Repository navigation
test: stop test_utxo_security_audit overwriting RC_ADMIN_KEY (unblocks CI) - #8467
Merged
Merged
Conversation
…s CI) #8393 set os.environ["RC_ADMIN_KEY"] = "test-rollback-admin-key-2819" at import time. That value is 28 chars; the node sys.exit(1)s on a key < 32 chars, so every later test module that imports the node aborted pytest collection and the CI "test" job has failed on every PR since 9/14. The overwrite also leaked into later tests that send conftest's key (401s). Use the suite-wide key from tests/conftest.py (setdefault, so the file still runs standalone) and pass that same value to rollback_genesis(). Local run of the exact CI command (CI env + tests/requirements.txt): before: collection INTERNALERROR (SystemExit: 1), 0 tests run after: 4009 passed, 2 failed The 2 remaining failures (test_utxo_dual_write_double_spend, test_utxo_transfer_spends_account_mirror) fail standalone on main and are unrelated: mirror boxes are now filtered before the 409 ACCOUNT_MIRROR_BOX_NOT_SPENDABLE check, so the endpoint returns 400 "Insufficient UTXO balance" instead. The box is still not spent. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Scott <scottbphone12@gmail.com>
Contributor
|
| Metric | Value |
|---|---|
| Trust Score | 36/100 |
| Certificate ID | BCOS-0e151b69 |
| Tier | L1 (not met) |
What does this mean?
The BCOS (Beacon Certified Open Source) engine scans for:
- SPDX license header compliance
- Known CVE vulnerabilities (OSV database)
- Static analysis findings (Semgrep)
- SBOM completeness
- Dependency freshness
- Test infrastructure evidence
- Review attestation tier
BCOS v2 Engine - Free & Open Source (MIT) - Elyan Labs
This was referenced Sep 18, 2026
Contributor
RTC RewardThis merged PR earned 5 RTC — sent to |
Scottcjn
added a commit
that referenced
this pull request
Sep 18, 2026
…isleading 400 (#8468) Since #8395, account-mirror boxes are excluded inside get_coin_select_candidates() before candidate bounding, so the mirror_candidate_ids branch in /utxo/transfer can never fire. A sender whose funds are mirror-locked got 400 "Insufficient UTXO balance" while the same response reported balance_nrtc >= requested_nrtc. On a failed selection, decide from wallet totals: if the spendable (non-mirror) funds fall short but the mirror-locked ones would cover the request, return the 409 with the box ids; otherwise the plain 400, now with spendable_nrtc. Totals are wallet-wide (SQL SUM), not the bounded candidate list, so #8395's false-409 cannot return. No state change: this only runs after coin selection has already failed. Fixes the two long-failing tests (test_utxo_dual_write_double_spend, test_utxo_transfer_spends_account_mirror) and adds a guard that a request beyond the whole wallet stays a plain 400. Full CI suite (with #8467's collection fix applied locally): 4012 passed, 0 failed. Signed-off-by: Scott <scottbphone12@gmail.com> Co-authored-by: Scott <scottbphone12@gmail.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Scottcjn
pushed a commit
that referenced
this pull request
Sep 27, 2026
Branch was based on aa584b3 and predates #8467 (test_utxo_security_audit overwrote RC_ADMIN_KEY), which made the node module sys.exit(1) at import during pytest collection (tests/test_vintage_g5_and_qube.py) and crashed the whole CI test job. Bringing main in picks up that fix; no change to the PR's own diff. Signed-off-by: Scott <scottbphone12@gmail.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Scottcjn
pushed a commit
that referenced
this pull request
Sep 27, 2026
Picks up main's CI fixes (e.g. #8467 RC_ADMIN_KEY test leak and the refreshed installer checksum manifest) that the stale branch was missing. Signed-off-by: Scott <scottbphone12@gmail.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Scottcjn
pushed a commit
that referenced
this pull request
Sep 27, 2026
Picks up main's CI fixes (e.g. #8467 RC_ADMIN_KEY test leak and the refreshed installer checksum manifest) that the stale branch was missing. Signed-off-by: Scott <scottbphone12@gmail.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The CI
testjob has failed on every Rustchain PR since 9/14. It wasn't flakiness: pytest collection itself was aborting.Cause
#8393 added this at import time in
tests/test_utxo_security_audit.py:The node refuses any key shorter than 32 characters with
sys.exit(1)(rip200.py:8870). So the first later test module that imports the node (test_vintage_g5_and_qube.py) raisedSystemExit, pytest reportedINTERNALERROR, and zero tests ran. I found this by bisecting over the 465 test files collected before the crashing one. The overwrite also leaked into later tests that send conftest's"0"*32key, so they got 401s (test_wallet_review_holds×2,test_miner_headerkey_schema).Fix
Use the suite-wide key that
tests/conftest.pyalready sets (viasetdefault, so the file still runs on its own), and pass the same value torollback_genesis(). The change is one file.Verification
I ran the exact CI command locally, with the CI env and
tests/requirements.txt:mainINTERNALERROR(SystemExit: 1), 0 tests runThe lint step (
ruff check tests --select E9,F63,F7,F82) passes.The 2 remaining failures (pre-existing, out of scope)
test_utxo_dual_write_double_spendandtest_utxo_transfer_spends_account_mirrorfail on their own onmaintoo. The security property still holds: the mirror box is not spent. But the endpoint now returns 400 "Insufficient UTXO balance" (balance 100, requested 99) instead of 409ACCOUNT_MIRROR_BOX_NOT_SPENDABLE. Coin selection filters mirror boxes out before the specific check can fire, so users get a misleading error. That's worth a follow-up; it isn't fixed here.This should merge before #8465 and other PRs, so their CI results mean something again.
🤖 Generated with Claude Code