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

tx - txnNotFound Error should include which ledger versions it searched #2924

Closed
intelliot opened this issue May 1, 2019 · 1 comment
Closed
Labels
API Change Feature Request Used to indicate requests to add new features

Comments

@intelliot
Copy link
Collaborator

(Copied from RIPD-1705)

With online deletion, there is a race condition where a client could incorrectly conclude that a transaction is not in a validated ledger because that ledger was deleted after the client queried which ledgers were available on the server.

This is an edge case in reliable transaction submission: you have to know that a transaction is not in a range of validated ledgers before you conclude that it has failed. The scenario in question goes something like this (where "you" are a rippled client):

  • You submit a transaction T.
  • Transaction T becomes validated in ledger M, but you don't know that yet.
  • You see that the server has ledger M in its list of available ledgers, either because you're subscribed to the server's ledgerClosed stream, or by checking server_info.
  • After you've asked about the available ledgers but before you query for the transaction, the server deletes ledger M. (If you're following the ledgerClosed stream, this would have to be after a number of ledger versions have closed equal to or greater than online_delete, which is minimum ~15 minutes. If you asked via server_info, this could happen immediately if the ledger was in the range to be deleted when online_delete next ran.)
  • You ask the server about transaction T and get a txnNotFound response from the server.
  • You incorrectly conclude that the transaction T is not in ledger M, because you thought that the server had ledger M.

Even if you check server_info again after not finding the transaction, there's a small chance that the ledger in question was just finished downloading in between. Naturally, most of this stuff is unlikely, but becomes more plausible if there's an unusual amount of network latency between client and server.

One very straightforward and robust fix for this problem would be for the txnNotFound response to include a list of ledger indexes it checked. Essentially, paste the complete_ledgers field of server_info—all the validated ledger versions the server checked—into the error message. (It could also be in the form of ledger_index_min / ledger_index_max fields as the account_tx command returns.) That way, the client knows without risk of race conditions exactly which ledgers the transaction is not in.

@mDuo13 mDuo13 added API Change Feature Request Used to indicate requests to add new features labels Aug 1, 2019
@intelliot intelliot changed the title txnNotFound Error should include which ledger versions it searched tx - txnNotFound Error should include which ledger versions it searched Sep 4, 2019
undertome added a commit to undertome/rippled that referenced this issue Oct 15, 2019
…error.

FIXES: XRPLF#2924

* Create TransactionEnvelope struct. (Encapsulates transaction with ledger info)
* Return a TransactionEnvelope when fetching transactions from the database.
* Provide ledger info when returning a 'txnNotFound' error.
undertome added a commit to undertome/rippled that referenced this issue Oct 17, 2019
…error.

FIXES: XRPLF#2924

* Create TransactionEnvelope struct. (Encapsulates transaction with ledger info)
* Return a TransactionEnvelope when fetching transactions from the database.
* Provide ledger info when returning a 'txnNotFound' error.
undertome added a commit to undertome/rippled that referenced this issue Nov 1, 2019
…hen returning a 'txnNotFound' error.

FIXES: XRPLF#2924

* Tx command now supports min_ledger and max_ledger fields.
* If the requested transaction isn't found and these fields are provided, the error
  response indicates whether or not every ledger in the the provided range was searched.
undertome added a commit to undertome/rippled that referenced this issue Nov 1, 2019
…hen returning a 'txnNotFound' error.

FIXES: XRPLF#2924

* Tx command now supports min_ledger and max_ledger fields.
* If the requested transaction isn't found and these fields are provided, the error
  response indicates whether or not every ledger in the the provided range was searched.
undertome added a commit to undertome/rippled that referenced this issue Nov 1, 2019
…hen returning a 'txnNotFound' error.

FIXES: XRPLF#2924

* Tx command now supports min_ledger and max_ledger fields.
* If the requested transaction isn't found and these fields are provided, the error
  response indicates whether or not every ledger in the the provided range was searched.
undertome added a commit to undertome/rippled that referenced this issue Nov 3, 2019
FIXES: XRPLF#2924

* Tx command now supports min_ledger and max_ledger fields.
* If the requested transaction isn't found and these fields are
  provided, the error response indicates whether or not every
  ledger in the the provided range was searched.
undertome added a commit to undertome/rippled that referenced this issue Nov 4, 2019
FIXES: XRPLF#2924

* Tx command now supports min_ledger and max_ledger fields.
* If the requested transaction isn't found and these fields are
  provided, the error response indicates whether or not every
  ledger in the the provided range was searched.
undertome added a commit to undertome/rippled that referenced this issue Nov 4, 2019
FIXES: XRPLF#2924

* Tx command now supports min_ledger and max_ledger fields.
* If the requested transaction isn't found and these fields are
  provided, the error response indicates whether or not every
  ledger in the the provided range was searched.
undertome added a commit to undertome/rippled that referenced this issue Nov 4, 2019
FIXES: XRPLF#2924

* Tx command now supports min_ledger and max_ledger fields.
* If the requested transaction isn't found and these fields are
  provided, the error response indicates whether or not every
  ledger in the the provided range was searched.
undertome added a commit to undertome/rippled that referenced this issue Nov 11, 2019
FIXES: XRPLF#2924

* Tx command now supports min_ledger and max_ledger fields.
* If the requested transaction isn't found and these fields are
  provided, the error response indicates whether or not every
  ledger in the the provided range was searched.
@intelliot
Copy link
Collaborator Author

#3145 -- included in 1.5.0-b1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Change Feature Request Used to indicate requests to add new features
Projects
None yet
2 participants