Skip to content

fix: wait for send buffer space on p2p request responses#3903

Open
iho wants to merge 1 commit into
mimblewimble:stagingfrom
iho:fix/p2p-response-send-timeout
Open

fix: wait for send buffer space on p2p request responses#3903
iho wants to merge 1 commit into
mimblewimble:stagingfrom
iho:fix/p2p-response-send-timeout

Conversation

@iho

@iho iho commented Jul 9, 2026

Copy link
Copy Markdown

Summary

Large txs were accepted to the local pool and advertised by kernel hash, peers issued GetTransaction, but full-tx responses could be silently dropped when the outbound peer send channel was full (try_send + drop).

That matches the #3392 symptoms: 8 peers request the full tx after the kernel hash, then the large tx never completes propagation.

Changes

  • Keep non-blocking try_send for unsolicited traffic (broadcasts, stems, etc.)
  • Add ConnHandle::send_response that waits up to 5s for queue space before dropping
  • Use send_response for Consumed::Response (answers to GetTransaction / GetBlock / etc.)
  • Log message type and body size when dropping (full queue or response timeout)
  • Unit tests: drop-on-full for send, wait-for-space for send_response

Closes #3392

Test plan

  • cargo test -p grin_p2p --lib conn::tests

Outbound peer messages use a bounded channel with try_send that drops
when full. That is fine for broadcasts, but silently dropping a
GetTransaction/GetBlock response leaves the peer without data and can
stall large-tx propagation after kernel-hash advertise.

Use a short blocking wait for Consumed::Response, log type/size on
drop/timeout, and keep try_send for unsolicited traffic.

Closes mimblewimble#3392
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.

1 participant