diff --git a/Cargo.toml b/Cargo.toml index 4d8950ff..59613200 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -45,16 +45,16 @@ op-alloy-rpc-jsonrpsee = { version = "0.9.6", path = "crates/rpc-jsonrpsee", def op-alloy-flz = { version = "0.9.6", path = "crates/flz", default-features = false } # Alloy -alloy-eips = { version = "0.9.2", default-features = false } -alloy-serde = { version = "0.9.2", default-features = false } -alloy-signer = { version = "0.9.2", default-features = false } -alloy-network = { version = "0.9.2", default-features = false } -alloy-provider = { version = "0.9.2", default-features = false } -alloy-transport = { version = "0.9.2", default-features = false } -alloy-consensus = { version = "0.9.2", default-features = false } -alloy-rpc-types-eth = { version = "0.9.2", default-features = false } -alloy-rpc-types-engine = { version = "0.9.2", default-features = false } -alloy-network-primitives = { version = "0.9.2", default-features = false } +alloy-eips = { version = "0.11", default-features = false } +alloy-serde = { version = "0.11", default-features = false } +alloy-signer = { version = "0.11", default-features = false } +alloy-network = { version = "0.11", default-features = false } +alloy-provider = { version = "0.11", default-features = false } +alloy-transport = { version = "0.11", default-features = false } +alloy-consensus = { version = "0.11", default-features = false } +alloy-rpc-types-eth = { version = "0.11", default-features = false } +alloy-rpc-types-engine = { version = "0.11", default-features = false } +alloy-network-primitives = { version = "0.11", default-features = false } # Alloy RLP alloy-rlp = { version = "0.3", default-features = false } @@ -116,14 +116,13 @@ c-kzg = { version = "1.0", default-features = false } k256 = { version = "0.13", default-features = false, features = ["ecdsa"] } [patch.crates-io] -#alloy-consensus = { git = "https://github.com/alloy-rs/alloy", rev = "7ba1bff" } -#alloy-network = { git = "https://github.com/alloy-rs/alloy", rev = "7ba1bff" } -#alloy-network-primitives = { git = "https://github.com/alloy-rs/alloy", rev = "7ba1bff" } -#alloy-rpc-types = { git = "https://github.com/alloy-rs/alloy", rev = "7ba1bff" } -#alloy-rpc-types-eth = { git = "https://github.com/alloy-rs/alloy", rev = "7ba1bff" } -#alloy-rpc-types-engine = { git = "https://github.com/alloy-rs/alloy", rev = "7ba1bff" } -#alloy-eips = { git = "https://github.com/alloy-rs/alloy", rev = "7ba1bff" } -#alloy-serde = { git = "https://github.com/alloy-rs/alloy", rev = "7ba1bff" } -#alloy-signer = { git = "https://github.com/alloy-rs/alloy", rev = "7ba1bff" } -#alloy-provider = { git = "https://github.com/alloy-rs/alloy", rev = "7ba1bff" } -#alloy-transport = { git = "https://github.com/alloy-rs/alloy", rev = "7ba1bff" } +#alloy-consensus = { git = "https://github.com/alloy-rs/alloy", rev = "cfb13aa" } +#alloy-network = { git = "https://github.com/alloy-rs/alloy", rev = "cfb13aa" } +#alloy-network-primitives = { git = "https://github.com/alloy-rs/alloy", rev = "cfb13aa" } +#alloy-rpc-types-eth = { git = "https://github.com/alloy-rs/alloy", rev = "cfb13aa" } +#alloy-rpc-types-engine = { git = "https://github.com/alloy-rs/alloy", rev = "cfb13aa" } +#alloy-eips = { git = "https://github.com/alloy-rs/alloy", rev = "cfb13aa" } +#alloy-serde = { git = "https://github.com/alloy-rs/alloy", rev = "cfb13aa" } +#alloy-signer = { git = "https://github.com/alloy-rs/alloy", rev = "cfb13aa" } +#alloy-provider = { git = "https://github.com/alloy-rs/alloy", rev = "cfb13aa" } +#alloy-transport = { git = "https://github.com/alloy-rs/alloy", rev = "cfb13aa" } diff --git a/crates/consensus/src/receipt/envelope.rs b/crates/consensus/src/receipt/envelope.rs index b321e81a..e95162c3 100644 --- a/crates/consensus/src/receipt/envelope.rs +++ b/crates/consensus/src/receipt/envelope.rs @@ -3,7 +3,10 @@ use crate::{OpDepositReceipt, OpDepositReceiptWithBloom, OpTxType}; use alloc::vec::Vec; use alloy_consensus::{Eip658Value, Receipt, ReceiptWithBloom, TxReceipt}; -use alloy_eips::eip2718::{Decodable2718, Eip2718Error, Eip2718Result, Encodable2718}; +use alloy_eips::{ + eip2718::{Decodable2718, Eip2718Error, Eip2718Result, Encodable2718}, + Typed2718, +}; use alloy_primitives::{logs_bloom, Bloom, Log}; use alloy_rlp::{length_of_length, BufMut, Decodable, Encodable}; @@ -247,17 +250,20 @@ impl Decodable for OpReceiptEnvelope { } } -impl Encodable2718 for OpReceiptEnvelope { - fn type_flag(&self) -> Option { - match self { - Self::Legacy(_) => None, - Self::Eip2930(_) => Some(OpTxType::Eip2930 as u8), - Self::Eip1559(_) => Some(OpTxType::Eip1559 as u8), - Self::Eip7702(_) => Some(OpTxType::Eip7702 as u8), - Self::Deposit(_) => Some(OpTxType::Deposit as u8), - } +impl Typed2718 for OpReceiptEnvelope { + fn ty(&self) -> u8 { + let ty = match self { + Self::Legacy(_) => OpTxType::Legacy, + Self::Eip2930(_) => OpTxType::Eip2930, + Self::Eip1559(_) => OpTxType::Eip1559, + Self::Eip7702(_) => OpTxType::Eip7702, + Self::Deposit(_) => OpTxType::Deposit, + }; + ty as u8 } +} +impl Encodable2718 for OpReceiptEnvelope { fn encode_2718_len(&self) -> usize { self.inner_length() + !self.is_legacy() as usize } @@ -327,24 +333,27 @@ mod tests { let expected = hex!("f901668001b9010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f85ff85d940000000000000000000000000000000000000011f842a0000000000000000000000000000000000000000000000000000000000000deada0000000000000000000000000000000000000000000000000000000000000beef830100ff"); let mut data = vec![]; - let receipt = - OpReceiptEnvelope::Legacy(ReceiptWithBloom { - receipt: Receipt { - status: false.into(), - cumulative_gas_used: 0x1, - logs: vec![Log { - address: address!("0000000000000000000000000000000000000011"), - data: LogData::new_unchecked( - vec![ - b256!("000000000000000000000000000000000000000000000000000000000000dead"), - b256!("000000000000000000000000000000000000000000000000000000000000beef"), - ], - bytes!("0100ff"), - ), - }], - }, - logs_bloom: [0; 256].into(), - }); + let receipt = OpReceiptEnvelope::Legacy(ReceiptWithBloom { + receipt: Receipt { + status: false.into(), + cumulative_gas_used: 0x1, + logs: vec![Log { + address: address!("0000000000000000000000000000000000000011"), + data: LogData::new_unchecked( + vec![ + b256!( + "000000000000000000000000000000000000000000000000000000000000dead" + ), + b256!( + "000000000000000000000000000000000000000000000000000000000000beef" + ), + ], + bytes!("0100ff"), + ), + }], + }, + logs_bloom: [0; 256].into(), + }); receipt.network_encode(&mut data); diff --git a/crates/consensus/src/transaction/pooled.rs b/crates/consensus/src/transaction/pooled.rs index d3ee5943..9e5ffc7a 100644 --- a/crates/consensus/src/transaction/pooled.rs +++ b/crates/consensus/src/transaction/pooled.rs @@ -73,7 +73,7 @@ impl OpPooledTransaction { /// length of the header + the length of the type flag and inner encoding. fn network_len(&self) -> usize { let mut payload_length = self.encode_2718_len(); - if !Encodable2718::is_legacy(self) { + if !self.is_legacy() { payload_length += Header { list: false, payload_length }.length(); } diff --git a/crates/provider/src/ext/engine.rs b/crates/provider/src/ext/engine.rs index 4440c9da..5bf074eb 100644 --- a/crates/provider/src/ext/engine.rs +++ b/crates/provider/src/ext/engine.rs @@ -184,7 +184,7 @@ impl OpEngineApi for P where N: Network, T: Transport + Clone, - P: Provider, + P: Provider, { async fn new_payload_v2( &self, diff --git a/crates/rpc-types/src/receipt.rs b/crates/rpc-types/src/receipt.rs index dd274d50..2bbd99b6 100644 --- a/crates/rpc-types/src/receipt.rs +++ b/crates/rpc-types/src/receipt.rs @@ -67,10 +67,6 @@ impl alloy_network_primitives::ReceiptResponse for OpTransactionReceipt { self.inner.to() } - fn authorization_list(&self) -> Option<&[alloy_eips::eip7702::SignedAuthorization]> { - self.inner.authorization_list() - } - fn cumulative_gas_used(&self) -> u64 { self.inner.cumulative_gas_used() }