juno
juno copied to clipboard
perf(state): avoid full header decode in StateAtBlockHash
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