-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed as not planned
Labels
C-bugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorC-enhancementNew feature or requestNew feature or requestS-staleThis issue/PR is stale and will close with no further activityThis issue/PR is stale and will close with no further activity
Description
Describe the feature
these aren't symmetrical:
reth/crates/primitives-traits/src/block/sealed.rs
Lines 309 to 320 in d8e8d67
impl<B: Block> Encodable for SealedBlock<B> { | |
fn encode(&self, out: &mut dyn BufMut) { | |
self.body.encode(out); | |
} | |
} | |
impl<B: Block> Decodable for SealedBlock<B> { | |
fn decode(buf: &mut &[u8]) -> alloy_rlp::Result<Self> { | |
let block = B::decode(buf)?; | |
Ok(Self::seal_slow(block)) | |
} | |
} |
we need to fix this so that we encode the header then encode the block
a quick fix for this is .clone().into_block().encode
but this is a bit expensive.
it's a bit tricky because we'd need something like this to make this more efficient
reth/crates/primitives-traits/src/block/mod.rs
Lines 143 to 144 in d8e8d67
/// Returns the rlp length of the block with the given header and body. | |
fn rlp_length(header: &Self::Header, body: &Self::Body) -> usize; |
Additional context
No response
Metadata
Metadata
Assignees
Labels
C-bugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorC-enhancementNew feature or requestNew feature or requestS-staleThis issue/PR is stale and will close with no further activityThis issue/PR is stale and will close with no further activity
Type
Projects
Status
Done