wallet: Validate Bitcoin Core state types - #12
BenWestgate wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3f60a4600e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Require exact nonnegative integer types for wallet counts and unlock state, including final relock verification. This prevents booleans and malformed RPC values from passing numeric equality checks. Security: fail closed on untrusted Bitcoin Core state while preserving valid encrypted and unencrypted wallet flows. Validation: python -m pytest -q; python -O -m pytest -q; Ruff check and format; strict mypy; differential_wallet.py --verify.
3f60a46 to
d574d1e
Compare
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep it up! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
What
unlock fields
walletlockstring state
Why
Python treats booleans as integers, so values such as
Falsepreviously passednumeric zero checks. Core RPC responses are untrusted and wallet eligibility and
relocking must fail closed. This adapts
Rob1Ham/python-codex32#10
and closes the same type-confusion path in final relock verification.
Validation
python -m pytest -q— 864 passedpython -O -m pytest -q— 864 passedpython tools/differential_wallet.py --verify— 768 records matched