-
Notifications
You must be signed in to change notification settings - Fork 1.2k
refactor: move all network operations out of CGovernanceManager
#7106
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?
refactor: move all network operations out of CGovernanceManager
#7106
Conversation
…thods Replace SyncObjects() and SyncSingleObjVotes() with pure data accessors: - GetSyncableObjectInvs(): returns inventory of syncable governance objects - GetSyncableVoteInvs(): returns inventory of syncable votes for an object Move network message construction (SYNCSTATUSCOUNT) to NetGovernance, following the established pattern in NetSigning and NetInstantSend. This improves separation of concerns: - CGovernanceManager handles data access only - NetGovernance handles network protocol operations Co-Authored-By: Claude Opus 4.5 <[email protected]>
Complete separation of network operations from CGovernanceManager by moving RequestGovernanceObject functionality to the appropriate network layer classes. Changes to CGovernanceManager (data access only): - Add GetVoteBloomFilter() to build bloom filter for sync requests - Add GetOrphanVoteObjectHashes() to get object hashes for orphan votes - Modify ProcessVote() to use output param hashToRequest instead of doing network operations internally - Remove RequestGovernanceObject() and RequestOrphanObjects() Changes to SyncManager: - Add SendGovernanceObjectSyncRequest() for vote sync requests - Update RequestGovernanceObjectVotes() to use new method Changes to NetGovernance: - Handle orphan vote requests in ProcessMessage() after ProcessVote - Move RequestOrphanObjects logic into Schedule() for periodic requests Co-Authored-By: Claude Opus 4.5 <[email protected]>
WalkthroughThe changes refactor the governance synchronization API by decoupling network operations from data collection. Four network-performing methods are replaced with pure getter/accessor methods: Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes The refactoring spans five files with heterogeneous changes to public APIs and their call sites. While the changes follow a consistent decoupling pattern, they require careful verification that all callers are updated correctly and that network operations are properly delegated. The moderate logic density involving bloom filters, orphan tracking, and inventory management, combined with the multiple affected components, necessitates detailed review. 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
📜 Recent review detailsConfiguration used: Repository UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (5)
🧰 Additional context used📓 Path-based instructions (5)src/**/*.{cpp,h,hpp,cc}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
src/node/**/*.{cpp,h}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
src/{masternode,evo,llmq,governance,coinjoin}/**/*.{cpp,h}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
src/governance/**/*.{cpp,h}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
src/{masternode,llmq,evo,coinjoin,governance}/**/*.{cpp,h}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
🧠 Learnings (13)📓 Common learnings📚 Learning: 2025-11-24T16:41:22.457ZApplied to files:
📚 Learning: 2025-11-25T10:53:37.523ZApplied to files:
📚 Learning: 2025-12-22T15:42:48.595ZApplied to files:
📚 Learning: 2025-11-24T16:41:22.457ZApplied to files:
📚 Learning: 2025-11-24T16:41:22.457ZApplied to files:
📚 Learning: 2025-12-09T20:40:42.286ZApplied to files:
📚 Learning: 2025-10-21T11:09:34.688ZApplied to files:
📚 Learning: 2025-11-24T16:41:22.457ZApplied to files:
📚 Learning: 2025-11-24T16:41:22.457ZApplied to files:
📚 Learning: 2025-11-25T10:53:37.523ZApplied to files:
📚 Learning: 2025-11-24T16:41:22.457ZApplied to files:
📚 Learning: 2025-11-24T16:41:22.457ZApplied to files:
🧬 Code graph analysis (4)src/node/sync_manager.h (1)
src/node/sync_manager.cpp (1)
src/governance/governance.h (1)
src/governance/governance.cpp (2)
⏰ 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)
🔇 Additional comments (15)
✏️ Tip: You can disable this entire section by setting 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 |
Issue being fixed or feature implemented
Move all network operations from
CGovernanceManagerto the appropriate network layer classes (SyncManagerandNetGovernance).What was done?
Refactor only, see individual commits
How Has This Been Tested?
Run tests, sync gov data on mainnet node
Breaking Changes
n/a
Checklist: