Derive the accepted era list when reading transaction witnesses - #1426
Merged
Conversation
readFileTxKeyWitness rejected TxWitness DijkstraEra envelopes because it enumerated the accepted eras by hand and stopped at Conway; derive the list from the api's era enumeration instead, so future eras are accepted the moment the api exposes them.
palas
requested review from
Jimbo4350,
carbolymer,
disassembler,
kevinhammond and
newhoggy
as code owners
August 27, 2026 09:38
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the transaction witness reader in Cardano.CLI.Read to derive the set of accepted Shelley-based eras from the API’s AnyShelleyBasedEra enumeration, avoiding a hard-coded list that previously stopped at Conway and caused transaction assemble/sign-witness to reject Dijkstra witnesses.
Changes:
- Refactors
readFileTxKeyWitnessto use a derived[minBound .. maxBound]era list (matching the existingfromSomeShelleyTxpattern). - Removes the now-unneeded hard-coded
readFileInAnyShelleyBasedErahelper. - Adds a changelog fragment documenting the bugfix (including Dijkstra support).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
cardano-cli/src/Cardano/CLI/Read.hs |
Derives accepted witness eras from AnyShelleyBasedEra to prevent era list rot and accept newer eras like Dijkstra. |
.changes/20260827_111653_cardano-cli_palas_accept_newer_era_witnesses.yml |
Records the bugfix in the changelog fragments. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
carbolymer
approved these changes
Aug 27, 2026
Jimbo4350
approved these changes
Aug 27, 2026
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.
Context
Context transaction assemble (also known as transaction sign-witness) rejected witness files from any era after Conway with a TextEnvelope type error. The reader kept a hand-written list of accepted witness types, and the list ended at Conway.
This is #1422, and Leios testnet SPOs hit it in the wild as input-output-hk/ouroboros-leios#1061.
The fix derives the list from the api's era enumeration (the same pattern this file already uses for reading transactions:
fromSomeShelleyTx) so new eras are accepted the moment the api exposes them, and the list cannot rot again.Closes #1422.
Note on tests
The end-to-end golden test (build-raw, witness, assemble in Dijkstra) arrives with the upcoming PR that enables the Dijkstra transaction commands because it cannot run before those commands exist. For every existing era the derived list is exactly the same set as the old hand-written one, and the existing suites cover that unchanged behaviour.
How to trust this PR
It is almost a refactoring, except Dijkstra is now in the list.
Checklist
.changes/