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 +11
-12
lines changed Expand file tree Collapse file tree 2 files changed +11
-12
lines changed Original file line number Diff line number Diff line change @@ -91,17 +91,12 @@ func HandleOps(
91
91
if err != nil {
92
92
return nil , nil , err
93
93
}
94
- tip , err := eth .SuggestGasTipCap (context .Background ())
95
- if err != nil {
96
- return nil , nil , err
97
- }
98
94
99
95
auth , err := bind .NewKeyedTransactorWithChainID (eoa .PrivateKey , chainID )
100
96
if err != nil {
101
97
return nil , nil , err
102
98
}
103
99
auth .GasLimit = gas
104
- auth .GasTipCap = tip
105
100
106
101
txn , err = ep .HandleOps (auth , toAbiType (batch ), beneficiary )
107
102
if err != nil {
@@ -131,19 +126,14 @@ func CreateRawHandleOps(
131
126
if err != nil {
132
127
return "" , err
133
128
}
134
- tip , err := eth .SuggestGasTipCap (context .Background ())
135
- if err != nil {
136
- return "" , err
137
- }
138
129
139
130
auth , err := bind .NewKeyedTransactorWithChainID (eoa .PrivateKey , chainID )
140
131
if err != nil {
141
132
return "" , err
142
133
}
143
134
auth .GasLimit = gas
144
- auth .GasTipCap = tip
145
- auth .GasFeeCap = big .NewInt (0 ).Add (baseFee , tip )
146
135
auth .NoSend = true
136
+
147
137
tx , err := ep .HandleOps (auth , toAbiType (batch ), beneficiary )
148
138
if err != nil {
149
139
return "" , err
Original file line number Diff line number Diff line change @@ -7,13 +7,22 @@ import (
7
7
)
8
8
9
9
// ValidateFeePerGas checks the maxFeePerGas is sufficiently high to be included with the current
10
- // block.basefee.
10
+ // block.basefee. Alternatively, if basefee is not supported, then check that maxPriorityFeePerGas is equal to
11
+ // maxFeePerGas as a fallback.
11
12
func ValidateFeePerGas (op * userop.UserOperation , gbf GetBaseFeeFunc ) error {
12
13
bf , err := gbf ()
13
14
if err != nil {
14
15
return err
15
16
}
16
17
18
+ if bf == nil {
19
+ if op .MaxPriorityFeePerGas .Cmp (op .MaxFeePerGas ) != 0 {
20
+ return fmt .Errorf ("legacy fee mode: maxPriorityFeePerGas must equal maxFeePerGas" )
21
+ }
22
+
23
+ return nil
24
+ }
25
+
17
26
if op .MaxFeePerGas .Cmp (bf ) < 0 {
18
27
return fmt .Errorf ("maxFeePerGas: must be equal to or greater than current block.basefee" )
19
28
}
You can’t perform that action at this time.
0 commit comments