state

package
v0.11.9 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAddingValidatorToBased = errors.New("cannot add validators to empty validator set")

ErrAddingValidatorToBased is returned when trying to add a validator to an empty validator set.

View Source
var ErrEmptyValSetGenerated = errors.New("applying the validator changes would result in empty set")

ErrEmptyValSetGenerated is returned when applying the validator changes would result in empty set.

Functions

func CheckBounds added in v0.11.2

func CheckBounds(ranges indexer.QueryRange, v interface{}) (bool, error)

CheckBounds checks if the given value falls within the specified query range.

Types

type BlockExecutor

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

BlockExecutor creates and applies blocks and maintains state.

func NewBlockExecutor

func NewBlockExecutor(proposerAddress []byte, chainID string, mempool mempool.Mempool, proxyApp proxy.AppConnConsensus, eventBus *cmtypes.EventBus, logger log.Logger) *BlockExecutor

NewBlockExecutor creates new instance of BlockExecutor.

func (*BlockExecutor) ApplyBlock

func (e *BlockExecutor) ApplyBlock(ctx context.Context, state types.State, block *types.Block) (types.State, *abci.ResponseFinalizeBlock, error)

ApplyBlock validates and executes the block.

func (*BlockExecutor) Commit

func (e *BlockExecutor) Commit(ctx context.Context, state types.State, block *types.Block, resp *abci.ResponseFinalizeBlock) ([]byte, uint64, error)

Commit commits the block

func (*BlockExecutor) CreateBlock

func (e *BlockExecutor) CreateBlock(height uint64, lastCommit *types.Commit, lastHeaderHash types.Hash, state types.State) (*types.Block, error)

CreateBlock reaps transactions from mempool and builds a block.

func (*BlockExecutor) InitChain

func (e *BlockExecutor) InitChain(genesis *cmtypes.GenesisDoc) (*abci.ResponseInitChain, error)

InitChain calls InitChainSync using consensus connection to app.

func (*BlockExecutor) ProcessProposal added in v0.11.2

func (e *BlockExecutor) ProcessProposal(
	block *types.Block,
	state types.State,
) (bool, error)

ProcessProposal calls the corresponding ABCI method on the app.

func (*BlockExecutor) Validate added in v0.10.5

func (e *BlockExecutor) Validate(state types.State, block *types.Block) error

Validate validates the state and the block for the executor

Directories

Path Synopsis
kv

Jump to

Keyboard shortcuts

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