-
Notifications
You must be signed in to change notification settings - Fork 52
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
Conversation
…/RangeBasedGets""" This reverts commit 49115fd.
// 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; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing work @maqi !
Great work! 💪 |
This reverts commit 49115fd.
CLOSE #2357
CLOSE #2360
CLOSE #2367
CLOSE #2368
Description
Take PR 2224 out of the production code