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,12 @@ import type { ContractInstanceWithAddress } from '@aztec/stdlib/contract';
import { Gas, GasSettings } from '@aztec/stdlib/gas';
import { deriveSigningKey } from '@aztec/stdlib/keys';

import { AUTOMINE_E2E_OPTS, MNEMONIC, getPaddedMaxFeesPerGas } from '../../fixtures/fixtures.js';
import {
AUTOMINE_E2E_OPTS,
L1_DIRECT_WRITE_ACCOUNT_INDEX,
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 @@ -244,7 +249,15 @@ export class ClientFlowsBenchmark {
this.feeJuiceBridgeTestHarness = await FeeJuicePortalTestingHarnessFactory.create({
aztecNode: this.context.aztecNodeService,
aztecNodeAdmin: this.context.aztecNodeService,
l1Client: this.context.deployL1ContractsValues.l1Client,
// Bridge from a dedicated L1 account so its direct writes don't race the sequencer publisher's
// txs on the deployer account (see L1_DIRECT_WRITE_ACCOUNT_INDEX).
l1Client: createExtendedL1Client(
this.context.config.l1RpcUrls,
MNEMONIC,
undefined,
undefined,
L1_DIRECT_WRITE_ACCOUNT_INDEX,
),
wallet: this.adminWallet,
logger: this.logger,
});
Expand Down
12 changes: 10 additions & 2 deletions yarn-project/end-to-end/src/e2e_fees/fees_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';

import { getContract } from 'viem';

import { MNEMONIC, getPaddedMaxFeesPerGas } from '../fixtures/fixtures.js';
import { L1_DIRECT_WRITE_ACCOUNT_INDEX, MNEMONIC, getPaddedMaxFeesPerGas } from '../fixtures/fixtures.js';
import {
type EndToEndContext,
type SetupOptions,
Expand Down Expand Up @@ -230,7 +230,15 @@ export class FeesTest {
this.feeJuiceBridgeTestHarness = await FeeJuicePortalTestingHarnessFactory.create({
aztecNode: this.context.aztecNodeService,
aztecNodeAdmin: this.context.aztecNodeService,
l1Client: this.context.deployL1ContractsValues.l1Client,
// Bridge from a dedicated L1 account so its direct writes don't race the sequencer publisher's
// txs on the deployer account (see L1_DIRECT_WRITE_ACCOUNT_INDEX).
l1Client: createExtendedL1Client(
this.context.config.l1RpcUrls,
MNEMONIC,
undefined,
undefined,
L1_DIRECT_WRITE_ACCOUNT_INDEX,
),
wallet: this.wallet,
logger: this.logger,
});
Expand Down
8 changes: 8 additions & 0 deletions yarn-project/end-to-end/src/fixtures/fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,14 @@ export const TEST_PEER_CHECK_INTERVAL_MS = 1000;
export const TEST_MAX_PENDING_TX_POOL_COUNT = 10_000; // Number of max pending TXs ~ 1.56GB

export const MNEMONIC = 'test test test test test test test test test test test junk';

// Mnemonic account index for tests that issue direct L1 writes (e.g. bridging fee juice) while a
// sequencer is running. The deployer/sequencer publisher uses index 0, the prover index 2, and
// validators index 3+. Test-side viem writes and the publisher's l1-tx-utils track nonces
// independently, so sharing an account causes "replacement transaction underpriced" races; index 1
// is otherwise unused, so issuing those writes from it keeps them off the publisher's nonce stream.
export const L1_DIRECT_WRITE_ACCOUNT_INDEX = 1;

export const privateKey = Buffer.from('ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80', 'hex');
export const privateKey2 = Buffer.from('59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d', 'hex');

Expand Down
Loading