chore: remove legacy proof code paths and simplify to V2-only (#22270)

Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
Brian Picciano
2026-02-17 15:42:13 +01:00
committed by GitHub
parent e89bf483bc
commit 6f9a3242ef
16 changed files with 169 additions and 3776 deletions

View File

@@ -39,9 +39,7 @@ pub struct DefaultEngineValues {
storage_worker_count: Option<usize>,
account_worker_count: Option<usize>,
prewarming_threads: Option<usize>,
disable_proof_v2: bool,
cache_metrics_disabled: bool,
disable_trie_cache: bool,
sparse_trie_prune_depth: usize,
sparse_trie_max_storage_tries: usize,
disable_sparse_trie_cache_pruning: bool,
@@ -176,24 +174,12 @@ impl DefaultEngineValues {
self
}
/// Set whether to disable proof V2 by default
pub const fn with_disable_proof_v2(mut self, v: bool) -> Self {
self.disable_proof_v2 = v;
self
}
/// Set whether to disable cache metrics by default
pub const fn with_cache_metrics_disabled(mut self, v: bool) -> Self {
self.cache_metrics_disabled = v;
self
}
/// Set whether to disable sparse trie cache by default
pub const fn with_disable_trie_cache(mut self, v: bool) -> Self {
self.disable_trie_cache = v;
self
}
/// Set the sparse trie prune depth by default
pub const fn with_sparse_trie_prune_depth(mut self, v: usize) -> Self {
self.sparse_trie_prune_depth = v;
@@ -241,9 +227,7 @@ impl Default for DefaultEngineValues {
storage_worker_count: None,
account_worker_count: None,
prewarming_threads: None,
disable_proof_v2: false,
cache_metrics_disabled: false,
disable_trie_cache: false,
sparse_trie_prune_depth: DEFAULT_SPARSE_TRIE_PRUNE_DEPTH,
sparse_trie_max_storage_tries: DEFAULT_SPARSE_TRIE_MAX_STORAGE_TRIES,
disable_sparse_trie_cache_pruning: false,
@@ -373,18 +357,10 @@ pub struct EngineArgs {
#[arg(long = "engine.prewarming-threads", default_value = Resettable::from(DefaultEngineValues::get_global().prewarming_threads.map(|v| v.to_string().into())))]
pub prewarming_threads: Option<usize>,
/// Disable V2 storage proofs for state root calculations
#[arg(long = "engine.disable-proof-v2", default_value_t = DefaultEngineValues::get_global().disable_proof_v2)]
pub disable_proof_v2: bool,
/// Disable cache metrics recording, which can take up to 50ms with large cached state.
#[arg(long = "engine.disable-cache-metrics", default_value_t = DefaultEngineValues::get_global().cache_metrics_disabled)]
pub cache_metrics_disabled: bool,
/// Disable sparse trie cache.
#[arg(long = "engine.disable-trie-cache", default_value_t = DefaultEngineValues::get_global().disable_trie_cache, conflicts_with = "disable_proof_v2")]
pub disable_trie_cache: bool,
/// Sparse trie prune depth.
#[arg(long = "engine.sparse-trie-prune-depth", default_value_t = DefaultEngineValues::get_global().sparse_trie_prune_depth)]
pub sparse_trie_prune_depth: usize,
@@ -438,9 +414,7 @@ impl Default for EngineArgs {
storage_worker_count,
account_worker_count,
prewarming_threads,
disable_proof_v2,
cache_metrics_disabled,
disable_trie_cache,
sparse_trie_prune_depth,
sparse_trie_max_storage_tries,
disable_sparse_trie_cache_pruning,
@@ -470,9 +444,7 @@ impl Default for EngineArgs {
storage_worker_count,
account_worker_count,
prewarming_threads,
disable_proof_v2,
cache_metrics_disabled,
disable_trie_cache,
sparse_trie_prune_depth,
sparse_trie_max_storage_tries,
disable_sparse_trie_cache_pruning,
@@ -506,9 +478,7 @@ impl EngineArgs {
.with_unwind_canonical_header(self.allow_unwind_canonical_header)
.with_storage_worker_count_opt(self.storage_worker_count)
.with_account_worker_count_opt(self.account_worker_count)
.with_disable_proof_v2(self.disable_proof_v2)
.without_cache_metrics(self.cache_metrics_disabled)
.with_disable_trie_cache(self.disable_trie_cache)
.with_sparse_trie_prune_depth(self.sparse_trie_prune_depth)
.with_sparse_trie_max_storage_tries(self.sparse_trie_max_storage_tries)
.with_disable_sparse_trie_cache_pruning(self.disable_sparse_trie_cache_pruning)
@@ -562,9 +532,7 @@ mod tests {
storage_worker_count: Some(16),
account_worker_count: Some(8),
prewarming_threads: Some(4),
disable_proof_v2: false,
cache_metrics_disabled: true,
disable_trie_cache: true,
sparse_trie_prune_depth: 10,
sparse_trie_max_storage_tries: 100,
disable_sparse_trie_cache_pruning: true,
@@ -601,7 +569,6 @@ mod tests {
"--engine.prewarming-threads",
"4",
"--engine.disable-cache-metrics",
"--engine.disable-trie-cache",
"--engine.sparse-trie-prune-depth",
"10",
"--engine.sparse-trie-max-storage-tries",