fix: deduplicate QRINFO base blocks#7349
Conversation
|
@coderabbitai review |
✅ Action performedReview finished.
|
✅ No Merge Conflicts DetectedThis PR currently has no conflicts with other open PRs. |
|
Warning Review limit reached
More reviews will be available in 4 minutes and 8 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughThis PR modifies the quorum rotation snapshot construction to unconditionally sort and deduplicate base block indexes by ascending block height. Previously, this sorting was applied only under legacy construction; now it applies to all paths. The change adds Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
🔍 Review in progress — actively reviewing now (commit 9f30867) |
thepastaclaw
left a comment
There was a problem hiding this comment.
Code Review
Both agents converged on no findings for this small, well-scoped fix that sorts and deduplicates QRINFO baseBlockIndexes. CodeRabbit also reported no inline findings. The change is covered by both unit and functional tests.
|
Might this be a breaking change? Especially how we have the "legacy construction" flag? seems for some reason at some point the exact structure was deemed important? |
Address review feedback: the prior commit unconditionally sorted and deduplicated baseBlockIndexes, which touched the legacy construction path used to serve peers < EFFICIENT_QRINFO_VERSION. Restrict deduplication to the non-legacy path so the wire response to older peers stays bit-for-bit identical to the pre-fix behavior. The legacy path keeps the sort it always relied on for baseBlockIndexes.back() and GetLastBaseBlockHash(). Strengthen the unit test to explicitly prove the legacy no-op invariant: GetLastBaseBlockHash returns the same hash whether the sorted input contains duplicates or not, so legacy multiplicity is harmless. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Good catch. I narrowed the change in The repeated-base-hash fix now applies to the non-legacy path used by the RPC. I also added a direct unit assertion documenting that duplicates are a no-op for legacy Validation: |
Issue being fixed or feature implemented
QRINFO request handling accepts caller-provided base block hashes and carries the
validated block indexes through quorum rotation response construction. Repeated
base hashes do not add useful information, so this change canonicalizes those
base indexes before the builder phases use them.
Provenance: thepastaclaw/tracker#1450
What was done?
paths.
result as a single base hash.
How Has This Been Tested?
Environment: macOS arm64, local Dash Core worktree based on
upstream/develop.Commands run:
git diff --check upstream/develop..HEAD— passedmake -C src -j$(sysctl -n hw.ncpu) test/test_dash— passed earlier in thisworktree before the final Python-only test addition
src/test/test_dash --run_test=llmq_snapshot_tests/get_last_base_block_hash_repeated_base_blocks_test— passed
test/functional/feature_llmq_rotation.py— skipped locally because thisworktree was configured with
--disable-walletcode-review dashpay/dash upstream/develop fix/qrinfo-dedupe-base-hashes ...— passed with recommendation: ship
Also checked:
gh api repos/dashpay/dash --jq '.default_branch'—developopen PR found
Breaking Changes
None expected.
Checklist: