Skip to content
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
741 changes: 410 additions & 331 deletions Cargo.lock

Large diffs are not rendered by default.

122 changes: 62 additions & 60 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -438,69 +438,70 @@ reth-ress-protocol = { path = "crates/ress/protocol" }
reth-ress-provider = { path = "crates/ress/provider" }

# revm
revm = { version = "21.0.0", default-features = false }
revm-bytecode = { version = "2.0.0", default-features = false }
revm-database = { version = "2.0.0", default-features = false }
revm-state = { version = "2.0.0", default-features = false }
revm-primitives = { version = "17.0.0", default-features = false }
revm-interpreter = { version = "17.0.0", default-features = false }
revm-inspector = { version = "2.0.0", default-features = false }
revm-context = { version = "2.0.0", default-features = false }
revm-context-interface = { version = "2.0.0", default-features = false }
revm-database-interface = { version = "2.0.0", default-features = false }
op-revm = { version = "2.0.0", default-features = false }
revm-inspectors = "0.18.0"
revm = { version = "22.0.0", default-features = false }
revm-bytecode = { version = "3.0.0", default-features = false }
revm-database = { version = "3.0.0", default-features = false }
revm-state = { version = "3.0.0", default-features = false }
revm-primitives = { version = "18.0.0", default-features = false }
revm-interpreter = { version = "18.0.0", default-features = false }
revm-inspector = { version = "3.0.0", default-features = false }
revm-context = { version = "3.0.0", default-features = false }
revm-context-interface = { version = "3.0.0", default-features = false }
revm-database-interface = { version = "3.0.0", default-features = false }
op-revm = { version = "3.0.0", default-features = false }
revm-inspectors = "0.19.0"

# eth
alloy-chains = { version = "0.1.68", default-features = false }
alloy-dyn-abi = "0.8.25"
alloy-eip2124 = { version = "0.1.0", default-features = false }
alloy-evm = { version = "0.3.2", default-features = false }
alloy-primitives = { version = "0.8.25", default-features = false, features = ["map-foldhash"] }
alloy-chains = { version = "0.2.0", default-features = false }
alloy-dyn-abi = "1.0.0"
alloy-eip2124 = { version = "0.2.0", default-features = false }
alloy-evm = { version = "0.4.0", default-features = false }
alloy-primitives = { version = "1.0.0", default-features = false, features = ["map-foldhash"] }
alloy-rlp = { version = "0.3.10", default-features = false, features = ["core-net"] }
alloy-sol-types = { version = "0.8.25", default-features = false }
alloy-trie = { version = "0.7.9", default-features = false }

alloy-hardforks = "0.1.4"

alloy-consensus = { version = "0.13.0", default-features = false }
alloy-contract = { version = "0.13.0", default-features = false }
alloy-eips = { version = "0.13.0", default-features = false }
alloy-genesis = { version = "0.13.0", default-features = false }
alloy-json-rpc = { version = "0.13.0", default-features = false }
alloy-network = { version = "0.13.0", default-features = false }
alloy-network-primitives = { version = "0.13.0", default-features = false }
alloy-node-bindings = { version = "0.13.0", default-features = false }
alloy-provider = { version = "0.13.0", features = ["reqwest"], default-features = false }
alloy-pubsub = { version = "0.13.0", default-features = false }
alloy-rpc-client = { version = "0.13.0", default-features = false }
alloy-rpc-types = { version = "0.13.0", features = ["eth"], default-features = false }
alloy-rpc-types-admin = { version = "0.13.0", default-features = false }
alloy-rpc-types-anvil = { version = "0.13.0", default-features = false }
alloy-rpc-types-beacon = { version = "0.13.0", default-features = false }
alloy-rpc-types-debug = { version = "0.13.0", default-features = false }
alloy-rpc-types-engine = { version = "0.13.0", default-features = false }
alloy-rpc-types-eth = { version = "0.13.0", default-features = false }
alloy-rpc-types-mev = { version = "0.13.0", default-features = false }
alloy-rpc-types-trace = { version = "0.13.0", default-features = false }
alloy-rpc-types-txpool = { version = "0.13.0", default-features = false }
alloy-serde = { version = "0.13.0", default-features = false }
alloy-signer = { version = "0.13.0", default-features = false }
alloy-signer-local = { version = "0.13.0", default-features = false }
alloy-transport = { version = "0.13.0" }
alloy-transport-http = { version = "0.13.0", features = ["reqwest-rustls-tls"], default-features = false }
alloy-transport-ipc = { version = "0.13.0", default-features = false }
alloy-transport-ws = { version = "0.13.0", default-features = false }
alloy-sol-macro = "1.0.0"
alloy-sol-types = { version = "1.0.0", default-features = false }
alloy-trie = { version = "0.8.0", default-features = false }

alloy-hardforks = "0.2.0"

alloy-consensus = { version = "0.14.0", default-features = false }
alloy-contract = { version = "0.14.0", default-features = false }
alloy-eips = { version = "0.14.0", default-features = false }
alloy-genesis = { version = "0.14.0", default-features = false }
alloy-json-rpc = { version = "0.14.0", default-features = false }
alloy-network = { version = "0.14.0", default-features = false }
alloy-network-primitives = { version = "0.14.0", default-features = false }
alloy-node-bindings = { version = "0.14.0", default-features = false }
alloy-provider = { version = "0.14.0", features = ["reqwest"], default-features = false }
alloy-pubsub = { version = "0.14.0", default-features = false }
alloy-rpc-client = { version = "0.14.0", default-features = false }
alloy-rpc-types = { version = "0.14.0", features = ["eth"], default-features = false }
alloy-rpc-types-admin = { version = "0.14.0", default-features = false }
alloy-rpc-types-anvil = { version = "0.14.0", default-features = false }
alloy-rpc-types-beacon = { version = "0.14.0", default-features = false }
alloy-rpc-types-debug = { version = "0.14.0", default-features = false }
alloy-rpc-types-engine = { version = "0.14.0", default-features = false }
alloy-rpc-types-eth = { version = "0.14.0", default-features = false }
alloy-rpc-types-mev = { version = "0.14.0", default-features = false }
alloy-rpc-types-trace = { version = "0.14.0", default-features = false }
alloy-rpc-types-txpool = { version = "0.14.0", default-features = false }
alloy-serde = { version = "0.14.0", default-features = false }
alloy-signer = { version = "0.14.0", default-features = false }
alloy-signer-local = { version = "0.14.0", default-features = false }
alloy-transport = { version = "0.14.0" }
alloy-transport-http = { version = "0.14.0", features = ["reqwest-rustls-tls"], default-features = false }
alloy-transport-ipc = { version = "0.14.0", default-features = false }
alloy-transport-ws = { version = "0.14.0", default-features = false }

# op
alloy-op-evm = { version = "0.3.2", default-features = false }
alloy-op-hardforks = "0.1.2"
op-alloy-rpc-types = { version = "0.12.2", default-features = false }
op-alloy-rpc-types-engine = { version = "0.12.2", default-features = false }
op-alloy-network = { version = "0.12.2", default-features = false }
op-alloy-consensus = { version = "0.12.2", default-features = false }
op-alloy-rpc-jsonrpsee = { version = "0.12.2", default-features = false }
op-alloy-flz = { version = "0.12.0", default-features = false }
alloy-op-evm = { version = "0.4.0", default-features = false }
alloy-op-hardforks = "0.2.0"
op-alloy-rpc-types = { version = "0.13.0", default-features = false }
op-alloy-rpc-types-engine = { version = "0.13.0", default-features = false }
op-alloy-network = { version = "0.13.0", default-features = false }
op-alloy-consensus = { version = "0.13.0", default-features = false }
op-alloy-rpc-jsonrpsee = { version = "0.13.0", default-features = false }
op-alloy-flz = { version = "0.13.0", default-features = false }

# misc
aquamarine = "0.6"
Expand Down Expand Up @@ -530,7 +531,7 @@ nybbles = { version = "0.3.0", default-features = false }
once_cell = { version = "1.19", default-features = false, features = ["critical-section"] }
parking_lot = "0.12"
paste = "1.0"
rand = "0.8.5"
rand = "0.9"
rayon = "1.7"
rustc-hash = { version = "2.0", default-features = false }
schnellru = "0.2"
Expand Down Expand Up @@ -603,6 +604,8 @@ proptest-arbitrary-interop = "0.1.0"
enr = { version = "0.13", default-features = false }
k256 = { version = "0.13", default-features = false, features = ["ecdsa"] }
secp256k1 = { version = "0.30", default-features = false, features = ["global-context", "recovery"] }
# rand 8 for secp256k1
rand_08 = { package = "rand", version = "0.8" }

# for eip-4844
c-kzg = "2.1.0"
Expand Down Expand Up @@ -639,7 +642,6 @@ snmalloc-rs = { version = "0.3.7", features = ["build_cc"] }
crunchy = "=0.2.2"
aes = "0.8.1"
ahash = "0.8"
alloy-sol-macro = "0.8.9"
anyhow = "1.0"
bindgen = { version = "0.70", default-features = false }
block-padding = "0.3.2"
Expand Down
8 changes: 4 additions & 4 deletions crates/chain-state/src/in_memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1114,7 +1114,7 @@ mod tests {
#[test]
fn test_in_memory_state_impl_state_by_hash() {
let mut state_by_hash = HashMap::default();
let number = rand::thread_rng().gen::<u64>();
let number = rand::rng().random::<u64>();
let mut test_block_builder: TestBlockBuilder = TestBlockBuilder::default();
let state = Arc::new(create_mock_state(&mut test_block_builder, number, B256::random()));
state_by_hash.insert(state.hash(), state.clone());
Expand All @@ -1130,7 +1130,7 @@ mod tests {
let mut state_by_hash = HashMap::default();
let mut hash_by_number = BTreeMap::new();

let number = rand::thread_rng().gen::<u64>();
let number = rand::rng().random::<u64>();
let mut test_block_builder: TestBlockBuilder = TestBlockBuilder::default();
let state = Arc::new(create_mock_state(&mut test_block_builder, number, B256::random()));
let hash = state.hash();
Expand Down Expand Up @@ -1167,7 +1167,7 @@ mod tests {

#[test]
fn test_in_memory_state_impl_pending_state() {
let pending_number = rand::thread_rng().gen::<u64>();
let pending_number = rand::rng().random::<u64>();
let mut test_block_builder: TestBlockBuilder = TestBlockBuilder::default();
let pending_state =
create_mock_state(&mut test_block_builder, pending_number, B256::random());
Expand All @@ -1193,7 +1193,7 @@ mod tests {

#[test]
fn test_state() {
let number = rand::thread_rng().gen::<u64>();
let number = rand::rng().random::<u64>();
let mut test_block_builder: TestBlockBuilder = TestBlockBuilder::default();
let block = test_block_builder.get_executed_block_with_number(number, B256::random());

Expand Down
8 changes: 4 additions & 4 deletions crates/chain-state/src/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use alloy_primitives::{Address, BlockNumber, B256, U256};
use alloy_signer::SignerSync;
use alloy_signer_local::PrivateKeySigner;
use core::marker::PhantomData;
use rand::{thread_rng, Rng};
use rand::Rng;
use reth_chainspec::{ChainSpec, EthereumHardfork, MIN_TRANSACTION_GAS};
use reth_ethereum_primitives::{
Block, BlockBody, EthPrimitives, Receipt, Transaction, TransactionSigned,
Expand Down Expand Up @@ -96,7 +96,7 @@ impl<N: NodePrimitives> TestBlockBuilder<N> {
number: BlockNumber,
parent_hash: B256,
) -> RecoveredBlock<reth_ethereum_primitives::Block> {
let mut rng = thread_rng();
let mut rng = rand::rng();

let mock_tx = |nonce: u64| -> Recovered<_> {
let tx = Transaction::Eip1559(TxEip1559 {
Expand All @@ -114,7 +114,7 @@ impl<N: NodePrimitives> TestBlockBuilder<N> {
TransactionSigned::new_unhashed(tx, signature).with_signer(self.signer)
};

let num_txs = rng.gen_range(0..5);
let num_txs = rng.random_range(0..5);
let signer_balance_decrease = Self::single_tx_cost() * U256::from(num_txs);
let transactions: Vec<Recovered<_>> = (0..num_txs)
.map(|_| {
Expand Down Expand Up @@ -232,7 +232,7 @@ impl<N: NodePrimitives> TestBlockBuilder<N> {
receipts: Vec<Vec<Receipt>>,
parent_hash: B256,
) -> ExecutedBlockWithTrieUpdates {
let number = rand::thread_rng().gen::<u64>();
let number = rand::rng().random::<u64>();
self.get_executed_block(number, receipts, parent_hash)
}

Expand Down
6 changes: 3 additions & 3 deletions crates/cli/commands/src/test_vectors/compact.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use alloy_eips::eip4895::Withdrawals;
use alloy_primitives::{hex, private::getrandom::getrandom, PrimitiveSignature, TxKind};
use alloy_primitives::{hex, private::getrandom, Signature, TxKind};
use arbitrary::Arbitrary;
use eyre::{Context, Result};
use proptest::{
Expand Down Expand Up @@ -128,7 +128,7 @@ compact_types!(
],
// These types require an extra identifier which is usually stored elsewhere (eg. parent type).
identifier: [
PrimitiveSignature,
Signature,
Transaction,
TxType,
TxKind
Expand All @@ -148,7 +148,7 @@ pub fn read_vectors() -> Result<()> {
pub fn generate_vectors_with(gen: &[fn(&mut TestRunner) -> eyre::Result<()>]) -> Result<()> {
// Prepare random seed for test (same method as used by proptest)
let mut seed = [0u8; 32];
getrandom(&mut seed)?;
getrandom::fill(&mut seed)?;
println!("Seed for compact test vectors: {:?}", hex::encode_prefixed(seed));

// Start the runner with the seed
Expand Down
4 changes: 2 additions & 2 deletions crates/cli/commands/src/test_vectors/tables.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use alloy_consensus::Header;
use alloy_primitives::{hex, private::getrandom::getrandom};
use alloy_primitives::{hex, private::getrandom};
use arbitrary::Arbitrary;
use eyre::Result;
use proptest::{
Expand All @@ -24,7 +24,7 @@ const PER_TABLE: usize = 1000;
pub fn generate_vectors(mut tables: Vec<String>) -> Result<()> {
// Prepare random seed for test (same method as used by proptest)
let mut seed = [0u8; 32];
getrandom(&mut seed)?;
getrandom::fill(&mut seed)?;
println!("Seed for table test vectors: {:?}", hex::encode_prefixed(seed));

// Start the runner with the seed
Expand Down
5 changes: 4 additions & 1 deletion crates/cli/util/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,16 @@ alloy-eips.workspace = true
# misc
cfg-if.workspace = true
eyre.workspace = true
rand.workspace = true
secp256k1 = { workspace = true, features = ["rand"] }
rand_08.workspace = true
thiserror.workspace = true
serde.workspace = true

tracy-client = { workspace = true, optional = true, features = ["demangle"] }

[dev-dependencies]
rand.workspace = true

[target.'cfg(unix)'.dependencies]
tikv-jemallocator = { workspace = true, optional = true }
snmalloc-rs = { workspace = true, optional = true }
Expand Down
2 changes: 1 addition & 1 deletion crates/cli/util/src/load_secret_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use thiserror::Error;

/// Convenience function to create a new random [`SecretKey`]
pub fn rng_secret_key() -> SecretKey {
SecretKey::new(&mut rand::thread_rng())
SecretKey::new(&mut rand_08::thread_rng())
}

/// Errors returned by loading a [`SecretKey`], including IO errors.
Expand Down
2 changes: 1 addition & 1 deletion crates/cli/util/src/parsers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ mod tests {

#[test]
fn parse_socket_address_random() {
let port: u16 = rand::thread_rng().gen();
let port: u16 = rand::rng().random();

for value in [format!("localhost:{port}"), format!(":{port}"), port.to_string()] {
let socket_addr = parse_socket_address(&value)
Expand Down
8 changes: 5 additions & 3 deletions crates/consensus/common/src/validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -337,14 +337,14 @@ mod tests {
use super::*;
use alloy_consensus::{BlockBody, Header, TxEip4844};
use alloy_eips::eip4895::Withdrawals;
use alloy_primitives::{Address, Bytes, PrimitiveSignature as Signature, U256};
use alloy_primitives::{Address, Bytes, Signature, U256};
use rand::Rng;
use reth_chainspec::ChainSpecBuilder;
use reth_ethereum_primitives::{Transaction, TransactionSigned};
use reth_primitives_traits::proofs;

fn mock_blob_tx(nonce: u64, num_blobs: usize) -> TransactionSigned {
let mut rng = rand::thread_rng();
let mut rng = rand::rng();
let request = Transaction::Eip4844(TxEip4844 {
chain_id: 1u64,
nonce,
Expand All @@ -356,7 +356,9 @@ mod tests {
value: U256::from(3_u64),
input: Bytes::from(vec![1, 2]),
access_list: Default::default(),
blob_versioned_hashes: std::iter::repeat_with(|| rng.gen()).take(num_blobs).collect(),
blob_versioned_hashes: std::iter::repeat_with(|| rng.random())
.take(num_blobs)
.collect(),
});

let signature = Signature::new(U256::default(), U256::default(), true);
Expand Down
7 changes: 6 additions & 1 deletion crates/engine/invalid-block-hooks/src/witness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,12 @@ where
let state = state_provider.witness(Default::default(), hashed_state.clone())?;

// Write the witness to the output directory.
let response = ExecutionWitness { state, codes: Default::default(), keys: state_preimages };
let response = ExecutionWitness {
state,
codes: Default::default(),
keys: state_preimages,
..Default::default()
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prep for #15608

};
let re_executed_witness_path = self.save_file(
format!("{}_{}.witness.re_executed.json", block.number(), block.hash()),
&response,
Expand Down
1 change: 1 addition & 0 deletions crates/engine/tree/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ criterion.workspace = true
crossbeam-channel.workspace = true
proptest.workspace = true
rand.workspace = true
rand_08.workspace = true

[[bench]]
name = "channel_perf"
Expand Down
2 changes: 1 addition & 1 deletion crates/engine/tree/benches/channel_perf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use alloy_primitives::{B256, U256};
use criterion::{criterion_group, criterion_main, BatchSize, BenchmarkId, Criterion};
use proptest::test_runner::TestRunner;
use rand::Rng;
use rand_08::Rng;
use revm_primitives::{Address, HashMap};
use revm_state::{Account, AccountInfo, AccountStatus, EvmState, EvmStorage, EvmStorageSlot};
use std::{hint::black_box, thread};
Expand Down
9 changes: 7 additions & 2 deletions crates/engine/tree/benches/state_root_task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use alloy_evm::block::StateChangeSource;
use alloy_primitives::{Address, B256};
use criterion::{criterion_group, criterion_main, BenchmarkId, Criterion};
use proptest::test_runner::TestRunner;
use rand::Rng;
use rand_08::Rng;
use reth_chain_state::EthPrimitives;
use reth_chainspec::ChainSpec;
use reth_db_common::init::init_genesis;
Expand Down Expand Up @@ -41,7 +41,12 @@ struct BenchParams {
fn create_bench_state_updates(params: &BenchParams) -> Vec<EvmState> {
let mut runner = TestRunner::deterministic();
let mut rng = runner.rng().clone();
let all_addresses: Vec<Address> = (0..params.num_accounts).map(|_| rng.gen()).collect();
let all_addresses: Vec<Address> = (0..params.num_accounts)
.map(|_| {
// TODO: rand08
Address::random()
})
.collect();
let mut updates = Vec::new();

for _ in 0..params.updates_per_account {
Expand Down
Loading
Loading