celestiaorg / celestiaorg/celestia-node

feat(p2p): Extract bootstrapping into separate module

Open
#3,274 5 comments 0 reactions 0 assignees View on GitHub
area:p2p enhancement stale
Dominant language
Go
Stars
996
Forks
1.1k
Avg merge
1d 6h
Merged PRs (30d)
34

Description

### Implementation ideas

The current implementation of the Celetia node disperses the logic for maintaining alive connections to other nodes across multiple packages, notably within the go-header package and discovery. This approach has led to inefficiencies, particularly in scenarios where the node could become isolated from its peers due to networking issues. Presently, if the node loses all connections and remains disconnected for a prolonged period, it may fail to re-initiate connections to known peers or bootstrappers, effectively stalling its network participation.

This issue proposes the creation of a dedicated module responsible for aggregating all connection management logic. This module will ensure the node maintains at least one active connection to either bootstrappers or previously seen peers upon launch. Moreover, it will actively manage reconnections to the network if the node finds itself disconnected from all peers, addressing the current limitation where the node might cease attempting to reconnect.

Objectives:
1. Create module within the Celestia node that ensures there is alive connection to network.
2. Extract and consolidate existing connection logic from the go-header package and any other relevant parts of the codebase into this new module.
3. Ensure the module initiates at least one connection to known peers or bootstrappers upon node startup.
4. Implement a mechanism within the module to detect loss of all connections and automatically attempt reconnection to the network, using a list of previously successful connections and bootstrappers.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.