feat: update revm 19 alloy 09 (#13594)

This commit is contained in:
Matthias Seitz
2024-12-30 19:49:39 +01:00
committed by GitHub
parent a6325c41e0
commit 0b135a2670
54 changed files with 273 additions and 341 deletions

View File

@ -19,7 +19,7 @@ use reth_codecs_derive::add_arbitrary_tests;
#[cfg_attr(feature = "test-utils", allow(unreachable_pub), visibility::make(pub))]
#[add_arbitrary_tests(crate, compact)]
pub(crate) struct Authorization {
chain_id: u64,
chain_id: U256,
address: Address,
nonce: u64,
}
@ -80,7 +80,7 @@ mod tests {
#[test]
fn test_roundtrip_compact_authorization_list_item() {
let authorization = AlloyAuthorization {
chain_id: 1u64,
chain_id: U256::from(1),
address: address!("dac17f958d2ee523a2206206994597c13d831ec7"),
nonce: 1,
}

View File

@ -58,7 +58,6 @@ pub(crate) struct Header {
#[reth_codecs(crate = "crate")]
pub(crate) struct HeaderExt {
requests_hash: Option<B256>,
target_blobs_per_block: Option<u64>,
}
impl HeaderExt {
@ -66,7 +65,7 @@ impl HeaderExt {
///
/// Required since [`Header`] uses `Option<HeaderExt>` as a field.
const fn into_option(self) -> Option<Self> {
if self.requests_hash.is_some() || self.target_blobs_per_block.is_some() {
if self.requests_hash.is_some() {
Some(self)
} else {
None
@ -79,7 +78,7 @@ impl Compact for AlloyHeader {
where
B: bytes::BufMut + AsMut<[u8]>,
{
let extra_fields = HeaderExt { requests_hash: self.requests_hash, target_blobs_per_block: self.target_blobs_per_block };
let extra_fields = HeaderExt { requests_hash: self.requests_hash };
let header = Header {
parent_hash: self.parent_hash,
@ -131,7 +130,6 @@ impl Compact for AlloyHeader {
parent_beacon_block_root: header.parent_beacon_block_root,
requests_hash: header.extra_fields.as_ref().and_then(|h| h.requests_hash),
extra_data: header.extra_data,
target_blobs_per_block: header.extra_fields.as_ref().and_then(|h| h.target_blobs_per_block),
};
(alloy_header, buf)
}
@ -190,7 +188,7 @@ mod tests {
#[test]
fn test_extra_fields() {
let mut header = HOLESKY_BLOCK;
header.extra_fields = Some(HeaderExt { requests_hash: Some(B256::random()), target_blobs_per_block: Some(3) });
header.extra_fields = Some(HeaderExt { requests_hash: Some(B256::random())});
let mut encoded_header = vec![];
let len = header.to_compact(&mut encoded_header);