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

bug: bundleInteraction can throw and still manage to send a transaction #149

Closed
noomly opened this issue May 24, 2022 · 2 comments
Closed

Comments

@noomly
Copy link
Contributor

noomly commented May 24, 2022

We recently suffered from a duplicate interactions issue caused by bundleInteraction failing in appearance by throwing an error while still managing to send the transaction to the Sequencer. Our system interpreted such errors reported by bundleInteraction as recoverable and reiterated the call to bundleInteraction, sometimes multiple times. This has led to some interactions being effectively run many times. I noticed over time that the method can have timeout errors (probably from Arweave's gateway?), errors from Redstone's Gateway, and also errors from the Sequencer (the .catch to gateway/sequencer/register's fetch). However, I'm unfortunately unable to provide more information on the specific issues that triggered bundleInteraction to throw while still sending the transactions as the concerned logs weren't retained...

Due to the criticality of such an issue, I also posted another issue describing a feature that would allow to proactively avoid duplicated interactions: #148.

@noomly noomly changed the title bug: bundleInteraction can throws and still manage to send a transaction bug: bundleInteraction can throw and still manage to send a transaction May 24, 2022
@ppedziwiatr
Copy link
Contributor

from initial analysis:

It turns out that Bundlr library by default is using 100000ms timeout - https://github.com/Bundlr-Network/js-client/blob/main/src/node/bundlr.ts#L22
Our SDK is using fetch underneath. For node env. it is undici-fetch, which has a default timeout of only 30000ms. nodejs/undici#1373

So it may happen that a request to the sequencer (that is being done by bundleInteraction) will timeout before the "upload" method will timeout in the sequncer/bundlr.
From the SDK perspective it is then a timeout error, but the sequencer have processed the transaction properly.

Also - obviously our gateway indexes the bundled interaction only after getting a successful response from Bundlr - so it cannot happen, that we will cache/index something, that wasn't succssefully sent to Bundlr.

@ppedziwiatr
Copy link
Contributor

I have reduced the upload timeout in Bundlr client in sequencer to 5000ms.

@ppedziwiatr ppedziwiatr added this to Warp May 25, 2022
@ppedziwiatr ppedziwiatr moved this to Done in Warp Aug 8, 2022
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