Skip to content

Part 3 - pow: remove pyethash C extension, always use pure Python ethash#973

Open
ping-ke wants to merge 6 commits intoupgrade/py313-baselinefrom
upgrade/ethash
Open

Part 3 - pow: remove pyethash C extension, always use pure Python ethash#973
ping-ke wants to merge 6 commits intoupgrade/py313-baselinefrom
upgrade/ethash

Conversation

@ping-ke
Copy link
Copy Markdown
Contributor

@ping-ke ping-ke commented Mar 15, 2026

Summary

pyethash is a C++ extension that is not compatible with Python 3.13. The pure Python implementation in ethereum.pow.ethash is sufficient. Remove the conditional import and always use the Python path, adding @lru_cache to get_cache_slow for the same performance benefit.

Test plan

  • Mining and PoW verification still pass in existing tests
  • No ImportError on Python 3.13

pyethash is a C++ extension that is not compatible with Python 3.13.
The pure Python implementation in ethereum.pow.ethash is sufficient.
Remove the conditional import and always use the Python path, adding
@lru_cache to get_cache_slow for the same performance benefit.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
ping-ke added 2 commits March 30, 2026 23:22
Add comment explaining why pyethash C++ acceleration was removed
(not supported on Python 3.13) with link to #976
@ping-ke ping-ke changed the base branch from upgrade/py313-baseline to master April 5, 2026 02:37
@ping-ke ping-ke changed the base branch from master to upgrade/py313-baseline April 5, 2026 02:37
@ping-ke ping-ke requested a review from syntrust April 5, 2026 02:38
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