-
Notifications
You must be signed in to change notification settings - Fork 990
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
PIBD segment p2p messages #3496
Conversation
#3482 is now merged. |
👀 |
Message::OutputBitmapSegment(_) | ||
| Message::OutputSegment(_) | ||
| Message::RangeProofSegment(_) | ||
| Message::KernelSegment(_) => Consumed::None, | ||
|
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.
This is just a /dev/null
placeholder for now?
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.
Yes, nodes receiving segments just ignore them.
servers/src/common/adapters.rs
Outdated
hash: Hash, | ||
id: SegmentIdentifier, | ||
) -> Result<Segment<TxKernel>, chain::Error> { | ||
if id.height < 9 || id.height > 13 { |
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.
We should pull these min and max heights out into const
so its easier to see them all together.
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.
Done
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.
Looks good. 👍
Minor comment about the min/max values.
@@ -46,6 +46,12 @@ use crate::util::OneTime; | |||
use chrono::prelude::*; | |||
use chrono::Duration; | |||
use rand::prelude::*; | |||
use std::ops::Range; | |||
|
|||
const KERNEL_SEGMENT_HEIGHT_RANGE: Range<u8> = 9..14; |
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.
Nice. Didn't think of using ranges here. 👍
* Define PIBD segment p2p messages * Respond to segment requests * Use specialized (de)ser for output bitmap segments * Allowed segment height ranges in const
This PR introduces the new p2p messages as defined in this RFC. Only merge after #3482 and #3492.
Until then we use a placeholder
Segmenter
that just panics on usage.Enforce segment height limitsRebase once 3482 is mergedSwitch toBitmapSegment
in place ofSegment<BitmapChunk>
inOutputBitmapSegment
responses