Repository navigation
backport: bitcoin#35670 - net: append compact-block extra txn until full - #7958
Conversation
|
No actionable comments were generated in the recent review.
|
| Check name | Status | Explanation |
|---|---|---|
| Title check | The title names the upstream backport (bitcoin#35670) and the main change: compact-block extra transactions are appended until the cache is full. This matches the raw summary, which describes AddToCom… | |
| Description check | The description states the problem: vExtraTxnForCompact was resized to full capacity on first insertion, leaving default entries that InitData scanned. It explains the fix (append until full, then rin… | |
| Linked Issues check | Check skipped because no linked issues were found for this pull request. | |
| Out of Scope Changes check | Check skipped because no linked issues were found for this pull request. |
Full details: Title check
-
Explanation
The title names the upstream backport (bitcoin#35670) and the main change: compact-block extra transactions are appended until the cache is full. This matches the raw summary, which describes AddToCompactExtraTransactions reserving capacity and appending until the limit, and the description, which states the same fix. The title is specific and identifies the primary change. It does not mention the Dash-specific hash adaptation, which is an acceptable omission.
Full details: Description check
-
Explanation
The description states the problem: vExtraTxnForCompact was resized to full capacity on first insertion, leaving default entries that InitData scanned. It explains the fix (append until full, then ring-order overwrite), the Dash adaptation to GetInstanceHash(), the build and test commands run, and the absence of breaking changes. This relates directly to the changeset in src/net_processing.cpp.
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 1 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
Finishing Touches
-
Generate docstrings
-
- Commit to this branch
- Create a new PR
Generate unit tests (beta)
-
- 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.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
⏹️ Not reviewed — PR is closed (merged) (commit f5930b8) |
thepastaclaw
left a comment
There was a problem hiding this comment.
Final validation — Phase 1 + Phase 2
The backport correctly preserves Dash's instance-hash handling while changing the compact-block extra-transaction cache to append until full. The null-entry guard closes the demonstrated dereference path, and the available CI snapshot has no relevant failures; build jobs were still pending. One non-blocking test-coverage issue remains: the regression test keys entries with transaction IDs rather than the instance hashes used in production.
💬 1 nitpick(s)
Review provenance
Source: reviewer 1: muse-spark-1.3-contributor (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: backport-reviewer); reviewer 4: 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:
normalbygpt-6.1-sol(effort low) — This is a contained behavioral change to compact-block transaction caching and reconstruction, with added test coverage, but it does not alter consensus, funds movement, cryptography, or other critical surfaces. - Phase 1 reviewers:
muse-spark-1.3-contributor— general (completed, effort xhigh); agentphase1-reviewer - Phase 1 model:
muse-spark-1.3-contributor— not quota-gated; passed overgemini-3.8-flash-high(antigravity quota lookup failed),glm-5.3-flash(not used above high effort; tier asks max) - Fresh verifier:
gpt-6.1-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.1-sol— general (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— backport-reviewer (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— dash-core-commit-history (completed, effort high); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.
In `src/test/blockencodings_tests.cpp`:
- [NITPICK] src/test/blockencodings_tests.cpp:121-124: Test keys extra entries with GetHash instead of production GetInstanceHash
The production path stores compact-block extra transactions under GetInstanceHash() in src/net_processing.cpp:1953, and compact-block short IDs are also computed from instance hashes in src/blockencodings.cpp:34. This test uses GetHash(), which happens to match for the ordinary transactions created by BuildBlockTestCase, but does not verify the Dash-specific invariant for version 2+ asset unlocks where the two hashes differ. Keying the test entries with GetInstanceHash() would make the regression test mirror the production path.
thepastaclaw
left a comment
There was a problem hiding this comment.
Re-review — Final validation — Phase 1 + Phase 2
Verified the complete diff at 771e8e8 against upstream bitcoin#35670 and the surrounding Dash code: the change preserves instance-hash keying and ring-buffer behavior, with no correctness defects found, and the prior test-key finding is fixed. One non-blocking commit-history suggestion remains. Static validation only: current CI shows successful lint and multiple platform builds, with tests and additional builds pending; the milestone requirement fails and conflict-prediction jobs were cancelled, neither indicating a code failure.
🟡 1 suggestion(s)
1 finding(s) not shown inline (the lines are not part of this PR's diff)
🟡 Suggestion: Fold the corrective follow-up into the initial backport
<commit:771e8e8a00d>:1
Commit 771e8e8 removes the InitData guard and regression test introduced by 4339411 and completes the same backport's early-return alignment. These commits represent one logical change; retaining both leaves an unnecessary introduction/removal cycle, while the initial commit message describes guard and test behavior absent from the final tree. Fold the correction into the initial backport and update the resulting message to describe only the final change, retaining the upstream reference and Dash instance-hash adaptation.
source: gpt-6.1-sol (phase2-reviewer: dash-core-commit-history)
Review provenance
Source: reviewer 1: glm-5.3-flash (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: backport-reviewer); reviewer 4: gpt-6.1-sol (agent: phase2-reviewer, role: dash-core-commit-history); reviewer 5: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 6: gpt-6.1-sol (agent: phase2-reviewer, role: backport-reviewer); reviewer 7: 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:
lowbygpt-6.1-sol(effort low) — The diff is a small, contained change to compact-block transaction cache initialization and insertion, with straightforward append-until-full behavior and unchanged replacement order. - Phase 1 reviewers:
glm-5.3-flash— general (completed, effort high); agentphase1-reviewer - Phase 1 model:
glm-5.3-flash— zai quota: 5h 93% left, weekly 77% left; passed overgemini-3.8-flash-high(antigravity quota lookup failed) - Fresh final gate: an independent Phase-2 review ran after iterative findings were reconciled
- Fresh verifier:
gpt-6.1-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.1-sol— general (completed, effort medium); agentphase2-reviewer,gpt-6.1-sol— backport-reviewer (completed, effort medium); agentphase2-reviewer,gpt-6.1-sol— dash-core-commit-history (completed, effort medium); agentphase2-reviewer,gpt-6.1-sol— general (completed, effort medium); agentphase2-reviewer,gpt-6.1-sol— backport-reviewer (completed, effort medium); agentphase2-reviewer,gpt-6.1-sol— dash-core-commit-history (completed, effort medium); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.
In `<commit:771e8e8a00d>`:
- [SUGGESTION] <commit:771e8e8a00d>:1: Fold the corrective follow-up into the initial backport
Commit 771e8e8a00d removes the InitData guard and regression test introduced by 4339411b01c and completes the same backport's early-return alignment. These commits represent one logical change; retaining both leaves an unnecessary introduction/removal cycle, while the initial commit message describes guard and test behavior absent from the final tree. Fold the correction into the initial backport and update the resulting message to describe only the final change, retaining the upstream reference and Dash instance-hash adaptation.
|
squash 2 commits please and update commit description accordingly |
vExtraTxnForCompact was resized to its configured capacity on the first
insertion. Until the ring filled, compact block reconstruction scanned
default {uint256(), nullptr} entries created for the unused slots.
Reserve the configured capacity and append entries until the cache is
full, then keep the same ring-buffer overwrite behavior. This preserves
the configured maximum and replacement order while keeping
reconstruction from scanning unused capacity.
Port of bitcoin/bitcoin@1a3cbf1bd2. Dash keys the cache by the
transaction instance hash (GetInstanceHash()) instead of upstream's
witness hash.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
771e8e8 to
f5930b8
Compare
Issue being fixed or feature implemented
vExtraTxnForCompactholds orphan and rejected transactions for compact block reconstruction. On the first insertion it was resized to its full configured capacity. Until the ring filled,PartiallyDownloadedBlock::InitDatascanned default{uint256(), nullptr}entries in the unused slots.What was done?
Backport of bitcoin#35670 (upstream commit 1a3cbf1): the extra-transaction ring buffer now appends until full.
src/net_processing.cpp:AddToCompactExtraTransactionsnow reserves the configured capacity and appends entries until the cache is full. After that it overwrites in ring order, as before. The configured maximum and the replacement order are unchanged.GetInstanceHash()) rather than upstream's witness hash.The diff is 1:1 with upstream apart from that hash adaptation. No upstream hunks were omitted.
How Has This Been Tested?
test_dashanddashdon Linux x86_64 with--enable-werror --enable-suppress-external-warnings --without-gui, plusCXXFLAGS=-Wno-error=suggest-override. The extra flag is needed because the Boostsignals2headers from depends trigger that warning under this host's newer GCC. The warning is in an untouched file and unrelated to this change../src/test/test_dash --run_test=blockencodings_tests,net_peer_connection_tests,denialofservice_testspasses.p2p_compactblocks.pypasses.Breaking Changes
None.
Checklist:
🤖 Generated with Claude Code