WIP: Dijkstra integration — bump deps to cardano-node 11.0.1 (stubbed)#462
Closed
Jimbo4350 wants to merge 2 commits into
Closed
WIP: Dijkstra integration — bump deps to cardano-node 11.0.1 (stubbed)#462Jimbo4350 wants to merge 2 commits into
Jimbo4350 wants to merge 2 commits into
Conversation
Removes the three CardanoSolutions/* source-repository-package forks (cardano-ledger, ouroboros-network, ouroboros-consensus) whose GetDRepDelegations / NodeToClientV_21 / queryDRepDelegations patches are now upstream in ouroboros-consensus 3.0.1, ouroboros-network 1.1, and cardano-ledger-conway 1.22.1. Adds `blockio +serialblockio` to drop the liburing system dependency.
ogmios:lib:ogmios now builds end-to-end (59/59 modules) against
cardano-node 11.0.1 / ouroboros-consensus 3.0.1 / ouroboros-network 1.1
/ cardano-ledger-core 1.20 / -conway 1.22.1 / -alonzo 1.15.
This commit only carries _mechanical_ adaptation + stubs marked with
`TODO(dijkstra): ...` `error` calls. None of the stubbed code paths are
functional at runtime — they exist solely to push the library through
typecheck so we can see the full surface area of what the dep bump
breaks before we start fixing things in earnest.
100 TODO(dijkstra) markers across 24 files. Major themes:
- Sh.body/wits/auxiliaryData -> Sh.stBody/stWits/stAuxData
(Alonzo: atBody/atWits/atAuxData/atIsValid; Conway: same pattern)
- Sh.txSeqTxns'/Al.txSeqTxns -> shelleyBlockBodyTxs/alonzoBlockBodyTxs
- Cardano.Ledger.Shelley.BlockChain -> .BlockBody
- Cardano.Ledger.Alonzo.TxSeq -> .BlockBody
- Cardano.Ledger.PoolParams -> Cardano.Ledger.State
- ppRewardAccount -> sppAccountAddress; pp* -> spp* prefix
- serialiseRewardAccount -> serialiseAccountAddress
- RewardAccount -> AccountAddress (constructor + type)
- upgradeTxBody moved Cardano.Ledger.Core -> Cardano.Ledger.Api.Tx.Body
- asTreasury/asReserves -> Ledger.casTreasury/casReserves
- Genesis (KeyRole) renamed to GenesisRole; type data KeyRole now
type-level only, so 'StakePool/'Staking/'Witness/'DRepRole/etc.
drop the tick prefix
- Ouroboros.Network.NodeToClient[.Version] -> Cardano.Network.NodeToClient
(cardano-diffusion); ogmios src goes through the local
Cardano.Network.Protocol.NodeToClient re-export
- NetworkConnectTracers: nctMuxTracer -> nctMuxTracers, retyped to
Mx.TracersWithBearer; outer type gains an `m` parameter
- CardanoCodecConfig gains a new Dijkstra slot
- new MonadEvaluate m constraint propagated through localChainSync /
localTxSubmission / localTxMonitor / localStateQuery / mkClient /
connectHealthCheckClient / newWebSocketApp; NFData a on localTxMonitor
- App monad derives MonadEvaluate
- Sh.Tx/Sh.ShelleyTx kinds gained a TxLevel param (use TopTx)
- Sh.RewardAccount, Ledger.PoolParams, Sh.ShelleyTxBody, Al.AlonzoTxBody
are now pattern synonyms, not types -> Ledger.AccountAddress /
Ledger.StakePoolParams / Ledger.TxBody Ledger.TopTx era
- Sh.WitVKey now in Cardano.Ledger.Keys.WitVKey
- encodeTx now matches on (Sh.MkShelleyTx x) for Shelley; Allegra /
Mary / Alonzo / Babbage / Conway equivalents stubbed (PR CardanoSolutions#461 uses
bodyTxL/witsTxL/auxDataTxL lenses; not adopted here yet)
- encodePParamsHKD stubbed in Shelley / Alonzo / Babbage / Conway —
sppKeyDeposit etc. now return Compact Coin; signature needs an
extra encodeCompact callback
- encodeAuxiliaryData / encodeScript in Alonzo stubbed —
Al.TimelockScript constructor removed in cardano-ledger-alonzo 1.15
- encodeGenesis Alonzo stubbed — AlonzoGenesis field types changed
(Maybe CostModels; Word32/Word16 vs Natural)
- withoutFutureParameters in Configuration stubbed —
UpgradeAlonzoPParams vs AlonzoExtraConfig
- All era PredicateFailure encoders stubbed (Shelley / Allegra /
Mary / Alonzo / Babbage / Conway) — NonEmpty / NonEmptySet
container types in ledger 1.18.1+, plus many constructor renames
(WithdrawalsNotInRewardsDELEGS removed, MissingRequiredSigners,
TriesToForgeADA, StakeKeyHasNonZeroRewardAccountBalanceDELEG ->
...HasNonZeroAccountBalanceDELEG, etc.)
- Rewards.rewardsProvenance / .circulation stubbed — ChainAccountState
/ ActiveStake / StakePoolSnapShot / NonZero Coin; mkPoolRewardInfo
arity changed
- Ledger.scriptPurposeInMostRecentEra stubbed — MostRecentEra is now
Dijkstra, needs an extra upgradePlutusPurposeAsIx step plus a new
AlonzoBasedEra arm
- EraTranslation: `instance Upgrade AlonzoTx ConwayEra` commented
out — AlonzoTx kind changed to `TxLevel -> Type -> Type`
- Json.encodeTx / Json.encodeSubmitTransactionError stubbed —
ApplyTxError is now a type only; pattern needs an accessor
- keepRedundantConstraint era-guard in TxSubmission / Query / TxMonitor
detuned (era constraint dropped) — must be re-armed against
DijkstraEra once Cardano.Ledger.Dijkstra.Era is wired in
- Dijkstra arms stubbed in fromEraIndex (Prelude), eraIndexToCardanoEra
(Health), toRawTxIdHash, GenTxDijkstra dispatch (TxSubmission
inputs/outputs)
- Werror cascades suppressed file-locally with
-Wno-{unused-imports,unused-matches,unused-top-binds,unused-imports,
incomplete-patterns,redundant-constraints,dodgy-imports/-exports,
deprecations,orphans} for the heavily-stubbed modules
Next step: each TODO(dijkstra) is a unit of real work. Recommended
approach is to walk the categories above starting from the most
isolated (Rewards, EraTranslation) and work outward to the encoders.
Member
|
Ola! Thanks for the PR but there's already a PR where this is taken care of: #461 |
Author
Member
|
Can we continue from the other PR though 🙏 , there is already a significant amount of work and reviews that went into that first one; we really need not to start over from scratch. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What's here
Two commits on top of master:
upgrade dependencies to cardano-node==11.0.1— clean dep bump (5 files, +62/-77):cardano-node 10.5.1 → 11.0.1cardano-ledger-conway 1.19.0.0 → ≥1.22.1.0ouroboros-consensus 0.27.0.0 → ^>=3.0.1ouroboros-network 0.21.3.0 → ^>=1.1io-classes 1.5.0.0 → ^>=1.8CardanoSolutions/*source-repository-package forks(
GetDRepDelegations/NodeToClientV_21/ etc.) — all upstream now inouroboros-consensus 3.0.1/ouroboros-network 1.1/cardano-ledger-conway 1.22.1validation < 1.2pin andblockio +serialblockio(drops theliburingbuild-time dependency)(
ouroboros-network-api→ouroboros-network:api, etc.)WIP: stub out source to compile against new deps— mechanical adaptation + stubs (30 files, +380/-1160).cabal build ogmios:lib:ogmios -j4succeeds.Major themes (each
TODO(dijkstra)is a unit of real work)type data KeyRole— tick-prefix dropped for'StakePool/'Staking/'Witness/ etc. across 5 files;'Genesis→GenesisRoleSh.body/.wits/.auxiliaryData→Sh.stBody/.stWits/.stAuxData;Al.body/ etc. →Al.atBody/ etc.;ppXxx→sppXxx;Sh.txSeqTxns'→Sh.shelleyBlockBodyTxs;Al.txSeqTxns→Al.alonzoBlockBodyTxsRewardAccount→AccountAddress;PoolParams→StakePoolParams;Sh.ShelleyTxBody/Al.AlonzoTxBody/ etc. (now pattern syns) →Ledger.TxBody Ledger.TopTx era;Sh.ShelleyTx era→Sh.Tx Ledger.TopTx eraCardano.Ledger.PoolParams→Cardano.Ledger.State;.Shelley.BlockChain→.Shelley.BlockBody;.Alonzo.TxSeq→.Alonzo.BlockBody;upgradeTxBodyfrom.Coreto.Api.Tx.Body;WitVKeytoCardano.Ledger.Keys.WitVKey;Ouroboros.Network.NodeToClient[.Version]→Cardano.Network.NodeToClient(cardano-diffusion)MonadEvaluate madded to 5 mini-protocol runners,mkClient,connectHealthCheckClient,newWebSocketApp;Appnewtype derivesMonadEvaluate;NFData aadded tolocalTxMonitorNetworkConnectTracersretyped —nctMuxTracer→nctMuxTracers, retyped toMx.TracersWithBearer; outer type gains anmparameter (currently stubbedundefined)CardanoCodecConfigDijkstra slot — stubbedundefinedfor the new 8th era arg in consensus 3.0.1Stubbed (still TODO; these are the real work units)
encodePParamsHKDShelley / Alonzo / Babbage / Conway (Compact Coin / newencodeCompactcallback); all eraencodeTxarms (lens migration needed per PR #461);encodeAuxiliaryData/encodeScriptAlonzo (Al.TimelockScriptctor removed);encodeGenesisAlonzo (AlonzoExtraConfigsplit); all PredicateFailure encoders (NonEmpty/NonEmptySetshifts + ctor renames likeWithdrawalsNotInRewardsDELEGS,TriesToForgeADA,MissingRequiredSigners,StakeKeyHasNonZeroRewardAccountBalanceDELEG→…HasNonZeroAccountBalanceDELEG);Rewards.rewardsProvenance/circulation(ChainAccountState/ActiveStake/StakePoolSnapShot/NonZero Coin;mkPoolRewardInfoarity);Ledger.scriptPurposeInMostRecentEra(needs Dijkstra arm + extraupgradePlutusPurposeAsIx);EraTranslationUpgrade AlonzoTx ConwayErainstance commented out (kind change toTxLevel -> Type -> Type; should follow PR #461 and useTx TopTx);encodeSubmitTransactionError/encodeTxdispatcher inJson.hs(ApplyTxErroris a type now, not a pattern);keepRedundantConstraintera guards detuned inQuery.hs/TxMonitor.hs(needsCardano.Ledger.Dijkstra.Erawired in to re-arm againstDijkstraEra);withoutFutureParametersinApp/Configuration.hs(AlonzoExtraConfig/UpgradeAlonzoPParamssplit +Maybe CostModels);Ledger.pmHash/drepDeposit/asReserves/asTreasury(Compact / ByteArray / accessor changes); Dijkstra branches infromEraIndex/eraIndexToCardanoEra/toRawTxIdHash/inputs/outputs.Werror suppressions
To keep the build green with the stubs in place, these files have file-local
-Wno-…pragmas (mostlyunused-imports/unused-matches/unused-top-binds/incomplete-patterns/redundant-constraints/dodgy-imports/dodgy-exports/deprecations/orphans):Rewards.hs,EraTranslation.hs,Shelley.hs/Allegra.hs/Mary.hs/Alonzo.hs/Babbage.hs/Conway.hs(Json),Query.hs,Json.hs,Orphans.hs, all 6 PredicateFailure modules,App/Configuration.hs,App/Protocol/TxMonitor.hs,App/Protocol/TxSubmission.hs. Each pragma carries aTODO(dijkstra)note explaining why.Open questions for review
encodeTxmigration that PR Add cardano-node 11.0.1 support #461 chose vs unwrappingMkShelleyTx— preferences before I commit to a direction across all 6 era encoders?EraTranslationUpgradeinstances: PR Add cardano-node 11.0.1 support #461 replacesAlonzoTx/BabbageTx/ etc. with the genericTx TopTxfromCardano.Ledger.Core. Sound approach?keepRedundantConstraintera-guard hack — should that move toDijkstraEraonce we add thecardano-ledger-dijkstradep, or replace with something else?Plumbing the rest of Dijkstra (new modules
Ogmios.Data.Json.Dijkstra/Ogmios.Data.Ledger.PredicateFailure.Dijkstra; era added to dispatchers; JSONschema updates) is intentionally deferred to keep this draft focused on
"what does the dep bump alone break".
🤖 Note: build adaptation generated with Claude Code under my supervision.