Documentation ¶
Index ¶
- Constants
- Variables
- type BlockchainService
- type BuilderService
- type Config
- type Handler
- func (h *Handler) PreBlocker(ctx sdk.Context, req *cometabci.RequestFinalizeBlock) error
- func (h *Handler) PrepareProposalHandler(ctx sdk.Context, req *cmtabci.RequestPrepareProposal) (*cmtabci.ResponsePrepareProposal, error)
- func (h *Handler) ProcessProposalHandler(_ sdk.Context, req *cmtabci.RequestProcessProposal) (*cmtabci.ResponseProcessProposal, error)
Constants ¶
const ( // MetricKeyPrepareProposalTime is the metric key for prepare proposal time. MetricKeyPrepareProposalTime = "beaconkit.prepare_proposal_time" // MetricKeyProcessProposalTime is the metric key for process proposal time. MetricKeyProcessProposalTime = "beaconkit.process_proposal_time" )
Variables ¶
var ( // ErrValidatorClientNotSynced is an error for when a // validator tries to propose a block with an out of sync // execution client. ErrValidatorClientNotSynced = errors.New( `your validator tried to propose a block with an out of sync execution client, did you forget to reset your execution client?`, ) // ErrClientNotSynced is an error for when a node tries to process // a block with an out of sync execution client. ErrClientNotSynced = errors.New( `your node tried to process a block with an out of sync execution client, did you forget to reset your execution client?`) // ErrNextPrepareNilResp is an error for when the `nextPrepare` function. ErrNextPrepareNilResp = errors.New("nil response from `nextPrepare`") )
Functions ¶
This section is empty.
Types ¶
type BlockchainService ¶
type BlockchainService interface { ProcessSlot(state.BeaconState) error BeaconState(context.Context) state.BeaconState ProcessBeaconBlock( context.Context, state.BeaconState, beacontypes.ReadOnlyBeaconBlock, *datypes.BlobSidecars, ) error PostBlockProcess( context.Context, state.BeaconState, beacontypes.ReadOnlyBeaconBlock, ) error BeaconCfg() *params.BeaconChainConfig }
type BuilderService ¶
type BuilderService interface { RequestBestBlock( context.Context, state.BeaconState, primitives.Slot, ) (beacontypes.BeaconBlock, *datypes.BlobSidecars, error) }
type Config ¶
type Config struct { // BeaconBlockPosition is the position of the beacon block // in the cometbft proposal. BeaconBlockPosition uint `mapstructure:"beacon-block-proposal-position"` // BlobSidecarsBlockPosition is the position of the blob sidecars // in the cometbft proposal. BlobSidecarsBlockPosition uint `mapstructure:"blob-sidecars-block-proposal-position"` }
ABCI is a configuration struct for the cosmos proposal handler.
func DefaultABCIConfig ¶
func DefaultABCIConfig() Config
DefaultABCIConfig returns the default configuration for the proposal service.
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler is a struct that encapsulates the necessary components to handle the proposal processes.
func NewHandler ¶
func NewHandler( cfg *Config, builderService BuilderService, chainService BlockchainService, nextPrepare sdk.PrepareProposalHandler, nextProcess sdk.ProcessProposalHandler, ) *Handler
NewHandler creates a new instance of the Handler struct.
func (*Handler) PreBlocker ¶
PreBlocker is called by the base app before the block is finalized. It is responsible for aggregating oracle data from each validator and writing the oracle data to the store.
func (*Handler) PrepareProposalHandler ¶
func (h *Handler) PrepareProposalHandler( ctx sdk.Context, req *cmtabci.RequestPrepareProposal, ) (*cmtabci.ResponsePrepareProposal, error)
PrepareProposalHandler is a wrapper around the prepare proposal handler that injects the beacon block into the proposal.
func (*Handler) ProcessProposalHandler ¶
func (h *Handler) ProcessProposalHandler( _ sdk.Context, req *cmtabci.RequestProcessProposal, ) (*cmtabci.ResponseProcessProposal, error)
ProcessProposalHandler is a wrapper around the process proposal handler that extracts the beacon block from the proposal and processes it.