-
Notifications
You must be signed in to change notification settings - Fork 21
feat(x/gov): dynamic deposit increases only with proposal activation, and decreases only with time #105
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(x/gov): dynamic deposit increases only with proposal activation, and decreases only with time #105
Conversation
Do you want to update the ADR in this PR or should we do it in a separate one ? I would rather see the change in this PR so everything is bundled. |
Yes I was thinking the same |
docs/architecture/adr-003-governance-proposal-deposit-auto-throttler.md
Outdated
Show resolved
Hide resolved
docs/architecture/adr-003-governance-proposal-deposit-auto-throttler.md
Outdated
Show resolved
Hide resolved
In a naive implementation for time-based updates every $T$ time has elapsed (a *tick*) the current value of $n_t$ should be used to calculate $D_t$. Having the accurate $D_t$ available to query at all times is important to be able to correctly submit a proposal. | ||
But in reality, all we need to know is when $n_t$ **actually** changed the last time (which happens when proposals enter or leave the active proposals queue, and in itself also trigger a `MinDeposit` update), and how much time has passed since then, anytime the $D_t$ value is requested. | ||
In a naive implementation for time-based decreases every $T$ time has elapsed (a *tick*) the current value of $n_t$ should be used to calculate $D_t$. Having the accurate $D_t$ available to query at all times is important to be able to correctly submit a proposal. | ||
But in reality, all we need to know is when $n_t$ **actually** changed the last time (which happens when proposals enters the active proposals queue, and in itself also trigger a `MinDeposit` increase), and how much time has passed since then, anytime the $D_t$ value is requested. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this optimization has been discarded right ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to remove it from the ADR though. The ADR just states it's possible, and present the mathematical relation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In fact, I removed the section talking about it in the implementation.
…ottler.md Co-authored-by: Thomas Bruyelle <thomas.bruyelle@tendermint.com>
…ottler.md Co-authored-by: Thomas Bruyelle <thomas.bruyelle@tendermint.com>
State was not reinitialized between test cases, which was confusing for some scenario and forced sometimes to reset things like the deposit throttling. The fix consists only of calling `suite.reset()` in `KeeperTestSuite.SetupSubTest()`, the other changes removes any correlation previously made by the test cases about this common state.
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This PR is based on #104
Based on discussions, this is a revised model for the dynamic deposit that:
Plus, remove the sensitivity to the distance for increases.
This PR should be merged only after #104 is (or in its stead). Moreover, if this PR is accepted, the partially overlapping PR #103 can be closed.
Importantly, this PR does not yet update neither the
x/gov
README.md nor the Dynamic Deposit ADR to reflect these changes, so it needs to be done.