Removed code to start connection upon addition of new peers.#1738
Merged
Conversation
Log messages added.
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR removes the auto-connection logic when adding a new peer and instead relies on manual connection management while adding additional debug logging to better trace connection events.
- Removed asynchronous spawning of outgoing connections in AddAddress.
- Added debug logging for spawning and tracking peer connections.
- Updated function signatures in peer management and node initialization to reflect these changes.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| pkg/node/peers/peer_manager.go | Removed connection spawn in AddAddress and added debug logging for connection metrics. |
| pkg/node/node.go | Removed unused SpawnOutgoingConnection function. |
| pkg/node/network/network.go | Added debug logging for established and disconnected connection events. |
| cmd/node/node.go | Updated spawnPeersByAddresses call to match the new AddAddress signature. |
Comments suppressed due to low confidence (2)
pkg/node/peers/peer_manager.go:425
- The removal of the context parameter and the asynchronous outgoing connection spawn in AddAddress is a key design change. Please ensure that the process for initiating connections is handled elsewhere and that the new signature aligns with the overall connection management strategy.
func (a *PeerManagerImpl) AddAddress(addr proto.TCPAddr) error {
cmd/node/node.go:440
- The call to spawnPeersByAddresses has been updated to remove the context parameter. Verify that context handling for asynchronous operations is re-integrated at an appropriate location if needed.
if pErr := spawnPeersByAddresses(conf.Addresses, peerManager); pErr != nil {
nickeskov
approved these changes
Jun 27, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Log messages added.