-
Notifications
You must be signed in to change notification settings - Fork 203
Update SyncResponse to be verifiable #8323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
72463f9
cf3c383
1e1c95c
1ec161e
05e6fa9
4d6fa69
5e48913
f856380
3d6b0c5
6d9ca64
d14aaee
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -117,7 +117,7 @@ func New( | |||||||||
| return nil, fmt.Errorf("could not register engine: %w", err) | ||||||||||
| } | ||||||||||
| e.con = con | ||||||||||
| e.requestHandler = NewRequestHandler(log, metrics, NewResponseSender(con), me, finalizedHeaderCache, blocks, core, true) | ||||||||||
| e.requestHandler = NewRequestHandler(log, metrics, NewResponseSender(con), me, state, finalizedHeaderCache, blocks, core, true) | ||||||||||
|
|
||||||||||
| // set up worker routines | ||||||||||
| builder := component.NewComponentManagerBuilder(). | ||||||||||
|
|
@@ -296,7 +296,12 @@ func (e *Engine) processAvailableResponses(ctx context.Context) { | |||||||||
| func (e *Engine) onSyncResponse(originID flow.Identifier, res *flow.SyncResponse) { | ||||||||||
| e.log.Debug().Str("origin_id", originID.String()).Msg("received sync response") | ||||||||||
| final := e.finalizedHeaderCache.Get() | ||||||||||
| e.core.HandleHeight(final, res.Height) | ||||||||||
| // backwards compatibility - ignore the Header/QC if they are not present, and use Height field instead | ||||||||||
| if res.Header.Height == 0 { | ||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you verify two test cases:
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unfortunately:
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So it means, new node can fetch blocks from old node, but old node can not fetch blocks from new node. I think this is probably ok, and we can still roll it out. Because when rolling out, most of the old nodes are all up to date, they don't need to sync blocks from other peers, once an old node is restarted, it becomes new node, and can still fetch blocks from old nodes or other new nodes. |
||||||||||
| e.core.HandleHeight(final, res.Height) | ||||||||||
| } else { | ||||||||||
| e.core.HandleHeight(final, res.Header.Height) | ||||||||||
| } | ||||||||||
| } | ||||||||||
tim-barry marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
|
|
||||||||||
| // onBlockResponse processes a structurally validated block proposal containing a specifically requested block response. | ||||||||||
|
|
||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be a breaking change, and require all the peers to upgrade, right?
I wonder if we can keep the
Heightfield to be backward compatible, so that this change can be rolled out.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it would be breaking; I think we could keep the Height field for now (with the Height field and current code path being used if and only if the Header/QC is empty)