reth icon indicating copy to clipboard operation
reth copied to clipboard

Do not de-allocate space used by accounts sparse trie

Open shekhirin opened this issue 7 months ago • 0 comments
trafficstars

Describe the feature

Currently, every time we have a new block, we create an empty SparseTrie for the accounts trie to reveal new proofs and apply updates in there.

After https://github.com/paradigmxyz/reth/pull/15637, still at least half of the time in reveal_account_proof is spent reserving the space for new nodes to insert

Image

This can be optimized by not de-allocating the accounts trie https://github.com/paradigmxyz/reth/blob/ab85300ac35a57ca2d1f8fbc23aa29d6baee1376/crates/trie/sparse/src/state.rs#L28-L29 and instead just clear it and carry over to the next state root task invocation.

Additional context

No response

shekhirin avatar Apr 09 '25 16:04 shekhirin