From 769f8f2ae693e78804124edfb651f0bb33257825 Mon Sep 17 00:00:00 2001 From: Thomas Coratger Date: Wed, 25 Sep 2024 19:16:33 +0200 Subject: [PATCH 1/8] primitives: rm more alloy_primitives reexports --- Cargo.lock | 128 +++++++++++------- bin/reth/Cargo.toml | 1 + .../src/commands/debug_cmd/build_block.rs | 3 +- bin/reth/src/commands/debug_cmd/execution.rs | 3 +- crates/config/Cargo.toml | 1 + crates/config/src/config.rs | 2 +- crates/evm/Cargo.toml | 1 + crates/evm/execution-types/Cargo.toml | 3 +- crates/evm/execution-types/src/chain.rs | 5 +- .../execution-types/src/execution_outcome.rs | 8 +- crates/evm/src/either.rs | 3 +- crates/evm/src/execute.rs | 3 +- crates/evm/src/lib.rs | 3 +- crates/evm/src/noop.rs | 3 +- crates/evm/src/test_utils.rs | 3 +- crates/node/builder/src/setup.rs | 3 +- .../cli/src/commands/init_state/bedrock.rs | 5 +- crates/optimism/cli/src/receipt_file_codec.rs | 4 +- crates/primitives/src/block.rs | 6 +- crates/primitives/src/lib.rs | 7 +- crates/primitives/src/proofs.rs | 5 +- crates/primitives/src/receipt.rs | 6 +- .../primitives/src/transaction/access_list.rs | 3 +- crates/primitives/src/transaction/compat.rs | 4 +- crates/primitives/src/transaction/mod.rs | 8 +- crates/primitives/src/transaction/pooled.rs | 5 +- crates/primitives/src/transaction/sidecar.rs | 3 +- .../primitives/src/transaction/signature.rs | 9 +- crates/primitives/src/transaction/tx_type.rs | 3 +- crates/primitives/src/transaction/util.rs | 9 +- crates/primitives/src/transaction/variant.rs | 4 +- crates/revm/Cargo.toml | 4 +- crates/revm/src/batch.rs | 3 +- crates/revm/src/database.rs | 3 +- crates/revm/src/state_change.rs | 3 +- crates/revm/src/test_utils.rs | 5 +- crates/rpc/rpc/src/eth/helpers/types.rs | 4 +- crates/stages/stages/Cargo.toml | 2 + crates/stages/stages/benches/criterion.rs | 2 +- .../stages/benches/setup/account_hashing.rs | 2 +- crates/stages/stages/benches/setup/mod.rs | 5 +- crates/stages/stages/src/stages/bodies.rs | 4 +- crates/stages/stages/src/stages/execution.rs | 9 +- .../stages/src/stages/hashing_account.rs | 7 +- .../stages/src/stages/hashing_storage.rs | 6 +- crates/stages/stages/src/stages/headers.rs | 3 +- .../src/stages/index_account_history.rs | 5 +- .../src/stages/index_storage_history.rs | 3 +- crates/stages/stages/src/stages/merkle.rs | 6 +- crates/stages/stages/src/stages/mod.rs | 4 +- .../stages/src/stages/sender_recovery.rs | 6 +- crates/stages/stages/src/stages/tx_lookup.rs | 3 +- crates/stages/stages/src/stages/utils.rs | 2 +- .../stages/stages/src/test_utils/test_db.rs | 5 +- .../provider/src/providers/static_file/mod.rs | 4 +- .../storage/provider/src/test_utils/blocks.rs | 8 +- crates/storage/provider/src/writer/mod.rs | 4 +- crates/trie/db/src/state.rs | 3 +- examples/custom-engine-types/Cargo.toml | 1 + examples/custom-engine-types/src/main.rs | 3 +- examples/custom-evm/Cargo.toml | 1 + examples/custom-evm/src/main.rs | 3 +- examples/custom-inspector/Cargo.toml | 1 + examples/custom-inspector/src/main.rs | 3 +- examples/db-access/Cargo.toml | 1 + examples/db-access/src/main.rs | 3 +- examples/stateful-precompile/Cargo.toml | 1 + examples/stateful-precompile/src/main.rs | 3 +- examples/txpool-tracing/Cargo.toml | 1 + examples/txpool-tracing/src/main.rs | 3 +- testing/ef-tests/src/models.rs | 5 +- 71 files changed, 233 insertions(+), 165 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a624c269a8ad..9fd2246f5122 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -126,9 +126,9 @@ dependencies = [ [[package]] name = "alloy-dyn-abi" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4004925bff5ba0a11739ae84dbb6601a981ea692f3bd45b626935ee90a6b8471" +checksum = "c538495c47bc558bd3bb7becf9bde6172dacd5e1fc77531cdd584eb1c248f973" dependencies = [ "alloy-json-abi", "alloy-primitives", @@ -201,9 +201,9 @@ dependencies = [ [[package]] name = "alloy-json-abi" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9996daf962fd0a90d3c93b388033228865953b92de7bb1959b891d78750a4091" +checksum = "03ebb591e349f3aab48a38da25ee1e2d1a3f4026d466b2e3160c618166b07aa4" dependencies = [ "alloy-primitives", "alloy-sol-type-parser", @@ -277,9 +277,9 @@ dependencies = [ [[package]] name = "alloy-primitives" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "411aff151f2a73124ee473708e82ed51b2535f68928b6a1caa8bc1246ae6f7cd" +checksum = "0f778fe4183cecaec41361e65869e81e748c44a77fa3e6ba20219ca92be33a19" dependencies = [ "alloy-rlp", "arbitrary", @@ -289,15 +289,20 @@ dependencies = [ "derive_arbitrary", "derive_more", "getrandom 0.2.15", + "hashbrown 0.14.5", "hex-literal", + "indexmap 2.5.0", "itoa", "k256", "keccak-asm", + "paste", "proptest", "proptest-derive", "rand 0.8.5", "ruint", + "rustc-hash 2.0.0", "serde", + "sha3", "tiny-keccak", ] @@ -588,9 +593,9 @@ dependencies = [ [[package]] name = "alloy-sol-macro" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0458ccb02a564228fcd76efb8eb5a520521a8347becde37b402afec9a1b83859" +checksum = "1cd94eff5a90844c341b39f78227eef5d6890e2ce65c934d97b3f9d724234cc8" dependencies = [ "alloy-sol-macro-expander", "alloy-sol-macro-input", @@ -602,9 +607,9 @@ dependencies = [ [[package]] name = "alloy-sol-macro-expander" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bc65475025fc1e84bf86fc840f04f63fcccdcf3cf12053c99918e4054dfbc69" +checksum = "d900423cebf57657f5b18945031edd82b8d3c481c055e00574653ac70acb1305" dependencies = [ "alloy-sol-macro-input", "const-hex", @@ -620,9 +625,9 @@ dependencies = [ [[package]] name = "alloy-sol-macro-input" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ed10f0715a0b69fde3236ff3b9ae5f6f7c97db5a387747100070d3016b9266b" +checksum = "58171163ee466fa907c974e0fb945ecde589217006c401d9414ac00316b63e0a" dependencies = [ "const-hex", "dunce", @@ -635,9 +640,9 @@ dependencies = [ [[package]] name = "alloy-sol-type-parser" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3edae8ea1de519ccba896b6834dec874230f72fe695ff3c9c118e90ec7cff783" +checksum = "d51ebc7c9a94d3a5d2aa29108323d70c890ae97cda38a3598e8b5ebd34fe7d01" dependencies = [ "serde", "winnow", @@ -645,9 +650,9 @@ dependencies = [ [[package]] name = "alloy-sol-types" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1eb88e4da0a1b697ed6a9f811fdba223cf4d5c21410804fd1707836af73a462b" +checksum = "092cce3d2618d5e16e04306796c839c2b20585b591dcc9d64d0897a10c5bd086" dependencies = [ "alloy-json-abi", "alloy-primitives", @@ -1059,9 +1064,9 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.82" +version = "0.1.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a27b8a3a6e1a44fa4c8baf1f653e4172e81486d4941f2237e20dc2d0cf4ddff1" +checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", @@ -2712,6 +2717,7 @@ name = "example-custom-engine-types" version = "0.0.0" dependencies = [ "alloy-genesis", + "alloy-primitives", "alloy-rpc-types", "eyre", "reth", @@ -2734,6 +2740,7 @@ name = "example-custom-evm" version = "0.0.0" dependencies = [ "alloy-genesis", + "alloy-primitives", "eyre", "reth", "reth-chainspec", @@ -2750,6 +2757,7 @@ dependencies = [ name = "example-custom-inspector" version = "0.0.0" dependencies = [ + "alloy-primitives", "alloy-rpc-types", "clap", "futures-util", @@ -2810,6 +2818,7 @@ dependencies = [ name = "example-db-access" version = "0.0.0" dependencies = [ + "alloy-primitives", "alloy-rpc-types", "eyre", "reth-chainspec", @@ -2916,6 +2925,7 @@ name = "example-stateful-precompile" version = "0.0.0" dependencies = [ "alloy-genesis", + "alloy-primitives", "eyre", "parking_lot 0.12.3", "reth", @@ -2933,6 +2943,7 @@ dependencies = [ name = "example-txpool-tracing" version = "0.0.0" dependencies = [ + "alloy-primitives", "alloy-rpc-types-trace", "clap", "futures-util", @@ -3634,9 +3645,9 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da62f120a8a37763efb0cf8fdf264b884c7b8b9ac8660b900c8661030c00e6ba" +checksum = "41296eb09f183ac68eec06e03cdbea2e759633d4067b2f6552fc2e009bcad08b" dependencies = [ "bytes", "futures-channel", @@ -3647,7 +3658,6 @@ dependencies = [ "pin-project-lite", "socket2 0.5.7", "tokio", - "tower 0.4.13", "tower-service", "tracing", ] @@ -3923,6 +3933,7 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" dependencies = [ + "arbitrary", "equivalent", "hashbrown 0.14.5", "serde", @@ -4402,9 +4413,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.158" +version = "0.2.159" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" +checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" [[package]] name = "libloading" @@ -4460,7 +4471,7 @@ checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ "bitflags 2.6.0", "libc", - "redox_syscall 0.5.4", + "redox_syscall 0.5.6", ] [[package]] @@ -4828,9 +4839,9 @@ checksum = "1fafa6961cabd9c63bcd77a45d7e3b7f3b552b70417831fb0f56db717e72407e" [[package]] name = "multiaddr" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b852bc02a2da5feed68cd14fa50d0774b92790a5bdbfa932a813926c8472070" +checksum = "fe6351f60b488e04c1d21bc69e56b89cb3f5e8f5d22557d6e8031bdfd79b6961" dependencies = [ "arrayref", "byteorder", @@ -4841,7 +4852,7 @@ dependencies = [ "percent-encoding", "serde", "static_assertions", - "unsigned-varint", + "unsigned-varint 0.8.0", "url", ] @@ -4863,7 +4874,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "076d548d76a0e2a0d4ab471d0b1c36c577786dfc4471242035d97a12a735c492" dependencies = [ "core2", - "unsigned-varint", + "unsigned-varint 0.7.2", ] [[package]] @@ -5229,9 +5240,9 @@ checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" [[package]] name = "ordered-float" -version = "4.2.2" +version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a91171844676f8c7990ce64959210cd2eaef32c2612c50f9fae9f8aaa6065a6" +checksum = "44d501f1a72f71d3c063a6bbc8f7271fa73aa09fe5d6283b6571e2ed176a2537" dependencies = [ "num-traits", ] @@ -5340,7 +5351,7 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.4", + "redox_syscall 0.5.6", "smallvec", "windows-targets 0.52.6", ] @@ -5484,9 +5495,9 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "plain_hasher" @@ -5917,6 +5928,7 @@ dependencies = [ "libc", "rand_chacha 0.3.1", "rand_core 0.6.4", + "serde", ] [[package]] @@ -6042,9 +6054,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.4" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0884ad60e090bf1345b93da0a5de8923c93884cd03f40dfcfddd3b4bee661853" +checksum = "355ae415ccd3a04315d3f8246e86d67689ea74d88d915576e1589a351062a13b" dependencies = [ "bitflags 2.6.0", ] @@ -6174,6 +6186,7 @@ name = "reth" version = "1.0.7" dependencies = [ "alloy-consensus", + "alloy-primitives", "alloy-rlp", "alloy-rpc-types", "aquamarine", @@ -6609,6 +6622,7 @@ dependencies = [ name = "reth-config" version = "1.0.7" dependencies = [ + "alloy-primitives", "eyre", "humantime-serde", "reth-network-peers", @@ -7283,6 +7297,7 @@ name = "reth-evm" version = "1.0.7" dependencies = [ "alloy-eips", + "alloy-primitives", "auto_impl", "futures-util", "metrics", @@ -8401,6 +8416,7 @@ dependencies = [ name = "reth-revm" version = "1.0.7" dependencies = [ + "alloy-primitives", "reth-chainspec", "reth-consensus-common", "reth-ethereum-forks", @@ -8755,6 +8771,7 @@ dependencies = [ name = "reth-stages" version = "1.0.7" dependencies = [ + "alloy-primitives", "alloy-rlp", "assert_matches", "criterion", @@ -9140,9 +9157,9 @@ dependencies = [ [[package]] name = "revm-inspectors" -version = "0.7.6" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b57b33a24b5b8b8efa1da3f60d44f02d6e649f06ef925d7780723ff14ff55321" +checksum = "cd8e3bae0d5c824da0ac883e2521c5e83870d6521eeeccd4ee54266aa3cc1a51" dependencies = [ "alloy-primitives", "alloy-rpc-types-eth", @@ -9348,6 +9365,9 @@ name = "rustc-hash" version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" +dependencies = [ + "rand 0.8.5", +] [[package]] name = "rustc-hex" @@ -10166,9 +10186,9 @@ dependencies = [ [[package]] name = "syn-solidity" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b95156f8b577cb59dc0b1df15c6f29a10afc5f8a7ac9786b0b5c68c19149278" +checksum = "27243031e95471f24108f05d00df2803932aaa7b9e461e69b95537d02613e3bf" dependencies = [ "paste", "proc-macro2", @@ -10309,18 +10329,18 @@ checksum = "a38c90d48152c236a3ab59271da4f4ae63d678c5d7ad6b7714d7cb9760be5e4b" [[package]] name = "thiserror" -version = "1.0.63" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" +checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.63" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" +checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" dependencies = [ "proc-macro2", "quote", @@ -10581,9 +10601,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.21" +version = "0.22.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b072cee73c449a636ffd6f32bd8de3a9f7119139aff882f44943ce2986dc5cf" +checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" dependencies = [ "indexmap 2.5.0", "serde", @@ -10792,9 +10812,9 @@ dependencies = [ [[package]] name = "tracy-client" -version = "0.17.3" +version = "0.17.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "373db47331c3407b343538df77eea2516884a0b126cdfb4b135acfd400015dd7" +checksum = "746b078c6a09ebfd5594609049e07116735c304671eaab06ce749854d23435bc" dependencies = [ "loom", "once_cell", @@ -10804,9 +10824,9 @@ dependencies = [ [[package]] name = "tracy-client-sys" -version = "0.24.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49cf0064dcb31c99aa1244c1b93439359e53f72ed217eef5db50abd442241e9a" +checksum = "68613466112302fdbeabc5fa55f7d57462a0b247d5a6b7d7e09401fb471a144d" dependencies = [ "cc", ] @@ -11012,6 +11032,12 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6889a77d49f1f013504cec6bf97a2c730394adedaeb1deb5ea08949a50541105" +[[package]] +name = "unsigned-varint" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb066959b24b5196ae73cb057f45598450d2c5f71460e98c49b738086eff9c06" + [[package]] name = "untrusted" version = "0.9.0" @@ -11568,9 +11594,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.6.18" +version = "0.6.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" +checksum = "c52ac009d615e79296318c1bcce2d422aaca15ad08515e344feeda07df67a587" dependencies = [ "memchr", ] diff --git a/bin/reth/Cargo.toml b/bin/reth/Cargo.toml index 19d7d18f1c08..e456871facb6 100644 --- a/bin/reth/Cargo.toml +++ b/bin/reth/Cargo.toml @@ -69,6 +69,7 @@ reth-prune.workspace = true alloy-rlp.workspace = true alloy-rpc-types = { workspace = true, features = ["engine"] } alloy-consensus.workspace = true +alloy-primitives.workspace = true # tracing tracing.workspace = true diff --git a/bin/reth/src/commands/debug_cmd/build_block.rs b/bin/reth/src/commands/debug_cmd/build_block.rs index a8589a74ec8d..57a8ee8a6b8d 100644 --- a/bin/reth/src/commands/debug_cmd/build_block.rs +++ b/bin/reth/src/commands/debug_cmd/build_block.rs @@ -1,5 +1,6 @@ //! Command for debugging block building. use alloy_consensus::TxEip4844; +use alloy_primitives::Address; use alloy_rlp::Decodable; use alloy_rpc_types::engine::{BlobsBundleV1, PayloadAttributes}; use clap::Parser; @@ -24,7 +25,7 @@ use reth_node_api::{NodeTypesWithDB, NodeTypesWithEngine, PayloadBuilderAttribut use reth_node_ethereum::{EthEvmConfig, EthExecutorProvider}; use reth_payload_builder::database::CachedReads; use reth_primitives::{ - revm_primitives::KzgSettings, Address, BlobTransaction, BlobTransactionSidecar, Bytes, + revm_primitives::KzgSettings, BlobTransaction, BlobTransactionSidecar, Bytes, PooledTransactionsElement, SealedBlock, SealedBlockWithSenders, Transaction, TransactionSigned, B256, U256, }; diff --git a/bin/reth/src/commands/debug_cmd/execution.rs b/bin/reth/src/commands/debug_cmd/execution.rs index 64ca4dc2dc84..46cc6064d25e 100644 --- a/bin/reth/src/commands/debug_cmd/execution.rs +++ b/bin/reth/src/commands/debug_cmd/execution.rs @@ -1,6 +1,7 @@ //! Command for debugging execution. use crate::{args::NetworkArgs, utils::get_single_header}; +use alloy_primitives::BlockNumber; use clap::Parser; use futures::{stream::select as stream_select, StreamExt}; use reth_beacon_consensus::EthBeaconConsensus; @@ -22,7 +23,7 @@ use reth_network_api::NetworkInfo; use reth_network_p2p::{headers::client::HeadersClient, BlockClient}; use reth_node_api::{NodeTypesWithDB, NodeTypesWithDBAdapter, NodeTypesWithEngine}; use reth_node_ethereum::EthExecutorProvider; -use reth_primitives::{BlockHashOrNumber, BlockNumber, B256}; +use reth_primitives::{BlockHashOrNumber, B256}; use reth_provider::{ BlockExecutionWriter, ChainSpecProvider, ProviderFactory, StageCheckpointReader, }; diff --git a/crates/config/Cargo.toml b/crates/config/Cargo.toml index d8224a3d62ed..55c0c676ad88 100644 --- a/crates/config/Cargo.toml +++ b/crates/config/Cargo.toml @@ -28,3 +28,4 @@ eyre.workspace = true tempfile.workspace = true reth-network-peers.workspace = true reth-primitives.workspace = true +alloy-primitives.workspace = true diff --git a/crates/config/src/config.rs b/crates/config/src/config.rs index 24c992fddd82..39855a3a0c94 100644 --- a/crates/config/src/config.rs +++ b/crates/config/src/config.rs @@ -445,7 +445,7 @@ mod tests { use super::{Config, EXTENSION}; use crate::PruneConfig; use reth_network_peers::TrustedPeer; - use reth_primitives::Address; + use alloy_primitives::Address; use reth_prune_types::{PruneMode, PruneModes, ReceiptsLogPruneConfig}; use std::{collections::BTreeMap, path::Path, str::FromStr, time::Duration}; diff --git a/crates/evm/Cargo.toml b/crates/evm/Cargo.toml index f520c75eeaa9..028c0cbb3677 100644 --- a/crates/evm/Cargo.toml +++ b/crates/evm/Cargo.toml @@ -28,6 +28,7 @@ auto_impl.workspace = true futures-util.workspace = true metrics = { workspace = true, optional = true } parking_lot = { workspace = true, optional = true } +alloy-primitives.workspace = true [dev-dependencies] parking_lot.workspace = true diff --git a/crates/evm/execution-types/Cargo.toml b/crates/evm/execution-types/Cargo.toml index cf50b47a03b2..1f0fc01f068d 100644 --- a/crates/evm/execution-types/Cargo.toml +++ b/crates/evm/execution-types/Cargo.toml @@ -16,13 +16,14 @@ reth-chainspec = { workspace = true, optional = true } reth-execution-errors.workspace = true reth-trie.workspace = true +alloy-primitives.workspace = true + revm.workspace = true serde = { workspace = true, optional = true } [dev-dependencies] reth-primitives = { workspace = true, features = ["test-utils"] } -alloy-primitives.workspace = true alloy-eips.workspace = true [features] diff --git a/crates/evm/execution-types/src/chain.rs b/crates/evm/execution-types/src/chain.rs index 4d0dc694a05f..54b44815ad76 100644 --- a/crates/evm/execution-types/src/chain.rs +++ b/crates/evm/execution-types/src/chain.rs @@ -2,11 +2,12 @@ use crate::ExecutionOutcome; use alloc::{borrow::Cow, collections::BTreeMap}; +use alloy_primitives::{Address, BlockHash, BlockNumber}; use core::{fmt, ops::RangeInclusive}; use reth_execution_errors::{BlockExecutionError, InternalBlockExecutionError}; use reth_primitives::{ - Address, BlockHash, BlockNumHash, BlockNumber, ForkBlock, Receipt, SealedBlock, - SealedBlockWithSenders, SealedHeader, TransactionSigned, TransactionSignedEcRecovered, TxHash, + BlockNumHash, ForkBlock, Receipt, SealedBlock, SealedBlockWithSenders, SealedHeader, + TransactionSigned, TransactionSignedEcRecovered, TxHash, }; use reth_trie::updates::TrieUpdates; use revm::db::BundleState; diff --git a/crates/evm/execution-types/src/execution_outcome.rs b/crates/evm/execution-types/src/execution_outcome.rs index 8996ac9959e3..f1ec1120b44c 100644 --- a/crates/evm/execution-types/src/execution_outcome.rs +++ b/crates/evm/execution-types/src/execution_outcome.rs @@ -1,7 +1,7 @@ use crate::BlockExecutionOutput; +use alloy_primitives::{Address, BlockNumber, Bloom}; use reth_primitives::{ - logs_bloom, Account, Address, BlockNumber, Bloom, Bytecode, Log, Receipt, Receipts, Requests, - StorageEntry, B256, U256, + logs_bloom, Account, Bytecode, Log, Receipt, Receipts, Requests, StorageEntry, B256, U256, }; use reth_trie::HashedPostState; use revm::{ @@ -371,8 +371,8 @@ impl From<(BlockExecutionOutput, BlockNumber)> for ExecutionOutcome { mod tests { use super::*; use alloy_eips::{eip6110::DepositRequest, eip7002::WithdrawalRequest}; - use alloy_primitives::{FixedBytes, LogData}; - use reth_primitives::{Address, Receipts, Request, Requests, TxType, B256}; + use alloy_primitives::{Address, FixedBytes, LogData}; + use reth_primitives::{Receipts, Request, Requests, TxType, B256}; use std::collections::HashMap; #[test] diff --git a/crates/evm/src/either.rs b/crates/evm/src/either.rs index fde316da9f5b..a3fca50ec7ee 100644 --- a/crates/evm/src/either.rs +++ b/crates/evm/src/either.rs @@ -3,9 +3,10 @@ use core::fmt::Display; use crate::execute::{BatchExecutor, BlockExecutorProvider, Executor}; +use alloy_primitives::BlockNumber; use reth_execution_errors::BlockExecutionError; use reth_execution_types::{BlockExecutionInput, BlockExecutionOutput, ExecutionOutcome}; -use reth_primitives::{BlockNumber, BlockWithSenders, Receipt}; +use reth_primitives::{BlockWithSenders, Receipt}; use reth_prune_types::PruneModes; use reth_storage_errors::provider::ProviderError; use revm_primitives::db::Database; diff --git a/crates/evm/src/execute.rs b/crates/evm/src/execute.rs index 60a29d4de9fc..8f843fb70cbd 100644 --- a/crates/evm/src/execute.rs +++ b/crates/evm/src/execute.rs @@ -5,8 +5,9 @@ pub use reth_execution_errors::{BlockExecutionError, BlockValidationError}; pub use reth_execution_types::{BlockExecutionInput, BlockExecutionOutput, ExecutionOutcome}; pub use reth_storage_errors::provider::ProviderError; +use alloy_primitives::BlockNumber; use core::fmt::Display; -use reth_primitives::{BlockNumber, BlockWithSenders, Receipt}; +use reth_primitives::{BlockWithSenders, Receipt}; use reth_prune_types::PruneModes; use revm::State; use revm_primitives::db::Database; diff --git a/crates/evm/src/lib.rs b/crates/evm/src/lib.rs index 569491a1b02c..d318f101d3da 100644 --- a/crates/evm/src/lib.rs +++ b/crates/evm/src/lib.rs @@ -14,7 +14,8 @@ extern crate alloc; use core::ops::Deref; use crate::builder::RethEvmBuilder; -use reth_primitives::{Address, TransactionSigned, TransactionSignedEcRecovered, B256, U256}; +use alloy_primitives::Address; +use reth_primitives::{TransactionSigned, TransactionSignedEcRecovered, B256, U256}; use reth_primitives_traits::BlockHeader; use revm::{Database, Evm, GetInspector}; use revm_primitives::{ diff --git a/crates/evm/src/noop.rs b/crates/evm/src/noop.rs index ae6171a506a9..ef9e6798cfb6 100644 --- a/crates/evm/src/noop.rs +++ b/crates/evm/src/noop.rs @@ -3,11 +3,12 @@ use core::fmt::Display; use reth_execution_errors::BlockExecutionError; use reth_execution_types::{BlockExecutionInput, BlockExecutionOutput, ExecutionOutcome}; -use reth_primitives::{BlockNumber, BlockWithSenders, Receipt}; +use reth_primitives::{ BlockWithSenders, Receipt}; use reth_prune_types::PruneModes; use reth_storage_errors::provider::ProviderError; use revm::State; use revm_primitives::db::Database; +use alloy_primitives::BlockNumber; use crate::execute::{BatchExecutor, BlockExecutorProvider, Executor}; diff --git a/crates/evm/src/test_utils.rs b/crates/evm/src/test_utils.rs index f30262c281e0..cf45930aece9 100644 --- a/crates/evm/src/test_utils.rs +++ b/crates/evm/src/test_utils.rs @@ -3,10 +3,11 @@ use crate::execute::{ BatchExecutor, BlockExecutionInput, BlockExecutionOutput, BlockExecutorProvider, Executor, }; +use alloy_primitives::BlockNumber; use parking_lot::Mutex; use reth_execution_errors::BlockExecutionError; use reth_execution_types::ExecutionOutcome; -use reth_primitives::{BlockNumber, BlockWithSenders, Receipt}; +use reth_primitives::{BlockWithSenders, Receipt}; use reth_prune_types::PruneModes; use reth_storage_errors::provider::ProviderError; use revm::State; diff --git a/crates/node/builder/src/setup.rs b/crates/node/builder/src/setup.rs index 10144d8699de..44c9f19e84b3 100644 --- a/crates/node/builder/src/setup.rs +++ b/crates/node/builder/src/setup.rs @@ -2,6 +2,7 @@ use std::sync::Arc; +use alloy_primitives::BlockNumber; use reth_config::{config::StageConfig, PruneConfig}; use reth_consensus::Consensus; use reth_downloaders::{ @@ -13,7 +14,7 @@ use reth_exex::ExExManagerHandle; use reth_network_p2p::{ bodies::downloader::BodyDownloader, headers::downloader::HeaderDownloader, BlockClient, }; -use reth_node_core::primitives::{BlockNumber, B256}; +use reth_node_core::primitives::B256; use reth_provider::{providers::ProviderNodeTypes, ProviderFactory}; use reth_stages::{prelude::DefaultStages, stages::ExecutionStage, Pipeline, StageSet}; use reth_static_file::StaticFileProducer; diff --git a/crates/optimism/cli/src/commands/init_state/bedrock.rs b/crates/optimism/cli/src/commands/init_state/bedrock.rs index 41cd467b2f22..2426a195a8b6 100644 --- a/crates/optimism/cli/src/commands/init_state/bedrock.rs +++ b/crates/optimism/cli/src/commands/init_state/bedrock.rs @@ -1,8 +1,7 @@ -use alloy_primitives::B256; +use alloy_primitives::{BlockNumber, B256}; use reth_optimism_primitives::bedrock::{BEDROCK_HEADER, BEDROCK_HEADER_HASH, BEDROCK_HEADER_TTD}; use reth_primitives::{ - BlockBody, BlockNumber, Header, SealedBlock, SealedBlockWithSenders, SealedHeader, - StaticFileSegment, U256, + BlockBody, Header, SealedBlock, SealedBlockWithSenders, SealedHeader, StaticFileSegment, U256, }; use reth_provider::{ providers::StaticFileProvider, BlockWriter, StageCheckpointWriter, StaticFileWriter, diff --git a/crates/optimism/cli/src/receipt_file_codec.rs b/crates/optimism/cli/src/receipt_file_codec.rs index c86bfa12a6bd..c0416fa5f072 100644 --- a/crates/optimism/cli/src/receipt_file_codec.rs +++ b/crates/optimism/cli/src/receipt_file_codec.rs @@ -1,10 +1,10 @@ //! Codec for reading raw receipts from a file. -use alloy_primitives::B256; +use alloy_primitives::{Address, Bloom, B256}; use alloy_rlp::{Decodable, RlpDecodable}; use reth_primitives::{ bytes::{Buf, BytesMut}, - Address, Bloom, Bytes, Log, Receipt, TxType, + Bytes, Log, Receipt, TxType, }; use tokio_util::codec::Decoder; diff --git a/crates/primitives/src/block.rs b/crates/primitives/src/block.rs index 5914602127e5..af860bed181b 100644 --- a/crates/primitives/src/block.rs +++ b/crates/primitives/src/block.rs @@ -1,12 +1,12 @@ use crate::{ - Address, Bytes, GotExpected, Header, SealedHeader, TransactionSigned, - TransactionSignedEcRecovered, Withdrawals, B256, + Bytes, GotExpected, Header, SealedHeader, TransactionSigned, TransactionSignedEcRecovered, + Withdrawals, B256, }; use alloc::vec::Vec; pub use alloy_eips::eip1898::{ BlockHashOrNumber, BlockId, BlockNumHash, BlockNumberOrTag, ForkBlock, RpcBlockHash, }; -use alloy_primitives::Sealable; +use alloy_primitives::{Address, Sealable}; use alloy_rlp::{Decodable, Encodable, RlpDecodable, RlpEncodable}; use derive_more::{Deref, DerefMut}; #[cfg(any(test, feature = "arbitrary"))] diff --git a/crates/primitives/src/lib.rs b/crates/primitives/src/lib.rs index cdcf642c05ae..4e523da6953e 100644 --- a/crates/primitives/src/lib.rs +++ b/crates/primitives/src/lib.rs @@ -72,10 +72,9 @@ pub use transaction::{ pub use alloy_primitives::{ self, address, b256, bloom, bytes, bytes::{Buf, BufMut, BytesMut}, - eip191_hash_message, hex, hex_literal, keccak256, ruint, + hex, hex_literal, ruint, utils::format_ether, - Address, BlockHash, BlockNumber, Bloom, BloomInput, Bytes, ChainId, Selector, StorageKey, - StorageValue, TxHash, TxIndex, TxNumber, B128, B256, B512, B64, U128, U256, U64, U8, + Bytes, StorageValue, TxHash, TxIndex, TxNumber, B128, B256, B512, B64, U128, U256, U64, }; pub use reth_ethereum_forks::*; pub use revm_primitives::{self, JumpTable}; @@ -88,7 +87,7 @@ pub type H64 = B64; pub type H128 = B128; #[doc(hidden)] #[deprecated = "use Address instead"] -pub type H160 = Address; +pub type H160 = alloy_primitives::Address; #[doc(hidden)] #[deprecated = "use B256 instead"] pub type H256 = B256; diff --git a/crates/primitives/src/proofs.rs b/crates/primitives/src/proofs.rs index 7f41fa9bd20f..14fdb5af3c47 100644 --- a/crates/primitives/src/proofs.rs +++ b/crates/primitives/src/proofs.rs @@ -1,11 +1,12 @@ //! Helper function for calculating Merkle proofs and hashes. use crate::{ - constants::EMPTY_OMMER_ROOT_HASH, keccak256, Header, Receipt, ReceiptWithBloom, - ReceiptWithBloomRef, Request, TransactionSigned, Withdrawal, B256, + constants::EMPTY_OMMER_ROOT_HASH, Header, Receipt, ReceiptWithBloom, ReceiptWithBloomRef, + Request, TransactionSigned, Withdrawal, B256, }; use alloc::vec::Vec; use alloy_eips::eip7685::Encodable7685; +use alloy_primitives::keccak256; use reth_trie_common::root::{ordered_trie_root, ordered_trie_root_with_encoder}; /// Calculate a transaction root. diff --git a/crates/primitives/src/receipt.rs b/crates/primitives/src/receipt.rs index 6b1b62ba6ffb..bdc0cd016cce 100644 --- a/crates/primitives/src/receipt.rs +++ b/crates/primitives/src/receipt.rs @@ -1,11 +1,11 @@ #[cfg(feature = "reth-codec")] use crate::compression::{RECEIPT_COMPRESSOR, RECEIPT_DECOMPRESSOR}; use crate::{ - logs_bloom, Bloom, Bytes, TxType, B256, EIP1559_TX_TYPE_ID, EIP2930_TX_TYPE_ID, - EIP4844_TX_TYPE_ID, EIP7702_TX_TYPE_ID, + logs_bloom, Bytes, TxType, B256, EIP1559_TX_TYPE_ID, EIP2930_TX_TYPE_ID, EIP4844_TX_TYPE_ID, + EIP7702_TX_TYPE_ID, }; use alloc::{vec, vec::Vec}; -use alloy_primitives::Log; +use alloy_primitives::{Bloom, Log}; use alloy_rlp::{length_of_length, Decodable, Encodable, RlpDecodable, RlpEncodable}; use bytes::{Buf, BufMut}; use core::{cmp::Ordering, ops::Deref}; diff --git a/crates/primitives/src/transaction/access_list.rs b/crates/primitives/src/transaction/access_list.rs index 7a0782bef761..32beb293f9c1 100644 --- a/crates/primitives/src/transaction/access_list.rs +++ b/crates/primitives/src/transaction/access_list.rs @@ -2,8 +2,9 @@ #[cfg(test)] mod tests { - use crate::{Address, B256}; + use crate::B256; use alloy_eips::eip2930::{AccessList, AccessListItem}; + use alloy_primitives::Address; use alloy_rlp::{RlpDecodable, RlpDecodableWrapper, RlpEncodable, RlpEncodableWrapper}; use proptest::proptest; use proptest_arbitrary_interop::arb; diff --git a/crates/primitives/src/transaction/compat.rs b/crates/primitives/src/transaction/compat.rs index 319ae55b1af1..ac39671f34a8 100644 --- a/crates/primitives/src/transaction/compat.rs +++ b/crates/primitives/src/transaction/compat.rs @@ -1,5 +1,5 @@ -use crate::{Address, Transaction, TransactionSigned, U256}; -use alloy_primitives::TxKind; +use crate::{Transaction, TransactionSigned, U256}; +use alloy_primitives::{Address, TxKind}; use revm_primitives::{AuthorizationList, TxEnv}; /// Implements behaviour to fill a [`TxEnv`] from another transaction. diff --git a/crates/primitives/src/transaction/mod.rs b/crates/primitives/src/transaction/mod.rs index f1dae00fece2..bb6510fdeaa5 100644 --- a/crates/primitives/src/transaction/mod.rs +++ b/crates/primitives/src/transaction/mod.rs @@ -1,8 +1,8 @@ //! Transaction types. -use crate::{keccak256, Address, BlockHashOrNumber, Bytes, TxHash, B256, U256}; +use crate::{BlockHashOrNumber, Bytes, TxHash, B256, U256}; use alloy_eips::eip7702::SignedAuthorization; -use alloy_primitives::TxKind; +use alloy_primitives::{keccak256, Address, TxKind}; use alloy_consensus::{SignableTransaction, TxEip1559, TxEip2930, TxEip4844, TxEip7702, TxLegacy}; use alloy_eips::eip2930::AccessList; @@ -1702,10 +1702,10 @@ mod tests { use crate::{ hex, transaction::{signature::Signature, TxEip1559, TxKind, TxLegacy}, - Address, Bytes, Transaction, TransactionSigned, TransactionSignedEcRecovered, + Bytes, Transaction, TransactionSigned, TransactionSignedEcRecovered, TransactionSignedNoHash, B256, U256, }; - use alloy_primitives::{address, b256, bytes, Parity}; + use alloy_primitives::{address, b256, bytes, Address, Parity}; use alloy_rlp::{Decodable, Encodable, Error as RlpError}; use reth_chainspec::MIN_TRANSACTION_GAS; use reth_codecs::Compact; diff --git a/crates/primitives/src/transaction/pooled.rs b/crates/primitives/src/transaction/pooled.rs index 78ad756923c0..3f19b29b36c1 100644 --- a/crates/primitives/src/transaction/pooled.rs +++ b/crates/primitives/src/transaction/pooled.rs @@ -7,14 +7,15 @@ use super::{ TxEip7702, }; use crate::{ - Address, BlobTransaction, BlobTransactionSidecar, Bytes, Signature, Transaction, - TransactionSigned, TransactionSignedEcRecovered, TxHash, B256, EIP4844_TX_TYPE_ID, + BlobTransaction, BlobTransactionSidecar, Bytes, Signature, Transaction, TransactionSigned, + TransactionSignedEcRecovered, TxHash, B256, EIP4844_TX_TYPE_ID, }; use alloc::vec::Vec; use alloy_consensus::{ transaction::{TxEip1559, TxEip2930, TxEip4844, TxLegacy}, SignableTransaction, TxEip4844WithSidecar, }; +use alloy_primitives::Address; use alloy_rlp::{Decodable, Encodable, Error as RlpError, Header, EMPTY_LIST_CODE}; use bytes::Buf; use derive_more::{AsRef, Deref}; diff --git a/crates/primitives/src/transaction/sidecar.rs b/crates/primitives/src/transaction/sidecar.rs index e486fa670b6d..94dfbe6da4b6 100644 --- a/crates/primitives/src/transaction/sidecar.rs +++ b/crates/primitives/src/transaction/sidecar.rs @@ -1,7 +1,8 @@ #![cfg_attr(docsrs, doc(cfg(feature = "c-kzg")))] -use crate::{keccak256, Signature, Transaction, TransactionSigned, TxHash, EIP4844_TX_TYPE_ID}; +use crate::{Signature, Transaction, TransactionSigned, TxHash, EIP4844_TX_TYPE_ID}; use alloy_consensus::{transaction::TxEip4844, TxEip4844WithSidecar}; +use alloy_primitives::keccak256; use alloy_rlp::{Decodable, Error as RlpError, Header}; use serde::{Deserialize, Serialize}; diff --git a/crates/primitives/src/transaction/signature.rs b/crates/primitives/src/transaction/signature.rs index 4b4b5bb4547e..07a2d6195795 100644 --- a/crates/primitives/src/transaction/signature.rs +++ b/crates/primitives/src/transaction/signature.rs @@ -1,6 +1,5 @@ -use crate::{transaction::util::secp256k1, Address, B256, U256}; - -use alloy_primitives::Parity; +use crate::{transaction::util::secp256k1, B256, U256}; +use alloy_primitives::{Address, Parity}; use alloy_rlp::{Decodable, Error as RlpError}; pub use alloy_primitives::Signature; @@ -120,9 +119,9 @@ mod tests { transaction::signature::{ legacy_parity, recover_signer, recover_signer_unchecked, SECP256K1N_HALF, }, - Address, Signature, B256, U256, + Signature, B256, U256, }; - use alloy_primitives::Parity; + use alloy_primitives::{Address, Parity}; use std::str::FromStr; #[test] diff --git a/crates/primitives/src/transaction/tx_type.rs b/crates/primitives/src/transaction/tx_type.rs index 7331ba1ed93f..4017d8d4b9c4 100644 --- a/crates/primitives/src/transaction/tx_type.rs +++ b/crates/primitives/src/transaction/tx_type.rs @@ -1,4 +1,5 @@ -use crate::{U64, U8}; +use crate::U64; +use alloy_primitives::U8; use alloy_rlp::{Decodable, Encodable}; use serde::{Deserialize, Serialize}; diff --git a/crates/primitives/src/transaction/util.rs b/crates/primitives/src/transaction/util.rs index f3f49cb316c1..6205ec886ca0 100644 --- a/crates/primitives/src/transaction/util.rs +++ b/crates/primitives/src/transaction/util.rs @@ -1,4 +1,5 @@ -use crate::{Address, Signature}; +use crate::Signature; +use alloy_primitives::Address; use revm_primitives::B256; #[cfg(feature = "secp256k1")] @@ -14,13 +15,12 @@ pub(crate) mod secp256k1 { #[cfg(feature = "secp256k1")] mod impl_secp256k1 { use super::*; - use crate::keccak256; pub(crate) use ::secp256k1::Error; use ::secp256k1::{ ecdsa::{RecoverableSignature, RecoveryId}, Message, PublicKey, SecretKey, SECP256K1, }; - use alloy_primitives::Parity; + use alloy_primitives::{keccak256, Parity}; use revm_primitives::U256; /// Recovers the address of the sender using secp256k1 pubkey recovery. @@ -65,8 +65,7 @@ mod impl_secp256k1 { #[cfg_attr(feature = "secp256k1", allow(unused, unreachable_pub))] mod impl_k256 { use super::*; - use crate::keccak256; - use alloy_primitives::Parity; + use alloy_primitives::{keccak256, Parity}; pub(crate) use k256::ecdsa::Error; use k256::ecdsa::{RecoveryId, SigningKey, VerifyingKey}; use revm_primitives::U256; diff --git a/crates/primitives/src/transaction/variant.rs b/crates/primitives/src/transaction/variant.rs index 3e96b6dda899..c558e7ccb9ba 100644 --- a/crates/primitives/src/transaction/variant.rs +++ b/crates/primitives/src/transaction/variant.rs @@ -2,9 +2,9 @@ //! `TransactionSignedEcRecovered` use crate::{ - Address, Transaction, TransactionSigned, TransactionSignedEcRecovered, TransactionSignedNoHash, - B256, + Transaction, TransactionSigned, TransactionSignedEcRecovered, TransactionSignedNoHash, B256, }; +use alloy_primitives::Address; use core::ops::Deref; /// Represents various different transaction formats used in reth. diff --git a/crates/revm/Cargo.toml b/crates/revm/Cargo.toml index b4f169249444..2a5527ed0751 100644 --- a/crates/revm/Cargo.toml +++ b/crates/revm/Cargo.toml @@ -21,6 +21,7 @@ reth-consensus-common.workspace = true reth-prune-types.workspace = true reth-storage-api.workspace = true reth-trie = { workspace = true, optional = true } +alloy-primitives = { workspace = true, optional = true } # revm revm.workspace = true @@ -28,11 +29,12 @@ revm.workspace = true [dev-dependencies] reth-trie.workspace = true reth-ethereum-forks.workspace = true +alloy-primitives.workspace = true [features] default = ["std", "c-kzg"] std = [] c-kzg = ["revm/c-kzg"] -test-utils = ["dep:reth-trie"] +test-utils = ["dep:reth-trie", "alloy-primitives"] optimism = ["revm/optimism"] serde = ["revm/serde"] diff --git a/crates/revm/src/batch.rs b/crates/revm/src/batch.rs index 4502732a429d..7c8e0f29b5d7 100644 --- a/crates/revm/src/batch.rs +++ b/crates/revm/src/batch.rs @@ -182,7 +182,8 @@ impl BlockBatchRecord { mod tests { use super::*; use alloc::collections::BTreeMap; - use reth_primitives::{Address, Log, Receipt}; + use alloy_primitives::Address; + use reth_primitives::{Log, Receipt}; use reth_prune_types::{PruneMode, ReceiptsLogPruneConfig}; #[test] diff --git a/crates/revm/src/database.rs b/crates/revm/src/database.rs index fb5f71045ea1..e277d63e4bcc 100644 --- a/crates/revm/src/database.rs +++ b/crates/revm/src/database.rs @@ -1,6 +1,7 @@ use crate::primitives::alloy_primitives::{BlockNumber, StorageKey, StorageValue}; +use alloy_primitives::Address; use core::ops::{Deref, DerefMut}; -use reth_primitives::{Account, Address, B256, U256}; +use reth_primitives::{Account, B256, U256}; use reth_storage_errors::provider::{ProviderError, ProviderResult}; use revm::{ db::DatabaseRef, diff --git a/crates/revm/src/state_change.rs b/crates/revm/src/state_change.rs index 6376957f3111..8799b8c70eb2 100644 --- a/crates/revm/src/state_change.rs +++ b/crates/revm/src/state_change.rs @@ -1,7 +1,8 @@ use crate::precompile::HashMap; +use alloy_primitives::Address; use reth_chainspec::{ChainSpec, EthereumHardforks}; use reth_consensus_common::calc; -use reth_primitives::{Address, Block, Withdrawal, Withdrawals, U256}; +use reth_primitives::{Block, Withdrawal, Withdrawals, U256}; /// Collect all balance changes at the end of the block. /// diff --git a/crates/revm/src/test_utils.rs b/crates/revm/src/test_utils.rs index fe377bc5fc3d..bbdc196cd528 100644 --- a/crates/revm/src/test_utils.rs +++ b/crates/revm/src/test_utils.rs @@ -2,9 +2,8 @@ use std::collections::HashSet; use crate::precompile::HashMap; use alloc::vec::Vec; -use reth_primitives::{ - keccak256, Account, Address, BlockNumber, Bytecode, Bytes, StorageKey, B256, U256, -}; +use alloy_primitives::{keccak256, Address, BlockNumber, StorageKey}; +use reth_primitives::{Account, Bytecode, Bytes, B256, U256}; use reth_storage_api::{ AccountReader, BlockHashReader, StateProofProvider, StateProvider, StateRootProvider, StorageRootProvider, diff --git a/crates/rpc/rpc/src/eth/helpers/types.rs b/crates/rpc/rpc/src/eth/helpers/types.rs index 8cd659bb81d2..05da8bd91563 100644 --- a/crates/rpc/rpc/src/eth/helpers/types.rs +++ b/crates/rpc/rpc/src/eth/helpers/types.rs @@ -1,10 +1,10 @@ //! L1 `eth` API types. use alloy_network::{AnyNetwork, Network}; -use alloy_primitives::TxKind; +use alloy_primitives::{Address, TxKind}; use alloy_rpc_types::{Transaction, TransactionInfo}; use alloy_serde::WithOtherFields; -use reth_primitives::{Address, TransactionSignedEcRecovered}; +use reth_primitives::TransactionSignedEcRecovered; use reth_rpc_types_compat::{ transaction::{from_primitive_signature, GasPrice}, TransactionCompat, diff --git a/crates/stages/stages/Cargo.toml b/crates/stages/stages/Cargo.toml index 934e9b109053..9ed84160477f 100644 --- a/crates/stages/stages/Cargo.toml +++ b/crates/stages/stages/Cargo.toml @@ -37,6 +37,8 @@ reth-trie-db = { workspace = true, features = ["metrics"] } reth-testing-utils = { workspace = true, optional = true } +alloy-primitives.workspace = true + # async tokio = { workspace = true, features = ["sync"] } futures-util.workspace = true diff --git a/crates/stages/stages/benches/criterion.rs b/crates/stages/stages/benches/criterion.rs index 3957ceac4d70..7519d81a3622 100644 --- a/crates/stages/stages/benches/criterion.rs +++ b/crates/stages/stages/benches/criterion.rs @@ -6,7 +6,7 @@ use reth_chainspec::ChainSpec; use reth_config::config::{EtlConfig, TransactionLookupConfig}; use reth_db::{test_utils::TempDatabase, Database, DatabaseEnv}; -use reth_primitives::BlockNumber; +use alloy_primitives::BlockNumber; use reth_provider::{DatabaseProvider, DatabaseProviderFactory}; use reth_stages::{ stages::{MerkleStage, SenderRecoveryStage, TransactionLookupStage}, diff --git a/crates/stages/stages/benches/setup/account_hashing.rs b/crates/stages/stages/benches/setup/account_hashing.rs index 86831418e53f..9926c1f3d378 100644 --- a/crates/stages/stages/benches/setup/account_hashing.rs +++ b/crates/stages/stages/benches/setup/account_hashing.rs @@ -1,11 +1,11 @@ #![allow(unreachable_pub)] use super::constants; +use alloy_primitives::BlockNumber; use reth_db::tables; use reth_db_api::{ cursor::DbCursorRO, database::Database, transaction::DbTx, DatabaseError as DbError, }; -use reth_primitives::BlockNumber; use reth_stages::{ stages::{AccountHashingStage, SeedOpts}, test_utils::TestStageDB, diff --git a/crates/stages/stages/benches/setup/mod.rs b/crates/stages/stages/benches/setup/mod.rs index 41570c057f8e..85e4e3e5a318 100644 --- a/crates/stages/stages/benches/setup/mod.rs +++ b/crates/stages/stages/benches/setup/mod.rs @@ -1,4 +1,5 @@ #![allow(unreachable_pub)] +use alloy_primitives::Address; use itertools::concat; use reth_chainspec::ChainSpec; use reth_db::{tables, test_utils::TempDatabase, Database, DatabaseEnv}; @@ -6,9 +7,7 @@ use reth_db_api::{ cursor::DbCursorRO, transaction::{DbTx, DbTxMut}, }; -use reth_primitives::{ - alloy_primitives::Sealable, Account, Address, SealedBlock, SealedHeader, B256, U256, -}; +use reth_primitives::{alloy_primitives::Sealable, Account, SealedBlock, SealedHeader, B256, U256}; use reth_provider::{DatabaseProvider, DatabaseProviderFactory, TrieWriter}; use reth_stages::{ stages::{AccountHashingStage, StorageHashingStage}, diff --git a/crates/stages/stages/src/stages/bodies.rs b/crates/stages/stages/src/stages/bodies.rs index 7f6d2d6a066f..cc30fc90a11d 100644 --- a/crates/stages/stages/src/stages/bodies.rs +++ b/crates/stages/stages/src/stages/bodies.rs @@ -621,6 +621,7 @@ mod tests { UnwindStageTestRunner, }, }; + use alloy_primitives::{BlockHash, BlockNumber}; use futures_util::Stream; use reth_db::{static_file::HeaderMask, tables}; use reth_db_api::{ @@ -636,8 +637,7 @@ mod tests { error::DownloadResult, }; use reth_primitives::{ - BlockBody, BlockHash, BlockNumber, Header, SealedBlock, SealedHeader, - StaticFileSegment, TxNumber, B256, + BlockBody, Header, SealedBlock, SealedHeader, StaticFileSegment, TxNumber, B256, }; use reth_provider::{ providers::StaticFileWriter, test_utils::MockNodeTypesWithDB, HeaderProvider, diff --git a/crates/stages/stages/src/stages/execution.rs b/crates/stages/stages/src/stages/execution.rs index 57a9cdaab7ef..04cc1dd65923 100644 --- a/crates/stages/stages/src/stages/execution.rs +++ b/crates/stages/stages/src/stages/execution.rs @@ -1,4 +1,5 @@ use crate::stages::MERKLE_STAGE_DEFAULT_CLEAN_THRESHOLD; +use alloy_primitives::BlockNumber; use num_traits::Zero; use reth_config::config::ExecutionConfig; use reth_db::{static_file::HeaderMask, tables}; @@ -9,9 +10,7 @@ use reth_evm::{ }; use reth_execution_types::{Chain, ExecutionOutcome}; use reth_exex::{ExExManagerHandle, ExExNotification}; -use reth_primitives::{ - alloy_primitives::Sealable, BlockNumber, Header, SealedHeader, StaticFileSegment, -}; +use reth_primitives::{alloy_primitives::Sealable, Header, SealedHeader, StaticFileSegment}; use reth_primitives_traits::format_gas_throughput; use reth_provider::{ providers::{StaticFileProvider, StaticFileProviderRWRefMut, StaticFileWriter}, @@ -659,6 +658,7 @@ where mod tests { use super::*; use crate::test_utils::TestStageDB; + use alloy_primitives::{keccak256, Address}; use alloy_rlp::Decodable; use assert_matches::assert_matches; use reth_chainspec::ChainSpecBuilder; @@ -666,8 +666,7 @@ mod tests { use reth_evm_ethereum::execute::EthExecutorProvider; use reth_execution_errors::BlockValidationError; use reth_primitives::{ - address, hex_literal::hex, keccak256, Account, Address, Bytecode, SealedBlock, - StorageEntry, B256, U256, + address, hex_literal::hex, Account, Bytecode, SealedBlock, StorageEntry, B256, U256, }; use reth_provider::{ test_utils::create_test_provider_factory, AccountReader, DatabaseProviderFactory, diff --git a/crates/stages/stages/src/stages/hashing_account.rs b/crates/stages/stages/src/stages/hashing_account.rs index 2e109f7557f1..bbcb9b8da270 100644 --- a/crates/stages/stages/src/stages/hashing_account.rs +++ b/crates/stages/stages/src/stages/hashing_account.rs @@ -1,3 +1,4 @@ +use alloy_primitives::keccak256; use itertools::Itertools; use reth_config::config::{EtlConfig, HashingConfig}; use reth_db::{tables, RawKey, RawTable, RawValue}; @@ -6,7 +7,7 @@ use reth_db_api::{ transaction::{DbTx, DbTxMut}, }; use reth_etl::Collector; -use reth_primitives::{keccak256, Account, B256}; +use reth_primitives::{Account, B256}; use reth_provider::{AccountExtReader, DBProvider, HashingWriter, StatsReader}; use reth_stages_api::{ AccountHashingCheckpoint, EntitiesCheckpoint, ExecInput, ExecOutput, Stage, StageCheckpoint, @@ -63,7 +64,7 @@ impl AccountHashingStage { >( provider: &reth_provider::DatabaseProvider, opts: SeedOpts, - ) -> Result, StageError> { + ) -> Result, StageError> { use reth_db_api::models::AccountBeforeTx; use reth_primitives::U256; use reth_provider::{StaticFileProviderFactory, StaticFileWriter}; @@ -348,7 +349,7 @@ mod tests { mod test_utils { use super::*; use crate::test_utils::TestStageDB; - use reth_primitives::Address; + use alloy_primitives::Address; use reth_provider::DatabaseProviderFactory; pub(crate) struct AccountHashingTestRunner { diff --git a/crates/stages/stages/src/stages/hashing_storage.rs b/crates/stages/stages/src/stages/hashing_storage.rs index 54a9921dd521..ba1e03c1a296 100644 --- a/crates/stages/stages/src/stages/hashing_storage.rs +++ b/crates/stages/stages/src/stages/hashing_storage.rs @@ -1,3 +1,4 @@ +use alloy_primitives::keccak256; use itertools::Itertools; use reth_config::config::{EtlConfig, HashingConfig}; use reth_db::tables; @@ -8,7 +9,7 @@ use reth_db_api::{ transaction::{DbTx, DbTxMut}, }; use reth_etl::Collector; -use reth_primitives::{keccak256, BufMut, StorageEntry, B256}; +use reth_primitives::{BufMut, StorageEntry, B256}; use reth_provider::{DBProvider, HashingWriter, StatsReader, StorageReader}; use reth_stages_api::{ EntitiesCheckpoint, ExecInput, ExecOutput, Stage, StageCheckpoint, StageError, StageId, @@ -211,13 +212,14 @@ mod tests { stage_test_suite_ext, ExecuteStageTestRunner, StageTestRunner, TestRunnerError, TestStageDB, UnwindStageTestRunner, }; + use alloy_primitives::Address; use assert_matches::assert_matches; use rand::Rng; use reth_db_api::{ cursor::{DbCursorRW, DbDupCursorRO}, models::StoredBlockBodyIndices, }; - use reth_primitives::{Address, SealedBlock, U256}; + use reth_primitives::{SealedBlock, U256}; use reth_provider::providers::StaticFileWriter; use reth_testing_utils::generators::{ self, random_block_range, random_contract_account_range, BlockRangeParams, diff --git a/crates/stages/stages/src/stages/headers.rs b/crates/stages/stages/src/stages/headers.rs index f2ff1c666e26..25c7abaee48a 100644 --- a/crates/stages/stages/src/stages/headers.rs +++ b/crates/stages/stages/src/stages/headers.rs @@ -1,3 +1,4 @@ +use alloy_primitives::{BlockHash, BlockNumber}; use futures_util::StreamExt; use reth_codecs::Compact; use reth_config::config::EtlConfig; @@ -10,7 +11,7 @@ use reth_db_api::{ }; use reth_etl::Collector; use reth_network_p2p::headers::{downloader::HeaderDownloader, error::HeadersDownloaderError}; -use reth_primitives::{BlockHash, BlockNumber, SealedHeader, StaticFileSegment, B256}; +use reth_primitives::{SealedHeader, StaticFileSegment, B256}; use reth_provider::{ providers::{StaticFileProvider, StaticFileWriter}, BlockHashReader, DBProvider, HeaderProvider, HeaderSyncGap, HeaderSyncGapProvider, diff --git a/crates/stages/stages/src/stages/index_account_history.rs b/crates/stages/stages/src/stages/index_account_history.rs index 8ca8d173fd85..e0fcde2b194f 100644 --- a/crates/stages/stages/src/stages/index_account_history.rs +++ b/crates/stages/stages/src/stages/index_account_history.rs @@ -1,8 +1,8 @@ use super::{collect_history_indices, load_history_indices}; +use alloy_primitives::Address; use reth_config::config::{EtlConfig, IndexHistoryConfig}; use reth_db::tables; use reth_db_api::{models::ShardedKey, table::Decode, transaction::DbTxMut}; -use reth_primitives::Address; use reth_provider::{DBProvider, HistoryWriter, PruneCheckpointReader, PruneCheckpointWriter}; use reth_prune_types::{PruneCheckpoint, PruneMode, PrunePurpose, PruneSegment}; use reth_stages_api::{ @@ -148,6 +148,7 @@ mod tests { stage_test_suite_ext, ExecuteStageTestRunner, StageTestRunner, TestRunnerError, TestStageDB, UnwindStageTestRunner, }; + use alloy_primitives::BlockNumber; use itertools::Itertools; use reth_db::BlockNumberList; use reth_db_api::{ @@ -158,7 +159,7 @@ mod tests { }, transaction::DbTx, }; - use reth_primitives::{address, BlockNumber, B256}; + use reth_primitives::{address, B256}; use reth_provider::{providers::StaticFileWriter, DatabaseProviderFactory}; use reth_testing_utils::generators::{ self, random_block_range, random_changeset_range, random_contract_account_range, diff --git a/crates/stages/stages/src/stages/index_storage_history.rs b/crates/stages/stages/src/stages/index_storage_history.rs index 00646da2fd22..4af2cb3efea2 100644 --- a/crates/stages/stages/src/stages/index_storage_history.rs +++ b/crates/stages/stages/src/stages/index_storage_history.rs @@ -153,6 +153,7 @@ mod tests { stage_test_suite_ext, ExecuteStageTestRunner, StageTestRunner, TestRunnerError, TestStageDB, UnwindStageTestRunner, }; + use alloy_primitives::{Address, BlockNumber}; use itertools::Itertools; use reth_db::BlockNumberList; use reth_db_api::{ @@ -163,7 +164,7 @@ mod tests { }, transaction::DbTx, }; - use reth_primitives::{address, b256, Address, BlockNumber, StorageEntry, B256, U256}; + use reth_primitives::{address, b256, StorageEntry, B256, U256}; use reth_provider::{providers::StaticFileWriter, DatabaseProviderFactory}; use reth_testing_utils::generators::{ self, random_block_range, random_changeset_range, random_contract_account_range, diff --git a/crates/stages/stages/src/stages/merkle.rs b/crates/stages/stages/src/stages/merkle.rs index 83c8c52ce561..7b94067e9926 100644 --- a/crates/stages/stages/src/stages/merkle.rs +++ b/crates/stages/stages/src/stages/merkle.rs @@ -1,8 +1,9 @@ +use alloy_primitives::BlockNumber; use reth_codecs::Compact; use reth_consensus::ConsensusError; use reth_db::tables; use reth_db_api::transaction::{DbTx, DbTxMut}; -use reth_primitives::{alloy_primitives::Sealable, BlockNumber, GotExpected, SealedHeader, B256}; +use reth_primitives::{alloy_primitives::Sealable, GotExpected, SealedHeader, B256}; use reth_provider::{ DBProvider, HeaderProvider, ProviderError, StageCheckpointReader, StageCheckpointWriter, StatsReader, TrieWriter, @@ -373,9 +374,10 @@ mod tests { stage_test_suite_ext, ExecuteStageTestRunner, StageTestRunner, StorageKind, TestRunnerError, TestStageDB, UnwindStageTestRunner, }; + use alloy_primitives::keccak256; use assert_matches::assert_matches; use reth_db_api::cursor::{DbCursorRO, DbCursorRW, DbDupCursorRO}; - use reth_primitives::{keccak256, SealedBlock, StaticFileSegment, StorageEntry, U256}; + use reth_primitives::{SealedBlock, StaticFileSegment, StorageEntry, U256}; use reth_provider::{providers::StaticFileWriter, StaticFileProviderFactory}; use reth_stages_api::StageUnitCheckpoint; use reth_testing_utils::generators::{ diff --git a/crates/stages/stages/src/stages/mod.rs b/crates/stages/stages/src/stages/mod.rs index 4eb3c6f141d4..d3c5b7099d21 100644 --- a/crates/stages/stages/src/stages/mod.rs +++ b/crates/stages/stages/src/stages/mod.rs @@ -42,6 +42,7 @@ use utils::*; mod tests { use super::*; use crate::test_utils::{StorageKind, TestStageDB}; + use alloy_primitives::{keccak256, BlockNumber}; use alloy_rlp::Decodable; use reth_chainspec::ChainSpecBuilder; use reth_db::{ @@ -56,8 +57,7 @@ mod tests { use reth_evm_ethereum::execute::EthExecutorProvider; use reth_exex::ExExManagerHandle; use reth_primitives::{ - address, hex_literal::hex, keccak256, Account, BlockNumber, Bytecode, SealedBlock, - StaticFileSegment, B256, U256, + address, hex_literal::hex, Account, Bytecode, SealedBlock, StaticFileSegment, B256, U256, }; use reth_provider::{ providers::{StaticFileProvider, StaticFileWriter}, diff --git a/crates/stages/stages/src/stages/sender_recovery.rs b/crates/stages/stages/src/stages/sender_recovery.rs index bf7df6147ff8..344a8ea848ee 100644 --- a/crates/stages/stages/src/stages/sender_recovery.rs +++ b/crates/stages/stages/src/stages/sender_recovery.rs @@ -1,3 +1,4 @@ +use alloy_primitives::Address; use reth_config::config::SenderRecoveryConfig; use reth_consensus::ConsensusError; use reth_db::{static_file::TransactionMask, tables, RawValue}; @@ -6,7 +7,7 @@ use reth_db_api::{ transaction::{DbTx, DbTxMut}, DbTxUnwindExt, }; -use reth_primitives::{Address, GotExpected, StaticFileSegment, TransactionSignedNoHash, TxNumber}; +use reth_primitives::{GotExpected, StaticFileSegment, TransactionSignedNoHash, TxNumber}; use reth_provider::{ BlockReader, DBProvider, HeaderProvider, ProviderError, PruneCheckpointReader, StaticFileProviderFactory, StatsReader, @@ -333,9 +334,10 @@ struct FailedSenderRecoveryError { #[cfg(test)] mod tests { + use alloy_primitives::BlockNumber; use assert_matches::assert_matches; use reth_db_api::cursor::DbCursorRO; - use reth_primitives::{BlockNumber, SealedBlock, TransactionSigned, B256}; + use reth_primitives::{SealedBlock, TransactionSigned, B256}; use reth_provider::{ providers::StaticFileWriter, DatabaseProviderFactory, PruneCheckpointWriter, StaticFileProviderFactory, TransactionsProvider, diff --git a/crates/stages/stages/src/stages/tx_lookup.rs b/crates/stages/stages/src/stages/tx_lookup.rs index e636c281829d..4e68cfe90b76 100644 --- a/crates/stages/stages/src/stages/tx_lookup.rs +++ b/crates/stages/stages/src/stages/tx_lookup.rs @@ -250,8 +250,9 @@ mod tests { stage_test_suite_ext, ExecuteStageTestRunner, StageTestRunner, StorageKind, TestRunnerError, TestStageDB, UnwindStageTestRunner, }; + use alloy_primitives::BlockNumber; use assert_matches::assert_matches; - use reth_primitives::{BlockNumber, SealedBlock, B256}; + use reth_primitives::{SealedBlock, B256}; use reth_provider::{ providers::StaticFileWriter, DatabaseProviderFactory, StaticFileProviderFactory, }; diff --git a/crates/stages/stages/src/stages/utils.rs b/crates/stages/stages/src/stages/utils.rs index cb9c729aa234..c16886e0bdca 100644 --- a/crates/stages/stages/src/stages/utils.rs +++ b/crates/stages/stages/src/stages/utils.rs @@ -1,4 +1,5 @@ //! Utils for `stages`. +use alloy_primitives::BlockNumber; use reth_config::config::EtlConfig; use reth_db::BlockNumberList; use reth_db_api::{ @@ -9,7 +10,6 @@ use reth_db_api::{ DatabaseError, }; use reth_etl::Collector; -use reth_primitives::BlockNumber; use reth_provider::DBProvider; use reth_stages_api::StageError; use std::{collections::HashMap, hash::Hash, ops::RangeBounds}; diff --git a/crates/stages/stages/src/test_utils/test_db.rs b/crates/stages/stages/src/test_utils/test_db.rs index 5fef9d6a2be2..89d74d9d4092 100644 --- a/crates/stages/stages/src/test_utils/test_db.rs +++ b/crates/stages/stages/src/test_utils/test_db.rs @@ -1,3 +1,4 @@ +use alloy_primitives::{keccak256, Address, BlockNumber}; use reth_chainspec::MAINNET; use reth_db::{ tables, @@ -14,8 +15,8 @@ use reth_db_api::{ DatabaseError as DbError, }; use reth_primitives::{ - keccak256, Account, Address, BlockNumber, Receipt, SealedBlock, SealedHeader, - StaticFileSegment, StorageEntry, TxHash, TxNumber, B256, U256, + Account, Receipt, SealedBlock, SealedHeader, StaticFileSegment, StorageEntry, TxHash, TxNumber, + B256, U256, }; use reth_provider::{ providers::{StaticFileProvider, StaticFileProviderRWRefMut, StaticFileWriter}, diff --git a/crates/storage/provider/src/providers/static_file/mod.rs b/crates/storage/provider/src/providers/static_file/mod.rs index 8152dd0ed9ca..3587a499484f 100644 --- a/crates/storage/provider/src/providers/static_file/mod.rs +++ b/crates/storage/provider/src/providers/static_file/mod.rs @@ -56,7 +56,7 @@ impl Deref for LoadedJar { mod tests { use super::*; use crate::{test_utils::create_test_provider_factory, HeaderProvider}; - use alloy_primitives::{B256, U256}; + use alloy_primitives::{BlockHash, B256, U256}; use rand::seq::SliceRandom; use reth_db::{ test_utils::create_test_static_files_dir, CanonicalHeaders, HeaderNumbers, @@ -65,7 +65,7 @@ mod tests { use reth_db_api::transaction::DbTxMut; use reth_primitives::{ static_file::{find_fixed_range, SegmentRangeInclusive, DEFAULT_BLOCKS_PER_STATIC_FILE}, - BlockHash, Header, Receipt, TransactionSignedNoHash, + Header, Receipt, TransactionSignedNoHash, }; use reth_testing_utils::generators::{self, random_header_range}; use std::{fmt::Debug, fs, ops::Range, path::Path}; diff --git a/crates/storage/provider/src/test_utils/blocks.rs b/crates/storage/provider/src/test_utils/blocks.rs index 352f5314af9f..6f6aae992446 100644 --- a/crates/storage/provider/src/test_utils/blocks.rs +++ b/crates/storage/provider/src/test_utils/blocks.rs @@ -1,14 +1,14 @@ //! Dummy blocks and data for tests use crate::{DatabaseProviderRW, ExecutionOutcome}; use alloy_consensus::TxLegacy; -use alloy_primitives::{Log, Parity, Sealable, TxKind}; +use alloy_primitives::{Address, BlockNumber, Log, Parity, Sealable, TxKind}; use once_cell::sync::Lazy; use reth_db::tables; use reth_db_api::{database::Database, models::StoredBlockBodyIndices}; use reth_primitives::{ - alloy_primitives, b256, hex_literal::hex, Account, Address, BlockBody, BlockNumber, Bytes, - Header, Receipt, SealedBlock, SealedBlockWithSenders, SealedHeader, Signature, Transaction, - TransactionSigned, TxType, Withdrawal, Withdrawals, B256, U256, + alloy_primitives, b256, hex_literal::hex, Account, BlockBody, Bytes, Header, Receipt, + SealedBlock, SealedBlockWithSenders, SealedHeader, Signature, Transaction, TransactionSigned, + TxType, Withdrawal, Withdrawals, B256, U256, }; use reth_trie::root::{state_root_unhashed, storage_root_unhashed}; use revm::{ diff --git a/crates/storage/provider/src/writer/mod.rs b/crates/storage/provider/src/writer/mod.rs index 17bf9db81bd4..d96e722d7b40 100644 --- a/crates/storage/provider/src/writer/mod.rs +++ b/crates/storage/provider/src/writer/mod.rs @@ -544,14 +544,14 @@ mod tests { use crate::{ test_utils::create_test_provider_factory, AccountReader, StorageTrieWriter, TrieWriter, }; - use alloy_primitives::{keccak256, B256, U256}; + use alloy_primitives::{keccak256, Address, B256, U256}; use reth_db::tables; use reth_db_api::{ cursor::{DbCursorRO, DbCursorRW, DbDupCursorRO}, models::{AccountBeforeTx, BlockNumberAddress}, transaction::{DbTx, DbTxMut}, }; - use reth_primitives::{Account, Address, Receipt, Receipts, StorageEntry}; + use reth_primitives::{Account, Receipt, Receipts, StorageEntry}; use reth_storage_api::DatabaseProviderFactory; use reth_trie::{ test_utils::{state_root, storage_root_prehashed}, diff --git a/crates/trie/db/src/state.rs b/crates/trie/db/src/state.rs index 4f27679ddad9..9cefc6b9fa83 100644 --- a/crates/trie/db/src/state.rs +++ b/crates/trie/db/src/state.rs @@ -267,9 +267,10 @@ impl DatabaseHashedPostState for HashedPostState { #[cfg(test)] mod tests { use super::*; + use alloy_primitives::Address; use reth_db::test_utils::create_test_rw_db; use reth_db_api::database::Database; - use reth_primitives::{hex, revm_primitives::AccountInfo, Address, U256}; + use reth_primitives::{hex, revm_primitives::AccountInfo, U256}; use revm::db::BundleState; use std::collections::HashMap; diff --git a/examples/custom-engine-types/Cargo.toml b/examples/custom-engine-types/Cargo.toml index 9a949b8367fd..f826451d2038 100644 --- a/examples/custom-engine-types/Cargo.toml +++ b/examples/custom-engine-types/Cargo.toml @@ -18,6 +18,7 @@ reth-node-ethereum = { workspace = true, features = ["test-utils"] } reth-tracing.workspace = true alloy-genesis.workspace = true alloy-rpc-types = { workspace = true, features = ["engine"] } +alloy-primitives.workspace = true eyre.workspace = true tokio.workspace = true diff --git a/examples/custom-engine-types/src/main.rs b/examples/custom-engine-types/src/main.rs index 5e0503701ab9..c4f640e9b87f 100644 --- a/examples/custom-engine-types/src/main.rs +++ b/examples/custom-engine-types/src/main.rs @@ -23,6 +23,7 @@ use serde::{Deserialize, Serialize}; use thiserror::Error; use alloy_genesis::Genesis; +use alloy_primitives::Address; use alloy_rpc_types::{ engine::{ ExecutionPayloadEnvelopeV2, ExecutionPayloadEnvelopeV3, ExecutionPayloadEnvelopeV4, @@ -63,7 +64,7 @@ use reth_payload_builder::{ EthBuiltPayload, EthPayloadBuilderAttributes, PayloadBuilderError, PayloadBuilderHandle, PayloadBuilderService, }; -use reth_primitives::{Address, Withdrawals, B256}; +use reth_primitives::{Withdrawals, B256}; use reth_tracing::{RethTracer, Tracer}; /// A custom payload attributes type. diff --git a/examples/custom-evm/Cargo.toml b/examples/custom-evm/Cargo.toml index 7642dc80cf2f..53563ab9575b 100644 --- a/examples/custom-evm/Cargo.toml +++ b/examples/custom-evm/Cargo.toml @@ -15,6 +15,7 @@ reth-primitives.workspace = true reth-node-ethereum = { workspace = true, features = ["test-utils"] } reth-tracing.workspace = true alloy-genesis.workspace = true +alloy-primitives.workspace = true eyre.workspace = true tokio.workspace = true diff --git a/examples/custom-evm/src/main.rs b/examples/custom-evm/src/main.rs index 3a93d85ad6fb..4f1c0c7eb299 100644 --- a/examples/custom-evm/src/main.rs +++ b/examples/custom-evm/src/main.rs @@ -3,6 +3,7 @@ #![cfg_attr(not(test), warn(unused_crate_dependencies))] use alloy_genesis::Genesis; +use alloy_primitives::Address; use reth::{ builder::{ components::{ExecutorBuilder, PayloadServiceBuilder}, @@ -38,7 +39,7 @@ use reth_node_ethereum::{ }; use reth_primitives::{ revm_primitives::{CfgEnvWithHandlerCfg, TxEnv}, - Address, Header, TransactionSigned, U256, + Header, TransactionSigned, U256, }; use reth_tracing::{RethTracer, Tracer}; use std::sync::Arc; diff --git a/examples/custom-inspector/Cargo.toml b/examples/custom-inspector/Cargo.toml index 101806276099..a94980951627 100644 --- a/examples/custom-inspector/Cargo.toml +++ b/examples/custom-inspector/Cargo.toml @@ -12,3 +12,4 @@ reth-rpc-types.workspace = true alloy-rpc-types.workspace = true clap = { workspace = true, features = ["derive"] } futures-util.workspace = true +alloy-primitives.workspace = true diff --git a/examples/custom-inspector/src/main.rs b/examples/custom-inspector/src/main.rs index 87f8dd7e95bf..b1cd6535652b 100644 --- a/examples/custom-inspector/src/main.rs +++ b/examples/custom-inspector/src/main.rs @@ -10,6 +10,7 @@ #![cfg_attr(not(test), warn(unused_crate_dependencies))] +use alloy_primitives::Address; use alloy_rpc_types::state::EvmOverrides; use clap::Parser; use futures_util::StreamExt; @@ -17,7 +18,7 @@ use reth::{ args::utils::DefaultChainSpecParser, builder::NodeHandle, cli::Cli, - primitives::{Address, BlockNumberOrTag, IntoRecoveredTransaction}, + primitives::{BlockNumberOrTag, IntoRecoveredTransaction}, revm::{ inspector_handle_register, interpreter::{Interpreter, OpCode}, diff --git a/examples/db-access/Cargo.toml b/examples/db-access/Cargo.toml index c0fbe74e1874..0180f4f90922 100644 --- a/examples/db-access/Cargo.toml +++ b/examples/db-access/Cargo.toml @@ -16,6 +16,7 @@ reth-node-ethereum.workspace = true reth-node-types.workspace = true alloy-rpc-types.workspace = true +alloy-primitives.workspace = true eyre.workspace = true diff --git a/examples/db-access/src/main.rs b/examples/db-access/src/main.rs index 53b56b738c0a..5730e6753522 100644 --- a/examples/db-access/src/main.rs +++ b/examples/db-access/src/main.rs @@ -1,8 +1,9 @@ +use alloy_primitives::Address; use alloy_rpc_types::{Filter, FilteredParams}; use reth_chainspec::ChainSpecBuilder; use reth_node_ethereum::EthereumNode; use reth_node_types::NodeTypesWithDBAdapter; -use reth_primitives::{alloy_primitives::Sealable, Address, SealedHeader, B256}; +use reth_primitives::{alloy_primitives::Sealable, SealedHeader, B256}; use reth_provider::{ providers::StaticFileProvider, AccountReader, BlockReader, BlockSource, HeaderProvider, ProviderFactory, ReceiptProvider, StateProvider, TransactionsProvider, diff --git a/examples/stateful-precompile/Cargo.toml b/examples/stateful-precompile/Cargo.toml index 2ae4656eee86..47a784c36e14 100644 --- a/examples/stateful-precompile/Cargo.toml +++ b/examples/stateful-precompile/Cargo.toml @@ -14,6 +14,7 @@ reth-primitives.workspace = true reth-node-ethereum = { workspace = true, features = ["test-utils"] } reth-tracing.workspace = true alloy-genesis.workspace = true +alloy-primitives.workspace = true eyre.workspace = true parking_lot.workspace = true diff --git a/examples/stateful-precompile/src/main.rs b/examples/stateful-precompile/src/main.rs index 88ca2ac1a7bb..7db6ee48c76a 100644 --- a/examples/stateful-precompile/src/main.rs +++ b/examples/stateful-precompile/src/main.rs @@ -3,13 +3,14 @@ #![cfg_attr(not(test), warn(unused_crate_dependencies))] use alloy_genesis::Genesis; +use alloy_primitives::Address; use parking_lot::RwLock; use reth::{ api::NextBlockEnvAttributes, builder::{components::ExecutorBuilder, BuilderContext, NodeBuilder}, primitives::{ revm_primitives::{BlockEnv, CfgEnvWithHandlerCfg, Env, PrecompileResult, TxEnv}, - Address, Bytes, U256, + Bytes, U256, }, revm::{ handler::register::EvmHandler, diff --git a/examples/txpool-tracing/Cargo.toml b/examples/txpool-tracing/Cargo.toml index 219292ee0686..38d0ad9409b6 100644 --- a/examples/txpool-tracing/Cargo.toml +++ b/examples/txpool-tracing/Cargo.toml @@ -11,3 +11,4 @@ reth-node-ethereum.workspace = true alloy-rpc-types-trace.workspace = true clap = { workspace = true, features = ["derive"] } futures-util.workspace = true +alloy-primitives.workspace = true diff --git a/examples/txpool-tracing/src/main.rs b/examples/txpool-tracing/src/main.rs index c9d27089d9ce..9575608fdc97 100644 --- a/examples/txpool-tracing/src/main.rs +++ b/examples/txpool-tracing/src/main.rs @@ -17,11 +17,12 @@ use reth::{ args::utils::DefaultChainSpecParser, builder::NodeHandle, cli::Cli, - primitives::{Address, IntoRecoveredTransaction}, + primitives::{ IntoRecoveredTransaction}, rpc::compat::transaction::transaction_to_call_request, transaction_pool::TransactionPool, }; use reth_node_ethereum::node::EthereumNode; +use alloy_primitives::Address; fn main() { Cli::::parse() diff --git a/testing/ef-tests/src/models.rs b/testing/ef-tests/src/models.rs index 8c8c3189a5d3..47d0a388a3ef 100644 --- a/testing/ef-tests/src/models.rs +++ b/testing/ef-tests/src/models.rs @@ -1,7 +1,7 @@ //! Shared models for use crate::{assert::assert_equal, Error}; -use alloy_primitives::{Address, Bloom, Bytes, B256, B64, U256}; +use alloy_primitives::{keccak256, Address, Bloom, Bytes, B256, B64, U256}; use reth_chainspec::{ChainSpec, ChainSpecBuilder}; use reth_db::tables; use reth_db_api::{ @@ -9,8 +9,7 @@ use reth_db_api::{ transaction::{DbTx, DbTxMut}, }; use reth_primitives::{ - keccak256, Account as RethAccount, Bytecode, Header as RethHeader, SealedHeader, StorageEntry, - Withdrawals, + Account as RethAccount, Bytecode, Header as RethHeader, SealedHeader, StorageEntry, Withdrawals, }; use serde::Deserialize; use std::{collections::BTreeMap, ops::Deref}; From 638c4018b444fd228d5e4270ce790be3133a1b33 Mon Sep 17 00:00:00 2001 From: Thomas Coratger Date: Wed, 25 Sep 2024 19:19:33 +0200 Subject: [PATCH 2/8] fmt --- crates/config/src/config.rs | 2 +- crates/evm/src/noop.rs | 4 ++-- examples/stateful-precompile/src/main.rs | 2 +- examples/txpool-tracing/src/main.rs | 9 +++------ 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/crates/config/src/config.rs b/crates/config/src/config.rs index 39855a3a0c94..e4a7fc9677aa 100644 --- a/crates/config/src/config.rs +++ b/crates/config/src/config.rs @@ -444,8 +444,8 @@ where mod tests { use super::{Config, EXTENSION}; use crate::PruneConfig; - use reth_network_peers::TrustedPeer; use alloy_primitives::Address; + use reth_network_peers::TrustedPeer; use reth_prune_types::{PruneMode, PruneModes, ReceiptsLogPruneConfig}; use std::{collections::BTreeMap, path::Path, str::FromStr, time::Duration}; diff --git a/crates/evm/src/noop.rs b/crates/evm/src/noop.rs index ef9e6798cfb6..392bfd0bd722 100644 --- a/crates/evm/src/noop.rs +++ b/crates/evm/src/noop.rs @@ -1,14 +1,14 @@ //! A no operation block executor implementation. +use alloy_primitives::BlockNumber; use core::fmt::Display; use reth_execution_errors::BlockExecutionError; use reth_execution_types::{BlockExecutionInput, BlockExecutionOutput, ExecutionOutcome}; -use reth_primitives::{ BlockWithSenders, Receipt}; +use reth_primitives::{BlockWithSenders, Receipt}; use reth_prune_types::PruneModes; use reth_storage_errors::provider::ProviderError; use revm::State; use revm_primitives::db::Database; -use alloy_primitives::BlockNumber; use crate::execute::{BatchExecutor, BlockExecutorProvider, Executor}; diff --git a/examples/stateful-precompile/src/main.rs b/examples/stateful-precompile/src/main.rs index 7db6ee48c76a..effece640d26 100644 --- a/examples/stateful-precompile/src/main.rs +++ b/examples/stateful-precompile/src/main.rs @@ -10,7 +10,7 @@ use reth::{ builder::{components::ExecutorBuilder, BuilderContext, NodeBuilder}, primitives::{ revm_primitives::{BlockEnv, CfgEnvWithHandlerCfg, Env, PrecompileResult, TxEnv}, - Bytes, U256, + Bytes, U256, }, revm::{ handler::register::EvmHandler, diff --git a/examples/txpool-tracing/src/main.rs b/examples/txpool-tracing/src/main.rs index 9575608fdc97..ea51f27af2e2 100644 --- a/examples/txpool-tracing/src/main.rs +++ b/examples/txpool-tracing/src/main.rs @@ -10,19 +10,16 @@ #![cfg_attr(not(test), warn(unused_crate_dependencies))] +use alloy_primitives::Address; use alloy_rpc_types_trace::{parity::TraceType, tracerequest::TraceCallRequest}; use clap::Parser; use futures_util::StreamExt; use reth::{ - args::utils::DefaultChainSpecParser, - builder::NodeHandle, - cli::Cli, - primitives::{ IntoRecoveredTransaction}, - rpc::compat::transaction::transaction_to_call_request, + args::utils::DefaultChainSpecParser, builder::NodeHandle, cli::Cli, + primitives::IntoRecoveredTransaction, rpc::compat::transaction::transaction_to_call_request, transaction_pool::TransactionPool, }; use reth_node_ethereum::node::EthereumNode; -use alloy_primitives::Address; fn main() { Cli::::parse() From 2b2c8c3c276c636ee8d6f45d3b9d958c0844674c Mon Sep 17 00:00:00 2001 From: Thomas Coratger Date: Wed, 25 Sep 2024 19:32:41 +0200 Subject: [PATCH 3/8] some fixes --- crates/revm/Cargo.toml | 4 ++-- testing/testing-utils/src/genesis_allocator.rs | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/revm/Cargo.toml b/crates/revm/Cargo.toml index 2a5527ed0751..9e4501f62770 100644 --- a/crates/revm/Cargo.toml +++ b/crates/revm/Cargo.toml @@ -21,7 +21,7 @@ reth-consensus-common.workspace = true reth-prune-types.workspace = true reth-storage-api.workspace = true reth-trie = { workspace = true, optional = true } -alloy-primitives = { workspace = true, optional = true } +alloy-primitives.workspace = true # revm revm.workspace = true @@ -35,6 +35,6 @@ alloy-primitives.workspace = true default = ["std", "c-kzg"] std = [] c-kzg = ["revm/c-kzg"] -test-utils = ["dep:reth-trie", "alloy-primitives"] +test-utils = ["dep:reth-trie"] optimism = ["revm/optimism"] serde = ["revm/serde"] diff --git a/testing/testing-utils/src/genesis_allocator.rs b/testing/testing-utils/src/genesis_allocator.rs index 8a5adb300240..d2da3bbabd28 100644 --- a/testing/testing-utils/src/genesis_allocator.rs +++ b/testing/testing-utils/src/genesis_allocator.rs @@ -18,7 +18,8 @@ use std::{ /// /// # Example /// ``` -/// # use reth_primitives::{Address, U256, hex, Bytes}; +/// # use alloy_primitives::Address; +/// # use reth_primitives::{U256, hex, Bytes}; /// # use reth_testing_utils::GenesisAllocator; /// # use std::str::FromStr; /// let mut allocator = GenesisAllocator::default(); From 59b411c6d57c1460c7940b3e17cfa039bc1c8438 Mon Sep 17 00:00:00 2001 From: Thomas Coratger Date: Wed, 25 Sep 2024 19:46:32 +0200 Subject: [PATCH 4/8] fix lock file --- Cargo.lock | 117 +++++++++++++++++++++++------------------------------ 1 file changed, 51 insertions(+), 66 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9fd2246f5122..420de59ea67a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -126,9 +126,9 @@ dependencies = [ [[package]] name = "alloy-dyn-abi" -version = "0.8.4" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c538495c47bc558bd3bb7becf9bde6172dacd5e1fc77531cdd584eb1c248f973" +checksum = "4004925bff5ba0a11739ae84dbb6601a981ea692f3bd45b626935ee90a6b8471" dependencies = [ "alloy-json-abi", "alloy-primitives", @@ -201,9 +201,9 @@ dependencies = [ [[package]] name = "alloy-json-abi" -version = "0.8.4" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03ebb591e349f3aab48a38da25ee1e2d1a3f4026d466b2e3160c618166b07aa4" +checksum = "9996daf962fd0a90d3c93b388033228865953b92de7bb1959b891d78750a4091" dependencies = [ "alloy-primitives", "alloy-sol-type-parser", @@ -277,9 +277,9 @@ dependencies = [ [[package]] name = "alloy-primitives" -version = "0.8.4" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f778fe4183cecaec41361e65869e81e748c44a77fa3e6ba20219ca92be33a19" +checksum = "411aff151f2a73124ee473708e82ed51b2535f68928b6a1caa8bc1246ae6f7cd" dependencies = [ "alloy-rlp", "arbitrary", @@ -289,20 +289,15 @@ dependencies = [ "derive_arbitrary", "derive_more", "getrandom 0.2.15", - "hashbrown 0.14.5", "hex-literal", - "indexmap 2.5.0", "itoa", "k256", "keccak-asm", - "paste", "proptest", "proptest-derive", "rand 0.8.5", "ruint", - "rustc-hash 2.0.0", "serde", - "sha3", "tiny-keccak", ] @@ -593,9 +588,9 @@ dependencies = [ [[package]] name = "alloy-sol-macro" -version = "0.8.4" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd94eff5a90844c341b39f78227eef5d6890e2ce65c934d97b3f9d724234cc8" +checksum = "0458ccb02a564228fcd76efb8eb5a520521a8347becde37b402afec9a1b83859" dependencies = [ "alloy-sol-macro-expander", "alloy-sol-macro-input", @@ -607,9 +602,9 @@ dependencies = [ [[package]] name = "alloy-sol-macro-expander" -version = "0.8.4" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d900423cebf57657f5b18945031edd82b8d3c481c055e00574653ac70acb1305" +checksum = "2bc65475025fc1e84bf86fc840f04f63fcccdcf3cf12053c99918e4054dfbc69" dependencies = [ "alloy-sol-macro-input", "const-hex", @@ -625,9 +620,9 @@ dependencies = [ [[package]] name = "alloy-sol-macro-input" -version = "0.8.4" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58171163ee466fa907c974e0fb945ecde589217006c401d9414ac00316b63e0a" +checksum = "6ed10f0715a0b69fde3236ff3b9ae5f6f7c97db5a387747100070d3016b9266b" dependencies = [ "const-hex", "dunce", @@ -640,9 +635,9 @@ dependencies = [ [[package]] name = "alloy-sol-type-parser" -version = "0.8.4" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d51ebc7c9a94d3a5d2aa29108323d70c890ae97cda38a3598e8b5ebd34fe7d01" +checksum = "3edae8ea1de519ccba896b6834dec874230f72fe695ff3c9c118e90ec7cff783" dependencies = [ "serde", "winnow", @@ -650,9 +645,9 @@ dependencies = [ [[package]] name = "alloy-sol-types" -version = "0.8.4" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "092cce3d2618d5e16e04306796c839c2b20585b591dcc9d64d0897a10c5bd086" +checksum = "1eb88e4da0a1b697ed6a9f811fdba223cf4d5c21410804fd1707836af73a462b" dependencies = [ "alloy-json-abi", "alloy-primitives", @@ -1064,9 +1059,9 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.83" +version = "0.1.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" +checksum = "a27b8a3a6e1a44fa4c8baf1f653e4172e81486d4941f2237e20dc2d0cf4ddff1" dependencies = [ "proc-macro2", "quote", @@ -3645,9 +3640,9 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.9" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41296eb09f183ac68eec06e03cdbea2e759633d4067b2f6552fc2e009bcad08b" +checksum = "da62f120a8a37763efb0cf8fdf264b884c7b8b9ac8660b900c8661030c00e6ba" dependencies = [ "bytes", "futures-channel", @@ -3658,6 +3653,7 @@ dependencies = [ "pin-project-lite", "socket2 0.5.7", "tokio", + "tower 0.4.13", "tower-service", "tracing", ] @@ -3933,7 +3929,6 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" dependencies = [ - "arbitrary", "equivalent", "hashbrown 0.14.5", "serde", @@ -4413,9 +4408,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.159" +version = "0.2.158" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" +checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" [[package]] name = "libloading" @@ -4471,7 +4466,7 @@ checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ "bitflags 2.6.0", "libc", - "redox_syscall 0.5.6", + "redox_syscall 0.5.4", ] [[package]] @@ -4839,9 +4834,9 @@ checksum = "1fafa6961cabd9c63bcd77a45d7e3b7f3b552b70417831fb0f56db717e72407e" [[package]] name = "multiaddr" -version = "0.18.2" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe6351f60b488e04c1d21bc69e56b89cb3f5e8f5d22557d6e8031bdfd79b6961" +checksum = "8b852bc02a2da5feed68cd14fa50d0774b92790a5bdbfa932a813926c8472070" dependencies = [ "arrayref", "byteorder", @@ -4852,7 +4847,7 @@ dependencies = [ "percent-encoding", "serde", "static_assertions", - "unsigned-varint 0.8.0", + "unsigned-varint", "url", ] @@ -4874,7 +4869,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "076d548d76a0e2a0d4ab471d0b1c36c577786dfc4471242035d97a12a735c492" dependencies = [ "core2", - "unsigned-varint 0.7.2", + "unsigned-varint", ] [[package]] @@ -5240,9 +5235,9 @@ checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" [[package]] name = "ordered-float" -version = "4.3.0" +version = "4.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d501f1a72f71d3c063a6bbc8f7271fa73aa09fe5d6283b6571e2ed176a2537" +checksum = "4a91171844676f8c7990ce64959210cd2eaef32c2612c50f9fae9f8aaa6065a6" dependencies = [ "num-traits", ] @@ -5351,7 +5346,7 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.6", + "redox_syscall 0.5.4", "smallvec", "windows-targets 0.52.6", ] @@ -5495,9 +5490,9 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.31" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "plain_hasher" @@ -5928,7 +5923,6 @@ dependencies = [ "libc", "rand_chacha 0.3.1", "rand_core 0.6.4", - "serde", ] [[package]] @@ -6054,9 +6048,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.6" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "355ae415ccd3a04315d3f8246e86d67689ea74d88d915576e1589a351062a13b" +checksum = "0884ad60e090bf1345b93da0a5de8923c93884cd03f40dfcfddd3b4bee661853" dependencies = [ "bitflags 2.6.0", ] @@ -9157,9 +9151,9 @@ dependencies = [ [[package]] name = "revm-inspectors" -version = "0.7.7" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd8e3bae0d5c824da0ac883e2521c5e83870d6521eeeccd4ee54266aa3cc1a51" +checksum = "b57b33a24b5b8b8efa1da3f60d44f02d6e649f06ef925d7780723ff14ff55321" dependencies = [ "alloy-primitives", "alloy-rpc-types-eth", @@ -9365,9 +9359,6 @@ name = "rustc-hash" version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" -dependencies = [ - "rand 0.8.5", -] [[package]] name = "rustc-hex" @@ -10186,9 +10177,9 @@ dependencies = [ [[package]] name = "syn-solidity" -version = "0.8.4" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27243031e95471f24108f05d00df2803932aaa7b9e461e69b95537d02613e3bf" +checksum = "4b95156f8b577cb59dc0b1df15c6f29a10afc5f8a7ac9786b0b5c68c19149278" dependencies = [ "paste", "proc-macro2", @@ -10329,18 +10320,18 @@ checksum = "a38c90d48152c236a3ab59271da4f4ae63d678c5d7ad6b7714d7cb9760be5e4b" [[package]] name = "thiserror" -version = "1.0.64" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" +checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.64" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" +checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", @@ -10601,9 +10592,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.22" +version = "0.22.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" +checksum = "3b072cee73c449a636ffd6f32bd8de3a9f7119139aff882f44943ce2986dc5cf" dependencies = [ "indexmap 2.5.0", "serde", @@ -10812,9 +10803,9 @@ dependencies = [ [[package]] name = "tracy-client" -version = "0.17.4" +version = "0.17.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "746b078c6a09ebfd5594609049e07116735c304671eaab06ce749854d23435bc" +checksum = "373db47331c3407b343538df77eea2516884a0b126cdfb4b135acfd400015dd7" dependencies = [ "loom", "once_cell", @@ -10824,9 +10815,9 @@ dependencies = [ [[package]] name = "tracy-client-sys" -version = "0.24.1" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68613466112302fdbeabc5fa55f7d57462a0b247d5a6b7d7e09401fb471a144d" +checksum = "49cf0064dcb31c99aa1244c1b93439359e53f72ed217eef5db50abd442241e9a" dependencies = [ "cc", ] @@ -11032,12 +11023,6 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6889a77d49f1f013504cec6bf97a2c730394adedaeb1deb5ea08949a50541105" -[[package]] -name = "unsigned-varint" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb066959b24b5196ae73cb057f45598450d2c5f71460e98c49b738086eff9c06" - [[package]] name = "untrusted" version = "0.9.0" @@ -11594,9 +11579,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.6.19" +version = "0.6.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c52ac009d615e79296318c1bcce2d422aaca15ad08515e344feeda07df67a587" +checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" dependencies = [ "memchr", ] From 9fa0cbaa7f4925655e64ae2e22abbf7cf214c24a Mon Sep 17 00:00:00 2001 From: Thomas Coratger Date: Wed, 25 Sep 2024 19:55:56 +0200 Subject: [PATCH 5/8] fix udeps --- Cargo.lock | 1 - crates/config/Cargo.toml | 1 - 2 files changed, 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 420de59ea67a..a8d3ccbbf032 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6621,7 +6621,6 @@ dependencies = [ "humantime-serde", "reth-network-peers", "reth-network-types", - "reth-primitives", "reth-prune-types", "reth-stages-types", "serde", diff --git a/crates/config/Cargo.toml b/crates/config/Cargo.toml index 55c0c676ad88..a186b8407a8a 100644 --- a/crates/config/Cargo.toml +++ b/crates/config/Cargo.toml @@ -27,5 +27,4 @@ eyre.workspace = true [dev-dependencies] tempfile.workspace = true reth-network-peers.workspace = true -reth-primitives.workspace = true alloy-primitives.workspace = true From 41729a678cf7d8d8482bc724c31ebcc71f365aa1 Mon Sep 17 00:00:00 2001 From: Thomas Coratger Date: Thu, 26 Sep 2024 12:21:05 +0200 Subject: [PATCH 6/8] fix conflicts --- crates/evm/Cargo.toml | 1 - crates/evm/execution-types/Cargo.toml | 2 -- crates/evm/execution-types/src/chain.rs | 10 ++-------- crates/evm/execution-types/src/execution_outcome.rs | 8 ++------ crates/evm/src/lib.rs | 4 +--- 5 files changed, 5 insertions(+), 20 deletions(-) diff --git a/crates/evm/Cargo.toml b/crates/evm/Cargo.toml index 217c4b16da6a..20070d421e97 100644 --- a/crates/evm/Cargo.toml +++ b/crates/evm/Cargo.toml @@ -32,7 +32,6 @@ auto_impl.workspace = true futures-util.workspace = true metrics = { workspace = true, optional = true } parking_lot = { workspace = true, optional = true } -alloy-primitives.workspace = true [dev-dependencies] parking_lot.workspace = true diff --git a/crates/evm/execution-types/Cargo.toml b/crates/evm/execution-types/Cargo.toml index 188d912c63f5..65426e3083b4 100644 --- a/crates/evm/execution-types/Cargo.toml +++ b/crates/evm/execution-types/Cargo.toml @@ -15,8 +15,6 @@ reth-primitives.workspace = true reth-execution-errors.workspace = true reth-trie.workspace = true -alloy-primitives.workspace = true - revm.workspace = true # alloy diff --git a/crates/evm/execution-types/src/chain.rs b/crates/evm/execution-types/src/chain.rs index c838a5f0fc4a..ae33d7d79f1f 100644 --- a/crates/evm/execution-types/src/chain.rs +++ b/crates/evm/execution-types/src/chain.rs @@ -2,19 +2,13 @@ use crate::ExecutionOutcome; use alloc::{borrow::Cow, collections::BTreeMap}; -use alloy_primitives::{Address, BlockHash, BlockNumber}; -use core::{fmt, ops::RangeInclusive}; -use reth_execution_errors::{BlockExecutionError, InternalBlockExecutionError}; -use reth_primitives::{ - BlockNumHash, ForkBlock, Receipt, SealedBlock, SealedBlockWithSenders, SealedHeader, - TransactionSigned, TransactionSignedEcRecovered, TxHash, use alloy_eips::{eip1898::ForkBlock, BlockNumHash}; use alloy_primitives::{Address, BlockHash, BlockNumber, TxHash}; use core::{fmt, ops::RangeInclusive}; use reth_execution_errors::{BlockExecutionError, InternalBlockExecutionError}; use reth_primitives::{ - Receipt, SealedBlock, SealedBlockWithSenders, SealedHeader, TransactionSigned, - TransactionSignedEcRecovered, + BlockNumHash, ForkBlock, Receipt, SealedBlock, SealedBlockWithSenders, SealedHeader, + TransactionSigned, TransactionSignedEcRecovered, TxHash, }; use reth_trie::updates::TrieUpdates; use revm::db::BundleState; diff --git a/crates/evm/execution-types/src/execution_outcome.rs b/crates/evm/execution-types/src/execution_outcome.rs index 412871f7bfa6..05f89a97be3f 100644 --- a/crates/evm/execution-types/src/execution_outcome.rs +++ b/crates/evm/execution-types/src/execution_outcome.rs @@ -1,10 +1,8 @@ use crate::BlockExecutionOutput; -use alloy_primitives::{Address, BlockNumber, Bloom}; +use alloy_primitives::{Address, BlockNumber, Bloom, Log, B256, U256}; use reth_primitives::{ logs_bloom, Account, Bytecode, Log, Receipt, Receipts, Requests, StorageEntry, B256, U256, }; -use alloy_primitives::{Address, BlockNumber, Bloom, Log, B256, U256}; -use reth_primitives::{logs_bloom, Account, Bytecode, Receipt, Receipts, Requests, StorageEntry}; use reth_trie::HashedPostState; use revm::{ db::{states::BundleState, BundleAccount}, @@ -370,10 +368,8 @@ impl From<(BlockExecutionOutput, BlockNumber)> for ExecutionOutcome { mod tests { use super::*; use alloy_eips::{eip6110::DepositRequest, eip7002::WithdrawalRequest}; - use alloy_primitives::{Address, FixedBytes, LogData}; - use reth_primitives::{Receipts, Request, Requests, TxType, B256}; use alloy_primitives::{Address, FixedBytes, LogData, B256}; - use reth_primitives::{Receipts, Request, Requests, TxType}; + use reth_primitives::{Receipts, Request, Requests, TxType, B256}; use std::collections::HashMap; #[test] diff --git a/crates/evm/src/lib.rs b/crates/evm/src/lib.rs index 051c27f2a437..1b2a714cf608 100644 --- a/crates/evm/src/lib.rs +++ b/crates/evm/src/lib.rs @@ -14,10 +14,8 @@ extern crate alloc; use core::ops::Deref; use crate::builder::RethEvmBuilder; -use alloy_primitives::Address; -use reth_primitives::{TransactionSigned, TransactionSignedEcRecovered, B256, U256}; use alloy_primitives::{Address, Bytes, B256, U256}; -use reth_primitives::{TransactionSigned, TransactionSignedEcRecovered}; +use reth_primitives::{TransactionSigned, TransactionSignedEcRecovered, B256, U256}; use reth_primitives_traits::BlockHeader; use revm::{Database, Evm, GetInspector}; use revm_primitives::{BlockEnv, CfgEnvWithHandlerCfg, Env, EnvWithHandlerCfg, SpecId, TxEnv}; From 0e91a76fc249b8293913924c44f302ccde5a9462 Mon Sep 17 00:00:00 2001 From: Thomas Coratger Date: Thu, 26 Sep 2024 12:27:28 +0200 Subject: [PATCH 7/8] fix conflicts --- crates/evm/execution-types/src/chain.rs | 4 ++-- crates/evm/execution-types/src/execution_outcome.rs | 4 +--- crates/evm/src/lib.rs | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/crates/evm/execution-types/src/chain.rs b/crates/evm/execution-types/src/chain.rs index ae33d7d79f1f..588bc832e688 100644 --- a/crates/evm/execution-types/src/chain.rs +++ b/crates/evm/execution-types/src/chain.rs @@ -7,8 +7,8 @@ use alloy_primitives::{Address, BlockHash, BlockNumber, TxHash}; use core::{fmt, ops::RangeInclusive}; use reth_execution_errors::{BlockExecutionError, InternalBlockExecutionError}; use reth_primitives::{ - BlockNumHash, ForkBlock, Receipt, SealedBlock, SealedBlockWithSenders, SealedHeader, - TransactionSigned, TransactionSignedEcRecovered, TxHash, + Receipt, SealedBlock, SealedBlockWithSenders, SealedHeader, TransactionSigned, + TransactionSignedEcRecovered, }; use reth_trie::updates::TrieUpdates; use revm::db::BundleState; diff --git a/crates/evm/execution-types/src/execution_outcome.rs b/crates/evm/execution-types/src/execution_outcome.rs index 05f89a97be3f..cf34b9960d11 100644 --- a/crates/evm/execution-types/src/execution_outcome.rs +++ b/crates/evm/execution-types/src/execution_outcome.rs @@ -1,8 +1,6 @@ use crate::BlockExecutionOutput; use alloy_primitives::{Address, BlockNumber, Bloom, Log, B256, U256}; -use reth_primitives::{ - logs_bloom, Account, Bytecode, Log, Receipt, Receipts, Requests, StorageEntry, B256, U256, -}; +use reth_primitives::{logs_bloom, Account, Bytecode, Receipt, Receipts, Requests, StorageEntry}; use reth_trie::HashedPostState; use revm::{ db::{states::BundleState, BundleAccount}, diff --git a/crates/evm/src/lib.rs b/crates/evm/src/lib.rs index 1b2a714cf608..6fcb3d9f8c3d 100644 --- a/crates/evm/src/lib.rs +++ b/crates/evm/src/lib.rs @@ -15,7 +15,7 @@ use core::ops::Deref; use crate::builder::RethEvmBuilder; use alloy_primitives::{Address, Bytes, B256, U256}; -use reth_primitives::{TransactionSigned, TransactionSignedEcRecovered, B256, U256}; +use reth_primitives::{TransactionSigned, TransactionSignedEcRecovered}; use reth_primitives_traits::BlockHeader; use revm::{Database, Evm, GetInspector}; use revm_primitives::{BlockEnv, CfgEnvWithHandlerCfg, Env, EnvWithHandlerCfg, SpecId, TxEnv}; From 8fb0531ded50483edf48013ae5507a46df7b428d Mon Sep 17 00:00:00 2001 From: Thomas Coratger Date: Thu, 26 Sep 2024 12:56:10 +0200 Subject: [PATCH 8/8] fix deps --- crates/evm/execution-types/src/execution_outcome.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/evm/execution-types/src/execution_outcome.rs b/crates/evm/execution-types/src/execution_outcome.rs index cf34b9960d11..3b21f36dd13c 100644 --- a/crates/evm/execution-types/src/execution_outcome.rs +++ b/crates/evm/execution-types/src/execution_outcome.rs @@ -367,7 +367,7 @@ mod tests { use super::*; use alloy_eips::{eip6110::DepositRequest, eip7002::WithdrawalRequest}; use alloy_primitives::{Address, FixedBytes, LogData, B256}; - use reth_primitives::{Receipts, Request, Requests, TxType, B256}; + use reth_primitives::{Receipts, Request, Requests, TxType}; use std::collections::HashMap; #[test]