Skip to content
Cosmopediaby Unity Nodes
DiscussionsTendermint10x? Acceleration of Tx Execution Without State TrieForum ↗

10x? Acceleration of Tx Execution Without State Trie

Tendermint3 posts837 views3 likesLast activity Aug 2020
QI
qizhouOP
Aug 2020 3

Motivation To make sure the majority validators agree on the same application state, the block header of Tendermint includes a apphash field, which contains the hash of the application state (generally a KV map). To efficiently compute the hash of the application state after applying the transactions of a block, we use a Merkle tree (e.g., IAVL tree or Merkle Patricia Tree (MPT)) to represent the application state and use the root hash as apphash. However, when the number of accounts is large (e.g., Ethereum currently has 100M unique addresses), reading/updating the Merkle tree can result in multiple KV store get/put operations. Further, extra storage space of the state map is also needed (compared to a plain KV map) to keep the internal nodes of the Merkle tree. The motivation of the proposal is to circumvent the Merkle tree by exploiting one great benefit of Tendermint - forkless . Unlike probabilistic-finality chains such as PoW-based chains, every block passed to the application (via BeginBlock/DeliverTx/EndBlock/CommitBlock) in Tendermint will be finalized and thus not be reverted due to re-org. This means that we only need to maintain a single version of the application…

Excerpt (1198 of 3100 characters). Read the whole post on the forum ↗

BH
bharvest
Aug 2020

This is a good analogy imo. Thanks for sharing.

I think entire state hash can be voted for every 1k blocks as a periodic snapshot if we want to confirm it periodically.

QI
qizhou
Aug 2020

Yes, we could definitively include the entire state hash for every 1K blocks (likely the hash of the state for the previous 1K block, i.e., block height with current_block_height - 1K so that we could have 1K block time to calculate the hash if we do not maintain a Merkle). This could also help a fast-sync client to download and verify the latest state snapshot by using the state hash of the block with nearest height that is multiple of 1K, and then get the latest state by replying the remaining blocks.

← Back to Discussions