Skip to content

Add cardano-node 11.0.1 support#461

Draft
johnalotoski wants to merge 27 commits into
CardanoSolutions:masterfrom
johnalotoski:feature/node-11.0
Draft

Add cardano-node 11.0.1 support#461
johnalotoski wants to merge 27 commits into
CardanoSolutions:masterfrom
johnalotoski:feature/node-11.0

Conversation

@johnalotoski
Copy link
Copy Markdown

@johnalotoski johnalotoski commented May 12, 2026

Add support for cardano-node 11.0.1 and the Dijkstra era (protocol version 12).

The changes in this PR were generated by Claude and are being reviewed by @erikd.

Dependencies & CI

  • Bump cabal.project constraints: cardano-node == 11.0.1, ouroboros-consensus ^>= 3.0.1, cardano-ledger-conway >= 1.22.1
  • Update hackage and CHaP index-state to 2026-05-08
  • Pin validation < 1.2 to avoid breaking API change in validation-1.2
  • Update Dockerfile, CI workflows, and README for node 11.0.1

Dijkstra era support

  • Add ShelleyBasedEraDijkstra / QueryIfCurrentDijkstra pattern matches across all encoding, decoding, query, and predicate failure modules
  • Introduce Ogmios.Data.Json.Dijkstra with CBOR bridge functions for safe type conversion between nominally distinct Dijkstra and Conway ledger types
  • Update era indices, codec configs, and the Prelude era list
  • Adapt Rewards module to new ledger API types (NonZero, ChainAccountState, StakeWithDelegation)
  • Add dijkstra to JSON schemas (Era, Block<Praos>, DeserialisationFailure)

GetDRepDelegations query restored

  • Re-enable GetDRepDelegations query (now available via NodeToClientV_23 in node 11.0.1)
  • Switch delegateRepresentatives from SomeCompoundQuery with empty delegation map to SomeCompound2Query with real delegation data
  • Delegator lists for AlwaysAbstain and AlwaysNoConfidence DReps are now populated correctly

Test & schema fixes

  • Update test generators, specs, and orphan instances for Dijkstra era
  • Add Dijkstra entry to deserialization failure test data
  • Fix BootstrapVote voter schema to use ExtendedVerificationKey (128 hex chars) instead of VerificationKey (64 hex chars)
  • Update all test vector JSON files
  • Add deprecation pragma comment for GetStakeDistributionGetStakeDistribution2 migration

Known limitations

  • Dijkstra block generation excluded from ChainSync unit tests due to CBOR codec mismatch in the mock peer (upstream Arbitrary instances produce blocks incompatible with the HardFork combinator codec)
  • GetStakeDistribution is deprecated in favor of GetStakeDistribution2; suppressed via -fno-warn-deprecations pragma pending migration

Test plan

  • cabal build exe:ogmios succeeds
  • cabal test ogmios:test:unit passes (140/140)
  • Verified with multiple random seeds to catch flaky schema validation

Copilot AI review requested due to automatic review settings May 12, 2026 23:24
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

TxOutInAnyEra (ShelleyBasedEraConway, out) ->
Babbage.encodeTxOut includeAllCbor out
TxOutInAnyEra (ShelleyBasedEraDijkstra, out) ->
Babbage.encodeTxOut includeAllCbor (unsafeCoerce out :: BabbageTxOut ConwayEra)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am working with @johnalotoski on this. We are pretty certain this use of unsafeCoerce is not legit and are investigating better options.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dijkstra.encodeTxOut ... + Dijkstra module & related encoders to be defined.

@johnalotoski johnalotoski marked this pull request as draft May 12, 2026 23:56
@erikd
Copy link
Copy Markdown

erikd commented May 13, 2026

The two workflows needing approval do not need to be run while this PR is still in Draft.

Comment thread server/cabal.project Outdated
-- NOTE: GetDRepDelegations query and associated patches are now upstream
-- in cardano-node 11.0.1 (ouroboros-consensus 3.0.1, cardano-ledger-conway >= 1.22.1).
-- The previous source-repository-package patches for cardano-ledger,
-- ouroboros-network, and ouroboros-consensus have been removed.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Shall rather be a commit message than a comment. In 3 months, that comment is going to look very off taken in isolation.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in a commit; we could fixup that into the original commit on a final pass if you prefer.

Comment on lines +192 to +208
withoutFutureParameters sourceParamNames genesis =
case extraConfig genesis of
Nothing -> genesis
Just (AlonzoExtraConfig maybeCostModels) ->
case maybeCostModels of
Nothing -> genesis
Just cms ->
let pruned = Map.adjust pruneCostModel Ledger.PlutusV1 (Ledger.costModelsValid cms)
cms' = Ledger.mkCostModels pruned
in genesis { extraConfig = Just (AlonzoExtraConfig (Just cms')) }
where
pruneCostModel cm =
case Ledger.mkCostModel Ledger.PlutusV1 (Map.elems prunedParams) of
Right cm' -> cm'
Left _ -> cm
where
prunedParams = Map.restrictKeys (Ledger.costModelToMap cm) sourceParamNames
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably also needed for V2 and V3 now, given that this release is adding new builtins. To be tested.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude "thinks" no code change is required for this due to:

  - Conway+ decoders (protocol version 9+) already handle variable-length cost model lists, so the V1 padding workaround isn't needed for V2/V3
  - This Ogmios PR has been lightly tested against preview (PV11, post-hard fork) without cost model decode issues

Do you have suggestions for further tests that should be run?

Nothing
in
sameEra <|> babbageToConway
sameEra <|> babbageToConway <|> conwayToDijkstra <|> babbageToDijkstra
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe only conwayToDijsktra is needed here.


-- Selector for the Dijkstra era.
-> ( HoistQuery Praos DijkstraEra -> LSQ.ClientStAcquired block (Point block) (Query block) m ()
)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be a rotation happening with each era. Babbage is now old enough to be removed, in favor of Conway and Dijkstra.

Comment thread docs/static/cardano.json
johnalotoski and others added 11 commits May 14, 2026 00:05
Update cabal.project constraints, index-state, and dependency bounds
for cardano-node 11.0.1 (ouroboros-consensus 3.0.1, cardano-ledger-conway
>= 1.22.1). Update Dockerfile, CI workflows, and JSON schemas to
reference the new node version and include the Dijkstra era.

Co-Authored-By: Claude <noreply@anthropic.com>
Add ShelleyBasedEraDijkstra and QueryIfCurrentDijkstra pattern matches
across all encoding, decoding, query, and predicate failure modules.
Introduce Ogmios.Data.Json.Dijkstra with CBOR bridge functions for
type conversion between the nominally distinct Dijkstra and Conway
ledger types. Update era indices, codec configs, and the Prelude era
list. Adapt Rewards module to new ledger API types (NonZero,
ChainAccountState, StakeWithDelegation). Re-enable GetDRepDelegations
query now that NodeToClientV_23 is available in cardano-node 11.0.1.

Co-Authored-By: Claude <noreply@anthropic.com>
Update test generators, specs, and orphan instances to include
Dijkstra era patterns. Add Dijkstra entry to deserialization failure
test data. Fix BootstrapVote voter schema to use ExtendedVerificationKey.
Update all test vector JSON files for the new era.

Co-Authored-By: Claude <noreply@anthropic.com>
Use upgradeTxOut and fmap upgrade for BabbageTxOut and UTxO
Dijkstra era translations instead of unsafeCoerce.

Co-Authored-By: Claude <noreply@anthropic.com>
Add encodeMempoolFailure for Dijkstra era and two new predicate
failures (PointerAddressInCollateralReturn, SpendingOutputFromSubTransaction)
rather than unsafeCoercing through Conway's encodeLedgerFailure.

Co-Authored-By: Claude <noreply@anthropic.com>
…icateFailure

Add ~400 lines of Dijkstra-era encoding functions (encodeTxOut,
encodeNativeScript, encodeDelegCert, encodeScriptPurpose, etc.)
so PredicateFailure.hs can use them instead of unsafeCoercing
through Conway encoders.

Co-Authored-By: Claude <noreply@anthropic.com>
Add encodePParams, encodeUtxo, encodeGovActionState, and govProposals
to Dijkstra.hs. Replace all unsafeCoerce in Query.hs with these
proper Dijkstra-era encoders.

Co-Authored-By: Claude <noreply@anthropic.com>
Align with the two-letter era alias convention used throughout
the codebase (Sh, Al, Ba, Cn). Also qualify Cardano.Ledger.Core
as Ledger.Core for clarity.

Co-Authored-By: Claude <noreply@anthropic.com>
…Dijkstra

Remove babbageToConway and babbageToDijkstra translation paths,
keeping only sameEra and conwayToDijkstra as suggested in review.

Co-Authored-By: Claude <noreply@anthropic.com>
Babbage is old enough to be removed per era rotation policy.
Route Babbage transactions to unsupportedEra, keeping only
Conway and Dijkstra as active evaluation eras.

Co-Authored-By: Claude <noreply@anthropic.com>
The GetDRepDelegations patch history note is better suited to
commit message than an inline comment that will lack context over time.

The SRPs were removed and are now obtained directly from CHaP.

Co-Authored-By: Claude <noreply@anthropic.com>
]
[ GenTxIdAlonzo (ShelleyTxId id)
, GenTxIdMary (ShelleyTxId id)
]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would break mainnet and preprod unfortunately. I'll fix.

Copy link
Copy Markdown
Author

@johnalotoski johnalotoski May 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possibly addressed by: e04b610 (amended)

Comment thread server/src/Ogmios/Data/Json/Dijkstra.hs Outdated
)

-- | Encode a Dijkstra transaction by converting to Conway via CBOR roundtrip.
-- Dijkstra and Conway share the same CBOR wire format, so this is safe.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is a lie 😬 ....

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

I have caught Claude in a lie/halucination before. It seems that somewhere in its training data it found the term "same wire format" and uses that where ever it can. Same with unsafeCoerce (otherwise known as "turn off the type checker completely for now and all time").

@KtorZ
Copy link
Copy Markdown
Member

KtorZ commented May 15, 2026

@johnalotoski @erikd, I've made a first round of review fixing various stuff and in particular implementing a proper JSON encoding for the Dijkstra transaction body.

I have to say it is really painful to have to deal with Dijkstra changes when the hard fork does not even enable Dijkstra.

I've left a few FIXMEs if you wanna help further. I'll otherwise continue on this when time allows. Likely not this week.

erikd and others added 2 commits May 14, 2026 21:12
…ields

- Replace downgradePParamsHKD with native encoder exposing real
  Dijkstra ref-script parameters (refScriptCostStride,
  refScriptCostMultiplier, maxRefScriptSizePerTx,
  maxRefScriptSizePerBlock)
- Wire up guards field via guardsTxBodyL replacing reqSignerHashesTxBodyL
- Wire up directDeposits and accountBalanceIntervals TxBody fields
- Fix DijkstraUnRegCert incorrectly mapped to ConwayRegCert
- Fix stale module comment referencing CBOR roundtrip

Co-Authored-By: Claude <noreply@anthropic.com>
@johnalotoski
Copy link
Copy Markdown
Author

@johnalotoski @erikd, I've made a first round of review fixing various stuff and in particular implementing a proper JSON encoding for the Dijkstra transaction body. I have to say it is really painful to have to deal with Dijkstra changes when the hard fork does not even enable Dijkstra. I've left a few FIXMEs if you wanna help further. I'll otherwise continue on this when time allows. Likely not this week.

Hi @KtorZ, we pushed a couple more commits, but I think we could probably use some clarification on direction to try and stay on the correct path. Here are some questions which might help. Also if you see other blind spots we seem to have, feel free to offer any additional pointers or constraints we may be missing context for that we should be aware of.

  1. Timing — Is any of the Dijkstra-specific work (beyond basic compatibility) needed before PV11 ships, or can it wait?

Other questions which may be moot depending on the answer to (1):

  1. encodeCbor @ConwayEra in encodeTx — It looks like no Dijkstra encoding path uses withCurrentEncodingVersion, so the protocol version passed to serialize' is threaded but never inspected, making @ConwayEra vs @DijkstraEra produce identical CBOR output. Can you confirm this is the case and @ConwayEra is intentional (or just cosmetic)?

  2. minFeeReferenceScripts schema — Conway nests range and multiplier inside this object. In Dijkstra they're independent PParams (HKD-wrapped, separately updatable). Should they stay nested with real values, or become top-level keys like refScriptCostStride / refScriptCostMultiplier?

  3. "guards" vs "requiredExtraSignatories" — Guards replace required signers but are a superset (can include script hashes). New field name, or keep the old name and filter to key hashes only (like reqSignerHashesTxBodyG does)?

  4. Inclusive/Exclusive bounds on accountBalanceIntervals — Should the JSON indicate bound type explicitly, or is it implicit (lower always inclusive, upper always exclusive)?

  5. Sub-transactions — Are these needed in Ogmios now, or can they be stubbed until closer to PV12 hard fork? If needed, is the shape right (no spends/isValid, no fee/collateral, adds requiredTopLevelGuards)?

  6. Native PParams encoder vs downgradePParamsHKD — Acceptable as-is (~70 lines), or would you prefer refactoring Conway's encoder to accept callbacks for the variable fields?

  7. accountBalanceIntervals entry shape — Each entry uses encodeCredential which produces a "from" key (credential type) alongside "account", "lowerBound", "upperBound". Is this the right structure, or should the credential be nested?

@KtorZ
Copy link
Copy Markdown
Member

KtorZ commented May 15, 2026

@johnalotoski

  1. I believe most of it could wait; though if we ship a version that's already capable of speaking Dijkstra, then we shall either error properly (which is work to be done, and undone later); or implement Dijkstra properly. I usually prefer the latter. The ideal scenario would be for the node to not force Dijkstra into every downstream dependencies until ready, but hey, I've given up believing in this world.

  2. The era type parameter is used to determined protocol version; using eraProtVerLow; Note that the function comes from Ogmios' prelude; not cardano-ledger. This should be @DijkstraEra if encoding a Dijkstra transaction.

  3. Nested; otherwise we break the API. Plus, Ogmios has a few opinionated changes like this, and it doesn't necessarily strictly follow choices made in the Haskell implementation.

  4. I'd keep the signers where they are indeed; but add a new field for script guards; otherwise that's also an API breaking change.

  5. Ideally, I would encode that in the field name: greaterThanOrEqualTo, strictlyLessThan. Also, no need to encode this as a sum with a tag. The two fields can already encode the 3 representations; though the JSON schema may explicitly use a oneof to indicate that there are really 3 possibilities.

  6. I don't how "stable" they are at the moment, and whether there will be a lot of unwind. My gut feeling is that it's probably good to implement what's available now already.

  7. I try to limit duplication where I can unless it gets to messy. The higher-kinded types, type and data families make it very unpractical sometimes. So if there are only few changes, I usually prefer to inject the behaviour via a parameter, but when there are too many (e.g. encodeTxBody), then I rewrite the whole encoding, carefully inspecting the resulting schema (and the JSON schema validation helps greatly in that regard). For the protocol parameters, they are particularly painful, but they seem mostly additive, no ?

  8. a list with encodeCredential indeed, to distinguish between keys and scripts. For the other fields, see (5).

Thanks 🫶

johnalotoski and others added 4 commits May 16, 2026 17:38
- Extract shared TxBody fields into encodeSharedTxBody
- Add encodeSubTx and encodeSubTxBody for Tx SubTx DijkstraEra
- Encode requiredTopLevelGuards in sub-transaction bodies
- Pass MetadataFormat through encodeTxBody for sub-tx metadata

Note: TopTx-only fields (collaterals, fee) are appended after
shared fields rather than interleaved in Conway's original order.
This is a trade-off for code sharing via encodeSharedTxBody —
JSON objects are unordered by spec so no client impact.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Preserves the existing requiredExtraSignatories field by filtering
guard credentials to key hashes only (matching reqSignerHashesTxBodyG).
Script hash guards are exposed via a new requiredExtraGuards field.

Co-Authored-By: Claude <noreply@anthropic.com>
Rename lowerBound/upperBound to greaterThanOrEqualTo/strictlyLessThan
to make the inclusive/exclusive semantics explicit in the JSON field
names.

Co-Authored-By: Claude <noreply@anthropic.com>
@johnalotoski
Copy link
Copy Markdown
Author

Hi @KtorZ -- we've pushed some more work based on that guidance above. We'll stay attentive to new comments, thank you!

johnalotoski and others added 8 commits May 19, 2026 00:37
Gate Dijkstra behind nodeToClientV > V_23 since V_23 is the latest
NodeToClientVersion in ouroboros-consensus 3.0.1.0 and is negotiated
by all networks with node 11.0.1.

On Dijkstra networks (future V_24+), Dijkstra is tried first. On
Conway networks, Conway is tried first. Each list is ordered from
most probable era to least probable.

Verified on preview and preprod that GenTxIdDijkstra does not crash
the node (returns false, loop continues), so this is a performance
optimization to avoid unnecessary round-trips on non-Dijkstra
networks.

Co-Authored-By: Claude <noreply@anthropic.com>
Both full PParams and PParamsUpdate nest range and multiplier inside
minFeeReferenceScripts to preserve Conway's API shape. For full
PParams, all three sub-fields are always present. For updates, only
the sub-fields being updated are included, and the key is omitted
entirely when none of the three are updated.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Add schema definitions for new Dijkstra era fields:
- Transaction: requiredExtraGuards, directDeposits,
  accountBalanceIntervals, subTransactions, requiredTopLevelGuards
- ProtocolParameters: maxReferenceScriptsSizePerBlock
- New types: AccountBalanceInterval (with oneOf for bound variants),
  TopLevelGuard, SubTransaction

New JSON field names introduced across all Dijkstra commits:

  Transaction body (TopTx):
  - requiredExtraGuards: script hash guards (new Dijkstra field)
  - directDeposits: account address to coin map
  - accountBalanceIntervals: list of interval constraints per account
  - subTransactions: nested sub-transactions
  - fee: moved to TopTx-only (SubTx has no fee)

  Transaction body (SubTx):
  - requiredTopLevelGuards: guard credentials with optional datums

  AccountBalanceInterval fields:
  - greaterThanOrEqualTo: inclusive lower bound (coin)
  - strictlyLessThan: exclusive upper bound (coin)

  TopLevelGuard fields:
  - credential: guard credential (key hash or script hash)
  - datum: optional inline datum

  ProtocolParameters:
  - maxReferenceScriptsSizePerBlock: new Dijkstra param

  Script purpose enum:
  - "guard": new Dijkstra script purpose

  Error codes:
  - 3169: PointerAddressInCollateralReturn
  - 3170: SpendingOutputFromSubTransaction

Co-Authored-By: Claude <noreply@anthropic.com>
- Add GenTxIdDijkstra to genGenTxId
- Add Dijkstra context error to genContextError
- Add Dijkstra-era MissingScript to genScriptFailure
- Add "guard" to script purpose enum in cardano.json
- Remove stale FIXME comment in Generators.hs
- Regenerate EvaluateTransactionResponse test vectors

Co-Authored-By: Claude <noreply@anthropic.com>
Schema fixes for Dijkstra-era validation:
- Add SubmitTransactionFailure entries: 3169 (PointerAddressInCollateralReturn),
  3170 (SpendingOutputFromSubTransaction)
- Add ScriptPurpose<Guard> and Clause<Guard> to cardano.json
- Fix AccountBalanceInterval: use anyOf instead of oneOf
- Make ProposedProtocolParameters minFeeReferenceScripts sub-fields optional

Enable Dijkstra ApplyTxError generator and Dijkstra GenTx generator.
GenTx uses genDijkstraShelleyTx which strips sub-transactions to
avoid MemoBytes CBOR round-trip failures in mock protocol peers.

Dijkstra block generation remains excluded: randomly generated blocks
fail CBOR round-tripping in the ChainSync mock peer, likely due to
block header/body hash inconsistency. The consensus codec itself
supports Dijkstra's 5-segment block body.

Add test dependencies: cardano-data, cardano-ledger-dijkstra:testlib.
Import Dijkstra Arbitrary instances.

Co-Authored-By: Claude <noreply@anthropic.com>
Prefer oneOf vs anyOf for the interval representations.
Use mutual exclusion (not/required) to make oneOf entries
non-overlapping when both bounds are present.

Co-Authored-By: Claude <noreply@anthropic.com>
utxoFromMempool initialized with UTxOInBabbageEra, causing all
evaluations to hit the Babbage rejection branch even for Conway
transactions. Changed to UTxOInConwayEra.

Reorder deserialiseCBOR to try Conway and Dijkstra before Babbage.
Conway transactions can successfully deserialize as Babbage (the
Babbage decoder accepts Conway-era CBOR), wrapping them as
GenTxBabbage and rejecting them as "unsupported era". Older eras
kept as fallbacks for specific diagnostics.

Use eraProtVerHigh in transaction deserialization to accept
transactions from any protocol version within an era (e.g.
Conway PV9 through PV11).

Co-Authored-By: Claude <noreply@anthropic.com>
Jimbo4350 added a commit to Jimbo4350/ogmios that referenced this pull request May 20, 2026
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.
Jimbo4350 added a commit to Jimbo4350/ogmios that referenced this pull request May 20, 2026
This commit carries the rest of the dependency-bump scaffolding
inherited from the original WIP (2c0fb8e...) — the parts not
yet replaced by real Dijkstra implementations in the preceding
commits. Everything here is mechanical adaptation + stubs marked
with `TODO(dijkstra): ...` / `error` placeholders to keep the
build green; none of the stubbed code paths are functional at
runtime.

What remains in this commit (23 files):

- Per-era PredicateFailure encoders (Shelley / Allegra / Mary /
  Alonzo / Babbage / Conway), Data.Ledger.PredicateFailure
- Json encoders for Shelley / Allegra / Mary / Alonzo / Babbage /
  Conway / Orphans / Query, Ogmios.Data.Json itself
- Ogmios.Data.Ledger.Rewards (rewardsProvenance, circulation —
  ChainAccountState / ActiveStake / StakePoolSnapShot / NonZero
  Coin shape changes; mkPoolRewardInfo arity)
- App.Configuration (withoutFutureParameters — UpgradeAlonzoPParams
  vs AlonzoExtraConfig split + Maybe CostModels)
- App.Health, Data.Health, App.Server.WebSocket, Ogmios.Control
- NodeToClient.Trace

Themes the stubs cover (~93 TODO(dijkstra) markers, file-local
-Wno- pragmas on the heavily-stubbed modules):

- Sh.body / .wits / .auxiliaryData -> Sh.stBody / .stWits /
  .stAuxData; Alonzo at*; Conway pattern
- Sh.txSeqTxns' / Al.txSeqTxns -> shelleyBlockBodyTxs /
  alonzoBlockBodyTxs (lens-based shape)
- 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  Cardano.Ledger.Core -> .Api.Tx.Body
- asTreasury / asReserves -> Ledger.casTreasury / casReserves
- type data KeyRole now type-level only (drop tick prefixes:
  'StakePool / 'Staking / 'Witness / 'DRepRole / etc.)
- Tx kind: now `TxLevel -> Type -> Type`; use TopTx
- 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)
- 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 ledger-alonzo 1.15)
- encodeGenesis Alonzo stubbed (AlonzoGenesis field types changed:
  Maybe CostModels; Word32/Word16 vs Natural)
- All era PredicateFailure encoders stubbed (NonEmpty / NonEmptySet
  container types in ledger 1.18.1+; many constructor renames:
  WithdrawalsNotInRewardsDELEGS removed; MissingRequiredSigners,
  TriesToForgeADA; StakeKeyHasNonZeroRewardAccountBalanceDELEG ->
  ...HasNonZeroAccountBalanceDELEG; etc.)
- Json.encodeTx / encodeSubmitTransactionError stubbed
  (ApplyTxError is a type only; pattern needs an accessor)
- Dijkstra arms still stubbed in fromEraIndex (Prelude),
  eraIndexToCardanoEra (Health), toRawTxIdHash

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, App.Configuration) and work outward to the
encoders.
Jimbo4350 added a commit to Jimbo4350/ogmios that referenced this pull request May 21, 2026
Residual scaffolding from the dependency-bump that hasn't been
replaced by real Dijkstra implementations yet. Everything here is
mechanical adaptation + stubs marked with `TODO(dijkstra): ...` /
`error` placeholders to keep the build green; none of the stubbed
code paths are functional at runtime.

What remains (19 files):

- Per-era PredicateFailure encoders (Shelley / Allegra / Mary /
  Alonzo / Babbage / Conway), Data.Ledger.PredicateFailure
- Json encoders for Shelley / Allegra / Mary / Alonzo / Babbage /
  Conway / Orphans / Query, Ogmios.Data.Json itself
- Ogmios.Data.Ledger.Rewards (rewardsProvenance, circulation —
  ChainAccountState / ActiveStake / StakePoolSnapShot / NonZero
  Coin shape changes; mkPoolRewardInfo arity)
- App.Configuration (withoutFutureParameters — UpgradeAlonzoPParams
  vs AlonzoExtraConfig split + Maybe CostModels)
- Data.Health (eraIndexToCardanoEra Dijkstra arm stubbed)

Themes the stubs cover (~93 TODO(dijkstra) markers, file-local
-Wno- pragmas on the heavily-stubbed modules):

- Sh.body / .wits / .auxiliaryData -> Sh.stBody / .stWits /
  .stAuxData; Alonzo at*; Conway pattern
- Sh.txSeqTxns' / Al.txSeqTxns -> shelleyBlockBodyTxs /
  alonzoBlockBodyTxs (lens-based shape)
- 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  Cardano.Ledger.Core -> .Api.Tx.Body
- asTreasury / asReserves -> Ledger.casTreasury / casReserves
- type data KeyRole now type-level only (drop tick prefixes:
  'StakePool / 'Staking / 'Witness / 'DRepRole / etc.)
- Tx kind: now `TxLevel -> Type -> Type`; use TopTx
- 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)
- 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 ledger-alonzo 1.15)
- encodeGenesis Alonzo stubbed (AlonzoGenesis field types changed:
  Maybe CostModels; Word32/Word16 vs Natural)
- All era PredicateFailure encoders stubbed (NonEmpty / NonEmptySet
  container types in ledger 1.18.1+; many constructor renames:
  WithdrawalsNotInRewardsDELEGS removed; MissingRequiredSigners,
  TriesToForgeADA; StakeKeyHasNonZeroRewardAccountBalanceDELEG ->
  ...HasNonZeroAccountBalanceDELEG; etc.)
- Json.encodeTx / encodeSubmitTransactionError stubbed
  (ApplyTxError is a type only; pattern needs an accessor)
- Dijkstra arm stubbed in eraIndexToCardanoEra (Health)

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, App.Configuration) and work outward to the
encoders.
Jimbo4350 added a commit to Jimbo4350/ogmios that referenced this pull request May 21, 2026
Residual scaffolding from the dependency-bump that hasn't been
replaced by real Dijkstra implementations yet. Everything here is
mechanical adaptation + stubs marked with `TODO(dijkstra): ...` /
`error` placeholders to keep the build green; none of the stubbed
code paths are functional at runtime.

What remains (19 files):

- Per-era PredicateFailure encoders (Shelley / Allegra / Mary /
  Alonzo / Babbage / Conway), Data.Ledger.PredicateFailure
- Json encoders for Shelley / Allegra / Mary / Alonzo / Babbage /
  Conway / Orphans / Query, Ogmios.Data.Json itself
- Ogmios.Data.Ledger.Rewards (rewardsProvenance, circulation —
  ChainAccountState / ActiveStake / StakePoolSnapShot / NonZero
  Coin shape changes; mkPoolRewardInfo arity)
- App.Configuration (withoutFutureParameters — UpgradeAlonzoPParams
  vs AlonzoExtraConfig split + Maybe CostModels)
- Data.Health (eraIndexToCardanoEra Dijkstra arm stubbed)

Themes the stubs cover (~93 TODO(dijkstra) markers, file-local
-Wno- pragmas on the heavily-stubbed modules):

- Sh.body / .wits / .auxiliaryData -> Sh.stBody / .stWits /
  .stAuxData; Alonzo at*; Conway pattern
- Sh.txSeqTxns' / Al.txSeqTxns -> shelleyBlockBodyTxs /
  alonzoBlockBodyTxs (lens-based shape)
- 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  Cardano.Ledger.Core -> .Api.Tx.Body
- asTreasury / asReserves -> Ledger.casTreasury / casReserves
- type data KeyRole now type-level only (drop tick prefixes:
  'StakePool / 'Staking / 'Witness / 'DRepRole / etc.)
- Tx kind: now `TxLevel -> Type -> Type`; use TopTx
- 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)
- 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 ledger-alonzo 1.15)
- encodeGenesis Alonzo stubbed (AlonzoGenesis field types changed:
  Maybe CostModels; Word32/Word16 vs Natural)
- All era PredicateFailure encoders stubbed (NonEmpty / NonEmptySet
  container types in ledger 1.18.1+; many constructor renames:
  WithdrawalsNotInRewardsDELEGS removed; MissingRequiredSigners,
  TriesToForgeADA; StakeKeyHasNonZeroRewardAccountBalanceDELEG ->
  ...HasNonZeroAccountBalanceDELEG; etc.)
- Json.encodeTx / encodeSubmitTransactionError stubbed
  (ApplyTxError is a type only; pattern needs an accessor)
- Dijkstra arm stubbed in eraIndexToCardanoEra (Health)

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, App.Configuration) and work outward to the
encoders.
@kylixafonso
Copy link
Copy Markdown

Hey @johnalotoski @KtorZ, what's needed to get this over the line? Liqwid and almost surely other dApps are blocked on this - Preview deployments using Ogmios not working fully.

@KtorZ
Copy link
Copy Markdown
Member

KtorZ commented May 25, 2026

@kylixafonso what's needed to get this over the line

A bit of time mostly. I haven't reviewed the latest changes. Given that their commits all start with "WIP" and are obviously AI-generated; It'll likely take a bit of energy to go through each and ensure that this actually works

My apologies for the delay; this hard fork is really not coming at a good time on my end. As I've already told IOG/Intersect representatives 2, 3, 4, 5 times now: I will have little availability to cut another release for Ogmios before mid-June. Doing my best during my evenings and free-time already to help move this forward.

@KtorZ
Copy link
Copy Markdown
Member

KtorZ commented May 25, 2026

@Jimbo4350, it looks like your commits are reverting many (already released) changes introduced to Ogmios recently, and also reverting work that was started on this PR and was ... in a somewhat good shape. So whatever you've asked this AI to do; please stop 😬 ...

I'll likely be reverting the latest commits because they are no good.

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.

5 participants