This repository was archived by the owner on Oct 20, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -42,11 +42,12 @@ func CallGasEstimate(
42
42
return 0 , err
43
43
}
44
44
45
+ ov := NewDefaultOverhead ()
45
46
tg := big .NewInt (0 ).Div (sim .Paid , op .MaxFeePerGas )
46
- cgl := big .NewInt (0 ).Sub (tg , sim .PreOpGas )
47
- call := NewDefaultOverhead () .NonZeroValueCall ()
48
- if cgl .Cmp (call ) >= 1 {
47
+ cgl := big .NewInt (0 ).Add ( big . NewInt ( 0 ). Sub (tg , sim .PreOpGas ), big . NewInt ( int64 ( ov . fixed )) )
48
+ min := ov .NonZeroValueCall ()
49
+ if cgl .Cmp (min ) >= 1 {
49
50
return cgl .Uint64 (), nil
50
51
}
51
- return call .Uint64 (), nil
52
+ return min .Uint64 (), nil
52
53
}
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ func (ov *Overhead) CalcPreVerificationGas(op *userop.UserOperation) *big.Int {
44
44
// See https://github.com/wolflo/evm-opcodes/blob/main/gas.md#aa-1-call.
45
45
func (ov * Overhead ) NonZeroValueCall () * big.Int {
46
46
return big .NewInt (
47
- int64 (ov .warmStorageRead + ov .nonZeroValueCall + ov .callOpcode + ov .nonZeroValueStipend ),
47
+ int64 (ov .fixed + ov . warmStorageRead + ov .nonZeroValueCall + ov .callOpcode + ov .nonZeroValueStipend ),
48
48
)
49
49
}
50
50
You can’t perform that action at this time.
0 commit comments