Documentation
¶
Overview ¶
Package lp118 implements LP-118 message handling
Index ¶
- Constants
- func NewHandlerAdapter(handler Handler) p2p.Handler
- type CachedHandler
- type Handler
- type HandlerAdapter
- func (h *HandlerAdapter) AppGossip(ctx context.Context, nodeID ids.NodeID, gossipBytes []byte)
- func (h *HandlerAdapter) AppRequest(ctx context.Context, nodeID ids.NodeID, deadline time.Time, ...) ([]byte, *core.AppError)
- func (h *HandlerAdapter) CrossChainAppRequest(ctx context.Context, chainID ids.ID, deadline time.Time, requestBytes []byte) ([]byte, error)
- type NoOpHandler
- type SignatureAggregator
- type Verifier
Constants ¶
const HandlerID = 0x12345678 // Implementation note
HandlerID is the protocol ID for LP-118
Variables ¶
This section is empty.
Functions ¶
func NewHandlerAdapter ¶ added in v1.16.56
NewHandlerAdapter creates a new adapter
Types ¶
type CachedHandler ¶ added in v1.11.14
type CachedHandler struct {
// contains filtered or unexported fields
}
CachedHandler implements a cached handler for LP-118
type Handler ¶
type Handler interface {
// AppRequest handles an incoming request
AppRequest(ctx context.Context, nodeID ids.NodeID, deadline time.Time, request []byte) ([]byte, error)
}
Handler handles ACP-118 messages
type HandlerAdapter ¶ added in v1.16.56
type HandlerAdapter struct {
// contains filtered or unexported fields
}
HandlerAdapter adapts an lp118.Handler to p2p.Handler
type NoOpHandler ¶ added in v1.11.14
type NoOpHandler struct{}
NoOpHandler is a no-op implementation of Handler
type SignatureAggregator ¶
type SignatureAggregator struct {
// contains filtered or unexported fields
}
SignatureAggregator aggregates validator signatures for warp messages
func NewSignatureAggregator ¶
func NewSignatureAggregator(log log.Logger, client *p2p.Client) *SignatureAggregator
NewSignatureAggregator returns an instance of SignatureAggregator
func (*SignatureAggregator) AggregateSignatures ¶
func (s *SignatureAggregator) AggregateSignatures( ctx context.Context, message *warp.Message, justification []byte, validators []*warp.Validator, quorumNum uint64, quorumDen uint64, ) ( _ *warp.Message, aggregatedStake *big.Int, totalStake *big.Int, _ error, )
AggregateSignatures blocks until quorumNum/quorumDen signatures from validators are requested to be aggregated into a warp message or the context is canceled. Returns the signed message and the amount of stake that signed the message. Caller is responsible for providing a well-formed canonical validator set corresponding to the signer bitset in the message.