Skip to content

Commit

Permalink
fix(node): disable records_stored bad quote detection due to new work
Browse files Browse the repository at this point in the history
  • Loading branch information
maqi committed Apr 2, 2024
1 parent 90790a6 commit 170bcb5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
4 changes: 2 additions & 2 deletions sn_networking/src/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -635,8 +635,8 @@ impl SwarmDriver {
// --------------------------------------------

/// Return a far address, close to but probably farther than our responsibilty range.
/// This simply uses the closest k peers to estimate the farthest address as CLOSE_GROUP_SIZE + 1 peer's
/// address distance.
/// This simply uses the closest k peers to estimate the farthest address as
/// `CLOSE_GROUP_SIZE + 1`th peer's address distance.
fn get_farthest_relevant_address_estimate(
&mut self,
// Sorted list of closest k peers to our peer id.
Expand Down
25 changes: 15 additions & 10 deletions sn_transfers/src/wallet/data_payments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,16 +207,21 @@ impl PaymentQuote {
return false;
}

// There could be pruning to be undertaken,
// hence the `increasement` check only valid when not being too full.
if new_quote.quoting_metrics.close_records_stored + 20
< new_quote.quoting_metrics.max_records
&& new_quote.quoting_metrics.close_records_stored
< old_quote.quoting_metrics.close_records_stored
{
info!("claimed records_stored out of sequence");
return false;
}
// // There could be pruning to be undertaken,
// // hence the `increasement` check only valid when not being too full.
// // As now using the `close_records_stored`, with the changing range,
// // there is chance that a newer close_records_stored will be smaller than old ones
// //
// // TODO: rethink about the detection policy on this part
//
// if new_quote.quoting_metrics.close_records_stored + 20
// < new_quote.quoting_metrics.max_records
// && new_quote.quoting_metrics.close_records_stored
// < old_quote.quoting_metrics.close_records_stored
// {
// info!("claimed records_stored out of sequence");
// return false;
// }

// TODO: Double check if this applies, as this will prevent a node restart with same ID
if new_quote.quoting_metrics.received_payment_count
Expand Down

0 comments on commit 170bcb5

Please sign in to comment.