-
Notifications
You must be signed in to change notification settings - Fork 14
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: full solver failure surcharge solution #427
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BenSparksCode
requested review from
thogard785,
jj1980a,
0x1NotMe,
aanand1 and
jgcogsystematictrading
September 12, 2024 19:22
This was referenced Oct 14, 2024
fix: bundler gets bundler surcharge if all solvers fail
jj1980a
approved these changes
Oct 17, 2024
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.
lgtm!
feat: cap bundler surcharge if all solvers fail
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes to Accounting Treatment of Surcharges
Variables
cost
= the base gas cost of execution, on which surcharges are calculated.a
= Atlas gas surchargeb
= Bundler surcharged
= deficit due to insufficient solver balance during_assign()
Latest Accounting Rules
cost + b
, paid by winning solver.a
, paid by winning solver.cost
and does not receive a refund.claims
is set to0
, but the following treatment is applied on a per-solverOp basis.cost
, and writeoffs increases bya + b
, but gets cleared when claims gets set to0
unless their is a winning solver.cost + a + b - d
via_assign()
.cost
but is refundedcost + b - d
via_credit()
.a
via an increase in cumulative surcharge.Capping Bundler refund when all solverOps fail
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.