Documentation ¶
Index ¶
- Constants
- Variables
- type BatchingKeeper
- type Handlers
- func (h *Handlers) ExtendVoteHandler() sdk.ExtendVoteHandler
- func (h *Handlers) PreBlocker() sdk.PreBlocker
- func (h *Handlers) PrepareProposalHandler() sdk.PrepareProposalHandler
- func (h *Handlers) ProcessProposalHandler() sdk.ProcessProposalHandler
- func (h *Handlers) SetSEDASigner(signer utils.SEDASigner)
- func (h *Handlers) VerifyVoteExtensionHandler() sdk.VerifyVoteExtensionHandler
- type PubKeyKeeper
- type StakingKeeper
Constants ¶
const ( // BlockOffsetSign is the block height difference between the batch // signing phase and the corresponding batch's creation height. // The signing phase consists of ExtendVote and VerifyVoteExtension. BlockOffsetSignPhase = -1 // BlockOffsetCollectPhase is the block height difference between the // batch signature collection phase and the corresponding batch's // creation height. The collection phase spans PrepareProposal, // ProcessProposal, and PreBlock to store a canonical set of batch // signatures. BlockOffsetCollectPhase = -2 // MaxVoteExtensionLength is the maximum size of vote extension in // bytes. MaxVoteExtensionLength = 64 * 5 )
const ModuleName = "vote_extension"
Variables ¶
var ( ErrNoBatchForCurrentHeight = errors.Register(ModuleName, 2, "no batch found for current height") ErrInvalidVoteExtensionLength = errors.Register(ModuleName, 3, "invalid vote extension length") ErrVoteExtensionInjectionTooBig = errors.Register(ModuleName, 4, "injected vote extensions are too big") ErrInvalidBatchSignature = errors.Register(ModuleName, 5, "batch signature is invalid") )
Functions ¶
This section is empty.
Types ¶
type BatchingKeeper ¶
type Handlers ¶
type Handlers struct {
// contains filtered or unexported fields
}
func NewHandlers ¶
func NewHandlers( dph *baseapp.DefaultProposalHandler, bk BatchingKeeper, pkk PubKeyKeeper, sk StakingKeeper, vac addresscodec.Codec, logger log.Logger, ) *Handlers
func (*Handlers) ExtendVoteHandler ¶
func (h *Handlers) ExtendVoteHandler() sdk.ExtendVoteHandler
ExtendVoteHandler handles the ExtendVote ABCI to sign a batch created from the previous block.
func (*Handlers) PreBlocker ¶
func (h *Handlers) PreBlocker() sdk.PreBlocker
PreBlocker runs before BeginBlocker to extract the batch signatures from the canonical set of vote extensions injected by the proposer and store them.
func (*Handlers) PrepareProposalHandler ¶
func (h *Handlers) PrepareProposalHandler() sdk.PrepareProposalHandler
PrepareProposalHandler handles the PrepareProposal ABCI to inject a canonical set of vote extensions in the proposal.
func (*Handlers) ProcessProposalHandler ¶
func (h *Handlers) ProcessProposalHandler() sdk.ProcessProposalHandler
ProcessProposalHandler handles the ProcessProposal ABCI to validate the canonical set of vote extensions injected by the proposer.
func (*Handlers) SetSEDASigner ¶
func (h *Handlers) SetSEDASigner(signer utils.SEDASigner)
func (*Handlers) VerifyVoteExtensionHandler ¶
func (h *Handlers) VerifyVoteExtensionHandler() sdk.VerifyVoteExtensionHandler
VerifyVoteExtensionHandler handles the VerifyVoteExtension ABCI to verify the batch signature included in the pre-commit vote against the public key registered in the pubkey module.
type PubKeyKeeper ¶
type PubKeyKeeper interface {
GetValidatorKeyAtIndex(ctx context.Context, valAddr sdk.ValAddress, index utils.SEDAKeyIndex) (cryptotypes.PubKey, error)
}
type StakingKeeper ¶
type StakingKeeper interface { baseapp.ValidatorStore GetValidatorByConsAddr(ctx context.Context, consAddr sdk.ConsAddress) (stakingtypes.Validator, error) }