Skip to content

fix: Register validator callbacks on p2p client before starting#17207

Merged
spalladino merged 1 commit intonextfrom
palla/register-p2p-handlers-before-starting-it
Sep 22, 2025
Merged

fix: Register validator callbacks on p2p client before starting#17207
spalladino merged 1 commit intonextfrom
palla/register-p2p-handlers-before-starting-it

Conversation

@spalladino
Copy link
Contributor

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.

@spalladino
Copy link
Contributor Author

Here are the relevant logs for a successful run, where the no-discovery validator is initialized:

1:17:22:15 [17:22:15.730] INFO: archiver:4507 Initial archiver sync to L1 block 15 complete. {"l1BlockNumber":15,"syncPoint":{"blocksSynchedTo":15},"latest":{"number":0},"proven":{"number":0},"finalized":{"number":0}}
3:17:22:15 [17:22:15.809] INFO: world-state:database:4507 Creating world state data store at directory /tmp/gossip-DhfFJH-6/world_state with map sizes {"archiveTreeMapSizeKb":134217728,"nullifierTreeMapSizeKb":134217728,"noteHashTreeMapSizeKb":134217728,"messageTreeMapSizeKb":134217728,"publicDataTreeMapSizeKb":134217728} and 2 threads.
4:17:22:15 [17:22:15.845] INFO: world_state:4507 Created world state synchroniser with block history of 64
5:17:22:15 [17:22:15.846] WARN: node:4507 Aztec node is accepting fake proofs
6:17:22:15 [17:22:15.846] INFO: bb-prover:queued_ivc_verifier:4507 Starting QueuedIVCVerifier with 8 concurrent verifiers
7:17:22:15 [17:22:15.853] INFO: p2p:lmdb-v2:4507 Creating p2p data store at directory /tmp/gossip-DhfFJH-6/p2p with map size 134217728 KB (LMDB v2)
10:17:22:16 [17:22:16.016] INFO: p2p:lmdb-v2:4507 Starting data store with maxReaders 16
11:17:22:16 [17:22:16.050] INFO: p2p-archive:lmdb-v2:4507 Creating p2p-archive data store at directory /tmp/gossip-DhfFJH-6/p2p-archive with map size 134217728 KB (LMDB v2)
16:17:22:16 [17:22:16.387] INFO: p2p-archive:lmdb-v2:4507 Starting data store with maxReaders 16
21:17:22:16 [17:22:16.540] INFO: p2p-peer:lmdb-v2:4507 Creating p2p-peers data store at directory /tmp/gossip-DhfFJH-6/p2p-peers with map size 134217728 KB (LMDB v2)
31:17:22:16 [17:22:16.883] INFO: p2p-peer:lmdb-v2:4507 Starting data store with maxReaders 16
32:17:22:16 [17:22:16.900] INFO: p2p:tx_pool:4507 Setting maximum tx mempool size {"maxTxPoolSize":2147483648}
33:17:22:16 [17:22:16.900] VERBOSE: p2p:4507:libp2p_service:4507 P2P is enabled. Using LibP2P service.
34:17:22:16 [17:22:16.906] VERBOSE: p2p:4507:libp2p_service:4507 Creating new peer ID private key and persisting it to /tmp/gossip-DhfFJH-6/p2p-private-key
35:17:22:16 [17:22:16.927] INFO: p2p:4507:libp2p_service:4507:libp2p_service:4507 Started libp2p service with protocol version 00-31337-766523f0-1681077350-25eb6a2c-0b21c341
36:17:22:16 [17:22:16.938] VERBOSE: world-state:block_stream:4507 Starting L2 block stream {"proven":false,"pollIntervalMS":100}
37:17:22:16 [17:22:16.939] INFO: world_state:4507 Started world state synchronizer from block 1
38:17:22:16 [17:22:16.945] VERBOSE: world-state:block_stream:4507 Starting sync from block number 0
47:17:22:18 [17:22:18.304] INFO: p2p:4507:libp2p_service:4507:libp2p_service:4507 Started P2P service {"listen":"127.0.0.1","port":4507,"announce":"/ip4/127.0.0.1/tcp/4507","peerId":"16Uiu2HAmKvfheYyGLpvkXbaaxXMAbELzt38rNNP7yj9vF1rV2GWh"}
48:17:22:18 [17:22:18.304] INFO: p2p:4507 Starting p2p client from block 0 with empty mempools
49:17:22:18 [17:22:18.305] VERBOSE: p2p:4507:l2-block-stream:4507 Starting L2 block stream {"batchSize":20,"pollIntervalMS":1000,"startingBlock":0}
50:17:22:18 [17:22:18.305] VERBOSE: epoch-prune-watcher:4507 EpochPruneWatcher initialized with penalties: valid epoch pruned=10000000000000000000 data withholding=10000000000000000000
51:17:22:18 [17:22:18.306] INFO: attestations-block-watcher:4507 AttestationsBlockWatcher initialized
52:17:22:18 [17:22:18.307] VERBOSE: validator:4507 Initialized validator with addresses: 0xa0ee7a142d267c1f36714e4a8f75612f20a79720
53:17:22:18 [17:22:18.307] VERBOSE: node:4507 All Aztec Node subsystems synced
54:17:22:18 [17:22:18.321] INFO: slasher:lmdb:4507 Creating slasher data store at directory /tmp/gossip-DhfFJH-6/slasher with map size 134217728 KB (LMDB v2)
55:17:22:18 [17:22:18.333] VERBOSE: p2p:4507:l2-block-stream:4507 Starting sync from block number 0
56:17:22:18 [17:22:18.335] INFO: slasher:lmdb:4507 Starting data store with maxReaders 16
57:17:22:18 [17:22:18.396] INFO: slasher:offenses-collector:4507 Started SlashOffensesCollector
58:17:22:18 [17:22:18.398] INFO: slasher:4507 Started tally slasher client
59:17:22:18 [17:22:18.407] INFO: PublisherManager:4507 PublisherManager initialized with 1 publishers.
60:17:22:18 [17:22:18.423] INFO: sequencer:4507 Sequencer config set {"transactionPollingIntervalMS":500,"maxTxsPerBlock":32,"minTxsPerBlock":1,"maxL2BlockGas":10000000000,"publishTxsWithProposals":false,"maxDABlockGas":10000000000,"coinbase":"0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266","acvmWorkingDirectory":"/tmp/ab2d86c9/acvm","acvmBinaryPath":"../../noir/noir-repo/target/release/acvm","maxBlockSizeInBytes":1048576,"governanceProposerPayload":"0x0000000000000000000000000000000000000000","maxL1TxInclusionTimeIntoSlot":3,"enforceTimeTable":false,"attestationPropagationTime":2,"skipCollectingAttestations":false,"secondsBeforeInvalidatingBlockAsCommitteeMember":144,"secondsBeforeInvalidatingBlockAsNonCommitteeMember":432}
61:17:22:18 [17:22:18.424] VERBOSE: sequencer:4507 Sequencer timetable initialized (not enforced) {"ethereumSlotDuration":4,"aztecSlotDuration":12,"maxL1TxInclusionTimeIntoSlot":3,"l1PublishingTime":1,"minExecutionTime":1,"blockPrepareTime":0.5,"attestationPropagationTime":0,"blockValidationTime":0.5,"initializeDeadline":8,"enforce":false,"allWorkToDo":4}
62:17:22:18 [17:22:18.436] INFO: validator:4507 Started validator with addresses in current validator committee: 0xa0ee7a142d267c1f36714e4a8f75612f20a79720
63:17:22:18 [17:22:18.437] INFO: validator:4507 Validators 0xa0ee7a142d267c1f36714e4a8f75612f20a79720 are on the validator committee for epoch 3
64:17:22:18 [17:22:18.445] INFO: sequencer:4507 Started sequencer
65:17:22:18 [17:22:18.446] VERBOSE: node:4507 Sequencer started
66:17:22:18 [17:22:18.446] INFO: node:4507 Aztec Node version: 3.0.0
67:17:22:18 [17:22:18.446] INFO: node:4507 Aztec Node started on chain 0x7a69 {"registryAddress":"0x00b1ca2bb46b04584afcc15f40ce31b454cc1d52","governanceAddress":"0xce6a1f08e1d96a753f33e187be3eaae3526fc228","governanceProposerAddress":"0x7065c4b5f4b0edea68edc8265745856acc806a2e","rollupAddress":"0x766523f07cf69246fa6d86ed830fea097f77df45","inboxAddress":"0x77b9ae53058c7166d6712b78984daa216c2dd144","outboxAddress":"0x26429adfc00fb93c99e85879a030f39c139a5ec3","feeJuicePortalAddress":"0x396b3428cf29a2e4ac10c5ed0e016e9b8bbfb7fb","feeJuiceAddress":"0x106e45bc62c5d8686ad5f02d8215469e4c2de398","stakingAssetAddress":"0x64c4d5783bcb64b2e073a17f09d1b0b86806c240","rewardDistributorAddress":"0x5a36844c2b9a5f85881badfcc69a83b0093c69dc","gseAddress":"0x963dcb4508655cf77fdf9e7a7bbcacfcc7ef6271","coinIssuerAddress":"0x61085f6279416f1770e31263f0d4e5391c9f84f5","slashFactoryAddress":"0x3346dc39edf4b309b2dbb833decf0226e1e952a5","feeAssetHandlerAddress":"0xf7a7ef96041cdc7e3a8c005caa51c877d6af512e","stakingAssetHandlerAddress":"0x60e940bee12e0e4143e4fb2c7c27261a7ab03894","zkPassportVerifierAddress":"0xbec82dec0747c9170d760d5aba9cc44929b17c05"}
74:17:22:18 [17:22:18.954] VERBOSE: p2p:4507:libp2p_service:4507:libp2p_service:4507:peer_manager:4507 Connected to peer 16Uiu2HAmPXE3h7sEsJwZSt7qWshkSyrEAXEcGr6ej4M2VhCKNUhq
75:17:22:18 [17:22:18.965] VERBOSE: p2p:4507:libp2p_service:4507:libp2p_service:4507:peer_manager:4507 Connected to peer 16Uiu2HAmHQ5pHaTkbj4fvXaBEnEVSULDMiKddP2x26tcpUfs5img
17:22:18 [17:22:18.914] VERBOSE: p2p:4501:libp2p_service:4501:libp2p_service:4501:peer_manager:4501 Connected to peer 16Uiu2HAmKvfheYyGLpvkXbaaxXMAbELzt38rNNP7yj9vF1rV2GWh
17:22:18 [17:22:18.933] VERBOSE: p2p:4502:libp2p_service:4502:libp2p_service:4502:peer_manager:4502 Connected to peer 16Uiu2HAmKvfheYyGLpvkXbaaxXMAbELzt38rNNP7yj9vF1rV2GWh
17:22:18 [17:22:18.954] VERBOSE: p2p:4507:libp2p_service:4507:libp2p_service:4507:peer_manager:4507 Connected to peer 16Uiu2HAmPXE3h7sEsJwZSt7qWshkSyrEAXEcGr6ej4M2VhCKNUhq
17:22:18 [17:22:18.965] VERBOSE: p2p:4507:libp2p_service:4507:libp2p_service:4507:peer_manager:4507 Connected to peer 16Uiu2HAmHQ5pHaTkbj4fvXaBEnEVSULDMiKddP2x26tcpUfs5img
17:22:19 [17:22:19.063] INFO: p2p:4501:libp2p_service:4501:libp2p_service:4501:peer_manager:4501 Successfully completed auth handshake with peer 16Uiu2HAmKvfheYyGLpvkXbaaxXMAbELzt38rNNP7yj9vF1rV2GWh, validator address 0xa0ee7a142d267c1f36714e4a8f75612f20a79720 {"peerId":"16Uiu2HAmKvfheYyGLpvkXbaaxXMAbELzt38rNNP7yj9vF1rV2GWh","status":"SUCCESS","data":"0x0000002e30302d33313333372d37363635323366302d313638313037373335302d32356562366132632d30623231633334310000000000000042307830373362396536383663663562623730633463363431663730366137373362616666663938633437343962643435383164616666336563383766316561383931000000003793c3e2383cfc48978cde542a3c7d9c6617c271def7d7368583de16dfa8eb0b6fbb7fac656fafd8a5a84df2c191d972b6b50ab37f03d40cba45f1925d3589ed0000001c"}
17:22:19 [17:22:19.114] INFO: p2p:4502:libp2p_service:4502:libp2p_service:4502:peer_manager:4502 Successfully completed auth handshake with peer 16Uiu2HAmKvfheYyGLpvkXbaaxXMAbELzt38rNNP7yj9vF1rV2GWh, validator address 0xa0ee7a142d267c1f36714e4a8f75612f20a79720 {"peerId":"16Uiu2HAmKvfheYyGLpvkXbaaxXMAbELzt38rNNP7yj9vF1rV2GWh","status":"SUCCESS","data":"0x0000002e30302d33313333372d37363635323366302d313638313037373335302d32356562366132632d30623231633334310000000000000042307830373362396536383663663562623730633463363431663730366137373362616666663938633437343962643435383164616666336563383766316561383931000000005cd703cfa184952aece5cee934db471259502f9e4c2bd48ed8b20bfa2d800a3f56c903b19c9639794ea637a3b1f96e695fdc6adc03e1b093e4c46b2ab42b2a2e0000001b"}

@spalladino
Copy link
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).

1:17:22:18 [17:22:18.247] INFO: archiver:4507 Initial archiver sync to L1 block 15 complete. {"l1BlockNumber":15,"syncPoint":{"blocksSynchedTo":15},"latest":{"number":0},"proven":{"number":0},"finalized":{"number":0}}
2:17:22:18 [17:22:18.258] INFO: world-state:database:4507 Creating world state data store at directory /tmp/gossip-fvjqMA-6/world_state with map sizes {"archiveTreeMapSizeKb":134217728,"nullifierTreeMapSizeKb":134217728,"noteHashTreeMapSizeKb":134217728,"messageTreeMapSizeKb":134217728,"publicDataTreeMapSizeKb":134217728} and 2 threads.
3:17:22:18 [17:22:18.297] INFO: world_state:4507 Created world state synchroniser with block history of 64
4:17:22:18 [17:22:18.298] WARN: node:4507 Aztec node is accepting fake proofs
5:17:22:18 [17:22:18.298] INFO: bb-prover:queued_ivc_verifier:4507 Starting QueuedIVCVerifier with 8 concurrent verifiers
6:17:22:18 [17:22:18.302] INFO: p2p:lmdb-v2:4507 Creating p2p data store at directory /tmp/gossip-fvjqMA-6/p2p with map size 134217728 KB (LMDB v2)
9:17:22:18 [17:22:18.769] INFO: p2p:lmdb-v2:4507 Starting data store with maxReaders 16
16:17:22:18 [17:22:18.960] INFO: p2p-archive:lmdb-v2:4507 Creating p2p-archive data store at directory /tmp/gossip-fvjqMA-6/p2p-archive with map size 134217728 KB (LMDB v2)
18:17:22:19 [17:22:19.069] INFO: p2p-archive:lmdb-v2:4507 Starting data store with maxReaders 16
20:17:22:19 [17:22:19.086] INFO: p2p-peer:lmdb-v2:4507 Creating p2p-peers data store at directory /tmp/gossip-fvjqMA-6/p2p-peers with map size 134217728 KB (LMDB v2)
21:17:22:19 [17:22:19.120] INFO: p2p-peer:lmdb-v2:4507 Starting data store with maxReaders 16
23:17:22:19 [17:22:19.132] INFO: p2p:tx_pool:4507 Setting maximum tx mempool size {"maxTxPoolSize":2147483648}
24:17:22:19 [17:22:19.133] VERBOSE: p2p:4507:libp2p_service:4507 P2P is enabled. Using LibP2P service.
25:17:22:19 [17:22:19.150] VERBOSE: p2p:4507:libp2p_service:4507 Creating new peer ID private key and persisting it to /tmp/gossip-fvjqMA-6/p2p-private-key
27:17:22:19 [17:22:19.304] INFO: p2p:4507:libp2p_service:4507:libp2p_service:4507 Started libp2p service with protocol version 00-31337-fda1699f-845231156-25eb6a2c-0b21c341
28:17:22:19 [17:22:19.320] VERBOSE: world-state:block_stream:4507 Starting L2 block stream {"proven":false,"pollIntervalMS":100}
29:17:22:19 [17:22:19.321] INFO: world_state:4507 Started world state synchronizer from block 1
30:17:22:19 [17:22:19.335] VERBOSE: world-state:block_stream:4507 Starting sync from block number 0
47:17:22:21 [17:22:21.914] INFO: p2p:4507:libp2p_service:4507:libp2p_service:4507 Started P2P service {"listen":"127.0.0.1","port":4507,"announce":"/ip4/127.0.0.1/tcp/4507","peerId":"16Uiu2HAkwY6GqGZTM96Wj9TnaG3Mh4SBSKBPcr2WWPsyZ3mJgTg7"}
48:17:22:21 [17:22:21.918] INFO: p2p:4507 Starting p2p client from block 0 with empty mempools
49:17:22:21 [17:22:21.918] VERBOSE: p2p:4507:l2-block-stream:4507 Starting L2 block stream {"batchSize":20,"pollIntervalMS":1000,"startingBlock":0}
50:17:22:21 [17:22:21.919] VERBOSE: epoch-prune-watcher:4507 EpochPruneWatcher initialized with penalties: valid epoch pruned=10000000000000000000 data withholding=10000000000000000000
51:17:22:21 [17:22:21.920] INFO: attestations-block-watcher:4507 AttestationsBlockWatcher initialized
52:17:22:21 [17:22:21.922] VERBOSE: validator:4507 Initialized validator with addresses: 0xa0ee7a142d267c1f36714e4a8f75612f20a79720
53:17:22:21 [17:22:21.922] VERBOSE: node:4507 All Aztec Node subsystems synced
54:17:22:21 [17:22:21.980] INFO: slasher:lmdb:4507 Creating slasher data store at directory /tmp/gossip-fvjqMA-6/slasher with map size 134217728 KB (LMDB v2)
55:17:22:22 [17:22:22.164] VERBOSE: p2p:4507:l2-block-stream:4507 Starting sync from block number 0
17:22:22 [17:22:22.192] VERBOSE: p2p:4501:libp2p_service:4501:libp2p_service:4501:peer_manager:4501 Connected to peer 16Uiu2HAkwY6GqGZTM96Wj9TnaG3Mh4SBSKBPcr2WWPsyZ3mJgTg7
17:22:22 [17:22:22.204] VERBOSE: p2p:4502:libp2p_service:4502:libp2p_service:4502:peer_manager:4502 Connected to peer 16Uiu2HAkwY6GqGZTM96Wj9TnaG3Mh4SBSKBPcr2WWPsyZ3mJgTg7
17:22:22 [17:22:22.250] VERBOSE: p2p:4507:libp2p_service:4507:libp2p_service:4507:peer_manager:4507 Connected to peer 16Uiu2HAm7kgpEDRxbtUzZitKUPWFHfg1Kvq1N8FXUF6Qd8VnDywQ
17:22:22 [17:22:22.260] VERBOSE: p2p:4507:libp2p_service:4507:libp2p_service:4507:peer_manager:4507 Connected to peer 16Uiu2HAm1rRG4ySyVaAZHuoFubxpbq7q4VhWhkNP6okRUK7T7a2A
17:22:22 [17:22:22.296] VERBOSE: p2p:peer-scoring:4501 Penalizing peer 16Uiu2HAkwY6GqGZTM96Wj9TnaG3Mh4SBSKBPcr2WWPsyZ3mJgTg7 with HighToleranceError (new score is -2)
17:22:22 [17:22:22.305] VERBOSE: p2p:peer-scoring:4502 Penalizing peer 16Uiu2HAkwY6GqGZTM96Wj9TnaG3Mh4SBSKBPcr2WWPsyZ3mJgTg7 with HighToleranceError (new score is -2)
62:17:22:22 [17:22:22.367] INFO: slasher:lmdb:4507 Starting data store with maxReaders 16
63:17:22:22 [17:22:22.437] INFO: slasher:offenses-collector:4507 Started SlashOffensesCollector
64:17:22:22 [17:22:22.439] INFO: slasher:4507 Started tally slasher client
65:17:22:22 [17:22:22.442] INFO: PublisherManager:4507 PublisherManager initialized with 1 publishers.
66:17:22:22 [17:22:22.480] INFO: sequencer:4507 Sequencer config set {"transactionPollingIntervalMS":500,"maxTxsPerBlock":32,"minTxsPerBlock":1,"maxL2BlockGas":10000000000,"publishTxsWithProposals":false,"maxDABlockGas":10000000000,"coinbase":"0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266","acvmWorkingDirectory":"/tmp/8a89b475/acvm","acvmBinaryPath":"../../noir/noir-repo/target/release/acvm","maxBlockSizeInBytes":1048576,"governanceProposerPayload":"0x0000000000000000000000000000000000000000","maxL1TxInclusionTimeIntoSlot":3,"enforceTimeTable":false,"attestationPropagationTime":2,"skipCollectingAttestations":false,"secondsBeforeInvalidatingBlockAsCommitteeMember":144,"secondsBeforeInvalidatingBlockAsNonCommitteeMember":432}
67:17:22:22 [17:22:22.481] VERBOSE: sequencer:4507 Sequencer timetable initialized (not enforced) {"ethereumSlotDuration":4,"aztecSlotDuration":12,"maxL1TxInclusionTimeIntoSlot":3,"l1PublishingTime":1,"minExecutionTime":1,"blockPrepareTime":0.5,"attestationPropagationTime":0,"blockValidationTime":0.5,"initializeDeadline":8,"enforce":false,"allWorkToDo":4}
68:17:22:22 [17:22:22.570] INFO: validator:4507 Started validator with addresses in current validator committee: 0xa0ee7a142d267c1f36714e4a8f75612f20a79720
69:17:22:22 [17:22:22.571] INFO: validator:4507 Validators 0xa0ee7a142d267c1f36714e4a8f75612f20a79720 are on the validator committee for epoch 3
70:17:22:22 [17:22:22.889] INFO: sequencer:4507 Started sequencer
71:17:22:22 [17:22:22.890] VERBOSE: node:4507 Sequencer started
72:17:22:22 [17:22:22.891] INFO: node:4507 Aztec Node version: 3.0.0
73:17:22:22 [17:22:22.891] INFO: node:4507 Aztec Node started on chain 0x7a69 {"registryAddress":"0x00b1ca2bb46b04584afcc15f40ce31b454cc1d52","governanceAddress":"0xce6a1f08e1d96a753f33e187be3eaae3526fc228","governanceProposerAddress":"0x7065c4b5f4b0edea68edc8265745856acc806a2e","rollupAddress":"0xfda1699f9e37fdbbd319316f279e57d959f2c805","inboxAddress":"0x39fce7912c2f7b0daebc5f963ca7f543e562eed4","outboxAddress":"0x4ec8298a8e61b51525d41421511230070cc3ea0c","feeJuicePortalAddress":"0x0002bfad876873a6fed06e8cfa093289b744d174","feeJuiceAddress":"0x106e45bc62c5d8686ad5f02d8215469e4c2de398","stakingAssetAddress":"0x64c4d5783bcb64b2e073a17f09d1b0b86806c240","rewardDistributorAddress":"0x5a36844c2b9a5f85881badfcc69a83b0093c69dc","gseAddress":"0x963dcb4508655cf77fdf9e7a7bbcacfcc7ef6271","coinIssuerAddress":"0x61085f6279416f1770e31263f0d4e5391c9f84f5","slashFactoryAddress":"0x60060132aa7e37ea9ecf708873e60cb797d2a939","feeAssetHandlerAddress":"0xf7a7ef96041cdc7e3a8c005caa51c877d6af512e","stakingAssetHandlerAddress":"0x60e940bee12e0e4143e4fb2c7c27261a7ab03894","zkPassportVerifierAddress":"0xbec82dec0747c9170d760d5aba9cc44929b17c05"}

@spalladino spalladino added this pull request to the merge queue Sep 22, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 22, 2025
@spalladino spalladino force-pushed the palla/register-p2p-handlers-before-starting-it branch from 2598869 to fb5f071 Compare September 22, 2025 20:53
@spalladino spalladino removed the request for review from charlielye September 22, 2025 21:02
@spalladino spalladino added this pull request to the merge queue Sep 22, 2025
Merged via the queue into next with commit ebd08ad Sep 22, 2025
14 checks passed
@spalladino spalladino deleted the palla/register-p2p-handlers-before-starting-it branch September 22, 2025 21:56
spalladino added a commit that referenced this pull request Sep 22, 2025
Revert "fix: Register validator callbacks on p2p client before starting (#17207)"

This reverts commit ebd08ad, reversing
changes made to 2255c32.
spalladino added a commit that referenced this pull request Sep 22, 2025
github-merge-queue bot pushed a commit that referenced this pull request Sep 23, 2025
Revert "fix: Register validator callbacks on p2p client before starting
(#17207)"

This reverts commit ebd08ad, reversing
changes made to 2255c32.

This is causing an avalanche of flakes.
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.
mralj pushed a commit that referenced this pull request Oct 13, 2025
ludamad pushed a commit that referenced this pull request Dec 16, 2025
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.

2 participants