Documentation
¶
Index ¶
Constants ¶
const CodecVersion = warp.CodecVersion + 1
Variables ¶
var Codec codec.Manager
Functions ¶
func NewBLSAuth ¶
func NewBLSAuth(config *Config) (BLSSigner, BLSVerifier)
Types ¶
type BLSSigner ¶
type BLSSigner struct {
// contains filtered or unexported fields
}
BLSSigner signs messages encoded with the provided ChainID and NetworkID. using the SignBLS function.
type BLSVerifier ¶
type BLSVerifier struct {
// contains filtered or unexported fields
}
type Block ¶ added in v1.13.3
type Block struct {
// contains filtered or unexported fields
}
func (*Block) BlockHeader ¶ added in v1.13.3
func (b *Block) BlockHeader() simplex.BlockHeader
BlockHeader returns the block header for the block.
type Config ¶
type Config struct {
Ctx SimplexChainContext
Log logging.Logger
Sender sender.ExternalSender
OutboundMsgBuilder message.OutboundMsgBuilder
// Validators is a map of node IDs to their validator information.
// This tells the node about the current membership set, and should be consistent
// across all nodes in the subnet.
Validators map[ids.NodeID]*validators.GetValidatorOutput
VM block.ChainVM
DB database.KeyValueReaderWriter
// SignBLS is the signing function used for this node to sign messages.
SignBLS SignFunc
}
Config wraps all the parameters needed for a simplex engine
type QC ¶ added in v1.13.4
type QC struct {
// contains filtered or unexported fields
}
QC represents a quorum certificate in the Simplex consensus protocol.
type QCDeserializer ¶ added in v1.13.4
type QCDeserializer struct {
// contains filtered or unexported fields
}
func (*QCDeserializer) DeserializeQuorumCertificate ¶ added in v1.13.4
func (d *QCDeserializer) DeserializeQuorumCertificate(bytes []byte) (simplex.QuorumCertificate, error)
DeserializeQuorumCertificate deserializes a quorum certificate from bytes.
type SignatureAggregator ¶ added in v1.13.4
type SignatureAggregator struct {
// contains filtered or unexported fields
}
SignatureAggregator aggregates signatures into a quorum certificate.
func (*SignatureAggregator) Aggregate ¶ added in v1.13.4
func (a *SignatureAggregator) Aggregate(signatures []simplex.Signature) (simplex.QuorumCertificate, error)
Aggregate aggregates the provided signatures into a quorum certificate. It requires at least a quorum of signatures to succeed. If any signature is from a signer not in the membership set, it returns an error.
type SimplexChainContext ¶
type SimplexChainContext struct {
// Network is the ID of the network this context exists within.
NodeID ids.NodeID
// ChainID is the ID of the chain this context exists within.
ChainID ids.ID
// SubnetID is the ID of the subnet this context exists within.
SubnetID ids.ID
// NodeID is the ID of this node
NetworkID uint32
}
Context is information about the current execution.
type Storage ¶ added in v1.13.5
type Storage struct {
// contains filtered or unexported fields
}
func (*Storage) Index ¶ added in v1.13.5
func (s *Storage) Index(ctx context.Context, block simplex.VerifiedBlock, finalization simplex.Finalization) error
Index indexes the finalization in the storage. It stores the finalization bytes and increments numBlocks.
func (*Storage) Retrieve ¶ added in v1.13.5
func (s *Storage) Retrieve(seq uint64) (simplex.VerifiedBlock, simplex.Finalization, error)
Retrieve returns the block and finalization at [seq]. If [seq] is not found, returns simplex.ErrBlockNotFound.