Skip to content

Derive the accepted era list when reading transaction witnesses - #1426

Merged
palas merged 1 commit into
masterfrom
derive-accepted-witness-eras
Aug 28, 2026
Merged

Derive the accepted era list when reading transaction witnesses#1426
palas merged 1 commit into
masterfrom
derive-accepted-witness-eras

Conversation

@palas

@palas palas commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

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

  • Commit sequence broadly makes sense and commits have useful messages
  • New tests are added if needed and existing tests are updated. See Running tests for more details
  • Self-reviewed the diff
  • Changelog fragment added in .changes/

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 palas self-assigned this Aug 27, 2026
Copilot AI lite review requested due to automatic review settings August 27, 2026 09:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 readFileTxKeyWitness to use a derived [minBound .. maxBound] era list (matching the existing fromSomeShelleyTx pattern).
  • Removes the now-unneeded hard-coded readFileInAnyShelleyBasedEra helper.
  • 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.

@palas
palas added this pull request to the merge queue Aug 28, 2026
Merged via the queue into master with commit ae17805 Aug 28, 2026
26 checks passed
@palas
palas deleted the derive-accepted-witness-eras branch August 28, 2026 17:59
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.

transaction assemble cannot read the witnesses that transaction witness writes in Dijkstra

4 participants