-
Notifications
You must be signed in to change notification settings - Fork 6
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
Asset group #34
base: main
Are you sure you want to change the base?
Asset group #34
Conversation
@@ -1343,7 +1343,7 @@ fn test_register_limiter_after_having_liquidity() { | |||
t.contract | |||
.execute( | |||
&ExecMsg::RegisterLimiter { | |||
denom: COSMOS_USDC.to_string(), | |||
scope: Scope::Denom(COSMOS_USDC.to_string()), |
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.
Does this test need replicated for a Group
scope?
&self, | ||
ExecCtx { deps, env: _, info }: ExecCtx, | ||
label: String, |
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.
nit: Can this label be an empty string?
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.
shouldn't, will catht that.
|
||
// ensure that all denoms are valid pool assets | ||
for denom in &denoms { | ||
ensure!( |
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.
Is there a DOS vector here if I add an asset group with the same asset a ton of times? Might be worth enforcing uniqueness of elements
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.
Few comments otherwise LGTM!
nice catches, will fix them! |
This PR introduce concept of
scope
for limiter and upcoming rebalancing incentivescope
can be eitherdenom
orasset_group
which can practically represent source chain or bridge. This is what changed in registering limiter:scope
can be prefixed with eitherdenom::
orasset_group::
to differentiate the scope variant.In order to specify an
asset_group
as scope, it creating new group is requriedit can also be removed, and the associated limiters will we removed along with it
mark_corrupted_assets
&unmark_corrupted_assets
also changed tomark_corrupted_scopes
&unmark_corrupted_scopes
The assets that are within the corrupted scopes will be removed from the pool when the amount reaches 0 as before. The reference to the specific asset that is corrupted and reaches 0 will also be removed from
asset_group
. Once asset group emptied, it is also automatically removed.