Documentation
¶
Index ¶
- func VerifyDualCertificates(block *Block, blsPK []byte, rtPK []byte) error
- type AncestorTracker
- type Block
- func (b *Block) Accept() error
- func (b *Block) AttachCertificates(blsAgg [96]byte, rtCert []byte) error
- func (b *Block) BLSSignature() []byte
- func (b *Block) Bytes() []byte
- func (b *Block) HasDualCert() bool
- func (b *Block) Height() uint64
- func (b *Block) ID() ids.ID
- func (b *Block) Parent() ids.ID
- func (b *Block) RTCertificate() []byte
- func (b *Block) Reject() error
- func (b *Block) SetQuantum() error
- func (b *Block) SetStatus(status choices.Status)
- func (b *Block) Status() choices.Status
- func (b *Block) Timestamp() int64
- func (b *Block) Verify() error
- type CertBundle
- type Config
- type Engine
- type Parameters
- type PrecompPool
- type Quasar
- type QuasarConfig
- type Sender
- type SlashEvent
- type StartupTracker
- type Timer
- type VM
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AncestorTracker ¶
type AncestorTracker interface {
// Add adds a block to track
Add(blkID ids.ID) error
// Remove removes a block from tracking
Remove(blkID ids.ID) error
// IsAncestor returns true if ancestor is an ancestor of descendant
IsAncestor(ancestor, descendant ids.ID) (bool, error)
}
AncestorTracker tracks block ancestors
type Block ¶
type Block struct {
PrntID ids.ID
Hght uint64
Tmstmp int64
ProposerID ids.NodeID
TxList [][]byte
Certs CertBundle
// contains filtered or unexported fields
}
Block represents a block in the Beam consensus
func BuildBlock ¶
func BuildBlock( parentID ids.ID, height uint64, timestamp int64, proposerID ids.NodeID, txs [][]byte, ) *Block
BuildBlock creates a new block
func (*Block) AttachCertificates ¶
AttachCertificates attaches dual certificates to a block
func (*Block) BLSSignature ¶
BLSSignature returns the BLS aggregate signature
func (*Block) HasDualCert ¶
HasDualCert returns true if both BLS and RT certificates are present
func (*Block) RTCertificate ¶
RTCertificate returns the Ringtail certificate
func (*Block) SetQuantum ¶
SetQuantum marks this block as having quantum-secure finality
type CertBundle ¶
type CertBundle struct {
BLSAgg [96]byte // BLS aggregate signature
RTCert []byte // Ringtail certificate (~3KB)
}
CertBundle contains dual certificates for quantum security
type Config ¶
type Config struct {
// Consensus parameters
Params Parameters
StartupTracker StartupTracker
Sender Sender
Timer Timer
AncestorTracker AncestorTracker
// Quantum parameters
QuasarEnabled bool
QuasarTimeout time.Duration
RingtailThreshold int
}
Config contains the configuration for the Beam engine
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine implements the Beam consensus engine
func (*Engine) BuildBlock ¶
BuildBlock builds a new block
func (*Engine) GetSlashChannel ¶
func (e *Engine) GetSlashChannel() <-chan SlashEvent
GetSlashChannel returns the slash event channel
type Parameters ¶
type Parameters struct {
K int // Sample size
AlphaPreference int // Preference threshold
AlphaConfidence int // Confidence threshold
Beta int // Decision threshold
MaxItemProcessingTime time.Duration // Max time to process an item
}
Parameters contains consensus parameters
func (Parameters) Valid ¶
func (p Parameters) Valid() error
Valid returns true if the parameters are valid
type PrecompPool ¶
type PrecompPool struct {
// contains filtered or unexported fields
}
PrecompPool manages precomputed Ringtail data
func NewPrecompPool ¶
func NewPrecompPool(capacity int) *PrecompPool
NewPrecompPool creates a new precomputation pool
type Quasar ¶
type Quasar struct {
// contains filtered or unexported fields
}
Quasar manages quantum-secure consensus operations
func (*Quasar) RegisterForCertificate ¶
RegisterForCertificate registers to receive a certificate when ready
type QuasarConfig ¶
type QuasarConfig struct {
Threshold int
QuasarTimeout time.Duration
Validators validators.State
}
QuasarConfig contains Quasar configuration
type Sender ¶
type Sender interface {
// SendGetAncestors sends a GetAncestors message
SendGetAncestors(ctx context.Context, nodeID ids.NodeID, requestID uint32, containerID ids.ID) error
// SendPullQuery sends a PullQuery message
SendPullQuery(ctx context.Context, nodeIDs set.Set[ids.NodeID], requestID uint32, containerID ids.ID) error
// SendPushQuery sends a PushQuery message
SendPushQuery(ctx context.Context, nodeIDs set.Set[ids.NodeID], requestID uint32, container []byte) error
// SendChits sends a Chits message
SendChits(ctx context.Context, nodeID ids.NodeID, requestID uint32, preferredID ids.ID, acceptedID ids.ID) error
}
Sender sends consensus messages
type SlashEvent ¶
SlashEvent represents a slashing event
type StartupTracker ¶
type StartupTracker interface {
Started() bool
}
StartupTracker tracks if the node is started
type Timer ¶
type Timer interface {
// SetTimeout sets a timeout
SetTimeout(duration time.Duration) error
// Cancel cancels the current timeout
Cancel() error
}
Timer manages timeouts
type VM ¶
type VM interface {
// GetBlock returns the block with the given ID
GetBlock(context.Context, ids.ID) (quasar.Block, error)
// BuildBlock builds a new block
BuildBlock(context.Context) (quasar.Block, error)
// SetPreference sets the preferred block
SetPreference(context.Context, ids.ID) error
// LastAccepted returns the last accepted block
LastAccepted(context.Context) (ids.ID, error)
// VerifyWithContext verifies a block with context
VerifyWithContext(context.Context, quasar.Block) error
}
VM is the interface for the virtual machine