From fe49a753d356139928175fd4f6b613a3cc6794c0 Mon Sep 17 00:00:00 2001 From: Luke Imhoff Date: Thu, 19 Jul 2018 15:09:57 -0500 Subject: [PATCH] block_rate -> block_interval block_rate is measured in milliseconds / block, but a rate would blocks / unit-time, so rename block_rate to block_interval to reflect it is the interval between blocks. --- apps/indexer/config/dev/geth.exs | 2 +- apps/indexer/config/dev/parity.exs | 2 +- apps/indexer/config/prod/geth.exs | 2 +- apps/indexer/config/prod/parity.exs | 2 +- apps/indexer/lib/indexer/block_fetcher.ex | 7 ++++--- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/apps/indexer/config/dev/geth.exs b/apps/indexer/config/dev/geth.exs index c668c4942b..ec004dbb88 100644 --- a/apps/indexer/config/dev/geth.exs +++ b/apps/indexer/config/dev/geth.exs @@ -1,7 +1,7 @@ use Mix.Config config :indexer, - block_rate: 5_000, + block_interval: 5_000, json_rpc_named_arguments: [ transport: EthereumJSONRPC.HTTP, transport_options: [ diff --git a/apps/indexer/config/dev/parity.exs b/apps/indexer/config/dev/parity.exs index fb8b0ef7a0..eaced127e3 100644 --- a/apps/indexer/config/dev/parity.exs +++ b/apps/indexer/config/dev/parity.exs @@ -1,7 +1,7 @@ use Mix.Config config :indexer, - block_rate: 5_000, + block_interval: 5_000, json_rpc_named_arguments: [ transport: EthereumJSONRPC.HTTP, transport_options: [ diff --git a/apps/indexer/config/prod/geth.exs b/apps/indexer/config/prod/geth.exs index c668c4942b..ec004dbb88 100644 --- a/apps/indexer/config/prod/geth.exs +++ b/apps/indexer/config/prod/geth.exs @@ -1,7 +1,7 @@ use Mix.Config config :indexer, - block_rate: 5_000, + block_interval: 5_000, json_rpc_named_arguments: [ transport: EthereumJSONRPC.HTTP, transport_options: [ diff --git a/apps/indexer/config/prod/parity.exs b/apps/indexer/config/prod/parity.exs index fb8b0ef7a0..eaced127e3 100644 --- a/apps/indexer/config/prod/parity.exs +++ b/apps/indexer/config/prod/parity.exs @@ -1,7 +1,7 @@ use Mix.Config config :indexer, - block_rate: 5_000, + block_interval: 5_000, json_rpc_named_arguments: [ transport: EthereumJSONRPC.HTTP, transport_options: [ diff --git a/apps/indexer/lib/indexer/block_fetcher.ex b/apps/indexer/lib/indexer/block_fetcher.ex index 8b604b5556..b18db11a7d 100644 --- a/apps/indexer/lib/indexer/block_fetcher.ex +++ b/apps/indexer/lib/indexer/block_fetcher.ex @@ -23,7 +23,7 @@ defmodule Indexer.BlockFetcher do @blocks_concurrency 10 # milliseconds - @block_rate 5_000 + @block_interval 5_000 @receipts_batch_size 250 @receipts_concurrency 10 @@ -45,7 +45,8 @@ defmodule Indexer.BlockFetcher do Defaults to #{@blocks_concurrency}. So upto `blocks_concurrency * block_batch_size` (defaults to `#{@blocks_concurrency * @blocks_batch_size}`) blocks can be requested from the JSONRPC at once over all connections. - * `:block_rate` - The millisecond rate new blocks are published at. Defaults to `#{@block_rate}` milliseconds. + * `:block_interval` - The number of milliseconds between new blocks being published. Defaults to + `#{@block_interval}` milliseconds. * `:receipts_batch_size` - The number of receipts to request in one call to the JSONRPC. Defaults to `#{@receipts_batch_size}`. Receipt requests also include the logs for when the transaction was collated into the block. *These logs are not paginated.* @@ -70,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_rate] || @block_rate, + realtime_interval: opts[:block_interval] || @block_interval, 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),