IntersectMBO / IntersectMBO/ouroboros-consensus
Parametrize LedgerTables by `blk`
- Dominant language
- Haskell
- Stars
- 67
- Forks
- 43
- Avg merge
- 5d 13h
- Merged PRs (30d)
- 43
Description
I'm not too happy with the `Castable` constraint, and I already have ideas for how to get rid of it. But maybe we should do it in a follow-up to this main body of UTXO-HD work.
The idea is to not parameterise `LedgerTables` by the ledger state type `l` but by the block type `blk`. `Castable` is currently capturing the fact that key/value types are the same regardless of whether `l ~ LedgerState blk`, or `l ~ ExtLedgerState blk`, or `l ~ Ticked (LedgerState blk)`. This is true for all block types:
```haskell
type instance Key (LedgerTables l) = Key l
type instance Value (LedgerTables l) = Value l
type instance Key (Ticked1 l) = Key l
type instance Value (Ticked1 l) = Value l
```
The reason I did not implement this change initially is that I trouble fitting this into the code, because some parts are blissfully unaware of the fact that a type parameter `l`, representing (ticked/extended) ledger states, always has a `blk` type parameter in practice. It would be a largish refactoring to make code aware of the `blk` parameter where necessary.
_Originally posted by @jorisdral in https://github.com/IntersectMBO/ouroboros-consensus/pull/1267#discussion_r1825719546_
Contributor guide
Assessment
This issue has not been assessed yet.