-
Notifications
You must be signed in to change notification settings - Fork 112
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
Adjust robustness of MTX broadcaster #1321
Conversation
error: { message: `Error: VM Exception while processing transaction: reverted with reason string '${decoded[0]}'` }, | ||
id: req.body.id, | ||
}); | ||
console.log(error); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this meant to be part of the final implementation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I guess this can be removed now that we have the try/catch.
A demoralising update. From the frontend side, we need to guarantee, as strongly as possible, that the hash returned is the hash of the transaction that does the metatransaction. The previous implementation, rebroadcasting the transaction if it did not succeed, does not guarantee that (as if we have to change the nonce, the hash will change). I've ended up at this much simpler implementation that refreshes the nonce every request (as a typical signer would), but retrying if an error relating to the nonce is seen when doing so, and only returning the transaction hash when that doesn't happen (which will be when the transaction is mined). For cases where the broadcaster ends up behind, it'll catch-up, and for cases where the broadcaster ends up ahead it'll reset itself. The latter can't be tested properly locally currently, as The (previous) 'clever' version might be appropriate to use with the wormhole relayer - where we don't care about the transaction hash of something happening, we just care about it happening, but it can use this provider for now, as well, as far as I'm concerned. |
0c55baa
to
7024774
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
7024774
to
c9f3c19
Compare
While investigating issues that users were having with the metatransaction broadcaster, this is where we've arrived, fixing two issues:
signer.sendTransaction
andprovider.sendTransaction
in the rebroadcasting logic.Reproducing issues around this determinsitically is hard; I've done my best with some tests, but I couldn't get the exact errors we saw in production. These changes are currently live on QA, and will hit production before the next release (or maybe even before this is merged), so it's going to be an ongoing battle, but let's still review / improve these changes as normal!