-
Notifications
You must be signed in to change notification settings - Fork 94
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
Deactivation of platform coin also deactivates its tokens, for all platforms #1641
Comments
I checked the day it was implemented for IRIS and IRIS_IBC, that other protocol tokens arent deactivated when parent is deactivated, and it was only for IRIS. I check again checked now on mobile, and you can deactivate them separately. Only IRIS/IRIS_IBC behaves like that from the coins I tested with.
Also, you can still activate all protocols separately. Except SLPs, IRISs |
@yurii-khi @ologunB thanks for the question! We deactivate tokens if only they were activated via
This is done because such tokens are completely dependent on the platform coins. If the token is activated via the legacy |
Ok, got it now, thanks @sergeyboyko0791 for clarification. We're not using legacy |
Yes, right
|
This is considered a global bug - please fix. Expected behaviour: If i try to disable a "parental chain" (EMV, tendermint, etc) mm2 should either disable only the coin-specific interface / functionalities however not fully remove it from the mm2 runtime scope since otherwise tokens running on these "parental chains" just get killed although this is not intended by the user. This means, handle coin/token activation states independently of the "parental-chain" dependencies to prevent such situations. In our case and in regards to the resource-limitation I think it should be sufficient to execute a small refactoring towards the below pseudo-code logic - so we technically fake what I requested above and just gimmick a "coin-deactivation" but in reality we keep the parental chain running in case there is a active "child token" in the runtime scope - otherwise we can kill it.
Note: Obviously for future iterations and as resources free up it d make sense to further polish this layer. e.g. where mm2 "just knows when to kill a parental chain, when to launch it, also maybe in idle mode to spin up a few syncing threads to update pub-key related data thats not even in the "active_coins" scope, et cetera" and basically doing everything in the background and without the user/GUI asking for it. I am sure you know what I mean. But yea, thats the god-level polishing phase for after the v1 release, so we have exciting times ahead for the coming year or two :) NB: Please feel free to propose a diff. refactoring / fix - the above should just be taken as inspiration/hints and independent feedback ref. dev friendly interface expectations. But its a bug and needs take care of so GUI-devs/cli-users don't end up having to do this kind of sanity checks. |
As mentioned in the corresponding WebDEX issue, we can return an error if platform coin has active dependent tokens (with a list of them). This way, the API will do all required sanity checks and provide a clear feedback on what's wrong. |
This makes sense! I'd also add the
|
I prepared a fix. Now we return an error if there are dependent tokens and |
Does it fix inconsistent behaviour of I believe, it would be much better if we allow disabling parent coin without disabling children, like suggested in #1641 (comment) |
The most practical way to avoid destroying child contexts of platform coins may be to implement a soft kill/delete algorithm. This would allow us to passive the related coin rather than completely dropping it from the memory. For example, if we have three tokens and one platform coin enabled, disabling the platform coin would only make it invisible to the outside, but it would remain in memory for future use cases involving token operations. The coin would only be dropped from memory once all of its tokens have been disabled. There are two ways to implement this: We could create a new RPC called "soft_disable" so that the GUI can prompt the user to either turn off all tokens of the platform coin or simply disable the coin itself while keeping the tokens. Alternatively, we could handle this behind the scenes without exposing a new RPC. Let me know your opinions so I can start the implementation. |
I like this option more, I don't think we should add a new RPC. |
cc @ca333 |
Not sure if bug of feature, but after #1493,
disable_coin
RPC for platform coin (e.g.BNB
) also automatically deactivates all its tokens (e.g.KMD-BEP20
). Looks like it work like this for all platforms/tokens, including ERC-20, BEP-20 etc.Question is: is it an expected behaviour and apps should handle it on gui side for all platforms?
Related: https://github.com/KomodoPlatform/WebDEX/issues/815
cc: @ologunB
The text was updated successfully, but these errors were encountered: