[rpc send] retry when BlockhashNotFound happens #2
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.
hi @butonium ,
this is not an urgent PR request. I think it can wait when you have a bit of time to check.
I'm trying to address failures happening in bot processing of
marcrank
.I would like to ask you for a review or your perspective on this change.
This is a code I re-used from
marinade-anchor
, refactored it and now started to use it formarcrank
andvalidator-manager
bots.It's code that manages to send transactions and to that "generic" stuff around RPC calls. Each of the bots then creates own code with business logic on top of this.
During the morning today there were multiple errors in
marcrank
script processing the transactions.It's now all the time about
I reran the code and I cannot find much of the flaw in sending the transactions. The idea is to take a "
Finalized
" blockhash from the RPC call, to sign the transaction with that loaded blockhash and then send it to RPC to proceed.It happens time to time and sometimes more often that the sending transaction ends with
Blockhash not found
. As the blockhash was searched asFinalized
and it was loaded just before the call on sending happens I wonder this being some discrepancy of the particular RPC node to the network.My idea is to retry few times (like 2-3 times) the call of the same transaction with a new blockhash until the transaction sending is considered a failure.
I would like to ask you about you feeling around this and/or maybe if you did some similar handling before and if can be done easier than this.
Thanks for your points in advance.