-
Notifications
You must be signed in to change notification settings - Fork 607
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
Implement clawback of airdrop from inactive genesis addresses #560
Conversation
Codecov Report
@@ Coverage Diff @@
## main #560 +/- ##
==========================================
- Coverage 20.31% 20.20% -0.12%
==========================================
Files 164 172 +8
Lines 23262 24141 +879
==========================================
+ Hits 4726 4878 +152
- Misses 17762 18469 +707
- Partials 774 794 +20
Continue to review full report at Codecov.
|
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.
Other than the questions asked above, looks lgtm!
|
@antstalepresh currently the claim module claws back the un-claimed coins from the |
@ValarDragon this should be added to this upgrade, in case we don't get another upgrade in by Dec 18 |
Yep, I marked it as a v5 upgrade checklist, would assign myself to go over the edge case @antstalepresh mentioned within today, tomorrow and get it merged as well! |
Sunny and I discussed today. Its probably not worth resolving that edge case (but a great catch to be aware of). The governance proposal's "letter of the law" interpretation clearly supports pruning the entire account. The "spirit of the proposal" is incredibly unclear, this edge case wasn't spelled out. But theres been no concern from the community about it. Would rather we focus on other things, instead of resolving it. |
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.
Cool! In that case, I think this PR is good to go, ready to merge!
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 corrected the test cases. @sunnya97 can you investigate failures. On scan appears to be clawing back from non-airdrop inactive addresses.
Also changes like this require updates to the spec. Please update the concepts.
Fixed |
x/claim/keeper/claim.go
Outdated
acc := k.accountKeeper.GetAccount(ctx, addr) | ||
if acc != nil { |
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'm trying to make sure I understand the prior bug. Why would it clawback from all accounts? (Or were the addresses just wrong)
Also is there any expected scenario where acc would be nil, or this is just in case something unexpected occurs?
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, it was doing the opposite. It wasn't clawing back from any accounts.
See original testcases:
https://github.com/osmosis-labs/osmosis/blob/cf7ba91f7bd74e6b9e7d3559f5e0e0ff9da87b8b/x/claim/keeper/claim_test.go
It's cause the function was exiting early, b/c as soon as it saw an account that wasn't in the account store it would error.
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.
Ahh that makes sense
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.
Airdrop addrs is a map that we iterate over. I'm concerned over determinism issues here. Lets update to not use a map, but instead a list of addresses. This bool
value in the map is not important. Its always true.
Also I made a commit adding more comments to the function, since edge cases, even if determined to not be worth doing, should at least be documented as such.
On further analysis, this non-determinism has pretty high risk of chain halts. The clawback deletes state entries. IAVL is deletion order dependent. My understanding is that the delete orders do get sorted by key prior to hitting IAVL in commit, but I'd definitely have to double check, and am quite hesistant to rely on that. |
Swapped map for an array |
LGTM, A second person should just verify the airdrop accounts (I have not), and then its good to merge. |
Checked the file, its good |
Closes: #553
Description
Implements the automatic clawback of all OSMO and ION from genesis airdrop recipients at the end of the claim period (6 months after genesis).
For more details, see Osmosis proposal 32: https://www.mintscan.io/osmosis/proposals/32
For contributor use:
docs/
) or specification (x/<module>/spec/
)Unreleased
section inCHANGELOG.md
Files changed
in the Github PR explorer