Merge branch 'eip4844' into deneb-free-blobs

This commit is contained in:
Diva M
2023-03-17 16:39:17 -05:00
27 changed files with 861 additions and 1034 deletions

View File

@@ -409,10 +409,14 @@ impl ProtocolId {
/// beginning of the stream, else returns `false`.
pub fn has_context_bytes(&self) -> bool {
match self.message_name {
Protocol::BlocksByRange | Protocol::BlocksByRoot => {
!matches!(self.version, Version::V1)
}
Protocol::BlobsByRange | Protocol::BlobsByRoot | Protocol::LightClientBootstrap => true,
Protocol::BlocksByRange | Protocol::BlocksByRoot => match self.version {
Version::V2 => true,
Version::V1 => false,
},
Protocol::LightClientBootstrap => match self.version {
Version::V2 | Version::V1 => true,
},
Protocol::BlobsByRoot | Protocol::BlobsByRange => true,
Protocol::Goodbye | Protocol::Ping | Protocol::Status | Protocol::MetaData => false,
}
}