Skip to content

Commit 6ffa82f

Browse files
committed
Bump alloy to 0.8.0
1 parent 36c0142 commit 6ffa82f

File tree

10 files changed

+243
-232
lines changed

10 files changed

+243
-232
lines changed

Cargo.lock

+95-95
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+39-39
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ reth-ethereum-consensus = { path = "crates/ethereum/consensus" }
343343
reth-ethereum-engine-primitives = { path = "crates/ethereum/engine-primitives" }
344344
reth-ethereum-forks = { path = "crates/ethereum-forks", default-features = false }
345345
reth-ethereum-payload-builder = { path = "crates/ethereum/payload" }
346-
reth-ethereum-primitives = { path = "crates/ethereum/primitives", default-features = false }
346+
reth-ethereum-primitives = { path = "crates/ethereum/primitives", default-features = false }
347347
reth-etl = { path = "crates/etl" }
348348
reth-evm = { path = "crates/evm" }
349349
reth-evm-ethereum = { path = "crates/ethereum/evm" }
@@ -427,58 +427,58 @@ reth-zstd-compressors = { path = "crates/storage/zstd-compressors", default-feat
427427

428428
# revm
429429
revm = { version = "18.0.0", features = ["std"], default-features = false }
430-
revm-inspectors = "0.12.0"
430+
revm-inspectors = "0.13.0"
431431
revm-primitives = { version = "14.0.0", default-features = false }
432432

433433
# eth
434434
alloy-chains = { version = "0.1.32", default-features = false }
435-
alloy-dyn-abi = "0.8.11"
436-
alloy-primitives = { version = "0.8.11", default-features = false }
435+
alloy-dyn-abi = "0.8.15"
436+
alloy-primitives = { version = "0.8.15", default-features = false }
437437
alloy-rlp = { version = "0.3.10", default-features = false }
438-
alloy-sol-types = "0.8.11"
438+
alloy-sol-types = "0.8.15"
439439
alloy-trie = { version = "0.7", default-features = false }
440440

441-
alloy-consensus = { version = "0.7.3", default-features = false }
442-
alloy-contract = { version = "0.7.3", default-features = false }
443-
alloy-eips = { version = "0.7.3", default-features = false }
444-
alloy-genesis = { version = "0.7.3", default-features = false }
445-
alloy-json-rpc = { version = "0.7.3", default-features = false }
446-
alloy-network = { version = "0.7.3", default-features = false }
447-
alloy-network-primitives = { version = "0.7.3", default-features = false }
448-
alloy-node-bindings = { version = "0.7.3", default-features = false }
449-
alloy-provider = { version = "0.7.3", features = [
441+
alloy-consensus = { version = "0.8.0", default-features = false }
442+
alloy-contract = { version = "0.8.0", default-features = false }
443+
alloy-eips = { version = "0.8.0", default-features = false }
444+
alloy-genesis = { version = "0.8.0", default-features = false }
445+
alloy-json-rpc = { version = "0.8.0", default-features = false }
446+
alloy-network = { version = "0.8.0", default-features = false }
447+
alloy-network-primitives = { version = "0.8.0", default-features = false }
448+
alloy-node-bindings = { version = "0.8.0", default-features = false }
449+
alloy-provider = { version = "0.8.0", features = [
450450
"reqwest",
451451
], default-features = false }
452-
alloy-pubsub = { version = "0.7.3", default-features = false }
453-
alloy-rpc-client = { version = "0.7.3", default-features = false }
454-
alloy-rpc-types = { version = "0.7.3", features = [
452+
alloy-pubsub = { version = "0.8.0", default-features = false }
453+
alloy-rpc-client = { version = "0.8.0", default-features = false }
454+
alloy-rpc-types = { version = "0.8.0", features = [
455455
"eth",
456456
], default-features = false }
457-
alloy-rpc-types-admin = { version = "0.7.3", default-features = false }
458-
alloy-rpc-types-anvil = { version = "0.7.3", default-features = false }
459-
alloy-rpc-types-beacon = { version = "0.7.3", default-features = false }
460-
alloy-rpc-types-debug = { version = "0.7.3", default-features = false }
461-
alloy-rpc-types-engine = { version = "0.7.3", default-features = false }
462-
alloy-rpc-types-eth = { version = "0.7.3", default-features = false }
463-
alloy-rpc-types-mev = { version = "0.7.3", default-features = false }
464-
alloy-rpc-types-trace = { version = "0.7.3", default-features = false }
465-
alloy-rpc-types-txpool = { version = "0.7.3", default-features = false }
466-
alloy-serde = { version = "0.7.3", default-features = false }
467-
alloy-signer = { version = "0.7.3", default-features = false }
468-
alloy-signer-local = { version = "0.7.3", default-features = false }
469-
alloy-transport = { version = "0.7.3" }
470-
alloy-transport-http = { version = "0.7.3", features = [
457+
alloy-rpc-types-admin = { version = "0.8.0", default-features = false }
458+
alloy-rpc-types-anvil = { version = "0.8.0", default-features = false }
459+
alloy-rpc-types-beacon = { version = "0.8.0", default-features = false }
460+
alloy-rpc-types-debug = { version = "0.8.0", default-features = false }
461+
alloy-rpc-types-engine = { version = "0.8.0", default-features = false }
462+
alloy-rpc-types-eth = { version = "0.8.0", default-features = false }
463+
alloy-rpc-types-mev = { version = "0.8.0", default-features = false }
464+
alloy-rpc-types-trace = { version = "0.8.0", default-features = false }
465+
alloy-rpc-types-txpool = { version = "0.8.0", default-features = false }
466+
alloy-serde = { version = "0.8.0", default-features = false }
467+
alloy-signer = { version = "0.8.0", default-features = false }
468+
alloy-signer-local = { version = "0.8.0", default-features = false }
469+
alloy-transport = { version = "0.8.0" }
470+
alloy-transport-http = { version = "0.8.0", features = [
471471
"reqwest-rustls-tls",
472472
], default-features = false }
473-
alloy-transport-ipc = { version = "0.7.3", default-features = false }
474-
alloy-transport-ws = { version = "0.7.3", default-features = false }
473+
alloy-transport-ipc = { version = "0.8.0", default-features = false }
474+
alloy-transport-ws = { version = "0.8.0", default-features = false }
475475

476476
# op
477-
op-alloy-rpc-types = "0.7.3"
478-
op-alloy-rpc-types-engine = "0.7.3"
479-
op-alloy-rpc-jsonrpsee = "0.7.3"
480-
op-alloy-network = "0.7.3"
481-
op-alloy-consensus = "0.7.3"
477+
op-alloy-rpc-types = "0.8.0"
478+
op-alloy-rpc-types-engine = "0.8.0"
479+
op-alloy-rpc-jsonrpsee = "0.8.0"
480+
op-alloy-network = "0.8.0"
481+
op-alloy-consensus = "0.8.0"
482482

483483
# misc
484484
aquamarine = "0.6"
@@ -495,7 +495,7 @@ cfg-if = "1.0"
495495
clap = "4"
496496
const_format = { version = "0.2.32", features = ["rust_1_64"] }
497497
dashmap = "6.0"
498-
derive_more = { version = "1", default-features = false, features = ["full"] }
498+
derive_more = { version = "1", default-features = false, features = ["full"] }
499499
dyn-clone = "1.0.17"
500500
eyre = "0.6"
501501
fdlimit = "0.3.0"

crates/net/eth-wire-types/src/broadcast.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use alloy_rlp::{
88
use derive_more::{Constructor, Deref, DerefMut, From, IntoIterator};
99
use reth_codecs_derive::{add_arbitrary_tests, generate_tests};
1010
use reth_primitives::TransactionSigned;
11-
use reth_primitives_traits::{SignedTransaction, Transaction};
11+
use reth_primitives_traits::SignedTransaction;
1212
use std::{
1313
collections::{HashMap, HashSet},
1414
mem,
@@ -38,7 +38,7 @@ impl NewBlockHashes {
3838
pub fn latest(&self) -> Option<&BlockHashNumber> {
3939
self.0.iter().fold(None, |latest, block| {
4040
if let Some(latest) = latest {
41-
return if latest.number > block.number { Some(latest) } else { Some(block) }
41+
return if latest.number > block.number { Some(latest) } else { Some(block) };
4242
}
4343
Some(block)
4444
})
@@ -432,13 +432,13 @@ impl Decodable for NewPooledTransactionHashes68 {
432432
return Err(alloy_rlp::Error::ListLengthMismatch {
433433
expected: msg.hashes.len(),
434434
got: msg.types.len(),
435-
})
435+
});
436436
}
437437
if msg.hashes.len() != msg.sizes.len() {
438438
return Err(alloy_rlp::Error::ListLengthMismatch {
439439
expected: msg.hashes.len(),
440440
got: msg.sizes.len(),
441-
})
441+
});
442442
}
443443

444444
Ok(msg)
@@ -711,15 +711,15 @@ impl RequestTxHashes {
711711
pub fn retain_count(&mut self, count: usize) -> Self {
712712
let rest_capacity = self.hashes.len().saturating_sub(count);
713713
if rest_capacity == 0 {
714-
return Self::empty()
714+
return Self::empty();
715715
}
716716
let mut rest = Self::with_capacity(rest_capacity);
717717

718718
let mut i = 0;
719719
self.hashes.retain(|hash| {
720720
if i >= count {
721721
rest.insert(*hash);
722-
return false
722+
return false;
723723
}
724724
i += 1;
725725

crates/optimism/primitives/src/transaction/mod.rs

+7-5
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use alloy_primitives::{bytes, Bytes, TxKind, Uint, B256};
77

88
#[cfg(any(test, feature = "reth-codec"))]
99
use alloy_consensus::constants::EIP7702_TX_TYPE_ID;
10-
use alloy_consensus::{SignableTransaction, TxLegacy};
10+
use alloy_consensus::{SignableTransaction, TxLegacy, Typed2718};
1111
use alloy_eips::{eip2930::AccessList, eip7702::SignedAuthorization};
1212
use derive_more::{Constructor, Deref, From};
1313
use op_alloy_consensus::OpTypedTransaction;
@@ -157,10 +157,6 @@ impl alloy_consensus::Transaction for OpTransaction {
157157
self.0.input()
158158
}
159159

160-
fn ty(&self) -> u8 {
161-
self.0.ty()
162-
}
163-
164160
fn access_list(&self) -> Option<&AccessList> {
165161
self.0.access_list()
166162
}
@@ -197,3 +193,9 @@ impl InMemorySize for OpTransaction {
197193
}
198194
}
199195
}
196+
197+
impl Typed2718 for OpTransaction {
198+
fn ty(&self) -> u8 {
199+
self.0.ty()
200+
}
201+
}

crates/optimism/primitives/src/transaction/signed.rs

+15-12
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use crate::{OpTransaction, OpTxType};
44
use alloc::vec::Vec;
55
use alloy_consensus::{
66
transaction::RlpEcdsaTx, SignableTransaction, Transaction, TxEip1559, TxEip2930, TxEip7702,
7+
Typed2718,
78
};
89
use alloy_eips::{
910
eip2718::{Decodable2718, Eip2718Error, Eip2718Result, Encodable2718},
@@ -83,7 +84,7 @@ impl SignedTransaction for OpTransactionSigned {
8384
// Optimism's Deposit transaction does not have a signature. Directly return the
8485
// `from` address.
8586
if let OpTypedTransaction::Deposit(TxDeposit { from, .. }) = *self.transaction {
86-
return Some(from)
87+
return Some(from);
8788
}
8889

8990
let Self { transaction, signature, .. } = self;
@@ -95,7 +96,7 @@ impl SignedTransaction for OpTransactionSigned {
9596
// Optimism's Deposit transaction does not have a signature. Directly return the
9697
// `from` address.
9798
if let OpTypedTransaction::Deposit(TxDeposit { from, .. }) = *self.transaction {
98-
return Some(from)
99+
return Some(from);
99100
}
100101

101102
let Self { transaction, signature, .. } = self;
@@ -107,7 +108,7 @@ impl SignedTransaction for OpTransactionSigned {
107108
// Optimism's Deposit transaction does not have a signature. Directly return the
108109
// `from` address.
109110
if let OpTypedTransaction::Deposit(TxDeposit { from, .. }) = *self.transaction {
110-
return Some(from)
111+
return Some(from);
111112
}
112113
self.encode_for_signing(buf);
113114
let signature_hash = keccak256(buf);
@@ -200,7 +201,7 @@ impl FillTxEnv for OpTransactionSigned {
200201
is_system_transaction: Some(tx.is_system_transaction),
201202
enveloped_tx: Some(envelope.into()),
202203
};
203-
return
204+
return;
204205
}
205206
}
206207

@@ -228,7 +229,7 @@ impl alloy_rlp::Encodable for OpTransactionSigned {
228229

229230
fn length(&self) -> usize {
230231
let mut payload_length = self.encode_2718_len();
231-
if !self.is_legacy() {
232+
if !Encodable2718::is_legacy(self) {
232233
payload_length += Header { list: false, payload_length }.length();
233234
}
234235

@@ -377,10 +378,6 @@ impl Transaction for OpTransactionSigned {
377378
self.deref().input()
378379
}
379380

380-
fn ty(&self) -> u8 {
381-
self.deref().ty()
382-
}
383-
384381
fn access_list(&self) -> Option<&AccessList> {
385382
self.deref().access_list()
386383
}
@@ -406,6 +403,12 @@ impl Transaction for OpTransactionSigned {
406403
}
407404
}
408405

406+
impl Typed2718 for OpTransactionSigned {
407+
fn ty(&self) -> u8 {
408+
self.tx_type() as u8
409+
}
410+
}
411+
409412
impl Default for OpTransactionSigned {
410413
fn default() -> Self {
411414
Self {
@@ -418,9 +421,9 @@ impl Default for OpTransactionSigned {
418421

419422
impl PartialEq for OpTransactionSigned {
420423
fn eq(&self, other: &Self) -> bool {
421-
self.signature == other.signature &&
422-
self.transaction == other.transaction &&
423-
self.tx_hash() == other.tx_hash()
424+
self.signature == other.signature
425+
&& self.transaction == other.transaction
426+
&& self.tx_hash() == other.tx_hash()
424427
}
425428
}
426429

crates/primitives/src/alloy_compat.rs

+17-18
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
use crate::{Block, BlockBody, Transaction, TransactionSigned};
44
use alloc::{string::ToString, vec::Vec};
5-
use alloy_consensus::{constants::EMPTY_TRANSACTIONS, Header, TxEnvelope};
5+
use alloy_consensus::{constants::EMPTY_TRANSACTIONS, Header, TxEnvelope, Typed2718};
66
use alloy_network::{AnyHeader, AnyRpcBlock, AnyRpcTransaction, AnyTxEnvelope};
77
use alloy_serde::WithOtherFields;
88
use op_alloy_rpc_types as _;
@@ -16,23 +16,22 @@ impl TryFrom<AnyRpcBlock> for Block {
1616
let block = block.inner;
1717

1818
let transactions = {
19-
let transactions: Result<Vec<TransactionSigned>, ConversionError> = match block
20-
.transactions
21-
{
22-
alloy_rpc_types::BlockTransactions::Full(transactions) => {
23-
transactions.into_iter().map(|tx| tx.try_into()).collect()
24-
}
25-
alloy_rpc_types::BlockTransactions::Hashes(_) |
26-
alloy_rpc_types::BlockTransactions::Uncle => {
27-
// alloy deserializes empty blocks into `BlockTransactions::Hashes`, if the tx
28-
// root is the empty root then we can just return an empty vec.
29-
if block.header.transactions_root == EMPTY_TRANSACTIONS {
30-
Ok(Vec::new())
31-
} else {
32-
Err(ConversionError::Custom("missing transactions".to_string()))
19+
let transactions: Result<Vec<TransactionSigned>, ConversionError> =
20+
match block.transactions {
21+
alloy_rpc_types::BlockTransactions::Full(transactions) => {
22+
transactions.into_iter().map(|tx| tx.try_into()).collect()
3323
}
34-
}
35-
};
24+
alloy_rpc_types::BlockTransactions::Hashes(_)
25+
| alloy_rpc_types::BlockTransactions::Uncle => {
26+
// alloy deserializes empty blocks into `BlockTransactions::Hashes`, if the tx
27+
// root is the empty root then we can just return an empty vec.
28+
if block.header.transactions_root == EMPTY_TRANSACTIONS {
29+
Ok(Vec::new())
30+
} else {
31+
Err(ConversionError::Custom("missing transactions".to_string()))
32+
}
33+
}
34+
};
3635
transactions?
3736
};
3837

@@ -152,7 +151,7 @@ impl TryFrom<AnyRpcTransaction> for TransactionSigned {
152151
hash,
153152
)
154153
} else {
155-
return Err(ConversionError::Custom("unknown transaction type".to_string()))
154+
return Err(ConversionError::Custom("unknown transaction type".to_string()));
156155
}
157156
}
158157
_ => return Err(ConversionError::Custom("unknown transaction type".to_string())),

0 commit comments

Comments
 (0)