Documentation
¶
Overview ¶
Package ray finalizes linear chains through single-threaded consensus.
After focus accumulates β consecutive successes, Ray provides the final "yes/no" decision for the linear case. It's a single beam of light that marks a definitive state transition—bright, decisive, observable. This handles linear consensus finality.
Index ¶
- type Block
- type Chain
- type Config
- type Driver
- func (d *Driver[T]) GetPreference() (T, bool)
- func (d *Driver[T]) Height() uint64
- func (d *Driver[T]) IsFinalized(item T) bool
- func (d *Driver[T]) Propose(ctx context.Context, item T) error
- func (d *Driver[T]) Start(ctx context.Context) error
- func (d *Driver[T]) Stop(ctx context.Context) error
- func (d *Driver[T]) Tick(ctx context.Context) error
- type ID
- type Nova
- type Sink
- type Source
- type Transport
- type VM
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Block ¶
type Block interface {
ID() ids.ID
ParentID() ids.ID
Height() uint64
Bytes() []byte
Verify(context.Context) error
Accept(context.Context) error
Reject(context.Context) error
}
Block defines a block
type Chain ¶
type Chain interface {
// GetBlock gets a block
GetBlock(context.Context, ids.ID) (Block, error)
// AddBlock adds a block
AddBlock(Block) error
// LastAccepted returns last accepted block
LastAccepted() ids.ID
// GetAncestor gets an ancestor
GetAncestor(ids.ID, uint64) (ids.ID, error)
}
Chain defines a blockchain
type Driver ¶
type Driver[T ID] struct { // contains filtered or unexported fields }
func (*Driver[T]) GetPreference ¶
GetPreference returns the current preferred item
func (*Driver[T]) IsFinalized ¶
IsFinalized checks if an item is finalized
type Nova ¶
type Nova struct {
// contains filtered or unexported fields
}
Nova implements the Nova consensus protocol
type Transport ¶
type Transport[T ID] interface { RequestVotes(ctx context.Context, peers []types.NodeID, item T) <-chan wave.Photon[T] MakeLocalPhoton(item T, prefer bool) wave.Photon[T] }
Transport bridges network vote requests <-> Photons the Wave consumes.
type VM ¶
type VM interface {
// ParseBlock parses a block
ParseBlock(context.Context, []byte) (Block, error)
// BuildBlock builds a block
BuildBlock(context.Context) (Block, error)
// GetBlock gets a block
GetBlock(context.Context, ids.ID) (Block, error)
// SetPreference sets preferred block
SetPreference(context.Context, ids.ID) error
// LastAccepted returns last accepted block ID
LastAccepted(context.Context) (ids.ID, error)
}
VM defines a chain VM
Click to show internal directories.
Click to hide internal directories.