Submitted by guhu95, also found by zzykxx, LessDupes, ilchovski, and Bauchibred
The calculateTVLs function in the RestakeManager contains two nested loops: one loop for each operator delegator (OD), and an internal loop for each token. In each internal loop:
Due to the the nested loop structure, the gas consumption in the case of several operator delegators, and several tokens used is quadratic: n-OD x n-Tokens. Crucially, this method is called in most user flows: deposits, withdrawals, and Balancer trades.
An even small number of operators and supported tokens will render the protocol unusable, up to running out of block gas limit.
Currently, with 1 OD and 2 tokens, calculateTVLs consumes approximately 450K gas (see the example transaction gas profiling section).
For reasonable values, such as 12 ODs and 12 tokens (Eigenlayer supports 12 tokens), there would be 144 nested loop iterations instead of just 2 iterations in the current version and configuration. A simple extrapolation, without adding the cost of operations added in the new version, and without estimating the additional quadratic memory expansion costs, would suggest that 144 iterations, instead of the current 2, would cost 32M gas (450K * 144 / 2), exceeding the block gas limit.
However, an earlier limiting factor will be encountered because calculateTVL is called in most user interactions with Renzo:  deposit, withdrawal, and Balancer trade. Thus, exceeding even 1M-2M gas on L1 will render most protocol methods practically unusable for users.
Instead of pulling operator delegator token balances, a pushing pattern can be used:
This will remove all loops during the calculation, except for the loop needed to iterate over the token oracles (once).
Alternatively, an off-chain custom TVL oracle can be used, for example, via a custom Chainlink oracle.
DoS
jatinj615 (Renzo) acknowledged
