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 blacklisted collateral #1343

Merged
merged 6 commits into from
Sep 9, 2022
Merged

feat: automatically clear blacklisted collateral #1343

merged 6 commits into from
Sep 9, 2022

Conversation

toteki
Copy link
Member

@toteki toteki commented Sep 7, 2022

Description

closes: #1223


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • added appropriate labels to the PR
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

@toteki toteki marked this pull request as ready for review September 7, 2022 06:29
@toteki toteki requested review from a team as code owners September 7, 2022 06:29
@codecov-commenter
Copy link

codecov-commenter commented Sep 7, 2022

Codecov Report

Merging #1343 (c496447) into main (b3a2e79) will decrease coverage by 0.18%.
The diff coverage is 68.75%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1343      +/-   ##
==========================================
- Coverage   52.47%   52.29%   -0.19%     
==========================================
  Files          70       70              
  Lines        6878     6812      -66     
==========================================
- Hits         3609     3562      -47     
+ Misses       2990     2976      -14     
+ Partials      279      274       -5     
Impacted Files Coverage Δ
x/leverage/keeper/filter.go 100.00% <ø> (ø)
x/leverage/keeper/genesis.go 3.00% <0.00%> (+0.41%) ⬆️
x/leverage/keeper/oracle.go 63.07% <0.00%> (+2.78%) ⬆️
x/leverage/keeper/supply.go 39.28% <0.00%> (ø)
x/leverage/keeper/iter.go 54.08% <33.33%> (-5.62%) ⬇️
x/leverage/keeper/reserves.go 67.07% <57.14%> (-4.20%) ⬇️
x/leverage/keeper/interest.go 68.18% <66.66%> (+0.68%) ⬆️
x/leverage/keeper/store.go 66.24% <70.86%> (-2.13%) ⬇️
x/leverage/keeper/keeper.go 65.79% <71.42%> (-0.13%) ⬇️
x/leverage/keeper/validate.go 73.52% <76.00%> (+11.50%) ⬆️
... and 9 more

CHANGELOG.md Show resolved Hide resolved
Copy link
Contributor

@RafilxTenfen RafilxTenfen left a comment

Choose a reason for hiding this comment

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

utACK

But I do have a question, why do we attempt to SweepBadDebts at the end of every block and not like at each some amount of blocks?

@toteki
Copy link
Member Author

toteki commented Sep 9, 2022

Right now we don't have any Epoch-like stuff in leverage module, but since bad debt sweeping doesn't have to be instantaneous we could add it.

For example, using BlockHeight() % 100 == 0 would result in a sweep every 10 minutes, and would probably be unimportant enough that we wouldn't need to add a parameter for the 100.

@mergify mergify bot merged commit 902ebae into main Sep 9, 2022
@mergify mergify bot deleted the adam/sweep branch September 9, 2022 16:00
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.

leverage: Clear blacklisted collateral when mark/sweeping bad debt
3 participants