governance -> gauges -> GaugeController.sol -> Line 418
The getTotalWeight
function calculates the total weight of all active gauges by iterating over the entire _gaugeList
array. While functionally correct, this approach may become gas‑inefficient if the number of gauges grows significantly.
Intended Behavior:
The function should provide an aggregate weight of all active gauges to determine revenue and reward distribution.
Observed Behavior:
The implementation uses a for‑loop over _gaugeList
and checks each gauge’s isActive
flag before summing its weight.
Why It Matters:
Although this is not a security vulnerability per se, high gas costs can hinder usability and lead to transaction failures in scenarios with many gauges.
Performance Impact:
Increased gas usage could make calling this function expensive or cause it to fail in high-load scenarios.
User Experience:
Elevated gas costs affect overall protocol efficiency and could discourage users from interacting with gauge-related functions.
To optimize gas usage:
Maintain a running total of active gauge weights that updates whenever a gauge’s weight or status changes.
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.