Skip to content

Implement forwards iterator for state roots #2377

@paulhauner

Description

@paulhauner

Description

As per #2376, it turns out that deep reverse iterators are causing big memory spikes.

Whilst #2376 addresses this issue for block root lookups, it'll still exist for state roots. Whilst I don't think this is really a big deal for "normal operation" (i.e., following the chain and running validators), it'll mean the calls via the HTTP API to older state roots will be slow and expensive for memory.

One way to solve this would be to just implement an O(1) state root lookup using the freezer chunked roots. However, since we already have the foward iters for block roots then perhaps it's easier to adapt them to also do state roots. That way we also get iteration, if we want. I have no strong preference.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions