The UpdateWeightRunner
contract allows pools to set their rules through the setRuleForPool
function, but provides no mechanism to update or remove these rules once set. This is implemented through a one-time setting mechanism:
While this immutability might be intentional for gas optimization and security through simplicity (as noted in the architecture documentation), the complete lack of any emergency or migration mechanism creates significant risks.
The rules are stored permanently in these mappings:
The inability to update or remove rules can lead to several critical issues:
Permanent Lock-in to Buggy Rules
If a mathematical error is discovered in a rule's implementation
If a rule becomes vulnerable to manipulation under certain market conditions
If regulatory changes require modifications to rule behavior
No Recovery from Suboptimal States
Pools stuck with underperforming rules cannot be optimized
No way to adapt to changing market conditions or new trading patterns
Cannot implement improvements or optimizations to rule calculations
Financial Risks
Users could suffer losses from continued use of buggy rules
Protocol could face reputational damage from inability to fix known issues
Potential for permanent loss of funds if a critical vulnerability is discovered
Multiple approaches could be implemented to address this issue while maintaining the benefits of the current design:
Rule Migration System
This system allows for a controlled transition from one rule to another. Here's how it works:
Emergency Rule Suspension
This is a safety mechanism to quickly stop a problematic rule:
Please read the CodeHawks documentation to know which submissions are valid. If you disagree, provide a coded PoC and explain the real likelyhood and the detailed impact on the mainnet without any supposition (if, it could, etc) to prove your point.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.