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

RPC node doesn't retry sending transactions #9401

Closed
garious opened this issue Apr 9, 2020 · 3 comments
Closed

RPC node doesn't retry sending transactions #9401

garious opened this issue Apr 9, 2020 · 3 comments
Milestone

Comments

@garious
Copy link
Contributor

garious commented Apr 9, 2020

Problem

RPC node doesn't retry sending transactions, so each client has to implement the same retry algorithm, and lazy clients probably won't implement exponential backoff, causing unnecessary network congestion.

Proposed Solution

Add RpcClient::send_transaction_and_wait_until_accepted() and corresponding JSON RPC API. The RPC node should retry on behalf of the client. It should share the same retry code as what is used for #9400.

Ideally, the RPC node implementation could use async/await, not one thread per connection.

cc: @mvines @CriesofCarrots @aeyakovenko

@garious garious added this to the The Future! milestone Apr 9, 2020
@mvines
Copy link
Member

mvines commented May 2, 2020

We could only retry transactions:

  1. That pass signature check
  2. That can pay the transaction fee (based on the max confirmed bank of the RPC node)
  3. Only retry transactions until their blockhash is no longer known to the RPC node

This could just be a simple queue that is checked every ~5-10 seconds. Once a queued transaction's blockhash is no longer known, or the signature shows up in the status cache then drop it.

@mvines mvines modified the milestones: The Future!, v1.2.0 May 2, 2020
@mvines
Copy link
Member

mvines commented May 2, 2020

This would likely help mitigate a current TrustWallet bug where transactions get stuck as "pending" in the TrustWallet UI.

TrustWallet should clearly handle this better, but a retry facility in RPC would reduce the likelihood of users encountering the application bug.

@mvines
Copy link
Member

mvines commented May 11, 2020

Replaced by #9974

@mvines mvines closed this as completed May 11, 2020
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

No branches or pull requests

2 participants