Repository navigation
i2p, test: steady SAM creation deadline, test framework fixes - #246
Merged
Merged
Conversation
Found in review of #233. - i2p: the single SAM session creation deadline is on the steady clock, but Sock::SendComplete() and Sock::RecvUntilTerminator() re-base the time left on the mockable wall clock. A clock step back while the router stalls extended creation (holding Session::m_mutex, which also blocks outbound I2P connects), and a frozen setmocktime left only the interrupt to end it. Each request now goes through a socket view whose waits end by the steady deadline, so the 3-minute bound holds without changing Sock for other callers. A unit test freezes and steps back the mockable clock while the router stalls on SESSION CREATE. - test: when its handshake authentication failed, the Python v2 peer queued its pending bytes (a key confirmation) and then raised from the asyncio callback, which closed the transport before the queued write ran and printed a fatal error on stderr. A hybrid responder whose keys don't match the node's therefore made the node see EOF (closed_after_switch) instead of failing the confirmation. Sends now go through an ordered per-connection queue that the failure path flushes before a graceful close. p2p_v2_pq_misbehaving.py gets a case where such a responder fails the node's confirmation too, and the node records first_packet_failed. - test: V2TransportTester passed a caller's PQKemOps reference straight to V2Transport, getting around its deleted rvalue overload, so a temporary could dangle. The tester now owns a copy that outlives its transport. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. You're on a roll. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
This was referenced Oct 23, 2026
djh58
added a commit
that referenced
this pull request
Oct 26, 2026
When the Python v2 peer fails the node's key confirmation, it writes out what it has sent and closes the connection, so that the node sees the peer's own confirmation fail (#246). But a close with the node's later bytes still unread on the peer's socket resets the connection, and on Windows the reset discards what the node has not read yet: the node then records closed_after_switch (reset) instead of first_packet_failed, and p2p_v2_pq_misbehaving.py fails. The node sends its version packet right after its confirmation, so this depends on timing. End the peer's stream with write_eof() instead and let the node close the connection, discarding what the node still sends until then. Sends after that are dropped, since a write after write_eof() raises. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
6 of 15 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three fixes from review of #233.
Sock::SendComplete()andSock::RecvUntilTerminator()measure their timeouts on the mockable wall clock. A clock step back while the router stalled extended creation, and that holdsSession::m_mutex, which also blocks outbound I2P connects. A frozensetmocktimeleft only an interrupt to end it. Each SAM request now goes through a socket view whose waits end at the steady deadline.Sockis unchanged for other callers. A new unit test freezes the mockable clock, and steps it back, while the router stalls.closed_after_switch) instead of a failed confirmation. Sends now go through an ordered per-connection queue, which the failure path flushes before a graceful close.p2p_v2_pq_misbehaving.pygains a case where such a responder makes the node recordfirst_packet_failed.V2TransportTesterowns itsPQKemOps. It passed a caller's reference straight toV2Transport, getting around the deleted rvalue overload, so a temporary could dangle. This was latent, since every caller passes a static.Tests run:
test_qbit --run_test=net_tests,i2p_testsp2p_v2_pq_misbehaving,p2p_v2_pq,p2p_v2_misbehaving,feature_framework_unit_tests,p2p_i2p_ports,p2p_i2p_sessionsandfeature_proxy, plusp2p_v2_encrypted,p2p_v2_transport,p2p_v2_pq_fallback,rpc_pqtransport,p2p_invalid_messages,p2p_ping,p2p_segwitandp2p_compactblocksAll passed. Since #245, pull requests into
feature/pq-transportdon't run CI. #233's full CI covers this change once it merges.🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need.