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

feat: automatically clear unsupplied blacklisted tokens #1808

Merged
merged 10 commits into from
Feb 14, 2023
Merged

Conversation

toteki
Copy link
Member

@toteki toteki commented Feb 13, 2023

When a leverage registry update passes (regardless of whether it blacklisted any tokens), the module checks for any existing blacklisted tokens with zero supply and deletes them.

If supply is nonzero, deletion is not acceptable because the module would lose the ability to interpret existing uToken balances, reserves, borrows, etc for the blacklisted base denom.

@codecov-commenter
Copy link

Codecov Report

Merging #1808 (7fd870a) into main (7c04da0) will decrease coverage by 0.09%.
The diff coverage is 23.80%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1808      +/-   ##
==========================================
- Coverage   57.80%   57.72%   -0.09%     
==========================================
  Files          78       78              
  Lines        8023     8044      +21     
==========================================
+ Hits         4638     4643       +5     
- Misses       3047     3061      +14     
- Partials      338      340       +2     
Impacted Files Coverage Δ
x/leverage/keeper/token.go 54.09% <23.52%> (-11.82%) ⬇️
x/leverage/keeper/msg_server.go 79.13% <25.00%> (-0.64%) ⬇️

@toteki toteki marked this pull request as ready for review February 13, 2023 07:52
@toteki toteki requested review from a team as code owners February 13, 2023 07:52
Copy link
Member

@robert-zaremba robert-zaremba left a comment

Choose a reason for hiding this comment

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

Could you clarify when and why we want to remove tokens from the registry? Before you said that we don't want to do that. Let's discuss in the thread in the comment.

x/leverage/keeper/token.go Show resolved Hide resolved
Copy link
Collaborator

@adamewozniak adamewozniak left a comment

Choose a reason for hiding this comment

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

Might want to make this a bit more clear on the proposal side.

Let's add something like an "AttemptDelete" flag

Copy link
Member

@robert-zaremba robert-zaremba left a comment

Choose a reason for hiding this comment

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

Pre-approving. Added one small request in the thread

@toteki toteki merged commit 614d2c5 into main Feb 14, 2023
@toteki toteki deleted the adam/blacklist branch February 14, 2023 21:55
mergify bot pushed a commit that referenced this pull request Feb 14, 2023
* feat: automatically clear unsupplied blacklisted tokens

* cl++

* add oracle hooks call

* lint++

* README++

---------

Co-authored-by: Robert Zaremba <robert@zaremba.ch>
(cherry picked from commit 614d2c5)
toteki added a commit that referenced this pull request Feb 14, 2023
* feat: automatically clear unsupplied blacklisted tokens

* cl++

* add oracle hooks call

* lint++

* README++

---------

Co-authored-by: Robert Zaremba <robert@zaremba.ch>
(cherry picked from commit 614d2c5)

Co-authored-by: Adam Moser <63419657+toteki@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants