Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions configs/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ type Config struct {
RedisPassword string `env:"REDIS_PASSWORD"`
RedisDB int `env:"REDIS_DB" envDefault:"0"`
ValidationMode string `env:"VALIDATION_MODE" envDefault:"minimal"`
EnableReorgValidation bool `env:"ENABLE_REORG_VALIDATION" envDefault:"true"`
}

var Cfg Config
Expand Down
3 changes: 3 additions & 0 deletions internal/committer/reorg.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ func RunReorgValidator() {
if !config.Cfg.CommitterIsLive {
return
}
if !config.Cfg.EnableReorgValidation {
return
}

lastBlockCheck := int64(0)
for {
Expand Down
2 changes: 1 addition & 1 deletion internal/libs/clickhouse.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ func GetBlockHeadersForReorgCheck(chainId uint64, startBlockNumber uint64, endBl
length := endBlockNumber - startBlockNumber + 1
blocksRaw := make([]*common.Block, length)

query := fmt.Sprintf("SELECT block_number, hash, parent_hash FROM %s.blocks FINAL WHERE chain_id = %d AND block_number BETWEEN %d AND %d order by block_number",
query := fmt.Sprintf("SELECT chain_id, block_number, hash, parent_hash FROM %s.blocks WHERE chain_id = %d AND block_number BETWEEN %d AND %d order by block_number",
config.Cfg.CommitterClickhouseDatabase,
chainId,
startBlockNumber,
Expand Down