@@ -62,7 +62,7 @@ async fn assert_rejected_transaction(
6262}
6363
6464/// Proves snapshot-tail replay verifies fresh checkpoints, rebuilds state, and
65- /// refreshes processed signatures.
65+ /// refreshes processed signatures and preserves epochs at the recovered slot .
6666///
6767/// Dropping superblock 2's archive forces the restore back onto snapshot 1, so
6868/// re-executing B crosses superblock 2's sealed checksum before C is rebuilt
@@ -92,6 +92,8 @@ async fn replay_rebuilds_state_after_counter_lag() {
9292 unsafe { te. checkpoint ( None ) } . unwrap ( ) ;
9393 }
9494 te. advance ( 2 ) . await ;
95+ let expected_clock = te. clock ( te. blocks ( ) . latest ( ) ) ;
96+ assert ! ( expected_clock. epoch > 0 ) ;
9597 let ( dirs, authority) = te. close ( ) . await ;
9698
9799 // Lag only accountsdb's durable checkpoint in the closed store, preserving
@@ -103,6 +105,13 @@ async fn replay_rebuilds_state_after_counter_lag() {
103105 std:: fs:: remove_file ( & s2) . unwrap ( ) ;
104106
105107 let te2 = TestEngine :: with ( dirs, authority) . await ;
108+ assert_eq ! ( te2. clock( te2. blocks( ) . latest( ) ) , expected_clock) ;
109+ let stored: solana_sysvar:: clock:: Clock = te2
110+ . get_account ( solana_sdk_ids:: sysvar:: clock:: ID )
111+ . unwrap ( )
112+ . deserialize_data ( )
113+ . unwrap ( ) ;
114+ assert_eq ! ( stored, expected_clock) ;
106115 assert_eq ! (
107116 load_v42_data( & te2, key) ,
108117 Some ( 21 ) ,
@@ -167,7 +176,8 @@ async fn replay_aborts_on_checksum_mismatch() {
167176 }
168177}
169178
170- /// Proves a clean restart restores processed signatures without re-execution.
179+ /// Proves a clean restart restores processed signatures and the same slot-based
180+ /// epoch without re-execution.
171181///
172182/// Persisted state reopens as-is with the clean-shutdown volatile dump. A failed
173183/// execution still counts on both durable sides without writing accounts. The
@@ -195,9 +205,24 @@ async fn clean_restart_reopens_persisted_and_volatile_state() {
195205 te. advance ( 1 ) . await ;
196206 let direct = store_v42 ( & te, 7 , AccountMode :: Delegated ) ;
197207 let volatile = store_v42 ( & te, 8 , AccountMode :: ReadOnly ) ;
208+ let expected_clock = te. clock ( te. blocks ( ) . latest ( ) ) ;
209+ assert ! ( expected_clock. epoch > 0 ) ;
198210 let ( dirs, authority) = te. close ( ) . await ;
199211
200212 let te2 = TestEngine :: with ( dirs, authority) . await ;
213+ // Leader startup reconstructs the block timestamp as zero; epoch semantics
214+ // depend only on the recovered slot, not on that existing timestamp policy.
215+ let expected_clock = solana_sysvar:: clock:: Clock {
216+ unix_timestamp : 0 ,
217+ ..expected_clock
218+ } ;
219+ assert_eq ! ( te2. clock( te2. blocks( ) . latest( ) ) , expected_clock) ;
220+ let stored: solana_sysvar:: clock:: Clock = te2
221+ . get_account ( solana_sdk_ids:: sysvar:: clock:: ID )
222+ . unwrap ( )
223+ . deserialize_data ( )
224+ . unwrap ( ) ;
225+ assert_eq ! ( stored, expected_clock) ;
201226 assert_eq ! (
202227 load_v42_data( & te2, key) ,
203228 Some ( 21 ) ,
0 commit comments