From 8e2ba649e496af7db16d6918f5db0e7ea3a3716d Mon Sep 17 00:00:00 2001 From: zerosnacks Date: Fri, 25 Oct 2024 12:09:31 +0200 Subject: [PATCH 1/3] mark legacy transaction type as 0x0 or Some(0) rather than None --- crates/anvil/core/src/eth/transaction/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/anvil/core/src/eth/transaction/mod.rs b/crates/anvil/core/src/eth/transaction/mod.rs index 88e7f2765f32..11f0fe9a819d 100644 --- a/crates/anvil/core/src/eth/transaction/mod.rs +++ b/crates/anvil/core/src/eth/transaction/mod.rs @@ -300,7 +300,7 @@ pub fn to_alloy_transaction_with_hash_and_sender( y_parity: None, }), access_list: None, - transaction_type: None, + transaction_type: Some(0), max_fee_per_blob_gas: None, blob_versioned_hashes: None, authorization_list: None, @@ -1564,7 +1564,7 @@ impl Decodable for TypedReceipt { impl Encodable2718 for TypedReceipt { fn type_flag(&self) -> Option { match self { - Self::Legacy(_) => None, + Self::Legacy(_) => Some(0), Self::EIP2930(_) => Some(1), Self::EIP1559(_) => Some(2), Self::EIP4844(_) => Some(3), From 1074a00747097ccd9c5c381df7ce1aa831744bdb Mon Sep 17 00:00:00 2001 From: zerosnacks Date: Fri, 25 Oct 2024 12:17:47 +0200 Subject: [PATCH 2/3] return as Some(0) for legacy tx --- crates/anvil/core/src/eth/transaction/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/anvil/core/src/eth/transaction/mod.rs b/crates/anvil/core/src/eth/transaction/mod.rs index 11f0fe9a819d..9987f0c8012d 100644 --- a/crates/anvil/core/src/eth/transaction/mod.rs +++ b/crates/anvil/core/src/eth/transaction/mod.rs @@ -755,7 +755,7 @@ impl TypedTransaction { /// Returns the transaction type pub fn r#type(&self) -> Option { match self { - Self::Legacy(_) => None, + Self::Legacy(_) => Some(0), Self::EIP2930(_) => Some(1), Self::EIP1559(_) => Some(2), Self::EIP4844(_) => Some(3), From aa7fc166833f5986cc98b6357dcfffad0b647b67 Mon Sep 17 00:00:00 2001 From: zerosnacks Date: Fri, 25 Oct 2024 13:34:57 +0200 Subject: [PATCH 3/3] revert Some(0) change per EIP-2718 spec --- crates/anvil/core/src/eth/transaction/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/anvil/core/src/eth/transaction/mod.rs b/crates/anvil/core/src/eth/transaction/mod.rs index 9987f0c8012d..827f14a55402 100644 --- a/crates/anvil/core/src/eth/transaction/mod.rs +++ b/crates/anvil/core/src/eth/transaction/mod.rs @@ -755,7 +755,7 @@ impl TypedTransaction { /// Returns the transaction type pub fn r#type(&self) -> Option { match self { - Self::Legacy(_) => Some(0), + Self::Legacy(_) => None, Self::EIP2930(_) => Some(1), Self::EIP1559(_) => Some(2), Self::EIP4844(_) => Some(3), @@ -1564,7 +1564,7 @@ impl Decodable for TypedReceipt { impl Encodable2718 for TypedReceipt { fn type_flag(&self) -> Option { match self { - Self::Legacy(_) => Some(0), + Self::Legacy(_) => None, Self::EIP2930(_) => Some(1), Self::EIP1559(_) => Some(2), Self::EIP4844(_) => Some(3),