Skip to content

Commit a64dc55

Browse files
committed
test(e2e): enable proposer pipelining on add_rollup p2p test
Mirrors the pipelining toggles applied to the rest of the p2p e2e suite (`enableProposerPipelining: true`, `inboxLag: 2`, `minTxsPerBlock: 0`) plus the test-side adjustments needed to keep cross-chain assertions deterministic (`waitForL1ToL2MessageReady` instead of the older `waitForL1ToL2MessageSeen`, longer per-test jest timeout). Intentionally does NOT add the `EpochTestSettler` cheat-code workaround that previously masked the `Root rollup public inputs mismatch`; the helper-based fix earlier in this PR is what unblocks add_rollup under pipelining.
1 parent b813b76 commit a64dc55

1 file changed

Lines changed: 30 additions & 3 deletions

File tree

yarn-project/end-to-end/src/e2e_p2p/add_rollup.test.ts

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { EthAddress } from '@aztec/aztec.js/addresses';
55
import { waitForProven } from '@aztec/aztec.js/contracts';
66
import { generateClaimSecret } from '@aztec/aztec.js/ethereum';
77
import { Fr } from '@aztec/aztec.js/fields';
8+
import { waitForL1ToL2MessageReady } from '@aztec/aztec.js/messaging';
89
import { RollupCheatCodes } from '@aztec/aztec/testing';
910
import { FeeAssetHandlerContract, RegistryContract, RollupContract } from '@aztec/ethereum/contracts';
1011
import { deployRollupForUpgrade } from '@aztec/ethereum/deploy-aztec-l1-contracts';
@@ -13,6 +14,7 @@ import type { L1ContractAddresses } from '@aztec/ethereum/l1-contract-addresses'
1314
import { L1TxUtils, createL1TxUtils } from '@aztec/ethereum/l1-tx-utils';
1415
import type { ExtendedViemWalletClient } from '@aztec/ethereum/types';
1516
import { CheckpointNumber, EpochNumber, SlotNumber } from '@aztec/foundation/branded-types';
17+
import { retryUntil } from '@aztec/foundation/retry';
1618
import { sleep } from '@aztec/foundation/sleep';
1719
import {
1820
GovernanceAbi,
@@ -42,7 +44,6 @@ import { shouldCollectMetrics } from '../fixtures/fixtures.js';
4244
import { sendL1ToL2Message } from '../fixtures/l1_to_l2_messaging.js';
4345
import { ATTESTER_PRIVATE_KEYS_START_INDEX, createNodes, createProverNode } from '../fixtures/setup_p2p_test.js';
4446
import { setupSharedBlobStorage } from '../fixtures/utils.js';
45-
import { waitForL1ToL2MessageSeen } from '../shared/wait_for_l1_to_l2_message.js';
4647
import { TestWallet } from '../test-wallet/test_wallet.js';
4748
import { P2PNetworkTest, SHORTENED_BLOCK_TIME_CONFIG_NO_PRUNES } from './p2p_network.js';
4849

@@ -53,7 +54,7 @@ const BOOT_NODE_UDP_PORT = 4500;
5354
const DATA_DIR = fs.mkdtempSync(path.join(os.tmpdir(), 'add-rollup-old-'));
5455
const DATA_DIR_NEW = fs.mkdtempSync(path.join(os.tmpdir(), 'add-rollup-new-'));
5556

56-
jest.setTimeout(1000 * 60 * 10);
57+
jest.setTimeout(1000 * 60 * 20);
5758

5859
/**
5960
* This test emulates the addition of a new rollup to the registry and tests that cross-chain messages work.
@@ -80,6 +81,14 @@ describe('e2e_p2p_add_rollup', () => {
8081
...SHORTENED_BLOCK_TIME_CONFIG_NO_PRUNES,
8182
listenAddress: '127.0.0.1',
8283
governanceProposerRoundSize: 10,
84+
enableProposerPipelining: true,
85+
// Allow validators to build empty checkpoints under pipelining so the chain keeps
86+
// advancing while we wait for L1->L2 messages to land in the next checkpoint's inbox tree.
87+
minTxsPerBlock: 0,
88+
// Pipelining starts cycle for checkpoint N+1 during slot N, but the inbox tree for
89+
// checkpoint N is only sealed when checkpoint N is published. inboxLag: 2 sources
90+
// L1->L2 messages from checkpoint N-1 (already sealed), avoiding L1ToL2MessagesNotReadyError.
91+
inboxLag: 2,
8392
},
8493
startProverNode: false, // Start one later using p2p.
8594
});
@@ -307,7 +316,10 @@ describe('e2e_p2p_add_rollup', () => {
307316
});
308317

309318
const makeMessageConsumable = async (msgHash: Fr) => {
310-
await waitForL1ToL2MessageSeen(node, msgHash, { timeoutSeconds: 10 });
319+
// Wait until the message is ready to be consumed (the rollup has reached the message's checkpoint).
320+
// Using waitForL1ToL2MessageReady rather than isL1ToL2MessageSynced because with `inboxLag > 0`
321+
// a synced message is not yet present in the latest checkpoint's inbox tree.
322+
await waitForL1ToL2MessageReady(node, msgHash, { timeoutSeconds: 120 });
311323

312324
const { receipt } = await testContract.methods
313325
.create_l2_to_l1_message_arbitrary_recipient_private(contentOutFromRollup, ethRecipient)
@@ -578,6 +590,21 @@ describe('e2e_p2p_add_rollup', () => {
578590
// The new rollup should have no checkpoints
579591
expect(await newRollup.getCheckpointNumber()).toBe(CheckpointNumber(0));
580592

593+
// Wait for the new rollup to publish its first checkpoint AND for `nodes[0]` to have synced
594+
// it locally, before the second bridging step. The bridge wallet uses
595+
// `syncChainTip: 'checkpointed'`, which falls back to the genesis block when no checkpoint
596+
// exists. After warping ~500 epochs forward, txs anchored at genesis would expire before
597+
// being included. We poll the node's local view (not just the L1 rollup contract) so the PXE
598+
// and the assertion observe the same chain state.
599+
t.logger.info(`Waiting for new rollup to publish its first checkpoint`);
600+
await retryUntil(
601+
async () => Number(await nodes[0].getCheckpointNumber('checkpointed')) > 0,
602+
'newRollup first checkpoint synced by node',
603+
300,
604+
2,
605+
);
606+
t.logger.info(`New rollup published its first checkpoint`);
607+
581608
// Bridge into and out of the new rollup to ensure that it works.
582609
await bridging(
583610
nodes[0],

0 commit comments

Comments
 (0)