-
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
Conversation
WalkthroughThe core governance code was changed to make the per-hash vote-request limit chain-aware: real networks keep a peers-per-hash limit of 3, while mockable/regtest chains use an effectively unlimited limit (size_t max). The functional governance test was extended with many additional assertions that check total vote counts (gobject("count")["votes"]) and consistent YES/NO vote tallies across nodes at multiple points, including during isolation and after reconnection. No public APIs or exported signatures were modified. Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. 📜 Recent review detailsConfiguration used: CodeRabbit UI 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. 📥 CommitsReviewing files that changed from the base of the PR and between 89753f285de2383baea172e33fe157fc6fe5b153 and bd2aa80. 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
✨ Finishing Touches
🧪 Generate unit tests
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. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
src/governance/governance.cpp
Outdated
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?
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.
can we increaese this value for both cases of mockable / non-mockable chain? What are possible downsides?
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.
Mockable is basically regtest, non-mockable - everything else. We don't want to ask too many nodes for the same data on real networks, it would be a waste of bandwidth.
knst
left a comment
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.
ACK 89753f285de2383baea172e33fe157fc6fe5b153
I tested one more time by cherry-picking commits to top of develop - it works fine
src/governance/governance.cpp
Outdated
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.
can we increaese this value for both cases of mockable / non-mockable chain? What are possible downsides?
|
Claude's comments, makes sense to me.
Suggestions
|
✅ No Merge Conflicts DetectedThis PR currently has no conflicts with other open PRs. |
|
rebased on develop with no changes in previous commits and added bd2aa80 to address review suggestions |
knst
left a comment
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.
LGTM a7c8116
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.pyflakiness. Alternative to #6710.What was done?
Bump
nPeersPerHashMaxfor 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.pyBreaking Changes
n/a
Checklist: