mlabs-haskell / clb

Cardano Ledger Backend (next-gen PSM)
7 stars 1 forks source link

Support for stacking #7

Open uhbif19 opened 4 months ago

uhbif19 commented 4 months ago

This is similar to slotting. Real consensus has slots moving, and our emulator should have slot changing API instead.

Same goes for stacking rewards. We should probably have simple API for selection of slotting leader, not really conforming PoS algorithm.

We could use PoS docs to check it working correctly.

uhbif19 commented 3 months ago

@euonymos

Seems like there is some Stacking logic and params in ledger. So may be it already does stacking somehow?

https://github.com/IntersectMBO/cardano-ledger/blob/c2fd86ea034a8021766a794cd06f888b9cfbf62c/eras/shelley/impl/src/Cardano/Ledger/Shelley/LedgerState/IncrementalStake.hs

euonymos commented 3 months ago

You are quite right, the ledger is capable of handling the state of certificates (from what I saw) and probably something else. We have to use this. In terms of emulating, I would say we need to emulate a set of SPOs that can used to delegate funds (and related things) @uhbif19 .

euonymos commented 3 months ago

I have some doubts about how we should do that, but the bottom line is to try to reuse the ledger as far as possible.