diff --git a/contract-watcher/cmd/service/run.go b/contract-watcher/cmd/service/run.go index ed9dfe6fc..b648f770e 100644 --- a/contract-watcher/cmd/service/run.go +++ b/contract-watcher/cmd/service/run.go @@ -49,6 +49,7 @@ type watchersConfig struct { moonbeam *config.WatcherBlockchainAddresses oasis *config.WatcherBlockchainAddresses optimism *config.WatcherBlockchainAddresses + polygon *config.WatcherBlockchainAddresses solana *config.WatcherBlockchain terra *config.WatcherBlockchain rateLimit rateLimitConfig @@ -65,6 +66,7 @@ type rateLimitConfig struct { moonbeam int oasis int optimism int + polygon int solana int terra int } @@ -234,13 +236,18 @@ func newWatchers(config *config.ServiceConfiguration, repo *storage.Repository, result = append(result, baseWatcher) } + // add polygon watcher + if watchers.polygon != nil { + polygonWatcher := builder.CreateEvmWatcher(watchers.rateLimit.polygon, config.PolygonUrl, *watchers.polygon, logger, repo, metrics) + result = append(result, polygonWatcher) + } + return result } func newWatchersForMainnet(cfg *config.ServiceConfiguration) *watchersConfig { return &watchersConfig{ ankr: []config.WatcherBlockchainAddresses{ - config.POLYGON_MAINNET, config.BSC_MAINNET, config.FANTOM_MAINNET, }, @@ -253,6 +260,7 @@ func newWatchersForMainnet(cfg *config.ServiceConfiguration) *watchersConfig { moonbeam: &config.MOONBEAM_MAINNET, oasis: &config.OASIS_MAINNET, optimism: &config.OPTIMISM_MAINNET, + polygon: &config.POLYGON_MAINNET, solana: &config.SOLANA_MAINNET, terra: &config.TERRA_MAINNET, @@ -267,6 +275,7 @@ func newWatchersForMainnet(cfg *config.ServiceConfiguration) *watchersConfig { moonbeam: cfg.MoonbeamRequestsPerSecond, oasis: cfg.OasisRequestsPerSecond, optimism: cfg.OptimismRequestsPerSecond, + polygon: cfg.PolygonRequestsPerSecond, solana: cfg.SolanaRequestsPerSecond, terra: cfg.TerraRequestsPerSecond, }, @@ -276,7 +285,6 @@ func newWatchersForMainnet(cfg *config.ServiceConfiguration) *watchersConfig { func newWatchersForTestnet(cfg *config.ServiceConfiguration) *watchersConfig { return &watchersConfig{ ankr: []config.WatcherBlockchainAddresses{ - config.POLYGON_TESTNET, config.BSC_TESTNET, config.FANTOM_TESTNET, }, @@ -289,6 +297,7 @@ func newWatchersForTestnet(cfg *config.ServiceConfiguration) *watchersConfig { moonbeam: &config.MOONBEAM_TESTNET, oasis: &config.OASIS_TESTNET, optimism: &config.OPTIMISM_TESTNET, + polygon: &config.POLYGON_TESTNET, solana: &config.SOLANA_TESTNET, rateLimit: rateLimitConfig{ ankr: cfg.AnkrRequestsPerSecond, @@ -301,6 +310,7 @@ func newWatchersForTestnet(cfg *config.ServiceConfiguration) *watchersConfig { moonbeam: cfg.MoonbeamRequestsPerSecond, oasis: cfg.OasisRequestsPerSecond, optimism: cfg.OptimismRequestsPerSecond, + polygon: cfg.PolygonRequestsPerSecond, solana: cfg.SolanaRequestsPerSecond, terra: cfg.TerraRequestsPerSecond, }, diff --git a/contract-watcher/config/config.go b/contract-watcher/config/config.go index 6d184d5bc..129b7e32e 100644 --- a/contract-watcher/config/config.go +++ b/contract-watcher/config/config.go @@ -39,6 +39,8 @@ type ServiceConfiguration struct { OptimismRequestsPerSecond int `env:"OPTIMISM_REQUESTS_PER_SECOND,required"` OasisUrl string `env:"OASIS_URL,required"` OasisRequestsPerSecond int `env:"OASIS_REQUESTS_PER_SECOND,required"` + PolygonUrl string `env:"POLYGON_URL,required"` + PolygonRequestsPerSecond int `env:"POLYGON_REQUESTS_PER_SECOND,required"` SolanaUrl string `env:"SOLANA_URL,required"` SolanaRequestsPerSecond int `env:"SOLANA_REQUESTS_PER_SECOND,required"` TerraUrl string `env:"TERRA_URL,required"` diff --git a/contract-watcher/watcher/terra_watcher.go b/contract-watcher/watcher/terra_watcher.go index 86c20e429..a31b62a68 100644 --- a/contract-watcher/watcher/terra_watcher.go +++ b/contract-watcher/watcher/terra_watcher.go @@ -112,7 +112,7 @@ func (w *TerraWatcher) Start(ctx context.Context) error { w.repository.UpdateWatcherBlock(ctx, w.chainID, watcherBlock) } } else { - w.logger.Info("waiting for new terra blocks") + w.logger.Debug("waiting for new terra blocks") select { case <-ctx.Done(): w.wg.Done() diff --git a/deploy/contract-watcher/contract-watcher-service.yaml b/deploy/contract-watcher/contract-watcher-service.yaml index f8bb65534..54aa2fb90 100644 --- a/deploy/contract-watcher/contract-watcher-service.yaml +++ b/deploy/contract-watcher/contract-watcher-service.yaml @@ -144,6 +144,13 @@ spec: key: avalanche-url - name: AVALANCHE_REQUESTS_PER_SECOND value: "{{ .AVALANCHE_REQUESTS_PER_SECOND }}" + - name: POLYGON_URL + valueFrom: + secretKeyRef: + name: blockchain + key: polygon-url + - name: POLYGON_REQUESTS_PER_SECOND + value: "{{ .POLYGON_REQUESTS_PER_SECOND }}" - name: ALERT_API_KEY valueFrom: secretKeyRef: diff --git a/deploy/contract-watcher/env/production-mainnet.env b/deploy/contract-watcher/env/production-mainnet.env index b16265c2a..0664fdb22 100644 --- a/deploy/contract-watcher/env/production-mainnet.env +++ b/deploy/contract-watcher/env/production-mainnet.env @@ -29,6 +29,8 @@ OASIS_URL= OASIS_REQUESTS_PER_SECOND=3 OPTIMISM_URL= OPTIMISM_REQUESTS_PER_SECOND=3 +POLYGON_URL= +POLYGON_REQUESTS_PER_SECOND=3 SOLANA_URL= SOLANA_REQUESTS_PER_SECOND=20 TERRA_URL= diff --git a/deploy/contract-watcher/env/production-testnet.env b/deploy/contract-watcher/env/production-testnet.env index 71a236f47..5b6a14275 100644 --- a/deploy/contract-watcher/env/production-testnet.env +++ b/deploy/contract-watcher/env/production-testnet.env @@ -23,12 +23,14 @@ CELO_URL= CELO_REQUESTS_PER_SECOND=20 ETHEREUM_URL= ETHEREUM_REQUESTS_PER_SECOND=2 +MOONBEAM_URL= +MOONBEAM_REQUESTS_PER_SECOND=2 OASIS_URL= OASIS_REQUESTS_PER_SECOND=1 OPTIMISM_URL= OPTIMISM_REQUESTS_PER_SECOND=1 -MOONBEAM_URL= -MOONBEAM_REQUESTS_PER_SECOND=2 +POLYGON_URL= +POLYGON_REQUESTS_PER_SECOND=3 SOLANA_URL= SOLANA_REQUESTS_PER_SECOND=2 TERRA_URL= diff --git a/deploy/contract-watcher/env/staging-mainnet.env b/deploy/contract-watcher/env/staging-mainnet.env index 2576a1979..0f9a4b500 100644 --- a/deploy/contract-watcher/env/staging-mainnet.env +++ b/deploy/contract-watcher/env/staging-mainnet.env @@ -14,7 +14,7 @@ ANKR_REQUESTS_PER_SECOND=1000 APTOS_URL= APTOS_REQUESTS_PER_SECOND=20 ARBITRUM_URL= -ARBITRUM_REQUESTS_PER_SECOND=3 +ARBITRUM_REQUESTS_PER_SECOND=5 AVALANCHE_URL= AVALANCHE_REQUESTS_PER_SECOND=5 BASE_URL= @@ -29,6 +29,8 @@ OASIS_URL= OASIS_REQUESTS_PER_SECOND=3 OPTIMISM_URL= OPTIMISM_REQUESTS_PER_SECOND=3 +POLYGON_URL= +POLYGON_REQUESTS_PER_SECOND=3 SOLANA_URL= SOLANA_REQUESTS_PER_SECOND=20 TERRA_URL= diff --git a/deploy/contract-watcher/env/staging-testnet.env b/deploy/contract-watcher/env/staging-testnet.env index a7777d046..d6e1ff817 100644 --- a/deploy/contract-watcher/env/staging-testnet.env +++ b/deploy/contract-watcher/env/staging-testnet.env @@ -23,12 +23,14 @@ CELO_URL= CELO_REQUESTS_PER_SECOND=20 ETHEREUM_URL= ETHEREUM_REQUESTS_PER_SECOND=2 +MOONBEAM_URL= +MOONBEAM_REQUESTS_PER_SECOND=2 OASIS_URL= OASIS_REQUESTS_PER_SECOND=1 OPTIMISM_URL= OPTIMISM_REQUESTS_PER_SECOND=1 -MOONBEAM_URL= -MOONBEAM_REQUESTS_PER_SECOND=2 +POLYGON_URL= +POLYGON_REQUESTS_PER_SECOND=3 SOLANA_URL= SOLANA_REQUESTS_PER_SECOND=2 TERRA_URL= diff --git a/deploy/contract-watcher/secrets.yaml b/deploy/contract-watcher/secrets.yaml index e262eabd5..52ffe71eb 100644 --- a/deploy/contract-watcher/secrets.yaml +++ b/deploy/contract-watcher/secrets.yaml @@ -17,4 +17,5 @@ data: ethereum-url: {{ .ETHEREUM_URL | b64enc }} avalanche-url: {{ .AVALANCHE_URL | b64enc }} base-url: {{ .BASE_URL | b64enc }} + polygon-url: {{ .POLYGON_URL | b64enc }} type: Opaque