This repository was archived by the owner on Nov 18, 2024. It is now read-only.
Draft
Conversation
gurghet
commented
Aug 6, 2021
src/blocks/send_block.rs
Outdated
|
|
||
| impl SendBlock { | ||
| pub const LEN: usize = 152; | ||
| pub const LEN: usize = 32+32+16+64+8; |
Contributor
Author
There was a problem hiding this comment.
This is never going to change, true, but I think it's clearer like this, each field its own number.
gurghet
commented
Aug 6, 2021
| debug_assert!(header.is_some()); | ||
| let header = header.unwrap(); | ||
| debug_assert_eq!(header.ext().block_type()?, BlockType::State); | ||
| if let Some(header) = header { |
Contributor
Author
There was a problem hiding this comment.
Could be without header in the bulk pull case
gak
reviewed
Aug 6, 2021
src/node/peer/messages.rs
Outdated
| ) -> anyhow::Result<()> { | ||
| // The rest of this connection will be a bunch of blocks without any headers. | ||
| if matches!(self.bootstrap_state, FrontierStream) { | ||
| panic!("Invalid bootstrap state transition FrontierStream => BulkPull"); |
Collaborator
There was a problem hiding this comment.
Probably planned, but just suggesting this be an Err because a peer can trigger this, right?
Contributor
Author
There was a problem hiding this comment.
Not sure, I'm moving stuff around right now. Could you elaborate anyways? I used panic because I thought this should be an irrecoverable programming error, the transition should not be even possible.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This adds bootstrap handling in a built-in way.
I'm publishing this as a draft PR as I'm not sure this should be merged (wanted to build a dedicated module for bootstrap) but I don't want to lose track of the progress so far.