aggregator

package
v0.5.1-warp-rc.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2023 License: GPL-3.0, LGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSignatureAggregationJob

func NewSignatureAggregationJob(
	client SignatureBackend,
	height uint64,
	subnetID ids.ID,
	quorumNum uint64,
	cancelQuorumNum uint64,
	quorumDen uint64,
	state validators.State,
	msg *avalancheWarp.UnsignedMessage,
) *signatureAggregationJob

Types

type AggregateSignatureResult

type AggregateSignatureResult struct {
	SignatureWeight uint64
	TotalWeight     uint64
	Message         *avalancheWarp.Message
}

type Aggregator

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

func NewAggregator

func NewAggregator(subnetID ids.ID, state validators.State, client SignatureBackend) *Aggregator

func (*Aggregator) AggregateSignatures

func (a *Aggregator) AggregateSignatures(ctx context.Context, unsignedMessage *avalancheWarp.UnsignedMessage, quorumNum uint64) (*AggregateSignatureResult, error)

type NetworkClient

type NetworkClient interface {
	SendAppRequest(nodeID ids.NodeID, message []byte) ([]byte, error)
}

type NetworkSigner

type NetworkSigner struct {
	Client NetworkClient
}

networkSigner fetches warp signatures on behalf of the aggregator using VM App-Specific Messaging

func (*NetworkSigner) FetchWarpSignature

func (s *NetworkSigner) FetchWarpSignature(ctx context.Context, nodeID ids.NodeID, unsignedWarpMessage *avalancheWarp.UnsignedMessage) (*bls.Signature, error)

FetchWarpSignature attempts to fetch a BLS Signature of [unsignedWarpMessage] from [nodeID] until it succeeds or receives an invalid response

Note: the caller should ensure that [ctx] is properly cancelled once the result is no longer needed from this call.

type SignatureBackend

type SignatureBackend interface {
	// FetchWarpSignature attempts to fetch a BLS Signature from [nodeID] for [unsignedWarpMessage]
	FetchWarpSignature(ctx context.Context, nodeID ids.NodeID, unsignedWarpMessage *avalancheWarp.UnsignedMessage) (*bls.Signature, error)
}

SignatureBackend defines the minimum network interface to perform signature aggregation

Jump to

Keyboard shortcuts

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