Skip to content

Read pool parameters from query pool-state output or a node in stake-pool bls-registration-certificate - #1490

Open
carbolymer wants to merge 3 commits into
ch1bo/leios-queriesfrom
mgalazyn/feature/bls-registration-certificate-pool-state
Open

carbolymer wants to merge 3 commits into
ch1bo/leios-queriesfrom
mgalazyn/feature/bls-registration-certificate-pool-state

Conversation

@carbolymer

@carbolymer carbolymer commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Context

Closes:

The first PR, now merged, added cardano-cli dijkstra stake-pool bls-registration-certificate offline, which reads an existing registration certificate:

This PR adds the other two parameter sources from the issue, so the pool operator no longer needs the original certificate:

  • offline --pool-state-file FILE --stake-pool-id POOL_ID reads the output of query pool-state and picks one pool.
  • online --stake-pool-id POOL_ID asks a running node for the pool's parameters, with the same node connection options as query pool-state.

Both take --current-params or --pending-params. The pending choice uses the parameters of the pool's pending update. With --current-params, the offline command also needs --mainnet or --testnet-magic, because the query pool-state output has no network in the pool's reward account; the online command takes the network from the node connection. The command warns when the new certificate replaces a pending update, and when it cancels a retirement that is scheduled for the pool (the ledger drops a re-registered pool from the retiring list). As before, only the BLS key and its proof of possession change.

This PR is stacked on #1478 and can merge only after it. That PR makes query pool-state return the ledger QueryResultStakePoolState and pins unreleased cardano-ledger, ouroboros-consensus and cardano-api commits as source-repository-packages.

The signing workflow will be documented in the developer portal in a separate PR.

How to trust this PR

Review commit by commit.

  1. Add FromJSON instance for QueryResultStakePoolState
  2. Read pool parameters from query pool-state output in stake-pool bls-registration-certificate
  3. Query pool parameters from a node in stake-pool bls-registration-certificate

Commit 1 adds an orphan FromJSON instance in cardano-cli, with a TODO to move it to cardano-ledger next to its ToJSON instance. A Hedgehog round-trip test covers it.

Commit 2 has golden tests for the current and pending parameters, for each warning on its own, and for a missing pool, a pool without a pending update and a malformed file. The test input files/input/dijkstra/stake_pool/pool_state.json has three pools: one with a pending update, one that is retiring, and one with neither.

Commit 3 shares the current or pending selection, the warnings and the errors with commit 2, so those tests cover it too. The node query itself is not tested here, because the test suites run without a node.

Example commands:

  • cardano-cli dijkstra stake-pool bls-registration-certificate offline --pool-state-file pool-state.json --stake-pool-id POOL_ID --pending-params --bls-signing-key-file bls.skey --out-file pool.cert
  • cardano-cli dijkstra stake-pool bls-registration-certificate online --socket-path node.socket --testnet-magic 42 --stake-pool-id POOL_ID --current-params --bls-signing-key-file bls.skey --out-file pool.cert

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/

@carbolymer
carbolymer changed the base branch from master to ch1bo/leios-queries October 29, 2026 10:04
@carbolymer
carbolymer added this pull request to stack #1491 October 29, 2026 10:05
@carbolymer carbolymer self-assigned this Oct 29, 2026
@carbolymer carbolymer changed the title Mgalazyn/feature/bls registration certificate pool state Read pool parameters from query pool-state output or a node in stake-pool bls-registration-certificate Oct 29, 2026
@carbolymer
carbolymer force-pushed the mgalazyn/feature/bls-registration-certificate-pool-state branch from 52dba82 to 11e0e18 Compare October 29, 2026 10:53
@carbolymer
carbolymer force-pushed the mgalazyn/feature/bls-registration-certificate-pool-state branch from 11e0e18 to a4821ea Compare October 29, 2026 14:31
@carbolymer
carbolymer marked this pull request as ready for review October 29, 2026 14:31
Copilot AI balanced review requested due to automatic review settings October 29, 2026 14:31

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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

, "currentStakeDistribution" .= (nes ^. L.nesStakePoolDistrG)
]

-- TODO: upstream to cardano-ledger next to the ToJSON instance of QueryResultStakePoolState.

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.

Can you create an issue in the ledger repo and tag Alexey in it?

@carbolymer
carbolymer force-pushed the mgalazyn/feature/bls-registration-certificate-pool-state branch from a4821ea to 5074d99 Compare October 29, 2026 15:59

This branch has not been deployed

No deployments
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.

Add a dedicated pool registration certificate creation command to register or update a pool’s BLS key using existing pool parameters

3 participants