Skip to content

Conversation

@nicholaspai
Copy link
Member

@nicholaspai nicholaspai commented Jan 5, 2023

Constructor should be able to initialize deposit ID to support upgrades

The alternative implementation with less code diff would be to add an admin function incrementDepositCount(uint32 count) where the admin could increase the deposit count. I don't see this being useful outside of upgrades so I decided not to do it.

Thoughts?

Constructor should be able to initialize deposit ID to support upgrades
@nicholaspai nicholaspai requested review from mrice32 and pxrl January 5, 2023 13:59
Copy link
Contributor

@mrice32 mrice32 left a comment

Choose a reason for hiding this comment

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

LGTM!

Interesting comment on the admin call.
Advantages:

  • More flexibility.

Disadvantages:

  • More complexity.
  • Possible to "skip" deposit ids in a single spoke pool. In the future, we could use skips as a sign that we missed a deposit/fill in the bots, but if these can be incremented after launch, that strategy wouldn't really work as nicely.

I can't think of a reason we'd want to do this. Can you @pxrl?

@pxrl
Copy link
Contributor

pxrl commented Jan 11, 2023

An alternative solution could be to have the contract pause deposits automatically in the constructor, which would then allow the depositId to be manually adjusted via a separate txn, before unpausing again. This might make it marginally easier to re-deploy successive contracts because it'd be one less thing to modify each time.

FWIW as background, I like the concept of the contract being deployed in a "guarded" state to allow time for any manual post-deployment testing and config, before flicking a switch to make it accessible to all others.

@nicholaspai
Copy link
Member Author

An alternative solution could be to have the contract pause deposits automatically in the constructor, which would then allow the depositId to be manually adjusted via a separate txn, before unpausing again. This might make it marginally easier to re-deploy successive contracts because it'd be one less thing to modify each time.

FWIW as background, I like the concept of the contract being deployed in a "guarded" state to allow time for any manual post-deployment testing and config, before flicking a switch to make it accessible to all others.

This is the case today as enabledDeposits for all indices will be false

@nicholaspai nicholaspai merged commit 07a8fd9 into master Jan 12, 2023
@nicholaspai nicholaspai deleted the npai/deposit-id branch January 12, 2023 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants