Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(client): extra sleep between chunk verification #1160

Merged
merged 1 commit into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions sn_networking/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,13 @@ impl Network {
return Ok(());
}
warn!("The obtained {n_verified} verified proofs did not match the expected {expected_n_verified} verified proofs");
// Sleep to avoid firing queries too close to even choke the nodes further.
let waiting_time = if retry_attempts == 1 {
MIN_WAIT_BEFORE_READING_A_PUT
} else {
MIN_WAIT_BEFORE_READING_A_PUT + MIN_WAIT_BEFORE_READING_A_PUT
};
tokio::time::sleep(waiting_time).await;
}

Err(Error::FailedToVerifyChunkProof(chunk_address.clone()))
Expand Down
2 changes: 1 addition & 1 deletion sn_transfers/src/wallet/wallet_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,10 @@ where
*SpendAddress::from_unique_pubkey(&cash_note.unique_pubkey()).xorname();
let unique_pubkey_file_name = format!("{}.cash_note", hex::encode(unique_pubkey_name));

debug!("Writing cash note to: {:?}", created_cash_notes_path);
fs::create_dir_all(&created_cash_notes_path)?;

let cash_note_file_path = created_cash_notes_path.join(unique_pubkey_file_name);
debug!("Writing cash note to: {cash_note_file_path:?}");

let hex = cash_note
.to_hex()
Expand Down