Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AggregateSignatureResult ¶
type AggregateSignatureResult struct { SignatureWeight uint64 TotalWeight uint64 Message *avalancheWarp.Message }
type Aggregator ¶
type Aggregator struct {
// contains filtered or unexported fields
}
Aggregator fulfills requests to aggregate signatures of a subnet's validator set for Avalanche Warp Messages.
func NewAggregator ¶
func NewAggregator(subnetID ids.ID, state validators.State, client SignatureBackend) *Aggregator
NewAggregator returns a signature aggregator, which will aggregate Warp Signatures for the given [
func (*Aggregator) AggregateSignatures ¶
func (a *Aggregator) AggregateSignatures(ctx context.Context, unsignedMessage *avalancheWarp.UnsignedMessage, quorumNum uint64) (*AggregateSignatureResult, error)
type NetworkClient ¶
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: this function will continue attempting to fetch the signature from [nodeID] until it receives an invalid value or [ctx] is cancelled. The caller is responsible to cancel [ctx] if it no longer needs to fetch this signature.
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