-
Notifications
You must be signed in to change notification settings - Fork 246
feat: Add 2 outbound block-relay-only connections #4888
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add 2 outbound block-relay-only connections #4888
Conversation
7df79cd to
b3af81f
Compare
15a3df1 to
341b841
Compare
18c03ed to
4211771
Compare
a3d28c9 to
3852d13
Compare
3852d13 to
040245a
Compare
There was a problem hiding this 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 {
d373de5
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
Side effects
Release note