Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Don't retransmit txs upon node restart #11123

Merged
merged 2 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions yarn-project/p2p/src/client/p2p_client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
3 changes: 0 additions & 3 deletions yarn-project/p2p/src/client/p2p_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -380,9 +380,6 @@ export class P2PClient<T extends P2PClientType = P2PClientType.Full>
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}`);

Expand Down
Loading