Skip to content

fix(ledger): fail closed on committee certificates - #2146

Merged
wolf31o2 merged 5 commits into
mainfrom
fix/2142-committee-authz
Sep 1, 2026
Merged

fix(ledger): fail closed on committee certificates#2146
wolf31o2 merged 5 commits into
mainfrom
fix/2142-committee-authz

Conversation

@wolf31o2

@wolf31o2 wolf31o2 commented Aug 30, 2026

Copy link
Copy Markdown
Member

Fixes #2142.

  • preserves exact key and script committee credentials
  • fails closed on unavailable, empty, or inconsistent committee state
  • validates authorization, resignation, and committee voters against active membership
  • reports committee voter lookup failures as CommitteeMemberLookupError, carrying the credential and its type rather than a bare provider error
  • skips governance checks for phase-2-invalid transactions
  • preserves released and exact-provider conformance coverage

The legacy conformance adapter reports a script credential as not a member: the released hash-only store cannot represent one, so answering it could only alias onto the key-hash entry of the same hash.

Signed-off-by: Chris Gianelloni <wolf31o2@blinklabs.io>
@wolf31o2
wolf31o2 requested a review from a team as a code owner August 30, 2026 11:15
@wolf31o2
wolf31o2 requested a review from arepala-uml August 30, 2026 11:15
@coderabbitai

coderabbitai Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 0a4fa1e5-3424-402e-bdf1-401438e6b4e1

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 6bc5cd06-790d-406b-acb6-f764c3c1f3f6

📥 Commits

Reviewing files that changed from the base of the PR and between 9586efe and 374db6c.

📒 Files selected for processing (3)
  • ledger/common/state.go
  • ledger/conway/rules.go
  • ledger/conway/rules_test.go

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The GovState interface now documents committee member resolution semantics. UtxoValidateCommitteeCertificates lazily caches committee state, propagates committee lookup errors, and rejects missing members for authorization and resignation certificates. Tests cover current and proposed members, empty committees, lookup failures, and unrelated certificates.

Merge Risk: 🔵 Low · up to 374db

Committee certificate validation now rejects unavailable or unknown committee state and recognizes pending committee members. The change is mergeable with owner awareness that ledger-state providers must consistently implement the current-and-pending membership contract and return stable results during validation.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: committee certificate handling now fails closed when committee state is empty or unavailable.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/2142-committee-authz

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

Comment @coderabbitai help to get the list of available commands.

Signed-off-by: Chris Gianelloni <wolf31o2@blinklabs.io>
Signed-off-by: Chris Gianelloni <wolf31o2@blinklabs.io>
Signed-off-by: Chris Gianelloni <wolf31o2@blinklabs.io>

@cubic-dev-ai cubic-dev-ai Bot 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.

All reported issues were addressed across 6 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread internal/test/conformance/conformance_test.go
Comment thread ledger/conway/rules.go
@wolf31o2
wolf31o2 requested review from chrisguiney and removed request for chrisguiney September 1, 2026 15:47
The legacy conformance adapter keyed committee lookups on the raw hash, so a
script cold or hot credential whose hash matched a registered key-hash member
was returned as an authoritative member. The released store cannot represent a
script member, so report not a member for a script credential rather than
aliasing it onto the key-hash entry.

UtxoValidateUnknownVoters returned raw provider errors while
UtxoValidateCommitteeCertificates wrapped them. Wrap the voter path the same
way, and rename CommitteeMemberLookupError.ColdCredential to MemberCredential,
since it now carries the hot credential for a voter lookup.

Signed-off-by: Chris Gianelloni <wolf31o2@blinklabs.io>

@arepala-uml arepala-uml 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.

Verified independently against the current checkout (build, vet, make lint, nilaway, go test -race ./ledger/..., and go test ./internal/test/conformance/...): all pass, 315/315 conformance vectors pass. CodeRabbit and Cubic have no actionable findings; all CI checks are green.

Traced the new common.CommitteeCredentialState capability across the dependency spine: ouroboros-mock's shared MockLedgerState already implements it (merged in ouroboros-mock#263), and Dingo's LedgerView has a matching structural implementation in progress (dingo#3745, open). Release sequencing note: don't let Dingo bump to a gouroboros release containing this fix before dingo#3745 merges, or committee certificates/CC votes will fail closed in production until that lands.

No merge-blocking findings.

@wolf31o2
wolf31o2 merged commit df65301 into main Sep 1, 2026
14 checks passed
@wolf31o2
wolf31o2 deleted the fix/2142-committee-authz branch September 1, 2026 19:24
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.

ledger: fail closed on missing constitutional committee state

2 participants