-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix: request governance votes from more nodes on regtest #6712
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
WalkthroughThe changes update the governance voting logic and its corresponding functional test. In the core implementation, the maximum number of peers from which to request votes for a governance object is conditionally increased from 3 to 10 when running on a mockable chain, such as regtest, while maintaining the original limit for other networks. The functional test is expanded with additional assertions to check the total vote counts reported by the 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🧰 Additional context used🧬 Code Graph Analysis (1)test/functional/feature_governance.py (2)
🪛 GitHub Actions: Check Potential Conflictssrc/governance/governance.cpp[error] 1-1: Merge conflict detected in 'src/governance/governance.cpp' across multiple pull requests. Rebase required. test/functional/feature_governance.py[error] 1-1: Merge conflict detected in 'test/functional/feature_governance.py' in pull request 6182 and 6710. Rebase required. 🪛 Ruff (0.11.9)test/functional/feature_governance.py289-289: Function definition does not bind loop variable (B023) 290-290: Function definition does not bind loop variable (B023) 291-291: Function definition does not bind loop variable (B023) 292-292: Function definition does not bind loop variable (B023) ⏰ Context from checks skipped due to timeout of 90000ms (3)
🔇 Additional comments (6)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
size_t nPeersPerHashMax = 3; | ||
// We isolate nodes on regtest during tests so let's use extra nodes to make sure | ||
// votes from isolated nodes are requested by non-isolated nodes correctly. | ||
size_t nPeersPerHashMax = Params().IsMockableChain() ? 10 : 3; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to choose "isolated" nodes somehow by more deterministic way instead bumping this variable?
Issue being fixed or feature implemented
We only ask
nPeersPerHashMax
(3) nodes for governance votes for the same governance object when syncing. However on regtest we also isolate nodes to create conflicting triggers and since we have 5 nodes to sync from asking 3 of them often results in asking "non-isolated" nodes only (24 votes) yet sometimes we do ask previously isolated node too (25 votes).Should fix
feature_governance.py
flakiness. Alternative to #6710.What was done?
Bump
nPeersPerHashMax
for regtest. Add more asserts in tests to fail earlier if smth isn't right, check votes on all nodes.How Has This Been Tested?
run
feature_governance.py
Breaking Changes
n/a
Checklist: