Skip to content

Commit

Permalink
chore: remove rlp encoding for Request (alloy-rs#751)
Browse files Browse the repository at this point in the history
the EIP was a bit ambigious here, apparently we are not
supposed to also RLP encode the result of the
EIP-7685 encoding. instead, to compute the request root,
we should just stuff the EIP-7685 encoded request
into a list and RLP encode that list

this simply removes the unneeded RLP encoding
  • Loading branch information
onbjerg authored and ben186 committed Jul 27, 2024
1 parent 6dd70a1 commit a724e1e
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions crates/consensus/src/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use alloy_eips::{
eip7002::WithdrawalRequest,
eip7685::{Decodable7685, Eip7685Error, Encodable7685},
};
use alloy_rlp::{Decodable, Encodable, Header};
use alloy_rlp::{Decodable, Encodable};

/// Ethereum execution layer requests.
///
Expand Down Expand Up @@ -92,16 +92,3 @@ impl Decodable7685 for Request {
})
}
}

impl Encodable for Request {
fn encode(&self, out: &mut dyn alloy_rlp::BufMut) {
self.encoded_7685().encode(out)
}
}

impl Decodable for Request {
fn decode(buf: &mut &[u8]) -> alloy_rlp::Result<Self> {
let mut data = Header::decode_bytes(buf, false)?;
Ok(Self::decode_7685(&mut data)?)
}
}

0 comments on commit a724e1e

Please sign in to comment.