From 39535c97c6ee70f53709ab03a5b36b256c024048 Mon Sep 17 00:00:00 2001 From: PhilWindle <60546371+PhilWindle@users.noreply.github.com> Date: Thu, 9 Jan 2025 13:15:11 +0000 Subject: [PATCH] fix: Don't retransmit txs upon node restart (#11123) A long time ago, the node was written such that it would broadcast all txs in it's pool after a restart. This seems unnecessary now and can cause lib-p2p errors when it does so. Removed. --- yarn-project/p2p/src/client/p2p_client.test.ts | 11 ----------- yarn-project/p2p/src/client/p2p_client.ts | 3 --- 2 files changed, 14 deletions(-) diff --git a/yarn-project/p2p/src/client/p2p_client.test.ts b/yarn-project/p2p/src/client/p2p_client.test.ts index 0179aeae383..231fb263052 100644 --- a/yarn-project/p2p/src/client/p2p_client.test.ts +++ b/yarn-project/p2p/src/client/p2p_client.test.ts @@ -104,17 +104,6 @@ describe('In-Memory P2P Client', () => { expect(txPool.addTxs).toHaveBeenCalledTimes(2); }); - it('republishes previously stored txs on start', async () => { - const tx1 = mockTx(); - const tx2 = mockTx(); - txPool.getAllTxs.mockReturnValue([tx1, tx2]); - - await client.start(); - expect(p2pService.propagate).toHaveBeenCalledTimes(2); - expect(p2pService.propagate).toHaveBeenCalledWith(tx1); - expect(p2pService.propagate).toHaveBeenCalledWith(tx2); - }); - it('restores the previous block number it was at', async () => { await client.start(); await client.stop(); diff --git a/yarn-project/p2p/src/client/p2p_client.ts b/yarn-project/p2p/src/client/p2p_client.ts index 4ab855f4847..aeb51ae3fcd 100644 --- a/yarn-project/p2p/src/client/p2p_client.ts +++ b/yarn-project/p2p/src/client/p2p_client.ts @@ -380,9 +380,6 @@ export class P2PClient this.log.debug(`Block ${syncedLatestBlock} (proven ${syncedProvenBlock}) already beyond current block`); } - // publish any txs in TxPool after its doing initial sync - this.syncPromise = this.syncPromise.then(() => this.publishStoredTxs()); - this.blockStream.start(); this.log.verbose(`Started block downloader from block ${syncedLatestBlock}`);