refactor(p2p,eth): collapse pair-peer dual links into a single prioritized write path, close #2351 #2359#2360
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR removes the XDPoS pair-peer dual-connection mechanism and replaces its BFT-latency goal with per-peer high/low priority write scheduling in the p2p message path.
Changes:
- Removes pair-peer state, duplicate-connection allowances, and eth pair writer fallback paths.
- Adds
PriorityMsgWriter/SendPriorityand routes Vote, Timeout, and SyncInfo messages through the high-priority lane. - Updates dial/server tests and adds priority scheduler tests for preemption, starvation guard, and fallback behavior.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
p2p/server.go |
Rejects duplicate NodeID connections and removes pair-peer tracking. |
p2p/server_test.go |
Updates server peer tracking tests for single-peer semantics. |
p2p/peer.go |
Adds high/low write request queues and priority arbitration. |
p2p/peer_test.go |
Removes pair-peer disconnect behavior test. |
p2p/peer_priority_test.go |
Adds tests for priority write scheduling behavior. |
p2p/peer_error.go |
Removes ErrAddPairPeer. |
p2p/message.go |
Adds SendPriority helper with fallback to normal writes. |
p2p/dial.go |
Restores duplicate peer dial rejection. |
p2p/dial_test.go |
Updates dial state expectations for one connection per NodeID. |
eth/peer.go |
Removes pairRw and uses priority sends for BFT messages. |
eth/handler.go |
Simplifies peer registration now that pair peers are removed. |
4d8709c to
3771f6b
Compare
bb807f4 to
a37847c
Compare
43397e7 to
8e66ebd
Compare
8e66ebd to
4f92775
Compare
4f92775 to
77c08ce
Compare
77c08ce to
4548fb3
Compare
4548fb3 to
d75ae5c
Compare
3123733 to
70c967c
Compare
…tized write path, close XinFinOrg#2351 XinFinOrg#2359 Replace the pair-peer dual-link write model with a single peer-owned write ingress backed by internal high/low priority queues. Preserve BFT message priority across wrapper layers, keep synchronous write errors visible to callers, and make queued versus in-flight shutdown handling deterministic. Update queue metrics and add regression coverage for priority preemption, starvation bounds, ping serialization, wrapper forwarding, and shutdown behavior.
70c967c to
e11afef
Compare
Proposed changes
This PR close issue #2359 and replace PR #2351
Replace the pair-peer dual-link write model with a single peer-owned write ingress backed by internal high/low priority queues.
Preserve BFT message priority across wrapper layers, keep synchronous write errors visible to callers, and make queued versus in-flight shutdown handling deterministic.
Update queue metrics and add regression coverage for priority preemption, starvation bounds, ping serialization, wrapper forwarding, and shutdown behavior.
Types of changes
What types of changes does your code introduce to XDC network?
Put an
✅in the boxes that applyImpacted Components
Which parts of the codebase does this PR touch?
Put an
✅in the boxes that applyChecklist
Put an
✅in the boxes once you have confirmed below actions (or provide reasons on not doing so) that