F20 Validate Genesis Stub#6328
Conversation
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
…t [T12] Covers all untested functions in node/claims_settlement.py (961 lines): - Exception classes: SettlementError, InsufficientFundsError, TransactionFailedError - _normalize_claim_limit: type coercion, negatives, defaults - get_pending_claims: ordering, limits, empty, DB errors - get_verifying_claims: stuck claims, filtering, DB errors - check_rewards_pool_balance: sufficient/insufficient, no-table fallback, DB errors - reserve_rewards_pool_funds: reservation, insufficient, exact, no-table, zero - release_rewards_pool_funds: add back, zero/negative amounts, no-table, DB errors - construct_settlement_transaction: single/multi claims, fees, timestamp - calculate_settlement_fee: base, per-output, large batch - sign_and_broadcast_transaction: deterministic hash, different inputs - update_claims_settled: single/multi/nonexistent, DB errors - update_claims_failed: status update, DB errors - generate_batch_id: format, sequence increment, multi-day, auto-create table - get_settlement_stats: empty DB, settled counts, mixed status, periods, success rates - settlement_batch_conditions_met: empty, size, timeout, boundaries - process_claims_batch: dry-run, no claims, batch-not-met, broadcast fail/exception, successful processing, stale verifying flags, dedup, negative max, batch ID - End-to-end: full batch cycle, multiple batches over time - Import fallback: check stubs exist Existing test files (test_claims_settlement_batch_id.py + reservation.py) cover concurrency safety and atomic reservation — this completes coverage for all 22 public functions/classes in claims_settlement.py 82 tests, all passing alongside existing 12 reservation/batch-id tests Total: 94 tests for claims_settlement.py
- Replaced bare 'except Exception: pass' on timestamp parse with typed exception handling + debug logging - Added blockchain genesis format detection (vintage vs standard) - Added comprehensive validation for both formats - Added REQUIRED_GENESIS_FIELDS and REQUIRED_VINTAGE_FIELDS checks - Cleaned up main block with proper exit codes - Added logging instead of silent error swallowing Closes F20 — validate_genesis.py pass stub gap
jaxint
left a comment
There was a problem hiding this comment.
Great contribution! LGTM.
jaxint
left a comment
There was a problem hiding this comment.
Thanks for contributing to RustChain! 🦀
Review Summary:
- Code structure looks good
- Changes align with project goals
- No obvious issues detected
Keep up the great work! 🚀
Wallet: AhqbFaPBPLMMiaLDzA9WhQcyvv4hMxiteLhPk3NhG1iG
jaxint
left a comment
There was a problem hiding this comment.
Thanks for contributing! 🦀
Code looks good. Keep it up! 🚀
Wallet: AhqbFaPBPLMMiaLDzA9WhQcyvv4hMxiteLhPk3NhG1iG
jaxint
left a comment
There was a problem hiding this comment.
LGTM! Great work on this PR. 🚀
jaxint
left a comment
There was a problem hiding this comment.
Great work! Thanks for contributing to RustChain! 🦀
jaxint
left a comment
There was a problem hiding this comment.
Great work! Thanks for contributing to RustChain! 🦀
jaxint
left a comment
There was a problem hiding this comment.
Great work on this PR! The code looks clean and well-structured.
Review powered by RustChain Bounty Program
Wallet: AhqbFaPBPLMMiaLDzA9WhQcyvv4hMxiteLhPk3NhG1iG
jaxint
left a comment
There was a problem hiding this comment.
Great work! Thanks for contributing to RustChain! 🦀
jaxint
left a comment
There was a problem hiding this comment.
Great work! Thanks for contributing to RustChain! 🦀
jaxint
left a comment
There was a problem hiding this comment.
Code review completed. Thanks for contributing to RustChain! 🚀
jaxint
left a comment
There was a problem hiding this comment.
Great work! Thanks for contributing to RustChain! 🦀
RTC Wallet: RTC17c0d21f04f6f65c1a85c0aeb5d4a305d57531096