sender

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2020 License: BSD-3-Clause Imports: 7 Imported by: 15

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExternalSender

type ExternalSender interface {
	GetAcceptedFrontier(validatorIDs ids.ShortSet, chainID ids.ID, requestID uint32, deadline time.Time)
	AcceptedFrontier(validatorID ids.ShortID, chainID ids.ID, requestID uint32, containerIDs []ids.ID)

	GetAccepted(validatorIDs ids.ShortSet, chainID ids.ID, requestID uint32, deadline time.Time, containerIDs []ids.ID)
	Accepted(validatorID ids.ShortID, chainID ids.ID, requestID uint32, containerIDs []ids.ID)

	GetAncestors(validatorID ids.ShortID, chainID ids.ID, requestID uint32, deadline time.Time, containerID ids.ID)
	MultiPut(validatorID ids.ShortID, chainID ids.ID, requestID uint32, containers [][]byte)

	Get(validatorID ids.ShortID, chainID ids.ID, requestID uint32, deadline time.Time, containerID ids.ID)
	Put(validatorID ids.ShortID, chainID ids.ID, requestID uint32, containerID ids.ID, container []byte)

	PushQuery(validatorIDs ids.ShortSet, chainID ids.ID, requestID uint32, deadline time.Time, containerID ids.ID, container []byte)
	PullQuery(validatorIDs ids.ShortSet, chainID ids.ID, requestID uint32, deadline time.Time, containerID ids.ID)
	Chits(validatorID ids.ShortID, chainID ids.ID, requestID uint32, votes []ids.ID)

	Gossip(chainID ids.ID, containerID ids.ID, container []byte)
}

ExternalSender sends consensus messages to other validators Right now this is implemented in the networking package

type ExternalSenderTest

type ExternalSenderTest struct {
	T *testing.T
	B *testing.B

	CantGetAcceptedFrontier, CantAcceptedFrontier,
	CantGetAccepted, CantAccepted,
	CantGetAncestors, CantMultiPut,
	CantGet, CantPut,
	CantPullQuery, CantPushQuery, CantChits,
	CantGossip bool

	GetAcceptedFrontierF func(validatorIDs ids.ShortSet, chainID ids.ID, requestID uint32, deadline time.Time)
	AcceptedFrontierF    func(validatorID ids.ShortID, chainID ids.ID, requestID uint32, containerIDs []ids.ID)

	GetAcceptedF func(validatorIDs ids.ShortSet, chainID ids.ID, requestID uint32, deadline time.Time, containerIDs []ids.ID)
	AcceptedF    func(validatorID ids.ShortID, chainID ids.ID, requestID uint32, containerIDs []ids.ID)

	GetAncestorsF func(validatorID ids.ShortID, chainID ids.ID, requestID uint32, deadline time.Time, containerID ids.ID)
	MultiPutF     func(validatorID ids.ShortID, chainID ids.ID, requestID uint32, containers [][]byte)

	GetF func(validatorID ids.ShortID, chainID ids.ID, requestID uint32, deadline time.Time, containerID ids.ID)
	PutF func(validatorID ids.ShortID, chainID ids.ID, requestID uint32, containerID ids.ID, container []byte)

	PushQueryF func(validatorIDs ids.ShortSet, chainID ids.ID, requestID uint32, deadline time.Time, containerID ids.ID, container []byte)
	PullQueryF func(validatorIDs ids.ShortSet, chainID ids.ID, requestID uint32, deadline time.Time, containerID ids.ID)
	ChitsF     func(validatorID ids.ShortID, chainID ids.ID, requestID uint32, votes []ids.ID)

	GossipF func(chainID ids.ID, containerID ids.ID, container []byte)
}

ExternalSenderTest is a test sender

func (*ExternalSenderTest) Accepted

func (s *ExternalSenderTest) Accepted(validatorID ids.ShortID, chainID ids.ID, requestID uint32, containerIDs []ids.ID)

Accepted calls AcceptedF if it was initialized. If it wasn't initialized and this function shouldn't be called and testing was initialized, then testing will fail.

func (*ExternalSenderTest) AcceptedFrontier

func (s *ExternalSenderTest) AcceptedFrontier(validatorID ids.ShortID, chainID ids.ID, requestID uint32, containerIDs []ids.ID)

AcceptedFrontier calls AcceptedFrontierF if it was initialized. If it wasn't initialized and this function shouldn't be called and testing was initialized, then testing will fail.

func (*ExternalSenderTest) Chits

func (s *ExternalSenderTest) Chits(vdr ids.ShortID, chainID ids.ID, requestID uint32, votes []ids.ID)

Chits calls ChitsF if it was initialized. If it wasn't initialized and this function shouldn't be called and testing was initialized, then testing will fail.

func (*ExternalSenderTest) Default

func (s *ExternalSenderTest) Default(cant bool)

Default set the default callable value to [cant]

func (*ExternalSenderTest) Get

func (s *ExternalSenderTest) Get(vdr ids.ShortID, chainID ids.ID, requestID uint32, deadline time.Time, vtxID ids.ID)

Get calls GetF if it was initialized. If it wasn't initialized and this function shouldn't be called and testing was initialized, then testing will fail.

func (*ExternalSenderTest) GetAccepted

func (s *ExternalSenderTest) GetAccepted(validatorIDs ids.ShortSet, chainID ids.ID, requestID uint32, deadline time.Time, containerIDs []ids.ID)

GetAccepted calls GetAcceptedF if it was initialized. If it wasn't initialized and this function shouldn't be called and testing was initialized, then testing will fail.

func (*ExternalSenderTest) GetAcceptedFrontier

func (s *ExternalSenderTest) GetAcceptedFrontier(validatorIDs ids.ShortSet, chainID ids.ID, requestID uint32, deadline time.Time)

GetAcceptedFrontier calls GetAcceptedFrontierF if it was initialized. If it wasn't initialized and this function shouldn't be called and testing was initialized, then testing will fail.

func (*ExternalSenderTest) GetAncestors added in v0.8.0

func (s *ExternalSenderTest) GetAncestors(vdr ids.ShortID, chainID ids.ID, requestID uint32, deadline time.Time, vtxID ids.ID)

GetAncestors calls GetAncestorsF if it was initialized. If it wasn't initialized and this function shouldn't be called and testing was initialized, then testing will fail.

func (*ExternalSenderTest) Gossip added in v0.8.0

func (s *ExternalSenderTest) Gossip(chainID ids.ID, containerID ids.ID, container []byte)

Gossip calls GossipF if it was initialized. If it wasn't initialized and this function shouldn't be called and testing was initialized, then testing will fail.

func (*ExternalSenderTest) MultiPut added in v0.8.0

func (s *ExternalSenderTest) MultiPut(vdr ids.ShortID, chainID ids.ID, requestID uint32, vtxs [][]byte)

MultiPut calls MultiPutF if it was initialized. If it wasn't initialized and this function shouldn't be called and testing was initialized, then testing will fail.

func (*ExternalSenderTest) PullQuery

func (s *ExternalSenderTest) PullQuery(vdrs ids.ShortSet, chainID ids.ID, requestID uint32, deadline time.Time, vtxID ids.ID)

PullQuery calls PullQueryF if it was initialized. If it wasn't initialized and this function shouldn't be called and testing was initialized, then testing will fail.

func (*ExternalSenderTest) PushQuery

func (s *ExternalSenderTest) PushQuery(vdrs ids.ShortSet, chainID ids.ID, requestID uint32, deadline time.Time, vtxID ids.ID, vtx []byte)

PushQuery calls PushQueryF if it was initialized. If it wasn't initialized and this function shouldn't be called and testing was initialized, then testing will fail.

func (*ExternalSenderTest) Put

func (s *ExternalSenderTest) Put(vdr ids.ShortID, chainID ids.ID, requestID uint32, vtxID ids.ID, vtx []byte)

Put calls PutF if it was initialized. If it wasn't initialized and this function shouldn't be called and testing was initialized, then testing will fail.

type Sender

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

Sender sends consensus messages to other validators

func (*Sender) Accepted

func (s *Sender) Accepted(validatorID ids.ShortID, requestID uint32, containerIDs []ids.ID)

Accepted ...

func (*Sender) AcceptedFrontier

func (s *Sender) AcceptedFrontier(validatorID ids.ShortID, requestID uint32, containerIDs []ids.ID)

AcceptedFrontier ...

func (*Sender) Chits

func (s *Sender) Chits(validatorID ids.ShortID, requestID uint32, votes []ids.ID)

Chits sends chits

func (*Sender) Context

func (s *Sender) Context() *snow.Context

Context of this sender

func (*Sender) Get

func (s *Sender) Get(validatorID ids.ShortID, requestID uint32, containerID ids.ID)

Get sends a Get message to the consensus engine running on the specified chain to the specified validator. The Get message signifies that this consensus engine would like the recipient to send this consensus engine the specified container.

func (*Sender) GetAccepted

func (s *Sender) GetAccepted(validatorIDs ids.ShortSet, requestID uint32, containerIDs []ids.ID)

GetAccepted ...

func (*Sender) GetAcceptedFrontier

func (s *Sender) GetAcceptedFrontier(validatorIDs ids.ShortSet, requestID uint32)

GetAcceptedFrontier ...

func (*Sender) GetAncestors added in v0.8.0

func (s *Sender) GetAncestors(validatorID ids.ShortID, requestID uint32, containerID ids.ID)

GetAncestors sends a GetAncestors message

func (*Sender) Gossip added in v0.8.0

func (s *Sender) Gossip(containerID ids.ID, container []byte)

Gossip the provided container

func (*Sender) Initialize

func (s *Sender) Initialize(ctx *snow.Context, sender ExternalSender, router router.Router, timeouts *timeout.Manager)

Initialize this sender

func (*Sender) MultiPut added in v0.8.0

func (s *Sender) MultiPut(validatorID ids.ShortID, requestID uint32, containers [][]byte)

MultiPut sends a MultiPut message to the consensus engine running on the specified chain on the specified validator. The MultiPut message gives the recipient the contents of several containers.

func (*Sender) PullQuery

func (s *Sender) PullQuery(validatorIDs ids.ShortSet, requestID uint32, containerID ids.ID)

PullQuery sends a PullQuery message to the consensus engines running on the specified chains on the specified validators. The PullQuery message signifies that this consensus engine would like each validator to send their preferred frontier.

func (*Sender) PushQuery

func (s *Sender) PushQuery(validatorIDs ids.ShortSet, requestID uint32, containerID ids.ID, container []byte)

PushQuery sends a PushQuery message to the consensus engines running on the specified chains on the specified validators. The PushQuery message signifies that this consensus engine would like each validator to send their preferred frontier given the existence of the specified container.

func (*Sender) Put

func (s *Sender) Put(validatorID ids.ShortID, requestID uint32, containerID ids.ID, container []byte)

Put sends a Put message to the consensus engine running on the specified chain on the specified validator. The Put message signifies that this consensus engine is giving to the recipient the contents of the specified container.

Jump to

Keyboard shortcuts

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