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

feat: cap bundler surcharge if all solvers fail #441

Merged
merged 3 commits into from
Oct 17, 2024

Conversation

BenSparksCode
Copy link
Contributor

@BenSparksCode BenSparksCode commented Oct 16, 2024

Summary

Bundling should not be profitable when all solvers fail. If they fail due to fault of the solver, the current accounting charges Atlas and Bundler surcharges on the gas costs of the execution of those SolverOperations. This was then distributed to Atlas and Bundler at the end of the metacall.

However, the Bundler may also collect storage refunds after bundling a metacall, which in combination with the Bundler surcharges, could result in a profitable tx (ETH spent on gas cost vs refunds and surcharges received). As such, we now cap the Bundler surcharge, only in the case of all solvers failing, to a max of 80% of the metacall gas cost. The remaining 20% may be made up through storage refunds.

If the max is exceeded, the excess is instead taken as Atlas gas surcharge.

Copy link
Contributor

@jj1980a jj1980a left a comment

Choose a reason for hiding this comment

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

lgtm!

@BenSparksCode BenSparksCode merged commit 1fd0f79 into solver-surcharge-tracking Oct 17, 2024
3 checks passed
@BenSparksCode BenSparksCode deleted the bundler-surcharge-cap branch October 17, 2024 11:46
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

Successfully merging this pull request may close these issues.

2 participants