IntersectMBO / cardano-ledger

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

Make updating the delegation state part of the chain tick function #1046

Closed edsko closed 2 years ago

edsko commented 4 years ago

The ledger specs provide the facility for validating a block extending a chain. However, as a leader we have to consider how to validate a block that we are producing. We should have an additional invariant here:

To get around this, we should require of the ledger that it exposes a "chain tick" transition, driven only by slot number, that covers all time/slot based updates to the chain state.

For Byron, this involves splitting the DELEG transitions to move ADELEGS (delegation activation) and EPOCH into a new TICK rule which takes only slot as signal, updating both delegation state and update state.

For Shelley, this involves modifying the BHEAD rule to either (a) move the header checks up to CHAIN, and rename as TICK, or (b) add a new rule TICK below BHEAD which applies the slot-driven transitions.

mgajda commented 4 years ago

1052 made the leftover ticket Byron-only.

mgajda commented 4 years ago

So Byron part is supposed to remove dotted links here, and add dashed links, and new STS TICK. Also it TICK will call TRC, not just initial IRC transitions for ADELEGS. sts-hierarchy-jan-13-byron-and-shelley

Or should we also call update STS?

Will submit it this week.

JaredCorduan commented 4 years ago

the chain tick functionality is now exposed in cardano-ledger. but the rules are not adapted. I am going to de-prioritize this issue for now.

JaredCorduan commented 2 years ago

Development of Byron code has been frozen and only potential security fixes will be applied in the future