Documentation
¶
Index ¶
- func BytesFromTimeoutVote(t *Timeout, author string, vote *TimeoutVote) []byte
- type BlockData
- func (x *BlockData) Bytes() ([]byte, error)
- func (x *BlockData) GetParentRound() uint64
- func (x *BlockData) GetRound() uint64
- func (x *BlockData) GetVersion() types.ABVersion
- func (x *BlockData) Hash(algo gocrypto.Hash) ([]byte, error)
- func (x *BlockData) IsValid() error
- func (x *BlockData) MarshalCBOR() ([]byte, error)
- func (x *BlockData) String() string
- func (x *BlockData) UnmarshalCBOR(data []byte) error
- func (x *BlockData) Verify(tb types.RootTrustBase) error
- type CertRequestVerifier
- type IRChangeReason
- type IRChangeReq
- type Payload
- type QuorumCert
- type RequestVerifier
- type RoundInfo
- func (x *RoundInfo) GetParentRound() uint64
- func (x *RoundInfo) GetRound() uint64
- func (x *RoundInfo) GetVersion() types.ABVersion
- func (x *RoundInfo) Hash(hash gocrypto.Hash) ([]byte, error)
- func (x *RoundInfo) IsValid() error
- func (x *RoundInfo) MarshalCBOR() ([]byte, error)
- func (x *RoundInfo) UnmarshalCBOR(data []byte) error
- type Timeout
- type TimeoutCert
- func (x *TimeoutCert) Add(author string, timeout *Timeout, signature []byte) error
- func (x *TimeoutCert) GetAuthors() []string
- func (x *TimeoutCert) GetHqcRound() uint64
- func (x *TimeoutCert) GetRound() uint64
- func (x *TimeoutCert) IsValid() error
- func (x *TimeoutCert) Verify(tb types.RootTrustBase) error
- type TimeoutVote
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesFromTimeoutVote ¶
func BytesFromTimeoutVote(t *Timeout, author string, vote *TimeoutVote) []byte
Types ¶
type BlockData ¶
type BlockData struct { Version types.ABVersion Author string `json:"author"` // NodeIdentifier of the proposer Round uint64 `json:"round"` // Root round number Epoch uint64 `json:"epoch"` // Epoch to establish valid configuration Timestamp uint64 `json:"timestamp"` Payload *Payload `json:"payload"` // Payload that will trigger changes to the state // quorum certificate for ancestor // before payload can be applied check that local state matches state in qc // qc.vote_info.proposed.state_hash == h(UC[]) Qc *QuorumCert `json:"qc"` // contains filtered or unexported fields }
func (*BlockData) GetParentRound ¶
func (*BlockData) GetVersion ¶
func (*BlockData) MarshalCBOR ¶
func (*BlockData) UnmarshalCBOR ¶
type CertRequestVerifier ¶
type IRChangeReason ¶
type IRChangeReason uint8
const ( Quorum IRChangeReason = iota QuorumNotPossible T2Timeout )
func (IRChangeReason) String ¶
func (r IRChangeReason) String() string
type IRChangeReq ¶
type IRChangeReq struct { Partition types.PartitionID Shard types.ShardID CertReason IRChangeReason // IR change (quorum or no quorum possible of block certification requests) Requests []*certification.BlockCertificationRequest // contains filtered or unexported fields }
func (*IRChangeReq) IsValid ¶
func (x *IRChangeReq) IsValid() error
func (*IRChangeReq) String ¶
func (x *IRChangeReq) String() string
func (*IRChangeReq) Verify ¶
func (x *IRChangeReq) Verify(tb RequestVerifier, luc *types.UnicityCertificate, round, t2InRounds uint64) (*types.InputRecord, error)
type Payload ¶
type Payload struct { Requests []*IRChangeReq `json:"requests"` // IR change requests with quorum or no quorum possible // contains filtered or unexported fields }
type QuorumCert ¶
type QuorumCert struct { VoteInfo *RoundInfo `json:"voteInfo"` // Consensus data LedgerCommitInfo *types.UnicitySeal `json:"ledgerCommitInfo"` // Commit info Signatures map[string]hex.Bytes `json:"signatures"` // Node identifier to signature map (NB! aggregated signature schema in spec) // contains filtered or unexported fields }
func NewQuorumCertificate ¶
func NewQuorumCertificate(voteInfo *RoundInfo, commitHash []byte) (*QuorumCert, error)
func NewQuorumCertificateFromVote ¶
func NewQuorumCertificateFromVote(voteInfo *RoundInfo, commitInfo *types.UnicitySeal, signatures map[string]hex.Bytes) *QuorumCert
func (*QuorumCert) GetCommitRound ¶
func (x *QuorumCert) GetCommitRound() uint64
func (*QuorumCert) GetParentRound ¶
func (x *QuorumCert) GetParentRound() uint64
func (*QuorumCert) GetRound ¶
func (x *QuorumCert) GetRound() uint64
func (*QuorumCert) IsValid ¶
func (x *QuorumCert) IsValid() error
func (*QuorumCert) SignatureBytes ¶
func (x *QuorumCert) SignatureBytes() []byte
SignatureBytes serializes signatures.
func (*QuorumCert) Verify ¶
func (x *QuorumCert) Verify(tb types.RootTrustBase) error
type RequestVerifier ¶
type RequestVerifier interface { GetQuorum() uint64 GetTotalNodes() uint64 ValidRequest(req *certification.BlockCertificationRequest) error }
type RoundInfo ¶
type RoundInfo struct { Version types.ABVersion RoundNumber uint64 `json:"rootChainRoundNumber"` Epoch uint64 `json:"rootEpoch"` Timestamp uint64 `json:"timestamp"` ParentRoundNumber uint64 `json:"rootChainParentRoundNumber"` CurrentRootHash hex.Bytes `json:"currentRootHash"` // contains filtered or unexported fields }
func (*RoundInfo) GetParentRound ¶
func (*RoundInfo) GetVersion ¶
func (*RoundInfo) MarshalCBOR ¶
func (*RoundInfo) UnmarshalCBOR ¶
type Timeout ¶
type Timeout struct { Epoch uint64 `json:"epoch"` // Epoch to establish valid configuration Round uint64 `json:"round"` // Root round number HighQc *QuorumCert `json:"highQc"` // Highest quorum certificate of the validator // contains filtered or unexported fields }
func NewTimeout ¶
func NewTimeout(round, epoch uint64, hqc *QuorumCert) *Timeout
NewTimeout creates new Timeout for round (epoch) and highest QC seen
func (*Timeout) GetHqcRound ¶
type TimeoutCert ¶
type TimeoutCert struct { Timeout *Timeout `json:"timeout"` // Round and epoch of the timeout event Signatures map[string]*TimeoutVote `json:"signatures"` // 2f+1 signatures from nodes confirming TC // contains filtered or unexported fields }
func (*TimeoutCert) Add ¶
func (x *TimeoutCert) Add(author string, timeout *Timeout, signature []byte) error
func (*TimeoutCert) GetAuthors ¶
func (x *TimeoutCert) GetAuthors() []string
func (*TimeoutCert) GetHqcRound ¶
func (x *TimeoutCert) GetHqcRound() uint64
func (*TimeoutCert) GetRound ¶
func (x *TimeoutCert) GetRound() uint64
func (*TimeoutCert) IsValid ¶
func (x *TimeoutCert) IsValid() error
func (*TimeoutCert) Verify ¶
func (x *TimeoutCert) Verify(tb types.RootTrustBase) error
type TimeoutVote ¶
Click to show internal directories.
Click to hide internal directories.