Skip to content
This repository has been archived by the owner on Oct 1, 2023. It is now read-only.

Respx - Carousel rollover queues can become clogged with small items #235

Closed
sherlock-admin opened this issue Mar 27, 2023 · 0 comments
Closed
Labels
Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label Medium A valid Medium severity issue Reward A payout will be made for this issue

Comments

@sherlock-admin
Copy link
Contributor

sherlock-admin commented Mar 27, 2023

Respx

medium

Carousel rollover queues can become clogged with small items

Summary

Low value items in the rollover queue are not processed, but remain in the queue and are reprocessed with each epoch. This will add gas fees to the cost of processing every epoch and could even make rollovers non-viable.

Vulnerability Detail

The critical section of code is inside the loop in Carousel.mintRollovers() where queue items with a value below relayerFee are skipped, but not removed.

Although there are measures to prevent rollover items with a value below relayerFee from being directly added to the rollover queue, it can still happen if the value of relayerFee is increased.

If a sufficiently large number of items of this kind accumulate in the queue, either as a result of a denial of service attack or through a Carousel running for a very long time, then the gas cost of processing rollovers could increase significantly.

Impact

With a sufficiently large number of clogging entries, the gas fee for processing rollovers could become prohibitively expensive and relayers would no longer process them. This could lead to an increase in the value of relayerFee which would only make the situation worse. Eventually, the Carousel would need to be abandoned.

Code Snippet

https://github.com/Y2K-Finance/Earthquake/blob/736b2e1e51bef6daa6a5ecd1decb7d156316d795/src/v2/Carousel/Carousel.sol#L403-L406

                    if (queue[index].assets < relayerFee) {
                        index++;
                        continue;
                    }

Tool used

Manual Review

Recommendation

Consider allowing items in the rollover queue with a value below relayerFee to be delisted and refunded to any user if they have been in the queue for a long time.

Duplicate of #172

@github-actions github-actions bot closed this as completed Apr 3, 2023
@github-actions github-actions bot added Medium A valid Medium severity issue Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label labels Apr 3, 2023
@sherlock-admin sherlock-admin added the Reward A payout will be made for this issue label Apr 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label Medium A valid Medium severity issue Reward A payout will be made for this issue
Projects
None yet
Development

No branches or pull requests

1 participant