Documentation ¶
Index ¶
- func Launch(eventBroker wire.EventBroker, c committee.Foldable, keys user.Keys)
- func MarshalStepVotes(r *bytes.Buffer, vote *StepVotes) error
- func MarshalVotes(r *bytes.Buffer, votes []*StepVotes) error
- func MockAgreement(hash []byte, round uint64, step uint8, keys []user.Keys) *bytes.Buffer
- func MockCommittee(quorum int, isMember bool, membersNr int) (*mocks.Foldable, []user.Keys)
- func ReconstructApk(subcommittee sortedset.Set) (*bls.Apk, error)
- func Sign(a *Agreement, keys user.Keys) error
- func UnmarshalVotes(r *bytes.Buffer, votes *[]*StepVotes) error
- func VerifySignatures(round uint64, step uint8, blockHash []byte, apk *bls.Apk, sig *bls.Signature) error
- type Agreement
- type StepVotes
- type UnMarshaller
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Launch ¶
Launch is a helper to minimize the wiring of TopicListeners, collector and channels. The agreement component notarizes the new blocks after having collected a quorum of votes
func MarshalStepVotes ¶
MarshalStepVotes marshals the aggregated form of the BLS PublicKey and Signature for an ordered set of votes
func MarshalVotes ¶
MarshalVotes marshals an array of StepVotes
func MockAgreement ¶
MockAgreement mocks an Agreement event, and returns the marshalled representation of it as a `*bytes.Buffer`. NOTE: it does not include the topic
func MockCommittee ¶
MockCommittee mocks a Foldable committee implementation, which can be used for testing the Agreement component.
func ReconstructApk ¶
ReconstructApk reconstructs an aggregated BLS public key from a subcommittee.
func UnmarshalVotes ¶
UnmarshalVotes unmarshals the array of StepVotes for a single Agreement
Types ¶
type Agreement ¶
Agreement is the Event created at the end of the Reduction process. It includes the aggregated compressed signatures of all voters
func MockAgreementEvent ¶
MockAgreementEvent returns a mocked Agreement Event, to be used for testing purposes.
type StepVotes ¶
StepVotes represents the aggregated votes for one reduction step. Normally an Agreement event includes two of these structures. They need to be kept separated since the BitSet representation of the Signees does not admit duplicates, whereas the same provisioner may very well be included in the committee for both Reduction steps
func NewStepVotes ¶
func NewStepVotes() *StepVotes
NewStepVotes returns a new StepVotes structure for a given round, step and block hash
func UnmarshalStepVotes ¶
UnmarshalStepVotes unmarshals a single StepVote
type UnMarshaller ¶
type UnMarshaller struct { *header.UnMarshaller wire.EventMarshaller wire.EventUnmarshaller }
UnMarshaller marshals and unmarshals Agreement events.
func NewUnMarshaller ¶
func NewUnMarshaller() *UnMarshaller
NewUnMarshaller returns an initialized UnMarshaller.
func (*UnMarshaller) Deserialize ¶
Deserialize an Agreement event from a buffer to its struct representation.