Skip to content

Commit

Permalink
remove checks for config values as it is handled in validateBasic()
Browse files Browse the repository at this point in the history
  • Loading branch information
yan-soon committed Dec 9, 2024
1 parent e4416f2 commit 79b5899
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions oracle/service/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (

log "github.com/sirupsen/logrus"

Check failure on line 10 in oracle/service/runner/runner.go

View workflow job for this annotation

GitHub Actions / golangci-lint

import 'github.com/sirupsen/logrus' is not allowed from list 'main' (depguard)

"github.com/cometbft/cometbft/config"
"github.com/cometbft/cometbft/oracle/service/types"
"github.com/cometbft/cometbft/oracle/service/utils"

Expand Down Expand Up @@ -100,25 +99,12 @@ func ProcessSignVoteQueue(oracleInfo *types.OracleInfo, chainId string) {

func PruneVoteBuffers(oracleInfo *types.OracleInfo, consensusState *cs.State) {
go func(oracleInfo *types.OracleInfo) {
defaultOracleConfig := config.DefaultOracleConfig()

// only keep votes that are less than x blocks old, where x = Config.MaxOracleGossipBlocksDelayed
maxOracleGossipBlocksDelayed := oracleInfo.Config.MaxOracleGossipBlocksDelayed
if maxOracleGossipBlocksDelayed == 0 {
maxOracleGossipBlocksDelayed = defaultOracleConfig.MaxOracleGossipBlocksDelayed
}

// only keep votes that are less than x seconds old, where x = Config.MaxOracleGossipAge
maxOracleGossipAge := oracleInfo.Config.MaxOracleGossipAge
if maxOracleGossipAge == 0 {
maxOracleGossipAge = defaultOracleConfig.MaxOracleGossipAge
}

// run pruner every x milliseconds, where x = Config.PruneInterval
pruneInterval := oracleInfo.Config.PruneInterval
if pruneInterval == 0 {
pruneInterval = defaultOracleConfig.PruneInterval
}

ticker := time.Tick(pruneInterval)
for range ticker {
Expand Down

0 comments on commit 79b5899

Please sign in to comment.