Repository navigation
Add network identifier check on startup - #384
Merged
Merged
Conversation
Jannis
suggested changes
Sep 19, 2018
| // Network is in database and has identifiers | ||
| Some((Some(last_net_version), Some(last_genesis_block_hash))) => { | ||
| if last_net_version != new_net_version { | ||
| panic!("Ethereum node provided net_version {}, but we expected {}. Did you change networks without changing the network name?", new_net_version, last_net_version); |
Contributor
There was a problem hiding this comment.
The two panic lines are a little too long. Can we break them up roughly like this?
panic!("Ethereum node provided net_version {}, \
but we expected {}. Did you change networks \
...);
Contributor
Author
There was a problem hiding this comment.
Oh, good catch. I guess cargo fmt doesn't remove all of my formatting obligations :)
… on startup Check that we are connected to the same Ethereum network as the last time this network name was used.
timmclean
force-pushed
the
tim/net-mistake
branch
from
September 19, 2018 13:40
a4b30ed to
cc26056
Compare
Jannis
approved these changes
Sep 19, 2018
Jannis
left a comment
Contributor
There was a problem hiding this comment.
Looks good now. I'll update Travis tomorrow to ignore failed builds with Rust beta.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Check that we are connected to the same Ethereum network as the last time this network name was used. Panic block ingestor if, for example, the user switches from mainnet to kovan but does not use a new network name.
add_network_if_missingwill be refactored away when the new block processing work gets merged in, but I'm sticking with that design for nowMaybe @nenadjaja could test this?
Closes #377