Skip to content

primitives%fix!: correct the names of revocation reasons 1 to 3 - #132

Merged
PastaPastaPasta merged 1 commit into
developfrom
pasta/revocation-reason-names
Nov 14, 2026
Merged

PastaPastaPasta merged 1 commit into
developfrom
pasta/revocation-reason-names

Conversation

@PastaPastaPasta

@PastaPastaPasta PastaPastaPasta commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

Motivation

RevocationReason gives 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::ChangeOfKeys keeps 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 using ChangeOfKeys for code 2 must switch to CompromisedKeys. The bytes for a given code are unchanged.
  • RevocationReason::KeyCompromise and RevocationReason::ViolationOfService are removed.
  • Code 1 is RevocationReason::TerminationOfService. Its Display text is termination_of_service (was key_compromise).
  • Code 2 is RevocationReason::CompromisedKeys. Its Display text is compromised_keys (was change_of_keys).
  • Code 3 is RevocationReason::ChangeOfKeys. Its Display text is change_of_keys (was violation_of_service).

How Has This Been Tested?

just comb

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, 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

@coderabbitai

coderabbitai Bot commented Nov 14, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between f480538 and 8b25917.

Files selected for processing: 1

  • pkgs/primitives/src/support.rs
  • 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.

Share

@github-actions

Copy link
Copy Markdown

Note

This pull request has no conflicts! 🎊 🎉 🎊

@thepastaclaw

thepastaclaw commented Nov 14, 2026 •

Copy link
Copy Markdown

✅ Final review complete — no blockers (commit 8b25917) · triage: low

@PastaPastaPasta PastaPastaPasta left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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.

  1. 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::ChangeOfKeys keeps 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 using ChangeOfKeys for code 2 must switch to CompromisedKeys, 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.

  2. 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

codecov Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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: low by gpt-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); agent phase1-reviewer, glm-5.3-flash — rust-quality (completed, effort high); agent phase1-reviewer
  • Phase 1 model: glm-5.3-flash — zai quota: 5h 100% left, weekly 54% left; passed over gemini-3.8-flash-high (antigravity quota lookup failed)
  • Fresh verifier: gpt-6.1-sol — final-verifier; agent sol-verifier
  • Phase 2 reviewers: gpt-6.1-sol — general (completed, effort medium); agent phase2-reviewer, gpt-6.1-sol — rust-quality (completed, effort medium); agent phase2-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.

Comment on lines +24 to +28
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",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 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)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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.

@PastaPastaPasta

Copy link
Copy Markdown
Member Author

Ready for steward review at 8b25917


🤖 Posted autonomously by Claude on behalf of pasta.

@PastaPastaPasta
PastaPastaPasta merged commit a4ea791 into develop Nov 14, 2026
55 checks passed
@PastaPastaPasta
PastaPastaPasta deleted the pasta/revocation-reason-names branch November 14, 2026 02:36
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.

2 participants