The UpdateWeightRunner contract contains a timing check that allows weight updates slightly earlier than intended due to using >= instead of > when comparing against the update interval. This causes updates to occur marginally more frequently than specified in the documentation.
In the performUpdate function, there is a timing check that verifies if enough time has passed since the last update:
The documentation specifies that updates must be performed "more than updateInterval seconds ago", but the code uses >= which allows updates to occur exactly at the updateInterval time. This creates a discrepancy between the documented behavior and actual implementation.
The impact is that:
Updates can occur one block earlier than intended
The system deviates from its documented specification
Weight updates may happen marginally more frequently than designed
Code does not function as intended.
Medium Severity - Low impact being that funds are not directly at risk but functionality does not work as intended. High likelyhood given that anyone can call this every time the invalid logic case becomes true (every update interval).
Manual Review
Change the comparison operator from >= to > to match the documented behavior:
This ensures that updates can only occur strictly after the intended interval has passed, aligning with the documentation and intended system behavior.
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.