Skip to content

Conversation

@zhangsoledad
Copy link
Member

@zhangsoledad zhangsoledad commented May 22, 2025

What is changed and how it works?

This approach was motivated by the TxProbe paper.,After this PR, CKB will make 2 additional outbound connections that are only used for block relay.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)

Side effects

  • Performance regression
  • Breaking backward compatibility

Release note

Title Only: Include only the PR title in the release note.

@zhangsoledad zhangsoledad force-pushed the zhangsoledad/extra_block_relay_peers branch from 7df79cd to b3af81f Compare May 22, 2025 06:52
@zhangsoledad zhangsoledad requested a review from Copilot May 29, 2025 15:57

This comment was marked as outdated.

@zhangsoledad zhangsoledad force-pushed the zhangsoledad/extra_block_relay_peers branch from 15a3df1 to 341b841 Compare June 5, 2025 14:53
@zhangsoledad zhangsoledad marked this pull request as ready for review June 5, 2025 15:01
@zhangsoledad zhangsoledad requested a review from a team as a code owner June 5, 2025 15:01
@zhangsoledad zhangsoledad requested review from quake and removed request for a team June 5, 2025 15:01
@zhangsoledad zhangsoledad force-pushed the zhangsoledad/extra_block_relay_peers branch from 18c03ed to 4211771 Compare June 5, 2025 15:15
@zhangsoledad zhangsoledad requested a review from Copilot June 5, 2025 15:16

This comment was marked as outdated.

@zhangsoledad zhangsoledad force-pushed the zhangsoledad/extra_block_relay_peers branch from a3d28c9 to 3852d13 Compare June 26, 2025 10:46
@zhangsoledad zhangsoledad force-pushed the zhangsoledad/extra_block_relay_peers branch from 3852d13 to 040245a Compare June 26, 2025 13:27
Copy link

Copilot AI left a comment

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 implements the new feature of adding two outbound block‐relay-only connections. Key changes include adding a new config flag (disable_block_relay_only_connection), updating peer registry logic to support block relay only sessions, and propagating these changes through tests, protocols, and peer store modules.

Reviewed Changes

Copilot reviewed 20 out of 21 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
util/light-client-protocol-server/src/tests/utils/network_context.rs Added stub for full_relay_connected_peers in test context.
util/app-config/src/configs/network.rs Introduced a new configuration flag for disabling block‐relay-only connections.
test/src/specs/p2p/whitelist.rs Updated whitelist tests to disable block‐relay‐only connections.
sync/* Added implementations for full_relay_connected_peers in various test modules.
network/src/protocols/* Updated protocol implementations to use the full_relay_connected_peers API and change the register method signature to return a bool.
network/src/peer_store/* Integrated anchors support into peer store for managing block‐relay‐only peers.
network/src/peer_registry.rs Updated peer acceptance logic and connection status counters to handle block‐relay‐only sessions.
network/src/peer.rs Introduced a new SessionType enum with a BlockRelayOnly variant.
network/src/network.rs Updated network initialization to include anchors for block‐relay‐only peers.
network/src/lib.rs Adjusted imports to align with the new session type and protocol changes.
Comments suppressed due to low confidence (1)

network/src/protocols/identify/mod.rs:364

  • Update the documentation comment for the register method to reflect that it now returns a bool indicating whether registration succeeded, so that future readers and integrators clearly understand this API change.
    fn register(&self, context: &ProtocolContextMutRef, version: &str) -> bool {

@zhangsoledad zhangsoledad added this pull request to the merge queue Jun 27, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jun 27, 2025
@zhangsoledad zhangsoledad added this pull request to the merge queue Jun 27, 2025
Merged via the queue into nervosnetwork:develop with commit d373de5 Jun 27, 2025
36 of 37 checks passed
@doitian doitian mentioned this pull request Sep 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants