abci

package
v0.4.0-dev.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2024 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
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
)
View Source
const ModuleName = "vote_extension"

Variables

View Source
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 BatchingKeeper interface {
	GetBatchForHeight(ctx context.Context, height int64) (types.Batch, error)
	SetBatchSignatures(ctx context.Context, batchNum uint64, sigs types.BatchSignatures) error
}

type Handlers

type Handlers struct {
	// contains filtered or unexported fields
}

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)
}

Directories

Path Synopsis
Package testutil is a generated GoMock package.
Package testutil is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL