-
Notifications
You must be signed in to change notification settings - Fork 216
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
TIP-541: Support canceling unstaking in Stake 2.0 #541
Comments
The reason why the system contract did not implement this interface and the smart contract was implemented is because there is a possibility of suicide in the smart contract. In order to achieve contract suicide, the unfrozen queue must be cancelled first, and the system contract does not have this concern. At present, the unfrozen delay in receiving accounts is 14 days, which may not be very convenient for some users. Adding this interface is also necessary. |
Looks good, if it is going to be adopted, do you need to open a proposal for voting? |
Need to add a new transaction type to support it , I think this needs to use the proposal enable the feature. |
I am glad to get yes and thumbs from you guys, so now I will try to create a proposal to suggest the dev team adopting this TIP issue. |
I see that the implementation of the I'm not sure whether this can meet the needs of most users. Some people may prefer to specify a few of the unstakings to cancel. What do you think? In addition, can users accept that the unstaked TRX that have expired being withdrawn to the balance? Or should these resources be re-staked regardless of whether they are expired or not? I think these issues need further discussion, let's hear everyone's opinions. |
@lxcmyf please consider adding in an option to re-allocate frozen TRX to either bandwidth or energy when cancelling an unstake. Or making a discrete api call that would allow that re-allocation. Its is difficult if a user decides they need more bandwidth or energy and need to undergo a 14 day waiting period in order to rebalance. If it is believe there needs to be some holding period then I would propose that maybe a user could re-allocate after a 2-3 unstake period but something shorter than 14 days. Again this could be worked into the unstake cancel, where if a call to cancel an unstake is more than three days after the initial unstake call then the user would also have the option to select a resource type to freeze to. |
Thank you for your suggestion. We will preliminarily evaluate it for possible use on the chain in the future. |
The main reason to cancel the unstaking would be to get a certain amount back to resources. It would be beneficial if we could reallocate the canceled amount to either the energy or the bandwidth. |
Yes, as you said. |
In the tron network, system contracts often synchronize the implementation of smart contracts. The smart contract has already implemented |
Yes, it is acceptable, cancelling all the unfreeze TRX in waiting period is also compatible with the TVM instructions, well enough. |
@lxcmyf, the next java version should also have an endpoint to switch trx staked for energy to bandwidth and vice versa without unstaking. |
@otakuinny That is something that could be considered in the future planning. |
Close this issue as it is implemented by GreatVoyage-v4.7.2. |
Simple Summary
Add an API in Stake 2.0 to allow users to cancel the unstaking transactions in the waiting period.
Abstract
To be consistent with TVM instructions in Stake 2.0, it is proposed to add an API to support canceling unstaking in Stake 2.0, which means that users can use this API to cancel unstaking in waiting period time, make the unstaking TRX restaked, and meanwhile help users withdraw the TRX expired waiting period to balance.
Motivation
Stake 2.0 has been launched on TRON mainnet, one of the changes is that there is a waiting period of 14 days after unstaking. As said in this issue, if users misoperate the unstaking transaction, or they change their mind during the waiting period and want to restake the TRX for earnings, for now, they can do nothing but wait for 14 days. This is detrimental to the user's benefit and the staking rate of TRX on the chain.
Meanwhile, as Stake 2.0 has already supported TVM instructions to cancel the unstakings in the smart contract, I think it is reasonable to add an API in Stake 2.0 to cancel the unstaking transactions.
Specifications
Add
wallet/cancelallunfreezev2
API, the user can call this API to cancel all the ongoing unstaking transactions in the waiting period.Params:
owner_address
- address of transaction initiator, data type is stringvisible
- whether the address is in base58 format, data type is boolReturns: unsigned transaction, data type is json string
Example:
Backward Compatibility
It will not influence the existed staking and unstaking related transactions.
The text was updated successfully, but these errors were encountered: