Skip to content
This repository has been archived by the owner on Oct 20, 2024. It is now read-only.

Commit

Permalink
Consistent env var names for reputation constants
Browse files Browse the repository at this point in the history
  • Loading branch information
hazim-j committed Jan 26, 2024
1 parent 42b7da5 commit 5ea0cf0
Showing 1 changed file with 27 additions and 27 deletions.
54 changes: 27 additions & 27 deletions internal/config/mempool.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
}
}

0 comments on commit 5ea0cf0

Please sign in to comment.