juno icon indicating copy to clipboard operation
juno copied to clipboard

perf(state): avoid full header decode in StateAtBlockHash

Open ongyimeng opened this issue 5 months ago • 0 comments

StateAtBlockHash currently calls pruner.HeaderByHashIfStateRetained, which resolves the block hash and fully decodes the corresponding block header. Opening historical state by hash only needs:

Block number from the hash → number index GlobalStateRoot from the header

A partial-header decode could avoid materializing heavier unused fields such as EventsBloom.

Use https://github.com/NethermindEth/juno/pull/3782 as reference implementation

ongyimeng avatar Jul 03 '26 01:07 ongyimeng