-
Notifications
You must be signed in to change notification settings - Fork 81
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
fix: persistTransaction timeout #1224
Merged
Merged
Conversation
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
* Improve error log * Default timeout = 3000 ms defer + (30 retries * 1000 ms delay) = 33 seconds * Aligns with default timeout fetching from storage-subgraph = 30 seconds
* This tells the user to stop polling /getConfirmedTransaction because the transaction will never be confirmed.
MantisClone
requested review from
skiv71,
benjlevesque,
alexandre-abrioux and
yomarion
October 27, 2023 22:23
I converted to Draft because I should probably add some tests. |
yomarion
approved these changes
Oct 30, 2023
alexandre-abrioux
approved these changes
Oct 31, 2023
I decided to skip writing tests. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Resolves #1145
Context
The
persistTransaction()
method of thehttp-data-access
implementation works like this:request-node
to persist a new transaction withPOST /persistTransaction
GET /getConfirmedTransaction
multiple times until it does not receive an HTTP error anymore (normally it's NOT FOUND 404). By default, it polls 500 times with a 3-second delay for a total of 25 minutes! 😱request-node
tries to confirm the transaction via thestorage-subgraph
. However, if the graph node is running slow, perhaps due to a rate-limited Ethereum Node RPC, this transaction confirmation will timeout after 30 seconds.request-node
never again tries to confirm it, and the/getConfirmedTransaction
will forever return NOT FOUND 404Changes
getConfirmationMaxRetry
from 500 to 30 and the defaultgetConfirmationRetryDelay
from 3 seconds to 1 second.request-node
server side to better explain what happened in the case of a timeout.http-data-access
client side to explain to thepersistTransaction()
caller that they must continue polling thegetTransactionsByChannelId()
if they still need to confirm that their transaction was stored.request-node
: Store anError
in theconfirmedTransactionStore
when thePOST /persistTransaction
endpoint fails. Anyone who calls theGET /getConfirmedTransaction
can see theError
.TODO
- [ ] Add tests