Documentation ¶
Index ¶
- Constants
- Variables
- func CheckBounds(ranges indexer.QueryRange, v interface{}) (bool, error)
- type BlockExecutor
- func (e *BlockExecutor) ApplyBlock(ctx context.Context, state types.State, block *types.Block) (types.State, *abci.ResponseFinalizeBlock, error)
- func (e *BlockExecutor) Commit(ctx context.Context, state types.State, block *types.Block, ...) ([]byte, uint64, error)
- func (e *BlockExecutor) CreateBlock(height uint64, lastCommit *types.Commit, ...) (*types.Block, error)
- func (e *BlockExecutor) ExtendVote(ctx context.Context, block *types.Block) ([]byte, error)
- func (e *BlockExecutor) InitChain(genesis *cmtypes.GenesisDoc) (*abci.ResponseInitChain, error)
- func (e *BlockExecutor) ProcessProposal(block *types.Block, state types.State) (bool, error)
- func (e *BlockExecutor) Validate(state types.State, block *types.Block) error
- type Metrics
Constants ¶
const ( // MetricsSubsystem is a subsystem shared by all metrics exposed by this // package. MetricsSubsystem = "state" )
Variables ¶
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.
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, maxBytes uint64, logger log.Logger, metrics *Metrics, valsetHash []byte) *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, lastExtendedCommit abci.ExtendedCommitInfo, lastHeaderHash types.Hash, state types.State) (*types.Block, error)
CreateBlock reaps transactions from mempool and builds a block.
func (*BlockExecutor) ExtendVote ¶ added in v0.13.3
ExtendVote calls the ExtendVote ABCI method on the proxy app.
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
ProcessProposal calls the corresponding ABCI method on the app.
type Metrics ¶ added in v0.11.19
type Metrics struct { // Time spent processing FinalizeBlock BlockProcessingTime metrics.Histogram `metrics_buckettype:"lin" metrics_bucketsizes:"1, 10, 10"` // ConsensusParamUpdates is the total number of times the application has // updated the consensus params since process start. //metrics:Number of consensus parameter updates returned by the application since process start. ConsensusParamUpdates metrics.Counter }
Metrics contains metrics exposed by this package.
func PrometheusMetrics ¶ added in v0.11.19
PrometheusMetrics returns Metrics build using Prometheus client library. Optionally, labels can be provided along with their values ("foo", "fooValue").