Skip to content

Commit 80a0d4b

Browse files
incrypto32Zoran Cvetkov
authored andcommitted
chain/ethereum: Add block_ptr_batch_size env variable
1 parent eb1cb5d commit 80a0d4b

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

chain/ethereum/src/env.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ pub struct EnvVars {
3333
/// Set by the environment variable `ETHEREUM_BLOCK_BATCH_SIZE`. The
3434
/// default value is 10 blocks.
3535
pub block_batch_size: usize,
36+
/// Set by the environment variable `ETHEREUM_BLOCK_PTR_BATCH_SIZE`. The
37+
/// default value is 10 blocks.
38+
pub block_ptr_batch_size: usize,
3639
/// Maximum number of blocks to request in each chunk.
3740
///
3841
/// Set by the environment variable `GRAPH_ETHEREUM_MAX_BLOCK_RANGE_SIZE`.
@@ -116,6 +119,7 @@ impl From<Inner> for EnvVars {
116119
trace_stream_step_size: x.trace_stream_step_size,
117120
max_event_only_range: x.max_event_only_range,
118121
block_batch_size: x.block_batch_size,
122+
block_ptr_batch_size: x.block_ptr_batch_size,
119123
max_block_range_size: x.max_block_range_size,
120124
json_rpc_timeout: Duration::from_secs(x.json_rpc_timeout_in_secs),
121125
block_receipts_check_timeout: Duration::from_secs(
@@ -160,6 +164,8 @@ struct Inner {
160164
max_event_only_range: BlockNumber,
161165
#[envconfig(from = "ETHEREUM_BLOCK_BATCH_SIZE", default = "10")]
162166
block_batch_size: usize,
167+
#[envconfig(from = "ETHEREUM_BLOCK_PTR_BATCH_SIZE", default = "100")]
168+
block_ptr_batch_size: usize,
163169
#[envconfig(from = "GRAPH_ETHEREUM_MAX_BLOCK_RANGE_SIZE", default = "2000")]
164170
max_block_range_size: BlockNumber,
165171
#[envconfig(from = "GRAPH_ETHEREUM_JSON_RPC_TIMEOUT", default = "180")]

chain/ethereum/src/ethereum_adapter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -829,7 +829,7 @@ impl EthereumAdapter {
829829
.compat()
830830
.from_err()
831831
}))
832-
.buffered(ENV_VARS.block_batch_size)
832+
.buffered(ENV_VARS.block_ptr_batch_size)
833833
}
834834

835835
/// Request blocks ptrs for numbers through JSON-RPC.

0 commit comments

Comments
 (0)