Skip to content

Implement freezer fallback to era1 files #31279

@fjl

Description

@fjl

When Geth runs with pruned history, the freezer will no longer contain pre-merge blocks. One way for users to still access these blocks, is importing era1 files.

We should add a code path to the ancient store implementation that uses era1.

  • When an ancient item is requested, we should first check if it is within the block range of the freezer. If the request is for a block number below the freezer range, the access goes to era.
  • We define a era1 subdirectory of the ancients directory to hold era1 files.
  • All accesses should try to open the file, i.e. no pre-opening. That way, the user can add era1 files while Geth is running to make certain block ranges available.
  • There can be a LRU cache for open era1 files, with a time-based eviction policy. It's important to ensure Geth closes the files that haven't been accessed for a while, so that users can actually delete era1 files while it is running.

Sub-issues

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions