fix: Register validator callbacks on p2p client before starting#17207
Merged
spalladino merged 1 commit intonextfrom Sep 22, 2025
Merged
fix: Register validator callbacks on p2p client before starting#17207spalladino merged 1 commit intonextfrom
spalladino merged 1 commit intonextfrom
Conversation
Contributor
Author
|
Here are the relevant logs for a successful run, where the no-discovery validator is initialized: |
Contributor
Author
|
And here for a failed one. Note the "penalizing peer" right after the connections are established, those correspond to the auth handshake failing (the actual error is not shown since it was logged as DEBUG). |
PhilWindle
approved these changes
Sep 22, 2025
2598869 to
fb5f071
Compare
spalladino
added a commit
that referenced
this pull request
Sep 22, 2025
Merged
spalladino
added a commit
that referenced
this pull request
Sep 22, 2025
AztecBot
pushed a commit
that referenced
this pull request
Sep 23, 2025
Second attempt at #17207 The issue was that the `start` method on p2p client would overwrite all previously registered subprotocol handlers, hence the errors we were seeing on CI: ``` 22:00:04 [22:00:04.697] WARN: p2p:4506:libp2p_service:4506:libp2p_service:4506:reqresp:4506 Unknown stream error while handling the stream, aborting {"protocol":"/aztec/req/auth/1.0.0"} 22:00:04 err: { 22:00:04 "type": "TypeError", 22:00:04 "message": "handler is not a function", 22:00:04 "stack": 22:00:04 TypeError: handler is not a function 22:00:04 at /home/aztec-dev/aztec-packages/yarn-project/p2p/dest/services/reqresp/reqresp.js:452:40 22:00:04 at processTicksAndRejections (node:internal/process/task_queues:105:5) 22:00:04 at duplex.sink (/home/aztec-dev/aztec-packages/yarn-project/node_modules/it-byte-stream/src/index.ts:86:22) 22:00:04 } ``` The test was also failing locally (it had passed before I submitted due to a build issue I missed), and since it was tagged as flake it was greenlighted by CI on the PR.
spalladino
pushed a commit
that referenced
this pull request
Sep 25, 2025
Second attempt at #17207 The issue was that the `start` method on p2p client would overwrite all previously registered subprotocol handlers, hence the errors we were seeing on CI: ``` 22:00:04 [22:00:04.697] WARN: p2p:4506:libp2p_service:4506:libp2p_service:4506:reqresp:4506 Unknown stream error while handling the stream, aborting {"protocol":"/aztec/req/auth/1.0.0"} 22:00:04 err: { 22:00:04 "type": "TypeError", 22:00:04 "message": "handler is not a function", 22:00:04 "stack": 22:00:04 TypeError: handler is not a function 22:00:04 at /home/aztec-dev/aztec-packages/yarn-project/p2p/dest/services/reqresp/reqresp.js:452:40 22:00:04 at processTicksAndRejections (node:internal/process/task_queues:105:5) 22:00:04 at duplex.sink (/home/aztec-dev/aztec-packages/yarn-project/node_modules/it-byte-stream/src/index.ts:86:22) 22:00:04 } ``` The test was also failing locally (it had passed before I submitted due to a build issue I missed), and since it was tagged as flake it was greenlighted by CI on the PR.
ludamad
pushed a commit
that referenced
this pull request
Dec 16, 2025
ludamad
pushed a commit
that referenced
this pull request
Dec 16, 2025
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.
Attempts to fix a flake in
preferred_gossip_network.test.ts. The test would fail due to failed auth handshakes. These were caused by a race condition in which the p2p client would start before the validator client, so it wouldn't have the capability to reply to an auth request.This PR changes it so that the validator registers all callbacks on p2p before starting it.