Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove guardrails for empty snapshots
  • Loading branch information
rodrigo-o committed Oct 8, 2025
commit 3f7d1eae56e35adac6f9c2724fb1a7b1c16e34d4
25 changes: 8 additions & 17 deletions crates/networking/p2p/peer_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1399,11 +1399,6 @@ impl PeerHandler {
let current_account_storages = std::mem::take(&mut current_account_storages);
let snapshot = current_account_storages.into_values().collect::<Vec<_>>();

if snapshot.is_empty() {
// TODO: This happened while testing on pivot changes, we need to understand why
continue;
}

if !std::fs::exists(account_storages_snapshots_dir)
.map_err(|_| PeerHandlerError::NoStorageSnapshotsDir)?
{
Expand Down Expand Up @@ -1777,18 +1772,14 @@ impl PeerHandler {
std::fs::create_dir_all(account_storages_snapshots_dir)
.map_err(|_| PeerHandlerError::CreateStorageSnapshotsDir)?;
}
if snapshot.is_empty() {
// TODO: This happened while testing on pivot changes, we need to understand why
warn!(chunk = *chunk_index, "Skipping empty storage snapshot");
} else {
let path = get_account_storages_snapshot_file(
account_storages_snapshots_dir,
*chunk_index,
);
dump_storages_to_file(&path, snapshot)
.map_err(|_| PeerHandlerError::WriteStorageSnapshotsDir(*chunk_index))?;
*chunk_index += 1;
}

let path = get_account_storages_snapshot_file(
account_storages_snapshots_dir,
*chunk_index,
);
dump_storages_to_file(&path, snapshot)
.map_err(|_| PeerHandlerError::WriteStorageSnapshotsDir(*chunk_index))?;
*chunk_index += 1;
}
disk_joinset
.join_all()
Expand Down