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

Hopefully fix noisy submission error alert on eden #481

Merged
merged 13 commits into from
Sep 1, 2022

Conversation

MartinquaXD
Copy link
Contributor

@MartinquaXD MartinquaXD commented Aug 29, 2022

Currently eden's submission error alert is one of our noisiest. Also it's not really actionable so let's try to fix it.

My current working hypothesis is that eden sometimes submits a transaction into the mempool but reports an error anyway. This would lead our submission logic to think the gas price which would require a replacement tx would be the price of tx_1 * 1.25 (MIN_GAS_BUMP). But since the mempool already knows about tx_2 which must have at least a gas price of tx_1 * 1.25 the actual replacement tx would have to have a gas price of at least tx_2 * (1.25^2).

This hypothesis came from logs like this where at some point eden returned some generic internal server error and afterwards reports many replacement transaction underpriced errors in a row.

As a side note this change could also lead to faster submission times when a solver run loop encounters that issue.

I don't really know how to test this idea without deploying it so please let me know if it seems reasonable to you.
We could also enable the gas price factor bumping with a CLI switch to test the fix temporarily without redeploying the solver.

Test Plan

CI

@MartinquaXD MartinquaXD requested a review from a team as a code owner August 29, 2022 21:14
Copy link
Contributor

@nlordell nlordell left a comment

Choose a reason for hiding this comment

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

One concern I have here is that it is possible for gas prices to "escalate" quite quickly since we are making a positive "increase gas cost" feedback loop.

We should keep a close eye on this change (maybe add a log when we set the tx_consecutively_underpriced so we can easily track what its value is).

As for testing - I'm not sure what the right way to test this is. Maybe we can create a mock submitter and get it to return "tx underprised" errors?

@nlordell
Copy link
Contributor

Maybe we can reach out to the Eden team and let them know that transactions are getting added to the tx pool even if their RPC endpoint is returning an error?

@sunce86
Copy link
Contributor

sunce86 commented Aug 30, 2022

I am worried if we start going this path (trying to handle these kind of errors) our code will eventually become maintenance nightmare.

@MartinquaXD
Copy link
Contributor Author

I am worried if we start going this path (trying to handle these kind of errors) our code will eventually become maintenance nightmare.

While I agree that we ideally shouldn't have to worry about that, I think it makes sense to address this bug because it seems to cause our noisiest alert.
I hope I found a way to make this behavior configurable with the CLI in a reasonable manner.

Copy link
Contributor

@sunce86 sunce86 left a comment

Choose a reason for hiding this comment

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

Lg.
What would be interesting is to add some kind of metric to know how often this happens, so we can be alerted when Eden fixes this error internally (if ever). Or we can set a manual reminder somewhere to check for the logs :) -> all so we can revert this change once the error is cleared.

@MartinquaXD
Copy link
Contributor Author

What would be interesting is to add some kind of metric to know how often this happens, so we can be alerted when Eden fixes this error internally (if ever). Or we can set a manual reminder somewhere to check for the logs :) -> all so we can revert this change once the error is cleared.

Agree on all fronts. Since I don't know yet, whether this PR will actually fix the error (just an idea) I will deploy the change and monitor the impact. If it actually fixes the problem I will add the metrics otherwise I will revert the PR again.

@MartinquaXD MartinquaXD enabled auto-merge (squash) September 1, 2022 14:45
@MartinquaXD MartinquaXD merged commit 2dfc400 into main Sep 1, 2022
@MartinquaXD MartinquaXD deleted the fixed-transaction-underpriced-error branch September 1, 2022 14:47
@github-actions github-actions bot locked and limited conversation to collaborators Sep 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants