diff --git a/internal/config/constants.go b/internal/config/constants.go index b66d486c..bbe6ebc4 100644 --- a/internal/config/constants.go +++ b/internal/config/constants.go @@ -34,4 +34,10 @@ var ( LyraSepoliaChainID.Uint64(), Ancient8SepoliaChainID.Uint64(), ) + + ArbStackChains = mapset.NewSet( + ArbitrumOneChainID.Uint64(), + ArbitrumGoerliChainID.Uint64(), + ArbitrumSepoliaChainID.Uint64(), + ) ) diff --git a/internal/config/values.go b/internal/config/values.go index 7e1e243d..5377402d 100644 --- a/internal/config/values.go +++ b/internal/config/values.go @@ -46,6 +46,7 @@ type Values struct { // Rollup related variables. IsOpStackNetwork bool IsRIP7212Supported bool + IsArbStackNetwork bool // Undocumented variables. DebugMode bool @@ -99,6 +100,7 @@ func GetValues() *Values { viper.SetDefault("erc4337_bundler_blocks_in_the_future", 6) viper.SetDefault("erc4337_bundler_otel_insecure_mode", false) viper.SetDefault("erc4337_bundler_is_op_stack_network", false) + viper.SetDefault("erc4337_bundler_is_arb_stack_network", false) viper.SetDefault("erc4337_bundler_is_rip7212_supported", false) viper.SetDefault("erc4337_bundler_debug_mode", false) viper.SetDefault("erc4337_bundler_gin_mode", gin.ReleaseMode) @@ -138,6 +140,7 @@ func GetValues() *Values { _ = viper.BindEnv("erc4337_bundler_alt_mempool_ipfs_gateway") _ = viper.BindEnv("erc4337_bundler_alt_mempool_ids") _ = viper.BindEnv("erc4337_bundler_is_op_stack_network") + _ = viper.BindEnv("erc4337_bundler_is_arb_stack_network") _ = viper.BindEnv("erc4337_bundler_is_rip7212_supported") _ = viper.BindEnv("erc4337_bundler_debug_mode") _ = viper.BindEnv("erc4337_bundler_gin_mode") @@ -200,6 +203,7 @@ func GetValues() *Values { altMempoolIPFSGateway := viper.GetString("erc4337_bundler_alt_mempool_ipfs_gateway") altMempoolIds := envArrayToStringSlice(viper.GetString("erc4337_bundler_alt_mempool_ids")) isOpStackNetwork := viper.GetBool("erc4337_bundler_is_op_stack_network") + isArbStackNetwork := viper.GetBool("erc4337_bundler_is_arb_stack_network") isRIP7212Supported := viper.GetBool("erc4337_bundler_is_rip7212_supported") debugMode := viper.GetBool("erc4337_bundler_debug_mode") ginMode := viper.GetString("erc4337_bundler_gin_mode") @@ -226,6 +230,7 @@ func GetValues() *Values { AltMempoolIPFSGateway: altMempoolIPFSGateway, AltMempoolIds: altMempoolIds, IsOpStackNetwork: isOpStackNetwork, + IsArbStackNetwork: isArbStackNetwork, IsRIP7212Supported: isRIP7212Supported, DebugMode: debugMode, GinMode: ginMode, diff --git a/internal/start/private.go b/internal/start/private.go index bb1fe7e0..23fb9982 100644 --- a/internal/start/private.go +++ b/internal/start/private.go @@ -84,9 +84,7 @@ func PrivateMode() { } ov := gas.NewDefaultOverhead() - if chain.Cmp(config.ArbitrumOneChainID) == 0 || - chain.Cmp(config.ArbitrumGoerliChainID) == 0 || - chain.Cmp(config.ArbitrumSepoliaChainID) == 0 { + if conf.IsArbStackNetwork || config.ArbStackChains.Contains(chain.Uint64()) { ov.SetCalcPreVerificationGasFunc(gas.CalcArbitrumPVGWithEthClient(rpc, conf.SupportedEntryPoints[0])) ov.SetPreVerificationGasBufferFactor(16) }