Skip to content

docs(adr): align ADR 005 voucher-reject mirror with the wire enum - #2258

Merged
alpergundogdu merged 1 commit into
mainfrom
fix/2172-adr005-voucher-reject-mirror
Oct 1, 2026
Merged

alpergundogdu merged 1 commit into
mainfrom
fix/2172-adr005-voucher-reject-mirror

Conversation

@yigitdot

@yigitdot yigitdot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • ADR 005 called BadPreimage a handler-emitted reason with no validation-enum counterpart. PoolError::BadPreimage exists and voucher_reject_reason maps it one-to-one. The enum listing, the mirror paragraph and §Mirror obligation now list it as mirrored, and it joins the revert-avoiding reasons.
  • SignerCapExhausted was missing from ADR 005 (enum listing, handler-direct paragraph, retry table, exempt list) and from ADR 003's wire-encoding table and recovery list. Both now carry it in wire order, with the recovery the rustdoc names: the owner raises the cap or issues a fresh capability. It is not watermark-gated.
  • The VoucherRejectReason rustdoc in decdn-protocol repeated the same drift and is fixed to match. The false "variant order is frozen — new reasons append at the end" sentence now states that variant order is the postcard wire discriminant. The enum is not reordered.

Doc-only, no behavior change.

Test plan

  • RUSTDOCFLAGS="-D warnings" cargo doc --workspace --no-deps --document-private-items
  • cargo fmt -- --check
  • cargo clippy -p decdn-protocol --all-targets -- -D warnings
  • cargo nextest run -p decdn-protocol -p decdn-incentive (445 passed)
  • Manual cross-check: ADR 005 listing order == crates/protocol/src/client.rs; mirrored set == client_bridge.rs match arms

Closes #2172

🤖 Generated with Claude Code

BadPreimage is mirrored from PoolError::BadPreimage. SignerCapExhausted
joins the ADR 005 listing, handler-direct paragraph, retry table and
mirror exempt set, and the ADR 003 wire-encoding table. The
VoucherRejectReason rustdoc matches.

Closes #2172

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI balanced review requested due to automatic review settings October 1, 2026 02:18

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-code-quality

Copy link
Copy Markdown

Code Coverage Overview

Languages: Rust

Rust / code-coverage/cargo-llvm-cov

The overall line coverage in commit 505e226 in the fix/2172-adr005-vouc... branch remains at 87%, unchanged from commit ef4bb89 in the main branch.

Show a line coverage summary of the most impacted files.
File main ef4bb89 fix/2172-adr005-vouc... 505e226 +/-
crates/incentiv...eth_identity.rs 99% 98% -1%
crates/node/src/dht/publish.rs 92% 92% 0%
crates/cache/src/engine.rs 94% 94% 0%
crates/node/src...gin/pull_leg.rs 90% 90% 0%

@alpergundogdu

Copy link
Copy Markdown
Contributor

Review: approve

Verified against crates/protocol/src/client.rs VoucherRejectReason: ADR 005's listing (adr/005-protocol.md:302-319) and ADR 003's wire table (adr/003-payments.md:387-402) carry the same 16 variants in the same order. The mirrored set (first seven plus BadPreimage and UnderFold) matches the arms in crates/incentive/src/client_bridge.rs:117-136. SignerCapExhausted is correctly exempt: not watermark-gated, collapses to NotFound at admit. Anchors resolve, and no other doc mirrors this enum. CI is green.

Nit (optional)

  • adr/005-protocol.md:332 says twice that BadPreimage mirrors the validation enum. Drop it from the first sentence and keep the second, which gives the reason.

@alpergundogdu
alpergundogdu merged commit 8f3cdca into main Oct 1, 2026
30 checks passed
@alpergundogdu
alpergundogdu deleted the fix/2172-adr005-voucher-reject-mirror branch October 1, 2026 13:37
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.

adr 005: BadPreimage mirror and SignerCapExhausted are out of step with the wire enum

3 participants