Repository navigation
fix(rpc): derive active DKG count from membership - #7812
PastaPastaPasta merged 2 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (4)
💤 Files with no reviewable changes (2)
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
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant Client
participant DkginfoRPC
participant QuorumData
Client->>DkginfoRPC: Request dkginfo
DkginfoRPC->>QuorumData: Check cycle, work block, and membership
QuorumData-->>DkginfoRPC: Membership result or unknown reason
DkginfoRPC-->>Client: active_dkgs and upcoming DKG details
Merge Risk: ⚪ Minimal · up to The changed DKG participation count is consistent with session timing and membership selection. No issue requiring a fix before merge was established. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)✅ Passed checks (4 passed)Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 11 functions across 4 files. (1 skipped: 1 unsupported.)
✨ 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 |
|
✅ Final review complete — no blockers (commit 1ed0310) · triage: normal |
thepastaclaw
left a comment
There was a problem hiding this comment.
Final validation — Phase 2 only (queue backlog)
Verified the supplied Phase-2 claims against head ca29e24 and the four-commit PR range. No in-scope correctness blocker was identified; the commit-history suggestion is supported by the diffs and remains nonblocking. Validation was static only: the supplied CI snapshot shows successful formatting and merge checks, two queued container-manifest jobs, and cancelled conflict prediction; no local builds or tests were run.
🟡 1 suggestion(s)
1 finding(s) not shown inline (the lines are not part of this PR's diff)
🟡 Suggestion: Fold the active-window correction into the implementation it amends
<commit:ca29e24b74>:1
Commit ca29e24 replaces the dkgMiningWindowStart cutoff introduced by cbd8aa7 and retained by 0881935 with 5 * dkgPhaseBlocks, updates the newly added rotated-boundary assertions, and corrects the new current-session reason text. These changes complete the behavior introduced earlier in this same unmerged stack rather than repair behavior predating the PR. Fold this correction into the membership implementation, regrouping the implementation commits as needed; if the separate release-note commit is retained, consolidate its subsequent edits there. This follows the project's atomic-commit guidance and keeps permanent history focused on the complete intended behavior instead of its intermediate cutoff and immediate repair.
source: gpt-6.1-sol (phase2-reviewer: dash-core-commit-history)
Review provenance
Source: reviewer 1: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 2: 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) — The change adds nontrivial RPC membership prediction and per-session expiration logic with boundary tests, but does not itself alter consensus, funds movement, cryptography, network deserialization, or storage migrations. - Phase 1 reviewers: not run (skipped for throughput: 13 PRs queued, above the 10 limit)
- 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— 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 `<commit:ca29e24b74>`:
- [SUGGESTION] <commit:ca29e24b74>:1: Fold the active-window correction into the implementation it amends
Commit ca29e24b74 replaces the dkgMiningWindowStart cutoff introduced by cbd8aa7865 and retained by 08819354de with 5 * dkgPhaseBlocks, updates the newly added rotated-boundary assertions, and corrects the new current-session reason text. These changes complete the behavior introduced earlier in this same unmerged stack rather than repair behavior predating the PR. Fold this correction into the membership implementation, regrouping the implementation commits as needed; if the separate release-note commit is retained, consolidate its subsequent edits there. This follows the project's atomic-commit guidance and keeps permanent history focused on the complete intended behavior instead of its intermediate cutoff and immediate repair.
ca29e24 to
31c1e47
Compare
thepastaclaw
left a comment
There was a problem hiding this comment.
Re-review — Final validation — Phase 1 + Phase 2
Independently reviewed the complete diff at 31c1e47 and found no actionable in-scope defects. Membership-derived counts, conservative unknown handling, and per-index Commit-phase expiry match the surrounding selection and scheduling code; the prior commit-hygiene finding is fixed. This was a static review without local build or test execution; the supplied CI snapshot shows successful completed checks and four queued container builds.
🔴 0 blocking | 🟡 0 suggestion(s) | 💬 0 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: dash-core-commit-history); reviewer 4: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 5: 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) — The change adds nontrivial RPC membership prediction and per-session boundary handling with regression tests, but does not change consensus, funds movement, cryptography, network deserialization, or storage migrations. - 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 below 15% reserve: weekly 15% left, 5h 100% left),glm-5.3-flash(not used above high effort; tier asks max) - 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 high); agentphase2-reviewer,gpt-6.1-sol— dash-core-commit-history (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— general (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 the current code and confirm that no unresolved issues remain.
No unresolved findings remain from the prior review on this head.
knst
left a comment
There was a problem hiding this comment.
what are all of these rpc fields in response are needed for?
simple rpc that answer to question about current active dkg sessions and upcoming suddenly returns so many things. That's not for debugging of dkg quorum process, that's for answering to simple trivial question "is masternode participating in dkg or could be safely rebooted / restarted"?
haveen't checked further more
31c1e47 to
091b462
Compare
Core no longer reports active_dkg_sessions (dashpay/dash#7812 was slimmed). When upcoming_dkgs is present, stopping is safe only if active_dkgs is 0 and no member, unknown-membership or malformed upcoming DKG starts within MIN_BLOCKS_BEFORE_DKG. The legacy next_dkg guard and dkgstatus refinement are kept for responses without upcoming_dkgs. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
@knst Agreed, the extra output wasn't needed. I removed What's left is the fix to
Together with your existing 🤖 Posted autonomously by Claude on behalf of pasta. |
091b462 to
c2c50fb
Compare
thepastaclaw
left a comment
There was a problem hiding this comment.
Re-review — Final validation — Phase 1 + Phase 2
Independently reviewed the complete PR diff at c2c50fb against the surrounding DKG lifecycle, membership-selection code, and functional-test setup; no actionable in-scope defects were found. The implementation counts membership through Commit, expires rotated indices independently, conservatively counts unknown membership, and preserves upcoming-session reporting. Validation was static only: the supplied CI snapshot shows successful preliminary checks, while container builds and conflict prediction remain queued; completed build and functional-test validation is not established.
🔴 0 blocking | 🟡 0 suggestion(s) | 💬 0 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: dash-core-commit-history); reviewer 4: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 5: 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) — The change revises RPC participation-counting logic across DKG phase boundaries, rotated indices, and unknown membership with functional test coverage, but does not itself alter a critical surface. - 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 below 15% reserve: weekly 15% left, 5h 100% left),glm-5.3-flash(not used above high effort; tier asks max) - 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 high); agentphase2-reviewer,gpt-6.1-sol— dash-core-commit-history (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— general (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 the current code and confirm that no unresolved issues remain.
No unresolved findings remain from the prior review on this head.
`quorum dkginfo` reported `active_dkgs` as the number of local DKG debug records. Those appear only once the DKG worker initializes a session and linger after it ends, so the count was 0 at a session's start block and non-zero long after the masternode stopped participating. Compute the count from membership at the captured tip instead: a session counts from its start block through the end of its Commit phase when the given or local masternode is a member of it. Rotated indices expire on their own schedule rather than at the shared mining window. Sessions whose membership cannot be determined are counted, so 0 never hides possible participation. The membership lookup is shared with `upcoming_dkgs`, whose output is unchanged. CDKGDebugManager::GetSessionCount() has no remaining callers and is removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
c2c50fb to
1ed0310
Compare
thepastaclaw
left a comment
There was a problem hiding this comment.
Re-review — Final validation — Phase 1 + Phase 2
Independently reviewed the complete PR diff at 1ed0310 and verified the membership calculation, conservative unknown-membership handling, per-index Commit-phase expiry, and preservation of upcoming-session output; no actionable in-scope issues were found. The prior commit-organization finding is fixed: the correction and regression coverage are incorporated into the implementation commit. Validation was static only; the supplied CI snapshot reports successful completed builds, lint, and standard Linux, SQLite, and no-wallet tests, with ASan tests, TSan tests, and the multiprocess build still pending.
🔴 0 blocking | 🟡 0 suggestion(s) | 💬 0 nitpick(s)
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); reviewer 4: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 5: 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) — The change revises RPC counting logic across DKG membership, phase boundaries, and rotated-session expiry with functional coverage, but does not itself alter consensus, funds, cryptography, network deserialization, or storage migrations. - Phase 1 reviewers:
gemini-3.8-flash-high— general (completed, effort high); agentphase1-reviewer - Phase 1 model:
gemini-3.8-flash-high— antigravity quota: weekly 59% left, 5h 39% left - 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 high); agentphase2-reviewer,gpt-6.1-sol— dash-core-commit-history (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— general (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 the current code and confirm that no unresolved issues remain.
No unresolved findings remain from the prior review on this head.
PastaPastaPasta
left a comment
There was a problem hiding this comment.
approved; this looks reasonable; should fix an edge case bug in dashmate
…status - Rotation test. The existing check after the DKG finishes now asserts 0 for each masternode. It no longer sums the stale debug sessions. The PR's two added scenarios are removed. - rpc_quorum.py. It now mines to the next DKG start block while the DKG spork is still off. Then it asserts the masternode's active_dkgs is above 0, before turning the spork on. The PR's separate scenario is removed. - test_framework.py. The helper that only the removed scenarios used is gone.
…status - Rotation test. The existing check after the DKG finishes now asserts 0 for each masternode. It no longer sums the stale debug sessions. The PR's two added scenarios are removed. - rpc_quorum.py. It now mines to the next DKG start block while the DKG spork is still off. Then it asserts the masternode's active_dkgs is above 0, before turning the spork on. The PR's separate scenario is removed. - test_framework.py. The helper that only the removed scenarios used is gone.
…status - Rotation test. The existing check after the DKG finishes now asserts 0 for each masternode. It no longer sums the stale debug sessions. The PR's two added scenarios are removed. - rpc_quorum.py. It now mines to the next DKG start block while the DKG spork is still off. Then it asserts the masternode's active_dkgs is above 0, before turning the spork on. The PR's separate scenario is removed. - test_framework.py. The helper that only the removed scenarios used is gone.
Issue being fixed or feature implemented
quorum dkginfois meant to answer a simple question: is this masternode participating in a DKG right now, or can it be restarted safely?active_dkgsanswers it wrongly at both ends of a session. At a DKG start block it stays zero until the asynchronous DKG worker publishes its local debug record, and afterwards it keeps counting expired debug records.What was done?
active_dkgsis now computed from membership at the captured chain tip instead of debug-session tracking:quorumHeight + 5 * dkgPhaseBlocks. Rotated indices expire individually, not at the shared cycle mining window.No RPC fields are added.
upcoming_dkgsis unchanged. The membership lookup is shared betweenactive_dkgsandupcoming_dkgs, andCDKGDebugManager::GetSessionCount(), which lost its only caller, is removed.Together with
upcoming_dkgs, this lets dashpay/platform#5231 decide whether a masternode can stop safely from a singlequorum dkginfocall.How Has This Been Tested?
test/functional/rpc_quorum.py: with DKG publication disabled, checks the count for a member and a non-member at the start block, inside the window, and after expiry, against theupcoming_dkgspredictions taken one block before the start.test/functional/feature_llmq_rotation.py: checks conservative counting of unknown membership before v20, zero counts despite expired debug sessions, and per-index expiry of rotated sessions at cycle offsets 0, 1, 9, 10, 11, 12 and 13.Breaking Changes
active_dkgsstays numeric, but its meaning is corrected: it includes sessions not yet initialized locally, excludes expired sessions, counts unknown membership, and follows the supplied proTxHash. Clients that need the local DKG worker state should usequorum dkgstatus.Checklist:
🤖 Generated with Claude Code