Currently FeeConversionKeeper::checkUpkeep
is iterating through all of the live markets by engine and then for every market is iterating through the all of the fees for the current market . If the number of markets is extremely huge and same is applicable for the fees, the function will end up to be unsuable.
The issue lies in the nested iteration structure of the function:
It iterates through all live markets in the engine.
For each market, it iterates through all fees associated with that market.
This results in a quadratic complexity (O(n*m), where n
is the number of markets and m
is the number of fees per market). As the number of markets and fees grows, the function will consume an impractical amount of gas and may even exceed block gas limits, rendering it unusable.
High Gas Costs: The function will become prohibitively expensive to execute as the number of markets and fees increases.
Block Gas Limit Exceeded: For extremely large datasets, the function may fail entirely due to exceeding the block gas limit.
Manual review
Make the function configurable to iterate through subset of markets, such as from index to index. Make the function pageable.
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.