• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

safe-global / safe-eth-py / 45613737965
94%

Build:
DEFAULT BRANCH: main
Ran 25 Nov 2026 12:28PM UTC
Jobs 5
Files 129
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

25 Nov 2026 12:26PM UTC coverage: 94.214% (+0.2%) from 94.026%
45613737965

push

github

web-flow
feat: add optional native extension for ecrecover, P-256, keccak and checksums (#2861)

* feat: add optional native extension for ecrecover, P-256, keccak and checksums

Add `native/`, a Rust (PyO3) package published as `safe-eth-native`, and
the `native` extra (`safe-eth-py[native]`) to install it.

When it is installed:
- `get_signing_address` recovers with libsecp256k1 (~25 us instead of
  ~3.5 ms with the pure Python eth-keys backend on Python 3.14)
- `p256.verify` uses RustCrypto p256 (~125 us instead of ~2.6 ms)
- `fast_keccak`, `fast_keccak_hex` and the checksum helpers use the
  native keccak256 and EIP-55 code (10-14x faster checksums)
- the native keccak256 also replaces the eth-hash one, used by web3,
  eth-utils and eth-account, unless `ETH_HASH_BACKEND` is set

Without the extra, the Python code is used as before. Both paths return
the same values and raise the same errors, and the tests run every helper
with and without the extension.

`fast_bytes_to_checksum_address` now raises `ValueError` for a buffer with
items wider than one byte (for example `array("H")`), where it returned a
wrong address.

The extension has one abi3 wheel for CPython 3.11+ and wheels for
free-threaded 3.14t and 3.15t. `.github/workflows/native.yml` builds and
tests them on Linux (glibc and musl), macOS and Windows, and publishes
them on a `native-v*` tag.

* chore: publish with the PIPY_SAFE_ETH_TOKEN and PIPY_SAFE_ETH_NATIVE_TOKEN secrets

`PYPI_TOKEN` was renamed to `PIPY_SAFE_ETH_TOKEN`, and safe-eth-native
gets its own token, `PIPY_SAFE_ETH_NATIVE_TOKEN`, instead of trusted
publishing.

* fix: lock the object behind a memoryview while keccak256 copies it

On free-threaded Python, a `memoryview` over a `bytearray` was copied
holding only the lock of the `memoryview`. Writes to the `bytearray`
take the lock of the `bytearray`, so the copy could mix old and new
content. Hold both locks.

A new test hashes a `bytearray`, and `memoryview`s of it, while other
threa... (continued)

339 of 343 new or added lines in 10 files covered. (98.83%)

12407 of 13169 relevant lines covered (94.21%)

4.37 hits per line

Uncovered Changes

Lines Coverage ∆ File
2
92.59
safe_eth/util/native.py
1
99.39
-0.61% safe_eth/eth/tests/test_utils.py
1
97.8
0.74% safe_eth/safe/tests/test_p256.py
Jobs
ID Job ID Ran Files Coverage
1 run-3.13 - 45613737965.1 25 Nov 2026 12:28PM UTC 129
86.66
GitHub Action Run
2 run-3.12 - 45613737965.2 25 Nov 2026 12:28PM UTC 129
86.66
GitHub Action Run
3 run-3.15 - 45613737965.3 25 Nov 2026 12:28PM UTC 129
86.42
GitHub Action Run
4 run-3.11 - 45613737965.4 25 Nov 2026 12:29PM UTC 129
86.66
GitHub Action Run
5 run-3.14 - 45613737965.5 25 Nov 2026 12:28PM UTC 129
94.11
GitHub Action Run
Source Files on build 45613737965
  • Tree
  • List 129
  • Changed 7
  • Source Changed 7
  • Coverage Changed 7
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #45613737965
  • 52df8f98 on github
  • Prev Build on main (#45586944530)
  • Next Build on main (#45619760965)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc