ethereum / ethereum/execution-specs
Avoid converting to `int` in `calculate_block_difficulty`
Open
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
Assessment
This issue has not been assessed yet.