Giter Club home page Giter Club logo

Comments (1)

hongda3141 avatar hongda3141 commented on August 19, 2024

为了保证共识节点列表在一段时间内保持稳定,避免共识节点对当前有效的共识列表产生分歧,设定了以下几个规则:

抵押金额发生变动(抵押、追加、部分赎回和全部赎回)时,需新增一条 stake info。新增的 stake info 的 inauguration_era 必须等于当前引用的 {Checkpoint Cell}.era(即当前 era) + 2。加 2 是为了确保所有共识节点有充足的缓冲时间确定当前 era 和下一个 era 的共识列表。因此,同一个共识节点(以 Identity 标识)可能在列表中有多条 stake info,但是同一个节点不能有多条 inauguration_era 相同的 stake info。同一个 inauguration_era 的 stake info 数量不得超过 quorum_size
已生效的 stake info A 的定义是 A. inauguration_era <= {Checkpoint Cell}.era,且同一节点没有另外一条 stake info B,B. inauguration_era > A. inauguration_era && B. inauguration_era <= {Checkpoint Cell}.era,按 amount 金额从高到低排序,前 quorum_size 个 stake info 即为已生效的 stake info。简单来说就是在当前 era 下生效,且未被同一 identity 的其他生效的 era 覆盖的金额最多的前 quorum_size 个 stake info。所有已生效的 stake info 对应的节点,即为当前 era 下有效的共识节点
准生效的 stake info A 的定义是 A. inauguration_era <= {Checkpoint Cell}.era + 1,且同一节点没有另外一条 stake info B,B. inauguration_era > A. inauguration_era && B. inauguration_era <= {Checkpoint Cell}.era + 1,按 amount 金额从高到低排序,前 quorum_size 个 stake info 即为准生效的 stake info。简单来说就是在 era + 1 下生效,且未被同一 identity 的其他生效的 era 覆盖的金额最多的前 quorum_size 个 stake info。准生效的 stake info 对应的节点即为下一个 era 中有效的共识节点。已生效的 stake info 集合与准生效的集合一般会有交集
待生效的 stake info A 的定义是所有 inauguration_era > {Checkpoint Cell}.era + 1 的 stake info。待生效的 stake info 集合与已生效和准生效的集合没有交集
有效的 stake info 为已生效、准生效和待生效的集合的并集
除了有效的 stake info 之外的都是失效的 stake info。在 output 中需要删除失效的 stake info,确保 stake info 集合的大小不会超过 3* quorum_size
对于一个参与竞选的节点,其有效抵押金额的定义是,其所有有效的 stake info 集合中最大的 stake_amount。节点在进行抵押、追加或者赎回操作时,其 output 的 Stake AT Cell 的 amount 总额必须等于 output 的 Stake Cell 中有效的抵押金额
查询属于同一个 identity 的 input Stake AT Cell 和 output Stake AT Cell。若 output 的 amount 总额小于 input 的 amount 总额,则计算 output 中属于该 identity 的 Withdrawal AT Cell 的金额是否等于差额,其 period 是否等于引用的 Checkpoint Cell 的 period + unlock_period

。。

from cryptape_study_note.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.