Skip to content

refactor(quic): dedup QuicConnection construction sites#975

Closed
tcoratger wants to merge 1 commit into
leanEthereum:mainfrom
tcoratger:audit/arch-04-dedup-quic-construction
Closed

refactor(quic): dedup QuicConnection construction sites#975
tcoratger wants to merge 1 commit into
leanEthereum:mainfrom
tcoratger:audit/arch-04-dedup-quic-construction

Conversation

@tcoratger

Copy link
Copy Markdown
Collaborator

Summary

The QUIC connection manager built a QuicConnection in two places with
identical wiring:

  • the outbound connect path, and
  • the inbound listen handshake callback.

Both constructed the connection, assigned it back onto the protocol, replayed
buffered events, and registered it in the connections map. This change factors
that shared sequence into a single private _register_connection method so the
two sites share one construction path.

Behavior

Unchanged. The two sites differ only in the protocol instance, peer ID, and
remote address; those become the method's parameters. No on-the-wire or public
API change.

Testing

  • uv run pytest tests/node/networking/transport/quic/test_connection.py -q — 74 passed.
  • just check — all checks pass (lint, format, type check, spell, mdformat, lock).

🤖 Generated with Claude Code

Both the outbound connect path and the inbound handshake callback built a
QuicConnection, wired it onto the protocol, replayed buffered events, and
registered it in the connections map with identical steps.

Factor that shared sequence into a single private method on the manager so
the two sites share one construction path. Behavior is unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@tcoratger tcoratger closed this Jun 12, 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.

1 participant