@@ -14,6 +14,7 @@ import (
14
14
"github.com/stackup-wallet/stackup-bundler/pkg/mempool"
15
15
"github.com/stackup-wallet/stackup-bundler/pkg/modules"
16
16
"github.com/stackup-wallet/stackup-bundler/pkg/modules/noop"
17
+ "github.com/stackup-wallet/stackup-bundler/pkg/state"
17
18
"github.com/stackup-wallet/stackup-bundler/pkg/userop"
18
19
)
19
20
@@ -139,11 +140,15 @@ func (i *Client) SendUserOperation(op map[string]any, ep string) (string, error)
139
140
return hash .String (), nil
140
141
}
141
142
142
- // EstimateUserOperationGas returns estimates for PreVerificationGas, VerificationGas, and CallGasLimit given
143
- // a UserOperation and EntryPoint address. The signature field and current gas values will not be validated
144
- // although there should be dummy values in place for the most reliable results (e.g. a signature with the
145
- // correct length).
146
- func (i * Client ) EstimateUserOperationGas (op map [string ]any , ep string ) (* gas.GasEstimates , error ) {
143
+ // EstimateUserOperationGas returns estimates for PreVerificationGas, VerificationGasLimit, and CallGasLimit
144
+ // given a UserOperation, EntryPoint address, and state OverrideSet. The signature field and current gas
145
+ // values will not be validated although there should be dummy values in place for the most reliable results
146
+ // (e.g. a signature with the correct length).
147
+ func (i * Client ) EstimateUserOperationGas (
148
+ op map [string ]any ,
149
+ ep string ,
150
+ os map [string ]any ,
151
+ ) (* gas.GasEstimates , error ) {
147
152
// Init logger
148
153
l := i .logger .WithName ("eth_estimateUserOperationGas" )
149
154
@@ -165,6 +170,12 @@ func (i *Client) EstimateUserOperationGas(op map[string]any, ep string) (*gas.Ga
165
170
hash := userOp .GetUserOpHash (epAddr , i .chainID )
166
171
l = l .WithValues ("userop_hash" , hash )
167
172
173
+ _ , err = state .ParseOverrideData (os )
174
+ if err != nil {
175
+ l .Error (err , "eth_estimateUserOperationGas error" )
176
+ return nil , err
177
+ }
178
+
168
179
// Estimate gas limits
169
180
vg , cg , err := i .getGasEstimate (epAddr , userOp )
170
181
if err != nil {
0 commit comments