-
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
Improve transaction relay logic #4985
Open
ximinez
wants to merge
77
commits into
XRPLF:develop
Choose a base branch
from
ximinez:relay
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 4 commits
Commits
Show all changes
77 commits
Select commit
Hold shift + click to select a range
c3805a7
Decrease `shouldRelay` limit to 30s:
ximinez 36dddfa
Give a transaction more chances to be retried:
ximinez 99a63a0
Pop all transactions with sequential sequences, or tickets
ximinez e048a41
Process held transactions through existing NetworkOPs batching:
ximinez 3c0dbeb
Merge remote-tracking branch 'upstream/develop' into relay
ximinez 88c0074
Merge remote-tracking branch 'upstream/develop' into relay
ximinez 029d64c
Merge remote-tracking branch 'upstream/develop' into relay
ximinez a1218af
Merge branch 'develop' into relay
ximinez f67f346
Merge remote-tracking branch 'upstream/develop' into relay
ximinez 3863b01
Merge remote-tracking branch 'upstream/develop' into relay
ximinez 8b43ea8
Merge remote-tracking branch 'upstream/develop' into relay
ximinez 23636d1
Merge commit 'c706926' into relay
ximinez 7096d0a
Merge commit 'f6879da' into relay
ximinez 643ca1a
Move CMake directory
f0170d3
Rearrange sources
8742e3b
Rewrite includes
e6f2597
Recompute loops
0f71e1c
Merge remote-tracking branch 'upstream/develop' into relay
ximinez 31a18f8
Fix formatting
ximinez 58a5797
Merge remote-tracking branch 'upstream/develop' into relay
ximinez 05e4164
[FOLD] Review feedback from @scottschurr:
ximinez ff27e9e
Merge remote-tracking branch 'upstream/develop' into relay
ximinez 5d1ab36
Merge remote-tracking branch 'upstream/develop' into relay
ximinez 43d8ab1
fixup! [FOLD] Review feedback from @scottschurr:
ximinez c7e08bc
Merge remote-tracking branch 'upstream/develop' into relay
ximinez 3054f5a
Merge remote-tracking branch 'upstream/develop' into relay
ximinez c9eed68
Merge remote-tracking branch 'upstream/develop' into relay
ximinez 3ac1a8a
Merge remote-tracking branch 'upstream/develop' into relay
ximinez 0940acd
Merge remote-tracking branch 'upstream/develop' into relay
ximinez 00e1945
Merge remote-tracking branch 'upstream/develop' into relay
ximinez 77138fc
Merge remote-tracking branch 'upstream/develop' into relay
ximinez c2f600c
Merge remote-tracking branch 'upstream/develop' into relay
ximinez 29dbd50
Merge remote-tracking branch 'upstream/develop' into relay
ximinez 3d741e1
Merge remote-tracking branch 'upstream/develop' into relay
ximinez fb0e201
Merge remote-tracking branch 'upstream/develop' into relay
ximinez f982d93
Merge remote-tracking branch 'upstream/develop' into relay
ximinez 284399b
Merge remote-tracking branch 'upstream/develop' into relay
ximinez 03f9d0f
Merge remote-tracking branch 'upstream/develop' into relay
ximinez 31e982a
Merge remote-tracking branch 'upstream/develop' into relay
ximinez 0641f77
Merge remote-tracking branch 'upstream/develop' into relay
ximinez 01bd73b
Merge remote-tracking branch 'upstream/develop' into relay
ximinez f3e3199
Merge remote-tracking branch 'upstream/develop' into relay
ximinez b056f25
Merge remote-tracking branch 'upstream/develop' into relay
ximinez 0bbb61a
Merge remote-tracking branch 'upstream/develop' into relay
ximinez b008dbc
Add UNDOCUMENTED configuration section for HashRouter timeouts
ximinez 022142f
Document why a lock is not used for Transaction::mApplying
ximinez be52629
Merge remote-tracking branch 'upstream/develop' into relay
ximinez 12af9f1
Merge remote-tracking branch 'upstream/develop' into relay
ximinez c1866d1
Merge remote-tracking branch 'upstream/develop' into relay
ximinez 79fb1cc
Merge remote-tracking branch 'upstream/develop' into relay
ximinez b5624fe
Merge remote-tracking branch 'upstream/develop' into relay
ximinez a35aab0
Merge remote-tracking branch 'upstream/develop' into relay
ximinez 9595d8c
Merge remote-tracking branch 'upstream/develop' into relay
ximinez eeb1277
Merge remote-tracking branch 'upstream/develop' into relay
ximinez 91d0867
fixup! Add UNDOCUMENTED configuration section for HashRouter timeouts
ximinez 3c5e9cf
Merge remote-tracking branch 'upstream/develop' into relay
ximinez 2ca015e
Merge remote-tracking branch 'upstream/develop' into relay
ximinez 65303b3
Merge remote-tracking branch 'upstream/develop' into relay
ximinez e5233f2
Merge remote-tracking branch 'upstream/develop' into relay
ximinez 8f48d64
Merge remote-tracking branch 'upstream/develop' into relay
ximinez d5ba2c6
Merge remote-tracking branch 'upstream/develop' into relay
ximinez dcc3ca5
Merge remote-tracking branch 'upstream/develop' into relay
ximinez d3a9522
Merge remote-tracking branch 'upstream/develop' into relay
ximinez 9082414
Merge remote-tracking branch 'upstream/develop' into relay
ximinez 96f9219
Merge remote-tracking branch 'upstream/develop' into relay
ximinez c94bf7d
Merge remote-tracking branch 'upstream/develop' into relay
ximinez 9fe23dc
Merge remote-tracking branch 'upstream/develop' into relay
ximinez e96745f
Merge remote-tracking branch 'upstream/develop' into relay
ximinez 1cd33b8
Merge remote-tracking branch 'upstream/develop' into relay
ximinez 158c285
Merge remote-tracking branch 'upstream/develop' into relay
ximinez 5b09745
Merge remote-tracking branch 'upstream/develop' into relay
ximinez e8c0d7b
Merge remote-tracking branch 'upstream/develop' into relay
ximinez 76dd4e1
Address review feedback from @Bronek:
ximinez 47da138
Add missing include
ximinez 93b9a6d
Get rid of some unused variables
ximinez 0855726
Merge remote-tracking branch 'upstream/develop' into relay
ximinez 1fed810
Merge remote-tracking branch 'upstream/develop' into relay
ximinez 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,18 +66,22 @@ CanonicalTXSet::popAcctTransaction(std::shared_ptr<STTx const> const& tx) | |
// 1. Prioritize transactions with Sequences over transactions with | ||
// Tickets. | ||
// | ||
// 2. Don't worry about consecutive Sequence numbers. Creating Tickets | ||
// can introduce a discontinuity in Sequence numbers. | ||
// 2. For transactions not using Tickets, look for consecutive Sequence | ||
// numbers. For transactions using Tickets, don't worry about | ||
// consecutive Sequence numbers. Tickets can process out of order. | ||
// | ||
// 3. After handling all transactions with Sequences, return Tickets | ||
// with the lowest Ticket ID first. | ||
std::shared_ptr<STTx const> result; | ||
uint256 const effectiveAccount{accountKey(tx->getAccountID(sfAccount))}; | ||
|
||
Key const after(effectiveAccount, tx->getSeqProxy(), beast::zero); | ||
auto const seqProxy = tx->getSeqProxy(); | ||
Key const after(effectiveAccount, seqProxy, beast::zero); | ||
auto const itrNext{map_.lower_bound(after)}; | ||
if (itrNext != map_.end() && | ||
itrNext->first.getAccount() == effectiveAccount) | ||
itrNext->first.getAccount() == effectiveAccount && | ||
(!itrNext->second->getSeqProxy().isSeq() || | ||
itrNext->second->getSeqProxy().value() == seqProxy.value() + 1)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice! This takes full advantage of the "unusual" sort order of |
||
{ | ||
result = std::move(itrNext->second); | ||
map_.erase(itrNext); | ||
|
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.
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 great way to minimize processing while the
lock
is held. Good spotting!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!