Avalanche共识

更新时间:2023-06-25 23:43:58 阅读: 评论:0

shutterAvalanche 共识
1. 引⾔
爱护公物演讲稿
中介绍了Avalanche区块链平台采⽤的Avalanche共识。2012年考研英语作文
直观举例为:
房间⾥有很多⼈,⼤家⼀起决策中午是吃披萨还是烧烤。某些⼈初始可能选择披萨,另⼀些⼈初始选择烧烤。最终,⼤家的⽬的是达成共识。
每个⼈询问房间内的a random subt of people其希望午餐吃什么。若有多于⼀半选择披萨,则其也选择披萨——即采⽤其所询问的⼤多数⼈的选择。
每个⼈都重复以上过程,每轮,会有越来越多的⼈具有相同的选择。This is becau the more people that prefer an option, the more likely someone is to receive a majority reply and adopt that option as their preference. ⾜够轮数之后,可达成共识,每个⼈都选择同⼀选项。
2. Snowball
Snowball算法是Avalanche共识的基础。Snowball算法关键参数有::参与者数量(sample size):取值范围为1到(法定⼈数):取值范围为1到(decision threshold):Snowball算法伪代码⽰例为:
preference := pizzaall round
concutiveSuccess := 0
while not decided:
ask k random people their preference
杭州日语学校
if >= α give the same respon:
preference := respon with >= α
if preference == old preference:
concutiveSuccess++
el:
concutiveSuccess = 1
el:
concutiveSuccess = 0
if concutiveSuccess > β:
decide(preference)
具体⽰例可参看:
Snowball可⽤于对多个possible choices达成共识。
随着⽹络中节点数增加,Snowball具有可扩展性,其每次sample的size可仍然为。
3. DAG(有向⽆环图)
n k n
αk
β>=1
n k
publishersDAG可实现partial ordering of decisions。
如上图,可只a在b之前,b在d之前,c在e之前。根据传递性可知a在e之前。但是,所谓partial ordering,是指:某些元素之间的顺序是不确定的,如——⽆法确定b和c之间的顺序关系。DAG中相关的概念有:
ancestors:为DAG中可⽤线连上的节点,如上图中,的ancestors为,的ancestors为。
descendants:与ancestors相反,如上图中,的descendants为。的descendants为。
以太坊和⽐特币采⽤linear chain⽅式,每个block仅有⼀个parent和⼀个child。
但是,Avalanche采⽤DAG来存储数据,DAG中每个元素可能有多个parents。DAG中的parent-child relationship不代表application-level dependency。
为了避免在DAG中包含conflicting transactions,在Avalanche中定义了conflict t,Avalanche中的每
imperative
笔交易都属于⼀个conflict t,conflict t中只能有1笔交易可包含在DAG中,每个节点需prefer one transaction in a conflict t。
详细的可参看 。
4. Vertices
Ava Labs在对⽩⽪书中共识进⾏实现时,做了⼀定的优化来降低延迟和提⾼吞吐量。最⼤的优化是引⼊了vertices。kwas
vertex类似于linear blockchain中的区块,vertex中包含了the hashes of its parents 以及 a list of transactions。Vertices⽀持将多笔交易打包并被voted on in groups rather than one by one。
DAG由vertices组成。
若节点收到a vote for a vertex,则可认为是a vote for all the transactions in a vertex。votes具有可向上传递性。
A vertex is accepted when all the transactions which are in it are accepted. If a vertex contains a rejected transaction then it is rejected and all of its descendants are rejected. If a vertex is rejected,
猴子的英文
any valid transactions are re-issued into a new vertex which is not the child of a rejected vertex. New vertices are appended to preferred vertices.
5. Finality
d a ,b ,c
e a ,c a b ,c ,d ,e b d
Avalanche共识在⼀定的safety threshold具有probabilistically safe。即,the probability that a correct node accepts a transaction that another correct rejects can be made arbitrarily low by adjusting system parameters。
不同于以太坊和⽐特币需很长时间来等待区块固化,Avalanche中acceptance/rejection是final and irreversible的,仅需⼏秒钟。6. 优化
节点query new transaction的同时,也会不断query知道没有不善良的vertices。善良的vertex中没有conflicts。
节点也⽆需等待个query respons才register the outcome of a poll,因为若交易未获得 majority,则⽆需在等待剩余的respon 了。
7. Validator
要称为Validator,节点需质押AVAX,质押量越多,越容易被其他节点query,对⽹络的影响⼒会越⼤。
节点query时并不是uniformly random的,⽽是weighted by stake amount。
Avalanche没有slash,Validator作恶或者不响应并不会惩罚,其质押⾦到期仍将全额返还,只是没有reward。As long as a sufficient portion of the bonded AVAX is held by correct nodes,则⽹络是安全的,且is live for virtuous transactions。
8. 两⼤创新
Avalanche中的2⼤创新分别是:
subsampling:具有low message overhead。不随20个节点还是2000个节点影响,the number of connsus messages a node nds during a query remains constant。
transitive voting:即a vote for a vertex is a vote for all its ancestors,这样有助于提升交易吞吐量。each note is actually many votes in one。
如上图,a vote for vertex D,也是a vote for A,B,C。
9. Loo Ends
⽤户可调⽤ API或者直接使⽤ 的⽅式来发起交易。
基于以下2种情况,vertex将被创建并添加到DAG:
when nodes batch incoming transactions together。
when accepted transactions from a rejected vertex get reissued。
10. Snowman
可将以上Avalanche connsus protocol改为linear chain,即要求each vertex has only one parent,这样可确定vertices的全局排序,适⽤于如智能合约——one needs to know if a transaction came before another transaction。
Avalanche connsus protocol for linear chains的实现,称为Snowman,即对应的为C-Chain 和P-Chain采⽤的为Snowman共识。
Avalanche中没有leader,任意节点都可提交交易,任意质押AVAX的节点都可对每⼀笔交易进⾏投票,可make the network more robust and decentralized。
参考资料
[1]
>英语译中文

本文发布于:2023-06-25 23:43:58,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/90/157698.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:交易   节点   选择   质押   算法   区块   没有   共识
相关文章
留言与评论(共有 0 条评论)
   
验证码:
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图