Skip to content

fix(net): announce sporks once per new peer - #7918

Merged
knst merged 1 commit into
dashpay:developfrom
PastaPastaPasta:fix/dedup-spork-announce
Oct 21, 2026
Merged

knst merged 1 commit into
dashpay:developfrom
PastaPastaPasta:fix/dedup-spork-announce

Conversation

@PastaPastaPasta

@PastaPastaPasta PastaPastaPasta commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Issue being fixed or feature implemented

  • fix(net): announce sporks to new peers instead of requesting them during mnsync #7893 ("fix(net): announce sporks to new peers instead of requesting them during mnsync") reached develop through two merge commits: f99212b carried an earlier revision of the PR's commit (ce24c40) and 72a5997 later carried the final revision (45acdf3). Git merged both without conflict, so the VERACK handler in src/net_processing.cpp now announces sporks twice: once inside the if (pfrom.CanRelay()) block (earlier revision) and once right after that block (final revision, which also covers masternode connections that only become relay-capable after MNAUTH).
  • Effect: on test chains, relay-capable peers get each active spork inv queued twice in vInventoryOtherToSend per connection. SendMessages checks and updates the known-inventory filter for each queued inv, so the second copy is dropped before it is sent. The wire output is unchanged, and the cost is one extra queue entry and filter lookup per spork. This is a cleanup of dead duplicate code with no correctness or consensus effect. Mainnet is untouched because both copies are gated on IsTestChain().

What was done?

Removed the earlier copy of the spork announcement loop (and its comment) from inside the if (pfrom.CanRelay()) block, so that block again ends right after the SENDCMPCT push. The copy after the block is kept. The VERACK handler now matches the final revision of #7893 (45acdf3).

How Has This Been Tested?

The diff is a pure deletion (8 lines) that restores the final revision of #7893. I compared the VERACK handler region (from the SENDHEADERS comment through if (!RejectIncomingTxs(pfrom))) against git show 45acdf30f3:src/net_processing.cpp and it is identical.

Built on macOS (Apple silicon, --enable-debug --enable-werror --disable-hardening --enable-suppress-external-warnings --disable-bench) and ran:

  • test/functional/test_runner.py feature_sporks.py p2p_instantsend.py: both passed.
  • ./src/test/test_dash --run_test=governance_vote_sync_tests: 6 test cases, no errors detected.

No new test was added: the duplicate queue entry is filtered before sending, so it has no observable effect on the wire or on peers.

Breaking Changes

None.

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have assigned this pull request to a milestone (for repository code-owners and collaborators only)

🤖 Generated with Claude Code

dashpay#7893 reached develop twice: f99212b merged an earlier revision of
its commit, which announces sporks inside the CanRelay() block, and
72a5997 merged the final revision, which announces them after that
block so masternode connections are covered too. Both loops survived,
so on test chains every relay-capable peer had each active spork inv
queued twice at VERACK.

Drop the earlier copy. The handler now matches the final revision
(45acdf3).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-16T19:55:07.872372Z ac1bc5d PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e687ec3a-96ab-4cda-a65f-0e30ea2d3478
📥 Commits

Reviewing files that changed from the base of the PR and between fad547f and ac1bc5d.

📒 Files selected for processing: 1
  • src/net_processing.cpp
💤 Files with no reviewable changes: 1
  • src/net_processing.cpp

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

Walkthrough

The test-chain active-spork announcement now runs after the pfrom.CanRelay() branch for every successfully veracked peer. Comments about compact-block request behavior were removed. The outgoing SENDCMPCT message remains part of the peer handshake.

Priority: ⬇️ Low

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

Merge Risk: ⚪ Minimal · up to ac1bc

No actionable issue is identified; the change is mergeable after normal checks.

Pre-merge checks: Passed 5
Check name Status Explanation
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
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 The description clearly explains the duplicate spork announcements, the eight-line deletion, the affected test-chain behavior, and the reported validation.
Title check Passed The title clearly and concisely identifies the main change: announcing sporks once per new peer.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files.

✨ Finishing Touches: 💡 1
🧪 Generate unit tests (beta)
  • Create a new PR
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
  • 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

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

@thepastaclaw

thepastaclaw commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

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

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown
Collaborator

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

Verified ac1bc5d: the eight-line deletion removes redundant spork queueing while preserving test-chain gating, masternode coverage, and repeated-VERACK protection; no in-scope defects were found. The existing inventory-send path filters duplicates, so the PR description overstates the wire-level effect, but the cleanup remains correct. Validation was static only: the supplied CI snapshot reports an ASan build failure and several pending jobs, and the failed-log request confirmed logs remain unavailable while the workflow is running.

Review provenance

Source: reviewer 1: gemini-3.8-flash-high (agent: phase1-reviewer, role: general); reviewer 2: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 3: gpt-6.1-sol (agent: phase2-reviewer, role: dash-core-commit-history); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)

  • Triage: low by gpt-6.1-sol (effort low) — The diff deletes one duplicate spork announcement loop while preserving the existing announcement path, making this a small, contained behavior fix whose correctness is easy to confirm.
  • Phase 1 reviewers: gemini-3.8-flash-high — general (completed, effort high); agent phase1-reviewer
  • Phase 1 model: gemini-3.8-flash-high — antigravity quota: weekly 71% left, 5h 100% left
  • 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 — dash-core-commit-history (completed, effort medium); agent phase2-reviewer

@thepastaclaw thepastaclaw added the pastaclaw:approved thepastaclaw's latest review approved this PR label Oct 16, 2026

@knst knst left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

utACK ac1bc5d

@knst knst added this to the 24.1 milestone Oct 21, 2026
@knst
knst merged commit ccf5c09 into dashpay:develop Oct 21, 2026
90 of 91 checks passed
@thepastaclaw thepastaclaw removed the pastaclaw:approved thepastaclaw's latest review approved this PR label Oct 21, 2026
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.

3 participants