Documentation ¶
Index ¶
- func ValidateRewards(rewards []types.AnyReward) error
- type CertConfig
- type Certifier
- func (c *Certifier) CertCount() map[types.EpochID]int
- func (c *Certifier) CertifyIfEligible(ctx context.Context, lid types.LayerID, bid types.BlockID) error
- func (c *Certifier) HandleCertifyMessage(ctx context.Context, peer p2p.Peer, data []byte) error
- func (c *Certifier) HandleSyncedCertificate(ctx context.Context, lid types.LayerID, cert *types.Certificate) error
- func (c *Certifier) NumCached() int
- func (c *Certifier) Register(sig *signing.EdSigner)
- func (c *Certifier) RegisterForCert(ctx context.Context, lid types.LayerID, bid types.BlockID) error
- func (c *Certifier) Start(ctx context.Context)
- 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 `mapstructure:"committee-size"` 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 *sql.Database, o eligibility.Rolacle, v *signing.EdVerifier, 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, 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 (*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 WithCertifierLogger ¶ added in v1.0.0
func WithCertifierLogger(logger *zap.Logger) CertifierOpt
WithCertifierLogger defines logger for Certifier.
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( db *sql.Database, atxs *atxsdata.Data, proposals *store.Store, 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 WithGeneratorLogger ¶ added in v1.0.0
func WithGeneratorLogger(logger *zap.Logger) GeneratorOpt
WithGeneratorLogger defines logger for Generator.
func WithHareOutputChan ¶ added in v1.0.0
func WithHareOutputChan(ch <-chan hare4.ConsensusOutput) 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.