-
Notifications
You must be signed in to change notification settings - Fork 130
Add the doc of resource reclamation upon undelegation #280
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
base: master
Are you sure you want to change the base?
Conversation
docs/mechanism-algorithm/resource.md
Outdated
| 当用户 X 取消对 用户 Y 的 200 TRX 的能量代理时: | ||
| ``` | ||
| 回收的未恢复能量数量 = 200 / 500 * 50 = 20 Energy |
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.
(200 / 500) * 50
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.
乘除运算遵循从左往右的计算顺序,是否加括号,结果都是一样的。为了更清晰,可以加上括号。
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.
呃 是为了和你之前给的公式 “回收的未恢复资源数量 = (取消代理的 TRX 数额 / 被代理方该资源的总质押数额) * 被代理方的未恢复资源量” 保持统一
docs/mechanism-algorithm/resource.md
Outdated
| 未恢复资源量 = 原未恢复资源量 - 回收的未恢复资源量 | ||
| ``` | ||
| **注意:** 资源被消耗后会在 24 小时内匀速线性地恢复。如果在恢复期间,账户再次使用资源或收回代理资源,系统会将原有的恢复进度与新的恢复周期进行加权合并。因此,账户资源重新回满所需的实际剩余时间通常会小于 24 小时。 |
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.
账户资源恢复满/账户资源全部恢复?
| ``` | ||
| 回收的未恢复资源数量 = (取消代理的 TRX 数额 / 被代理方该资源的总质押数额) * 被代理方的未恢复资源量 | ||
| ``` | ||
| **注意**:回收的未恢复资源数量,不得超过本次取消代理的 TRX 数量按当前全网实时质押量计算出的最大资源容量。 |
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.
这个"注意"部分是否可以删除,上述计算逻辑已经保证了“不会超过”。如下:
回收的未恢复资源数量 = (取消代理的 TRX 数额 / 被代理方该资源的总质押数额) * 被代理方的未恢复资源量
<=(取消代理的 TRX 数额 / 被代理方该资源的总质押数额) * (被代理方该资源的总质押数额 * 每单位质押TRX可以获取的资源)
<=取消代理的TRX 数额 * 每单位质押TRX可以获取的资源
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.
并不是你说的这样。需要有这个备注。可以再参考下这部分的代码。当被代理方使用量大,而当前可获得的能量少时,就需要这个约束了。
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.
意思是代码逻辑上存在 “被代理方的未恢复资源量 > 被代理方该资源的总质押数额 * 每单位质押TRX可以获取的资源” 的情形?
bretk1989
left a comment
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.
Needs to be reviewed and approved by me first and that's all networking changes or rules. Thank you
No description provided.