Documentation ¶
Index ¶
- func ValidateRewards(rewards []types.AnyReward) error
- type CertConfig
- type Certifier
- func (c *Certifier) CertifyIfEligible(ctx context.Context, logger log.Log, lid types.LayerID, bid types.BlockID) error
- func (c *Certifier) HandleCertifyMessage(ctx context.Context, peer p2p.Peer, msg []byte) pubsub.ValidationResult
- func (c *Certifier) HandleSyncedCertificate(ctx context.Context, lid types.LayerID, cert *types.Certificate) error
- func (c *Certifier) NumCached() int
- func (c *Certifier) RegisterForCert(ctx context.Context, lid types.LayerID, bid types.BlockID) error
- func (c *Certifier) Start()
- func (c *Certifier) Stop()
- type CertifierOpt
- type Config
- type Generator
- type GeneratorOpt
- type Handler
- type Opt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateRewards ¶ added in v1.0.0
ValidateRewards syntactically validates rewards.
Types ¶
type CertConfig ¶ added in v1.0.0
type CertConfig struct { CommitteeSize int CertifyThreshold int LayerBuffer uint32 NumLayersToKeep uint32 }
CertConfig is the config for Certifier.
type Certifier ¶ added in v1.0.0
type Certifier struct {
// contains filtered or unexported fields
}
Certifier collects enough CertifyMessage for a given hare output and generate certificate.
func NewCertifier ¶ added in v1.0.0
func NewCertifier( db *datastore.CachedDB, o hare.Rolacle, n types.NodeID, s *signing.EdSigner, pke *signing.PubKeyExtractor, p pubsub.Publisher, lc layerClock, b system.BeaconGetter, tortoise system.Tortoise, opts ...CertifierOpt, ) *Certifier
NewCertifier creates new block certifier.
func (*Certifier) CertifyIfEligible ¶ added in v1.0.0
func (c *Certifier) CertifyIfEligible(ctx context.Context, logger log.Log, lid types.LayerID, bid types.BlockID) error
CertifyIfEligible signs the hare output, along with its role proof as a certifier, and gossip the CertifyMessage if the node is eligible to be a certifier.
func (*Certifier) HandleCertifyMessage ¶ added in v1.0.0
func (c *Certifier) HandleCertifyMessage(ctx context.Context, peer p2p.Peer, msg []byte) pubsub.ValidationResult
HandleCertifyMessage is the gossip receiver for certify message.
func (*Certifier) HandleSyncedCertificate ¶ added in v1.0.0
func (c *Certifier) HandleSyncedCertificate(ctx context.Context, lid types.LayerID, cert *types.Certificate) error
HandleSyncedCertificate handles Certificate from sync.
func (*Certifier) NumCached ¶ added in v1.0.0
NumCached returns the number of layers being cached in memory.
func (*Certifier) RegisterForCert ¶ added in v1.0.0
func (c *Certifier) RegisterForCert(ctx context.Context, lid types.LayerID, bid types.BlockID) error
RegisterForCert register to generate a certificate for the specified layer/block.
type CertifierOpt ¶ added in v1.0.0
type CertifierOpt func(*Certifier)
CertifierOpt for configuring Certifier.
func WithCertConfig ¶ added in v1.0.0
func WithCertConfig(cfg CertConfig) CertifierOpt
WithCertConfig defines cfg for Certifier.
func WithCertContext ¶ added in v1.0.0
func WithCertContext(ctx context.Context) CertifierOpt
WithCertContext modifies parent context for Certifier.
func WithCertifierLogger ¶ added in v1.0.0
func WithCertifierLogger(logger log.Log) CertifierOpt
WithCertifierLogger defines logger for Certifier.
type Config ¶
type Config struct { LayerSize uint32 LayersPerEpoch uint32 GenBlockInterval time.Duration BlockGasLimit uint64 OptFilterThreshold int }
Config is the config for Generator.
type Generator ¶ added in v1.0.0
type Generator struct {
// contains filtered or unexported fields
}
Generator generates a block from proposals.
func NewGenerator ¶ added in v1.0.0
func NewGenerator( cdb *datastore.CachedDB, exec executor, m meshProvider, f system.ProposalFetcher, c certifier, p layerPatrol, opts ...GeneratorOpt, ) *Generator
NewGenerator creates new block generator.
type GeneratorOpt ¶ added in v1.0.0
type GeneratorOpt func(*Generator)
GeneratorOpt for configuring Generator.
func WithConfig ¶ added in v1.0.0
func WithConfig(cfg Config) GeneratorOpt
WithConfig defines cfg for Generator.
func WithContext ¶ added in v1.0.0
func WithContext(ctx context.Context) GeneratorOpt
WithContext modifies default context.
func WithGeneratorLogger ¶ added in v1.0.0
func WithGeneratorLogger(logger log.Log) GeneratorOpt
WithGeneratorLogger defines logger for Generator.
func WithHareOutputChan ¶ added in v1.0.0
func WithHareOutputChan(ch chan hare.LayerOutput) GeneratorOpt
WithHareOutputChan sets the chan to listen to hare output.
type Handler ¶ added in v1.0.0
type Handler struct {
// contains filtered or unexported fields
}
Handler processes Block fetched from peers during sync.
func NewHandler ¶ added in v1.0.0
NewHandler creates new Handler.