-
Notifications
You must be signed in to change notification settings - Fork 27
Types
HagarMeir edited this page May 20, 2019
·
15 revisions
A Proposal
is the subject on which all nodes need to reach consensus.
Proposal {
Payload []byte
Header []byte
Metadata []byte
}
A View
has a designated leader and followers. It runs all three phases (prePrepare, prepare, and commit) on the proposals. It can abort on demand.
View {
Propose(p Proposal)
OnReceive(m Message)
Abort()
}
The Consensus
runs the different views, proposes values and delivers the decisions. It also aborts views when they must be changed.
Consensus {
ViewBuilder
View
ViewChanged(id int)
}
The ViewBuilder
helps Consensus
building new views.
ViewBuilder {
BuildView(id int, members []int, d Decider, vc ViewChanger) View
}
The Decider
delivers the decisions (agreed proposals and signatures) to the Consensus
.
Decider {
Decide(p Proposal, signatures []Signature)
}
The ViewChanger
collects the requests to change the current view and runs the view change protocol when needed. It informs the Consensus
of the new view.
ViewChanger {
ChangeView(id int, members []int)
}
The Timeouter
Timeouter {
StartTimer(Duration, func) Cancel
}
A Signature
.
Signature {
Id uint64
Value []byte
}