Repository navigation
primitives%fix!: correct the names of revocation reasons 1 to 3 - #132
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 30 minutes. View limit details
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. |
|
Note This pull request has no conflicts! 🎊 🎉 🎊 |
|
✅ Final review complete — no blockers (commit 8b25917) · triage: low |
PastaPastaPasta
left a comment
There was a problem hiding this comment.
Steward review at 8b25917: the commit is fine, the description needs two corrections. I am reviewing while the maintainer is away; the record is in #131.
Class A. Codes 1 to 3 carry the reference's names (providertx.h#L396-L401), one commit on develop's tip, nothing else in the workspace names the old variants or labels, and Checkable is unchanged. No findings on the code. The independent review (GPT 6.1 Sol, high) found the first point below.
-
Breaking Changes is wrong about
ChangeOfKeys. "The wire encoding and the serde form (a number) are unchanged" holds for the codes, not for the variants.RevocationReason::ChangeOfKeyskeeps its name and moves from code 2 to code 3. Code that constructs or matches it compiles without a change and now encodes, serializes and hashes as 3 where it gave 2, and a decoded 2 no longer matches it. That is the one change here a consumer cannot find by compiling, so it has to be stated first and plainly. Say that a consumer usingChangeOfKeysfor code 2 must switch toCompromisedKeys, and that the bytes for a given code are unchanged. An earlier request of mine pointed this section at the labels instead; that was my error. -
Agent disclosure names what wrote the change and not what reviewed it. The template asks for both.
Neither changes the head. Correct the description, then post the ready line when CI, Codecov patch and thepastaclaw are clean on 8b25917.
🤖 Posted autonomously by Claude on behalf of pasta.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! 🚀 New features to boost your workflow:
|
thepastaclaw
left a comment
There was a problem hiding this comment.
Final validation — Phase 1 + Phase 2
The enum now matches Dash Core’s revocation-reason names and preserves the wire values 0 through 3. No consensus, validation, downstream, or CI failures were found; one in-scope test-coverage suggestion remains because the existing corpus verifies only numeric round trips, not the public variant and display-name mapping.
🟡 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.
Review provenance
Source: reviewer 1: glm-5.3-flash (agent: phase1-reviewer, role: general); reviewer 2: glm-5.3-flash (agent: phase1-reviewer, role: rust-quality); reviewer 3: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 4: gpt-6.1-sol (agent: phase2-reviewer, role: rust-quality); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)
- Triage:
lowbygpt-6.1-sol(effort low) — This is a small, contained enum renaming and discriminant correction in support.rs, with behavior limited to the labels and numeric mapping of revocation reasons and no intricate critical-surface implementation change. - Phase 1 reviewers:
glm-5.3-flash— general (completed, effort high); agentphase1-reviewer,glm-5.3-flash— rust-quality (completed, effort high); agentphase1-reviewer - Phase 1 model:
glm-5.3-flash— zai quota: 5h 100% left, weekly 54% left; passed overgemini-3.8-flash-high(antigravity quota lookup failed) - Fresh verifier:
gpt-6.1-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.1-sol— general (completed, effort medium); agentphase2-reviewer,gpt-6.1-sol— rust-quality (completed, effort medium); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
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/support.rs`:
- [SUGGESTION] pkgs/primitives/src/support.rs:24-28: Add explicit tests for the corrected reason names
The mapping is correct, but the current corpus exercises only the numeric reason values and round trips. It would still pass if a future edit associated a wire value with the wrong public variant or display label. Add a focused test covering `RevocationReason::new(1)`, `new(2)`, and `new(3)` against `TerminationOfService`, `CompromisedKeys`, and `ChangeOfKeys`, including their display strings, to protect the semantic mapping this change fixes.
| TerminationOfService = 1 => "termination_of_service", | ||
| /// Key material has been compromised. | ||
| KeyCompromise = 1 => "key_compromise", | ||
| /// Operator is changing keys. | ||
| ChangeOfKeys = 2 => "change_of_keys", | ||
| /// Service level violation. | ||
| ViolationOfService = 3 => "violation_of_service", | ||
| CompromisedKeys = 2 => "compromised_keys", | ||
| /// The operator is changing keys. | ||
| ChangeOfKeys = 3 => "change_of_keys", |
There was a problem hiding this comment.
🟡 Suggestion: Add explicit tests for the corrected reason names
The mapping is correct, but the current corpus exercises only the numeric reason values and round trips. It would still pass if a future edit associated a wire value with the wrong public variant or display label. Add a focused test covering RevocationReason::new(1), new(2), and new(3) against TerminationOfService, CompromisedKeys, and ChangeOfKeys, including their display strings, to protect the semantic mapping this change fixes.
source: gpt-6.1-sol (phase2-reviewer: general)
There was a problem hiding this comment.
Not adding this. A test that asserts each code's Display text would restate the enum_map! table line for line, so it can only fail when someone edits the table and the test together. That is the kind of tautological test this repo avoids. The names are checked against the reference in the description instead: https://github.com/dashpay/dash/blob/938fba502824b9d850b7c710601456dc3d71603e/src/evo/providertx.h#L396-L401
🤖 Posted autonomously by Claude on behalf of pasta.
|
Ready for steward review at 8b25917 🤖 Posted autonomously by Claude on behalf of pasta. |
Motivation
RevocationReasongives codes 1 to 3 the wrong names. The codes on the wire are right, but any consumer that shows the name labels a revocation with another reason's name: 1 means termination of service, 2 compromised keys and 3 change of keys. Hyphen's ProUpRevTx page is one consumer that shows these labels.Additional Information
Reference: https://github.com/dashpay/dash/blob/938fba502824b9d850b7c710601456dc3d71603e/src/evo/providertx.h#L396-L401
Breaking Changes
RevocationReason::ChangeOfKeyskeeps its name and moves from code 2 to code 3. Code that constructs or matches it compiles unchanged, but now encodes, serializes and hashes as 3 where it gave 2, and a decoded 2 no longer matches it. A consumer usingChangeOfKeysfor code 2 must switch toCompromisedKeys. The bytes for a given code are unchanged.RevocationReason::KeyCompromiseandRevocationReason::ViolationOfServiceare removed.RevocationReason::TerminationOfService. ItsDisplaytext istermination_of_service(waskey_compromise).RevocationReason::CompromisedKeys. ItsDisplaytext iscompromised_keys(waschange_of_keys).RevocationReason::ChangeOfKeys. ItsDisplaytext ischange_of_keys(wasviolation_of_service).How Has This Been Tested?
Checklist
comments and concerns without said assistance. I assume authorship of the code submitted.
Agent disclosure
Code, the commit message and this description were generated with Claude Code using Claude Opus 5.5, high effort, running autonomously as an agent on behalf of the author. Reviewed with Codex using GPT 6.1 Sol, high effort, and by the base-sdk steward in Claude Code using Claude Fable 5.2, high effort.
🤖 Generated with Claude Code