Transactions squeezed out in-between submit
and statusChange
calls hang indefinitely
#2936
Labels
bug
Issue is a bug
submit
and statusChange
calls hang indefinitely
#2936
@Torres-ssf did tests on devnet and found that sending a transaction would sometimes hang indefinitely. After some investigation, the problem was found to be transactions being squeezed out after submitting them but before a
statusChange
subscription is established. ThisstatusChange
subscription would then hang indefinitely because the squeezed out transaction is unavailable on the node.Solution
To solve this, we'd have to use the
submitAndAwait
endpoint instead ofsubmit
inProvider.sendTransaction
. This way theSqueezedOutStatus
status wouldn't be lost as it'd be sent as the second event on the subscription afterSubmittedStatus
.There are other considerations here. For example, what happens if we submit the transaction and the connection breaks? We'd have to use the
statusChange
subscription then, but we'd be back on square one because the transaction can be squeezed out in the meantime. That would require some internal "squeezed out timer" onstatusChange
which'd throw an error if there's no response from the node after e.g. 20 seconds, and this error would be something like "The transaction was probably squeezed out". This can be a separate issue.Another thing worthy of covering is that a node has a maximum active subscriptions limit. What happens when that limit is reached and how do we account for that?
The text was updated successfully, but these errors were encountered: