File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed
magicblock-accounts-db/src Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -282,12 +282,15 @@ impl AccountsDb {
282282 ///
283283 /// Returns the state checksum computed at snapshot time.
284284 /// The checksum can be used to verify state consistency across nodes.
285- pub fn take_snapshot ( & self , slot : u64 ) -> AccountsDbResult < u64 > {
285+ ///
286+ ///
287+ /// # Safety
288+ /// the caller must ensure that no state transitions are taking
289+ /// place concurrently when this operation is in progress
290+ pub unsafe fn take_snapshot ( & self , slot : u64 ) -> AccountsDbResult < u64 > {
286291 // Create snapshot directory (potential deep copy)
287292 self . flush ( ) ;
288- // SAFETY:
289- // we have acquired the write lock above
290- let checksum = unsafe { self . checksum ( ) } ;
293+ let checksum = self . checksum ( ) ;
291294 let used_storage = self . storage . active_segment ( ) ;
292295
293296 let manager = self . snapshot_manager . clone ( ) ;
Original file line number Diff line number Diff line change @@ -754,7 +754,7 @@ impl TestEnv {
754754
755755 /// Takes a snapshot and waits for archiving to complete.
756756 fn take_snapshot_and_wait ( & self , slot : u64 ) -> u64 {
757- let checksum = self . adb . take_snapshot ( slot) ;
757+ let checksum = unsafe { self . adb . take_snapshot ( slot) } ;
758758 // Wait for background archiving to complete
759759 let mut retries = 0 ;
760760 while !self . adb . snapshot_exists ( slot) && retries < 200 {
You can’t perform that action at this time.
0 commit comments