oasisprotocol / oasisprotocol/oasis-core

History expiry

Open
#6,422 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
369
Forks
151
Avg merge
1d 3h
Merged PRs (30d)
6

Description

Long term solution to the growing state problem.

Context

As we are getting further away from the genesis, keeping all historical state becomes impractical, thus nodes (especially validators) start pruning (https://github.com/oasisprotocol/docs/pull/1526).

However, as the nodes start pruning we are risking data availability issues (at least for the genesis sync).

Currently, the network still has nodes that serve historical data and we also offer snapshots. Nevertheless, there will be less and less such nodes, which decreases data availability and increases the risk of (accidentally) loosing it.

Proposed solution

History Expiry.

Let's define a sane default, for which all network participants (except for stateless clients) guarantee, it is possible to sycn from. I believe 1 year would be a good value.

If the network is always capable of serving a State DB checkpoint that is one year old, and if by default nodes always preserve 1 year of blocks and or storage diffs, then our network guarantees history expiry invariant.

Implementation space:

History Expiry Checkpoint

In addition to existing checkpoints, there will be another historical checkpoint created and replaced every month (target age of history expiry). In practice it will replace the current genesis checkpoint. I.e. every node serving checkpoints will fetch, store and serve it, even if they only preserve one month of state.

Pruning

Operator would still be able to prune runtime and consensus state to any value it wants, however we will not allow pruning of consensus blocks and or runtime storage diffs younger then expired history.

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.

Research direction

Start by tracing the existing checkpoint creation and replacement flow, including the genesis checkpoint, then inspect how runtime and consensus pruning handles blocks and storage diffs. Done means nodes can serve a periodically replaced history-expiry checkpoint and cannot prune consensus blocks or runtime storage diffs younger than the configured expiry.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
blockchain, databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.