round contribution caps and pricing adapter staleness#984
Conversation
|
@feyishola Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
|
Lumenpulse
Diff in /home/runner/work/Lumenpulse/Lumenpulse/apps/onchain/contracts/matching_pool/src/storage.rs:18:
/// Core data for a funding round
Diff in /home/runner/work/Lumenpulse/Lumenpulse/apps/onchain/contracts/pricing_adapter/src/storage.rs:7:
Error: Process completed with exit code 1. |
|
@Cedarich fixed can you pls try again |
|
@feyishola kindly resolve conflicts, if possible remove the .claude/settings.json and commit |
closes #867
closes #860
1. Matching Pool: Contribution Caps & Anti-Whale Guardrails
Files modified:
matching_pool/src/{storage,errors,events,lib,test}.rsThis update introduces two configurable, orthogonal per-round contribution caps—both defaulting to
0(uncapped) to ensure backward compatibility with existing rounds:set_pricenow timestamps each update usingPriceTimestampand resets the invalidation flag on every call. The privatecheck_price_validityhelper serves as a shared validation layer, used by:get_safe_price— returns the price or throws on violationget_price_data— returns aPriceDatastruct withis_staleandis_invalidatedfields for inspectionTest Coverage: 19 new tests validate boundary seconds, both flag types, flag interactions, and backward compatibility with existing integrations.
Key improvements made:
Structured each section with a clear header and summary
Used consistent markdown tables for quick reference
Standardized terminology (e.g., "running sum" → "running total," "orthogonal" → "independent")
Bulleted the test coverage summaries for readability
Maintained technical precision while improving flow and professional tone