-
Notifications
You must be signed in to change notification settings - Fork 23
feat: Atlas v1.6 #478
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
Merged
Merged
feat: Atlas v1.6 #478
Conversation
This file contains hidden or 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
metacallSimulation accounts for multipleSuccessfulSolvers in Simulato…
Four multiple solvers
feat: use `solverOp.gas` for metacall gas calcs
refactor: store surcharge rates in GasLedger
…isabled fix: solver gas subsidies disabled in `multipleSuccessfulSolvers` mode
fix: solverGasLiability in multipleSuccessfulSolvers
fix: `multipleSuccessfulSolvers` rule in `reconcile()`
fix: Atlas v1.6 Audit Fixes
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 vs Atlas v1.5:
A new
multipleSuccessfulSolvers
call config setting.In this config multiple solvers can execute successfully and each pay a bid. Atlas will continue to revert solvers who do not pay their bid in this config. This config enables app specific ordering rules, rather than a standard backrun auction. If the MEV is taken by an earlier solver in this config, the next solver should either revert early or search for leftover MEV. The gas accounting should be the same as if all solverOps reverted, even if solvers executed successfully and paid their bid. This config does not intend to fully compensate the bundler, the bundler will function like an oracle service with gas costs as an expense, and a monetization outside of Atlas. That being said, the bundler expects each solver to cover their respective gas costs in this config the same as if all SolverOps reverted.
It works by:
This config is not designed to be used with the invertBidValue, solverAuctioneer, requireFulfillment, zeroSolvers, or the exPostBids config, this is enforced in AtlasVerification.
Bundler surcharge set at the DAppControl level, instead of a global setting at the Atlas level.
getBundlerSurchargeRate()
view function which returns a uint128USER_OP_STATIC_LENGTH
constant (which measures the length of a UserOp with empty sig and data fields, for calldata gas accounting) has been increased by 32, bringing it to a value of576
.userOp.bundlerSurchargeRate
is included in the hash operation inAtlasVerification.getUserOperationHash()
, in both default and trusted modes.BundlerSurchargeRateMismatch
.S_surchargeRates
storage slot, with the left-most 128 bits taken up by the Atlas surcharge rate. This is the same as before, and the Atlas logic which reads the surcharges rates for calculations has not been modified.S_surchargeRates
storage variable is reset to 0 at the end of the metacall.bundlerSurchargeRate()
view function has been removed from Atlas and the IAtlas interface, as it is only non-zero during a metacall, and at that point it can be read of the active DAppControl.userOp.bundlerSurchargeRate
figure, asAtlas.bundlerSurchargeRate()
has been removed.type(uint128).max
.Use
solverOp.gas
instead ofdConfig.solverGasLimit
for lower and more accurate gas estimations.This PR aims to lower the recommended gas limit bundlers need to use for metacalls, and lower the bonded atlETH required to qualify a solverOp for execution. It also brings standard Atlas closer to Atlas on Monad, as the Monad version already uses this approach.
Changes:
solverOp.gas
values in the solverOps array, instead of the previoussolverOps.length * dConfig.solverGasLimit
approach.remainingMaxGas
andunreachedSolverGas
for gas accounting purposes,solverOp.gas
is used instead ofdConfig.solverGasLimit
.dConfig.solverGasLimit
applied to thesolverOp.gas
figure added or subtracted, so the value cannot be problematically large due to solver tampering.Read Atlas and Bundler surcharge rates from GasLedger struct for better gas efficiency.
1.09 x 10^12
gas. This should be enough gas even on chains with gigagas (10^9) block limits.uint24 atlasSurchargeRate
anduint24 bundlerSurchargeRate
to the GasLedger struct._initializeAccountingValues()
. Atlas surcharge rate is read from theS_atlasSurchargeRate
slot in Atlas, while the bundler surcharge rate is taken from theuserOp.bundlerSurchargeRate
value, which is checked against thedConfig.bundlerSurchargeRate
value duringvalidateCalls()
to ensure the userOp and DAppControl agree.solverGasLiability()
calculation.SCALE
constant) has been reduced from10_000_000
to10_000
. Because the max surcharge rate value that can be stored in a uint24 is16 777 215
, this means the surcharge rates have a max of 167.77x or 16 777% each.atlasSurchargeRate()
view function on Atlas has been changed togetAtlasSurchargeRate()
to avoid name collisions.Audit Fixes