-
Notifications
You must be signed in to change notification settings - Fork 836
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
Unify ChainSync
actions under one enum
#2180
Merged
Merged
Changes from 4 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
422fca4
Unify `ChainSync` actions under one enum
dmitry-markin 37a488a
minor: make `ImportBlocksAction` private
dmitry-markin f7d6893
Log actions in `SyncingEngine::process_chain_sync_actions`
dmitry-markin affd342
minor: comment
dmitry-markin b1f1fd0
Make no `ChainSync` methods return actions (except errors)
dmitry-markin 11f8d87
Make `on_state_data` push actions directly to `self.actions`
dmitry-markin fc41efd
Make `restart` push actions directly to `self.actions`
dmitry-markin 857a15d
Merge remote-tracking branch 'origin/master' into dm-chainsync-action
dmitry-markin cbee72a
Update tests
dmitry-markin 5af81db
Merge remote-tracking branch 'origin/master' into dm-chainsync-action
dmitry-markin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Why is this not happening inside of
validate_and_queue_blocks
?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.
Fixed — now all actions are pushed at the place they are generated. Except
BadPeer
errors — those are sometime deferred until the function returns to simplify the error handling.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.
Well, actually there is one function left returning actions —
new_peer_inner
. But we need to track inrestart
that it is not requesting any actions to cancel obsolete requests, so it's hard to make it not return actions.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.
Still need to fix tests 🙈
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.
Now unit tests are not that unit anymore due to results ending up in
self.actions
...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.
The tests are updated, but they became uglier because of the need to track actions pushed into
self.actions
instead of just checking return values.@bkchr could you have a look again?
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.
I'm going to merge this to move forward, but we can revisit these changes later if you know better ways of testing structs with an output queue.