Skip to content

Add live trie node collector #169

@meyer9

Description

@meyer9

Describe the feature

When we get a new block in the ExEx through the ChainCommitted event, we can check that the latest state provider is 0-1 blocks away from the block being added.

If it is, we can efficiently calculate the state root by getting the hashed post state from the block, and applying that to the state of the parent block. Example: https://github.com/meyer9/proof-helper/blob/e398f0b31707b6ae2d25096c9c826a7412a006c5/src/main.rs#L366

The hashed post state are the changed leaf nodes and the trie updates are the changed trie nodes. We can store these to the database under the block number that changed them.

Additional context

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions