abci

package
v0.1.1-experimental.3 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
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

View Source
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 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

func (h *Handler) PreBlocker(
	ctx sdk.Context, req *cometabci.RequestFinalizeBlock,
) error

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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