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

fork模板抵押赎回规则 #526

Open
sunhantao opened this issue May 7, 2020 · 1 comment
Open

fork模板抵押赎回规则 #526

sunhantao opened this issue May 7, 2020 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@sunhantao
Copy link
Collaborator

  • 创建fork需要抵押10w token
  • 赎回抵押的token,从创建fork的交易上链块高度H0开始,以60 * 24 * 90 = 129600个高度为衰减周期T(三个月),每次剩余锁定token衰减50%。
  • 计算高度为H1时的剩余锁定token公式:

@sunhantao sunhantao added the enhancement New feature or request label May 7, 2020
@sunhantao sunhantao self-assigned this May 7, 2020
@sunhantao
Copy link
Collaborator Author

sunhantao commented May 9, 2020

  • fork的joint必须是最长链30个高度以前。这样可以避免回滚导致joint失效,进而fork失效的情况。一旦出现该情况,代码并未处理。
  • forkmanager和forkdb的数据一一对应。forkdb新增一个inactive开头的数据,用于记录由于回滚导致的失效fork
  • 发送到fork模板的交易强校验,交易必须在当前能创建合法fork
  • fork的赎回不检查fork地址上的余额,只检查当前交易的vin >= amount + lock + txfee。相应的wallet对于赎回交易组织合法的input
  • 对于fork的回滚,不删除既有数据。在forkdb和CForkContextEx中记录其有效性,并做相应处理和判断。
  • txpool处理fork交易回滚的情况
  • service处理fork交易回滚。wallet不处理,由wallet的调用上层service来控制。
  • blockbase对于失效fork做标记,blockview可以提取fork交易

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant