gossiper

package
v0.0.0-...-7781947 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 20, 2024 License: BSD-3-Clause Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Gossiper

type Gossiper interface {
	Run(common.AppSender)
	TriggerGossip(context.Context) error // may be triggered by run already
	HandleAppGossip(ctx context.Context, nodeID ids.NodeID, msg []byte) error
	Done() // wait after stop
}

type Manual

type Manual struct {
	// contains filtered or unexported fields
}

func NewManual

func NewManual(vm VM) *Manual

func (*Manual) Done

func (g *Manual) Done()

func (*Manual) HandleAppGossip

func (g *Manual) HandleAppGossip(ctx context.Context, nodeID ids.NodeID, msg []byte) error

func (*Manual) Run

func (g *Manual) Run(appSender common.AppSender)

func (*Manual) TriggerGossip

func (g *Manual) TriggerGossip(ctx context.Context) error

type Proposer

type Proposer struct {
	// contains filtered or unexported fields
}

func NewProposer

func NewProposer(vm VM, cfg *ProposerConfig) *Proposer

func (*Proposer) Done

func (g *Proposer) Done()

func (*Proposer) HandleAppGossip

func (g *Proposer) HandleAppGossip(ctx context.Context, nodeID ids.NodeID, msg []byte) error

func (*Proposer) Run

func (g *Proposer) Run(appSender common.AppSender)

periodically but less aggressively force-regossip the pending

func (*Proposer) TriggerGossip

func (g *Proposer) TriggerGossip(ctx context.Context) error

Triggers "AppGossip" on the pending transactions in the mempool. "force" is true to re-gossip whether recently gossiped or not

type ProposerConfig

type ProposerConfig struct {
	GossipProposerDiff  int
	GossipProposerDepth int
	GossipInterval      time.Duration
	GossipPeerCacheSize int
	GossipMinLife       int64 // seconds
	BuildProposerDiff   int
}

func DefaultProposerConfig

func DefaultProposerConfig() *ProposerConfig

type VM

type VM interface {
	ChainID() ids.ID
	StopChan() chan struct{}
	Tracer() trace.Tracer
	Mempool() chain.Mempool
	Proposers(ctx context.Context, diff int, depth int) (set.Set[ids.NodeID], error)
	IsValidator(context.Context, ids.NodeID) (bool, error)
	Logger() logging.Logger
	PreferredBlock(context.Context) (*chain.StatelessBlock, error)
	Registry() (chain.ActionRegistry, chain.AuthRegistry)
	NodeID() ids.NodeID
	Rules(int64) chain.Rules
	Submit(ctx context.Context, verify bool, txs []*chain.Transaction) []error
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL