IntersectMBO / IntersectMBO/ouroboros-consensus
Change `OneEraGenTxId` to just wrap a `ShortByteString`
- Dominant language
- Haskell
- Stars
- 67
- Forks
- 43
- Avg merge
- 5d 13h
- Merged PRs (30d)
- 43
Description
Currently, `OneEraGenTxId` (used for the HFC's `GenTxId`) is an n-ary sum:
https://github.com/IntersectMBO/ouroboros-consensus/blob/8c485b24161981d34bf3d0c1d58cafeac141d359/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/HardFork/Combinator/AcrossEras.hs#L127
Since #1017, motivated by #1009, we already compare these based on the underlying hash, ignoring the index of the n-ary sum:
https://github.com/IntersectMBO/ouroboros-consensus/blob/8c485b24161981d34bf3d0c1d58cafeac141d359/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/HardFork/Combinator/AcrossEras.hs#L164-L175
As mentioned in https://github.com/IntersectMBO/ouroboros-consensus/issues/1009#issuecomment-2017825556, the logical next step is to change `OneEraGenTxId` to
```haskell
newtype OneEraGenTxId xs = OneEraGenTxId { getOneEraGenTxId :: ShortByteString }
```
to get rid of the n-ary sum completely.
This will require changes to the serialization format, and we will need to keep compatibility with the previous format for some time (it might be fine to not do this for Byron).
Contributor guide
Assessment
This issue has not been assessed yet.