Skip to content

Conversation

@omegajudith
Copy link

  • Removes all int() casts
  • No new variables
  • All comments preserved
  • 2**num_bomb_periods kept
  • Behavior unchanged
  • All py3 tests pass

…hereum#1415)

- Remove all int() casts
- No new variables
- All comments preserved
- Behavior unchanged
- All py3 tests pass
@omegajudith
Copy link
Author

omegajudith commented Oct 26, 2025

@bomanaps

@omegajudith
Copy link
Author

@SamWilsn

@bomanaps
Copy link
Contributor

Hello @SamWilsn @Carsons-Eels Please we need a review on this pr still a work in progress and trying to take it one file at a time.

@bomanaps
Copy link
Contributor

I have a question @SamWilsn How should we properly fix the ethereum-types stub files to declare these operations (like Uint.__floordiv__, U256.__floordiv__, Uint.__sub__) so @omegajudith can test her changes with mypy passing?
Wants the ideal way to go about this?

@SamWilsn
Copy link
Contributor

The ethereum-types package is fully typed. There should not be any stubs. How are you running mypy?

@bomanaps
Copy link
Contributor

The ethereum-types package is fully typed. There should not be any stubs. How are you running mypy?

This is from the tox run I did - src/ethereum/forks/homestead/fork.py:769: error: Unsupported operand types for // ("Uint" and "int")
src/ethereum/forks/homestead/fork.py:770: error: Unsupported operand types for // ("U256" and "int")
src/ethereum/forks/homestead/fork.py:778: error: Unsupported operand types for // ("Uint" and "int")

@bomanaps
Copy link
Contributor

And this is the command uvx tox -e static please am I missing a step?

@SamWilsn
Copy link
Contributor

SamWilsn commented Oct 29, 2025

Ah, that error is correct. You cannot use // with U256 and int. You need to convert the int into to a U256. Something like U256(123) // U256(456).

@bomanaps
Copy link
Contributor

Ah, that error is correct. You cannot use // with U256 and int. You need to convert the int into to a U256. Something like U256(123) // U256(456).

Ooh okay so our fix for example should be parent_difficulty // Uint(2048) (block_timestamp - parent_timestamp) // U256(10)

@omegajudith
Copy link
Author

@gurukamath , @SamWilsn

@omegajudith
Copy link
Author

@SamWilsn , @bomanaps , @gurukamath , please help me review

thank u

@omegajudith omegajudith marked this pull request as ready for review October 31, 2025 23:26
@omegajudith omegajudith marked this pull request as draft October 31, 2025 23:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants