Skip to content

feat(client-cli): improve the node start command and the blocks and transactions certification - #3682

Merged
jpraynaud merged 5 commits into
mainfrom
jpraynaud/node-start-command-input-validation
Nov 6, 2026
Merged

jpraynaud merged 5 commits into
mainfrom
jpraynaud/node-start-command-input-validation

Conversation

@jpraynaud

@jpraynaud jpraynaud commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

Content

This PR includes a validation of the values used to build the node start command and a mandatory genesis verification key in the certification commands of the client CLI:

  • Validate the network and the Cardano node version before building the docker run command printed after a Cardano database download or a snapshot conversion: both must be non empty strings of at most 32 lowercase letters, digits, dots and hyphens
  • Keep accepting values unknown to the client, such as the private network of custom magic networks, the latest and pre-release node version aliases, and new networks or tag formats
  • Fail the download and the snapshot converter with an explicit error when a value is rejected, instead of printing the command
  • Require the genesis verification key in the cardano-transaction certify and cardano-block certify commands, which verify the certificate chain, instead of using the fallback reserved for the commands that never verify one
  • Add a link to the network configurations page in the error raised when the genesis verification key is missing
  • Document in the WASM client library that the proof message functions verify only the proof and that the certificate chain verification and the message binding are separate required calls, in the doc comments and in the client guide, whose Cardano transactions example now checks the message against its certificate

Pre-submit checklist

  • Branch
    • Tests are provided (if possible)
    • Crates versions are updated (if relevant)
    • Commit sequence broadly makes sense
    • Key commits have useful messages
  • PR
    • All check jobs of the CI have succeeded
    • Self-reviewed the diff
    • Useful pull request description
    • Reviewer requested

@jpraynaud jpraynaud self-assigned this Nov 4, 2026
@jpraynaud jpraynaud added the optimization 🛠️ Optimization and/or small enhancements label Nov 4, 2026
Copilot AI lite review requested due to automatic review settings November 4, 2026 15:57

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.

🟢 Approval recommended

No active review issues are identified, and the changes address command validation, error propagation, required key configuration, and related regression coverage.

No open issues 🎉

What changed in this PR

This pull request hardens the client CLI’s generated Cardano node startup commands and requires a configured genesis verification key for certificate-verifying block and transaction certification commands.

Changes:

  • Validate network and Cardano node version values before generating Docker commands.
  • Propagate command-generation errors through database downloads and snapshot conversion.
  • Require the configured genesis verification key for block and transaction certification.
  • Improve missing-key configuration guidance and add related regression tests.
File Description
mithril-client-cli/​src/​utils/​cardano_db.rs Adds node-command value validation and related tests.
mithril-client-cli/​src/​commands/​tools/​utxo_hd/​snapshot_converter.rs Propagates startup command validation errors during snapshot conversion.
mithril-client-cli/​src/​commands/​cardano_transaction/​certify/​mod.rs Requires the configured genesis verification key for transaction certification and adds tests.
mithril-client-cli/​src/​commands/​cardano_db/​shared_steps.rs Propagates startup command validation errors after database downloads.
mithril-client-cli/​src/​commands/​cardano_block/​certify.rs Requires the configured genesis verification key for block certification and adds a regression test.
mithril-client-cli/​src/​command_context.rs Separates certificate-verifying client setup from fallback setup and improves missing-key guidance.

Review effort: Lite

@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Test Results

     5 files  ± 0     236 suites  ±0   1h 0m 36s ⏱️ - 7m 31s
 4 213 tests +20   4 213 ✅ +20  0 💤 ±0  0 ❌ ±0 
13 370 runs  +80  13 370 ✅ +80  0 💤 ±0  0 ❌ ±0 

Results for commit fdabf6a. ± Comparison against base commit dfafc1e.

♻️ This comment has been updated with latest results.

@damrobi damrobi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM overall, I just raised a couple of concerns regarding late errors in the execute commands

@jpraynaud
jpraynaud force-pushed the jpraynaud/node-start-command-input-validation branch from 44a79a5 to 0f39078 Compare November 5, 2026 14:16
@jpraynaud
jpraynaud temporarily deployed to testing-2-preview November 5, 2026 14:28 — with GitHub Actions Inactive
@jpraynaud
jpraynaud temporarily deployed to testing-2-preview November 5, 2026 14:57 — with GitHub Actions Inactive

@Alenar Alenar left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

…cation commands

The transaction and block certification commands verify the certificate chain, so they take the key the
download commands require instead of the fallback reserved for the commands that never verify one.
…essage functions

The functions verify only the proof, the certificate chain and the message binding are separate calls.
… guide

Warn that computing a message certifies nothing by itself and check the message of the Cardano transactions example against its certificate, in the current and maintained versions.

@turmelclem turmelclem 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.

LGTM 👍

@jpraynaud
jpraynaud force-pushed the jpraynaud/node-start-command-input-validation branch from d95ca00 to fdabf6a Compare November 6, 2026 14:42
@jpraynaud
jpraynaud deployed to testing-preview November 6, 2026 14:58 — with GitHub Actions Active
@jpraynaud
jpraynaud deployed to testing-2-preview November 6, 2026 14:58 — with GitHub Actions Active
@jpraynaud
jpraynaud merged commit 8040607 into main Nov 6, 2026
53 checks passed
@jpraynaud
jpraynaud deleted the jpraynaud/node-start-command-input-validation branch November 6, 2026 15:02

This branch was successfully deployed

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

Labels

optimization 🛠️ Optimization and/or small enhancements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants