Casper CBC: cbc-casper-js

description

each validator has the same weight 100 and random starting point (estimation) 0 or 1

choose from and to randomly, and send the message with from's estimation (consensus value) and justification (latest messages) to to until consensus achieved

consensus will achieve if and only if the ratio of the weights of all validators who are safe vs. those who are not has certain level or more

estimation will be safe if and only if safety ratio obtained by safety oracle has certain level or more

example

./casper.js random -n 3

simulation

check that the ratio of safe validators is grater or equals to? overallRatio

select from and to from validators randomly

sender: set myself as sender

get estimate (= decide the most voted consensus value by validators' weight) from the messages

justification: set getLatestMsgHashes() as justification

receive and parseMsg(msgHash)

verifyMsgHashLazyDeep()

verify messages recursively

from.getEstimate()

getEstimateFromMsgs()

from.findSafety() from the estimation

Given an estimate, return the ratio of the weights of all validators who are safe vs. those who are not

get estimate, safety ratio, and safe or not for each validator

write output

verifyMsgHash

justificationEstimateIsValid

justificationHasDuplicates

findEquivocation

findSafety

WIP

memo

message

sender

estimate

justification

estimate

by estimator

justification

hashes of latest messages from each validator

estimator

from messages to most voted message