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

Feat/588 timelocks #988

Closed
wants to merge 20 commits into from
Closed

Conversation

Ramarti
Copy link
Contributor

@Ramarti Ramarti commented Nov 5, 2021

Adds timelocked action execution in accordance to issue #558

  • Timelocked (delayed) actions are defined by using the method setActionDelay in VaultAuthorizer
  • setActionDelay is in itself a delayed action, initially set with a delay of 1h
  • Only a special kind of contract, DelayedCall can trigger a delayed action
  • DelayedCalls are deployed calling VaultAuthorizer.deployDelayedCall by an account with permission granted for the actionId that would be triggered by DelayedCall
  • DelayedCalls trigger can be permissionless or restricted to accounts with global permission granted for the correspondent actionId. This option is set when deploying them.
  • DelayedCalls cancellation is restricted to accounts with global permission granted for the correspondent actionId

@nventuro
Copy link
Contributor

nventuro commented Nov 5, 2021

(I force-pushed a revised history where only the new commits are added, as squash-merging doesn't play nice with using branchs this way, particularly when merging back to the feature branch)

Copy link
Contributor

@TomAFrench TomAFrench left a comment

Choose a reason for hiding this comment

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

Hey Raúl 👋. Was having a quick snoop through this PR and I have a question about the permissioning for delayed actions.

DelayedCalls are deployed calling VaultAuthorizer.deployDelayedCall by an account with global permission granted for the actionId that would be triggered by DelayedCall

Considering we know the value of where for the DelayedCall to be deployed why would we not allow users for which AccessControl.hasRole(actionId, account, where) == true queue up this action?

pkg/vault/contracts/Authorizer.sol Outdated Show resolved Hide resolved
pkg/vault/contracts/Authorizer.sol Show resolved Hide resolved
pkg/vault/contracts/DelayedCall.sol Outdated Show resolved Hide resolved
@Ramarti
Copy link
Contributor Author

Ramarti commented Nov 8, 2021

Hey Raúl wave. Was having a quick snoop through this PR and I have a question about the permissioning for delayed actions.

DelayedCalls are deployed calling VaultAuthorizer.deployDelayedCall by an account with global permission granted for the actionId that would be triggered by DelayedCall

Considering we know the value of where for the DelayedCall to be deployed why would we not allow users for which AccessControl.hasRole(actionId, account, where) == true queue up this action?

Hi Tom, actually I just described it incorrectly, the method does actually allow for specific contracts:

    function deployDelayedCall(
        bytes32 actionId,
        address where,
        uint256 value,
        bytes calldata data,
        bool permissionedTrigger
    ) external returns (address) {
        require(AccessControl.hasRole(actionId, msg.sender, where), "Invalid permission");
        uint256 delay = _actionDelays[actionId];
        require(delay > 0, "Not a delayed action");
        DelayedCall delayedCall = new DelayedCall(data, where, value, this, this, permissionedTrigger, actionId);
        _delayedCalls[actionId].add(address(delayedCall));
        emit DelayedCallScheduled(actionId, address(delayedCall), where, value, data, delay);
        return address(delayedCall);
    }
    

I'm going to update the description

@nventuro
Copy link
Contributor

nventuro commented Feb 2, 2022

@facuspagnuolo is basing his work on the authorizer revamp milestone on this and other unmerged PRs, closing as this will be superceded by those.

@nventuro nventuro closed this Feb 2, 2022
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