From 4007b8e34e563d93e6c07856a95c8936d610f215 Mon Sep 17 00:00:00 2001 From: Roshan Date: Mon, 2 Sep 2024 21:39:44 +0800 Subject: [PATCH] chore: resolve merge conflicts --- .github/assets/check_wasm.sh | 2 + .github/workflows/integration.yml | 2 +- .github/workflows/unit.yml | 2 +- Cargo.lock | 2085 +++++++++++++---- Cargo.toml | 30 +- Dockerfile | 2 +- Makefile | 5 +- bin/reth/src/commands/debug_cmd/execution.rs | 2 +- .../commands/debug_cmd/in_memory_merkle.rs | 2 +- bin/reth/src/commands/debug_cmd/merkle.rs | 2 +- .../src/commands/debug_cmd/replay_engine.rs | 2 +- bsc.Dockerfile | 2 +- crates/blockchain-tree/src/chain.rs | 2 +- crates/bsc/chainspec/Cargo.toml | 8 +- crates/bsc/chainspec/src/bsc.rs | 31 +- crates/bsc/chainspec/src/bsc_chapel.rs | 18 +- crates/bsc/chainspec/src/bsc_rialto.rs | 2 +- crates/bsc/chainspec/src/lib.rs | 882 ++++--- crates/bsc/cli/Cargo.toml | 8 + crates/bsc/cli/src/chainspec.rs | 68 +- crates/bsc/cli/src/lib.rs | 3 + crates/bsc/consensus/src/lib.rs | 40 +- crates/bsc/engine/Cargo.toml | 1 + crates/bsc/engine/src/client.rs | 28 +- crates/bsc/engine/src/lib.rs | 29 +- crates/bsc/engine/src/task.rs | 26 +- crates/bsc/evm/src/execute.rs | 37 +- crates/bsc/evm/src/lib.rs | 8 +- crates/bsc/evm/src/post_execution.rs | 4 +- crates/bsc/node/Cargo.toml | 1 + crates/bsc/node/src/node.rs | 6 +- crates/chain-state/src/test_utils.rs | 1 + crates/chainspec/src/spec.rs | 7 +- crates/cli/commands/src/p2p/mod.rs | 2 +- crates/cli/commands/src/stage/drop.rs | 1 + crates/cli/commands/src/stage/run.rs | 1 - crates/consensus/beacon/Cargo.toml | 1 - crates/consensus/consensus/src/lib.rs | 8 +- crates/engine/service/src/service.rs | 11 +- crates/engine/tree/src/tree/mod.rs | 1 + crates/engine/util/src/reorg.rs | 1 + crates/evm/execution-types/src/execute.rs | 34 +- .../execution-types/src/execution_outcome.rs | 3 +- crates/evm/src/execute.rs | 2 +- crates/evm/src/system_calls.rs | 2 +- crates/exex/exex/src/backfill/job.rs | 3 +- crates/exex/exex/src/backfill/test_utils.rs | 1 + .../net/eth-wire-types/src/upgrade_status.rs | 8 +- crates/net/network-api/src/events.rs | 33 +- crates/net/network-api/src/lib.rs | 14 + crates/net/network/src/manager.rs | 41 +- crates/net/network/src/message.rs | 7 +- crates/net/network/src/network.rs | 16 +- crates/net/network/src/session/active.rs | 2 +- crates/node/builder/Cargo.toml | 9 +- crates/node/builder/src/launch/mod.rs | 5 +- crates/node/core/Cargo.toml | 7 +- crates/node/core/src/args/utils.rs | 40 +- crates/optimism/chainspec/src/lib.rs | 6 + crates/optimism/chainspec/src/opbnb.rs | 25 +- crates/optimism/chainspec/src/opbnb_qa.rs | 16 +- .../optimism/chainspec/src/opbnb_testnet.rs | 16 +- crates/optimism/cli/src/chainspec.rs | 12 +- crates/optimism/evm/src/execute.rs | 10 +- crates/optimism/rpc/src/eth/receipt.rs | 4 +- crates/primitives-traits/src/blob_sidecar.rs | 8 +- crates/primitives/Cargo.toml | 8 +- crates/primitives/src/lib.rs | 4 +- crates/primitives/src/parlia/snapshot.rs | 9 +- crates/primitives/src/parlia/vote.rs | 6 +- crates/primitives/src/system_contracts/mod.rs | 12 +- crates/rpc/rpc-eth-api/src/core.rs | 5 +- crates/rpc/rpc-eth-api/src/helpers/block.rs | 16 +- crates/rpc/rpc-eth-api/src/helpers/call.rs | 22 +- crates/rpc/rpc-eth-api/src/helpers/trace.rs | 8 +- .../rpc-eth-api/src/helpers/transaction.rs | 6 +- crates/rpc/rpc/src/debug.rs | 17 +- crates/stages/stages/src/stages/bodies.rs | 3 +- crates/stages/stages/src/stages/merkle.rs | 6 +- .../src/providers/blockchain_provider.rs | 33 +- .../src/providers/database/provider.rs | 15 +- crates/storage/provider/src/providers/mod.rs | 9 +- .../src/providers/static_file/manager.rs | 2 +- .../src/providers/static_file/writer.rs | 19 +- .../storage/provider/src/test_utils/blocks.rs | 5 +- .../storage/provider/src/test_utils/mock.rs | 10 +- .../storage/provider/src/test_utils/noop.rs | 15 +- crates/storage/provider/src/traits/full.rs | 5 +- crates/storage/provider/src/writer/mod.rs | 9 +- op.Dockerfile | 2 +- 90 files changed, 2696 insertions(+), 1248 deletions(-) diff --git a/.github/assets/check_wasm.sh b/.github/assets/check_wasm.sh index 5eaa9cd70..709cb6d01 100755 --- a/.github/assets/check_wasm.sh +++ b/.github/assets/check_wasm.sh @@ -1,6 +1,8 @@ #!/usr/bin/env bash set +e # Disable immediate exit on error +tool_chain=$1 + # Array of crates to compile crates=($(cargo metadata --format-version=1 --no-deps | jq -r '.packages[].name' | grep '^reth' | sort)) # Array of crates to exclude diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index bb244bfb0..f9b684f62 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -12,7 +12,7 @@ on: env: CARGO_TERM_COLOR: always SEED: rustethereumethereumrust - TOOL_CHAIN: "1.79" + TOOL_CHAIN: "1.80" concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} diff --git a/.github/workflows/unit.yml b/.github/workflows/unit.yml index 55bddd542..fd0556fae 100644 --- a/.github/workflows/unit.yml +++ b/.github/workflows/unit.yml @@ -12,7 +12,7 @@ on: env: CARGO_TERM_COLOR: always SEED: rustethereumethereumrust - TOOL_CHAIN: "1.79" + TOOL_CHAIN: "1.80" concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} diff --git a/Cargo.lock b/Cargo.lock index 10ed2226c..c8de3e1af 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -30,7 +30,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0" dependencies = [ "crypto-common", - "generic-array", + "generic-array 0.14.7", ] [[package]] @@ -103,9 +103,8 @@ checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] name = "alloy-chains" -version = "0.1.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb07629a5d0645d29f68d2fb6f4d0cf15c89ec0965be915f303967180929743f" +version = "0.1.18" +source = "git+https://github.com/bnb-chain/alloy-chains-rs.git?tag=v1.0.0#b7c5379cf47345181f8dce350acafb958f47152a" dependencies = [ "alloy-rlp", "arbitrary", @@ -118,8 +117,7 @@ dependencies = [ [[package]] name = "alloy-consensus" version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7198a527b4c4762cb88d54bcaeb0428f4298b72552c9c8ec4af614b4a4990c59" +source = "git+https://github.com/bnb-chain/alloy?rev=133e5b3dd8af4bc1ceb9018be42c156727eef619#133e5b3dd8af4bc1ceb9018be42c156727eef619" dependencies = [ "alloy-eips", "alloy-primitives 0.8.0", @@ -178,8 +176,7 @@ dependencies = [ [[package]] name = "alloy-eips" version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "159eab0e4e15b88571f55673af37314f4b8f17630dc1b393c3d70f2128a1d494" +source = "git+https://github.com/bnb-chain/alloy?rev=133e5b3dd8af4bc1ceb9018be42c156727eef619#133e5b3dd8af4bc1ceb9018be42c156727eef619" dependencies = [ "alloy-eip2930", "alloy-eip7702", @@ -205,6 +202,16 @@ dependencies = [ "serde", ] +[[package]] +name = "alloy-genesis" +version = "0.3.0" +source = "git+https://github.com/bnb-chain/alloy?rev=133e5b3dd8af4bc1ceb9018be42c156727eef619#133e5b3dd8af4bc1ceb9018be42c156727eef619" +dependencies = [ + "alloy-primitives 0.8.0", + "alloy-serde", + "serde", +] + [[package]] name = "alloy-json-abi" version = "0.8.0" @@ -231,15 +238,27 @@ dependencies = [ "tracing", ] +[[package]] +name = "alloy-json-rpc" +version = "0.3.0" +source = "git+https://github.com/bnb-chain/alloy?rev=133e5b3dd8af4bc1ceb9018be42c156727eef619#133e5b3dd8af4bc1ceb9018be42c156727eef619" +dependencies = [ + "alloy-primitives 0.8.0", + "alloy-sol-types", + "serde", + "serde_json", + "thiserror", + "tracing", +] + [[package]] name = "alloy-network" version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b80851d1697fc4fa2827998e3ee010a3d1fc59c7d25e87070840169fcf465832" +source = "git+https://github.com/bnb-chain/alloy?rev=133e5b3dd8af4bc1ceb9018be42c156727eef619#133e5b3dd8af4bc1ceb9018be42c156727eef619" dependencies = [ "alloy-consensus", "alloy-eips", - "alloy-json-rpc", + "alloy-json-rpc 0.3.0 (git+https://github.com/bnb-chain/alloy?rev=133e5b3dd8af4bc1ceb9018be42c156727eef619)", "alloy-network-primitives", "alloy-primitives 0.8.0", "alloy-rpc-types-eth", @@ -255,8 +274,7 @@ dependencies = [ [[package]] name = "alloy-network-primitives" version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d76a2336889f3d0624b18213239d27f4f34eb476eb35bef22f6a8cc24e0c0078" +source = "git+https://github.com/bnb-chain/alloy?rev=133e5b3dd8af4bc1ceb9018be42c156727eef619#133e5b3dd8af4bc1ceb9018be42c156727eef619" dependencies = [ "alloy-primitives 0.8.0", "alloy-serde", @@ -269,7 +287,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2657dae91ae61ed6cdd4c58b7e09330de934eea4e14d2f54f72f2a6720b23437" dependencies = [ - "alloy-genesis", + "alloy-genesis 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "alloy-primitives 0.8.0", "k256", "serde_json", @@ -286,7 +304,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ccb3ead547f4532bc8af961649942f0b9c16ee9226e26caa3f38420651cc0bf4" dependencies = [ "alloy-rlp", - "bytes", + "bytes 1.7.1", "cfg-if", "const-hex", "derive_more 0.99.18", @@ -309,7 +327,7 @@ checksum = "a767e59c86900dd7c3ce3ecef04f3ace5ac9631ee150beb8b7d22f7fa3bbb2d7" dependencies = [ "alloy-rlp", "arbitrary", - "bytes", + "bytes 1.7.1", "cfg-if", "const-hex", "derive_arbitrary", @@ -330,24 +348,23 @@ dependencies = [ [[package]] name = "alloy-provider" version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2d2a195caa6707f5ce13905794865765afc6d9ea92c3a56e3a973c168d703bc" +source = "git+https://github.com/bnb-chain/alloy?rev=133e5b3dd8af4bc1ceb9018be42c156727eef619#133e5b3dd8af4bc1ceb9018be42c156727eef619" dependencies = [ "alloy-chains", "alloy-consensus", "alloy-eips", - "alloy-json-rpc", + "alloy-json-rpc 0.3.0 (git+https://github.com/bnb-chain/alloy?rev=133e5b3dd8af4bc1ceb9018be42c156727eef619)", "alloy-network", "alloy-network-primitives", "alloy-primitives 0.8.0", - "alloy-pubsub", - "alloy-rpc-client", - "alloy-rpc-types-admin", - "alloy-rpc-types-engine", + "alloy-pubsub 0.3.0 (git+https://github.com/bnb-chain/alloy?rev=133e5b3dd8af4bc1ceb9018be42c156727eef619)", + "alloy-rpc-client 0.3.0 (git+https://github.com/bnb-chain/alloy?rev=133e5b3dd8af4bc1ceb9018be42c156727eef619)", + "alloy-rpc-types-admin 0.3.0 (git+https://github.com/bnb-chain/alloy?rev=133e5b3dd8af4bc1ceb9018be42c156727eef619)", + "alloy-rpc-types-engine 0.3.0 (git+https://github.com/bnb-chain/alloy?rev=133e5b3dd8af4bc1ceb9018be42c156727eef619)", "alloy-rpc-types-eth", - "alloy-transport", + "alloy-transport 0.3.0 (git+https://github.com/bnb-chain/alloy?rev=133e5b3dd8af4bc1ceb9018be42c156727eef619)", "alloy-transport-http", - "alloy-transport-ws", + "alloy-transport-ws 0.3.0 (git+https://github.com/bnb-chain/alloy?rev=133e5b3dd8af4bc1ceb9018be42c156727eef619)", "async-stream", "async-trait", "auto_impl", @@ -356,7 +373,7 @@ dependencies = [ "futures-utils-wasm", "lru", "pin-project", - "reqwest", + "reqwest 0.12.7", "serde", "serde_json", "thiserror", @@ -371,9 +388,27 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4c59e13200322138fe4279b4676b0d78c4f55502de127f5a448495d3ddfaa43" dependencies = [ - "alloy-json-rpc", + "alloy-json-rpc 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "alloy-primitives 0.8.0", + "alloy-transport 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "bimap", + "futures", + "serde", + "serde_json", + "tokio", + "tokio-stream", + "tower", + "tracing", +] + +[[package]] +name = "alloy-pubsub" +version = "0.3.0" +source = "git+https://github.com/bnb-chain/alloy?rev=133e5b3dd8af4bc1ceb9018be42c156727eef619#133e5b3dd8af4bc1ceb9018be42c156727eef619" +dependencies = [ + "alloy-json-rpc 0.3.0 (git+https://github.com/bnb-chain/alloy?rev=133e5b3dd8af4bc1ceb9018be42c156727eef619)", "alloy-primitives 0.8.0", - "alloy-transport", + "alloy-transport 0.3.0 (git+https://github.com/bnb-chain/alloy?rev=133e5b3dd8af4bc1ceb9018be42c156727eef619)", "bimap", "futures", "serde", @@ -392,7 +427,7 @@ checksum = "26154390b1d205a4a7ac7352aa2eb4f81f391399d4e2f546fb81a2f8bb383f62" dependencies = [ "alloy-rlp-derive", "arrayvec", - "bytes", + "bytes 1.7.1", ] [[package]] @@ -412,15 +447,33 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed31cdba2b23d71c555505b06674f8e7459496abfd7f4875d268434ef5a99ee6" dependencies = [ - "alloy-json-rpc", + "alloy-json-rpc 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "alloy-transport 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "alloy-transport-http", + "futures", + "pin-project", + "serde", + "serde_json", + "tokio", + "tokio-stream", + "tower", + "tracing", +] + +[[package]] +name = "alloy-rpc-client" +version = "0.3.0" +source = "git+https://github.com/bnb-chain/alloy?rev=133e5b3dd8af4bc1ceb9018be42c156727eef619#133e5b3dd8af4bc1ceb9018be42c156727eef619" +dependencies = [ + "alloy-json-rpc 0.3.0 (git+https://github.com/bnb-chain/alloy?rev=133e5b3dd8af4bc1ceb9018be42c156727eef619)", "alloy-primitives 0.8.0", - "alloy-pubsub", - "alloy-transport", + "alloy-pubsub 0.3.0 (git+https://github.com/bnb-chain/alloy?rev=133e5b3dd8af4bc1ceb9018be42c156727eef619)", + "alloy-transport 0.3.0 (git+https://github.com/bnb-chain/alloy?rev=133e5b3dd8af4bc1ceb9018be42c156727eef619)", "alloy-transport-http", - "alloy-transport-ws", + "alloy-transport-ws 0.3.0 (git+https://github.com/bnb-chain/alloy?rev=133e5b3dd8af4bc1ceb9018be42c156727eef619)", "futures", "pin-project", - "reqwest", + "reqwest 0.12.7", "serde", "serde_json", "tokio", @@ -436,7 +489,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2d758f65aa648491c6358335c578de45cd7de6fdf2877c3cef61f2c9bebea21" dependencies = [ - "alloy-rpc-types-engine", + "alloy-rpc-types-engine 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "alloy-rpc-types-eth", "alloy-rpc-types-trace", "alloy-serde", @@ -449,7 +502,18 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7e41c33bbddaec71ca1bd7a4df38f95f408ef4fa3b3c29a7e9cc8d0e43be5fbe" dependencies = [ - "alloy-genesis", + "alloy-genesis 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "alloy-primitives 0.8.0", + "serde", + "serde_json", +] + +[[package]] +name = "alloy-rpc-types-admin" +version = "0.3.0" +source = "git+https://github.com/bnb-chain/alloy?rev=133e5b3dd8af4bc1ceb9018be42c156727eef619#133e5b3dd8af4bc1ceb9018be42c156727eef619" +dependencies = [ + "alloy-genesis 0.3.0 (git+https://github.com/bnb-chain/alloy?rev=133e5b3dd8af4bc1ceb9018be42c156727eef619)", "alloy-primitives 0.8.0", "serde", "serde_json", @@ -474,7 +538,7 @@ checksum = "3173bf0239a59d3616f4f4ab1682de25dd30b13fb8f52bf7ee7503729354f3c4" dependencies = [ "alloy-eips", "alloy-primitives 0.8.0", - "alloy-rpc-types-engine", + "alloy-rpc-types-engine 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde", "serde_with", "thiserror", @@ -499,11 +563,25 @@ dependencies = [ "thiserror", ] +[[package]] +name = "alloy-rpc-types-engine" +version = "0.3.0" +source = "git+https://github.com/bnb-chain/alloy?rev=133e5b3dd8af4bc1ceb9018be42c156727eef619#133e5b3dd8af4bc1ceb9018be42c156727eef619" +dependencies = [ + "alloy-consensus", + "alloy-eips", + "alloy-primitives 0.8.0", + "alloy-rlp", + "alloy-rpc-types-eth", + "alloy-serde", + "serde", + "thiserror", +] + [[package]] name = "alloy-rpc-types-eth" version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0ba05d6ee4db0d89113294a614137940f79abfc2c40a9a3bee2995660358776" +source = "git+https://github.com/bnb-chain/alloy?rev=133e5b3dd8af4bc1ceb9018be42c156727eef619#133e5b3dd8af4bc1ceb9018be42c156727eef619" dependencies = [ "alloy-consensus", "alloy-eips", @@ -562,8 +640,7 @@ dependencies = [ [[package]] name = "alloy-serde" version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfd260ede54f0b53761fdd04133acc10ae70427f66a69aa9590529bbd066cd58" +source = "git+https://github.com/bnb-chain/alloy?rev=133e5b3dd8af4bc1ceb9018be42c156727eef619#133e5b3dd8af4bc1ceb9018be42c156727eef619" dependencies = [ "alloy-primitives 0.8.0", "arbitrary", @@ -574,8 +651,7 @@ dependencies = [ [[package]] name = "alloy-signer" version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5193ee6b370b89db154d7dc40c6a8e6ce11213865baaf2b418a9f2006be762" +source = "git+https://github.com/bnb-chain/alloy?rev=133e5b3dd8af4bc1ceb9018be42c156727eef619#133e5b3dd8af4bc1ceb9018be42c156727eef619" dependencies = [ "alloy-primitives 0.8.0", "async-trait", @@ -588,8 +664,7 @@ dependencies = [ [[package]] name = "alloy-signer-local" version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf6b19bbb231c7f941af07f363d4c74d356dfcdfcd7dfa85a41a504ae856a6d5" +source = "git+https://github.com/bnb-chain/alloy?rev=133e5b3dd8af4bc1ceb9018be42c156727eef619#133e5b3dd8af4bc1ceb9018be42c156727eef619" dependencies = [ "alloy-consensus", "alloy-network", @@ -679,7 +754,25 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "454220c714857cf68af87d788d1f0638ad8766268b94f6a49fed96cbc2ab382c" dependencies = [ - "alloy-json-rpc", + "alloy-json-rpc 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "base64 0.22.1", + "futures-util", + "futures-utils-wasm", + "serde", + "serde_json", + "thiserror", + "tokio", + "tower", + "tracing", + "url", +] + +[[package]] +name = "alloy-transport" +version = "0.3.0" +source = "git+https://github.com/bnb-chain/alloy?rev=133e5b3dd8af4bc1ceb9018be42c156727eef619#133e5b3dd8af4bc1ceb9018be42c156727eef619" +dependencies = [ + "alloy-json-rpc 0.3.0 (git+https://github.com/bnb-chain/alloy?rev=133e5b3dd8af4bc1ceb9018be42c156727eef619)", "base64 0.22.1", "futures-util", "futures-utils-wasm", @@ -695,12 +788,11 @@ dependencies = [ [[package]] name = "alloy-transport-http" version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "377f2353d7fea03a2dba6b9ffbb7d610402c040dd5700d1fae8b9ec2673eed9b" +source = "git+https://github.com/bnb-chain/alloy?rev=133e5b3dd8af4bc1ceb9018be42c156727eef619#133e5b3dd8af4bc1ceb9018be42c156727eef619" dependencies = [ - "alloy-json-rpc", - "alloy-transport", - "reqwest", + "alloy-json-rpc 0.3.0 (git+https://github.com/bnb-chain/alloy?rev=133e5b3dd8af4bc1ceb9018be42c156727eef619)", + "alloy-transport 0.3.0 (git+https://github.com/bnb-chain/alloy?rev=133e5b3dd8af4bc1ceb9018be42c156727eef619)", + "reqwest 0.12.7", "serde_json", "tower", "tracing", @@ -713,10 +805,10 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8653c47dcc30326fb09a34140e8800fa21987fc52453de6cfcdd5c7b8b6e9886" dependencies = [ - "alloy-json-rpc", - "alloy-pubsub", - "alloy-transport", - "bytes", + "alloy-json-rpc 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "alloy-pubsub 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "alloy-transport 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 1.7.1", "futures", "interprocess", "pin-project", @@ -732,11 +824,28 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26d43ba8e9a3a7fef626d5fd93cc87ff2d6d2c81acfb866f068b3dce31dda060" dependencies = [ - "alloy-pubsub", - "alloy-transport", + "alloy-pubsub 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "alloy-transport 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "futures", + "http 1.1.0", + "rustls 0.23.12", + "serde_json", + "tokio", + "tokio-tungstenite", + "tracing", + "ws_stream_wasm", +] + +[[package]] +name = "alloy-transport-ws" +version = "0.3.0" +source = "git+https://github.com/bnb-chain/alloy?rev=133e5b3dd8af4bc1ceb9018be42c156727eef619#133e5b3dd8af4bc1ceb9018be42c156727eef619" +dependencies = [ + "alloy-pubsub 0.3.0 (git+https://github.com/bnb-chain/alloy?rev=133e5b3dd8af4bc1ceb9018be42c156727eef619)", + "alloy-transport 0.3.0 (git+https://github.com/bnb-chain/alloy?rev=133e5b3dd8af4bc1ceb9018be42c156727eef619)", "futures", - "http", - "rustls", + "http 1.1.0", + "rustls 0.23.12", "serde_json", "tokio", "tokio-tungstenite", @@ -785,6 +894,15 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" +[[package]] +name = "anomaly" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "550632e31568ae1a5f47998c3aa48563030fc49b9ec91913ca337cf64fbc5ccb" +dependencies = [ + "backtrace", +] + [[package]] name = "anstream" version = "0.6.15" @@ -863,6 +981,35 @@ dependencies = [ "derive_arbitrary", ] +[[package]] +name = "ark-bls12-381" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c775f0d12169cba7aae4caeb547bb6a50781c7449a8aa53793827c9ec4abf488" +dependencies = [ + "ark-ec", + "ark-ff 0.4.2", + "ark-serialize 0.4.2", + "ark-std 0.4.0", +] + +[[package]] +name = "ark-ec" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" +dependencies = [ + "ark-ff 0.4.2", + "ark-poly", + "ark-serialize 0.4.2", + "ark-std 0.4.0", + "derivative", + "hashbrown 0.13.2", + "itertools 0.10.5", + "num-traits", + "zeroize", +] + [[package]] name = "ark-ff" version = "0.3.0" @@ -946,6 +1093,19 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "ark-poly" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" +dependencies = [ + "ark-ff 0.4.2", + "ark-serialize 0.4.2", + "ark-std 0.4.0", + "derivative", + "hashbrown 0.13.2", +] + [[package]] name = "ark-serialize" version = "0.3.0" @@ -962,11 +1122,23 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" dependencies = [ + "ark-serialize-derive", "ark-std 0.4.0", "digest 0.10.7", "num-bigint", ] +[[package]] +name = "ark-serialize-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "ark-std" version = "0.3.0" @@ -1108,7 +1280,7 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0aef7712851e524f35fbbb74fa6599c5cd8692056a1c36f9ca0d2001b670e7e5" dependencies = [ - "hex", + "hex 0.4.3", "num", ] @@ -1279,6 +1451,12 @@ dependencies = [ "dyn_size_of", ] +[[package]] +name = "bitset" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd450435a044ff3a192c9b0063e9f612ee3e2b2e23388332bc3aada13e3f7f6b" + [[package]] name = "bitvec" version = "1.0.1" @@ -1292,13 +1470,25 @@ dependencies = [ "wyz", ] +[[package]] +name = "block-buffer" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" +dependencies = [ + "block-padding 0.1.5", + "byte-tools", + "byteorder", + "generic-array 0.12.4", +] + [[package]] name = "block-buffer" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" dependencies = [ - "generic-array", + "generic-array 0.14.7", ] [[package]] @@ -1307,7 +1497,16 @@ version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ - "generic-array", + "generic-array 0.14.7", +] + +[[package]] +name = "block-padding" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" +dependencies = [ + "byte-tools", ] [[package]] @@ -1316,7 +1515,24 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8894febbff9f758034a5b8e12d87918f56dfc64a8e1fe757d65e29041538d93" dependencies = [ - "generic-array", + "generic-array 0.14.7", +] + +[[package]] +name = "bls_on_arkworks" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4107cadb31de0d0c1282dd57efe395706b1d81feb697799871f95c3324af7c44" +dependencies = [ + "ark-bls12-381", + "ark-ec", + "ark-ff 0.4.2", + "ark-serialize 0.4.2", + "ark-std 0.4.0", + "hkdf", + "hmac 0.12.1", + "libm", + "sha2 0.10.8", ] [[package]] @@ -1428,7 +1644,7 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.76", - "synstructure", + "synstructure 0.13.1", ] [[package]] @@ -1509,6 +1725,17 @@ dependencies = [ "tinyvec", ] +[[package]] +name = "bstr" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223" +dependencies = [ + "lazy_static", + "memchr", + "regex-automata 0.1.10", +] + [[package]] name = "bstr" version = "1.10.0" @@ -1532,6 +1759,12 @@ version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" +[[package]] +name = "byte-tools" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" + [[package]] name = "bytemuck" version = "1.17.1" @@ -1558,6 +1791,12 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" +[[package]] +name = "bytes" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38" + [[package]] name = "bytes" version = "1.7.1" @@ -1576,7 +1815,7 @@ dependencies = [ "blst", "cc", "glob", - "hex", + "hex 0.4.3", "libc", "once_cell", "serde", @@ -1706,7 +1945,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" dependencies = [ "ciborium-io", - "half", + "half 2.4.1", ] [[package]] @@ -1813,11 +2052,11 @@ dependencies = [ "bs58", "const-hex", "digest 0.10.7", - "generic-array", + "generic-array 0.14.7", "ripemd", "serde", "sha2 0.10.8", - "sha3", + "sha3 0.10.8", "thiserror", ] @@ -1833,49 +2072,175 @@ version = "4.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" dependencies = [ - "bytes", + "bytes 1.7.1", "memchr", ] [[package]] -name = "comfy-table" -version = "7.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b34115915337defe99b2aff5c2ce6771e5fbc4079f4b506301f5cf394c8452f7" +name = "cometbft" +version = "0.1.0-alpha.2" +source = "git+https://github.com/bnb-chain/greenfield-cometbft-rs.git?rev=1282547#12825470f8b2df8e960e39a84ad4c9921492f512" dependencies = [ - "crossterm", - "strum", - "strum_macros", - "unicode-width", + "bytes 1.7.1", + "cometbft-proto", + "digest 0.10.7", + "ed25519 2.2.3", + "ed25519-consensus", + "flex-error", + "futures", + "num-traits", + "once_cell", + "prost 0.12.6", + "prost-types 0.12.6", + "serde", + "serde_bytes", + "serde_json", + "serde_repr", + "sha2 0.10.8", + "signature 2.2.0", + "subtle", + "subtle-encoding", + "time", + "zeroize", ] [[package]] -name = "compact_str" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f86b9c4c00838774a6d902ef931eff7470720c51d90c2e32cfe15dc304737b3f" +name = "cometbft-config" +version = "0.1.0-alpha.2" +source = "git+https://github.com/bnb-chain/greenfield-cometbft-rs.git?rev=1282547#12825470f8b2df8e960e39a84ad4c9921492f512" dependencies = [ - "castaway", - "cfg-if", - "itoa", - "ryu", - "static_assertions", + "cometbft", + "flex-error", + "serde", + "serde_json", + "toml 0.8.19", + "url", ] [[package]] -name = "concat-kdf" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d72c1252426a83be2092dd5884a5f6e3b8e7180f6891b6263d2c21b92ec8816" +name = "cometbft-light-client" +version = "0.1.0-alpha.2" +source = "git+https://github.com/bnb-chain/greenfield-cometbft-rs.git?rev=1282547#12825470f8b2df8e960e39a84ad4c9921492f512" dependencies = [ - "digest 0.10.7", -] - -[[package]] -name = "concurrent-queue" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" + "cometbft", + "cometbft-light-client-verifier", + "cometbft-rpc", + "contracts", + "crossbeam-channel", + "derive_more 0.99.18", + "flex-error", + "futures", + "regex", + "serde", + "serde_cbor", + "serde_derive", + "serde_json", + "static_assertions", + "time", + "tokio", + "tracing", +] + +[[package]] +name = "cometbft-light-client-verifier" +version = "0.1.0-alpha.2" +source = "git+https://github.com/bnb-chain/greenfield-cometbft-rs.git?rev=1282547#12825470f8b2df8e960e39a84ad4c9921492f512" +dependencies = [ + "cometbft", + "derive_more 0.99.18", + "flex-error", + "serde", + "time", +] + +[[package]] +name = "cometbft-proto" +version = "0.1.0-alpha.2" +source = "git+https://github.com/bnb-chain/greenfield-cometbft-rs.git?rev=1282547#12825470f8b2df8e960e39a84ad4c9921492f512" +dependencies = [ + "bytes 1.7.1", + "flex-error", + "num-derive 0.4.2", + "num-traits", + "prost 0.12.6", + "prost-types 0.12.6", + "serde", + "serde_bytes", + "subtle-encoding", + "time", +] + +[[package]] +name = "cometbft-rpc" +version = "0.1.0-alpha.2" +source = "git+https://github.com/bnb-chain/greenfield-cometbft-rs.git?rev=1282547#12825470f8b2df8e960e39a84ad4c9921492f512" +dependencies = [ + "async-trait", + "bytes 1.7.1", + "cometbft", + "cometbft-config", + "cometbft-proto", + "flex-error", + "futures", + "getrandom 0.2.15", + "peg", + "pin-project", + "rand 0.8.5", + "reqwest 0.11.27", + "semver 1.0.23", + "serde", + "serde_bytes", + "serde_json", + "subtle", + "subtle-encoding", + "thiserror", + "time", + "tokio", + "tracing", + "url", + "uuid", + "walkdir", +] + +[[package]] +name = "comfy-table" +version = "7.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b34115915337defe99b2aff5c2ce6771e5fbc4079f4b506301f5cf394c8452f7" +dependencies = [ + "crossterm", + "strum", + "strum_macros", + "unicode-width", +] + +[[package]] +name = "compact_str" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f86b9c4c00838774a6d902ef931eff7470720c51d90c2e32cfe15dc304737b3f" +dependencies = [ + "castaway", + "cfg-if", + "itoa", + "ryu", + "static_assertions", +] + +[[package]] +name = "concat-kdf" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d72c1252426a83be2092dd5884a5f6e3b8e7180f6891b6263d2c21b92ec8816" +dependencies = [ + "digest 0.10.7", +] + +[[package]] +name = "concurrent-queue" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" dependencies = [ "crossbeam-utils", ] @@ -1900,7 +2265,7 @@ checksum = "94fb8a24a26d37e1ffd45343323dc9fe6654ceea44c12f2fcb3d7ac29e610bc6" dependencies = [ "cfg-if", "cpufeatures", - "hex", + "hex 0.4.3", "proptest", "serde", ] @@ -1932,6 +2297,17 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "contracts" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1d1429e3bd78171c65aa010eabcdf8f863ba3254728dbfb0ad4b1545beac15c" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "convert_case" version = "0.4.0" @@ -2123,7 +2499,7 @@ version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ - "generic-array", + "generic-array 0.14.7", "rand_core 0.6.4", "subtle", "zeroize", @@ -2135,7 +2511,7 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "generic-array", + "generic-array 0.14.7", "rand_core 0.6.4", "typenum", ] @@ -2146,7 +2522,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" dependencies = [ - "generic-array", + "generic-array 0.14.7", "subtle", ] @@ -2194,6 +2570,19 @@ dependencies = [ "serde_derive", ] +[[package]] +name = "curve25519-dalek" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61" +dependencies = [ + "byteorder", + "digest 0.9.0", + "rand_core 0.5.1", + "subtle", + "zeroize", +] + [[package]] name = "curve25519-dalek" version = "4.1.3" @@ -2221,6 +2610,19 @@ dependencies = [ "syn 2.0.76", ] +[[package]] +name = "curve25519-dalek-ng" +version = "4.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c359b7249347e46fb28804470d071c921156ad62b3eef5d34e2ba867533dec8" +dependencies = [ + "byteorder", + "digest 0.9.0", + "rand_core 0.6.4", + "subtle-ng", + "zeroize", +] + [[package]] name = "darling" version = "0.20.10" @@ -2411,13 +2813,22 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "digest" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" +dependencies = [ + "generic-array 0.12.4", +] + [[package]] name = "digest" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" dependencies = [ - "generic-array", + "generic-array 0.14.7", ] [[package]] @@ -2490,7 +2901,7 @@ dependencies = [ "fnv", "futures", "hashlink", - "hex", + "hex 0.4.3", "hkdf", "lazy_static", "libp2p-identity", @@ -2558,10 +2969,20 @@ dependencies = [ "digest 0.10.7", "elliptic-curve", "rfc6979", - "signature", + "signature 2.2.0", "spki", ] +[[package]] +name = "ed25519" +version = "1.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7" +dependencies = [ + "serde", + "signature 1.6.4", +] + [[package]] name = "ed25519" version = "2.2.3" @@ -2569,7 +2990,35 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" dependencies = [ "pkcs8", - "signature", + "signature 2.2.0", +] + +[[package]] +name = "ed25519-consensus" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c8465edc8ee7436ffea81d21a019b16676ee3db267aa8d5a8d729581ecf998b" +dependencies = [ + "curve25519-dalek-ng", + "hex 0.4.3", + "rand_core 0.6.4", + "sha2 0.9.9", + "zeroize", +] + +[[package]] +name = "ed25519-dalek" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" +dependencies = [ + "curve25519-dalek 3.2.0", + "ed25519 1.5.3", + "rand 0.7.3", + "serde", + "serde_bytes", + "sha2 0.9.9", + "zeroize", ] [[package]] @@ -2578,8 +3027,8 @@ version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4a3daa8e81a3963a60642bcc1f90a670680bd4a77535faa384e9d1c79d620871" dependencies = [ - "curve25519-dalek", - "ed25519", + "curve25519-dalek 4.1.3", + "ed25519 2.2.3", "rand_core 0.6.4", "serde", "sha2 0.10.8", @@ -2589,7 +3038,7 @@ dependencies = [ [[package]] name = "ef-tests" -version = "1.0.6" +version = "1.0.3" dependencies = [ "alloy-rlp", "rayon", @@ -2622,7 +3071,7 @@ dependencies = [ "crypto-bigint", "digest 0.10.7", "ff", - "generic-array", + "generic-array 0.14.7", "group", "pkcs8", "rand_core 0.6.4", @@ -2637,6 +3086,15 @@ version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" +[[package]] +name = "encoding_rs" +version = "0.8.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" +dependencies = [ + "cfg-if", +] + [[package]] name = "endian-type" version = "0.1.2" @@ -2651,15 +3109,15 @@ checksum = "972070166c68827e64bd1ebc8159dd8e32d9bc2da7ebe8f20b61308f7974ad30" dependencies = [ "alloy-rlp", "base64 0.21.7", - "bytes", - "ed25519-dalek", - "hex", + "bytes 1.7.1", + "ed25519-dalek 2.1.1", + "hex 0.4.3", "k256", "log", "rand 0.8.5", "secp256k1", "serde", - "sha3", + "sha3 0.10.8", "zeroize", ] @@ -2716,7 +3174,7 @@ dependencies = [ "clap", "eyre", "futures-util", - "reqwest", + "reqwest 0.12.7", "reth", "reth-node-ethereum", "serde", @@ -2774,7 +3232,7 @@ dependencies = [ name = "example-custom-engine-types" version = "0.0.0" dependencies = [ - "alloy-genesis", + "alloy-genesis 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "eyre", "reth", "reth-basic-payload-builder", @@ -2796,7 +3254,7 @@ dependencies = [ name = "example-custom-evm" version = "0.0.0" dependencies = [ - "alloy-genesis", + "alloy-genesis 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "eyre", "reth", "reth-chainspec", @@ -2975,7 +3433,7 @@ dependencies = [ name = "example-stateful-precompile" version = "0.0.0" dependencies = [ - "alloy-genesis", + "alloy-genesis 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "eyre", "parking_lot 0.12.3", "reth", @@ -3009,6 +3467,34 @@ dependencies = [ "once_cell", ] +[[package]] +name = "failure" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d32e9bd16cc02eae7db7ef620b392808b89f6a5e16bb3497d159c6b92a0f4f86" +dependencies = [ + "backtrace", + "failure_derive", +] + +[[package]] +name = "failure_derive" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", + "synstructure 0.12.6", +] + +[[package]] +name = "fake-simd" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" + [[package]] name = "fast-float" version = "0.2.0" @@ -3038,7 +3524,7 @@ checksum = "139834ddba373bbdd213dffe02c8d110508dcf1726c2be27e8d1f7d7e1856418" dependencies = [ "arrayvec", "auto_impl", - "bytes", + "bytes 1.7.1", ] [[package]] @@ -3101,6 +3587,15 @@ dependencies = [ "miniz_oxide 0.8.0", ] +[[package]] +name = "flex-error" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c606d892c9de11507fa0dcffc116434f94e105d0bbdc4e405b61519464c49d7b" +dependencies = [ + "paste", +] + [[package]] name = "fnv" version = "1.0.7" @@ -3248,6 +3743,15 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42012b0f064e01aa58b545fe3727f90f7dd4020f4a3ea735b50344965f5a57e9" +[[package]] +name = "generic-array" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" +dependencies = [ + "typenum", +] + [[package]] name = "generic-array" version = "0.14.7" @@ -3289,7 +3793,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0d8a4362ccb29cb0b265253fb0a2728f592895ee6854fd9bc13f2ffda266ff1" dependencies = [ - "opaque-debug", + "opaque-debug 0.3.1", "polyval", ] @@ -3315,7 +3819,7 @@ dependencies = [ "futures-core", "futures-sink", "gloo-utils", - "http", + "http 1.1.0", "js-sys", "pin-project", "serde", @@ -3362,6 +3866,25 @@ dependencies = [ "subtle", ] +[[package]] +name = "h2" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" +dependencies = [ + "bytes 1.7.1", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http 0.2.12", + "indexmap 2.4.0", + "slab", + "tokio", + "tokio-util", + "tracing", +] + [[package]] name = "h2" version = "0.4.6" @@ -3369,11 +3892,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" dependencies = [ "atomic-waker", - "bytes", + "bytes 1.7.1", "fnv", "futures-core", "futures-sink", - "http", + "http 1.1.0", "indexmap 2.4.0", "slab", "tokio", @@ -3381,6 +3904,12 @@ dependencies = [ "tracing", ] +[[package]] +name = "half" +version = "1.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b43ede17f21864e81be2fa654110bf1e793774238d86ef8555c37e6519c0403" + [[package]] name = "half" version = "2.4.1" @@ -3408,6 +3937,9 @@ name = "hashbrown" version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash", +] [[package]] name = "hashbrown" @@ -3463,6 +3995,12 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" +[[package]] +name = "hex" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "805026a5d0141ffc30abb3be3173848ad46a1b1664fe632428479619a3644d77" + [[package]] name = "hex" version = "0.4.3" @@ -3513,7 +4051,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17ea0a1394df5b6574da6e0c1ade9e78868c9fb0a4e5ef4428e32da4676b85b1" dependencies = [ "digest 0.9.0", - "generic-array", + "generic-array 0.14.7", "hmac 0.8.1", ] @@ -3528,25 +4066,47 @@ dependencies = [ "winapi", ] +[[package]] +name = "http" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" +dependencies = [ + "bytes 1.7.1", + "fnv", + "itoa", +] + [[package]] name = "http" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" dependencies = [ - "bytes", + "bytes 1.7.1", "fnv", "itoa", ] +[[package]] +name = "http-body" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +dependencies = [ + "bytes 1.7.1", + "http 0.2.12", + "pin-project-lite", +] + [[package]] name = "http-body" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" dependencies = [ - "bytes", - "http", + "bytes 1.7.1", + "http 1.1.0", ] [[package]] @@ -3555,10 +4115,10 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" dependencies = [ - "bytes", + "bytes 1.7.1", "futures-util", - "http", - "http-body", + "http 1.1.0", + "http-body 1.0.1", "pin-project-lite", ] @@ -3624,41 +4184,79 @@ dependencies = [ [[package]] name = "hyper" -version = "1.4.1" +version = "0.14.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" +checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" dependencies = [ - "bytes", + "bytes 1.7.1", "futures-channel", + "futures-core", "futures-util", - "h2", - "http", - "http-body", + "h2 0.3.26", + "http 0.2.12", + "http-body 0.4.6", "httparse", "httpdate", "itoa", "pin-project-lite", - "smallvec", + "socket2 0.5.7", "tokio", + "tower-service", + "tracing", "want", ] [[package]] -name = "hyper-rustls" -version = "0.27.2" +name = "hyper" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" +checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" dependencies = [ + "bytes 1.7.1", + "futures-channel", "futures-util", - "http", - "hyper", - "hyper-util", - "log", - "rustls", - "rustls-native-certs", - "rustls-pki-types", + "h2 0.4.6", + "http 1.1.0", + "http-body 1.0.1", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" +dependencies = [ + "futures-util", + "http 0.2.12", + "hyper 0.14.30", + "rustls 0.21.12", + "tokio", + "tokio-rustls 0.24.1", +] + +[[package]] +name = "hyper-rustls" +version = "0.27.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" +dependencies = [ + "futures-util", + "http 1.1.0", + "hyper 1.4.1", + "hyper-util", + "log", + "rustls 0.23.12", + "rustls-native-certs 0.7.2", + "rustls-pki-types", "tokio", - "tokio-rustls", + "tokio-rustls 0.26.0", "tower-service", "webpki-roots", ] @@ -3669,12 +4267,12 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cde7055719c54e36e95e8719f95883f22072a48ede39db7fc17a4e1d5281e9b9" dependencies = [ - "bytes", + "bytes 1.7.1", "futures-channel", "futures-util", - "http", - "http-body", - "hyper", + "http 1.1.0", + "http-body 1.0.1", + "hyper 1.4.1", "pin-project-lite", "socket2 0.5.7", "tokio", @@ -3738,6 +4336,21 @@ dependencies = [ "cc", ] +[[package]] +name = "ics23" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d020eb9116abc920452cb63aec8ff662483bf2b75199680046057389b1128988" +dependencies = [ + "bytes 0.5.6", + "failure", + "hex 0.4.3", + "prost 0.6.1", + "ripemd160 0.8.0", + "sha2 0.8.2", + "sha3 0.8.2", +] + [[package]] name = "icu_collections" version = "1.5.0" @@ -3979,8 +4592,8 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" dependencies = [ - "block-padding", - "generic-array", + "block-padding 0.3.3", + "generic-array 0.14.7", ] [[package]] @@ -4061,6 +4674,24 @@ version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" +[[package]] +name = "itertools" +version = "0.7.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d47946d458e94a1b7bcabbf6521ea7c037062c81f534615abcad76e84d4970d" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f56a2d0bc861f9165be4eb3442afd3c236d8a98afd426f65d92324ae1091a484" +dependencies = [ + "either", +] + [[package]] name = "itertools" version = "0.10.5" @@ -4160,16 +4791,16 @@ dependencies = [ "futures-channel", "futures-util", "gloo-net", - "http", + "http 1.1.0", "jsonrpsee-core", "pin-project", - "rustls", + "rustls 0.23.12", "rustls-pki-types", "rustls-platform-verifier", "soketto", "thiserror", "tokio", - "tokio-rustls", + "tokio-rustls 0.26.0", "tokio-util", "tracing", "url", @@ -4182,11 +4813,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e942c55635fbf5dc421938b8558a8141c7e773720640f4f1dbe1f4164ca4e221" dependencies = [ "async-trait", - "bytes", + "bytes 1.7.1", "futures-timer", "futures-util", - "http", - "http-body", + "http 1.1.0", + "http-body 1.0.1", "http-body-util", "jsonrpsee-types", "parking_lot 0.12.3", @@ -4210,13 +4841,13 @@ checksum = "e33774602df12b68a2310b38a535733c477ca4a498751739f89fe8dbbb62ec4c" dependencies = [ "async-trait", "base64 0.22.1", - "http-body", - "hyper", - "hyper-rustls", + "http-body 1.0.1", + "hyper 1.4.1", + "hyper-rustls 0.27.2", "hyper-util", "jsonrpsee-core", "jsonrpsee-types", - "rustls", + "rustls 0.23.12", "rustls-platform-verifier", "serde", "serde_json", @@ -4247,10 +4878,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "038fb697a709bec7134e9ccbdbecfea0e2d15183f7140254afef7c5610a3f488" dependencies = [ "futures-util", - "http", - "http-body", + "http 1.1.0", + "http-body 1.0.1", "http-body-util", - "hyper", + "hyper 1.4.1", "hyper-util", "jsonrpsee-core", "jsonrpsee-types", @@ -4273,7 +4904,7 @@ version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23b67d6e008164f027afbc2e7bb79662650158d26df200040282d2aa1cbb093b" dependencies = [ - "http", + "http 1.1.0", "serde", "serde_json", "thiserror", @@ -4296,7 +4927,7 @@ version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "992bf67d1132f88edf4a4f8cff474cf01abb2be203004a2b8e11c2b20795b99e" dependencies = [ - "http", + "http 1.1.0", "jsonrpsee-client-transport", "jsonrpsee-core", "jsonrpsee-types", @@ -4329,7 +4960,7 @@ dependencies = [ "elliptic-curve", "once_cell", "sha2 0.10.8", - "signature", + "signature 2.2.0", ] [[package]] @@ -4411,7 +5042,7 @@ checksum = "55cca1eb2bc1fd29f099f3daaab7effd01e1a54b7c577d0ed082521034d912e8" dependencies = [ "asn1_der", "bs58", - "ed25519-dalek", + "ed25519-dalek 2.1.1", "hkdf", "libsecp256k1", "multihash", @@ -4672,11 +5303,11 @@ checksum = "e00cdd87dab765e7dac55c21eb680bfd10655b6c2530f6fe578acdfbb66c757c" dependencies = [ "alloy-primitives 0.7.7", "async-sse", - "bytes", + "bytes 1.7.1", "futures-util", "http-types", "pin-project-lite", - "reqwest", + "reqwest 0.12.7", "serde", "serde_json", "thiserror", @@ -4931,6 +5562,28 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" +[[package]] +name = "num-derive" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "num-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.76", +] + [[package]] name = "num-format" version = "0.4.4" @@ -5109,11 +5762,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "620e645c36cc66220909bf97e6632e7a154a2309356221cbf33ae78bf5294478" dependencies = [ "alloy-primitives 0.8.0", - "alloy-rpc-types-engine", + "alloy-rpc-types-engine 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "alloy-serde", "serde", ] +[[package]] +name = "opaque-debug" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" + [[package]] name = "opaque-debug" version = "0.3.1" @@ -5169,6 +5828,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "parity-bytes" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16b56e3a2420138bdb970f84dfb9c774aea80fa0e7371549eedec0d80c209c67" + [[package]] name = "parity-scale-codec" version = "3.6.12" @@ -5178,7 +5843,7 @@ dependencies = [ "arrayvec", "bitvec", "byte-slice-cast", - "bytes", + "bytes 1.7.1", "impl-trait-for-tuples", "parity-scale-codec-derive", "serde", @@ -5266,6 +5931,33 @@ dependencies = [ "hmac 0.12.1", ] +[[package]] +name = "peg" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "295283b02df346d1ef66052a757869b2876ac29a6bb0ac3f5f7cd44aebe40e8f" +dependencies = [ + "peg-macros", + "peg-runtime", +] + +[[package]] +name = "peg-macros" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdad6a1d9cf116a059582ce415d5f5566aabcd4008646779dab7fdc2a9a9d426" +dependencies = [ + "peg-runtime", + "proc-macro2", + "quote", +] + +[[package]] +name = "peg-runtime" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3aeb8f54c078314c2065ee649a7241f46b9d8e418e1a9581ba0546657d7aa3a" + [[package]] name = "pem" version = "3.0.4" @@ -5457,7 +6149,7 @@ checksum = "9d1fe60d06143b2430aa532c94cfe9e29783047f06c0d7fd359a9a51b729fa25" dependencies = [ "cfg-if", "cpufeatures", - "opaque-debug", + "opaque-debug 0.3.1", "universal-hash", ] @@ -5611,7 +6303,7 @@ dependencies = [ "bitflags 2.6.0", "chrono", "flate2", - "hex", + "hex 0.4.3", "lazy_static", "procfs-core", "rustix", @@ -5625,7 +6317,7 @@ checksum = "2d3554923a69f4ce04c4a754260c338f505ce22642d3830e049a399fc2059a29" dependencies = [ "bitflags 2.6.0", "chrono", - "hex", + "hex 0.4.3", ] [[package]] @@ -5669,6 +6361,95 @@ dependencies = [ "syn 2.0.76", ] +[[package]] +name = "prost" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce49aefe0a6144a45de32927c77bd2859a5f7677b55f220ae5b744e87389c212" +dependencies = [ + "bytes 0.5.6", + "prost-derive 0.6.1", +] + +[[package]] +name = "prost" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "deb1435c188b76130da55f17a466d252ff7b1418b2ad3e037d127b94e3411f29" +dependencies = [ + "bytes 1.7.1", + "prost-derive 0.12.6", +] + +[[package]] +name = "prost-amino" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dda006a6c21ae45e261a5a756f2a3e5299722eedae2405f4747dd6a5b47556e" +dependencies = [ + "byteorder", + "bytes 0.5.6", +] + +[[package]] +name = "prost-amino-derive" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7bbb97577964b9ff334506e319a7628af460f59a6be1da592b5bdccb6a78e921" +dependencies = [ + "failure", + "itertools 0.7.11", + "proc-macro2", + "quote", + "sha2 0.9.9", + "syn 1.0.109", +] + +[[package]] +name = "prost-derive" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "537aa19b95acde10a12fec4301466386f757403de4cd4e5b4fa78fb5ecb18f72" +dependencies = [ + "anyhow", + "itertools 0.8.2", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "prost-derive" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1" +dependencies = [ + "anyhow", + "itertools 0.12.1", + "proc-macro2", + "quote", + "syn 2.0.76", +] + +[[package]] +name = "prost-types" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1834f67c0697c001304b75be76f67add9c89742eda3a085ad8ee0bb38c3417aa" +dependencies = [ + "bytes 0.5.6", + "prost 0.6.1", +] + +[[package]] +name = "prost-types" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9091c90b0a32608e984ff2fa4091273cbdd755d54935c51d520887f4a1dbd5b0" +dependencies = [ + "prost 0.12.6", +] + [[package]] name = "quanta" version = "0.12.3" @@ -5714,12 +6495,12 @@ version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b22d8e7369034b9a7132bc2008cac12f2013c8132b45e0554e6e20e2617f2156" dependencies = [ - "bytes", + "bytes 1.7.1", "pin-project-lite", "quinn-proto", "quinn-udp", "rustc-hash 2.0.0", - "rustls", + "rustls 0.23.12", "socket2 0.5.7", "thiserror", "tokio", @@ -5732,11 +6513,11 @@ version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba92fb39ec7ad06ca2582c0ca834dfeadcaf06ddfc8e635c80aa7e1c05315fdd" dependencies = [ - "bytes", + "bytes 1.7.1", "rand 0.8.5", "ring", "rustc-hash 2.0.0", - "rustls", + "rustls 0.23.12", "slab", "thiserror", "tinyvec", @@ -6000,6 +6781,47 @@ dependencies = [ "memchr", ] +[[package]] +name = "reqwest" +version = "0.11.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" +dependencies = [ + "base64 0.21.7", + "bytes 1.7.1", + "encoding_rs", + "futures-core", + "futures-util", + "h2 0.3.26", + "http 0.2.12", + "http-body 0.4.6", + "hyper 0.14.30", + "hyper-rustls 0.24.2", + "ipnet", + "js-sys", + "log", + "mime", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls 0.21.12", + "rustls-native-certs 0.6.3", + "rustls-pemfile 1.0.4", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper 0.1.2", + "system-configuration", + "tokio", + "tokio-rustls 0.24.1", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "winreg", +] + [[package]] name = "reqwest" version = "0.12.7" @@ -6007,14 +6829,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8f4955649ef5c38cc7f9e8aa41761d48fb9677197daea9984dc54f56aad5e63" dependencies = [ "base64 0.22.1", - "bytes", + "bytes 1.7.1", "futures-core", "futures-util", - "http", - "http-body", + "http 1.1.0", + "http-body 1.0.1", "http-body-util", - "hyper", - "hyper-rustls", + "hyper 1.4.1", + "hyper-rustls 0.27.2", "hyper-util", "ipnet", "js-sys", @@ -6024,16 +6846,16 @@ dependencies = [ "percent-encoding", "pin-project-lite", "quinn", - "rustls", - "rustls-native-certs", - "rustls-pemfile", + "rustls 0.23.12", + "rustls-native-certs 0.7.2", + "rustls-pemfile 2.1.3", "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", - "sync_wrapper", + "sync_wrapper 1.0.1", "tokio", - "tokio-rustls", + "tokio-rustls 0.26.0", "tokio-util", "tower-service", "url", @@ -6057,7 +6879,7 @@ dependencies = [ [[package]] name = "reth" -version = "1.0.6" +version = "1.0.3" dependencies = [ "alloy-rlp", "aquamarine", @@ -6096,6 +6918,7 @@ dependencies = [ "reth-network-api", "reth-network-p2p", "reth-node-api", + "reth-node-bsc", "reth-node-builder", "reth-node-core", "reth-node-ethereum", @@ -6134,13 +6957,13 @@ dependencies = [ "tempfile", "tikv-jemallocator", "tokio", - "toml", + "toml 0.8.19", "tracing", ] [[package]] name = "reth-auto-seal-consensus" -version = "1.0.6" +version = "1.0.3" dependencies = [ "futures-util", "reth-beacon-consensus", @@ -6167,7 +6990,7 @@ dependencies = [ [[package]] name = "reth-basic-payload-builder" -version = "1.0.6" +version = "1.0.3" dependencies = [ "alloy-rlp", "futures-core", @@ -6189,15 +7012,16 @@ dependencies = [ [[package]] name = "reth-beacon-consensus" -version = "1.0.6" +version = "1.0.3" dependencies = [ - "alloy-genesis", + "alloy-genesis 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "assert_matches", "futures", "itertools 0.13.0", "metrics", "reth-blockchain-tree", "reth-blockchain-tree-api", + "reth-bsc-consensus", "reth-chainspec", "reth-config", "reth-consensus", @@ -6238,26 +7062,26 @@ dependencies = [ [[package]] name = "reth-bench" -version = "1.0.6" +version = "1.0.3" dependencies = [ "alloy-consensus", "alloy-eips", - "alloy-json-rpc", + "alloy-json-rpc 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "alloy-provider", - "alloy-pubsub", - "alloy-rpc-client", - "alloy-rpc-types-engine", - "alloy-transport", + "alloy-pubsub 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "alloy-rpc-client 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "alloy-rpc-types-engine 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "alloy-transport 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "alloy-transport-http", "alloy-transport-ipc", - "alloy-transport-ws", + "alloy-transport-ws 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "async-trait", "clap", "csv", "eyre", "futures", "libc", - "reqwest", + "reqwest 0.12.7", "reth-cli-runner", "reth-db", "reth-node-api", @@ -6279,9 +7103,9 @@ dependencies = [ [[package]] name = "reth-blockchain-tree" -version = "1.0.6" +version = "1.0.3" dependencies = [ - "alloy-genesis", + "alloy-genesis 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "aquamarine", "assert_matches", "linked_hash_set", @@ -6314,7 +7138,7 @@ dependencies = [ [[package]] name = "reth-blockchain-tree-api" -version = "1.0.6" +version = "1.0.3" dependencies = [ "reth-consensus", "reth-execution-errors", @@ -6323,9 +7147,120 @@ dependencies = [ "thiserror", ] +[[package]] +name = "reth-bsc-chainspec" +version = "1.0.3" +dependencies = [ + "alloy-chains", + "alloy-genesis 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "alloy-primitives 0.8.0", + "derive_more 1.0.0", + "once_cell", + "op-alloy-rpc-types", + "reth-chainspec", + "reth-ethereum-forks", + "reth-primitives-traits", + "serde_json", +] + +[[package]] +name = "reth-bsc-cli" +version = "1.0.3" +dependencies = [ + "clap", + "eyre", + "reth-bsc-chainspec", + "reth-cli", + "reth-node-core", +] + +[[package]] +name = "reth-bsc-consensus" +version = "1.0.3" +dependencies = [ + "alloy-dyn-abi", + "alloy-json-abi", + "alloy-rlp", + "bitset", + "blst", + "bytes 1.7.1", + "futures-util", + "lazy_static", + "lru", + "mockall", + "parking_lot 0.12.3", + "rand 0.8.5", + "reth-chainspec", + "reth-codecs", + "reth-consensus", + "reth-consensus-common", + "reth-db-api", + "reth-engine-primitives", + "reth-network", + "reth-network-p2p", + "reth-network-peers", + "reth-primitives", + "reth-provider", + "reth-rpc-types", + "secp256k1", + "serde", + "serde_cbor", + "serde_json", + "sha3 0.10.8", + "thiserror", + "tokio", + "tokio-stream", + "tracing", +] + +[[package]] +name = "reth-bsc-engine" +version = "1.0.3" +dependencies = [ + "alloy-dyn-abi", + "alloy-json-abi", + "alloy-rlp", + "bitset", + "blst", + "bytes 1.7.1", + "futures-util", + "lazy_static", + "lru", + "mockall", + "parking_lot 0.12.3", + "rand 0.8.5", + "reth-beacon-consensus", + "reth-bsc-consensus", + "reth-chainspec", + "reth-codecs", + "reth-consensus", + "reth-consensus-common", + "reth-db-api", + "reth-engine-primitives", + "reth-evm", + "reth-evm-bsc", + "reth-network", + "reth-network-api", + "reth-network-p2p", + "reth-network-peers", + "reth-primitives", + "reth-primitives-traits", + "reth-provider", + "reth-rpc-types", + "secp256k1", + "serde", + "serde_cbor", + "serde_json", + "sha3 0.10.8", + "thiserror", + "tokio", + "tokio-stream", + "tracing", +] + [[package]] name = "reth-chain-state" -version = "1.0.6" +version = "1.0.3" dependencies = [ "alloy-signer", "alloy-signer-local", @@ -6350,11 +7285,11 @@ dependencies = [ [[package]] name = "reth-chainspec" -version = "1.0.6" +version = "1.0.3" dependencies = [ "alloy-chains", "alloy-eips", - "alloy-genesis", + "alloy-genesis 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "alloy-primitives 0.8.0", "alloy-rlp", "alloy-trie", @@ -6372,7 +7307,7 @@ dependencies = [ [[package]] name = "reth-cli" -version = "1.0.6" +version = "1.0.3" dependencies = [ "clap", "eyre", @@ -6381,7 +7316,7 @@ dependencies = [ [[package]] name = "reth-cli-commands" -version = "1.0.6" +version = "1.0.3" dependencies = [ "ahash", "arbitrary", @@ -6432,13 +7367,13 @@ dependencies = [ "serde", "serde_json", "tokio", - "toml", + "toml 0.8.19", "tracing", ] [[package]] name = "reth-cli-runner" -version = "1.0.6" +version = "1.0.3" dependencies = [ "reth-tasks", "tokio", @@ -6447,7 +7382,7 @@ dependencies = [ [[package]] name = "reth-cli-util" -version = "1.0.6" +version = "1.0.3" dependencies = [ "alloy-eips", "alloy-primitives 0.8.0", @@ -6461,15 +7396,15 @@ dependencies = [ [[package]] name = "reth-codecs" -version = "1.0.6" +version = "1.0.3" dependencies = [ "alloy-consensus", "alloy-eips", - "alloy-genesis", + "alloy-genesis 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "alloy-primitives 0.8.0", "alloy-trie", "arbitrary", - "bytes", + "bytes 1.7.1", "modular-bitfield", "proptest", "proptest-arbitrary-interop", @@ -6481,7 +7416,7 @@ dependencies = [ [[package]] name = "reth-codecs-derive" -version = "1.0.6" +version = "1.0.3" dependencies = [ "convert_case 0.6.0", "proc-macro2", @@ -6492,22 +7427,23 @@ dependencies = [ [[package]] name = "reth-config" -version = "1.0.6" +version = "1.0.3" dependencies = [ "eyre", "humantime-serde", "reth-network-peers", "reth-network-types", + "reth-primitives", "reth-prune-types", "reth-stages-types", "serde", "tempfile", - "toml", + "toml 0.8.19", ] [[package]] name = "reth-consensus" -version = "1.0.6" +version = "1.0.3" dependencies = [ "auto_impl", "derive_more 1.0.0", @@ -6516,7 +7452,7 @@ dependencies = [ [[package]] name = "reth-consensus-common" -version = "1.0.6" +version = "1.0.3" dependencies = [ "mockall", "rand 0.8.5", @@ -6528,7 +7464,7 @@ dependencies = [ [[package]] name = "reth-consensus-debug-client" -version = "1.0.6" +version = "1.0.3" dependencies = [ "alloy-consensus", "alloy-eips", @@ -6536,7 +7472,7 @@ dependencies = [ "auto_impl", "eyre", "futures", - "reqwest", + "reqwest 0.12.7", "reth-node-api", "reth-node-core", "reth-rpc-api", @@ -6550,11 +7486,11 @@ dependencies = [ [[package]] name = "reth-db" -version = "1.0.6" +version = "1.0.3" dependencies = [ "arbitrary", "assert_matches", - "bytes", + "bytes 1.7.1", "criterion", "derive_more 1.0.0", "eyre", @@ -6589,11 +7525,11 @@ dependencies = [ [[package]] name = "reth-db-api" -version = "1.0.6" +version = "1.0.3" dependencies = [ "arbitrary", "assert_matches", - "bytes", + "bytes 1.7.1", "criterion", "derive_more 1.0.0", "iai-callgrind", @@ -6613,14 +7549,15 @@ dependencies = [ "reth-storage-errors", "reth-trie-common", "serde", + "serde_cbor", "test-fuzz", ] [[package]] name = "reth-db-common" -version = "1.0.6" +version = "1.0.3" dependencies = [ - "alloy-genesis", + "alloy-genesis 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "boyer-moore-magiclen", "eyre", "reth-chainspec", @@ -6644,10 +7581,10 @@ dependencies = [ [[package]] name = "reth-db-models" -version = "1.0.6" +version = "1.0.3" dependencies = [ "arbitrary", - "bytes", + "bytes 1.7.1", "modular-bitfield", "proptest", "proptest-arbitrary-interop", @@ -6659,14 +7596,14 @@ dependencies = [ [[package]] name = "reth-discv4" -version = "1.0.6" +version = "1.0.3" dependencies = [ "alloy-primitives 0.8.0", "alloy-rlp", "assert_matches", "discv5", "enr", - "generic-array", + "generic-array 0.14.7", "parking_lot 0.12.3", "rand 0.8.5", "reth-ethereum-forks", @@ -6685,7 +7622,7 @@ dependencies = [ [[package]] name = "reth-discv5" -version = "1.0.6" +version = "1.0.3" dependencies = [ "alloy-primitives 0.8.0", "alloy-rlp", @@ -6709,7 +7646,7 @@ dependencies = [ [[package]] name = "reth-dns-discovery" -version = "1.0.6" +version = "1.0.3" dependencies = [ "alloy-chains", "alloy-primitives 0.8.0", @@ -6737,7 +7674,7 @@ dependencies = [ [[package]] name = "reth-downloaders" -version = "1.0.6" +version = "1.0.3" dependencies = [ "alloy-rlp", "assert_matches", @@ -6772,7 +7709,7 @@ dependencies = [ [[package]] name = "reth-e2e-test-utils" -version = "1.0.6" +version = "1.0.3" dependencies = [ "alloy-consensus", "alloy-network", @@ -6807,26 +7744,26 @@ dependencies = [ [[package]] name = "reth-ecies" -version = "1.0.6" +version = "1.0.3" dependencies = [ "aes", "alloy-primitives 0.8.0", "alloy-rlp", - "block-padding", + "block-padding 0.3.3", "byteorder", "cipher", "concat-kdf", "ctr", "digest 0.10.7", "futures", - "generic-array", + "generic-array 0.14.7", "hmac 0.12.1", "pin-project", "rand 0.8.5", "reth-network-peers", "secp256k1", "sha2 0.10.8", - "sha3", + "sha3 0.10.8", "thiserror", "tokio", "tokio-stream", @@ -6837,7 +7774,7 @@ dependencies = [ [[package]] name = "reth-engine-primitives" -version = "1.0.6" +version = "1.0.3" dependencies = [ "reth-chainspec", "reth-payload-primitives", @@ -6846,7 +7783,7 @@ dependencies = [ [[package]] name = "reth-engine-service" -version = "1.0.6" +version = "1.0.3" dependencies = [ "futures", "pin-project", @@ -6877,7 +7814,7 @@ dependencies = [ [[package]] name = "reth-engine-tree" -version = "1.0.6" +version = "1.0.3" dependencies = [ "alloy-rlp", "assert_matches", @@ -6922,7 +7859,7 @@ dependencies = [ [[package]] name = "reth-engine-util" -version = "1.0.6" +version = "1.0.3" dependencies = [ "eyre", "futures", @@ -6951,7 +7888,7 @@ dependencies = [ [[package]] name = "reth-errors" -version = "1.0.6" +version = "1.0.3" dependencies = [ "reth-blockchain-tree-api", "reth-consensus", @@ -6963,12 +7900,12 @@ dependencies = [ [[package]] name = "reth-eth-wire" -version = "1.0.6" +version = "1.0.3" dependencies = [ "alloy-rlp", "arbitrary", "async-stream", - "bytes", + "bytes 1.7.1", "derive_more 1.0.0", "futures", "pin-project", @@ -6996,13 +7933,13 @@ dependencies = [ [[package]] name = "reth-eth-wire-types" -version = "1.0.6" +version = "1.0.3" dependencies = [ "alloy-chains", - "alloy-genesis", + "alloy-genesis 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "alloy-rlp", "arbitrary", - "bytes", + "bytes 1.7.1", "derive_more 1.0.0", "proptest", "proptest-arbitrary-interop", @@ -7016,9 +7953,9 @@ dependencies = [ [[package]] name = "reth-ethereum-cli" -version = "1.0.6" +version = "1.0.3" dependencies = [ - "alloy-genesis", + "alloy-genesis 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "clap", "eyre", "reth-chainspec", @@ -7029,7 +7966,7 @@ dependencies = [ [[package]] name = "reth-ethereum-consensus" -version = "1.0.6" +version = "1.0.3" dependencies = [ "reth-chainspec", "reth-consensus", @@ -7040,7 +7977,7 @@ dependencies = [ [[package]] name = "reth-ethereum-engine-primitives" -version = "1.0.6" +version = "1.0.3" dependencies = [ "alloy-rlp", "reth-chainspec", @@ -7058,7 +7995,7 @@ dependencies = [ [[package]] name = "reth-ethereum-forks" -version = "1.0.6" +version = "1.0.3" dependencies = [ "alloy-chains", "alloy-primitives 0.8.0", @@ -7077,7 +8014,7 @@ dependencies = [ [[package]] name = "reth-ethereum-payload-builder" -version = "1.0.6" +version = "1.0.3" dependencies = [ "reth-basic-payload-builder", "reth-errors", @@ -7096,7 +8033,7 @@ dependencies = [ [[package]] name = "reth-etl" -version = "1.0.6" +version = "1.0.3" dependencies = [ "alloy-primitives 0.8.0", "rayon", @@ -7106,7 +8043,7 @@ dependencies = [ [[package]] name = "reth-evm" -version = "1.0.6" +version = "1.0.3" dependencies = [ "alloy-eips", "auto_impl", @@ -7122,9 +8059,32 @@ dependencies = [ "revm-primitives", ] +[[package]] +name = "reth-evm-bsc" +version = "1.0.3" +dependencies = [ + "bitset", + "blst", + "lazy_static", + "lru", + "parking_lot 0.12.3", + "reth-bsc-consensus", + "reth-chainspec", + "reth-errors", + "reth-ethereum-forks", + "reth-evm", + "reth-primitives", + "reth-provider", + "reth-prune-types", + "reth-revm", + "revm-primitives", + "thiserror", + "tracing", +] + [[package]] name = "reth-evm-ethereum" -version = "1.0.6" +version = "1.0.3" dependencies = [ "alloy-eips", "alloy-sol-types", @@ -7144,7 +8104,7 @@ dependencies = [ [[package]] name = "reth-evm-optimism" -version = "1.0.6" +version = "1.0.3" dependencies = [ "reth-chainspec", "reth-ethereum-forks", @@ -7164,7 +8124,7 @@ dependencies = [ [[package]] name = "reth-execution-errors" -version = "1.0.6" +version = "1.0.3" dependencies = [ "alloy-eips", "alloy-primitives 0.8.0", @@ -7179,7 +8139,7 @@ dependencies = [ [[package]] name = "reth-execution-types" -version = "1.0.6" +version = "1.0.3" dependencies = [ "alloy-eips", "alloy-primitives 0.8.0", @@ -7193,7 +8153,7 @@ dependencies = [ [[package]] name = "reth-exex" -version = "1.0.6" +version = "1.0.3" dependencies = [ "eyre", "futures", @@ -7226,7 +8186,7 @@ dependencies = [ [[package]] name = "reth-exex-test-utils" -version = "1.0.6" +version = "1.0.3" dependencies = [ "eyre", "futures-util", @@ -7256,7 +8216,7 @@ dependencies = [ [[package]] name = "reth-exex-types" -version = "1.0.6" +version = "1.0.3" dependencies = [ "alloy-primitives 0.8.0", "reth-provider", @@ -7265,7 +8225,7 @@ dependencies = [ [[package]] name = "reth-fs-util" -version = "1.0.6" +version = "1.0.3" dependencies = [ "serde", "serde_json", @@ -7274,10 +8234,10 @@ dependencies = [ [[package]] name = "reth-ipc" -version = "1.0.6" +version = "1.0.3" dependencies = [ "async-trait", - "bytes", + "bytes 1.7.1", "futures", "futures-util", "interprocess", @@ -7296,7 +8256,7 @@ dependencies = [ [[package]] name = "reth-libmdbx" -version = "1.0.6" +version = "1.0.3" dependencies = [ "bitflags 2.6.0", "byteorder", @@ -7316,7 +8276,7 @@ dependencies = [ [[package]] name = "reth-mdbx-sys" -version = "1.0.6" +version = "1.0.3" dependencies = [ "bindgen", "cc", @@ -7324,7 +8284,7 @@ dependencies = [ [[package]] name = "reth-metrics" -version = "1.0.6" +version = "1.0.3" dependencies = [ "futures", "metrics", @@ -7335,7 +8295,7 @@ dependencies = [ [[package]] name = "reth-metrics-derive" -version = "1.0.6" +version = "1.0.3" dependencies = [ "metrics", "proc-macro2", @@ -7348,17 +8308,17 @@ dependencies = [ [[package]] name = "reth-net-banlist" -version = "1.0.6" +version = "1.0.3" dependencies = [ "alloy-primitives 0.8.0", ] [[package]] name = "reth-net-nat" -version = "1.0.6" +version = "1.0.3" dependencies = [ "futures-util", - "reqwest", + "reqwest 0.12.7", "reth-tracing", "serde_with", "thiserror", @@ -7367,7 +8327,7 @@ dependencies = [ [[package]] name = "reth-network" -version = "1.0.6" +version = "1.0.3" dependencies = [ "alloy-node-bindings", "alloy-provider", @@ -7424,10 +8384,10 @@ dependencies = [ [[package]] name = "reth-network-api" -version = "1.0.6" +version = "1.0.3" dependencies = [ "alloy-primitives 0.8.0", - "alloy-rpc-types-admin", + "alloy-rpc-types-admin 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "auto_impl", "derive_more 1.0.0", "enr", @@ -7446,7 +8406,7 @@ dependencies = [ [[package]] name = "reth-network-p2p" -version = "1.0.6" +version = "1.0.3" dependencies = [ "auto_impl", "derive_more 1.0.0", @@ -7464,7 +8424,7 @@ dependencies = [ [[package]] name = "reth-network-peers" -version = "1.0.6" +version = "1.0.3" dependencies = [ "alloy-primitives 0.8.0", "alloy-rlp", @@ -7480,7 +8440,7 @@ dependencies = [ [[package]] name = "reth-network-types" -version = "1.0.6" +version = "1.0.3" dependencies = [ "humantime-serde", "reth-ethereum-forks", @@ -7493,7 +8453,7 @@ dependencies = [ [[package]] name = "reth-nippy-jar" -version = "1.0.6" +version = "1.0.3" dependencies = [ "anyhow", "bincode", @@ -7514,7 +8474,7 @@ dependencies = [ [[package]] name = "reth-node-api" -version = "1.0.6" +version = "1.0.3" dependencies = [ "reth-chainspec", "reth-db-api", @@ -7529,9 +8489,41 @@ dependencies = [ "reth-transaction-pool", ] +[[package]] +name = "reth-node-bsc" +version = "1.0.3" +dependencies = [ + "eyre", + "futures", + "futures-util", + "reth", + "reth-basic-payload-builder", + "reth-bsc-consensus", + "reth-chainspec", + "reth-config", + "reth-db", + "reth-e2e-test-utils", + "reth-ethereum-engine-primitives", + "reth-ethereum-payload-builder", + "reth-evm-bsc", + "reth-exex", + "reth-network", + "reth-node-api", + "reth-node-builder", + "reth-node-core", + "reth-payload-builder", + "reth-primitives", + "reth-provider", + "reth-rpc", + "reth-tracing", + "reth-transaction-pool", + "serde_json", + "tokio", +] + [[package]] name = "reth-node-builder" -version = "1.0.6" +version = "1.0.3" dependencies = [ "alloy-network", "aquamarine", @@ -7542,6 +8534,8 @@ dependencies = [ "reth-auto-seal-consensus", "reth-beacon-consensus", "reth-blockchain-tree", + "reth-bsc-consensus", + "reth-bsc-engine", "reth-chainspec", "reth-cli-util", "reth-config", @@ -7589,10 +8583,10 @@ dependencies = [ [[package]] name = "reth-node-core" -version = "1.0.6" +version = "1.0.3" dependencies = [ - "alloy-genesis", - "alloy-rpc-types-engine", + "alloy-genesis 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "alloy-rpc-types-engine 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "clap", "const_format", "derive_more 1.0.0", @@ -7602,6 +8596,7 @@ dependencies = [ "humantime", "proptest", "rand 0.8.5", + "reth-bsc-chainspec", "reth-chainspec", "reth-cli-util", "reth-config", @@ -7635,16 +8630,16 @@ dependencies = [ "shellexpand", "tempfile", "tokio", - "toml", + "toml 0.8.19", "tracing", "vergen", ] [[package]] name = "reth-node-ethereum" -version = "1.0.6" +version = "1.0.3" dependencies = [ - "alloy-genesis", + "alloy-genesis 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "alloy-primitives 0.8.0", "eyre", "futures", @@ -7677,9 +8672,9 @@ dependencies = [ [[package]] name = "reth-node-events" -version = "1.0.6" +version = "1.0.3" dependencies = [ - "alloy-rpc-types-engine", + "alloy-rpc-types-engine 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "futures", "humantime", "pin-project", @@ -7698,17 +8693,17 @@ dependencies = [ [[package]] name = "reth-node-metrics" -version = "1.0.6" +version = "1.0.3" dependencies = [ "eyre", - "http", + "http 1.1.0", "jsonrpsee", "metrics", "metrics-exporter-prometheus", "metrics-process", "metrics-util", "procfs", - "reqwest", + "reqwest 0.12.7", "reth-chainspec", "reth-db", "reth-db-api", @@ -7725,9 +8720,9 @@ dependencies = [ [[package]] name = "reth-node-optimism" -version = "1.0.6" +version = "1.0.3" dependencies = [ - "alloy-genesis", + "alloy-genesis 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "alloy-primitives 0.8.0", "async-trait", "clap", @@ -7735,7 +8730,7 @@ dependencies = [ "jsonrpsee", "jsonrpsee-types", "parking_lot 0.12.3", - "reqwest", + "reqwest 0.12.7", "reth", "reth-auto-seal-consensus", "reth-basic-payload-builder", @@ -7774,10 +8769,10 @@ dependencies = [ [[package]] name = "reth-optimism-chainspec" -version = "1.0.6" +version = "1.0.3" dependencies = [ "alloy-chains", - "alloy-genesis", + "alloy-genesis 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "alloy-primitives 0.8.0", "derive_more 1.0.0", "once_cell", @@ -7790,7 +8785,7 @@ dependencies = [ [[package]] name = "reth-optimism-cli" -version = "1.0.6" +version = "1.0.3" dependencies = [ "alloy-primitives 0.8.0", "alloy-rlp", @@ -7829,7 +8824,7 @@ dependencies = [ [[package]] name = "reth-optimism-consensus" -version = "1.0.6" +version = "1.0.3" dependencies = [ "reth-chainspec", "reth-consensus", @@ -7840,7 +8835,7 @@ dependencies = [ [[package]] name = "reth-optimism-payload-builder" -version = "1.0.6" +version = "1.0.3" dependencies = [ "alloy-rlp", "reth-basic-payload-builder", @@ -7866,17 +8861,17 @@ dependencies = [ [[package]] name = "reth-optimism-primitives" -version = "1.0.6" +version = "1.0.3" [[package]] name = "reth-optimism-rpc" -version = "1.0.6" +version = "1.0.3" dependencies = [ "alloy-primitives 0.8.0", "jsonrpsee-types", "op-alloy-network", "parking_lot 0.12.3", - "reqwest", + "reqwest 0.12.7", "reth-chainspec", "reth-evm", "reth-evm-optimism", @@ -7901,7 +8896,7 @@ dependencies = [ [[package]] name = "reth-payload-builder" -version = "1.0.6" +version = "1.0.3" dependencies = [ "futures-util", "metrics", @@ -7923,7 +8918,7 @@ dependencies = [ [[package]] name = "reth-payload-primitives" -version = "1.0.6" +version = "1.0.3" dependencies = [ "reth-chain-state", "reth-chainspec", @@ -7938,7 +8933,7 @@ dependencies = [ [[package]] name = "reth-payload-validator" -version = "1.0.6" +version = "1.0.3" dependencies = [ "reth-chainspec", "reth-primitives", @@ -7948,22 +8943,25 @@ dependencies = [ [[package]] name = "reth-primitives" -version = "1.0.6" +version = "1.0.3" dependencies = [ + "alloy-chains", "alloy-consensus", "alloy-eips", - "alloy-genesis", + "alloy-genesis 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "alloy-primitives 0.8.0", "alloy-rlp", "alloy-rpc-types", "alloy-serde", "arbitrary", "assert_matches", - "bytes", + "bytes 1.7.1", "c-kzg", "criterion", "derive_more 1.0.0", + "include_dir", "k256", + "lazy_static", "modular-bitfield", "once_cell", "op-alloy-rpc-types", @@ -7972,6 +8970,7 @@ dependencies = [ "proptest-arbitrary-interop", "rand 0.8.5", "rayon", + "reth-bsc-chainspec", "reth-chainspec", "reth-codecs", "reth-ethereum-forks", @@ -7979,6 +8978,7 @@ dependencies = [ "reth-primitives-traits", "reth-static-file-types", "reth-trie-common", + "revm", "revm-primitives", "secp256k1", "serde", @@ -7991,17 +8991,17 @@ dependencies = [ [[package]] name = "reth-primitives-traits" -version = "1.0.6" +version = "1.0.3" dependencies = [ "alloy-consensus", "alloy-eips", - "alloy-genesis", + "alloy-genesis 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "alloy-primitives 0.8.0", "alloy-rlp", "alloy-rpc-types-eth", "arbitrary", "byteorder", - "bytes", + "bytes 1.7.1", "derive_more 1.0.0", "modular-bitfield", "proptest", @@ -8017,9 +9017,9 @@ dependencies = [ [[package]] name = "reth-provider" -version = "1.0.6" +version = "1.0.3" dependencies = [ - "alloy-rpc-types-engine", + "alloy-rpc-types-engine 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "assert_matches", "auto_impl", "dashmap 6.0.1", @@ -8060,7 +9060,7 @@ dependencies = [ [[package]] name = "reth-prune" -version = "1.0.6" +version = "1.0.3" dependencies = [ "alloy-primitives 0.8.0", "assert_matches", @@ -8089,12 +9089,12 @@ dependencies = [ [[package]] name = "reth-prune-types" -version = "1.0.6" +version = "1.0.3" dependencies = [ "alloy-primitives 0.8.0", "arbitrary", "assert_matches", - "bytes", + "bytes 1.7.1", "derive_more 1.0.0", "modular-bitfield", "proptest", @@ -8104,12 +9104,12 @@ dependencies = [ "serde_json", "test-fuzz", "thiserror", - "toml", + "toml 0.8.19", ] [[package]] name = "reth-revm" -version = "1.0.6" +version = "1.0.3" dependencies = [ "reth-chainspec", "reth-consensus-common", @@ -8125,19 +9125,20 @@ dependencies = [ [[package]] name = "reth-rpc" -version = "1.0.6" +version = "1.0.3" dependencies = [ "alloy-dyn-abi", - "alloy-genesis", + "alloy-genesis 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "alloy-network", "alloy-primitives 0.8.0", "alloy-rlp", "async-trait", + "cfg-if", "derive_more 1.0.0", "futures", - "http", - "http-body", - "hyper", + "http 1.1.0", + "http-body 1.0.1", + "hyper 1.4.1", "jsonrpsee", "jsonrpsee-types", "jsonwebtoken", @@ -8183,9 +9184,9 @@ dependencies = [ [[package]] name = "reth-rpc-api" -version = "1.0.6" +version = "1.0.3" dependencies = [ - "alloy-json-rpc", + "alloy-json-rpc 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpsee", "reth-engine-primitives", "reth-network-peers", @@ -8197,7 +9198,7 @@ dependencies = [ [[package]] name = "reth-rpc-api-testing-util" -version = "1.0.6" +version = "1.0.3" dependencies = [ "futures", "jsonrpsee", @@ -8213,10 +9214,10 @@ dependencies = [ [[package]] name = "reth-rpc-builder" -version = "1.0.6" +version = "1.0.3" dependencies = [ "clap", - "http", + "http 1.1.0", "jsonrpsee", "metrics", "pin-project", @@ -8259,7 +9260,7 @@ dependencies = [ [[package]] name = "reth-rpc-engine-api" -version = "1.0.6" +version = "1.0.3" dependencies = [ "alloy-rlp", "assert_matches", @@ -8292,13 +9293,14 @@ dependencies = [ [[package]] name = "reth-rpc-eth-api" -version = "1.0.6" +version = "1.0.3" dependencies = [ "alloy-dyn-abi", - "alloy-json-rpc", + "alloy-json-rpc 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "alloy-network", "async-trait", "auto_impl", + "cfg-if", "dyn-clone", "futures", "jsonrpsee", @@ -8328,7 +9330,7 @@ dependencies = [ [[package]] name = "reth-rpc-eth-types" -version = "1.0.6" +version = "1.0.3" dependencies = [ "alloy-sol-types", "derive_more 1.0.0", @@ -8366,14 +9368,14 @@ dependencies = [ [[package]] name = "reth-rpc-layer" -version = "1.0.6" +version = "1.0.3" dependencies = [ - "alloy-rpc-types-engine", - "http", + "alloy-rpc-types-engine 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "http 1.1.0", "jsonrpsee", "jsonrpsee-http-client", "pin-project", - "reqwest", + "reqwest 0.12.7", "tokio", "tower", "tracing", @@ -8381,7 +9383,7 @@ dependencies = [ [[package]] name = "reth-rpc-server-types" -version = "1.0.6" +version = "1.0.3" dependencies = [ "alloy-primitives 0.8.0", "jsonrpsee-core", @@ -8396,14 +9398,14 @@ dependencies = [ [[package]] name = "reth-rpc-types" -version = "1.0.6" +version = "1.0.3" dependencies = [ "alloy-primitives 0.8.0", "alloy-rpc-types", - "alloy-rpc-types-admin", + "alloy-rpc-types-admin 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "alloy-rpc-types-anvil", "alloy-rpc-types-beacon", - "alloy-rpc-types-engine", + "alloy-rpc-types-engine 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "alloy-rpc-types-mev", "alloy-rpc-types-trace", "alloy-rpc-types-txpool", @@ -8417,7 +9419,7 @@ dependencies = [ [[package]] name = "reth-rpc-types-compat" -version = "1.0.6" +version = "1.0.3" dependencies = [ "alloy-rlp", "alloy-rpc-types", @@ -8429,7 +9431,7 @@ dependencies = [ [[package]] name = "reth-stages" -version = "1.0.6" +version = "1.0.3" dependencies = [ "alloy-rlp", "assert_matches", @@ -8450,6 +9452,7 @@ dependencies = [ "reth-downloaders", "reth-etl", "reth-evm", + "reth-evm-bsc", "reth-evm-ethereum", "reth-execution-errors", "reth-execution-types", @@ -8477,7 +9480,7 @@ dependencies = [ [[package]] name = "reth-stages-api" -version = "1.0.6" +version = "1.0.3" dependencies = [ "alloy-primitives 0.8.0", "aquamarine", @@ -8506,11 +9509,11 @@ dependencies = [ [[package]] name = "reth-stages-types" -version = "1.0.6" +version = "1.0.3" dependencies = [ "alloy-primitives 0.8.0", "arbitrary", - "bytes", + "bytes 1.7.1", "modular-bitfield", "proptest", "proptest-arbitrary-interop", @@ -8523,7 +9526,7 @@ dependencies = [ [[package]] name = "reth-static-file" -version = "1.0.6" +version = "1.0.3" dependencies = [ "alloy-primitives 0.8.0", "assert_matches", @@ -8546,7 +9549,7 @@ dependencies = [ [[package]] name = "reth-static-file-types" -version = "1.0.6" +version = "1.0.3" dependencies = [ "alloy-primitives 0.8.0", "clap", @@ -8557,7 +9560,7 @@ dependencies = [ [[package]] name = "reth-storage-api" -version = "1.0.6" +version = "1.0.3" dependencies = [ "auto_impl", "reth-chainspec", @@ -8572,7 +9575,7 @@ dependencies = [ [[package]] name = "reth-storage-errors" -version = "1.0.6" +version = "1.0.3" dependencies = [ "alloy-rlp", "derive_more 1.0.0", @@ -8582,7 +9585,7 @@ dependencies = [ [[package]] name = "reth-tasks" -version = "1.0.6" +version = "1.0.3" dependencies = [ "auto_impl", "dyn-clone", @@ -8599,10 +9602,10 @@ dependencies = [ [[package]] name = "reth-testing-utils" -version = "1.0.6" +version = "1.0.3" dependencies = [ "alloy-eips", - "alloy-genesis", + "alloy-genesis 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.8.5", "reth-primitives", "secp256k1", @@ -8610,7 +9613,7 @@ dependencies = [ [[package]] name = "reth-tokio-util" -version = "1.0.6" +version = "1.0.3" dependencies = [ "tokio", "tokio-stream", @@ -8619,7 +9622,7 @@ dependencies = [ [[package]] name = "reth-tracing" -version = "1.0.6" +version = "1.0.3" dependencies = [ "clap", "eyre", @@ -8633,7 +9636,7 @@ dependencies = [ [[package]] name = "reth-transaction-pool" -version = "1.0.6" +version = "1.0.3" dependencies = [ "alloy-rlp", "aquamarine", @@ -8675,7 +9678,7 @@ dependencies = [ [[package]] name = "reth-trie" -version = "1.0.6" +version = "1.0.3" dependencies = [ "alloy-rlp", "auto_impl", @@ -8706,15 +9709,15 @@ dependencies = [ [[package]] name = "reth-trie-common" -version = "1.0.6" +version = "1.0.3" dependencies = [ "alloy-consensus", - "alloy-genesis", + "alloy-genesis 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "alloy-primitives 0.8.0", "alloy-rlp", "alloy-trie", "arbitrary", - "bytes", + "bytes 1.7.1", "derive_more 1.0.0", "hash-db", "itertools 0.13.0", @@ -8727,12 +9730,12 @@ dependencies = [ "revm-primitives", "serde", "test-fuzz", - "toml", + "toml 0.8.19", ] [[package]] name = "reth-trie-db" -version = "1.0.6" +version = "1.0.3" dependencies = [ "alloy-rlp", "auto_impl", @@ -8766,7 +9769,7 @@ dependencies = [ [[package]] name = "reth-trie-parallel" -version = "1.0.6" +version = "1.0.3" dependencies = [ "alloy-rlp", "criterion", @@ -8794,8 +9797,7 @@ dependencies = [ [[package]] name = "revm" version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69eae90188e48c81588fe1987b4bd35cd90d69b3602cb0c3a9ab12b882f18d91" +source = "git+https://github.com/bnb-chain/revm?rev=d7b7e713ec398735d5e4a568c9e4ffed949bad5a#d7b7e713ec398735d5e4a568c9e4ffed949bad5a" dependencies = [ "auto_impl", "cfg-if", @@ -8827,8 +9829,7 @@ dependencies = [ [[package]] name = "revm-interpreter" version = "10.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7bad33a4f862ed8e2dc8bb5e7935852990da74f6db986732ef4f47f9021b2e4" +source = "git+https://github.com/bnb-chain/revm?rev=d7b7e713ec398735d5e4a568c9e4ffed949bad5a#d7b7e713ec398735d5e4a568c9e4ffed949bad5a" dependencies = [ "revm-primitives", "serde", @@ -8837,28 +9838,35 @@ dependencies = [ [[package]] name = "revm-precompile" version = "11.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24db0f8fb5bc636e18b4d36bdc4c402ea941be79cfbdb096469887b616959a46" +source = "git+https://github.com/bnb-chain/revm?rev=d7b7e713ec398735d5e4a568c9e4ffed949bad5a#d7b7e713ec398735d5e4a568c9e4ffed949bad5a" dependencies = [ + "alloy-rlp", "aurora-engine-modexp", + "bls_on_arkworks", "blst", "c-kzg", "cfg-if", + "cometbft", + "cometbft-light-client", + "cometbft-light-client-verifier", + "cometbft-proto", "k256", "once_cell", "p256", + "parity-bytes", + "prost 0.12.6", "revm-primitives", "ripemd", "secp256k1", "sha2 0.10.8", "substrate-bn", + "tendermint", ] [[package]] name = "revm-primitives" version = "9.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c13132ed599b17fa9057fcfc1d37d2954921958f3b96173fc4f4cf52803b32c3" +source = "git+https://github.com/bnb-chain/revm?rev=d7b7e713ec398735d5e4a568c9e4ffed949bad5a#d7b7e713ec398735d5e4a568c9e4ffed949bad5a" dependencies = [ "alloy-eips", "alloy-primitives 0.8.0", @@ -8870,7 +9878,7 @@ dependencies = [ "dyn-clone", "enumn", "hashbrown 0.14.5", - "hex", + "hex 0.4.3", "serde", ] @@ -8923,6 +9931,28 @@ dependencies = [ "digest 0.10.7", ] +[[package]] +name = "ripemd160" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad5112e0dbbb87577bfbc56c42450235e3012ce336e29c5befd7807bd626da4a" +dependencies = [ + "block-buffer 0.7.3", + "digest 0.8.1", + "opaque-debug 0.2.3", +] + +[[package]] +name = "ripemd160" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2eca4ecc81b7f313189bf73ce724400a07da2a6dac19588b03c8bd76a2dcc251" +dependencies = [ + "block-buffer 0.9.0", + "digest 0.9.0", + "opaque-debug 0.3.1", +] + [[package]] name = "rlimit" version = "0.10.1" @@ -8938,7 +9968,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bb919243f34364b6bd2fc10ef797edbfa75f33c252e7998527479c6d6b47e1ec" dependencies = [ - "bytes", + "bytes 1.7.1", "rustc-hex", ] @@ -8977,7 +10007,7 @@ dependencies = [ "arbitrary", "ark-ff 0.3.0", "ark-ff 0.4.2", - "bytes", + "bytes 1.7.1", "fastrlp", "num-bigint", "num-traits", @@ -9053,6 +10083,18 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "rustls" +version = "0.21.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" +dependencies = [ + "log", + "ring", + "rustls-webpki 0.101.7", + "sct", +] + [[package]] name = "rustls" version = "0.23.12" @@ -9063,11 +10105,23 @@ dependencies = [ "once_cell", "ring", "rustls-pki-types", - "rustls-webpki", + "rustls-webpki 0.102.7", "subtle", "zeroize", ] +[[package]] +name = "rustls-native-certs" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" +dependencies = [ + "openssl-probe", + "rustls-pemfile 1.0.4", + "schannel", + "security-framework", +] + [[package]] name = "rustls-native-certs" version = "0.7.2" @@ -9075,12 +10129,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04182dffc9091a404e0fc069ea5cd60e5b866c3adf881eff99a32d048242dffa" dependencies = [ "openssl-probe", - "rustls-pemfile", + "rustls-pemfile 2.1.3", "rustls-pki-types", "schannel", "security-framework", ] +[[package]] +name = "rustls-pemfile" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +dependencies = [ + "base64 0.21.7", +] + [[package]] name = "rustls-pemfile" version = "2.1.3" @@ -9108,10 +10171,10 @@ dependencies = [ "jni", "log", "once_cell", - "rustls", - "rustls-native-certs", + "rustls 0.23.12", + "rustls-native-certs 0.7.2", "rustls-platform-verifier-android", - "rustls-webpki", + "rustls-webpki 0.102.7", "security-framework", "security-framework-sys", "webpki-roots", @@ -9124,6 +10187,16 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f87165f0995f63a9fbeea62b64d10b4d9d8e78ec6d7d51fb2125fda7bb36788f" +[[package]] +name = "rustls-webpki" +version = "0.101.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" +dependencies = [ + "ring", + "untrusted", +] + [[package]] name = "rustls-webpki" version = "0.102.7" @@ -9209,6 +10282,16 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "sct" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" +dependencies = [ + "ring", + "untrusted", +] + [[package]] name = "sdd" version = "3.0.2" @@ -9223,7 +10306,7 @@ checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" dependencies = [ "base16ct", "der", - "generic-array", + "generic-array 0.14.7", "pkcs8", "subtle", "zeroize", @@ -9330,6 +10413,16 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_cbor" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bef2ebfde456fb76bbcf9f59315333decc4fda0b2b44b420243c11e0f5ec1f5" +dependencies = [ + "half 1.8.3", + "serde", +] + [[package]] name = "serde_derive" version = "1.0.209" @@ -9365,6 +10458,17 @@ dependencies = [ "thiserror", ] +[[package]] +name = "serde_repr" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.76", +] + [[package]] name = "serde_spanned" version = "0.6.7" @@ -9394,7 +10498,7 @@ checksum = "69cecfa94848272156ea67b2b1a53f20fc7bc638c4a46d2f8abde08f05f4b857" dependencies = [ "base64 0.22.1", "chrono", - "hex", + "hex 0.4.3", "indexmap 1.9.3", "indexmap 2.4.0", "serde", @@ -9452,6 +10556,18 @@ dependencies = [ "digest 0.10.7", ] +[[package]] +name = "sha2" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a256f46ea78a0c0d9ff00077504903ac881a1dafdc20da66545699e7776b3e69" +dependencies = [ + "block-buffer 0.7.3", + "digest 0.8.1", + "fake-simd", + "opaque-debug 0.2.3", +] + [[package]] name = "sha2" version = "0.9.9" @@ -9462,7 +10578,7 @@ dependencies = [ "cfg-if", "cpufeatures", "digest 0.9.0", - "opaque-debug", + "opaque-debug 0.3.1", ] [[package]] @@ -9476,6 +10592,19 @@ dependencies = [ "digest 0.10.7", ] +[[package]] +name = "sha3" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd26bc0e7a2e3a7c959bc494caf58b72ee0c71d67704e9520f736ca7e4853ecf" +dependencies = [ + "block-buffer 0.7.3", + "byte-tools", + "digest 0.8.1", + "keccak", + "opaque-debug 0.2.3", +] + [[package]] name = "sha3" version = "0.10.8" @@ -9550,6 +10679,12 @@ dependencies = [ "libc", ] +[[package]] +name = "signature" +version = "1.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" + [[package]] name = "signature" version = "2.2.0" @@ -9566,7 +10701,7 @@ version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1de1d4f81173b03af4c0cbed3c898f6bff5b870e4a7f5d6f4057d62a7a4b686e" dependencies = [ - "bstr", + "bstr 1.10.0", "unicode-segmentation", ] @@ -9656,9 +10791,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37468c595637c10857701c990f93a40ce0e357cedb0953d1c26c8d8027f9bb53" dependencies = [ "base64 0.22.1", - "bytes", + "bytes 1.7.1", "futures", - "http", + "http 1.1.0", "httparse", "log", "rand 0.8.5", @@ -9762,6 +10897,21 @@ version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" +[[package]] +name = "subtle-encoding" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dcb1ed7b8330c5eed5441052651dd7a12c75e2ed88f2ec024ae1fa3a5e59945" +dependencies = [ + "zeroize", +] + +[[package]] +name = "subtle-ng" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "734676eb262c623cec13c3155096e08d1f8f29adce39ba17948b18dad1e54142" + [[package]] name = "sucds" version = "0.8.1" @@ -9829,6 +10979,12 @@ dependencies = [ "syn 2.0.76", ] +[[package]] +name = "sync_wrapper" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + [[package]] name = "sync_wrapper" version = "1.0.1" @@ -9838,6 +10994,18 @@ dependencies = [ "futures-core", ] +[[package]] +name = "synstructure" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", + "unicode-xid", +] + [[package]] name = "synstructure" version = "0.13.1" @@ -9863,6 +11031,27 @@ dependencies = [ "windows 0.52.0", ] +[[package]] +name = "system-configuration" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "tap" version = "1.0.1" @@ -9882,6 +11071,65 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "tendermint" +version = "0.17.0" +source = "git+https://github.com/bnb-chain/tendermint-rs-parlia?rev=8c21ccbd58a174e07eed2c9343e63ccd00f0fbd5#8c21ccbd58a174e07eed2c9343e63ccd00f0fbd5" +dependencies = [ + "anomaly", + "async-trait", + "bstr 0.2.17", + "byteorder", + "bytes 0.5.6", + "chrono", + "ed25519 1.5.3", + "ed25519-dalek 1.0.1", + "futures", + "hex 0.3.2", + "ics23", + "k256", + "num-traits", + "once_cell", + "parity-bytes", + "prost 0.6.1", + "prost-amino", + "prost-amino-derive", + "prost-types 0.6.1", + "ripemd160 0.9.1", + "serde", + "serde_bytes", + "serde_json", + "serde_repr", + "sha2 0.9.9", + "signature 1.6.4", + "subtle", + "subtle-encoding", + "tendermint-proto", + "thiserror", + "toml 0.5.11", + "zeroize", +] + +[[package]] +name = "tendermint-proto" +version = "0.17.0" +source = "git+https://github.com/bnb-chain/tendermint-rs-parlia?rev=8c21ccbd58a174e07eed2c9343e63ccd00f0fbd5#8c21ccbd58a174e07eed2c9343e63ccd00f0fbd5" +dependencies = [ + "anomaly", + "bytes 0.5.6", + "chrono", + "num-derive 0.3.3", + "num-traits", + "prost 0.6.1", + "prost-amino", + "prost-amino-derive", + "prost-types 0.6.1", + "serde", + "serde_bytes", + "subtle-encoding", + "thiserror", +] + [[package]] name = "termcolor" version = "1.4.1" @@ -9941,7 +11189,7 @@ version = "5.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ba7fe4e29cb917d48fcd18324ed745b6d5e43e9bea76f5f85eb8352f5829ac1" dependencies = [ - "hex", + "hex 0.4.3", "num-traits", "serde", "sha1", @@ -10129,7 +11377,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9babc99b9923bfa4804bd74722ff02c0381021eafa4db9949217e3be8e84fff5" dependencies = [ "backtrace", - "bytes", + "bytes 1.7.1", "libc", "mio 1.0.2", "parking_lot 0.12.3", @@ -10151,13 +11399,23 @@ dependencies = [ "syn 2.0.76", ] +[[package]] +name = "tokio-rustls" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +dependencies = [ + "rustls 0.21.12", + "tokio", +] + [[package]] name = "tokio-rustls" version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ - "rustls", + "rustls 0.23.12", "rustls-pki-types", "tokio", ] @@ -10182,10 +11440,10 @@ checksum = "c6989540ced10490aaf14e6bad2e3d33728a2813310a0c71d1574304c49631cd" dependencies = [ "futures-util", "log", - "rustls", + "rustls 0.23.12", "rustls-pki-types", "tokio", - "tokio-rustls", + "tokio-rustls 0.26.0", "tungstenite", "webpki-roots", ] @@ -10196,7 +11454,7 @@ version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" dependencies = [ - "bytes", + "bytes 1.7.1", "futures-core", "futures-io", "futures-sink", @@ -10205,6 +11463,15 @@ dependencies = [ "tokio", ] +[[package]] +name = "toml" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +dependencies = [ + "serde", +] + [[package]] name = "toml" version = "0.8.19" @@ -10269,11 +11536,11 @@ dependencies = [ "async-compression", "base64 0.21.7", "bitflags 2.6.0", - "bytes", + "bytes 1.7.1", "futures-core", "futures-util", - "http", - "http-body", + "http 1.1.0", + "http-body 1.0.1", "http-body-util", "http-range-header", "httpdate", @@ -10496,7 +11763,7 @@ dependencies = [ "serde_derive", "serde_json", "termcolor", - "toml", + "toml 0.8.19", ] [[package]] @@ -10506,13 +11773,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e2e2ce1e47ed2994fd43b04c8f618008d4cabdd5ee34027cf14f9d918edd9c8" dependencies = [ "byteorder", - "bytes", + "bytes 1.7.1", "data-encoding", - "http", + "http 1.1.0", "httparse", "log", "rand 0.8.5", - "rustls", + "rustls 0.23.12", "rustls-pki-types", "sha1", "thiserror", @@ -10539,7 +11806,7 @@ checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52" dependencies = [ "byteorder", "crunchy", - "hex", + "hex 0.4.3", "static_assertions", ] @@ -11222,7 +12489,7 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.76", - "synstructure", + "synstructure 0.13.1", ] [[package]] @@ -11264,7 +12531,7 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.76", - "synstructure", + "synstructure 0.13.1", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index e640006be..b03dfee84 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,6 +14,7 @@ members = [ "crates/blockchain-tree-api/", "crates/blockchain-tree/", "crates/chain-state/", + "crates/bsc/chainspec", "crates/bsc/cli", "crates/bsc/consensus", "crates/bsc/node/", @@ -289,6 +290,7 @@ reth-auto-seal-consensus = { path = "crates/consensus/auto-seal" } reth-basic-payload-builder = { path = "crates/payload/basic" } reth-beacon-consensus = { path = "crates/consensus/beacon" } reth-bench = { path = "bin/reth-bench" } +reth-bsc-chainspec = { path = "crates/bsc/chainspec" } reth-bsc-cli = { path = "crates/bsc/cli" } reth-bsc-consensus = { path = "crates/bsc/consensus" } reth-blockchain-tree = { path = "crates/blockchain-tree" } @@ -417,9 +419,9 @@ revm-primitives = { version = "9.0.0", features = [ ], default-features = false } # eth -alloy-chains = "0.1.18" +alloy-chains = "=0.1.18" alloy-dyn-abi = "0.8.0" -alloy-json-abi = "0.7.2" +alloy-json-abi = "0.8.0" alloy-primitives = { version = "0.8.0", default-features = false } alloy-rlp = "0.3.4" alloy-sol-types = "0.8.0" @@ -576,15 +578,17 @@ tempfile = "3.8" test-fuzz = "5" [patch.crates-io] -revm = { git = "https://github.com/bnb-chain/revm", tag = "v1.0.1" } -revm-interpreter = { git = "https://github.com/bnb-chain/revm", tag = "v1.0.1" } -revm-precompile = { git = "https://github.com/bnb-chain/revm", tag = "v1.0.1" } -revm-primitives = { git = "https://github.com/bnb-chain/revm", tag = "v1.0.1" } +revm = { git = "https://github.com/bnb-chain/revm", rev = "d7b7e713ec398735d5e4a568c9e4ffed949bad5a" } +revm-interpreter = { git = "https://github.com/bnb-chain/revm", rev = "d7b7e713ec398735d5e4a568c9e4ffed949bad5a" } +revm-precompile = { git = "https://github.com/bnb-chain/revm", rev = "d7b7e713ec398735d5e4a568c9e4ffed949bad5a" } +revm-primitives = { git = "https://github.com/bnb-chain/revm", rev = "d7b7e713ec398735d5e4a568c9e4ffed949bad5a" } alloy-chains = { git = "https://github.com/bnb-chain/alloy-chains-rs.git", tag = "v1.0.0" } -alloy-rpc-types-eth = { git = "https://github.com/bnb-chain/alloy", tag = "v1.0.0" } -alloy-consensus = { git = "https://github.com/bnb-chain/alloy", tag = "v1.0.0" } -alloy-eips = { git = "https://github.com/bnb-chain/alloy", tag = "v1.0.0" } -alloy-network = { git = "https://github.com/bnb-chain/alloy", tag = "v1.0.0" } -alloy-serde = { git = "https://github.com/bnb-chain/alloy", tag = "v1.0.0" } -alloy-signer = { git = "https://github.com/bnb-chain/alloy", tag = "v1.0.0" } -alloy-signer-local = { git = "https://github.com/bnb-chain/alloy", tag = "v1.0.0" } +alloy-rpc-types-eth = { git = "https://github.com/bnb-chain/alloy", rev = "133e5b3dd8af4bc1ceb9018be42c156727eef619" } +alloy-consensus = { git = "https://github.com/bnb-chain/alloy", rev = "133e5b3dd8af4bc1ceb9018be42c156727eef619" } +alloy-eips = { git = "https://github.com/bnb-chain/alloy", rev = "133e5b3dd8af4bc1ceb9018be42c156727eef619" } +alloy-network = { git = "https://github.com/bnb-chain/alloy", rev = "133e5b3dd8af4bc1ceb9018be42c156727eef619" } +alloy-serde = { git = "https://github.com/bnb-chain/alloy", rev = "133e5b3dd8af4bc1ceb9018be42c156727eef619" } +alloy-signer = { git = "https://github.com/bnb-chain/alloy", rev = "133e5b3dd8af4bc1ceb9018be42c156727eef619" } +alloy-signer-local = { git = "https://github.com/bnb-chain/alloy", rev = "133e5b3dd8af4bc1ceb9018be42c156727eef619" } +alloy-provider = { git = "https://github.com/bnb-chain/alloy", rev = "133e5b3dd8af4bc1ceb9018be42c156727eef619" } +alloy-transport-http = { git = "https://github.com/bnb-chain/alloy", rev = "133e5b3dd8af4bc1ceb9018be42c156727eef619" } diff --git a/Dockerfile b/Dockerfile index 8f6989965..26a1ad890 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM lukemathwalker/cargo-chef:latest-rust-1.79 AS chef +FROM lukemathwalker/cargo-chef:latest-rust-1.80 AS chef WORKDIR /app LABEL org.opencontainers.image.source=https://github.com/paradigmxyz/reth diff --git a/Makefile b/Makefile index c387e52f7..6415e6ac8 100644 --- a/Makefile +++ b/Makefile @@ -547,6 +547,7 @@ check-features: cargo hack check \ --package reth-codecs \ --package reth-primitives-traits \ - --package reth-primitives \ --package reth-rpc-types \ - --feature-powerset \ No newline at end of file + --feature-powerset + +# --package reth-primitives \ \ No newline at end of file diff --git a/bin/reth/src/commands/debug_cmd/execution.rs b/bin/reth/src/commands/debug_cmd/execution.rs index 708382cd3..409b856f8 100644 --- a/bin/reth/src/commands/debug_cmd/execution.rs +++ b/bin/reth/src/commands/debug_cmd/execution.rs @@ -17,7 +17,7 @@ use reth_downloaders::{ headers::reverse_headers::ReverseHeadersDownloaderBuilder, }; use reth_exex::ExExManagerHandle; -use reth_network::{BlockDownloaderProvider, NetworkEventListenerProvider, NetworkHandle}; +use reth_network::{NetworkEventListenerProvider, NetworkHandle}; use reth_network_api::NetworkInfo; use reth_network_p2p::{headers::client::HeadersClient, BlockClient}; use reth_primitives::{BlockHashOrNumber, BlockNumber, B256}; diff --git a/bin/reth/src/commands/debug_cmd/in_memory_merkle.rs b/bin/reth/src/commands/debug_cmd/in_memory_merkle.rs index 12dbded2a..9256bb486 100644 --- a/bin/reth/src/commands/debug_cmd/in_memory_merkle.rs +++ b/bin/reth/src/commands/debug_cmd/in_memory_merkle.rs @@ -12,7 +12,7 @@ use reth_db::DatabaseEnv; use reth_errors::BlockValidationError; use reth_evm::execute::{BlockExecutorProvider, Executor}; use reth_execution_types::ExecutionOutcome; -use reth_network::{BlockDownloaderProvider, NetworkHandle}; +use reth_network::NetworkHandle; use reth_network_api::NetworkInfo; use reth_primitives::BlockHashOrNumber; use reth_provider::{ diff --git a/bin/reth/src/commands/debug_cmd/merkle.rs b/bin/reth/src/commands/debug_cmd/merkle.rs index 54013b66e..71b822fb3 100644 --- a/bin/reth/src/commands/debug_cmd/merkle.rs +++ b/bin/reth/src/commands/debug_cmd/merkle.rs @@ -13,7 +13,7 @@ use reth_consensus::Consensus; use reth_db::{tables, DatabaseEnv}; use reth_db_api::{cursor::DbCursorRO, transaction::DbTx}; use reth_evm::execute::{BatchExecutor, BlockExecutorProvider}; -use reth_network::{BlockDownloaderProvider, NetworkHandle}; +use reth_network::NetworkHandle; use reth_network_api::NetworkInfo; use reth_network_p2p::full_block::FullBlockClient; use reth_primitives::BlockHashOrNumber; diff --git a/bin/reth/src/commands/debug_cmd/replay_engine.rs b/bin/reth/src/commands/debug_cmd/replay_engine.rs index 5ae868e48..196ebf4f5 100644 --- a/bin/reth/src/commands/debug_cmd/replay_engine.rs +++ b/bin/reth/src/commands/debug_cmd/replay_engine.rs @@ -15,7 +15,7 @@ use reth_consensus::Consensus; use reth_db::DatabaseEnv; use reth_engine_util::engine_store::{EngineMessageStore, StoredEngineApiMessage}; use reth_fs_util as fs; -use reth_network::{BlockDownloaderProvider, NetworkHandle}; +use reth_network::NetworkHandle; use reth_network_api::NetworkInfo; use reth_payload_builder::{PayloadBuilderHandle, PayloadBuilderService}; use reth_provider::{ diff --git a/bsc.Dockerfile b/bsc.Dockerfile index 744eb993d..3743b985b 100644 --- a/bsc.Dockerfile +++ b/bsc.Dockerfile @@ -1,4 +1,4 @@ -FROM lukemathwalker/cargo-chef:latest-rust-1.79 AS chef +FROM lukemathwalker/cargo-chef:latest-rust-1.80 AS chef WORKDIR /app LABEL org.opencontainers.image.source=https://github.com/paradigmxyz/reth diff --git a/crates/blockchain-tree/src/chain.rs b/crates/blockchain-tree/src/chain.rs index 365aa4476..5fa3c9a48 100644 --- a/crates/blockchain-tree/src/chain.rs +++ b/crates/blockchain-tree/src/chain.rs @@ -213,7 +213,7 @@ impl AppendableChain { let block_hash = block.hash(); let block = block.unseal(); - let state = executor.execute((&block, U256::MAX).into())?; + let state = executor.execute((&block, U256::MAX, ancestor_blocks).into())?; externals.consensus.validate_block_post_execution( &block, PostExecutionInput::new(&state.receipts, &state.requests), diff --git a/crates/bsc/chainspec/Cargo.toml b/crates/bsc/chainspec/Cargo.toml index d4d9eb87f..70a7edfff 100644 --- a/crates/bsc/chainspec/Cargo.toml +++ b/crates/bsc/chainspec/Cargo.toml @@ -1,20 +1,20 @@ [package] -name = "reth-optimism-chainspec" +name = "reth-bsc-chainspec" version.workspace = true edition.workspace = true rust-version.workspace = true license.workspace = true homepage.workspace = true repository.workspace = true -description = "EVM chain spec implementation for optimism." +description = "EVM chain spec implementation for bsc." [lints] workspace = true [dependencies] # reth -reth-chainspec = { workspace = true, features = ["optimism"] } -reth-ethereum-forks = { workspace = true, features = ["optimism"] } +reth-chainspec = { workspace = true, features = ["bsc"] } +reth-ethereum-forks = { workspace = true, features = ["bsc"] } reth-primitives-traits.workspace = true # ethereum diff --git a/crates/bsc/chainspec/src/bsc.rs b/crates/bsc/chainspec/src/bsc.rs index 3259dec9b..743809590 100644 --- a/crates/bsc/chainspec/src/bsc.rs +++ b/crates/bsc/chainspec/src/bsc.rs @@ -1,34 +1,33 @@ -//! Chain specification for the OpBNB Mainnet network. +//! Chain specification for the BSC Mainnet network. #[cfg(not(feature = "std"))] use alloc::sync::Arc; #[cfg(feature = "std")] use std::sync::Arc; -use alloy_chains::Chain; +use alloy_chains::{Chain, NamedChain}; use alloy_primitives::{b256, U256}; use once_cell::sync::Lazy; use reth_chainspec::{BaseFeeParams, BaseFeeParamsKind, ChainSpec}; -use reth_ethereum_forks::{EthereumHardfork, OptimismHardfork}; +use reth_ethereum_forks::BscHardfork; -use crate::OpChainSpec; +use crate::BscChainSpec; -/// The OpBNB mainnet spec -pub static OPBNB_MAINNET: Lazy> = Lazy::new(|| { - OpChainSpec { +/// The BSC mainnet spec +pub static BSC_MAINNET: Lazy> = Lazy::new(|| { + BscChainSpec { inner: ChainSpec { - chain: Chain::opbnb_mainnet(), - genesis: serde_json::from_str(include_str!("../res/genesis/opbnb_mainnet.json")) - .expect("Can't deserialize opBNB mainent genesis json"), + chain: Chain::from_named(NamedChain::BNBSmartChain), + genesis: serde_json::from_str(include_str!("../res/genesis/bsc.json")) + .expect("Can't deserialize BSC Mainnet genesis json"), genesis_hash: Some(b256!( - "4dd61178c8b0f01670c231597e7bcb368e84545acd46d940a896d6a791dd6df4" + "0d21840abff46b96c84b2ac9e10e4f5cdaeb5693cb665db62a2f3b02d2d57b5b" )), paris_block_and_final_difficulty: Some((0, U256::from(0))), - hardforks: OptimismHardfork::opbnb_mainnet(), - base_fee_params: BaseFeeParamsKind::Variable( - vec![(EthereumHardfork::London.boxed(), BaseFeeParams::ethereum())].into(), - ), - prune_delete_limit: 0, + hardforks: BscHardfork::bsc_mainnet(), + deposit_contract: None, + base_fee_params: BaseFeeParamsKind::Constant(BaseFeeParams::new(1, 1)), + prune_delete_limit: 3500, ..Default::default() }, } diff --git a/crates/bsc/chainspec/src/bsc_chapel.rs b/crates/bsc/chainspec/src/bsc_chapel.rs index ed13cc9f2..b9665860a 100644 --- a/crates/bsc/chainspec/src/bsc_chapel.rs +++ b/crates/bsc/chainspec/src/bsc_chapel.rs @@ -9,22 +9,22 @@ use alloy_chains::{Chain, NamedChain}; use alloy_primitives::{b256, U256}; use once_cell::sync::Lazy; use reth_chainspec::{BaseFeeParams, BaseFeeParamsKind, ChainSpec}; -use reth_ethereum_forks::{BscHardfork}; +use reth_ethereum_forks::BscHardfork; use crate::BscChainSpec; /// The BSC mainnet spec -pub static BSC_MAINNET: Lazy> = Lazy::new(|| { +pub static BSC_CHAPEL: Lazy> = Lazy::new(|| { BscChainSpec { - inner: ChainSpec { - chain: Chain::from_named(NamedChain::BNBSmartChain), - genesis: serde_json::from_str(include_str!("../res/genesis/bsc.json")) - .expect("Can't deserialize BSC Mainnet genesis json"), + inner: ChainSpec { + chain: Chain::from_named(NamedChain::BNBSmartChainTestnet), + genesis: serde_json::from_str(include_str!("../res/genesis/bsc_rialto.json")) + .expect("Can't deserialize BSC Testnet genesis json"), genesis_hash: Some(b256!( - "0d21840abff46b96c84b2ac9e10e4f5cdaeb5693cb665db62a2f3b02d2d57b5b" - )), + "6d3c66c5357ec91d5c43af47e234a939b22557cbb552dc45bebbceeed90fbe34" + )), paris_block_and_final_difficulty: Some((0, U256::from(0))), - hardforks: BscHardfork::bsc_mainnet(), + hardforks: BscHardfork::bsc_testnet(), deposit_contract: None, base_fee_params: BaseFeeParamsKind::Constant(BaseFeeParams::new(1, 1)), prune_delete_limit: 3500, diff --git a/crates/bsc/chainspec/src/bsc_rialto.rs b/crates/bsc/chainspec/src/bsc_rialto.rs index eeae50569..211397e58 100644 --- a/crates/bsc/chainspec/src/bsc_rialto.rs +++ b/crates/bsc/chainspec/src/bsc_rialto.rs @@ -5,7 +5,7 @@ use alloc::sync::Arc; #[cfg(feature = "std")] use std::sync::Arc; -use alloy_chains::{Chain, NamedChain}; +use alloy_chains::Chain; use alloy_primitives::{b256, U256}; use once_cell::sync::Lazy; use reth_chainspec::{BaseFeeParams, BaseFeeParamsKind, ChainSpec}; diff --git a/crates/bsc/chainspec/src/lib.rs b/crates/bsc/chainspec/src/lib.rs index 9d0b9886e..ce87417cc 100644 --- a/crates/bsc/chainspec/src/lib.rs +++ b/crates/bsc/chainspec/src/lib.rs @@ -12,459 +12,449 @@ extern crate alloc; pub mod constants; -mod base; -mod base_sepolia; -mod dev; -mod op; -mod op_sepolia; -mod opbnb; -mod opbnb_testnet; -mod opbnb_qa; +mod bsc; +mod bsc_chapel; +mod bsc_rialto; -pub use base::BASE_MAINNET; -pub use base_sepolia::BASE_SEPOLIA; -pub use dev::OP_DEV; -pub use op::OP_MAINNET; -pub use op_sepolia::OP_SEPOLIA; -pub use opbnb::OPBNB_MAINNET; -pub use opbnb_testnet::OPBNB_TESTNET; -pub use opbnb_qa::OPBNB_QA; +pub use bsc::BSC_MAINNET; +pub use bsc_chapel::BSC_CHAPEL; +pub use bsc_rialto::BSC_RIALTO; use derive_more::{Constructor, Deref, Into}; use reth_chainspec::ChainSpec; -/// OP stack chain spec type. +/// Bsc chain spec type. #[derive(Debug, Deref, Into, Constructor)] -pub struct OpChainSpec { +pub struct BscChainSpec { /// [`ChainSpec`]. pub inner: ChainSpec, } -#[cfg(test)] -mod tests { - use alloy_genesis::Genesis; - use alloy_primitives::b256; - use reth_chainspec::{test_fork_ids, BaseFeeParams, BaseFeeParamsKind, ChainSpec}; - use reth_ethereum_forks::{ - EthereumHardfork, ForkCondition, ForkHash, ForkId, Head, OptimismHardfork, - OptimismHardforks, - }; - - use crate::*; - - #[test] - fn base_mainnet_forkids() { - test_fork_ids( - &BASE_MAINNET, - &[ - ( - Head { number: 0, ..Default::default() }, - ForkId { hash: ForkHash([0x67, 0xda, 0x02, 0x60]), next: 1704992401 }, - ), - ( - Head { number: 0, timestamp: 1704992400, ..Default::default() }, - ForkId { hash: ForkHash([0x67, 0xda, 0x02, 0x60]), next: 1704992401 }, - ), - ( - Head { number: 0, timestamp: 1704992401, ..Default::default() }, - ForkId { hash: ForkHash([0x3c, 0x28, 0x3c, 0xb3]), next: 1710374401 }, - ), - ( - Head { number: 0, timestamp: 1710374400, ..Default::default() }, - ForkId { hash: ForkHash([0x3c, 0x28, 0x3c, 0xb3]), next: 1710374401 }, - ), - ( - Head { number: 0, timestamp: 1710374401, ..Default::default() }, - ForkId { hash: ForkHash([0x51, 0xcc, 0x98, 0xb3]), next: 1720627201 }, - ), - ( - Head { number: 0, timestamp: 1720627200, ..Default::default() }, - ForkId { hash: ForkHash([0x51, 0xcc, 0x98, 0xb3]), next: 1720627201 }, - ), - ( - Head { number: 0, timestamp: 1720627201, ..Default::default() }, - ForkId { hash: ForkHash([0xe4, 0x01, 0x0e, 0xb9]), next: 1726070401 }, - ), - ( - Head { number: 0, timestamp: 1726070401, ..Default::default() }, - ForkId { hash: ForkHash([0xbc, 0x38, 0xf9, 0xca]), next: 0 }, - ), - ], - ); - } - - #[test] - fn op_sepolia_forkids() { - test_fork_ids( - &OP_SEPOLIA, - &[ - ( - Head { number: 0, ..Default::default() }, - ForkId { hash: ForkHash([0x67, 0xa4, 0x03, 0x28]), next: 1699981200 }, - ), - ( - Head { number: 0, timestamp: 1699981199, ..Default::default() }, - ForkId { hash: ForkHash([0x67, 0xa4, 0x03, 0x28]), next: 1699981200 }, - ), - ( - Head { number: 0, timestamp: 1699981200, ..Default::default() }, - ForkId { hash: ForkHash([0xa4, 0x8d, 0x6a, 0x00]), next: 1708534800 }, - ), - ( - Head { number: 0, timestamp: 1708534799, ..Default::default() }, - ForkId { hash: ForkHash([0xa4, 0x8d, 0x6a, 0x00]), next: 1708534800 }, - ), - ( - Head { number: 0, timestamp: 1708534800, ..Default::default() }, - ForkId { hash: ForkHash([0xcc, 0x17, 0xc7, 0xeb]), next: 1716998400 }, - ), - ( - Head { number: 0, timestamp: 1716998399, ..Default::default() }, - ForkId { hash: ForkHash([0xcc, 0x17, 0xc7, 0xeb]), next: 1716998400 }, - ), - ( - Head { number: 0, timestamp: 1716998400, ..Default::default() }, - ForkId { hash: ForkHash([0x54, 0x0a, 0x8c, 0x5d]), next: 1723478400 }, - ), - ( - Head { number: 0, timestamp: 1723478399, ..Default::default() }, - ForkId { hash: ForkHash([0x54, 0x0a, 0x8c, 0x5d]), next: 1723478400 }, - ), - ( - Head { number: 0, timestamp: 1723478400, ..Default::default() }, - ForkId { hash: ForkHash([0x75, 0xde, 0xa4, 0x1e]), next: 0 }, - ), - ], - ); - } - - #[test] - fn op_mainnet_forkids() { - test_fork_ids( - &OP_MAINNET, - &[ - ( - Head { number: 0, ..Default::default() }, - ForkId { hash: ForkHash([0xca, 0xf5, 0x17, 0xed]), next: 3950000 }, - ), - // TODO: complete these, see https://github.com/paradigmxyz/reth/issues/8012 - ( - Head { number: 105235063, timestamp: 1710374401, ..Default::default() }, - ForkId { hash: ForkHash([0x19, 0xda, 0x4c, 0x52]), next: 1720627201 }, - ), - ], - ); - } - - #[test] - fn base_sepolia_forkids() { - test_fork_ids( - &BASE_SEPOLIA, - &[ - ( - Head { number: 0, ..Default::default() }, - ForkId { hash: ForkHash([0xb9, 0x59, 0xb9, 0xf7]), next: 1699981200 }, - ), - ( - Head { number: 0, timestamp: 1699981199, ..Default::default() }, - ForkId { hash: ForkHash([0xb9, 0x59, 0xb9, 0xf7]), next: 1699981200 }, - ), - ( - Head { number: 0, timestamp: 1699981200, ..Default::default() }, - ForkId { hash: ForkHash([0x60, 0x7c, 0xd5, 0xa1]), next: 1708534800 }, - ), - ( - Head { number: 0, timestamp: 1708534799, ..Default::default() }, - ForkId { hash: ForkHash([0x60, 0x7c, 0xd5, 0xa1]), next: 1708534800 }, - ), - ( - Head { number: 0, timestamp: 1708534800, ..Default::default() }, - ForkId { hash: ForkHash([0xbe, 0x96, 0x9b, 0x17]), next: 1716998400 }, - ), - ( - Head { number: 0, timestamp: 1716998399, ..Default::default() }, - ForkId { hash: ForkHash([0xbe, 0x96, 0x9b, 0x17]), next: 1716998400 }, - ), - ( - Head { number: 0, timestamp: 1716998400, ..Default::default() }, - ForkId { hash: ForkHash([0x4e, 0x45, 0x7a, 0x49]), next: 1723478400 }, - ), - ( - Head { number: 0, timestamp: 1723478399, ..Default::default() }, - ForkId { hash: ForkHash([0x4e, 0x45, 0x7a, 0x49]), next: 1723478400 }, - ), - ( - Head { number: 0, timestamp: 1723478400, ..Default::default() }, - ForkId { hash: ForkHash([0x5e, 0xdf, 0xa3, 0xb6]), next: 0 }, - ), - ], - ); - } - - #[test] - fn base_mainnet_genesis() { - let genesis = BASE_MAINNET.genesis_header(); - assert_eq!( - genesis.hash_slow(), - b256!("f712aa9241cc24369b143cf6dce85f0902a9731e70d66818a3a5845b296c73dd") - ); - let base_fee = genesis - .next_block_base_fee(BASE_MAINNET.base_fee_params_at_timestamp(genesis.timestamp)) - .unwrap(); - // - assert_eq!(base_fee, 980000000); - } - - #[test] - fn base_sepolia_genesis() { - let genesis = BASE_SEPOLIA.genesis_header(); - assert_eq!( - genesis.hash_slow(), - b256!("0dcc9e089e30b90ddfc55be9a37dd15bc551aeee999d2e2b51414c54eaf934e4") - ); - let base_fee = genesis - .next_block_base_fee(BASE_SEPOLIA.base_fee_params_at_timestamp(genesis.timestamp)) - .unwrap(); - // - assert_eq!(base_fee, 980000000); - } - - #[test] - fn op_sepolia_genesis() { - let genesis = OP_SEPOLIA.genesis_header(); - assert_eq!( - genesis.hash_slow(), - b256!("102de6ffb001480cc9b8b548fd05c34cd4f46ae4aa91759393db90ea0409887d") - ); - let base_fee = genesis - .next_block_base_fee(OP_SEPOLIA.base_fee_params_at_timestamp(genesis.timestamp)) - .unwrap(); - // - assert_eq!(base_fee, 980000000); - } - - #[test] - fn latest_base_mainnet_fork_id() { - assert_eq!( - ForkId { hash: ForkHash([0xbc, 0x38, 0xf9, 0xca]), next: 0 }, - BASE_MAINNET.latest_fork_id() - ) - } - - #[test] - fn is_bedrock_active() { - assert!(!OP_MAINNET.is_bedrock_active_at_block(1)) - } - - #[test] - fn parse_optimism_hardforks() { - let geth_genesis = r#" - { - "config": { - "bedrockBlock": 10, - "regolithTime": 20, - "canyonTime": 30, - "ecotoneTime": 40, - "fjordTime": 50, - "graniteTime": 51, - "optimism": { - "eip1559Elasticity": 60, - "eip1559Denominator": 70 - } - } - } - "#; - let genesis: Genesis = serde_json::from_str(geth_genesis).unwrap(); - - let actual_bedrock_block = genesis.config.extra_fields.get("bedrockBlock"); - assert_eq!(actual_bedrock_block, Some(serde_json::Value::from(10)).as_ref()); - let actual_regolith_timestamp = genesis.config.extra_fields.get("regolithTime"); - assert_eq!(actual_regolith_timestamp, Some(serde_json::Value::from(20)).as_ref()); - let actual_canyon_timestamp = genesis.config.extra_fields.get("canyonTime"); - assert_eq!(actual_canyon_timestamp, Some(serde_json::Value::from(30)).as_ref()); - let actual_ecotone_timestamp = genesis.config.extra_fields.get("ecotoneTime"); - assert_eq!(actual_ecotone_timestamp, Some(serde_json::Value::from(40)).as_ref()); - let actual_fjord_timestamp = genesis.config.extra_fields.get("fjordTime"); - assert_eq!(actual_fjord_timestamp, Some(serde_json::Value::from(50)).as_ref()); - let actual_granite_timestamp = genesis.config.extra_fields.get("graniteTime"); - assert_eq!(actual_granite_timestamp, Some(serde_json::Value::from(51)).as_ref()); - - let optimism_object = genesis.config.extra_fields.get("optimism").unwrap(); - assert_eq!( - optimism_object, - &serde_json::json!({ - "eip1559Elasticity": 60, - "eip1559Denominator": 70, - }) - ); - - let chain_spec: ChainSpec = genesis.into(); - - assert_eq!( - chain_spec.base_fee_params, - BaseFeeParamsKind::Constant(BaseFeeParams::new(70, 60)) - ); - - assert!(!chain_spec.is_fork_active_at_block(OptimismHardfork::Bedrock, 0)); - assert!(!chain_spec.is_fork_active_at_timestamp(OptimismHardfork::Regolith, 0)); - assert!(!chain_spec.is_fork_active_at_timestamp(OptimismHardfork::Canyon, 0)); - assert!(!chain_spec.is_fork_active_at_timestamp(OptimismHardfork::Ecotone, 0)); - assert!(!chain_spec.is_fork_active_at_timestamp(OptimismHardfork::Fjord, 0)); - assert!(!chain_spec.is_fork_active_at_timestamp(OptimismHardfork::Granite, 0)); - - assert!(chain_spec.is_fork_active_at_block(OptimismHardfork::Bedrock, 10)); - assert!(chain_spec.is_fork_active_at_timestamp(OptimismHardfork::Regolith, 20)); - assert!(chain_spec.is_fork_active_at_timestamp(OptimismHardfork::Canyon, 30)); - assert!(chain_spec.is_fork_active_at_timestamp(OptimismHardfork::Ecotone, 40)); - assert!(chain_spec.is_fork_active_at_timestamp(OptimismHardfork::Fjord, 50)); - assert!(chain_spec.is_fork_active_at_timestamp(OptimismHardfork::Granite, 51)); - } - - #[test] - fn parse_optimism_hardforks_variable_base_fee_params() { - let geth_genesis = r#" - { - "config": { - "bedrockBlock": 10, - "regolithTime": 20, - "canyonTime": 30, - "ecotoneTime": 40, - "fjordTime": 50, - "graniteTime": 51, - "optimism": { - "eip1559Elasticity": 60, - "eip1559Denominator": 70, - "eip1559DenominatorCanyon": 80 - } - } - } - "#; - let genesis: Genesis = serde_json::from_str(geth_genesis).unwrap(); - - let actual_bedrock_block = genesis.config.extra_fields.get("bedrockBlock"); - assert_eq!(actual_bedrock_block, Some(serde_json::Value::from(10)).as_ref()); - let actual_regolith_timestamp = genesis.config.extra_fields.get("regolithTime"); - assert_eq!(actual_regolith_timestamp, Some(serde_json::Value::from(20)).as_ref()); - let actual_canyon_timestamp = genesis.config.extra_fields.get("canyonTime"); - assert_eq!(actual_canyon_timestamp, Some(serde_json::Value::from(30)).as_ref()); - let actual_ecotone_timestamp = genesis.config.extra_fields.get("ecotoneTime"); - assert_eq!(actual_ecotone_timestamp, Some(serde_json::Value::from(40)).as_ref()); - let actual_fjord_timestamp = genesis.config.extra_fields.get("fjordTime"); - assert_eq!(actual_fjord_timestamp, Some(serde_json::Value::from(50)).as_ref()); - let actual_granite_timestamp = genesis.config.extra_fields.get("graniteTime"); - assert_eq!(actual_granite_timestamp, Some(serde_json::Value::from(51)).as_ref()); - - let optimism_object = genesis.config.extra_fields.get("optimism").unwrap(); - assert_eq!( - optimism_object, - &serde_json::json!({ - "eip1559Elasticity": 60, - "eip1559Denominator": 70, - "eip1559DenominatorCanyon": 80 - }) - ); - - let chain_spec: ChainSpec = genesis.into(); - - assert_eq!( - chain_spec.base_fee_params, - BaseFeeParamsKind::Variable( - vec![ - (EthereumHardfork::London.boxed(), BaseFeeParams::new(70, 60)), - (OptimismHardfork::Canyon.boxed(), BaseFeeParams::new(80, 60)), - ] - .into() - ) - ); - - assert!(!chain_spec.is_fork_active_at_block(OptimismHardfork::Bedrock, 0)); - assert!(!chain_spec.is_fork_active_at_timestamp(OptimismHardfork::Regolith, 0)); - assert!(!chain_spec.is_fork_active_at_timestamp(OptimismHardfork::Canyon, 0)); - assert!(!chain_spec.is_fork_active_at_timestamp(OptimismHardfork::Ecotone, 0)); - assert!(!chain_spec.is_fork_active_at_timestamp(OptimismHardfork::Fjord, 0)); - assert!(!chain_spec.is_fork_active_at_timestamp(OptimismHardfork::Granite, 0)); - - assert!(chain_spec.is_fork_active_at_block(OptimismHardfork::Bedrock, 10)); - assert!(chain_spec.is_fork_active_at_timestamp(OptimismHardfork::Regolith, 20)); - assert!(chain_spec.is_fork_active_at_timestamp(OptimismHardfork::Canyon, 30)); - assert!(chain_spec.is_fork_active_at_timestamp(OptimismHardfork::Ecotone, 40)); - assert!(chain_spec.is_fork_active_at_timestamp(OptimismHardfork::Fjord, 50)); - assert!(chain_spec.is_fork_active_at_timestamp(OptimismHardfork::Granite, 51)); - } - - #[test] - fn parse_genesis_optimism_with_variable_base_fee_params() { - use op_alloy_rpc_types::genesis::OptimismBaseFeeInfo; - - let geth_genesis = r#" - { - "config": { - "chainId": 8453, - "homesteadBlock": 0, - "eip150Block": 0, - "eip155Block": 0, - "eip158Block": 0, - "byzantiumBlock": 0, - "constantinopleBlock": 0, - "petersburgBlock": 0, - "istanbulBlock": 0, - "muirGlacierBlock": 0, - "berlinBlock": 0, - "londonBlock": 0, - "arrowGlacierBlock": 0, - "grayGlacierBlock": 0, - "mergeNetsplitBlock": 0, - "bedrockBlock": 0, - "regolithTime": 15, - "terminalTotalDifficulty": 0, - "terminalTotalDifficultyPassed": true, - "optimism": { - "eip1559Elasticity": 6, - "eip1559Denominator": 50 - } - } - } - "#; - let genesis: Genesis = serde_json::from_str(geth_genesis).unwrap(); - let chainspec = ChainSpec::from(genesis.clone()); - - let actual_chain_id = genesis.config.chain_id; - assert_eq!(actual_chain_id, 8453); - - assert_eq!( - chainspec.hardforks.get(EthereumHardfork::Istanbul), - Some(ForkCondition::Block(0)) - ); - - let actual_bedrock_block = genesis.config.extra_fields.get("bedrockBlock"); - assert_eq!(actual_bedrock_block, Some(serde_json::Value::from(0)).as_ref()); - let actual_canyon_timestamp = genesis.config.extra_fields.get("canyonTime"); - assert_eq!(actual_canyon_timestamp, None); - - assert!(genesis.config.terminal_total_difficulty_passed); - - let optimism_object = genesis.config.extra_fields.get("optimism").unwrap(); - let optimism_base_fee_info = - serde_json::from_value::(optimism_object.clone()).unwrap(); - - assert_eq!( - optimism_base_fee_info, - OptimismBaseFeeInfo { - eip1559_elasticity: Some(6), - eip1559_denominator: Some(50), - eip1559_denominator_canyon: None, - } - ); - assert_eq!( - chainspec.base_fee_params, - BaseFeeParamsKind::Constant(BaseFeeParams { - max_change_denominator: 50, - elasticity_multiplier: 6, - }) - ); - - assert!(chainspec.is_fork_active_at_block(OptimismHardfork::Bedrock, 0)); - - assert!(chainspec.is_fork_active_at_timestamp(OptimismHardfork::Regolith, 20)); - } -} +// #[cfg(test)] +// mod tests { +// use alloy_genesis::Genesis; +// use alloy_primitives::b256; +// use reth_chainspec::{test_fork_ids, BaseFeeParams, BaseFeeParamsKind, ChainSpec}; +// use reth_ethereum_forks::{ +// EthereumHardfork, ForkCondition, ForkHash, ForkId, Head, OptimismHardfork, +// OptimismHardforks, +// }; +// +// use crate::*; +// +// #[test] +// fn base_mainnet_forkids() { +// test_fork_ids( +// &BASE_MAINNET, +// &[ +// ( +// Head { number: 0, ..Default::default() }, +// ForkId { hash: ForkHash([0x67, 0xda, 0x02, 0x60]), next: 1704992401 }, +// ), +// ( +// Head { number: 0, timestamp: 1704992400, ..Default::default() }, +// ForkId { hash: ForkHash([0x67, 0xda, 0x02, 0x60]), next: 1704992401 }, +// ), +// ( +// Head { number: 0, timestamp: 1704992401, ..Default::default() }, +// ForkId { hash: ForkHash([0x3c, 0x28, 0x3c, 0xb3]), next: 1710374401 }, +// ), +// ( +// Head { number: 0, timestamp: 1710374400, ..Default::default() }, +// ForkId { hash: ForkHash([0x3c, 0x28, 0x3c, 0xb3]), next: 1710374401 }, +// ), +// ( +// Head { number: 0, timestamp: 1710374401, ..Default::default() }, +// ForkId { hash: ForkHash([0x51, 0xcc, 0x98, 0xb3]), next: 1720627201 }, +// ), +// ( +// Head { number: 0, timestamp: 1720627200, ..Default::default() }, +// ForkId { hash: ForkHash([0x51, 0xcc, 0x98, 0xb3]), next: 1720627201 }, +// ), +// ( +// Head { number: 0, timestamp: 1720627201, ..Default::default() }, +// ForkId { hash: ForkHash([0xe4, 0x01, 0x0e, 0xb9]), next: 1726070401 }, +// ), +// ( +// Head { number: 0, timestamp: 1726070401, ..Default::default() }, +// ForkId { hash: ForkHash([0xbc, 0x38, 0xf9, 0xca]), next: 0 }, +// ), +// ], +// ); +// } +// +// #[test] +// fn op_sepolia_forkids() { +// test_fork_ids( +// &OP_SEPOLIA, +// &[ +// ( +// Head { number: 0, ..Default::default() }, +// ForkId { hash: ForkHash([0x67, 0xa4, 0x03, 0x28]), next: 1699981200 }, +// ), +// ( +// Head { number: 0, timestamp: 1699981199, ..Default::default() }, +// ForkId { hash: ForkHash([0x67, 0xa4, 0x03, 0x28]), next: 1699981200 }, +// ), +// ( +// Head { number: 0, timestamp: 1699981200, ..Default::default() }, +// ForkId { hash: ForkHash([0xa4, 0x8d, 0x6a, 0x00]), next: 1708534800 }, +// ), +// ( +// Head { number: 0, timestamp: 1708534799, ..Default::default() }, +// ForkId { hash: ForkHash([0xa4, 0x8d, 0x6a, 0x00]), next: 1708534800 }, +// ), +// ( +// Head { number: 0, timestamp: 1708534800, ..Default::default() }, +// ForkId { hash: ForkHash([0xcc, 0x17, 0xc7, 0xeb]), next: 1716998400 }, +// ), +// ( +// Head { number: 0, timestamp: 1716998399, ..Default::default() }, +// ForkId { hash: ForkHash([0xcc, 0x17, 0xc7, 0xeb]), next: 1716998400 }, +// ), +// ( +// Head { number: 0, timestamp: 1716998400, ..Default::default() }, +// ForkId { hash: ForkHash([0x54, 0x0a, 0x8c, 0x5d]), next: 1723478400 }, +// ), +// ( +// Head { number: 0, timestamp: 1723478399, ..Default::default() }, +// ForkId { hash: ForkHash([0x54, 0x0a, 0x8c, 0x5d]), next: 1723478400 }, +// ), +// ( +// Head { number: 0, timestamp: 1723478400, ..Default::default() }, +// ForkId { hash: ForkHash([0x75, 0xde, 0xa4, 0x1e]), next: 0 }, +// ), +// ], +// ); +// } +// +// #[test] +// fn op_mainnet_forkids() { +// test_fork_ids( +// &OP_MAINNET, +// &[ +// ( +// Head { number: 0, ..Default::default() }, +// ForkId { hash: ForkHash([0xca, 0xf5, 0x17, 0xed]), next: 3950000 }, +// ), +// // TODO: complete these, see https://github.com/paradigmxyz/reth/issues/8012 +// ( +// Head { number: 105235063, timestamp: 1710374401, ..Default::default() }, +// ForkId { hash: ForkHash([0x19, 0xda, 0x4c, 0x52]), next: 1720627201 }, +// ), +// ], +// ); +// } +// +// #[test] +// fn base_sepolia_forkids() { +// test_fork_ids( +// &BASE_SEPOLIA, +// &[ +// ( +// Head { number: 0, ..Default::default() }, +// ForkId { hash: ForkHash([0xb9, 0x59, 0xb9, 0xf7]), next: 1699981200 }, +// ), +// ( +// Head { number: 0, timestamp: 1699981199, ..Default::default() }, +// ForkId { hash: ForkHash([0xb9, 0x59, 0xb9, 0xf7]), next: 1699981200 }, +// ), +// ( +// Head { number: 0, timestamp: 1699981200, ..Default::default() }, +// ForkId { hash: ForkHash([0x60, 0x7c, 0xd5, 0xa1]), next: 1708534800 }, +// ), +// ( +// Head { number: 0, timestamp: 1708534799, ..Default::default() }, +// ForkId { hash: ForkHash([0x60, 0x7c, 0xd5, 0xa1]), next: 1708534800 }, +// ), +// ( +// Head { number: 0, timestamp: 1708534800, ..Default::default() }, +// ForkId { hash: ForkHash([0xbe, 0x96, 0x9b, 0x17]), next: 1716998400 }, +// ), +// ( +// Head { number: 0, timestamp: 1716998399, ..Default::default() }, +// ForkId { hash: ForkHash([0xbe, 0x96, 0x9b, 0x17]), next: 1716998400 }, +// ), +// ( +// Head { number: 0, timestamp: 1716998400, ..Default::default() }, +// ForkId { hash: ForkHash([0x4e, 0x45, 0x7a, 0x49]), next: 1723478400 }, +// ), +// ( +// Head { number: 0, timestamp: 1723478399, ..Default::default() }, +// ForkId { hash: ForkHash([0x4e, 0x45, 0x7a, 0x49]), next: 1723478400 }, +// ), +// ( +// Head { number: 0, timestamp: 1723478400, ..Default::default() }, +// ForkId { hash: ForkHash([0x5e, 0xdf, 0xa3, 0xb6]), next: 0 }, +// ), +// ], +// ); +// } +// +// #[test] +// fn base_mainnet_genesis() { +// let genesis = BASE_MAINNET.genesis_header(); +// assert_eq!( +// genesis.hash_slow(), +// b256!("f712aa9241cc24369b143cf6dce85f0902a9731e70d66818a3a5845b296c73dd") +// ); +// let base_fee = genesis +// .next_block_base_fee(BASE_MAINNET.base_fee_params_at_timestamp(genesis.timestamp)) +// .unwrap(); +// // +// assert_eq!(base_fee, 980000000); +// } +// +// #[test] +// fn base_sepolia_genesis() { +// let genesis = BASE_SEPOLIA.genesis_header(); +// assert_eq!( +// genesis.hash_slow(), +// b256!("0dcc9e089e30b90ddfc55be9a37dd15bc551aeee999d2e2b51414c54eaf934e4") +// ); +// let base_fee = genesis +// .next_block_base_fee(BASE_SEPOLIA.base_fee_params_at_timestamp(genesis.timestamp)) +// .unwrap(); +// // +// assert_eq!(base_fee, 980000000); +// } +// +// #[test] +// fn op_sepolia_genesis() { +// let genesis = OP_SEPOLIA.genesis_header(); +// assert_eq!( +// genesis.hash_slow(), +// b256!("102de6ffb001480cc9b8b548fd05c34cd4f46ae4aa91759393db90ea0409887d") +// ); +// let base_fee = genesis +// .next_block_base_fee(OP_SEPOLIA.base_fee_params_at_timestamp(genesis.timestamp)) +// .unwrap(); +// // +// assert_eq!(base_fee, 980000000); +// } +// +// #[test] +// fn latest_base_mainnet_fork_id() { +// assert_eq!( +// ForkId { hash: ForkHash([0xbc, 0x38, 0xf9, 0xca]), next: 0 }, +// BASE_MAINNET.latest_fork_id() +// ) +// } +// +// #[test] +// fn is_bedrock_active() { +// assert!(!OP_MAINNET.is_bedrock_active_at_block(1)) +// } +// +// #[test] +// fn parse_optimism_hardforks() { +// let geth_genesis = r#" +// { +// "config": { +// "bedrockBlock": 10, +// "regolithTime": 20, +// "canyonTime": 30, +// "ecotoneTime": 40, +// "fjordTime": 50, +// "graniteTime": 51, +// "optimism": { +// "eip1559Elasticity": 60, +// "eip1559Denominator": 70 +// } +// } +// } +// "#; +// let genesis: Genesis = serde_json::from_str(geth_genesis).unwrap(); +// +// let actual_bedrock_block = genesis.config.extra_fields.get("bedrockBlock"); +// assert_eq!(actual_bedrock_block, Some(serde_json::Value::from(10)).as_ref()); +// let actual_regolith_timestamp = genesis.config.extra_fields.get("regolithTime"); +// assert_eq!(actual_regolith_timestamp, Some(serde_json::Value::from(20)).as_ref()); +// let actual_canyon_timestamp = genesis.config.extra_fields.get("canyonTime"); +// assert_eq!(actual_canyon_timestamp, Some(serde_json::Value::from(30)).as_ref()); +// let actual_ecotone_timestamp = genesis.config.extra_fields.get("ecotoneTime"); +// assert_eq!(actual_ecotone_timestamp, Some(serde_json::Value::from(40)).as_ref()); +// let actual_fjord_timestamp = genesis.config.extra_fields.get("fjordTime"); +// assert_eq!(actual_fjord_timestamp, Some(serde_json::Value::from(50)).as_ref()); +// let actual_granite_timestamp = genesis.config.extra_fields.get("graniteTime"); +// assert_eq!(actual_granite_timestamp, Some(serde_json::Value::from(51)).as_ref()); +// +// let optimism_object = genesis.config.extra_fields.get("optimism").unwrap(); +// assert_eq!( +// optimism_object, +// &serde_json::json!({ +// "eip1559Elasticity": 60, +// "eip1559Denominator": 70, +// }) +// ); +// +// let chain_spec: ChainSpec = genesis.into(); +// +// assert_eq!( +// chain_spec.base_fee_params, +// BaseFeeParamsKind::Constant(BaseFeeParams::new(70, 60)) +// ); +// +// assert!(!chain_spec.is_fork_active_at_block(OptimismHardfork::Bedrock, 0)); +// assert!(!chain_spec.is_fork_active_at_timestamp(OptimismHardfork::Regolith, 0)); +// assert!(!chain_spec.is_fork_active_at_timestamp(OptimismHardfork::Canyon, 0)); +// assert!(!chain_spec.is_fork_active_at_timestamp(OptimismHardfork::Ecotone, 0)); +// assert!(!chain_spec.is_fork_active_at_timestamp(OptimismHardfork::Fjord, 0)); +// assert!(!chain_spec.is_fork_active_at_timestamp(OptimismHardfork::Granite, 0)); +// +// assert!(chain_spec.is_fork_active_at_block(OptimismHardfork::Bedrock, 10)); +// assert!(chain_spec.is_fork_active_at_timestamp(OptimismHardfork::Regolith, 20)); +// assert!(chain_spec.is_fork_active_at_timestamp(OptimismHardfork::Canyon, 30)); +// assert!(chain_spec.is_fork_active_at_timestamp(OptimismHardfork::Ecotone, 40)); +// assert!(chain_spec.is_fork_active_at_timestamp(OptimismHardfork::Fjord, 50)); +// assert!(chain_spec.is_fork_active_at_timestamp(OptimismHardfork::Granite, 51)); +// } +// +// #[test] +// fn parse_optimism_hardforks_variable_base_fee_params() { +// let geth_genesis = r#" +// { +// "config": { +// "bedrockBlock": 10, +// "regolithTime": 20, +// "canyonTime": 30, +// "ecotoneTime": 40, +// "fjordTime": 50, +// "graniteTime": 51, +// "optimism": { +// "eip1559Elasticity": 60, +// "eip1559Denominator": 70, +// "eip1559DenominatorCanyon": 80 +// } +// } +// } +// "#; +// let genesis: Genesis = serde_json::from_str(geth_genesis).unwrap(); +// +// let actual_bedrock_block = genesis.config.extra_fields.get("bedrockBlock"); +// assert_eq!(actual_bedrock_block, Some(serde_json::Value::from(10)).as_ref()); +// let actual_regolith_timestamp = genesis.config.extra_fields.get("regolithTime"); +// assert_eq!(actual_regolith_timestamp, Some(serde_json::Value::from(20)).as_ref()); +// let actual_canyon_timestamp = genesis.config.extra_fields.get("canyonTime"); +// assert_eq!(actual_canyon_timestamp, Some(serde_json::Value::from(30)).as_ref()); +// let actual_ecotone_timestamp = genesis.config.extra_fields.get("ecotoneTime"); +// assert_eq!(actual_ecotone_timestamp, Some(serde_json::Value::from(40)).as_ref()); +// let actual_fjord_timestamp = genesis.config.extra_fields.get("fjordTime"); +// assert_eq!(actual_fjord_timestamp, Some(serde_json::Value::from(50)).as_ref()); +// let actual_granite_timestamp = genesis.config.extra_fields.get("graniteTime"); +// assert_eq!(actual_granite_timestamp, Some(serde_json::Value::from(51)).as_ref()); +// +// let optimism_object = genesis.config.extra_fields.get("optimism").unwrap(); +// assert_eq!( +// optimism_object, +// &serde_json::json!({ +// "eip1559Elasticity": 60, +// "eip1559Denominator": 70, +// "eip1559DenominatorCanyon": 80 +// }) +// ); +// +// let chain_spec: ChainSpec = genesis.into(); +// +// assert_eq!( +// chain_spec.base_fee_params, +// BaseFeeParamsKind::Variable( +// vec![ +// (EthereumHardfork::London.boxed(), BaseFeeParams::new(70, 60)), +// (OptimismHardfork::Canyon.boxed(), BaseFeeParams::new(80, 60)), +// ] +// .into() +// ) +// ); +// +// assert!(!chain_spec.is_fork_active_at_block(OptimismHardfork::Bedrock, 0)); +// assert!(!chain_spec.is_fork_active_at_timestamp(OptimismHardfork::Regolith, 0)); +// assert!(!chain_spec.is_fork_active_at_timestamp(OptimismHardfork::Canyon, 0)); +// assert!(!chain_spec.is_fork_active_at_timestamp(OptimismHardfork::Ecotone, 0)); +// assert!(!chain_spec.is_fork_active_at_timestamp(OptimismHardfork::Fjord, 0)); +// assert!(!chain_spec.is_fork_active_at_timestamp(OptimismHardfork::Granite, 0)); +// +// assert!(chain_spec.is_fork_active_at_block(OptimismHardfork::Bedrock, 10)); +// assert!(chain_spec.is_fork_active_at_timestamp(OptimismHardfork::Regolith, 20)); +// assert!(chain_spec.is_fork_active_at_timestamp(OptimismHardfork::Canyon, 30)); +// assert!(chain_spec.is_fork_active_at_timestamp(OptimismHardfork::Ecotone, 40)); +// assert!(chain_spec.is_fork_active_at_timestamp(OptimismHardfork::Fjord, 50)); +// assert!(chain_spec.is_fork_active_at_timestamp(OptimismHardfork::Granite, 51)); +// } +// +// #[test] +// fn parse_genesis_optimism_with_variable_base_fee_params() { +// use op_alloy_rpc_types::genesis::OptimismBaseFeeInfo; +// +// let geth_genesis = r#" +// { +// "config": { +// "chainId": 8453, +// "homesteadBlock": 0, +// "eip150Block": 0, +// "eip155Block": 0, +// "eip158Block": 0, +// "byzantiumBlock": 0, +// "constantinopleBlock": 0, +// "petersburgBlock": 0, +// "istanbulBlock": 0, +// "muirGlacierBlock": 0, +// "berlinBlock": 0, +// "londonBlock": 0, +// "arrowGlacierBlock": 0, +// "grayGlacierBlock": 0, +// "mergeNetsplitBlock": 0, +// "bedrockBlock": 0, +// "regolithTime": 15, +// "terminalTotalDifficulty": 0, +// "terminalTotalDifficultyPassed": true, +// "optimism": { +// "eip1559Elasticity": 6, +// "eip1559Denominator": 50 +// } +// } +// } +// "#; +// let genesis: Genesis = serde_json::from_str(geth_genesis).unwrap(); +// let chainspec = ChainSpec::from(genesis.clone()); +// +// let actual_chain_id = genesis.config.chain_id; +// assert_eq!(actual_chain_id, 8453); +// +// assert_eq!( +// chainspec.hardforks.get(EthereumHardfork::Istanbul), +// Some(ForkCondition::Block(0)) +// ); +// +// let actual_bedrock_block = genesis.config.extra_fields.get("bedrockBlock"); +// assert_eq!(actual_bedrock_block, Some(serde_json::Value::from(0)).as_ref()); +// let actual_canyon_timestamp = genesis.config.extra_fields.get("canyonTime"); +// assert_eq!(actual_canyon_timestamp, None); +// +// assert!(genesis.config.terminal_total_difficulty_passed); +// +// let optimism_object = genesis.config.extra_fields.get("optimism").unwrap(); +// let optimism_base_fee_info = +// serde_json::from_value::(optimism_object.clone()).unwrap(); +// +// assert_eq!( +// optimism_base_fee_info, +// OptimismBaseFeeInfo { +// eip1559_elasticity: Some(6), +// eip1559_denominator: Some(50), +// eip1559_denominator_canyon: None, +// } +// ); +// assert_eq!( +// chainspec.base_fee_params, +// BaseFeeParamsKind::Constant(BaseFeeParams { +// max_change_denominator: 50, +// elasticity_multiplier: 6, +// }) +// ); +// +// assert!(chainspec.is_fork_active_at_block(OptimismHardfork::Bedrock, 0)); +// +// assert!(chainspec.is_fork_active_at_timestamp(OptimismHardfork::Regolith, 20)); +// } +// } diff --git a/crates/bsc/cli/Cargo.toml b/crates/bsc/cli/Cargo.toml index 0d2c9917d..12eb96589 100644 --- a/crates/bsc/cli/Cargo.toml +++ b/crates/bsc/cli/Cargo.toml @@ -7,6 +7,14 @@ license.workspace = true homepage.workspace = true repository.workspace = true +[dependencies] +reth-cli.workspace = true +reth-node-core.workspace = true +reth-bsc-chainspec.workspace = true + +eyre.workspace = true +clap = { workspace = true, features = ["derive", "env"] } + [lints] [features] diff --git a/crates/bsc/cli/src/chainspec.rs b/crates/bsc/cli/src/chainspec.rs index a092994ae..6a759714c 100644 --- a/crates/bsc/cli/src/chainspec.rs +++ b/crates/bsc/cli/src/chainspec.rs @@ -1,55 +1,49 @@ -use alloy_genesis::Genesis; +use std::{ffi::OsStr, sync::Arc}; + use clap::{builder::TypedValueParser, error::Result, Arg, Command}; -use reth_chainspec::{ChainSpec, DEV, HOLESKY, MAINNET, SEPOLIA}; +use reth_bsc_chainspec::{BscChainSpec, BSC_CHAPEL, BSC_MAINNET, BSC_RIALTO}; use reth_cli::chainspec::ChainSpecParser; -use std::{ffi::OsStr, fs, path::PathBuf, sync::Arc}; +use reth_node_core::args::utils::parse_custom_chain_spec; /// Clap value parser for [`ChainSpec`]s. /// /// The value parser matches either a known chain, the path /// to a json file, or a json formatted string in-memory. The json needs to be a Genesis struct. -fn chain_value_parser(s: &str) -> eyre::Result, eyre::Error> { +fn chain_value_parser(s: &str) -> eyre::Result, eyre::Error> { Ok(match s { - "mainnet" => MAINNET.clone(), - "sepolia" => SEPOLIA.clone(), - "holesky" => HOLESKY.clone(), - "dev" => DEV.clone(), - _ => { - // try to read json from path first - let raw = match fs::read_to_string(PathBuf::from(shellexpand::full(s)?.into_owned())) { - Ok(raw) => raw, - Err(io_err) => { - // valid json may start with "\n", but must contain "{" - if s.contains('{') { - s.to_string() - } else { - return Err(io_err.into()) // assume invalid path - } - } - }; - - // both serialized Genesis and ChainSpec structs supported - let genesis: Genesis = serde_json::from_str(&raw)?; - - Arc::new(genesis.into()) - } + "bsc" | "bsc-mainnet" | "bsc_mainnet" => BSC_MAINNET.clone(), + "bsc-testnet" | "bsc-chapel" | "bsc_testnet" | "bsc_chapel" => BSC_CHAPEL.clone(), + "bsc-rialto" | "bsc-qa" | "bsc_rialto" | "bsc_qa" => BSC_RIALTO.clone(), + _ => Arc::new(BscChainSpec { inner: parse_custom_chain_spec(s)? }), }) } -/// Ethereum chain specification parser. +/// Bsc chain specification parser. #[derive(Debug, Clone, Default)] -pub struct EthChainSpecParser; +pub struct BscChainSpecParser; -impl ChainSpecParser for EthChainSpecParser { - const SUPPORTED_CHAINS: &'static [&'static str] = &["mainnet", "sepolia", "holesky", "dev"]; +impl ChainSpecParser for BscChainSpecParser { + const SUPPORTED_CHAINS: &'static [&'static str] = &[ + "bsc", + "bsc-mainnet", + "bsc_mainnet", + "bsc-testnet", + "bsc-chapel", + "bsc_testnet", + "bsc_chapel", + "bsc-qa", + "bsc-rialto", + "bsc_qa", + "bsc_rialto", + ]; - fn parse(s: &str) -> eyre::Result> { + fn parse(s: &str) -> eyre::Result> { chain_value_parser(s) } } -impl TypedValueParser for EthChainSpecParser { - type Value = Arc; +impl TypedValueParser for BscChainSpecParser { + type Value = Arc; fn parse_ref( &self, @@ -59,7 +53,7 @@ impl TypedValueParser for EthChainSpecParser { ) -> Result { let val = value.to_str().ok_or_else(|| clap::Error::new(clap::error::ErrorKind::InvalidUtf8))?; - >::parse(val).map_err(|err| { + >::parse(val).map_err(|err| { let arg = arg.map(|a| a.to_string()).unwrap_or_else(|| "...".to_owned()); let possible_values = Self::SUPPORTED_CHAINS.join(","); let msg = format!( @@ -83,8 +77,8 @@ mod tests { #[test] fn parse_known_chain_spec() { - for &chain in EthChainSpecParser::SUPPORTED_CHAINS { - assert!(>::parse(chain).is_ok()); + for &chain in BscChainSpecParser::SUPPORTED_CHAINS { + assert!(>::parse(chain).is_ok()); } } } diff --git a/crates/bsc/cli/src/lib.rs b/crates/bsc/cli/src/lib.rs index 004a6fc25..3dc879706 100644 --- a/crates/bsc/cli/src/lib.rs +++ b/crates/bsc/cli/src/lib.rs @@ -9,3 +9,6 @@ #![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] // The `bsc` feature must be enabled to use this crate. #![cfg(feature = "bsc")] + +/// Chain specification parser. +pub mod chainspec; diff --git a/crates/bsc/consensus/src/lib.rs b/crates/bsc/consensus/src/lib.rs index 9ff16702a..6b5586a18 100644 --- a/crates/bsc/consensus/src/lib.rs +++ b/crates/bsc/consensus/src/lib.rs @@ -258,17 +258,7 @@ impl Parlia { let is_luban_active = self.chain_spec.is_luban_active_at_block(header.number); let is_epoch = header.number % self.epoch == 0; - if !is_luban_active { - if is_epoch && - (extra_len - EXTRA_VANITY_LEN - EXTRA_SEAL_LEN) % - EXTRA_VALIDATOR_LEN_BEFORE_LUBAN != - 0 - { - return None; - } - - Some(header.extra_data[EXTRA_VANITY_LEN..extra_len - EXTRA_SEAL_LEN].to_vec()) - } else { + if is_luban_active { if !is_epoch { return None; } @@ -286,6 +276,16 @@ impl Parlia { return None } Some(header.extra_data[start..end].to_vec()) + } else { + if is_epoch && + (extra_len - EXTRA_VANITY_LEN - EXTRA_SEAL_LEN) % + EXTRA_VALIDATOR_LEN_BEFORE_LUBAN != + 0 + { + return None; + } + + Some(header.extra_data[EXTRA_VANITY_LEN..extra_len - EXTRA_SEAL_LEN].to_vec()) } } @@ -397,20 +397,20 @@ impl Parlia { return Ok(()); } - if !self.chain_spec.is_luban_active_at_block(header.number) { - let validator_bytes_len = extra_len - EXTRA_VANITY_LEN - EXTRA_SEAL_LEN; - if validator_bytes_len / EXTRA_VALIDATOR_LEN_BEFORE_LUBAN == 0 || - validator_bytes_len % EXTRA_VALIDATOR_LEN_BEFORE_LUBAN != 0 - { + if self.chain_spec.is_luban_active_at_block(header.number) { + let count = header.extra_data[EXTRA_VANITY_LEN_WITH_VALIDATOR_NUM - 1] as usize; + let expect = + EXTRA_VANITY_LEN_WITH_VALIDATOR_NUM + EXTRA_SEAL_LEN + count * EXTRA_VALIDATOR_LEN; + if count == 0 || extra_len < expect { return Err(ParliaConsensusError::InvalidHeaderExtraLen { header_extra_len: extra_len as u64, }); } } else { - let count = header.extra_data[EXTRA_VANITY_LEN_WITH_VALIDATOR_NUM - 1] as usize; - let expect = - EXTRA_VANITY_LEN_WITH_VALIDATOR_NUM + EXTRA_SEAL_LEN + count * EXTRA_VALIDATOR_LEN; - if count == 0 || extra_len < expect { + let validator_bytes_len = extra_len - EXTRA_VANITY_LEN - EXTRA_SEAL_LEN; + if validator_bytes_len / EXTRA_VALIDATOR_LEN_BEFORE_LUBAN == 0 || + validator_bytes_len % EXTRA_VALIDATOR_LEN_BEFORE_LUBAN != 0 + { return Err(ParliaConsensusError::InvalidHeaderExtraLen { header_extra_len: extra_len as u64, }); diff --git a/crates/bsc/engine/Cargo.toml b/crates/bsc/engine/Cargo.toml index 574fb6394..5443c3939 100644 --- a/crates/bsc/engine/Cargo.toml +++ b/crates/bsc/engine/Cargo.toml @@ -21,6 +21,7 @@ reth-primitives.workspace = true reth-provider.workspace = true reth-rpc-types.workspace = true reth-network.workspace = true +reth-network-api.workspace = true reth-engine-primitives.workspace = true reth-network-p2p.workspace = true reth-network-peers.workspace = true diff --git a/crates/bsc/engine/src/client.rs b/crates/bsc/engine/src/client.rs index 0c2f35a23..68b5ad858 100644 --- a/crates/bsc/engine/src/client.rs +++ b/crates/bsc/engine/src/client.rs @@ -1,11 +1,11 @@ //! This includes download client implementations for parlia consensus. use crate::Storage; -use reth_network::FetchClient; use reth_network_p2p::{ bodies::client::{BodiesClient, BodiesFut}, download::DownloadClient, headers::client::{HeadersClient, HeadersDirection, HeadersFut, HeadersRequest}, priority::Priority, + BlockClient, }; use reth_network_peers::{PeerId, WithPeerId}; use reth_primitives::{BlockBody, Header, SealedHeader, B256}; @@ -25,15 +25,18 @@ type InnerFetchBodyResult = Result, InnerFetchError>; /// This client will first try to fetch from the local storage, and if the data is not found, it /// will fetch from the network. #[derive(Debug, Clone)] -pub struct ParliaClient { +pub struct ParliaClient { /// cached header and body storage: Storage, - fetch_client: FetchClient, + fetch_client: Client, peer_id: PeerId, } -impl ParliaClient { - pub(crate) fn new(storage: Storage, fetch_client: FetchClient) -> Self { +impl ParliaClient +where + Client: BlockClient + 'static, +{ + pub(crate) fn new(storage: Storage, fetch_client: Client) -> Self { let peer_id = PeerId::random(); Self { storage, fetch_client, peer_id } } @@ -96,7 +99,10 @@ impl ParliaClient { } } -impl HeadersClient for ParliaClient { +impl HeadersClient for ParliaClient +where + Client: BlockClient + 'static, +{ type Output = HeadersFut; fn get_headers_with_priority( @@ -116,7 +122,10 @@ impl HeadersClient for ParliaClient { } } -impl BodiesClient for ParliaClient { +impl BodiesClient for ParliaClient +where + Client: BlockClient + 'static, +{ type Output = BodiesFut; fn get_block_bodies_with_priority( @@ -136,7 +145,10 @@ impl BodiesClient for ParliaClient { } } -impl DownloadClient for ParliaClient { +impl DownloadClient for ParliaClient +where + Client: BlockClient + 'static, +{ fn report_bad_message(&self, peer_id: PeerId) { let this = self.clone(); if peer_id == self.peer_id { diff --git a/crates/bsc/engine/src/lib.rs b/crates/bsc/engine/src/lib.rs index 52ac25960..b2f01d4b8 100644 --- a/crates/bsc/engine/src/lib.rs +++ b/crates/bsc/engine/src/lib.rs @@ -5,29 +5,29 @@ // The `bsc` feature must be enabled to use this crate. #![cfg(feature = "bsc")] +use reth_beacon_consensus::BeaconEngineMessage; use reth_bsc_consensus::Parlia; use reth_chainspec::ChainSpec; -use reth_primitives::{parlia::ParliaConfig, SealedHeader, B256}; +use reth_engine_primitives::EngineTypes; +use reth_evm_bsc::SnapshotReader; +use reth_network_api::events::EngineMessage; +use reth_network_p2p::BlockClient; +use reth_primitives::{ + parlia::ParliaConfig, BlockBody, BlockHash, BlockHashOrNumber, BlockNumber, SealedHeader, B256, +}; +use reth_provider::{BlockReaderIdExt, CanonChainTracker, ParliaProvider}; use std::{ clone::Clone, collections::{HashMap, VecDeque}, fmt::Debug, sync::Arc, }; - use tokio::sync::{ mpsc::{UnboundedReceiver, UnboundedSender}, Mutex, RwLockReadGuard, RwLockWriteGuard, }; use tracing::trace; -use reth_beacon_consensus::BeaconEngineMessage; -use reth_engine_primitives::EngineTypes; -use reth_evm_bsc::SnapshotReader; -use reth_network::{fetch::FetchClient, message::EngineMessage}; -use reth_primitives::{BlockBody, BlockHash, BlockHashOrNumber, BlockNumber}; -use reth_provider::{BlockReaderIdExt, CanonChainTracker, ParliaProvider}; - mod client; use client::*; @@ -38,13 +38,13 @@ const STORAGE_CACHE_NUM: usize = 1000; /// Builder type for configuring the setup #[derive(Debug)] -pub struct ParliaEngineBuilder { +pub struct ParliaEngineBuilder { chain_spec: Arc, cfg: ParliaConfig, storage: Storage, to_engine: UnboundedSender>, network_block_event_rx: Arc>>, - fetch_client: FetchClient, + fetch_client: Client, provider: Provider, parlia: Parlia, snapshot_reader: SnapshotReader

, @@ -52,8 +52,9 @@ pub struct ParliaEngineBuilder { // === impl ParliaEngineBuilder === -impl ParliaEngineBuilder +impl ParliaEngineBuilder where + Client: BlockClient + 'static, Provider: BlockReaderIdExt + CanonChainTracker + Clone + 'static, Engine: EngineTypes + 'static, P: ParliaProvider + 'static, @@ -66,7 +67,7 @@ where parlia_provider: P, to_engine: UnboundedSender>, network_block_event_rx: Arc>>, - fetch_client: FetchClient, + fetch_client: Client, ) -> Self { let latest_header = provider .latest_header() @@ -101,7 +102,7 @@ where /// Consumes the type and returns all components #[track_caller] - pub fn build(self, start_engine_task: bool) -> ParliaClient { + pub fn build(self, start_engine_task: bool) -> ParliaClient { let Self { chain_spec, cfg, diff --git a/crates/bsc/engine/src/task.rs b/crates/bsc/engine/src/task.rs index b13b82da0..59ebcc901 100644 --- a/crates/bsc/engine/src/task.rs +++ b/crates/bsc/engine/src/task.rs @@ -4,28 +4,26 @@ use reth_bsc_consensus::Parlia; use reth_chainspec::ChainSpec; use reth_engine_primitives::EngineTypes; use reth_evm_bsc::SnapshotReader; -use reth_network::message::EngineMessage; +use reth_network_api::events::EngineMessage; use reth_network_p2p::{ headers::client::{HeadersClient, HeadersDirection, HeadersRequest}, priority::Priority, + BlockClient, }; use reth_primitives::{Block, BlockBody, BlockHashOrNumber, SealedHeader, B256}; use reth_provider::{BlockReaderIdExt, CanonChainTracker, ParliaProvider}; -use reth_rpc_types::engine::ForkchoiceState; +use reth_rpc_types::{engine::ForkchoiceState, BlockId, RpcBlockHash}; use std::{ clone::Clone, fmt, sync::Arc, time::{SystemTime, UNIX_EPOCH}, }; -use tokio::sync::Mutex; - -use reth_rpc_types::{BlockId, RpcBlockHash}; use tokio::{ signal, sync::{ mpsc::{self, UnboundedReceiver, UnboundedSender}, - oneshot, + oneshot, Mutex, }, time::{interval, timeout, Duration}, }; @@ -58,6 +56,7 @@ pub(crate) struct ParliaEngineTask< Engine: EngineTypes, Provider: BlockReaderIdExt + CanonChainTracker, P: ParliaProvider, + Client: BlockClient, > { /// The configured chain spec chain_spec: Arc, @@ -68,7 +67,7 @@ pub(crate) struct ParliaEngineTask< /// The snapshot reader used to read the snapshot snapshot_reader: Arc>, /// The client used to fetch headers - block_fetcher: ParliaClient, + block_fetcher: ParliaClient, /// The interval of the block producing block_interval: u64, /// Shared storage to insert new headers @@ -92,7 +91,8 @@ impl< Engine: EngineTypes + 'static, Provider: BlockReaderIdExt + CanonChainTracker + Clone + 'static, P: ParliaProvider + 'static, - > ParliaEngineTask + Client: BlockClient + 'static, + > ParliaEngineTask { /// Creates a new instance of the task #[allow(clippy::too_many_arguments)] @@ -104,7 +104,7 @@ impl< to_engine: UnboundedSender>, network_block_event_rx: Arc>>, storage: Storage, - block_fetcher: ParliaClient, + block_fetcher: ParliaClient, block_interval: u64, ) { let (fork_choice_tx, fork_choice_rx) = mpsc::unbounded_channel(); @@ -538,8 +538,12 @@ impl< } } -impl - fmt::Debug for ParliaEngineTask +impl< + Engine: EngineTypes, + Provider: BlockReaderIdExt + CanonChainTracker, + P: ParliaProvider, + Client: BlockClient, + > fmt::Debug for ParliaEngineTask { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_struct("chain_spec") diff --git a/crates/bsc/evm/src/execute.rs b/crates/bsc/evm/src/execute.rs index 927f44ae3..a51110d32 100644 --- a/crates/bsc/evm/src/execute.rs +++ b/crates/bsc/evm/src/execute.rs @@ -19,20 +19,16 @@ use reth_primitives::{ parlia::{ParliaConfig, Snapshot, VoteAddress, CHECKPOINT_INTERVAL, DEFAULT_TURN_LENGTH}, system_contracts::{get_upgrade_system_contracts, is_system_transaction, SLASH_CONTRACT}, Address, BlockNumber, BlockWithSenders, Bytes, Header, Receipt, Transaction, TransactionSigned, - B256, BSC_MAINNET, U256, + B256, U256, }; use reth_provider::{ExecutionOutcome, ParliaProvider}; use reth_prune_types::PruneModes; -use reth_revm::{ - batch::{BlockBatchRecord, BlockExecutorStats}, - db::states::bundle_state::BundleRetention, - Evm, State, -}; +use reth_revm::{batch::BlockBatchRecord, db::states::bundle_state::BundleRetention, Evm, State}; use revm_primitives::{ db::{Database, DatabaseCommit}, BlockEnv, CfgEnvWithHandlerCfg, EVMError, EnvWithHandlerCfg, ResultAndState, TransactTo, }; -use std::{collections::HashMap, num::NonZeroUsize, sync::Arc, time::Instant}; +use std::{collections::HashMap, num::NonZeroUsize, sync::Arc}; use tracing::{debug, warn}; const SNAP_CACHE_NUM: usize = 2048; @@ -56,11 +52,6 @@ impl

BscExecutorProvider

{ pub fn bsc(chain_spec: Arc, provider: P) -> Self { Self::new(chain_spec, Default::default(), Default::default(), provider) } - - /// Returns a new provider for the mainnet. - pub fn mainnet(provider: P) -> Self { - Self::bsc(BSC_MAINNET.clone(), provider) - } } impl BscExecutorProvider { @@ -120,7 +111,6 @@ where BscBatchExecutor { executor, batch_record: BlockBatchRecord::default(), - stats: BlockExecutorStats::default(), snapshots: Vec::new(), } } @@ -608,7 +598,7 @@ where let vote_addrs_map = if vote_addrs.is_empty() { HashMap::new() } else { - validators.iter().cloned().zip(vote_addrs).collect::>() + validators.iter().copied().zip(vote_addrs).collect::>() }; output.current_validators = Some((validators, vote_addrs_map)); @@ -660,16 +650,16 @@ where number: BlockNumber, env: EnvWithHandlerCfg, ) -> (Vec

, Vec) { - if !self.chain_spec().is_luban_active_at_block(number) { - let (to, data) = self.parlia().get_current_validators_before_luban(number); + if self.chain_spec().is_luban_active_at_block(number) { + let (to, data) = self.parlia().get_current_validators(); let output = self.eth_call(to, data, env).unwrap(); - (self.parlia().unpack_data_into_validator_set_before_luban(output.as_ref()), Vec::new()) + self.parlia().unpack_data_into_validator_set(output.as_ref()) } else { - let (to, data) = self.parlia().get_current_validators(); + let (to, data) = self.parlia().get_current_validators_before_luban(number); let output = self.eth_call(to, data, env).unwrap(); - self.parlia().unpack_data_into_validator_set(output.as_ref()) + (self.parlia().unpack_data_into_validator_set_before_luban(output.as_ref()), Vec::new()) } } } @@ -718,7 +708,6 @@ pub struct BscBatchExecutor { executor: BscBlockExecutor, /// Keeps track of the batch and record receipts based on the configured prune mode batch_record: BlockBatchRecord, - stats: BlockExecutorStats, snapshots: Vec, } @@ -742,23 +731,17 @@ where fn execute_and_verify_one(&mut self, input: Self::Input<'_>) -> Result<(), Self::Error> { let BlockExecutionInput { block, total_difficulty, .. } = input; - let execute_start = Instant::now(); let BscExecuteOutput { receipts, gas_used: _, snapshot } = self.executor.execute_and_verify(block, total_difficulty, None)?; - self.stats.execution_duration += execute_start.elapsed(); validate_block_post_execution(block, self.executor.chain_spec(), &receipts)?; // prepare the state according to the prune mode - let merge_start = Instant::now(); let retention = self.batch_record.bundle_retention(block.number); self.executor.state.merge_transitions(retention); - self.stats.merge_transitions_duration += merge_start.elapsed(); // store receipts in the set - let receipts_start = Instant::now(); self.batch_record.save_receipts(receipts)?; - self.stats.receipt_root_duration += receipts_start.elapsed(); // store snapshot if let Some(snapshot) = snapshot { @@ -773,8 +756,6 @@ where } fn finalize(mut self) -> Self::Output { - self.stats.log_debug(); - ExecutionOutcome::new_with_snapshots( self.executor.state.take_bundle(), self.batch_record.take_receipts(), diff --git a/crates/bsc/evm/src/lib.rs b/crates/bsc/evm/src/lib.rs index 4344f5944..3b96db826 100644 --- a/crates/bsc/evm/src/lib.rs +++ b/crates/bsc/evm/src/lib.rs @@ -79,13 +79,13 @@ impl ConfigureEvmEnv for BscEvmConfig { impl ConfigureEvm for BscEvmConfig { type DefaultExternalContext<'a> = (); - fn evm<'a, DB: Database + 'a>(&self, db: DB) -> Evm<'a, Self::DefaultExternalContext<'a>, DB> { + fn evm(&self, db: DB) -> Evm<'_, Self::DefaultExternalContext<'_>, DB> { EvmBuilder::default().with_db(db).bsc().build() } - fn evm_with_inspector<'a, DB, I>(&self, db: DB, inspector: I) -> Evm<'a, I, DB> + fn evm_with_inspector(&self, db: DB, inspector: I) -> Evm<'_, I, DB> where - DB: Database + 'a, + DB: Database, I: GetInspector, { EvmBuilder::default() @@ -95,6 +95,8 @@ impl ConfigureEvm for BscEvmConfig { .append_handler_register(inspector_handle_register) .build() } + + fn default_external_context<'a>(&self) -> Self::DefaultExternalContext<'a> {} } #[cfg(test)] diff --git a/crates/bsc/evm/src/post_execution.rs b/crates/bsc/evm/src/post_execution.rs index 4c178dd9d..274354f49 100644 --- a/crates/bsc/evm/src/post_execution.rs +++ b/crates/bsc/evm/src/post_execution.rs @@ -208,7 +208,7 @@ where if self.chain_spec().is_on_luban_at_block(number) { vote_addrs_map = validators .iter() - .cloned() + .copied() .zip(vec![VoteAddress::default(); validator_num]) .collect::>(); } @@ -401,7 +401,7 @@ where target_hash = header.parent_hash; } - let mut validators: Vec
= accumulated_weights.keys().cloned().collect(); + let mut validators: Vec
= accumulated_weights.keys().copied().collect(); validators.sort(); let weights: Vec = validators.iter().map(|val| accumulated_weights[val]).collect(); diff --git a/crates/bsc/node/Cargo.toml b/crates/bsc/node/Cargo.toml index c0f8abea7..589e60569 100644 --- a/crates/bsc/node/Cargo.toml +++ b/crates/bsc/node/Cargo.toml @@ -12,6 +12,7 @@ workspace = true [dependencies] # reth +reth-chainspec.workspace = true reth-payload-builder.workspace = true reth-ethereum-engine-primitives.workspace = true reth-basic-payload-builder.workspace = true diff --git a/crates/bsc/node/src/node.rs b/crates/bsc/node/src/node.rs index 56461f239..0ab69246b 100644 --- a/crates/bsc/node/src/node.rs +++ b/crates/bsc/node/src/node.rs @@ -3,6 +3,7 @@ use crate::EthEngineTypes; use reth_basic_payload_builder::{BasicPayloadJobGenerator, BasicPayloadJobGeneratorConfig}; use reth_bsc_consensus::Parlia; +use reth_chainspec::ChainSpec; use reth_evm_bsc::{BscEvmConfig, BscExecutorProvider}; use reth_network::NetworkHandle; use reth_node_api::{FullNodeComponents, NodeAddOns}; @@ -39,7 +40,7 @@ impl BscNode { BscConsensusBuilder, > where - Node: FullNodeTypes, + Node: FullNodeTypes, { ComponentsBuilder::default() .node_types::() @@ -54,6 +55,7 @@ impl BscNode { impl NodeTypes for BscNode { type Primitives = (); type Engine = EthEngineTypes; + type ChainSpec = ChainSpec; } /// Add-ons w.r.t. l1 bsc. @@ -66,7 +68,7 @@ impl NodeAddOns for BSCAddOns { impl Node for BscNode where - N: FullNodeTypes, + N: FullNodeTypes, { type ComponentsBuilder = ComponentsBuilder< N, diff --git a/crates/chain-state/src/test_utils.rs b/crates/chain-state/src/test_utils.rs index d101b309a..d9bf7b157 100644 --- a/crates/chain-state/src/test_utils.rs +++ b/crates/chain-state/src/test_utils.rs @@ -170,6 +170,7 @@ impl TestBlockBuilder { body: transactions.into_iter().map(|tx| tx.into_signed()).collect(), ommers: Vec::new(), withdrawals: Some(vec![].into()), + sidecars: None, requests: None, }; diff --git a/crates/chainspec/src/spec.rs b/crates/chainspec/src/spec.rs index 02815f5f2..5030c9538 100644 --- a/crates/chainspec/src/spec.rs +++ b/crates/chainspec/src/spec.rs @@ -18,7 +18,8 @@ use reth_ethereum_forks::{ ForkFilter, ForkFilterKey, ForkHash, ForkId, Hardfork, Head, DEV_HARDFORKS, }; use reth_network_peers::{ - base_nodes, base_testnet_nodes, holesky_nodes, mainnet_nodes, op_nodes, op_testnet_nodes, + base_nodes, base_testnet_nodes, bsc_mainnet_nodes, bsc_testnet_nodes, holesky_nodes, + mainnet_nodes, op_nodes, op_testnet_nodes, opbnb_mainnet_nodes, opbnb_testnet_nodes, sepolia_nodes, NodeRecord, }; use reth_primitives_traits::{ @@ -607,13 +608,9 @@ impl ChainSpec { C::Optimism => Some(op_nodes()), C::BaseGoerli | C::BaseSepolia => Some(base_testnet_nodes()), C::OptimismSepolia | C::OptimismGoerli | C::OptimismKovan => Some(op_testnet_nodes()), - #[cfg(feature = "bsc")] C::BNBSmartChain => Some(bsc_mainnet_nodes()), - #[cfg(feature = "bsc")] C::BNBSmartChainTestnet => Some(bsc_testnet_nodes()), - #[cfg(all(feature = "optimism", feature = "opbnb"))] C::OpBNBTestnet => Some(opbnb_testnet_nodes()), - #[cfg(all(feature = "optimism", feature = "opbnb"))] C::OpBNBMainnet => Some(opbnb_mainnet_nodes()), _ => None, } diff --git a/crates/cli/commands/src/p2p/mod.rs b/crates/cli/commands/src/p2p/mod.rs index a3e37abc3..452df736d 100644 --- a/crates/cli/commands/src/p2p/mod.rs +++ b/crates/cli/commands/src/p2p/mod.rs @@ -7,7 +7,7 @@ use clap::{Parser, Subcommand}; use reth_chainspec::ChainSpec; use reth_cli_util::{get_secret_key, hash_or_num_value_parser}; use reth_config::Config; -use reth_network::{BlockDownloaderProvider, NetworkConfigBuilder}; +use reth_network::NetworkConfigBuilder; use reth_network_p2p::bodies::client::BodiesClient; use reth_node_core::{ args::{ diff --git a/crates/cli/commands/src/stage/drop.rs b/crates/cli/commands/src/stage/drop.rs index 204676679..24274c61a 100644 --- a/crates/cli/commands/src/stage/drop.rs +++ b/crates/cli/commands/src/stage/drop.rs @@ -77,6 +77,7 @@ impl Command { tx.clear::()?; tx.clear::()?; tx.clear::()?; + tx.clear::()?; tx.put::( StageId::Bodies.to_string(), Default::default(), diff --git a/crates/cli/commands/src/stage/run.rs b/crates/cli/commands/src/stage/run.rs index 7b097be42..f4d872507 100644 --- a/crates/cli/commands/src/stage/run.rs +++ b/crates/cli/commands/src/stage/run.rs @@ -15,7 +15,6 @@ use reth_downloaders::{ }; use reth_evm::execute::BlockExecutorProvider; use reth_exex::ExExManagerHandle; -use reth_network::BlockDownloaderProvider; use reth_network_p2p::HeadersClient; use reth_node_core::{ args::{NetworkArgs, StageEnum}, diff --git a/crates/consensus/beacon/Cargo.toml b/crates/consensus/beacon/Cargo.toml index 5fc23d0d0..f19e43dea 100644 --- a/crates/consensus/beacon/Cargo.toml +++ b/crates/consensus/beacon/Cargo.toml @@ -78,7 +78,6 @@ optimism = [ "reth-provider/optimism", "reth-blockchain-tree/optimism", ] - bsc = [ "reth-bsc-consensus/bsc" ] \ No newline at end of file diff --git a/crates/consensus/consensus/src/lib.rs b/crates/consensus/consensus/src/lib.rs index f67da4891..0528dce70 100644 --- a/crates/consensus/consensus/src/lib.rs +++ b/crates/consensus/consensus/src/lib.rs @@ -212,7 +212,7 @@ pub enum ConsensusError { ParentHashMismatch(GotExpectedBoxed), /// Error when the block timestamp is not expected compared to the predicted timestamp. - #[error("block timestamp {timestamp} is not expected compared to {predicted_timestamp}")] + #[display("block timestamp {timestamp} is not expected compared to {predicted_timestamp}")] TimestampNotExpected { /// The block's timestamp. timestamp: u64, @@ -342,18 +342,18 @@ pub enum ConsensusError { BlobGasUsedDiff(GotExpected), /// Error for invalid block difficulty - #[error("invalid block difficulty: {difficulty}")] + #[display("invalid block difficulty: {difficulty}")] InvalidDifficulty { /// The block difficulty difficulty: U256, }, /// Error for invalid mix hash - #[error("invalid mix digest")] + #[display("invalid mix digest")] InvalidMixHash, /// Error for invalid header extra - #[error("invalid header extra")] + #[display("invalid header extra")] InvalidHeaderExtra, /// Error for a transaction that violates consensus. diff --git a/crates/engine/service/src/service.rs b/crates/engine/service/src/service.rs index 6783ed01d..fd4cf26a9 100644 --- a/crates/engine/service/src/service.rs +++ b/crates/engine/service/src/service.rs @@ -179,8 +179,15 @@ mod tests { .unwrap(); let (_tx, rx) = watch::channel(FinishedExExHeight::NoExExs); - let pruner = - Pruner::<_, ProviderFactory<_>>::new(provider_factory.clone(), vec![], 0, 0, None, rx); + let pruner = Pruner::<_, ProviderFactory<_>>::new( + provider_factory.clone(), + vec![], + 0, + 0, + None, + rx, + 0, + ); let (tx, _rx) = unbounded_channel(); let _eth_service = EngineService::new( diff --git a/crates/engine/tree/src/tree/mod.rs b/crates/engine/tree/src/tree/mod.rs index 5d73cd69a..1e48201db 100644 --- a/crates/engine/tree/src/tree/mod.rs +++ b/crates/engine/tree/src/tree/mod.rs @@ -3140,6 +3140,7 @@ mod tests { } #[tokio::test] + #[cfg(not(feature = "bsc"))] async fn test_engine_tree_valid_forks_with_older_canonical_head() { reth_tracing::init_test_tracing(); diff --git a/crates/engine/util/src/reorg.rs b/crates/engine/util/src/reorg.rs index b952050aa..48ce54f8d 100644 --- a/crates/engine/util/src/reorg.rs +++ b/crates/engine/util/src/reorg.rs @@ -413,6 +413,7 @@ where body: transactions, ommers: reorg_target.ommers, withdrawals: reorg_target.withdrawals, + sidecars: reorg_target.sidecars, requests: None, // TODO(prague) } .seal_slow(); diff --git a/crates/evm/execution-types/src/execute.rs b/crates/evm/execution-types/src/execute.rs index 2933fd598..2eb34d2f5 100644 --- a/crates/evm/execution-types/src/execute.rs +++ b/crates/evm/execution-types/src/execute.rs @@ -1,25 +1,40 @@ -use reth_primitives::{Request, U256}; +use reth_primitives::{parlia::Snapshot, Request, B256, U256}; use revm::db::BundleState; +use std::collections::HashMap; /// A helper type for ethereum block inputs that consists of a block and the total difficulty. #[derive(Debug)] -pub struct BlockExecutionInput<'a, Block> { +pub struct BlockExecutionInput<'a, Block, Header> { /// The block to execute. pub block: &'a Block, /// The total difficulty of the block. pub total_difficulty: U256, + /// The headers of the block's ancestor + pub ancestor_headers: Option<&'a HashMap>, } -impl<'a, Block> BlockExecutionInput<'a, Block> { +impl<'a, Block, Header> BlockExecutionInput<'a, Block, Header> { /// Creates a new input. - pub const fn new(block: &'a Block, total_difficulty: U256) -> Self { - Self { block, total_difficulty } + pub const fn new( + block: &'a Block, + total_difficulty: U256, + ancestor_headers: Option<&'a HashMap>, + ) -> Self { + Self { block, total_difficulty, ancestor_headers } } } -impl<'a, Block> From<(&'a Block, U256)> for BlockExecutionInput<'a, Block> { - fn from((block, total_difficulty): (&'a Block, U256)) -> Self { - Self::new(block, total_difficulty) +impl<'a, Block, Header> From<(&'a Block, U256, Option<&'a HashMap>)> + for BlockExecutionInput<'a, Block, Header> +{ + fn from( + (block, total_difficulty, ancestor_headers): ( + &'a Block, + U256, + Option<&'a HashMap>, + ), + ) -> Self { + Self::new(block, total_difficulty, ancestor_headers) } } @@ -36,4 +51,7 @@ pub struct BlockExecutionOutput { pub requests: Vec, /// The total gas used by the block. pub gas_used: u64, + + /// Parlia snapshot. + pub snapshot: Option, } diff --git a/crates/evm/execution-types/src/execution_outcome.rs b/crates/evm/execution-types/src/execution_outcome.rs index c55f10e6a..0eba320cd 100644 --- a/crates/evm/execution-types/src/execution_outcome.rs +++ b/crates/evm/execution-types/src/execution_outcome.rs @@ -53,7 +53,6 @@ pub struct ExecutionOutcome { /// guaranteed to be the same as the number of transactions. pub requests: Vec, - // TODO: feature? /// Parlia snapshots. pub snapshots: Vec, } @@ -381,6 +380,7 @@ impl From<(BlockExecutionOutput, BlockNumber)> for ExecutionOutcome { receipts: Receipts::from(value.0.receipts), first_block: value.1, requests: vec![Requests::from(value.0.requests)], + snapshots: vec![value.0.snapshot.unwrap_or_default()], } } } @@ -915,6 +915,7 @@ mod tests { receipts: Receipts::default(), first_block: 0, requests: vec![], + snapshots: vec![], }; // Get the changed accounts diff --git a/crates/evm/src/execute.rs b/crates/evm/src/execute.rs index 5ac5146d5..1b40a7350 100644 --- a/crates/evm/src/execute.rs +++ b/crates/evm/src/execute.rs @@ -7,7 +7,7 @@ pub use reth_storage_errors::provider::ProviderError; use core::fmt::Display; -use reth_primitives::{BlockNumber, BlockWithSenders, Receipt}; +use reth_primitives::{BlockNumber, BlockWithSenders, Header, Receipt}; use reth_prune_types::PruneModes; use revm_primitives::db::Database; diff --git a/crates/evm/src/system_calls.rs b/crates/evm/src/system_calls.rs index 3e9e74a24..779e6aad7 100644 --- a/crates/evm/src/system_calls.rs +++ b/crates/evm/src/system_calls.rs @@ -146,7 +146,7 @@ where EvmConfig: ConfigureEvm, { // Return immediately if beaconRoot equals the zero hash when using the Parlia engine. - if chain_spec.is_bohr_active_at_timestamp(block_timestamp) && + if chain_spec.is_bohr_active_at_timestamp(initialized_block_env.timestamp.to()) && parent_beacon_block_root == Some(B256::ZERO) { return Ok(()) diff --git a/crates/exex/exex/src/backfill/job.rs b/crates/exex/exex/src/backfill/job.rs index 8350e8170..649dab6d5 100644 --- a/crates/exex/exex/src/backfill/job.rs +++ b/crates/exex/exex/src/backfill/job.rs @@ -107,11 +107,12 @@ where body: block.body, ommers: block.ommers, withdrawals: block.withdrawals, + sidecars: block.sidecars, requests: block.requests, } .with_senders_unchecked(senders); - executor.execute_and_verify_one((&block, td).into())?; + executor.execute_and_verify_one((&block, td, None).into())?; execution_duration += execute_start.elapsed(); // TODO(alexey): report gas metrics using `block.header.gas_used` diff --git a/crates/exex/exex/src/backfill/test_utils.rs b/crates/exex/exex/src/backfill/test_utils.rs index 14377e520..006cff07f 100644 --- a/crates/exex/exex/src/backfill/test_utils.rs +++ b/crates/exex/exex/src/backfill/test_utils.rs @@ -24,6 +24,7 @@ pub(crate) fn to_execution_outcome( receipts: block_execution_output.receipts.clone().into(), first_block: block_number, requests: vec![Requests(block_execution_output.requests.clone())], + snapshots: vec![], } } diff --git a/crates/net/eth-wire-types/src/upgrade_status.rs b/crates/net/eth-wire-types/src/upgrade_status.rs index 3a473587c..1d0a3346b 100644 --- a/crates/net/eth-wire-types/src/upgrade_status.rs +++ b/crates/net/eth-wire-types/src/upgrade_status.rs @@ -2,13 +2,14 @@ //! geth. use alloy_rlp::{RlpDecodable, RlpEncodable}; -use reth_codecs_derive::derive_arbitrary; +use reth_codecs_derive::add_arbitrary_tests; /// UpdateStatus packet introduced in BSC to notify peers whether to broadcast transaction or not. /// It is used during the p2p handshake. -#[derive_arbitrary(rlp)] #[derive(Debug, Clone, PartialEq, Eq, RlpEncodable, RlpDecodable)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] +#[cfg_attr(any(test, feature = "arbitrary"), derive(arbitrary::Arbitrary))] +#[add_arbitrary_tests(rlp)] pub struct UpgradeStatus { /// Extension for support customized features for BSC. pub extension: UpgradeStatusExtension, @@ -16,9 +17,10 @@ pub struct UpgradeStatus { /// The extension to define whether to enable or disable the flag. /// This flag currently is ignored, and will be supported later. -#[derive_arbitrary(rlp)] #[derive(Debug, Clone, PartialEq, Eq, RlpEncodable, RlpDecodable)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] +#[cfg_attr(any(test, feature = "arbitrary"), derive(arbitrary::Arbitrary))] +#[add_arbitrary_tests(rlp)] pub struct UpgradeStatusExtension { // TODO: support disable_peer_tx_broadcast flag /// To notify a peer to disable the broadcast of transactions or not. diff --git a/crates/net/network-api/src/events.rs b/crates/net/network-api/src/events.rs index d2bd66d1f..949fb041f 100644 --- a/crates/net/network-api/src/events.rs +++ b/crates/net/network-api/src/events.rs @@ -2,10 +2,11 @@ use std::{fmt, net::SocketAddr, sync::Arc}; +use alloy_primitives::B256; use reth_eth_wire_types::{ - message::RequestPair, BlockBodies, BlockHeaders, Capabilities, DisconnectReason, EthMessage, - EthVersion, GetBlockBodies, GetBlockHeaders, GetNodeData, GetPooledTransactions, GetReceipts, - NodeData, PooledTransactions, Receipts, Status, + message::RequestPair, BlockBodies, BlockHashNumber, BlockHeaders, Capabilities, + DisconnectReason, EthMessage, EthVersion, GetBlockBodies, GetBlockHeaders, GetNodeData, + GetPooledTransactions, GetReceipts, NewBlock, NodeData, PooledTransactions, Receipts, Status, }; use reth_ethereum_forks::ForkId; use reth_network_p2p::error::{RequestError, RequestResult}; @@ -231,3 +232,29 @@ impl fmt::Debug for PeerRequestSender { f.debug_struct("PeerRequestSender").field("peer_id", &self.peer_id).finish_non_exhaustive() } } + +/// All message variants that can be sent to `TaskEngine`. +#[derive(Debug)] +pub enum EngineMessage { + /// Announce new block hashes + NewBlockHashes(BlockHashesEvent), + /// Broadcast new block. + NewBlock(BlockEvent), +} + +/// internal message to engine task +#[derive(Debug, Clone)] +pub struct BlockHashesEvent { + /// New block hashes and the block number for each blockhash. + /// Clients should request blocks using a [`GetBlockBodies`](crate::GetBlockBodies) message. + pub hashes: Vec, +} + +/// internal message to engine task +#[derive(Debug, Clone)] +pub struct BlockEvent { + /// Hash of the block + pub hash: B256, + /// Raw received message + pub block: Arc, +} diff --git a/crates/net/network-api/src/lib.rs b/crates/net/network-api/src/lib.rs index 6163c8730..14b29bee1 100644 --- a/crates/net/network-api/src/lib.rs +++ b/crates/net/network-api/src/lib.rs @@ -37,6 +37,9 @@ use std::{future::Future, net::SocketAddr, sync::Arc, time::Instant}; use reth_eth_wire_types::{capability::Capabilities, DisconnectReason, EthVersion, Status}; use reth_network_peers::NodeRecord; +use tokio::sync::mpsc::UnboundedReceiver; + +use crate::events::EngineMessage; /// The `PeerId` type. pub type PeerId = alloy_primitives::B512; @@ -47,6 +50,7 @@ pub trait FullNetwork: + NetworkSyncUpdater + NetworkInfo + NetworkEventListenerProvider + + EngineRxProvider + PeersInfo + Peers + Clone @@ -59,6 +63,7 @@ impl FullNetwork for T where + NetworkSyncUpdater + NetworkInfo + NetworkEventListenerProvider + + EngineRxProvider + PeersInfo + Peers + Clone @@ -209,6 +214,15 @@ pub trait Peers: PeersInfo { ) -> impl Future, NetworkError>> + Send; } +/// Provides engine rx that is to communicate between network and engine. +#[auto_impl::auto_impl(&, Arc)] +pub trait EngineRxProvider: Send + Sync { + /// Returns a sharable [`UnboundedReceiver`] that can be cloned and shared. + /// + /// The Engine message is used to communicate between the network and the `EngineTask`. + fn get_to_engine_rx(&self) -> Arc>>; +} + /// Info about an active peer session. #[derive(Debug, Clone)] pub struct PeerInfo { diff --git a/crates/net/network/src/manager.rs b/crates/net/network/src/manager.rs index 477f3ce93..936c8c6da 100644 --- a/crates/net/network/src/manager.rs +++ b/crates/net/network/src/manager.rs @@ -27,24 +27,6 @@ use std::{ time::{Duration, Instant}, }; -use futures::{Future, StreamExt}; -use parking_lot::Mutex; -use reth_eth_wire::{capability::CapabilityMessage, Capabilities, DisconnectReason}; -use reth_fs_util::{self as fs, FsPathError}; -use reth_metrics::common::mpsc::UnboundedMeteredSender; -use reth_network_api::{ - test_utils::PeersHandle, EthProtocolInfo, NetworkEvent, NetworkStatus, PeerInfo, PeerRequest, -}; -use reth_network_peers::{NodeRecord, PeerId}; -use reth_network_types::ReputationChangeKind; -use reth_storage_api::BlockNumReader; -use reth_tasks::shutdown::GracefulShutdown; -use reth_tokio_util::EventSender; -use secp256k1::SecretKey; -use tokio::sync::mpsc::{self, error::TrySendError}; -use tokio_stream::wrappers::UnboundedReceiverStream; -use tracing::{debug, error, trace, warn}; - use crate::{ budget::{DEFAULT_BUDGET_TRY_DRAIN_NETWORK_HANDLE_CHANNEL, DEFAULT_BUDGET_TRY_DRAIN_SWARM}, config::NetworkConfig, @@ -54,7 +36,9 @@ use crate::{ import::{BlockImport, BlockImportOutcome, BlockValidation}, listener::ConnectionListener, message::{NewBlockMessage, PeerMessage}, - metrics::{DisconnectMetrics, NetworkMetrics, NETWORK_POOL_TRANSACTIONS_SCOPE}, + metrics::{ + DisconnectMetrics, NetworkMetrics, NETWORK_PEER_SCOPE, NETWORK_POOL_TRANSACTIONS_SCOPE, + }, network::{NetworkHandle, NetworkHandleMessage}, peers::PeersManager, poll_nested_stream_with_budget, @@ -65,6 +49,25 @@ use crate::{ transactions::NetworkTransactionEvent, FetchClient, NetworkBuilder, }; +use futures::{Future, StreamExt}; +use parking_lot::Mutex; +use reth_eth_wire::{capability::CapabilityMessage, Capabilities, DisconnectReason}; +use reth_fs_util::{self as fs, FsPathError}; +use reth_metrics::common::mpsc::UnboundedMeteredSender; +use reth_network_api::{ + events::{BlockEvent, BlockHashesEvent, EngineMessage}, + test_utils::PeersHandle, + EthProtocolInfo, NetworkEvent, NetworkStatus, PeerInfo, PeerRequest, +}; +use reth_network_peers::{NodeRecord, PeerId}; +use reth_network_types::ReputationChangeKind; +use reth_storage_api::BlockNumReader; +use reth_tasks::shutdown::GracefulShutdown; +use reth_tokio_util::EventSender; +use secp256k1::SecretKey; +use tokio::sync::mpsc::{self, error::TrySendError}; +use tokio_stream::wrappers::UnboundedReceiverStream; +use tracing::{debug, error, trace, warn}; #[cfg_attr(doc, aquamarine::aquamarine)] /// Manages the _entire_ state of the network. diff --git a/crates/net/network/src/message.rs b/crates/net/network/src/message.rs index 80a5ffcfd..10f9ddcba 100644 --- a/crates/net/network/src/message.rs +++ b/crates/net/network/src/message.rs @@ -10,9 +10,9 @@ use std::{ use futures::FutureExt; use reth_eth_wire::{ - capability::RawCapabilityMessage, message::RequestPair, BlockBodies, BlockHashNumber, - BlockHeaders, EthMessage, GetBlockBodies, GetBlockHeaders, NewBlock, NewBlockHashes, NewPooledTransactionHashes, NodeData, - PooledTransactions, Receipts, SharedTransactions, Transactions, + capability::RawCapabilityMessage, message::RequestPair, BlockBodies, BlockHeaders, EthMessage, + GetBlockBodies, GetBlockHeaders, NewBlock, NewBlockHashes, NewPooledTransactionHashes, + NodeData, PooledTransactions, Receipts, SharedTransactions, Transactions, }; use reth_network_api::PeerRequest; use reth_network_p2p::error::{RequestError, RequestResult}; @@ -204,4 +204,3 @@ impl PeerResponseResult { self.err().is_some() } } - diff --git a/crates/net/network/src/network.rs b/crates/net/network/src/network.rs index 0e5cfab85..db7b1cdc8 100644 --- a/crates/net/network/src/network.rs +++ b/crates/net/network/src/network.rs @@ -11,8 +11,9 @@ use parking_lot::Mutex; use reth_discv4::Discv4; use reth_eth_wire::{DisconnectReason, NewBlock, NewPooledTransactionHashes, SharedTransactions}; use reth_network_api::{ + events::EngineMessage, test_utils::{PeersHandle, PeersHandleProvider}, - BlockDownloaderProvider, DiscoveryEvent, NetworkError, NetworkEvent, + BlockDownloaderProvider, DiscoveryEvent, EngineRxProvider, NetworkError, NetworkEvent, NetworkEventListenerProvider, NetworkInfo, NetworkStatus, PeerInfo, PeerRequest, Peers, PeersInfo, }; @@ -92,13 +93,6 @@ impl NetworkHandle { &self.inner.to_manager_tx } - /// Returns a sharable [`UnboundedReceiver`] that can be cloned and shared. - /// - /// The Engine message is used to communicate between the network and the `EngineTask`. - pub fn get_to_engine_rx(&self) -> Arc>> { - self.inner.engine_rx.clone() - } - /// Returns a new [`FetchClient`] that can be cloned and shared. /// /// The [`FetchClient`] is the entrypoint for sending requests to the network. @@ -414,6 +408,12 @@ impl BlockDownloaderProvider for NetworkHandle { } } +impl EngineRxProvider for NetworkHandle { + fn get_to_engine_rx(&self) -> Arc>> { + self.inner.engine_rx.clone() + } +} + #[derive(Debug)] struct NetworkInner { /// Number of active peer sessions the node's currently handling. diff --git a/crates/net/network/src/session/active.rs b/crates/net/network/src/session/active.rs index 477ec002b..9df322c96 100644 --- a/crates/net/network/src/session/active.rs +++ b/crates/net/network/src/session/active.rs @@ -172,7 +172,7 @@ impl ActiveSession { } match msg { - message @ EthMessage::Status(_) | message @ EthMessage::UpgradeStatus(_) => { + message @ (EthMessage::Status(_) | EthMessage::UpgradeStatus(_)) => { OnIncomingMessageOutcome::BadMessage { error: EthStreamError::EthHandshakeError( EthHandshakeError::StatusNotInHandshake, diff --git a/crates/node/builder/Cargo.toml b/crates/node/builder/Cargo.toml index 2e6fd258f..c95cb0105 100644 --- a/crates/node/builder/Cargo.toml +++ b/crates/node/builder/Cargo.toml @@ -55,9 +55,6 @@ reth-engine-service.workspace = true reth-tokio-util.workspace = true reth-engine-tree.workspace = true -reth-bsc-consensus = { workspace = true, optional = true } -reth-bsc-engine = { workspace = true, optional = true } - ## ethereum alloy-network.workspace = true @@ -84,9 +81,13 @@ eyre.workspace = true fdlimit.workspace = true rayon.workspace = true -# tracing +## tracing tracing.workspace = true +## bsc +reth-bsc-consensus = { workspace = true, optional = true } +reth-bsc-engine = { workspace = true, optional = true } + [dev-dependencies] tempfile.workspace = true diff --git a/crates/node/builder/src/launch/mod.rs b/crates/node/builder/src/launch/mod.rs index 7378cb8c6..5b22846d5 100644 --- a/crates/node/builder/src/launch/mod.rs +++ b/crates/node/builder/src/launch/mod.rs @@ -17,11 +17,14 @@ use reth_beacon_consensus::{ }; use reth_blockchain_tree::{noop::NoopBlockchainTree, BlockchainTreeConfig}; #[cfg(feature = "bsc")] -use reth_bsc_engine::ParliaEngineBuilder;use reth_chainspec::ChainSpec; +use reth_bsc_engine::ParliaEngineBuilder; +use reth_chainspec::ChainSpec; use reth_consensus_debug_client::{DebugConsensusClient, EtherscanBlockProvider, RpcBlockProvider}; use reth_engine_util::EngineMessageStreamExt; use reth_exex::ExExManagerHandle; use reth_network::{BlockDownloaderProvider, NetworkEventListenerProvider}; +#[cfg(feature = "bsc")] +use reth_network_api::EngineRxProvider; use reth_node_api::{FullNodeComponents, FullNodeTypes, NodeAddOns}; use reth_node_core::{ dirs::{ChainPath, DataDirPath}, diff --git a/crates/node/core/Cargo.toml b/crates/node/core/Cargo.toml index df8d33aac..811bed4e3 100644 --- a/crates/node/core/Cargo.toml +++ b/crates/node/core/Cargo.toml @@ -39,12 +39,12 @@ reth-consensus-common.workspace = true reth-prune-types.workspace = true reth-stages-types.workspace = true reth-optimism-chainspec = { workspace = true, optional = true } +reth-bsc-chainspec = { workspace = true, optional = true } # ethereum alloy-genesis.workspace = true alloy-rpc-types-engine.workspace = true - # misc eyre.workspace = true clap = { workspace = true, features = ["derive"] } @@ -60,8 +60,6 @@ dirs-next = "2.0.0" shellexpand.workspace = true serde_json.workspace = true - - # tracing tracing.workspace = true @@ -90,13 +88,12 @@ optimism = [ "reth-rpc-eth-api/optimism", "dep:reth-optimism-chainspec", ] - opbnb = [ "reth-primitives/opbnb", ] - bsc = [ "reth-primitives/bsc", + "dep:reth-bsc-chainspec", ] # Features for vergen to generate correct env vars diff --git a/crates/node/core/src/args/utils.rs b/crates/node/core/src/args/utils.rs index ffab812f4..9b8993059 100644 --- a/crates/node/core/src/args/utils.rs +++ b/crates/node/core/src/args/utils.rs @@ -3,12 +3,16 @@ use std::{path::PathBuf, sync::Arc}; use alloy_genesis::Genesis; +#[cfg(feature = "bsc")] +use reth_bsc_chainspec::{BSC_CHAPEL, BSC_MAINNET, BSC_RIALTO}; use reth_chainspec::ChainSpec; -#[cfg(not(feature = "optimism"))] +#[cfg(all(not(feature = "optimism"), not(feature = "bsc")))] use reth_chainspec::{DEV, HOLESKY, MAINNET, SEPOLIA}; use reth_fs_util as fs; #[cfg(feature = "optimism")] use reth_optimism_chainspec::{BASE_MAINNET, BASE_SEPOLIA, OP_DEV, OP_MAINNET, OP_SEPOLIA}; +#[cfg(all(feature = "optimism", feature = "opbnb"))] +use reth_optimism_chainspec::{OPBNB_MAINNET, OPBNB_QA, OPBNB_TESTNET}; #[cfg(feature = "bsc")] /// Chains supported by bsc. First value should be used as the default. @@ -30,7 +34,7 @@ pub fn chain_help() -> String { /// /// The value parser matches either a known chain, the path /// to a json file, or a json formatted string in-memory. The json needs to be a Genesis struct. -#[cfg(not(feature = "optimism"))] +#[cfg(all(not(feature = "optimism"), not(feature = "bsc")))] pub fn chain_value_parser(s: &str) -> eyre::Result, eyre::Error> { Ok(match s { "mainnet" => MAINNET.clone(), @@ -53,18 +57,26 @@ pub fn chain_value_parser(s: &str) -> eyre::Result, eyre::Error> "base" => BASE_MAINNET.inner.clone(), "base_sepolia" | "base-sepolia" => BASE_SEPOLIA.inner.clone(), "dev" => OP_DEV.inner.clone(), - #[cfg(all(feature = "optimism", feature = "opbnb"))] - "opbnb_mainnet" | "opbnb-mainnet" => OPBNB_MAINNET.clone(), - #[cfg(all(feature = "optimism", feature = "opbnb"))] - "opbnb_testnet" | "opbnb-testnet" => OPBNB_TESTNET.clone(), - #[cfg(all(feature = "optimism", feature = "opbnb"))] - "opbnb_qa" | "opbnb-qa" => OPBNB_QA.clone(), - #[cfg(feature = "bsc")] - "bsc" | "bsc-mainnet" => BSC_MAINNET.clone(), - #[cfg(feature = "bsc")] - "bsc-testnet" => BSC_TESTNET.clone(), - #[cfg(feature = "bsc")] - "bsc-rialto" => BSC_RIALTO.clone(), + #[cfg(feature = "opbnb")] + "opbnb_mainnet" | "opbnb-mainnet" => OPBNB_MAINNET.inner.clone(), + #[cfg(feature = "opbnb")] + "opbnb_testnet" | "opbnb-testnet" => OPBNB_TESTNET.inner.clone(), + #[cfg(feature = "opbnb")] + "opbnb_qa" | "opbnb-qa" => OPBNB_QA.inner.clone(), + _ => parse_custom_chain_spec(s)?, + })) +} + +/// Clap value parser for [`BscChainSpec`](reth_bsc_chainspec::BscChainSpec)s. +/// +/// The value parser matches either a known chain, the path +/// to a json file, or a json formatted string in-memory. The json needs to be a Genesis struct. +#[cfg(feature = "bsc")] +pub fn chain_value_parser(s: &str) -> eyre::Result, eyre::Error> { + Ok(Arc::new(match s { + "bsc" | "bsc-mainnet" | "bsc_mainnet" => BSC_MAINNET.inner.clone(), + "bsc-testnet" | "bsc-chapel" | "bsc_testnet" | "bsc_chapel" => BSC_CHAPEL.inner.clone(), + "bsc-rialto" | "bsc-qa" | "bsc_rialto" | "bsc_qa" => BSC_RIALTO.inner.clone(), _ => parse_custom_chain_spec(s)?, })) } diff --git a/crates/optimism/chainspec/src/lib.rs b/crates/optimism/chainspec/src/lib.rs index fd290448d..8954f8ab0 100644 --- a/crates/optimism/chainspec/src/lib.rs +++ b/crates/optimism/chainspec/src/lib.rs @@ -17,12 +17,18 @@ mod base_sepolia; mod dev; mod op; mod op_sepolia; +mod opbnb; +mod opbnb_qa; +mod opbnb_testnet; pub use base::BASE_MAINNET; pub use base_sepolia::BASE_SEPOLIA; pub use dev::OP_DEV; pub use op::OP_MAINNET; pub use op_sepolia::OP_SEPOLIA; +pub use opbnb::OPBNB_MAINNET; +pub use opbnb_qa::OPBNB_QA; +pub use opbnb_testnet::OPBNB_TESTNET; use derive_more::{Constructor, Deref, Into}; use reth_chainspec::ChainSpec; diff --git a/crates/optimism/chainspec/src/opbnb.rs b/crates/optimism/chainspec/src/opbnb.rs index d14a6b3d6..a316492e7 100644 --- a/crates/optimism/chainspec/src/opbnb.rs +++ b/crates/optimism/chainspec/src/opbnb.rs @@ -1,4 +1,4 @@ -//! Chain specification for the Base Mainnet network. +//! Chain specification for the Opbnb Mainnet network. #[cfg(not(feature = "std"))] use alloc::sync::Arc; @@ -13,27 +13,22 @@ use reth_ethereum_forks::{EthereumHardfork, OptimismHardfork}; use crate::OpChainSpec; -/// The Base mainnet spec -pub static BASE_MAINNET: Lazy> = Lazy::new(|| { +/// The opbnb mainnet spec +pub static OPBNB_MAINNET: Lazy> = Lazy::new(|| { OpChainSpec { inner: ChainSpec { - chain: Chain::base_mainnet(), - genesis: serde_json::from_str(include_str!("../res/genesis/base.json")) - .expect("Can't deserialize Base genesis json"), + chain: Chain::opbnb_mainnet(), + genesis: serde_json::from_str(include_str!("../res/genesis/opbnb_mainnet.json")) + .expect("Can't deserialize opBNB mainent genesis json"), genesis_hash: Some(b256!( - "f712aa9241cc24369b143cf6dce85f0902a9731e70d66818a3a5845b296c73dd" + "4dd61178c8b0f01670c231597e7bcb368e84545acd46d940a896d6a791dd6df4" )), paris_block_and_final_difficulty: Some((0, U256::from(0))), - hardforks: OptimismHardfork::base_mainnet(), + hardforks: OptimismHardfork::opbnb_mainnet(), base_fee_params: BaseFeeParamsKind::Variable( - vec![ - (EthereumHardfork::London.boxed(), BaseFeeParams::optimism()), - (OptimismHardfork::Canyon.boxed(), BaseFeeParams::optimism_canyon()), - ] - .into(), + vec![(EthereumHardfork::London.boxed(), BaseFeeParams::ethereum())].into(), ), - max_gas_limit: crate::constants::BASE_MAINNET_MAX_GAS_LIMIT, - prune_delete_limit: 10000, + prune_delete_limit: 0, ..Default::default() }, } diff --git a/crates/optimism/chainspec/src/opbnb_qa.rs b/crates/optimism/chainspec/src/opbnb_qa.rs index 3259dec9b..64d7c6412 100644 --- a/crates/optimism/chainspec/src/opbnb_qa.rs +++ b/crates/optimism/chainspec/src/opbnb_qa.rs @@ -1,4 +1,4 @@ -//! Chain specification for the OpBNB Mainnet network. +//! Chain specification for the Opbnb QA network. #[cfg(not(feature = "std"))] use alloc::sync::Arc; @@ -13,18 +13,18 @@ use reth_ethereum_forks::{EthereumHardfork, OptimismHardfork}; use crate::OpChainSpec; -/// The OpBNB mainnet spec -pub static OPBNB_MAINNET: Lazy> = Lazy::new(|| { +/// The opbnb qa spec +pub static OPBNB_QA: Lazy> = Lazy::new(|| { OpChainSpec { inner: ChainSpec { - chain: Chain::opbnb_mainnet(), - genesis: serde_json::from_str(include_str!("../res/genesis/opbnb_mainnet.json")) - .expect("Can't deserialize opBNB mainent genesis json"), + chain: Chain::from_id(4530), + genesis: serde_json::from_str(include_str!("../res/genesis/opbnb_qa.json")) + .expect("Can't deserialize opBNB qa genesis json"), genesis_hash: Some(b256!( - "4dd61178c8b0f01670c231597e7bcb368e84545acd46d940a896d6a791dd6df4" + "bb2282e70cc2aebb17342003ad1c0aeab6a8114f8a4718730c13711d787b5de9" )), paris_block_and_final_difficulty: Some((0, U256::from(0))), - hardforks: OptimismHardfork::opbnb_mainnet(), + hardforks: OptimismHardfork::opbnb_qa(), base_fee_params: BaseFeeParamsKind::Variable( vec![(EthereumHardfork::London.boxed(), BaseFeeParams::ethereum())].into(), ), diff --git a/crates/optimism/chainspec/src/opbnb_testnet.rs b/crates/optimism/chainspec/src/opbnb_testnet.rs index 3259dec9b..c1f9df30e 100644 --- a/crates/optimism/chainspec/src/opbnb_testnet.rs +++ b/crates/optimism/chainspec/src/opbnb_testnet.rs @@ -1,4 +1,4 @@ -//! Chain specification for the OpBNB Mainnet network. +//! Chain specification for the Opbnb Mainnet network. #[cfg(not(feature = "std"))] use alloc::sync::Arc; @@ -13,18 +13,18 @@ use reth_ethereum_forks::{EthereumHardfork, OptimismHardfork}; use crate::OpChainSpec; -/// The OpBNB mainnet spec -pub static OPBNB_MAINNET: Lazy> = Lazy::new(|| { +/// The opbnb testnet spec +pub static OPBNB_TESTNET: Lazy> = Lazy::new(|| { OpChainSpec { inner: ChainSpec { - chain: Chain::opbnb_mainnet(), - genesis: serde_json::from_str(include_str!("../res/genesis/opbnb_mainnet.json")) - .expect("Can't deserialize opBNB mainent genesis json"), + chain: Chain::opbnb_testnet(), + genesis: serde_json::from_str(include_str!("../res/genesis/opbnb_testnet.json")) + .expect("Can't deserialize opBNB testnet genesis json"), genesis_hash: Some(b256!( - "4dd61178c8b0f01670c231597e7bcb368e84545acd46d940a896d6a791dd6df4" + "51fa57729dfb1c27542c21b06cb72a0459c57440ceb43a465dae1307cd04fe80" )), paris_block_and_final_difficulty: Some((0, U256::from(0))), - hardforks: OptimismHardfork::opbnb_mainnet(), + hardforks: OptimismHardfork::opbnb_testnet(), base_fee_params: BaseFeeParamsKind::Variable( vec![(EthereumHardfork::London.boxed(), BaseFeeParams::ethereum())].into(), ), diff --git a/crates/optimism/cli/src/chainspec.rs b/crates/optimism/cli/src/chainspec.rs index bee5124a3..86c95dea7 100644 --- a/crates/optimism/cli/src/chainspec.rs +++ b/crates/optimism/cli/src/chainspec.rs @@ -4,7 +4,8 @@ use clap::{builder::TypedValueParser, error::Result, Arg, Command}; use reth_cli::chainspec::ChainSpecParser; use reth_node_core::args::utils::parse_custom_chain_spec; use reth_optimism_chainspec::{ - OpChainSpec, BASE_MAINNET, BASE_SEPOLIA, OP_DEV, OP_MAINNET, OP_SEPOLIA, + OpChainSpec, BASE_MAINNET, BASE_SEPOLIA, OPBNB_MAINNET, OPBNB_QA, OPBNB_TESTNET, OP_DEV, + OP_MAINNET, OP_SEPOLIA, }; /// Clap value parser for [`OpChainSpec`]s. @@ -18,6 +19,9 @@ fn chain_value_parser(s: &str) -> eyre::Result, eyre::Error> { "optimism_sepolia" | "optimism-sepolia" => OP_SEPOLIA.clone(), "base" => BASE_MAINNET.clone(), "base_sepolia" | "base-sepolia" => BASE_SEPOLIA.clone(), + "opbnb_mainnet" | "opbnb-mainnet" => OPBNB_MAINNET.clone(), + "opbnb_testnet" | "opbnb-testnet" => OPBNB_TESTNET.clone(), + "opbnb_qa" | "opbnb-qa" => OPBNB_QA.clone(), _ => Arc::new(OpChainSpec { inner: parse_custom_chain_spec(s)? }), }) } @@ -35,6 +39,12 @@ impl ChainSpecParser for OpChainSpecParser { "base", "base_sepolia", "base-sepolia", + "opbnb_mainnet", + "opbnb-mainnet", + "opbnb_testnet", + "opbnb-testnet", + "opbnb_qa", + "opbnb-qa", ]; fn parse(s: &str) -> eyre::Result> { diff --git a/crates/optimism/evm/src/execute.rs b/crates/optimism/evm/src/execute.rs index 190b5d229..4dcfd08a1 100644 --- a/crates/optimism/evm/src/execute.rs +++ b/crates/optimism/evm/src/execute.rs @@ -337,11 +337,8 @@ where let governance_token_contract_address = Address::from_str("0x4200000000000000000000000000000000000042").unwrap(); - let w_bnb_contract_account = self - .state - .load_cache_account(w_bnb_contract_address) - .map_err(|err| BlockExecutionError::Other(Box::new(err.into()))) - .unwrap(); + let w_bnb_contract_account = + self.state.load_cache_account(w_bnb_contract_address).map_err(|err| err.into())?; // change the token symbol and token name let w_bnb_contract_change = w_bnb_contract_account.change( w_bnb_contract_account.account_info().unwrap(), HashMap::from([ @@ -361,8 +358,7 @@ where let governance_token_account = self .state .load_cache_account(governance_token_contract_address) - .map_err(|err| BlockExecutionError::Other(Box::new(err.into()))) - .unwrap(); + .map_err(|err| err.into())?; // destroy governance token contract let governance_token_change = governance_token_account.selfdestruct().unwrap(); diff --git a/crates/optimism/rpc/src/eth/receipt.rs b/crates/optimism/rpc/src/eth/receipt.rs index bc4bf54ad..a97b1350c 100644 --- a/crates/optimism/rpc/src/eth/receipt.rs +++ b/crates/optimism/rpc/src/eth/receipt.rs @@ -1,6 +1,6 @@ //! Loads and formats OP receipt RPC response. -use reth_chainspec::OptimismHardforks; +use reth_chainspec::{ChainSpecProvider, OptimismHardforks}; use reth_node_api::FullNodeComponents; use reth_primitives::{Receipt, TransactionMeta, TransactionSigned}; use reth_rpc_eth_api::{ @@ -39,7 +39,7 @@ where let l1_block_info = reth_evm_optimism::extract_l1_info(&block).ok(); let mut optimism_tx_meta = self.build_op_tx_meta(&tx, l1_block_info, block.timestamp)?; - if self.inner.chain_spec().is_wright_active_at_timestamp(block.timestamp) && + if self.inner.provider().chain_spec().is_wright_active_at_timestamp(block.timestamp) && tx.effective_gas_price(meta.base_fee) == 0 { optimism_tx_meta.l1_fee = Some(0); diff --git a/crates/primitives-traits/src/blob_sidecar.rs b/crates/primitives-traits/src/blob_sidecar.rs index e6474f6bf..af11850a1 100644 --- a/crates/primitives-traits/src/blob_sidecar.rs +++ b/crates/primitives-traits/src/blob_sidecar.rs @@ -6,15 +6,13 @@ use alloy_rlp::{Decodable, Encodable, RlpDecodableWrapper, RlpEncodableWrapper}; use bytes::{Buf, BufMut}; use core::mem; use derive_more::{Deref, DerefMut, From, IntoIterator}; -use reth_codecs::{derive_arbitrary, reth_codec, Compact}; +use reth_codecs::Compact; use revm_primitives::U256; use serde::{Deserialize, Serialize}; #[cfg(not(feature = "std"))] use alloc::vec::Vec; -#[reth_codec(no_arbitrary)] -#[derive_arbitrary] #[derive( Debug, Clone, @@ -29,7 +27,9 @@ use alloc::vec::Vec; RlpDecodableWrapper, Serialize, Deserialize, + Compact, )] +#[cfg_attr(any(test, feature = "arbitrary"), derive(arbitrary::Arbitrary))] pub struct BlobSidecars(Vec); impl BlobSidecars { @@ -51,8 +51,8 @@ impl BlobSidecars { } } -#[derive_arbitrary] #[derive(Debug, Clone, PartialEq, Eq, Default, Serialize, Deserialize)] +#[cfg_attr(any(test, feature = "arbitrary"), derive(arbitrary::Arbitrary))] pub struct BlobSidecar { pub blob_transaction_sidecar: BlobTransactionSidecar, pub block_number: U256, diff --git a/crates/primitives/Cargo.toml b/crates/primitives/Cargo.toml index 655453c7e..c2dc17aac 100644 --- a/crates/primitives/Cargo.toml +++ b/crates/primitives/Cargo.toml @@ -22,6 +22,7 @@ revm-primitives = { workspace = true, features = ["serde"] } reth-chainspec = { workspace = true, optional = true } reth-codecs = { workspace = true, optional = true } reth-optimism-chainspec = { workspace = true, optional = true } +reth-bsc-chainspec = { workspace = true, optional = true } # ethereum alloy-primitives = { workspace = true, features = ["rand", "rlp"] } @@ -64,7 +65,6 @@ proptest = { workspace = true, optional = true } alloy-chains = { workspace = true, optional = true } include_dir = { version = "0.7.4", optional = true } lazy_static = { version = "1.4.0", optional = true } -thiserror = { workspace = true, optional = true } [dev-dependencies] # eth @@ -83,7 +83,6 @@ serde_json.workspace = true test-fuzz.workspace = true modular-bitfield.workspace = true - criterion.workspace = true pprof = { workspace = true, features = [ "flamegraph", @@ -93,7 +92,7 @@ pprof = { workspace = true, features = [ [features] default = ["c-kzg", "alloy-compat", "std", "reth-codec", "secp256k1"] -std = ["thiserror", "reth-primitives-traits/std"] +std = ["dep:thiserror", "reth-primitives-traits/std"] reth-codec = ["dep:reth-codecs", "dep:zstd", "dep:modular-bitfield", "std"] asm-keccak = ["alloy-primitives/asm-keccak"] arbitrary = [ @@ -129,7 +128,8 @@ bsc = [ "dep:include_dir", "dep:lazy_static", "dep:revm", - "dep:thiserror" + "dep:thiserror", + "dep:reth-bsc-chainspec", ] alloy-compat = ["reth-primitives-traits/alloy-compat", "dep:alloy-rpc-types", "dep:alloy-serde", "dep:op-alloy-rpc-types"] diff --git a/crates/primitives/src/lib.rs b/crates/primitives/src/lib.rs index 1a21ad388..2469fddcf 100644 --- a/crates/primitives/src/lib.rs +++ b/crates/primitives/src/lib.rs @@ -120,7 +120,7 @@ mod optimism { pub use crate::transaction::{TxDeposit, DEPOSIT_TX_TYPE_ID}; pub use reth_optimism_chainspec::{BASE_MAINNET, BASE_SEPOLIA, OP_MAINNET, OP_SEPOLIA}; #[cfg(feature = "opbnb")] - pub use reth_chainspec::{OPBNB_MAINNET, OPBNB_QA, OPBNB_TESTNET}; + pub use reth_optimism_chainspec::{OPBNB_MAINNET, OPBNB_QA, OPBNB_TESTNET}; } #[cfg(feature = "optimism")] @@ -129,7 +129,7 @@ pub use optimism::*; /// Bsc specific re-exports #[cfg(feature = "bsc")] mod bsc { - pub use reth_chainspec::{BSC_MAINNET, BSC_RIALTO, BSC_TESTNET}; + pub use reth_bsc_chainspec::{BSC_CHAPEL, BSC_MAINNET, BSC_RIALTO}; } #[cfg(feature = "bsc")] diff --git a/crates/primitives/src/parlia/snapshot.rs b/crates/primitives/src/parlia/snapshot.rs index 6cc5a609a..01213dfb1 100644 --- a/crates/primitives/src/parlia/snapshot.rs +++ b/crates/primitives/src/parlia/snapshot.rs @@ -1,11 +1,12 @@ +use std::collections::{BTreeMap, HashMap}; + use crate::{ parlia::{VoteAddress, VoteAttestation, VoteData}, Address, BlockNumber, Header, B256, }; -#[cfg(feature = "reth-codec")] +#[cfg(any(test, feature = "reth-codec"))] use reth_codecs::Compact; use serde::{Deserialize, Serialize}; -use std::collections::{BTreeMap, HashMap}; /// Number of blocks after which to save the snapshot to the database pub const CHECKPOINT_INTERVAL: u64 = 1024; @@ -13,8 +14,10 @@ pub const CHECKPOINT_INTERVAL: u64 = 1024; pub const DEFAULT_TURN_LENGTH: u8 = 1; /// record validators information -#[cfg_attr(any(test, feature = "reth-codec"), reth_codecs::reth_codec)] #[derive(Debug, Default, PartialEq, Eq, Clone, Serialize, Deserialize)] +#[cfg_attr(any(test, feature = "arbitrary"), derive(arbitrary::Arbitrary))] +#[cfg_attr(any(test, feature = "reth-codec"), derive(Compact))] +#[cfg_attr(any(test, feature = "reth-codec"), reth_codecs::add_arbitrary_tests(compact))] pub struct ValidatorInfo { /// The index of the validator /// The index should offset by 1 diff --git a/crates/primitives/src/parlia/vote.rs b/crates/primitives/src/parlia/vote.rs index ec49ae1a9..5a2eaa57e 100644 --- a/crates/primitives/src/parlia/vote.rs +++ b/crates/primitives/src/parlia/vote.rs @@ -1,7 +1,7 @@ use crate::{alloy_primitives::wrap_fixed_bytes, keccak256, BlockNumber, B256}; use alloy_rlp::{RlpDecodable, RlpEncodable}; use bytes::Bytes; -#[cfg(feature = "reth-codec")] +#[cfg(any(test, feature = "reth-codec"))] use reth_codecs::{impl_compact_for_wrapped_bytes, Compact}; use serde::{Deserialize, Serialize}; @@ -24,10 +24,12 @@ wrap_fixed_bytes!( impl_compact_for_wrapped_bytes!(VoteAddress, VoteSignature); /// `VoteData` represents the vote range that validator voted for fast finality. -#[cfg_attr(any(test, feature = "reth-codec"), reth_codecs::reth_codec)] #[derive( Clone, Copy, Debug, PartialEq, Eq, Default, RlpEncodable, RlpDecodable, Serialize, Deserialize, )] +#[cfg_attr(any(test, feature = "arbitrary"), derive(arbitrary::Arbitrary))] +#[cfg_attr(any(test, feature = "reth-codec"), derive(Compact))] +#[cfg_attr(any(test, feature = "reth-codec"), reth_codecs::add_arbitrary_tests(compact))] pub struct VoteData { /// The source block number should be the latest justified block number. pub source_number: BlockNumber, diff --git a/crates/primitives/src/system_contracts/mod.rs b/crates/primitives/src/system_contracts/mod.rs index 62864c8b7..7767aefbe 100644 --- a/crates/primitives/src/system_contracts/mod.rs +++ b/crates/primitives/src/system_contracts/mod.rs @@ -1,14 +1,16 @@ #![cfg(feature = "bsc")] #![allow(missing_docs)] +use std::collections::HashMap; + use crate::{hex, Address, BlockNumber, TransactionSigned}; use alloy_chains::Chain; use include_dir::{include_dir, Dir}; use lazy_static::lazy_static; -use reth_chainspec::{ChainSpec, BSC_MAINNET, BSC_RIALTO, BSC_TESTNET}; +use reth_bsc_chainspec::{BSC_CHAPEL, BSC_MAINNET, BSC_RIALTO}; +use reth_chainspec::ChainSpec; use reth_ethereum_forks::BscHardfork; use revm_primitives::Bytecode; -use std::collections::HashMap; use thiserror::Error; pub const VALIDATOR_CONTRACT: &str = "0x0000000000000000000000000000000000001000"; @@ -56,7 +58,7 @@ lazy_static! { /// testnet system contracts: hardfork -> address -> Bytecode pub(crate) static ref BSC_TESTNET_CONTRACTS: HashMap>> = - read_all_system_contracts(BSC_TESTNET.as_ref()); + read_all_system_contracts(BSC_CHAPEL.as_ref()); /// qa system contracts: hardfork -> address -> Bytecode pub(crate) static ref BSC_QA_CONTRACTS: HashMap>> = @@ -268,10 +270,10 @@ pub fn get_upgrade_system_contracts( condition.transitions_at_timestamp(block_time, parent_block_time) { if let Ok(contracts) = get_system_contract_codes(spec, fork.name()) { - contracts.iter().for_each(|(k, v)| { + for (k, v) in &contracts { let address = Address::parse_checksummed(k.clone(), None).unwrap(); m.insert(address, v.clone()); - }); + } } else { return Err(SystemContractError::FailToUpdate); } diff --git a/crates/rpc/rpc-eth-api/src/core.rs b/crates/rpc/rpc-eth-api/src/core.rs index 11a2666c3..59c907cc8 100644 --- a/crates/rpc/rpc-eth-api/src/core.rs +++ b/crates/rpc/rpc-eth-api/src/core.rs @@ -13,8 +13,9 @@ use reth_rpc_types::{ serde_helpers::JsonStorageKey, simulate::{SimBlock, SimulatedBlock}, state::{EvmOverrides, StateOverride}, - AnyTransactionReceipt, BlockOverrides, BlockTransactions, BlockSidecar, Bundle, EIP1186AccountProofResponse, - EthCallResponse, FeeHistory, Header, Index, StateContext, SyncStatus, TransactionRequest, Work, + AnyTransactionReceipt, BlockOverrides, BlockSidecar, BlockTransactions, Bundle, + EIP1186AccountProofResponse, EthCallResponse, FeeHistory, Header, Index, StateContext, + SyncStatus, TransactionRequest, Work, }; use reth_transaction_pool::{PoolTransaction, TransactionPool}; use tracing::trace; diff --git a/crates/rpc/rpc-eth-api/src/helpers/block.rs b/crates/rpc/rpc-eth-api/src/helpers/block.rs index c144a866f..b7d64d411 100644 --- a/crates/rpc/rpc-eth-api/src/helpers/block.rs +++ b/crates/rpc/rpc-eth-api/src/helpers/block.rs @@ -215,7 +215,7 @@ pub trait EthBlocks: LoadBlock { fn rpc_block_sidecars( &self, block_id: BlockId, - ) -> impl Future>>> + Send + ) -> impl Future>, Self::Error>> + Send where Self: LoadPendingBlock + SpawnBlocking, { @@ -224,12 +224,14 @@ pub trait EthBlocks: LoadBlock { return Ok(None); } - let sidecars = - if let Some(block_hash) = LoadBlock::provider(self).block_hash_for_id(block_id)? { - self.cache().get_sidecars(block_hash).await? - } else { - None - }; + let sidecars = if let Some(block_hash) = LoadBlock::provider(self) + .block_hash_for_id(block_id) + .map_err(Self::Error::from_eth_err)? + { + self.cache().get_sidecars(block_hash).await.map_err(Self::Error::from_eth_err)? + } else { + None + }; Ok(sidecars.map(|sidecars| { sidecars diff --git a/crates/rpc/rpc-eth-api/src/helpers/call.rs b/crates/rpc/rpc-eth-api/src/helpers/call.rs index b262517d9..e58bfb363 100644 --- a/crates/rpc/rpc-eth-api/src/helpers/call.rs +++ b/crates/rpc/rpc-eth-api/src/helpers/call.rs @@ -1,12 +1,13 @@ //! Loads a pending block from database. Helper trait for `eth_` transaction, call and trace RPC //! methods. -use crate::{AsEthApiError, FromEthApiError, FromEvmError, IntoEthApiError}; use super::{LoadBlock, LoadPendingBlock, LoadState, LoadTransaction, SpawnBlocking, Trace}; use cfg_if::cfg_if; use futures::Future; #[cfg(feature = "bsc")] use reth_chainspec::BscHardforks; +#[cfg(feature = "bsc")] +use reth_errors::RethError; use reth_evm::{ConfigureEvm, ConfigureEvmEnv}; #[cfg(feature = "bsc")] use reth_primitives::system_contracts::get_upgrade_system_contracts; @@ -47,6 +48,8 @@ use revm::{Database, DatabaseCommit}; use revm_inspectors::access_list::AccessListInspector; use tracing::trace; +use crate::{AsEthApiError, FromEthApiError, FromEvmError, IntoEthApiError}; + /// Execution related functions for the [`EthApiServer`](crate::EthApiServer) trait in /// the `eth_` namespace. pub trait EthCall: Call + LoadPendingBlock { @@ -537,7 +540,9 @@ pub trait Call: LoadState + SpawnBlocking { .expect("get upgrade system contracts failed"); for (k, v) in contracts { - let account = evm.db_mut().load_account(k)?; + let account = evm.db_mut().load_account(k).map_err(|error| { + EthApiError::Internal(RethError::Other("load account failed".into())) + })?; if account.account_state == NotExisting { account.account_state = Touched; } @@ -551,12 +556,17 @@ pub trait Call: LoadState + SpawnBlocking { // this should be done before return #[cfg(feature = "bsc")] if before_system_tx && is_system_transaction(&tx, tx.signer(), block_env.coinbase) { - let sys_acc = evm.db_mut().load_account(SYSTEM_ADDRESS)?; + let sys_acc = evm.db_mut().load_account(SYSTEM_ADDRESS).map_err(|error| { + EthApiError::Internal(RethError::Other("load account failed".into())) + })?; let balance = sys_acc.info.balance; if balance > U256::ZERO { sys_acc.info.balance = U256::ZERO; - let val_acc = evm.db_mut().load_account(block_env.coinbase)?; + let val_acc = + evm.db_mut().load_account(block_env.coinbase).map_err(|error| { + EthApiError::Internal(RethError::Other("load account failed".into())) + })?; if val_acc.account_state == NotExisting { val_acc.account_state = Touched; } @@ -579,7 +589,9 @@ pub trait Call: LoadState + SpawnBlocking { .expect("get upgrade system contracts failed"); for (k, v) in contracts { - let account = evm.db_mut().load_account(k)?; + let account = evm.db_mut().load_account(k).map_err(|error| { + EthApiError::Internal(RethError::Other("load account failed".into())) + })?; if account.account_state == NotExisting { account.account_state = Touched; } diff --git a/crates/rpc/rpc-eth-api/src/helpers/trace.rs b/crates/rpc/rpc-eth-api/src/helpers/trace.rs index 3b8d9f329..d8932dead 100644 --- a/crates/rpc/rpc-eth-api/src/helpers/trace.rs +++ b/crates/rpc/rpc-eth-api/src/helpers/trace.rs @@ -1,5 +1,6 @@ //! Loads a pending block from database. Helper trait for `eth_` call and trace RPC methods. +use super::{Call, LoadBlock, LoadPendingBlock, LoadState, LoadTransaction}; use cfg_if::cfg_if; use futures::Future; use reth_evm::{ConfigureEvm, ConfigureEvmEnv}; @@ -16,10 +17,10 @@ use revm::{db::CacheDB, Database, DatabaseCommit, GetInspector, Inspector}; use revm_inspectors::tracing::{TracingInspector, TracingInspectorConfig}; use revm_primitives::{EnvWithHandlerCfg, EvmState, ExecutionResult, ResultAndState}; +#[cfg(feature = "bsc")] +use crate::FromEthApiError; use crate::FromEvmError; -use super::{Call, LoadBlock, LoadPendingBlock, LoadState, LoadTransaction}; - /// Executes CPU heavy tasks. pub trait Trace: LoadState { /// Returns a handle for reading evm config. @@ -196,7 +197,8 @@ pub trait Trace: LoadState { cfg_if! { if #[cfg(feature = "bsc")] { - let parent_timestamp = LoadState::cache(self).get_block(parent_block).await? + let parent_timestamp = LoadState::cache(self).get_block(parent_block).await + .map_err(Self::Error::from_eth_err)? .map(|block| block.timestamp) .ok_or_else(|| EthApiError::UnknownParentBlock)?; } else { diff --git a/crates/rpc/rpc-eth-api/src/helpers/transaction.rs b/crates/rpc/rpc-eth-api/src/helpers/transaction.rs index 0c74b29d6..d97a49f2d 100644 --- a/crates/rpc/rpc-eth-api/src/helpers/transaction.rs +++ b/crates/rpc/rpc-eth-api/src/helpers/transaction.rs @@ -9,14 +9,16 @@ use reth_primitives::{ }; use reth_provider::{BlockReaderIdExt, ReceiptProvider, TransactionsProvider}; use reth_rpc_eth_types::{ - utils::recover_raw_transaction, EthApiError, EthStateCache, SignError, TransactionSource, + utils::recover_raw_transaction, EthApiError, EthResult, EthStateCache, SignError, + TransactionSource, }; use reth_rpc_types::{ transaction::{ EIP1559TransactionRequest, EIP2930TransactionRequest, EIP4844TransactionRequest, LegacyTransactionRequest, }, - AnyTransactionReceipt, BlockSidecar, TransactionInfo, TransactionRequest, TypedTransactionRequest, + AnyTransactionReceipt, BlockSidecar, TransactionInfo, TransactionRequest, + TypedTransactionRequest, }; use reth_rpc_types_compat::transaction::from_recovered_with_block_context; use reth_transaction_pool::{PoolTransaction, TransactionOrigin, TransactionPool}; diff --git a/crates/rpc/rpc/src/debug.rs b/crates/rpc/rpc/src/debug.rs index 65c737f6a..36d4e80ff 100644 --- a/crates/rpc/rpc/src/debug.rs +++ b/crates/rpc/rpc/src/debug.rs @@ -1,3 +1,5 @@ +use std::{collections::HashMap, sync::Arc}; + use alloy_rlp::{Decodable, Encodable}; use async_trait::async_trait; use cfg_if::cfg_if; @@ -5,6 +7,8 @@ use jsonrpsee::core::RpcResult; #[cfg(feature = "bsc")] use reth_chainspec::BscHardforks; use reth_chainspec::{ChainSpec, EthereumHardforks}; +#[cfg(feature = "bsc")] +use reth_errors::RethError; use reth_evm::{ system_calls::{pre_block_beacon_root_contract_call, pre_block_blockhashes_contract_call}, ConfigureEvmEnv, @@ -48,8 +52,7 @@ use revm::{ use revm_inspectors::tracing::{ FourByteInspector, MuxInspector, TracingInspector, TracingInspectorConfig, TransactionContext, }; -use revm_primitives::{keccak256, HashMap}; -use std::sync::Arc; +use revm_primitives::keccak256; use tokio::sync::{AcquireError, OwnedSemaphorePermit}; /// `debug` API implementation. @@ -137,7 +140,9 @@ where .expect("get upgrade system contracts failed"); for (k, v) in contracts { - let account = db.load_account(k)?; + let account = db.load_account(k).map_err(|error| { + EthApiError::Internal(RethError::Other("load account failed".into())) + })?; if account.account_state == NotExisting { account.account_state = Touched; } @@ -180,7 +185,11 @@ where .expect("get upgrade system contracts failed"); for (k, v) in contracts { - let account = db.load_account(k)?; + let account = db.load_account(k).map_err(|error| { + EthApiError::Internal(RethError::Other( + "load account failed".into(), + )) + })?; if account.account_state == NotExisting { account.account_state = Touched; } diff --git a/crates/stages/stages/src/stages/bodies.rs b/crates/stages/stages/src/stages/bodies.rs index 7f15687ea..dfbdb57eb 100644 --- a/crates/stages/stages/src/stages/bodies.rs +++ b/crates/stages/stages/src/stages/bodies.rs @@ -212,7 +212,8 @@ impl Stage for BodyStage { // Increment block on static file header. if block_number > 0 { - let appended_block_number = static_file_producer_tx.increment_block(block_number)?; + let appended_block_number = + static_file_producer_tx.increment_block(block_number)?; if appended_block_number != block_number { // This scenario indicates a critical error in the logic of adding new diff --git a/crates/stages/stages/src/stages/merkle.rs b/crates/stages/stages/src/stages/merkle.rs index 5468db9e0..4fd9f4c1a 100644 --- a/crates/stages/stages/src/stages/merkle.rs +++ b/crates/stages/stages/src/stages/merkle.rs @@ -519,8 +519,10 @@ mod tests { random_block( &mut rng, stage_progress, - BlockParams { parent:preblocks.last().map(|b| b.hash()), - ..Default::default() }, + BlockParams { + parent: preblocks.last().map(|b| b.hash()), + ..Default::default() + }, ); let mut header = header.unseal(); diff --git a/crates/storage/provider/src/providers/blockchain_provider.rs b/crates/storage/provider/src/providers/blockchain_provider.rs index a5f8432bc..613ca1806 100644 --- a/crates/storage/provider/src/providers/blockchain_provider.rs +++ b/crates/storage/provider/src/providers/blockchain_provider.rs @@ -2,8 +2,8 @@ use crate::{ providers::StaticFileProvider, AccountReader, BlockHashReader, BlockIdReader, BlockNumReader, BlockReader, BlockReaderIdExt, BlockSource, CanonChainTracker, CanonStateNotifications, CanonStateSubscriptions, ChainSpecProvider, ChangeSetReader, DatabaseProviderFactory, - DatabaseProviderRO, EvmEnvProvider, FinalizedBlockReader, HeaderProvider, ProviderError, - ProviderFactory, PruneCheckpointReader, ReceiptProvider, ReceiptProviderIdExt, + DatabaseProviderRO, EvmEnvProvider, FinalizedBlockReader, HeaderProvider, ParliaSnapshotReader, + ProviderError, ProviderFactory, PruneCheckpointReader, ReceiptProvider, ReceiptProviderIdExt, RequestsProvider, StageCheckpointReader, StateProviderBox, StateProviderFactory, StaticFileProviderFactory, TransactionVariant, TransactionsProvider, WithdrawalsProvider, }; @@ -19,13 +19,14 @@ use reth_db_api::{ }; use reth_evm::ConfigureEvmEnv; use reth_primitives::{ - Account, Address, Block, BlockHash, BlockHashOrNumber, BlockId, BlockNumHash, BlockNumber, - BlockNumberOrTag, BlockWithSenders, EthereumHardforks, Header, Receipt, SealedBlock, - SealedBlockWithSenders, SealedHeader, TransactionMeta, TransactionSigned, + parlia::Snapshot, Account, Address, BlobSidecars, Block, BlockHash, BlockHashOrNumber, BlockId, + BlockNumHash, BlockNumber, BlockNumberOrTag, BlockWithSenders, EthereumHardforks, Header, + Receipt, SealedBlock, SealedBlockWithSenders, SealedHeader, TransactionMeta, TransactionSigned, TransactionSignedNoHash, TxHash, TxNumber, Withdrawal, Withdrawals, B256, U256, }; use reth_prune_types::{PruneCheckpoint, PruneSegment}; use reth_stages_types::{StageCheckpoint, StageId}; +use reth_storage_api::SidecarsProvider; use reth_storage_errors::provider::ProviderResult; use revm::primitives::{BlockEnv, CfgEnvWithHandlerCfg}; use std::{ @@ -988,6 +989,19 @@ where } } +impl SidecarsProvider for BlockchainProvider2 +where + DB: Database, +{ + fn sidecars(&self, block_hash: &BlockHash) -> ProviderResult> { + self.database.sidecars(block_hash) + } + + fn sidecars_by_number(&self, num: BlockNumber) -> ProviderResult> { + self.database.sidecars_by_number(num) + } +} + impl RequestsProvider for BlockchainProvider2 where DB: Database, @@ -1433,6 +1447,15 @@ where } } +impl ParliaSnapshotReader for BlockchainProvider2 +where + DB: Database + Sync + Send, +{ + fn get_parlia_snapshot(&self, block_hash: B256) -> ProviderResult> { + self.database.provider()?.get_parlia_snapshot(block_hash) + } +} + #[cfg(test)] mod tests { use std::{ diff --git a/crates/storage/provider/src/providers/database/provider.rs b/crates/storage/provider/src/providers/database/provider.rs index 43934065f..bf1360f4d 100644 --- a/crates/storage/provider/src/providers/database/provider.rs +++ b/crates/storage/provider/src/providers/database/provider.rs @@ -7,13 +7,14 @@ use crate::{ }, writer::UnifiedStorageWriter, AccountReader, BlockExecutionReader, BlockExecutionWriter, BlockHashReader, BlockNumReader, - BlockReader, BlockWriter, BundleStateInit, EvmEnvProvider, FinalizedBlockReader, + BlockReader, BlockWriter, BundleStateInit, Chain, EvmEnvProvider, FinalizedBlockReader, FinalizedBlockWriter, HashingWriter, HeaderProvider, HeaderSyncGap, HeaderSyncGapProvider, HistoricalStateProvider, HistoryWriter, LatestStateProvider, OriginalValuesKnown, - ProviderError, PruneCheckpointReader, PruneCheckpointWriter, RequestsProvider, RevertsInit, - StageCheckpointReader, StateChangeWriter, StateProviderBox, StateWriter, StatsReader, - StorageReader, StorageTrieWriter, TransactionVariant, TransactionsProvider, - TransactionsProviderExt, TrieWriter, WithdrawalsProvider, + ParliaSnapshotReader, ProviderError, PruneCheckpointReader, PruneCheckpointWriter, + RequestsProvider, RevertsInit, SidecarsProvider, StageCheckpointReader, StateChangeWriter, + StateProviderBox, StateWriter, StatsReader, StorageReader, StorageTrieWriter, + TransactionVariant, TransactionsProvider, TransactionsProviderExt, TrieWriter, + WithdrawalsProvider, }; use itertools::{izip, Itertools}; use rayon::slice::ParallelSliceMut; @@ -38,8 +39,8 @@ use reth_execution_types::ExecutionOutcome; use reth_network_p2p::headers::downloader::SyncTarget; use reth_primitives::{ keccak256, parlia::Snapshot, Account, Address, BlobSidecars, Block, BlockHash, - BlockHashOrNumber, BlockNumber, BlockWithSenders, Bytecode,GotExpected, Header, Receipt, Requests, - SealedBlock, SealedBlockWithSenders, SealedHeader, StaticFileSegment, StorageEntry, + BlockHashOrNumber, BlockNumber, BlockWithSenders, Bytecode, GotExpected, Header, Receipt, + Requests, SealedBlock, SealedBlockWithSenders, SealedHeader, StaticFileSegment, StorageEntry, TransactionMeta, TransactionSigned, TransactionSignedEcRecovered, TransactionSignedNoHash, TxHash, TxNumber, Withdrawal, Withdrawals, B256, U256, }; diff --git a/crates/storage/provider/src/providers/mod.rs b/crates/storage/provider/src/providers/mod.rs index 972b9054f..18ebdea4c 100644 --- a/crates/storage/provider/src/providers/mod.rs +++ b/crates/storage/provider/src/providers/mod.rs @@ -2,10 +2,11 @@ use crate::{ AccountReader, BlockHashReader, BlockIdReader, BlockNumReader, BlockReader, BlockReaderIdExt, BlockSource, BlockchainTreePendingStateProvider, CanonChainTracker, CanonStateNotifications, CanonStateSubscriptions, ChainSpecProvider, ChangeSetReader, DatabaseProviderFactory, - EvmEnvProvider, FinalizedBlockReader, FullExecutionDataProvider, HeaderProvider, ParliaSnapshotReader, ProviderError, - PruneCheckpointReader, ReceiptProvider, ReceiptProviderIdExt, RequestsProvider, - StageCheckpointReader, StateProviderBox, StateProviderFactory, StaticFileProviderFactory, - TransactionVariant, TransactionsProvider, TreeViewer, WithdrawalsProvider, + EvmEnvProvider, FinalizedBlockReader, FullExecutionDataProvider, HeaderProvider, + ParliaSnapshotReader, ProviderError, PruneCheckpointReader, ReceiptProvider, + ReceiptProviderIdExt, RequestsProvider, StageCheckpointReader, StateProviderBox, + StateProviderFactory, StaticFileProviderFactory, TransactionVariant, TransactionsProvider, + TreeViewer, WithdrawalsProvider, }; use reth_blockchain_tree_api::{ error::{CanonicalError, InsertBlockError}, diff --git a/crates/storage/provider/src/providers/static_file/manager.rs b/crates/storage/provider/src/providers/static_file/manager.rs index 790a50603..654d80c00 100644 --- a/crates/storage/provider/src/providers/static_file/manager.rs +++ b/crates/storage/provider/src/providers/static_file/manager.rs @@ -745,7 +745,7 @@ impl StaticFileProvider { writer.append_sidecars(Default::default(), block_number, hash)?; } writer.commit()?; - self.writers.insert(segment, writer); + self.writers.set_writer(segment, Some(writer)); return Ok(None) } diff --git a/crates/storage/provider/src/providers/static_file/writer.rs b/crates/storage/provider/src/providers/static_file/writer.rs index 75fd11f79..4bdce0526 100644 --- a/crates/storage/provider/src/providers/static_file/writer.rs +++ b/crates/storage/provider/src/providers/static_file/writer.rs @@ -29,6 +29,7 @@ pub(crate) struct StaticFileWriters { headers: RwLock>, transactions: RwLock>, receipts: RwLock>, + sidecars: RwLock>, } impl StaticFileWriters { @@ -41,6 +42,7 @@ impl StaticFileWriters { StaticFileSegment::Headers => self.headers.write(), StaticFileSegment::Transactions => self.transactions.write(), StaticFileSegment::Receipts => self.receipts.write(), + StaticFileSegment::Sidecars => self.sidecars.write(), }; if write_guard.is_none() { @@ -51,7 +53,7 @@ impl StaticFileWriters { } pub(crate) fn commit(&self) -> ProviderResult<()> { - for writer_lock in [&self.headers, &self.transactions, &self.receipts] { + for writer_lock in [&self.headers, &self.transactions, &self.receipts, &self.sidecars] { let mut writer = writer_lock.write(); if let Some(writer) = writer.as_mut() { writer.commit()?; @@ -59,6 +61,19 @@ impl StaticFileWriters { } Ok(()) } + + pub(crate) fn set_writer( + &self, + segment: StaticFileSegment, + writer: Option, + ) { + match segment { + StaticFileSegment::Headers => *self.headers.write() = writer, + StaticFileSegment::Transactions => *self.transactions.write() = writer, + StaticFileSegment::Receipts => *self.receipts.write() = writer, + StaticFileSegment::Sidecars => *self.sidecars.write() = writer, + } + } } /// Mutable reference to a [`StaticFileProviderRW`] behind a [`RwLockWriteGuard`]. @@ -574,7 +589,7 @@ impl StaticFileProviderRW { debug_assert!(self.writer.user_header().segment() == StaticFileSegment::Sidecars); - let block_number = self.increment_block(StaticFileSegment::Sidecars, block_number)?; + let block_number = self.increment_block(block_number)?; self.append_column(sidecars)?; self.append_column(hash)?; diff --git a/crates/storage/provider/src/test_utils/blocks.rs b/crates/storage/provider/src/test_utils/blocks.rs index 745816b41..0a6cbea36 100644 --- a/crates/storage/provider/src/test_utils/blocks.rs +++ b/crates/storage/provider/src/test_utils/blocks.rs @@ -6,9 +6,8 @@ use reth_db::tables; use reth_db_api::{database::Database, models::StoredBlockBodyIndices}; use reth_primitives::{ alloy_primitives, b256, hex_literal::hex, Account, Address, BlobSidecars, BlockNumber, Bytes, - Header, Receipt, Requests, SealedBlock, SealedBlockWithSenders, SealedHeader, Signature, Transaction, - TransactionSigned, TxKind, TxLegacy, TxType, Withdrawal, - Withdrawals, B256, U256, + Header, Receipt, Requests, SealedBlock, SealedBlockWithSenders, SealedHeader, Signature, + Transaction, TransactionSigned, TxKind, TxLegacy, TxType, Withdrawal, Withdrawals, B256, U256, }; use reth_trie::root::{state_root_unhashed, storage_root_unhashed}; use revm::{ diff --git a/crates/storage/provider/src/test_utils/mock.rs b/crates/storage/provider/src/test_utils/mock.rs index a9f37e917..22ba0604a 100644 --- a/crates/storage/provider/src/test_utils/mock.rs +++ b/crates/storage/provider/src/test_utils/mock.rs @@ -10,14 +10,16 @@ use reth_chainspec::{ChainInfo, ChainSpec}; use reth_db_api::models::{AccountBeforeTx, StoredBlockBodyIndices}; use reth_evm::ConfigureEvmEnv; use reth_primitives::{ - keccak256, Account, Address, BlobSidecars, Block, BlockHash, BlockHashOrNumber, BlockId, BlockNumber, - BlockNumberOrTag, BlockWithSenders, Bytecode, Bytes, Header, Receipt, SealedBlock, + keccak256, Account, Address, BlobSidecars, Block, BlockHash, BlockHashOrNumber, BlockId, + BlockNumber, BlockNumberOrTag, BlockWithSenders, Bytecode, Bytes, Header, Receipt, SealedBlock, SealedBlockWithSenders, SealedHeader, StorageKey, StorageValue, TransactionMeta, TransactionSigned, TransactionSignedNoHash, TxHash, TxNumber, Withdrawal, Withdrawals, B256, U256, }; -use reth_stages_types::{SidecarsProvider, StageCheckpoint, StageId}; -use reth_storage_api::{StageCheckpointReader, StateProofProvider, StorageRootProvider}; +use reth_stages_types::{StageCheckpoint, StageId}; +use reth_storage_api::{ + SidecarsProvider, StageCheckpointReader, StateProofProvider, StorageRootProvider, +}; use reth_storage_errors::provider::{ProviderError, ProviderResult}; use reth_trie::{ prefix_set::TriePrefixSetsMut, updates::TrieUpdates, AccountProof, HashedPostState, diff --git a/crates/storage/provider/src/test_utils/noop.rs b/crates/storage/provider/src/test_utils/noop.rs index 57e60169e..e4ff0adea 100644 --- a/crates/storage/provider/src/test_utils/noop.rs +++ b/crates/storage/provider/src/test_utils/noop.rs @@ -14,9 +14,10 @@ use reth_errors::ProviderError; use reth_evm::ConfigureEvmEnv; use reth_primitives::{ parlia::Snapshot, Account, Address, BlobSidecars, Block, BlockHash, BlockHashOrNumber, BlockId, - BlockNumber, BlockNumberOrTag,BlockWithSenders, Bytecode, Bytes,Header, Receipt, SealedBlock, SealedBlockWithSenders, - SealedHeader, StorageKey, StorageValue, TransactionMeta, TransactionSigned, - TransactionSignedNoHash, TxHash, TxNumber, Withdrawal, Withdrawals, B256, U256, + BlockNumber, BlockNumberOrTag, BlockWithSenders, Bytecode, Bytes, Header, Receipt, SealedBlock, + SealedBlockWithSenders, SealedHeader, StorageKey, StorageValue, TransactionMeta, + TransactionSigned, TransactionSignedNoHash, TxHash, TxNumber, Withdrawal, Withdrawals, B256, + U256, }; use reth_prune_types::{PruneCheckpoint, PruneSegment}; use reth_stages_types::{StageCheckpoint, StageId}; @@ -33,10 +34,10 @@ use crate::{ providers::StaticFileProvider, traits::{BlockSource, ReceiptProvider}, AccountReader, BlockHashReader, BlockIdReader, BlockNumReader, BlockReader, BlockReaderIdExt, - ChainSpecProvider, ChangeSetReader, EvmEnvProvider, HeaderProvider, ParliaSnapshotReader, PruneCheckpointReader, - ReceiptProviderIdExt, RequestsProvider, StageCheckpointReader, StateProvider, StateProviderBox, - StateProviderFactory, StateRootProvider, StaticFileProviderFactory, TransactionVariant, - TransactionsProvider, WithdrawalsProvider, + ChainSpecProvider, ChangeSetReader, EvmEnvProvider, HeaderProvider, ParliaSnapshotReader, + PruneCheckpointReader, ReceiptProviderIdExt, RequestsProvider, StageCheckpointReader, + StateProvider, StateProviderBox, StateProviderFactory, StateRootProvider, + StaticFileProviderFactory, TransactionVariant, TransactionsProvider, WithdrawalsProvider, }; /// Supports various api interfaces for testing purposes. diff --git a/crates/storage/provider/src/traits/full.rs b/crates/storage/provider/src/traits/full.rs index 3a56e7546..522591c20 100644 --- a/crates/storage/provider/src/traits/full.rs +++ b/crates/storage/provider/src/traits/full.rs @@ -2,9 +2,8 @@ use crate::{ AccountReader, BlockReaderIdExt, ChainSpecProvider, ChangeSetReader, DatabaseProviderFactory, - EvmEnvProvider, HeaderProvider, ParliaSnapshotReader, - StageCheckpointReader, StateProviderFactory, - StaticFileProviderFactory, TransactionsProvider, + EvmEnvProvider, HeaderProvider, ParliaSnapshotReader, StageCheckpointReader, + StateProviderFactory, StaticFileProviderFactory, TransactionsProvider, }; use reth_chain_state::{CanonStateSubscriptions, ForkChoiceSubscriptions}; use reth_chainspec::{ChainSpec, EthChainSpec}; diff --git a/crates/storage/provider/src/writer/mod.rs b/crates/storage/provider/src/writer/mod.rs index a873b2496..161444dad 100644 --- a/crates/storage/provider/src/writer/mod.rs +++ b/crates/storage/provider/src/writer/mod.rs @@ -15,7 +15,8 @@ use reth_db::{ use reth_errors::{ProviderError, ProviderResult}; use reth_execution_types::ExecutionOutcome; use reth_primitives::{ - parlia::Snapshot, BlockNumber, Header, SealedBlock, StaticFileSegment, TransactionSignedNoHash, B256, U256, + parlia::Snapshot, BlockNumber, Header, SealedBlock, StaticFileSegment, TransactionSignedNoHash, + B256, U256, }; use reth_stages_types::{StageCheckpoint, StageId}; use reth_storage_api::{ @@ -29,6 +30,7 @@ use tracing::{debug, instrument}; mod database; mod static_file; use database::DatabaseWriter; +use reth_db_api::cursor::DbCursorRW; enum StorageType { Database(C), @@ -482,7 +484,7 @@ where // Write snapshots to the database. if !snapshots.is_empty() { let mut snapshot_cursor = - self.database_writer().tx_ref().cursor_write::()?; + self.database().tx_ref().cursor_write::()?; for snap in snapshots { snapshot_cursor.upsert(snap.block_hash, snap)?; } @@ -511,6 +513,7 @@ where self.append_receipts_from_blocks( execution_outcome.first_block, execution_outcome.receipts.into_iter(), + execution_outcome.snapshots, )?; self.database().write_state_changes(plain_state)?; @@ -1364,6 +1367,7 @@ mod tests { receipts: vec![vec![Some(Receipt::default()); 2]; 7].into(), first_block: 10, requests: Vec::new(), + snapshots: Vec::new(), }; let mut this = base.clone(); @@ -1581,6 +1585,7 @@ mod tests { receipts: vec![vec![Some(Receipt::default()); 2]; 1].into(), first_block: 2, requests: Vec::new(), + snapshots: Vec::new(), }; test.prepend_state(previous_state); diff --git a/op.Dockerfile b/op.Dockerfile index 833ca9f69..93d0b45c1 100644 --- a/op.Dockerfile +++ b/op.Dockerfile @@ -1,4 +1,4 @@ -FROM lukemathwalker/cargo-chef:latest-rust-1.79 AS chef +FROM lukemathwalker/cargo-chef:latest-rust-1.80 AS chef WORKDIR /app LABEL org.opencontainers.image.source=https://github.com/paradigmxyz/reth