diff --git a/yarn-project/p2p/src/client/p2p_client.test.ts b/yarn-project/p2p/src/client/p2p_client.test.ts index 43b68442c1c..219d2caeded 100644 --- a/yarn-project/p2p/src/client/p2p_client.test.ts +++ b/yarn-project/p2p/src/client/p2p_client.test.ts @@ -340,7 +340,9 @@ describe('In-Memory P2P Client', () => { await advanceToProvenBlock(advanceToProvenBlockNumber); expect(attestationPool.deleteAttestationsOlderThan).toHaveBeenCalledTimes(1); - expect(attestationPool.deleteAttestationsOlderThan).toHaveBeenCalledWith(BigInt(advanceToProvenBlockNumber - keepAttestationsInPoolFor)); + expect(attestationPool.deleteAttestationsOlderThan).toHaveBeenCalledWith( + BigInt(advanceToProvenBlockNumber - keepAttestationsInPoolFor), + ); }); }); }); diff --git a/yarn-project/p2p/src/client/p2p_client.ts b/yarn-project/p2p/src/client/p2p_client.ts index 8e6e86f1761..58575d5e599 100644 --- a/yarn-project/p2p/src/client/p2p_client.ts +++ b/yarn-project/p2p/src/client/p2p_client.ts @@ -227,8 +227,7 @@ export class P2PClient extends WithTracer implements P2P { ) { super(telemetry, 'P2PClient'); - const { blockCheckIntervalMS, blockRequestBatchSize, keepAttestationsInPoolFor } = - getP2PConfigFromEnv(); + const { blockCheckIntervalMS, blockRequestBatchSize, keepAttestationsInPoolFor } = getP2PConfigFromEnv(); this.keepAttestationsInPoolFor = keepAttestationsInPoolFor; @@ -647,7 +646,6 @@ export class P2PClient extends WithTracer implements P2P { this.epochProofQuotePool.deleteQuotesToEpoch(BigInt(provenEpochNumber)); } - await this.startServiceIfSynched(); } diff --git a/yarn-project/p2p/src/config.ts b/yarn-project/p2p/src/config.ts index b16f0f46543..3150722a21a 100644 --- a/yarn-project/p2p/src/config.ts +++ b/yarn-project/p2p/src/config.ts @@ -94,7 +94,6 @@ export interface P2PConfig extends P2PReqRespConfig { /** How many slots to keep attestations for. */ keepAttestationsInPoolFor: number; - /** * The interval of the gossipsub heartbeat to perform maintenance tasks. */ diff --git a/yarn-project/p2p/src/mem_pools/attestation_pool/attestation_pool.ts b/yarn-project/p2p/src/mem_pools/attestation_pool/attestation_pool.ts index 5c57e85b87b..bb7ecb5b704 100644 --- a/yarn-project/p2p/src/mem_pools/attestation_pool/attestation_pool.ts +++ b/yarn-project/p2p/src/mem_pools/attestation_pool/attestation_pool.ts @@ -30,7 +30,6 @@ export interface AttestationPool { */ deleteAttestationsOlderThan(slot: bigint): Promise; - /** * Delete Attestations for slot * diff --git a/yarn-project/p2p/src/mem_pools/attestation_pool/memory_attestation_pool.test.ts b/yarn-project/p2p/src/mem_pools/attestation_pool/memory_attestation_pool.test.ts index 0840f5e7d94..ef80dad21ec 100644 --- a/yarn-project/p2p/src/mem_pools/attestation_pool/memory_attestation_pool.test.ts +++ b/yarn-project/p2p/src/mem_pools/attestation_pool/memory_attestation_pool.test.ts @@ -3,9 +3,9 @@ import { Secp256k1Signer } from '@aztec/foundation/crypto'; import { Fr } from '@aztec/foundation/fields'; import { NoopTelemetryClient } from '@aztec/telemetry-client/noop'; +import { jest } from '@jest/globals'; import { type MockProxy, mock } from 'jest-mock-extended'; -import { jest } from '@jest/globals'; import { type PoolInstrumentation } from '../instrumentation.js'; import { InMemoryAttestationPool } from './memory_attestation_pool.js'; import { mockAttestation } from './mocks.js'; diff --git a/yarn-project/p2p/src/mem_pools/attestation_pool/memory_attestation_pool.ts b/yarn-project/p2p/src/mem_pools/attestation_pool/memory_attestation_pool.ts index fa738340c9a..95f9af415cb 100644 --- a/yarn-project/p2p/src/mem_pools/attestation_pool/memory_attestation_pool.ts +++ b/yarn-project/p2p/src/mem_pools/attestation_pool/memory_attestation_pool.ts @@ -58,7 +58,7 @@ export class InMemoryAttestationPool implements AttestationPool { return total; } - public deleteAttestationsOlderThan(oldestSlot: bigint): Promise { + public async deleteAttestationsOlderThan(oldestSlot: bigint): Promise { const olderThan = []; // Entries are iterated in insertion order, so we can break as soon as we find a slot that is older than the oldestSlot. @@ -74,7 +74,7 @@ export class InMemoryAttestationPool implements AttestationPool { } for (const oldSlot of olderThan) { - this.deleteAttestationsForSlot(oldSlot); + await this.deleteAttestationsForSlot(oldSlot); } return Promise.resolve(); }