-
Notifications
You must be signed in to change notification settings - Fork 945
Less fork choice #679
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
Merged
Merged
Less fork choice #679
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
7df1497
Try merge in change to reduce fork choice calls
paulhauner 68e2206
Merge branch 'sync-load-balancing' into less-fork-choice
paulhauner 87fdac9
Remove fork choice from process block
paulhauner 0d0b2af
Minor log fix
paulhauner dfc0c05
Check successes > 0
paulhauner 03febae
Fix failing beacon chain tests
paulhauner 11cf9a6
Fix re-org warnings
paulhauner 97a9ec5
Fix mistake in prev commit
paulhauner 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 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,7 +6,7 @@ use beacon_chain::{ | |
| use eth2_libp2p::rpc::methods::*; | ||
| use eth2_libp2p::rpc::{RPCEvent, RPCRequest, RPCResponse, RequestId}; | ||
| use eth2_libp2p::PeerId; | ||
| use slog::{debug, o, trace, warn}; | ||
| use slog::{debug, error, o, trace, warn}; | ||
| use ssz::Encode; | ||
| use std::sync::Arc; | ||
| use store::Store; | ||
|
|
@@ -438,6 +438,27 @@ impl<T: BeaconChainTypes> MessageProcessor<T> { | |
| BlockProcessingOutcome::Processed { .. } => { | ||
| trace!(self.log, "Gossipsub block processed"; | ||
| "peer_id" => format!("{:?}",peer_id)); | ||
|
|
||
| // TODO: It would be better if we can run this _after_ we publish the block to | ||
| // reduce block propagation latency. | ||
| // | ||
| // The `MessageHandler` would be the place to put this, however it doesn't seem | ||
| // to have a reference to the `BeaconChain`. I will leave this for future | ||
| // works. | ||
|
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. Yeah agreed. The threading will be refactored in the network re-write. Will deal with this then |
||
| match self.chain.fork_choice() { | ||
| Ok(()) => trace!( | ||
| self.log, | ||
| "Fork choice success"; | ||
| "location" => "block gossip" | ||
| ), | ||
| Err(e) => error!( | ||
| self.log, | ||
| "Fork choice failed"; | ||
| "error" => format!("{:?}", e), | ||
| "location" => "block gossip" | ||
| ), | ||
| } | ||
|
|
||
| SHOULD_FORWARD_GOSSIP_BLOCK | ||
| } | ||
| BlockProcessingOutcome::ParentUnknown { .. } => { | ||
|
|
||
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.
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.
@Age please confirm
breakis equivalent toreturnhere and belowThere 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.
We want the break, so we can optionally run fork choice.. but we only want to run fork choice if we have processed a block.
You need to check if successes > 0, which it looks like you have forgotten