From 33eaa1f65795a2efc3121d4ef4ec07ed1ba754cd Mon Sep 17 00:00:00 2001 From: hazim Date: Fri, 26 Jan 2024 11:09:49 +1100 Subject: [PATCH] Consistent env var names for reputation constants (#366) --- internal/config/mempool.go | 54 +++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/internal/config/mempool.go b/internal/config/mempool.go index 9cf99157..0730aae9 100644 --- a/internal/config/mempool.go +++ b/internal/config/mempool.go @@ -8,39 +8,39 @@ import ( func NewReputationConstantsFromEnv() *entities.ReputationConstants { viper.SetDefault("erc4337_bundler_min_unstake_delay", 86400) viper.SetDefault("erc4337_bundler_min_stake_value", 2000000000000000) - viper.SetDefault("erc4337_same_sender_mempool_count", 4) - viper.SetDefault("erc4337_same_unstaked_entity_mempool_count", 11) - viper.SetDefault("erc4337_throttled_entity_mempool_count", 4) - viper.SetDefault("erc4337_throttled_entity_live_blocks", 10) - viper.SetDefault("erc4337_throttled_entity_bundle_count", 4) - viper.SetDefault("erc4337_min_inclusion_rate_denominator", 10) - viper.SetDefault("erc4337_inclusion_rate_factor", 10) - viper.SetDefault("erc4337_throttling_slack", 10) - viper.SetDefault("erc4337_ban_slack", 50) + viper.SetDefault("erc4337_bundler_same_sender_mempool_count", 4) + viper.SetDefault("erc4337_bundler_same_unstaked_entity_mempool_count", 11) + viper.SetDefault("erc4337_bundler_throttled_entity_mempool_count", 4) + viper.SetDefault("erc4337_bundler_throttled_entity_live_blocks", 10) + viper.SetDefault("erc4337_bundler_throttled_entity_bundle_count", 4) + viper.SetDefault("erc4337_bundler_min_inclusion_rate_denominator", 10) + viper.SetDefault("erc4337_bundler_inclusion_rate_factor", 10) + viper.SetDefault("erc4337_bundler_throttling_slack", 10) + viper.SetDefault("erc4337_bundler_ban_slack", 50) _ = viper.BindEnv("erc4337_bundler_min_unstake_delay") _ = viper.BindEnv("erc4337_bundler_min_stake_value") - _ = viper.BindEnv("erc4337_same_sender_mempool_count") - _ = viper.BindEnv("erc4337_same_unstaked_entity_mempool_count") - _ = viper.BindEnv("erc4337_throttled_entity_mempool_count") - _ = viper.BindEnv("erc4337_throttled_entity_live_blocks") - _ = viper.BindEnv("erc4337_throttled_entity_bundle_count") - _ = viper.BindEnv("erc4337_min_inclusion_rate_denominator") - _ = viper.BindEnv("erc4337_inclusion_rate_factor") - _ = viper.BindEnv("erc4337_throttling_slack") - _ = viper.BindEnv("erc4337_ban_slack") + _ = viper.BindEnv("erc4337_bundler_same_sender_mempool_count") + _ = viper.BindEnv("erc4337_bundler_same_unstaked_entity_mempool_count") + _ = viper.BindEnv("erc4337_bundler_throttled_entity_mempool_count") + _ = viper.BindEnv("erc4337_bundler_throttled_entity_live_blocks") + _ = viper.BindEnv("erc4337_bundler_throttled_entity_bundle_count") + _ = viper.BindEnv("erc4337_bundler_min_inclusion_rate_denominator") + _ = viper.BindEnv("erc4337_bundler_inclusion_rate_factor") + _ = viper.BindEnv("erc4337_bundler_throttling_slack") + _ = viper.BindEnv("erc4337_bundler_ban_slack") return &entities.ReputationConstants{ MinUnstakeDelay: viper.GetInt("erc4337_bundler_min_unstake_delay"), MinStakeValue: viper.GetInt64("erc4337_bundler_min_stake_value"), - SameSenderMempoolCount: viper.GetInt("erc4337_same_sender_mempool_count"), - SameUnstakedEntityMempoolCount: viper.GetInt("erc4337_same_unstaked_entity_mempool_count"), - ThrottledEntityMempoolCount: viper.GetInt("erc4337_throttled_entity_mempool_count"), - ThrottledEntityLiveBlocks: viper.GetInt("erc4337_throttled_entity_live_blocks"), - ThrottledEntityBundleCount: viper.GetInt("erc4337_throttled_entity_bundle_count"), - MinInclusionRateDenominator: viper.GetInt("erc4337_min_inclusion_rate_denominator"), - InclusionRateFactor: viper.GetInt("erc4337_inclusion_rate_factor"), - ThrottlingSlack: viper.GetInt("erc4337_throttling_slack"), - BanSlack: viper.GetInt("erc4337_ban_slack"), + SameSenderMempoolCount: viper.GetInt("erc4337_bundler_same_sender_mempool_count"), + SameUnstakedEntityMempoolCount: viper.GetInt("erc4337_bundler_same_unstaked_entity_mempool_count"), + ThrottledEntityMempoolCount: viper.GetInt("erc4337_bundler_throttled_entity_mempool_count"), + ThrottledEntityLiveBlocks: viper.GetInt("erc4337_bundler_throttled_entity_live_blocks"), + ThrottledEntityBundleCount: viper.GetInt("erc4337_bundler_throttled_entity_bundle_count"), + MinInclusionRateDenominator: viper.GetInt("erc4337_bundler_min_inclusion_rate_denominator"), + InclusionRateFactor: viper.GetInt("erc4337_bundler_inclusion_rate_factor"), + ThrottlingSlack: viper.GetInt("erc4337_bundler_throttling_slack"), + BanSlack: viper.GetInt("erc4337_bundler_ban_slack"), } }