Documentation
¶
Index ¶
Constants ¶
View Source
const MaxByzantine = 0.33
MaxByzantine is the maximum fraction of malicious nodes we can tolerate BFT requires n > 3f, so with f malicious we need 3f+1 total
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BFTAggregator ¶
type BFTAggregator struct {
// contains filtered or unexported fields
}
BFTAggregator aggregates reports with Byzantine fault tolerance
func NewBFTAggregator ¶
func NewBFTAggregator(minWitnesses int) *BFTAggregator
NewBFTAggregator creates a BFT-aware aggregator
func (*BFTAggregator) AddReport ¶
func (a *BFTAggregator) AddReport(report *SignedReport) bool
AddReport adds a signed report after verification
func (*BFTAggregator) CanTolerate ¶
func (a *BFTAggregator) CanTolerate() int
CanTolerate returns how many byzantine nodes we can handle
type Keypair ¶
type Keypair struct {
Public ed25519.PublicKey
Private ed25519.PrivateKey
}
Keypair manages witness identity
func GenerateKeypair ¶
GenerateKeypair creates a new witness identity
type SignedReport ¶
type SignedReport struct {
Witness types.NodeID
Target types.NodeID
Belief types.Belief
Timestamp uint64
Signature []byte
PublicKey ed25519.PublicKey
}
SignedReport is a witness report with cryptographic signature
func (*SignedReport) Verify ¶
func (r *SignedReport) Verify() bool
Verify checks if signature is valid
Click to show internal directories.
Click to hide internal directories.