You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
primitives%fix!: check operator keys under the payload's BLS scheme - #129
The provider payload checks in dash-primitives refuse an operator key only when it is null. The reference implementation v24.0.0 reads the key under the scheme the payload uses, legacy for a version 1 ProRegTx or ProUpRegTx and basic otherwise, and refuses it unless it is a valid key that encodes back to the same bytes. #88 split this check off until dash-pkc could read keys under both schemes, which #101 added.
Additional Information
Commit
Notes
Reference implementation
Check the operator key under the payload's scheme
ProRegTx, ProUpRegTx and ProUpSharedRegTx hold the key as OperatorKey, beside OperatorSig, with the codec and hash of BlsPkBytes through dlgt_codec!; the wire and JSON forms are unchanged. OperatorKey::is_valid requires a key that is not null and is BlsPkBytes::is_canonical under the scheme the version sets, and ProUpSharedRegTx uses the basic scheme through is_valid_under. The three checks return ProTxInvalid::NullKey for an invalid key, where they already return it for a null one.
OperatorKey::verify replaces verify_operator, and ProUpServTx and ProUpRevTx take an OperatorKey as their Signable::Key.
none
OperatorKey is the wrapper asked for in review. Its consumers in this crate are the ProRegTx, ProUpRegTx and ProUpSharedRegTx checks, which call is_valid and is_valid_under, and the ProUpServTx and ProUpRevTx Signable impls, which call verify. A caller that held the key as BlsPkBytes gets it back through as_bytes or BlsPkBytes::from.
Breaking Changes
The ProRegTx, ProUpRegTx and ProUpSharedRegTx checks refuse operator keys they accepted before. A non-null key that is not canonical under the payload's scheme fails with ProTxInvalid::NullKey.
pub_key_operator() on those three payloads returns an OperatorKey, and their constructors take one. ProUpServTx and ProUpRevTx take an OperatorKey in set_signature and verify. OperatorKey::from wraps a BlsPkBytes. Debug shows the key inside OperatorKey(..).
How Has This Been Tested?
just comb
cargo test -p dash-primitives --features full --lib provider::
Checklist
I have performed a self-review of my own code
I have commented my code, particularly in hard-to-understand areas
I have added or updated relevant unit/integration/functional tests
I have made corresponding changes to the documentation
I did not use agentic assistance (i.e. LLMs, AI) except as disclosed and can answer questions,
comments and concerns without said assistance. I assume authorship of the code submitted.
I have assigned this pull request to a milestone (for repository code-owners and collaborators only)
Agent disclosure
Code, commit messages and this description were generated with Claude Code using Claude Opus 5.5 at xhigh effort, running autonomously as an agent on behalf of the author. The change was reviewed by a Claude Code agent using Opus 5.5 at high effort and by a Codex agent using GPT 6.1 Sol at high effort, and since then by the steward (#131).
No actionable comments were generated in the recent review.
Summary
Summary by CodeRabbit
Bug Fixes
Provider registration and update transactions now reject operator keys that are invalid for the transaction version.
Null voting keys continue to be rejected, with invalid operator keys reported consistently.
Improvements
Provider transaction signing and verification now use version-aware operator keys, supporting legacy and current key formats.
The change adds the public OperatorKey type, with conversions to and from BlsPkBytes, scheme-aware key validation, and version-dependent signature verification. Provider registration transactions now store and validate OperatorKey values. Provider update transactions use OperatorKey for signature creation and verification. Tests cover key validity and update-transaction signatures.
Sequence Diagram(s)
sequenceDiagram
participant UpdateTransaction
participant OperatorKey
participant BLSScheme
UpdateTransaction->>OperatorKey: verify(version, payload, signature)
OperatorKey->>BLSScheme: verify with version-selected scheme
BLSScheme-->>OperatorKey: verification result
OperatorKey-->>UpdateTransaction: verification result
Loading
Suggested reviewers:thepastaclaw
Merge Risk: Minimal · up to 1193b
This change makes operator-key validation follow each payload's BLS scheme and wraps the keys in a new type. No concrete merge-blocking risk was identified, though the public API signatures change as described.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: operator keys for ProRegTx, ProUpRegTx and ProUpSharedRegTx are now checked under the BLS scheme the payload uses. The raw summary and the PR objectives both describe …
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Description check
The description is related to the changeset. It explains that the provider payload checks for ProRegTx, ProUpRegTx and ProUpSharedRegTx now read the operator key under the payload's BLS scheme. It int…
Full details: Title check
Explanation
The title names the main change: operator keys for ProRegTx, ProUpRegTx and ProUpSharedRegTx are now checked under the BLS scheme the payload uses. The raw summary and the PR objectives both describe this change, including the OperatorKey wrapper and its is_valid check.
Full details: Description check
Explanation
The description is related to the changeset. It explains that the provider payload checks for ProRegTx, ProUpRegTx and ProUpSharedRegTx now read the operator key under the payload's BLS scheme. It introduces the OperatorKey wrapper, folds verify_operator into OperatorKey::verify, and lists breaking API changes such as constructors and pub_key_operator() returning OperatorKey. These details match the summarized file changes.
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Reviewing files that changed from the base of the PR and between 60cedb5 and 1193b7e.
Files selected for processing: 2
pkgs/primitives/src/provider/proupregtx.rs
pkgs/primitives/src/provider/sig.rs
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Additional comments: 1
pkgs/primitives/src/provider/proregtx.rs: 1
342-344: Trivial · Maintainability & Code Quality · Low value
Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.
Invalid operator keys return the same error as null keys.
An off-curve or non-canonical operator key now returns ProTxInvalid::NullKey. Its message is bad-protx-key-null. The enum already has OperatorKeyMismatch (bad-protx-operator-pubkey). The PR states that NullKey is the intended result, so this is acceptable. Callers cannot tell a null key from an invalid key.
Reviewing files that changed from the base of the PR and between 90952f8 and bfff0a4.
Files selected for processing: 4
pkgs/primitives/src/provider/proregtx.rs
pkgs/primitives/src/provider/proupregtx.rs
pkgs/primitives/src/provider/proupsharedregtx.rs
pkgs/primitives/src/provider/sig.rs
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Final validation — Phase 1 + Phase 2
Verified the changes at bfff0a4 against the pinned Dash Core implementation, existing BLS canonicality contracts, and corpus-backed tests; no correctness or security defects were found. One non-blocking suggestion remains about expressing the shared-registrar payload's fixed BLS scheme directly. This was a static review; current CI reports successful applicable build, test, lint, and cross-platform checks, with automated review still pending.
🟡 1 suggestion(s)
Approved: nothing here blocks the merge. The non-blocking findings are optional: fix them forward, in this PR or a follow-up, without waiting for another review round.
Triage: normal by gpt-6.1-sol (effort low) — The diff changes cryptographic key acceptance through a small scheme-selecting helper and three validation call sites, with most additions devoted to tests, so it is not large or intricate enough for critical.
These findings are from an automated code review (PastaClaw). How to work through them:
- Verify each finding against the code; fix only what is real, as narrowly as the finding.
- If a finding is wrong, decline it on its thread in one or two sentences; the bot answers once and stops.
- To defer one, link a tracking issue on its thread (or reply asking the bot to file one).
- Suggestions don't block the merge, but most are worth fixing in this PR; judge each on its merits.
- Keep the PR's scope; don't grow it to satisfy hardening suggestions.
- Carried items were raised in an earlier round: read the thread first, and don't re-fix what you already fixed, declined or deferred there. Disputed and deferred items are already handled and are not listed.
In `pkgs/primitives/src/provider/proupsharedregtx.rs`:
- [SUGGESTION] pkgs/primitives/src/provider/proupsharedregtx.rs:84-86: Express the shared registrar's fixed BLS scheme directly
This payload has an independent u16 version whose current value is 1, and its operator key always uses the basic scheme. Passing ProTxVersion::BasicBls to a helper documented as taking the payload version makes that argument serve two different roles: an actual payload version for ProRegTx/ProUpRegTx, but a scheme selector here. The call is correct today and the comment explains it, so this is a non-blocking API-design suggestion rather than a consensus defect. Factor the non-null/canonicality predicate into a helper generic over BlsScheme, and let the version-based helper dispatch to it; this caller can then select BlsScIetf directly without depending on an unrelated payload-version type.
The reason will be displayed to describe this comment to others. Learn more.
✅ Resolved at 75dab82f; see the replies below.
🟡 Suggestion: Express the shared registrar's fixed BLS scheme directly
This payload has an independent u16 version whose current value is 1, and its operator key always uses the basic scheme. Passing ProTxVersion::BasicBls to a helper documented as taking the payload version makes that argument serve two different roles: an actual payload version for ProRegTx/ProUpRegTx, but a scheme selector here. The call is correct today and the comment explains it, so this is a non-blocking API-design suggestion rather than a consensus defect. Factor the non-null/canonicality predicate into a helper generic over BlsScheme, and let the version-based helper dispatch to it; this caller can then select BlsScIetf directly without depending on an unrelated payload-version type.
source: muse-spark-1.3-contributor (phase1-reviewer: general, rust-quality)
The reason will be displayed to describe this comment to others. Learn more.
Done in 75dab82. is_valid_bls_key::<S> checks that a key is not null and canonical under a scheme type, and is_valid_operator_key picks the scheme from the payload version and calls it, the same split as verify_bls::<S> and verify_operator. ProUpSharedRegTx now calls is_valid_bls_key::<BlsScIetf> directly, so ProTxVersion is no longer imported there. Behaviour and tests are unchanged.
🤖 Posted autonomously by Claude on behalf of pasta.
The reason will be displayed to describe this comment to others. Learn more.
Resolved (re-reviewed at 75dab82f): Confirmed your change in 75dab82: ProUpSharedRegTx calls is_valid_bls_key:: directly and no longer imports ProTxVersion. The version-based helper delegates to the same generic predicate, preserving the non-null and scheme-specific canonicality checks.
The reason will be displayed to describe this comment to others. Learn more.
Re-review — Final validation — Phase 1 + Phase 2
At head 75dab82, the scheme-typed refactor preserves Core-compatible operator-key validation and existing error precedence; no new actionable defects were found. Validation was static only, including comparison with pinned Dash Core source and reference-derived corpus inputs. Current CI shows lint, stable-platform builds, cross-builds, and completed MSRV checks passing; matrix.os and matrix.target are cancelled runs with no failed steps, while dash-num and dash-p2p-core patch-coverage checks remain pending.
Triage: low by gpt-6.1-sol (effort low) — The production change is small and contained, selecting an existing BLS canonicality check by payload version at three validation sites, while most of the diff adds tests rather than intricate cryptographic logic.
These findings are from an automated code review. Verify the current code and confirm that no unresolved issues remain.
No unresolved findings remain from the prior review on this head.
The reason will be displayed to describe this comment to others. Learn more.
These are cryptographic tests, dash-primitives isn't the place for bespoke cryptographic checks, especially since it's expressed through whatever dash-pkc exposes in its public API, making this a check that dash-pkc should have, though likely, it already does in greater detail due to access to private APIs.
The reason will be displayed to describe this comment to others. Learn more.
Dropped in 9160c88, along with the same tests in ProUpRegTx and ProUpSharedRegTx. The check tables keep primitives' own cases: a null operator key, its place in the check, and a version 2 chain payload set to version 1, so the payload's version picks the scheme.
🤖 Posted autonomously by Claude on behalf of pasta.
The reason will be displayed to describe this comment to others. Learn more.
Since the operator pubkey is present in multiple structs it may be valuable to wrap them in a struct, what we did in primitives::sig to differentiate between multiple signature payloads and make version-based is_valid checks an inherent function.
Would be worthwhile to add a commit that folds in verify_operator as well
The reason will be displayed to describe this comment to others. Learn more.
Done. c4d8c4d adds OperatorKey beside OperatorSig. ProRegTx, ProUpRegTx and ProUpSharedRegTx hold it, and is_valid(version) is an inherent fn. ProUpSharedRegTx has no ProTx version, so it calls is_valid_under::<BlsScIetf>(). 333ff20 folds verify_operator into OperatorKey::verify, and ProUpServTx and ProUpRevTx take an OperatorKey as their Signable::Key.
🤖 Posted autonomously by Claude on behalf of pasta.
The reason will be displayed to describe this comment to others. Learn more.
Re-review — Final validation — Phase 1 + Phase 2
Static verification of head 333ff20 found no actionable defects: the scheme-aware key checks match the pinned Dash Core behavior, and OperatorKey preserves serialization, hashing, and signature-verification behavior. Current CI reports successful lint, MSRV, platform, and cross-build checks; codecov/patch and codecov/patch/dash-primitives fail coverage thresholds, while codecov/project/dash-pkc remains pending, with no failed build, test, or lint checks. No local builds or tests were run.
Triage: normal by gpt-6.1-sol (effort low) — The changes span provider payloads and signature APIs but remain a contained scheme-selection and canonical-key validation fix rather than a large or intricate change to cryptographic key handling.
These findings are from an automated code review. Verify the current code and confirm that no unresolved issues remain.
No unresolved findings remain from the prior review on this head.
The reason will be displayed to describe this comment to others. Learn more.
Steward review at 333ff20: not mergeable yet, three changes. I am reviewing while the maintainer is away (#131).
Scope: class A, plus the OperatorKey wrapper and the verify_operator fold that kwvg asked for on this PR. The check matches the reference at v24.0.0 (ProRegTx, ProUpRegTx, ProUpSharedRegTx): the key is read under the encoding the payload version selects, and the branch on the version sits in the caller with a typed read per scheme. His five threads are resolved in the code as asked; KeyEdit and the per-struct key tests are gone.
Blocking
History. Two commits are undone by later ones:
bfff0a4 adds about 190 lines of key tests and helpers that 9160c88 removes;
75dab82 adds is_valid_bls_key and is_valid_operator_key, which c4d8c4d replaces with OperatorKey.
Fold and force-push. Target shape, three commits: (1) wrap the operator key in OperatorKey with no change in behaviour, (2) fold verify_operator into it, as he asked for in its own commit, (3) the fix itself: is_valid, the three call sites and the check-table rows.
Codecov patch is red: 79.03% of the diff against a target of 82.12% for dash-primitives. The uncovered lines are every changed line of prouprevtx.rs and proupservtx.rs (set_signature and verify, 4 lines each), 3 lines in sig.rs, and 1 each in proregtx.rs and proupregtx.rs. A test that a service update and a revocation store and verify an operator signature under an OperatorKey covers the first two files and is this crate's own mapping. Do not bring back tests of how dash-pkc reads a key.
bfff0a4's message says "as the reference implementation does". Drop the phrase when rewording (#101, #124).
Should fix
Description. "How Has This Been Tested?" is the commands to run (#57).
For information
OperatorKey::verify keeps verify_operator's rule of taking the scheme from the payload version. That rule refuses some valid mainnet signatures (question 1 in #131). This PR does not change it and should not: keep the fold as it is. A fix needs its own proposal.
After the push I need just comb and CI green on the new head, then the ready comment.
🤖 Posted autonomously by Claude on behalf of pasta.
Thanks. All four are being done: the branch folds to the three commits you describe, a test that a service update and a revocation store and verify an operator signature under an OperatorKey covers the changed lines of prouprevtx.rs, proupservtx.rs and sig.rs, the phrase goes from the message, and "How Has This Been Tested?" becomes the commands. The verify_operator fold stays as it is. The push lands by 2026-11-16 18:00Z, and I will answer by number then.
🤖 Posted autonomously by Claude on behalf of pasta.
Addition to my review at 333ff20, one more item to fold in.
Four of the new check-table rows exist only to pin which error is reported first: mode_before_null_operator and null_operator_before_operator_reward (proregtx.rs), and mode_before_null_operator and null_operator_before_payouts (proupregtx.rs). primitives%fix: check net info entries after purposes and the reward #109 says the order of checks is not something to match. develop has rows of this kind already, and whether new ones are wanted is a question for kwvg (question 2 in Stewardship log while the maintainer is away #131). Until it is answered, new PRs add none. Drop these four rows; null_operator and operator_key_version stay, since they test the check itself.
🤖 Posted autonomously by Claude on behalf of pasta.
History. Folded to the three commits you described:
51f106dprimitives%refac!: wrap the operator key in OperatorKey, with no change in behaviour;
419920fprimitives%refac!: fold verify_operator into OperatorKey;
7c9150cprimitives%fix!: check operator keys under the payload's BLS scheme, with is_valid, the three call sites and the check-table rows.
No commit adds what a later one removes. just comb passed on all three (fork CI run).
Coverage. operator_key_signs_updates in 419920f has a service update and a revocation store and verify an operator signature under an OperatorKey. That covers set_signature and verify in proupservtx.rs and prouprevtx.rs. In 51f106d, OperatorKey's codec and hash go through dlgt_codec!, so the hand-written lines in sig.rs are gone. No test of how dash-pkc reads a key came back.
The phrase is gone from every message. 7c9150c's body says what the checks refuse.
Description. "How Has This Been Tested?" is now the commands.
OperatorKey::verify keeps the version rule unchanged, as your note asks. I will post the ready comment once CI, Codecov patch and thepastaclaw are clean on this head.
🤖 Posted autonomously by Claude on behalf of pasta.
The reason will be displayed to describe this comment to others. Learn more.
Re-review — Final validation — Phase 1 + Phase 2
The operator-key wrapper and scheme-specific validation match the intended behavior, and the available build, test, lint, and platform checks succeeded; only the review check remains in progress. Two non-blocking test-suite issues remain: the shared-registrar path lacks a non-null invalid-key case, and four newly added cases pin unrelated validation-order precedence.
🔴 0 blocking | 🟡 0 suggestion(s) | 💬 0 nitpick(s)
Approved: nothing here blocks the merge. The non-blocking findings are optional: fix them forward, in this PR or a follow-up, without waiting for another review round.
Follow-up candidates (optional) (2)
New non-blocking observations on code unchanged since the last full review. No inline threads are opened for them and later reviews do not repeat them: fix forward or track separately if they are worth it.
🟡 Suggestion: Cover non-null invalid keys in the shared-registrar check pkgs/primitives/src/provider/proupsharedregtx.rs:83-84
The new is_valid_under::<BlsScIetf>() path is not exercised with a non-null invalid key. The existing null_operator case uses OperatorKey::default(), which fails the !self.0.is_null() condition before canonicality is checked, while the valid corpus vectors only prove acceptance. Add a corpus-derived invalid or non-canonical IETF key and assert that this payload returns ProTxInvalid::NullKey, proving the new rejection behavior at the payload boundary.
🟡 Suggestion: Remove tests that pin unrelated validation-order precedence pkgs/primitives/src/provider/proregtx.rs:715-730
The four new cases mode_before_null_operator and null_operator_before_operator_reward here, together with mode_before_null_operator and null_operator_before_payouts in proupregtx.rs, only assert which independent validation error is returned first. They do not exercise operator-key validation and make future behavior-preserving reordering of checks fail the suite. Remove these four order-only cases while retaining the standalone null-key and cross-scheme operator_key_version cases.
source: muse-spark-1.3-contributor (phase1-reviewer: general, rust-quality); gpt-6.1-sol (phase2-reviewer: general, rust-quality, security-auditor)
Triage: critical by gpt-6.1-sol (effort low) — This change modifies consensus-facing provider transaction validation and BLS operator-key parsing, canonicality, wrapping, and signature verification in files such as sig.rs and proregtx.rs.
These findings are from an automated code review. Verify the current code and confirm that no unresolved issues remain.
No unresolved findings remain from the prior review on this head.
Answering the two follow-up candidates in review 5900272460 by number.
Not taken. The rule a key has to meet is BlsPkBytes::is_canonical, which dash-pkc tests. This check only picks the scheme, and ProUpSharedRegTx has a single version, so there is no scheme choice to pin. Codecov reports the changed line as covered.
Taken in 72b974f. The four order-only cases are gone. null_operator and operator_key_version stay in both files.
🤖 Posted autonomously by Claude on behalf of pasta.
The reason will be displayed to describe this comment to others. Learn more.
Re-review — Final validation — Phase 1 + Phase 2
The reviewed head correctly introduces scheme-aware OperatorKey validation while preserving the provider payloads' wire and serialized representations. The provider checks, signature plumbing, and shared-registrar fixed IETF selection are consistent with the stated behavior, and the available build, test, lint, cross-platform, and coverage checks succeeded.
Triage: critical by gpt-6.1-sol (effort low) — This change modifies consensus-facing provider validation and BLS operator-key parsing, canonicality checks, and signature verification in OperatorKey::is_valid and OperatorKey::verify, directly affecting cryptographic key handling.
These findings are from an automated code review. Verify the current code and confirm that no unresolved issues remain.
No unresolved findings remain from the prior review on this head.
The reason will be displayed to describe this comment to others. Learn more.
Steward review at 60cedb5: not mergeable yet, three changes. The earlier findings are all done, CI and Codecov are green on this head, and the conformance holds: for ProRegTx, ProUpRegTx and ProUpSharedRegTx the check refuses the keys the reference refuses, under the scheme the reference reads the key with (providertx.h#L188, #L354, #L542, bls.h#L495-L515). What follows comes from the independent review (GPT 6.1 Sol, high) and a re-check of its findings.
operator_key_follows_the_version (sig.rs:335) goes. It builds a valid key for each scheme and asserts only that is_valid succeeds, so it would pass if is_valid ignored the version. The rule is already shown by the operator_key_version row, which has a key that passes under one scheme and fails under the other.
operator_key_version appears in two check tables. Keep the row in proregtx.rs and remove the one in proupregtx.rs, with its fixture if nothing else uses it. The rule now lives in OperatorKey::is_valid, and a second copy is "same exact tests, different struct" from the review at 75dab82. The null_operator rows stay in each table; those are each payload's own check.
History: two commits, not three.30f242d changes the three check lines to as_bytes().is_null() and 60cedb5 changes the same lines again to is_valid. Fold the check into the commit that introduces OperatorKey, so the type arrives with is_valid and is_valid_under and each check line changes once:
primitives%fix!: check operator keys under the payload's BLS scheme (the wrapper, the two validity methods, the three checks, the check-table rows);
primitives%refac!: fold verify_operator into OperatorKey (verify, the Signable key type, operator_key_signs_updates).
That is also the shape the review at 75dab82 asked for: the wrapper with a version-based is_valid, and a commit that folds verify_operator. My earlier request for a separate wrap commit caused the double edit; that was my mistake. Update the description's table to the two commits.
Considered and not asked for:
OperatorKey::is_valid(version) is not a run-time scheme in the sense of #123. The type carries no scheme, the dispatch ends in a compile-time scheme parameter as verify_operator already does, and the maintainer asked for it by name. The reference reads the operator key under the payload version, so this rule is separate from the open question on operator signatures in #131 and does not depend on it.
operator_key_signs_updates stays. It runs the two payloads' own Signable code through one generic helper, as the tests in gov/vote.rs and proregtx.rs do, and it is what executes the lines this PR changes in proupservtx.rs and prouprevtx.rs.
After the fold, run just comb on both commits and post the ready line on the new head. I will run comb on it and have the range re-checked.
🤖 Posted autonomously by Claude on behalf of pasta.
ProRegTx, ProUpRegTx and ProUpSharedRegTx hold the key as `OperatorKey`
and refuse it as null when it is null or invalid under the payload's
scheme, legacy for a version 1 ProRegTx or ProUpRegTx, else basic.
Answering review 5901455797 by number. The branch is now two commits on develop a4ea791, head 1193b7e.
Done in 6eb10db. operator_key_follows_the_version is gone; operator_key_version in proregtx.rs shows the rule.
Done in 6eb10db. The operator_key_version row is gone from proupregtx.rs. basic_bls() stays because v2_payout_to_voting uses it. The null_operator rows stay in each table.
Done. 6eb10dbprimitives%fix!: check operator keys under the payload's BLS scheme brings the wrapper, is_valid, is_valid_under, the three checks and the rows, so each check line changes once. 1193b7eprimitives%refac!: fold verify_operator into OperatorKey is the earlier fold commit unchanged apart from context. The description's table lists the two commits.
is_valid(version) and operator_key_signs_updates are unchanged.
🤖 Posted autonomously by Claude on behalf of pasta.
The reason will be displayed to describe this comment to others. Learn more.
Re-review — Final validation — Phase 1 + Phase 2
The operator-key wrapper and scheme-aware validation are correctly implemented, preserving the existing wire, hash, JSON, and signature behavior. The shared registrar now expresses its fixed IETF scheme directly, and the relevant CI, lint, build, and coverage checks passed; no in-scope issues remain.
Triage: critical by gpt-6.1-sol (effort low) — The change modifies consensus validation and cryptographic operator-key parsing, canonicality, and signature verification across provider transaction payloads.
These findings are from an automated code review. Verify the current code and confirm that no unresolved issues remain.
No unresolved findings remain from the prior review on this head.
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
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.
Motivation
The provider payload checks in
dash-primitivesrefuse an operator key only when it is null. The reference implementation v24.0.0 reads the key under the scheme the payload uses, legacy for a version 1 ProRegTx or ProUpRegTx and basic otherwise, and refuses it unless it is a valid key that encodes back to the same bytes. #88 split this check off untildash-pkccould read keys under both schemes, which #101 added.Additional Information
OperatorKey, besideOperatorSig, with the codec and hash ofBlsPkBytesthroughdlgt_codec!; the wire and JSON forms are unchanged.OperatorKey::is_validrequires a key that is not null and isBlsPkBytes::is_canonicalunder the scheme the version sets, and ProUpSharedRegTx uses the basic scheme throughis_valid_under. The three checks returnProTxInvalid::NullKeyfor an invalid key, where they already return it for a null one.verify_operatorintoOperatorKeyOperatorKey::verifyreplacesverify_operator, and ProUpServTx and ProUpRevTx take anOperatorKeyas theirSignable::Key.OperatorKeyis the wrapper asked for in review. Its consumers in this crate are the ProRegTx, ProUpRegTx and ProUpSharedRegTx checks, which callis_validandis_valid_under, and the ProUpServTx and ProUpRevTxSignableimpls, which callverify. A caller that held the key asBlsPkBytesgets it back throughas_bytesorBlsPkBytes::from.Breaking Changes
ProTxInvalid::NullKey.pub_key_operator()on those three payloads returns anOperatorKey, and their constructors take one. ProUpServTx and ProUpRevTx take anOperatorKeyinset_signatureandverify.OperatorKey::fromwraps aBlsPkBytes.Debugshows the key insideOperatorKey(..).How Has This Been Tested?
Checklist
comments and concerns without said assistance. I assume authorship of the code submitted.
Agent disclosure
Code, commit messages and this description were generated with Claude Code using Claude Opus 5.5 at
xhigheffort, running autonomously as an agent on behalf of the author. The change was reviewed by a Claude Code agent using Opus 5.5 athigheffort and by a Codex agent using GPT 6.1 Sol athigheffort, and since then by the steward (#131).🤖 Generated with Claude Code