diff --git a/Cargo.lock b/Cargo.lock index 457b1ea2e5..d6972e3741 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2297,7 +2297,7 @@ dependencies = [ "bytes", "datatest-stable", "ethrex-blockchain", - "ethrex-core", + "ethrex-common", "ethrex-rlp", "ethrex-storage", "ethrex-vm", @@ -2316,7 +2316,7 @@ dependencies = [ "clap_complete", "colored", "ethrex-blockchain", - "ethrex-core", + "ethrex-common", "ethrex-levm", "ethrex-rlp", "ethrex-storage", @@ -2798,7 +2798,7 @@ dependencies = [ "clap 4.5.21", "directories", "ethrex-blockchain", - "ethrex-core", + "ethrex-common", "ethrex-dev", "ethrex-l2", "ethrex-metrics", @@ -2827,7 +2827,7 @@ version = "0.1.0" dependencies = [ "bytes", "cfg-if", - "ethrex-core", + "ethrex-common", "ethrex-levm", "ethrex-metrics", "ethrex-rlp", @@ -2842,7 +2842,7 @@ dependencies = [ ] [[package]] -name = "ethrex-core" +name = "ethrex-common" version = "0.1.0" dependencies = [ "bytes", @@ -2895,7 +2895,7 @@ dependencies = [ "envy", "ethereum-types 0.15.1", "ethrex-blockchain", - "ethrex-core", + "ethrex-common", "ethrex-dev", "ethrex-metrics", "ethrex-rlp", @@ -2928,7 +2928,7 @@ dependencies = [ "bytes", "colored", "datatest-stable", - "ethrex-core", + "ethrex-common", "ethrex-rlp", "hex", "k256", @@ -2953,7 +2953,7 @@ name = "ethrex-metrics" version = "0.1.0" dependencies = [ "axum 0.8.1", - "ethrex-core", + "ethrex-common", "prometheus", "serde", "serde_json", @@ -2971,7 +2971,7 @@ dependencies = [ "concat-kdf", "ctr", "ethrex-blockchain", - "ethrex-core", + "ethrex-common", "ethrex-rlp", "ethrex-storage", "ethrex-trie", @@ -3000,7 +3000,7 @@ dependencies = [ "bytes", "ethereum-types 0.15.1", "ethrex-blockchain", - "ethrex-core", + "ethrex-common", "ethrex-l2", "ethrex-rlp", "ethrex-storage", @@ -3040,7 +3040,7 @@ dependencies = [ "axum-extra", "bytes", "ethrex-blockchain", - "ethrex-core", + "ethrex-common", "ethrex-p2p", "ethrex-rlp", "ethrex-storage", @@ -3066,7 +3066,7 @@ version = "0.1.0" dependencies = [ "bytes", "ethereum-types 0.15.1", - "ethrex-core", + "ethrex-common", "ethrex-rlp", "ethrex-rpc", "eyre", @@ -3089,7 +3089,7 @@ dependencies = [ "anyhow", "bytes", "ethereum-types 0.15.1", - "ethrex-core", + "ethrex-common", "ethrex-rlp", "ethrex-trie", "hex", @@ -3137,7 +3137,7 @@ dependencies = [ "bytes", "cfg-if", "ethereum-types 0.15.1", - "ethrex-core", + "ethrex-common", "ethrex-levm", "ethrex-rlp", "ethrex-storage", @@ -3159,7 +3159,7 @@ dependencies = [ "bytes", "colored", "ethereum-types 0.15.1", - "ethrex-core", + "ethrex-common", "ethrex-l2", "ethrex-sdk", "hex", @@ -3184,7 +3184,7 @@ dependencies = [ "dirs 5.0.1", "ethereum-types 0.15.1", "ethrex-blockchain", - "ethrex-core", + "ethrex-common", "ethrex-l2", "ethrex-prover", "ethrex-rlp", @@ -6798,7 +6798,7 @@ name = "revm_comparison" version = "0.1.0" dependencies = [ "bytes", - "ethrex-core", + "ethrex-common", "ethrex-levm", "hex", "revm 9.0.0", @@ -9971,7 +9971,7 @@ dependencies = [ name = "zkvm_interface" version = "0.1.0" dependencies = [ - "ethrex-core", + "ethrex-common", "ethrex-rlp", "ethrex-storage", "ethrex-trie", diff --git a/Cargo.toml b/Cargo.toml index 4867a12adb..764c2c3a52 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,7 +32,7 @@ edition = "2021" [workspace.dependencies] ethrex-blockchain = { path = "./crates/blockchain" } -ethrex-core = { path = "./crates/common" } +ethrex-common = { path = "./crates/common" } ethrex-p2p = { path = "./crates/networking/p2p" } ethrex-rpc = { path = "./crates/networking/rpc" } ethrex-storage = { path = "./crates/storage/store" } diff --git a/cmd/ef_tests/blockchain/Cargo.toml b/cmd/ef_tests/blockchain/Cargo.toml index c33bfea5fb..8bd8dfcd6d 100644 --- a/cmd/ef_tests/blockchain/Cargo.toml +++ b/cmd/ef_tests/blockchain/Cargo.toml @@ -5,7 +5,7 @@ edition.workspace = true [dependencies] ethrex-blockchain.workspace = true -ethrex-core.workspace = true +ethrex-common.workspace = true ethrex-storage.workspace = true ethrex-rlp.workspace = true ethrex-vm.workspace = true diff --git a/cmd/ef_tests/blockchain/network.rs b/cmd/ef_tests/blockchain/network.rs index b06ec3c936..ebad0a6f8a 100644 --- a/cmd/ef_tests/blockchain/network.rs +++ b/cmd/ef_tests/blockchain/network.rs @@ -1,4 +1,4 @@ -use ethrex_core::types::ChainConfig; +use ethrex_common::types::ChainConfig; use lazy_static::lazy_static; use serde::Deserialize; diff --git a/cmd/ef_tests/blockchain/test_runner.rs b/cmd/ef_tests/blockchain/test_runner.rs index e8b4612632..5638ba645a 100644 --- a/cmd/ef_tests/blockchain/test_runner.rs +++ b/cmd/ef_tests/blockchain/test_runner.rs @@ -2,7 +2,7 @@ use std::{collections::HashMap, path::Path}; use crate::types::{BlockWithRLP, TestUnit}; use ethrex_blockchain::{add_block, fork_choice::apply_fork_choice}; -use ethrex_core::types::{ +use ethrex_common::types::{ Account as CoreAccount, Block as CoreBlock, BlockHeader as CoreBlockHeader, }; use ethrex_rlp::decode::RLPDecode; diff --git a/cmd/ef_tests/blockchain/types.rs b/cmd/ef_tests/blockchain/types.rs index c310909527..dee7ea2f12 100644 --- a/cmd/ef_tests/blockchain/types.rs +++ b/cmd/ef_tests/blockchain/types.rs @@ -1,11 +1,11 @@ use bytes::Bytes; -use ethrex_core::types::{ +use ethrex_common::types::{ code_hash, Account as ethrexAccount, AccountInfo, Block as CoreBlock, BlockBody, EIP1559Transaction, EIP2930Transaction, EIP4844Transaction, LegacyTransaction, Transaction as ethrexTransaction, TxKind, }; -use ethrex_core::types::{Genesis, GenesisAccount, Withdrawal}; -use ethrex_core::{types::BlockHeader, Address, Bloom, H256, H64, U256}; +use ethrex_common::types::{Genesis, GenesisAccount, Withdrawal}; +use ethrex_common::{types::BlockHeader, Address, Bloom, H256, H64, U256}; use serde::{Deserialize, Serialize}; use std::collections::HashMap; @@ -18,7 +18,7 @@ pub struct TestUnit { pub info: Option, pub blocks: Vec, pub genesis_block_header: Header, - #[serde(rename = "genesisRLP", with = "ethrex_core::serde_utils::bytes")] + #[serde(rename = "genesisRLP", with = "ethrex_common::serde_utils::bytes")] pub genesis_rlp: Bytes, pub lastblockhash: H256, pub network: Network, @@ -37,11 +37,11 @@ pub struct FixtureConfig { #[derive(Debug, Deserialize)] #[serde(rename_all = "camelCase")] pub struct ForkBlobSchedule { - #[serde(default, with = "ethrex_core::serde_utils::u64::hex_str")] + #[serde(default, with = "ethrex_common::serde_utils::u64::hex_str")] pub target: u64, - #[serde(default, with = "ethrex_core::serde_utils::u64::hex_str")] + #[serde(default, with = "ethrex_common::serde_utils::u64::hex_str")] pub max: u64, - #[serde(default, with = "ethrex_core::serde_utils::u64::hex_str")] + #[serde(default, with = "ethrex_common::serde_utils::u64::hex_str")] pub base_fee_update_fraction: u64, } @@ -96,7 +96,7 @@ impl TestUnit { #[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone)] pub struct Account { pub balance: U256, - #[serde(with = "ethrex_core::serde_utils::bytes")] + #[serde(with = "ethrex_common::serde_utils::bytes")] pub code: Bytes, pub nonce: U256, pub storage: HashMap, @@ -135,7 +135,7 @@ pub struct Header { pub bloom: Bloom, pub coinbase: Address, pub difficulty: U256, - #[serde(with = "ethrex_core::serde_utils::bytes")] + #[serde(with = "ethrex_common::serde_utils::bytes")] pub extra_data: Bytes, pub gas_limit: U256, pub gas_used: U256, @@ -160,7 +160,7 @@ pub struct Header { #[derive(Debug, PartialEq, Eq, Deserialize, Clone)] #[serde(rename_all = "camelCase")] pub struct BlockWithRLP { - #[serde(with = "ethrex_core::serde_utils::bytes")] + #[serde(with = "ethrex_common::serde_utils::bytes")] pub rlp: Bytes, #[serde(flatten)] inner: Option, @@ -217,7 +217,7 @@ impl From for CoreBlock { pub struct Transaction { #[serde(rename = "type")] pub transaction_type: Option, - #[serde(with = "ethrex_core::serde_utils::bytes")] + #[serde(with = "ethrex_common::serde_utils::bytes")] pub data: Bytes, pub gas_limit: U256, pub gas_price: Option, diff --git a/cmd/ef_tests/state/Cargo.toml b/cmd/ef_tests/state/Cargo.toml index d2cb4edc1e..55b0a2c461 100644 --- a/cmd/ef_tests/state/Cargo.toml +++ b/cmd/ef_tests/state/Cargo.toml @@ -5,7 +5,7 @@ edition.workspace = true [dependencies] ethrex-blockchain = { workspace = true } -ethrex-core.workspace = true +ethrex-common.workspace = true ethrex-storage.workspace = true ethrex-rlp.workspace = true ethrex-vm = { workspace = true } diff --git a/cmd/ef_tests/state/deserialize.rs b/cmd/ef_tests/state/deserialize.rs index e1a72a281e..9d414b7905 100644 --- a/cmd/ef_tests/state/deserialize.rs +++ b/cmd/ef_tests/state/deserialize.rs @@ -3,7 +3,7 @@ use crate::types::{ TransactionExpectedException, }; use bytes::Bytes; -use ethrex_core::{types::Fork, H256, U256}; +use ethrex_common::{types::Fork, H256, U256}; use serde::{Deserialize, Deserializer}; use std::{collections::HashMap, str::FromStr}; diff --git a/cmd/ef_tests/state/report.rs b/cmd/ef_tests/state/report.rs index 3f2ed801c7..3ac0ecb424 100644 --- a/cmd/ef_tests/state/report.rs +++ b/cmd/ef_tests/state/report.rs @@ -1,6 +1,6 @@ use crate::runner::{EFTestRunnerError, InternalError}; use colored::Colorize; -use ethrex_core::{types::Fork, Address, H256}; +use ethrex_common::{types::Fork, Address, H256}; use ethrex_levm::{ errors::{ExecutionReport, TxResult, VMError}, Account, StorageSlot, @@ -128,7 +128,7 @@ pub fn summary_for_slack(reports: &[EFTestReport]) -> String { "text": {{ "type": "mrkdwn", "text": "*Summary*: {total_passed}/{total_run} ({success_percentage:.2}%)\n\n{}\n{}\n{}\n{}\n{}\n{}\n{}\n{}\n{}\n{}\n{}\n{}\n" - }} + }} }} ] }}"#, diff --git a/cmd/ef_tests/state/runner/levm_runner.rs b/cmd/ef_tests/state/runner/levm_runner.rs index 065c8656b2..5c8af4d2cf 100644 --- a/cmd/ef_tests/state/runner/levm_runner.rs +++ b/cmd/ef_tests/state/runner/levm_runner.rs @@ -4,7 +4,7 @@ use crate::{ types::{EFTest, TransactionExpectedException}, utils::{self, effective_gas_price}, }; -use ethrex_core::{ +use ethrex_common::{ types::{code_hash, tx_fields::*, AccountInfo, Fork}, H256, U256, }; diff --git a/cmd/ef_tests/state/runner/revm_runner.rs b/cmd/ef_tests/state/runner/revm_runner.rs index 6ca9bb9d0c..c082d67b02 100644 --- a/cmd/ef_tests/state/runner/revm_runner.rs +++ b/cmd/ef_tests/state/runner/revm_runner.rs @@ -8,7 +8,7 @@ use crate::{ utils::{effective_gas_price, load_initial_state}, }; use bytes::Bytes; -use ethrex_core::{ +use ethrex_common::{ types::{Fork, TxKind}, Address, H256, }; @@ -61,7 +61,7 @@ pub fn re_run_failed_ef_test( } } }, - // Currently, we decided not to re-execute the test when the Expected exception does not match + // Currently, we decided not to re-execute the test when the Expected exception does not match // with the received. This can change in the future. EFTestRunnerError::ExpectedExceptionDoesNotMatchReceived(_) => continue, EFTestRunnerError::VMInitializationFailed(_) diff --git a/cmd/ef_tests/state/types.rs b/cmd/ef_tests/state/types.rs index bf1064c67d..d7769534cc 100644 --- a/cmd/ef_tests/state/types.rs +++ b/cmd/ef_tests/state/types.rs @@ -10,7 +10,7 @@ use crate::{ report::TestVector, }; use bytes::Bytes; -use ethrex_core::{ +use ethrex_common::{ types::{Fork, Genesis, GenesisAccount, TxKind}, Address, H256, U256, }; diff --git a/cmd/ef_tests/state/utils.rs b/cmd/ef_tests/state/utils.rs index d0a6906b5d..2a1b57ce0d 100644 --- a/cmd/ef_tests/state/utils.rs +++ b/cmd/ef_tests/state/utils.rs @@ -2,7 +2,7 @@ use crate::{ runner::{EFTestRunnerError, InternalError}, types::{EFTest, EFTestTransaction}, }; -use ethrex_core::{types::Genesis, H256, U256}; +use ethrex_common::{types::Genesis, H256, U256}; use ethrex_storage::{EngineType, Store}; use ethrex_vm::db::{evm_state, EvmState}; use spinoff::Spinner; diff --git a/cmd/ethrex/Cargo.toml b/cmd/ethrex/Cargo.toml index f19857a400..87c8b3b849 100644 --- a/cmd/ethrex/Cargo.toml +++ b/cmd/ethrex/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" [dependencies] ethrex-blockchain.workspace = true ethrex-rpc.workspace = true -ethrex-core.workspace = true +ethrex-common.workspace = true ethrex-p2p.workspace = true ethrex-storage = { workspace = true, optional = true } ethrex-vm.workspace = true diff --git a/cmd/ethrex/decode.rs b/cmd/ethrex/decode.rs index 01bb326473..04214684b1 100644 --- a/cmd/ethrex/decode.rs +++ b/cmd/ethrex/decode.rs @@ -1,6 +1,6 @@ use anyhow::Error; use bytes::Bytes; -use ethrex_core::types::{Block, Genesis}; +use ethrex_common::types::{Block, Genesis}; use ethrex_rlp::decode::RLPDecode as _; use std::{ fs::File, @@ -38,7 +38,7 @@ pub fn genesis_file(file: File) -> Result { #[cfg(test)] mod tests { use crate::decode::chain_file; - use ethrex_core::H256; + use ethrex_common::H256; use std::{fs::File, str::FromStr as _}; #[test] diff --git a/cmd/ethrex/ethrex.rs b/cmd/ethrex/ethrex.rs index bebce6d8b8..eec7b898d1 100644 --- a/cmd/ethrex/ethrex.rs +++ b/cmd/ethrex/ethrex.rs @@ -1,7 +1,7 @@ use bytes::Bytes; use directories::ProjectDirs; use ethrex_blockchain::{add_block, fork_choice::apply_fork_choice}; -use ethrex_core::types::{Block, Genesis}; +use ethrex_common::types::{Block, Genesis}; use ethrex_p2p::{ kademlia::KademliaTable, network::{node_id_from_signing_key, peer_table}, @@ -295,7 +295,7 @@ async fn main() { head_block_hash, max_tries, 1000, - ethrex_core::Address::default(), + ethrex_common::Address::default(), ); tracker.spawn(block_producer_engine); } else { diff --git a/cmd/ethrex_l2/Cargo.toml b/cmd/ethrex_l2/Cargo.toml index 11aad2a0ed..9fca20fd0b 100644 --- a/cmd/ethrex_l2/Cargo.toml +++ b/cmd/ethrex_l2/Cargo.toml @@ -28,7 +28,7 @@ keccak-hash.workspace = true ethrex-l2.workspace = true ethrex-sdk.workspace = true -ethrex-core.workspace = true +ethrex-common.workspace = true ethrex-blockchain.workspace = true ethrex-prover.workspace = true ethrex-rlp.workspace = true diff --git a/cmd/ethrex_l2/src/commands/info.rs b/cmd/ethrex_l2/src/commands/info.rs index 538a9836d5..11247b3665 100644 --- a/cmd/ethrex_l2/src/commands/info.rs +++ b/cmd/ethrex_l2/src/commands/info.rs @@ -1,7 +1,7 @@ use crate::{commands::wallet::balance_in_wei, config::EthrexL2Config}; use clap::Subcommand; use colored::{self, Colorize}; -use ethrex_core::Address; +use ethrex_common::Address; use ethrex_l2_sdk::eth_client::EthClient; use keccak_hash::H256; use std::str::FromStr; diff --git a/cmd/ethrex_l2/src/commands/wallet.rs b/cmd/ethrex_l2/src/commands/wallet.rs index 35e6eaf4a4..09b78c4e06 100644 --- a/cmd/ethrex_l2/src/commands/wallet.rs +++ b/cmd/ethrex_l2/src/commands/wallet.rs @@ -2,7 +2,7 @@ use crate::config::EthrexL2Config; use bytes::Bytes; use clap::Subcommand; use ethereum_types::{Address, H256, U256}; -use ethrex_core::types::{PrivilegedTxType, Transaction}; +use ethrex_common::types::{PrivilegedTxType, Transaction}; use ethrex_l2_sdk::calldata::{encode_calldata, Value}; use ethrex_l2_sdk::eth_client::{eth_sender::Overrides, EthClient}; use ethrex_l2_sdk::merkle_tree::merkle_proof; diff --git a/crates/blockchain/Cargo.toml b/crates/blockchain/Cargo.toml index 952bdda65f..9ede7d46d7 100644 --- a/crates/blockchain/Cargo.toml +++ b/crates/blockchain/Cargo.toml @@ -14,7 +14,7 @@ bytes.workspace = true cfg-if = "1.0.0" ethrex-rlp.workspace = true -ethrex-core = { path = "../common", default-features = false } +ethrex-common = { path = "../common", default-features = false } ethrex-storage = { path = "../storage/store", default-features = false } ethrex-vm = { path = "../vm", default-features = false } @@ -31,6 +31,6 @@ path = "./blockchain.rs" [features] default = ["c-kzg"] -libmdbx = ["ethrex-core/libmdbx", "ethrex-storage/default", "ethrex-vm/libmdbx"] -c-kzg = ["ethrex-core/c-kzg", "ethrex-levm/c-kzg"] +libmdbx = ["ethrex-common/libmdbx", "ethrex-storage/default", "ethrex-vm/libmdbx"] +c-kzg = ["ethrex-common/c-kzg", "ethrex-levm/c-kzg"] metrics = ["ethrex-metrics/transactions"] diff --git a/crates/blockchain/blockchain.rs b/crates/blockchain/blockchain.rs index 3c29446537..ce7b3766f8 100644 --- a/crates/blockchain/blockchain.rs +++ b/crates/blockchain/blockchain.rs @@ -6,13 +6,13 @@ pub mod payload; mod smoke_test; use error::{ChainError, InvalidBlockError}; -use ethrex_core::constants::GAS_PER_BLOB; -use ethrex_core::types::{ +use ethrex_common::constants::GAS_PER_BLOB; +use ethrex_common::types::{ compute_receipts_root, validate_block_header, validate_post_cancun_header_fields, validate_pre_cancun_header_fields, Block, BlockHash, BlockHeader, BlockNumber, ChainConfig, EIP4844Transaction, Receipt, Transaction, }; -use ethrex_core::H256; +use ethrex_common::H256; use ethrex_storage::error::StoreError; use ethrex_storage::{AccountUpdate, Store}; diff --git a/crates/blockchain/error.rs b/crates/blockchain/error.rs index d75bc9d976..b1ece27589 100644 --- a/crates/blockchain/error.rs +++ b/crates/blockchain/error.rs @@ -1,4 +1,4 @@ -use ethrex_core::types::{BlobsBundleError, InvalidBlockHeaderError}; +use ethrex_common::types::{BlobsBundleError, InvalidBlockHeaderError}; use ethrex_storage::error::StoreError; use ethrex_vm::EvmError; diff --git a/crates/blockchain/fork_choice.rs b/crates/blockchain/fork_choice.rs index 8519672290..8a0ca5ee85 100644 --- a/crates/blockchain/fork_choice.rs +++ b/crates/blockchain/fork_choice.rs @@ -1,4 +1,4 @@ -use ethrex_core::{ +use ethrex_common::{ types::{Block, BlockHash, BlockHeader, BlockNumber}, H256, }; diff --git a/crates/blockchain/mempool.rs b/crates/blockchain/mempool.rs index e5e1338962..233f50dfb2 100644 --- a/crates/blockchain/mempool.rs +++ b/crates/blockchain/mempool.rs @@ -8,7 +8,7 @@ use crate::{ }, error::MempoolError, }; -use ethrex_core::{ +use ethrex_common::{ constants::MIN_BASE_FEE_PER_BLOB_GAS, types::{ BlobsBundle, BlockHeader, ChainConfig, EIP4844Transaction, MempoolTransaction, Transaction, @@ -310,10 +310,10 @@ mod tests { }; use super::{transaction_intrinsic_gas, validate_transaction}; - use ethrex_core::types::{ + use ethrex_common::types::{ BlockHeader, ChainConfig, EIP1559Transaction, EIP4844Transaction, Transaction, TxKind, }; - use ethrex_core::{Address, Bytes, H256, U256}; + use ethrex_common::{Address, Bytes, H256, U256}; use ethrex_storage::EngineType; use ethrex_storage::{error::StoreError, Store}; diff --git a/crates/blockchain/metrics/Cargo.toml b/crates/blockchain/metrics/Cargo.toml index 688a870ea6..9626d4eea2 100644 --- a/crates/blockchain/metrics/Cargo.toml +++ b/crates/blockchain/metrics/Cargo.toml @@ -12,7 +12,7 @@ thiserror.workspace = true serde_json.workspace = true serde.workspace = true -ethrex-core = { path = "../../common", default-features = false } +ethrex-common = { path = "../../common", default-features = false } prometheus = { version = "0.13.4", optional = true } diff --git a/crates/blockchain/metrics/metrics_transactions.rs b/crates/blockchain/metrics/metrics_transactions.rs index a69582caba..5c6eaa8542 100644 --- a/crates/blockchain/metrics/metrics_transactions.rs +++ b/crates/blockchain/metrics/metrics_transactions.rs @@ -1,4 +1,4 @@ -use ethrex_core::types::TxType; +use ethrex_common::types::TxType; use prometheus::{Encoder, IntCounter, IntCounterVec, Opts, Registry, TextEncoder}; use std::sync::{Arc, LazyLock, Mutex}; @@ -124,12 +124,12 @@ pub struct MetricsTxType(pub TxType); impl MetricsTxType { pub fn to_str(&self) -> &str { match self.0 { - ethrex_core::types::TxType::Legacy => "Legacy", - ethrex_core::types::TxType::EIP2930 => "EIP2930", - ethrex_core::types::TxType::EIP1559 => "EIP1559", - ethrex_core::types::TxType::EIP4844 => "EIP4844", - ethrex_core::types::TxType::EIP7702 => "EIP7702", - ethrex_core::types::TxType::Privileged => "Privileged", + ethrex_common::types::TxType::Legacy => "Legacy", + ethrex_common::types::TxType::EIP2930 => "EIP2930", + ethrex_common::types::TxType::EIP1559 => "EIP1559", + ethrex_common::types::TxType::EIP4844 => "EIP4844", + ethrex_common::types::TxType::EIP7702 => "EIP7702", + ethrex_common::types::TxType::Privileged => "Privileged", } } } diff --git a/crates/blockchain/payload.rs b/crates/blockchain/payload.rs index 18ebb4833e..c0b6f20fb2 100644 --- a/crates/blockchain/payload.rs +++ b/crates/blockchain/payload.rs @@ -3,7 +3,7 @@ use std::{ collections::HashMap, }; -use ethrex_core::{ +use ethrex_common::{ constants::GAS_PER_BLOB, types::{ calculate_base_fee_per_blob_gas, calculate_base_fee_per_gas, compute_receipts_root, @@ -14,7 +14,7 @@ use ethrex_core::{ Address, Bloom, Bytes, H256, U256, }; -use ethrex_core::types::{Fork, GWEI_TO_WEI}; +use ethrex_common::types::{Fork, GWEI_TO_WEI}; use ethrex_levm::{db::CacheDB, vm::EVMConfig, Account, AccountInfo}; use ethrex_vm::{ backends, diff --git a/crates/blockchain/smoke_test.rs b/crates/blockchain/smoke_test.rs index d49ce27df1..9417225ed4 100644 --- a/crates/blockchain/smoke_test.rs +++ b/crates/blockchain/smoke_test.rs @@ -10,7 +10,7 @@ mod blockchain_integration_test { payload::{build_payload, create_payload, BuildPayloadArgs}, }; - use ethrex_core::{ + use ethrex_common::{ types::{Block, BlockHeader}, H160, H256, }; diff --git a/crates/common/Cargo.toml b/crates/common/Cargo.toml index 666dfd20ef..cc083b9a6e 100644 --- a/crates/common/Cargo.toml +++ b/crates/common/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "ethrex-core" +name = "ethrex-common" version = "0.1.0" edition = "2021" @@ -37,4 +37,4 @@ redb = ["ethrex-trie/redb"] c-kzg = ["dep:c-kzg"] [lib] -path = "./core.rs" +path = "./common.rs" diff --git a/crates/common/core.rs b/crates/common/common.rs similarity index 100% rename from crates/common/core.rs rename to crates/common/common.rs diff --git a/crates/l2/Cargo.toml b/crates/l2/Cargo.toml index b22f638308..bb50c6a554 100644 --- a/crates/l2/Cargo.toml +++ b/crates/l2/Cargo.toml @@ -13,7 +13,7 @@ tracing.workspace = true serde.workspace = true serde_json.workspace = true ethereum-types.workspace = true -ethrex-core.workspace = true +ethrex-common.workspace = true ethrex-rlp.workspace = true ethrex-rpc.workspace = true ethrex-blockchain.workspace = true diff --git a/crates/l2/contracts/Cargo.toml b/crates/l2/contracts/Cargo.toml index 615a06a995..cbbfd4b826 100644 --- a/crates/l2/contracts/Cargo.toml +++ b/crates/l2/contracts/Cargo.toml @@ -20,7 +20,7 @@ thiserror.workspace = true ethrex-l2 = { path = "../../l2" } ethrex-sdk = { path = "../../l2/sdk" } -ethrex-core = { path = "../../common" } +ethrex-common = { path = "../../common" } [[bin]] name = "ethrex_l2_l1_deployer" diff --git a/crates/l2/proposer/errors.rs b/crates/l2/proposer/errors.rs index 2dc65bc1ad..62a9922068 100644 --- a/crates/l2/proposer/errors.rs +++ b/crates/l2/proposer/errors.rs @@ -3,7 +3,7 @@ use std::sync::mpsc::SendError; use crate::utils::config::errors::ConfigError; use crate::utils::prover::errors::SaveStateError; use ethereum_types::FromStrRadixErr; -use ethrex_core::types::{BlobsBundleError, FakeExponentialError}; +use ethrex_common::types::{BlobsBundleError, FakeExponentialError}; use ethrex_dev::utils::engine_client::errors::EngineClientError; use ethrex_l2_sdk::eth_client::errors::{CalldataEncodeError, EthClientError}; use ethrex_l2_sdk::merkle_tree::MerkleError; diff --git a/crates/l2/proposer/l1_committer.rs b/crates/l2/proposer/l1_committer.rs index ae39e0a16e..200b3dcb73 100644 --- a/crates/l2/proposer/l1_committer.rs +++ b/crates/l2/proposer/l1_committer.rs @@ -6,7 +6,7 @@ use crate::{ utils::config::{committer::CommitterConfig, errors::ConfigError, eth::EthConfig}, }; -use ethrex_core::{ +use ethrex_common::{ types::{ blobs_bundle, fake_exponential_checked, BlobsBundle, BlobsBundleError, Block, PrivilegedL2Transaction, PrivilegedTxType, Transaction, TxKind, diff --git a/crates/l2/proposer/l1_watcher.rs b/crates/l2/proposer/l1_watcher.rs index cdfbff15e1..071eab0f1b 100644 --- a/crates/l2/proposer/l1_watcher.rs +++ b/crates/l2/proposer/l1_watcher.rs @@ -5,8 +5,8 @@ use crate::{ use bytes::Bytes; use ethereum_types::{Address, BigEndianHash, H256, U256}; use ethrex_blockchain::{constants::TX_GAS_COST, mempool}; -use ethrex_core::types::PrivilegedTxType; -use ethrex_core::types::{Signable, Transaction}; +use ethrex_common::types::PrivilegedTxType; +use ethrex_common::types::{Signable, Transaction}; use ethrex_l2_sdk::eth_client::{errors::EthClientError, eth_sender::Overrides, EthClient}; use ethrex_rpc::types::receipt::RpcLog; use ethrex_storage::Store; diff --git a/crates/l2/proposer/prover_server.rs b/crates/l2/proposer/prover_server.rs index 7fa7c92ea9..92aa10cea1 100644 --- a/crates/l2/proposer/prover_server.rs +++ b/crates/l2/proposer/prover_server.rs @@ -10,7 +10,7 @@ use crate::utils::{ save_state::{StateFileType, StateType, *}, }, }; -use ethrex_core::{ +use ethrex_common::{ types::{Block, BlockHeader}, Address, H256, U256, }; diff --git a/crates/l2/prover/Cargo.toml b/crates/l2/prover/Cargo.toml index 3d083cb38c..929c6ec577 100644 --- a/crates/l2/prover/Cargo.toml +++ b/crates/l2/prover/Cargo.toml @@ -16,7 +16,7 @@ hex.workspace = true thiserror.workspace = true # ethrex -ethrex-core.workspace = true +ethrex-common.workspace = true ethrex-vm.workspace = true ethrex-rlp.workspace = true diff --git a/crates/l2/prover/tests/perf_zkvm.rs b/crates/l2/prover/tests/perf_zkvm.rs index a87e052685..c9f99b1e42 100644 --- a/crates/l2/prover/tests/perf_zkvm.rs +++ b/crates/l2/prover/tests/perf_zkvm.rs @@ -1,6 +1,6 @@ #![allow(clippy::expect_used)] #![allow(clippy::unwrap_used)] -use ethrex_core::types::Block; +use ethrex_common::types::Block; use std::path::Path; use tracing::info; diff --git a/crates/l2/prover/zkvm/interface/Cargo.toml b/crates/l2/prover/zkvm/interface/Cargo.toml index 270680cbc1..7d1a5a1376 100644 --- a/crates/l2/prover/zkvm/interface/Cargo.toml +++ b/crates/l2/prover/zkvm/interface/Cargo.toml @@ -8,7 +8,7 @@ serde = { version = "1.0.203", features = ["derive"] } serde_with = "3.11.0" thiserror = "2.0.9" -ethrex-core = { path = "../../../../common/", default-features = false } +ethrex-common = { path = "../../../../common/", default-features = false } ethrex-vm = { path = "../../../../vm", default-features = false } ethrex-rlp = { path = "../../../../common/rlp", default-features = false } ethrex-storage = { path = "../../../../storage/store", default-features = false } diff --git a/crates/l2/prover/zkvm/interface/risc0/Cargo.toml b/crates/l2/prover/zkvm/interface/risc0/Cargo.toml index 2a6e8a7815..e199d447be 100644 --- a/crates/l2/prover/zkvm/interface/risc0/Cargo.toml +++ b/crates/l2/prover/zkvm/interface/risc0/Cargo.toml @@ -9,7 +9,7 @@ edition = "2021" risc0-zkvm = { version = "1.2.2", default-features = false, features = ["std"] } zkvm_interface = { path = "../" } -ethrex-core = { path = "../../../../../common", default-features = false } +ethrex-common = { path = "../../../../../common", default-features = false } ethrex-rlp = { path = "../../../../../common/rlp" } ethrex-vm = { path = "../../../../../vm", default-features = false, features = [ "l2", diff --git a/crates/l2/prover/zkvm/interface/sp1/Cargo.toml b/crates/l2/prover/zkvm/interface/sp1/Cargo.toml index 97a6fbfe4a..e3e932c0b6 100644 --- a/crates/l2/prover/zkvm/interface/sp1/Cargo.toml +++ b/crates/l2/prover/zkvm/interface/sp1/Cargo.toml @@ -9,7 +9,7 @@ edition = "2021" sp1-zkvm = "3.4.0" zkvm_interface = { path = "../" } -ethrex-core = { path = "../../../../../common", default-features = false } +ethrex-common = { path = "../../../../../common", default-features = false } ethrex-rlp = { path = "../../../../../common/rlp" } ethrex-vm = { path = "../../../../../vm", default-features = false, features = [ "l2", diff --git a/crates/l2/prover/zkvm/interface/src/lib.rs b/crates/l2/prover/zkvm/interface/src/lib.rs index 189e926eb8..9a83d60700 100644 --- a/crates/l2/prover/zkvm/interface/src/lib.rs +++ b/crates/l2/prover/zkvm/interface/src/lib.rs @@ -16,7 +16,7 @@ pub mod methods { } pub mod io { - use ethrex_core::{ + use ethrex_common::{ types::{Block, BlockHeader}, H256, }; @@ -49,7 +49,7 @@ pub mod io { } /// Used with [serde_with] to encode a Block into RLP before serializing its bytes. This is - /// necessary because the [ethrex_core::types::Transaction] type doesn't serializes into any + /// necessary because the [ethrex_common::types::Transaction] type doesn't serializes into any /// format other than JSON. pub struct RLPBlock; @@ -78,7 +78,7 @@ pub mod io { pub mod trie { use std::collections::HashMap; - use ethrex_core::{types::AccountState, H160, U256}; + use ethrex_common::{types::AccountState, H160, U256}; use ethrex_rlp::{decode::RLPDecode, encode::RLPEncode, error::RLPDecodeError}; use ethrex_storage::{hash_address, hash_key, AccountUpdate}; use ethrex_trie::{Trie, TrieError}; diff --git a/crates/l2/sdk/Cargo.toml b/crates/l2/sdk/Cargo.toml index 243121e75d..407091809f 100644 --- a/crates/l2/sdk/Cargo.toml +++ b/crates/l2/sdk/Cargo.toml @@ -4,7 +4,7 @@ version.workspace = true edition.workspace = true [dependencies] -ethrex-core.workspace = true +ethrex-common.workspace = true ethrex-rpc.workspace = true ethereum-types.workspace = true diff --git a/crates/l2/sdk/src/calldata.rs b/crates/l2/sdk/src/calldata.rs index 6f64b8f1cd..28570c3f3c 100644 --- a/crates/l2/sdk/src/calldata.rs +++ b/crates/l2/sdk/src/calldata.rs @@ -1,5 +1,5 @@ -use ethrex_core::Bytes; -use ethrex_core::{Address, H32, U256}; +use ethrex_common::Bytes; +use ethrex_common::{Address, H32, U256}; use keccak_hash::keccak; use crate::eth_client::errors::CalldataEncodeError; diff --git a/crates/l2/sdk/src/eth_client/eth_sender.rs b/crates/l2/sdk/src/eth_client/eth_sender.rs index 7933341661..cc5dc14ab2 100644 --- a/crates/l2/sdk/src/eth_client/eth_sender.rs +++ b/crates/l2/sdk/src/eth_client/eth_sender.rs @@ -1,7 +1,7 @@ use bytes::Bytes; use ethereum_types::{Address, U256}; -use ethrex_core::types::{GenericTransaction, TxKind}; -use ethrex_core::H256; +use ethrex_common::types::{GenericTransaction, TxKind}; +use ethrex_common::H256; use ethrex_rlp::encode::RLPEncode; use ethrex_rpc::utils::{RpcRequest, RpcRequestId}; use keccak_hash::keccak; diff --git a/crates/l2/sdk/src/eth_client/mod.rs b/crates/l2/sdk/src/eth_client/mod.rs index aff994dc07..9046d65947 100644 --- a/crates/l2/sdk/src/eth_client/mod.rs +++ b/crates/l2/sdk/src/eth_client/mod.rs @@ -8,7 +8,7 @@ use errors::{ }; use eth_sender::Overrides; use ethereum_types::{Address, H256, U256}; -use ethrex_core::{ +use ethrex_common::{ types::{ BlobsBundle, EIP1559Transaction, EIP4844Transaction, GenericTransaction, PrivilegedL2Transaction, PrivilegedTxType, Signable, TxKind, TxType, @@ -1064,15 +1064,15 @@ pub fn from_hex_string_to_u256(hex_str: &str) -> Result { #[derive(Serialize, Deserialize, Debug)] #[serde(rename_all = "camelCase")] pub struct GetTransactionByHashTransaction { - #[serde(default, with = "ethrex_core::serde_utils::u64::hex_str")] + #[serde(default, with = "ethrex_common::serde_utils::u64::hex_str")] pub chain_id: u64, - #[serde(default, with = "ethrex_core::serde_utils::u64::hex_str")] + #[serde(default, with = "ethrex_common::serde_utils::u64::hex_str")] pub nonce: u64, - #[serde(default, with = "ethrex_core::serde_utils::u64::hex_str")] + #[serde(default, with = "ethrex_common::serde_utils::u64::hex_str")] pub max_priority_fee_per_gas: u64, - #[serde(default, with = "ethrex_core::serde_utils::u64::hex_str")] + #[serde(default, with = "ethrex_common::serde_utils::u64::hex_str")] pub max_fee_per_gas: u64, - #[serde(default, with = "ethrex_core::serde_utils::u64::hex_str")] + #[serde(default, with = "ethrex_common::serde_utils::u64::hex_str")] pub gas_limit: u64, #[serde(default)] pub to: Address, @@ -1086,9 +1086,9 @@ pub struct GetTransactionByHashTransaction { pub r#type: TxType, #[serde(default)] pub signature_y_parity: bool, - #[serde(default, with = "ethrex_core::serde_utils::u64::hex_str")] + #[serde(default, with = "ethrex_common::serde_utils::u64::hex_str")] pub signature_r: u64, - #[serde(default, with = "ethrex_core::serde_utils::u64::hex_str")] + #[serde(default, with = "ethrex_common::serde_utils::u64::hex_str")] pub signature_s: u64, #[serde(default)] pub block_number: U256, @@ -1098,7 +1098,7 @@ pub struct GetTransactionByHashTransaction { pub from: Address, #[serde(default)] pub hash: H256, - #[serde(default, with = "ethrex_core::serde_utils::u64::hex_str")] + #[serde(default, with = "ethrex_common::serde_utils::u64::hex_str")] pub transaction_index: u64, } diff --git a/crates/l2/sdk/src/merkle_tree.rs b/crates/l2/sdk/src/merkle_tree.rs index 99514fd66a..eec2d0351f 100644 --- a/crates/l2/sdk/src/merkle_tree.rs +++ b/crates/l2/sdk/src/merkle_tree.rs @@ -1,4 +1,4 @@ -use ethrex_core::H256; +use ethrex_common::H256; use keccak_hash::keccak; use serde::{Deserialize, Serialize}; use tracing::info; diff --git a/crates/l2/sdk/src/sdk.rs b/crates/l2/sdk/src/sdk.rs index f254022957..991b02be01 100644 --- a/crates/l2/sdk/src/sdk.rs +++ b/crates/l2/sdk/src/sdk.rs @@ -5,7 +5,7 @@ use eth_client::{ EthClient, }; use ethereum_types::{Address, H160, H256, U256}; -use ethrex_core::types::{PrivilegedTxType, Transaction}; +use ethrex_common::types::{PrivilegedTxType, Transaction}; use ethrex_rpc::types::{block::BlockBodyWrapper, receipt::RpcReceipt}; use itertools::Itertools; use keccak_hash::keccak; diff --git a/crates/l2/utils/test_data_io.rs b/crates/l2/utils/test_data_io.rs index 6a4ced09f2..cde47d5b2d 100644 --- a/crates/l2/utils/test_data_io.rs +++ b/crates/l2/utils/test_data_io.rs @@ -2,7 +2,7 @@ #![allow(clippy::expect_used)] use ethrex_blockchain::add_block; -use ethrex_core::types::{Block, Genesis}; +use ethrex_common::types::{Block, Genesis}; use ethrex_rlp::{decode::RLPDecode, encode::RLPEncode}; use ethrex_storage::{EngineType, Store}; use ethrex_vm::execution_db::ExecutionDB; diff --git a/crates/networking/p2p/Cargo.toml b/crates/networking/p2p/Cargo.toml index 24f326a809..1b8c380e32 100644 --- a/crates/networking/p2p/Cargo.toml +++ b/crates/networking/p2p/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -ethrex-core.workspace = true +ethrex-common.workspace = true ethrex-blockchain.workspace = true ethrex-rlp.workspace = true ethrex-storage.workspace = true diff --git a/crates/networking/p2p/discv4/lookup.rs b/crates/networking/p2p/discv4/lookup.rs index 0a4c4ab873..23d585e610 100644 --- a/crates/networking/p2p/discv4/lookup.rs +++ b/crates/networking/p2p/discv4/lookup.rs @@ -8,7 +8,7 @@ use crate::{ network::{node_id_from_signing_key, P2PContext}, types::Node, }; -use ethrex_core::H512; +use ethrex_common::H512; use k256::ecdsa::SigningKey; use rand::rngs::OsRng; use std::{collections::HashSet, net::SocketAddr, sync::Arc, time::Duration}; diff --git a/crates/networking/p2p/discv4/messages.rs b/crates/networking/p2p/discv4/messages.rs index e950881348..ce137f55f2 100644 --- a/crates/networking/p2p/discv4/messages.rs +++ b/crates/networking/p2p/discv4/messages.rs @@ -1,7 +1,7 @@ use super::helpers::current_unix_time; use crate::types::{Endpoint, Node, NodeRecord}; use bytes::BufMut; -use ethrex_core::{H256, H512, H520}; +use ethrex_common::{H256, H512, H520}; use ethrex_rlp::{ decode::RLPDecode, encode::RLPEncode, @@ -501,7 +501,7 @@ impl RLPEncode for ENRResponseMessage { mod tests { use super::*; use bytes::Bytes; - use ethrex_core::{H256, H264}; + use ethrex_common::{H256, H264}; use std::fmt::Write; use std::net::IpAddr; use std::num::ParseIntError; diff --git a/crates/networking/p2p/discv4/server.rs b/crates/networking/p2p/discv4/server.rs index 17fc93c58f..76247d116b 100644 --- a/crates/networking/p2p/discv4/server.rs +++ b/crates/networking/p2p/discv4/server.rs @@ -13,7 +13,7 @@ use crate::{ network::{handle_peer_as_initiator, P2PContext}, types::{Endpoint, Node, NodeRecord}, }; -use ethrex_core::H256; +use ethrex_common::H256; use k256::ecdsa::{signature::hazmat::PrehashVerifier, Signature, VerifyingKey}; use std::{ collections::HashSet, diff --git a/crates/networking/p2p/kademlia.rs b/crates/networking/p2p/kademlia.rs index b9f1cf696d..98df637f40 100644 --- a/crates/networking/p2p/kademlia.rs +++ b/crates/networking/p2p/kademlia.rs @@ -5,7 +5,7 @@ use crate::{ rlpx::{message::Message as RLPxMessage, p2p::Capability}, types::{Node, NodeRecord}, }; -use ethrex_core::{H256, H512, U256}; +use ethrex_common::{H256, H512, U256}; use sha3::{Digest, Keccak256}; use tokio::sync::mpsc::UnboundedSender; use tokio::sync::{mpsc, Mutex}; diff --git a/crates/networking/p2p/network.rs b/crates/networking/p2p/network.rs index 2bb13ed2e9..5f771d45ad 100644 --- a/crates/networking/p2p/network.rs +++ b/crates/networking/p2p/network.rs @@ -11,7 +11,7 @@ use crate::{ }, rlpx::utils::log_peer_error, }; -use ethrex_core::H512; +use ethrex_common::H512; use ethrex_storage::Store; use k256::{ ecdsa::SigningKey, diff --git a/crates/networking/p2p/peer_handler.rs b/crates/networking/p2p/peer_handler.rs index b1e3dca348..f8acb03072 100644 --- a/crates/networking/p2p/peer_handler.rs +++ b/crates/networking/p2p/peer_handler.rs @@ -1,7 +1,7 @@ use std::{collections::BTreeMap, sync::Arc, time::Duration}; use bytes::Bytes; -use ethrex_core::{ +use ethrex_common::{ types::{AccountState, BlockBody, BlockHeader, Receipt}, H256, U256, }; diff --git a/crates/networking/p2p/rlpx/connection.rs b/crates/networking/p2p/rlpx/connection.rs index 1f661bf6e8..4352a7c57e 100644 --- a/crates/networking/p2p/rlpx/connection.rs +++ b/crates/networking/p2p/rlpx/connection.rs @@ -20,7 +20,7 @@ use crate::{ types::Node, }; use ethrex_blockchain::mempool::{self}; -use ethrex_core::{H256, H512}; +use ethrex_common::{H256, H512}; use ethrex_storage::Store; use futures::SinkExt; use k256::{ecdsa::SigningKey, PublicKey, SecretKey}; diff --git a/crates/networking/p2p/rlpx/eth/backend.rs b/crates/networking/p2p/rlpx/eth/backend.rs index 7526ba696f..0e4fd14f6e 100644 --- a/crates/networking/p2p/rlpx/eth/backend.rs +++ b/crates/networking/p2p/rlpx/eth/backend.rs @@ -1,4 +1,4 @@ -use ethrex_core::{types::ForkId, U256}; +use ethrex_common::{types::ForkId, U256}; use ethrex_storage::Store; use crate::rlpx::error::RLPxError; @@ -89,7 +89,7 @@ pub fn validate_status(msg_data: StatusMessage, storage: &Store) -> Result<(), R mod tests { use super::validate_status; use crate::rlpx::eth::status::StatusMessage; - use ethrex_core::{ + use ethrex_common::{ types::{ForkId, Genesis}, H256, U256, }; diff --git a/crates/networking/p2p/rlpx/eth/blocks.rs b/crates/networking/p2p/rlpx/eth/blocks.rs index 01ae0d3c1f..bc2ce2b1c1 100644 --- a/crates/networking/p2p/rlpx/eth/blocks.rs +++ b/crates/networking/p2p/rlpx/eth/blocks.rs @@ -3,7 +3,7 @@ use crate::rlpx::{ utils::{snappy_compress, snappy_decompress}, }; use bytes::BufMut; -use ethrex_core::types::{BlockBody, BlockHash, BlockHeader, BlockNumber}; +use ethrex_common::types::{BlockBody, BlockHash, BlockHeader, BlockNumber}; use ethrex_rlp::{ decode::RLPDecode, encode::RLPEncode, @@ -309,7 +309,7 @@ impl RLPxMessage for BlockBodies { #[cfg(test)] mod tests { - use ethrex_core::types::BlockHash; + use ethrex_common::types::BlockHash; use crate::rlpx::{ eth::blocks::{BlockBodies, GetBlockBodies, GetBlockHeaders}, diff --git a/crates/networking/p2p/rlpx/eth/receipts.rs b/crates/networking/p2p/rlpx/eth/receipts.rs index f3e3b11502..20f7112df0 100644 --- a/crates/networking/p2p/rlpx/eth/receipts.rs +++ b/crates/networking/p2p/rlpx/eth/receipts.rs @@ -3,7 +3,7 @@ use crate::rlpx::{ utils::{snappy_compress, snappy_decompress}, }; use bytes::BufMut; -use ethrex_core::types::{BlockHash, Receipt}; +use ethrex_common::types::{BlockHash, Receipt}; use ethrex_rlp::{ error::{RLPDecodeError, RLPEncodeError}, structs::{Decoder, Encoder}, @@ -87,7 +87,7 @@ impl RLPxMessage for Receipts { #[cfg(test)] mod tests { - use ethrex_core::types::{BlockHash, Receipt}; + use ethrex_common::types::{BlockHash, Receipt}; use crate::rlpx::{ eth::receipts::{GetReceipts, Receipts}, diff --git a/crates/networking/p2p/rlpx/eth/status.rs b/crates/networking/p2p/rlpx/eth/status.rs index f39c36dcfd..cd0731eee3 100644 --- a/crates/networking/p2p/rlpx/eth/status.rs +++ b/crates/networking/p2p/rlpx/eth/status.rs @@ -3,7 +3,7 @@ use crate::rlpx::{ utils::{snappy_compress, snappy_decompress}, }; use bytes::BufMut; -use ethrex_core::{ +use ethrex_common::{ types::{BlockHash, ForkId}, U256, }; diff --git a/crates/networking/p2p/rlpx/eth/transactions.rs b/crates/networking/p2p/rlpx/eth/transactions.rs index 56ff26c409..d5846420fd 100644 --- a/crates/networking/p2p/rlpx/eth/transactions.rs +++ b/crates/networking/p2p/rlpx/eth/transactions.rs @@ -2,9 +2,9 @@ use bytes::BufMut; use bytes::Bytes; use ethrex_blockchain::error::MempoolError; use ethrex_blockchain::mempool; -use ethrex_core::types::P2PTransaction; -use ethrex_core::types::WrappedEIP4844Transaction; -use ethrex_core::{types::Transaction, H256}; +use ethrex_common::types::P2PTransaction; +use ethrex_common::types::WrappedEIP4844Transaction; +use ethrex_common::{types::Transaction, H256}; use ethrex_rlp::{ error::{RLPDecodeError, RLPEncodeError}, structs::{Decoder, Encoder}, @@ -299,7 +299,7 @@ impl RLPxMessage for PooledTransactions { #[cfg(test)] mod tests { - use ethrex_core::{types::P2PTransaction, H256}; + use ethrex_common::{types::P2PTransaction, H256}; use crate::rlpx::{ eth::transactions::{GetPooledTransactions, PooledTransactions}, diff --git a/crates/networking/p2p/rlpx/frame.rs b/crates/networking/p2p/rlpx/frame.rs index 0fe1fc2030..30faf96a5a 100644 --- a/crates/networking/p2p/rlpx/frame.rs +++ b/crates/networking/p2p/rlpx/frame.rs @@ -9,7 +9,7 @@ use aes::{ Aes256Enc, }; use bytes::{Buf, BytesMut}; -use ethrex_core::{H128, H256}; +use ethrex_common::{H128, H256}; use ethrex_rlp::{decode::RLPDecode, encode::RLPEncode as _}; use sha3::{Digest as _, Keccak256}; use tokio::io::{AsyncRead, AsyncWrite}; diff --git a/crates/networking/p2p/rlpx/handshake.rs b/crates/networking/p2p/rlpx/handshake.rs index eb82ee5468..85da3b72a8 100644 --- a/crates/networking/p2p/rlpx/handshake.rs +++ b/crates/networking/p2p/rlpx/handshake.rs @@ -11,7 +11,7 @@ use crate::{ types::Node, }; use aes::cipher::{KeyIvInit, StreamCipher}; -use ethrex_core::{Signature, H128, H256, H512}; +use ethrex_common::{Signature, H128, H256, H512}; use ethrex_rlp::{ decode::RLPDecode, encode::RLPEncode, @@ -505,7 +505,7 @@ impl RLPDecode for AckMessage { mod tests { use std::str::FromStr; - use ethrex_core::H256; + use ethrex_common::H256; use hex_literal::hex; use k256::SecretKey; diff --git a/crates/networking/p2p/rlpx/p2p.rs b/crates/networking/p2p/rlpx/p2p.rs index bcc0fd4fba..3f423c809b 100644 --- a/crates/networking/p2p/rlpx/p2p.rs +++ b/crates/networking/p2p/rlpx/p2p.rs @@ -1,5 +1,5 @@ use bytes::BufMut; -use ethrex_core::H512; +use ethrex_common::H512; use ethrex_rlp::{ decode::RLPDecode, encode::RLPEncode, diff --git a/crates/networking/p2p/rlpx/snap.rs b/crates/networking/p2p/rlpx/snap.rs index 8d56438a9b..2b7fafee5d 100644 --- a/crates/networking/p2p/rlpx/snap.rs +++ b/crates/networking/p2p/rlpx/snap.rs @@ -3,7 +3,7 @@ use super::{ utils::{snappy_compress, snappy_decompress}, }; use bytes::{BufMut, Bytes}; -use ethrex_core::{ +use ethrex_common::{ types::{AccountState, EMPTY_KECCACK_HASH, EMPTY_TRIE_HASH}, H256, U256, }; diff --git a/crates/networking/p2p/rlpx/utils.rs b/crates/networking/p2p/rlpx/utils.rs index e9660149fb..7dec861fce 100644 --- a/crates/networking/p2p/rlpx/utils.rs +++ b/crates/networking/p2p/rlpx/utils.rs @@ -1,5 +1,5 @@ use crate::types::Node; -use ethrex_core::H512; +use ethrex_common::H512; use ethrex_rlp::error::{RLPDecodeError, RLPEncodeError}; use k256::{ elliptic_curve::sec1::{FromEncodedPoint, ToEncodedPoint}, diff --git a/crates/networking/p2p/snap.rs b/crates/networking/p2p/snap.rs index 499934754f..9bbe970280 100644 --- a/crates/networking/p2p/snap.rs +++ b/crates/networking/p2p/snap.rs @@ -165,7 +165,7 @@ pub(crate) fn encodable_to_proof(proof: &[Bytes]) -> Vec> { mod tests { use std::str::FromStr; - use ethrex_core::{types::AccountState, BigEndianHash, H256}; + use ethrex_common::{types::AccountState, BigEndianHash, H256}; use ethrex_rlp::{decode::RLPDecode, encode::RLPEncode}; use ethrex_storage::EngineType; diff --git a/crates/networking/p2p/sync.rs b/crates/networking/p2p/sync.rs index b8a9edfbe4..22957e8dcf 100644 --- a/crates/networking/p2p/sync.rs +++ b/crates/networking/p2p/sync.rs @@ -1,5 +1,5 @@ use ethrex_blockchain::error::ChainError; -use ethrex_core::{ +use ethrex_common::{ types::{AccountState, Block, BlockHash, EMPTY_KECCACK_HASH}, BigEndianHash, H256, U256, U512, }; diff --git a/crates/networking/p2p/types.rs b/crates/networking/p2p/types.rs index f45ae6ebc0..d483d5c381 100644 --- a/crates/networking/p2p/types.rs +++ b/crates/networking/p2p/types.rs @@ -1,5 +1,5 @@ use bytes::{BufMut, Bytes}; -use ethrex_core::{H264, H512}; +use ethrex_common::{H264, H512}; use ethrex_rlp::{ decode::RLPDecode, encode::RLPEncode, @@ -138,7 +138,7 @@ impl Node { } pub fn from_enr_url(enr: &str) -> Result { - let base64_decoded = ethrex_core::base64::decode(enr[4..].as_bytes()); + let base64_decoded = ethrex_common::base64::decode(enr[4..].as_bytes()); let record = NodeRecord::decode(&base64_decoded) .map_err(|_| "Could not build node record from enr")?; let pairs = record.decode_pairs(); @@ -256,7 +256,7 @@ impl NodeRecord { pub fn enr_url(&self) -> Result { let rlp_encoded = self.encode_to_vec(); - let base64_encoded = ethrex_core::base64::encode(&rlp_encoded); + let base64_encoded = ethrex_common::base64::encode(&rlp_encoded); let mut result: String = "enr:".into(); let base64_encoded = String::from_utf8(base64_encoded).map_err(|_| "Could not base 64 encode enr record")?; @@ -390,7 +390,7 @@ mod tests { network::node_id_from_signing_key, types::{Node, NodeRecord}, }; - use ethrex_core::H512; + use ethrex_common::H512; use k256::ecdsa::SigningKey; use std::{net::SocketAddr, str::FromStr}; diff --git a/crates/networking/rpc/Cargo.toml b/crates/networking/rpc/Cargo.toml index 3fbee3012a..ae06b856b7 100644 --- a/crates/networking/rpc/Cargo.toml +++ b/crates/networking/rpc/Cargo.toml @@ -13,7 +13,7 @@ tokio.workspace = true bytes.workspace = true tracing.workspace = true tracing-subscriber.workspace = true -ethrex-core.workspace = true +ethrex-common.workspace = true ethrex-storage.workspace = true ethrex-vm.workspace = true ethrex-blockchain.workspace = true diff --git a/crates/networking/rpc/admin/mod.rs b/crates/networking/rpc/admin/mod.rs index f2d37b8f0a..ffd9767148 100644 --- a/crates/networking/rpc/admin/mod.rs +++ b/crates/networking/rpc/admin/mod.rs @@ -1,4 +1,4 @@ -use ethrex_core::types::ChainConfig; +use ethrex_common::types::ChainConfig; use ethrex_p2p::types::{Node, NodeRecord}; use ethrex_storage::Store; use serde::Serialize; diff --git a/crates/networking/rpc/engine/exchange_transition_config.rs b/crates/networking/rpc/engine/exchange_transition_config.rs index 751b1ad49b..b1228aa8dc 100644 --- a/crates/networking/rpc/engine/exchange_transition_config.rs +++ b/crates/networking/rpc/engine/exchange_transition_config.rs @@ -1,4 +1,4 @@ -use ethrex_core::{serde_utils, H256}; +use ethrex_common::{serde_utils, H256}; use serde::{Deserialize, Serialize}; use serde_json::Value; use tracing::{info, warn}; diff --git a/crates/networking/rpc/engine/fork_choice.rs b/crates/networking/rpc/engine/fork_choice.rs index ae46a3b9fa..37ae38aef6 100644 --- a/crates/networking/rpc/engine/fork_choice.rs +++ b/crates/networking/rpc/engine/fork_choice.rs @@ -4,7 +4,7 @@ use ethrex_blockchain::{ latest_canonical_block_hash, payload::{create_payload, BuildPayloadArgs}, }; -use ethrex_core::types::BlockHeader; +use ethrex_common::types::BlockHeader; use serde_json::Value; use tracing::{debug, info, warn}; diff --git a/crates/networking/rpc/engine/payload.rs b/crates/networking/rpc/engine/payload.rs index b627e774e9..f7366d3475 100644 --- a/crates/networking/rpc/engine/payload.rs +++ b/crates/networking/rpc/engine/payload.rs @@ -1,8 +1,8 @@ use ethrex_blockchain::add_block; use ethrex_blockchain::error::ChainError; use ethrex_blockchain::payload::build_payload; -use ethrex_core::types::{BlobsBundle, Block, BlockBody, BlockHash, BlockNumber, Fork}; -use ethrex_core::{H256, U256}; +use ethrex_common::types::{BlobsBundle, Block, BlockBody, BlockHash, BlockNumber, Fork}; +use ethrex_common::{H256, U256}; use serde_json::Value; use tracing::{debug, error, info, warn}; diff --git a/crates/networking/rpc/eth/account.rs b/crates/networking/rpc/eth/account.rs index 94f880da33..e1746f6e40 100644 --- a/crates/networking/rpc/eth/account.rs +++ b/crates/networking/rpc/eth/account.rs @@ -6,7 +6,7 @@ use crate::types::account_proof::{AccountProof, StorageProof}; use crate::types::block_identifier::{BlockIdentifierOrHash, BlockTag}; use crate::RpcApiContext; use crate::{utils::RpcErr, RpcHandler}; -use ethrex_core::{Address, BigEndianHash, H256, U256}; +use ethrex_common::{Address, BigEndianHash, H256, U256}; pub struct GetBalanceRequest { pub address: Address, diff --git a/crates/networking/rpc/eth/block.rs b/crates/networking/rpc/eth/block.rs index 2da29413e4..742e50c6a0 100644 --- a/crates/networking/rpc/eth/block.rs +++ b/crates/networking/rpc/eth/block.rs @@ -12,7 +12,7 @@ use crate::{ utils::RpcErr, RpcApiContext, RpcHandler, }; -use ethrex_core::{ +use ethrex_common::{ types::{ calculate_base_fee_per_blob_gas, Block, BlockBody, BlockHash, BlockHeader, BlockNumber, Receipt, diff --git a/crates/networking/rpc/eth/fee_market.rs b/crates/networking/rpc/eth/fee_market.rs index 48bc1cd9f8..2005c5ec45 100644 --- a/crates/networking/rpc/eth/fee_market.rs +++ b/crates/networking/rpc/eth/fee_market.rs @@ -1,4 +1,4 @@ -use ethrex_core::{ +use ethrex_common::{ constants::GAS_PER_BLOB, types::{Block, Transaction}, }; @@ -7,7 +7,7 @@ use serde_json::Value; use tracing::info; use crate::{types::block_identifier::BlockIdentifier, utils::RpcErr, RpcApiContext, RpcHandler}; -use ethrex_core::types::calculate_base_fee_per_blob_gas; +use ethrex_common::types::calculate_base_fee_per_blob_gas; use ethrex_storage::Store; #[derive(Clone, Debug)] diff --git a/crates/networking/rpc/eth/filter.rs b/crates/networking/rpc/eth/filter.rs index e686c0dc6a..0a3fb0316c 100644 --- a/crates/networking/rpc/eth/filter.rs +++ b/crates/networking/rpc/eth/filter.rs @@ -2,7 +2,7 @@ // - Manually testing the behaviour deploying contracts on the Sepolia test network. // - Go-Ethereum, specifically: https://github.com/ethereum/go-ethereum/blob/368e16f39d6c7e5cce72a92ec289adbfbaed4854/eth/filters/filter.go // - Ethereum's reference: https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newfilter -use ethrex_core::types::BlockNumber; +use ethrex_common::types::BlockNumber; use ethrex_storage::Store; use std::{ collections::HashMap, @@ -267,7 +267,7 @@ mod tests { types::block_identifier::BlockIdentifier, utils::{test_utils::example_p2p_node, RpcRequest}, }; - use ethrex_core::types::Genesis; + use ethrex_common::types::Genesis; use ethrex_p2p::sync::SyncManager; use ethrex_storage::{EngineType, Store}; diff --git a/crates/networking/rpc/eth/logs.rs b/crates/networking/rpc/eth/logs.rs index 72eb0aed60..937239b4e8 100644 --- a/crates/networking/rpc/eth/logs.rs +++ b/crates/networking/rpc/eth/logs.rs @@ -6,7 +6,7 @@ use crate::{ types::{block_identifier::BlockIdentifier, receipt::RpcLog}, RpcApiContext, RpcErr, RpcHandler, }; -use ethrex_core::{H160, H256}; +use ethrex_common::{H160, H256}; use ethrex_storage::Store; use serde::Deserialize; use serde_json::Value; diff --git a/crates/networking/rpc/eth/mod.rs b/crates/networking/rpc/eth/mod.rs index 5fc298a793..326e6aa8f1 100644 --- a/crates/networking/rpc/eth/mod.rs +++ b/crates/networking/rpc/eth/mod.rs @@ -13,7 +13,7 @@ pub(crate) mod max_priority_fee; #[cfg(test)] pub mod test_utils { use bytes::Bytes; - use ethrex_core::{ + use ethrex_common::{ types::{ Block, BlockBody, BlockHeader, EIP1559Transaction, Genesis, LegacyTransaction, Transaction, TxKind, DEFAULT_REQUESTS_HASH, diff --git a/crates/networking/rpc/eth/transaction.rs b/crates/networking/rpc/eth/transaction.rs index e098bce6ff..eca1a45ac0 100644 --- a/crates/networking/rpc/eth/transaction.rs +++ b/crates/networking/rpc/eth/transaction.rs @@ -7,7 +7,7 @@ use crate::{ utils::RpcErr, RpcApiContext, RpcHandler, }; -use ethrex_core::{ +use ethrex_common::{ types::{AccessListEntry, BlockHash, BlockHeader, BlockNumber, GenericTransaction, TxKind}, H256, U256, }; @@ -68,7 +68,7 @@ pub struct AccessListResult { access_list: Vec, #[serde(skip_serializing_if = "Option::is_none")] error: Option, - #[serde(with = "ethrex_core::serde_utils::u64::hex_str")] + #[serde(with = "ethrex_common::serde_utils::u64::hex_str")] gas_used: u64, } @@ -233,7 +233,7 @@ impl RpcHandler for GetTransactionByHashRequest { _ => return Ok(Value::Null), }; - let transaction: ethrex_core::types::Transaction = + let transaction: ethrex_common::types::Transaction = match storage.get_transaction_by_location(block_hash, index)? { Some(transaction) => transaction, _ => return Ok(Value::Null), diff --git a/crates/networking/rpc/rpc.rs b/crates/networking/rpc/rpc.rs index b0ebcedac5..3361960db7 100644 --- a/crates/networking/rpc/rpc.rs +++ b/crates/networking/rpc/rpc.rs @@ -360,7 +360,7 @@ where mod tests { use super::*; use crate::utils::test_utils::{example_local_node_record, example_p2p_node}; - use ethrex_core::types::{ChainConfig, Genesis}; + use ethrex_common::types::{ChainConfig, Genesis}; use ethrex_storage::EngineType; use sha3::{Digest, Keccak256}; use std::fs::File; diff --git a/crates/networking/rpc/types/account_proof.rs b/crates/networking/rpc/types/account_proof.rs index ed0ca8cdfc..d3c8ac4c3f 100644 --- a/crates/networking/rpc/types/account_proof.rs +++ b/crates/networking/rpc/types/account_proof.rs @@ -1,4 +1,4 @@ -use ethrex_core::{serde_utils, Address, H256, U256}; +use ethrex_common::{serde_utils, Address, H256, U256}; use serde::{ser::SerializeSeq, Serialize, Serializer}; #[derive(Debug, Serialize)] diff --git a/crates/networking/rpc/types/block.rs b/crates/networking/rpc/types/block.rs index 41de1e1016..f6f2a4c4f2 100644 --- a/crates/networking/rpc/types/block.rs +++ b/crates/networking/rpc/types/block.rs @@ -1,5 +1,5 @@ use super::transaction::RpcTransaction; -use ethrex_core::{ +use ethrex_common::{ serde_utils, types::{Block, BlockBody, BlockHash, BlockHeader, BlockNumber, Withdrawal}, H256, U256, @@ -101,7 +101,7 @@ impl FullBlockBody { mod test { use bytes::Bytes; - use ethrex_core::{ + use ethrex_common::{ types::{EIP1559Transaction, Transaction, TxKind, EMPTY_KECCACK_HASH}, Address, Bloom, H256, U256, }; diff --git a/crates/networking/rpc/types/block_identifier.rs b/crates/networking/rpc/types/block_identifier.rs index d741a4cf77..9c816435c5 100644 --- a/crates/networking/rpc/types/block_identifier.rs +++ b/crates/networking/rpc/types/block_identifier.rs @@ -1,6 +1,6 @@ use std::{fmt::Display, str::FromStr}; -use ethrex_core::types::{BlockHash, BlockHeader, BlockNumber}; +use ethrex_common::types::{BlockHash, BlockHeader, BlockNumber}; use ethrex_storage::{error::StoreError, Store}; use serde::Deserialize; use serde_json::Value; diff --git a/crates/networking/rpc/types/fork_choice.rs b/crates/networking/rpc/types/fork_choice.rs index 754d8183e1..a0483ed99a 100644 --- a/crates/networking/rpc/types/fork_choice.rs +++ b/crates/networking/rpc/types/fork_choice.rs @@ -1,5 +1,5 @@ use super::payload::PayloadStatus; -use ethrex_core::{serde_utils, types::Withdrawal, Address, H256}; +use ethrex_common::{serde_utils, types::Withdrawal, Address, H256}; use serde::{Deserialize, Serialize}; #[derive(Debug, Deserialize, Serialize)] diff --git a/crates/networking/rpc/types/payload.rs b/crates/networking/rpc/types/payload.rs index 202816f752..650cbd6257 100644 --- a/crates/networking/rpc/types/payload.rs +++ b/crates/networking/rpc/types/payload.rs @@ -2,7 +2,7 @@ use bytes::Bytes; use ethrex_rlp::error::RLPDecodeError; use serde::{Deserialize, Serialize}; -use ethrex_core::{ +use ethrex_common::{ serde_utils, types::{ compute_transactions_root, compute_withdrawals_root, BlobsBundle, Block, BlockBody, diff --git a/crates/networking/rpc/types/receipt.rs b/crates/networking/rpc/types/receipt.rs index 29bb39cbba..f54a3c910a 100644 --- a/crates/networking/rpc/types/receipt.rs +++ b/crates/networking/rpc/types/receipt.rs @@ -1,4 +1,4 @@ -use ethrex_core::{ +use ethrex_common::{ constants::GAS_PER_BLOB, serde_utils, types::{BlockHash, BlockHeader, BlockNumber, Log, Receipt, Transaction, TxKind, TxType}, @@ -138,18 +138,18 @@ impl RpcReceiptBlockInfo { #[serde(rename_all = "camelCase")] pub struct RpcReceiptTxInfo { pub transaction_hash: H256, - #[serde(with = "ethrex_core::serde_utils::u64::hex_str")] + #[serde(with = "ethrex_common::serde_utils::u64::hex_str")] pub transaction_index: u64, pub from: Address, pub to: Option
, pub contract_address: Option
, - #[serde(with = "ethrex_core::serde_utils::u64::hex_str")] + #[serde(with = "ethrex_common::serde_utils::u64::hex_str")] pub gas_used: u64, - #[serde(with = "ethrex_core::serde_utils::u64::hex_str")] + #[serde(with = "ethrex_common::serde_utils::u64::hex_str")] pub effective_gas_price: u64, #[serde( skip_serializing_if = "Option::is_none", - with = "ethrex_core::serde_utils::u64::hex_str_opt", + with = "ethrex_common::serde_utils::u64::hex_str_opt", default = "Option::default" )] pub blob_gas_price: Option, @@ -207,7 +207,7 @@ impl RpcReceiptTxInfo { #[cfg(test)] mod tests { use super::*; - use ethrex_core::{ + use ethrex_common::{ types::{Log, TxType}, Bloom, Bytes, }; diff --git a/crates/networking/rpc/types/transaction.rs b/crates/networking/rpc/types/transaction.rs index 0f63205af1..1b217854fd 100644 --- a/crates/networking/rpc/types/transaction.rs +++ b/crates/networking/rpc/types/transaction.rs @@ -1,4 +1,4 @@ -use ethrex_core::{ +use ethrex_common::{ serde_utils, types::{ BlockHash, BlockNumber, EIP1559Transaction, EIP2930Transaction, LegacyTransaction, diff --git a/crates/networking/rpc/utils.rs b/crates/networking/rpc/utils.rs index e71db2681b..cc0d4ed15f 100644 --- a/crates/networking/rpc/utils.rs +++ b/crates/networking/rpc/utils.rs @@ -254,7 +254,7 @@ pub fn parse_json_hex(hex: &serde_json::Value) -> Result { pub mod test_utils { use std::{net::SocketAddr, str::FromStr}; - use ethrex_core::H512; + use ethrex_common::H512; use ethrex_p2p::{ sync::SyncManager, types::{Node, NodeRecord}, diff --git a/crates/storage/store/Cargo.toml b/crates/storage/store/Cargo.toml index 322d1a3178..18c7451665 100644 --- a/crates/storage/store/Cargo.toml +++ b/crates/storage/store/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [dependencies] ethrex-rlp.workspace = true -ethrex-core = { path = "../../common", default-features = false } +ethrex-common = { path = "../../common", default-features = false } ethrex-trie = { path = "../../storage/trie", default-features = false } ethereum-types.workspace = true @@ -24,8 +24,8 @@ redb = { workspace = true, optional = true } [features] default = [] -libmdbx = ["dep:libmdbx", "ethrex-trie/libmdbx", "ethrex-core/libmdbx"] -redb = ["dep:redb", "ethrex-trie/redb", "ethrex-core/redb"] +libmdbx = ["dep:libmdbx", "ethrex-trie/libmdbx", "ethrex-common/libmdbx"] +redb = ["dep:redb", "ethrex-trie/redb", "ethrex-common/redb"] [dev-dependencies] hex.workspace = true diff --git a/crates/storage/store/engines/api.rs b/crates/storage/store/engines/api.rs index 57801104b5..0c134e2385 100644 --- a/crates/storage/store/engines/api.rs +++ b/crates/storage/store/engines/api.rs @@ -1,6 +1,6 @@ use bytes::Bytes; use ethereum_types::{H256, U256}; -use ethrex_core::types::{ +use ethrex_common::types::{ BlobsBundle, Block, BlockBody, BlockHash, BlockHeader, BlockNumber, ChainConfig, Index, Receipt, Transaction, }; diff --git a/crates/storage/store/engines/in_memory.rs b/crates/storage/store/engines/in_memory.rs index 0455e2fea7..a9d395adb1 100644 --- a/crates/storage/store/engines/in_memory.rs +++ b/crates/storage/store/engines/in_memory.rs @@ -1,7 +1,7 @@ use crate::error::StoreError; use bytes::Bytes; use ethereum_types::{H256, U256}; -use ethrex_core::types::{ +use ethrex_common::types::{ BlobsBundle, Block, BlockBody, BlockHash, BlockHeader, BlockNumber, ChainConfig, Index, Receipt, }; use ethrex_trie::{InMemoryTrieDB, Nibbles, Trie}; diff --git a/crates/storage/store/engines/libmdbx.rs b/crates/storage/store/engines/libmdbx.rs index b932ea06e5..c441c6802c 100644 --- a/crates/storage/store/engines/libmdbx.rs +++ b/crates/storage/store/engines/libmdbx.rs @@ -8,7 +8,7 @@ use crate::rlp::{ use anyhow::Result; use bytes::Bytes; use ethereum_types::{H256, U256}; -use ethrex_core::types::{ +use ethrex_common::types::{ BlobsBundle, Block, BlockBody, BlockHash, BlockHeader, BlockNumber, ChainConfig, Index, Receipt, Transaction, }; diff --git a/crates/storage/store/engines/redb.rs b/crates/storage/store/engines/redb.rs index 71e1d812ca..033023b74f 100644 --- a/crates/storage/store/engines/redb.rs +++ b/crates/storage/store/engines/redb.rs @@ -1,7 +1,7 @@ use std::{borrow::Borrow, panic::RefUnwindSafe, sync::Arc}; -use ethrex_core::types::BlockBody; -use ethrex_core::{ +use ethrex_common::types::BlockBody; +use ethrex_common::{ types::{BlobsBundle, Block, BlockHash, BlockHeader, BlockNumber, ChainConfig, Index, Receipt}, H256, U256, }; @@ -323,7 +323,7 @@ impl StoreEngine for RedBStore { fn add_block_total_difficulty( &self, block_hash: BlockHash, - block_total_difficulty: ethrex_core::U256, + block_total_difficulty: ethrex_common::U256, ) -> Result<(), StoreError> { // self.write::(block_hash.into(), block_total_difficulty.into()) self.write( @@ -336,7 +336,7 @@ impl StoreEngine for RedBStore { fn get_block_total_difficulty( &self, block_hash: BlockHash, - ) -> Result, StoreError> { + ) -> Result, StoreError> { Ok(self .read( BLOCK_TOTAL_DIFFICULTIES_TABLE, @@ -347,7 +347,7 @@ impl StoreEngine for RedBStore { fn add_transaction_location( &self, - transaction_hash: ethrex_core::H256, + transaction_hash: ethrex_common::H256, block_number: BlockNumber, block_hash: BlockHash, index: Index, @@ -365,7 +365,7 @@ impl StoreEngine for RedBStore { fn get_transaction_location( &self, - transaction_hash: ethrex_core::H256, + transaction_hash: ethrex_common::H256, ) -> Result, StoreError> { let read_txn = self.db.begin_read()?; let table = read_txn.open_multimap_table(TRANSACTION_LOCATIONS_TABLE)?; @@ -411,7 +411,7 @@ impl StoreEngine for RedBStore { fn add_account_code( &self, - code_hash: ethrex_core::H256, + code_hash: ethrex_common::H256, code: bytes::Bytes, ) -> Result<(), StoreError> { self.write( @@ -423,7 +423,7 @@ impl StoreEngine for RedBStore { fn get_account_code( &self, - code_hash: ethrex_core::H256, + code_hash: ethrex_common::H256, ) -> Result, StoreError> { Ok(self .read( @@ -533,7 +533,7 @@ impl StoreEngine for RedBStore { fn update_latest_total_difficulty( &self, - latest_total_difficulty: ethrex_core::U256, + latest_total_difficulty: ethrex_common::U256, ) -> Result<(), StoreError> { self.write( CHAIN_DATA_TABLE, @@ -542,7 +542,7 @@ impl StoreEngine for RedBStore { ) } - fn get_latest_total_difficulty(&self) -> Result, StoreError> { + fn get_latest_total_difficulty(&self) -> Result, StoreError> { match self.read(CHAIN_DATA_TABLE, ChainDataIndex::LatestTotalDifficulty)? { None => Ok(None), Some(ref rlp) => RLPDecode::decode(&rlp.value()) @@ -570,14 +570,14 @@ impl StoreEngine for RedBStore { fn open_storage_trie( &self, - hashed_address: ethrex_core::H256, - storage_root: ethrex_core::H256, + hashed_address: ethrex_common::H256, + storage_root: ethrex_common::H256, ) -> ethrex_trie::Trie { let db = Box::new(RedBMultiTableTrieDB::new(self.db.clone(), hashed_address.0)); Trie::open(db, storage_root) } - fn open_state_trie(&self, state_root: ethrex_core::H256) -> ethrex_trie::Trie { + fn open_state_trie(&self, state_root: ethrex_common::H256) -> ethrex_trie::Trie { let db = Box::new(RedBTrie::new(self.db.clone())); Trie::open(db, state_root) } diff --git a/crates/storage/store/rlp.rs b/crates/storage/store/rlp.rs index 77e20aa6b0..6514ce00cc 100644 --- a/crates/storage/store/rlp.rs +++ b/crates/storage/store/rlp.rs @@ -3,7 +3,7 @@ use std::marker::PhantomData; use bytes::Bytes; use ethereum_types::U256; -use ethrex_core::{ +use ethrex_common::{ types::{Block, BlockBody, BlockHash, BlockHeader, Receipt}, H256, }; diff --git a/crates/storage/store/storage.rs b/crates/storage/store/storage.rs index a93a9989d5..57bc2f24dc 100644 --- a/crates/storage/store/storage.rs +++ b/crates/storage/store/storage.rs @@ -7,7 +7,7 @@ use engines::api::StoreEngine; #[cfg(feature = "redb")] use engines::redb::RedBStore; use ethereum_types::{Address, H256, U256}; -use ethrex_core::types::{ +use ethrex_common::types::{ code_hash, AccountInfo, AccountState, BlobsBundle, Block, BlockBody, BlockHash, BlockHeader, BlockNumber, ChainConfig, Genesis, GenesisAccount, Index, MempoolTransaction, Receipt, Transaction, TxType, EMPTY_TRIE_HASH, @@ -1092,7 +1092,7 @@ pub fn hash_key(key: &H256) -> Vec { mod tests { use bytes::Bytes; use ethereum_types::{H256, U256}; - use ethrex_core::{ + use ethrex_common::{ types::{Transaction, TxType, BYTES_PER_BLOB, EMPTY_KECCACK_HASH}, Bloom, }; diff --git a/crates/vm/Cargo.toml b/crates/vm/Cargo.toml index 11f70a487d..5701f7edb2 100644 --- a/crates/vm/Cargo.toml +++ b/crates/vm/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" edition = "2021" [dependencies] -ethrex-core = { path = "../common", default-features = false } +ethrex-common = { path = "../common", default-features = false } ethrex-storage = { path = "../storage/store", default-features = false } ethrex-levm = { path = "./levm", default-features = false } ethrex-trie = { path = "../storage/trie", default-features = false } @@ -40,9 +40,9 @@ path = "./vm.rs" [features] default = ["c-kzg", "blst"] l2 = [] -c-kzg = ["revm/c-kzg", "ethrex-levm/c-kzg", "ethrex-core/c-kzg"] +c-kzg = ["revm/c-kzg", "ethrex-levm/c-kzg", "ethrex-common/c-kzg"] blst = ["revm/blst"] -libmdbx = ["ethrex-storage/default", "ethrex-core/libmdbx"] +libmdbx = ["ethrex-storage/default", "ethrex-common/libmdbx"] [profile.test] opt-level = 3 diff --git a/crates/vm/backends/levm.rs b/crates/vm/backends/levm.rs index 593fd0442a..a9ee3207a4 100644 --- a/crates/vm/backends/levm.rs +++ b/crates/vm/backends/levm.rs @@ -2,8 +2,8 @@ use crate::db::StoreWrapper; use crate::EvmError; use crate::EvmState; #[cfg(not(feature = "l2"))] -use ethrex_core::types::Fork; -use ethrex_core::{ +use ethrex_common::types::Fork; +use ethrex_common::{ types::{ code_hash, AccountInfo, Block, BlockHeader, Receipt, Transaction, TxKind, GWEI_TO_WEI, }, diff --git a/crates/vm/backends/revm.rs b/crates/vm/backends/revm.rs index 1f90881161..c0725ee183 100644 --- a/crates/vm/backends/revm.rs +++ b/crates/vm/backends/revm.rs @@ -12,7 +12,7 @@ use revm::{ }; use revm_inspectors::access_list::AccessListInspector; // Rename imported types for clarity -use ethrex_core::{ +use ethrex_common::{ types::{ Block, BlockHeader, GenericTransaction, PrivilegedTxType, Receipt, Transaction, TxKind, Withdrawal, GWEI_TO_WEI, INITIAL_BASE_FEE, diff --git a/crates/vm/db.rs b/crates/vm/db.rs index 0110f9bf37..0eca397586 100644 --- a/crates/vm/db.rs +++ b/crates/vm/db.rs @@ -1,5 +1,5 @@ use crate::{execution_db::ExecutionDB, EvmError}; -use ethrex_core::{ +use ethrex_common::{ types::{BlockHash, ChainConfig}, Address as CoreAddress, H256 as CoreH256, }; @@ -60,7 +60,7 @@ impl From for EvmState { } } -use ethrex_core::U256 as CoreU256; +use ethrex_common::U256 as CoreU256; use ethrex_levm::db::Database as LevmDatabase; impl LevmDatabase for StoreWrapper { diff --git a/crates/vm/errors.rs b/crates/vm/errors.rs index b440045fa8..877e82b635 100644 --- a/crates/vm/errors.rs +++ b/crates/vm/errors.rs @@ -1,5 +1,5 @@ use ethereum_types::{H160, H256}; -use ethrex_core::{types::BlockHash, Address}; +use ethrex_common::{types::BlockHash, Address}; use ethrex_levm::errors::VMError; use ethrex_storage::error::StoreError; use ethrex_trie::TrieError; diff --git a/crates/vm/execution_db.rs b/crates/vm/execution_db.rs index ead5f9a78f..0169568dd9 100644 --- a/crates/vm/execution_db.rs +++ b/crates/vm/execution_db.rs @@ -2,7 +2,7 @@ use std::collections::HashMap; use bytes::Bytes; use ethereum_types::H160; -use ethrex_core::{ +use ethrex_common::{ types::{AccountInfo, Block, ChainConfig}, Address, H256, U256, }; diff --git a/crates/vm/execution_result.rs b/crates/vm/execution_result.rs index 9f0d370862..2ac3742279 100644 --- a/crates/vm/execution_result.rs +++ b/crates/vm/execution_result.rs @@ -1,6 +1,6 @@ use bytes::Bytes; -use ethrex_core::Address; -use ethrex_core::{types::Log, H256}; +use ethrex_common::Address; +use ethrex_common::{types::Log, H256}; use revm::primitives::result::Output as RevmOutput; use revm::primitives::result::SuccessReason as RevmSuccessReason; use revm::primitives::ExecutionResult as RevmExecutionResult; diff --git a/crates/vm/levm/Cargo.toml b/crates/vm/levm/Cargo.toml index 55414f594c..d4fc6721ed 100644 --- a/crates/vm/levm/Cargo.toml +++ b/crates/vm/levm/Cargo.toml @@ -4,7 +4,7 @@ version.workspace = true edition.workspace = true [dependencies] -ethrex-core = { path = "../../common", default-features = false } +ethrex-common = { path = "../../common", default-features = false } ethrex-rlp.workspace = true revm-primitives = { version = "14.0.0", features = [ "std", @@ -41,7 +41,7 @@ spinoff = "0.8.0" [features] default = ["c-kzg"] -c-kzg = ["ethrex-core/c-kzg"] +c-kzg = ["ethrex-common/c-kzg"] ethereum_foundation_tests = [] [lints.rust] diff --git a/crates/vm/levm/bench/revm_comparison/Cargo.toml b/crates/vm/levm/bench/revm_comparison/Cargo.toml index dc00b9156a..c413ce8b4a 100644 --- a/crates/vm/levm/bench/revm_comparison/Cargo.toml +++ b/crates/vm/levm/bench/revm_comparison/Cargo.toml @@ -9,7 +9,7 @@ path = "src/lib.rs" [dependencies] ethrex-levm = { path = "../../" } -ethrex-core.workspace = true +ethrex-common.workspace = true hex.workspace = true bytes.workspace = true diff --git a/crates/vm/levm/src/account.rs b/crates/vm/levm/src/account.rs index 5d5dd69540..7cf497fecb 100644 --- a/crates/vm/levm/src/account.rs +++ b/crates/vm/levm/src/account.rs @@ -1,6 +1,6 @@ use crate::constants::EMPTY_CODE_HASH; use bytes::Bytes; -use ethrex_core::{H256, U256}; +use ethrex_common::{H256, U256}; use keccak_hash::keccak; use serde::{Deserialize, Serialize}; use std::collections::HashMap; diff --git a/crates/vm/levm/src/call_frame.rs b/crates/vm/levm/src/call_frame.rs index 33c36ce021..a943a9f0a0 100644 --- a/crates/vm/levm/src/call_frame.rs +++ b/crates/vm/levm/src/call_frame.rs @@ -6,7 +6,7 @@ use crate::{ utils::get_valid_jump_destinations, }; use bytes::Bytes; -use ethrex_core::{types::Log, Address, U256}; +use ethrex_common::{types::Log, Address, U256}; use std::collections::HashSet; #[derive(Debug, Clone, Default, PartialEq, Eq)] diff --git a/crates/vm/levm/src/constants.rs b/crates/vm/levm/src/constants.rs index 62b72fba18..8645640ffb 100644 --- a/crates/vm/levm/src/constants.rs +++ b/crates/vm/levm/src/constants.rs @@ -1,4 +1,4 @@ -use ethrex_core::{H256, U256}; +use ethrex_common::{H256, U256}; use k256::{ elliptic_curve::{bigint::Encoding, Curve}, Secp256k1, @@ -35,7 +35,7 @@ pub const MAX_CREATE_CODE_SIZE: usize = 2 * MAX_CODE_SIZE; pub const INVALID_CONTRACT_PREFIX: u8 = 0xef; pub mod create_opcode { - use ethrex_core::U256; + use ethrex_common::U256; pub const INIT_CODE_WORD_COST: U256 = U256([2, 0, 0, 0]); pub const CODE_DEPOSIT_COST: U256 = U256([200, 0, 0, 0]); diff --git a/crates/vm/levm/src/db/cache.rs b/crates/vm/levm/src/db/cache.rs index dc58470030..44b3c3a9d5 100644 --- a/crates/vm/levm/src/db/cache.rs +++ b/crates/vm/levm/src/db/cache.rs @@ -1,5 +1,5 @@ use crate::Account; -use ethrex_core::Address; +use ethrex_common::Address; use std::collections::HashMap; pub type CacheDB = HashMap; diff --git a/crates/vm/levm/src/db/mod.rs b/crates/vm/levm/src/db/mod.rs index 79148d391d..2d311b031b 100644 --- a/crates/vm/levm/src/db/mod.rs +++ b/crates/vm/levm/src/db/mod.rs @@ -1,5 +1,5 @@ use crate::account::{Account, AccountInfo, StorageSlot}; -use ethrex_core::{Address, H256, U256}; +use ethrex_common::{Address, H256, U256}; use std::collections::HashMap; pub mod cache; diff --git a/crates/vm/levm/src/environment.rs b/crates/vm/levm/src/environment.rs index bf17c0e470..32d4bd819c 100644 --- a/crates/vm/levm/src/environment.rs +++ b/crates/vm/levm/src/environment.rs @@ -1,4 +1,4 @@ -use ethrex_core::{Address, H256, U256}; +use ethrex_common::{Address, H256, U256}; pub use revm_primitives::SpecId; use crate::vm::EVMConfig; diff --git a/crates/vm/levm/src/errors.rs b/crates/vm/levm/src/errors.rs index 75c20b7317..132b27b70e 100644 --- a/crates/vm/levm/src/errors.rs +++ b/crates/vm/levm/src/errors.rs @@ -1,6 +1,6 @@ use crate::account::Account; use bytes::Bytes; -use ethrex_core::{types::Log, Address}; +use ethrex_common::{types::Log, Address}; use serde::{Deserialize, Serialize}; use std::collections::HashMap; use thiserror; diff --git a/crates/vm/levm/src/gas_cost.rs b/crates/vm/levm/src/gas_cost.rs index 2cec242860..a4f626152b 100644 --- a/crates/vm/levm/src/gas_cost.rs +++ b/crates/vm/levm/src/gas_cost.rs @@ -6,7 +6,7 @@ use crate::{ }; use bytes::Bytes; /// Contains the gas costs of the EVM instructions -use ethrex_core::{types::Fork, U256}; +use ethrex_common::{types::Fork, U256}; use num_bigint::BigUint; // Opcodes cost diff --git a/crates/vm/levm/src/hooks/default_hook.rs b/crates/vm/levm/src/hooks/default_hook.rs index 973f1a7fc9..1bddb4d8ef 100644 --- a/crates/vm/levm/src/hooks/default_hook.rs +++ b/crates/vm/levm/src/hooks/default_hook.rs @@ -10,7 +10,7 @@ use crate::{ vm::VM, }; -use ethrex_core::{types::Fork, U256}; +use ethrex_common::{types::Fork, U256}; use std::cmp::max; diff --git a/crates/vm/levm/src/memory.rs b/crates/vm/levm/src/memory.rs index a6f7df22e6..7ad43dde73 100644 --- a/crates/vm/levm/src/memory.rs +++ b/crates/vm/levm/src/memory.rs @@ -2,7 +2,7 @@ use crate::{ constants::{MEMORY_EXPANSION_QUOTIENT, WORD_SIZE_IN_BYTES_USIZE}, errors::{InternalError, OutOfGasError, VMError}, }; -use ethrex_core::U256; +use ethrex_common::U256; pub type Memory = Vec; diff --git a/crates/vm/levm/src/opcode_handlers/arithmetic.rs b/crates/vm/levm/src/opcode_handlers/arithmetic.rs index 1598b98653..d437c2081c 100644 --- a/crates/vm/levm/src/opcode_handlers/arithmetic.rs +++ b/crates/vm/levm/src/opcode_handlers/arithmetic.rs @@ -5,7 +5,7 @@ use crate::{ opcode_handlers::bitwise_comparison::checked_shift_left, vm::VM, }; -use ethrex_core::{U256, U512}; +use ethrex_common::{U256, U512}; use super::bitwise_comparison::checked_shift_right; diff --git a/crates/vm/levm/src/opcode_handlers/bitwise_comparison.rs b/crates/vm/levm/src/opcode_handlers/bitwise_comparison.rs index 1cf9b38ca6..3233d31be0 100644 --- a/crates/vm/levm/src/opcode_handlers/bitwise_comparison.rs +++ b/crates/vm/levm/src/opcode_handlers/bitwise_comparison.rs @@ -5,7 +5,7 @@ use crate::{ gas_cost, vm::VM, }; -use ethrex_core::U256; +use ethrex_common::U256; use std::collections::HashMap; use std::sync::LazyLock; diff --git a/crates/vm/levm/src/opcode_handlers/block.rs b/crates/vm/levm/src/opcode_handlers/block.rs index aa0851b03d..03c8cb6c7b 100644 --- a/crates/vm/levm/src/opcode_handlers/block.rs +++ b/crates/vm/levm/src/opcode_handlers/block.rs @@ -6,7 +6,7 @@ use crate::{ utils::*, vm::VM, }; -use ethrex_core::{ +use ethrex_common::{ types::{Fork, BLOB_BASE_FEE_UPDATE_FRACTION, MIN_BASE_FEE_PER_BLOB_GAS}, U256, }; diff --git a/crates/vm/levm/src/opcode_handlers/environment.rs b/crates/vm/levm/src/opcode_handlers/environment.rs index f098925d13..e1528c4ba9 100644 --- a/crates/vm/levm/src/opcode_handlers/environment.rs +++ b/crates/vm/levm/src/opcode_handlers/environment.rs @@ -7,7 +7,7 @@ use crate::{ utils::{access_account, has_delegation, word_to_address}, vm::VM, }; -use ethrex_core::U256; +use ethrex_common::U256; use keccak_hash::keccak; // Environmental Information (16) diff --git a/crates/vm/levm/src/opcode_handlers/keccak.rs b/crates/vm/levm/src/opcode_handlers/keccak.rs index 1b43b63452..7ad4209560 100644 --- a/crates/vm/levm/src/opcode_handlers/keccak.rs +++ b/crates/vm/levm/src/opcode_handlers/keccak.rs @@ -5,7 +5,7 @@ use crate::{ memory::{self, calculate_memory_size}, vm::VM, }; -use ethrex_core::U256; +use ethrex_common::U256; use sha3::{Digest, Keccak256}; // KECCAK256 (1) diff --git a/crates/vm/levm/src/opcode_handlers/logging.rs b/crates/vm/levm/src/opcode_handlers/logging.rs index 24f1bbc4ea..2ba494843e 100644 --- a/crates/vm/levm/src/opcode_handlers/logging.rs +++ b/crates/vm/levm/src/opcode_handlers/logging.rs @@ -6,7 +6,7 @@ use crate::{ vm::VM, }; use bytes::Bytes; -use ethrex_core::{types::Log, H256}; +use ethrex_common::{types::Log, H256}; // Logging Operations (5) // Opcodes: LOG0 ... LOG4 diff --git a/crates/vm/levm/src/opcode_handlers/push.rs b/crates/vm/levm/src/opcode_handlers/push.rs index 0afd3aea62..2cfb70b868 100644 --- a/crates/vm/levm/src/opcode_handlers/push.rs +++ b/crates/vm/levm/src/opcode_handlers/push.rs @@ -5,7 +5,7 @@ use crate::{ gas_cost, vm::VM, }; -use ethrex_core::{types::Fork, U256}; +use ethrex_common::{types::Fork, U256}; // Push Operations // Opcodes: PUSH0, PUSH1 ... PUSH32 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 f59664c2e5..5f160ee073 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 @@ -6,7 +6,7 @@ use crate::{ memory::{self, calculate_memory_size}, vm::VM, }; -use ethrex_core::{types::Fork, H256, U256}; +use ethrex_common::{types::Fork, H256, U256}; // Stack, Memory, Storage and Flow Operations (15) // Opcodes: POP, MLOAD, MSTORE, MSTORE8, SLOAD, SSTORE, JUMP, JUMPI, PC, MSIZE, GAS, JUMPDEST, TLOAD, TSTORE, MCOPY diff --git a/crates/vm/levm/src/opcode_handlers/system.rs b/crates/vm/levm/src/opcode_handlers/system.rs index 23af44bc46..7995dc742d 100644 --- a/crates/vm/levm/src/opcode_handlers/system.rs +++ b/crates/vm/levm/src/opcode_handlers/system.rs @@ -11,7 +11,7 @@ use crate::{ Account, }; use bytes::Bytes; -use ethrex_core::{types::Fork, Address, U256}; +use ethrex_common::{types::Fork, Address, U256}; // System Operations (10) // Opcodes: CREATE, CALL, CALLCODE, RETURN, DELEGATECALL, CREATE2, STATICCALL, REVERT, INVALID, SELFDESTRUCT diff --git a/crates/vm/levm/src/operations.rs b/crates/vm/levm/src/operations.rs index 6897ae2e18..93854bff41 100644 --- a/crates/vm/levm/src/operations.rs +++ b/crates/vm/levm/src/operations.rs @@ -3,7 +3,7 @@ use crate::{ opcodes::Opcode, }; use bytes::Bytes; -use ethrex_core::U256; +use ethrex_common::U256; #[derive(Debug, PartialEq, Eq, Clone)] pub enum Operation { diff --git a/crates/vm/levm/src/precompiles.rs b/crates/vm/levm/src/precompiles.rs index eadca8619f..71dd1c5005 100644 --- a/crates/vm/levm/src/precompiles.rs +++ b/crates/vm/levm/src/precompiles.rs @@ -4,7 +4,7 @@ use bls12_381::{ }; use bytes::Bytes; -use ethrex_core::{serde_utils::bool, types::Fork, Address, H160, H256, U256}; +use ethrex_common::{serde_utils::bool, types::Fork, Address, H160, H256, U256}; use keccak_hash::keccak256; use kzg_rs::{Bytes32, Bytes48, KzgSettings}; use lambdaworks_math::{ diff --git a/crates/vm/levm/src/testing.rs b/crates/vm/levm/src/testing.rs index ffebb9e396..18c9c29347 100644 --- a/crates/vm/levm/src/testing.rs +++ b/crates/vm/levm/src/testing.rs @@ -7,7 +7,7 @@ use crate::{ vm::VM, }; use bytes::Bytes; -use ethrex_core::{types::TxKind, Address, U256}; +use ethrex_common::{types::TxKind, Address, U256}; use std::{collections::HashMap, sync::Arc}; pub fn ops_to_bytecode(operations: &[Operation]) -> Result { diff --git a/crates/vm/levm/src/utils.rs b/crates/vm/levm/src/utils.rs index 1f9c3a661b..47134dfb9b 100644 --- a/crates/vm/levm/src/utils.rs +++ b/crates/vm/levm/src/utils.rs @@ -16,7 +16,7 @@ use crate::{ AccountInfo, }; use bytes::Bytes; -use ethrex_core::{ +use ethrex_common::{ types::{tx_fields::*, Fork}, Address, H256, U256, }; diff --git a/crates/vm/levm/src/vm.rs b/crates/vm/levm/src/vm.rs index 2ece2061b3..5e1e37bc4f 100644 --- a/crates/vm/levm/src/vm.rs +++ b/crates/vm/levm/src/vm.rs @@ -18,7 +18,7 @@ use crate::{ TransientStorage, }; use bytes::Bytes; -use ethrex_core::{ +use ethrex_common::{ types::{ tx_fields::{AccessList, AuthorizationList}, Fork, ForkBlobSchedule, TxKind, diff --git a/crates/vm/levm/tests/edge_case_tests.rs b/crates/vm/levm/tests/edge_case_tests.rs index ca6dd41227..2304b02cb7 100644 --- a/crates/vm/levm/tests/edge_case_tests.rs +++ b/crates/vm/levm/tests/edge_case_tests.rs @@ -3,7 +3,7 @@ use std::str::FromStr; use bytes::Bytes; -use ethrex_core::U256; +use ethrex_common::U256; use ethrex_levm::{ errors::{TxResult, VMError}, operations::Operation, diff --git a/crates/vm/levm/tests/tests.rs b/crates/vm/levm/tests/tests.rs index b2df707a57..8ce2280788 100644 --- a/crates/vm/levm/tests/tests.rs +++ b/crates/vm/levm/tests/tests.rs @@ -2,7 +2,7 @@ #![allow(clippy::unwrap_used)] use bytes::Bytes; -use ethrex_core::{ +use ethrex_common::{ types::{Fork, TxKind}, Address, H256, U256, }; diff --git a/crates/vm/vm.rs b/crates/vm/vm.rs index dafc616a08..4ca2a641e8 100644 --- a/crates/vm/vm.rs +++ b/crates/vm/vm.rs @@ -10,7 +10,7 @@ use backends::EVM; use db::EvmState; use crate::backends::revm::*; -use ethrex_core::{ +use ethrex_common::{ types::{ tx_fields::AccessList, AccountInfo, BlockHeader, ChainConfig, Fork, GenericTransaction, INITIAL_BASE_FEE,