Skip to content

refactor(reqresp): drop defensive finish_write lookup#740

Open
tcoratger wants to merge 1 commit into
leanEthereum:mainfrom
tcoratger:refactor/reqresp-finish-write
Open

refactor(reqresp): drop defensive finish_write lookup#740
tcoratger wants to merge 1 commit into
leanEthereum:mainfrom
tcoratger:refactor/reqresp-finish-write

Conversation

@tcoratger
Copy link
Copy Markdown
Collaborator

Summary

  • The reqresp client opens streams through QuicConnection.open_stream(), which is statically typed as returning QuicStream — a class that always implements finish_write.
  • The getattr(stream, "finish_write", None); if finish_write is not None: await finish_write() guard at the BlocksByRoot and BlocksByRange call sites was dead defensive code.
  • The sibling status path already called stream.finish_write() directly, so this just aligns the three sites.

Test plan

  • uv run pytest tests/lean_spec/subspecs/networking/client/ — 126 tests pass.
  • Confirmed every test fake stream implements finish_write (grep across tests/).

🤖 Generated with Claude Code

The reqresp client opens streams via QuicConnection.open_stream(),
which is typed as returning QuicStream — a class that always
implements finish_write. The getattr(stream, "finish_write", None)
guard at the BlocksByRoot and BlocksByRange sites was dead. The
sibling status path already called stream.finish_write() directly,
so this aligns the three sites.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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