From b28b5716417f863fb23135e5ebc0303cd7c55312 Mon Sep 17 00:00:00 2001 From: Dmytro Date: Mon, 8 Jul 2024 16:33:37 +0100 Subject: [PATCH 1/2] Hotfix for testnets --- metrics/src/gas.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/metrics/src/gas.py b/metrics/src/gas.py index 72e918c..ccec8eb 100644 --- a/metrics/src/gas.py +++ b/metrics/src/gas.py @@ -39,6 +39,9 @@ def calc_avg_gas_price(): logger.info(f'Getting historic block gas prices...') for index in range(GAS_ESTIMATION_ITERATIONS): block_number = block_number - BLOCK_SAMPLING * index + if (block_number < 0): + break + logger.info(f'Getting block {block_number}...') block = w3.eth.get_block(block_number) total_gas_used += block['baseFeePerGas'] From ccf2b33891e16768835cd9b544632720fb90bcf5 Mon Sep 17 00:00:00 2001 From: Dmytro Date: Mon, 8 Jul 2024 16:52:48 +0100 Subject: [PATCH 2/2] Hotfix for testnets --- metrics/src/gas.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metrics/src/gas.py b/metrics/src/gas.py index ccec8eb..ab3c5b7 100644 --- a/metrics/src/gas.py +++ b/metrics/src/gas.py @@ -39,7 +39,7 @@ def calc_avg_gas_price(): logger.info(f'Getting historic block gas prices...') for index in range(GAS_ESTIMATION_ITERATIONS): block_number = block_number - BLOCK_SAMPLING * index - if (block_number < 0): + if block_number < 0: break logger.info(f'Getting block {block_number}...') block = w3.eth.get_block(block_number)