Skip to content

Commit

Permalink
Add rounding
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeny-stakewise committed Mar 14, 2024
1 parent 63fea80 commit cda47bc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/common/execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down

0 comments on commit cda47bc

Please sign in to comment.