Open
Conversation
6938982 to
e695dcc
Compare
2f79591 to
463b9e8
Compare
463b9e8 to
eed7d01
Compare
0679166 to
ae8a93f
Compare
carbolymer
reviewed
Jan 5, 2026
| , Plutus.EraPlutusContext (ShelleyLedgerEra era) | ||
| , L.Script (ShelleyLedgerEra era) ~ L.AlonzoScript (ShelleyLedgerEra era) | ||
| , L.ScriptsNeeded (ShelleyLedgerEra era) ~ L.AlonzoScriptsNeeded (ShelleyLedgerEra era) | ||
| , L.ShelleyEraTxCert (ShelleyLedgerEra era) |
Contributor
There was a problem hiding this comment.
I'm not 100% convinced about this change. Depending on the legacy certificates support, we might need to revert this and split AlonzoEraOnwardsConstraints into two:
- from Alonzo to Conway including
ShelleyEraTxCert - from Dijkstra onwards.
This needs to be double checked and if anything pops out during cardano-cli integration.
91d8ca3 to
12fbb1e
Compare
12fbb1e to
88149e9
Compare
6227b26 to
89109c0
Compare
46864d5 to
8711784
Compare
8711784 to
c476239
Compare
geo2a
commented
Feb 19, 2026
fd21353 to
71e925a
Compare
0dab4b5 to
5407021
Compare
a900ea3 to
3aa87d5
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Integrates updated Ledger/Consensus packages (Node 10.7) into the API surface by updating dependencies, adapting to new ledger types/roles, and adjusting genesis/query/tx plumbing accordingly.
Changes:
- Updated cabal/Nix dependencies to newer
ouroboros-*,cardano-ledger-*, and related packages. - Refactored API + tests for new ledger types (e.g.,
TopTx,Guard,AccountAddress, stake pool params rename) and new/relocated cost model configuration. - Extended query support (ledger peer snapshots variants, DRep delegations) and updated various conversions/serialisation.
Reviewed changes
Copilot reviewed 70 out of 71 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| flake.nix | Switches consensus dependency for dev shell builds |
| cardano-rpc/test/cardano-rpc-test/Test/Cardano/Rpc/ProtocolParameters.hs | Updates protocol param lenses/types used in roundtrip property |
| cardano-rpc/src/Cardano/Rpc/Server/Internal/UtxoRpc/Type.hs | Updates protocol param conversions for new ledger representations |
| cardano-rpc/cardano-rpc.cabal | Adds errors dependency for new helpers |
| cardano-api/test/cardano-api-test/files/input/genesis/spec.alonzo-v2-cost-model-map-175.json | Updates golden genesis JSON structure for cost models |
| cardano-api/test/cardano-api-test/files/input/genesis/spec.alonzo-v2-cost-model-array-175.json | Updates golden genesis JSON structure for cost models |
| cardano-api/test/cardano-api-test/Test/Cardano/Api/Transaction/Autobalance.hs | Adapts tests to AccountAddress return address |
| cardano-api/test/cardano-api-test/Test/Cardano/Api/Genesis.hs | Adjusts default cost model access & genesis parsing |
| cardano-api/test/cardano-api-test/Test/Cardano/Api/Experimental.hs | Updates experimental tests for TopTx and renamed fields |
| cardano-api/test/cardano-api-test/Test/Cardano/Api/EpochLeadership.hs | Adapts epoch leadership test types (NonZero Coin) |
| cardano-api/test/cardano-api-test/Test/Cardano/Api/Crypto.hs | Updates DSIGN size API usage |
| cardano-api/test/cardano-api-golden/Test/Golden/Cardano/Api/Genesis.hs | Aligns golden genesis types with renamed key roles |
| cardano-api/src/Cardano/Api/Tx/Internal/Sign.hs | Moves to Tx TopTx and TxBody TopTx types |
| cardano-api/src/Cardano/Api/Tx/Internal/Output.hs | Updates output conversions for new tx body type |
| cardano-api/src/Cardano/Api/Tx/Internal/Fee.hs | Moves to Tx TopTx and updated credential roles |
| cardano-api/src/Cardano/Api/Tx/Internal/Body/Lens.hs | Changes validity interval lenses to StrictMaybe |
| cardano-api/src/Cardano/Api/Tx/Internal/Body.hs | Updates tx body conversions + introduces asGuard helper |
| cardano-api/src/Cardano/Api/Query/Internal/Type/QueryInMode.hs | Adds new query variants and updates peer snapshot decoding |
| cardano-api/src/Cardano/Api/Query/Internal/Expr.hs | Exposes new query helpers and peer snapshot kind parameter |
| cardano-api/src/Cardano/Api/Query.hs | Renames exported peer snapshot decoder |
| cardano-api/src/Cardano/Api/ProtocolParameters.hs | Adapts protocol params update types + compact conversions |
| cardano-api/src/Cardano/Api/Plutus/Internal/Script.hs | Upgrades timelocks for Dijkstra scripts |
| cardano-api/src/Cardano/Api/Network/Internal/Reexport.hs | Reexports peer snapshot kind/types |
| cardano-api/src/Cardano/Api/Network/IPC/Internal/Version.hs | Switches NodeToClient version import path |
| cardano-api/src/Cardano/Api/Network/IPC/Internal/ChainSync/Client.hs | Switches NodeToClient import path |
| cardano-api/src/Cardano/Api/Network/IPC/Internal.hs | Switches NodeToClient import path and aliases |
| cardano-api/src/Cardano/Api/Network.hs | Reexports new network peer snapshot types |
| cardano-api/src/Cardano/Api/LedgerState/Internal/Rule/BBODY/UTXOW.hs | Refactors UTXOW event handling to LambdaCase |
| cardano-api/src/Cardano/Api/LedgerState/Internal/LedgerEvent.hs | Updates credential role types in events |
| cardano-api/src/Cardano/Api/LedgerState.hs | Updates key roles and ledger table extraction plumbing |
| cardano-api/src/Cardano/Api/Ledger/Internal/Reexport.hs | Updates reexports for renamed ledger symbols |
| cardano-api/src/Cardano/Api/Key/Internal/Class.hs | Updates RNG bytestring generation function |
| cardano-api/src/Cardano/Api/Key/Internal.hs | Updates genesis key role types |
| cardano-api/src/Cardano/Api/Internal/Orphans/Serialisation.hs | Adds/changes JSON instances for updated ledger types |
| cardano-api/src/Cardano/Api/Internal/Orphans/Misc.hs | Updates Semigroup instances for renamed fee fields |
| cardano-api/src/Cardano/Api/Governance/Internal/Action/ProposalProcedure.hs | Updates governance action/withdrawal address types |
| cardano-api/src/Cardano/Api/Genesis/Internal.hs | Restructures Alonzo genesis defaults & exports V1 model |
| cardano-api/src/Cardano/Api/Genesis.hs | Reexports defaultV1CostModel |
| cardano-api/src/Cardano/Api/Experimental/Tx/Internal/Type.hs | Updates experimental tx wrappers to Tx TopTx |
| cardano-api/src/Cardano/Api/Experimental/Tx/Internal/Fee.hs | Updates experimental fee evaluation tx type |
| cardano-api/src/Cardano/Api/Experimental/Tx/Internal/Certificate/Compatible.hs | Renames PoolParams -> StakePoolParams |
| cardano-api/src/Cardano/Api/Experimental/Tx/Internal/Certificate.hs | Updates pool metadata hash types/conversions |
| cardano-api/src/Cardano/Api/Experimental/Tx/Internal/BodyContent/New.hs | Adapts experimental tx builder for new types/roles |
| cardano-api/src/Cardano/Api/Experimental/Tx.hs | Updates tx hashing + signed tx type to TopTx |
| cardano-api/src/Cardano/Api/Experimental/Simple/Script.hs | Simplifies annotator application |
| cardano-api/src/Cardano/Api/Experimental/Plutus/Internal/Shim/LegacyScripts.hs | Upgrades timelocks for Dijkstra in legacy shim |
| cardano-api/src/Cardano/Api/Experimental/Era.hs | Updates constraints for tx body hashing type |
| cardano-api/src/Cardano/Api/Experimental/AnyScript.hs | Simplifies annotator application |
| cardano-api/src/Cardano/Api/Experimental.hs | Exposes additional constraints helper |
| cardano-api/src/Cardano/Api/Era/Internal/Eon/ShelleyToMaryEra.hs | Updates HashAnnotated constraint to TopTx |
| cardano-api/src/Cardano/Api/Era/Internal/Eon/ShelleyToBabbageEra.hs | Updates HashAnnotated constraint to TopTx |
| cardano-api/src/Cardano/Api/Era/Internal/Eon/ShelleyToAlonzoEra.hs | Updates HashAnnotated constraint to TopTx |
| cardano-api/src/Cardano/Api/Era/Internal/Eon/ShelleyToAllegraEra.hs | Updates HashAnnotated constraint to TopTx |
| cardano-api/src/Cardano/Api/Era/Internal/Eon/ShelleyEraOnly.hs | Updates HashAnnotated constraint to TopTx |
| cardano-api/src/Cardano/Api/Era/Internal/Eon/ShelleyBasedEra.hs | Updates constraints and adds ApplyTxError JSON constraint |
| cardano-api/src/Cardano/Api/Era/Internal/Eon/MaryEraOnwards.hs | Updates HashAnnotated constraint to TopTx |
| cardano-api/src/Cardano/Api/Era/Internal/Eon/ConwayEraOnwards.hs | Updates HashAnnotated constraint to TopTx |
| cardano-api/src/Cardano/Api/Era/Internal/Eon/BabbageEraOnwards.hs | Updates HashAnnotated constraint to TopTx |
| cardano-api/src/Cardano/Api/Era/Internal/Eon/AlonzoEraOnwards.hs | Enables Dijkstra support and updates constraints |
| cardano-api/src/Cardano/Api/Crypto/Ed25519Bip32.hs | Updates DSIGN associated type names |
| cardano-api/src/Cardano/Api/Compatible/Tx.hs | Updates compatible tx creation for TopTx |
| cardano-api/src/Cardano/Api/Certificate/Internal.hs | Updates stake pool params + pool metadata hash handling |
| cardano-api/src/Cardano/Api/Block.hs | Updates tx extraction from block body with lens |
| cardano-api/src/Cardano/Api/Address.hs | Updates stake/payment credential and account address types |
| cardano-api/gen/Test/Gen/Cardano/Api/Typed.hs | Adapts generators to updated types and strict maybes |
| cardano-api/gen/Test/Gen/Cardano/Api.hs | Updates Alonzo genesis generator for new cost model layout |
| cardano-api/cardano-api.cabal | Updates dependencies and version constraints |
| cabal.project | Updates index-state and wasm overrides |
| .github/workflows/haskell-wasm.yml | Removes trailing whitespace line |
Comments suppressed due to low confidence (13)
cardano-rpc/src/Cardano/Rpc/Server/Internal/UtxoRpc/Type.hs:1
minFeeCoefficient(linear fee per byte) is being populated fromppTxFeeFixedL, andminFeeConstant(fixed fee) fromppTxFeePerByteL. This swaps A/B semantics and will produce incorrect fees for API consumers. MapminFeeCoefficientfromppTxFeePerByteLandminFeeConstantfromppTxFeeFixedL(with the appropriateCoinPerByte/compact conversions).
cardano-rpc/src/Cardano/Rpc/Server/Internal/UtxoRpc/Type.hs:1- The reverse conversion applies
minFeeCoefficienttoppTxFeeFixedLandminFeeConstanttoppTxFeePerByteL, which is also swapped relative to typical min-fee semantics (A=per-byte, B=fixed). This breaks roundtrips and will misconfigure protocol parameters derived from RPC input. Swap the setters sominFeeCoefficientsetsppTxFeePerByteLandminFeeConstantsetsppTxFeeFixedL.
cardano-api/src/Cardano/Api/Query/Internal/Type/QueryInMode.hs:1 - Using
errorhere makes the library crash at runtime when a caller issuesQueryStakeSnapshotin a pre-Conway era (which is a normal user input path). Prefer returning a structured error (e.g.,Left EraMismatch/UnsupportedNtcVersionError/a dedicatedQueryConvenienceError) or restrict the constructor toConwayEraOnwardsat the type level so this cannot be constructed for earlier eras.
cardano-api/src/Cardano/Api/Query/Internal/Type/QueryInMode.hs:1 - Same issue as
QueryStakeSnapshot:errorturns an unsupported-era query into a process crash. Return a typed error instead, or makeGetDRepDelegationsonly constructible underConwayEraOnwardsso unsupported eras are rejected statically.
cardano-api/src/Cardano/Api/Internal/Orphans/Serialisation.hs:1 - These instances will crash at runtime whenever JSON encoding touches
NonEmptyMap/NonEmptySet(likely via derived instances that now include them). Implement these (e.g., encodeNonEmptyMapas a normalMapviaNonEmptyMap.toMap, andNonEmptySetas a list viaNonEmptySet.toSet/toList), or remove the instances and provide explicitToJSONwhere needed.
cardano-api/src/Cardano/Api/Internal/Orphans/Serialisation.hs:1 - This will crash if JSON encoding is attempted for a Dijkstra-era apply-tx error (even in tooling/logging paths). If Dijkstra is expected to be 'inactive', consider encoding a safe placeholder value (e.g., a tagged string/object with
show) rather than throwing, or hide this instance behind a build flag so production builds cannot crash via JSON rendering.
cardano-api/src/Cardano/Api/ProtocolParameters.hs:1 toCompactPartialis a partial conversion; if a caller supplies an out-of-rangeprotocolUpdateTxFeePerByte, this can fail via exception/panic rather than returning a validation error. Prefer using the total conversion (toCompact) and propagating a meaningfulLeftfromtoShelleyCommonPParamsUpdatewhen compacting fails.
cardano-api/src/Cardano/Api/ProtocolParameters.hs:1toCompactPartialis a partial conversion; if a caller supplies an out-of-rangeprotocolUpdateTxFeePerByte, this can fail via exception/panic rather than returning a validation error. Prefer using the total conversion (toCompact) and propagating a meaningfulLeftfromtoShelleyCommonPParamsUpdatewhen compacting fails.
cardano-api/src/Cardano/Api/ProtocolParameters.hs:1- Same issue as the fee-per-byte conversion:
toCompactPartialcan fail at runtime for large values. Use the safetoCompactand return a validation error when the value cannot be represented in compact form.
cardano-api/test/cardano-api-test/Test/Cardano/Api/Genesis.hs:1 - This introduces nested
fromJustin a test, which will fail with an unhelpful exception if defaults change. Prefer pattern matching or usingmaybe (fail ...) pure(orH.failMessage) so failures report what field was missing and why.
cardano-api/src/Cardano/Api/Tx/Internal/Body/Lens.hs:1 - The comments still describe a
Maybe SlotNorepresentation (Nothing/Just), but the lens types were changed toStrictMaybe SlotNo(SNothing/SJust). Update the comment wording to match the new API to avoid misleading maintainers/users.
cardano-api/src/Cardano/Api/Tx/Internal/Body/Lens.hs:1 - The comments still describe a
Maybe SlotNorepresentation (Nothing/Just), but the lens types were changed toStrictMaybe SlotNo(SNothing/SJust). Update the comment wording to match the new API to avoid misleading maintainers/users.
cardano-rpc/test/cardano-rpc-test/Test/Cardano/Rpc/ProtocolParameters.hs:1 %~ idis a no-op and adds noise to an already dense test transformation pipeline. If no transformation is needed, consider removing these two lens updates entirely (and keep a brief comment nearby if the rationale is important).
lehins
reviewed
Mar 17, 2026
Jimbo4350
reviewed
Mar 17, 2026
Replace stub `toJSON = undefined` implementations with real ones that delegate to the underlying Map and Set instances via toMap/toSet.
Handle StrictMaybe/Maybe conversion inside the lenses (via strictMaybeL) rather than exposing StrictMaybe in the public API. Keeps TxValidityUpperBound, convValidityLowerBound, convValidityUpperBound, and the three validity bound lenses stable.
GetStakeSnapshots in ouroboros-consensus 1.0.0.0 requires EraGov, which must be available in the context of toConsensusQueryShelleyBased.
b6e7a96 to
a7086b9
Compare
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.
Changelog
Context
This PR brings the new Ledger and Consensus packages and attempts to integrate them into cardano-api.
How to trust this PR
Review the dependency bumps and any type-level changes required to accommodate the new Ledger/Consensus APIs.
Checklist