-
Notifications
You must be signed in to change notification settings - Fork 54
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
fix(relayer): Use precomputed gas limits #1876
base: master
Are you sure you want to change the base?
Conversation
The relayer has had a bug for a while where it is incorrectly dropping the precomputed gas limit for non-message fills. Instead, it was retaining the limit for message fills. This can lead to unnecessary transaction simulation later on, increasing RPC consumption and potentially delaying fills.
One thing holding this back: some ERC20s consume a lot more gas on transfers than others. This PR would probably break filling for SNX and UMA at least. |
Fixed by precomputing all types on startup: 6bf012a This isn't as efficient as it could be, but it still miles better than the current status quo that's performing simulation for every single fill. |
276b191
The relayer has had a bug for a while where it is incorrectly dropping the precomputed gas limit for non-message fills. Instead, it was retaining the limit for message fills. This can lead to unnecessary transaction simulation later on, increasing RPC consumption and potentially delaying fills.
In practice, it's totally unnecessary for the top-level relayer logic to consider whether the deposit has a message at all. This is because the ProfitClient handles that internally and takes responsibility for setting the gas limit. It's inherently required to do this because otherwise the relayer risks making a vastly unprofitable fill (if gas consumption varies between the initial estimate and any subsequent estimate).