Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deployment count cap #142

Merged
merged 1 commit into from
Apr 28, 2023
Merged

Deployment count cap #142

merged 1 commit into from
Apr 28, 2023

Conversation

aalavandhan
Copy link
Member

  • Added deployment count limit to prevent large loops which might run out of gas

@aalavandhan aalavandhan added the next-release Changes for upcoming release label Apr 10, 2023
Copy link
Member

@brandoniles brandoniles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see the problem of unbounded loops causing gas limit problems, but I'm not sure I see this as a right solution for it. If there's no hard limit in the code, then it will be implicitly enforced anyway by the block gas limit. This change would simply make the limit lower?

I could see this working if, instead of reverting, it executed as much as it could up to some limit, then left the rest for followup calls, though.

I'm guessing if either this code limit or block gas limit were reached, it could brick the contract until somehow the tranches were redeemed from the side. To make sure we have a recovery step--Is there a non-permissioned way to redeem the tranches to underlying for the vault?

@aalavandhan
Copy link
Member Author

aalavandhan commented Apr 17, 2023

Hmm. Makes sense. We don't yet have a non-permissioned way to redeem individual tranches I think we should add public methods to redeem tranches.

The additional benefit of the limit is that it guarantees the vault share holder can always "redeem" shares for the underlying (as the redemption loops through all the assets and could be bricked if the _deployed list was maliciously inflated).

Base automatically changed from vault-interface to fee-strategy April 18, 2023 12:48
Base automatically changed from fee-strategy to vault-unit-tests April 18, 2023 12:48
Base automatically changed from vault-unit-tests to main April 18, 2023 12:49
Copy link
Member

@brandoniles brandoniles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@aalavandhan aalavandhan merged commit ebc9a46 into main Apr 28, 2023
@aalavandhan aalavandhan deleted the vault-caps branch April 28, 2023 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
next-release Changes for upcoming release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants