balancer / balancer-v3-monorepo

GNU General Public License v3.0
37 stars 10 forks source link

Aggregate fee tests #824

Closed EndymionJkb closed 1 month ago

EndymionJkb commented 1 month ago

Description

We had a legacy helper in BaseVaultTest (and a duplicate in one of the test files) that computed aggregate percentages from their components. It had (documented) precision issues, which were resolved in the latest ProtocolFeeController code.

This makes minimal changes to remove these helpers and use the ProtocolFeeController itself for aggregate computation, so that it's consistent with what the system does. For the fuzz tests, there were still precision issues trying to set each to its full range, so in that case I had to fuzz the aggregate fee directly (bounding it, then manually adjusting for precision).

A more extensive change would be to always use the aggregate percentage natively, and not try to compute it.

Type of change

Checklist:

Issue Resolution

Resolves #823 .