Skip to content

fix(utxo_endpoints): add logging when account model unavailable for integrity check (M9)#6311

Open
waefrebeorn wants to merge 35 commits into
Scottcjn:mainfrom
waefrebeorn:fix-m9-utxo-integrity-logging-v2
Open

fix(utxo_endpoints): add logging when account model unavailable for integrity check (M9)#6311
waefrebeorn wants to merge 35 commits into
Scottcjn:mainfrom
waefrebeorn:fix-m9-utxo-integrity-logging-v2

Conversation

@waefrebeorn
Copy link
Copy Markdown

Summary

M9 — MED: utxo_endpoints.py /utxo/integrity silently skips cross-model comparison

Bug

When the account model (balances table) is unavailable — DB path mismatch, locked DB, or schema mismatch — the /utxo/integrity endpoint silently falls through without logging. The integrity check runs against UTXO only, potentially masking fund leaks or reconciliation issues.

Fix

Added logging.warning() before the silent fallback so operators can detect when cross-model comparison is skipped.

Before: silent — GET /utxo/integrity returns OK but no account comparison was performed.
After: WARNING:root:Account model unavailable — running integrity check without cross-model comparison in logs.

Testing

  • Syntax verified (Python AST parse)
  • 0 behavioral change — only adds logging on the existing failure path
  • No regressions

RTC Wallet for bounty: RTC17c0d21f04f6f65c1a85c0aeb5d4a305d57531096

Adds max_length parameter to _clean_string_field and caps all user input
fields in POST route handlers:

- /lock: sender_wallet(128), target_wallet(128), tx_hash(128), receipt_signature(256)
- /confirm: proof_ref(256), notes(1024)
- /release: release_tx(128), notes(1024)

Prevents storage of arbitrarily large strings in bridge_ledger DB.
…s + Row M error handling + Row T test gaps + Row E infrastructure
@github-actions github-actions Bot added documentation Improvements or additions to documentation BCOS-L1 Beacon Certified Open Source tier BCOS-L1 (required for non-doc PRs) node Node server related api API endpoint related size/M PR: 51-200 lines labels May 25, 2026
Copy link
Copy Markdown
Contributor

@jaxint jaxint left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Great work on this PR. 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api API endpoint related BCOS-L1 Beacon Certified Open Source tier BCOS-L1 (required for non-doc PRs) documentation Improvements or additions to documentation node Node server related size/M PR: 51-200 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants