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

Revert "Revert "Revert "Merge pull request #2224 from joshuef/RangeBasedGets""" #2369

Merged
merged 4 commits into from
Nov 2, 2024

Conversation

maqi
Copy link
Member

@maqi maqi commented Oct 31, 2024

This reverts commit 49115fd.

CLOSE #2357
CLOSE #2360
CLOSE #2367
CLOSE #2368

Description

Take PR 2224 out of the production code

Comment on lines +247 to +269
// TODO: Double check if this applies, as this will prevent a node restart with same ID
if new_quote.quoting_metrics.received_payment_count
< old_quote.quoting_metrics.received_payment_count
{
info!("claimed received_payment_count out of sequence");
return false;
}

let old_elapsed = if let Ok(elapsed) = old_quote.timestamp.elapsed() {
elapsed
} else {
info!("timestamp failure");
return false;
// The elapsed call could fail due to system clock change
// hence consider the verification succeeded.
info!("old_quote timestamp elapsed call failure");
return true;
};
let new_elapsed = if let Ok(elapsed) = new_quote.timestamp.elapsed() {
elapsed
} else {
info!("timestamp failure");
return false;
// The elapsed call could fail due to system clock change
// hence consider the verification succeeded.
info!("new_quote timestamp elapsed call failure");
return true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not 100% sure about this, @mickvandijke could you confirm this makes sense?

Copy link
Contributor

@mickvandijke mickvandijke Nov 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really understand why these checks are done at all. Maybe I'm missing something. But wouldn't we only need to verify a quote's signature to check if it is made by this peer? Why do we need to store historical quotes and compare with them?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was to confirm a quote given by other node are not faked.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The quote signature being valid already rules out that the quote could have been faked by another node or client. So I think we can get rid of this.

This might be out of scope for this PR though, we can do it in a follow-up PR.

Copy link
Member Author

@maqi maqi Nov 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was to confirm a quote given by other node are not faked.

Sry, I don't mean faked by other, I mean faked by the quoter itself .
i.e. a node gives a quote with out_of_sequence data to gaim higher chance to be picked as a payee, or got a overpay by the client

Copy link
Member

@grumbach grumbach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing work @maqi !

@mickvandijke
Copy link
Contributor

Great work! 💪

@jacderida jacderida changed the base branch from stable to rc-2024.10.4.3 November 2, 2024 14:19
@jacderida jacderida merged commit 8b63e9f into maidsafe:rc-2024.10.4.3 Nov 2, 2024
25 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants