Integrate cardano-ledger for node-8.11.0#1069
Conversation
|
Obviously, this is far from done but I opted to open a draft early so everyone can track the progress of the integration. One thing that is worth mentioning right away: This removes the cc: @dnadales |
db59b48 to
6e9fca6
Compare
ad3720a to
45e379c
Compare
This comment was marked as resolved.
This comment was marked as resolved.
e87e596 to
0a1a154
Compare
5530023 to
3f873d6
Compare
3f873d6 to
cc97ed1
Compare
cardano-ledger and ouroboros-network for node-8.11.0 (SRP)cardano-ledger for node-8.11.0
cc97ed1 to
3afee0a
Compare
ouroboros-consensus-cardano/changelog.d/20240430_233346_Lucsanszky_integration_8_11.md
Outdated
Show resolved
Hide resolved
ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Eras.hs
Show resolved
Hide resolved
* Update `index-state` and affected `cardano-ledger` version bounds:
`cardano-ledger` requires `plutus-ledger-api ^>=1.26.0`,
hence the `index-state` update
* Use `StandardCrypto` in protocol info tests:
`exampleConwayGenesis` was made monomorphic here:
IntersectMBO/cardano-ledger#4252
The `Crypto c` constraint was removed and now it uses
`StandardCrypto`.
* Add `plutusV3CostModel` to `Conway` genesis file
* Update `SupportsTwoPhaseValidation` instance for `Conway`:
`ConwayUtxowFailure` was fixed to get rid of the possibility
of injecting `UtxoFailure` in two separate ways
(as seen in the code removed by this commit)
* Use the updated behavior * Fixup haddock to reflect generality of protocol version update
Change in serialization is due to the addition of future `PParams` to the `LedgerState`
1bcb75e to
0fc34d8
Compare
| -- | Use 'MockCryptoCompatByron' so that bootstrap addresses and | ||
| -- bootstrap witnesses are supported. | ||
| type Crypto = MockCryptoCompatByron | ||
| type Crypto = StandardCrypto |
There was a problem hiding this comment.
This seems fine for now given that it is only about tests and those tests pass, but we should look into the exact implications of this change at some point (also see #1069 (comment)).
There was a problem hiding this comment.
The only difference between MockCryptoCompatByron and StandardCrypto is in the VRF and KES:
MockKESdoesn't do any evolution.MockKESandMockVRFare faster (see below).- The types involved in
MockKESandMockVRFare potentially simpler to construct (though we mostly useArbitraryinstances that are defined for anyCrypto). MockKESandMockVRFyield more compact output in QuickCheck counterexamples.
A small benchmark with hyperfine yields that the Cardano ThreadNet is now ~50% slower:
hyperfine -L crypto MockCryptoCompatByron,StandardCrypto './cardano-test-{crypto} -p "Cardano ThreadNet" --quickcheck-tests=2 --quickcheck-replay=0'| Command | Mean [s] | Min [s] | Max [s] | Relative |
|---|---|---|---|---|
MockCryptoCompatByron |
6.319 ± 1.329 | 5.350 | 9.020 | 1.00 |
StandardCrypto |
9.547 ± 2.617 | 7.489 | 15.095 | 1.51 ± 0.52 |
Overall CI time of the entire cardano-test suite didn't regress by the same factor as it does lots of other things (see Hydra), it seems to be longer by 20s from 5min20s to 5min40s.
Also, I don't think that the usage of StandardCrypto in ledger is absolutely necessary; it could be generalized to any Crypto c where just the hashes/signatures are constrained, but the VRF/KES is left unconstrained.
Given that larger changes in the crypto parameterization are planned1 I am inclined to leave the code as is for now.
Footnotes
-
See https://github.com/IntersectMBO/cardano-ledger/issues/4223, which would make all ledger definitions crypto-monomorphic, but removing KES/VRF from
Cryptoto sth likeHeaderCrypto, which would solve the issue at hand (asMockCryptoCompatByronandStandardCryptoonly differ in header crypto). ↩
| inspectLedger tlc before after = do | ||
| inspectLedger _tlc before after = do | ||
| guard $ updatesBefore /= updatesAfter | ||
| return $ LedgerUpdate $ ShelleyUpdatedProtocolUpdates updatesAfter | ||
| return $ LedgerUpdate updatesAfter | ||
| where | ||
| genesis :: SL.ShelleyGenesis (EraCrypto era) | ||
| genesis = shelleyLedgerGenesis (configLedger tlc) | ||
|
|
||
| updatesBefore, updatesAfter :: [ProtocolUpdate era] | ||
| updatesBefore = protocolUpdates genesis before | ||
| updatesAfter = protocolUpdates genesis after | ||
| updatesBefore, updatesAfter :: ShelleyLedgerUpdate era | ||
| updatesBefore = pparamsUpdate before | ||
| updatesAfter = pparamsUpdate after |
There was a problem hiding this comment.
FTR: With the new code, we will log one LedgerUpdate in every epoch (when we first tick across the Shelley voting deadline, ie 6k/f before the end of the epoch), even if nothing changed. This is in contrast to the previous state of the code. This seems fine to me, at least for now.
Related to IntersectMBO/cardano-node#5790