From 87967436f0aa2da2263733004c990bb77a3cfde3 Mon Sep 17 00:00:00 2001 From: Mario Rugiero Date: Sat, 18 Oct 2025 21:06:21 -0300 Subject: [PATCH 01/17] perf: store jump destinations in DB --- crates/blockchain/blockchain.rs | 2 +- crates/blockchain/vm.rs | 7 +- crates/common/types/account.rs | 46 +++++++++++-- crates/common/types/account_update.rs | 8 ++- .../common/types/block_execution_witness.rs | 22 +++---- crates/l2/common/src/state_diff.rs | 6 +- crates/l2/networking/rpc/l2/transaction.rs | 6 +- .../prover/src/guest_program/src/execution.rs | 14 +++- .../block_producer/payload_builder.rs | 2 +- crates/networking/p2p/snap.rs | 2 +- crates/networking/rpc/eth/account.rs | 1 + crates/storage/api.rs | 7 +- crates/storage/store.rs | 30 ++++----- crates/storage/store_db/in_memory.rs | 14 ++-- crates/storage/store_db/rocksdb.rs | 64 ++++++++++++++----- crates/vm/backends/levm/db.rs | 6 +- crates/vm/backends/levm/mod.rs | 2 +- crates/vm/db.rs | 5 +- crates/vm/levm/runner/src/input.rs | 3 +- crates/vm/levm/runner/src/main.rs | 4 +- crates/vm/levm/src/call_frame.rs | 21 +++--- crates/vm/levm/src/db/gen_db.rs | 15 ++--- crates/vm/levm/src/db/mod.rs | 5 +- crates/vm/levm/src/execution_handlers.rs | 3 +- crates/vm/levm/src/hooks/default_hook.rs | 9 ++- crates/vm/levm/src/hooks/l2_hook.rs | 12 +++- .../levm/src/opcode_handlers/environment.rs | 34 ++++++---- crates/vm/levm/src/opcode_handlers/push.rs | 1 + .../stack_memory_storage_flow.rs | 20 +++--- crates/vm/levm/src/opcode_handlers/system.rs | 11 ++-- crates/vm/levm/src/utils.rs | 18 +++--- crates/vm/levm/src/vm.rs | 4 +- crates/vm/witness_db.rs | 5 +- 33 files changed, 251 insertions(+), 158 deletions(-) diff --git a/crates/blockchain/blockchain.rs b/crates/blockchain/blockchain.rs index a313e574699..7c00e74f278 100644 --- a/crates/blockchain/blockchain.rs +++ b/crates/blockchain/blockchain.rs @@ -313,7 +313,7 @@ impl Blockchain { .ok_or(ChainError::WitnessGeneration( "Failed to get account code".to_string(), ))?; - codes.push(code.to_vec()); + codes.push(code.bytecode.to_vec()); } // Apply account updates to the trie recording all the necessary nodes to do so diff --git a/crates/blockchain/vm.rs b/crates/blockchain/vm.rs index a90fdd2ae49..fc9498d71af 100644 --- a/crates/blockchain/vm.rs +++ b/crates/blockchain/vm.rs @@ -1,8 +1,7 @@ -use bytes::Bytes; use ethrex_common::{ Address, H256, U256, constants::EMPTY_KECCACK_HASH, - types::{AccountState, BlockHash, BlockNumber, ChainConfig}, + types::{AccountState, BlockHash, BlockNumber, ChainConfig, Code}, }; use ethrex_storage::Store; use ethrex_vm::{EvmError, VmDatabase}; @@ -104,9 +103,9 @@ impl VmDatabase for StoreVmDatabase { } #[instrument(level = "trace", name = "Account code read", skip_all)] - fn get_account_code(&self, code_hash: H256) -> Result { + fn get_account_code(&self, code_hash: H256) -> Result { if code_hash == *EMPTY_KECCACK_HASH { - return Ok(Bytes::new()); + return Ok(Code::default()); } match self.store.get_account_code(code_hash) { Ok(Some(code)) => Ok(code), diff --git a/crates/common/types/account.rs b/crates/common/types/account.rs index 2bc3e1ef296..d108c192b6b 100644 --- a/crates/common/types/account.rs +++ b/crates/common/types/account.rs @@ -19,11 +19,47 @@ use crate::{ utils::keccak, }; -#[allow(unused)] +#[derive(Clone, Default, Debug, PartialEq, Eq, Serialize, Deserialize)] +pub struct Code { + pub hash: H256, + pub bytecode: Bytes, + pub jump_targets: Vec, +} + +impl Code { + pub fn from_bytecode(code: Bytes) -> Self { + let jump_targets = Self::compute_jump_targets(&code); + Self { + hash: keccak(code.as_ref()), + bytecode: code, + jump_targets, + } + } + + fn compute_jump_targets(code: &[u8]) -> Vec { + debug_assert!(code.len() <= u16::MAX as usize); + let mut targets = Vec::new(); + let mut i = 0; + while i < code.len() { + match code[i] { + 0x5B => { + targets.push(i as u16); + } + c @ 0x60..0x80 => { + i += (c - 0x59) as usize; + } + _ => (), + } + i += 1; + } + targets + } +} + #[derive(Clone, Default, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct Account { pub info: AccountInfo, - pub code: Bytes, + pub code: Code, pub storage: BTreeMap, } @@ -71,7 +107,7 @@ impl From for Account { balance: genesis.balance, nonce: genesis.nonce, }, - code: genesis.code, + code: Code::from_bytecode(genesis.code), storage: genesis .storage .iter() @@ -160,11 +196,11 @@ impl From<&GenesisAccount> for AccountState { } impl Account { - pub fn new(balance: U256, code: Bytes, nonce: u64, storage: BTreeMap) -> Self { + pub fn new(balance: U256, code: Code, nonce: u64, storage: BTreeMap) -> Self { Self { info: AccountInfo { balance, - code_hash: keccak(code.as_ref()).0.into(), + code_hash: code.hash, nonce, }, code, diff --git a/crates/common/types/account_update.rs b/crates/common/types/account_update.rs index e6c2ff58190..d2754444c71 100644 --- a/crates/common/types/account_update.rs +++ b/crates/common/types/account_update.rs @@ -1,7 +1,9 @@ use std::collections::BTreeMap; -use crate::{Address, H256, U256, types::AccountInfo}; -use bytes::Bytes; +use crate::{ + Address, H256, U256, + types::{AccountInfo, Code}, +}; use serde::{Deserialize, Serialize}; #[derive(Default, Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] @@ -9,7 +11,7 @@ pub struct AccountUpdate { pub address: Address, pub removed: bool, pub info: Option, - pub code: Option, + pub code: Option, pub added_storage: BTreeMap, /// If account was destroyed and then modified we need this for removing its storage but not the entire account. pub removed_storage: bool, diff --git a/crates/common/types/block_execution_witness.rs b/crates/common/types/block_execution_witness.rs index 5b788b6a409..47eb394182b 100644 --- a/crates/common/types/block_execution_witness.rs +++ b/crates/common/types/block_execution_witness.rs @@ -2,7 +2,7 @@ use std::collections::BTreeMap; use std::fmt; use std::str::FromStr; -use crate::types::Block; +use crate::types::{Block, Code}; use crate::{ H160, constants::EMPTY_KECCACK_HASH, @@ -34,7 +34,7 @@ pub struct GuestProgramState { /// Map of code hashes to their corresponding bytecode. /// This is computed during guest program execution inside the zkVM, /// before the stateless validation. - pub codes_hashed: BTreeMap>, + pub codes_hashed: BTreeMap, /// Map of block numbers to their corresponding block headers. /// The block headers are pushed to the zkVM RLP-encoded, and then /// decoded and stored in this map during guest program execution, @@ -151,7 +151,10 @@ impl TryFrom for GuestProgramState { let codes_hashed = value .codes .into_iter() - .map(|code| (keccak(&code), code)) + .map(|code| { + let code = Code::from_bytecode(code.into()); + (code.hash, code) + }) .collect(); let mut guest_program_state = GuestProgramState { @@ -255,7 +258,7 @@ impl GuestProgramState { account_state.code_hash = info.code_hash; // Store updated code in DB if let Some(code) = &update.code { - self.codes_hashed.insert(info.code_hash, code.to_vec()); + self.codes_hashed.insert(info.code_hash, code.clone()); } } // Store the added storage in the account's storage trie and compute its new root @@ -446,15 +449,12 @@ impl GuestProgramState { /// Retrieves the account code for a specific account. /// Returns an Err if the code is not found. - pub fn get_account_code( - &self, - code_hash: H256, - ) -> Result { + pub fn get_account_code(&self, code_hash: H256) -> Result { if code_hash == *EMPTY_KECCACK_HASH { - return Ok(Bytes::new()); + return Ok(Code::default()); } match self.codes_hashed.get(&code_hash) { - Some(code) => Ok(Bytes::copy_from_slice(code)), + Some(code) => Ok(code.clone()), None => { // We do this because what usually happens is that the Witness doesn't have the code we asked for but it is because it isn't relevant for that particular case. // In client implementations there are differences and it's natural for some clients to access more/less information in some edge cases. @@ -463,7 +463,7 @@ impl GuestProgramState { "Missing bytecode for hash {} in witness. Defaulting to empty code.", // If there's a state root mismatch and this prints we have to see if it's the cause or not. hex::encode(code_hash) ); - Ok(Bytes::new()) + Ok(Code::default()) } } } diff --git a/crates/l2/common/src/state_diff.rs b/crates/l2/common/src/state_diff.rs index 748a376c2ef..0bf278ccb7d 100644 --- a/crates/l2/common/src/state_diff.rs +++ b/crates/l2/common/src/state_diff.rs @@ -3,7 +3,7 @@ use std::collections::{BTreeMap, HashMap}; use bytes::Bytes; use ethereum_types::{Address, H256, U256}; use ethrex_common::types::{ - AccountInfo, AccountState, AccountUpdate, BlockHeader, PrivilegedL2Transaction, TxKind, + AccountInfo, AccountState, AccountUpdate, BlockHeader, Code, PrivilegedL2Transaction, TxKind, code_hash, }; use ethrex_rlp::decode::RLPDecode; @@ -297,7 +297,7 @@ impl StateDiff { address: *address, removed: false, info: account_info, - code: diff.bytecode.clone(), + code: diff.bytecode.clone().map(Code::from_bytecode), added_storage: diff.storage.clone().into_iter().collect(), removed_storage: false, }, @@ -583,7 +583,7 @@ pub fn prepare_state_diff( new_balance: account_update.info.clone().map(|info| info.balance), nonce_diff, storage: account_update.added_storage.clone().into_iter().collect(), - bytecode: account_update.code.clone(), + bytecode: account_update.code.map(|b| b.bytecode).clone(), bytecode_hash: None, }, ); diff --git a/crates/l2/networking/rpc/l2/transaction.rs b/crates/l2/networking/rpc/l2/transaction.rs index 5b0abc60dd0..93accede0a8 100644 --- a/crates/l2/networking/rpc/l2/transaction.rs +++ b/crates/l2/networking/rpc/l2/transaction.rs @@ -101,13 +101,13 @@ impl RpcHandler for SponsoredTx { .map_err(RpcErr::from)? .unwrap_or_default(); - let prefix: Vec = code.iter().take(3).copied().collect(); - if code.len() != EIP7702_DELEGATED_CODE_LEN || prefix != DELGATION_PREFIX { + let prefix: Vec = code.bytecode.iter().take(3).copied().collect(); + if code.bytecode.len() != EIP7702_DELEGATED_CODE_LEN || prefix != DELGATION_PREFIX { return Err(RpcErr::InvalidEthrexL2Message( "Invalid tx trying to call non delegated account".to_string(), )); } - let address = Address::from_slice(&code[3..]); + let address = Address::from_slice(&code.bytecode[3..]); if address.is_zero() { return Err(RpcErr::InvalidEthrexL2Message( "Invalid tx trying to call non delegated account".to_string(), diff --git a/crates/l2/prover/src/guest_program/src/execution.rs b/crates/l2/prover/src/guest_program/src/execution.rs index 34846b9c1c3..77536c3aff6 100644 --- a/crates/l2/prover/src/guest_program/src/execution.rs +++ b/crates/l2/prover/src/guest_program/src/execution.rs @@ -194,8 +194,14 @@ pub fn stateless_validation_l2( // Check state diffs are valid let blob_versioned_hash = if !validium { + use bytes::Bytes; + use ethrex_common::types::Code; + let mut guest_program_state = GuestProgramState { - codes_hashed, + codes_hashed: codes_hashed + .into_iter() + .map(|(h, c)| (h, Code::from_bytecode(Bytes::from_owner(c)))) + .collect(), parent_block_header, first_block_number: initial_db.first_block_number, chain_config: initial_db.chain_config, @@ -274,7 +280,11 @@ fn execute_stateless( #[cfg(feature = "l2")] let nodes_hashed = guest_program_state.nodes_hashed.clone(); #[cfg(feature = "l2")] - let codes_hashed = guest_program_state.codes_hashed.clone(); + let codes_hashed = guest_program_state + .codes_hashed + .iter() + .map(|(h, c)| (*h, c.bytecode.to_vec())) + .collect(); #[cfg(feature = "l2")] let parent_block_header_clone = guest_program_state.parent_block_header.clone(); diff --git a/crates/l2/sequencer/block_producer/payload_builder.rs b/crates/l2/sequencer/block_producer/payload_builder.rs index c040dd59b9b..76b6f9e0c09 100644 --- a/crates/l2/sequencer/block_producer/payload_builder.rs +++ b/crates/l2/sequencer/block_producer/payload_builder.rs @@ -326,7 +326,7 @@ fn get_account_diffs_in_tx( new_balance, nonce_diff, storage: BTreeMap::new(), // We add the storage later - bytecode, + bytecode: bytecode.map(|c| c.bytecode), bytecode_hash: None, }; diff --git a/crates/networking/p2p/snap.rs b/crates/networking/p2p/snap.rs index e7897abfc92..f7326d2bd71 100644 --- a/crates/networking/p2p/snap.rs +++ b/crates/networking/p2p/snap.rs @@ -112,7 +112,7 @@ pub fn process_byte_codes_request( let mut codes = vec![]; let mut bytes_used = 0; for code_hash in request.hashes { - if let Some(code) = store.get_account_code(code_hash)? { + if let Some(code) = store.get_account_code(code_hash)?.map(|c| c.bytecode) { bytes_used += code.len() as u64; codes.push(code); } diff --git a/crates/networking/rpc/eth/account.rs b/crates/networking/rpc/eth/account.rs index 54c4ef1c981..bcc6fd1f25c 100644 --- a/crates/networking/rpc/eth/account.rs +++ b/crates/networking/rpc/eth/account.rs @@ -99,6 +99,7 @@ impl RpcHandler for GetCodeRequest { .storage .get_code_by_account_address(block_number, self.address) .await? + .map(|c| c.bytecode) .unwrap_or_default(); serde_json::to_value(format!("0x{code:x}")) diff --git a/crates/storage/api.rs b/crates/storage/api.rs index deb32976bf8..1646a7f9830 100644 --- a/crates/storage/api.rs +++ b/crates/storage/api.rs @@ -1,7 +1,8 @@ use bytes::Bytes; use ethereum_types::H256; use ethrex_common::types::{ - Block, BlockBody, BlockHash, BlockHeader, BlockNumber, ChainConfig, Index, Receipt, Transaction, + Block, BlockBody, BlockHash, BlockHeader, BlockNumber, ChainConfig, Code, Index, Receipt, + Transaction, }; use std::{fmt::Debug, panic::RefUnwindSafe}; @@ -121,13 +122,13 @@ pub trait StoreEngine: Debug + Send + Sync + RefUnwindSafe { ) -> Result, StoreError>; /// Add account code - async fn add_account_code(&self, code_hash: H256, code: Bytes) -> Result<(), StoreError>; + async fn add_account_code(&self, code: Code) -> Result<(), StoreError>; /// Clears all checkpoint data created during the last snap sync async fn clear_snap_state(&self) -> Result<(), StoreError>; /// Obtain account code via code hash - fn get_account_code(&self, code_hash: H256) -> Result, StoreError>; + fn get_account_code(&self, code_hash: H256) -> Result, StoreError>; async fn get_transaction_by_hash( &self, diff --git a/crates/storage/store.rs b/crates/storage/store.rs index c49be6b5062..4284bab414e 100644 --- a/crates/storage/store.rs +++ b/crates/storage/store.rs @@ -10,8 +10,8 @@ use ethrex_common::{ constants::EMPTY_TRIE_HASH, types::{ AccountInfo, AccountState, AccountUpdate, Block, BlockBody, BlockHash, BlockHeader, - BlockNumber, ChainConfig, ForkId, Genesis, GenesisAccount, Index, Receipt, Transaction, - code_hash, + BlockNumber, ChainConfig, Code, ForkId, Genesis, GenesisAccount, Index, Receipt, + Transaction, }, }; use ethrex_rlp::decode::RLPDecode; @@ -57,7 +57,7 @@ pub struct UpdateBatch { /// Receipts added per block pub receipts: Vec<(H256, Vec)>, /// Code updates - pub code_updates: Vec<(H256, Bytes)>, + pub code_updates: Vec<(H256, Code)>, } type StorageUpdates = Vec<(H256, Vec<(Nibbles, Vec)>)>; @@ -66,7 +66,7 @@ pub struct AccountUpdatesList { pub state_trie_hash: H256, pub state_updates: Vec<(Nibbles, Vec)>, pub storage_updates: StorageUpdates, - pub code_updates: Vec<(H256, Bytes)>, + pub code_updates: Vec<(H256, Code)>, } impl Store { @@ -312,11 +312,11 @@ impl Store { self.engine.get_transaction_location(transaction_hash).await } - pub async fn add_account_code(&self, code_hash: H256, code: Bytes) -> Result<(), StoreError> { - self.engine.add_account_code(code_hash, code).await + pub async fn add_account_code(&self, code: Code) -> Result<(), StoreError> { + self.engine.add_account_code(code).await } - pub fn get_account_code(&self, code_hash: H256) -> Result, StoreError> { + pub fn get_account_code(&self, code_hash: H256) -> Result, StoreError> { self.engine.get_account_code(code_hash) } @@ -324,7 +324,7 @@ impl Store { &self, block_number: BlockNumber, address: Address, - ) -> Result, StoreError> { + ) -> Result, StoreError> { let Some(block_hash) = self.get_canonical_block_hash(block_number).await? else { return Ok(None); }; @@ -468,7 +468,7 @@ impl Store { account_state.code_hash = info.code_hash; // Store updated code in DB if let Some(code) = &update.code { - self.add_account_code(info.code_hash, code.clone()).await?; + self.add_account_code(code.clone()).await?; } } if update.removed_storage { @@ -515,8 +515,9 @@ impl Store { for (address, account) in genesis_accounts { let hashed_address = hash_address(&address); // Store account code (as this won't be stored in the trie) - let code_hash = code_hash(&account.code); - self.add_account_code(code_hash, account.code).await?; + let code = Code::from_bytecode(account.code); + let code_hash = code.hash; + self.add_account_code(code).await?; // Store the account's storage in a clean storage trie and compute its root let mut storage_trie = self .engine @@ -1720,12 +1721,9 @@ mod tests { async fn test_store_account_code(store: Store) { let code_hash = H256::random(); - let code = Bytes::from("kiwi"); + let code = Code::from_bytecode(Bytes::from("kiwi")); - store - .add_account_code(code_hash, code.clone()) - .await - .unwrap(); + store.add_account_code(code.clone()).await.unwrap(); let stored_code = store.get_account_code(code_hash).unwrap().unwrap(); diff --git a/crates/storage/store_db/in_memory.rs b/crates/storage/store_db/in_memory.rs index ae47add0e0f..b19147dc5d6 100644 --- a/crates/storage/store_db/in_memory.rs +++ b/crates/storage/store_db/in_memory.rs @@ -9,7 +9,7 @@ use crate::{ use bytes::Bytes; use ethereum_types::H256; use ethrex_common::types::{ - Block, BlockBody, BlockHash, BlockHeader, BlockNumber, ChainConfig, Index, Receipt, + Block, BlockBody, BlockHash, BlockHeader, BlockNumber, ChainConfig, Code, Index, Receipt, }; use ethrex_trie::{InMemoryTrieDB, Nibbles, Trie, db::NodeMap}; use std::{ @@ -35,7 +35,7 @@ pub struct StoreInner { bodies: HashMap, headers: HashMap, // Maps code hashes to code - account_codes: HashMap, + account_codes: HashMap, // Maps transaction hashes to their blocks (height+hash) and index within the blocks. transaction_locations: HashMap>, receipts: HashMap>, @@ -373,12 +373,12 @@ impl StoreEngine for Store { .cloned()) } - async fn add_account_code(&self, code_hash: H256, code: Bytes) -> Result<(), StoreError> { - self.inner()?.account_codes.insert(code_hash, code); + async fn add_account_code(&self, code: Code) -> Result<(), StoreError> { + self.inner()?.account_codes.insert(code.hash, code); Ok(()) } - fn get_account_code(&self, code_hash: H256) -> Result, StoreError> { + fn get_account_code(&self, code_hash: H256) -> Result, StoreError> { Ok(self.inner()?.account_codes.get(&code_hash).cloned()) } @@ -692,7 +692,9 @@ impl StoreEngine for Store { let mut store = self.inner()?; for (code_hash, code) in account_codes { - store.account_codes.insert(code_hash, code); + store + .account_codes + .insert(code_hash, Code::from_bytecode(code)); } Ok(()) diff --git a/crates/storage/store_db/rocksdb.rs b/crates/storage/store_db/rocksdb.rs index 5dd5d4208ea..ba0e2cbdaed 100644 --- a/crates/storage/store_db/rocksdb.rs +++ b/crates/storage/store_db/rocksdb.rs @@ -9,8 +9,8 @@ use bytes::Bytes; use ethrex_common::{ H256, types::{ - AccountState, Block, BlockBody, BlockHash, BlockHeader, BlockNumber, ChainConfig, Index, - Receipt, Transaction, + AccountState, Block, BlockBody, BlockHash, BlockHeader, BlockNumber, ChainConfig, Code, + Index, Receipt, Transaction, }, }; use ethrex_trie::{Nibbles, Node, Trie}; @@ -33,7 +33,10 @@ use crate::{ trie_db::rocksdb::RocksDBTrieDB, utils::{ChainDataIndex, SnapStateIndex}, }; -use ethrex_rlp::{decode::RLPDecode, encode::RLPEncode}; +use ethrex_rlp::{ + decode::{RLPDecode, decode_bytes}, + encode::RLPEncode, +}; use std::fmt::Debug; // TODO: use finalized hash to determine when to commit @@ -740,9 +743,17 @@ impl StoreEngine for Store { } for (code_hash, code) in update_batch.code_updates { - let code_key = code_hash.as_bytes(); - let code_value = AccountCodeRLP::from(code).bytes().clone(); - batch.put_cf(&cf_codes, code_key, code_value); + let mut buf = + Vec::with_capacity(6 + code.bytecode.len() + 2 * code.jump_targets.len()); + code.bytecode.encode(&mut buf); + unsafe { + std::slice::from_raw_parts( + code.jump_targets.as_ptr().cast(), + 2 * code.jump_targets.len(), + ) + } + .encode(&mut buf); + batch.put_cf(&cf_codes, code_hash.0, buf); } // Single write operation @@ -1108,11 +1119,18 @@ impl StoreEngine for Store { .map_err(StoreError::from) } - async fn add_account_code(&self, code_hash: H256, code: Bytes) -> Result<(), StoreError> { - let hash_key = code_hash.as_bytes().to_vec(); - let code_value = AccountCodeRLP::from(code).bytes().clone(); - self.write_async(CF_ACCOUNT_CODES, hash_key, code_value) - .await + async fn add_account_code(&self, code: Code) -> Result<(), StoreError> { + let hash_key = code.hash.0.to_vec(); + let mut buf = Vec::with_capacity(6 + code.bytecode.len() + 2 * code.jump_targets.len()); + code.bytecode.encode(&mut buf); + unsafe { + std::slice::from_raw_parts( + code.jump_targets.as_ptr().cast(), + 2 * code.jump_targets.len(), + ) + } + .encode(&mut buf); + self.write_async(CF_ACCOUNT_CODES, hash_key, buf).await } async fn clear_snap_state(&self) -> Result<(), StoreError> { @@ -1137,12 +1155,26 @@ impl StoreEngine for Store { .map_err(|e| StoreError::Custom(format!("Task panicked: {}", e)))? } - fn get_account_code(&self, code_hash: H256) -> Result, StoreError> { + fn get_account_code(&self, code_hash: H256) -> Result, StoreError> { let hash_key = code_hash.as_bytes().to_vec(); - self.read_sync(CF_ACCOUNT_CODES, hash_key)? - .map(|bytes| AccountCodeRLP::from_bytes(bytes).to()) - .transpose() - .map_err(StoreError::from) + let Some(bytes) = self.read_sync(CF_ACCOUNT_CODES, hash_key)? else { + return Ok(None); + }; + let bytes = Bytes::from_owner(bytes); + let (bytecode, targets) = decode_bytes(&bytes)?; + let (targets, rest) = decode_bytes(targets)?; + if !rest.is_empty() || !targets.len().is_multiple_of(2) { + return Err(StoreError::DecodeError); + } + let code = Code { + hash: code_hash, + bytecode: Bytes::copy_from_slice(bytecode), + jump_targets: targets + .chunks_exact(2) + .map(|c| u16::from_le_bytes([c[0], c[1]])) + .collect(), + }; + Ok(Some(code)) } async fn get_transaction_by_hash( diff --git a/crates/vm/backends/levm/db.rs b/crates/vm/backends/levm/db.rs index 8c835c6e6ef..163ae3c9fa3 100644 --- a/crates/vm/backends/levm/db.rs +++ b/crates/vm/backends/levm/db.rs @@ -1,6 +1,6 @@ use ethrex_common::U256 as CoreU256; use ethrex_common::constants::EMPTY_KECCACK_HASH; -use ethrex_common::types::AccountState; +use ethrex_common::types::{AccountState, Code}; use ethrex_common::{Address as CoreAddress, H256 as CoreH256}; use ethrex_levm::db::Database as LevmDatabase; @@ -85,7 +85,7 @@ impl LevmDatabase for DatabaseLogger { .get_chain_config() } - fn get_account_code(&self, code_hash: CoreH256) -> Result { + fn get_account_code(&self, code_hash: CoreH256) -> Result { if code_hash != *EMPTY_KECCACK_HASH { let mut code_accessed = self .code_accessed @@ -131,7 +131,7 @@ impl LevmDatabase for DynVmDatabase { .map_err(|e| DatabaseError::Custom(e.to_string())) } - fn get_account_code(&self, code_hash: CoreH256) -> Result { + fn get_account_code(&self, code_hash: CoreH256) -> Result { ::get_account_code(self.as_ref(), code_hash) .map_err(|e| DatabaseError::Custom(e.to_string())) } diff --git a/crates/vm/backends/levm/mod.rs b/crates/vm/backends/levm/mod.rs index af2a3df1c19..e24ab27d14b 100644 --- a/crates/vm/backends/levm/mod.rs +++ b/crates/vm/backends/levm/mod.rs @@ -388,7 +388,7 @@ pub fn generic_system_contract_levm( if PRAGUE_SYSTEM_CONTRACTS .iter() .any(|contract| contract.address == contract_address) - && db.get_account_code(contract_address)?.is_empty() + && db.get_account_code(contract_address)?.bytecode.is_empty() { return Err(EvmError::SystemContractCallFailed(format!( "System contract: {contract_address} has no code after deployment" diff --git a/crates/vm/db.rs b/crates/vm/db.rs index 1e9d51d2a3e..bbeba686513 100644 --- a/crates/vm/db.rs +++ b/crates/vm/db.rs @@ -1,9 +1,8 @@ use crate::EvmError; -use bytes::Bytes; use dyn_clone::DynClone; use ethrex_common::{ Address, H256, U256, - types::{AccountState, ChainConfig}, + types::{AccountState, ChainConfig, Code}, }; pub trait VmDatabase: Send + Sync + DynClone { @@ -11,7 +10,7 @@ pub trait VmDatabase: Send + Sync + DynClone { fn get_storage_slot(&self, address: Address, key: H256) -> Result, EvmError>; fn get_block_hash(&self, block_number: u64) -> Result; fn get_chain_config(&self) -> Result; - fn get_account_code(&self, code_hash: H256) -> Result; + fn get_account_code(&self, code_hash: H256) -> Result; } dyn_clone::clone_trait_object!(VmDatabase); diff --git a/crates/vm/levm/runner/src/input.rs b/crates/vm/levm/runner/src/input.rs index 35f53ef404e..0f6f993dfab 100644 --- a/crates/vm/levm/runner/src/input.rs +++ b/crates/vm/levm/runner/src/input.rs @@ -3,6 +3,7 @@ use ethrex_common::H256; use ethrex_common::serde_utils::bytes::deserialize; use ethrex_common::serde_utils::u64; use ethrex_common::serde_utils::u256; +use ethrex_common::types::Code; use ethrex_common::types::{Account, AccountInfo, code_hash}; use ethrex_common::{Address, U256, types::Fork}; use serde::Deserialize; @@ -40,7 +41,7 @@ impl From for Account { balance: account.balance, nonce: 0, }, - code: account.code, + code: Code::from_bytecode(account.code), storage: account .storage .into_iter() diff --git a/crates/vm/levm/runner/src/main.rs b/crates/vm/levm/runner/src/main.rs index 42e4013ca46..71e1c484f94 100644 --- a/crates/vm/levm/runner/src/main.rs +++ b/crates/vm/levm/runner/src/main.rs @@ -4,7 +4,7 @@ use env_logger::Env; use ethrex_blockchain::vm::StoreVmDatabase; use ethrex_common::{ Address, H160, H256, U256, - types::{Account, LegacyTransaction, Transaction}, + types::{Account, Code, LegacyTransaction, Transaction}, }; use ethrex_levm::{ EVMConfig, Environment, @@ -285,7 +285,7 @@ fn setup_initial_state( if let Some(to) = runner_input.transaction.to { // Contract Bytecode, set code of recipient. let acc = initial_state.entry(to).or_default(); - acc.code = bytecode; + acc.code = Code::from_bytecode(bytecode); } else { // Initcode should be data of transaction runner_input.transaction.data = bytecode; diff --git a/crates/vm/levm/src/call_frame.rs b/crates/vm/levm/src/call_frame.rs index 65db7c119cf..a892bcac350 100644 --- a/crates/vm/levm/src/call_frame.rs +++ b/crates/vm/levm/src/call_frame.rs @@ -3,12 +3,12 @@ use crate::{ constants::STACK_LIMIT, errors::{ExceptionalHalt, InternalError, VMError}, memory::Memory, - utils::{JumpTargetFilter, restore_cache_state}, + utils::restore_cache_state, vm::VM, }; use bytes::Bytes; -use ethrex_common::H256; use ethrex_common::{Address, U256}; +use ethrex_common::{H256, types::Code}; use std::{ collections::{BTreeMap, HashMap}, fmt, @@ -243,7 +243,7 @@ pub struct CallFrame { /// Address of the code to execute. Usually the same as `to`, but can be different pub code_address: Address, /// Bytecode to execute - pub bytecode: Bytes, + pub bytecode: Code, /// Value sent along the transaction pub msg_value: U256, pub stack: Stack, @@ -258,9 +258,6 @@ pub struct CallFrame { pub is_static: bool, /// Call stack current depth pub depth: usize, - /// Lazy blacklist of jump targets. Contains all offsets of 0x5B (JUMPDEST) in literals (after - /// push instructions). - pub jump_target_filter: JumpTargetFilter, /// This is set to true if the function that created this callframe is CREATE or CREATE2 pub is_create: bool, /// Everytime we want to write an account during execution of a callframe we store the pre-write state so that we can restore if it reverts @@ -319,7 +316,7 @@ impl CallFrame { msg_sender: Address, to: Address, code_address: Address, - bytecode: Bytes, + bytecode: Code, msg_value: U256, calldata: Bytes, is_static: bool, @@ -341,12 +338,11 @@ impl CallFrame { msg_sender, to, code_address, - bytecode: bytecode.clone(), + bytecode, msg_value, calldata, is_static, depth, - jump_target_filter: JumpTargetFilter::new(bytecode), should_transfer_value, is_create, ret_offset, @@ -362,10 +358,10 @@ impl CallFrame { #[inline(always)] pub fn next_opcode(&self) -> u8 { - if self.pc < self.bytecode.len() { + if self.pc < self.bytecode.bytecode.len() { #[expect(unsafe_code, reason = "bounds checked above")] unsafe { - *self.bytecode.get_unchecked(self.pc) + *self.bytecode.bytecode.get_unchecked(self.pc) } } else { 0 @@ -390,8 +386,7 @@ impl CallFrame { Ok(()) } - pub fn set_code(&mut self, code: Bytes) -> Result<(), VMError> { - self.jump_target_filter = JumpTargetFilter::new(code.clone()); + pub fn set_code(&mut self, code: Code) -> Result<(), VMError> { self.bytecode = code; Ok(()) } diff --git a/crates/vm/levm/src/db/gen_db.rs b/crates/vm/levm/src/db/gen_db.rs index 97765893bda..2021aa3e3ad 100644 --- a/crates/vm/levm/src/db/gen_db.rs +++ b/crates/vm/levm/src/db/gen_db.rs @@ -1,13 +1,12 @@ use std::collections::BTreeMap; use std::sync::Arc; -use bytes::Bytes; use ethrex_common::Address; use ethrex_common::H256; use ethrex_common::U256; use ethrex_common::types::Account; +use ethrex_common::types::Code; use ethrex_common::utils::ZERO_U256; -use ethrex_common::utils::keccak; use super::Database; use crate::account::AccountStatus; @@ -28,7 +27,7 @@ pub struct GeneralizedDatabase { pub store: Arc, pub current_accounts_state: CacheDB, pub initial_accounts_state: CacheDB, - pub codes: BTreeMap, + pub codes: BTreeMap, pub tx_backup: Option, } @@ -97,7 +96,7 @@ impl GeneralizedDatabase { /// Gets code immutably given the code hash. /// Use this only inside of the VM, when we don't surely know if the code is in the cache or not /// But e.g. in `get_state_transitions` just do `db.codes.get(code_hash)` because we know for sure code is there. - pub fn get_code(&mut self, code_hash: H256) -> Result<&Bytes, InternalError> { + pub fn get_code(&mut self, code_hash: H256) -> Result<&Code, InternalError> { match self.codes.entry(code_hash) { Entry::Occupied(entry) => Ok(entry.into_mut()), Entry::Vacant(entry) => { @@ -108,7 +107,7 @@ impl GeneralizedDatabase { } /// Shortcut for getting the code when we only have the address of an account and we don't need anything else. - pub fn get_account_code(&mut self, address: Address) -> Result<&Bytes, InternalError> { + pub fn get_account_code(&mut self, address: Address) -> Result<&Code, InternalError> { let code_hash = self.get_account(address)?.info.code_hash; self.get_code(code_hash) } @@ -326,11 +325,11 @@ impl<'a> VM<'a> { pub fn update_account_bytecode( &mut self, address: Address, - new_bytecode: Bytes, + new_bytecode: Code, ) -> Result<(), InternalError> { let acc = self.get_account_mut(address)?; - let code_hash = keccak(new_bytecode.as_ref()).0.into(); - acc.info.code_hash = code_hash; + let code_hash = new_bytecode.hash; + acc.info.code_hash = new_bytecode.hash; self.db.codes.entry(code_hash).or_insert(new_bytecode); Ok(()) } diff --git a/crates/vm/levm/src/db/mod.rs b/crates/vm/levm/src/db/mod.rs index cd0bcca3295..50a3c52896a 100644 --- a/crates/vm/levm/src/db/mod.rs +++ b/crates/vm/levm/src/db/mod.rs @@ -1,8 +1,7 @@ use crate::errors::DatabaseError; -use bytes::Bytes; use ethrex_common::{ Address, H256, U256, - types::{AccountState, ChainConfig}, + types::{AccountState, ChainConfig, Code}, }; pub mod gen_db; @@ -12,5 +11,5 @@ pub trait Database: Send + Sync { fn get_storage_value(&self, address: Address, key: H256) -> Result; fn get_block_hash(&self, block_number: u64) -> Result; fn get_chain_config(&self) -> Result; - fn get_account_code(&self, code_hash: H256) -> Result; + fn get_account_code(&self, code_hash: H256) -> Result; } diff --git a/crates/vm/levm/src/execution_handlers.rs b/crates/vm/levm/src/execution_handlers.rs index 9bd514961c9..0888c6093ab 100644 --- a/crates/vm/levm/src/execution_handlers.rs +++ b/crates/vm/levm/src/execution_handlers.rs @@ -6,6 +6,7 @@ use crate::{ }; use bytes::Bytes; +use ethrex_common::types::Code; impl<'a> VM<'a> { pub fn handle_precompile_result( @@ -64,7 +65,7 @@ impl<'a> VM<'a> { // Set bytecode to the newly created contract. let contract_address = self.current_call_frame.to; let code = self.current_call_frame.output.clone(); - self.update_account_bytecode(contract_address, code)?; + self.update_account_bytecode(contract_address, Code::from_bytecode(code))?; } #[expect(clippy::as_conversions, reason = "remaining gas conversion")] diff --git a/crates/vm/levm/src/hooks/default_hook.rs b/crates/vm/levm/src/hooks/default_hook.rs index 71f5631a262..5200fdc7ee8 100644 --- a/crates/vm/levm/src/hooks/default_hook.rs +++ b/crates/vm/levm/src/hooks/default_hook.rs @@ -9,7 +9,10 @@ use crate::{ }; use bytes::Bytes; -use ethrex_common::{Address, U256, types::Fork}; +use ethrex_common::{ + Address, U256, + types::{Code, Fork}, +}; pub const MAX_REFUND_QUOTIENT: u64 = 5; @@ -96,7 +99,7 @@ impl Hook for DefaultHook { // (9) SENDER_NOT_EOA let code = vm.db.get_code(sender_info.code_hash)?; - validate_sender(sender_address, code)?; + validate_sender(sender_address, &code.bytecode)?; // (10) GAS_ALLOWANCE_EXCEEDED validate_gas_allowance(vm)?; @@ -492,7 +495,7 @@ pub fn set_bytecode_and_code_address(vm: &mut VM<'_>) -> Result<(), VMError> { let (bytecode, code_address) = if vm.is_create()? { // Here bytecode is the calldata and the code_address is just the created contract address. let calldata = std::mem::take(&mut vm.current_call_frame.calldata); - (calldata, vm.current_call_frame.to) + (Code::from_bytecode(calldata), vm.current_call_frame.to) } else { // Here bytecode and code_address could be either from the account or from the delegated account. let to = vm.current_call_frame.to; diff --git a/crates/vm/levm/src/hooks/l2_hook.rs b/crates/vm/levm/src/hooks/l2_hook.rs index 46f52660a45..a9aced2ba2c 100644 --- a/crates/vm/levm/src/hooks/l2_hook.rs +++ b/crates/vm/levm/src/hooks/l2_hook.rs @@ -5,7 +5,10 @@ use crate::{ vm::VM, }; -use ethrex_common::{Address, H160, U256, types::fee_config::FeeConfig}; +use ethrex_common::{ + Address, H160, H256, U256, + types::{Code, fee_config::FeeConfig}, +}; pub const COMMON_BRIDGE_L2_ADDRESS: Address = H160([ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -91,8 +94,11 @@ impl Hook for L2Hook { // If the transaction failed some validation, but it must still be included // To prevent it from taking effect, we force it to revert vm.current_call_frame.msg_value = U256::zero(); - vm.current_call_frame - .set_code(vec![Opcode::INVALID.into()].into())?; + vm.current_call_frame.set_code(Code { + hash: H256::zero(), + bytecode: vec![Opcode::INVALID.into()].into(), + jump_targets: Vec::new(), + })?; return Ok(()); } diff --git a/crates/vm/levm/src/opcode_handlers/environment.rs b/crates/vm/levm/src/opcode_handlers/environment.rs index 04a9277fe70..b0c3bf08dff 100644 --- a/crates/vm/levm/src/opcode_handlers/environment.rs +++ b/crates/vm/levm/src/opcode_handlers/environment.rs @@ -204,7 +204,7 @@ impl<'a> VM<'a> { current_call_frame .stack - .push1(U256::from(current_call_frame.bytecode.len()))?; + .push1(U256::from(current_call_frame.bytecode.bytecode.len()))?; Ok(OpcodeResult::Continue) } @@ -231,11 +231,12 @@ impl<'a> VM<'a> { // Happiest fast path, copy without an intermediate buffer because there is no need to pad 0s and also size doesn't overflow. if let Some(code_offset_end) = code_offset.checked_add(size) - && code_offset_end <= current_call_frame.bytecode.len() + && code_offset_end <= current_call_frame.bytecode.bytecode.len() { #[expect(unsafe_code, reason = "bounds checked beforehand")] let slice = unsafe { current_call_frame + .bytecode .bytecode .get_unchecked(code_offset..code_offset_end) }; @@ -245,15 +246,23 @@ impl<'a> VM<'a> { } let mut data = vec![0u8; size]; - if code_offset < current_call_frame.bytecode.len() { - let diff = current_call_frame.bytecode.len().wrapping_sub(code_offset); + if code_offset < current_call_frame.bytecode.bytecode.len() { + let diff = current_call_frame + .bytecode + .bytecode + .len() + .wrapping_sub(code_offset); let final_size = size.min(diff); let end = code_offset.wrapping_add(final_size); #[expect(unsafe_code, reason = "bounds checked beforehand")] unsafe { - data.get_unchecked_mut(..final_size) - .copy_from_slice(current_call_frame.bytecode.get_unchecked(code_offset..end)); + data.get_unchecked_mut(..final_size).copy_from_slice( + current_call_frame + .bytecode + .bytecode + .get_unchecked(code_offset..end), + ); } } @@ -277,7 +286,8 @@ impl<'a> VM<'a> { pub fn op_extcodesize(&mut self) -> Result { let address = word_to_address(self.current_call_frame.stack.pop1()?); let address_was_cold = !self.substate.add_accessed_address(address); - let account_code_length = self.db.get_account_code(address)?.len().into(); + // FIXME: a bit wasteful to fetch the whole code just to get the length. + let account_code_length = self.db.get_account_code(address)?.bytecode.len().into(); let current_call_frame = &mut self.current_call_frame; @@ -319,10 +329,10 @@ impl<'a> VM<'a> { // Happiest fast path, copy without an intermediate buffer because there is no need to pad 0s and also size doesn't overflow. if let Some(offset_end) = offset.checked_add(size) - && offset_end <= bytecode.len() + && offset_end <= bytecode.bytecode.len() { #[expect(unsafe_code, reason = "bounds checked beforehand")] - let slice = unsafe { bytecode.get_unchecked(offset..offset_end) }; + let slice = unsafe { bytecode.bytecode.get_unchecked(offset..offset_end) }; self.current_call_frame .memory .store_data(dest_offset, slice)?; @@ -331,15 +341,15 @@ impl<'a> VM<'a> { } let mut data = vec![0u8; size]; - if offset < bytecode.len() { - let diff = bytecode.len().wrapping_sub(offset); + if offset < bytecode.bytecode.len() { + let diff = bytecode.bytecode.len().wrapping_sub(offset); let final_size = size.min(diff); let end = offset.wrapping_add(final_size); #[expect(unsafe_code, reason = "bounds checked beforehand")] unsafe { data.get_unchecked_mut(..final_size) - .copy_from_slice(bytecode.get_unchecked(offset..end)); + .copy_from_slice(bytecode.bytecode.get_unchecked(offset..end)); } } diff --git a/crates/vm/levm/src/opcode_handlers/push.rs b/crates/vm/levm/src/opcode_handlers/push.rs index 3724aad2d8e..627c94a3338 100644 --- a/crates/vm/levm/src/opcode_handlers/push.rs +++ b/crates/vm/levm/src/opcode_handlers/push.rs @@ -20,6 +20,7 @@ impl<'a> VM<'a> { } let value = if let Some(slice) = call_frame + .bytecode .bytecode .get(call_frame.pc..call_frame.pc.wrapping_add(N)) { diff --git a/crates/vm/levm/src/opcode_handlers/stack_memory_storage_flow.rs b/crates/vm/levm/src/opcode_handlers/stack_memory_storage_flow.rs index 3902e86d6c1..316912d2620 100644 --- a/crates/vm/levm/src/opcode_handlers/stack_memory_storage_flow.rs +++ b/crates/vm/levm/src/opcode_handlers/stack_memory_storage_flow.rs @@ -4,7 +4,6 @@ use crate::{ errors::{ExceptionalHalt, InternalError, OpcodeResult, VMError}, gas_cost::{self, SSTORE_STIPEND}, memory::calculate_memory_size, - opcodes::Opcode, utils::u256_to_usize, vm::VM, }; @@ -292,13 +291,12 @@ impl<'a> VM<'a> { /// - Checking that the byte at the requested target PC is a JUMPDEST (0x5B). /// - Ensuring the byte is not blacklisted. In other words, the 0x5B value is not part of a /// constant associated with a push instruction. - fn target_address_is_valid(call_frame: &mut CallFrame, jump_address: usize) -> bool { - #[expect(clippy::as_conversions)] - call_frame.bytecode.get(jump_address).is_some_and(|value| { - // It's a constant, therefore the conversion cannot fail. - *value == Opcode::JUMPDEST as u8 - && !call_frame.jump_target_filter.is_blacklisted(jump_address) - }) + fn target_address_is_valid(call_frame: &mut CallFrame, jump_address: u16) -> bool { + call_frame + .bytecode + .jump_targets + .binary_search(&jump_address) + .is_ok() } /// JUMP* family (`JUMP` and `JUMP` ATTOW [DEC 2024]) helper @@ -307,14 +305,14 @@ impl<'a> VM<'a> { /// to be equal to the specified address. If the address is not a /// valid JUMPDEST, it will return an error pub fn jump(call_frame: &mut CallFrame, jump_address: U256) -> Result<(), VMError> { - let jump_address_usize = jump_address + let jump_address_u16 = jump_address .try_into() .map_err(|_err| ExceptionalHalt::VeryLargeNumber)?; #[expect(clippy::arithmetic_side_effects)] - if Self::target_address_is_valid(call_frame, jump_address_usize) { + if Self::target_address_is_valid(call_frame, jump_address_u16) { call_frame.increase_consumed_gas(gas_cost::JUMPDEST)?; - call_frame.pc = jump_address_usize + 1; + call_frame.pc = usize::from(jump_address_u16) + 1; Ok(()) } else { Err(ExceptionalHalt::InvalidJump.into()) diff --git a/crates/vm/levm/src/opcode_handlers/system.rs b/crates/vm/levm/src/opcode_handlers/system.rs index 2ae0fa57f58..ee467c5a6d5 100644 --- a/crates/vm/levm/src/opcode_handlers/system.rs +++ b/crates/vm/levm/src/opcode_handlers/system.rs @@ -9,10 +9,11 @@ use crate::{ vm::VM, }; use bytes::Bytes; -use ethrex_common::tracing::CallType::{ - self, CALL, CALLCODE, DELEGATECALL, SELFDESTRUCT, STATICCALL, -}; use ethrex_common::{Address, U256, evm::calculate_create_address, types::Fork}; +use ethrex_common::{ + tracing::CallType::{self, CALL, CALLCODE, DELEGATECALL, SELFDESTRUCT, STATICCALL}, + types::Code, +}; // System Operations (10) // Opcodes: CREATE, CALL, CALLCODE, RETURN, DELEGATECALL, CREATE2, STATICCALL, REVERT, INVALID, SELFDESTRUCT @@ -681,7 +682,7 @@ impl<'a> VM<'a> { deployer, new_address, new_address, - code, + Code::from_bytecode(code), value, Bytes::new(), false, @@ -726,7 +727,7 @@ impl<'a> VM<'a> { calldata: Bytes, ret_offset: usize, ret_size: usize, - bytecode: Bytes, + bytecode: Code, is_delegation_7702: bool, ) -> Result { // Clear callframe subreturn data diff --git a/crates/vm/levm/src/utils.rs b/crates/vm/levm/src/utils.rs index 693ee9fae7d..6dca1d7e205 100644 --- a/crates/vm/levm/src/utils.rs +++ b/crates/vm/levm/src/utils.rs @@ -18,7 +18,7 @@ use bytes::{Bytes, buf::IntoIter}; use ethrex_common::{ Address, H256, U256, evm::calculate_create_address, - types::{Account, Fork, Transaction, tx_fields::*}, + types::{Account, Code, Fork, Transaction, tx_fields::*}, utils::{keccak, u256_to_big_endian}, }; use ethrex_common::{types::TxKind, utils::u256_from_big_endian_const}; @@ -330,7 +330,7 @@ pub fn eip7702_get_code( db: &mut GeneralizedDatabase, accrued_substate: &mut Substate, address: Address, -) -> Result<(bool, u64, Address, Bytes), VMError> { +) -> Result<(bool, u64, Address, Code), VMError> { // Address is the delgated address let bytecode = db.get_account_code(address)?; @@ -338,13 +338,13 @@ pub fn eip7702_get_code( // return false meaning that is not a delegation // return the same address given // return the bytecode of the given address - if !code_has_delegation(bytecode)? { + if !code_has_delegation(&bytecode.bytecode)? { return Ok((false, 0, address, bytecode.clone())); } // Here the address has a delegation code // The delegation code has the authorized address - let auth_address = get_authorized_address_from_code(bytecode)?; + let auth_address = get_authorized_address_from_code(&bytecode.bytecode)?; let access_cost = if accrued_substate.add_accessed_address(auth_address) { WARM_ADDRESS_ACCESS_COST @@ -391,8 +391,8 @@ impl<'a> VM<'a> { self.substate.add_accessed_address(authority_address); // 5. Verify the code of authority is either empty or already delegated. - let empty_or_delegated = - authority_code.is_empty() || code_has_delegation(authority_code)?; + let empty_or_delegated = authority_code.bytecode.is_empty() + || code_has_delegation(&authority_code.bytecode)?; if !empty_or_delegated { continue; } @@ -426,7 +426,7 @@ impl<'a> VM<'a> { } else { Bytes::new() }; - self.update_account_bytecode(authority_address, code)?; + self.update_account_bytecode(authority_address, Code::from_bytecode(code))?; // 9. Increase the nonce of authority by one. self.increment_account_nonce(authority_address) @@ -528,7 +528,7 @@ impl<'a> VM<'a> { pub fn get_min_gas_used(&self) -> Result { // If the transaction is a CREATE transaction, the calldata is emptied and the bytecode is assigned. let calldata = if self.is_create()? { - &self.current_call_frame.bytecode + &self.current_call_frame.bytecode.bytecode } else { &self.current_call_frame.calldata }; @@ -582,7 +582,7 @@ impl<'a> VM<'a> { /// Converts Account to LevmAccount /// The problem with this is that we don't have the storage root. -pub fn account_to_levm_account(account: Account) -> (LevmAccount, Bytes) { +pub fn account_to_levm_account(account: Account) -> (LevmAccount, Code) { ( LevmAccount { info: account.info, diff --git a/crates/vm/levm/src/vm.rs b/crates/vm/levm/src/vm.rs index cc1e877e958..312014c065e 100644 --- a/crates/vm/levm/src/vm.rs +++ b/crates/vm/levm/src/vm.rs @@ -20,7 +20,7 @@ use bytes::Bytes; use ethrex_common::{ Address, H160, H256, U256, tracing::CallType, - types::{AccessListEntry, Fork, Log, Transaction, fee_config::FeeConfig}, + types::{AccessListEntry, Code, Fork, Log, Transaction, fee_config::FeeConfig}, }; use std::{ cell::RefCell, @@ -360,7 +360,7 @@ impl<'a> VM<'a> { env.origin, callee, Address::default(), // Will be assigned at the end of prepare_execution - Bytes::new(), // Will be assigned at the end of prepare_execution + Code::default(), // Will be assigned at the end of prepare_execution tx.value(), tx.data().clone(), false, diff --git a/crates/vm/witness_db.rs b/crates/vm/witness_db.rs index 28457cb5255..505260c33f5 100644 --- a/crates/vm/witness_db.rs +++ b/crates/vm/witness_db.rs @@ -1,9 +1,8 @@ use crate::{EvmError, VmDatabase}; -use bytes::Bytes; use ethrex_common::{ Address, H256, U256, types::{ - AccountState, AccountUpdate, Block, BlockHeader, ChainConfig, + AccountState, AccountUpdate, Block, BlockHeader, ChainConfig, Code, block_execution_witness::{GuestProgramState, GuestProgramStateError}, }, }; @@ -60,7 +59,7 @@ impl GuestProgramStateWrapper { } impl VmDatabase for GuestProgramStateWrapper { - fn get_account_code(&self, code_hash: H256) -> Result { + fn get_account_code(&self, code_hash: H256) -> Result { self.lock_mutex() .map_err(|_| EvmError::DB("Failed to lock db".to_string()))? .get_account_code(code_hash) From d3e55ee2941775e0c63c00b5686e8a8f52572054 Mon Sep 17 00:00:00 2001 From: Mario Rugiero Date: Mon, 20 Oct 2025 13:38:07 -0300 Subject: [PATCH 02/17] get it to compile --- crates/common/types/account.rs | 2 ++ crates/networking/p2p/sync.rs | 11 +++++++++-- crates/storage/api.rs | 2 +- crates/storage/store.rs | 2 +- crates/storage/store_db/in_memory.rs | 6 ++---- crates/storage/store_db/rocksdb.rs | 14 +++++++++++--- tooling/archive_sync/src/main.rs | 4 ++-- 7 files changed, 28 insertions(+), 13 deletions(-) diff --git a/crates/common/types/account.rs b/crates/common/types/account.rs index d108c192b6b..27524dd7834 100644 --- a/crates/common/types/account.rs +++ b/crates/common/types/account.rs @@ -27,6 +27,8 @@ pub struct Code { } impl Code { + // TODO: also add `from_hashed_bytecode` to optimize the download pipeline, + // where hash is already known and checked. pub fn from_bytecode(code: Bytes) -> Self { let jump_targets = Self::compute_jump_targets(&code); Self { diff --git a/crates/networking/p2p/sync.rs b/crates/networking/p2p/sync.rs index f850a914238..f340f5905f0 100644 --- a/crates/networking/p2p/sync.rs +++ b/crates/networking/p2p/sync.rs @@ -17,6 +17,7 @@ use crate::{ peer_handler::{HASH_MAX, MAX_BLOCK_BODIES_TO_REQUEST, PeerHandler}, }; use ethrex_blockchain::{BatchBlockProcessingFailure, Blockchain, error::ChainError}; +use ethrex_common::types::Code; use ethrex_common::{ BigEndianHash, H256, U256, constants::{EMPTY_KECCACK_HASH, EMPTY_TRIE_HASH}, @@ -949,7 +950,10 @@ impl Syncer { store .write_account_code_batch( - code_hashes_to_download.drain(..).zip(bytecodes).collect(), + code_hashes_to_download + .drain(..) + .zip(bytecodes.into_iter().map(Code::from_bytecode)) + .collect(), ) .await?; } @@ -967,7 +971,10 @@ impl Syncer { .ok_or(SyncError::BytecodesNotFound)?; store .write_account_code_batch( - code_hashes_to_download.into_iter().zip(bytecodes).collect(), + code_hashes_to_download + .drain(..) + .zip(bytecodes.into_iter().map(Code::from_bytecode)) + .collect(), ) .await?; } diff --git a/crates/storage/api.rs b/crates/storage/api.rs index 1646a7f9830..b9e0f2b3991 100644 --- a/crates/storage/api.rs +++ b/crates/storage/api.rs @@ -361,7 +361,7 @@ pub trait StoreEngine: Debug + Send + Sync + RefUnwindSafe { async fn write_account_code_batch( &self, - account_codes: Vec<(H256, Bytes)>, + account_codes: Vec<(H256, Code)>, ) -> Result<(), StoreError>; /// Add a batch of headers downloaded during fullsync diff --git a/crates/storage/store.rs b/crates/storage/store.rs index 4284bab414e..65ef7e65b0e 100644 --- a/crates/storage/store.rs +++ b/crates/storage/store.rs @@ -1336,7 +1336,7 @@ impl Store { pub async fn write_account_code_batch( &self, - account_codes: Vec<(H256, Bytes)>, + account_codes: Vec<(H256, Code)>, ) -> Result<(), StoreError> { self.engine.write_account_code_batch(account_codes).await } diff --git a/crates/storage/store_db/in_memory.rs b/crates/storage/store_db/in_memory.rs index b19147dc5d6..7454ce85b8c 100644 --- a/crates/storage/store_db/in_memory.rs +++ b/crates/storage/store_db/in_memory.rs @@ -687,14 +687,12 @@ impl StoreEngine for Store { async fn write_account_code_batch( &self, - account_codes: Vec<(H256, Bytes)>, + account_codes: Vec<(H256, Code)>, ) -> Result<(), StoreError> { let mut store = self.inner()?; for (code_hash, code) in account_codes { - store - .account_codes - .insert(code_hash, Code::from_bytecode(code)); + store.account_codes.insert(code_hash, code); } Ok(()) diff --git a/crates/storage/store_db/rocksdb.rs b/crates/storage/store_db/rocksdb.rs index ba0e2cbdaed..9fde42df794 100644 --- a/crates/storage/store_db/rocksdb.rs +++ b/crates/storage/store_db/rocksdb.rs @@ -1690,14 +1690,22 @@ impl StoreEngine for Store { async fn write_account_code_batch( &self, - account_codes: Vec<(H256, Bytes)>, + account_codes: Vec<(H256, Code)>, ) -> Result<(), StoreError> { let mut batch_ops = Vec::new(); for (code_hash, code) in account_codes { let key = code_hash.as_bytes().to_vec(); - let value = AccountCodeRLP::from(code).bytes().clone(); - batch_ops.push((CF_ACCOUNT_CODES.to_string(), key, value)); + let mut buf = Vec::with_capacity(6 + code.bytecode.len() + 2 * code.jump_targets.len()); + code.bytecode.encode(&mut buf); + unsafe { + std::slice::from_raw_parts( + code.jump_targets.as_ptr().cast(), + 2 * code.jump_targets.len(), + ) + } + .encode(&mut buf); + batch_ops.push((CF_ACCOUNT_CODES.to_string(), key, buf)); } self.write_batch_async(batch_ops).await diff --git a/tooling/archive_sync/src/main.rs b/tooling/archive_sync/src/main.rs index 5417fefd563..4ff5318d6fa 100644 --- a/tooling/archive_sync/src/main.rs +++ b/tooling/archive_sync/src/main.rs @@ -5,7 +5,7 @@ lazy_static::lazy_static! { use clap::{ArgGroup, Parser}; use ethrex::initializers::open_store; use ethrex::utils::{default_datadir, init_datadir}; -use ethrex_common::types::BlockHash; +use ethrex_common::types::{BlockHash, Code}; use ethrex_common::utils::keccak; use ethrex_common::{Address, serde_utils}; use ethrex_common::{BigEndianHash, Bytes, H256, U256, types::BlockNumber}; @@ -147,7 +147,7 @@ async fn process_dump(dump: Dump, store: Store, current_root: H256) -> eyre::Res // Add code to DB if it is not empty if dump_account.code_hash != *EMPTY_KECCACK_HASH { store - .add_account_code(dump_account.code_hash, dump_account.code.clone()) + .add_account_code(Code::from_bytecode(dump_account.code.clone())) .await?; } // Process storage trie if it is not empty From a2ed2337c9bf2af65cb01279c27b750c3728f006 Mon Sep 17 00:00:00 2001 From: Mario Rugiero Date: Mon, 20 Oct 2025 15:05:46 -0300 Subject: [PATCH 03/17] fixes --- crates/common/types/account.rs | 2 +- crates/l2/networking/rpc/l2/transaction.rs | 5 +++-- crates/storage/rlp.rs | 1 - crates/storage/store.rs | 3 +-- crates/storage/store_db/in_memory.rs | 1 - crates/storage/store_db/rocksdb.rs | 2 +- crates/storage/trie_db/rocksdb.rs | 2 +- 7 files changed, 7 insertions(+), 9 deletions(-) diff --git a/crates/common/types/account.rs b/crates/common/types/account.rs index 27524dd7834..a514bbdc191 100644 --- a/crates/common/types/account.rs +++ b/crates/common/types/account.rs @@ -48,7 +48,7 @@ impl Code { targets.push(i as u16); } c @ 0x60..0x80 => { - i += (c - 0x59) as usize; + i += (c - 0x5F) as usize; } _ => (), } diff --git a/crates/l2/networking/rpc/l2/transaction.rs b/crates/l2/networking/rpc/l2/transaction.rs index 93accede0a8..22a73cddff2 100644 --- a/crates/l2/networking/rpc/l2/transaction.rs +++ b/crates/l2/networking/rpc/l2/transaction.rs @@ -101,8 +101,9 @@ impl RpcHandler for SponsoredTx { .map_err(RpcErr::from)? .unwrap_or_default(); - let prefix: Vec = code.bytecode.iter().take(3).copied().collect(); - if code.bytecode.len() != EIP7702_DELEGATED_CODE_LEN || prefix != DELGATION_PREFIX { + if code.bytecode.len() != EIP7702_DELEGATED_CODE_LEN + || code.bytecode[..3] != DELGATION_PREFIX + { return Err(RpcErr::InvalidEthrexL2Message( "Invalid tx trying to call non delegated account".to_string(), )); diff --git a/crates/storage/rlp.rs b/crates/storage/rlp.rs index aea365788af..4daccd18a6b 100644 --- a/crates/storage/rlp.rs +++ b/crates/storage/rlp.rs @@ -10,7 +10,6 @@ use ethrex_rlp::{decode::RLPDecode, encode::RLPEncode}; // Account types pub type AccountCodeHashRLP = Rlp; -pub type AccountCodeRLP = Rlp; // Block types pub type BlockHashRLP = Rlp; diff --git a/crates/storage/store.rs b/crates/storage/store.rs index 65ef7e65b0e..080f39768f0 100644 --- a/crates/storage/store.rs +++ b/crates/storage/store.rs @@ -3,7 +3,6 @@ use crate::store_db::in_memory::Store as InMemoryStore; #[cfg(feature = "rocksdb")] use crate::store_db::rocksdb::Store as RocksDBStore; use crate::{api::StoreEngine, apply_prefix}; -use bytes::Bytes; use ethereum_types::{Address, H256, U256}; use ethrex_common::{ @@ -1720,8 +1719,8 @@ mod tests { } async fn test_store_account_code(store: Store) { - let code_hash = H256::random(); let code = Code::from_bytecode(Bytes::from("kiwi")); + let code_hash = code.hash; store.add_account_code(code.clone()).await.unwrap(); diff --git a/crates/storage/store_db/in_memory.rs b/crates/storage/store_db/in_memory.rs index 7454ce85b8c..4557ec2c02e 100644 --- a/crates/storage/store_db/in_memory.rs +++ b/crates/storage/store_db/in_memory.rs @@ -6,7 +6,6 @@ use crate::{ store::STATE_TRIE_SEGMENTS, trie_db::layering::{TrieLayerCache, TrieWrapper}, }; -use bytes::Bytes; use ethereum_types::H256; use ethrex_common::types::{ Block, BlockBody, BlockHash, BlockHeader, BlockNumber, ChainConfig, Code, Index, Receipt, diff --git a/crates/storage/store_db/rocksdb.rs b/crates/storage/store_db/rocksdb.rs index 9fde42df794..1e0ebad08f4 100644 --- a/crates/storage/store_db/rocksdb.rs +++ b/crates/storage/store_db/rocksdb.rs @@ -29,7 +29,7 @@ use crate::{ STATE_TRIE_SEGMENTS, UpdateBatch, api::StoreEngine, error::StoreError, - rlp::{AccountCodeRLP, BlockBodyRLP, BlockHashRLP, BlockHeaderRLP, BlockRLP}, + rlp::{BlockBodyRLP, BlockHashRLP, BlockHeaderRLP, BlockRLP}, trie_db::rocksdb::RocksDBTrieDB, utils::{ChainDataIndex, SnapStateIndex}, }; diff --git a/crates/storage/trie_db/rocksdb.rs b/crates/storage/trie_db/rocksdb.rs index 20275feed2d..acf852f60b9 100644 --- a/crates/storage/trie_db/rocksdb.rs +++ b/crates/storage/trie_db/rocksdb.rs @@ -141,7 +141,7 @@ impl TrieDB for RocksDBTrieDB { mod tests { use super::*; use ethrex_trie::Nibbles; - use rocksdb::{ColumnFamilyDescriptor, DBCommon, MultiThreaded, Options}; + use rocksdb::{ColumnFamilyDescriptor, MultiThreaded, Options}; use tempfile::TempDir; #[test] From 8ba26c6b28894a9baff76d07d0dbd8317e5b3b87 Mon Sep 17 00:00:00 2001 From: Edgar Luque Date: Tue, 21 Oct 2025 16:20:12 +0200 Subject: [PATCH 04/17] lint --- crates/storage/api.rs | 1 - crates/storage/rlp.rs | 1 - 2 files changed, 2 deletions(-) diff --git a/crates/storage/api.rs b/crates/storage/api.rs index b9e0f2b3991..d3246a167c1 100644 --- a/crates/storage/api.rs +++ b/crates/storage/api.rs @@ -1,4 +1,3 @@ -use bytes::Bytes; use ethereum_types::H256; use ethrex_common::types::{ Block, BlockBody, BlockHash, BlockHeader, BlockNumber, ChainConfig, Code, Index, Receipt, diff --git a/crates/storage/rlp.rs b/crates/storage/rlp.rs index 4daccd18a6b..7c928772604 100644 --- a/crates/storage/rlp.rs +++ b/crates/storage/rlp.rs @@ -1,7 +1,6 @@ use std::fmt::Debug; use std::marker::PhantomData; -use bytes::Bytes; use ethrex_common::{ H256, types::{Block, BlockBody, BlockHash, BlockHeader, Receipt}, From 94247b6fc8df6e83ff21852e0669cee6b9b1637d Mon Sep 17 00:00:00 2001 From: Edgar Luque Date: Tue, 21 Oct 2025 16:29:52 +0200 Subject: [PATCH 05/17] fixes to comments --- crates/common/types/account.rs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/crates/common/types/account.rs b/crates/common/types/account.rs index a514bbdc191..2fc095e3a19 100644 --- a/crates/common/types/account.rs +++ b/crates/common/types/account.rs @@ -19,10 +19,11 @@ use crate::{ utils::keccak, }; -#[derive(Clone, Default, Debug, PartialEq, Eq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct Code { pub hash: H256, pub bytecode: Bytes, + // TODO: Consider using Arc (needs to enable serde rc feature) pub jump_targets: Vec, } @@ -58,6 +59,12 @@ impl Code { } } +impl AsRef for Code { + fn as_ref(&self) -> &Bytes { + &self.bytecode + } +} + #[derive(Clone, Default, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct Account { pub info: AccountInfo, @@ -101,6 +108,16 @@ impl Default for AccountState { } } +impl Default for Code { + fn default() -> Self { + Self { + bytecode: Bytes::new(), + hash: *EMPTY_KECCACK_HASH, + jump_targets: Vec::new(), + } + } +} + impl From for Account { fn from(genesis: GenesisAccount) -> Self { Self { From cd630b8bc69bc4b6d29cb568e3bfbb2a64ad72e0 Mon Sep 17 00:00:00 2001 From: Edgar Luque Date: Tue, 21 Oct 2025 17:26:38 +0200 Subject: [PATCH 06/17] remove unsafe --- crates/common/types/account.rs | 2 ++ crates/storage/store_db/rocksdb.rs | 27 ++++++--------------------- 2 files changed, 8 insertions(+), 21 deletions(-) diff --git a/crates/common/types/account.rs b/crates/common/types/account.rs index 2fc095e3a19..cedc566c707 100644 --- a/crates/common/types/account.rs +++ b/crates/common/types/account.rs @@ -45,9 +45,11 @@ impl Code { let mut i = 0; while i < code.len() { match code[i] { + // OP_JUMPDEST 0x5B => { targets.push(i as u16); } + // OP_PUSH1..32 c @ 0x60..0x80 => { i += (c - 0x5F) as usize; } diff --git a/crates/storage/store_db/rocksdb.rs b/crates/storage/store_db/rocksdb.rs index f5dcf87dee3..706a5082483 100644 --- a/crates/storage/store_db/rocksdb.rs +++ b/crates/storage/store_db/rocksdb.rs @@ -745,13 +745,8 @@ impl StoreEngine for Store { let mut buf = Vec::with_capacity(6 + code.bytecode.len() + 2 * code.jump_targets.len()); code.bytecode.encode(&mut buf); - unsafe { - std::slice::from_raw_parts( - code.jump_targets.as_ptr().cast(), - 2 * code.jump_targets.len(), - ) - } - .encode(&mut buf); + ethrex_rlp::encode::encode_length(2 * code.jump_targets.len(), &mut buf); + buf.extend(code.jump_targets.into_iter().flat_map(|t| t.to_le_bytes())); batch.put_cf(&cf_codes, code_hash.0, buf); } @@ -1122,13 +1117,8 @@ impl StoreEngine for Store { let hash_key = code.hash.0.to_vec(); let mut buf = Vec::with_capacity(6 + code.bytecode.len() + 2 * code.jump_targets.len()); code.bytecode.encode(&mut buf); - unsafe { - std::slice::from_raw_parts( - code.jump_targets.as_ptr().cast(), - 2 * code.jump_targets.len(), - ) - } - .encode(&mut buf); + ethrex_rlp::encode::encode_length(2 * code.jump_targets.len(), &mut buf); + buf.extend(code.jump_targets.into_iter().flat_map(|t| t.to_le_bytes())); self.write_async(CF_ACCOUNT_CODES, hash_key, buf).await } @@ -1697,13 +1687,8 @@ impl StoreEngine for Store { let key = code_hash.as_bytes().to_vec(); let mut buf = Vec::with_capacity(6 + code.bytecode.len() + 2 * code.jump_targets.len()); code.bytecode.encode(&mut buf); - unsafe { - std::slice::from_raw_parts( - code.jump_targets.as_ptr().cast(), - 2 * code.jump_targets.len(), - ) - } - .encode(&mut buf); + ethrex_rlp::encode::encode_length(2 * code.jump_targets.len(), &mut buf); + buf.extend(code.jump_targets.into_iter().flat_map(|t| t.to_le_bytes())); batch_ops.push((CF_ACCOUNT_CODES.to_string(), key, buf)); } From 7beda2880a70f36cec37d783667cd3b5443973df Mon Sep 17 00:00:00 2001 From: Edgar Luque Date: Tue, 21 Oct 2025 17:29:10 +0200 Subject: [PATCH 07/17] add comment, fix ef test --- crates/common/types/block_execution_witness.rs | 1 + tooling/ef_tests/blockchain/types.rs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/common/types/block_execution_witness.rs b/crates/common/types/block_execution_witness.rs index 47eb394182b..3f950a097f0 100644 --- a/crates/common/types/block_execution_witness.rs +++ b/crates/common/types/block_execution_witness.rs @@ -148,6 +148,7 @@ impl TryFrom for GuestProgramState { .collect(); // hash codes + // TODO: codes here probably needs to be Vec, rather than recomputing here. This requires rkyv implementation. let codes_hashed = value .codes .into_iter() diff --git a/tooling/ef_tests/blockchain/types.rs b/tooling/ef_tests/blockchain/types.rs index c9ff6749437..cfff3981682 100644 --- a/tooling/ef_tests/blockchain/types.rs +++ b/tooling/ef_tests/blockchain/types.rs @@ -1,6 +1,6 @@ use bytes::Bytes; use ethrex_common::types::{ - Account as ethrexAccount, AccountInfo, Block as CoreBlock, BlockBody, EIP1559Transaction, + Account as ethrexAccount, AccountInfo, Block as CoreBlock, BlockBody, Code, EIP1559Transaction, EIP2930Transaction, EIP4844Transaction, EIP7702Transaction, LegacyTransaction, Transaction as ethrexTransaction, TxKind, code_hash, }; @@ -567,7 +567,7 @@ impl From for ethrexAccount { balance: val.balance, nonce: val.nonce.as_u64(), }, - code: val.code, + code: Code::from_bytecode(val.code), storage: val .storage .into_iter() From 3a7a1059abe75a9913a8b84f1dcdd64bd2806af5 Mon Sep 17 00:00:00 2001 From: Edgar Luque Date: Tue, 21 Oct 2025 17:30:45 +0200 Subject: [PATCH 08/17] changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ac73eb9a2fb..4c4252791f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## Perf +### 2025-10-21 + +- Instead of lazy computation of blocklist, do greedy computation of allowlist and store the result, fetch it with the DB. [#4961](https://github.com/lambdaclass/ethrex/pull/4961) + ### 2025-10-17 - Replaces incremental iteration with a one-time precompute method that scans the entire bytecode, building a `BitVec` where bits mark valid `JUMPDEST` positions, skipping `PUSH1..PUSH32` data bytes. From 17fcc1ac4b1994e4676eef08a49460843f5b642a Mon Sep 17 00:00:00 2001 From: Edgar Luque Date: Tue, 21 Oct 2025 17:37:13 +0200 Subject: [PATCH 09/17] fix bench --- .../vm/levm/bench/revm_comparison/Cargo.lock | 3819 +++++++++++++++++ .../bench/revm_comparison/src/levm_bench.rs | 22 +- 2 files changed, 3837 insertions(+), 4 deletions(-) create mode 100644 crates/vm/levm/bench/revm_comparison/Cargo.lock diff --git a/crates/vm/levm/bench/revm_comparison/Cargo.lock b/crates/vm/levm/bench/revm_comparison/Cargo.lock new file mode 100644 index 00000000000..6dd89ce9565 --- /dev/null +++ b/crates/vm/levm/bench/revm_comparison/Cargo.lock @@ -0,0 +1,3819 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "addchain" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b2e69442aa5628ea6951fa33e24efe8313f4321a91bd729fc2f75bdfc858570" +dependencies = [ + "num-bigint 0.3.3", + "num-integer", + "num-traits", +] + +[[package]] +name = "ahash" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + +[[package]] +name = "alloy-primitives" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccb3ead547f4532bc8af961649942f0b9c16ee9226e26caa3f38420651cc0bf4" +dependencies = [ + "alloy-rlp", + "bytes", + "cfg-if", + "const-hex", + "derive_more 0.99.20", + "hex-literal", + "itoa", + "k256", + "keccak-asm", + "proptest", + "rand 0.8.5", + "ruint", + "serde", + "tiny-keccak", +] + +[[package]] +name = "alloy-rlp" +version = "0.3.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f70d83b765fdc080dbcd4f4db70d8d23fe4761f2f02ebfa9146b833900634b4" +dependencies = [ + "arrayvec", + "bytes", +] + +[[package]] +name = "anstream" +version = "0.6.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43d5b281e737544384e969a5ccad3f1cdd24b48086a0fc1b2a5262a26b8f4f4a" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5192cca8006f1fd4f7237516f40fa183bb07f8fbdfedaa0036de5ea9b0b45e78" + +[[package]] +name = "anstyle-parse" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e231f6134f61b71076a3eab506c379d4f36122f2af15a9ff04415ea4c3339e2" +dependencies = [ + "windows-sys 0.60.2", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e0633414522a32ffaac8ac6cc8f748e090c5717661fddeea04219e2344f5f2a" +dependencies = [ + "anstyle", + "once_cell_polyfill", + "windows-sys 0.60.2", +] + +[[package]] +name = "anyhow" +version = "1.0.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61" + +[[package]] +name = "ark-bn254" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d69eab57e8d2663efa5c63135b2af4f396d66424f88954c21104125ab6b3e6bc" +dependencies = [ + "ark-ec", + "ark-ff 0.5.0", + "ark-std 0.5.0", +] + +[[package]] +name = "ark-ec" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43d68f2d516162846c1238e755a7c4d131b892b70cc70c471a8e3ca3ed818fce" +dependencies = [ + "ahash", + "ark-ff 0.5.0", + "ark-poly", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "educe", + "fnv", + "hashbrown 0.15.5", + "itertools 0.13.0", + "num-bigint 0.4.6", + "num-integer", + "num-traits", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b3235cc41ee7a12aaaf2c575a2ad7b46713a8a50bda2fc3b003a04845c05dd6" +dependencies = [ + "ark-ff-asm 0.3.0", + "ark-ff-macros 0.3.0", + "ark-serialize 0.3.0", + "ark-std 0.3.0", + "derivative", + "num-bigint 0.4.6", + "num-traits", + "paste", + "rustc_version 0.3.3", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" +dependencies = [ + "ark-ff-asm 0.4.2", + "ark-ff-macros 0.4.2", + "ark-serialize 0.4.2", + "ark-std 0.4.0", + "derivative", + "digest 0.10.7", + "itertools 0.10.5", + "num-bigint 0.4.6", + "num-traits", + "paste", + "rustc_version 0.4.1", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a177aba0ed1e0fbb62aa9f6d0502e9b46dad8c2eab04c14258a1212d2557ea70" +dependencies = [ + "ark-ff-asm 0.5.0", + "ark-ff-macros 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "arrayvec", + "digest 0.10.7", + "educe", + "itertools 0.13.0", + "num-bigint 0.4.6", + "num-traits", + "paste", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db02d390bf6643fb404d3d22d31aee1c4bc4459600aef9113833d17e786c6e44" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-asm" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-asm" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62945a2f7e6de02a31fe400aa489f0e0f5b2502e69f95f853adb82a96c7a6b60" +dependencies = [ + "quote", + "syn 2.0.107", +] + +[[package]] +name = "ark-ff-macros" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fd794a08ccb318058009eefdf15bcaaaaf6f8161eb3345f907222bac38b20" +dependencies = [ + "num-bigint 0.4.6", + "num-traits", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" +dependencies = [ + "num-bigint 0.4.6", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09be120733ee33f7693ceaa202ca41accd5653b779563608f1234f78ae07c4b3" +dependencies = [ + "num-bigint 0.4.6", + "num-traits", + "proc-macro2", + "quote", + "syn 2.0.107", +] + +[[package]] +name = "ark-poly" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "579305839da207f02b89cd1679e50e67b4331e2f9294a57693e5051b7703fe27" +dependencies = [ + "ahash", + "ark-ff 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "educe", + "fnv", + "hashbrown 0.15.5", +] + +[[package]] +name = "ark-serialize" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d6c2b318ee6e10f8c2853e73a83adc0ccb88995aa978d8a3408d492ab2ee671" +dependencies = [ + "ark-std 0.3.0", + "digest 0.9.0", +] + +[[package]] +name = "ark-serialize" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" +dependencies = [ + "ark-std 0.4.0", + "digest 0.10.7", + "num-bigint 0.4.6", +] + +[[package]] +name = "ark-serialize" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f4d068aaf107ebcd7dfb52bc748f8030e0fc930ac8e360146ca54c1203088f7" +dependencies = [ + "ark-serialize-derive", + "ark-std 0.5.0", + "arrayvec", + "digest 0.10.7", + "num-bigint 0.4.6", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "213888f660fddcca0d257e88e54ac05bca01885f258ccdf695bafd77031bb69d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.107", +] + +[[package]] +name = "ark-std" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1df2c09229cbc5a028b1d70e00fdb2acee28b1055dfb5ca73eea49c5a25c4e7c" +dependencies = [ + "num-traits", + "rand 0.8.5", +] + +[[package]] +name = "ark-std" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits", + "rand 0.8.5", +] + +[[package]] +name = "ark-std" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "246a225cc6131e9ee4f24619af0f19d67761fff15d7ccc22e42b80846e69449a" +dependencies = [ + "num-traits", + "rand 0.8.5", +] + +[[package]] +name = "arrayref" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" + +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + +[[package]] +name = "async-trait" +version = "0.1.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.107", +] + +[[package]] +name = "aurora-engine-modexp" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "518bc5745a6264b5fd7b09dffb9667e400ee9e2bbe18555fac75e1fe9afa0df9" +dependencies = [ + "hex", + "num", +] + +[[package]] +name = "auto_impl" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffdcb70bdbc4d478427380519163274ac86e52916e10f0a8889adf0f96d3fee7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.107", +] + +[[package]] +name = "autocfg" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" + +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + +[[package]] +name = "base64ct" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55248b47b0caf0546f7988906588779981c43bb1bc9d0c44087278f80cdb44ba" + +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + +[[package]] +name = "bit-set" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" + +[[package]] +name = "bitcoin-io" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b47c4ab7a93edb0c7198c5535ed9b52b63095f4e9b45279c6736cec4b856baf" + +[[package]] +name = "bitcoin_hashes" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb18c03d0db0247e147a21a6faafd5a7eb851c743db062de72018b6b7e8e4d16" +dependencies = [ + "bitcoin-io", + "hex-conservative", +] + +[[package]] +name = "bitflags" +version = "2.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3" + +[[package]] +name = "bitvec" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] + +[[package]] +name = "blake3" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3888aaa89e4b2a40fca9848e400f6a658a5a3978de7be858e209cafa8be9a4a0" +dependencies = [ + "arrayref", + "arrayvec", + "cc", + "cfg-if", + "constant_time_eq", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bls12_381" +version = "0.8.0" +source = "git+https://github.com/lambdaclass/bls12_381?branch=expose-fp-struct#219174187bd78154cec35b0809799fc2c991a579" +dependencies = [ + "digest 0.10.7", + "ff", + "group", + "pairing", + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "blst" +version = "0.3.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcdb4c7013139a150f9fc55d123186dbfaba0d912817466282c73ac49e71fb45" +dependencies = [ + "cc", + "glob", + "threadpool", + "zeroize", +] + +[[package]] +name = "bumpalo" +version = "3.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" + +[[package]] +name = "byte-slice-cast" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7575182f7272186991736b70173b0ea045398f984bf5ebbb3804736ce1330c9d" + +[[package]] +name = "bytecheck" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0caa33a2c0edca0419d15ac723dff03f1956f7978329b1e3b5fdaaaed9d3ca8b" +dependencies = [ + "bytecheck_derive", + "ptr_meta", + "rancor", + "simdutf8", +] + +[[package]] +name = "bytecheck_derive" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89385e82b5d1821d2219e0b095efa2cc1f246cbf99080f3be46a1a85c0d392d9" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.107", +] + +[[package]] +name = "bytemuck" +version = "1.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fbdf580320f38b612e485521afda1ee26d10cc9884efaaa750d383e13e3c5f4" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" +dependencies = [ + "serde", +] + +[[package]] +name = "c-kzg" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0307f72feab3300336fb803a57134159f6e20139af1357f36c54cb90d8e8928" +dependencies = [ + "blst", + "cc", + "glob", + "hex", + "libc", + "once_cell", + "serde", +] + +[[package]] +name = "camino" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "276a59bf2b2c967788139340c9f0c5b12d7fd6630315c15c217e559de85d2609" + +[[package]] +name = "cc" +version = "1.2.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac9fe6cdbb24b6ade63616c0a0688e45bb56732262c158df3c0c4bea4ca47cb7" +dependencies = [ + "find-msvc-tools", + "shlex", +] + +[[package]] +name = "cfg-if" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" + +[[package]] +name = "clap" +version = "4.5.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c2cfd7bf8a6017ddaa4e32ffe7403d547790db06bd171c1c53926faab501623" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.5.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a4c05b9e80c5ccd3a7ef080ad7b6ba7d6fc00a985b8b157197075677c82c7a0" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.5.49" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a0b5487afeab2deb2ff4e03a807ad1a03ac532ff5a2cee5d86884440c7f7671" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 2.0.107", +] + +[[package]] +name = "clap_lex" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d728cc89cf3aee9ff92b05e62b19ee65a02b5702cff7d5a377e32c6ae29d8d" + +[[package]] +name = "colorchoice" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" + +[[package]] +name = "const-hex" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3bb320cac8a0750d7f25280aa97b09c26edfe161164238ecbbb31092b079e735" +dependencies = [ + "cfg-if", + "cpufeatures", + "proptest", + "serde_core", +] + +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + +[[package]] +name = "const_format" +version = "0.2.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7faa7469a93a566e9ccc1c73fe783b4a65c274c5ace346038dca9c39fe0030ad" +dependencies = [ + "const_format_proc_macros", +] + +[[package]] +name = "const_format_proc_macros" +version = "0.2.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d57c2eccfb16dbac1f4e61e206105db5820c9d26c3c472bc17c774259ef7744" +dependencies = [ + "proc-macro2", + "quote", + "unicode-xid", +] + +[[package]] +name = "constant_time_eq" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6" + +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + +[[package]] +name = "convert_case" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1137cd7e7fc0fb5d3c5a8678be38ec56e819125d8d7907411fe24ccb943faca8" +dependencies = [ + "crossbeam-channel", + "crossbeam-deque", + "crossbeam-epoch", + "crossbeam-queue", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82b8f8f868b36967f9606790d1903570de9ceaf870a7bf9fbbd3016d636a2cb2" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-queue" +version = "0.3.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f58bbc28f91df819d0aa2a2c00cd19754769c2fad90579b3592b1c9ba7a3115" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" + +[[package]] +name = "crunchy" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" + +[[package]] +name = "crypto-bigint" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" +dependencies = [ + "generic-array", + "rand_core 0.6.4", + "subtle", + "zeroize", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "datatest-stable" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "833306ca7eec4d95844e65f0d7502db43888c5c1006c6c517e8cf51a27d15431" +dependencies = [ + "camino", + "fancy-regex", + "libtest-mimic", + "walkdir", +] + +[[package]] +name = "der" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb" +dependencies = [ + "const-oid", + "pem-rfc7468", + "zeroize", +] + +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive_more" +version = "0.99.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6edb4b64a43d977b8e99788fe3a04d483834fba1215a7e02caa415b626497f7f" +dependencies = [ + "convert_case 0.4.0", + "proc-macro2", + "quote", + "rustc_version 0.4.1", + "syn 2.0.107", +] + +[[package]] +name = "derive_more" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" +dependencies = [ + "convert_case 0.6.0", + "proc-macro2", + "quote", + "syn 2.0.107", + "unicode-xid", +] + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "const-oid", + "crypto-common", + "subtle", +] + +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.107", +] + +[[package]] +name = "dyn-clone" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555" + +[[package]] +name = "ecdsa" +version = "0.16.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" +dependencies = [ + "der", + "digest 0.10.7", + "elliptic-curve", + "rfc6979", + "signature", + "spki", +] + +[[package]] +name = "educe" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7bc049e1bd8cdeb31b68bbd586a9464ecf9f3944af3958a7a9d0f8b9799417" +dependencies = [ + "enum-ordinalize", + "proc-macro2", + "quote", + "syn 2.0.107", +] + +[[package]] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" + +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest 0.10.7", + "ff", + "generic-array", + "group", + "pem-rfc7468", + "pkcs8", + "rand_core 0.6.4", + "sec1", + "subtle", + "zeroize", +] + +[[package]] +name = "enum-ordinalize" +version = "4.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea0dcfa4e54eeb516fe454635a95753ddd39acda650ce703031c6973e315dd5" +dependencies = [ + "enum-ordinalize-derive", +] + +[[package]] +name = "enum-ordinalize-derive" +version = "4.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d28318a75d4aead5c4db25382e8ef717932d0346600cacae6357eb5941bc5ff" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.107", +] + +[[package]] +name = "enumn" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f9ed6b3789237c8a0c1c505af1c7eb2c560df6186f01b098c3a1064ea532f38" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.107", +] + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "errno" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "escape8259" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5692dd7b5a1978a5aeb0ce83b7655c58ca8efdcb79d21036ea249da95afec2c6" + +[[package]] +name = "ethbloom" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c321610643004cf908ec0f5f2aa0d8f1f8e14b540562a2887a1111ff1ecbf7b" +dependencies = [ + "crunchy", + "fixed-hash", + "impl-rlp", + "impl-serde", + "tiny-keccak", +] + +[[package]] +name = "ethereum-types" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ab15ed80916029f878e0267c3a9f92b67df55e79af370bf66199059ae2b4ee3" +dependencies = [ + "ethbloom", + "fixed-hash", + "impl-rlp", + "impl-serde", + "primitive-types 0.13.1", + "uint 0.10.0", +] + +[[package]] +name = "ethrex-blockchain" +version = "4.0.0" +dependencies = [ + "bytes", + "ethrex-common", + "ethrex-metrics", + "ethrex-rlp", + "ethrex-storage", + "ethrex-vm", + "secp256k1 0.30.0", + "sha3", + "thiserror", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "ethrex-common" +version = "4.0.0" +dependencies = [ + "bytes", + "crc32fast", + "ethereum-types", + "ethrex-crypto", + "ethrex-rlp", + "ethrex-trie", + "hex", + "kzg-rs", + "lazy_static", + "libc", + "once_cell", + "rayon", + "rkyv", + "secp256k1 0.30.0", + "serde", + "serde_json", + "sha2", + "sha3", + "thiserror", + "tinyvec", + "tracing", + "url", +] + +[[package]] +name = "ethrex-crypto" +version = "4.0.0" +dependencies = [ + "kzg-rs", + "thiserror", +] + +[[package]] +name = "ethrex-levm" +version = "4.0.0" +dependencies = [ + "ark-bn254", + "ark-ec", + "ark-ff 0.5.0", + "bitvec", + "bls12_381", + "bytes", + "datatest-stable", + "derive_more 1.0.0", + "ethrex-common", + "ethrex-crypto", + "ethrex-rlp", + "k256", + "lambdaworks-math", + "lazy_static", + "malachite", + "p256", + "ripemd", + "secp256k1 0.30.0", + "serde", + "serde_json", + "sha2", + "sha3", + "strum", + "thiserror", + "walkdir", +] + +[[package]] +name = "ethrex-metrics" +version = "4.0.0" +dependencies = [ + "ethrex-common", + "serde", + "serde_json", + "thiserror", + "tracing-subscriber", +] + +[[package]] +name = "ethrex-rlp" +version = "4.0.0" +dependencies = [ + "bytes", + "ethereum-types", + "hex", + "lazy_static", + "snap", + "thiserror", + "tinyvec", +] + +[[package]] +name = "ethrex-storage" +version = "4.0.0" +dependencies = [ + "anyhow", + "async-trait", + "bincode", + "bytes", + "ethereum-types", + "ethrex-common", + "ethrex-rlp", + "ethrex-trie", + "hex", + "serde", + "serde_json", + "sha3", + "thiserror", + "tracing", +] + +[[package]] +name = "ethrex-threadpool" +version = "0.1.0" +dependencies = [ + "crossbeam", +] + +[[package]] +name = "ethrex-trie" +version = "4.0.0" +dependencies = [ + "anyhow", + "bytes", + "crossbeam", + "digest 0.10.7", + "ethereum-types", + "ethrex-rlp", + "ethrex-threadpool", + "hex", + "lazy_static", + "serde", + "serde_json", + "sha3", + "smallvec", + "thiserror", + "tracing", +] + +[[package]] +name = "ethrex-vm" +version = "4.0.0" +dependencies = [ + "bincode", + "bytes", + "derive_more 1.0.0", + "dyn-clone", + "ethereum-types", + "ethrex-common", + "ethrex-levm", + "ethrex-rlp", + "ethrex-trie", + "hex", + "lazy_static", + "rkyv", + "serde", + "sha3", + "thiserror", + "tracing", +] + +[[package]] +name = "fancy-regex" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e24cb5a94bcae1e5408b0effca5cd7172ea3c5755049c5f3af4cd283a165298" +dependencies = [ + "bit-set", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "fastrand" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" + +[[package]] +name = "fastrlp" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "139834ddba373bbdd213dffe02c8d110508dcf1726c2be27e8d1f7d7e1856418" +dependencies = [ + "arrayvec", + "auto_impl", + "bytes", +] + +[[package]] +name = "fastrlp" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce8dba4714ef14b8274c371879b175aa55b16b30f269663f19d576f380018dc4" +dependencies = [ + "arrayvec", + "auto_impl", + "bytes", +] + +[[package]] +name = "ff" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" +dependencies = [ + "bitvec", + "byteorder", + "ff_derive", + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "ff_derive" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f10d12652036b0e99197587c6ba87a8fc3031986499973c030d8b44fcc151b60" +dependencies = [ + "addchain", + "num-bigint 0.3.3", + "num-integer", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "find-msvc-tools" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52051878f80a721bb68ebfbc930e07b65ba72f2da88968ea5c06fd6ca3d3a127" + +[[package]] +name = "fixed-hash" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" +dependencies = [ + "byteorder", + "rand 0.8.5", + "rustc-hex", + "static_assertions", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + +[[package]] +name = "form_urlencoded" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + +[[package]] +name = "futures-core" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" + +[[package]] +name = "futures-macro" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.107", +] + +[[package]] +name = "futures-sink" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" + +[[package]] +name = "futures-task" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" + +[[package]] +name = "futures-util" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" +dependencies = [ + "futures-core", + "futures-macro", + "futures-task", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "gcd" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d758ba1b47b00caf47f24925c0074ecb20d6dfcffe7f6d53395c0465674841a" + +[[package]] +name = "generic-array" +version = "0.14.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bb6743198531e02858aeaea5398fcc883e71851fcbcb5a2f773e2fb6cb1edf2" +dependencies = [ + "typenum", + "version_check", + "zeroize", +] + +[[package]] +name = "getrandom" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "getrandom" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" +dependencies = [ + "cfg-if", + "libc", + "r-efi", + "wasip2", +] + +[[package]] +name = "glob" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280" + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash", + "allocator-api2", +] + +[[package]] +name = "hashbrown" +version = "0.15.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" +dependencies = [ + "allocator-api2", + "foldhash", +] + +[[package]] +name = "hashbrown" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5419bdc4f6a9207fbeba6d11b604d481addf78ecd10c11ad51e76c2f6482748d" + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hermit-abi" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-conservative" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5313b072ce3c597065a808dbf612c4c8e8590bdbf8b579508bf7a762c5eae6cd" +dependencies = [ + "arrayvec", +] + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest 0.10.7", +] + +[[package]] +name = "icu_collections" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "200072f5d0e3614556f94a9930d5dc3e0662a652823904c3a75dc3b0af7fee47" +dependencies = [ + "displaydoc", + "potential_utf", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locale_core" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cde2700ccaed3872079a65fb1a78f6c0a36c91570f28755dda67bc8f7d9f00a" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_normalizer" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "436880e8e18df4d7bbc06d58432329d6458cc84531f7ac5f024e93deadb37979" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00210d6893afc98edb752b664b8890f0ef174c8adbb8d0be9710fa66fbbf72d3" + +[[package]] +name = "icu_properties" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "016c619c1eeb94efb86809b015c58f479963de65bdb6253345c1a1276f22e32b" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "potential_utf", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "298459143998310acd25ffe6810ed544932242d3f07083eee1084d83a71bd632" + +[[package]] +name = "icu_provider" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03c80da27b5f4187909049ee2d72f276f0d9f99a42c306bd0131ecfe04d8e5af" +dependencies = [ + "displaydoc", + "icu_locale_core", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerotrie", + "zerovec", +] + +[[package]] +name = "idna" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "impl-codec" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" +dependencies = [ + "parity-scale-codec", +] + +[[package]] +name = "impl-codec" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d40b9d5e17727407e55028eafc22b2dc68781786e6d7eb8a21103f5058e3a14" +dependencies = [ + "parity-scale-codec", +] + +[[package]] +name = "impl-rlp" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54ed8ad1f3877f7e775b8cbf30ed1bd3209a95401817f19a0eb4402d13f8cf90" +dependencies = [ + "rlp 0.6.1", +] + +[[package]] +name = "impl-serde" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a143eada6a1ec4aefa5049037a26a6d597bfd64f8c026d07b77133e02b7dd0b" +dependencies = [ + "serde", +] + +[[package]] +name = "impl-trait-for-tuples" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0eb5a3343abf848c0984fe4604b2b105da9539376e24fc0a3b0007411ae4fd9" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.107", +] + +[[package]] +name = "indexmap" +version = "2.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6717a8d2a5a929a1a2eb43a12812498ed141a0bcfb7e8f7844fbdbe4303bba9f" +dependencies = [ + "equivalent", + "hashbrown 0.16.0", +] + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" + +[[package]] +name = "js-sys" +version = "0.3.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec48937a97411dcb524a265206ccd4c90bb711fca92b2792c407f268825b9305" +dependencies = [ + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "k256" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6e3919bbaa2945715f0bb6d3934a173d1e9a59ac23767fbaaef277265a7411b" +dependencies = [ + "cfg-if", + "ecdsa", + "elliptic-curve", + "once_cell", + "sha2", + "signature", +] + +[[package]] +name = "keccak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" +dependencies = [ + "cpufeatures", +] + +[[package]] +name = "keccak-asm" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "505d1856a39b200489082f90d897c3f07c455563880bc5952e38eabf731c83b6" +dependencies = [ + "digest 0.10.7", + "sha3-asm", +] + +[[package]] +name = "kzg-rs" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9201effeea3fcc93b587904ae2df9ce97e433184b9d6d299e9ebc9830a546636" +dependencies = [ + "ff", + "hex", + "serde_arrays", + "sha2", + "sp1_bls12_381", + "spin", +] + +[[package]] +name = "lambdaworks-math" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "708d148956bcdc21ae5c432b4e20bbaa26fd68d5376a3a6c461f41095abea0ba" +dependencies = [ + "rayon", + "serde", + "serde_json", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +dependencies = [ + "spin", +] + +[[package]] +name = "libc" +version = "0.2.177" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2874a2af47a2325c2001a6e6fad9b16a53b802102b528163885171cf92b15976" + +[[package]] +name = "libm" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de" + +[[package]] +name = "libtest-mimic" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5297962ef19edda4ce33aaa484386e0a5b3d7f2f4e037cbeee00503ef6b29d33" +dependencies = [ + "anstream", + "anstyle", + "clap", + "escape8259", +] + +[[package]] +name = "linux-raw-sys" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039" + +[[package]] +name = "litemap" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956" + +[[package]] +name = "log" +version = "0.4.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34080505efa8e45a4b816c349525ebe327ceaa8559756f0356cba97ef3bf7432" + +[[package]] +name = "malachite" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec410515e231332b14cd986a475d1c3323bcfa4c7efc038bfa1d5b410b1c57e4" +dependencies = [ + "malachite-base", + "malachite-nz", + "malachite-q", +] + +[[package]] +name = "malachite-base" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c738d3789301e957a8f7519318fcbb1b92bb95863b28f6938ae5a05be6259f34" +dependencies = [ + "hashbrown 0.15.5", + "itertools 0.14.0", + "libm", + "ryu", +] + +[[package]] +name = "malachite-nz" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1707c9a1fa36ce21749b35972bfad17bbf34cf5a7c96897c0491da321e387d3b" +dependencies = [ + "itertools 0.14.0", + "libm", + "malachite-base", + "wide", +] + +[[package]] +name = "malachite-q" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d764801aa4e96bbb69b389dcd03b50075345131cd63ca2e380bca71cc37a3675" +dependencies = [ + "itertools 0.14.0", + "malachite-base", + "malachite-nz", +] + +[[package]] +name = "matchers" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1525a2a28c7f4fa0fc98bb91ae755d1e2d1505079e05539e35bc876b5d65ae9" +dependencies = [ + "regex-automata", +] + +[[package]] +name = "memchr" +version = "2.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273" + +[[package]] +name = "munge" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e17401f259eba956ca16491461b6e8f72913a0a114e39736ce404410f915a0c" +dependencies = [ + "munge_macro", +] + +[[package]] +name = "munge_macro" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4568f25ccbd45ab5d5603dc34318c1ec56b117531781260002151b8530a9f931" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.107", +] + +[[package]] +name = "nu-ansi-term" +version = "0.50.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "num" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" +dependencies = [ + "num-bigint 0.4.6", + "num-complex", + "num-integer", + "num-iter", + "num-rational", + "num-traits", +] + +[[package]] +name = "num-bigint" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f6f7833f2cbf2360a6cfd58cd41a53aa7a90bd4c202f5b1c7dd2ed73c57b2c3" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-bigint" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-complex" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-iter" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" +dependencies = [ + "num-bigint 0.4.6", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", + "libm", +] + +[[package]] +name = "num_cpus" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91df4bbde75afed763b708b7eee1e8e7651e02d97f6d5dd763e89367e957b23b" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "once_cell" +version = "1.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" + +[[package]] +name = "once_cell_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4895175b425cb1f87721b59f0f286c2092bd4af812243672510e1ac53e2e0ad" + +[[package]] +name = "p256" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +dependencies = [ + "ecdsa", + "elliptic-curve", + "primeorder", + "sha2", +] + +[[package]] +name = "p3-baby-bear" +version = "0.2.3-succinct" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7521838ecab2ddf4f7bc4ceebad06ec02414729598485c1ada516c39900820e8" +dependencies = [ + "num-bigint 0.4.6", + "p3-field", + "p3-mds", + "p3-poseidon2", + "p3-symmetric", + "rand 0.8.5", + "serde", +] + +[[package]] +name = "p3-dft" +version = "0.2.3-succinct" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46414daedd796f1eefcdc1811c0484e4bced5729486b6eaba9521c572c76761a" +dependencies = [ + "p3-field", + "p3-matrix", + "p3-maybe-rayon", + "p3-util", + "tracing", +] + +[[package]] +name = "p3-field" +version = "0.2.3-succinct" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48948a0516b349e9d1cdb95e7236a6ee010c44e68c5cc78b4b92bf1c4022a0d9" +dependencies = [ + "itertools 0.12.1", + "num-bigint 0.4.6", + "num-traits", + "p3-util", + "rand 0.8.5", + "serde", +] + +[[package]] +name = "p3-matrix" +version = "0.2.3-succinct" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e4de3f373589477cb735ea58e125898ed20935e03664b4614c7fac258b3c42f" +dependencies = [ + "itertools 0.12.1", + "p3-field", + "p3-maybe-rayon", + "p3-util", + "rand 0.8.5", + "serde", + "tracing", +] + +[[package]] +name = "p3-maybe-rayon" +version = "0.2.3-succinct" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3968ad1160310296eb04f91a5f4edfa38fe1d6b2b8cd6b5c64e6f9b7370979e" + +[[package]] +name = "p3-mds" +version = "0.2.3-succinct" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2356b1ed0add6d5dfbf7a338ce534a6fde827374394a52cec16a0840af6e97c9" +dependencies = [ + "itertools 0.12.1", + "p3-dft", + "p3-field", + "p3-matrix", + "p3-symmetric", + "p3-util", + "rand 0.8.5", +] + +[[package]] +name = "p3-poseidon2" +version = "0.2.3-succinct" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da1eec7e1b6900581bedd95e76e1ef4975608dd55be9872c9d257a8a9651c3a" +dependencies = [ + "gcd", + "p3-field", + "p3-mds", + "p3-symmetric", + "rand 0.8.5", + "serde", +] + +[[package]] +name = "p3-symmetric" +version = "0.2.3-succinct" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edb439bea1d822623b41ff4b51e3309e80d13cadf8b86d16ffd5e6efb9fdc360" +dependencies = [ + "itertools 0.12.1", + "p3-field", + "serde", +] + +[[package]] +name = "p3-util" +version = "0.2.3-succinct" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c2c2010678b9332b563eaa38364915b585c1a94b5ca61e2c7541c087ddda5c" +dependencies = [ + "serde", +] + +[[package]] +name = "pairing" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81fec4625e73cf41ef4bb6846cafa6d44736525f442ba45e407c4a000a13996f" +dependencies = [ + "group", +] + +[[package]] +name = "parity-scale-codec" +version = "3.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "799781ae679d79a948e13d4824a40970bfa500058d245760dd857301059810fa" +dependencies = [ + "arrayvec", + "bitvec", + "byte-slice-cast", + "const_format", + "impl-trait-for-tuples", + "parity-scale-codec-derive", + "rustversion", + "serde", +] + +[[package]] +name = "parity-scale-codec-derive" +version = "3.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34b4653168b563151153c9e4c08ebed57fb8262bebfa79711552fa983c623e7a" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.107", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "pem-rfc7468" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" +dependencies = [ + "base64ct", +] + +[[package]] +name = "percent-encoding" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" + +[[package]] +name = "pest" +version = "2.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "989e7521a040efde50c3ab6bbadafbe15ab6dc042686926be59ac35d74607df4" +dependencies = [ + "memchr", + "ucd-trie", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der", + "spki", +] + +[[package]] +name = "potential_utf" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84df19adbe5b5a0782edcab45899906947ab039ccf4573713735ee7de1e6b08a" +dependencies = [ + "zerovec", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "primeorder" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", +] + +[[package]] +name = "primitive-types" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" +dependencies = [ + "fixed-hash", + "impl-codec 0.6.0", + "uint 0.9.5", +] + +[[package]] +name = "primitive-types" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d15600a7d856470b7d278b3fe0e311fe28c2526348549f8ef2ff7db3299c87f5" +dependencies = [ + "fixed-hash", + "impl-codec 0.7.1", + "impl-rlp", + "impl-serde", + "uint 0.10.0", +] + +[[package]] +name = "proc-macro-crate" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "219cb19e96be00ab2e37d6e299658a0cfa83e52429179969b0f0121b4ac46983" +dependencies = [ + "toml_edit", +] + +[[package]] +name = "proc-macro2" +version = "1.0.101" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89ae43fd86e4158d6db51ad8e2b80f313af9cc74f5c0e03ccb87de09998732de" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "proptest" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bb0be07becd10686a0bb407298fb425360a5c44a663774406340c59a22de4ce" +dependencies = [ + "bit-set", + "bit-vec", + "bitflags", + "lazy_static", + "num-traits", + "rand 0.9.2", + "rand_chacha 0.9.0", + "rand_xorshift", + "regex-syntax", + "rusty-fork", + "tempfile", + "unarray", +] + +[[package]] +name = "ptr_meta" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b9a0cf95a1196af61d4f1cbdab967179516d9a4a4312af1f31948f8f6224a79" +dependencies = [ + "ptr_meta_derive", +] + +[[package]] +name = "ptr_meta_derive" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7347867d0a7e1208d93b46767be83e2b8f978c3dad35f775ac8d8847551d6fe1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.107", +] + +[[package]] +name = "quick-error" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" + +[[package]] +name = "quote" +version = "1.0.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce25767e7b499d1b604768e7cde645d14cc8584231ea6b295e9c9eb22c02e1d1" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + +[[package]] +name = "rancor" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a063ea72381527c2a0561da9c80000ef822bdd7c3241b1cc1b12100e3df081ee" +dependencies = [ + "ptr_meta", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1" +dependencies = [ + "rand_chacha 0.9.0", + "rand_core 0.9.3", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" +dependencies = [ + "ppv-lite86", + "rand_core 0.9.3", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.16", +] + +[[package]] +name = "rand_core" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" +dependencies = [ + "getrandom 0.3.4", +] + +[[package]] +name = "rand_xorshift" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "513962919efc330f829edb2535844d1b912b0fbe2ca165d613e4e8788bb05a5a" +dependencies = [ + "rand_core 0.9.3", +] + +[[package]] +name = "rayon" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "368f01d005bf8fd9b1206fb6fa653e6c4a81ceb1466406b81792d87c5677a58f" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "regex-automata" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5276caf25ac86c8d810222b3dbb938e512c55c6831a10f3e6ed1c93b84041f1c" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a2d987857b319362043e95f5353c0535c1f58eec5336fdfcf626430af7def58" + +[[package]] +name = "rend" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cadadef317c2f20755a64d7fdc48f9e7178ee6b0e1f7fce33fa60f1d68a276e6" +dependencies = [ + "bytecheck", +] + +[[package]] +name = "revm" +version = "9.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a2c336f9921588e50871c00024feb51a521eca50ce6d01494bb9c50f837c8ed" +dependencies = [ + "auto_impl", + "cfg-if", + "dyn-clone", + "revm-interpreter", + "revm-precompile", + "serde", + "serde_json", +] + +[[package]] +name = "revm-interpreter" +version = "5.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a58182c7454179826f9dad2ca577661963092ce9d0fd0c9d682c1e9215a72e70" +dependencies = [ + "revm-primitives", + "serde", +] + +[[package]] +name = "revm-precompile" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc8af9aa737eef0509a50d9f3cc1a631557a00ef2e70a3aa8a75d9ee0ed275bb" +dependencies = [ + "aurora-engine-modexp", + "blst", + "c-kzg", + "k256", + "once_cell", + "revm-primitives", + "ripemd", + "secp256k1 0.29.1", + "sha2", + "substrate-bn", +] + +[[package]] +name = "revm-primitives" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9bf5d465e64b697da6a111cb19e798b5b2ebb18e5faf2ad48e9e8d47c64add2" +dependencies = [ + "alloy-primitives", + "auto_impl", + "bitflags", + "bitvec", + "c-kzg", + "cfg-if", + "derive_more 0.99.20", + "dyn-clone", + "enumn", + "hashbrown 0.14.5", + "hex", + "once_cell", + "serde", +] + +[[package]] +name = "revm_comparison" +version = "0.1.0" +dependencies = [ + "bytes", + "ethrex-blockchain", + "ethrex-common", + "ethrex-levm", + "ethrex-storage", + "ethrex-vm", + "hex", + "revm", + "sha3", +] + +[[package]] +name = "rfc6979" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" +dependencies = [ + "hmac", + "subtle", +] + +[[package]] +name = "ripemd" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd124222d17ad93a644ed9d011a40f4fb64aa54275c08cc216524a9ea82fb09f" +dependencies = [ + "digest 0.10.7", +] + +[[package]] +name = "rkyv" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35a640b26f007713818e9a9b65d34da1cf58538207b052916a83d80e43f3ffa4" +dependencies = [ + "bytecheck", + "bytes", + "hashbrown 0.15.5", + "indexmap", + "munge", + "ptr_meta", + "rancor", + "rend", + "rkyv_derive", + "tinyvec", + "uuid", +] + +[[package]] +name = "rkyv_derive" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd83f5f173ff41e00337d97f6572e416d022ef8a19f371817259ae960324c482" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.107", +] + +[[package]] +name = "rlp" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb919243f34364b6bd2fc10ef797edbfa75f33c252e7998527479c6d6b47e1ec" +dependencies = [ + "bytes", + "rustc-hex", +] + +[[package]] +name = "rlp" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa24e92bb2a83198bb76d661a71df9f7076b8c420b8696e4d3d97d50d94479e3" +dependencies = [ + "bytes", + "rustc-hex", +] + +[[package]] +name = "ruint" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a68df0380e5c9d20ce49534f292a36a7514ae21350726efe1865bdb1fa91d278" +dependencies = [ + "alloy-rlp", + "ark-ff 0.3.0", + "ark-ff 0.4.2", + "ark-ff 0.5.0", + "bytes", + "fastrlp 0.3.1", + "fastrlp 0.4.0", + "num-bigint 0.4.6", + "num-integer", + "num-traits", + "parity-scale-codec", + "primitive-types 0.12.2", + "proptest", + "rand 0.8.5", + "rand 0.9.2", + "rlp 0.5.2", + "ruint-macro", + "serde_core", + "valuable", + "zeroize", +] + +[[package]] +name = "ruint-macro" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48fd7bd8a6377e15ad9d42a8ec25371b94ddc67abe7c8b9127bec79bebaaae18" + +[[package]] +name = "rustc-hex" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" + +[[package]] +name = "rustc_version" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" +dependencies = [ + "semver 0.11.0", +] + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver 1.0.27", +] + +[[package]] +name = "rustix" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd15f8a2c5551a84d56efdc1cd049089e409ac19a3072d5037a17fd70719ff3e" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.61.2", +] + +[[package]] +name = "rustversion" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" + +[[package]] +name = "rusty-fork" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc6bf79ff24e648f6da1f8d1f011e9cac26491b619e6b9280f2b47f1774e6ee2" +dependencies = [ + "fnv", + "quick-error", + "tempfile", + "wait-timeout", +] + +[[package]] +name = "ryu" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" + +[[package]] +name = "safe_arch" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96b02de82ddbe1b636e6170c21be622223aea188ef2e139be0a5b219ec215323" +dependencies = [ + "bytemuck", +] + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "pkcs8", + "subtle", + "zeroize", +] + +[[package]] +name = "secp256k1" +version = "0.29.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9465315bc9d4566e1724f0fffcbcc446268cb522e60f9a27bcded6b19c108113" +dependencies = [ + "rand 0.8.5", + "secp256k1-sys", +] + +[[package]] +name = "secp256k1" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b50c5943d326858130af85e049f2661ba3c78b26589b8ab98e65e80ae44a1252" +dependencies = [ + "bitcoin_hashes", + "rand 0.8.5", + "secp256k1-sys", +] + +[[package]] +name = "secp256k1-sys" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4387882333d3aa8cb20530a17c69a3752e97837832f34f6dccc760e715001d9" +dependencies = [ + "cc", +] + +[[package]] +name = "semver" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" +dependencies = [ + "semver-parser", +] + +[[package]] +name = "semver" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" + +[[package]] +name = "semver-parser" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9900206b54a3527fdc7b8a938bffd94a568bac4f4aa8113b209df75a09c0dec2" +dependencies = [ + "pest", +] + +[[package]] +name = "serde" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_arrays" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94a16b99c5ea4fe3daccd14853ad260ec00ea043b2708d1fd1da3106dcd8d9df" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.107", +] + +[[package]] +name = "serde_json" +version = "1.0.145" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "402a6f66d8c709116cf22f558eab210f5a50187f702eb4d7e5ef38d9a7f1c79c" +dependencies = [ + "indexmap", + "itoa", + "memchr", + "ryu", + "serde", + "serde_core", +] + +[[package]] +name = "sha2" +version = "0.10.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.7", +] + +[[package]] +name = "sha3" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +dependencies = [ + "digest 0.10.7", + "keccak", +] + +[[package]] +name = "sha3-asm" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c28efc5e327c837aa837c59eae585fc250715ef939ac32881bcc11677cd02d46" +dependencies = [ + "cc", + "cfg-if", +] + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signature" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "digest 0.10.7", + "rand_core 0.6.4", +] + +[[package]] +name = "simdutf8" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" + +[[package]] +name = "slab" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a2ae44ef20feb57a68b23d846850f861394c2e02dc425a50098ae8c90267589" + +[[package]] +name = "smallvec" +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" + +[[package]] +name = "snap" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b6b67fb9a61334225b5b790716f609cd58395f895b3fe8b328786812a40bc3b" + +[[package]] +name = "sp1-lib" +version = "5.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fce8ad0f153443d09d398eccb650a0b2dcbf829470e394e4bf60ec4379c7af93" +dependencies = [ + "bincode", + "serde", + "sp1-primitives", +] + +[[package]] +name = "sp1-primitives" +version = "5.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0244dee3a7a0f88cf71c3edf518f4fc97794ae870a107cbe7c810ac3fbf879cb" +dependencies = [ + "bincode", + "blake3", + "cfg-if", + "hex", + "lazy_static", + "num-bigint 0.4.6", + "p3-baby-bear", + "p3-field", + "p3-poseidon2", + "p3-symmetric", + "serde", + "sha2", +] + +[[package]] +name = "sp1_bls12_381" +version = "0.8.0-sp1-5.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac255e1704ebcdeec5e02f6a0ebc4d2e9e6b802161938330b6810c13a610c583" +dependencies = [ + "cfg-if", + "ff", + "group", + "pairing", + "rand_core 0.6.4", + "sp1-lib", + "subtle", +] + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + +[[package]] +name = "spki" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" +dependencies = [ + "base64ct", + "der", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "strum" +version = "0.27.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af23d6f6c1a224baef9d3f61e287d2761385a5b88fdab4eb4c6f11aeb54c4bcf" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.27.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7695ce3845ea4b33927c055a39dc438a45b059f7c1b3d91d38d10355fb8cbca7" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 2.0.107", +] + +[[package]] +name = "substrate-bn" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b5bbfa79abbae15dd642ea8176a21a635ff3c00059961d1ea27ad04e5b441c" +dependencies = [ + "byteorder", + "crunchy", + "lazy_static", + "rand 0.8.5", + "rustc-hex", +] + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.107" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a26dbd934e5451d21ef060c018dae56fc073894c5a7896f882928a76e6d081b" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "synstructure" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.107", +] + +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + +[[package]] +name = "tempfile" +version = "3.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d31c77bdf42a745371d260a26ca7163f1e0924b64afa0b688e61b5a9fa02f16" +dependencies = [ + "fastrand", + "getrandom 0.3.4", + "once_cell", + "rustix", + "windows-sys 0.61.2", +] + +[[package]] +name = "thiserror" +version = "2.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f63587ca0f12b72a0600bcba1d40081f830876000bb46dd2337a3051618f4fc8" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ff15c8ecd7de3849db632e14d18d2571fa09dfc5ed93479bc4485c7a517c913" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.107", +] + +[[package]] +name = "thread_local" +version = "1.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "threadpool" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d050e60b33d41c19108b32cea32164033a9013fe3b46cbd4457559bfbf77afaa" +dependencies = [ + "num_cpus", +] + +[[package]] +name = "tiny-keccak" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" +dependencies = [ + "crunchy", +] + +[[package]] +name = "tinystr" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d4f6d1145dcb577acf783d4e601bc1d76a13337bb54e6233add580b07344c8b" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tinyvec" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa5fdc3bce6191a1dbc8c02d5c8bffcf557bafa17c124c5264a458f1b0613fa" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff360e02eab121e0bc37a2d3b4d4dc622e6eda3a8e5253d5435ecf5bd4c68408" +dependencies = [ + "pin-project-lite", +] + +[[package]] +name = "tokio-util" +version = "0.7.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14307c986784f72ef81c89db7d9e28d6ac26d16213b109ea501696195e6e3ce5" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "futures-util", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "toml_datetime" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2cdb639ebbc97961c51720f858597f7f24c4fc295327923af55b74c3c724533" +dependencies = [ + "serde_core", +] + +[[package]] +name = "toml_edit" +version = "0.23.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6485ef6d0d9b5d0ec17244ff7eb05310113c3f316f2d14200d4de56b3cb98f8d" +dependencies = [ + "indexmap", + "toml_datetime", + "toml_parser", + "winnow", +] + +[[package]] +name = "toml_parser" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0cbe268d35bdb4bb5a56a2de88d0ad0eb70af5384a99d648cd4b3d04039800e" +dependencies = [ + "winnow", +] + +[[package]] +name = "tracing" +version = "0.1.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" +dependencies = [ + "log", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81383ab64e72a7a8b8e13130c49e3dab29def6d0c7d76a03087b3cf71c5c6903" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.107", +] + +[[package]] +name = "tracing-core" +version = "0.1.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2054a14f5307d601f88daf0553e1cbf472acc4f2c51afab632431cdcd72124d5" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex-automata", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", +] + +[[package]] +name = "typenum" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb" + +[[package]] +name = "ucd-trie" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" + +[[package]] +name = "uint" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52" +dependencies = [ + "byteorder", + "crunchy", + "hex", + "static_assertions", +] + +[[package]] +name = "uint" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "909988d098b2f738727b161a106cfc7cab00c539c2687a8836f8e565976fb53e" +dependencies = [ + "byteorder", + "crunchy", + "hex", + "static_assertions", +] + +[[package]] +name = "unarray" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" + +[[package]] +name = "unicode-ident" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "462eeb75aeb73aea900253ce739c8e18a67423fadf006037cd3ff27e82748a06" + +[[package]] +name = "unicode-segmentation" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" + +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + +[[package]] +name = "url" +version = "2.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08bc136a29a3d1758e07a9cca267be308aeebf5cfd5a10f3f67ab2097683ef5b" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", +] + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[package]] +name = "uuid" +version = "1.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f87b8aa10b915a06587d0dec516c282ff295b475d94abf425d62b57710070a2" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "valuable" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "wait-timeout" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ac3b126d3914f9849036f826e054cbabdc8519970b8998ddaf3b5bd3c65f11" +dependencies = [ + "libc", +] + +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "wasip2" +version = "1.0.1+wasi-0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0562428422c63773dad2c345a1882263bbf4d65cf3f42e90921f787ef5ad58e7" +dependencies = [ + "wit-bindgen", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1da10c01ae9f1ae40cbfac0bac3b1e724b320abfcf52229f80b547c0d250e2d" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "671c9a5a66f49d8a47345ab942e2cb93c7d1d0339065d4f8139c486121b43b19" +dependencies = [ + "bumpalo", + "log", + "proc-macro2", + "quote", + "syn 2.0.107", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ca60477e4c59f5f2986c50191cd972e3a50d8a95603bc9434501cf156a9a119" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f07d2f20d4da7b26400c9f4a0511e6e0345b040694e8a75bd41d578fa4421d7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.107", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bad67dc8b2a1a6e5448428adec4c3e84c43e561d8c9ee8a9e5aabeb193ec41d1" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "wide" +version = "0.7.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce5da8ecb62bcd8ec8b7ea19f69a51275e91299be594ea5cc6ef7819e16cd03" +dependencies = [ + "bytemuck", + "safe_arch", +] + +[[package]] +name = "winapi-util" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-targets" +version = "0.53.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" +dependencies = [ + "windows-link", + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" + +[[package]] +name = "windows_i686_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" + +[[package]] +name = "windows_i686_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" + +[[package]] +name = "winnow" +version = "0.7.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21a0236b59786fed61e2a80582dd500fe61f18b5dca67a4a067d0bc9039339cf" +dependencies = [ + "memchr", +] + +[[package]] +name = "wit-bindgen" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59" + +[[package]] +name = "writeable" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb" + +[[package]] +name = "wyz" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", +] + +[[package]] +name = "yoke" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f41bb01b8226ef4bfd589436a297c53d118f65921786300e427be8d487695cc" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38da3c9736e16c5d3c8c597a9aaa5d1fa565d0532ae05e27c24aa62fb32c0ab6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.107", + "synstructure", +] + +[[package]] +name = "zerocopy" +version = "0.8.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0894878a5fa3edfd6da3f88c4805f4c8558e2b996227a3d864f47fe11e38282c" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88d2b8d9c68ad2b9e4340d7832716a4d21a22a1154777ad56ea55c51a9cf3831" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.107", +] + +[[package]] +name = "zerofrom" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.107", + "synstructure", +] + +[[package]] +name = "zeroize" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.107", +] + +[[package]] +name = "zerotrie" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36f0bbd478583f79edad978b407914f61b2972f5af6fa089686016be8f9af595" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + +[[package]] +name = "zerovec" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7aa2bd55086f1ab526693ecbe444205da57e25f4489879da80635a46d90e73b" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b96237efa0c878c64bd89c436f661be4e46b2f3eff1ebb976f7ef2321d2f58f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.107", +] diff --git a/crates/vm/levm/bench/revm_comparison/src/levm_bench.rs b/crates/vm/levm/bench/revm_comparison/src/levm_bench.rs index bb5b95ccec5..a56437e0610 100644 --- a/crates/vm/levm/bench/revm_comparison/src/levm_bench.rs +++ b/crates/vm/levm/bench/revm_comparison/src/levm_bench.rs @@ -3,7 +3,7 @@ use ethrex_blockchain::vm::StoreVmDatabase; use ethrex_common::H256; use ethrex_common::{ Address, U256, - types::{Account, EIP1559Transaction, Transaction, TxKind}, + types::{Account, Code, EIP1559Transaction, Transaction, TxKind}, }; use ethrex_levm::errors::VMError; use ethrex_levm::{ @@ -58,18 +58,32 @@ fn init_db(bytecode: Bytes) -> GeneralizedDatabase { let cache = BTreeMap::from([ ( Address::from_low_u64_be(CONTRACT_ADDRESS), - Account::new(U256::MAX, bytecode.clone(), 0, BTreeMap::new()), + Account::new( + U256::MAX, + Code::from_bytecode(bytecode.clone()), + 0, + BTreeMap::new(), + ), ), ( Address::from_low_u64_be(SENDER_ADDRESS), - Account::new(U256::MAX, Bytes::new(), 0, BTreeMap::new()), + Account::new( + U256::MAX, + Code::from_bytecode(Bytes::new()), + 0, + BTreeMap::new(), + ), ), ]); GeneralizedDatabase::new_with_account_state(Arc::new(store), cache) } -fn init_vm(db: &mut GeneralizedDatabase, nonce: u64, calldata: Bytes) -> Result { +fn init_vm( + db: &'_ mut GeneralizedDatabase, + nonce: u64, + calldata: Bytes, +) -> Result, VMError> { let env = Environment { origin: Address::from_low_u64_be(SENDER_ADDRESS), tx_nonce: nonce, From 39b3c00dec68cd66619c572c8b3a40fdf6d9e9ba Mon Sep 17 00:00:00 2001 From: Edgar Luque Date: Tue, 21 Oct 2025 17:43:47 +0200 Subject: [PATCH 10/17] fix compile errors --- crates/common/constants.rs | 10 ++-------- crates/common/trie/node_hash.rs | 11 ++++------- crates/common/trie/trie.rs | 5 ++--- crates/vm/levm/src/precompiles.rs | 4 +--- tooling/ef_tests/state/report.rs | 8 ++++---- tooling/ef_tests/state/runner/revm_db.rs | 18 +++++++++++------- tooling/ef_tests/state/runner/revm_runner.rs | 4 ++-- 7 files changed, 26 insertions(+), 34 deletions(-) diff --git a/crates/common/constants.rs b/crates/common/constants.rs index 1de461674e2..b6fe881bdd0 100644 --- a/crates/common/constants.rs +++ b/crates/common/constants.rs @@ -35,14 +35,8 @@ pub static EMPTY_KECCACK_HASH: LazyLock = LazyLock::new(|| { ) }); -pub static EMPTY_TRIE_HASH: LazyLock = LazyLock::new(|| { - H256::from_slice( - Keccak256::new() - .chain_update([RLP_NULL]) - .finalize() - .as_slice(), - ) -}); +pub static EMPTY_TRIE_HASH: LazyLock = + LazyLock::new(|| H256::from_slice(&Keccak256::new().chain_update([RLP_NULL]).finalize())); // Request related pub static DEPOSIT_TOPIC: LazyLock = LazyLock::new(|| { diff --git a/crates/common/trie/node_hash.rs b/crates/common/trie/node_hash.rs index 5588a50f659..a1fa55e7320 100644 --- a/crates/common/trie/node_hash.rs +++ b/crates/common/trie/node_hash.rs @@ -27,7 +27,7 @@ impl NodeHash { pub fn from_encoded_raw(encoded: &[u8]) -> NodeHash { if encoded.len() >= 32 { let hash = Keccak256::new_with_prefix(encoded).finalize(); - NodeHash::Hashed(H256::from_slice(hash.as_slice())) + NodeHash::Hashed(H256::from_slice(&hash)) } else { NodeHash::from_slice(encoded) } @@ -51,12 +51,9 @@ impl NodeHash { /// NOTE: This will hash smaller nodes, only use to get the final root hash, not for intermediate node hashes pub fn finalize(self) -> H256 { match self { - NodeHash::Inline(_) => H256::from_slice( - Keccak256::new() - .chain_update(self.as_ref()) - .finalize() - .as_slice(), - ), + NodeHash::Inline(_) => { + H256::from_slice(&Keccak256::new().chain_update(self.as_ref()).finalize()) + } NodeHash::Hashed(x) => x, } } diff --git a/crates/common/trie/trie.rs b/crates/common/trie/trie.rs index eea5b1eba6f..d4787678cf4 100644 --- a/crates/common/trie/trie.rs +++ b/crates/common/trie/trie.rs @@ -34,10 +34,9 @@ use lazy_static::lazy_static; lazy_static! { // Hash value for an empty trie, equal to keccak(RLP_NULL) pub static ref EMPTY_TRIE_HASH: H256 = H256::from_slice( - Keccak256::new() + &Keccak256::new() .chain_update([RLP_NULL]) - .finalize() - .as_slice(), + .finalize(), ); } diff --git a/crates/vm/levm/src/precompiles.rs b/crates/vm/levm/src/precompiles.rs index 130b71e288b..513c48d334c 100644 --- a/crates/vm/levm/src/precompiles.rs +++ b/crates/vm/levm/src/precompiles.rs @@ -457,9 +457,7 @@ pub fn sha2_256(calldata: &Bytes, gas_remaining: &mut u64, _fork: Fork) -> Resul increase_precompile_consumed_gas(gas_cost, gas_remaining)?; let digest = sha2::Sha256::digest(calldata); - let result = digest.as_slice(); - - Ok(Bytes::copy_from_slice(result)) + Ok(Bytes::copy_from_slice(&digest)) } /// Returns the calldata hashed by ripemd-160 algorithm, padded by zeros at left diff --git a/tooling/ef_tests/state/report.rs b/tooling/ef_tests/state/report.rs index b64925f34f9..a475ea165b2 100644 --- a/tooling/ef_tests/state/report.rs +++ b/tooling/ef_tests/state/report.rs @@ -709,18 +709,18 @@ impl fmt::Display for ComparisonReport { writeln!( f, "\t\t\t\t\tCode: {} -> {}", - if base_account.code.is_empty() { + if base_account.code.bytecode.is_empty() { "empty".to_string() } else { - hex::encode(&base_account.code) + hex::encode(&base_account.code.bytecode) }, account_update .code .as_ref() - .map(|code| if code.is_empty() { + .map(|code| if code.bytecode.is_empty() { "empty".to_string() } else { - hex::encode(code) + hex::encode(&code.bytecode) }) .expect("If code hash changed then 'code' shouldn't be None.") )?; diff --git a/tooling/ef_tests/state/runner/revm_db.rs b/tooling/ef_tests/state/runner/revm_db.rs index 28556b4ed40..cf0ab4e0fb0 100644 --- a/tooling/ef_tests/state/runner/revm_db.rs +++ b/tooling/ef_tests/state/runner/revm_db.rs @@ -1,10 +1,10 @@ -use ethrex_common::types::{AccountInfo, AccountUpdate, ChainConfig}; +use ethrex_common::types::{AccountInfo, AccountUpdate, ChainConfig, Code}; use ethrex_common::{Address as CoreAddress, BigEndianHash, H256, U256}; use ethrex_vm::{DynVmDatabase, EvmError, VmDatabase}; use revm::context::DBErrorMarker; -use revm::database::states::{bundle_state::BundleRetention, AccountStatus}; +use revm::database::states::{AccountStatus, bundle_state::BundleRetention}; use revm::primitives::{ - Address as RevmAddress, Bytes as RevmBytes, B256 as RevmB256, U256 as RevmU256, + Address as RevmAddress, B256 as RevmB256, Bytes as RevmBytes, U256 as RevmU256, }; use revm::state::{AccountInfo as RevmAccountInfo, Bytecode as RevmBytecode}; @@ -74,7 +74,7 @@ impl revm::Database for RevmDynVmDatabase { fn code_by_hash(&mut self, code_hash: RevmB256) -> Result { let code = ::get_account_code(self.0.as_ref(), H256::from(code_hash.as_ref()))?; - Ok(RevmBytecode::new_raw(RevmBytes(code))) + Ok(RevmBytecode::new_raw(RevmBytes(code.bytecode))) } fn storage(&mut self, address: RevmAddress, index: RevmU256) -> Result { @@ -117,7 +117,7 @@ impl revm::DatabaseRef for RevmDynVmDatabase { fn code_by_hash_ref(&self, code_hash: RevmB256) -> Result { let code = ::get_account_code(self.0.as_ref(), H256::from(code_hash.as_ref()))?; - Ok(RevmBytecode::new_raw(RevmBytes(code))) + Ok(RevmBytecode::new_raw(RevmBytes(code.bytecode))) } fn storage_ref(&self, address: RevmAddress, index: RevmU256) -> Result { @@ -187,7 +187,10 @@ impl RevmState { balance: U256::from_little_endian(new_acc_info.balance.as_le_slice()), nonce: new_acc_info.nonce, }), - code: new_acc_info.code.map(|c| c.original_bytes().0), + code: new_acc_info + .code + .map(|c| c.original_bytes().0) + .map(Code::from_bytecode), added_storage: account .storage .iter() @@ -220,7 +223,8 @@ impl RevmState { // Update code in db if account.is_contract_changed() { if let Some(code) = new_acc_info.code { - account_update.code = Some(code.original_bytes().0); + account_update.code = + Some(Code::from_bytecode(code.original_bytes().0)); } } } diff --git a/tooling/ef_tests/state/runner/revm_runner.rs b/tooling/ef_tests/state/runner/revm_runner.rs index 5e242a24d26..4558367c3be 100644 --- a/tooling/ef_tests/state/runner/revm_runner.rs +++ b/tooling/ef_tests/state/runner/revm_runner.rs @@ -9,7 +9,7 @@ use crate::{ }; use alloy_rlp::Encodable; use bytes::Bytes; -use ethrex_common::types::TxType; +use ethrex_common::types::{Code, TxType}; use ethrex_common::utils::keccak; use ethrex_common::{ Address, H256, @@ -466,7 +466,7 @@ pub async fn compare_levm_revm_account_updates( .collect(); let account = Account::new( pre_state_value.balance, - pre_state_value.code.clone(), + Code::from_bytecode(pre_state_value.code.clone()), pre_state_value.nonce, account_storage, ); From 407c831e909fb8f3ab058b9a004d405b6e566423 Mon Sep 17 00:00:00 2001 From: Edgar Luque Date: Tue, 21 Oct 2025 18:05:58 +0200 Subject: [PATCH 11/17] fix --- crates/storage/store_db/rocksdb.rs | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/crates/storage/store_db/rocksdb.rs b/crates/storage/store_db/rocksdb.rs index 706a5082483..59b1149ed59 100644 --- a/crates/storage/store_db/rocksdb.rs +++ b/crates/storage/store_db/rocksdb.rs @@ -745,8 +745,11 @@ impl StoreEngine for Store { let mut buf = Vec::with_capacity(6 + code.bytecode.len() + 2 * code.jump_targets.len()); code.bytecode.encode(&mut buf); - ethrex_rlp::encode::encode_length(2 * code.jump_targets.len(), &mut buf); - buf.extend(code.jump_targets.into_iter().flat_map(|t| t.to_le_bytes())); + code.jump_targets + .into_iter() + .flat_map(|t| t.to_le_bytes()) + .collect::>() + .encode(&mut buf); batch.put_cf(&cf_codes, code_hash.0, buf); } @@ -1117,8 +1120,11 @@ impl StoreEngine for Store { let hash_key = code.hash.0.to_vec(); let mut buf = Vec::with_capacity(6 + code.bytecode.len() + 2 * code.jump_targets.len()); code.bytecode.encode(&mut buf); - ethrex_rlp::encode::encode_length(2 * code.jump_targets.len(), &mut buf); - buf.extend(code.jump_targets.into_iter().flat_map(|t| t.to_le_bytes())); + code.jump_targets + .into_iter() + .flat_map(|t| t.to_le_bytes()) + .collect::>() + .encode(&mut buf); self.write_async(CF_ACCOUNT_CODES, hash_key, buf).await } @@ -1687,8 +1693,11 @@ impl StoreEngine for Store { let key = code_hash.as_bytes().to_vec(); let mut buf = Vec::with_capacity(6 + code.bytecode.len() + 2 * code.jump_targets.len()); code.bytecode.encode(&mut buf); - ethrex_rlp::encode::encode_length(2 * code.jump_targets.len(), &mut buf); - buf.extend(code.jump_targets.into_iter().flat_map(|t| t.to_le_bytes())); + code.jump_targets + .into_iter() + .flat_map(|t| t.to_le_bytes()) + .collect::>() + .encode(&mut buf); batch_ops.push((CF_ACCOUNT_CODES.to_string(), key, buf)); } From 200282ececa46ff8f511c791db21c86134fdf7b9 Mon Sep 17 00:00:00 2001 From: Edgar Luque Date: Tue, 21 Oct 2025 18:14:44 +0200 Subject: [PATCH 12/17] fix --- crates/storage/store_db/rocksdb.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/storage/store_db/rocksdb.rs b/crates/storage/store_db/rocksdb.rs index 59b1149ed59..156d1fa9848 100644 --- a/crates/storage/store_db/rocksdb.rs +++ b/crates/storage/store_db/rocksdb.rs @@ -749,6 +749,7 @@ impl StoreEngine for Store { .into_iter() .flat_map(|t| t.to_le_bytes()) .collect::>() + .as_slice() .encode(&mut buf); batch.put_cf(&cf_codes, code_hash.0, buf); } @@ -1124,6 +1125,7 @@ impl StoreEngine for Store { .into_iter() .flat_map(|t| t.to_le_bytes()) .collect::>() + .as_slice() .encode(&mut buf); self.write_async(CF_ACCOUNT_CODES, hash_key, buf).await } @@ -1697,6 +1699,7 @@ impl StoreEngine for Store { .into_iter() .flat_map(|t| t.to_le_bytes()) .collect::>() + .as_slice() .encode(&mut buf); batch_ops.push((CF_ACCOUNT_CODES.to_string(), key, buf)); } From 22608f101f5e9f094e586e4730c73a9f0dda8fea Mon Sep 17 00:00:00 2001 From: ilitteri Date: Thu, 23 Oct 2025 00:48:52 -0300 Subject: [PATCH 13/17] Use `Keccak256::digest` --- crates/common/constants.rs | 2 +- crates/common/trie/node_hash.rs | 4 +--- crates/common/trie/trie.rs | 4 +--- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/crates/common/constants.rs b/crates/common/constants.rs index b6fe881bdd0..726ab7dd0ce 100644 --- a/crates/common/constants.rs +++ b/crates/common/constants.rs @@ -36,7 +36,7 @@ pub static EMPTY_KECCACK_HASH: LazyLock = LazyLock::new(|| { }); pub static EMPTY_TRIE_HASH: LazyLock = - LazyLock::new(|| H256::from_slice(&Keccak256::new().chain_update([RLP_NULL]).finalize())); + LazyLock::new(|| H256::from_slice(&Keccak256::digest([RLP_NULL]))); // Request related pub static DEPOSIT_TOPIC: LazyLock = LazyLock::new(|| { diff --git a/crates/common/trie/node_hash.rs b/crates/common/trie/node_hash.rs index a1fa55e7320..db310277c74 100644 --- a/crates/common/trie/node_hash.rs +++ b/crates/common/trie/node_hash.rs @@ -51,9 +51,7 @@ impl NodeHash { /// NOTE: This will hash smaller nodes, only use to get the final root hash, not for intermediate node hashes pub fn finalize(self) -> H256 { match self { - NodeHash::Inline(_) => { - H256::from_slice(&Keccak256::new().chain_update(self.as_ref()).finalize()) - } + NodeHash::Inline(_) => H256::from_slice(&Keccak256::digest(self.as_ref())), NodeHash::Hashed(x) => x, } } diff --git a/crates/common/trie/trie.rs b/crates/common/trie/trie.rs index d4787678cf4..9f15de5b550 100644 --- a/crates/common/trie/trie.rs +++ b/crates/common/trie/trie.rs @@ -34,9 +34,7 @@ use lazy_static::lazy_static; lazy_static! { // Hash value for an empty trie, equal to keccak(RLP_NULL) pub static ref EMPTY_TRIE_HASH: H256 = H256::from_slice( - &Keccak256::new() - .chain_update([RLP_NULL]) - .finalize(), + &Keccak256::digest([RLP_NULL]), ); } From 50ffa3b2b08cb1839c3584e3a34613daa41b40f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Gr=C3=BCner?= <47506558+MegaRedHand@users.noreply.github.com> Date: Thu, 23 Oct 2025 12:03:54 -0300 Subject: [PATCH 14/17] add debug log --- .github/workflows/pr_perf_blocks_exec.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pr_perf_blocks_exec.yaml b/.github/workflows/pr_perf_blocks_exec.yaml index 6466b0003a7..5ccf8bb4934 100644 --- a/.github/workflows/pr_perf_blocks_exec.yaml +++ b/.github/workflows/pr_perf_blocks_exec.yaml @@ -77,6 +77,8 @@ jobs: run: | sudo swapoff -a BINS="base,head" + # TODO: remove + ./bin/ethrex-base removedb hyperfine --setup "./bin/ethrex-base removedb" -w 5 -N -r 10 --show-output --export-markdown "bench_pr_comparison.md" \ -L bin "$BINS" -n "{bin}" \ "./bin/ethrex-{bin} --network fixtures/genesis/perf-ci.json --force import ./fixtures/blockchain/l2-1k-erc20.rlp --removedb" From 09594d39479e2cdaad49614723c95a5cace1c9fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Gr=C3=BCner?= <47506558+MegaRedHand@users.noreply.github.com> Date: Thu, 23 Oct 2025 12:25:20 -0300 Subject: [PATCH 15/17] ci: use --prepare instead of --setup for DB cleanup --- .github/workflows/pr_perf_blocks_exec.yaml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pr_perf_blocks_exec.yaml b/.github/workflows/pr_perf_blocks_exec.yaml index 5ccf8bb4934..0dc2a8cbed4 100644 --- a/.github/workflows/pr_perf_blocks_exec.yaml +++ b/.github/workflows/pr_perf_blocks_exec.yaml @@ -77,11 +77,12 @@ jobs: run: | sudo swapoff -a BINS="base,head" - # TODO: remove - ./bin/ethrex-base removedb - hyperfine --setup "./bin/ethrex-base removedb" -w 5 -N -r 10 --show-output --export-markdown "bench_pr_comparison.md" \ - -L bin "$BINS" -n "{bin}" \ - "./bin/ethrex-{bin} --network fixtures/genesis/perf-ci.json --force import ./fixtures/blockchain/l2-1k-erc20.rlp --removedb" + # Run hyperfine benchmark, removing the database before each run. + # Pipe `yes` into the remove command to automatically confirm. + hyperfine -w 5 -N -r 10 --show-output --export-markdown "bench_pr_comparison.md" \ + -L bin "$BINS" -n "{bin}" \ + --prepare "yes | ./bin/ethrex-{bin} removedb" \ + "./bin/ethrex-{bin} --network fixtures/genesis/perf-ci.json --force import ./fixtures/blockchain/l2-1k-erc20.rlp" echo -e "## Benchmark Block Execution Results Comparison Against Main\n\n$(cat bench_pr_comparison.md)" > bench_pr_comparison.md - name: Upload PR results uses: actions/upload-artifact@v4 From 0537c13c2fda54ac4f08fa68fef6d7b61bc78323 Mon Sep 17 00:00:00 2001 From: Javier Chatruc Date: Thu, 23 Oct 2025 14:59:07 -0300 Subject: [PATCH 16/17] Revert debug changes --- .github/workflows/pr_perf_blocks_exec.yaml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pr_perf_blocks_exec.yaml b/.github/workflows/pr_perf_blocks_exec.yaml index 0dc2a8cbed4..6466b0003a7 100644 --- a/.github/workflows/pr_perf_blocks_exec.yaml +++ b/.github/workflows/pr_perf_blocks_exec.yaml @@ -77,12 +77,9 @@ jobs: run: | sudo swapoff -a BINS="base,head" - # Run hyperfine benchmark, removing the database before each run. - # Pipe `yes` into the remove command to automatically confirm. - hyperfine -w 5 -N -r 10 --show-output --export-markdown "bench_pr_comparison.md" \ - -L bin "$BINS" -n "{bin}" \ - --prepare "yes | ./bin/ethrex-{bin} removedb" \ - "./bin/ethrex-{bin} --network fixtures/genesis/perf-ci.json --force import ./fixtures/blockchain/l2-1k-erc20.rlp" + hyperfine --setup "./bin/ethrex-base removedb" -w 5 -N -r 10 --show-output --export-markdown "bench_pr_comparison.md" \ + -L bin "$BINS" -n "{bin}" \ + "./bin/ethrex-{bin} --network fixtures/genesis/perf-ci.json --force import ./fixtures/blockchain/l2-1k-erc20.rlp --removedb" echo -e "## Benchmark Block Execution Results Comparison Against Main\n\n$(cat bench_pr_comparison.md)" > bench_pr_comparison.md - name: Upload PR results uses: actions/upload-artifact@v4 From 0bb059f89c97df1aa721dd9c497ab202239ff98d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Gr=C3=BCner?= <47506558+MegaRedHand@users.noreply.github.com> Date: Thu, 23 Oct 2025 15:11:24 -0300 Subject: [PATCH 17/17] docs: add comments --- crates/common/types/account.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/common/types/account.rs b/crates/common/types/account.rs index cedc566c707..34c37f97df7 100644 --- a/crates/common/types/account.rs +++ b/crates/common/types/account.rs @@ -23,7 +23,7 @@ use crate::{ pub struct Code { pub hash: H256, pub bytecode: Bytes, - // TODO: Consider using Arc (needs to enable serde rc feature) + // TODO: Consider using Arc<[u16]> (needs to enable serde rc feature) pub jump_targets: Vec, } @@ -44,6 +44,7 @@ impl Code { let mut targets = Vec::new(); let mut i = 0; while i < code.len() { + // TODO: we don't use the constants from the vm module to avoid a circular dependency match code[i] { // OP_JUMPDEST 0x5B => { @@ -51,6 +52,7 @@ impl Code { } // OP_PUSH1..32 c @ 0x60..0x80 => { + // OP_PUSH0 i += (c - 0x5F) as usize; } _ => (),