IntersectMBO / cardano-ledger

The ledger implementation and specifications of the Cardano blockchain.
Apache License 2.0
262 stars 155 forks source link

Specify cross-era ticking/forecasting for Cardano #4635

Open nfrisby opened 2 months ago

nfrisby commented 2 months ago

The Consensus Team needs assistance with Issue https://github.com/IntersectMBO/ouroboros-consensus/issues/418.

Right now, there is no separate specification for how to tick/forecast ledger states across era boundaries, there is only code. Other than Byron-to-Shelley, it's "obvious for the most part". But there are plenty of subtleties buried in the implementation.

This Issue is to create a proper specification of the relation that must hold between two ledger states X and Tick(X, S) --- X is the ledger state that results from applying the final block of some era, and S is the slot of the first block of the next era, which will be validated against the Tick(X, S) ledger state.

nfrisby commented 2 months ago

For the record, translating txs etc from one era to the next also deserves a specification. But it's less error-prone, in our experience.

amesgen commented 2 months ago

But there are plenty of subtleties buried in the implementation.

One such subtlety is on ticking from Babbage to Conway:

amesgen commented 2 months ago

This Issue is to create a proper specification of the relation that must hold between two ledger states X and Tick(X, S) --- X is the ledger state that results from applying the final block of some era, and S is the slot of the first block of the next era, which will be validated against the Tick(X, S) ledger state.

We also need sth similar for forecasting. E.g. one weird thing at the moment is that forecasting and ticking work differently/symmetrically:

Consensus requires that these things agree as long as forecasting is defined (the "forecasting lemma", see e.g. here), which isn't actually immediately obvious here.