Skip to content

feat: relay use async send msg#5001

Merged
driftluo merged 4 commits into
nervosnetwork:developfrom
driftluo:use-async-on-net
Nov 20, 2025
Merged

feat: relay use async send msg#5001
driftluo merged 4 commits into
nervosnetwork:developfrom
driftluo:use-async-on-net

Conversation

@driftluo

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

async send avoids the problem of messages failing to be sent due to insufficient capacity during congestion.

Check List

Tests

  • Unit test
  • Integration test

Release note

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

@eval-exec

Copy link
Copy Markdown
Collaborator

Please rebase onto develop branch.

@driftluo driftluo force-pushed the use-async-on-net branch 2 times, most recently from 74dfc5d to 61a11ea Compare November 13, 2025 07:02
@eval-exec

Copy link
Copy Markdown
Collaborator

@driftluo driftluo force-pushed the use-async-on-net branch 7 times, most recently from 58db65d to 5c6bfca Compare November 14, 2025 14:28
@driftluo driftluo marked this pull request as ready for review November 20, 2025 05:17
@driftluo driftluo requested a review from a team as a code owner November 20, 2025 05:17
@driftluo driftluo requested review from quake and removed request for a team November 20, 2025 05:17
Comment thread chain/src/init.rs
.expect("start preload_unverified_block should ok");

let (process_block_tx, process_block_rx) = channel::bounded(0);
let (process_block_tx, process_block_rx) = channel::bounded(24);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

How is this fixed value calculated?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

There's no calculation basis here; it's just fixing 0 into a bounded value. Using 0 here is actually unreasonable.

@eval-exec and I discussed why it was written as 0 here, but there was no reason why it had to be 0.

The blocks received here come from three sources: RPC mining, sync protocol synchronization, and relay protocol synchronization. A value of 0 means that only one source of data can be received at a time; the other source must wait for processing to complete, but this waiting is not mandatory.

Therefore, a small value was filled in here.

Comment thread network/src/network.rs Outdated
Comment thread sync/src/utils.rs Outdated
Comment thread network/src/protocols/mod.rs
Comment thread sync/src/relayer/mod.rs Outdated
Comment thread sync/src/relayer/mod.rs Outdated
eval-exec
eval-exec previously approved these changes Nov 20, 2025
@driftluo driftluo added this pull request to the merge queue Nov 20, 2025
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 20, 2025
@driftluo driftluo added this pull request to the merge queue Nov 20, 2025
Merged via the queue into nervosnetwork:develop with commit 88f620c Nov 20, 2025
33 checks passed
@driftluo driftluo deleted the use-async-on-net branch November 20, 2025 12:38
@doitian doitian mentioned this pull request Dec 10, 2025
@doitian doitian mentioned this pull request Mar 3, 2026
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