Compare commits

...

11 Commits
t4 ... push

Author SHA1 Message Date
Brian Picciano
d6324d63e2 chore: release 1.11.3 2026-03-12 12:34:39 +01:00
Brian Picciano
5f3ade1bfe fix(trie): Reset proof v2 calculator on error (#22781)
Co-authored-by: Amp <amp@ampcode.com>
2026-03-12 10:09:18 +00:00
Derek Cofausper
b053f6fafe cherry-pick: fix don't produce both updates and removals for trie nodes (#22507)
Co-Authored-By: Arsenii Kulikov <62447812+klkvr@users.noreply.github.com>
2026-03-12 02:30:25 +00:00
Derek Cofausper
2a58e7a077 cherry-pick: install rayon panic handler (37f5b3a)
Co-Authored-By: Arsenii Kulikov <62447812+klkvr@users.noreply.github.com>
2026-03-12 02:30:17 +00:00
Emma Jamieson-Hoare
793a3d5fb3 fix missing import 2026-03-10 11:44:07 +00:00
Emma Jamieson-Hoare
89ae1af694 chore: upgrade to 1.11.2 2026-03-10 10:48:03 +00:00
Alexey Shekhirin
9c33fb5d45 fix(engine): reset execution cache hash on clear (#22895)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 10:46:09 +00:00
Alexey Shekhirin
bef3d7b4d1 fix lockfile 2026-02-23 18:36:44 +00:00
Emma Jamieson-Hoare
e918c17af9 chore: release 1.11.1
Amp-Thread-ID: https://ampcode.com/threads/T-019c8ba4-fd85-736b-9d2d-e878d350a91b
Co-authored-by: Amp <amp@ampcode.com>
2026-02-23 18:02:14 +00:00
Arsenii Kulikov
fcc170d53c fix: properly reveal trie nodes (#22415) 2026-02-23 17:58:13 +00:00
Arsenii Kulikov
c685842ba2 fix: overlay preparation on tokio (#22492) 2026-02-23 17:57:51 +00:00
12 changed files with 422 additions and 196 deletions

View File

@@ -0,0 +1,5 @@
---
reth-trie-sparse: patch
---
Fixed a bug where trie nodes could appear in both `updated_nodes` and `removed_nodes` simultaneously by removing entries from `removed_nodes` when a node is inserted as updated.

View File

@@ -0,0 +1,5 @@
---
reth-trie: patch
---
Fixed a potential panic in `ProofCalculator` by clearing internal computation state (`branch_stack`, `child_stack`, `branch_path`, etc.) after errors, preventing stale state from causing `usize` underflow panics when the calculator is reused. Added a test verifying correct behavior after simulated mid-computation errors.

242
Cargo.lock generated
View File

@@ -3300,7 +3300,7 @@ dependencies = [
[[package]]
name = "ef-test-runner"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"clap",
"ef-tests",
@@ -3308,7 +3308,7 @@ dependencies = [
[[package]]
name = "ef-tests"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-consensus",
"alloy-eips",
@@ -3748,7 +3748,7 @@ dependencies = [
[[package]]
name = "example-full-contract-state"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-primitives",
"eyre",
@@ -3880,7 +3880,7 @@ dependencies = [
[[package]]
name = "exex-subscription"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-primitives",
"clap",
@@ -7532,7 +7532,7 @@ checksum = "1e061d1b48cb8d38042de4ae0a7a6401009d6143dc80d2e2d6f31f0bdd6470c7"
[[package]]
name = "reth"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-node-bindings",
"alloy-primitives",
@@ -7579,7 +7579,7 @@ dependencies = [
[[package]]
name = "reth-basic-payload-builder"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-consensus",
"alloy-eips",
@@ -7602,7 +7602,7 @@ dependencies = [
[[package]]
name = "reth-bench"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-consensus",
"alloy-eips",
@@ -7649,7 +7649,7 @@ dependencies = [
[[package]]
name = "reth-bench-compare"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-primitives",
"alloy-provider",
@@ -7677,7 +7677,7 @@ dependencies = [
[[package]]
name = "reth-chain-state"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-consensus",
"alloy-eips",
@@ -7710,7 +7710,7 @@ dependencies = [
[[package]]
name = "reth-chainspec"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-chains",
"alloy-consensus",
@@ -7730,7 +7730,7 @@ dependencies = [
[[package]]
name = "reth-cli"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-genesis",
"clap",
@@ -7743,7 +7743,7 @@ dependencies = [
[[package]]
name = "reth-cli-commands"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-chains",
"alloy-consensus",
@@ -7830,7 +7830,7 @@ dependencies = [
[[package]]
name = "reth-cli-runner"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"reth-tasks",
"tokio",
@@ -7839,7 +7839,7 @@ dependencies = [
[[package]]
name = "reth-cli-util"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-eips",
"alloy-primitives",
@@ -7860,7 +7860,7 @@ dependencies = [
[[package]]
name = "reth-codecs"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-consensus",
"alloy-eips",
@@ -7884,7 +7884,7 @@ dependencies = [
[[package]]
name = "reth-codecs-derive"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"proc-macro2",
"quote",
@@ -7894,7 +7894,7 @@ dependencies = [
[[package]]
name = "reth-config"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-primitives",
"eyre",
@@ -7912,7 +7912,7 @@ dependencies = [
[[package]]
name = "reth-consensus"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-consensus",
"alloy-primitives",
@@ -7924,7 +7924,7 @@ dependencies = [
[[package]]
name = "reth-consensus-common"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-consensus",
"alloy-eips",
@@ -7938,7 +7938,7 @@ dependencies = [
[[package]]
name = "reth-consensus-debug-client"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-consensus",
"alloy-eips",
@@ -7963,7 +7963,7 @@ dependencies = [
[[package]]
name = "reth-db"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-consensus",
"alloy-primitives",
@@ -7998,7 +7998,7 @@ dependencies = [
[[package]]
name = "reth-db-api"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-consensus",
"alloy-genesis",
@@ -8029,7 +8029,7 @@ dependencies = [
[[package]]
name = "reth-db-common"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-consensus",
"alloy-genesis",
@@ -8060,7 +8060,7 @@ dependencies = [
[[package]]
name = "reth-db-models"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-eips",
"alloy-primitives",
@@ -8076,7 +8076,7 @@ dependencies = [
[[package]]
name = "reth-discv4"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-primitives",
"alloy-rlp",
@@ -8102,7 +8102,7 @@ dependencies = [
[[package]]
name = "reth-discv5"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-primitives",
"alloy-rlp",
@@ -8127,7 +8127,7 @@ dependencies = [
[[package]]
name = "reth-dns-discovery"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-chains",
"alloy-primitives",
@@ -8155,7 +8155,7 @@ dependencies = [
[[package]]
name = "reth-downloaders"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-consensus",
"alloy-eips",
@@ -8193,7 +8193,7 @@ dependencies = [
[[package]]
name = "reth-e2e-test-utils"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-consensus",
"alloy-eips",
@@ -8250,7 +8250,7 @@ dependencies = [
[[package]]
name = "reth-ecies"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"aes",
"alloy-primitives",
@@ -8277,7 +8277,7 @@ dependencies = [
[[package]]
name = "reth-engine-local"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-consensus",
"alloy-primitives",
@@ -8300,7 +8300,7 @@ dependencies = [
[[package]]
name = "reth-engine-primitives"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-consensus",
"alloy-eips",
@@ -8324,7 +8324,7 @@ dependencies = [
[[package]]
name = "reth-engine-service"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-eips",
"futures",
@@ -8354,7 +8354,7 @@ dependencies = [
[[package]]
name = "reth-engine-tree"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-consensus",
"alloy-eip7928",
@@ -8427,7 +8427,7 @@ dependencies = [
[[package]]
name = "reth-engine-util"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-consensus",
"alloy-rpc-types-engine",
@@ -8454,7 +8454,7 @@ dependencies = [
[[package]]
name = "reth-era"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-consensus",
"alloy-eips",
@@ -8476,7 +8476,7 @@ dependencies = [
[[package]]
name = "reth-era-downloader"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-primitives",
"bytes",
@@ -8494,7 +8494,7 @@ dependencies = [
[[package]]
name = "reth-era-utils"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-consensus",
"alloy-primitives",
@@ -8520,7 +8520,7 @@ dependencies = [
[[package]]
name = "reth-errors"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"reth-consensus",
"reth-execution-errors",
@@ -8530,7 +8530,7 @@ dependencies = [
[[package]]
name = "reth-eth-wire"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-chains",
"alloy-consensus",
@@ -8568,7 +8568,7 @@ dependencies = [
[[package]]
name = "reth-eth-wire-types"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-chains",
"alloy-consensus",
@@ -8593,7 +8593,7 @@ dependencies = [
[[package]]
name = "reth-ethereum"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-rpc-types-engine",
"alloy-rpc-types-eth",
@@ -8633,7 +8633,7 @@ dependencies = [
[[package]]
name = "reth-ethereum-cli"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"clap",
"eyre",
@@ -8656,7 +8656,7 @@ dependencies = [
[[package]]
name = "reth-ethereum-consensus"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-consensus",
"alloy-eips",
@@ -8672,7 +8672,7 @@ dependencies = [
[[package]]
name = "reth-ethereum-engine-primitives"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-eips",
"alloy-primitives",
@@ -8690,7 +8690,7 @@ dependencies = [
[[package]]
name = "reth-ethereum-forks"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-eip2124",
"alloy-hardforks 0.4.7",
@@ -8703,7 +8703,7 @@ dependencies = [
[[package]]
name = "reth-ethereum-payload-builder"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-consensus",
"alloy-eips",
@@ -8731,7 +8731,7 @@ dependencies = [
[[package]]
name = "reth-ethereum-primitives"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-consensus",
"alloy-eips",
@@ -8758,7 +8758,7 @@ dependencies = [
[[package]]
name = "reth-etl"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-primitives",
"rayon",
@@ -8768,7 +8768,7 @@ dependencies = [
[[package]]
name = "reth-evm"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-consensus",
"alloy-eips",
@@ -8792,7 +8792,7 @@ dependencies = [
[[package]]
name = "reth-evm-ethereum"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-consensus",
"alloy-eips",
@@ -8816,7 +8816,7 @@ dependencies = [
[[package]]
name = "reth-execution-errors"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-evm",
"alloy-primitives",
@@ -8828,7 +8828,7 @@ dependencies = [
[[package]]
name = "reth-execution-types"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-consensus",
"alloy-eips",
@@ -8848,7 +8848,7 @@ dependencies = [
[[package]]
name = "reth-exex"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-consensus",
"alloy-eips",
@@ -8893,7 +8893,7 @@ dependencies = [
[[package]]
name = "reth-exex-test-utils"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-eips",
"eyre",
@@ -8924,7 +8924,7 @@ dependencies = [
[[package]]
name = "reth-exex-types"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-eips",
"alloy-primitives",
@@ -8941,7 +8941,7 @@ dependencies = [
[[package]]
name = "reth-fs-util"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"serde",
"serde_json",
@@ -8950,7 +8950,7 @@ dependencies = [
[[package]]
name = "reth-invalid-block-hooks"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-consensus",
"alloy-eips",
@@ -8983,7 +8983,7 @@ dependencies = [
[[package]]
name = "reth-ipc"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"bytes",
"futures",
@@ -9005,7 +9005,7 @@ dependencies = [
[[package]]
name = "reth-libmdbx"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"bitflags 2.10.0",
"byteorder",
@@ -9023,7 +9023,7 @@ dependencies = [
[[package]]
name = "reth-mdbx-sys"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"bindgen",
"cc",
@@ -9031,7 +9031,7 @@ dependencies = [
[[package]]
name = "reth-metrics"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"futures",
"metrics",
@@ -9042,7 +9042,7 @@ dependencies = [
[[package]]
name = "reth-net-banlist"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-primitives",
"ipnet",
@@ -9050,7 +9050,7 @@ dependencies = [
[[package]]
name = "reth-net-nat"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"futures-util",
"if-addrs",
@@ -9064,7 +9064,7 @@ dependencies = [
[[package]]
name = "reth-network"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-consensus",
"alloy-eips",
@@ -9126,7 +9126,7 @@ dependencies = [
[[package]]
name = "reth-network-api"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-consensus",
"alloy-primitives",
@@ -9150,7 +9150,7 @@ dependencies = [
[[package]]
name = "reth-network-p2p"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-consensus",
"alloy-eips",
@@ -9172,7 +9172,7 @@ dependencies = [
[[package]]
name = "reth-network-peers"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-primitives",
"alloy-rlp",
@@ -9189,7 +9189,7 @@ dependencies = [
[[package]]
name = "reth-network-types"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-eip2124",
"humantime-serde",
@@ -9202,7 +9202,7 @@ dependencies = [
[[package]]
name = "reth-nippy-jar"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"anyhow",
"bincode 1.3.3",
@@ -9220,7 +9220,7 @@ dependencies = [
[[package]]
name = "reth-node-api"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-rpc-types-engine",
"eyre",
@@ -9243,7 +9243,7 @@ dependencies = [
[[package]]
name = "reth-node-builder"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-consensus",
"alloy-eips",
@@ -9315,7 +9315,7 @@ dependencies = [
[[package]]
name = "reth-node-core"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-consensus",
"alloy-eips",
@@ -9371,7 +9371,7 @@ dependencies = [
[[package]]
name = "reth-node-ethereum"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-consensus",
"alloy-contract",
@@ -9431,7 +9431,7 @@ dependencies = [
[[package]]
name = "reth-node-ethstats"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-consensus",
"alloy-primitives",
@@ -9454,7 +9454,7 @@ dependencies = [
[[package]]
name = "reth-node-events"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-consensus",
"alloy-eips",
@@ -9477,7 +9477,7 @@ dependencies = [
[[package]]
name = "reth-node-metrics"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"bytes",
"eyre",
@@ -9506,7 +9506,7 @@ dependencies = [
[[package]]
name = "reth-node-types"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"reth-chainspec",
"reth-db-api",
@@ -9517,7 +9517,7 @@ dependencies = [
[[package]]
name = "reth-payload-builder"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-consensus",
"alloy-primitives",
@@ -9537,7 +9537,7 @@ dependencies = [
[[package]]
name = "reth-payload-builder-primitives"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"pin-project",
"reth-payload-primitives",
@@ -9548,7 +9548,7 @@ dependencies = [
[[package]]
name = "reth-payload-primitives"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-consensus",
"alloy-eips",
@@ -9571,7 +9571,7 @@ dependencies = [
[[package]]
name = "reth-payload-util"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-consensus",
"alloy-primitives",
@@ -9580,7 +9580,7 @@ dependencies = [
[[package]]
name = "reth-payload-validator"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-consensus",
"alloy-rpc-types-engine",
@@ -9589,7 +9589,7 @@ dependencies = [
[[package]]
name = "reth-primitives"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-consensus",
"alloy-eips",
@@ -9611,7 +9611,7 @@ dependencies = [
[[package]]
name = "reth-primitives-traits"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-consensus",
"alloy-eips",
@@ -9649,7 +9649,7 @@ dependencies = [
[[package]]
name = "reth-provider"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-consensus",
"alloy-eips",
@@ -9699,7 +9699,7 @@ dependencies = [
[[package]]
name = "reth-prune"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-consensus",
"alloy-eips",
@@ -9732,11 +9732,11 @@ dependencies = [
[[package]]
name = "reth-prune-db"
version = "1.11.0"
version = "1.11.3"
[[package]]
name = "reth-prune-types"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-primitives",
"arbitrary",
@@ -9756,7 +9756,7 @@ dependencies = [
[[package]]
name = "reth-revm"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-consensus",
"alloy-primitives",
@@ -9770,7 +9770,7 @@ dependencies = [
[[package]]
name = "reth-rpc"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-consensus",
"alloy-dyn-abi",
@@ -9850,7 +9850,7 @@ dependencies = [
[[package]]
name = "reth-rpc-api"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-eip7928",
"alloy-eips",
@@ -9880,7 +9880,7 @@ dependencies = [
[[package]]
name = "reth-rpc-api-testing-util"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-eips",
"alloy-primitives",
@@ -9899,7 +9899,7 @@ dependencies = [
[[package]]
name = "reth-rpc-builder"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-eips",
"alloy-network",
@@ -9955,7 +9955,7 @@ dependencies = [
[[package]]
name = "reth-rpc-convert"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-consensus",
"alloy-evm",
@@ -9979,7 +9979,7 @@ dependencies = [
[[package]]
name = "reth-rpc-e2e-tests"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-genesis",
"alloy-rpc-types-engine",
@@ -9999,7 +9999,7 @@ dependencies = [
[[package]]
name = "reth-rpc-engine-api"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-eips",
"alloy-primitives",
@@ -10035,7 +10035,7 @@ dependencies = [
[[package]]
name = "reth-rpc-eth-api"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-consensus",
"alloy-dyn-abi",
@@ -10078,7 +10078,7 @@ dependencies = [
[[package]]
name = "reth-rpc-eth-types"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-consensus",
"alloy-eips",
@@ -10126,7 +10126,7 @@ dependencies = [
[[package]]
name = "reth-rpc-layer"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-rpc-types-engine",
"http",
@@ -10143,7 +10143,7 @@ dependencies = [
[[package]]
name = "reth-rpc-server-types"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-eips",
"alloy-primitives",
@@ -10158,7 +10158,7 @@ dependencies = [
[[package]]
name = "reth-stages"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-consensus",
"alloy-eips",
@@ -10220,7 +10220,7 @@ dependencies = [
[[package]]
name = "reth-stages-api"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-eips",
"alloy-primitives",
@@ -10253,7 +10253,7 @@ dependencies = [
[[package]]
name = "reth-stages-types"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-primitives",
"arbitrary",
@@ -10269,7 +10269,7 @@ dependencies = [
[[package]]
name = "reth-static-file"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-primitives",
"assert_matches",
@@ -10292,7 +10292,7 @@ dependencies = [
[[package]]
name = "reth-static-file-types"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-primitives",
"clap",
@@ -10310,7 +10310,7 @@ dependencies = [
[[package]]
name = "reth-storage-api"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-consensus",
"alloy-eips",
@@ -10333,7 +10333,7 @@ dependencies = [
[[package]]
name = "reth-storage-errors"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-eips",
"alloy-primitives",
@@ -10349,7 +10349,7 @@ dependencies = [
[[package]]
name = "reth-storage-rpc-provider"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-consensus",
"alloy-eips",
@@ -10378,7 +10378,7 @@ dependencies = [
[[package]]
name = "reth-tasks"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"auto_impl",
"dyn-clone",
@@ -10395,7 +10395,7 @@ dependencies = [
[[package]]
name = "reth-testing-utils"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-consensus",
"alloy-eips",
@@ -10411,7 +10411,7 @@ dependencies = [
[[package]]
name = "reth-tokio-util"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"tokio",
"tokio-stream",
@@ -10420,7 +10420,7 @@ dependencies = [
[[package]]
name = "reth-tracing"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"clap",
"eyre",
@@ -10438,7 +10438,7 @@ dependencies = [
[[package]]
name = "reth-tracing-otlp"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"clap",
"eyre",
@@ -10455,7 +10455,7 @@ dependencies = [
[[package]]
name = "reth-transaction-pool"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-consensus",
"alloy-eips",
@@ -10506,7 +10506,7 @@ dependencies = [
[[package]]
name = "reth-trie"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-consensus",
"alloy-eips",
@@ -10540,7 +10540,7 @@ dependencies = [
[[package]]
name = "reth-trie-common"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-consensus",
"alloy-genesis",
@@ -10573,7 +10573,7 @@ dependencies = [
[[package]]
name = "reth-trie-db"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-consensus",
"alloy-primitives",
@@ -10604,7 +10604,7 @@ dependencies = [
[[package]]
name = "reth-trie-parallel"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-primitives",
"alloy-rlp",
@@ -10634,7 +10634,7 @@ dependencies = [
[[package]]
name = "reth-trie-sparse"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"alloy-primitives",
"alloy-rlp",
@@ -10665,7 +10665,7 @@ dependencies = [
[[package]]
name = "reth-zstd-compressors"
version = "1.11.0"
version = "1.11.3"
dependencies = [
"zstd",
]

View File

@@ -1,5 +1,5 @@
[workspace.package]
version = "1.11.0"
version = "1.11.3"
edition = "2024"
rust-version = "1.88"
license = "MIT OR Apache-2.0"
@@ -449,14 +449,18 @@ revm-inspectors = "0.34.2"
# eth
alloy-dyn-abi = "1.5.6"
alloy-primitives = { version = "1.5.6", default-features = false, features = ["map-foldhash"] }
alloy-primitives = { version = "1.5.6", default-features = false, features = [
"map-foldhash",
] }
alloy-sol-types = { version = "1.5.6", default-features = false }
alloy-chains = { version = "0.2.5", default-features = false }
alloy-eip2124 = { version = "0.2.0", default-features = false }
alloy-eip7928 = { version = "0.3.0", default-features = false }
alloy-evm = { version = "0.27.2", default-features = false }
alloy-rlp = { version = "0.3.13", default-features = false, features = ["core-net"] }
alloy-rlp = { version = "0.3.13", default-features = false, features = [
"core-net",
] }
alloy-trie = { version = "0.9.4", default-features = false }
alloy-hardforks = "0.4.5"
@@ -468,10 +472,15 @@ alloy-genesis = { version = "1.6.3", default-features = false }
alloy-json-rpc = { version = "1.6.3", default-features = false }
alloy-network = { version = "1.6.3", default-features = false }
alloy-network-primitives = { version = "1.6.3", default-features = false }
alloy-provider = { version = "1.6.3", features = ["reqwest", "debug-api"], default-features = false }
alloy-provider = { version = "1.6.3", features = [
"reqwest",
"debug-api",
], default-features = false }
alloy-pubsub = { version = "1.6.3", default-features = false }
alloy-rpc-client = { version = "1.6.3", default-features = false }
alloy-rpc-types = { version = "1.6.3", features = ["eth"], default-features = false }
alloy-rpc-types = { version = "1.6.3", features = [
"eth",
], default-features = false }
alloy-rpc-types-admin = { version = "1.6.3", default-features = false }
alloy-rpc-types-anvil = { version = "1.6.3", default-features = false }
alloy-rpc-types-beacon = { version = "1.6.3", default-features = false }
@@ -485,7 +494,9 @@ alloy-serde = { version = "1.6.3", default-features = false }
alloy-signer = { version = "1.6.3", default-features = false }
alloy-signer-local = { version = "1.6.3", default-features = false }
alloy-transport = { version = "1.6.3" }
alloy-transport-http = { version = "1.6.3", features = ["reqwest-rustls-tls"], default-features = false }
alloy-transport-http = { version = "1.6.3", features = [
"reqwest-rustls-tls",
], default-features = false }
alloy-transport-ipc = { version = "1.6.3", default-features = false }
alloy-transport-ws = { version = "1.6.3", default-features = false }
@@ -504,7 +515,10 @@ either = { version = "1.15.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,9 +540,13 @@ itertools = { version = "0.14", default-features = false }
linked_hash_set = "0.1"
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"
paste = "1.0"
rand = "0.9"
@@ -547,7 +565,9 @@ strum_macros = "0.27"
syn = "2.0"
thiserror = { version = "2.0.0", default-features = false }
tar = "0.4.44"
tracing = { version = "0.1.0", default-features = false, features = ["attributes"] }
tracing = { version = "0.1.0", default-features = false, features = [
"attributes",
] }
tracing-appender = "0.2"
url = { version = "2.3", default-features = false }
zstd = "0.13"
@@ -585,7 +605,11 @@ futures-util = { version = "0.3", default-features = false }
hyper = "1.3"
hyper-util = "0.1.5"
pin-project = "1.0.12"
reqwest = { version = "0.12", default-features = false, features = ["rustls-tls", "rustls-tls-native-roots", "stream"] }
reqwest = { version = "0.12", default-features = false, features = [
"rustls-tls",
"rustls-tls-native-roots",
"stream",
] }
tracing-futures = "0.2"
tower = "0.5"
tower-http = "0.6"
@@ -610,7 +634,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" }

View File

@@ -312,6 +312,11 @@ impl DeferredTrieData {
/// Given that invariant, circular wait dependencies are impossible.
#[instrument(level = "debug", target = "engine::tree::deferred_trie", skip_all)]
pub fn wait_cloned(&self) -> ComputedTrieData {
#[cfg(feature = "rayon")]
debug_assert!(
rayon::current_thread_index().is_none(),
"wait_cloned must not be called from a rayon worker thread"
);
let mut state = self.state.lock();
match &mut *state {
// If the deferred trie data is ready, return the cached result.

View File

@@ -845,8 +845,10 @@ impl SavedCache {
self.caches.update_metrics(&self.metrics);
}
/// Clears all caches, resetting them to empty state.
pub(crate) fn clear(&self) {
/// Clears all caches, resetting them to empty state,
/// and updates the hash of the block this cache belongs to.
pub(crate) fn clear_with_hash(&mut self, hash: B256) {
self.hash = hash;
self.caches.clear();
}
}

View File

@@ -1411,7 +1411,7 @@ where
// Spawn a background task to trigger computation so it's ready when the next payload
// arrives.
if let Some(overlay) = self.state.tree_state.prepare_canonical_overlay() {
rayon::spawn(move || {
tokio::task::spawn_blocking(move || {
let _ = overlay.get();
});
}

View File

@@ -50,7 +50,7 @@ use std::{
mpsc::{self, channel},
Arc,
},
time::Instant,
time::{Duration, Instant},
};
use tracing::{debug, debug_span, instrument, warn, Span};
@@ -444,8 +444,8 @@ where
let _ = execute_tx.send(tx);
next_for_execution += 1;
while let Some(entry) = queue.first_entry() &&
*entry.key() == next_for_execution
while let Some(entry) = queue.first_entry()
&& *entry.key() == next_for_execution
{
let _ = execute_tx.send(entry.remove());
next_for_execution += 1;
@@ -926,7 +926,7 @@ impl PayloadExecutionCache {
#[instrument(level = "debug", target = "engine::tree::payload_processor", skip(self))]
pub(crate) fn get_cache_for(&self, parent_hash: B256) -> Option<SavedCache> {
let start = Instant::now();
let cache = self.inner.read();
let mut cache = self.inner.write();
let elapsed = start.elapsed();
self.metrics.execution_cache_wait_duration.record(elapsed.as_secs_f64());
@@ -934,7 +934,7 @@ impl PayloadExecutionCache {
warn!(blocked_for=?elapsed, "Blocked waiting for execution cache mutex");
}
if let Some(c) = cache.as_ref() {
if let Some(c) = cache.as_mut() {
let cached_hash = c.executed_block_hash();
// Check that the cache hash matches the parent hash of the current block. It won't
// match in case it's a fork block.
@@ -955,13 +955,13 @@ impl PayloadExecutionCache {
);
if available {
// If the has is available (no other threads are using it), but has a mismatching
// parent hash, we can just clear it and keep using without re-creating from
// scratch.
if !hash_matches {
c.clear();
// Fork block: clear and update the hash on the ORIGINAL before cloning.
// This prevents the canonical chain from matching on the stale hash
// and picking up polluted data if the fork block fails.
c.clear_with_hash(parent_hash);
}
return Some(c.clone())
return Some(c.clone());
} else if hash_matches {
self.metrics.execution_cache_in_use.increment(1);
}
@@ -972,10 +972,25 @@ impl PayloadExecutionCache {
None
}
/// Clears the tracked cache
#[expect(unused)]
pub(crate) fn clear(&self) {
self.inner.write().take();
/// Waits until the execution cache becomes available for use.
///
/// This acquires a write lock to ensure exclusive access, then immediately releases it.
/// This is useful for synchronization before starting payload processing.
///
/// Returns the time spent waiting for the lock.
pub fn wait_for_availability(&self) -> Duration {
let start = Instant::now();
// Acquire write lock to wait for any current holders to finish
let _guard = self.inner.write();
let elapsed = start.elapsed();
if elapsed.as_millis() > 5 {
debug!(
target: "engine::tree::payload_processor",
blocked_for=?elapsed,
"Waited for execution cache to become available"
);
}
elapsed
}
/// Updates the cache with a closure that has exclusive access to the guard.
@@ -1128,10 +1143,18 @@ mod tests {
execution_cache.update_with_guard(|slot| *slot = Some(make_saved_cache(hash)));
// When the parent hash doesn't match, the cache is cleared and returned for reuse
// When the parent hash doesn't match (fork block), the cache is cleared,
// hash updated on the original, and clone returned for reuse
let different_hash = B256::from([4u8; 32]);
let cache = execution_cache.get_cache_for(different_hash);
assert!(cache.is_some(), "cache should be returned for reuse after clearing")
assert!(cache.is_some(), "cache should be returned for reuse after clearing");
drop(cache);
// The stored cache now has the fork block's parent hash.
// Canonical chain looking for original hash sees a mismatch → clears and reuses.
let original = execution_cache.get_cache_for(hash);
assert!(original.is_some(), "canonical chain gets cache back via mismatch+clear");
}
#[test]
@@ -1355,4 +1378,61 @@ mod tests {
"State root mismatch: task={root_from_task}, base={root_from_regular}"
);
}
/// Tests the full prewarm lifecycle for a fork block:
///
/// 1. Cache is at canonical block 4.
/// 2. Fork block (parent = block 2) checks out the cache via `get_cache_for`, simulating what
/// `PrewarmCacheTask` does when it receives a `SavedCache`.
/// 3. Prewarm populates the shared cache with fork-specific state.
/// 4. While the prewarm clone is alive, the cache is unavailable (`usage_guard` > 1).
/// 5. Prewarm drops without calling `save_cache` (fork block was invalid).
/// 6. Canonical block 5 (parent = block 4) must get a cache with correct hash and no stale fork
/// data.
#[test]
fn fork_prewarm_dropped_without_save_does_not_corrupt_cache() {
let execution_cache = PayloadExecutionCache::default();
// Canonical chain at block 4.
let block4_hash = B256::from([4u8; 32]);
execution_cache.update_with_guard(|slot| *slot = Some(make_saved_cache(block4_hash)));
// Fork block arrives with parent = block 2. Prewarm task checks out the cache.
// This simulates PrewarmCacheTask receiving a SavedCache clone from get_cache_for.
let fork_parent = B256::from([2u8; 32]);
let prewarm_cache = execution_cache.get_cache_for(fork_parent);
assert!(prewarm_cache.is_some(), "prewarm should obtain cache for fork block");
let prewarm_cache = prewarm_cache.unwrap();
assert_eq!(prewarm_cache.executed_block_hash(), fork_parent);
// Prewarm populates cache with fork-specific state (ancestor data for block 2).
// Since ExecutionCache uses Arc<Inner>, this data is shared with the stored original.
let fork_addr = Address::from([0xBB; 20]);
let fork_key = B256::from([0xCC; 32]);
prewarm_cache.cache().insert_storage(fork_addr, fork_key, Some(U256::from(999)));
// While prewarm holds the clone, the usage_guard count > 1 → cache is in use.
let during_prewarm = execution_cache.get_cache_for(block4_hash);
assert!(
during_prewarm.is_none(),
"cache must be unavailable while prewarm holds a reference"
);
// Fork block fails — prewarm task drops without calling save_cache/update_with_guard.
drop(prewarm_cache);
// Canonical block 5 arrives (parent = block 4).
// Stored hash = fork_parent (our fix), so get_cache_for sees a mismatch,
// clears the stale fork data, and returns a cache with hash = block4_hash.
let block5_cache = execution_cache.get_cache_for(block4_hash);
assert!(
block5_cache.is_some(),
"canonical chain must get cache after fork prewarm is dropped"
);
assert_eq!(
block5_cache.as_ref().unwrap().executed_block_hash(),
block4_hash,
"cache must carry the canonical parent hash, not the fork parent"
);
}
}

View File

@@ -816,6 +816,17 @@ impl RuntimeBuilder {
let (task_manager, on_shutdown, task_events_tx, graceful_tasks) =
TaskManager::new_parts(handle.clone());
#[cfg(feature = "rayon")]
#[allow(clippy::needless_pass_by_value)]
fn rayon_panic_handler(payload: Box<dyn std::any::Any + Send>) {
let msg = payload
.downcast_ref::<&str>()
.copied()
.or_else(|| payload.downcast_ref::<String>().map(|s| s.as_str()))
.unwrap_or("(no message)");
error!(target: "reth::tasks", %msg, "panic in worker pool thread");
}
#[cfg(feature = "rayon")]
let (
cpu_pool,
@@ -853,6 +864,7 @@ impl RuntimeBuilder {
let proof_storage_worker_pool = rayon::ThreadPoolBuilder::new()
.num_threads(proof_storage_worker_threads)
.thread_name(|i| format!("proof-strg-{i:02}"))
.panic_handler(rayon_panic_handler)
.build()?;
let proof_account_worker_threads =
@@ -860,6 +872,7 @@ impl RuntimeBuilder {
let proof_account_worker_pool = rayon::ThreadPoolBuilder::new()
.num_threads(proof_account_worker_threads)
.thread_name(|i| format!("proof-acct-{i:02}"))
.panic_handler(rayon_panic_handler)
.build()?;
debug!(

View File

@@ -258,7 +258,7 @@ impl SparseTrie for ParallelSparseTrie {
#[cfg(feature = "std")]
// Reveal lower subtrie nodes in parallel
{
use rayon::iter::{IndexedParallelIterator, IntoParallelIterator, ParallelIterator};
use rayon::iter::{IntoParallelIterator, ParallelIterator};
use tracing::Span;
// Capture the current span so it can be propagated to rayon worker threads
@@ -267,23 +267,39 @@ impl SparseTrie for ParallelSparseTrie {
// Capture reference to upper subtrie nodes for boundary leaf reachability checks
let upper_nodes = &self.upper_subtrie.nodes;
// Group the nodes by lower subtrie. This must be collected into a Vec in order for
// rayon's `zip` to be happy.
let node_groups: Vec<_> = lower_nodes
// Group the nodes by lower subtrie.
let results = lower_nodes
.chunk_by(|node_a, node_b| {
SparseSubtrieType::from_path(&node_a.path) ==
SparseSubtrieType::from_path(&node_b.path)
})
.collect();
// Take the lower subtries in the same order that the nodes were grouped into, so that
// the two can be zipped together. This also must be collected into a Vec for rayon's
// `zip` to be happy.
let lower_subtries: Vec<_> = node_groups
.iter()
// Filter out chunks for unreachable subtries.
.filter_map(|nodes| {
// NOTE: chunk_by won't produce empty groups
let node = &nodes[0];
let mut nodes = nodes
.iter()
.filter(|node| {
// For boundary leaves, check reachability from upper subtrie's parent
// branch.
if node.path.len() == UPPER_TRIE_MAX_DEPTH &&
!Self::is_boundary_leaf_reachable(
upper_nodes,
&node.path,
&node.node,
)
{
trace!(
target: "trie::parallel_sparse",
path = ?node.path,
"Boundary leaf not reachable from upper subtrie, skipping",
);
false
} else {
true
}
})
.peekable();
let node = nodes.peek()?;
let idx =
SparseSubtrieType::from_path(&node.path).lower_index().unwrap_or_else(
|| panic!("upper subtrie node {node:?} found amongst lower nodes"),
@@ -303,41 +319,24 @@ impl SparseTrie for ParallelSparseTrie {
// shortest path being revealed for each subtrie. Therefore we can reveal the
// subtrie itself using this path and retain correct behavior.
self.lower_subtries[idx].reveal(&node.path);
Some((idx, self.lower_subtries[idx].take_revealed().expect("just revealed")))
Some((
idx,
self.lower_subtries[idx].take_revealed().expect("just revealed"),
nodes,
))
})
.collect();
// Zip the lower subtries and their corresponding node groups, and reveal lower subtrie
// nodes in parallel
let results: Vec<_> = lower_subtries
.collect::<Vec<_>>()
.into_par_iter()
.zip(node_groups.into_par_iter())
.map(|((subtrie_idx, mut subtrie), nodes)| {
.map(|(subtrie_idx, mut subtrie, nodes)| {
// Enter the parent span to propagate context (e.g., hashed_address for storage
// tries) to the worker thread
let _guard = parent_span.enter();
// reserve space in the HashMap ahead of time; doing it on a node-by-node basis
// can cause multiple re-allocations as the hashmap grows.
subtrie.nodes.reserve(nodes.len());
subtrie.nodes.reserve(nodes.size_hint().1.unwrap_or(0));
for node in nodes {
// For boundary leaves, check reachability from upper subtrie's parent
// branch
if node.path.len() == UPPER_TRIE_MAX_DEPTH &&
!Self::is_boundary_leaf_reachable(
upper_nodes,
&node.path,
&node.node,
)
{
trace!(
target: "trie::parallel_sparse",
path = ?node.path,
"Boundary leaf not reachable from upper subtrie, skipping",
);
continue;
}
// Reveal each node in the subtrie, returning early on any errors
let res = subtrie.reveal_node(node.path, &node.node, node.masks);
if res.is_err() {
@@ -346,7 +345,7 @@ impl SparseTrie for ParallelSparseTrie {
}
(subtrie_idx, subtrie, Ok(()))
})
.collect();
.collect::<Vec<_>>();
// Put subtries back which were processed in the rayon pool, collecting the last
// seen error in the process and returning that.
@@ -1958,6 +1957,7 @@ impl ParallelSparseTrie {
}
SparseTrieUpdatesAction::InsertUpdated(path, branch_node) => {
updates.updated_nodes.insert(path, branch_node);
updates.removed_nodes.remove(&path);
}
}
}

View File

@@ -1282,6 +1282,16 @@ where
Ok(())
}
/// Clears internal computation state. Called after errors to ensure the calculator is not
/// left in a partially-computed state when reused.
fn clear_computation_state(&mut self) {
self.branch_stack.clear();
self.branch_path = Nibbles::new();
self.child_stack.clear();
self.cached_branch_stack.clear();
self.retained_proofs.clear();
}
/// Internal implementation of proof calculation. Assumes both cursors have already been reset.
/// See docs on [`Self::proof`] for expected behavior.
fn proof_inner(
@@ -1303,12 +1313,15 @@ where
// Divide targets into chunks, each chunk corresponding to a different sub-trie within the
// overall trie, and handle all proofs within that sub-trie.
for sub_trie_targets in iter_sub_trie_targets(targets) {
self.proof_subtrie(
if let Err(err) = self.proof_subtrie(
value_encoder,
&mut trie_cursor_state,
&mut hashed_cursor_current,
sub_trie_targets,
)?;
) {
self.clear_computation_state();
return Err(err);
}
}
trace!(
@@ -1378,12 +1391,15 @@ where
let sub_trie_targets =
SubTrieTargets { prefix: Nibbles::new(), targets: &EMPTY_TARGETS, retain_root: true };
self.proof_subtrie(
if let Err(err) = self.proof_subtrie(
value_encoder,
&mut trie_cursor_state,
&mut hashed_cursor_current,
sub_trie_targets,
)?;
) {
self.clear_computation_state();
return Err(err);
}
// proof_subtrie will retain the root node if retain_proof is true, regardless of if there
// are any targets.
@@ -1815,6 +1831,79 @@ mod tests {
}
}
/// Tests that `clear_computation_state` properly resets internal stacks, allowing a
/// `ProofCalculator` to be reused after a mid-computation error left stale state.
/// Before the fix, stale data in `branch_stack`, `child_stack`, and `branch_path`
/// could cause a `usize` underflow panic in `pop_branch`.
#[test]
fn test_proof_calculator_reuse_after_error() {
use alloy_primitives::U256;
reth_tracing::init_test_tracing();
let mut post_state = HashedPostState::default();
let addresses = [
B256::right_padding_from(&[0x10]),
B256::right_padding_from(&[0x20]),
B256::right_padding_from(&[0x30]),
B256::right_padding_from(&[0x40]),
];
for addr in &addresses {
let account =
Account { nonce: 1, balance: U256::from(100u64), bytecode_hash: Some(B256::ZERO) };
post_state.accounts.insert(*addr, Some(account));
}
let harness = ProofTestHarness::new(post_state);
let trie_cursor = harness.trie_cursor_factory.account_trie_cursor().unwrap();
let hashed_cursor = harness.hashed_cursor_factory.hashed_account_cursor().unwrap();
let mut proof_calculator = ProofCalculator::new(trie_cursor, hashed_cursor);
// Simulate stale state left by a mid-computation error: push fake entries onto internal
// stacks and set a non-empty branch_path.
proof_calculator.branch_stack.push(ProofTrieBranch {
ext_len: 2,
state_mask: TrieMask::new(0b1111),
masks: None,
});
proof_calculator.branch_stack.push(ProofTrieBranch {
ext_len: 0,
state_mask: TrieMask::new(0b11),
masks: None,
});
proof_calculator
.child_stack
.push(ProofTrieBranchChild::RlpNode(RlpNode::word_rlp(&B256::ZERO)));
proof_calculator.branch_path = Nibbles::from_nibbles([0x1, 0x2, 0x3]);
// clear_computation_state should reset everything so a subsequent proof() call works.
proof_calculator.clear_computation_state();
let mut value_encoder = SyncAccountValueEncoder::new(
harness.trie_cursor_factory.clone(),
harness.hashed_cursor_factory.clone(),
);
let mut sorted_addresses = addresses.to_vec();
sorted_addresses.sort();
let mut targets: Vec<ProofV2Target> =
sorted_addresses.iter().copied().map(ProofV2Target::new).collect();
let result = proof_calculator.proof(&mut value_encoder, &mut targets).unwrap();
// Compare against a fresh calculator to verify correctness.
let trie_cursor = harness.trie_cursor_factory.account_trie_cursor().unwrap();
let hashed_cursor = harness.hashed_cursor_factory.hashed_account_cursor().unwrap();
let mut fresh_calculator = ProofCalculator::new(trie_cursor, hashed_cursor);
let mut value_encoder = SyncAccountValueEncoder::new(
harness.trie_cursor_factory.clone(),
harness.hashed_cursor_factory,
);
let fresh_result = fresh_calculator.proof(&mut value_encoder, &mut targets).unwrap();
pretty_assertions::assert_eq!(fresh_result, result);
}
mod proptest_tests {
use super::*;
use alloy_primitives::{map::B256Map, U256};

View File

@@ -22,7 +22,7 @@ export default defineConfig({
},
{ text: 'GitHub', link: 'https://github.com/paradigmxyz/reth' },
{
text: 'v1.11.0',
text: 'v1.11.3',
items: [
{
text: 'Releases',