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
2 changes: 2 additions & 0 deletions configs/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ type Config struct {
RedisDB int `env:"REDIS_DB" envDefault:"0"`
ValidationMode string `env:"VALIDATION_MODE" envDefault:"minimal"`
EnableReorgValidation bool `env:"ENABLE_REORG_VALIDATION" envDefault:"true"`
// ReorgLagByBlocks keeps reorg validation this many ClickHouse blocks behind the latest committed block.
ReorgLagByBlocks uint64 `env:"REORG_LAG_BY_BLOCKS" envDefault:"500"`
// ReorgAPIListenAddr is the bind address for the manual reorg publish HTTP server (reorg-api command).
ReorgAPIListenAddr string `env:"REORG_API_LISTEN_ADDR" envDefault:":8080"`
// ReorgAPIKey, when non-empty, requires requests to send Authorization: Bearer <ReorgAPIKey>.
Expand Down
2 changes: 1 addition & 1 deletion internal/committer/reorg.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func getReorgRange() (int64, int64, error) {
return 0, 0, fmt.Errorf("failed to get max block number: %w", err)
}

endBlock = min(endBlock-500, startBlock+100) // lag by some blocks for safety
endBlock = min(endBlock-int64(config.Cfg.ReorgLagByBlocks), startBlock+100)

if startBlock >= endBlock {
return 0, 0, fmt.Errorf("start block is greater than end block (%d >= %d)", startBlock, endBlock)
Expand Down
Loading