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

Make metatransaction broadcaster estimateGas call stricter #1074

Merged
merged 1 commit into from
Jul 29, 2022

Conversation

area
Copy link
Member

@area area commented Jul 29, 2022

Some spotty tests came down to some behaviour here, where the oracle took a long time to responsd, and on thinking about it it did raise a potential issue with the broadcaster, so have decided to change its behaviour slightly (already cleared with the frontend). By including the gas limit with estimateGas, we return as quickly as possible. We lose information about whether the transaction fails or is too expensive, but I think that's fine to prevent people deliberately trying metatransactions that use a lot of gas to slow down / DoS the oracle (which is still possible, just harder).

@area area force-pushed the maint/metatx-gas-limit branch from b0b9551 to 424c804 Compare July 29, 2022 10:23
} catch (err) {
return res.status(400).send({
status: "fail",
data: {
payload: "Transaction reverts and will not be broadcast",
payload: "Transaction reverts and will not be broadcast. It either fails outright, or uses too much gas.",
Copy link
Member

Choose a reason for hiding this comment

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

I'm inclined to suggest we save all error messages to variables and use the variables here, but it's little more than a vague notion so I'll just let you think about it.

@kronosapiens kronosapiens merged commit 2fc7b8e into develop Jul 29, 2022
@kronosapiens kronosapiens deleted the maint/metatx-gas-limit branch July 29, 2022 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants