aave / aave-v3-core

This repository contains the core smart contracts of the Aave V3 protocol.
https://aave.com
Other
876 stars 572 forks source link

Support more than 128 assets #282

Closed LHerskind closed 2 years ago

LHerskind commented 3 years ago

The current implementation is made to support at most 128 reserves. However, for cases, it is useful to support >128 assets, (realT etc). To support this, an update needs to be made to the user configuration logic and data structure, as it must be able to hold additional assets.

LHerskind commented 3 years ago

Notice, same issue as in https://github.com/aave/aave-v3-core/pull/196#pullrequestreview-815760747

The-3D commented 2 years ago

An initial attempt to extend the number of reserves showed increased gas costs for all the actions. If we factor in the addition of the ability to full drop reserves and replace them (that was absent in V2) and the inherent block size limitations, i think for now we can maintain the limit of 128 reserves which still gives the full ability to extend further in the future (by adding more storage slots to UserConfigurationMap and proper logic to the UserConfiguration library) and just improve the consistency of the storage of id in ReserveData and _reservesCount in PoolStorage (#284). @LHerskind if you agree we can close