sc-state-db

Crates.iosc-state-db
lib.rssc-state-db
version0.36.0
sourcesrc
created_at2020-02-27 11:42:03.457597
updated_at2024-06-21 08:49:16.268432
descriptionState database maintenance. Handles canonicalization and pruning in the database. (polkadot v1.13.0)
homepagehttps://substrate.io
repositoryhttps://github.com/paritytech/polkadot-sdk.git
max_upload_size
id213061
size106,336
Parity Crate Owner (parity-crate-owner)

documentation

README

State database maintenance. Handles canonicalization and pruning in the database. The input to this module is a ChangeSet which is basically a list of key-value pairs (trie nodes) that were added or deleted during block execution.

Canonicalization

Canonicalization window tracks a tree of blocks identified by header hash. The in-memory overlay allows to get any node that was inserted in any of the blocks within the window. The tree is journaled to the backing database and rebuilt on startup. Canonicalization function selects one root from the top of the tree and discards all other roots and their subtrees.

Pruning

See RefWindow for pruning algorithm details. StateDb prunes on each canonicalization until pruning constraints are satisfied.

License: GPL-3.0-or-later WITH Classpath-exception-2.0

Commit count: 17920

cargo fmt