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

refactor(timelock): change submittedAt to validAt #292

Merged
merged 7 commits into from
Nov 9, 2023

Conversation

Rubilmax
Copy link
Contributor

@Rubilmax Rubilmax commented Nov 2, 2023

@Rubilmax Rubilmax linked an issue Nov 2, 2023 that may be closed by this pull request
@Rubilmax Rubilmax marked this pull request as ready for review November 2, 2023 14:01
Copy link
Contributor

@Jean-Grimal Jean-Grimal left a comment

Choose a reason for hiding this comment

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

I'd rather stay with the current version though

src/libraries/PendingLib.sol Outdated Show resolved Hide resolved
src/libraries/PendingLib.sol Outdated Show resolved Hide resolved
src/libraries/PendingLib.sol Outdated Show resolved Hide resolved
@Rubilmax
Copy link
Contributor Author

Rubilmax commented Nov 2, 2023

I'd rather stay with the current version though

But there's a bug with it, see the associated issue
What specifically don't you like about the new version? We can modify things to find a compromise

@Jean-Grimal
Copy link
Contributor

I'd rather stay with the current version though

But there's a bug with it, see the associated issue What specifically don't you like about the new version? We can modify things to find a compromise

Oh yes sorry I was mistaken. I understand the issue now

Base automatically changed from revert/revert/refactor/remove-expiration to cantina-review November 3, 2023 11:22
@MerlinEgalite
Copy link
Contributor

@Rubilmax can you update this PR please?

Copy link
Contributor

@MerlinEgalite MerlinEgalite left a comment

Choose a reason for hiding this comment

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

I think the events haven't been updated though

@Rubilmax Rubilmax force-pushed the refactor/timelock-submittedAt branch from ed465ae to 206ab5e Compare November 7, 2023 14:00
Copy link
Contributor

@QGarchery QGarchery left a comment

Choose a reason for hiding this comment

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

Adding 6 tests 💪

A few minor suggestions but I like this implementation !

src/MetaMorpho.sol Outdated Show resolved Hide resolved
src/interfaces/IMetaMorpho.sol Outdated Show resolved Hide resolved
src/libraries/PendingLib.sol Outdated Show resolved Hide resolved
@Rubilmax
Copy link
Contributor Author

Rubilmax commented Nov 7, 2023

Adding 6 tests 💪

A few minor suggestions but I like this implementation !

4 of them will actually be removed in #256 🫢

src/MetaMorpho.sol Show resolved Hide resolved
src/libraries/PendingLib.sol Outdated Show resolved Hide resolved
@Rubilmax Rubilmax changed the base branch from cantina-review to refactor/interfaces-3 November 7, 2023 17:52
Base automatically changed from refactor/interfaces-3 to cantina-review November 9, 2023 07:00
@MerlinEgalite MerlinEgalite merged commit 7416d5f into cantina-review Nov 9, 2023
6 checks passed
@MerlinEgalite MerlinEgalite deleted the refactor/timelock-submittedAt branch November 9, 2023 12:29
@StErMi
Copy link

StErMi commented Nov 9, 2023

@MerlinEgalite just to recap the changes

  • the owner now cannot directly influence the timelock of existing pending proposals (already scheduled) by calling submitTimelock(newTimelock) where newTimelock > timelock
  • the owner can still influence every pending proposal by executing submit*. He can also pass the very same already proposed value.
  • the owner can anyway revoke the pending proposal and propose a new one (not in this PR, but there's another PR that makes the owner part of the guardian role)

PS: is there a PR that does not allow setting the same values for the current active pending proposals?
TLDR the main difference is that the duration of the timelock is stored in the pending proposal when it's created and submitTimelock(newTimelock) cannot directly influence an already scheduled pending proposal even if the timelock is instantly changed or pendingTimelock is approved.

@MerlinEgalite
Copy link
Contributor

  • the owner now cannot directly influence the timelock of existing pending proposals (already scheduled) by calling submitTimelock(newTimelock) where newTimelock > timelock
  • the owner can still influence every pending proposal by executing submit*. He can also pass the very same already proposed value.
  • the owner can anyway revoke the pending proposal and propose a new one (not in this PR, but there's another PR that makes the owner part of the guardian role)

This is exact in the current state of this PR.

PS: is there a PR that does not allow setting the same values for the current active pending proposals? TLDR the main difference is that the duration of the timelock is stored in the pending proposal when it's created and submitTimelock(newTimelock) cannot directly influence an already scheduled pending proposal even if the timelock is instantly changed or pendingTimelock is approved.

yes there's such PR here: #295

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.

Unpredictable timelock mechanism
5 participants