Skip to content

Conversation

harrisluo
Copy link
Contributor

The method serves as an alternative to tryConfirm that also fetches the transaction from chain. To confirm a tx, exactly one of tryConfirm or tryFetchTx should be called since they mutate the same underlying state controlling async sending triggered by send.

@harrisluo harrisluo marked this pull request as ready for review October 28, 2024 22:43
} finally {
this._stopWaiting();
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this wouldn't have WS right? Did you ever figure out why WS wasn't ever really working with tryConfirm (polling almost always beat it).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup this wouldn't have WS, just polling. Haven't had the chance to look into WS in tryConfirm yet, will do tn.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After some testing, it looks like WS confirming is reliable. Both WS and polling at 300 ms intervals are roughly equally likely to pick up a confirmed status, and turning the poll interval up from 2000 ms wasn't strictly necessary since WS would have picked it up.

Polling getTransaction at 300ms intervals appears to yield similar results to WS + 300 ms getSignatureStatus poll, with the added benefit of eliminating the additional call to fetch the actual tx. So the getTransaction approach is promising.

@harrisluo harrisluo merged commit 86efbd9 into main Oct 29, 2024
2 checks passed
@harrisluo harrisluo deleted the harris/retrytxsender-fetch-tx branch October 29, 2024 00:18
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

Successfully merging this pull request may close these issues.

2 participants