Skip to content

WIP: Dijkstra integration — bump deps to cardano-node 11.0.1 (stubbed)#462

Closed
Jimbo4350 wants to merge 2 commits into
CardanoSolutions:masterfrom
Jimbo4350:jmillar/dijkstra-integration
Closed

WIP: Dijkstra integration — bump deps to cardano-node 11.0.1 (stubbed)#462
Jimbo4350 wants to merge 2 commits into
CardanoSolutions:masterfrom
Jimbo4350:jmillar/dijkstra-integration

Conversation

@Jimbo4350
Copy link
Copy Markdown

⚠️ This is a WIP/exploration draft. 30 source files contain TODO(dijkstra)
stubs (error "..." placeholders, ~100 sites). The library typechecks against
the new dep stack but most runtime code paths are non-functional.
Opened to discuss the migration surface before doing the real work.

What's here

Two commits on top of master:

  1. upgrade dependencies to cardano-node==11.0.1 — clean dep bump (5 files, +62/-77):

    • cardano-node 10.5.1 → 11.0.1
    • cardano-ledger-conway 1.19.0.0 → ≥1.22.1.0
    • ouroboros-consensus 0.27.0.0 → ^>=3.0.1
    • ouroboros-network 0.21.3.0 → ^>=1.1
    • io-classes 1.5.0.0 → ^>=1.8
    • Removes the three CardanoSolutions/* source-repository-package forks
      (GetDRepDelegations / NodeToClientV_21 / etc.) — all upstream now in ouroboros-consensus 3.0.1 / ouroboros-network 1.1 / cardano-ledger-conway 1.22.1
    • Adds validation < 1.2 pin and blockio +serialblockio (drops the
      liburing build-time dependency)
    • hpack-regenerated cabal files for the sub-library rename
      (ouroboros-network-apiouroboros-network:api, etc.)
  2. WIP: stub out source to compile against new deps — mechanical adaptation + stubs (30 files, +380/-1160). cabal build ogmios:lib:ogmios -j4 succeeds.

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; 'GenesisGenesisRole
  • Accessor renamesSh.body / .wits / .auxiliaryDataSh.stBody / .stWits / .stAuxData; Al.body / etc. → Al.atBody / etc.; ppXxxsppXxx; Sh.txSeqTxns'Sh.shelleyBlockBodyTxs; Al.txSeqTxnsAl.alonzoBlockBodyTxs
  • Type renamesRewardAccountAccountAddress; PoolParamsStakePoolParams; Sh.ShelleyTxBody / Al.AlonzoTxBody / etc. (now pattern syns) → Ledger.TxBody Ledger.TopTx era; Sh.ShelleyTx eraSh.Tx Ledger.TopTx era
  • Module relocationsCardano.Ledger.PoolParamsCardano.Ledger.State; .Shelley.BlockChain.Shelley.BlockBody; .Alonzo.TxSeq.Alonzo.BlockBody; upgradeTxBody from .Core to .Api.Tx.Body; WitVKey to Cardano.Ledger.Keys.WitVKey; Ouroboros.Network.NodeToClient[.Version]Cardano.Network.NodeToClient (cardano-diffusion)
  • Constraint propagationMonadEvaluate m added to 5 mini-protocol runners, mkClient, connectHealthCheckClient, newWebSocketApp; App newtype derives MonadEvaluate; NFData a added to localTxMonitor
  • NetworkConnectTracers retypednctMuxTracernctMuxTracers, retyped to Mx.TracersWithBearer; outer type gains an m parameter (currently stubbed undefined)
  • CardanoCodecConfig Dijkstra slot — stubbed undefined for the new 8th era arg in consensus 3.0.1

Stubbed (still TODO; these are the real work units)

encodePParamsHKD Shelley / Alonzo / Babbage / Conway (Compact Coin / new encodeCompact callback); all era encodeTx arms (lens migration needed per PR #461); encodeAuxiliaryData / encodeScript Alonzo (Al.TimelockScript ctor removed); encodeGenesis Alonzo (AlonzoExtraConfig split); all PredicateFailure encoders (NonEmpty / NonEmptySet shifts + ctor renames like WithdrawalsNotInRewardsDELEGS, TriesToForgeADA, MissingRequiredSigners, StakeKeyHasNonZeroRewardAccountBalanceDELEG…HasNonZeroAccountBalanceDELEG); Rewards.rewardsProvenance / circulation (ChainAccountState / ActiveStake / StakePoolSnapShot / NonZero Coin; mkPoolRewardInfo arity); Ledger.scriptPurposeInMostRecentEra (needs Dijkstra arm + extra upgradePlutusPurposeAsIx); EraTranslation Upgrade AlonzoTx ConwayEra instance commented out (kind change to TxLevel -> Type -> Type; should follow PR #461 and use Tx TopTx); encodeSubmitTransactionError / encodeTx dispatcher in Json.hs (ApplyTxError is a type now, not a pattern); keepRedundantConstraint era guards detuned in Query.hs / TxMonitor.hs (needs Cardano.Ledger.Dijkstra.Era wired in to re-arm against DijkstraEra); withoutFutureParameters in App/Configuration.hs (AlonzoExtraConfig / UpgradeAlonzoPParams split + Maybe CostModels); Ledger.pmHash / drepDeposit / asReserves / asTreasury (Compact / ByteArray / accessor changes); Dijkstra branches in fromEraIndex / eraIndexToCardanoEra / toRawTxIdHash / inputs / outputs.

Werror suppressions

To keep the build green with the stubs in place, these files have file-local
-Wno-… pragmas (mostly unused-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 a TODO(dijkstra) note explaining why.

Open questions for review

  1. The lens-based encodeTx migration that PR Add cardano-node 11.0.1 support #461 chose vs unwrapping MkShelleyTx — preferences before I commit to a direction across all 6 era encoders?
  2. EraTranslation Upgrade instances: PR Add cardano-node 11.0.1 support #461 replaces AlonzoTx / BabbageTx / etc. with the generic Tx TopTx from Cardano.Ledger.Core. Sound approach?
  3. Same for the keepRedundantConstraint era-guard hack — should that move to DijkstraEra once we add the cardano-ledger-dijkstra dep, 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; JSON
schema 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.

Jimbo4350 added 2 commits May 19, 2026 17:18
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.
@KtorZ
Copy link
Copy Markdown
Member

KtorZ commented May 20, 2026

Ola! Thanks for the PR but there's already a PR where this is taken care of: #461

@KtorZ KtorZ closed this May 20, 2026
@Jimbo4350
Copy link
Copy Markdown
Author

Jimbo4350 commented May 20, 2026

Ola! Thanks for the PR but there's already a PR where this is taken care of: #461

Hey 👋 @KtorZ , they've asked me to take it over. I'll open a PR on my fork first for testing/reviewing etc.

@KtorZ
Copy link
Copy Markdown
Member

KtorZ commented May 20, 2026

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants