keeper

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2024 License: GPL-3.0 Imports: 45 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_client_x_evmengine_keeper_evmengine_proto protoreflect.FileDescriptor

Functions

func NewMsgServerImpl

func NewMsgServerImpl(keeper *Keeper) types.MsgServiceServer

NewMsgServerImpl returns an implementation of the MsgServer interface for the provided Keeper.

func NewProposalServer

func NewProposalServer(keeper *Keeper) types.MsgServiceServer

NewProposalServer returns an implementation of the MsgServer interface for the provided Keeper.

Types

type EvmengineStore

type EvmengineStore interface {
	ExecutionHeadTable() ExecutionHeadTable
	// contains filtered or unexported methods
}

func NewEvmengineStore

func NewEvmengineStore(db ormtable.Schema) (EvmengineStore, error)

type ExecutionHead

type ExecutionHead struct {
	Id            uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`                                            // Auto-incremented ID (always and only 1).
	CreatedHeight uint64 `protobuf:"varint,2,opt,name=created_height,json=createdHeight,proto3" json:"created_height,omitempty"` // Consensus chain height this execution block was created in.
	BlockHeight   uint64 `protobuf:"varint,3,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"`       // Execution block height.
	BlockHash     []byte `protobuf:"bytes,4,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty"`              // Execution block hash.
	BlockTime     uint64 `protobuf:"varint,5,opt,name=block_time,json=blockTime,proto3" json:"block_time,omitempty"`             // Execution block time.
	// contains filtered or unexported fields
}

ExecutionHead defines the execution chain head. It is a singleton table; it only has a single row with ID==1.

func (*ExecutionHead) Descriptor deprecated

func (*ExecutionHead) Descriptor() ([]byte, []int)

Deprecated: Use ExecutionHead.ProtoReflect.Descriptor instead.

func (*ExecutionHead) GetBlockHash

func (x *ExecutionHead) GetBlockHash() []byte

func (*ExecutionHead) GetBlockHeight

func (x *ExecutionHead) GetBlockHeight() uint64

func (*ExecutionHead) GetBlockTime

func (x *ExecutionHead) GetBlockTime() uint64

func (*ExecutionHead) GetCreatedHeight

func (x *ExecutionHead) GetCreatedHeight() uint64

func (*ExecutionHead) GetId

func (x *ExecutionHead) GetId() uint64

func (*ExecutionHead) Hash

func (h *ExecutionHead) Hash() common.Hash

func (*ExecutionHead) ProtoMessage

func (*ExecutionHead) ProtoMessage()

func (*ExecutionHead) ProtoReflect

func (x *ExecutionHead) ProtoReflect() protoreflect.Message

func (*ExecutionHead) Reset

func (x *ExecutionHead) Reset()

func (*ExecutionHead) String

func (x *ExecutionHead) String() string

type ExecutionHeadIdIndexKey

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

func (ExecutionHeadIdIndexKey) WithId

type ExecutionHeadIndexKey

type ExecutionHeadIndexKey interface {
	// contains filtered or unexported methods
}

type ExecutionHeadIterator

type ExecutionHeadIterator struct {
	ormtable.Iterator
}

func (ExecutionHeadIterator) Value

type ExecutionHeadPrimaryKey

type ExecutionHeadPrimaryKey = ExecutionHeadIdIndexKey

primary key starting index..

type ExecutionHeadTable

type ExecutionHeadTable interface {
	Insert(ctx context.Context, executionHead *ExecutionHead) error
	InsertReturningId(ctx context.Context, executionHead *ExecutionHead) (uint64, error)
	LastInsertedSequence(ctx context.Context) (uint64, error)
	Update(ctx context.Context, executionHead *ExecutionHead) error
	Save(ctx context.Context, executionHead *ExecutionHead) error
	Delete(ctx context.Context, executionHead *ExecutionHead) error
	Has(ctx context.Context, id uint64) (found bool, err error)
	// Get returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
	Get(ctx context.Context, id uint64) (*ExecutionHead, error)
	List(ctx context.Context, prefixKey ExecutionHeadIndexKey, opts ...ormlist.Option) (ExecutionHeadIterator, error)
	ListRange(ctx context.Context, from, to ExecutionHeadIndexKey, opts ...ormlist.Option) (ExecutionHeadIterator, error)
	DeleteBy(ctx context.Context, prefixKey ExecutionHeadIndexKey) error
	DeleteRange(ctx context.Context, from, to ExecutionHeadIndexKey) error
	// contains filtered or unexported methods
}

func NewExecutionHeadTable

func NewExecutionHeadTable(db ormtable.Schema) (ExecutionHeadTable, error)

type Hooks

type Hooks struct{}

Hooks implements the staking hooks. It just logs at this point.

func (Hooks) AfterDelegationModified

func (Hooks) AfterDelegationModified(ctx context.Context, accAddr sdk.AccAddress, valAddr sdk.ValAddress) error

func (Hooks) AfterUnbondingInitiated

func (Hooks) AfterUnbondingInitiated(ctx context.Context, id uint64) error

func (Hooks) AfterValidatorBeginUnbonding

func (Hooks) AfterValidatorBeginUnbonding(ctx context.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error

func (Hooks) AfterValidatorBonded

func (Hooks) AfterValidatorBonded(ctx context.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error

AfterValidatorBonded updates the signing info start height or create a new signing info.

func (Hooks) AfterValidatorCreated

func (Hooks) AfterValidatorCreated(ctx context.Context, valAddr sdk.ValAddress) error

AfterValidatorCreated adds the address-pubkey relation when a validator is created.

func (Hooks) AfterValidatorRemoved

func (Hooks) AfterValidatorRemoved(ctx context.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error

AfterValidatorRemoved deletes the address-pubkey relation when a validator is removed,.

func (Hooks) BeforeDelegationCreated

func (Hooks) BeforeDelegationCreated(ctx context.Context, accAddr sdk.AccAddress, valAddr sdk.ValAddress) error

func (Hooks) BeforeDelegationRemoved

func (Hooks) BeforeDelegationRemoved(ctx context.Context, accAddr sdk.AccAddress, valAddr sdk.ValAddress) error

func (Hooks) BeforeDelegationSharesModified

func (Hooks) BeforeDelegationSharesModified(ctx context.Context, accAddr sdk.AccAddress, valAddr sdk.ValAddress) error

func (Hooks) BeforeValidatorModified

func (Hooks) BeforeValidatorModified(ctx context.Context, valAddr sdk.ValAddress) error

func (Hooks) BeforeValidatorSlashed

func (Hooks) BeforeValidatorSlashed(ctx context.Context, valAddr sdk.ValAddress, amount sdkmath.LegacyDec) error

type Keeper

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

func (*Keeper) ExecutionBlockHash

func (k *Keeper) ExecutionBlockHash(ctx context.Context) ([]byte, error)

ExecutionBlockHash returns the genesis execution block hash.

func (*Keeper) ExportGenesis

func (k *Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState

ExportGenesis returns a GenesisState for a given context and keeper.

func (*Keeper) GetParams

func (k *Keeper) GetParams(ctx context.Context) (params types.Params, err error)

func (*Keeper) InitGenesis

func (k *Keeper) InitGenesis(ctx context.Context, gs *types.GenesisState) error

func (*Keeper) InsertGenesisHead

func (k *Keeper) InsertGenesisHead(ctx context.Context, executionBlockHash []byte) error

InsertGenesisHead inserts the genesis execution head into the database.

func (*Keeper) PostFinalize

func (k *Keeper) PostFinalize(ctx sdk.Context) error

PostFinalize is called by our custom ABCI wrapper after a block is finalized. It starts an optimistic build if enabled and if we are the next proposer.

This custom ABCI callback is used since we need to trigger optimistic builds immediately after FinalizeBlock with the latest app hash which isn't available from cosmosSDK otherwise.

func (*Keeper) PrepareProposal

func (k *Keeper) PrepareProposal(ctx sdk.Context, req *abci.RequestPrepareProposal) (
	*abci.ResponsePrepareProposal, error,
)

PrepareProposal returns a proposal for the next block. Note returning an error results in a panic cometbft and CONSENSUS_FAILURE log.

func (*Keeper) ProcessSoftwareUpgrade

func (k *Keeper) ProcessSoftwareUpgrade(ctx context.Context, ev *bindings.UpgradeEntrypointSoftwareUpgrade) error

func (*Keeper) ProcessUpgradeEvents

func (k *Keeper) ProcessUpgradeEvents(ctx context.Context, height uint64, logs []*types.EVMEvent) error

func (*Keeper) RegisterProposalService

func (k *Keeper) RegisterProposalService(server grpc1.Server)

RegisterProposalService registers the proposal service on the provided router. This implements abci.ProcessProposal verification of new proposals.

func (*Keeper) SetBuildDelay

func (k *Keeper) SetBuildDelay(d time.Duration)

SetBuildDelay sets the build delay parameter.

func (*Keeper) SetBuildOptimistic

func (k *Keeper) SetBuildOptimistic(b bool)

SetBuildOptimistic sets the optimistic build parameter.

func (*Keeper) SetCometAPI

func (k *Keeper) SetCometAPI(c comet.API)

SetCometAPI sets the comet API client.

func (*Keeper) SetParams

func (k *Keeper) SetParams(ctx context.Context, params types.Params) error

This method performs no validation of the parameters.

func (*Keeper) SetValidatorAddress

func (k *Keeper) SetValidatorAddress(addr common.Address)

SetValidatorAddress sets the validator address.

func (*Keeper) ValidateGenesis

func (k *Keeper) ValidateGenesis(gs *types.GenesisState) error

Jump to

Keyboard shortcuts

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