@@ -16,6 +16,7 @@ import (
16
16
"github.com/stackup-wallet/stackup-bundler/internal/logger"
17
17
"github.com/stackup-wallet/stackup-bundler/pkg/bundler"
18
18
"github.com/stackup-wallet/stackup-bundler/pkg/client"
19
+ "github.com/stackup-wallet/stackup-bundler/pkg/gas"
19
20
"github.com/stackup-wallet/stackup-bundler/pkg/jsonrpc"
20
21
"github.com/stackup-wallet/stackup-bundler/pkg/mempool"
21
22
"github.com/stackup-wallet/stackup-bundler/pkg/modules/checks"
@@ -56,6 +57,11 @@ func PrivateMode() {
56
57
log .Fatal (err )
57
58
}
58
59
60
+ ov := gas .NewDefaultOverhead ()
61
+ if chain .Cmp (config .ArbitrumOneChainID ) == 0 || chain .Cmp (config .ArbitrumGoerliChainID ) == 0 {
62
+ ov .SetCalcPreVerificationGasFunc (gas .CalcArbitrumPVGWithEthClient (eth ))
63
+ }
64
+
59
65
mem , err := mempool .New (db )
60
66
if err != nil {
61
67
log .Fatal (err )
@@ -64,6 +70,7 @@ func PrivateMode() {
64
70
check := checks .New (
65
71
db ,
66
72
rpc ,
73
+ ov ,
67
74
conf .MaxVerificationGas ,
68
75
conf .MaxOpsForUnstakedSender ,
69
76
conf .BundlerCollectorTracer ,
@@ -80,9 +87,9 @@ func PrivateMode() {
80
87
paymaster := paymaster .New (db )
81
88
82
89
// Init Client
83
- c := client .New (mem , chain , conf .SupportedEntryPoints )
90
+ c := client .New (mem , ov , chain , conf .SupportedEntryPoints )
84
91
c .SetGetUserOpReceiptFunc (client .GetUserOpReceiptWithEthClient (eth ))
85
- c .SetGetGasEstimateFunc (client .GetGasEstimateWithEthClient (rpc , chain , conf .BundlerErrorTracer ))
92
+ c .SetGetGasEstimateFunc (client .GetGasEstimateWithEthClient (rpc , ov , chain , conf .BundlerErrorTracer ))
86
93
c .SetGetUserOpByHashFunc (client .GetUserOpByHashWithEthClient (eth ))
87
94
c .UseLogger (logr )
88
95
c .UseModules (
0 commit comments