Skip to content

Removed code to start connection upon addition of new peers.#1738

Merged
nickeskov merged 1 commit into
masterfrom
fix-initial-peers-spawn
Jun 27, 2025
Merged

Removed code to start connection upon addition of new peers.#1738
nickeskov merged 1 commit into
masterfrom
fix-initial-peers-spawn

Conversation

@alexeykiselev

Copy link
Copy Markdown
Collaborator

Log messages added.

@alexeykiselev
alexeykiselev requested a review from nickeskov June 27, 2025 14:56
@nickeskov nickeskov added the bug Something isn't working label Jun 27, 2025
@nickeskov
nickeskov requested a review from Copilot June 27, 2025 15:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
nickeskov merged commit 5f7043d into master Jun 27, 2025
21 checks passed
@nickeskov
nickeskov deleted the fix-initial-peers-spawn branch June 27, 2025 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants