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

Unpredictable timelock mechanism #267

Closed
QGarchery opened this issue Oct 25, 2023 · 2 comments · Fixed by #292
Closed

Unpredictable timelock mechanism #267

QGarchery opened this issue Oct 25, 2023 · 2 comments · Fixed by #292
Assignees

Comments

@QGarchery
Copy link
Contributor

The issue highlighted in https://github.com/cantinasec/review-morpho-blue-1/pull/68#discussion_r1367673403 seems to be fixed with #259. But actually this is a deeper issue where timelock of pending values are variable which can be unexpected. Consider the following scenario:

  1. Let's say the timelock is initially of 1 week, mark the current time as t
  2. People agree to change the timelock to 1 day, a pending value is submitted at t, with the intent that it is effective at t + 7
  3. 3 days later, at t + 3, people agree to increase the fee, with the intent that it is effective at t + 10
  4. At t + 7 the timelock is accepted
  5. After that (starting at t + 7 and beyond) the fee can be increased

I think that we should change the submittedAt field of pending values to a validFrom field that would store block.timestamp + timelock and the moment where the pending value is set

@MerlinEgalite
Copy link
Contributor

Or we can say that the intent below is not correct since timelock update is ongoing and the users should take it into account

3 days later, at t + 3, people agree to increase the fee, with the intent that it is effective at t + 10

@QGarchery
Copy link
Contributor Author

QGarchery commented Oct 27, 2023

Or we can say that the intent below is not correct since timelock update is ongoing and the users should take it into account

Ok, but then what should be the intent ? It's not easy to convey it because the pending timelock is not set in stone either. If I'm voting and agreeing on a change I want to know when that change is going to be effective. It's not wrong in itself, but it's unpredictable for no reason (I don't think the purpose of changing the timelock is to change the ETA of ongoing pending values)

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 a pull request may close this issue.

3 participants