From 189c0df32617afc488e0f091dbface1bd72cceb4 Mon Sep 17 00:00:00 2001 From: Emma Jamieson-Hoare Date: Wed, 12 Aug 2026 11:11:51 +0100 Subject: [PATCH 01/14] chore: bump reth version to 2.5.0 --- Cargo.lock | 228 +++++++++++++++++++-------------------- Cargo.toml | 2 +- docs/vocs/vocs.config.ts | 2 +- 3 files changed, 116 insertions(+), 116 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b33be037034..f84bacfb442 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3269,7 +3269,7 @@ dependencies = [ [[package]] name = "ef-test-runner" -version = "2.4.1" +version = "2.5.0" dependencies = [ "clap", "ef-tests", @@ -3277,7 +3277,7 @@ dependencies = [ [[package]] name = "ef-tests" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-consensus", "alloy-eips", @@ -3730,7 +3730,7 @@ dependencies = [ [[package]] name = "example-full-contract-state" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-primitives", "eyre", @@ -3848,7 +3848,7 @@ dependencies = [ [[package]] name = "exex-subscription" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-primitives", "clap", @@ -7661,7 +7661,7 @@ checksum = "1e061d1b48cb8d38042de4ae0a7a6401009d6143dc80d2e2d6f31f0bdd6470c7" [[package]] name = "reth" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-node-bindings", "alloy-primitives", @@ -7711,7 +7711,7 @@ dependencies = [ [[package]] name = "reth-basic-payload-builder" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-consensus", "alloy-eips", @@ -7737,7 +7737,7 @@ dependencies = [ [[package]] name = "reth-bb" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-consensus", "alloy-eips", @@ -7784,7 +7784,7 @@ dependencies = [ [[package]] name = "reth-chain-state" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-consensus", "alloy-eips", @@ -7815,7 +7815,7 @@ dependencies = [ [[package]] name = "reth-chainspec" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-chains", "alloy-consensus", @@ -7835,7 +7835,7 @@ dependencies = [ [[package]] name = "reth-cli" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-genesis", "clap", @@ -7847,7 +7847,7 @@ dependencies = [ [[package]] name = "reth-cli-commands" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-chains", "alloy-consensus", @@ -7937,7 +7937,7 @@ dependencies = [ [[package]] name = "reth-cli-runner" -version = "2.4.1" +version = "2.5.0" dependencies = [ "reth-tasks", "tokio", @@ -7946,7 +7946,7 @@ dependencies = [ [[package]] name = "reth-cli-util" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-eips", "alloy-primitives", @@ -8000,7 +8000,7 @@ dependencies = [ [[package]] name = "reth-config" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-primitives", "eyre", @@ -8018,7 +8018,7 @@ dependencies = [ [[package]] name = "reth-consensus" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-consensus", "alloy-eip7928", @@ -8031,7 +8031,7 @@ dependencies = [ [[package]] name = "reth-consensus-common" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-consensus", "alloy-eips", @@ -8045,7 +8045,7 @@ dependencies = [ [[package]] name = "reth-consensus-debug-client" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-consensus", "alloy-eips", @@ -8069,7 +8069,7 @@ dependencies = [ [[package]] name = "reth-db" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-consensus", "alloy-primitives", @@ -8105,7 +8105,7 @@ dependencies = [ [[package]] name = "reth-db-api" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-consensus", "alloy-primitives", @@ -8133,7 +8133,7 @@ dependencies = [ [[package]] name = "reth-db-common" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-consensus", "alloy-genesis", @@ -8164,7 +8164,7 @@ dependencies = [ [[package]] name = "reth-db-models" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-eips", "alloy-primitives", @@ -8180,7 +8180,7 @@ dependencies = [ [[package]] name = "reth-discv4" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -8206,7 +8206,7 @@ dependencies = [ [[package]] name = "reth-discv5" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -8231,7 +8231,7 @@ dependencies = [ [[package]] name = "reth-dns-discovery" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-chains", "alloy-primitives", @@ -8259,7 +8259,7 @@ dependencies = [ [[package]] name = "reth-downloaders" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-consensus", "alloy-eips", @@ -8297,7 +8297,7 @@ dependencies = [ [[package]] name = "reth-e2e-test-utils" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-consensus", "alloy-eips", @@ -8353,7 +8353,7 @@ dependencies = [ [[package]] name = "reth-ecies" -version = "2.4.1" +version = "2.5.0" dependencies = [ "aes", "alloy-primitives", @@ -8379,7 +8379,7 @@ dependencies = [ [[package]] name = "reth-engine-local" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-consensus", "alloy-primitives", @@ -8401,7 +8401,7 @@ dependencies = [ [[package]] name = "reth-engine-primitives" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-consensus", "alloy-eips", @@ -8427,7 +8427,7 @@ dependencies = [ [[package]] name = "reth-engine-tree" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-consensus", "alloy-eip7928", @@ -8497,7 +8497,7 @@ dependencies = [ [[package]] name = "reth-engine-util" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-consensus", "alloy-primitives", @@ -8526,7 +8526,7 @@ dependencies = [ [[package]] name = "reth-era" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-consensus", "alloy-eips", @@ -8551,7 +8551,7 @@ dependencies = [ [[package]] name = "reth-era-downloader" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-primitives", "bytes", @@ -8569,7 +8569,7 @@ dependencies = [ [[package]] name = "reth-era-utils" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-consensus", "alloy-primitives", @@ -8600,7 +8600,7 @@ dependencies = [ [[package]] name = "reth-errors" -version = "2.4.1" +version = "2.5.0" dependencies = [ "reth-consensus", "reth-execution-errors", @@ -8610,7 +8610,7 @@ dependencies = [ [[package]] name = "reth-eth-wire" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-chains", "alloy-consensus", @@ -8648,7 +8648,7 @@ dependencies = [ [[package]] name = "reth-eth-wire-types" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-chains", "alloy-consensus", @@ -8676,7 +8676,7 @@ dependencies = [ [[package]] name = "reth-ethereum" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-rpc-types-engine", "alloy-rpc-types-eth", @@ -8716,7 +8716,7 @@ dependencies = [ [[package]] name = "reth-ethereum-cli" -version = "2.4.1" +version = "2.5.0" dependencies = [ "clap", "eyre", @@ -8739,7 +8739,7 @@ dependencies = [ [[package]] name = "reth-ethereum-consensus" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-consensus", "alloy-eips", @@ -8755,7 +8755,7 @@ dependencies = [ [[package]] name = "reth-ethereum-engine-primitives" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-eips", "alloy-primitives", @@ -8771,7 +8771,7 @@ dependencies = [ [[package]] name = "reth-ethereum-forks" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-eip2124", "alloy-hardforks 0.4.7", @@ -8784,7 +8784,7 @@ dependencies = [ [[package]] name = "reth-ethereum-payload-builder" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-consensus", "alloy-eips", @@ -8813,7 +8813,7 @@ dependencies = [ [[package]] name = "reth-ethereum-primitives" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-consensus", "alloy-eips", @@ -8834,7 +8834,7 @@ dependencies = [ [[package]] name = "reth-etl" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-primitives", "rayon", @@ -8844,7 +8844,7 @@ dependencies = [ [[package]] name = "reth-evm" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-consensus", "alloy-eip7928", @@ -8870,7 +8870,7 @@ dependencies = [ [[package]] name = "reth-evm-ethereum" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-consensus", "alloy-eips", @@ -8895,7 +8895,7 @@ dependencies = [ [[package]] name = "reth-execution-cache" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-primitives", "fixed-cache", @@ -8913,7 +8913,7 @@ dependencies = [ [[package]] name = "reth-execution-errors" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-evm", "alloy-primitives", @@ -8925,7 +8925,7 @@ dependencies = [ [[package]] name = "reth-execution-types" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-consensus", "alloy-eips", @@ -8946,7 +8946,7 @@ dependencies = [ [[package]] name = "reth-exex" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-consensus", "alloy-eips", @@ -8991,7 +8991,7 @@ dependencies = [ [[package]] name = "reth-exex-test-utils" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-eips", "eyre", @@ -9022,7 +9022,7 @@ dependencies = [ [[package]] name = "reth-exex-types" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-eips", "alloy-primitives", @@ -9039,7 +9039,7 @@ dependencies = [ [[package]] name = "reth-fs-util" -version = "2.4.1" +version = "2.5.0" dependencies = [ "serde", "serde_json", @@ -9048,7 +9048,7 @@ dependencies = [ [[package]] name = "reth-invalid-block-hooks" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-consensus", "alloy-eips", @@ -9079,7 +9079,7 @@ dependencies = [ [[package]] name = "reth-ipc" -version = "2.4.1" +version = "2.5.0" dependencies = [ "bytes", "futures", @@ -9101,7 +9101,7 @@ dependencies = [ [[package]] name = "reth-libmdbx" -version = "2.4.1" +version = "2.5.0" dependencies = [ "bitflags 2.13.0", "byteorder", @@ -9118,7 +9118,7 @@ dependencies = [ [[package]] name = "reth-mdbx-sys" -version = "2.4.1" +version = "2.5.0" dependencies = [ "bindgen", "cc", @@ -9126,7 +9126,7 @@ dependencies = [ [[package]] name = "reth-metrics" -version = "2.4.1" +version = "2.5.0" dependencies = [ "futures", "libc", @@ -9139,7 +9139,7 @@ dependencies = [ [[package]] name = "reth-net-banlist" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-primitives", "ipnet", @@ -9147,7 +9147,7 @@ dependencies = [ [[package]] name = "reth-net-nat" -version = "2.4.1" +version = "2.5.0" dependencies = [ "futures-util", "if-addrs", @@ -9161,7 +9161,7 @@ dependencies = [ [[package]] name = "reth-network" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-consensus", "alloy-eip7928", @@ -9230,7 +9230,7 @@ dependencies = [ [[package]] name = "reth-network-api" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-consensus", "alloy-primitives", @@ -9254,7 +9254,7 @@ dependencies = [ [[package]] name = "reth-network-p2p" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-consensus", "alloy-eip7928", @@ -9278,7 +9278,7 @@ dependencies = [ [[package]] name = "reth-network-peers" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -9295,7 +9295,7 @@ dependencies = [ [[package]] name = "reth-network-types" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-eip2124", "humantime-serde", @@ -9308,7 +9308,7 @@ dependencies = [ [[package]] name = "reth-nippy-jar" -version = "2.4.1" +version = "2.5.0" dependencies = [ "anyhow", "bincode", @@ -9326,7 +9326,7 @@ dependencies = [ [[package]] name = "reth-node-api" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-rpc-types-engine", "eyre", @@ -9349,7 +9349,7 @@ dependencies = [ [[package]] name = "reth-node-builder" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-consensus", "alloy-eips", @@ -9420,7 +9420,7 @@ dependencies = [ [[package]] name = "reth-node-core" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-consensus", "alloy-eips", @@ -9476,7 +9476,7 @@ dependencies = [ [[package]] name = "reth-node-ethereum" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-consensus", "alloy-contract", @@ -9545,7 +9545,7 @@ dependencies = [ [[package]] name = "reth-node-ethstats" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-consensus", "alloy-primitives", @@ -9568,7 +9568,7 @@ dependencies = [ [[package]] name = "reth-node-events" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-consensus", "alloy-eips", @@ -9591,7 +9591,7 @@ dependencies = [ [[package]] name = "reth-node-metrics" -version = "2.4.1" +version = "2.5.0" dependencies = [ "bytes", "eyre", @@ -9620,7 +9620,7 @@ dependencies = [ [[package]] name = "reth-node-types" -version = "2.4.1" +version = "2.5.0" dependencies = [ "reth-chainspec", "reth-db-api", @@ -9631,7 +9631,7 @@ dependencies = [ [[package]] name = "reth-payload-builder" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-consensus", "alloy-primitives", @@ -9654,7 +9654,7 @@ dependencies = [ [[package]] name = "reth-payload-builder-primitives" -version = "2.4.1" +version = "2.5.0" dependencies = [ "pin-project", "reth-payload-primitives", @@ -9665,7 +9665,7 @@ dependencies = [ [[package]] name = "reth-payload-primitives" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-consensus", "alloy-eips", @@ -9689,7 +9689,7 @@ dependencies = [ [[package]] name = "reth-payload-util" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-consensus", "alloy-primitives", @@ -9698,7 +9698,7 @@ dependencies = [ [[package]] name = "reth-payload-validator" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-consensus", "alloy-rpc-types-engine", @@ -9740,7 +9740,7 @@ dependencies = [ [[package]] name = "reth-provider" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-consensus", "alloy-eip7928", @@ -9794,7 +9794,7 @@ dependencies = [ [[package]] name = "reth-prune" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-consensus", "alloy-primitives", @@ -9825,7 +9825,7 @@ dependencies = [ [[package]] name = "reth-prune-types" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-primitives", "arbitrary", @@ -9845,7 +9845,7 @@ dependencies = [ [[package]] name = "reth-revm" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-consensus", "alloy-primitives", @@ -9861,7 +9861,7 @@ dependencies = [ [[package]] name = "reth-rpc" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-consensus", "alloy-dyn-abi", @@ -9941,7 +9941,7 @@ dependencies = [ [[package]] name = "reth-rpc-api" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-eips", "alloy-genesis", @@ -9971,7 +9971,7 @@ dependencies = [ [[package]] name = "reth-rpc-builder" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-eips", "alloy-network", @@ -10029,7 +10029,7 @@ dependencies = [ [[package]] name = "reth-rpc-convert" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-consensus", "alloy-evm", @@ -10049,7 +10049,7 @@ dependencies = [ [[package]] name = "reth-rpc-e2e-tests" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-genesis", "alloy-rpc-types-engine", @@ -10069,7 +10069,7 @@ dependencies = [ [[package]] name = "reth-rpc-engine-api" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-eips", "alloy-primitives", @@ -10105,7 +10105,7 @@ dependencies = [ [[package]] name = "reth-rpc-eth-api" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-consensus", "alloy-dyn-abi", @@ -10151,7 +10151,7 @@ dependencies = [ [[package]] name = "reth-rpc-eth-types" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-chains", "alloy-consensus", @@ -10203,7 +10203,7 @@ dependencies = [ [[package]] name = "reth-rpc-layer" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-rpc-types-engine", "http", @@ -10220,7 +10220,7 @@ dependencies = [ [[package]] name = "reth-rpc-server-types" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-eips", "alloy-primitives", @@ -10250,7 +10250,7 @@ dependencies = [ [[package]] name = "reth-stages" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-consensus", "alloy-eips", @@ -10312,7 +10312,7 @@ dependencies = [ [[package]] name = "reth-stages-api" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-eips", "alloy-primitives", @@ -10346,7 +10346,7 @@ dependencies = [ [[package]] name = "reth-stages-types" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-primitives", "arbitrary", @@ -10362,7 +10362,7 @@ dependencies = [ [[package]] name = "reth-static-file" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-primitives", "assert_matches", @@ -10385,7 +10385,7 @@ dependencies = [ [[package]] name = "reth-static-file-types" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-primitives", "clap", @@ -10403,7 +10403,7 @@ dependencies = [ [[package]] name = "reth-storage-api" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-consensus", "alloy-eip7928", @@ -10430,7 +10430,7 @@ dependencies = [ [[package]] name = "reth-storage-errors" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-eips", "alloy-primitives", @@ -10446,7 +10446,7 @@ dependencies = [ [[package]] name = "reth-storage-overlay" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-consensus", "alloy-eips", @@ -10475,7 +10475,7 @@ dependencies = [ [[package]] name = "reth-storage-rpc-provider" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-consensus", "alloy-eips", @@ -10504,7 +10504,7 @@ dependencies = [ [[package]] name = "reth-tasks" -version = "2.4.1" +version = "2.5.0" dependencies = [ "crossbeam-utils", "dashmap", @@ -10524,7 +10524,7 @@ dependencies = [ [[package]] name = "reth-testing-utils" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-consensus", "alloy-eips", @@ -10540,7 +10540,7 @@ dependencies = [ [[package]] name = "reth-tokio-util" -version = "2.4.1" +version = "2.5.0" dependencies = [ "tokio", "tokio-stream", @@ -10549,7 +10549,7 @@ dependencies = [ [[package]] name = "reth-tracing" -version = "2.4.1" +version = "2.5.0" dependencies = [ "clap", "eyre", @@ -10568,7 +10568,7 @@ dependencies = [ [[package]] name = "reth-tracing-otlp" -version = "2.4.1" +version = "2.5.0" dependencies = [ "base64 0.22.1", "clap", @@ -10586,7 +10586,7 @@ dependencies = [ [[package]] name = "reth-transaction-pool" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-consensus", "alloy-eips", @@ -10637,7 +10637,7 @@ dependencies = [ [[package]] name = "reth-trie" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-consensus", "alloy-eips", @@ -10669,7 +10669,7 @@ dependencies = [ [[package]] name = "reth-trie-common" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-consensus", "alloy-eips", @@ -10701,7 +10701,7 @@ dependencies = [ [[package]] name = "reth-trie-db" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-consensus", "alloy-primitives", @@ -10728,7 +10728,7 @@ dependencies = [ [[package]] name = "reth-trie-parallel" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-evm", "alloy-primitives", @@ -10756,7 +10756,7 @@ dependencies = [ [[package]] name = "reth-trie-sparse" -version = "2.4.1" +version = "2.5.0" dependencies = [ "alloy-primitives", "alloy-rlp", diff --git a/Cargo.toml b/Cargo.toml index b23f6556a63..c82dd492175 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [workspace.package] -version = "2.4.1" +version = "2.5.0" edition = "2024" rust-version = "1.95" license = "MIT OR Apache-2.0" diff --git a/docs/vocs/vocs.config.ts b/docs/vocs/vocs.config.ts index bb8a8fba54b..29e1e41dae4 100644 --- a/docs/vocs/vocs.config.ts +++ b/docs/vocs/vocs.config.ts @@ -23,7 +23,7 @@ export default defineConfig({ { text: 'Rustdocs', link: '/docs' }, { text: 'GitHub', link: 'https://github.com/paradigmxyz/reth' }, { - text: 'v2.4.1', + text: 'v2.5.0', items: [ { text: 'Releases', From ab93eccf9c1538175841b9140c5bf7ebffc2b03b Mon Sep 17 00:00:00 2001 From: Francis Li Date: Thu, 20 Aug 2026 09:45:54 +0000 Subject: [PATCH 02/14] feat(payload): finalize pending build on resolve (#26759) Co-authored-by: Amp Co-authored-by: Arsenii Kulikov --- crates/payload/basic/src/lib.rs | 14 +++++--- crates/revm/src/cancelled.rs | 62 ++++++++++++++++++++++++++++++--- 2 files changed, 66 insertions(+), 10 deletions(-) diff --git a/crates/payload/basic/src/lib.rs b/crates/payload/basic/src/lib.rs index f9c18dfc00d..fb67012927f 100644 --- a/crates/payload/basic/src/lib.rs +++ b/crates/payload/basic/src/lib.rs @@ -416,7 +416,7 @@ where trace!(target: "payload_builder", id = %self.config.payload_id(), "spawn new payload build task"); let (tx, rx) = oneshot::channel(); let cancel = CancelOnDrop::default(); - let _cancel = cancel.clone(); + let pending_cancel = cancel.clone(); let guard = self.payload_task_guard.clone(); let payload_config = self.config.clone(); let best_payload = self.best_payload.payload().cloned(); @@ -446,7 +446,7 @@ where }); }); - self.pending_block = Some(PendingPayload { _cancel, payload: rx }); + self.pending_block = Some(PendingPayload { cancel: pending_cancel, payload: rx }); } } @@ -567,6 +567,10 @@ where let mut empty_payload = None; if best_payload.is_none() { + if let Some(pending) = maybe_better.as_ref() { + pending.cancel.request_finalization(); + } + debug!(target: "payload_builder", id=%self.config.payload_id(), "no best payload yet to resolve, building empty payload"); let args = BuildArguments { @@ -734,8 +738,8 @@ where /// A future that resolves to the result of the block building job. #[derive(Debug)] pub struct PendingPayload

{ - /// The marker to cancel the job on drop - _cancel: CancelOnDrop, + /// Cancels the job on drop and carries cooperative control signals. + cancel: CancelOnDrop, /// The channel to send the result to. payload: oneshot::Receiver, PayloadBuilderError>>, } @@ -746,7 +750,7 @@ impl

PendingPayload

{ cancel: CancelOnDrop, payload: oneshot::Receiver, PayloadBuilderError>>, ) -> Self { - Self { _cancel: cancel, payload } + Self { cancel, payload } } } diff --git a/crates/revm/src/cancelled.rs b/crates/revm/src/cancelled.rs index e535882355c..591cd3d376d 100644 --- a/crates/revm/src/cancelled.rs +++ b/crates/revm/src/cancelled.rs @@ -1,26 +1,53 @@ use alloc::sync::Arc; -use core::sync::atomic::AtomicBool; +use core::sync::atomic::{AtomicBool, AtomicU8, Ordering}; -/// A marker that can be used to cancel execution. +/// Payload building is still in progress. +const RUNNING: u8 = 0; +/// Payload building should stop accepting transactions and seal the accumulated work. +const FINALIZATION_REQUESTED: u8 = 1; +/// Payload building should stop and discard the accumulated work. +const CANCELLED: u8 = 2; + +/// Cancels execution on drop and supports cooperative finalization. /// /// If dropped, it will set the `cancelled` flag to true. /// /// This is most useful when a payload job needs to be cancelled. #[derive(Default, Clone, Debug)] -pub struct CancelOnDrop(Arc); +pub struct CancelOnDrop(Arc); // === impl CancelOnDrop === impl CancelOnDrop { + /// Returns true if the current work should be interrupted. + pub fn is_interrupted(&self) -> bool { + self.0.load(Ordering::Relaxed) != RUNNING + } + /// Returns true if the job was cancelled. pub fn is_cancelled(&self) -> bool { - self.0.load(core::sync::atomic::Ordering::Relaxed) + self.0.load(Ordering::Relaxed) == CANCELLED + } + + /// Requests that the current work be finalized without cancelling it. + pub fn request_finalization(&self) { + let _ = self.0.compare_exchange( + RUNNING, + FINALIZATION_REQUESTED, + Ordering::Relaxed, + Ordering::Relaxed, + ); + } + + /// Returns true if finalization was requested. + pub fn is_finalization_requested(&self) -> bool { + self.0.load(Ordering::Relaxed) == FINALIZATION_REQUESTED } } impl Drop for CancelOnDrop { fn drop(&mut self) { - self.0.store(true, core::sync::atomic::Ordering::Relaxed); + self.0.store(CANCELLED, Ordering::Relaxed); } } @@ -55,6 +82,7 @@ mod tests { #[test] fn test_default_cancelled() { let c = CancelOnDrop::default(); + assert!(!c.is_interrupted()); assert!(!c.is_cancelled()); } @@ -122,6 +150,7 @@ mod tests { drop(cancel); // The cloned instance should now see the cancelled flag as true + assert!(cloned_cancel.is_interrupted()); assert!(cloned_cancel.is_cancelled()); } @@ -140,8 +169,31 @@ mod tests { // Drop one clone - this should cancel all instances drop(clone1); + assert!(cancel.is_interrupted()); assert!(cancel.is_cancelled()); assert!(clone2.is_cancelled()); assert!(clone3.is_cancelled()); } + + #[test] + fn test_cancel_on_drop_finalization_request() { + let cancel = CancelOnDrop::default(); + let clone = cancel.clone(); + + cancel.request_finalization(); + + assert!(clone.is_interrupted()); + assert!(clone.is_finalization_requested()); + assert!(!clone.is_cancelled()); + + drop(cancel); + + assert!(clone.is_cancelled()); + assert!(!clone.is_finalization_requested()); + + clone.request_finalization(); + + assert!(clone.is_cancelled()); + assert!(!clone.is_finalization_requested()); + } } From b682925a8b491b26d663b3e373d66a18959cda3c Mon Sep 17 00:00:00 2001 From: Derek Cofausper <256792747+decofe@users.noreply.github.com> Date: Wed, 19 Aug 2026 14:44:16 +0000 Subject: [PATCH 03/14] fix(provider): handle storage wipes in batched persistence (#26750) Co-authored-by: Matthias Seitz <19890894+mattsse@users.noreply.github.com> Co-authored-by: joshieDo <93316087+joshieDo@users.noreply.github.com> --- .../src/providers/database/provider.rs | 299 +++++++++++++----- 1 file changed, 215 insertions(+), 84 deletions(-) diff --git a/crates/storage/provider/src/providers/database/provider.rs b/crates/storage/provider/src/providers/database/provider.rs index f29f84a5327..eb909288b6b 100644 --- a/crates/storage/provider/src/providers/database/provider.rs +++ b/crates/storage/provider/src/providers/database/provider.rs @@ -314,10 +314,10 @@ impl DatabaseProvider { &'a self, mut block_number: BlockNumber, ) -> ProviderResult> { - if block_number == self.best_block_number().unwrap_or_default() && - block_number == self.last_block_number().unwrap_or_default() + if block_number == self.best_block_number().unwrap_or_default() + && block_number == self.last_block_number().unwrap_or_default() { - return Ok(Box::new(LatestStateProviderRef::new(self))) + return Ok(Box::new(LatestStateProviderRef::new(self))); } // +1 as the changeset that we want is the one that was applied after this block. @@ -540,22 +540,22 @@ impl DatabaseProvider ProviderResult { let tip = self.last_block_number()?.max(last_block); Ok(StaticFileWriteCtx { - write_senders: EitherWriterDestination::senders(self).is_static_file() && - self.prune_modes.sender_recovery.is_none_or(|m| !m.is_full()), - write_receipts: save_mode.with_state() && - EitherWriter::receipts_destination(self).is_static_file(), - write_account_changesets: save_mode.with_state() && - EitherWriterDestination::account_changesets(self).is_static_file(), - write_storage_changesets: save_mode.with_state() && - EitherWriterDestination::storage_changesets(self).is_static_file(), + write_senders: EitherWriterDestination::senders(self).is_static_file() + && self.prune_modes.sender_recovery.is_none_or(|m| !m.is_full()), + write_receipts: save_mode.with_state() + && EitherWriter::receipts_destination(self).is_static_file(), + write_account_changesets: save_mode.with_state() + && EitherWriterDestination::account_changesets(self).is_static_file(), + write_storage_changesets: save_mode.with_state() + && EitherWriterDestination::storage_changesets(self).is_static_file(), tip, receipts_prune_mode: self.prune_modes.receipts, // Receipts are prunable if no receipts exist in SF yet and within pruning distance receipts_prunable: self .static_file_provider .get_highest_static_file_tx(StaticFileSegment::Receipts) - .is_none() && - PruneMode::Distance(self.minimum_pruning_distance) + .is_none() + && PruneMode::Distance(self.minimum_pruning_distance) .should_prune(first_block, tip), }) } @@ -594,7 +594,7 @@ impl DatabaseProvider DatabaseProvider DatabaseProvider>(); - let mask = state_trie_masking_blocks - .iter() - .map(|block| block.trie_data.get().sorted.trie_updates.as_ref()) - .collect::>(); - let merged_trie = TrieUpdatesSorted::disjointed_merge_batch(&batch, &mask); + let batch = ExecutedBlock::trie_updates_refs(state_trie_blocks); + let mask = ExecutedBlock::trie_updates_refs(state_trie_masking_blocks); + // Sparse-trie streaming emits node updates, while the serial state-root path, + // including fallback, can emit a whole storage-trie wipe. `disjointed_merge_batch` + // rejects wipes, so use the ordered merge. Persisting updates shadowed by the + // masking suffix is redundant but safe: the in-memory overlay still takes + // precedence. + // + // With a revm release containing bluealloy/revm#3863, post-Cancun selfdestructs + // will no longer result in `storage.is_deleted` in serial trie updates. The flag + // remains valid `save_blocks` input when processing pre-Cancun historical data. + let contains_storage_wipe = batch.iter().chain(&mask).any(|updates| { + updates.storage_tries_ref().values().any(|storage| storage.is_deleted) + }); + let merged_trie = if contains_storage_wipe { + TrieUpdatesSorted::merge_batch( + state_trie_blocks.iter().rev().map(|block| block.trie_updates()), + ) + } else { + Arc::new(TrieUpdatesSorted::disjointed_merge_batch(&batch, &mask)) + }; if !merged_trie.is_empty() { self.write_trie_updates_sorted(&merged_trie)?; } @@ -806,8 +818,8 @@ impl DatabaseProvider DatabaseProvider>, first_tx_num: TxNumber, ) -> ProviderResult { - if self.prune_modes.sender_recovery.is_none_or(|m| !m.is_full()) && - EitherWriterDestination::senders(self).is_database() + if self.prune_modes.sender_recovery.is_none_or(|m| !m.is_full()) + && EitherWriterDestination::senders(self).is_database() { let start = Instant::now(); let tx_nums_iter = std::iter::successors(Some(first_tx_num), |n| Some(n + 1)); @@ -1084,7 +1096,7 @@ where while let Some((sharded_key, list)) = item { // If the shard does not belong to the key, break. if !shard_belongs_to_key(&sharded_key) { - break + break; } // Always delete the current shard from the database first @@ -1099,18 +1111,18 @@ where // Keep it deleted (don't return anything for reinsertion) if first >= block_number { item = cursor.prev()?; - continue + continue; } // Case 2: This is a boundary shard (spans across the unwinding point) // The shard contains some blocks below and some at/above the unwinding point else if block_number <= sharded_key.as_ref().highest_block_number { // Return only the block numbers that are below the unwinding point // These will be reinserted to preserve the historical data - return Ok(list.iter().take_while(|i| *i < block_number).collect::>()) + return Ok(list.iter().take_while(|i| *i < block_number).collect::>()); } // Case 3: Entire shard is below the unwinding point // Return all block numbers for reinsertion (preserve entire shard) - return Ok(list.iter().collect::>()) + return Ok(list.iter().collect::>()); } // No shards found or all processed @@ -1189,7 +1201,7 @@ impl DatabaseProvider { let Some(block_number) = self.convert_hash_or_number(id)? else { return Ok(None) }; let earliest_available = self.static_file_provider.earliest_history_height(); if block_number < earliest_available { - return Err(ProviderError::BlockExpired { requested: block_number, earliest_available }) + return Err(ProviderError::BlockExpired { requested: block_number, earliest_available }); } let Some(header) = header_by_number(block_number)? else { return Ok(None) }; @@ -1259,7 +1271,7 @@ impl DatabaseProvider { F: FnMut(H, BodyTy, Range) -> ProviderResult, { if range.is_empty() { - return Ok(Vec::new()) + return Ok(Vec::new()); } let len = range.end().saturating_sub(*range.start()) as usize + 1; @@ -1594,8 +1606,8 @@ impl AccountExtReader for DatabaseProvider HeaderSyncGapProvider } Ordering::Less => { // There's either missing or corrupted files. - return Err(ProviderError::HeaderNotFound(next_static_file_block_num.into())) + return Err(ProviderError::HeaderNotFound(next_static_file_block_num.into())); } Ordering::Equal => {} } @@ -1928,7 +1940,7 @@ impl BlockReader for DatabaseProvid if let Some(number) = self.convert_hash_or_number(id)? { let earliest_available = self.static_file_provider.earliest_history_height(); if number < earliest_available { - return Err(ProviderError::BlockExpired { requested: number, earliest_available }) + return Err(ProviderError::BlockExpired { requested: number, earliest_available }); } let Some(header) = self.header_by_number(number)? else { return Ok(None) }; @@ -1938,7 +1950,7 @@ impl BlockReader for DatabaseProvid // If they exist but are not indexed, we don't have enough // information to return the block anyways, so we return `None`. let Some(transactions) = self.transactions_by_block(number.into())? else { - return Ok(None) + return Ok(None); }; let body = self @@ -1948,7 +1960,7 @@ impl BlockReader for DatabaseProvid .pop() .ok_or(ProviderError::InvalidStorageOutput)?; - return Ok(Some(Self::Block::new(header, body))) + return Ok(Some(Self::Block::new(header, body))); } Ok(None) @@ -2108,10 +2120,10 @@ impl TransactionsProvider for Datab &self, tx_hash: TxHash, ) -> ProviderResult> { - if let Some(transaction_id) = self.transaction_id(tx_hash)? && - let Some(transaction) = self.transaction_by_id_unhashed(transaction_id)? && - let Some(block_number) = self.block_by_transaction_id(transaction_id)? && - let Some(sealed_header) = self.sealed_header(block_number)? + if let Some(transaction_id) = self.transaction_id(tx_hash)? + && let Some(transaction) = self.transaction_by_id_unhashed(transaction_id)? + && let Some(block_number) = self.block_by_transaction_id(transaction_id)? + && let Some(sealed_header) = self.sealed_header(block_number)? { let (header, block_hash) = sealed_header.split(); if let Some(block_body) = self.block_body_indices(block_number)? { @@ -2131,7 +2143,7 @@ impl TransactionsProvider for Datab timestamp: header.timestamp(), }; - return Ok(Some((transaction, meta))) + return Ok(Some((transaction, meta))); } } @@ -2142,15 +2154,15 @@ impl TransactionsProvider for Datab &self, id: BlockHashOrNumber, ) -> ProviderResult>> { - if let Some(block_number) = self.convert_hash_or_number(id)? && - let Some(body) = self.block_body_indices(block_number)? + if let Some(block_number) = self.convert_hash_or_number(id)? + && let Some(body) = self.block_body_indices(block_number)? { let tx_range = body.tx_num_range(); return if tx_range.is_empty() { Ok(Some(Vec::new())) } else { self.transactions_by_tx_range(tx_range).map(Some) - } + }; } Ok(None) } @@ -2225,8 +2237,8 @@ impl ReceiptProvider for DatabasePr &self, block: BlockHashOrNumber, ) -> ProviderResult>> { - if let Some(number) = self.convert_hash_or_number(block)? && - let Some(body) = self.block_body_indices(number)? + if let Some(number) = self.convert_hash_or_number(block)? + && let Some(body) = self.block_body_indices(number)? { let tx_range = body.tx_num_range(); return if tx_range.is_empty() { @@ -2235,11 +2247,11 @@ impl ReceiptProvider for DatabasePr let receipts = self.receipts_by_tx_range(tx_range)?; if receipts.len() != body.tx_count as usize { - return Ok(None) + return Ok(None); } Ok(Some(receipts)) - } + }; } Ok(None) } @@ -2556,10 +2568,10 @@ impl StateWriter ) -> ProviderResult<()> { let execution_outcome = execution_outcome.into(); - if self.cached_storage_settings().use_hashed_state() && - !config.write_receipts && - !config.write_account_changesets && - !config.write_storage_changesets + if self.cached_storage_settings().use_hashed_state() + && !config.write_receipts + && !config.write_account_changesets + && !config.write_storage_changesets { // In storage v2 with all outputs directed to static files, plain state and changesets // are written elsewhere. Only bytecodes need MDBX writes, so skip the expensive @@ -2614,11 +2626,12 @@ impl StateWriter // Database, OR if receipts_in_static_files is enabled but no receipts exist in static // files yet. Once receipts exist in static files, we must continue writing to maintain // continuity and have no gaps. - let prunable_receipts = (EitherWriter::receipts_destination(self).is_database() || - self.static_file_provider() + let prunable_receipts = (EitherWriter::receipts_destination(self).is_database() + || self + .static_file_provider() .get_highest_static_file_tx(StaticFileSegment::Receipts) - .is_none()) && - PruneMode::Distance(self.minimum_pruning_distance).should_prune(first_block, tip); + .is_none()) + && PruneMode::Distance(self.minimum_pruning_distance).should_prune(first_block, tip); // Prepare set of addresses which logs should not be pruned. let mut allowed_addresses: AddressSet = AddressSet::default(); @@ -2635,12 +2648,13 @@ impl StateWriter receipts_writer.increment_block(block_number)?; // Skip writing receipts if pruning configuration requires us to. - if prunable_receipts && - self.prune_modes + if prunable_receipts + && self + .prune_modes .receipts .is_some_and(|mode| mode.should_prune(block_number, tip)) { - continue + continue; } // If there are new addresses to retain after this block number, track them @@ -2652,11 +2666,11 @@ impl StateWriter let receipt_idx = first_tx_index + idx as u64; // Skip writing receipt if log filter is active and it does not have any logs to // retain - if prunable_receipts && - has_contract_log_filter && - !receipt.logs().iter().any(|log| allowed_addresses.contains(&log.address)) + if prunable_receipts + && has_contract_log_filter + && !receipt.logs().iter().any(|log| allowed_addresses.contains(&log.address)) { - continue + continue; } receipts_writer.append_receipt(receipt_idx, receipt)?; @@ -2787,8 +2801,8 @@ impl StateWriter for entry in storage { tracing::trace!(?address, ?entry.key, "Updating plain state storage"); if let Some(db_entry) = - storages_cursor.seek_by_key_subkey(address, entry.key)? && - db_entry.key == entry.key + storages_cursor.seek_by_key_subkey(address, entry.key)? + && db_entry.key == entry.key { storages_cursor.delete_current()?; } @@ -2834,8 +2848,8 @@ impl StateWriter let entry = StorageEntry { key: *hashed_slot, value: *value }; if let Some(db_entry) = - hashed_storage_cursor.seek_by_key_subkey(*hashed_address, entry.key)? && - db_entry.key == entry.key + hashed_storage_cursor.seek_by_key_subkey(*hashed_address, entry.key)? + && db_entry.key == entry.key { hashed_storage_cursor.delete_current()?; } @@ -3018,7 +3032,7 @@ impl StateWriter let range = block + 1..=self.last_block_number()?; if range.is_empty() { - return Ok(ExecutionOutcome::default()) + return Ok(ExecutionOutcome::default()); } let start_block_number = *range.start(); @@ -3034,8 +3048,8 @@ impl StateWriter let storage_range = BlockNumberAddress::range(range.clone()); let storage_changeset = if let Some(highest_block) = self .static_file_provider - .get_highest_static_file_block(StaticFileSegment::StorageChangeSets) && - self.cached_storage_settings().storage_v2 + .get_highest_static_file_block(StaticFileSegment::StorageChangeSets) + && self.cached_storage_settings().storage_v2 { let changesets = self.storage_changesets_range(block + 1..=highest_block)?; let mut changeset_writer = @@ -3050,8 +3064,8 @@ impl StateWriter let highest_changeset_block = self .static_file_provider .get_highest_static_file_block(StaticFileSegment::AccountChangeSets); - let account_changeset = if let Some(highest_block) = highest_changeset_block && - self.cached_storage_settings().storage_v2 + let account_changeset = if let Some(highest_block) = highest_changeset_block + && self.cached_storage_settings().storage_v2 { // TODO: add a `take` method that removes and returns the items instead of doing this let changesets = self.account_changesets_range(block + 1..highest_block + 1)?; @@ -3258,7 +3272,7 @@ impl TrieWriter for DatabaseProvider #[instrument(level = "debug", target = "providers::db", skip_all)] fn write_trie_updates_sorted(&self, trie_updates: &TrieUpdatesSorted) -> ProviderResult { if trie_updates.is_empty() { - return Ok(0) + return Ok(0); } // Track the number of inserted entries. @@ -3516,8 +3530,8 @@ impl HistoryWriter for DatabaseProvi StorageShardedKey::last(address, storage_key), rem_index, |storage_sharded_key| { - storage_sharded_key.address == address && - storage_sharded_key.sharded_key.key == storage_key + storage_sharded_key.address == address + && storage_sharded_key.sharded_key.key == storage_key }, )?; @@ -3817,7 +3831,7 @@ impl BlockWriter ) -> ProviderResult<()> { if blocks.is_empty() { debug!(target: "providers::db", "Attempted to append empty block range"); - return Ok(()) + return Ok(()); } // Blocks are not empty, so no need to handle the case of `blocks.first()` being @@ -4858,6 +4872,123 @@ mod tests { assert_eq!(masked_entries[0].1.nibbles.0, masked_storage_node); } + #[cfg(feature = "partial-persistence")] + #[test] + fn test_save_blocks_merges_storage_wipe_in_multi_block_batch() { + use reth_trie::{ + updates::{StorageTrieUpdatesSorted, TrieUpdatesSorted}, + BranchNodeCompact, HashedPostStateSorted, + }; + + let factory = create_test_provider_factory(); + factory.set_storage_settings_cache(StorageSettings::v2()); + + let mut test_block_builder = TestBlockBuilder::eth().with_state(); + let genesis = test_block_builder.get_executed_blocks(0..1).next().unwrap(); + let mut blocks: Vec<_> = test_block_builder.get_executed_blocks(1..4).collect(); + let address = B256::with_last_byte(1); + let storage_path = Nibbles::from_nibbles([0x1, 0x2]); + + let provider_rw = factory.provider_rw().unwrap(); + save_genesis(&provider_rw, &genesis).unwrap(); + provider_rw + .write_trie_updates_sorted(&TrieUpdatesSorted::new( + vec![], + B256Map::from_iter([( + address, + StorageTrieUpdatesSorted { + is_deleted: false, + storage_nodes: vec![(storage_path, Some(BranchNodeCompact::default()))], + }, + )]), + )) + .unwrap(); + provider_rw.commit().unwrap(); + + let wipe = TrieUpdatesSorted::new( + vec![], + B256Map::from_iter([( + address, + StorageTrieUpdatesSorted { is_deleted: true, storage_nodes: vec![] }, + )]), + ); + let wipe_block = &blocks[2]; + blocks[2] = ExecutedBlock::new( + Arc::clone(&wipe_block.recovered_block), + Arc::clone(&wipe_block.execution_output), + ComputedTrieData::new(Arc::new(HashedPostStateSorted::default()), Arc::new(wipe)), + ); + + let provider_rw = factory.provider_rw().unwrap(); + let input = SaveBlocksInput::new(blocks, 0, 0, 3, 3); + provider_rw.save_blocks(&input).unwrap(); + provider_rw.commit().unwrap(); + + let provider = factory.provider().unwrap(); + let checkpoint = provider.get_stage_checkpoint(StageId::Finish).unwrap().unwrap(); + assert_eq!(checkpoint.block_number, 3); + let storage_entries = provider + .tx_ref() + .cursor_dup_read::() + .unwrap() + .walk_dup(Some(address), None) + .unwrap() + .collect::, _>>() + .unwrap(); + assert!(storage_entries.is_empty()); + } + + #[cfg(feature = "partial-persistence")] + #[test] + fn test_save_blocks_batches_transient_storage_wipe() { + use alloy_primitives::map::B256Set; + use reth_trie::{updates::TrieUpdates, HashBuilder, HashedPostStateSorted}; + + let factory = create_test_provider_factory(); + factory.set_storage_settings_cache(StorageSettings::v2()); + + let mut test_block_builder = TestBlockBuilder::eth().with_state(); + let genesis = test_block_builder.get_executed_blocks(0..1).next().unwrap(); + let blocks: Vec<_> = test_block_builder.get_executed_blocks(1..4).collect(); + + let provider_rw = factory.provider_rw().unwrap(); + save_genesis(&provider_rw, &genesis).unwrap(); + provider_rw.commit().unwrap(); + + // A contract created and self-destructed in the same transaction leaves an empty whole- + // storage wipe in the trie updates, even though the account never reaches persisted state. + let ephemeral_account = B256::with_last_byte(0x57); + let hashed_state = HashedPostStateSorted::default(); + let mut trie_updates = TrieUpdates::default(); + trie_updates.finalize( + HashBuilder::default(), + Default::default(), + B256Set::from_iter([ephemeral_account]), + ); + let trie_updates = trie_updates.into_sorted(); + assert!(trie_updates.storage_tries_ref()[&ephemeral_account].is_deleted); + let selfdestruct_block = ExecutedBlock::new( + Arc::clone(&blocks[2].recovered_block), + Arc::clone(&blocks[2].execution_output), + ComputedTrieData::new(Arc::new(hashed_state), Arc::new(trie_updates)), + ); + + let provider_rw = factory.provider_rw().unwrap(); + let input = SaveBlocksInput::new( + vec![blocks[0].clone(), blocks[1].clone(), selfdestruct_block], + 0, + 0, + 3, + 3, + ); + provider_rw.save_blocks(&input).unwrap(); + provider_rw.commit().unwrap(); + + let checkpoint = + factory.provider().unwrap().get_stage_checkpoint(StageId::Finish).unwrap().unwrap(); + assert_eq!(checkpoint.block_number, 3); + } + #[cfg(feature = "partial-persistence")] #[test] fn test_save_blocks_partial_cycles_do_not_duplicate_static_file_writes() { @@ -5540,8 +5671,8 @@ mod tests { ..Default::default() }; - let storage: HashMap> = (1..= - slots_per_account as u64) + let storage: HashMap> = (1 + ..=slots_per_account as u64) .map(|s| { ( U256::from(s + acct_idx as u64 * 100), From b7a801df625d96a87de1b227504ee41af6a8ffa5 Mon Sep 17 00:00:00 2001 From: Emma Jamieson-Hoare Date: Thu, 20 Aug 2026 11:40:02 +0100 Subject: [PATCH 04/14] chore: bump versions --- Cargo.lock | 228 +++++++++++++++++++-------------------- Cargo.toml | 2 +- docs/vocs/vocs.config.ts | 2 +- 3 files changed, 116 insertions(+), 116 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f84bacfb442..04c928a3f41 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3269,7 +3269,7 @@ dependencies = [ [[package]] name = "ef-test-runner" -version = "2.5.0" +version = "2.5.1" dependencies = [ "clap", "ef-tests", @@ -3277,7 +3277,7 @@ dependencies = [ [[package]] name = "ef-tests" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-consensus", "alloy-eips", @@ -3730,7 +3730,7 @@ dependencies = [ [[package]] name = "example-full-contract-state" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-primitives", "eyre", @@ -3848,7 +3848,7 @@ dependencies = [ [[package]] name = "exex-subscription" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-primitives", "clap", @@ -7661,7 +7661,7 @@ checksum = "1e061d1b48cb8d38042de4ae0a7a6401009d6143dc80d2e2d6f31f0bdd6470c7" [[package]] name = "reth" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-node-bindings", "alloy-primitives", @@ -7711,7 +7711,7 @@ dependencies = [ [[package]] name = "reth-basic-payload-builder" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-consensus", "alloy-eips", @@ -7737,7 +7737,7 @@ dependencies = [ [[package]] name = "reth-bb" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-consensus", "alloy-eips", @@ -7784,7 +7784,7 @@ dependencies = [ [[package]] name = "reth-chain-state" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-consensus", "alloy-eips", @@ -7815,7 +7815,7 @@ dependencies = [ [[package]] name = "reth-chainspec" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-chains", "alloy-consensus", @@ -7835,7 +7835,7 @@ dependencies = [ [[package]] name = "reth-cli" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-genesis", "clap", @@ -7847,7 +7847,7 @@ dependencies = [ [[package]] name = "reth-cli-commands" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-chains", "alloy-consensus", @@ -7937,7 +7937,7 @@ dependencies = [ [[package]] name = "reth-cli-runner" -version = "2.5.0" +version = "2.5.1" dependencies = [ "reth-tasks", "tokio", @@ -7946,7 +7946,7 @@ dependencies = [ [[package]] name = "reth-cli-util" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-eips", "alloy-primitives", @@ -8000,7 +8000,7 @@ dependencies = [ [[package]] name = "reth-config" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-primitives", "eyre", @@ -8018,7 +8018,7 @@ dependencies = [ [[package]] name = "reth-consensus" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-consensus", "alloy-eip7928", @@ -8031,7 +8031,7 @@ dependencies = [ [[package]] name = "reth-consensus-common" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-consensus", "alloy-eips", @@ -8045,7 +8045,7 @@ dependencies = [ [[package]] name = "reth-consensus-debug-client" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-consensus", "alloy-eips", @@ -8069,7 +8069,7 @@ dependencies = [ [[package]] name = "reth-db" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-consensus", "alloy-primitives", @@ -8105,7 +8105,7 @@ dependencies = [ [[package]] name = "reth-db-api" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-consensus", "alloy-primitives", @@ -8133,7 +8133,7 @@ dependencies = [ [[package]] name = "reth-db-common" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-consensus", "alloy-genesis", @@ -8164,7 +8164,7 @@ dependencies = [ [[package]] name = "reth-db-models" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-eips", "alloy-primitives", @@ -8180,7 +8180,7 @@ dependencies = [ [[package]] name = "reth-discv4" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -8206,7 +8206,7 @@ dependencies = [ [[package]] name = "reth-discv5" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -8231,7 +8231,7 @@ dependencies = [ [[package]] name = "reth-dns-discovery" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-chains", "alloy-primitives", @@ -8259,7 +8259,7 @@ dependencies = [ [[package]] name = "reth-downloaders" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-consensus", "alloy-eips", @@ -8297,7 +8297,7 @@ dependencies = [ [[package]] name = "reth-e2e-test-utils" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-consensus", "alloy-eips", @@ -8353,7 +8353,7 @@ dependencies = [ [[package]] name = "reth-ecies" -version = "2.5.0" +version = "2.5.1" dependencies = [ "aes", "alloy-primitives", @@ -8379,7 +8379,7 @@ dependencies = [ [[package]] name = "reth-engine-local" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-consensus", "alloy-primitives", @@ -8401,7 +8401,7 @@ dependencies = [ [[package]] name = "reth-engine-primitives" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-consensus", "alloy-eips", @@ -8427,7 +8427,7 @@ dependencies = [ [[package]] name = "reth-engine-tree" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-consensus", "alloy-eip7928", @@ -8497,7 +8497,7 @@ dependencies = [ [[package]] name = "reth-engine-util" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-consensus", "alloy-primitives", @@ -8526,7 +8526,7 @@ dependencies = [ [[package]] name = "reth-era" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-consensus", "alloy-eips", @@ -8551,7 +8551,7 @@ dependencies = [ [[package]] name = "reth-era-downloader" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-primitives", "bytes", @@ -8569,7 +8569,7 @@ dependencies = [ [[package]] name = "reth-era-utils" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-consensus", "alloy-primitives", @@ -8600,7 +8600,7 @@ dependencies = [ [[package]] name = "reth-errors" -version = "2.5.0" +version = "2.5.1" dependencies = [ "reth-consensus", "reth-execution-errors", @@ -8610,7 +8610,7 @@ dependencies = [ [[package]] name = "reth-eth-wire" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-chains", "alloy-consensus", @@ -8648,7 +8648,7 @@ dependencies = [ [[package]] name = "reth-eth-wire-types" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-chains", "alloy-consensus", @@ -8676,7 +8676,7 @@ dependencies = [ [[package]] name = "reth-ethereum" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-rpc-types-engine", "alloy-rpc-types-eth", @@ -8716,7 +8716,7 @@ dependencies = [ [[package]] name = "reth-ethereum-cli" -version = "2.5.0" +version = "2.5.1" dependencies = [ "clap", "eyre", @@ -8739,7 +8739,7 @@ dependencies = [ [[package]] name = "reth-ethereum-consensus" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-consensus", "alloy-eips", @@ -8755,7 +8755,7 @@ dependencies = [ [[package]] name = "reth-ethereum-engine-primitives" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-eips", "alloy-primitives", @@ -8771,7 +8771,7 @@ dependencies = [ [[package]] name = "reth-ethereum-forks" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-eip2124", "alloy-hardforks 0.4.7", @@ -8784,7 +8784,7 @@ dependencies = [ [[package]] name = "reth-ethereum-payload-builder" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-consensus", "alloy-eips", @@ -8813,7 +8813,7 @@ dependencies = [ [[package]] name = "reth-ethereum-primitives" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-consensus", "alloy-eips", @@ -8834,7 +8834,7 @@ dependencies = [ [[package]] name = "reth-etl" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-primitives", "rayon", @@ -8844,7 +8844,7 @@ dependencies = [ [[package]] name = "reth-evm" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-consensus", "alloy-eip7928", @@ -8870,7 +8870,7 @@ dependencies = [ [[package]] name = "reth-evm-ethereum" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-consensus", "alloy-eips", @@ -8895,7 +8895,7 @@ dependencies = [ [[package]] name = "reth-execution-cache" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-primitives", "fixed-cache", @@ -8913,7 +8913,7 @@ dependencies = [ [[package]] name = "reth-execution-errors" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-evm", "alloy-primitives", @@ -8925,7 +8925,7 @@ dependencies = [ [[package]] name = "reth-execution-types" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-consensus", "alloy-eips", @@ -8946,7 +8946,7 @@ dependencies = [ [[package]] name = "reth-exex" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-consensus", "alloy-eips", @@ -8991,7 +8991,7 @@ dependencies = [ [[package]] name = "reth-exex-test-utils" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-eips", "eyre", @@ -9022,7 +9022,7 @@ dependencies = [ [[package]] name = "reth-exex-types" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-eips", "alloy-primitives", @@ -9039,7 +9039,7 @@ dependencies = [ [[package]] name = "reth-fs-util" -version = "2.5.0" +version = "2.5.1" dependencies = [ "serde", "serde_json", @@ -9048,7 +9048,7 @@ dependencies = [ [[package]] name = "reth-invalid-block-hooks" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-consensus", "alloy-eips", @@ -9079,7 +9079,7 @@ dependencies = [ [[package]] name = "reth-ipc" -version = "2.5.0" +version = "2.5.1" dependencies = [ "bytes", "futures", @@ -9101,7 +9101,7 @@ dependencies = [ [[package]] name = "reth-libmdbx" -version = "2.5.0" +version = "2.5.1" dependencies = [ "bitflags 2.13.0", "byteorder", @@ -9118,7 +9118,7 @@ dependencies = [ [[package]] name = "reth-mdbx-sys" -version = "2.5.0" +version = "2.5.1" dependencies = [ "bindgen", "cc", @@ -9126,7 +9126,7 @@ dependencies = [ [[package]] name = "reth-metrics" -version = "2.5.0" +version = "2.5.1" dependencies = [ "futures", "libc", @@ -9139,7 +9139,7 @@ dependencies = [ [[package]] name = "reth-net-banlist" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-primitives", "ipnet", @@ -9147,7 +9147,7 @@ dependencies = [ [[package]] name = "reth-net-nat" -version = "2.5.0" +version = "2.5.1" dependencies = [ "futures-util", "if-addrs", @@ -9161,7 +9161,7 @@ dependencies = [ [[package]] name = "reth-network" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-consensus", "alloy-eip7928", @@ -9230,7 +9230,7 @@ dependencies = [ [[package]] name = "reth-network-api" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-consensus", "alloy-primitives", @@ -9254,7 +9254,7 @@ dependencies = [ [[package]] name = "reth-network-p2p" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-consensus", "alloy-eip7928", @@ -9278,7 +9278,7 @@ dependencies = [ [[package]] name = "reth-network-peers" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -9295,7 +9295,7 @@ dependencies = [ [[package]] name = "reth-network-types" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-eip2124", "humantime-serde", @@ -9308,7 +9308,7 @@ dependencies = [ [[package]] name = "reth-nippy-jar" -version = "2.5.0" +version = "2.5.1" dependencies = [ "anyhow", "bincode", @@ -9326,7 +9326,7 @@ dependencies = [ [[package]] name = "reth-node-api" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-rpc-types-engine", "eyre", @@ -9349,7 +9349,7 @@ dependencies = [ [[package]] name = "reth-node-builder" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-consensus", "alloy-eips", @@ -9420,7 +9420,7 @@ dependencies = [ [[package]] name = "reth-node-core" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-consensus", "alloy-eips", @@ -9476,7 +9476,7 @@ dependencies = [ [[package]] name = "reth-node-ethereum" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-consensus", "alloy-contract", @@ -9545,7 +9545,7 @@ dependencies = [ [[package]] name = "reth-node-ethstats" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-consensus", "alloy-primitives", @@ -9568,7 +9568,7 @@ dependencies = [ [[package]] name = "reth-node-events" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-consensus", "alloy-eips", @@ -9591,7 +9591,7 @@ dependencies = [ [[package]] name = "reth-node-metrics" -version = "2.5.0" +version = "2.5.1" dependencies = [ "bytes", "eyre", @@ -9620,7 +9620,7 @@ dependencies = [ [[package]] name = "reth-node-types" -version = "2.5.0" +version = "2.5.1" dependencies = [ "reth-chainspec", "reth-db-api", @@ -9631,7 +9631,7 @@ dependencies = [ [[package]] name = "reth-payload-builder" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-consensus", "alloy-primitives", @@ -9654,7 +9654,7 @@ dependencies = [ [[package]] name = "reth-payload-builder-primitives" -version = "2.5.0" +version = "2.5.1" dependencies = [ "pin-project", "reth-payload-primitives", @@ -9665,7 +9665,7 @@ dependencies = [ [[package]] name = "reth-payload-primitives" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-consensus", "alloy-eips", @@ -9689,7 +9689,7 @@ dependencies = [ [[package]] name = "reth-payload-util" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-consensus", "alloy-primitives", @@ -9698,7 +9698,7 @@ dependencies = [ [[package]] name = "reth-payload-validator" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-consensus", "alloy-rpc-types-engine", @@ -9740,7 +9740,7 @@ dependencies = [ [[package]] name = "reth-provider" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-consensus", "alloy-eip7928", @@ -9794,7 +9794,7 @@ dependencies = [ [[package]] name = "reth-prune" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-consensus", "alloy-primitives", @@ -9825,7 +9825,7 @@ dependencies = [ [[package]] name = "reth-prune-types" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-primitives", "arbitrary", @@ -9845,7 +9845,7 @@ dependencies = [ [[package]] name = "reth-revm" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-consensus", "alloy-primitives", @@ -9861,7 +9861,7 @@ dependencies = [ [[package]] name = "reth-rpc" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-consensus", "alloy-dyn-abi", @@ -9941,7 +9941,7 @@ dependencies = [ [[package]] name = "reth-rpc-api" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-eips", "alloy-genesis", @@ -9971,7 +9971,7 @@ dependencies = [ [[package]] name = "reth-rpc-builder" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-eips", "alloy-network", @@ -10029,7 +10029,7 @@ dependencies = [ [[package]] name = "reth-rpc-convert" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-consensus", "alloy-evm", @@ -10049,7 +10049,7 @@ dependencies = [ [[package]] name = "reth-rpc-e2e-tests" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-genesis", "alloy-rpc-types-engine", @@ -10069,7 +10069,7 @@ dependencies = [ [[package]] name = "reth-rpc-engine-api" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-eips", "alloy-primitives", @@ -10105,7 +10105,7 @@ dependencies = [ [[package]] name = "reth-rpc-eth-api" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-consensus", "alloy-dyn-abi", @@ -10151,7 +10151,7 @@ dependencies = [ [[package]] name = "reth-rpc-eth-types" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-chains", "alloy-consensus", @@ -10203,7 +10203,7 @@ dependencies = [ [[package]] name = "reth-rpc-layer" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-rpc-types-engine", "http", @@ -10220,7 +10220,7 @@ dependencies = [ [[package]] name = "reth-rpc-server-types" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-eips", "alloy-primitives", @@ -10250,7 +10250,7 @@ dependencies = [ [[package]] name = "reth-stages" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-consensus", "alloy-eips", @@ -10312,7 +10312,7 @@ dependencies = [ [[package]] name = "reth-stages-api" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-eips", "alloy-primitives", @@ -10346,7 +10346,7 @@ dependencies = [ [[package]] name = "reth-stages-types" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-primitives", "arbitrary", @@ -10362,7 +10362,7 @@ dependencies = [ [[package]] name = "reth-static-file" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-primitives", "assert_matches", @@ -10385,7 +10385,7 @@ dependencies = [ [[package]] name = "reth-static-file-types" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-primitives", "clap", @@ -10403,7 +10403,7 @@ dependencies = [ [[package]] name = "reth-storage-api" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-consensus", "alloy-eip7928", @@ -10430,7 +10430,7 @@ dependencies = [ [[package]] name = "reth-storage-errors" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-eips", "alloy-primitives", @@ -10446,7 +10446,7 @@ dependencies = [ [[package]] name = "reth-storage-overlay" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-consensus", "alloy-eips", @@ -10475,7 +10475,7 @@ dependencies = [ [[package]] name = "reth-storage-rpc-provider" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-consensus", "alloy-eips", @@ -10504,7 +10504,7 @@ dependencies = [ [[package]] name = "reth-tasks" -version = "2.5.0" +version = "2.5.1" dependencies = [ "crossbeam-utils", "dashmap", @@ -10524,7 +10524,7 @@ dependencies = [ [[package]] name = "reth-testing-utils" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-consensus", "alloy-eips", @@ -10540,7 +10540,7 @@ dependencies = [ [[package]] name = "reth-tokio-util" -version = "2.5.0" +version = "2.5.1" dependencies = [ "tokio", "tokio-stream", @@ -10549,7 +10549,7 @@ dependencies = [ [[package]] name = "reth-tracing" -version = "2.5.0" +version = "2.5.1" dependencies = [ "clap", "eyre", @@ -10568,7 +10568,7 @@ dependencies = [ [[package]] name = "reth-tracing-otlp" -version = "2.5.0" +version = "2.5.1" dependencies = [ "base64 0.22.1", "clap", @@ -10586,7 +10586,7 @@ dependencies = [ [[package]] name = "reth-transaction-pool" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-consensus", "alloy-eips", @@ -10637,7 +10637,7 @@ dependencies = [ [[package]] name = "reth-trie" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-consensus", "alloy-eips", @@ -10669,7 +10669,7 @@ dependencies = [ [[package]] name = "reth-trie-common" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-consensus", "alloy-eips", @@ -10701,7 +10701,7 @@ dependencies = [ [[package]] name = "reth-trie-db" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-consensus", "alloy-primitives", @@ -10728,7 +10728,7 @@ dependencies = [ [[package]] name = "reth-trie-parallel" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-evm", "alloy-primitives", @@ -10756,7 +10756,7 @@ dependencies = [ [[package]] name = "reth-trie-sparse" -version = "2.5.0" +version = "2.5.1" dependencies = [ "alloy-primitives", "alloy-rlp", diff --git a/Cargo.toml b/Cargo.toml index c82dd492175..a54d01ac3fd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [workspace.package] -version = "2.5.0" +version = "2.5.1" edition = "2024" rust-version = "1.95" license = "MIT OR Apache-2.0" diff --git a/docs/vocs/vocs.config.ts b/docs/vocs/vocs.config.ts index 29e1e41dae4..941f6e83ed6 100644 --- a/docs/vocs/vocs.config.ts +++ b/docs/vocs/vocs.config.ts @@ -23,7 +23,7 @@ export default defineConfig({ { text: 'Rustdocs', link: '/docs' }, { text: 'GitHub', link: 'https://github.com/paradigmxyz/reth' }, { - text: 'v2.5.0', + text: 'v2.5.1', items: [ { text: 'Releases', From 6dec1b96b625584956883c34ad0eafbe550480ac Mon Sep 17 00:00:00 2001 From: Emma Jamieson-Hoare Date: Thu, 20 Aug 2026 11:43:28 +0100 Subject: [PATCH 05/14] chore: fix formatting regression --- .../src/providers/database/provider.rs | 162 +++++++++--------- 1 file changed, 83 insertions(+), 79 deletions(-) diff --git a/crates/storage/provider/src/providers/database/provider.rs b/crates/storage/provider/src/providers/database/provider.rs index eb909288b6b..df23ce5fda3 100644 --- a/crates/storage/provider/src/providers/database/provider.rs +++ b/crates/storage/provider/src/providers/database/provider.rs @@ -314,10 +314,10 @@ impl DatabaseProvider { &'a self, mut block_number: BlockNumber, ) -> ProviderResult> { - if block_number == self.best_block_number().unwrap_or_default() - && block_number == self.last_block_number().unwrap_or_default() + if block_number == self.best_block_number().unwrap_or_default() && + block_number == self.last_block_number().unwrap_or_default() { - return Ok(Box::new(LatestStateProviderRef::new(self))); + return Ok(Box::new(LatestStateProviderRef::new(self))) } // +1 as the changeset that we want is the one that was applied after this block. @@ -540,22 +540,22 @@ impl DatabaseProvider ProviderResult { let tip = self.last_block_number()?.max(last_block); Ok(StaticFileWriteCtx { - write_senders: EitherWriterDestination::senders(self).is_static_file() - && self.prune_modes.sender_recovery.is_none_or(|m| !m.is_full()), - write_receipts: save_mode.with_state() - && EitherWriter::receipts_destination(self).is_static_file(), - write_account_changesets: save_mode.with_state() - && EitherWriterDestination::account_changesets(self).is_static_file(), - write_storage_changesets: save_mode.with_state() - && EitherWriterDestination::storage_changesets(self).is_static_file(), + write_senders: EitherWriterDestination::senders(self).is_static_file() && + self.prune_modes.sender_recovery.is_none_or(|m| !m.is_full()), + write_receipts: save_mode.with_state() && + EitherWriter::receipts_destination(self).is_static_file(), + write_account_changesets: save_mode.with_state() && + EitherWriterDestination::account_changesets(self).is_static_file(), + write_storage_changesets: save_mode.with_state() && + EitherWriterDestination::storage_changesets(self).is_static_file(), tip, receipts_prune_mode: self.prune_modes.receipts, // Receipts are prunable if no receipts exist in SF yet and within pruning distance receipts_prunable: self .static_file_provider .get_highest_static_file_tx(StaticFileSegment::Receipts) - .is_none() - && PruneMode::Distance(self.minimum_pruning_distance) + .is_none() && + PruneMode::Distance(self.minimum_pruning_distance) .should_prune(first_block, tip), }) } @@ -594,7 +594,7 @@ impl DatabaseProvider DatabaseProvider DatabaseProvider>(); + let mask = state_trie_masking_blocks + .iter() + .map(|block| block.trie_data.get().sorted.trie_updates.as_ref()) + .collect::>(); // Sparse-trie streaming emits node updates, while the serial state-root path, // including fallback, can emit a whole storage-trie wipe. `disjointed_merge_batch` // rejects wipes, so use the ordered merge. Persisting updates shadowed by the @@ -818,8 +824,8 @@ impl DatabaseProvider DatabaseProvider>, first_tx_num: TxNumber, ) -> ProviderResult { - if self.prune_modes.sender_recovery.is_none_or(|m| !m.is_full()) - && EitherWriterDestination::senders(self).is_database() + if self.prune_modes.sender_recovery.is_none_or(|m| !m.is_full()) && + EitherWriterDestination::senders(self).is_database() { let start = Instant::now(); let tx_nums_iter = std::iter::successors(Some(first_tx_num), |n| Some(n + 1)); @@ -1096,7 +1102,7 @@ where while let Some((sharded_key, list)) = item { // If the shard does not belong to the key, break. if !shard_belongs_to_key(&sharded_key) { - break; + break } // Always delete the current shard from the database first @@ -1111,18 +1117,18 @@ where // Keep it deleted (don't return anything for reinsertion) if first >= block_number { item = cursor.prev()?; - continue; + continue } // Case 2: This is a boundary shard (spans across the unwinding point) // The shard contains some blocks below and some at/above the unwinding point else if block_number <= sharded_key.as_ref().highest_block_number { // Return only the block numbers that are below the unwinding point // These will be reinserted to preserve the historical data - return Ok(list.iter().take_while(|i| *i < block_number).collect::>()); + return Ok(list.iter().take_while(|i| *i < block_number).collect::>()) } // Case 3: Entire shard is below the unwinding point // Return all block numbers for reinsertion (preserve entire shard) - return Ok(list.iter().collect::>()); + return Ok(list.iter().collect::>()) } // No shards found or all processed @@ -1201,7 +1207,7 @@ impl DatabaseProvider { let Some(block_number) = self.convert_hash_or_number(id)? else { return Ok(None) }; let earliest_available = self.static_file_provider.earliest_history_height(); if block_number < earliest_available { - return Err(ProviderError::BlockExpired { requested: block_number, earliest_available }); + return Err(ProviderError::BlockExpired { requested: block_number, earliest_available }) } let Some(header) = header_by_number(block_number)? else { return Ok(None) }; @@ -1271,7 +1277,7 @@ impl DatabaseProvider { F: FnMut(H, BodyTy, Range) -> ProviderResult, { if range.is_empty() { - return Ok(Vec::new()); + return Ok(Vec::new()) } let len = range.end().saturating_sub(*range.start()) as usize + 1; @@ -1606,8 +1612,8 @@ impl AccountExtReader for DatabaseProvider HeaderSyncGapProvider } Ordering::Less => { // There's either missing or corrupted files. - return Err(ProviderError::HeaderNotFound(next_static_file_block_num.into())); + return Err(ProviderError::HeaderNotFound(next_static_file_block_num.into())) } Ordering::Equal => {} } @@ -1940,7 +1946,7 @@ impl BlockReader for DatabaseProvid if let Some(number) = self.convert_hash_or_number(id)? { let earliest_available = self.static_file_provider.earliest_history_height(); if number < earliest_available { - return Err(ProviderError::BlockExpired { requested: number, earliest_available }); + return Err(ProviderError::BlockExpired { requested: number, earliest_available }) } let Some(header) = self.header_by_number(number)? else { return Ok(None) }; @@ -1950,7 +1956,7 @@ impl BlockReader for DatabaseProvid // If they exist but are not indexed, we don't have enough // information to return the block anyways, so we return `None`. let Some(transactions) = self.transactions_by_block(number.into())? else { - return Ok(None); + return Ok(None) }; let body = self @@ -1960,7 +1966,7 @@ impl BlockReader for DatabaseProvid .pop() .ok_or(ProviderError::InvalidStorageOutput)?; - return Ok(Some(Self::Block::new(header, body))); + return Ok(Some(Self::Block::new(header, body))) } Ok(None) @@ -2120,10 +2126,10 @@ impl TransactionsProvider for Datab &self, tx_hash: TxHash, ) -> ProviderResult> { - if let Some(transaction_id) = self.transaction_id(tx_hash)? - && let Some(transaction) = self.transaction_by_id_unhashed(transaction_id)? - && let Some(block_number) = self.block_by_transaction_id(transaction_id)? - && let Some(sealed_header) = self.sealed_header(block_number)? + if let Some(transaction_id) = self.transaction_id(tx_hash)? && + let Some(transaction) = self.transaction_by_id_unhashed(transaction_id)? && + let Some(block_number) = self.block_by_transaction_id(transaction_id)? && + let Some(sealed_header) = self.sealed_header(block_number)? { let (header, block_hash) = sealed_header.split(); if let Some(block_body) = self.block_body_indices(block_number)? { @@ -2143,7 +2149,7 @@ impl TransactionsProvider for Datab timestamp: header.timestamp(), }; - return Ok(Some((transaction, meta))); + return Ok(Some((transaction, meta))) } } @@ -2154,15 +2160,15 @@ impl TransactionsProvider for Datab &self, id: BlockHashOrNumber, ) -> ProviderResult>> { - if let Some(block_number) = self.convert_hash_or_number(id)? - && let Some(body) = self.block_body_indices(block_number)? + if let Some(block_number) = self.convert_hash_or_number(id)? && + let Some(body) = self.block_body_indices(block_number)? { let tx_range = body.tx_num_range(); return if tx_range.is_empty() { Ok(Some(Vec::new())) } else { self.transactions_by_tx_range(tx_range).map(Some) - }; + } } Ok(None) } @@ -2237,8 +2243,8 @@ impl ReceiptProvider for DatabasePr &self, block: BlockHashOrNumber, ) -> ProviderResult>> { - if let Some(number) = self.convert_hash_or_number(block)? - && let Some(body) = self.block_body_indices(number)? + if let Some(number) = self.convert_hash_or_number(block)? && + let Some(body) = self.block_body_indices(number)? { let tx_range = body.tx_num_range(); return if tx_range.is_empty() { @@ -2247,11 +2253,11 @@ impl ReceiptProvider for DatabasePr let receipts = self.receipts_by_tx_range(tx_range)?; if receipts.len() != body.tx_count as usize { - return Ok(None); + return Ok(None) } Ok(Some(receipts)) - }; + } } Ok(None) } @@ -2568,10 +2574,10 @@ impl StateWriter ) -> ProviderResult<()> { let execution_outcome = execution_outcome.into(); - if self.cached_storage_settings().use_hashed_state() - && !config.write_receipts - && !config.write_account_changesets - && !config.write_storage_changesets + if self.cached_storage_settings().use_hashed_state() && + !config.write_receipts && + !config.write_account_changesets && + !config.write_storage_changesets { // In storage v2 with all outputs directed to static files, plain state and changesets // are written elsewhere. Only bytecodes need MDBX writes, so skip the expensive @@ -2626,12 +2632,11 @@ impl StateWriter // Database, OR if receipts_in_static_files is enabled but no receipts exist in static // files yet. Once receipts exist in static files, we must continue writing to maintain // continuity and have no gaps. - let prunable_receipts = (EitherWriter::receipts_destination(self).is_database() - || self - .static_file_provider() + let prunable_receipts = (EitherWriter::receipts_destination(self).is_database() || + self.static_file_provider() .get_highest_static_file_tx(StaticFileSegment::Receipts) - .is_none()) - && PruneMode::Distance(self.minimum_pruning_distance).should_prune(first_block, tip); + .is_none()) && + PruneMode::Distance(self.minimum_pruning_distance).should_prune(first_block, tip); // Prepare set of addresses which logs should not be pruned. let mut allowed_addresses: AddressSet = AddressSet::default(); @@ -2648,13 +2653,12 @@ impl StateWriter receipts_writer.increment_block(block_number)?; // Skip writing receipts if pruning configuration requires us to. - if prunable_receipts - && self - .prune_modes + if prunable_receipts && + self.prune_modes .receipts .is_some_and(|mode| mode.should_prune(block_number, tip)) { - continue; + continue } // If there are new addresses to retain after this block number, track them @@ -2666,11 +2670,11 @@ impl StateWriter let receipt_idx = first_tx_index + idx as u64; // Skip writing receipt if log filter is active and it does not have any logs to // retain - if prunable_receipts - && has_contract_log_filter - && !receipt.logs().iter().any(|log| allowed_addresses.contains(&log.address)) + if prunable_receipts && + has_contract_log_filter && + !receipt.logs().iter().any(|log| allowed_addresses.contains(&log.address)) { - continue; + continue } receipts_writer.append_receipt(receipt_idx, receipt)?; @@ -2801,8 +2805,8 @@ impl StateWriter for entry in storage { tracing::trace!(?address, ?entry.key, "Updating plain state storage"); if let Some(db_entry) = - storages_cursor.seek_by_key_subkey(address, entry.key)? - && db_entry.key == entry.key + storages_cursor.seek_by_key_subkey(address, entry.key)? && + db_entry.key == entry.key { storages_cursor.delete_current()?; } @@ -2848,8 +2852,8 @@ impl StateWriter let entry = StorageEntry { key: *hashed_slot, value: *value }; if let Some(db_entry) = - hashed_storage_cursor.seek_by_key_subkey(*hashed_address, entry.key)? - && db_entry.key == entry.key + hashed_storage_cursor.seek_by_key_subkey(*hashed_address, entry.key)? && + db_entry.key == entry.key { hashed_storage_cursor.delete_current()?; } @@ -3032,7 +3036,7 @@ impl StateWriter let range = block + 1..=self.last_block_number()?; if range.is_empty() { - return Ok(ExecutionOutcome::default()); + return Ok(ExecutionOutcome::default()) } let start_block_number = *range.start(); @@ -3048,8 +3052,8 @@ impl StateWriter let storage_range = BlockNumberAddress::range(range.clone()); let storage_changeset = if let Some(highest_block) = self .static_file_provider - .get_highest_static_file_block(StaticFileSegment::StorageChangeSets) - && self.cached_storage_settings().storage_v2 + .get_highest_static_file_block(StaticFileSegment::StorageChangeSets) && + self.cached_storage_settings().storage_v2 { let changesets = self.storage_changesets_range(block + 1..=highest_block)?; let mut changeset_writer = @@ -3064,8 +3068,8 @@ impl StateWriter let highest_changeset_block = self .static_file_provider .get_highest_static_file_block(StaticFileSegment::AccountChangeSets); - let account_changeset = if let Some(highest_block) = highest_changeset_block - && self.cached_storage_settings().storage_v2 + let account_changeset = if let Some(highest_block) = highest_changeset_block && + self.cached_storage_settings().storage_v2 { // TODO: add a `take` method that removes and returns the items instead of doing this let changesets = self.account_changesets_range(block + 1..highest_block + 1)?; @@ -3272,7 +3276,7 @@ impl TrieWriter for DatabaseProvider #[instrument(level = "debug", target = "providers::db", skip_all)] fn write_trie_updates_sorted(&self, trie_updates: &TrieUpdatesSorted) -> ProviderResult { if trie_updates.is_empty() { - return Ok(0); + return Ok(0) } // Track the number of inserted entries. @@ -3530,8 +3534,8 @@ impl HistoryWriter for DatabaseProvi StorageShardedKey::last(address, storage_key), rem_index, |storage_sharded_key| { - storage_sharded_key.address == address - && storage_sharded_key.sharded_key.key == storage_key + storage_sharded_key.address == address && + storage_sharded_key.sharded_key.key == storage_key }, )?; @@ -3831,7 +3835,7 @@ impl BlockWriter ) -> ProviderResult<()> { if blocks.is_empty() { debug!(target: "providers::db", "Attempted to append empty block range"); - return Ok(()); + return Ok(()) } // Blocks are not empty, so no need to handle the case of `blocks.first()` being @@ -5671,8 +5675,8 @@ mod tests { ..Default::default() }; - let storage: HashMap> = (1 - ..=slots_per_account as u64) + let storage: HashMap> = (1..= + slots_per_account as u64) .map(|s| { ( U256::from(s + acct_idx as u64 * 100), From 29aa4aeb76bc273ba3e75527f329113bcc90f284 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Tue, 1 Sep 2026 18:18:14 +0000 Subject: [PATCH 06/14] fix(stages): log bad block hash (#26909) Co-authored-by: DaniPopes <57450786+DaniPopes@users.noreply.github.com> --- crates/engine/tree/src/tree/precompile_cache.rs | 9 +++++++-- crates/stages/api/src/pipeline/mod.rs | 2 ++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/crates/engine/tree/src/tree/precompile_cache.rs b/crates/engine/tree/src/tree/precompile_cache.rs index e868cca8485..23146ca3914 100644 --- a/crates/engine/tree/src/tree/precompile_cache.rs +++ b/crates/engine/tree/src/tree/precompile_cache.rs @@ -14,6 +14,9 @@ use tracing::error; /// Default max cache size for [`PrecompileCache`] const MAX_CACHE_SIZE: u32 = 1024 * 1024; +/// Maximum calldata size to cache for a precompile. +const MAX_PRECOMPILE_CACHE_INPUT_SIZE: usize = 2 * 1024; + /// Stores caches for each precompile. #[derive(Debug, Clone, Default)] pub struct PrecompileCacheMap(Arc, FbBuildHasher<20>>>) @@ -179,7 +182,9 @@ where } fn call(&self, input: PrecompileInput<'_>) -> PrecompileResult { - if let Some(entry) = &self.cache.get(input.data, self.spec_id.clone()) && + let cacheable_input = input.data.len() <= MAX_PRECOMPILE_CACHE_INPUT_SIZE; + if cacheable_input && + let Some(entry) = &self.cache.get(input.data, self.spec_id.clone()) && input.gas >= entry.gas_used() { self.increment_by_one_precompile_cache_hits(); @@ -193,7 +198,7 @@ where match &result { // Only successful outputs are cacheable. Non-success statuses and errors must execute // again instead of poisoning the cache for subsequent calls. - Ok(output) if output.is_success() => { + Ok(output) if cacheable_input && output.is_success() => { // Sanity-check precompile output to ensure that it does not affect state gas in any // way. // diff --git a/crates/stages/api/src/pipeline/mod.rs b/crates/stages/api/src/pipeline/mod.rs index 0c2f3b668d6..36a8a6f3c3d 100644 --- a/crates/stages/api/src/pipeline/mod.rs +++ b/crates/stages/api/src/pipeline/mod.rs @@ -585,6 +585,7 @@ impl Pipeline { target: "sync::pipeline", stage = %stage_id, bad_block = %block.block.number, + bad_block_hash = %block.block.hash, "Stage encountered a validation error: {validation_error}" ); @@ -609,6 +610,7 @@ impl Pipeline { target: "sync::pipeline", stage = %stage_id, bad_block = %block.block.number, + bad_block_hash = %block.block.hash, "Stage encountered an execution error: {execution_error}" ); } From 60c1eb75d809fe26719fc52ad7e6166f9e5efc68 Mon Sep 17 00:00:00 2001 From: Sergei Shulepov Date: Tue, 25 Aug 2026 22:19:09 +0000 Subject: [PATCH 07/14] fix(rocksdb): better max_open_files config (#26812) --- Cargo.lock | 1 + crates/storage/provider/Cargo.toml | 3 + .../src/providers/rocksdb/provider.rs | 84 +++++++++++++++++-- 3 files changed, 82 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 04c928a3f41..00bed560e7d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -9751,6 +9751,7 @@ dependencies = [ "assert_matches", "eyre", "itertools 0.14.0", + "libc", "metrics", "notify", "parking_lot", diff --git a/crates/storage/provider/Cargo.toml b/crates/storage/provider/Cargo.toml index 1ff298889c1..17db3b470e5 100644 --- a/crates/storage/provider/Cargo.toml +++ b/crates/storage/provider/Cargo.toml @@ -69,6 +69,9 @@ rayon.workspace = true rocksdb.workspace = true +[target.'cfg(unix)'.dependencies] +libc.workspace = true + [dev-dependencies] reth-db = { workspace = true, features = ["test-utils"] } reth-primitives-traits = { workspace = true, features = ["arbitrary", "test-utils"] } diff --git a/crates/storage/provider/src/providers/rocksdb/provider.rs b/crates/storage/provider/src/providers/rocksdb/provider.rs index d7198e7c74a..9fae9514ebd 100644 --- a/crates/storage/provider/src/providers/rocksdb/provider.rs +++ b/crates/storage/provider/src/providers/rocksdb/provider.rs @@ -115,14 +115,22 @@ const DEFAULT_BLOCK_SIZE: usize = 16 * 1024; /// Default max background jobs for `RocksDB` compaction and flushing. const DEFAULT_MAX_BACKGROUND_JOBS: i32 = 6; -/// Default max open file descriptors for `RocksDB`. +/// Max open file descriptors for `RocksDB` when the process limit is low. /// /// Caps the number of SST file handles `RocksDB` keeps open simultaneously. /// Set to 512 to stay within the common default OS `ulimit -n` of 1024, /// leaving headroom for MDBX, static files, and other I/O. -/// `RocksDB` uses an internal table cache and re-opens files on demand, -/// so this has negligible performance impact on read-heavy workloads. -const DEFAULT_MAX_OPEN_FILES: i32 = 512; +const LIMITED_MAX_OPEN_FILES: i32 = 512; + +/// Keeps all `RocksDB` files open and avoids table cache lookups. +const KEEP_ALL_FILES_OPEN: i32 = -1; + +/// Minimum process file descriptor limit for keeping all `RocksDB` files open. +/// +/// Mature archive databases can use tens of thousands of file descriptors. This threshold keeps +/// unlimited mode for hosts configured for that workload while retaining a bounded table cache on +/// systems with low limits. +const HIGH_FILE_DESCRIPTOR_LIMIT: u64 = 128 * 1024; /// Default bytes per sync for `RocksDB` WAL writes (1 MB). const DEFAULT_BYTES_PER_SYNC: u64 = 1_048_576; @@ -234,7 +242,7 @@ impl RocksDBBuilder { options.set_log_level(log_level); - options.set_max_open_files(DEFAULT_MAX_OPEN_FILES); + options.set_max_open_files(select_max_open_files()); // Delete obsolete WAL files immediately after all column families have flushed. // Both set to 0 means "delete ASAP, no archival". @@ -415,7 +423,7 @@ impl RocksDBBuilder { // Open as secondary instance for catch-up capability. // Secondary needs max_open_files = -1 to keep all FDs open. let mut options = options; - options.set_max_open_files(-1); + options.set_max_open_files(KEEP_ALL_FILES_OPEN); let secondary_path = self .path @@ -2879,6 +2887,60 @@ const fn convert_log_level(level: LogLevel) -> rocksdb::LogLevel { } } +/// Selects the `RocksDB` `max_open_files` setting from the current file descriptor limit +/// balancing performance vs. compatibility. +/// +/// A mature database can use tens of thousands of file descriptors. With a +/// finite `max_open_files` value, `RocksDB` performs additional table-cache checks +/// even when enough capacity is available. The value `-1` keeps all table files +/// open and avoids this overhead. +/// +/// During normal startup, Reth raises the soft file descriptor limit to the +/// system hard limit before it opens `RocksDB`. Therefore, we expect the current +/// limit to be the hard limit. A survey of modern Linux distributions shows +/// common default limits of `1024:524288`. +/// +/// We use `-1` only when the current limit is above a conservative threshold. +/// This keeps enough file descriptors for other parts of the process. When the +/// limit is lower or cannot be read, we use a stricter fixed limit. +fn select_max_open_files() -> i32 { + let file_descriptor_limit = current_file_descriptor_limit(); + let max_open_files = max_open_files_for_limit(file_descriptor_limit); + + if max_open_files == LIMITED_MAX_OPEN_FILES { + tracing::warn!( + target: "providers::rocksdb", + ?file_descriptor_limit, + threshold = HIGH_FILE_DESCRIPTOR_LIMIT, + max_open_files, + "RocksDB will not keep all files open; performance may be reduced" + ); + } + + max_open_files +} + +const fn max_open_files_for_limit(file_descriptor_limit: Option) -> i32 { + match file_descriptor_limit { + Some(limit) if limit >= HIGH_FILE_DESCRIPTOR_LIMIT => KEEP_ALL_FILES_OPEN, + _ => LIMITED_MAX_OPEN_FILES, + } +} + +#[cfg(unix)] +#[allow(clippy::useless_conversion)] +fn current_file_descriptor_limit() -> Option { + let mut limit = libc::rlimit { rlim_cur: 0, rlim_max: 0 }; + // SAFETY: `limit` points to initialized writable memory for the kernel to populate. + let result = unsafe { libc::getrlimit(libc::RLIMIT_NOFILE, &raw mut limit) }; + (result == 0).then(|| limit.rlim_cur.into()) +} + +#[cfg(not(unix))] +const fn current_file_descriptor_limit() -> Option { + None +} + #[cfg(test)] mod tests { use super::*; @@ -2895,6 +2957,16 @@ mod tests { }; use tempfile::TempDir; + #[test] + fn max_open_files_adapts_to_file_descriptor_limit() { + assert_eq!(max_open_files_for_limit(Some(HIGH_FILE_DESCRIPTOR_LIMIT)), KEEP_ALL_FILES_OPEN); + assert_eq!( + max_open_files_for_limit(Some(HIGH_FILE_DESCRIPTOR_LIMIT - 1)), + LIMITED_MAX_OPEN_FILES + ); + assert_eq!(max_open_files_for_limit(None), LIMITED_MAX_OPEN_FILES); + } + #[test] fn test_with_default_tables_registers_required_column_families() { let temp_dir = TempDir::new().unwrap(); From 8eacb192fe01d4834e52e9d3003e625690eb4945 Mon Sep 17 00:00:00 2001 From: refcell Date: Tue, 25 Aug 2026 15:25:25 +0000 Subject: [PATCH 08/14] feat(net): allow updating the fork filter at runtime (#26794) Co-authored-by: Claude Co-authored-by: Matthias Seitz --- crates/net/network/src/manager.rs | 4 ++++ crates/net/network/src/network.rs | 24 +++++++++++++++++++++++- crates/net/network/src/session/mod.rs | 17 +++++++++++++++++ crates/net/p2p/src/sync.rs | 13 ++++++++++++- 4 files changed, 56 insertions(+), 2 deletions(-) diff --git a/crates/net/network/src/manager.rs b/crates/net/network/src/manager.rs index 515b27d690b..63255c41daa 100644 --- a/crates/net/network/src/manager.rs +++ b/crates/net/network/src/manager.rs @@ -776,6 +776,10 @@ impl NetworkManager { self.swarm.state_mut().update_fork_id(transition.current); } } + NetworkHandleMessage::SetForkFilter { fork_filter } => { + let fork_id = self.swarm.sessions_mut().set_fork_filter(fork_filter); + self.swarm.state_mut().update_fork_id(fork_id); + } NetworkHandleMessage::GetPeerInfos(tx) => { let _ = tx.send(self.get_peer_infos()); } diff --git a/crates/net/network/src/network.rs b/crates/net/network/src/network.rs index 18f381b3cbf..0ad5356bfee 100644 --- a/crates/net/network/src/network.rs +++ b/crates/net/network/src/network.rs @@ -12,7 +12,7 @@ use reth_eth_wire::{ BlockRangeUpdate, BroadcastPoolTransactions, DisconnectReason, EthNetworkPrimitives, NetworkPrimitives, NewPooledTransactionHashes, SharedTransactions, }; -use reth_ethereum_forks::Head; +use reth_ethereum_forks::{ForkFilter, Head}; use reth_network_api::{ events::{NetworkPeersEvents, PeerEvent, PeerEventStream}, test_utils::{PeersHandle, PeersHandleProvider}, @@ -112,6 +112,18 @@ impl NetworkHandle { self.send_message(NetworkHandleMessage::StatusUpdate { head }); } + /// Replaces the network's active [`ForkFilter`] with `fork_filter`, re-deriving the advertised + /// [`ForkId`](reth_ethereum_forks::ForkId) for future handshakes and updating the discovery + /// ENR entry. + /// + /// This lets a running node adopt a fork schedule that changed at runtime (e.g. an + /// L1-signalled upgrade) without a restart. The caller must build `fork_filter` from the + /// updated chain spec advanced to the node's current head, and should do so before the fork's + /// activation timestamp so the node announces the upcoming fork ahead of time. + pub fn set_fork_filter(&self, fork_filter: ForkFilter) { + self.send_message(NetworkHandleMessage::SetForkFilter { fork_filter }); + } + /// Announce a block over devp2p /// /// Caution: in `PoS` this is a noop because new blocks are no longer announced over devp2p. @@ -497,6 +509,11 @@ impl NetworkSyncUpdater for NetworkHandle { fn update_block_range(&self, update: reth_eth_wire::BlockRangeUpdate) { self.send_message(NetworkHandleMessage::InternalBlockRangeUpdate(update)); } + + /// Replaces the active fork filter to adopt a runtime fork-schedule change. + fn set_fork_filter(&self, fork_filter: ForkFilter) { + self.send_message(NetworkHandleMessage::SetForkFilter { fork_filter }); + } } impl BlockDownloaderProvider for NetworkHandle { @@ -614,6 +631,11 @@ pub(crate) enum NetworkHandleMessage), /// Gets `PeerInfo` for the specified peer IDs. diff --git a/crates/net/network/src/session/mod.rs b/crates/net/network/src/session/mod.rs index db95a71d984..a70a72742f4 100644 --- a/crates/net/network/src/session/mod.rs +++ b/crates/net/network/src/session/mod.rs @@ -263,6 +263,23 @@ impl SessionManager { transition } + /// Replaces the active [`ForkFilter`] with a newly derived one and returns the resulting + /// [`ForkId`]. + /// + /// This is used to adopt a fork schedule that changed at runtime (e.g. an L1-signalled + /// upgrade) without restarting the node. The caller is expected to build `fork_filter` from + /// the updated chain spec already advanced to the node's current head, so that + /// [`ForkFilter::current`] reflects the correct [`ForkId`] immediately. + /// + /// Every subsequent handshake clones this filter and advertises the returned [`ForkId`], so + /// the node's advertised fork identity stays aligned with the rules it now enforces. Existing + /// active sessions are not revalidated here; see [`SessionManager::active_sessions`]. + pub(crate) fn set_fork_filter(&mut self, fork_filter: ForkFilter) -> ForkId { + self.fork_filter = fork_filter; + self.status.forkid = self.fork_filter.current(); + self.status.forkid + } + /// An incoming TCP connection was received. This starts the authentication process to turn this /// stream into an active peer session. /// diff --git a/crates/net/p2p/src/sync.rs b/crates/net/p2p/src/sync.rs index 77b97116d19..6770c5d12a2 100644 --- a/crates/net/p2p/src/sync.rs +++ b/crates/net/p2p/src/sync.rs @@ -1,6 +1,6 @@ //! Traits used when interacting with the sync status of the network. -use alloy_eips::eip2124::Head; +use alloy_eips::eip2124::{ForkFilter, Head}; use reth_eth_wire_types::BlockRangeUpdate; /// A type that provides information about whether the node is currently syncing and the network is @@ -31,6 +31,17 @@ pub trait NetworkSyncUpdater: std::fmt::Debug + Send + Sync + 'static { /// Updates the advertised block range. fn update_block_range(&self, update: BlockRangeUpdate); + + /// Replaces the node's active [`ForkFilter`] to adopt a fork schedule that changed at runtime + /// (e.g. an L1-signalled upgrade) without a restart. + /// + /// The caller must build `fork_filter` from the updated chain spec advanced to the node's + /// current head, and should do so before the fork's activation timestamp so the node + /// announces the upcoming fork ahead of time. Defaults to a no-op for updaters that do not + /// track a fork filter. + fn set_fork_filter(&self, fork_filter: ForkFilter) { + let _ = fork_filter; + } } /// The state the network is currently in when it comes to synchronization. From b5f0c4f2d0eb981afa2c063acbdd605cb419228b Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Wed, 26 Aug 2026 11:50:31 +0000 Subject: [PATCH 09/14] fix(exex): support sparse WAL file IDs (#26819) --- crates/exex/exex/src/wal/mod.rs | 68 ++++++++++++++++++++++------- crates/exex/exex/src/wal/storage.rs | 34 ++++++--------- 2 files changed, 67 insertions(+), 35 deletions(-) diff --git a/crates/exex/exex/src/wal/mod.rs b/crates/exex/exex/src/wal/mod.rs index 0836e15b55a..e96d8b6cd3e 100644 --- a/crates/exex/exex/src/wal/mod.rs +++ b/crates/exex/exex/src/wal/mod.rs @@ -113,13 +113,14 @@ where /// Fills the block cache with the notifications from the storage. #[instrument(skip(self))] fn fill_block_cache(&self) -> WalResult<()> { - let Some(files_range) = self.storage.files_range()? else { return Ok(()) }; - self.next_file_id.store(files_range.end() + 1, Ordering::Relaxed); + let file_ids = self.storage.file_ids()?; + let Some(last_file_id) = file_ids.last() else { return Ok(()) }; + self.next_file_id.store(last_file_id + 1, Ordering::Relaxed); let mut block_cache = self.block_cache.write(); let mut notifications_size = 0; - for entry in self.storage.iter_notifications(files_range) { + for entry in self.storage.iter_notifications(file_ids) { let (file_id, size, notification) = entry?; notifications_size += size; @@ -198,11 +199,9 @@ where fn iter_notifications( &self, ) -> WalResult>> + '_>> { - let Some(range) = self.storage.files_range()? else { - return Ok(Box::new(std::iter::empty())) - }; - - Ok(Box::new(self.storage.iter_notifications(range).map(|entry| Ok(entry?.2)))) + Ok(Box::new( + self.storage.iter_notifications(self.storage.file_ids()?).map(|entry| Ok(entry?.2)), + )) } } @@ -238,6 +237,7 @@ mod tests { use crate::wal::{cache::CachedBlock, error::WalResult, Wal}; use alloy_primitives::B256; use itertools::Itertools; + use reth_ethereum_primitives::EthPrimitives; use reth_exex_types::ExExNotification; use reth_provider::Chain; use reth_testing_utils::generators::{ @@ -246,13 +246,11 @@ mod tests { use std::{collections::BTreeMap, sync::Arc}; fn read_notifications(wal: &Wal) -> WalResult> { - wal.inner.storage.files_range()?.map_or(Ok(Vec::new()), |range| { - wal.inner - .storage - .iter_notifications(range) - .map(|entry| entry.map(|(_, _, n)| n)) - .collect() - }) + wal.inner + .storage + .iter_notifications(wal.inner.storage.file_ids()?) + .map(|entry| entry.map(|(_, _, n)| n)) + .collect() } fn sort_committed_blocks( @@ -522,4 +520,44 @@ mod tests { Ok(()) } + + #[test] + fn test_finalize_with_sparse_file_ids() -> eyre::Result<()> { + let mut rng = generators::rng(); + + let temp_dir = tempfile::tempdir()?; + let wal = Wal::::new(&temp_dir)?; + + let blocks = random_block_range(&mut rng, 0..=5, BlockRangeParams::default()) + .into_iter() + .map(|block| block.try_recover()) + .collect::, _>>()?; + let chain = |range: std::ops::RangeInclusive| { + Arc::new(Chain::new(blocks[range].to_vec(), Default::default(), BTreeMap::new())) + }; + + let commit_to_four = ExExNotification::ChainCommitted { new: chain(1..=4) }; + let revert_to_two = ExExNotification::ChainReverted { old: chain(2..=4) }; + let commit_two = ExExNotification::ChainCommitted { new: chain(2..=2) }; + let commit_to_five = ExExNotification::ChainCommitted { new: chain(3..=5) }; + + wal.commit(&commit_to_four)?; + wal.commit(&revert_to_two)?; + wal.commit(&commit_two)?; + wal.commit(&commit_to_five)?; + assert_eq!(wal.inner.storage.file_ids()?, vec![0, 1, 2, 3]); + + // File 2 has a lower maximum block than the surrounding notifications, so finalizing it + // leaves a gap in the file ID sequence. + wal.finalize((blocks[2].number, blocks[2].hash()).into())?; + assert_eq!(wal.inner.storage.file_ids()?, vec![0, 1, 3]); + + let wal = Wal::::new(&temp_dir)?; + assert_eq!(read_notifications(&wal)?, vec![commit_to_four, revert_to_two, commit_to_five]); + + wal.commit(&commit_two)?; + assert_eq!(wal.inner.storage.file_ids()?, vec![0, 1, 3, 4]); + + Ok(()) + } } diff --git a/crates/exex/exex/src/wal/storage.rs b/crates/exex/exex/src/wal/storage.rs index 8c36e3f624d..45363130c23 100644 --- a/crates/exex/exex/src/wal/storage.rs +++ b/crates/exex/exex/src/wal/storage.rs @@ -1,6 +1,5 @@ use std::{ fs::File, - ops::RangeInclusive, path::{Path, PathBuf}, }; @@ -69,12 +68,9 @@ where } } - /// Returns the range of file IDs in the storage. - /// - /// If there are no files in the storage, returns `None`. - pub(super) fn files_range(&self) -> WalResult>> { - let mut min_id = None; - let mut max_id = None; + /// Returns the file IDs in the storage in ascending order. + pub(super) fn file_ids(&self) -> WalResult> { + let mut file_ids = Vec::new(); for entry in reth_fs_util::read_dir(&self.path)? { let entry = entry.map_err(|err| WalError::DirEntry(self.path.clone(), err))?; @@ -82,13 +78,12 @@ where if entry.path().extension() == Some(FILE_EXTENSION.as_ref()) { let file_name = entry.file_name(); let file_id = Self::parse_filename(&file_name.to_string_lossy())?; - - min_id = min_id.map_or(Some(file_id), |min_id: u32| Some(min_id.min(file_id))); - max_id = max_id.map_or(Some(file_id), |max_id: u32| Some(max_id.max(file_id))); + file_ids.push(file_id); } } - Ok(min_id.zip(max_id).map(|(min_id, max_id)| min_id..=max_id)) + file_ids.sort_unstable(); + Ok(file_ids) } /// Removes notifications from the storage according to the given list of file IDs. @@ -113,11 +108,11 @@ where Ok((deleted_total, deleted_size)) } - pub(super) fn iter_notifications( - &self, - range: RangeInclusive, - ) -> impl Iterator)>> + '_ { - range.map(move |id| { + pub(super) fn iter_notifications<'a>( + &'a self, + file_ids: impl IntoIterator + 'a, + ) -> impl Iterator)>> + 'a { + file_ids.into_iter().map(move |id| { let (notification, size) = self.read_notification(id)?.ok_or(WalError::FileNotFound(id))?; @@ -316,21 +311,20 @@ mod tests { } #[test] - fn test_files_range() -> eyre::Result<()> { + fn test_file_ids() -> eyre::Result<()> { let temp_dir = tempfile::tempdir()?; let storage: Storage = Storage::new(&temp_dir)?; // Create WAL files File::create(storage.file_path(1))?; - File::create(storage.file_path(2))?; File::create(storage.file_path(3))?; // Create non-WAL files that should be ignored File::create(temp_dir.path().join("0.tmp"))?; File::create(temp_dir.path().join("4.tmp"))?; - // Check files range - assert_eq!(storage.files_range()?, Some(1..=3)); + // Check existing file IDs are returned in order without filling the gap + assert_eq!(storage.file_ids()?, vec![1, 3]); Ok(()) } From f4b39f98108aa684c079cf073240bbe2798d2618 Mon Sep 17 00:00:00 2001 From: Emma Jamieson-Hoare Date: Wed, 2 Sep 2026 11:34:11 +0100 Subject: [PATCH 10/14] chore: bump version --- Cargo.lock | 228 +++++++++++++++++++-------------------- Cargo.toml | 62 ++++++++--- docs/vocs/vocs.config.ts | 2 +- 3 files changed, 162 insertions(+), 130 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 00bed560e7d..016f891a405 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3269,7 +3269,7 @@ dependencies = [ [[package]] name = "ef-test-runner" -version = "2.5.1" +version = "2.5.2" dependencies = [ "clap", "ef-tests", @@ -3277,7 +3277,7 @@ dependencies = [ [[package]] name = "ef-tests" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-consensus", "alloy-eips", @@ -3730,7 +3730,7 @@ dependencies = [ [[package]] name = "example-full-contract-state" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-primitives", "eyre", @@ -3848,7 +3848,7 @@ dependencies = [ [[package]] name = "exex-subscription" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-primitives", "clap", @@ -7661,7 +7661,7 @@ checksum = "1e061d1b48cb8d38042de4ae0a7a6401009d6143dc80d2e2d6f31f0bdd6470c7" [[package]] name = "reth" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-node-bindings", "alloy-primitives", @@ -7711,7 +7711,7 @@ dependencies = [ [[package]] name = "reth-basic-payload-builder" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-consensus", "alloy-eips", @@ -7737,7 +7737,7 @@ dependencies = [ [[package]] name = "reth-bb" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-consensus", "alloy-eips", @@ -7784,7 +7784,7 @@ dependencies = [ [[package]] name = "reth-chain-state" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-consensus", "alloy-eips", @@ -7815,7 +7815,7 @@ dependencies = [ [[package]] name = "reth-chainspec" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-chains", "alloy-consensus", @@ -7835,7 +7835,7 @@ dependencies = [ [[package]] name = "reth-cli" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-genesis", "clap", @@ -7847,7 +7847,7 @@ dependencies = [ [[package]] name = "reth-cli-commands" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-chains", "alloy-consensus", @@ -7937,7 +7937,7 @@ dependencies = [ [[package]] name = "reth-cli-runner" -version = "2.5.1" +version = "2.5.2" dependencies = [ "reth-tasks", "tokio", @@ -7946,7 +7946,7 @@ dependencies = [ [[package]] name = "reth-cli-util" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-eips", "alloy-primitives", @@ -8000,7 +8000,7 @@ dependencies = [ [[package]] name = "reth-config" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-primitives", "eyre", @@ -8018,7 +8018,7 @@ dependencies = [ [[package]] name = "reth-consensus" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-consensus", "alloy-eip7928", @@ -8031,7 +8031,7 @@ dependencies = [ [[package]] name = "reth-consensus-common" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-consensus", "alloy-eips", @@ -8045,7 +8045,7 @@ dependencies = [ [[package]] name = "reth-consensus-debug-client" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-consensus", "alloy-eips", @@ -8069,7 +8069,7 @@ dependencies = [ [[package]] name = "reth-db" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-consensus", "alloy-primitives", @@ -8105,7 +8105,7 @@ dependencies = [ [[package]] name = "reth-db-api" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-consensus", "alloy-primitives", @@ -8133,7 +8133,7 @@ dependencies = [ [[package]] name = "reth-db-common" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-consensus", "alloy-genesis", @@ -8164,7 +8164,7 @@ dependencies = [ [[package]] name = "reth-db-models" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-eips", "alloy-primitives", @@ -8180,7 +8180,7 @@ dependencies = [ [[package]] name = "reth-discv4" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -8206,7 +8206,7 @@ dependencies = [ [[package]] name = "reth-discv5" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -8231,7 +8231,7 @@ dependencies = [ [[package]] name = "reth-dns-discovery" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-chains", "alloy-primitives", @@ -8259,7 +8259,7 @@ dependencies = [ [[package]] name = "reth-downloaders" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-consensus", "alloy-eips", @@ -8297,7 +8297,7 @@ dependencies = [ [[package]] name = "reth-e2e-test-utils" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-consensus", "alloy-eips", @@ -8353,7 +8353,7 @@ dependencies = [ [[package]] name = "reth-ecies" -version = "2.5.1" +version = "2.5.2" dependencies = [ "aes", "alloy-primitives", @@ -8379,7 +8379,7 @@ dependencies = [ [[package]] name = "reth-engine-local" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-consensus", "alloy-primitives", @@ -8401,7 +8401,7 @@ dependencies = [ [[package]] name = "reth-engine-primitives" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-consensus", "alloy-eips", @@ -8427,7 +8427,7 @@ dependencies = [ [[package]] name = "reth-engine-tree" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-consensus", "alloy-eip7928", @@ -8497,7 +8497,7 @@ dependencies = [ [[package]] name = "reth-engine-util" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-consensus", "alloy-primitives", @@ -8526,7 +8526,7 @@ dependencies = [ [[package]] name = "reth-era" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-consensus", "alloy-eips", @@ -8551,7 +8551,7 @@ dependencies = [ [[package]] name = "reth-era-downloader" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-primitives", "bytes", @@ -8569,7 +8569,7 @@ dependencies = [ [[package]] name = "reth-era-utils" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-consensus", "alloy-primitives", @@ -8600,7 +8600,7 @@ dependencies = [ [[package]] name = "reth-errors" -version = "2.5.1" +version = "2.5.2" dependencies = [ "reth-consensus", "reth-execution-errors", @@ -8610,7 +8610,7 @@ dependencies = [ [[package]] name = "reth-eth-wire" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-chains", "alloy-consensus", @@ -8648,7 +8648,7 @@ dependencies = [ [[package]] name = "reth-eth-wire-types" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-chains", "alloy-consensus", @@ -8676,7 +8676,7 @@ dependencies = [ [[package]] name = "reth-ethereum" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-rpc-types-engine", "alloy-rpc-types-eth", @@ -8716,7 +8716,7 @@ dependencies = [ [[package]] name = "reth-ethereum-cli" -version = "2.5.1" +version = "2.5.2" dependencies = [ "clap", "eyre", @@ -8739,7 +8739,7 @@ dependencies = [ [[package]] name = "reth-ethereum-consensus" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-consensus", "alloy-eips", @@ -8755,7 +8755,7 @@ dependencies = [ [[package]] name = "reth-ethereum-engine-primitives" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-eips", "alloy-primitives", @@ -8771,7 +8771,7 @@ dependencies = [ [[package]] name = "reth-ethereum-forks" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-eip2124", "alloy-hardforks 0.4.7", @@ -8784,7 +8784,7 @@ dependencies = [ [[package]] name = "reth-ethereum-payload-builder" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-consensus", "alloy-eips", @@ -8813,7 +8813,7 @@ dependencies = [ [[package]] name = "reth-ethereum-primitives" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-consensus", "alloy-eips", @@ -8834,7 +8834,7 @@ dependencies = [ [[package]] name = "reth-etl" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-primitives", "rayon", @@ -8844,7 +8844,7 @@ dependencies = [ [[package]] name = "reth-evm" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-consensus", "alloy-eip7928", @@ -8870,7 +8870,7 @@ dependencies = [ [[package]] name = "reth-evm-ethereum" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-consensus", "alloy-eips", @@ -8895,7 +8895,7 @@ dependencies = [ [[package]] name = "reth-execution-cache" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-primitives", "fixed-cache", @@ -8913,7 +8913,7 @@ dependencies = [ [[package]] name = "reth-execution-errors" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-evm", "alloy-primitives", @@ -8925,7 +8925,7 @@ dependencies = [ [[package]] name = "reth-execution-types" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-consensus", "alloy-eips", @@ -8946,7 +8946,7 @@ dependencies = [ [[package]] name = "reth-exex" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-consensus", "alloy-eips", @@ -8991,7 +8991,7 @@ dependencies = [ [[package]] name = "reth-exex-test-utils" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-eips", "eyre", @@ -9022,7 +9022,7 @@ dependencies = [ [[package]] name = "reth-exex-types" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-eips", "alloy-primitives", @@ -9039,7 +9039,7 @@ dependencies = [ [[package]] name = "reth-fs-util" -version = "2.5.1" +version = "2.5.2" dependencies = [ "serde", "serde_json", @@ -9048,7 +9048,7 @@ dependencies = [ [[package]] name = "reth-invalid-block-hooks" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-consensus", "alloy-eips", @@ -9079,7 +9079,7 @@ dependencies = [ [[package]] name = "reth-ipc" -version = "2.5.1" +version = "2.5.2" dependencies = [ "bytes", "futures", @@ -9101,7 +9101,7 @@ dependencies = [ [[package]] name = "reth-libmdbx" -version = "2.5.1" +version = "2.5.2" dependencies = [ "bitflags 2.13.0", "byteorder", @@ -9118,7 +9118,7 @@ dependencies = [ [[package]] name = "reth-mdbx-sys" -version = "2.5.1" +version = "2.5.2" dependencies = [ "bindgen", "cc", @@ -9126,7 +9126,7 @@ dependencies = [ [[package]] name = "reth-metrics" -version = "2.5.1" +version = "2.5.2" dependencies = [ "futures", "libc", @@ -9139,7 +9139,7 @@ dependencies = [ [[package]] name = "reth-net-banlist" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-primitives", "ipnet", @@ -9147,7 +9147,7 @@ dependencies = [ [[package]] name = "reth-net-nat" -version = "2.5.1" +version = "2.5.2" dependencies = [ "futures-util", "if-addrs", @@ -9161,7 +9161,7 @@ dependencies = [ [[package]] name = "reth-network" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-consensus", "alloy-eip7928", @@ -9230,7 +9230,7 @@ dependencies = [ [[package]] name = "reth-network-api" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-consensus", "alloy-primitives", @@ -9254,7 +9254,7 @@ dependencies = [ [[package]] name = "reth-network-p2p" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-consensus", "alloy-eip7928", @@ -9278,7 +9278,7 @@ dependencies = [ [[package]] name = "reth-network-peers" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -9295,7 +9295,7 @@ dependencies = [ [[package]] name = "reth-network-types" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-eip2124", "humantime-serde", @@ -9308,7 +9308,7 @@ dependencies = [ [[package]] name = "reth-nippy-jar" -version = "2.5.1" +version = "2.5.2" dependencies = [ "anyhow", "bincode", @@ -9326,7 +9326,7 @@ dependencies = [ [[package]] name = "reth-node-api" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-rpc-types-engine", "eyre", @@ -9349,7 +9349,7 @@ dependencies = [ [[package]] name = "reth-node-builder" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-consensus", "alloy-eips", @@ -9420,7 +9420,7 @@ dependencies = [ [[package]] name = "reth-node-core" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-consensus", "alloy-eips", @@ -9476,7 +9476,7 @@ dependencies = [ [[package]] name = "reth-node-ethereum" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-consensus", "alloy-contract", @@ -9545,7 +9545,7 @@ dependencies = [ [[package]] name = "reth-node-ethstats" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-consensus", "alloy-primitives", @@ -9568,7 +9568,7 @@ dependencies = [ [[package]] name = "reth-node-events" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-consensus", "alloy-eips", @@ -9591,7 +9591,7 @@ dependencies = [ [[package]] name = "reth-node-metrics" -version = "2.5.1" +version = "2.5.2" dependencies = [ "bytes", "eyre", @@ -9620,7 +9620,7 @@ dependencies = [ [[package]] name = "reth-node-types" -version = "2.5.1" +version = "2.5.2" dependencies = [ "reth-chainspec", "reth-db-api", @@ -9631,7 +9631,7 @@ dependencies = [ [[package]] name = "reth-payload-builder" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-consensus", "alloy-primitives", @@ -9654,7 +9654,7 @@ dependencies = [ [[package]] name = "reth-payload-builder-primitives" -version = "2.5.1" +version = "2.5.2" dependencies = [ "pin-project", "reth-payload-primitives", @@ -9665,7 +9665,7 @@ dependencies = [ [[package]] name = "reth-payload-primitives" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-consensus", "alloy-eips", @@ -9689,7 +9689,7 @@ dependencies = [ [[package]] name = "reth-payload-util" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-consensus", "alloy-primitives", @@ -9698,7 +9698,7 @@ dependencies = [ [[package]] name = "reth-payload-validator" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-consensus", "alloy-rpc-types-engine", @@ -9740,7 +9740,7 @@ dependencies = [ [[package]] name = "reth-provider" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-consensus", "alloy-eip7928", @@ -9795,7 +9795,7 @@ dependencies = [ [[package]] name = "reth-prune" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-consensus", "alloy-primitives", @@ -9826,7 +9826,7 @@ dependencies = [ [[package]] name = "reth-prune-types" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-primitives", "arbitrary", @@ -9846,7 +9846,7 @@ dependencies = [ [[package]] name = "reth-revm" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-consensus", "alloy-primitives", @@ -9862,7 +9862,7 @@ dependencies = [ [[package]] name = "reth-rpc" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-consensus", "alloy-dyn-abi", @@ -9942,7 +9942,7 @@ dependencies = [ [[package]] name = "reth-rpc-api" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-eips", "alloy-genesis", @@ -9972,7 +9972,7 @@ dependencies = [ [[package]] name = "reth-rpc-builder" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-eips", "alloy-network", @@ -10030,7 +10030,7 @@ dependencies = [ [[package]] name = "reth-rpc-convert" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-consensus", "alloy-evm", @@ -10050,7 +10050,7 @@ dependencies = [ [[package]] name = "reth-rpc-e2e-tests" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-genesis", "alloy-rpc-types-engine", @@ -10070,7 +10070,7 @@ dependencies = [ [[package]] name = "reth-rpc-engine-api" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-eips", "alloy-primitives", @@ -10106,7 +10106,7 @@ dependencies = [ [[package]] name = "reth-rpc-eth-api" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-consensus", "alloy-dyn-abi", @@ -10152,7 +10152,7 @@ dependencies = [ [[package]] name = "reth-rpc-eth-types" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-chains", "alloy-consensus", @@ -10204,7 +10204,7 @@ dependencies = [ [[package]] name = "reth-rpc-layer" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-rpc-types-engine", "http", @@ -10221,7 +10221,7 @@ dependencies = [ [[package]] name = "reth-rpc-server-types" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-eips", "alloy-primitives", @@ -10251,7 +10251,7 @@ dependencies = [ [[package]] name = "reth-stages" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-consensus", "alloy-eips", @@ -10313,7 +10313,7 @@ dependencies = [ [[package]] name = "reth-stages-api" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-eips", "alloy-primitives", @@ -10347,7 +10347,7 @@ dependencies = [ [[package]] name = "reth-stages-types" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-primitives", "arbitrary", @@ -10363,7 +10363,7 @@ dependencies = [ [[package]] name = "reth-static-file" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-primitives", "assert_matches", @@ -10386,7 +10386,7 @@ dependencies = [ [[package]] name = "reth-static-file-types" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-primitives", "clap", @@ -10404,7 +10404,7 @@ dependencies = [ [[package]] name = "reth-storage-api" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-consensus", "alloy-eip7928", @@ -10431,7 +10431,7 @@ dependencies = [ [[package]] name = "reth-storage-errors" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-eips", "alloy-primitives", @@ -10447,7 +10447,7 @@ dependencies = [ [[package]] name = "reth-storage-overlay" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-consensus", "alloy-eips", @@ -10476,7 +10476,7 @@ dependencies = [ [[package]] name = "reth-storage-rpc-provider" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-consensus", "alloy-eips", @@ -10505,7 +10505,7 @@ dependencies = [ [[package]] name = "reth-tasks" -version = "2.5.1" +version = "2.5.2" dependencies = [ "crossbeam-utils", "dashmap", @@ -10525,7 +10525,7 @@ dependencies = [ [[package]] name = "reth-testing-utils" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-consensus", "alloy-eips", @@ -10541,7 +10541,7 @@ dependencies = [ [[package]] name = "reth-tokio-util" -version = "2.5.1" +version = "2.5.2" dependencies = [ "tokio", "tokio-stream", @@ -10550,7 +10550,7 @@ dependencies = [ [[package]] name = "reth-tracing" -version = "2.5.1" +version = "2.5.2" dependencies = [ "clap", "eyre", @@ -10569,7 +10569,7 @@ dependencies = [ [[package]] name = "reth-tracing-otlp" -version = "2.5.1" +version = "2.5.2" dependencies = [ "base64 0.22.1", "clap", @@ -10587,7 +10587,7 @@ dependencies = [ [[package]] name = "reth-transaction-pool" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-consensus", "alloy-eips", @@ -10638,7 +10638,7 @@ dependencies = [ [[package]] name = "reth-trie" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-consensus", "alloy-eips", @@ -10670,7 +10670,7 @@ dependencies = [ [[package]] name = "reth-trie-common" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-consensus", "alloy-eips", @@ -10702,7 +10702,7 @@ dependencies = [ [[package]] name = "reth-trie-db" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-consensus", "alloy-primitives", @@ -10729,7 +10729,7 @@ dependencies = [ [[package]] name = "reth-trie-parallel" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-evm", "alloy-primitives", @@ -10757,7 +10757,7 @@ dependencies = [ [[package]] name = "reth-trie-sparse" -version = "2.5.1" +version = "2.5.2" dependencies = [ "alloy-primitives", "alloy-rlp", diff --git a/Cargo.toml b/Cargo.toml index a54d01ac3fd..16277f885a0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [workspace.package] -version = "2.5.1" +version = "2.5.2" edition = "2024" rust-version = "1.95" license = "MIT OR Apache-2.0" @@ -432,19 +432,27 @@ reth-zstd-compressors = { version = "0.6.0", default-features = false } # revm revm = { version = "42.0.1", default-features = false } -revmc = { git = "https://github.com/paradigmxyz/revmc", branch = "main", default-features = false, features = ["llvm-prefer-static"] } +revmc = { git = "https://github.com/paradigmxyz/revmc", branch = "main", default-features = false, features = [ + "llvm-prefer-static", +] } revm-inspectors = "0.42.0" # eth alloy-dyn-abi = "1.6.1" -alloy-primitives = { version = "1.6.1", default-features = false, features = ["map-foldhash"] } +alloy-primitives = { version = "1.6.1", default-features = false, features = [ + "map-foldhash", +] } alloy-sol-types = { version = "1.6.1", default-features = false } alloy-chains = { version = "0.2.33", default-features = false } alloy-eip2124 = { version = "0.2.0", default-features = false } -alloy-eip7928 = { version = "0.4.5", default-features = false, features = ["rlp"] } +alloy-eip7928 = { version = "0.4.5", default-features = false, features = [ + "rlp", +] } alloy-evm = { version = "0.38.0", default-features = false } -alloy-rlp = { version = "0.3.16", default-features = false, features = ["core-net"] } +alloy-rlp = { version = "0.3.16", default-features = false, features = [ + "core-net", +] } alloy-trie = { version = "0.9.4", default-features = false } alloy-hardforks = "0.4.7" @@ -457,10 +465,15 @@ alloy-json-rpc = { version = "2.3.0", default-features = false } alloy-network = { version = "2.3.0", default-features = false } alloy-network-primitives = { version = "2.3.0", default-features = false } alloy-node-bindings = "2.3.0" -alloy-provider = { version = "2.3.0", features = ["reqwest", "debug-api"], default-features = false } +alloy-provider = { version = "2.3.0", features = [ + "reqwest", + "debug-api", +], default-features = false } alloy-pubsub = { version = "2.3.0", default-features = false } alloy-rpc-client = { version = "2.3.0", default-features = false } -alloy-rpc-types = { version = "2.3.0", features = ["eth"], default-features = false } +alloy-rpc-types = { version = "2.3.0", features = [ + "eth", +], default-features = false } alloy-rpc-types-admin = { version = "2.3.0", default-features = false } alloy-rpc-types-anvil = { version = "2.3.0", default-features = false } alloy-rpc-types-beacon = { version = "2.3.0", default-features = false } @@ -474,7 +487,9 @@ alloy-serde = { version = "2.3.0", default-features = false } alloy-signer = { version = "2.3.0", default-features = false } alloy-signer-local = { version = "2.3.0", default-features = false } alloy-transport = { version = "2.3.0" } -alloy-transport-http = { version = "2.3.0", features = ["reqwest-rustls-tls"], default-features = false } +alloy-transport-http = { version = "2.3.0", features = [ + "reqwest-rustls-tls", +], default-features = false } alloy-transport-ipc = { version = "2.3.0", default-features = false } alloy-transport-ws = { version = "2.3.0", default-features = false } @@ -483,7 +498,10 @@ either = { version = "1.16.0", default-features = false } arrayvec = { version = "0.7.6", default-features = false } aquamarine = "0.6" auto_impl = "1" -backon = { version = "1.2", default-features = false, features = ["std-blocking-sleep", "tokio-sleep"] } +backon = { version = "1.2", default-features = false, features = [ + "std-blocking-sleep", + "tokio-sleep", +] } bincode = "1.3" bitflags = "2.4" boyer-moore-magiclen = "0.2.16" @@ -508,9 +526,13 @@ linked_hash_set = "0.1" libc = "0.2" lz4 = "1.28.1" modular-bitfield = "0.13.1" -notify = { version = "8.0.0", default-features = false, features = ["macos_fsevent"] } +notify = { version = "8.0.0", default-features = false, features = [ + "macos_fsevent", +] } nybbles = { version = "0.4.8", default-features = false } -once_cell = { version = "1.19", default-features = false, features = ["critical-section"] } +once_cell = { version = "1.19", default-features = false, features = [ + "critical-section", +] } parking_lot = "0.12" quanta = "0.12" paste = "1.0" @@ -531,12 +553,16 @@ strum_macros = "0.27" syn = "2.0" thiserror = { version = "2.0.0", default-features = false } tar = "0.4.46" -tracing = { version = "0.1.0", default-features = false, features = ["attributes"] } +tracing = { version = "0.1.0", default-features = false, features = [ + "attributes", +] } tracing-appender = "0.2.5" url = { version = "2.3", default-features = false } zstd = "0.13" byteorder = "1" -fixed-cache = { version = "0.1.10", default-features = false, features = ["alloc"] } +fixed-cache = { version = "0.1.10", default-features = false, features = [ + "alloc", +] } moka = "0.12" tar-no-std = { version = "0.4.2", default-features = false } miniz_oxide = { version = "0.9.0", default-features = false } @@ -569,7 +595,10 @@ futures-util = { version = "0.3", default-features = false } hyper = "1.9" hyper-util = "0.1.5" pin-project = "1.1.12" -reqwest = { version = "0.13", default-features = false, features = ["rustls", "stream"] } +reqwest = { version = "0.13", default-features = false, features = [ + "rustls", + "stream", +] } tracing-futures = "0.2" tower = "0.5" tower-http = "0.6" @@ -594,7 +623,10 @@ proptest-arbitrary-interop = "0.1.0" # crypto enr = { version = "0.13", default-features = false } k256 = { version = "0.13", default-features = false, features = ["ecdsa"] } -secp256k1 = { version = "0.30", default-features = false, features = ["global-context", "recovery"] } +secp256k1 = { version = "0.30", default-features = false, features = [ + "global-context", + "recovery", +] } # rand 8 for secp256k1 rand_08 = { package = "rand", version = "0.8" } diff --git a/docs/vocs/vocs.config.ts b/docs/vocs/vocs.config.ts index 941f6e83ed6..6aa891ac973 100644 --- a/docs/vocs/vocs.config.ts +++ b/docs/vocs/vocs.config.ts @@ -23,7 +23,7 @@ export default defineConfig({ { text: 'Rustdocs', link: '/docs' }, { text: 'GitHub', link: 'https://github.com/paradigmxyz/reth' }, { - text: 'v2.5.1', + text: 'v2.5.2', items: [ { text: 'Releases', From 5a6940e351fed80458fe6c9da8581cbe4b8bd036 Mon Sep 17 00:00:00 2001 From: Emma Jamieson-Hoare Date: Wed, 2 Sep 2026 11:35:39 +0100 Subject: [PATCH 11/14] chore: formatting --- Cargo.toml | 60 +++++++++++++----------------------------------------- 1 file changed, 14 insertions(+), 46 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 16277f885a0..d6d61f1b3e4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -432,27 +432,19 @@ reth-zstd-compressors = { version = "0.6.0", default-features = false } # revm revm = { version = "42.0.1", default-features = false } -revmc = { git = "https://github.com/paradigmxyz/revmc", branch = "main", default-features = false, features = [ - "llvm-prefer-static", -] } +revmc = { git = "https://github.com/paradigmxyz/revmc", branch = "main", default-features = false, features = ["llvm-prefer-static"] } revm-inspectors = "0.42.0" # eth alloy-dyn-abi = "1.6.1" -alloy-primitives = { version = "1.6.1", default-features = false, features = [ - "map-foldhash", -] } +alloy-primitives = { version = "1.6.1", default-features = false, features = ["map-foldhash"] } alloy-sol-types = { version = "1.6.1", default-features = false } alloy-chains = { version = "0.2.33", default-features = false } alloy-eip2124 = { version = "0.2.0", default-features = false } -alloy-eip7928 = { version = "0.4.5", default-features = false, features = [ - "rlp", -] } +alloy-eip7928 = { version = "0.4.5", default-features = false, features = ["rlp"] } alloy-evm = { version = "0.38.0", default-features = false } -alloy-rlp = { version = "0.3.16", default-features = false, features = [ - "core-net", -] } +alloy-rlp = { version = "0.3.16", default-features = false, features = ["core-net"] } alloy-trie = { version = "0.9.4", default-features = false } alloy-hardforks = "0.4.7" @@ -465,15 +457,10 @@ alloy-json-rpc = { version = "2.3.0", default-features = false } alloy-network = { version = "2.3.0", default-features = false } alloy-network-primitives = { version = "2.3.0", default-features = false } alloy-node-bindings = "2.3.0" -alloy-provider = { version = "2.3.0", features = [ - "reqwest", - "debug-api", -], default-features = false } +alloy-provider = { version = "2.3.0", features = ["reqwest", "debug-api"], default-features = false } alloy-pubsub = { version = "2.3.0", default-features = false } alloy-rpc-client = { version = "2.3.0", default-features = false } -alloy-rpc-types = { version = "2.3.0", features = [ - "eth", -], default-features = false } +alloy-rpc-types = { version = "2.3.0", features = ["eth"], default-features = false } alloy-rpc-types-admin = { version = "2.3.0", default-features = false } alloy-rpc-types-anvil = { version = "2.3.0", default-features = false } alloy-rpc-types-beacon = { version = "2.3.0", default-features = false } @@ -487,9 +474,7 @@ alloy-serde = { version = "2.3.0", default-features = false } alloy-signer = { version = "2.3.0", default-features = false } alloy-signer-local = { version = "2.3.0", default-features = false } alloy-transport = { version = "2.3.0" } -alloy-transport-http = { version = "2.3.0", features = [ - "reqwest-rustls-tls", -], default-features = false } +alloy-transport-http = { version = "2.3.0", features = ["reqwest-rustls-tls"], default-features = false } alloy-transport-ipc = { version = "2.3.0", default-features = false } alloy-transport-ws = { version = "2.3.0", default-features = false } @@ -498,10 +483,7 @@ either = { version = "1.16.0", default-features = false } arrayvec = { version = "0.7.6", default-features = false } aquamarine = "0.6" auto_impl = "1" -backon = { version = "1.2", default-features = false, features = [ - "std-blocking-sleep", - "tokio-sleep", -] } +backon = { version = "1.2", default-features = false, features = ["std-blocking-sleep", "tokio-sleep"] } bincode = "1.3" bitflags = "2.4" boyer-moore-magiclen = "0.2.16" @@ -526,13 +508,9 @@ linked_hash_set = "0.1" libc = "0.2" lz4 = "1.28.1" modular-bitfield = "0.13.1" -notify = { version = "8.0.0", default-features = false, features = [ - "macos_fsevent", -] } +notify = { version = "8.0.0", default-features = false, features = ["macos_fsevent"] } nybbles = { version = "0.4.8", default-features = false } -once_cell = { version = "1.19", default-features = false, features = [ - "critical-section", -] } +once_cell = { version = "1.19", default-features = false, features = ["critical-section"] } parking_lot = "0.12" quanta = "0.12" paste = "1.0" @@ -553,16 +531,12 @@ strum_macros = "0.27" syn = "2.0" thiserror = { version = "2.0.0", default-features = false } tar = "0.4.46" -tracing = { version = "0.1.0", default-features = false, features = [ - "attributes", -] } +tracing = { version = "0.1.0", default-features = false, features = ["attributes"] } tracing-appender = "0.2.5" url = { version = "2.3", default-features = false } zstd = "0.13" byteorder = "1" -fixed-cache = { version = "0.1.10", default-features = false, features = [ - "alloc", -] } +fixed-cache = { version = "0.1.10", default-features = false, features = ["alloc"] } moka = "0.12" tar-no-std = { version = "0.4.2", default-features = false } miniz_oxide = { version = "0.9.0", default-features = false } @@ -595,10 +569,7 @@ futures-util = { version = "0.3", default-features = false } hyper = "1.9" hyper-util = "0.1.5" pin-project = "1.1.12" -reqwest = { version = "0.13", default-features = false, features = [ - "rustls", - "stream", -] } +reqwest = { version = "0.13", default-features = false, features = ["rustls", "stream"] } tracing-futures = "0.2" tower = "0.5" tower-http = "0.6" @@ -623,10 +594,7 @@ proptest-arbitrary-interop = "0.1.0" # crypto enr = { version = "0.13", default-features = false } k256 = { version = "0.13", default-features = false, features = ["ecdsa"] } -secp256k1 = { version = "0.30", default-features = false, features = [ - "global-context", - "recovery", -] } +secp256k1 = { version = "0.30", default-features = false, features = ["global-context", "recovery"] } # rand 8 for secp256k1 rand_08 = { package = "rand", version = "0.8" } From 0eff4827c27c8489fb1d39610ff3c8c06ee20495 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Fri, 14 Aug 2026 15:57:51 +0000 Subject: [PATCH 12/14] fix(engine): keep messages responsive during pending handoff (#26708) (cherry picked from commit 90ea46d0665408804e5fa24c6f05e06c09b232bb) --- crates/engine/tree/src/tree/mod.rs | 23 ++++++++++------ crates/engine/tree/src/tree/tests.rs | 39 ++++++++++------------------ 2 files changed, 29 insertions(+), 33 deletions(-) diff --git a/crates/engine/tree/src/tree/mod.rs b/crates/engine/tree/src/tree/mod.rs index f0bb957fb3f..2995071a77e 100644 --- a/crates/engine/tree/src/tree/mod.rs +++ b/crates/engine/tree/src/tree/mod.rs @@ -710,17 +710,24 @@ where /// Blocks until the next event that can safely be processed is ready. /// - /// A pending persisted handoff only accepts the notification that all active payload builds - /// have finished. This keeps queued engine messages from starting replacement payload jobs - /// before the handoff can reclaim the in-memory overlay. Otherwise, uses biased selection to - /// prioritize persistence completion to update in-memory state and unblock further writes. + /// A pending persisted handoff keeps processing engine messages while prioritizing the + /// notification that all active payload builds have finished. This keeps the engine responsive + /// without reclaiming the in-memory overlay while a payload job may still access it. Otherwise, + /// uses biased selection to prioritize persistence completion to update in-memory state and + /// unblock further writes. fn wait_for_event(&mut self) -> LoopEvent { if self.pending_persisted_handoff.is_some() { self.metrics.engine.backpressure_active.set(0.0); - return match self.payload_build_finished.recv() { - Ok(()) => LoopEvent::PayloadBuildFinished, - Err(_) => LoopEvent::Disconnected, - }; + return crossbeam_channel::select_biased! { + recv(self.payload_build_finished) -> result => match result { + Ok(()) => LoopEvent::PayloadBuildFinished, + Err(_) => LoopEvent::Disconnected, + }, + recv(self.incoming) -> msg => match msg { + Ok(m) => LoopEvent::EngineMessage(m), + Err(_) => LoopEvent::Disconnected, + }, + } } // Take ownership of persistence rx if present diff --git a/crates/engine/tree/src/tree/tests.rs b/crates/engine/tree/src/tree/tests.rs index 53cbf1d4e5f..c2e517db218 100644 --- a/crates/engine/tree/src/tree/tests.rs +++ b/crates/engine/tree/src/tree/tests.rs @@ -709,7 +709,7 @@ fn persistence_handoff_waits_for_active_payload_jobs() { } #[test] -fn pending_persisted_handoff_blocks_engine_messages_until_payload_build_finishes() { +fn pending_persisted_handoff_keeps_engine_messages_responsive() { let blocks: Vec<_> = TestBlockBuilder::eth().get_executed_blocks(1..4).collect(); let mut test_harness = TestHarness::with_config( MAINNET.clone(), @@ -732,34 +732,23 @@ fn pending_persisted_handoff_blocks_engine_messages_until_payload_build_finishes .unwrap(); assert!(test_harness.tree.pending_persisted_handoff.is_some()); - // Forkchoice updates received while the handoff is pending could start replacement payload - // builds and keep the final completion notification from reaching the tree. Queue a generic - // engine message to prove the gate leaves every message upstream until then. + // Engine messages remain processable while the handoff waits for the active payload build. test_harness.to_tree_tx.send(FromEngine::Event(FromOrchestrator::BackfillSyncStarted)).unwrap(); + assert_matches!( + test_harness.tree.wait_for_event(), + super::LoopEvent::EngineMessage(FromEngine::Event(FromOrchestrator::BackfillSyncStarted)) + ); + assert!(test_harness.tree.pending_persisted_handoff.is_some()); + assert!(test_harness.tree.state.tree_state.contains_hash(&persisted.hash)); - let (started_tx, started_rx) = std::sync::mpsc::sync_channel(0); - let (event_tx, event_rx) = std::sync::mpsc::sync_channel(1); - std::thread::scope(|scope| { - let tree = &mut test_harness.tree; - scope.spawn(move || { - started_tx.send(()).unwrap(); - event_tx - .send(matches!(tree.wait_for_event(), super::LoopEvent::PayloadBuildFinished)) - .unwrap(); - }); - - started_rx.recv().unwrap(); - assert!( - event_rx.recv_timeout(Duration::from_millis(100)).is_err(), - "a pending handoff must prevent queued engine messages from being processed" - ); - - drop(payload_build); - assert_eq!(event_rx.recv_timeout(Duration::from_secs(1)), Ok(true)); - }); - + // Once the final lease drops, its completion is prioritized over queued engine messages so the + // handoff gets the first opportunity to reclaim the overlay. + test_harness.to_tree_tx.send(FromEngine::Event(FromOrchestrator::BackfillSyncStarted)).unwrap(); + drop(payload_build); + assert_matches!(test_harness.tree.wait_for_event(), super::LoopEvent::PayloadBuildFinished); test_harness.tree.on_payload_build_finished().unwrap(); assert!(test_harness.tree.pending_persisted_handoff.is_none()); + assert!(!test_harness.tree.state.tree_state.contains_hash(&persisted.hash)); assert_matches!( test_harness.tree.wait_for_event(), super::LoopEvent::EngineMessage(FromEngine::Event(FromOrchestrator::BackfillSyncStarted)) From 0fbe428518594611bdd3fdd822eb5968823c8e66 Mon Sep 17 00:00:00 2001 From: Sebastian Stammler Date: Tue, 15 Sep 2026 15:59:19 +0200 Subject: [PATCH 13/14] ci: run fork validation through CircleCI act Squash the fork CI support from 04e73b7c2bdc8dcf3c1e8961c8d04b861bc15a8e and push-event support from b0d194cad81ddf9dcb954ecee95b22cc2d68b70b into one replayable maintenance commit. Preserve release action pins and advisory policy when resolving the replay. Select the book build job without entering Pages deployment. Refresh the standalone lockfile to patched h2 and rustls releases instead of suppressing RUSTSEC-2026-0258 and RUSTSEC-2026-0285; rustls requires the updated AWS-LC backend. Co-authored-by: Josh Klopfenstein Co-authored-by: falcorocks <14293929+falcorocks@users.noreply.github.com> Maintenance CI: Compare optimism push vectors against v2.5.2, retaining actual PR and merge-queue bases.: --- .circleci/config.yml | 209 ++++++++++++++++++++++++++++++ .circleci/prepare-act-event.sh | 102 +++++++++++++++ .github/scripts/check_rv32imac.sh | 2 +- .github/scripts/check_wasm.sh | 2 +- .github/workflows/book.yml | 2 + .github/workflows/compact.yml | 10 +- .github/workflows/e2e.yml | 4 + .github/workflows/integration.yml | 4 + .github/workflows/lint.yml | 20 ++- .github/workflows/stage.yml | 2 + .github/workflows/unit.yml | 6 + Cargo.lock | 21 +-- 12 files changed, 368 insertions(+), 16 deletions(-) create mode 100644 .circleci/config.yml create mode 100755 .circleci/prepare-act-event.sh diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 00000000000..d308228d379 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,209 @@ +version: 2.1 + +# Runs this fork's validation workflows through pinned act because GitHub Actions is disabled. +# Pull requests and branch pushes run the PR checks; merge queues add stage.yml. Event metadata is +# generated once per CircleCI revision and shared by all shards. +# +# The read-only GitHub token is exposed to PR code, so its CircleCI context must remain +# restricted to trusted contributors. Keep CircleCI auto-cancellation enabled. +# +# The act binary, checksum, and runner image are pinned. Compiler caches are no-ops because +# act's local cache is not reusable across these machines; Pages plumbing is skipped after the +# validation build. Lint and unit jobs are distributed; other workflows run up to four jobs. +# +# Excluded: pr-title.yml, label-pr.yml, and the privileged cyclops-audit.yml integration. + +jobs: + prepare-act-event: + machine: + image: ubuntu-2404:2025.09.1 + resource_class: medium + steps: + - checkout + - run: + name: Snapshot GitHub event + command: | + mkdir -p /tmp/act-event + if ! .circleci/prepare-act-event.sh; then + echo "GitHub event preparation failed; act shards will report the failure" | + tee /tmp/act-event/failed + fi + - persist_to_workspace: + root: /tmp/act-event + paths: + - . + + act: + parameters: + wf: + type: string + job: + type: string + default: "" + concurrent_jobs: + type: integer + default: 4 + machine: + image: ubuntu-2404:2025.09.1 + resource_class: xlarge + steps: + - checkout + - attach_workspace: + at: /tmp/act-event + - run: + name: Check event snapshot + command: | + if [ -f /tmp/act-event/failed ]; then + cat /tmp/act-event/failed >&2 + exit 1 + fi + - run: + name: Install pinned act + command: | + set -euo pipefail + readonly ACT_VERSION="0.2.89-action-cache-fix.1" + readonly ACT_RELEASE="v0.2.89-action-cache-fix.4" + readonly ACT_BINARY="act_Linux_x86_64" + readonly ACT_SHA256="28bfcf1502f59a834b14f2fb23c39e5b253c2234d875592b5aa0a175f9674dce" + curl --fail --silent --show-error --location \ + "https://github.com/ethereum-optimism/act/releases/download/${ACT_RELEASE}/${ACT_BINARY}" \ + --output "/tmp/${ACT_BINARY}" + echo "${ACT_SHA256} /tmp/${ACT_BINARY}" | sha256sum --check + sudo install -m 0755 "/tmp/${ACT_BINARY}" /usr/local/bin/act + test "$(act --version)" = "act version ${ACT_VERSION}" + - run: + name: Stub unsupported non-check actions + command: | + mkdir -p /tmp/noop-action + printf '%s\n' \ + 'name: noop' \ + 'description: disabled service plumbing under act' \ + 'inputs:' \ + ' cache-on-failure: {required: false}' \ + ' cache-targets: {required: false}' \ + 'runs:' \ + ' using: composite' \ + ' steps:' \ + ' - run: echo "Service plumbing disabled under act"' \ + ' shell: bash' \ + > /tmp/noop-action/action.yml + - run: + name: Run << parameters.wf >> via act + no_output_timeout: 45m + command: | + set -euo pipefail + event_path=/tmp/act-event/github-event.json + event_name="$(jq -er 'if .pull_request then "pull_request" elif .merge_group then "merge_group" elif .ref and .after then "push" else error("unsupported event") end' "$event_path")" + base_ref="$(jq -r '(.pull_request.base.ref // .merge_group.base_ref // "") | sub("^refs/heads/"; "")' "$event_path")" + target_job="<< parameters.job >>" + # Validate documentation without entering Pages deployment on branch pushes. + if [ "<< parameters.wf >>" = "book.yml" ]; then + target_job=build + fi + act_job=() + if [ -n "$target_job" ]; then + case "$target_job" in + crate-checks-*) + partition="${target_job#crate-checks-}" + if [[ ! "$partition" =~ ^[1-9][0-9]*$ ]]; then + echo "invalid crate-checks partition: $partition" >&2 + exit 1 + fi + act_job=(-j crate-checks --matrix "partition:${partition}") + ;; + *) + act_job=(-j "$target_job") + ;; + esac + fi + + act_env=(--env "RUSTC_WRAPPER=" --env "GITHUB_BASE_REF=${base_ref}") + if [ "<< parameters.wf >>" = "unit.yml" ] && [ "$target_job" = "state" ]; then + # EF tests use Rayon internally, so unrestricted nextest processes multiply + # runnable threads and starve valid_blocks past its upstream timeout. + act_env+=(--env "NEXTEST_TEST_THREADS=2") + fi + if [ "$event_name" != "pull_request" ]; then + act_env+=( + --env "GITHUB_REF=refs/heads/${CIRCLE_BRANCH}" + --env "GITHUB_SHA=${CIRCLE_SHA1}" + ) + fi + + act "$event_name" -W ".github/workflows/<< parameters.wf >>" \ + "${act_job[@]}" \ + --eventpath "$event_path" \ + -P "ubuntu-latest=catthehacker/ubuntu@sha256:b839c14c4410998529ec18f951262bdf87a2b23bc1467304d07b491b9455e074" \ + --concurrent-jobs << parameters.concurrent_jobs >> \ + "${act_env[@]}" \ + -s GITHUB_TOKEN="${MISE_GITHUB_TOKEN:?missing restricted read-only GitHub token}" \ + --local-repository "mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696=/tmp/noop-action" \ + --local-repository "Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4=/tmp/noop-action" \ + --local-repository "actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d=/tmp/noop-action" \ + --local-repository "actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9=/tmp/noop-action" + +workflows: + reth-act: + jobs: + - prepare-act-event: + context: + - circleci-repo-readonly-authenticated-github-token + - act: + context: + - circleci-repo-readonly-authenticated-github-token + name: "act-<< matrix.wf >>" + requires: + - prepare-act-event + matrix: + parameters: + wf: + - book.yml + - compact.yml + - e2e.yml + - grafana.yml + - integration.yml + - lint-actions.yml + - stage.yml + - act: + wf: lint.yml + concurrent_jobs: 1 + context: + - circleci-repo-readonly-authenticated-github-token + name: "act-lint-<< matrix.job >>" + requires: + - prepare-act-event + matrix: + parameters: + job: + - clippy-binaries + - clippy + - wasm + - riscv + - crate-checks-1 + - crate-checks-2 + - crate-checks-3 + - msrv + - docs + - fmt + - udeps + - book + - typos + - check-toml + - grafana + - no-test-deps + - feature-propagation + - deny + - act: + wf: unit.yml + concurrent_jobs: 1 + context: + - circleci-repo-readonly-authenticated-github-token + name: "act-unit-<< matrix.job >>" + requires: + - prepare-act-event + matrix: + parameters: + job: + - test + - state + - doc diff --git a/.circleci/prepare-act-event.sh b/.circleci/prepare-act-event.sh new file mode 100755 index 00000000000..99cccb27f3c --- /dev/null +++ b/.circleci/prepare-act-event.sh @@ -0,0 +1,102 @@ +#!/usr/bin/env bash +set -euo pipefail + +readonly OUTPUT_DIR="${ACT_EVENT_OUTPUT_DIR:-/tmp/act-event}" +readonly EVENT_PATH="${OUTPUT_DIR}/github-event.json" + +mkdir -p "$OUTPUT_DIR" +rm -f "$EVENT_PATH" + +: "${CIRCLE_SHA1:?missing CircleCI revision}" +: "${CIRCLE_PROJECT_USERNAME:?missing CircleCI project owner}" +: "${CIRCLE_PROJECT_REPONAME:?missing CircleCI project repository}" + +repository="${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}" + +if [[ "${CIRCLE_BRANCH:-}" == gh-readonly-queue/* ]]; then + event_name="merge_group" +elif [[ -n "${CIRCLE_PULL_REQUEST:-}" ]]; then + event_name="pull_request" +else + event_name="push" +fi + +case "$event_name" in + pull_request) + : "${CIRCLE_PULL_REQUEST:?pull-request trigger must provide CIRCLE_PULL_REQUEST}" + pr_number="${CIRCLE_PULL_REQUEST##*/}" + if [[ ! "$pr_number" =~ ^[1-9][0-9]*$ ]]; then + echo "invalid pull-request URL: ${CIRCLE_PULL_REQUEST}" >&2 + exit 1 + fi + + pull_request_path="${OUTPUT_DIR}/pull-request.json" + curl --fail --silent --show-error --location \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${MISE_GITHUB_TOKEN:?missing restricted read-only GitHub token}" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + "https://api.github.com/repos/${repository}/pulls/${pr_number}" > "$pull_request_path" + + event_head_sha="$(jq -er '.head.sha' "$pull_request_path")" + if [[ "$event_head_sha" != "$CIRCLE_SHA1" ]]; then + echo "PR head does not match CircleCI revision: ${CIRCLE_SHA1} != ${event_head_sha}" >&2 + exit 1 + fi + + jq '{ + action: "synchronize", + number: .number, + pull_request: ., + repository: .base.repo, + sender: .user + }' "$pull_request_path" > "$EVENT_PATH" + base_ref="$(jq -er '.base.ref | select(length > 0)' "$pull_request_path")" + head_ref="$(jq -er '.head.ref | select(length > 0)' "$pull_request_path")" + echo "act event: pull_request #${pr_number}, ${head_ref} -> ${base_ref}" + ;; + push) + : "${CIRCLE_BRANCH:?push trigger must provide CIRCLE_BRANCH}" + jq -n \ + --arg ref "refs/heads/${CIRCLE_BRANCH}" \ + --arg after "$CIRCLE_SHA1" \ + '{ref: $ref, after: $after}' > "$EVENT_PATH" + echo "act event: push ${CIRCLE_BRANCH} at ${CIRCLE_SHA1}" + ;; + merge_group) + : "${CIRCLE_BRANCH:?merge-queue trigger must provide CIRCLE_BRANCH}" + if [[ ! "$CIRCLE_BRANCH" =~ ^gh-readonly-queue/(.+)/pr-([1-9][0-9]*)-[^/]+$ ]]; then + echo "merge_group requires a gh-readonly-queue//pr-- branch, got: ${CIRCLE_BRANCH}" >&2 + exit 1 + fi + base_ref="${BASH_REMATCH[1]}" + + if ! base_sha="$(git rev-parse "${CIRCLE_SHA1}^1" 2>/dev/null)"; then + git fetch --no-tags --depth=2 origin "$CIRCLE_SHA1" + base_sha="$(git rev-parse "${CIRCLE_SHA1}^1")" + fi + + jq -n \ + --arg head_sha "$CIRCLE_SHA1" \ + --arg head_ref "refs/heads/${CIRCLE_BRANCH}" \ + --arg base_sha "$base_sha" \ + --arg base_ref "refs/heads/${base_ref}" \ + --arg repository "$repository" \ + --arg repository_name "$CIRCLE_PROJECT_REPONAME" \ + --arg repository_owner "$CIRCLE_PROJECT_USERNAME" \ + '{ + action: "checks_requested", + merge_group: { + head_sha: $head_sha, + head_ref: $head_ref, + base_sha: $base_sha, + base_ref: $base_ref + }, + repository: { + full_name: $repository, + name: $repository_name, + owner: {login: $repository_owner} + } + }' > "$EVENT_PATH" + echo "act event: merge_group ${CIRCLE_BRANCH} -> ${base_ref} at ${base_sha}" + ;; +esac diff --git a/.github/scripts/check_rv32imac.sh b/.github/scripts/check_rv32imac.sh index 4e477cdbed1..988a95a3309 100755 --- a/.github/scripts/check_rv32imac.sh +++ b/.github/scripts/check_rv32imac.sh @@ -32,7 +32,7 @@ trap 'rm -rf -- "$tmpdir"' EXIT INT TERM for crate in "${crates_to_check[@]}"; do outfile="$tmpdir/$crate.log" - if cargo +stable build -p "$crate" --target riscv32imac-unknown-none-elf --no-default-features --color never >"$outfile" 2>&1; then + if cargo build -p "$crate" --target riscv32imac-unknown-none-elf --no-default-features --color never >"$outfile" 2>&1; then echo "✅ $crate" else echo "❌ $crate" diff --git a/.github/scripts/check_wasm.sh b/.github/scripts/check_wasm.sh index 13bea47cfea..376b1fac7cf 100755 --- a/.github/scripts/check_wasm.sh +++ b/.github/scripts/check_wasm.sh @@ -109,7 +109,7 @@ for crate in "${crates[@]}"; do fi outfile="$tmpdir/$crate.log" - if cargo +stable build -p "$crate" --target wasm32-wasip1 --no-default-features --color never >"$outfile" 2>&1; then + if cargo build -p "$crate" --target wasm32-wasip1 --no-default-features --color never >"$outfile" 2>&1; then echo "✅ $crate" else echo "❌ $crate" diff --git a/.github/workflows/book.yml b/.github/workflows/book.yml index c8cea3e8832..707ff64874e 100644 --- a/.github/workflows/book.yml +++ b/.github/workflows/book.yml @@ -40,6 +40,8 @@ jobs: - name: Install Rust nightly uses: dtolnay/rust-toolchain@nightly + with: + toolchain: nightly-2026-07-14 - name: Build docs run: cd docs/vocs && bash scripts/build-cargo-docs.sh diff --git a/.github/workflows/compact.yml b/.github/workflows/compact.yml index 86f2592881a..80014d3793b 100644 --- a/.github/workflows/compact.yml +++ b/.github/workflows/compact.yml @@ -1,6 +1,6 @@ # Ensures that `Compact` codec changes are backwards compatible. # -# 1) checkout `main` +# 1) checkout the PR base, or the selected release for maintenance-branch pushes # 2) randomly generate and serialize to disk many different type vectors with `Compact` (eg. Header, Transaction, etc) # 3) checkout `pr` # 4) deserialize previously generated test vectors @@ -35,6 +35,8 @@ jobs: - uses: rui314/setup-mold@9c9c13bf4c3f1adef0cc596abc155580bcb04444 # v1 - run: .github/scripts/install_llvm.sh ubuntu - uses: dtolnay/rust-toolchain@stable + with: + toolchain: "1.97.0" - uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10 - uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1 with: @@ -42,9 +44,11 @@ jobs: - name: Checkout base uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: - ref: ${{ github.base_ref || 'main' }} + # Use v2.5.2's commit: the fork carries its history but does not mirror upstream tags. + # The maintenance branch must decode its release's data, not unreleased main formats. + ref: ${{ github.base_ref || (github.ref == 'refs/heads/optimism' && '5a6940e351fed80458fe6c9da8581cbe4b8bd036' || 'main') }} persist-credentials: false - # On `main` branch, generates test vectors and serializes them to disk using `Compact`. + # On the comparison base, generate test vectors and serialize them to disk using `Compact`. - name: Generate compact vectors run: | ${{ matrix.bin }} -- test-vectors compact --write diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 1abce78da42..bb1ca111517 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -35,6 +35,8 @@ jobs: - uses: rui314/setup-mold@9c9c13bf4c3f1adef0cc596abc155580bcb04444 # v1 - run: .github/scripts/install_llvm.sh ubuntu - uses: dtolnay/rust-toolchain@stable + with: + toolchain: "1.97.0" - uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10 - uses: taiki-e/install-action@41049aa56687c35e0afa74eed4f09cec4f9afabf # v2.85.2 with: @@ -70,6 +72,8 @@ jobs: - uses: rui314/setup-mold@9c9c13bf4c3f1adef0cc596abc155580bcb04444 # v1 - run: .github/scripts/install_llvm.sh ubuntu - uses: dtolnay/rust-toolchain@stable + with: + toolchain: "1.97.0" - uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10 - uses: taiki-e/install-action@41049aa56687c35e0afa74eed4f09cec4f9afabf # v2.85.2 with: diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 591bc31304e..9dde9163659 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -42,6 +42,8 @@ jobs: - uses: rui314/setup-mold@9c9c13bf4c3f1adef0cc596abc155580bcb04444 # v1 - run: .github/scripts/install_llvm.sh ubuntu - uses: dtolnay/rust-toolchain@stable + with: + toolchain: "1.97.0" - name: Install Geth run: .github/scripts/install_geth.sh - uses: taiki-e/install-action@41049aa56687c35e0afa74eed4f09cec4f9afabf # v2.85.2 @@ -85,6 +87,8 @@ jobs: - uses: rui314/setup-mold@9c9c13bf4c3f1adef0cc596abc155580bcb04444 # v1 - run: .github/scripts/install_llvm.sh ubuntu - uses: dtolnay/rust-toolchain@stable + with: + toolchain: "1.97.0" - uses: taiki-e/install-action@41049aa56687c35e0afa74eed4f09cec4f9afabf # v2.85.2 with: tool: nextest diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 562185f766b..59626fb4442 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -33,6 +33,7 @@ jobs: - run: .github/scripts/install_llvm.sh ubuntu - uses: dtolnay/rust-toolchain@clippy with: + toolchain: nightly-2026-07-14 components: clippy - uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10 - uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1 @@ -61,6 +62,7 @@ jobs: - run: .github/scripts/install_llvm.sh ubuntu - uses: dtolnay/rust-toolchain@nightly with: + toolchain: nightly-2026-07-14 components: clippy - uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10 - uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1 @@ -80,8 +82,10 @@ jobs: with: persist-credentials: false - uses: rui314/setup-mold@9c9c13bf4c3f1adef0cc596abc155580bcb04444 # v1 + - run: .github/scripts/install_llvm.sh ubuntu - uses: dtolnay/rust-toolchain@stable with: + toolchain: "1.97.0" target: wasm32-wasip1 - uses: taiki-e/install-action@41049aa56687c35e0afa74eed4f09cec4f9afabf # v2.85.2 with: @@ -93,7 +97,7 @@ jobs: - uses: dcarbone/install-jq-action@4fcb5062d7ce9bc4382d1a352d19ba3ba2c317c1 # v4.0.1 - name: Run Wasm checks run: | - sudo apt update && sudo apt install gcc-multilib + sudo apt update && sudo apt install --yes gcc-multilib .github/scripts/check_wasm.sh riscv: @@ -108,6 +112,7 @@ jobs: - uses: rui314/setup-mold@9c9c13bf4c3f1adef0cc596abc155580bcb04444 # v1 - uses: dtolnay/rust-toolchain@stable with: + toolchain: "1.97.0" target: riscv32imac-unknown-none-elf - uses: taiki-e/install-action@41049aa56687c35e0afa74eed4f09cec4f9afabf # v2.85.2 with: @@ -137,6 +142,8 @@ jobs: - uses: rui314/setup-mold@9c9c13bf4c3f1adef0cc596abc155580bcb04444 # v1 - run: .github/scripts/install_llvm.sh ubuntu - uses: dtolnay/rust-toolchain@stable + with: + toolchain: "1.97.0" - uses: taiki-e/install-action@41049aa56687c35e0afa74eed4f09cec4f9afabf # v2.85.2 with: tool: cargo-hack @@ -182,6 +189,8 @@ jobs: - uses: rui314/setup-mold@9c9c13bf4c3f1adef0cc596abc155580bcb04444 # v1 - run: .github/scripts/install_llvm.sh ubuntu - uses: dtolnay/rust-toolchain@nightly + with: + toolchain: nightly-2026-07-14 - uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10 - uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1 with: @@ -205,6 +214,7 @@ jobs: - uses: rui314/setup-mold@9c9c13bf4c3f1adef0cc596abc155580bcb04444 # v1 - uses: dtolnay/rust-toolchain@nightly with: + toolchain: nightly-2026-07-14 components: rustfmt - uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10 - name: Run fmt @@ -223,6 +233,8 @@ jobs: - uses: rui314/setup-mold@9c9c13bf4c3f1adef0cc596abc155580bcb04444 # v1 - run: .github/scripts/install_llvm.sh ubuntu - uses: dtolnay/rust-toolchain@nightly + with: + toolchain: nightly-2026-07-14 - uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10 - uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1 with: @@ -245,6 +257,8 @@ jobs: - uses: rui314/setup-mold@9c9c13bf4c3f1adef0cc596abc155580bcb04444 # v1 - run: .github/scripts/install_llvm.sh ubuntu - uses: dtolnay/rust-toolchain@nightly + with: + toolchain: nightly-2026-07-14 - uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10 - uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1 with: @@ -307,6 +321,8 @@ jobs: persist-credentials: false - uses: rui314/setup-mold@9c9c13bf4c3f1adef0cc596abc155580bcb04444 # v1 - uses: dtolnay/rust-toolchain@stable + with: + toolchain: "1.97.0" - name: Ensure no arbitrary or proptest dependency on default build run: cargo tree --package reth -e=features,no-dev | grep -Eq "arbitrary|proptest" && exit 1 || exit 0 @@ -322,6 +338,8 @@ jobs: persist-credentials: false - run: .github/scripts/install_llvm.sh ubuntu - uses: dtolnay/rust-toolchain@stable + with: + toolchain: "1.97.0" - uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10 - uses: rui314/setup-mold@9c9c13bf4c3f1adef0cc596abc155580bcb04444 # v1 - uses: taiki-e/cache-cargo-install-action@417450f3c33ee20393705369577571770643d4c7 # v3.0.7 diff --git a/.github/workflows/stage.yml b/.github/workflows/stage.yml index 8d0e2bf9d04..5b5d5d9eddf 100644 --- a/.github/workflows/stage.yml +++ b/.github/workflows/stage.yml @@ -39,6 +39,8 @@ jobs: - uses: rui314/setup-mold@9c9c13bf4c3f1adef0cc596abc155580bcb04444 # v1 - run: .github/scripts/install_llvm.sh ubuntu - uses: dtolnay/rust-toolchain@stable + with: + toolchain: "1.97.0" - uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10 - uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1 with: diff --git a/.github/workflows/unit.yml b/.github/workflows/unit.yml index 74986cbb3b9..465747462c3 100644 --- a/.github/workflows/unit.yml +++ b/.github/workflows/unit.yml @@ -42,6 +42,8 @@ jobs: - uses: rui314/setup-mold@9c9c13bf4c3f1adef0cc596abc155580bcb04444 # v1 - run: .github/scripts/install_llvm.sh ubuntu - uses: dtolnay/rust-toolchain@stable + with: + toolchain: "1.97.0" - uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10 - uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1 with: @@ -97,6 +99,8 @@ jobs: - uses: rui314/setup-mold@9c9c13bf4c3f1adef0cc596abc155580bcb04444 # v1 - run: .github/scripts/install_llvm.sh ubuntu - uses: dtolnay/rust-toolchain@stable + with: + toolchain: "1.97.0" - uses: taiki-e/install-action@41049aa56687c35e0afa74eed4f09cec4f9afabf # v2.85.2 with: tool: nextest @@ -121,6 +125,8 @@ jobs: - uses: rui314/setup-mold@9c9c13bf4c3f1adef0cc596abc155580bcb04444 # v1 - run: .github/scripts/install_llvm.sh ubuntu - uses: dtolnay/rust-toolchain@stable + with: + toolchain: "1.97.0" - uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10 - uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1 with: diff --git a/Cargo.lock b/Cargo.lock index 016f891a405..f33ed1c6760 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1573,9 +1573,9 @@ checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" [[package]] name = "aws-lc-rs" -version = "1.16.3" +version = "1.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ec6fb3fe69024a75fa7e1bfb48aa6cf59706a101658ea01bfd33b2b248a038f" +checksum = "b281d307588d634de920874890732659e2e7672f72b5e10e81badc1a8a83621e" dependencies = [ "aws-lc-sys", "untrusted 0.7.1", @@ -1584,14 +1584,15 @@ dependencies = [ [[package]] name = "aws-lc-sys" -version = "0.40.0" +version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f50037ee5e1e41e7b8f9d161680a725bd1626cb6f8c7e901f91f942850852fe7" +checksum = "9bff6c3b54fad79a2e60b8102caf565819711497c1f5f092f49508e2f5c31b27" dependencies = [ "cc", "cmake", "dunce", "fs_extra", + "pkg-config", ] [[package]] @@ -4373,9 +4374,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.4.14" +version = "0.4.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "171fefbc92fe4a4de27e0698d6a5b392d6a0e333506bc49133760b3bcf948733" +checksum = "a9f37a958b41b3b19ee2707c06439c0e9e547e847223eb791ecb0cb821c65e27" dependencies = [ "atomic-waker", "bytes", @@ -11377,9 +11378,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.38" +version = "0.23.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69f9466fb2c14ea04357e91413efb882e2a6d4a406e625449bc0a5d360d53a21" +checksum = "0d41d731c7d2f962d1ccc364cec258de3c0e93b38c2fb3ba97ac74513048d634" dependencies = [ "aws-lc-rs", "log", @@ -11463,9 +11464,9 @@ checksum = "f87165f0995f63a9fbeea62b64d10b4d9d8e78ec6d7d51fb2125fda7bb36788f" [[package]] name = "rustls-webpki" -version = "0.103.13" +version = "0.103.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61c429a8649f110dddef65e2a5ad240f747e85f7758a6bccc7e5777bd33f756e" +checksum = "f3c3cf1d8b1e7d4927e2d154c3fcb02979afb9939629c62cd9048d4f07b60ac2" dependencies = [ "aws-lc-rs", "ring", From ca905873165fe5b49e1ed56e55dcd094c319c96d Mon Sep 17 00:00:00 2001 From: geoknee Date: Fri, 16 Oct 2026 12:39:26 +0100 Subject: [PATCH 14/14] fix(rpc): replay block transactions through the block executor The RPC helpers that replay a block's own transactions (debug_trace*, trace_*, eth_callMany/debug_traceCall at an index/debug_traceCallMany, debug_intermediateRoots, ots) ran them on a bare EVM. Per-transaction logic that lives in the block executor was skipped, so on OP Stack SDM blocks traces reported pre-refund gas and unsettled balances, and the intermediate roots never reached the header's state root. Prefix replays now go through `executor_for_block`, and traced transactions run on an executor built over the inspected EVM via `execute_transaction_without_commit`. alloy-evm's `TxTracer` is replaced by an executor loop with a local `TracingCtx` of the same public shape. Ref: ethereum-optimism/protocol-team#485 Co-Authored-By: Claude Opus 5.5 --- crates/rpc/rpc-eth-api/src/helpers/call.rs | 20 +- crates/rpc/rpc-eth-api/src/helpers/trace.rs | 217 +++++++++++++++----- crates/rpc/rpc/src/debug.rs | 51 ++--- 3 files changed, 201 insertions(+), 87 deletions(-) diff --git a/crates/rpc/rpc-eth-api/src/helpers/call.rs b/crates/rpc/rpc-eth-api/src/helpers/call.rs index 060d2365298..5b4842ce303 100644 --- a/crates/rpc/rpc-eth-api/src/helpers/call.rs +++ b/crates/rpc/rpc-eth-api/src/helpers/call.rs @@ -21,8 +21,10 @@ use futures::Future; use reth_chainspec::{ChainSpecProvider, EthChainSpec, EthereumHardforks}; use reth_errors::{ProviderError, RethError}; use reth_evm::{ - block::BlockExecutor, env::BlockEnvironment, execute::BlockBuilder, ConfigureEvm, Evm, - EvmEnvFor, EvmFor, HaltReasonFor, InspectorFor, TransactionEnvMut, TxEnvFor, + block::{BlockExecutor, TxResult}, + env::BlockEnvironment, + execute::BlockBuilder, + ConfigureEvm, Evm, EvmEnvFor, EvmFor, HaltReasonFor, InspectorFor, TransactionEnvMut, TxEnvFor, }; use reth_node_api::BlockBody; use reth_primitives_traits::Recovered; @@ -717,9 +719,10 @@ pub trait Call: executor.execute_transaction(block_tx).map_err(Self::Error::from_eth_err)?; } - let tx_env = RpcNodeCore::evm_config(&this).tx_env(tx); - - let res = executor.evm_mut().transact(tx_env).map_err(Self::Error::from_evm_err)?; + let res = executor + .execute_transaction_without_commit(tx) + .map_err(Self::Error::from_eth_err)? + .into_result(); drop(executor); f(tx_info, res, db) }) @@ -732,8 +735,11 @@ pub trait Call: /// /// This executes on a caller provided EVM, so the target transaction can then be run on the /// same EVM, keeping any block-scoped EVM state intact. The EVM's inspector configuration is - /// left untouched; see - /// [`Trace::inspect_transaction_in_block`] to replay without inspection and trace the target. + /// left untouched. + /// + /// This bypasses the block executor, so it misses any chain-specific per-transaction + /// settlement the executor applies. To replay a block's own transactions, use + /// [`Trace::replay_block_until`] or [`Trace::inspect_transaction_in_block`] instead. /// /// If the target index is greater than or equal to the iterator length, all transactions are /// replayed. diff --git a/crates/rpc/rpc-eth-api/src/helpers/trace.rs b/crates/rpc/rpc-eth-api/src/helpers/trace.rs index a2662147624..08fc7d3328a 100644 --- a/crates/rpc/rpc-eth-api/src/helpers/trace.rs +++ b/crates/rpc/rpc-eth-api/src/helpers/trace.rs @@ -8,13 +8,17 @@ use alloy_rpc_types_eth::{BlockId, TransactionInfo}; use futures::Future; use reth_errors::RethError; use reth_evm::{ - block::BlockExecutor, evm::EvmFactoryExt, tracing::TracingCtx, ConfigureEvm, Evm, EvmEnvFor, - EvmFor, HaltReasonFor, InspectorFor, IntoTxEnv, TxEnvFor, + block::{BlockExecutor, BlockExecutorFor, TxResult}, + ConfigureEvm, Evm, EvmEnvFor, EvmFor, HaltReasonFor, InspectorFor, IntoTxEnv, TxEnvFor, }; use reth_primitives_traits::{BlockBody, BlockTy, Recovered, RecoveredBlock}; -use reth_rpc_eth_types::cache::db::StateCacheDb; +use reth_rpc_eth_types::{cache::db::StateCacheDb, EthApiError}; use reth_storage_api::{ProviderBlock, ProviderTx}; -use revm::{context::Block, context_interface::result::ResultAndState}; +use revm::{ + context::Block, + context_interface::result::{ExecutionResult, ResultAndState}, + state::EvmState, +}; use revm_inspectors::tracing::{TracingInspector, TracingInspectorConfig}; use std::sync::Arc; @@ -98,7 +102,7 @@ pub trait Trace: LoadState> + Call { None => return Ok(None), Some(res) => res, }; - let (tx, tx_info) = transaction.split(); + let (_, tx_info) = transaction.split(); // we need to get the state of the parent block because we're essentially replaying the // block the transaction is included in @@ -113,7 +117,6 @@ pub trait Trace: LoadState> + Call { // returns transactions included in a block tx_info.index.expect("transaction_and_block only returns block transactions") as usize, - tx, )?; f(tx_info, inspector, res, db) }) @@ -124,8 +127,9 @@ pub trait Trace: LoadState> + Call { /// Replays all transactions before the target transaction index. /// - /// All transactions before the target transaction are executed and their changes are written to - /// the _runtime_ db ([`StateCacheDb`]). + /// The block's pre-execution changes and all transactions before the target transaction are + /// executed through the block executor, and their changes are written to the _runtime_ db + /// ([`StateCacheDb`]). /// /// If the target index is greater than or equal to the block's transaction count, all /// transactions are replayed. @@ -135,19 +139,25 @@ pub trait Trace: LoadState> + Call { block: &RecoveredBlock>, target_tx_index: usize, ) -> Result<(), Self::Error> { - self.apply_pre_execution_changes(block, db)?; + let mut executor = self + .evm_config() + .executor_for_block(db, block.sealed_block()) + .map_err(RethError::other) + .map_err(Self::Error::from_eth_err)?; + executor.apply_pre_execution_changes().map_err(Self::Error::from_eth_err)?; - let evm_env = self.evm_env_for_header(block.sealed_block().sealed_header())?; - let mut evm = self.evm_config().evm_with_env(db, evm_env); - self.replay_transactions_until_with_evm( - &mut evm, - block.transactions_recovered(), - target_tx_index, - ) + for tx in block.transactions_recovered().take(target_tx_index) { + executor.execute_transaction(tx).map_err(Self::Error::from_eth_err)?; + } + Ok(()) } /// Replays all transactions before the target transaction without inspection, then executes - /// the target transaction with the configured inspector, all on the given EVM. + /// the block's transaction at the target index with the configured inspector, all through the + /// same block executor. + /// + /// The returned [`ResultAndState`] is the executor's, so it includes any chain-specific + /// per-transaction settlement. It is not committed to `db`. #[expect(clippy::type_complexity)] fn inspect_transaction_in_block<'a>( &self, @@ -155,26 +165,68 @@ pub trait Trace: LoadState> + Call { db: &'a mut StateCacheDb, inspector: impl InspectorFor, target_tx_index: usize, - target_tx_env: impl IntoTxEnv>, ) -> Result<(ResultAndState>, EvmEnvFor), Self::Error> { - let block_txs = block.transactions_recovered(); - - self.apply_pre_execution_changes(block, db)?; - let evm_env = self.evm_env_for_header(block.sealed_block().sealed_header())?; - let mut evm = self.evm_config().evm_with_env_and_inspector(db, evm_env, inspector); - - evm.disable_inspector(); - self.replay_transactions_until_with_evm(&mut evm, block_txs, target_tx_index)?; - evm.enable_inspector(); + let mut executor = self.inspected_block_executor(block, db, evm_env.clone(), inspector)?; - let res = evm.transact(target_tx_env).map_err(Self::Error::from_evm_err)?; + let mut block_txs = block.transactions_recovered(); + for tx in block_txs.by_ref().take(target_tx_index) { + executor.execute_transaction(tx).map_err(Self::Error::from_eth_err)?; + } + let target_tx = block_txs.next().ok_or_else(|| { + Self::Error::from_eth_err(EthApiError::InvalidParams(format!( + "tx_index {target_tx_index} out of bounds for block with {} transactions", + block.transaction_count() + ))) + })?; - let (_, evm_env) = evm.finish(); + executor.evm_mut().enable_inspector(); + let res = executor + .execute_transaction_without_commit(target_tx) + .map_err(Self::Error::from_eth_err)? + .into_result(); Ok((res, evm_env)) } + /// Creates a block executor for `block` whose EVM runs the given inspector, and applies the + /// block's pre-execution changes. The inspector is left disabled. + /// + /// Block transactions must be replayed through the executor rather than its EVM: the executor + /// tracks the transaction's position in the block and applies chain-specific per-transaction + /// settlement, such as OP Stack SDM refunds, that a bare EVM replay misses. + #[expect(clippy::type_complexity)] + fn inspected_block_executor<'a, 'db, I>( + &'a self, + block: &'a RecoveredBlock>, + db: &'db mut StateCacheDb, + evm_env: EvmEnvFor, + inspector: I, + ) -> Result< + BlockExecutorFor< + 'a, + ::BlockExecutorFactory, + &'db mut StateCacheDb, + I, + >, + Self::Error, + > + where + I: InspectorFor, + { + let evm_config = self.evm_config(); + let ctx = evm_config + .context_for_block(block.sealed_block()) + .map_err(RethError::other) + .map_err(Self::Error::from_eth_err)?; + let mut evm = evm_config.evm_with_env_and_inspector(db, evm_env, inspector); + evm.disable_inspector(); + + let mut executor = evm_config.create_executor_with_state(evm, ctx); + executor.apply_pre_execution_changes().map_err(Self::Error::from_eth_err)?; + Ok(executor) + } + /// Executes all transactions of a block up to a given index. /// /// If a `highest_index` is given, this will only execute the first `highest_index` @@ -268,38 +320,64 @@ pub trait Trace: LoadState> + Call { let block_timestamp = evm_env.block_env.timestamp().saturating_to(); let base_fee = evm_env.block_env.basefee(); - this.apply_pre_execution_changes(&block, &mut db)?; - // prepare transactions, we do everything upfront to reduce time spent with open // state - let max_transactions = highest_index.map_or_else( - || block.body().transaction_count(), - |highest| { - // we need + 1 because the index is 0-based - highest as usize + 1 - }, - ); + let max_transactions = highest_index + .map_or_else( + || block.body().transaction_count(), + |highest| { + // we need + 1 because the index is 0-based + (highest as usize).saturating_add(1) + }, + ) + .min(block.body().transaction_count()); - let mut idx = 0; + let inspector = inspector_setup(); + let fused_inspector = inspector.clone(); + let mut executor = + this.inspected_block_executor(&block, &mut db, evm_env, inspector)?; + executor.evm_mut().enable_inspector(); - let results = this - .evm_config() - .evm_factory() - .create_tracer(&mut db, evm_env, inspector_setup()) - .try_trace_many(block.transactions_recovered().take(max_transactions), |ctx| { - let tx_info = TransactionInfo { - hash: Some(*ctx.tx.tx_hash()), - index: Some(idx), - block_hash: Some(block_hash), - block_number: Some(block_number), - block_timestamp: Some(block_timestamp), - base_fee: Some(base_fee), - }; - idx += 1; + let mut results = Vec::with_capacity(max_transactions); + let mut transactions = + block.transactions_recovered().take(max_transactions).enumerate().peekable(); + while let Some((idx, tx)) = transactions.next() { + let output = executor + .execute_transaction_without_commit(tx) + .map_err(Self::Error::from_eth_err)?; + let ResultAndState { result, state } = output.result(); - f(tx_info, ctx) - }) - .collect::>()?; + let tx_info = TransactionInfo { + hash: Some(*tx.tx_hash()), + index: Some(idx as u64), + block_hash: Some(block_hash), + block_number: Some(block_number), + block_timestamp: Some(block_timestamp), + base_fee: Some(base_fee), + }; + let mut was_fused = false; + let (db, inspector, _) = executor.evm_mut().components_mut(); + results.push(f( + tx_info, + TracingCtx { + tx, + result: result.clone(), + state, + inspector, + db, + fused_inspector: &fused_inspector, + was_fused: &mut was_fused, + }, + )?); + if !was_fused { + *executor.evm_mut().inspector_mut() = fused_inspector.clone(); + } + + // the state of the last traced transaction is not needed + if transactions.peek().is_some() { + executor.commit_transaction(output); + } + } Ok(Some(results)) }) @@ -404,3 +482,30 @@ pub trait Trace: LoadState> + Call { Ok(()) } } + +/// Context for one transaction of a block traced by [`Trace::trace_block_until_with_inspector`]. +#[derive(Debug)] +pub struct TracingCtx<'a, T, E: Evm> { + /// The transaction that was just executed. + pub tx: T, + /// Result of transaction execution. + pub result: ExecutionResult, + /// State changes after transaction. + pub state: &'a EvmState, + /// Inspector state after transaction. + pub inspector: &'a mut E::Inspector, + /// Database used when executing the transaction, _before_ committing the state changes. + pub db: &'a mut E::DB, + /// Inspector state before any transaction was executed. + fused_inspector: &'a E::Inspector, + /// Whether the inspector was already reset by [`TracingCtx::take_inspector`]. + was_fused: &'a mut bool, +} + +impl> TracingCtx<'_, T, E> { + /// Returns the inspector state of this transaction, resetting the inspector for the next one. + pub fn take_inspector(&mut self) -> E::Inspector { + *self.was_fused = true; + core::mem::replace(self.inspector, self.fused_inspector.clone()) + } +} diff --git a/crates/rpc/rpc/src/debug.rs b/crates/rpc/rpc/src/debug.rs index 9860eae2fc7..ff01b500508 100644 --- a/crates/rpc/rpc/src/debug.rs +++ b/crates/rpc/rpc/src/debug.rs @@ -19,7 +19,11 @@ use parking_lot::RwLock; use reth_chainspec::{ChainSpecProvider, EthChainSpec, EthereumHardforks}; use reth_engine_primitives::ConsensusEngineEvent; use reth_errors::RethError; -use reth_evm::{block::BlockExecutor, execute::Executor, ConfigureEvm, EvmEnvFor}; +use reth_evm::{ + block::{BlockExecutor, TxResult}, + execute::Executor, + ConfigureEvm, EvmEnvFor, +}; use reth_primitives_traits::{ Block as BlockTrait, BlockBody, BlockTy, ReceiptWithBloom, RecoveredBlock, }; @@ -28,7 +32,7 @@ use reth_rpc_api::DebugApiServer; use reth_rpc_convert::RpcTxReq; use reth_rpc_eth_api::{ helpers::{EthTransactions, TraceExt}, - FromEthApiError, FromEvmError, RpcConvert, RpcNodeCore, + FromEthApiError, RpcConvert, RpcNodeCore, }; use reth_rpc_eth_types::{EthApiError, StateCacheDb}; use reth_rpc_server_types::{result::internal_rpc_err, ToRpcResult}; @@ -122,20 +126,22 @@ where .spawn_with_state_at_block(block.parent_hash(), move |eth_api, mut db| { let mut results = Vec::with_capacity(block.body().transactions().len()); - eth_api.apply_pre_execution_changes(&block, &mut db)?; - let block_env = evm_env.block_env.clone(); - let mut transactions = block.transactions_recovered().enumerate().peekable(); let inspector = DebugInspector::new(opts).map_err(Eth::Error::from_eth_err)?; - let mut evm = - eth_api.evm_config().evm_with_env_and_inspector(&mut db, evm_env, inspector); + let mut executor = + eth_api.inspected_block_executor(&block, &mut db, evm_env, inspector)?; + executor.evm_mut().enable_inspector(); + + let mut transactions = block.transactions_recovered().enumerate().peekable(); while let Some((index, tx)) = transactions.next() { let tx_env = eth_api.evm_config().tx_env(tx); - let res = evm.transact(tx_env.clone()).map_err(Eth::Error::from_evm_err)?; + let output = executor + .execute_transaction_without_commit(tx) + .map_err(Eth::Error::from_eth_err)?; - let (db, inspector, _) = evm.components_mut(); + let (db, inspector, _) = executor.evm_mut().components_mut(); let result = inspector .get_result( Some(TransactionContext { @@ -145,7 +151,7 @@ where }), &tx_env, &block_env, - &res, + output.result(), db, ) .map_err(Eth::Error::from_eth_err)?; @@ -155,7 +161,7 @@ where inspector.fuse().map_err(Eth::Error::from_eth_err)?; // need to apply the state changes of this transaction before executing the // next transaction - db.commit(res.state) + executor.commit_transaction(output); } } @@ -243,13 +249,8 @@ where let mut inspector = DebugInspector::new(opts).map_err(Eth::Error::from_eth_err)?; let tx_env = eth_api.evm_config().tx_env(&tx); - let (res, evm_env) = eth_api.inspect_transaction_in_block( - &block, - &mut db, - &mut inspector, - index, - tx_env.clone(), - )?; + let (res, evm_env) = + eth_api.inspect_transaction_in_block(&block, &mut db, &mut inspector, index)?; let trace = inspector .get_result( @@ -704,22 +705,24 @@ where .recovered_block(block_hash.into()) .await? .ok_or(EthApiError::HeaderNotFound(block_hash.into()))?; - let evm_env = self.eth_api().evm_env_for_header(block.sealed_block().sealed_header())?; self.eth_api() .spawn_with_state_at_block(block.parent_hash(), move |eth_api, mut db| { // Enable transition tracking so that merge_transitions works db.transition_state = Some(Default::default()); - eth_api.apply_pre_execution_changes(&block, &mut db)?; + let mut executor = eth_api + .evm_config() + .executor_for_block(&mut db, block.sealed_block()) + .map_err(RethError::other) + .map_err(Eth::Error::from_eth_err)?; + executor.apply_pre_execution_changes().map_err(Eth::Error::from_eth_err)?; let mut roots = Vec::with_capacity(block.body().transactions().len()); - let mut evm = eth_api.evm_config().evm_with_env(&mut db, evm_env); for tx in block.transactions_recovered() { - let tx_env = eth_api.evm_config().tx_env(tx); - evm.transact_commit(tx_env).map_err(Eth::Error::from_evm_err)?; + executor.execute_transaction(tx).map_err(Eth::Error::from_eth_err)?; - let state = evm.db_mut(); + let state = executor.evm_mut().db_mut(); // Merge transitions into cumulative bundle_state state.merge_transitions(BundleRetention::PlainState); // Compute state root from the accumulated state changes