Closed gerrrg closed 1 month ago
Hmmm! Good catch; certainly seems like this should work. I don't believe we ever call this, which is one reason we never noticed. Should have a test. (We would have found that in the coverage tests I suppose.)
Ah, yeah good point @jubeira about immutable reads vs normal storage reads. Still seems like a good thing to add in, just not as significant as I initially thoughts 🙂
Description
Currently, calling
computeBalance()
can perform (at most) 8 storage reads since it's calling_getNormalizedWeights()
and then taking thei
th index. Instead, we can directly query_getNormalizedWeight(i)
and just perform a single storage read for the weight we want.Type of change
Checklist:
main
, or there's a description of how to mergeIssue Resolution