From 75e2bfccc01cae5724be4e1ee788dc1da0c0677e Mon Sep 17 00:00:00 2001 From: Luke Imhoff Date: Thu, 19 Jul 2018 15:13:47 -0500 Subject: [PATCH] realtime_interval -> block_interval / 2 The realtime_interval should be half of the block_interval to ensure that we don't get stuck in a state where we just miss a new block because using precisely the block rate doesn't account for processing time. The exact value of half the block_interval was chosen for the Nyquist rules. --- apps/indexer/lib/indexer/block_fetcher.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/indexer/lib/indexer/block_fetcher.ex b/apps/indexer/lib/indexer/block_fetcher.ex index b18db11a7d..34f717d576 100644 --- a/apps/indexer/lib/indexer/block_fetcher.ex +++ b/apps/indexer/lib/indexer/block_fetcher.ex @@ -71,7 +71,7 @@ defmodule Indexer.BlockFetcher do json_rpc_named_arguments: Keyword.fetch!(opts, :json_rpc_named_arguments), genesis_task: nil, realtime_task: nil, - realtime_interval: opts[:block_interval] || @block_interval, + realtime_interval: div(opts[:block_interval] || @block_interval, 2), starting_block_number: nil, blocks_batch_size: Keyword.get(opts, :blocks_batch_size, @blocks_batch_size), blocks_concurrency: Keyword.get(opts, :blocks_concurrency, @blocks_concurrency),