Documentation
      ¶
    
    
  
    
  
    Overview ¶
Package aggregator is a generated GoMock package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AggregateSignatureResult ¶
type AggregateSignatureResult struct {
	// Weight of validators included in the aggregate signature.
	SignatureWeight uint64
	// Total weight of all validators in the subnet.
	TotalWeight uint64
	// The message with the aggregate signature.
	Message *avalancheWarp.Message
}
    type Aggregator ¶
type Aggregator struct {
	// contains filtered or unexported fields
}
    Aggregator requests signatures from validators and aggregates them into a single signature.
func New ¶
func New(client SignatureGetter, validators []*avalancheWarp.Validator, totalWeight uint64) *Aggregator
New returns a signature aggregator that will attempt to aggregate signatures from [validators].
func (*Aggregator) AggregateSignatures ¶
func (a *Aggregator) AggregateSignatures(ctx context.Context, unsignedMessage *avalancheWarp.UnsignedMessage, quorumNum uint64) (*AggregateSignatureResult, error)
Returns an aggregate signature over [unsignedMessage]. The returned signature's weight exceeds the threshold given by [quorumNum].
type MockNetworkClient ¶ added in v0.15.0
type MockNetworkClient struct {
	// contains filtered or unexported fields
}
    MockNetworkClient is a mock of NetworkClient interface.
func NewMockNetworkClient ¶ added in v0.15.0
func NewMockNetworkClient(ctrl *gomock.Controller) *MockNetworkClient
NewMockNetworkClient creates a new mock instance.
func (*MockNetworkClient) EXPECT ¶ added in v0.15.0
func (m *MockNetworkClient) EXPECT() *MockNetworkClientMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockNetworkClient) SendAppRequest ¶ added in v0.15.0
func (m *MockNetworkClient) SendAppRequest(ctx context.Context, nodeID ids.NodeID, message []byte) ([]byte, error)
SendAppRequest mocks base method.
type MockNetworkClientMockRecorder ¶ added in v0.15.0
type MockNetworkClientMockRecorder struct {
	// contains filtered or unexported fields
}
    MockNetworkClientMockRecorder is the mock recorder for MockNetworkClient.
func (*MockNetworkClientMockRecorder) SendAppRequest ¶ added in v0.15.0
func (mr *MockNetworkClientMockRecorder) SendAppRequest(ctx, nodeID, message any) *gomock.Call
SendAppRequest indicates an expected call of SendAppRequest.
type MockSignatureGetter ¶
type MockSignatureGetter struct {
	// contains filtered or unexported fields
}
    MockSignatureGetter is a mock of SignatureGetter interface.
func NewMockSignatureGetter ¶
func NewMockSignatureGetter(ctrl *gomock.Controller) *MockSignatureGetter
NewMockSignatureGetter creates a new mock instance.
func (*MockSignatureGetter) EXPECT ¶
func (m *MockSignatureGetter) EXPECT() *MockSignatureGetterMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockSignatureGetter) GetSignature ¶
func (m *MockSignatureGetter) GetSignature(ctx context.Context, nodeID ids.NodeID, unsignedWarpMessage *warp.UnsignedMessage) (*bls.Signature, error)
GetSignature mocks base method.
type MockSignatureGetterMockRecorder ¶
type MockSignatureGetterMockRecorder struct {
	// contains filtered or unexported fields
}
    MockSignatureGetterMockRecorder is the mock recorder for MockSignatureGetter.
func (*MockSignatureGetterMockRecorder) GetSignature ¶
func (mr *MockSignatureGetterMockRecorder) GetSignature(ctx, nodeID, unsignedWarpMessage any) *gomock.Call
GetSignature indicates an expected call of GetSignature.
type NetworkClient ¶
type NetworkSignatureGetter ¶
type NetworkSignatureGetter struct {
	Client NetworkClient
}
    NetworkSignatureGetter fetches warp signatures on behalf of the aggregator using VM App-Specific Messaging
func NewSignatureGetter ¶
func NewSignatureGetter(client NetworkClient) *NetworkSignatureGetter
func (*NetworkSignatureGetter) GetSignature ¶
func (s *NetworkSignatureGetter) GetSignature(ctx context.Context, nodeID ids.NodeID, unsignedWarpMessage *avalancheWarp.UnsignedMessage) (*bls.Signature, error)
GetSignature 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 SignatureGetter ¶
type SignatureGetter interface {
	// GetSignature attempts to fetch a BLS Signature from [nodeID] for [unsignedWarpMessage]
	GetSignature(ctx context.Context, nodeID ids.NodeID, unsignedWarpMessage *avalancheWarp.UnsignedMessage) (*bls.Signature, error)
}
    SignatureGetter defines the minimum network interface to perform signature aggregation