Skip to content

fix: gate BLS vote-signature failure log behind gobject category - #7556

Merged
PastaPastaPasta merged 1 commit into
dashpay:developfrom
PastaPastaPasta:t3code/fix/gate-governance-logs
Aug 7, 2026
Merged

fix: gate BLS vote-signature failure log behind gobject category#7556
PastaPastaPasta merged 1 commit into
dashpay:developfrom
PastaPastaPasta:t3code/fix/gate-governance-logs

Conversation

@PastaPastaPasta

Copy link
Copy Markdown
Member

Issue being fixed or feature implemented

In CGovernanceVote::CheckSignature(const CBLSPublicKey&) (src/governance/vote.cpp), a signature verification failure was logged unconditionally via LogPrintf instead of LogPrint(BCLog::GOBJECT, ...), unlike key ID signature verification and the rest of vote validation.
After PR #7527 (orphan governance votes must pass GovernanceVote::IsValid before caching), a peer holding a valid masternode outpoint (public data) plus an invalid BLS signature can reach this path with a vote naming an arbitrary parent hash, producing a debug.log line per message without -debug=gobject set.

Similarly, CGovernanceObject::ProcessVote (src/governance/object.cpp) logged unsupported vote signals and invalid votes via unconditional LogPrintf.

What was done?

Updated the unconditional LogPrintf calls in CGovernanceVote::CheckSignature and CGovernanceObject::ProcessVote to use LogPrint(BCLog::GOBJECT, ...).

  • src/governance/vote.cpp: CGovernanceVote::CheckSignature(const CBLSPublicKey&)
  • src/governance/object.cpp: CGovernanceObject::ProcessVote (unsupported vote signal and invalid vote paths)

How Has This Been Tested?

  • Built locally with dependencies prefix.
  • Unit tests (./src/test/test_dash --run_test="*gov*") pass.
  • Log and whitespace linters (test/lint/lint-logs.py, test/lint/lint-whitespace.py) pass.

Breaking Changes

None.

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/e2e tests
  • I have made corresponding changes to the documentation
  • I have assigned this pull request to a milestone (for repository code-owners and collaborators only)

This pull request was created by Codex.

Gate BLS vote-signature failure logs in CGovernanceVote::CheckSignature
and CGovernanceObject::ProcessVote behind the BCLog::GOBJECT log category
instead of logging unconditionally via LogPrintf.

This prevents peers holding valid masternode outpoints with invalid BLS vote
signatures or unsupported/invalid signals from spamming debug.log when
-debug=gobject is not enabled.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

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

LGTM

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

Governance vote validation messages now use category-based LogPrint calls with BCLog::GOBJECT instead of unconditional LogPrintf calls. Vote validation, error classification, and rejection behavior remain unchanged.

Estimated code review effort: 1 (Trivial) | ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes gating BLS vote-signature failure logs behind the gobject category.
Description check ✅ Passed The description accurately explains the logging changes, affected code paths, testing, and absence of breaking changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@coderabbitai coderabbitai Bot 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.

🧹 Nitpick comments (1)
src/governance/object.cpp (1)

411-411: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Verify regression coverage for the logging-category contract.

If existing governance tests do not cover these paths, add a focused test that verifies the messages are emitted only when BCLog::GOBJECT is enabled. Also cover the related change in src/governance/vote.cpp line 204.

As per coding guidelines, governance changes must add small tests that prove the changed invariant.

Also applies to: 462-462

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/governance/object.cpp` at line 411, Add focused governance tests covering
the logging paths in object.cpp and vote.cpp, verifying messages are emitted
only when BCLog::GOBJECT is enabled and suppressed when it is disabled. Reuse
existing logging-test utilities and cover both referenced object.cpp locations
plus the related vote.cpp path.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/governance/object.cpp`:
- Line 411: Add focused governance tests covering the logging paths in
object.cpp and vote.cpp, verifying messages are emitted only when BCLog::GOBJECT
is enabled and suppressed when it is disabled. Reuse existing logging-test
utilities and cover both referenced object.cpp locations plus the related
vote.cpp path.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 3e90c0f8-3dff-4ae6-a1aa-e0aff43e1b06

📥 Commits

Reviewing files that changed from the base of the PR and between 3d0b7c1 and afe5fda.

📒 Files selected for processing (2)
  • src/governance/object.cpp
  • src/governance/vote.cpp

@thepastaclaw

thepastaclaw commented Aug 7, 2026

Copy link
Copy Markdown

⛔ Blockers found — Opus deferred (commit afe5fda)
Canonical validated blockers: 1

@PastaPastaPasta PastaPastaPasta added this to the 24 milestone Aug 7, 2026
@PastaPastaPasta
PastaPastaPasta merged commit 42f9264 into dashpay:develop Aug 7, 2026
43 of 45 checks passed
@PastaPastaPasta
PastaPastaPasta deleted the t3code/fix/gate-governance-logs branch August 7, 2026 21:07
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