Skip to content

Commit 356e036

Browse files
authored
perf(e2e): warp proven-checkpoint waits, tighten in-process polling, and instrument setup spans (#24452)
## Motivation Span-instrumented full CI runs (since #24407 landed) now show where the remaining e2e wall-clock goes: a large uninstrumented setup layer, a cluster of proven-checkpoint/epoch waits that burn real time while nothing is being built, and a 1s in-process poll cadence that adds ~0.5-0.9s of dead sleep to nearly every awaited tx. This PR takes the low-risk warp folds and polling wins that are safe today, and adds span instrumentation to the setup layer so the next round can attack the ~5,000s of currently-invisible beforeAll work. Everything multi-node is validated on CI (hence `ci-no-fail-fast`); the last commit is a deliberate slot-cut experiment kept isolated so it can be reverted on its own. ## Changes - **poll in-process nodes at 250ms instead of 1s** — TestWallet now defaults its `send().wait()` poll interval to 0.25s (in-process nodes reach CHECKPOINTED synchronously under automine and cheaply otherwise), with the spartan/worker sites explicitly restored to the 1s default since they talk to remote JSON-RPC nodes. The e2e-local wait helpers (`wait_helpers.ts`, `waitForProvenChain`, gas-portal block advance, L1->L2 message poll) drop from 1s to 0.25s. Removes ~0.5-0.9s of dead sleep per awaited tx across ~600 tests. Production aztec.js/wallet-sdk defaults are untouched. - **warp past the epoch boundary in waitForProvenCheckpoint** — after the multi-node block-production fixture stops its sequencers, warp the L1 clock one epoch forward (forward-only, skipped if already proven) so the epoch closes and the fake prover can prove+submit without waiting the epoch out in real time. Targets ~716s of suite-summed `wait:proven-checkpoint` across proposed_chain (~430s), deploy_and_call_ordering (~143s), cross_chain_messages (~143s), plus blob_promotion. - **warp epoch waits in multi_proof and upload_failed_proof** — replace `waitUntilEpochStarts` with `warpToEpochStart` in these two 12s-slot proving tests (both passed under warp in the round-1 CI sweep). proof_fails is deliberately left untouched. - **register-only TestContract in automine pxe test** — the test only calls the noinitcheck private `emit_nullifier`, so register the contract instead of deploying it, dropping a deployment tx and its checkpoint cycle. - **compute genesis values on an ephemeral world state** — `generateGenesisValues` used a full fsync-on `NativeWorldStateService.tmp` per e2e container just to read one tree root; switch to the fsync-off `ephemeral` backend. Adds a unit test asserting `tmp` and `ephemeral` produce identical archive roots for a funded-accounts genesis with non-zero timestamp (this path is consensus-critical — CLI deploy paths compute the on-chain genesis root through it). - **instrument setup-layer deploys and mints with spans** — wrap the top-offender setup helpers (fees harness token/FPC deploys + mints + fee-juice bridge, cross-chain token/bridge deploys + mints, shared auth-registry publish, gas-portal bridge) in `testSpan` under the #24407 taxonomy (`deploy:*`, `tx:mint`, `setup:bridge`, `setup:auth-registry`). Zero behavior change (testSpan is a passthrough without `TEST_TIMING_FILE`); this is the data source for round 4's attack on the ~5,000s of uninstrumented beforeAll work. - **cut multi_validator_node slots 36s -> 16s** (experiment, last commit) — lower `aztecSlotDuration` 36->16 and `blockDurationMs` 6000->2000 together (eth stays 8). Small expected saving; kept as the final isolated commit so it can be reverted alone if CI shows committee/attestation trouble on this file. One planned item was dropped: an opt-in warp for `ChainMonitor.waitUntilL2Slot`. All three candidate call sites turned out to cover deliberate real-time building (live-sequencer coordination, inactivity accumulation across an epoch, and the proof-boundary critical window), so the opt-in API would have had no safe callers. ## Verification Locally: full `yarn build`, `yarn format --check`, and `yarn lint` on the touched packages all pass. The new world-state genesis-equivalence unit test passes (`tmp` and `ephemeral` roots identical). The `automine/pxe.test.ts` e2e passes as a smoke test for the register-only change and the 250ms polling. Everything multi-node (the warp folds, the timing cut) is validated on CI. Note the final commit is a deliberate slot-cut experiment that can be reverted in isolation. ## Measured impact Full green CI run of this PR (`9b4cc967`, CI `1782961631439529`) vs the base-proxy full run (`d160265b`, CI `1782938936852228` — the branch point plus one unrelated one-file test change). Identical test populations: 2051 rows, all passed, in both runs. Sums are across parallel processes, not wall-clock (methodology in the Linear "Times tracking" doc). | Bucket | Base | This PR | Δ | |---|---|---|---| | Overall | 7h 26m 03s | 6h 36m 20s | **−49m 43s (−11.1%)** | | Setup (before-hooks) | 2h 14m 31s | 1h 45m 44s | −21.4% | | — of which setup.ts | 42m 53s | 34m 13s | −20.2% | | Body | 5h 05m 14s | 4h 45m 03s | −6.6% | | Teardown | 6m 17s | 5m 33s | −11.6% | By mechanism: - **Proven-checkpoint warp**: `wait:proven-checkpoint` 14m 12s → 3m 32s (**−75%**), worst single wait 215s → 79s. Suite deltas match span deltas ~1:1 — proposed_chain −67%, deploy_and_call_ordering −45%, cross_chain_messages −21%. Hard attribution. - **Epoch warps**: multi_proof −52% (wait:epoch 92s → 40s). upload_failed_proof's warp also worked (35s → 20s) but was masked in the suite total by one-shot proving noise in that run. - **250ms polling + ephemeral genesis**: ~30–35 min spread across the whole suite — 141 of 152 suites improved; every `setup:env:*` span dropped ~16–50% with identical counts (same work, less waiting). - **Slot-cut experiment**: multi_validator_node 103s → 84s (−18.6%) and passed CI — the experiment survives. - **Register-only pxe test**: 18.2s → 10.1s. - **New setup spans**: ~44 min/run of previously untagged setup time is now attributable (`setup:auth-registry` 16m, `setup:bridge` 10m, `tx:mint` 8m, `deploy:token` 7m, `deploy:fpc` 2m) — the target list for round 4. 11 suites regressed (~8 min total vs ~58 min of improvements), all in untagged real-time slashing/proving bodies whose tagged waits are unchanged — consistent with run-to-run variance, not PR effects (per-suite noise floor between same-day runs is median ~11s / p90 ~52s).
1 parent f397aa5 commit 356e036

17 files changed

Lines changed: 183 additions & 58 deletions

File tree

yarn-project/end-to-end/src/automine/pxe.test.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,15 @@ describe('automine/pxe', () => {
1818
let contract: TestContract;
1919

2020
beforeAll(async () => {
21+
const test = await AutomineTestContext.setup({ numberOfAccounts: 1 });
2122
({
2223
teardown,
2324
wallet,
2425
accounts: [defaultAccountAddress],
25-
} = (await AutomineTestContext.setup({ numberOfAccounts: 1 })).context);
26-
({ contract } = await TestContract.deploy(wallet).send({ from: defaultAccountAddress }));
26+
} = test.context);
27+
// The test only calls the noinitcheck private `emit_nullifier`, so register the contract instead of
28+
// deploying it — this avoids a deployment tx and its checkpoint cycle.
29+
contract = await test.registerContract(wallet, TestContract);
2730
});
2831

2932
afterAll(() => teardown());

yarn-project/end-to-end/src/fixtures/setup.ts

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -821,7 +821,12 @@ export async function registerSponsoredFPC(wallet: Wallet): Promise<void> {
821821
await wallet.registerContract(await getSponsoredFPCInstance(), SponsoredFPCContract.artifact);
822822
}
823823

824-
export async function waitForProvenChain(node: AztecNode, targetBlock?: BlockNumber, timeoutSec = 60, intervalSec = 1) {
824+
export async function waitForProvenChain(
825+
node: AztecNode,
826+
targetBlock?: BlockNumber,
827+
timeoutSec = 60,
828+
intervalSec = 0.25,
829+
) {
825830
targetBlock ??= await node.getBlockNumber();
826831

827832
await retryUntil(
@@ -923,14 +928,16 @@ export async function expectMappingDelta<K, V extends number | bigint>(
923928
* surface as generic "Assertion failed:" and tests that match on the real message fail).
924929
*/
925930
export async function ensureAuthRegistryPublished(wallet: Wallet, from: AztecAddress) {
926-
const { instance, contractClass } = await getStandardAuthRegistry();
927-
if (!(await wallet.getContractClassMetadata(contractClass.id)).isContractClassPubliclyRegistered) {
928-
await (await publishContractClass(wallet, AuthRegistryArtifact)).send({ from });
929-
}
930-
if (!(await wallet.getContractMetadata(instance.address)).isContractPublished) {
931-
await publishInstance(wallet, instance).send({ from });
932-
}
933-
await wallet.registerContract(instance, AuthRegistryArtifact);
931+
await testSpan('setup:auth-registry', async () => {
932+
const { instance, contractClass } = await getStandardAuthRegistry();
933+
if (!(await wallet.getContractClassMetadata(contractClass.id)).isContractClassPubliclyRegistered) {
934+
await (await publishContractClass(wallet, AuthRegistryArtifact)).send({ from });
935+
}
936+
if (!(await wallet.getContractMetadata(instance.address)).isContractPublished) {
937+
await publishInstance(wallet, instance).send({ from });
938+
}
939+
await wallet.registerContract(instance, AuthRegistryArtifact);
940+
});
934941
}
935942

936943
/**

yarn-project/end-to-end/src/fixtures/wait_helpers.ts

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export type WaitForBlockOpts = {
2121
compare?: (actual: number, target: number) => boolean;
2222
/** Seconds before the poll rejects; defaults to 60. */
2323
timeout?: number;
24-
/** Seconds between polls; defaults to 1. */
24+
/** Seconds between polls; defaults to 0.25. */
2525
interval?: number;
2626
};
2727

@@ -45,7 +45,7 @@ export function waitForBlockNumber(node: AztecNode, target: number, opts: WaitFo
4545
},
4646
`block ${tag} ${compare} ${target}`,
4747
opts.timeout ?? 60,
48-
opts.interval ?? 1,
48+
opts.interval ?? 0.25,
4949
).then(({ blockNumber }) => blockNumber),
5050
);
5151
}
@@ -118,7 +118,10 @@ export function waitForNodeProvenCheckpoint(
118118
* {@link waitForTx}; resolves with the receipts in input order.
119119
*/
120120
export function waitForTxs(node: AztecNode, txHashes: TxHash[], opts?: WaitOpts): Promise<TxReceipt[]> {
121-
return testSpan('wait:tx-mined', () => Promise.all(txHashes.map(txHash => waitForTx(node, txHash, opts))));
121+
const optsWithInterval = { ...opts, interval: opts?.interval ?? 0.25 };
122+
return testSpan('wait:tx-mined', () =>
123+
Promise.all(txHashes.map(txHash => waitForTx(node, txHash, optsWithInterval))),
124+
);
122125
}
123126

124127
/** Options for {@link waitForBlocksAtSlots}. */
@@ -129,7 +132,7 @@ export type WaitForBlocksAtSlotsOpts = {
129132
limit?: number;
130133
/** Seconds before the poll rejects; defaults to 20. */
131134
timeout?: number;
132-
/** Seconds between polls; defaults to 1. */
135+
/** Seconds between polls; defaults to 0.25. */
133136
interval?: number;
134137
};
135138

@@ -153,7 +156,7 @@ export async function waitForBlocksAtSlots(
153156
},
154157
`blocks at slots ${slots.join(', ')}`,
155158
opts.timeout ?? 20,
156-
opts.interval ?? 1,
159+
opts.interval ?? 0.25,
157160
),
158161
);
159162
}
@@ -174,7 +177,7 @@ export function waitForL2ToL1Witness(
174177
() => node.getL2ToL1MembershipWitness(txHash, message),
175178
`L2-to-L1 membership witness for ${txHash.toString()}`,
176179
opts.timeout ?? 30,
177-
opts.interval ?? 1,
180+
opts.interval ?? 0.25,
178181
),
179182
);
180183
}
@@ -183,7 +186,7 @@ export function waitForL2ToL1Witness(
183186
export type WaitForTxReceiptOpts = {
184187
/** Seconds before the poll rejects; defaults to 30. */
185188
timeout?: number;
186-
/** Seconds between polls; defaults to 1. */
189+
/** Seconds between polls; defaults to 0.25. */
187190
interval?: number;
188191
};
189192

@@ -207,7 +210,7 @@ export function waitForTxReceipt(
207210
},
208211
`tx receipt for ${txHash.toString()}`,
209212
opts.timeout ?? 30,
210-
opts.interval ?? 1,
213+
opts.interval ?? 0.25,
211214
).then(({ receipt }) => receipt),
212215
);
213216
}
@@ -231,7 +234,7 @@ export type WaitForPendingTxCountOpts = {
231234
compare?: PendingTxCountComparator;
232235
/** Seconds before the poll rejects; defaults to 30. */
233236
timeout?: number;
234-
/** Seconds between polls; defaults to 1. */
237+
/** Seconds between polls; defaults to 0.25. */
235238
interval?: number;
236239
};
237240

@@ -256,7 +259,7 @@ export function waitForPendingTxCount(
256259
},
257260
`pending tx count ${compare} ${target}`,
258261
opts.timeout ?? 30,
259-
opts.interval ?? 1,
262+
opts.interval ?? 0.25,
260263
).then(({ count }) => count),
261264
);
262265
}

yarn-project/end-to-end/src/multi-node/block-production/multi_validator_node.parallel.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const COMMITTEE_SIZE = VALIDATOR_COUNT - 2;
2727
// Tests that a single AztecNodeService hosting multiple validator keys correctly signs attestations
2828
// and filters signing to only active committee members. One node, 5 validators staked, committee
2929
// size 3. Uses MultiNodeTestContext on the mock-gossip bus: all 5 validators on a single physical
30-
// node, ethSlot=8s, aztecSlot=36s, epoch=2, proofSubEpochs=NO_REORG_SUBMISSION_EPOCHS. Each it is an isolated CI job
30+
// node, ethSlot=8s, aztecSlot=16s, epoch=2, proofSubEpochs=NO_REORG_SUBMISSION_EPOCHS. Each it is an isolated CI job
3131
// (parallel convention).
3232
describe('multi-node/block-production/multi_validator_node', () => {
3333
jest.setTimeout(15 * 60 * 1000);
@@ -51,10 +51,10 @@ describe('multi-node/block-production/multi_validator_node', () => {
5151
aztecTargetCommitteeSize: COMMITTEE_SIZE,
5252
aztecEpochDuration: 2,
5353
ethereumSlotDuration: 8,
54-
aztecSlotDuration: 36,
54+
aztecSlotDuration: 16,
5555
aztecProofSubmissionEpochs: NO_REORG_SUBMISSION_EPOCHS,
5656
anvilSlotsInAnEpoch: 4,
57-
blockDurationMs: 6000,
57+
blockDurationMs: 2000,
5858
minTxsPerBlock: 0,
5959
inboxLag: 2,
6060
});

yarn-project/end-to-end/src/multi-node/block-production/setup.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import { TxStatus } from '@aztec/stdlib/tx';
2424
import { jest } from '@jest/globals';
2525

2626
import { sendL1ToL2Message } from '../../fixtures/l1_to_l2_messaging.js';
27+
import { testSpan } from '../../fixtures/timing.js';
2728
import type { EndToEndContext } from '../../fixtures/utils.js';
2829
import { waitForBlockNumber, waitForTxs } from '../../fixtures/wait_helpers.js';
2930
import type { TestWallet } from '../../test-wallet/test_wallet.js';
@@ -209,6 +210,17 @@ export async function waitForProvenCheckpoint(
209210
logger.warn(`Stopping validator sequencers before waiting for checkpoint ${targetCheckpoint} to be proven`);
210211
await Promise.all(nodes.map(n => n.getSequencer()?.stop()));
211212

213+
// With the sequencers stopped, no further blocks are produced, so waiting out the rest of the epoch in
214+
// wall-clock is dead time. Warp the L1 clock forward past the epoch boundary so the epoch containing
215+
// targetCheckpoint closes and the fake prover can prove+submit it; the subsequent wait then only covers
216+
// the (real-time) proving+submission. A single next-epoch jump stays inside the proof-submission window
217+
// (proofSubmissionEpochs >= 1), so it never crosses the submission deadline. Skipped if already proven,
218+
// and forward-only since advanceToNextEpoch never rewinds.
219+
const { proven } = await test.context.cheatCodes.rollup.getTips();
220+
if (proven < targetCheckpoint) {
221+
await testSpan('warp:proven-checkpoint-epoch', () => test.context.cheatCodes.rollup.advanceToNextEpoch());
222+
}
223+
212224
const provenTimeout = test.L2_SLOT_DURATION_IN_S * test.epochDuration * 4;
213225
logger.warn(`Waiting for checkpoint ${targetCheckpoint} to be proven (timeout=${provenTimeout}s)`);
214226
await test.waitUntilProvenCheckpointNumber(targetCheckpoint, provenTimeout);

yarn-project/end-to-end/src/shared/cross_chain_test_harness.ts

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import { TokenBridgeContract } from '@aztec/noir-contracts.js/TokenBridge';
2424

2525
import { type Hex, getContract } from 'viem';
2626

27+
import { testSpan } from '../fixtures/timing.js';
2728
import { mintTokensToPrivate } from '../fixtures/token_utils.js';
2829
import { waitForL1ToL2MessageSeen } from './wait_for_l1_to_l2_message.js';
2930

@@ -76,14 +77,18 @@ export async function deployAndInitializeTokenAndBridgeContracts(
7677
});
7778

7879
// deploy l2 token
79-
const { contract: token } = await TokenContract.deploy(wallet, owner, 'TokenName', 'TokenSymbol', 18).send({
80-
from: owner,
81-
});
80+
const { contract: token } = await testSpan('deploy:token', () =>
81+
TokenContract.deploy(wallet, owner, 'TokenName', 'TokenSymbol', 18).send({
82+
from: owner,
83+
}),
84+
);
8285

8386
// deploy l2 token bridge and attach to the portal
84-
const { contract: bridge } = await TokenBridgeContract.deploy(wallet, token.address, tokenPortalAddress).send({
85-
from: owner,
86-
});
87+
const { contract: bridge } = await testSpan('deploy:bridge', () =>
88+
TokenBridgeContract.deploy(wallet, token.address, tokenPortalAddress).send({
89+
from: owner,
90+
}),
91+
);
8792

8893
if ((await token.methods.get_admin().simulate({ from: owner })).result !== owner.toBigInt()) {
8994
throw new Error(`Token admin is not ${owner}`);
@@ -241,11 +246,13 @@ export class CrossChainTestHarness {
241246

242247
async mintTokensPublicOnL2(amount: bigint) {
243248
this.logger.info('Minting tokens on L2 publicly');
244-
await this.l2Token.methods.mint_to_public(this.ownerAddress, amount).send({ from: this.ownerAddress });
249+
await testSpan('tx:mint', () =>
250+
this.l2Token.methods.mint_to_public(this.ownerAddress, amount).send({ from: this.ownerAddress }),
251+
);
245252
}
246253

247254
async mintTokensPrivateOnL2(amount: bigint) {
248-
await mintTokensToPrivate(this.l2Token, this.ownerAddress, this.ownerAddress, amount);
255+
await testSpan('tx:mint', () => mintTokensToPrivate(this.l2Token, this.ownerAddress, this.ownerAddress, amount));
249256
}
250257

251258
async sendL2PublicTransfer(transferAmount: bigint, receiverAddress: AztecAddress) {

yarn-project/end-to-end/src/shared/gas_portal_test_harness.ts

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { FeeJuiceContract } from '@aztec/noir-contracts.js/FeeJuice';
1010
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
1111
import type { AztecNodeAdmin, AztecNodeDebug } from '@aztec/stdlib/interfaces/client';
1212

13+
import { testSpan } from '../fixtures/timing.js';
1314
import { waitForL1ToL2MessageSeen } from './wait_for_l1_to_l2_message.js';
1415

1516
/** Aztec node that may expose the debug mining API in local e2e setups. */
@@ -159,11 +160,13 @@ export class GasBridgingTestHarness implements IGasBridgingTestHarness {
159160
}
160161

161162
async bridgeFromL1ToL2(owner: AztecAddress, claimer: AztecAddress) {
162-
// Prepare the tokens on the L1 side
163-
const claim = await this.prepareTokensOnL1(owner);
163+
await testSpan('setup:bridge', async () => {
164+
// Prepare the tokens on the L1 side
165+
const claim = await this.prepareTokensOnL1(owner);
164166

165-
// Consume L1 -> L2 message and claim tokens privately on L2
166-
await this.consumeMessageOnAztecAndClaimPrivately(owner, claimer, claim);
167+
// Consume L1 -> L2 message and claim tokens privately on L2
168+
await this.consumeMessageOnAztecAndClaimPrivately(owner, claimer, claim);
169+
});
167170
}
168171

169172
private async advanceL2Block() {
@@ -181,7 +184,12 @@ export class GasBridgingTestHarness implements IGasBridgingTestHarness {
181184
}
182185

183186
try {
184-
await retryUntil(async () => (await this.aztecNode.getBlockNumber()) >= initialBlockNumber + 1);
187+
await retryUntil(
188+
async () => (await this.aztecNode.getBlockNumber()) >= initialBlockNumber + 1,
189+
'gas portal block advance',
190+
0,
191+
0.25,
192+
);
185193
} finally {
186194
if (this.aztecNodeAdmin && minTxsPerBlock !== undefined) {
187195
await this.aztecNodeAdmin.setConfig({ minTxsPerBlock });

yarn-project/end-to-end/src/shared/wait_for_l1_to_l2_message.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ export function waitForL1ToL2MessageSeen(
1818
async () => (await node.getL1ToL2MessageCheckpoint(l1ToL2MessageHash)) !== undefined,
1919
`L1 to L2 message ${l1ToL2MessageHash.toString()} seen`,
2020
opts.timeoutSeconds,
21-
1,
21+
0.25,
2222
);
2323
}

yarn-project/end-to-end/src/single-node/fees/fees_test.ts

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import { getContract } from 'viem';
2424

2525
import { L1_DIRECT_WRITE_ACCOUNT_INDEX, MNEMONIC, getPaddedMaxFeesPerGas } from '../../fixtures/fixtures.js';
2626
import { type SetupOptions, ensureAuthRegistryPublished, setup } from '../../fixtures/setup.js';
27+
import { testSpan } from '../../fixtures/timing.js';
2728
import { mintTokensToPrivate } from '../../fixtures/token_utils.js';
2829
import { type BalancesFn, getBalancesFn, setupSponsoredFPC } from '../../fixtures/utils.js';
2930
import {
@@ -158,7 +159,9 @@ export class FeesTest extends SingleNodeTestContext {
158159
async mintAndBridgeFeeJuice(minter: AztecAddress, recipient: AztecAddress) {
159160
const claim = await this.feeJuiceBridgeTestHarness.prepareTokensOnL1(recipient);
160161
const { claimSecret: secret, messageLeafIndex: index } = claim;
161-
await this.feeJuiceContract.methods.claim(recipient, claim.claimAmount, secret, index).send({ from: minter });
162+
await testSpan('setup:bridge', () =>
163+
this.feeJuiceContract.methods.claim(recipient, claim.claimAmount, secret, index).send({ from: minter }),
164+
);
162165
}
163166

164167
/** Alice mints bananaCoin tokens privately to the target address and redeems them. */
@@ -167,7 +170,7 @@ export class FeesTest extends SingleNodeTestContext {
167170
.balance_of_private(address)
168171
.simulate({ from: address });
169172

170-
await mintTokensToPrivate(this.bananaCoin, this.aliceAddress, address, amount);
173+
await testSpan('tx:mint', () => mintTokensToPrivate(this.bananaCoin, this.aliceAddress, address, amount));
171174

172175
const { result: balanceAfter } = await this.bananaCoin.methods
173176
.balance_of_private(address)
@@ -236,9 +239,11 @@ export class FeesTest extends SingleNodeTestContext {
236239
async applyDeployBananaToken() {
237240
this.logger.info('Applying deploy banana token setup');
238241

239-
const { contract: bananaCoin } = await BananaCoin.deploy(this.wallet, this.aliceAddress, 'BC', 'BC', 18n).send({
240-
from: this.aliceAddress,
241-
});
242+
const { contract: bananaCoin } = await testSpan('deploy:token', () =>
243+
BananaCoin.deploy(this.wallet, this.aliceAddress, 'BC', 'BC', 18n).send({
244+
from: this.aliceAddress,
245+
}),
246+
);
242247
this.logger.info(`BananaCoin deployed at ${bananaCoin.address}`);
243248

244249
this.bananaCoin = bananaCoin;
@@ -257,12 +262,15 @@ export class FeesTest extends SingleNodeTestContext {
257262
expect((await this.wallet.getContractMetadata(feeJuiceContract.address)).isContractPublished).toBe(true);
258263

259264
const bananaCoin = this.bananaCoin;
260-
const { contract: bananaFPC } = await FPCContract.deploy(this.wallet, bananaCoin.address, this.fpcAdmin).send({
261-
from: this.aliceAddress,
262-
});
265+
const { contract: bananaFPC } = await testSpan('deploy:fpc', () =>
266+
FPCContract.deploy(this.wallet, bananaCoin.address, this.fpcAdmin).send({
267+
from: this.aliceAddress,
268+
}),
269+
);
263270

264271
this.logger.info(`BananaPay deployed at ${bananaFPC.address}`);
265272

273+
// bridgeFromL1ToL2 carries its own setup:bridge span.
266274
await this.feeJuiceBridgeTestHarness.bridgeFromL1ToL2(bananaFPC.address, this.aliceAddress);
267275

268276
this.bananaFPC = bananaFPC;
@@ -345,9 +353,11 @@ export class FeesTest extends SingleNodeTestContext {
345353
this.logger.info('Applying fund Alice with bananas setup');
346354

347355
await this.mintPrivateBananas(this.ALICE_INITIAL_BANANAS, this.aliceAddress);
348-
await this.bananaCoin.methods
349-
.mint_to_public(this.aliceAddress, this.ALICE_INITIAL_BANANAS)
350-
.send({ from: this.aliceAddress });
356+
await testSpan('tx:mint', () =>
357+
this.bananaCoin.methods.mint_to_public(this.aliceAddress, this.ALICE_INITIAL_BANANAS).send({
358+
from: this.aliceAddress,
359+
}),
360+
);
351361
}
352362

353363
public async applyFundAliceWithPrivateBananas() {

yarn-project/end-to-end/src/single-node/proving/multi_proof.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,12 @@ describe('single-node/proving/multi_proof', () => {
8080
const proverIds = test.proverNodes.map(node => node.getProverNode()!.getProverId());
8181
logger.info(`Prover nodes running with ids ${proverIds.map(id => id.toString()).join(', ')}`);
8282

83-
// Anchor on a freshly-started epoch with the provers already running, then wait for it to fully
84-
// elapse. We can't use epoch 0: under CI load the sequencer can come up after the chain has already
83+
// Anchor on a freshly-started epoch with the provers already running, then warp past it so it fully
84+
// elapses. We can't use epoch 0: under CI load the sequencer can come up after the chain has already
8585
// advanced past epoch 0's slots, leaving it with no blocks, and the snapshot below would then have
8686
// nothing to read. Anchoring on the next epoch guarantees its full slot range is ahead of us.
8787
const epoch = await test.waitUntilNextEpochStarts();
88-
await test.waitUntilEpochStarts(epoch + 1);
88+
await test.warpToEpochStart(epoch + 1);
8989

9090
// Snapshot the anchored epoch's checkpoints. The epoch is now closed on L1 (no more epoch-N
9191
// checkpoints can land once epoch N+1 has begun), but the node's archiver may still be catching up.

0 commit comments

Comments
 (0)