fix: store historical rotating quorums by cycle boundary hash#409
fix: store historical rotating quorums by cycle boundary hash#409xdustinface wants to merge 1 commit intov0.42-devfrom
Conversation
Adds infrastructure for storing historical rotating quorums keyed by cycle boundary hash instead of quorum hash. This enables InstantLock verification for previous cycles by: - Adding `WORK_DIFF_DEPTH` constant (8 blocks offset to cycle boundary) - Adding `store_rotating_quorums_for_cycle()` to extract and store quorums - Collecting work block hashes from `QRInfo` diffs (`h-4c`, `h-3c`, `h-2c`, `h-c`) - Using cycle boundary hash as the key for `rotated_quorums_per_cycle`
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, 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 have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ✨ 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 |
|
@coderabbitai review Ensure you take into consideration this DIP https://github.com/dashpay/dips/blob/master/dip-0022.md and it's prior work, to understand system design. |
🧩 Analysis chain
🏁 Script executed: Length of output: 84079 🏁 Script executed: Length of output: 8821 🏁 Script executed: Length of output: 812
🏁 Script executed: Length of output: 12201 🏁 Script executed: Length of output: 10580 🏁 Script executed: Length of output: 3144 🏁 Script executed: Length of output: 5282 🏁 Script executed: Length of output: 4839 🏁 Script executed: Length of output: 8707
✅ Correct Implementation of DIP-0022 & DIP-0024The PR correctly addresses the requirement that InstantLock messages must be verified using Key Strengths
Architecture ObservationsCycle Boundary Calculation let cycle_boundary_height = work_block_height + WORK_DIFF_DEPTH;This correctly maps the work block (where masternode lists are selected) to the cycle boundary (where the cycle begins), matching DIP-0024's requirement that "the masternode list at this height is used 8 blocks prior to the current height" Duplicate Prevention
Minor Suggestions
Questions
SummaryThis PR correctly implements the critical infrastructure needed for deterministic InstantSend lock verification per DIP-0022 and DIP-0024. The shift from quorum hash to cycle hash as the storage key is essential because "any quorum could sign any islock even if it were not responsible to do so for that quorum cycle" under the old approach. The new implementation ensures that "nodes can follow the steps required to determine the appropriate quorumHash and verify the signature" for InstantLocks from any cycle. 🧠 Learnings used✅ Actions performedReview triggered.
|
This fixes issues in InstantSend lock verification where we miss the selected quorums. It adds infrastructure for storing historical rotating quorums keyed by cycle boundary hash instead of quorum hash. This enables InstantLock verification for previous cycles by:
WORK_DIFF_DEPTHconstant (8 blocks offset to cycle boundary)store_rotating_quorums_for_cycle()to extract and store quorumsQRInfodiffs (h-4c,h-3c,h-2c,h-c)rotated_quorums_per_cycle