Description:
The update_config function in config.rs:33-122 validates some parameters but leaves others unchecked:
decay_rate_bps — not bounded; could be set to 10000 (100%), instantly zeroing all reputation scores
decay_period_ledgers — not bounded; could be set to 0, causing division-by-zero in invoice.rs:324
dispute_timeout_ledgers — not bounded; could be set to 0, allowing instant auto-resolution of disputes before the payer can respond
high_rep_threshold — no bounds; could be set to 0, making all LPs "high reputation"
Why it matters: Malicious or misconfigured governance calls could break the reputation system, dispute resolution, or LP prioritization.
Acceptance Criteria:
Relevant Files: contracts/invoice_liquidity/src/config.rs:33-122
Description:
The
update_configfunction inconfig.rs:33-122validates some parameters but leaves others unchecked:decay_rate_bps— not bounded; could be set to 10000 (100%), instantly zeroing all reputation scoresdecay_period_ledgers— not bounded; could be set to 0, causing division-by-zero ininvoice.rs:324dispute_timeout_ledgers— not bounded; could be set to 0, allowing instant auto-resolution of disputes before the payer can respondhigh_rep_threshold— no bounds; could be set to 0, making all LPs "high reputation"Why it matters: Malicious or misconfigured governance calls could break the reputation system, dispute resolution, or LP prioritization.
Acceptance Criteria:
decay_rate_bps(e.g., 1–5000 bps)decay_period_ledgers(e.g., ≥ 100 ledgers)dispute_timeout_ledgers(e.g., ≥ 1440 ledgers / ~1 day)high_rep_threshold > 0Relevant Files:
contracts/invoice_liquidity/src/config.rs:33-122