From cda47bc0b3f9b5684abaf357cd4b64f9d38ea770 Mon Sep 17 00:00:00 2001 From: Evgeny Gusarov Date: Thu, 14 Mar 2024 19:41:46 +0300 Subject: [PATCH] Add rounding --- src/common/execution.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/common/execution.py b/src/common/execution.py index 50747074..443c874a 100644 --- a/src/common/execution.py +++ b/src/common/execution.py @@ -179,6 +179,11 @@ async def _calc_high_priority_fee() -> Wei: history = await execution_client.eth.fee_history(num_blocks, 'pending', [percentile]) validator_rewards = [r[0] for r in history['reward']] mean_reward = int(sum(validator_rewards) / len(validator_rewards)) + + # prettify `mean_reward` + # same as `round(value, 1)` if value was in gwei + mean_reward = round(mean_reward, -8) + return Wei(mean_reward)