File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -254,8 +254,11 @@ impl StorageManager {
254254 continue ; // Invalid key format (too short)
255255 }
256256
257- // Check if sender portion matches exactly
258- // This ensures we don't match longer senders that share a prefix
257+ // Check if sender portion matches exactly.
258+ // This break is intentional: RocksDB's prefix_iterator may return keys for longer
259+ // senders that share the same initial bytes (e.g., when searching for "abc", it
260+ // might also return keys starting with "abcd"). We break as soon as the prefix
261+ // no longer matches exactly to avoid returning transactions from other senders.
259262 if & key[ 0 ..sender. len ( ) ] != sender {
260263 break ; // No longer matching our sender prefix
261264 }
Original file line number Diff line number Diff line change @@ -228,7 +228,7 @@ fn test_snapshot_based_recovery() {
228228 assert ! ( header. is_none( ) , "Block {} should have been pruned" , height) ;
229229 }
230230
231- // Recent blocks should still exist
231+ // Recent blocks should still exist (blocks 799-999 since we stored 0-999)
232232 for height in 799 ..1000 {
233233 let header = storage. get_header_by_height ( height) . unwrap ( ) ;
234234 assert ! ( header. is_some( ) , "Block {} should not have been pruned" , height) ;
Original file line number Diff line number Diff line change @@ -230,10 +230,12 @@ let stats = storage.prune_old_blocks_production(
230230)? ;
231231
232232println! (" Deleted {} blocks" , stats . blocks_deleted);
233- println! (" Deleted {} transactions" , stats . transactions_deleted);
233+ println! (" Deleted ~ {} transactions (approximate) " , stats . transactions_deleted);
234234println! (" Archived: {}" , stats . archived);
235235```
236236
237+ > ** Note:** Transaction deletion count is currently approximate as the pruning implementation doesn't fully track individual transaction deletions.
238+
237239## Integration with StateManager
238240
239241The ` StateManager ` can use persistent storage:
You can’t perform that action at this time.
0 commit comments