-
Notifications
You must be signed in to change notification settings - Fork 106
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
go/staking: add minimum transfer amount #4456
Conversation
73877b0
to
13d27ae
Compare
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 guess this needs fixgenesis support, otherwise it looks fine to me.
hm, maybe I should perform the check on withdraw too, for symmetry |
adding to fixgenesis: the proposal is to set it to 1 base unit. this particular change is mostly to prevent zero-amount transfers from creating useless empty accounts. |
08759c0
to
fb01783
Compare
rearranged checks: now compares with min transfer amount parameter after IsSimulation bail, similar to min delegation amount check. added similar check to withdraw (same parameter) |
Should this be applied to |
I don't think allow is problematic (as it only updates the account's allowance, a zero allowance is ignored and the total number of allowances per account is already limited), the more important thing is withdraw (which seems to be handled in this PR). |
For burn we could just ignore burning a zero amount as that results in a useless event to be emitted. I guess an additional question is whether we would want to require a minimum balance to remain in an account, otherwise operations fail? Otherwise one can just do this at no cost (besides gas fees):
|
.changelog/4456.feature.md
Outdated
@@ -0,0 +1,4 @@ | |||
go/staking: Add minimum transfer amount |
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.
This is a breaking change to the consensus protocol.
we should do the other transactions as well. it's not so much that allow, for example, won't really charge the allowances table, but moreso that we have to create an account and start tracking the nonce after a successful transaction |
let's have the minimum balance thing in a separate PR. |
True, but this basically applies to any successfully authenticated transaction even though it doesn't deal with tokens (besides paying for fees). So this would basically imply a minimum account balance, because the check would need to be "you need to have at least X in your account before you can make any transaction"? |
yeah, not sure if there's another mitigation for allow |
fb01783
to
ad2ee1a
Compare
added similar check (same parameter) to burn adjusted ordering of checks in withdraw to check amount before consulting transfers disablement 🤷 |
let's leave allow and others as is and proceed to draft a minimum balance requirement \: |
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 looks good. Just change that feature entry to breaking.
ad2ee1a
to
2611e4e
Compare
2611e4e
to
51af43d
Compare
we discussed this further yesterday, and I'll be changing the minimum amount |
2e1d5fe
to
2cfa37b
Compare
2cfa37b
to
2e9becb
Compare
Codecov Report
@@ Coverage Diff @@
## master #4456 +/- ##
==========================================
+ Coverage 68.78% 68.84% +0.05%
==========================================
Files 424 424
Lines 47359 47366 +7
==========================================
+ Hits 32576 32608 +32
+ Misses 10762 10739 -23
+ Partials 4021 4019 -2
Continue to review full report at Codecov.
|
summary of changes after review:
|
cross reference: https://oasisprotocol.clickup.com/t/1zfn2hb