Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| c.logger.Info("removed crudr peer", zap.String("host", p.Host)) | ||
| } | ||
| } | ||
| c.peerClients = kept |
There was a problem hiding this comment.
Removed peer clients leak goroutines indefinitely
Medium Severity
When UpdatePeers removes a peer from c.peerClients, the two goroutines started by p.Start(c.lc) (sender and sweeper) continue running indefinitely. PeerClient has no Stop method, and Lifecycle has no way to cancel individual managed routines. The sweeper goroutine for each removed peer continues making HTTP requests and applying ops every 10 minutes. Since refreshPeersAndSigners calls UpdatePeers every 10 minutes, leaked goroutines can accumulate over the process lifetime.


Note
Medium Risk
Moderate risk: changes peer replication client lifecycle and adds in-place peer list reconciliation, which could leave orphaned routines or affect cluster sync if host lists are wrong; other changes are straightforward DB query/cursor fixes.
Overview
Fixes two long-running cluster maintenance issues and improves peer syncing. Storage expectation is recalculated using
eth_registered_endpoints(node count) instead ofcore_validators, aligning the estimate with the current registry.Crudrpeer handling is made safer and dynamic:broadcast/ForceSweepnow snapshotpeerClientsunder lock, and a newUpdatePeersreconciles the peer list (add/start new clients, drop removed peers) which is invoked during periodic peer refresh.Upload scrolling now always persists the cursor after processing a page (even when there are no overwrites), preventing the scroller from re-fetching the same page indefinitely; overwrites are still applied conditionally.
Written by Cursor Bugbot for commit c895c57. This will update automatically on new commits. Configure here.