-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
fixReducedOffersV1
: curtail the occurrence of order books that are blocked by reduced offers
#4512
Merged
Merged
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
a4e8397
Implementation for fixReducedOffersV1 amendment:
scottschurr a061338
[FOLD] Address review comments
scottschurr 17e11a6
[FOLD] Fixes to accommodate Number rounding changes to STAmount
scottschurr 49aaa49
[FOLD] Address one round of review comments
scottschurr 166d238
[FOLD] Add offerInLedger() method to ReducedOffer unit test
scottschurr 1a645bc
[FOLD] Delete special copy members of Number rounding guards
scottschurr e68ddf8
[FOLD] Fix rounding in divRound without a new Number rounding mode
scottschurr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 is a comment for line 590
else if (*ofrQ != offer.quality())
below (doesn't look like github allows commenting on collapsed lines). I'm not sure if this is a problem but judging from the PR commentI assume it's possible that the reduced offer written back to the ledger has a better quality than the original offer, in which case this offer might block the order book since the check on line 590 would fail for this offer.
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.
Good for you to point out.
The way I understand this code (and @seelabs may correct me on this),
forEachOffer()
is intended to run through all offers that have the sameQuality
in an order book. So we get theQuality
of the offer at the tip of the order book -- that's how theoptional
is filled in. If any subsequent offers in the order book have a differentQuality
, then we return fromforEachOffer()
.But that doesn't mean we're done. It just means that we've done as much as we can with this
Strand
for now. If theQuality
from this go-round is good enough, then the payment engine will try this stand again and get some more offers out of this path.One more source of confusion is that the code works with two different
Quality
s here. There is theQuality
that is encoded in the offer book directory page -- that should be theQuality
of the offer as initially placed (not necessarily reflecting the actualQuality
of a reduced offer). I'm pretty sure that's theQuality
being used in the place you pointed out. There are other places that deal in the actualQuality
of an offer.At any rate, the determination that a particular order book is blocked happens further up the call stack here: https://github.com/XRPLF/rippled/blob/develop/src/ripple/app/paths/impl/StrandFlow.h#L638-L644
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.
Thanks. I missed that this better quality offer or the next one after it are going to be picked on the next payment engine iteration if there is more output left.