Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import type { ContractInstanceWithAddress } from '@aztec/stdlib/contract';
import { GasSettings } from '@aztec/stdlib/gas';
import { deriveSigningKey } from '@aztec/stdlib/keys';

import { MNEMONIC, getPaddedMaxFeesPerGas } from '../../fixtures/fixtures.js';
import { AUTOMINE_E2E_OPTS, MNEMONIC, getPaddedMaxFeesPerGas } from '../../fixtures/fixtures.js';
import { type EndToEndContext, type SetupOptions, deployAccounts, setup, teardown } from '../../fixtures/setup.js';
import { mintTokensToPrivate } from '../../fixtures/token_utils.js';
import { setupSponsoredFPC } from '../../fixtures/utils.js';
Expand Down Expand Up @@ -125,7 +125,7 @@ export class ClientFlowsBenchmark {

constructor(testName?: string, setupOptions: Partial<SetupOptions & DeployAztecL1ContractsArgs> = {}) {
this.logger = createLogger(`bench:client_flows${testName ? `:${testName}` : ''}`);
this.setupOptions = { startProverNode: true, ...setupOptions };
this.setupOptions = { ...AUTOMINE_E2E_OPTS, startProverNode: true, ...setupOptions };
this.config = BENCHMARK_CONFIG === 'key_flows' ? KEY_FLOWS_CONFIG : FULL_FLOWS_CONFIG;
ProxyLogger.create();
this.proxyLogger = ProxyLogger.getInstance();
Expand Down
2 changes: 2 additions & 0 deletions yarn-project/end-to-end/src/bench/node_rpc_perf.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { mkdir, writeFile } from 'fs/promises';
import 'jest-extended';
import * as path from 'path';

import { PIPELINING_SETUP_OPTS } from '../fixtures/fixtures.js';
import { setup } from '../fixtures/utils.js';
import type { TestWallet } from '../test-wallet/test_wallet.js';
import { proveInteraction } from '../test-wallet/utils.js';
Expand Down Expand Up @@ -148,6 +149,7 @@ describe('e2e_node_rpc_perf', () => {
sequencerPollingIntervalMS: 200,
worldStateBlockCheckIntervalMS: 200,
blockCheckIntervalMS: 200,
...PIPELINING_SETUP_OPTS,
minTxsPerBlock: 1,
}));

Expand Down
8 changes: 4 additions & 4 deletions yarn-project/end-to-end/src/bench/tx_stats_bench.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ import {
} from 'zlib';

import { FullProverTest } from '../fixtures/e2e_prover_test.js';
import { PIPELINING_SETUP_OPTS } from '../fixtures/fixtures.js';
import type { TestWallet } from '../test-wallet/test_wallet.js';
import { proveInteraction } from '../test-wallet/utils.js';

// Set a 3 minute timeout.
const TIMEOUT = 300_000;
const REAL_PROOFS = !parseBooleanEnv(process.env.FAKE_PROOFS);
const TIMEOUT = REAL_PROOFS ? 45 * 60 * 1000 : 15 * 60 * 1000;

describe('transaction benchmarks', () => {
const REAL_PROOFS = !parseBooleanEnv(process.env.FAKE_PROOFS);
const COINBASE_ADDRESS = EthAddress.random();
const t = new FullProverTest('full_prover', 1, COINBASE_ADDRESS, REAL_PROOFS);

Expand Down Expand Up @@ -55,7 +55,7 @@ describe('transaction benchmarks', () => {
beforeAll(async () => {
t.logger.warn(`Running suite with ${REAL_PROOFS ? 'real' : 'fake'} proofs`);

await t.setup();
await t.setup({ ...PIPELINING_SETUP_OPTS });

({
provenWallet,
Expand Down
3 changes: 2 additions & 1 deletion yarn-project/end-to-end/src/bench/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import type { BenchmarkDataPoint, BenchmarkMetricsType, BenchmarkTelemetryClient
import { mkdirSync, writeFileSync } from 'fs';
import path from 'path';

import { PIPELINING_SETUP_OPTS } from '../fixtures/fixtures.js';
import { type EndToEndContext, type SetupOptions, setup } from '../fixtures/utils.js';

/**
Expand All @@ -23,7 +24,7 @@ export async function benchmarkSetup(
benchOutput?: string;
},
) {
const context = await setup(1, { ...opts, telemetryConfig: { benchmark: true } });
const context = await setup(1, { ...PIPELINING_SETUP_OPTS, ...opts, telemetryConfig: { benchmark: true } });
const defaultAccountAddress = context.accounts[0];
const { contract } = await BenchmarkingContract.deploy(context.wallet).send({ from: defaultAccountAddress });
context.logger.info(`Deployed benchmarking contract at ${contract.address}`);
Expand Down
24 changes: 17 additions & 7 deletions yarn-project/end-to-end/src/shared/gas_portal_test_harness.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@ import type { ExtendedViemWalletClient } from '@aztec/ethereum/types';
import { retryUntil } from '@aztec/foundation/retry';
import { FeeJuiceContract } from '@aztec/noir-contracts.js/FeeJuice';
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
import type { AztecNodeAdmin, AztecNodeDebug } from '@aztec/stdlib/interfaces/client';

import { waitForL1ToL2MessageSeen } from './wait_for_l1_to_l2_message.js';

/** Aztec node that may expose the debug mining API in local e2e setups. */
type MiningAztecNode = AztecNode & Partial<AztecNodeDebug>;

export interface IGasBridgingTestHarness {
getL1FeeJuiceBalance(address: EthAddress): Promise<bigint>;
prepareTokensOnL1(owner: AztecAddress): Promise<L2AmountClaim>;
Expand All @@ -21,7 +24,7 @@ export interface IGasBridgingTestHarness {
}

export interface FeeJuicePortalTestingHarnessFactoryConfig {
aztecNode: AztecNode;
aztecNode: MiningAztecNode;
aztecNodeAdmin?: AztecNodeAdmin;
l1Client: ExtendedViemWalletClient;
wallet: Wallet;
Expand Down Expand Up @@ -77,7 +80,7 @@ export class GasBridgingTestHarness implements IGasBridgingTestHarness {

constructor(
/** Aztec node */
public aztecNode: AztecNode,
public aztecNode: MiningAztecNode,
/** Aztec node admin interface */
public aztecNodeAdmin: AztecNodeAdmin | undefined,
/** Wallet. */
Expand Down Expand Up @@ -164,6 +167,11 @@ export class GasBridgingTestHarness implements IGasBridgingTestHarness {
}

private async advanceL2Block() {
if (this.aztecNode.mineBlock) {
await this.aztecNode.mineBlock();
return;
}

const initialBlockNumber = await this.aztecNode.getBlockNumber();

let minTxsPerBlock = undefined;
Expand All @@ -172,10 +180,12 @@ export class GasBridgingTestHarness implements IGasBridgingTestHarness {
await this.aztecNodeAdmin.setConfig({ minTxsPerBlock: 0 }); // Set to 0 to ensure we can advance the block
}

await retryUntil(async () => (await this.aztecNode.getBlockNumber()) >= initialBlockNumber + 1);

if (this.aztecNodeAdmin && minTxsPerBlock !== undefined) {
await this.aztecNodeAdmin.setConfig({ minTxsPerBlock });
try {
await retryUntil(async () => (await this.aztecNode.getBlockNumber()) >= initialBlockNumber + 1);
} finally {
if (this.aztecNodeAdmin && minTxsPerBlock !== undefined) {
await this.aztecNodeAdmin.setConfig({ minTxsPerBlock });
}
}
}
}
Loading