You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
electrum-ecc: assorted typing and CI hygiene gaps #668
spesmilo/electrum-ecc, pinned at 6314eb3f
(tag 0.0.7, 2026-05-13). Small items grouped into one issue, matching how
btclib's own #149 groups this class of finding:
Implicit-Optional annotations strict mypy rejects: grind_r_value: bool = None (keys.py:394), aux_rand32: bytes = None (keys.py:440), derivation_prefix: str = None, root_fingerprint: str = None
(bip32.py:427-428), sigdata: Mapping[bytes, bytes] = None (descriptor.py:361,369,393,
in the parent electrum repo's fork of this pattern).
No py.typed in the published electrum-ecc package — its
annotations (implicit-Optional issues aside) are invisible to a
downstream mypy user.
CI pins by tag, not SHA, and declares no permissions: block
(.github/workflows/ci.yml) — inconsistent with the parent electrum
repository's own tests.yml, which already SHA-pins with tag comments
and sets permissions: contents: read. The child package is looser
than the parent that depends on it.
ENABLE_ECDSA_R_VALUE_GRINDING is a mutable module-level global in __init__.py, with a comment "Some unit tests need..." — a
test-configuration switch left reachable from any importer.
Before sending upstream
Draft only. All four are small and independent; py.typed alone is worth
a standalone one-line PR given its outsized downstream value, the rest
can go together or separately at the reporter's discretion.
Implicit-Optional: grind_r_value: bool = None (keys.py:394), aux_rand32: bytes = None (keys.py:440). The bip32.py:427-428 and descriptor.py:361,369,393 entries are in the parent spesmilo/electrum
repository, not this one — the body says so, but the report must not,
or it will be answered with "wrong repo". descriptor.py's three are at
L361, L369 and L393 at electrum master today.
No py.typed: git ls-files shows MANIFEST.in, pyproject.toml, setup.py and no marker file. Confirmed.
CI: .github/workflows/ci.yml uses actions/checkout@v6 (L27, L58)
and actions/setup-python@v6 (L32, L62), by tag. It does set timeout-minutes: 15 (L20) — the body did not claim otherwise, but the
report should not either. There is no permissions: block anywhere in
the file.
ENABLE_ECDSA_R_VALUE_GRINDING: __init__.py:12, a module-level True, read at keys.py:407-408 on each call.
The tracker has no open issues and one open PR
(#17, MuSig2 bindings),
so nothing here is a duplicate.
What to send: three PRs, no issue
Each is small and self-evident; an issue asking permission for a py.typed
file would be noise. Order matters — send the first alone, and let its
reception decide whether the other two are worth the maintainers' time.
PR 1 — add py.typed. One empty file plus the packaging line that ships
it (setup.py/MANIFEST.in, whichever their build uses). The body is two
sentences: the package is annotated, and without the marker PEP 561 makes
those annotations invisible to every downstream mypy run, Electrum's own
included. Highest value per byte of the three.
PR 2 — implicit-Optional.grind_r_value: Optional[bool] = None and aux_rand32: Optional[bytes] = None. Two lines. Worth pairing with PR 1 in
the same PR if the maintainers prefer fewer PRs — mention the option in the
body, since with py.typed shipped these two annotations become other
people's mypy errors, which is the argument for fixing them at all.
PR 3 — CI. SHA-pin the two actions with the tag in a trailing comment,
add permissions: contents: read. Say plainly that this is hygiene matching
what the parent spesmilo/electrum repository's tests.yml already does —
the child being looser than the parent that depends on it is the whole
argument, and it is a good one.
ENABLE_ECDSA_R_VALUE_GRINDING: report, do not patch. A module-level
mutable switch that changes signing behaviour process-wide is a design
choice with a stated reason ("Some unit tests need..."). The useful thing is
a question in PR 3's description or a separate short issue: would a
context manager, or a per-call parameter, be preferred? Sending a patch that
changes it unasked is how a small hygiene PR turns into an argument.
The py.typed item is filed upstream as spesmilo/electrum-ecc#22. The other three items (implicit-Optional annotations, CI SHA-pinning/permissions, the grinding global) remain; keeping this open for them.
Closing without further follow-up. The py.typed item — the one with clear downstream value — is filed upstream as spesmilo/electrum-ecc#22. The remaining three (implicit-Optional annotations, CI SHA-pinning/permissions, the ENABLE_ECDSA_R_VALUE_GRINDING global) are project-configuration preferences a maintainer can reasonably decline, the same bar that closed #659; not worth an upstream report.
Activity
fametrano commentedon Aug 14, 2026
Re-verified 2026-08-14
Still
6314eb3f(0.0.7). Each item, checked:grind_r_value: bool = None(keys.py:394),aux_rand32: bytes = None(keys.py:440). Thebip32.py:427-428anddescriptor.py:361,369,393entries are in the parentspesmilo/electrumrepository, not this one — the body says so, but the report must not,
or it will be answered with "wrong repo".
descriptor.py's three are atL361, L369 and L393 at electrum master today.
py.typed:git ls-filesshowsMANIFEST.in,pyproject.toml,setup.pyand no marker file. Confirmed..github/workflows/ci.ymlusesactions/checkout@v6(L27, L58)and
actions/setup-python@v6(L32, L62), by tag. It does settimeout-minutes: 15(L20) — the body did not claim otherwise, but thereport should not either. There is no
permissions:block anywhere inthe file.
ENABLE_ECDSA_R_VALUE_GRINDING:__init__.py:12, a module-levelTrue, read atkeys.py:407-408on each call.The tracker has no open issues and one open PR
(#17, MuSig2 bindings),
so nothing here is a duplicate.
What to send: three PRs, no issue
Each is small and self-evident; an issue asking permission for a
py.typedfile would be noise. Order matters — send the first alone, and let its
reception decide whether the other two are worth the maintainers' time.
PR 1 —
add py.typed. One empty file plus the packaging line that shipsit (
setup.py/MANIFEST.in, whichever their build uses). The body is twosentences: the package is annotated, and without the marker PEP 561 makes
those annotations invisible to every downstream mypy run, Electrum's own
included. Highest value per byte of the three.
PR 2 — implicit-Optional.
grind_r_value: Optional[bool] = Noneandaux_rand32: Optional[bytes] = None. Two lines. Worth pairing with PR 1 inthe same PR if the maintainers prefer fewer PRs — mention the option in the
body, since with
py.typedshipped these two annotations become otherpeople's mypy errors, which is the argument for fixing them at all.
PR 3 — CI. SHA-pin the two actions with the tag in a trailing comment,
add
permissions: contents: read. Say plainly that this is hygiene matchingwhat the parent
spesmilo/electrumrepository'stests.ymlalready does —the child being looser than the parent that depends on it is the whole
argument, and it is a good one.
ENABLE_ECDSA_R_VALUE_GRINDING: report, do not patch. A module-levelmutable switch that changes signing behaviour process-wide is a design
choice with a stated reason ("Some unit tests need..."). The useful thing is
a question in PR 3's description or a separate short issue: would a
context manager, or a per-call parameter, be preferred? Sending a patch that
changes it unasked is how a small hygiene PR turns into an argument.
Verified against btclib
d7c4b3d5.fametrano commentedon Sep 8, 2026
The py.typed item is filed upstream as spesmilo/electrum-ecc#22. The other three items (implicit-Optional annotations, CI SHA-pinning/permissions, the grinding global) remain; keeping this open for them.
fametrano commentedon Sep 8, 2026
Closing without further follow-up. The py.typed item — the one with clear downstream value — is filed upstream as spesmilo/electrum-ecc#22. The remaining three (implicit-Optional annotations, CI SHA-pinning/permissions, the ENABLE_ECDSA_R_VALUE_GRINDING global) are project-configuration preferences a maintainer can reasonably decline, the same bar that closed #659; not worth an upstream report.