This repository was archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Allow changing the behavior for imported blocks #5236
Merged
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
c31d416
Added option to disable default block announce
cecton ba360ca
Added on_block_imported on NetworkService
cecton f52a4c9
Update from parent 'origin/master' (no conflict)
cecton 61c5d4b
Update from parent 'origin/master' (conflicts)
cecton c1a3ede
Revert "Added on_block_imported on NetworkService"
cecton f76a080
Do not announce block if set to not announce block
cecton de2027b
Revert fix
cecton 9137f9e
Moving default announce block to NetworkConfig
cecton 7911167
WIP
cecton ee66173
WIP
cecton 2f111f0
Removing boolean in favor of explicit call
cecton 30d493f
Fixing tests
cecton be04bda
WIP
cecton 8f63872
WIP
cecton 6404281
increase spec_version
cecton 779215f
Update from parent 'origin/master' (no conflict)
cecton 66d038d
Update from parent 'origin/master' (conflicts)
cecton 4a073a4
increase spec_version
cecton 19ea9f9
Update from parent 'origin/master' (no conflict)
cecton 875f4a3
Update from parent 'origin/master' (conflicts)
cecton 7aa6ee8
Fixed test
cecton 6a616d5
Fixing test
cecton 54403aa
Update from parent 'origin/master' (no conflict)
cecton c61ac54
Renamed should_announce_imported_blocks to announce_imported_blocks
cecton 96e6379
Updated assert_cmd
cecton 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
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.
TBH, seems that this function now does nothing unless the new block is best. Maybe it should be
fn on_best_block_imported(&mut self, header: &B::Header)Uh oh!
There was an error while loading. Please reload this page.
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.
But then we would need to reintroduce it if later we want to do something for non-best blocks.
I quite dislike that function to be honest, but its API seems to be "please call me when a block has been added to the client", and adding an "only if it is the new best block" clause seems even weirder and more error-prone to me.