Skip to content

Commit

Permalink
deps: bump alloy next
Browse files Browse the repository at this point in the history
  • Loading branch information
rkrasiuk committed Jan 31, 2025
1 parent 5b28b7b commit ad607c1
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 55 deletions.
41 changes: 20 additions & 21 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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.10", default-features = false }
alloy-serde = { version = "0.10", default-features = false }
alloy-signer = { version = "0.10", default-features = false }
alloy-network = { version = "0.10", default-features = false }
alloy-provider = { version = "0.10", default-features = false }
alloy-transport = { version = "0.10", default-features = false }
alloy-consensus = { version = "0.10", default-features = false }
alloy-rpc-types-eth = { version = "0.10", default-features = false }
alloy-rpc-types-engine = { version = "0.10", default-features = false }
alloy-network-primitives = { version = "0.10", default-features = false }

# Alloy RLP
alloy-rlp = { version = "0.3", default-features = false }
Expand Down Expand Up @@ -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" }
65 changes: 37 additions & 28 deletions crates/consensus/src/receipt/envelope.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};

Expand Down Expand Up @@ -247,17 +250,20 @@ impl Decodable for OpReceiptEnvelope {
}
}

impl Encodable2718 for OpReceiptEnvelope {
fn type_flag(&self) -> Option<u8> {
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
}
Expand Down Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion crates/consensus/src/transaction/pooled.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down
2 changes: 1 addition & 1 deletion crates/provider/src/ext/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ impl<N, T, P> OpEngineApi<N, T> for P
where
N: Network,
T: Transport + Clone,
P: Provider<T, N>,
P: Provider<N>,
{
async fn new_payload_v2(
&self,
Expand Down
4 changes: 0 additions & 4 deletions crates/rpc-types/src/receipt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down

0 comments on commit ad607c1

Please sign in to comment.