Skip to content

Commit daf2a18

Browse files
committed
test: node follow prune and extend chain
1 parent 94a9025 commit daf2a18

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

yarn-project/end-to-end/src/e2e_synching.test.ts

+12-9
Original file line numberDiff line numberDiff line change
@@ -609,9 +609,9 @@ describe('e2e_synching', () => {
609609
);
610610
});
611611

612-
it.skip('node following prunes and can extend chain', async () => {
613-
// @todo This test is to be activated when we can unwind the world state
614-
// It will currently stall forever as the state will never match.
612+
it('node following prunes and can extend chain (fresh pxe)', async () => {
613+
// @todo this should be rewritten slightly when the PXE can handle re-orgs
614+
// such that it does not need to be run "fresh" Issue #9327
615615
if (AZTEC_GENERATE_TEST_DATA) {
616616
return;
617617
}
@@ -628,6 +628,11 @@ describe('e2e_synching', () => {
628628
const pendingBlockNumber = await rollup.read.getPendingBlockNumber();
629629
await rollup.write.setAssumeProvenThroughBlockNumber([pendingBlockNumber - BigInt(variant.blockCount) / 2n]);
630630

631+
const aztecNode = await AztecNodeService.createAndSync(opts.config!, new NoopTelemetryClient());
632+
const sequencer = aztecNode.getSequencer();
633+
634+
const blockBeforePrune = await aztecNode.getBlockNumber();
635+
631636
const timeliness = (await rollup.read.EPOCH_DURATION()) * 2n;
632637
const [, , slot] = await rollup.read.blocks([(await rollup.read.getProvenBlockNumber()) + 1n]);
633638
const timeJumpTo = await rollup.read.getTimestampForSlot([slot + timeliness]);
@@ -641,16 +646,14 @@ describe('e2e_synching', () => {
641646
);
642647
await watcher.start();
643648

644-
const aztecNode = await AztecNodeService.createAndSync(opts.config!, new NoopTelemetryClient());
645-
const sequencer = aztecNode.getSequencer();
646-
647-
const blockBeforePrune = await aztecNode.getBlockNumber();
648-
649-
await rollup.write.prune();
649+
await opts.deployL1ContractsValues!.publicClient.waitForTransactionReceipt({
650+
hash: await rollup.write.prune(),
651+
});
650652

651653
await sleep(5000);
652654
expect(await aztecNode.getBlockNumber()).toBeLessThan(blockBeforePrune);
653655

656+
// We need to start the pxe after the re-org for now, because it won't handle it otherwise
654657
const { pxe } = await setupPXEService(aztecNode!);
655658
variant.setPXE(pxe);
656659

0 commit comments

Comments
 (0)