Skip to content

Commit b8be8e4

Browse files
committed
committer rpc parallel calls env
1 parent 7466bc9 commit b8be8e4

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

configs/config.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,7 @@ type Config struct {
288288
StagingS3AccessKeyID string `env:"STAGING_S3_ACCESS_KEY_ID"`
289289
StagingS3SecretAccessKey string `env:"STAGING_S3_SECRET_ACCESS_KEY"`
290290
StagingS3MaxParallelFileDownload int `env:"STAGING_S3_MAX_PARALLEL_FILE_DOWNLOAD" envDefault:"2"`
291+
CommitterRPCNumParallelCalls int64 `env:"COMMITTER_RPC_NUM_PARALLEL_CALLS" envDefault:"10"`
291292
}
292293

293294
var Cfg Config

internal/committer/committer.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -726,15 +726,14 @@ func fetchLatest(nextCommitBlockNumber *big.Int) error {
726726
continue
727727
}
728728

729-
// Configuration variables
730-
rpcBatchSize := int64(50) // Number of blocks per batch
731-
rpcNumParallelCalls := int64(10) // Maximum number of parallel RPC calls
732-
maxBlocksPerFetch := rpcBatchSize * rpcNumParallelCalls // Total blocks per fetch cycle
729+
rpcNumParallelCalls := config.Cfg.CommitterRPCNumParallelCalls
730+
rpcBatchSize := int64(50)
731+
maxBlocksPerFetch := rpcBatchSize * rpcNumParallelCalls
733732

734733
// Calculate the range of blocks to fetch
735734
blocksToFetch := new(big.Int).Sub(latestBlock, nextCommitBlockNumber)
736735
if blocksToFetch.Cmp(big.NewInt(maxBlocksPerFetch)) > 0 {
737-
blocksToFetch = big.NewInt(maxBlocksPerFetch) // Limit to maxBlocksPerFetch blocks per batch
736+
blocksToFetch = big.NewInt(maxBlocksPerFetch)
738737
}
739738

740739
log.Info().

0 commit comments

Comments
 (0)