feat(storage): add use_hashed_state storage setting (#21997)

This commit is contained in:
Dan Cline
2026-02-09 20:15:13 +00:00
committed by GitHub
parent cdcea2bd33
commit a549b4d66d
22 changed files with 324 additions and 0 deletions

View File

@@ -23,6 +23,16 @@ pub struct StorageArgs {
/// flags.
#[arg(long = "storage.v2", action = ArgAction::SetTrue)]
pub v2: bool,
/// Use hashed state tables (`HashedAccounts`/`HashedStorages`) as canonical state
/// representation instead of plain state tables.
///
/// When enabled, execution writes directly to hashed tables, eliminating the need for
/// separate hashing stages. This should only be enabled for new databases.
///
/// WARNING: Changing this setting on an existing database requires a full resync.
#[arg(long = "storage.use-hashed-state", default_value_t = false)]
pub use_hashed_state: bool,
}
#[cfg(test)]

View File

@@ -408,6 +408,8 @@ impl<ChainSpec> NodeConfig<ChainSpec> {
s = s.with_account_history_in_rocksdb(v);
}
s = s.with_use_hashed_state(self.storage.use_hashed_state);
s
}