gossip

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2020 License: AGPL-3.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MagicValidNewTip = "convertedFromGossip3"

TODO: Delete me when done with gossip 3 dark traffic testing!

View Source
var ZeroVoteID = "n"

Functions

func ComputeProfitWeights

func ComputeProfitWeights(responses []*Vote) map[string]float64

func Normalize

func Normalize(weights map[string]float64) map[string]float64

Types

type AddBlockWrapper

type AddBlockWrapper struct {
	tracing.ContextHolder
	*g4services.AddBlockRequest
	// contains filtered or unexported fields
}

AddBlockWrapper wraps an addblock request so that it can be traced through the system. currently exported so that the g3->g4 can use it

type NewNodeOptions

type NewNodeOptions struct {
	P2PNode          p2p.Node
	SignKey          *bls.SignKey
	NotaryGroup      *types.NotaryGroup
	DagStore         nodestore.DagStore
	Datastore        datastore.Batching
	Name             string             // optional
	RootActorContext *actor.RootContext // optional
}

type Node

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

func NewNode

func NewNode(ctx context.Context, opts *NewNodeOptions) (*Node, error)

func (*Node) Bootstrap

func (n *Node) Bootstrap(ctx context.Context, bootstrapAddrs []string) error

func (*Node) Close

func (n *Node) Close() error

func (*Node) PID

func (n *Node) PID() *actor.PID

func (*Node) Receive

func (n *Node) Receive(actorContext actor.Context)

func (*Node) SnowBallReceive

func (n *Node) SnowBallReceive(actorContext actor.Context)

func (*Node) Start

func (n *Node) Start(ctx context.Context) error

type Snowball

type Snowball struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewSnowball

func NewSnowball(alpha float64, beta int, k int) *Snowball

func (*Snowball) Decided

func (s *Snowball) Decided() bool

func (*Snowball) Prefer

func (s *Snowball) Prefer(v *Vote)

func (*Snowball) PreferInLock

func (s *Snowball) PreferInLock(v *Vote)

PreferInLock is ONLY for contexts in which you already hold a write lock

func (*Snowball) Preferred

func (s *Snowball) Preferred() *Vote

func (*Snowball) Progress

func (s *Snowball) Progress() int

func (*Snowball) Reset

func (s *Snowball) Reset()

func (*Snowball) Tick

func (s *Snowball) Tick(startCtx context.Context, votes []*Vote)

type TransactionValidator

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

TransactionValidator validates incoming pubsub messages for internal consistency and sends them to the gossip4 node. It is exported for the gossip3to4 module

func NewTransactionValidator

func NewTransactionValidator(ctx context.Context, logger logging.EventLogger, group *types.NotaryGroup, node *actor.PID) (*TransactionValidator, error)

NewTransactionValidator creates a new TransactionValidator

func (*TransactionValidator) ValidateAbr

func (tv *TransactionValidator) ValidateAbr(validateCtx context.Context, abr *services.AddBlockRequest) bool

type Vote

type Vote struct {
	Checkpoint *types.CheckpointWrapper
	// contains filtered or unexported fields
}

func (*Vote) Copy

func (v *Vote) Copy() *Vote

func (*Vote) ID

func (v *Vote) ID() string

func (*Vote) Length

func (v *Vote) Length() float64

func (*Vote) Nil

func (v *Vote) Nil()

func (*Vote) SetTally

func (v *Vote) SetTally(n float64)

func (*Vote) Tally

func (v *Vote) Tally() float64

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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