Skip to content

Conversation

@mrice32
Copy link
Contributor

@mrice32 mrice32 commented Feb 25, 2022

This change is mostly just simplifying. It allows the same logic to be performed but with fewer overridden methods in each SpokePool implementation and more of the implementation work done in the base class. There is also a unified modifier that all SpokePool implementations should use to gate admin functions: onlyAdmin.

Signed-off-by: Matt Rice <matthewcrice32@gmail.com>
Signed-off-by: Matt Rice <matthewcrice32@gmail.com>
Signed-off-by: Matt Rice <matthewcrice32@gmail.com>
bool enabled
) internal {
) public override onlyAdmin nonReentrant {
_requireAdminSender();
Copy link
Member

Choose a reason for hiding this comment

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

Why call both _requireAdminSender() and use the onlyAdmin modifier aren't these redundant?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes! That's a mistake.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.


function _setDepositQuoteTimeBuffer(uint32 _depositQuoteTimeBuffer) internal {
function setDepositQuoteTimeBuffer(uint32 _depositQuoteTimeBuffer) public override onlyAdmin nonReentrant {
_requireAdminSender();
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

// Once this method is executed and a distribution root is stored in this contract, then `distributeRootBundle`
// can be called to execute each leaf in the root.
function relayRootBundle(bytes32 relayerRefundRoot, bytes32 slowRelayRoot) public override onlyAdmin nonReentrant {
_requireAdminSender();
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

Copy link
Member

@nicholaspai nicholaspai left a comment

Choose a reason for hiding this comment

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

Really like this pattern but I think you have some redundant calls

@mrice32
Copy link
Contributor Author

mrice32 commented Feb 25, 2022

Really like this pattern but I think you have some redundant calls

Agreed. Thank you for pointing these out. I originally was just going to do a method call, then I moved to a modifier. Forgot to clean up the old calls.

Signed-off-by: Matt Rice <matthewcrice32@gmail.com>
@mrice32 mrice32 merged commit 5cc595e into master Feb 26, 2022
@mrice32 mrice32 deleted the spokepool branch February 26, 2022 23:02
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.

3 participants