-
Notifications
You must be signed in to change notification settings - Fork 43
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(sim): fix gas limit calcs #429
Conversation
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.
Nice
pub fn user_operation_max_gas_cost(uo: &UserOperation, chain_id: u64) -> U256 { | ||
user_operation_gas_limit(uo, chain_id) * uo.max_fee_per_gas | ||
pub fn user_operation_max_gas_cost(uo: &UserOperation) -> U256 { | ||
let mul = if uo.paymaster().is_some() { 3 } else { 1 }; |
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.
In the no paymaster case why is this now 1 but in user_operation_execution_gas_limit
it's still 2, we can still hit the innerHandleOp
code and incur cost there
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.
Good question. The 2
is there because of that incorrect check that requires us to have one validationGasLimit
buffer left in the transaction's gas. However, since no postOp
will ever run when not using a paymaster, the maximum a user will ever need to pay for is 1
validationGasLimit
11be8f1
to
57e8e5f
Compare
Codecov Report
@@ Coverage Diff @@
## main #429 +/- ##
==========================================
- Coverage 51.98% 51.98% -0.01%
==========================================
Files 93 93
Lines 13328 13324 -4
==========================================
- Hits 6929 6926 -3
+ Misses 6399 6398 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
No description provided.