@@ -587,6 +587,48 @@ contract RollupCommitBatchWithProofTest is L1MessageBaseTest {
587587
588588 assertEq (rollup.lastCommittedBatchIndex (), 1 );
589589 }
590+
591+ /// @notice Test: proveCommittedBatchState proves the state of a committed batch.
592+ function test_proveCommittedBatchState () public {
593+ _mockVerifierCall ();
594+ _mockMessageQueueStalled ();
595+
596+ // Warp time to simulate stall (> rollupDelayPeriod)
597+ hevm.warp (block .timestamp + 7200 );
598+
599+ bytes32 prevStateRoot = bytes32 (uint256 (1 ));
600+ bytes32 postStateRoot = bytes32 (uint256 (2 ));
601+ bytes32 withdrawalRoot = getTreeRoot ();
602+
603+ IRollup.BatchDataInput memory batchDataInput = IRollup.BatchDataInput ({
604+ version: 0 ,
605+ parentBatchHeader: batchHeader0,
606+ lastBlockNumber: 1 ,
607+ numL1Messages: 0 ,
608+ prevStateRoot: prevStateRoot,
609+ postStateRoot: postStateRoot,
610+ withdrawalRoot: withdrawalRoot
611+ });
612+
613+ bytes memory batchHeader1 = _createMatchingBatchHeader (1 , 0 , prevStateRoot, postStateRoot, withdrawalRoot);
614+
615+ hevm.prank (alice);
616+ rollup.commitBatchWithProof (
617+ batchDataInput,
618+ batchSignatureInput,
619+ batchHeader1,
620+ hex "deadbeef " // Non-empty proof required
621+ );
622+ // Verify batch was committed (finalization happens separately via finalizeBatch)
623+ assertEq (rollup.lastCommittedBatchIndex (), 1 );
624+ // finalizeTimestamp is set to block.timestamp, allowing immediate finalization
625+ // but lastFinalizedBatchIndex is not updated until finalizeBatch is called
626+ assertEq (rollup.lastFinalizedBatchIndex (), 0 );
627+
628+ bytes
629+ memory proof = hex"ffea2d2e0a0f124b2bc411325821f76e40978468a0892f57f7de20c99a4fe762dbbdfbc929f5b68b89bdecd40143f36782957e6b818fb761be749d283b16daab432f249b0ddb5537d6b7a8275505a9213eb15db1ddb095bada27a03b6f9c4edb5fd8f7110c7438abff87fed406080f3a103ad45c41fdf89542ff037adfe314a39e5688931da3a1f52f19a3a942cd36dace89340bcff9a18420596f6a06e5d14e5230baba07d1fb0a5bd20beb246875f3ad238dc040c347b10795fff4d6a92ac057c61d672f1d17bbab356c0ade3c419fb1d991f879c2d4fa02b8c4c6ad2d78a8338e9c101e7ea8eb9f1fe61a698598959eed8a33919226a623aa1cd5881d2db0d7f1811921abbb34d035056eea6a70c6079d13de1f67ccf4b2c54398a30cbbf490c2206c111c5e8734d5ef6574d1520f0e68acf482d40f11ac18a8316cb524b3b4a8adb8178e4333eb170bc3a0abfe3d69ced1c5f5b781be739ad2c45b8971455681bcd625348a050a4c5ebc469bf5f8ddb95d541baea4b71e9430452e37c084b2d0ab3c104dfe6dfab22413bf9ea4b2009b5248ec471432ab7464546ffe15033df99dba08077a60ae40633c2a5511faba9e00683497059265ab8114546729007d1e50670dc0a2cecf23cbe58417b2cf51afbf3fd8da63d936d8a92b6e9203c89665a3f40447bc5f08016739567287e5e824c164dc0c7dea8e95eddda27c4966c4d6674516d1cf84241a61b7fadbc432ce6253be085ab86771bf573aa6e506b4c98254d0192a1924297c2e29dfa5b19d99a8ff4ca3975803020f6f46c3200e09d2fb47282f5ced534b0301e5f7501aa56dc77d534c25849d7165efdba546883dda634db60f2d4a9ab608827d63a37020466318f704e30ba4223106a8092f052926714a7a2819a9afb7fb970a9a6d3058cb01ecd4d82e2e20f8996b0995818ae9c3ca815008fd01cdf42f187f723e6965c3c5ee972c9bbef7e7633776cf1af533460565bb256c5c9c6c1c50b63785daabe702d838308659e02c338ba5b47cd0508000eb4426bc76e4760d380bf9d1eb28e1dbcc9cd3a562a6b35ead2d434bce87657ab0ab2cfac2e3c410132c4bef39559dc853bfbf8319447dd365d0a6f52277046b1fdf284f27e626f4f86165eaea9b41bd4bf348325975bf3685a041c4740d300a4222063a6038b5da62c56052c5ddd1d845b51ae2782cec83fcae3966d7f4692d34fe00000000000000000000000000000000000000000000000000000000";
630+ rollup.proveCommittedBatchState (batchHeader1, proof);
631+ }
590632}
591633
592634contract RollupCommitBatchTest is L1MessageBaseTest {
0 commit comments