pub fn assert_trie_consistency<F>(factory: &F) -> Result<()>where
F: DatabaseProviderFactory<Provider: DBProvider + StorageSettingsCache + BlockNumReader + HeaderProvider>,Expand description
Asserts that the persisted state and trie representation is internally consistent and matches the state root of the latest persisted block.
This performs two checks against a single database snapshot:
- the state root recomputed from the persisted hashed state matches the state root of the latest persisted header, and
- the persisted trie nodes match a recomputation from the hashed state (the library equivalent
of a
reth db repair-trie --dry-run).
Only on-disk data is read, so callers must ensure the blocks of interest have been persisted,
e.g. via wait_for_persisted_block.