Documentation ¶
Index ¶
- Constants
- func NewAPIFetcher(clients map[ids.NodeID]Client) *apiFetcher
- type API
- func (a *API) GetBlockAggregateSignature(ctx context.Context, blockID ids.ID, quorumNum uint64, subnetIDStr string) (signedMessageBytes hexutil.Bytes, err error)
- func (a *API) GetBlockSignature(ctx context.Context, blockID ids.ID) (hexutil.Bytes, error)
- func (a *API) GetMessage(ctx context.Context, messageID ids.ID) (hexutil.Bytes, error)
- func (a *API) GetMessageAggregateSignature(ctx context.Context, messageID ids.ID, quorumNum uint64, subnetIDStr string) (signedMessageBytes hexutil.Bytes, err error)
- func (a *API) GetMessageSignature(ctx context.Context, messageID ids.ID) (hexutil.Bytes, error)
- type Backend
- type BlockClient
- type Client
Constants ¶
View Source
const ( ParseErrCode = iota + 1 VerifyErrCode )
Variables ¶
This section is empty.
Functions ¶
func NewAPIFetcher ¶
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
API introduces snowman specific functionality to the evm
func (*API) GetBlockAggregateSignature ¶
func (a *API) GetBlockAggregateSignature(ctx context.Context, blockID ids.ID, quorumNum uint64, subnetIDStr string) (signedMessageBytes hexutil.Bytes, err error)
GetBlockAggregateSignature fetches the aggregate signature for the requested [blockID]
func (*API) GetBlockSignature ¶
GetBlockSignature returns the BLS signature associated with a blockID.
func (*API) GetMessage ¶
GetMessage returns the Warp message associated with a messageID.
type Backend ¶
type Backend interface { // AddMessage signs [unsignedMessage] and adds it to the warp backend database AddMessage(unsignedMessage *avalancheWarp.UnsignedMessage) error // GetMessageSignature validates the message and returns the signature of the requested message. GetMessageSignature(ctx context.Context, message *avalancheWarp.UnsignedMessage) ([]byte, error) // GetBlockSignature returns the signature of a hash payload containing blockID if it's the ID of an accepted block. GetBlockSignature(ctx context.Context, blockID ids.ID) ([]byte, error) // GetMessage retrieves the [unsignedMessage] from the warp backend database if available // TODO: After Etna, the backend no longer needs to store the mapping from messageHash // to unsignedMessage (and this method can be removed). GetMessage(messageHash ids.ID) (*avalancheWarp.UnsignedMessage, error) acp118.Verifier }
Backend tracks signature-eligible warp messages and provides an interface to fetch them. The backend is also used to query for warp message signatures by the signature request handler.
func NewBackend ¶
func NewBackend( networkID uint32, sourceChainID ids.ID, warpSigner avalancheWarp.Signer, blockClient BlockClient, db database.Database, signatureCache cache.Cacher[ids.ID, []byte], offchainMessages [][]byte, ) (Backend, error)
NewBackend creates a new Backend, and initializes the signature cache and message tracking database.
type BlockClient ¶
type Client ¶
type Client interface { GetMessage(ctx context.Context, messageID ids.ID) ([]byte, error) GetMessageSignature(ctx context.Context, messageID ids.ID) ([]byte, error) GetMessageAggregateSignature(ctx context.Context, messageID ids.ID, quorumNum uint64, subnetIDStr string) ([]byte, error) GetBlockSignature(ctx context.Context, blockID ids.ID) ([]byte, error) GetBlockAggregateSignature(ctx context.Context, blockID ids.ID, quorumNum uint64, subnetIDStr string) ([]byte, error) }
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package aggregator is a generated GoMock package.
|
Package aggregator is a generated GoMock package. |
warptest exposes common functionality for testing the warp package.
|
warptest exposes common functionality for testing the warp package. |
Click to show internal directories.
Click to hide internal directories.