Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Maddiaa0 committed Nov 30, 2024
1 parent b95bcef commit f6ac466
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 9 deletions.
4 changes: 3 additions & 1 deletion yarn-project/p2p/src/client/p2p_client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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),
);
});
});
});
4 changes: 1 addition & 3 deletions yarn-project/p2p/src/client/p2p_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -647,7 +646,6 @@ export class P2PClient extends WithTracer implements P2P {
this.epochProofQuotePool.deleteQuotesToEpoch(BigInt(provenEpochNumber));
}


await this.startServiceIfSynched();
}

Expand Down
1 change: 0 additions & 1 deletion yarn-project/p2p/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export interface AttestationPool {
*/
deleteAttestationsOlderThan(slot: bigint): Promise<void>;


/**
* Delete Attestations for slot
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export class InMemoryAttestationPool implements AttestationPool {
return total;
}

public deleteAttestationsOlderThan(oldestSlot: bigint): Promise<void> {
public async deleteAttestationsOlderThan(oldestSlot: bigint): Promise<void> {
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.
Expand All @@ -74,7 +74,7 @@ export class InMemoryAttestationPool implements AttestationPool {
}

for (const oldSlot of olderThan) {
this.deleteAttestationsForSlot(oldSlot);
await this.deleteAttestationsForSlot(oldSlot);
}
return Promise.resolve();
}
Expand Down

0 comments on commit f6ac466

Please sign in to comment.