perf(state): avoid full header decode in StateAtBlockNumber

Open
#3,784 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
72/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Active
Tech stack
go

Research direction

Start at StateAtBlockNumber and compare pruner.HeaderByNumberIfStateRetained with the reference implementation in pull request 3782. Trace the historical-state lookup and verify that only GlobalStateRoot and Hash are decoded for the state-retention check, without materializing unused fields such as EventsBloom.

Written by the indexing model from the issue text.

Description

Optimisation Stale

StateAtBlockNumber currently calls pruner.HeaderByNumberIfStateRetained, which fully decodes the block header even though opening historical state only needs:

GlobalStateRoot
Hash, for the state-retention hash → number check

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

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

Dominant language
Go
Stars
444
Forks
244
Avg merge
2d 15h
Merged PRs (30d)
78

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from NethermindEth/juno

All issues in NethermindEth/juno

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.