IntersectMBO / IntersectMBO/cardano-ledger

Seed stake snapshots in testnet setups

Open
#5,996 0 comments 1 reaction 0 assignees View on GitHub
:credit_card: technical-debt
Dominant language
Haskell
Stars
295
Forks
179
Avg merge
4d 7h
Merged PRs (30d)
29

Description

Context and solution at consensus level already here: https://github.com/IntersectMBO/ouroboros-consensus/pull/2191

It was suggested that we might want to do the "seeding" of stake snapshots in era transitions at epoch 0 (or 1) in the ledger codebase instead of consensus as ledger is the owner of the actual data (stake snapshots):

> I'm thinking of this new behavior as "asserting that the ledger state that 'enters' EpochNo 0 has an infinitely old mark snapshot, and so that state's set and go snapshots should equal it".
>
> Which seems like a ledger concern (they own the maintenance of these snapshots). So, instead of altering the result of L.injectIntoTestState, should this patch instead be upstream in cardano-ledger?
>
> There's already even a type for "information needed in order to initialize the test chain's ledger state": L.TransitionConfig. Right now it's merely ShelleyGenesis, so we'd need to enrich it with either the trigger or a summary of the trigger (ie which snapshots to copy from mark).

Contributor guide

Open the contributing guide

Research direction

Read L.TransitionConfig and the context in ouroboros-consensus PR 2191 first. Trace how testnet ledger state crosses the epoch 0 or 1 era transition and how mark, set, and go snapshots are maintained. Done means the testnet ledger state seeds the required stake snapshots at initialization while keeping snapshot ownership in the ledger codebase.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
blockchain
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.