From 7595e6bbdcee4369b301a45727e5ce44cde59b25 Mon Sep 17 00:00:00 2001 From: cdrappi Date: Mon, 28 Jul 2025 17:17:08 -0400 Subject: [PATCH 1/2] invalidate cache when private flag changes --- Cargo.toml | 20 +++++++++++++------- crates/trie/sparse/src/trie.rs | 9 ++++++++- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index eb1d5880f1..df3a2713c5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -325,7 +325,11 @@ strip = "none" # Include debug info in benchmarks too. [profile.bench] -inherits = "profiling" +opt-level = 3 +lto = "thin" +debug = "full" +strip = "none" +codegen-units = 16 [profile.maxperf] inherits = "release" @@ -357,6 +361,7 @@ alloy-seismic-evm = {version = "0.9"} seismic-alloy-rpc-types = {version = "0.0.1", default-features = false} seismic-alloy-consensus = {version = "0.0.1", default-features = false} seismic-alloy-provider = {version = "0.0.1", default-features = false} +seismic-alloy-genesis = {version = "0.0.1", default-features = false} seismic-alloy-rpc-types-engine = {version = "0.0.1", default-features = false} seismic-alloy-network = {version = "0.0.1", default-features = false} @@ -751,7 +756,7 @@ vergen-git2 = "1.0.5" [patch.crates-io] # Seismic enclave -seismic-enclave = { git = "https://github.com/SeismicSystems/seismic-enclave.git", rev = "afb3f4d"} +seismic-enclave = { git = "https://github.com/SeismicSystems/seismic-enclave.git", rev = "fb959b6"} # seismic-alloy-core alloy-primitives = { git = "https://github.com/SeismicSystems/seismic-alloy-core.git", rev = "bc4b5ed" } @@ -762,7 +767,7 @@ alloy-sol-types = { git = "https://github.com/SeismicSystems/seismic-alloy-core. alloy-sol-type-parser = { git = "https://github.com/SeismicSystems/seismic-alloy-core.git", rev = "bc4b5ed" } alloy-dyn-abi = { git = "https://github.com/SeismicSystems/seismic-alloy-core.git", rev = "bc4b5ed" } -alloy-trie = { git = "https://github.com/SeismicSystems/seismic-trie.git", rev = "417644c" } +alloy-trie = { git = "https://github.com/SeismicSystems/seismic-trie.git", rev = "3f094397e43290c077b6faaa35cfccd31cd38191" } # revm revm = { git = "https://github.com/SeismicSystems/seismic-revm.git", rev = "e7fa9fab"} @@ -781,10 +786,11 @@ seismic-revm = { git = "https://github.com/SeismicSystems/seismic-revm.git", rev revm-inspectors = { git = "https://github.com/SeismicSystems/seismic-revm-inspectors.git", rev = "2b50433"} # Seismic alloy -seismic-alloy-consensus = { git = "https://github.com/SeismicSystems/seismic-alloy.git", rev = "c0e56e6866dbc509343dce90b5346393c0f409e5" } -seismic-alloy-rpc-types = { git = "https://github.com/SeismicSystems/seismic-alloy.git", rev = "c0e56e6866dbc509343dce90b5346393c0f409e5" } -seismic-alloy-network = { git = "https://github.com/SeismicSystems/seismic-alloy.git", rev = "c0e56e6866dbc509343dce90b5346393c0f409e5" } -seismic-alloy-provider = { git = "https://github.com/SeismicSystems/seismic-alloy.git", rev = "c0e56e6866dbc509343dce90b5346393c0f409e5" } +seismic-alloy-consensus = { git = "https://github.com/SeismicSystems/seismic-alloy.git", rev = "c16ddea3f87478c2e14b259aa02f8957016a4766" } +seismic-alloy-rpc-types = { git = "https://github.com/SeismicSystems/seismic-alloy.git", rev = "c16ddea3f87478c2e14b259aa02f8957016a4766" } +seismic-alloy-network = { git = "https://github.com/SeismicSystems/seismic-alloy.git", rev = "c16ddea3f87478c2e14b259aa02f8957016a4766" } +seismic-alloy-provider = { git = "https://github.com/SeismicSystems/seismic-alloy.git", rev = "c16ddea3f87478c2e14b259aa02f8957016a4766" } +seismic-alloy-genesis = { git = "https://github.com/SeismicSystems/seismic-alloy.git", rev = "c16ddea3f87478c2e14b259aa02f8957016a4766" } # alloy-evm alloy-evm = { git = "https://github.com/SeismicSystems/seismic-evm.git", rev = "6a68682320d317bf6ac2b76142b349f086828fbb" } diff --git a/crates/trie/sparse/src/trie.rs b/crates/trie/sparse/src/trie.rs index fed9093057..09aeeb570c 100644 --- a/crates/trie/sparse/src/trie.rs +++ b/crates/trie/sparse/src/trie.rs @@ -1512,7 +1512,14 @@ impl RevealedSparseTrie

{ self.prefix_set.insert(path.clone()); let existing = self.values.insert(path.clone(), value); if existing.is_some() { - // trie structure unchanged, return immediately + // Check if is_private flag changed and invalidate hash if so + if let Some(SparseNode::Leaf { is_private: ref mut existing_is_private, hash: ref mut existing_hash, .. }) = + self.nodes.values_mut().find(|node| matches!(node, SparseNode::Leaf { .. })) { + if *existing_is_private != is_private { + *existing_is_private = is_private; + *existing_hash = None; // Force hash recomputation + } + } return Ok(()); } From 7223cdec4bb73d207a226de3be8f8877edc65a88 Mon Sep 17 00:00:00 2001 From: cdrappi Date: Mon, 28 Jul 2025 17:18:37 -0400 Subject: [PATCH 2/2] only update alloy-trie --- Cargo.toml | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index df3a2713c5..7418f2d5af 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -325,11 +325,7 @@ strip = "none" # Include debug info in benchmarks too. [profile.bench] -opt-level = 3 -lto = "thin" -debug = "full" -strip = "none" -codegen-units = 16 +inherits = "profiling" [profile.maxperf] inherits = "release" @@ -361,7 +357,6 @@ alloy-seismic-evm = {version = "0.9"} seismic-alloy-rpc-types = {version = "0.0.1", default-features = false} seismic-alloy-consensus = {version = "0.0.1", default-features = false} seismic-alloy-provider = {version = "0.0.1", default-features = false} -seismic-alloy-genesis = {version = "0.0.1", default-features = false} seismic-alloy-rpc-types-engine = {version = "0.0.1", default-features = false} seismic-alloy-network = {version = "0.0.1", default-features = false} @@ -756,7 +751,7 @@ vergen-git2 = "1.0.5" [patch.crates-io] # Seismic enclave -seismic-enclave = { git = "https://github.com/SeismicSystems/seismic-enclave.git", rev = "fb959b6"} +seismic-enclave = { git = "https://github.com/SeismicSystems/seismic-enclave.git", rev = "afb3f4d"} # seismic-alloy-core alloy-primitives = { git = "https://github.com/SeismicSystems/seismic-alloy-core.git", rev = "bc4b5ed" } @@ -786,11 +781,10 @@ seismic-revm = { git = "https://github.com/SeismicSystems/seismic-revm.git", rev revm-inspectors = { git = "https://github.com/SeismicSystems/seismic-revm-inspectors.git", rev = "2b50433"} # Seismic alloy -seismic-alloy-consensus = { git = "https://github.com/SeismicSystems/seismic-alloy.git", rev = "c16ddea3f87478c2e14b259aa02f8957016a4766" } -seismic-alloy-rpc-types = { git = "https://github.com/SeismicSystems/seismic-alloy.git", rev = "c16ddea3f87478c2e14b259aa02f8957016a4766" } -seismic-alloy-network = { git = "https://github.com/SeismicSystems/seismic-alloy.git", rev = "c16ddea3f87478c2e14b259aa02f8957016a4766" } -seismic-alloy-provider = { git = "https://github.com/SeismicSystems/seismic-alloy.git", rev = "c16ddea3f87478c2e14b259aa02f8957016a4766" } -seismic-alloy-genesis = { git = "https://github.com/SeismicSystems/seismic-alloy.git", rev = "c16ddea3f87478c2e14b259aa02f8957016a4766" } +seismic-alloy-consensus = { git = "https://github.com/SeismicSystems/seismic-alloy.git", rev = "c0e56e6866dbc509343dce90b5346393c0f409e5" } +seismic-alloy-rpc-types = { git = "https://github.com/SeismicSystems/seismic-alloy.git", rev = "c0e56e6866dbc509343dce90b5346393c0f409e5" } +seismic-alloy-network = { git = "https://github.com/SeismicSystems/seismic-alloy.git", rev = "c0e56e6866dbc509343dce90b5346393c0f409e5" } +seismic-alloy-provider = { git = "https://github.com/SeismicSystems/seismic-alloy.git", rev = "c0e56e6866dbc509343dce90b5346393c0f409e5" } # alloy-evm alloy-evm = { git = "https://github.com/SeismicSystems/seismic-evm.git", rev = "6a68682320d317bf6ac2b76142b349f086828fbb" }