Skip to content

refactor(quic): finish_write delegates to drain#973

Merged
tcoratger merged 1 commit into
leanEthereum:mainfrom
tcoratger:audit/arch-05-finish-write-calls-drain
Jun 12, 2026
Merged

refactor(quic): finish_write delegates to drain#973
tcoratger merged 1 commit into
leanEthereum:mainfrom
tcoratger:audit/arch-05-finish-write-calls-drain

Conversation

@tcoratger

Copy link
Copy Markdown
Collaborator

Summary

The QUIC stream adapter's half-close path duplicated the buffer-flush logic already implemented by the drain method. This routes the flush through drain so both paths share a single implementation and cannot drift apart.

Change

finish_write now calls await self.drain() to flush the write buffer, then sends FIN via the underlying stream. The extra finalization (sending FIN) is preserved; only the duplicated flush logic is consolidated.

Behavior is unchanged: drain performs the exact same buffer flush that was previously inlined.

Verification

  • uv run pytest tests/node/networking/transport/quic/test_stream_adapter.py — 52 passed
  • just check — all checks passed

🤖 Generated with Claude Code

The half-close path duplicated the buffer-flush logic already
implemented by the drain method.
Route the flush through drain so the two paths share one
implementation and stay consistent.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@tcoratger tcoratger merged commit 19889f5 into leanEthereum:main Jun 12, 2026
14 checks passed
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