ethereum / ethereum/execution-specs

Avoid converting to `int` in `calculate_block_difficulty`

Open
#1,415 7 comments 0 reactions 0 assignees View on GitHub
A-spec-specs C-feat E-easy P-low stale
Dominant language
Python
Stars
1.2k
Forks
505
Avg merge
2d 14h
Merged PRs (30d)
116

Description

In pre-merge forks, the [`calculate_block_difficulty`](https://github.com/ethereum/execution-specs/blob/e68bc580de7ef921d1b1d741075f0460fc875fe4/src/ethereum/gray_glacier/fork.py#L873) function converts to `int` before doing the calculations.

Ideally, we should try and use types from `ethereum-types` whenever possible to indicate the intended signedness and bitwidth.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.