Documentation ¶
Index ¶
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- func UInt64FromBytes(s []byte) uint64
- type Hooks
- func (h Hooks) AfterDelegationModified(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress) error
- func (h Hooks) AfterValidatorBeginUnbonding(ctx sdk.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error
- func (h Hooks) AfterValidatorBonded(_ sdk.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error
- func (h Hooks) AfterValidatorCreated(ctx sdk.Context, addr sdk.ValAddress) error
- func (h Hooks) AfterValidatorRemoved(_ sdk.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error
- func (h Hooks) BeforeDelegationCreated(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress) error
- func (h Hooks) BeforeDelegationRemoved(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress) error
- func (h Hooks) BeforeDelegationSharesModified(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress) error
- func (h Hooks) BeforeValidatorModified(_ sdk.Context, _ sdk.ValAddress) error
- func (h Hooks) BeforeValidatorSlashed(_ sdk.Context, _ sdk.ValAddress, _ sdk.Dec) error
- type Keeper
- func (k Keeper) AttestationRequestByNonce(ctx context.Context, request *types.QueryAttestationRequestByNonceRequest) (*types.QueryAttestationRequestByNonceResponse, error)
- func (k Keeper) CheckEarliestAvailableAttestationNonce(ctx sdk.Context) bool
- func (k Keeper) CheckLatestAttestationNonce(ctx sdk.Context) bool
- func (k Keeper) DataCommitmentRangeForHeight(c context.Context, request *types.QueryDataCommitmentRangeForHeightRequest) (*types.QueryDataCommitmentRangeForHeightResponse, error)
- func (k Keeper) DeleteAttestation(ctx sdk.Context, nonce uint64)
- func (k Keeper) DeserializeValidatorIterator(vals []byte) stakingtypes.ValAddresses
- func (k Keeper) EVMAddress(goCtx context.Context, req *types.QueryEVMAddressRequest) (*types.QueryEVMAddressResponse, error)
- func (k Keeper) EarliestAttestationNonce(c context.Context, _ *types.QueryEarliestAttestationNonceRequest) (*types.QueryEarliestAttestationNonceResponse, error)
- func (k Keeper) GetAttestationByNonce(ctx sdk.Context, nonce uint64) (types.AttestationRequestI, bool, error)
- func (k Keeper) GetCurrentValset(ctx sdk.Context) (types.Valset, error)
- func (k Keeper) GetDataCommitmentForHeight(ctx sdk.Context, height uint64) (types.DataCommitment, error)
- func (k Keeper) GetDataCommitmentWindowParam(ctx sdk.Context) uint64
- func (k Keeper) GetEVMAddress(ctx sdk.Context, valAddress sdk.ValAddress) (gethcommon.Address, bool)
- func (k Keeper) GetEarliestAvailableAttestationNonce(ctx sdk.Context) uint64
- func (k Keeper) GetLatestAttestationNonce(ctx sdk.Context) uint64
- func (k Keeper) GetLatestDataCommitment(ctx sdk.Context) (types.DataCommitment, error)
- func (k Keeper) GetLatestUnBondingBlockHeight(ctx sdk.Context) uint64
- func (k Keeper) GetLatestValset(ctx sdk.Context) (*types.Valset, error)
- func (k Keeper) GetLatestValsetBeforeNonce(ctx sdk.Context, nonce uint64) (*types.Valset, error)
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k Keeper) HasDataCommitmentInStore(ctx sdk.Context) (bool, error)
- func (k Keeper) Hooks() Hooks
- func (k Keeper) IsEVMAddressUnique(ctx sdk.Context, evmAddress gethcommon.Address) bool
- func (k Keeper) LatestAttestationNonce(ctx context.Context, _ *types.QueryLatestAttestationNonceRequest) (*types.QueryLatestAttestationNonceResponse, error)
- func (k Keeper) LatestDataCommitment(c context.Context, _ *types.QueryLatestDataCommitmentRequest) (*types.QueryLatestDataCommitmentResponse, error)
- func (k Keeper) LatestUnbondingHeight(c context.Context, _ *types.QueryLatestUnbondingHeightRequest) (*types.QueryLatestUnbondingHeightResponse, error)
- func (k Keeper) LatestValsetRequestBeforeNonce(c context.Context, req *types.QueryLatestValsetRequestBeforeNonceRequest) (*types.QueryLatestValsetRequestBeforeNonceResponse, error)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) NextDataCommitment(ctx sdk.Context) (types.DataCommitment, error)
- func (k Keeper) Params(c context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Keeper) RegisterEVMAddress(goCtx context.Context, msg *types.MsgRegisterEVMAddress) (*types.MsgRegisterEVMAddressResponse, error)
- func (k Keeper) SetAttestationRequest(ctx sdk.Context, at types.AttestationRequestI) error
- func (k Keeper) SetEVMAddress(ctx sdk.Context, valAddress sdk.ValAddress, evmAddress gethcommon.Address)
- func (k Keeper) SetEarliestAvailableAttestationNonce(ctx sdk.Context, nonce uint64)
- func (k Keeper) SetLatestAttestationNonce(ctx sdk.Context, nonce uint64)
- func (k Keeper) SetLatestUnBondingBlockHeight(ctx sdk.Context, unbondingBlockHeight uint64)
- func (k Keeper) SetParams(ctx sdk.Context, ps types.Params)
- func (k Keeper) StoreAttestation(ctx sdk.Context, at types.AttestationRequestI)
- type StakingKeeper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the Blobstream MsgServer interface for the provided Keeper.
func UInt64FromBytes ¶
UInt64FromBytes create uint from binary big endian representation.
Types ¶
type Hooks ¶
type Hooks struct {
// contains filtered or unexported fields
}
Hooks is a wrapper struct around Keeper.
func (Hooks) AfterDelegationModified ¶
func (h Hooks) AfterDelegationModified(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress) error
func (Hooks) AfterValidatorBeginUnbonding ¶
func (h Hooks) AfterValidatorBeginUnbonding(ctx sdk.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error
func (Hooks) AfterValidatorBonded ¶
func (h Hooks) AfterValidatorBonded(_ sdk.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error
func (Hooks) AfterValidatorCreated ¶
func (Hooks) AfterValidatorRemoved ¶
func (h Hooks) AfterValidatorRemoved(_ sdk.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error
func (Hooks) BeforeDelegationCreated ¶
func (h Hooks) BeforeDelegationCreated(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress) error
func (Hooks) BeforeDelegationRemoved ¶
func (h Hooks) BeforeDelegationRemoved(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress) error
func (Hooks) BeforeDelegationSharesModified ¶
func (h Hooks) BeforeDelegationSharesModified(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress) error
func (Hooks) BeforeValidatorModified ¶
func (Hooks) BeforeValidatorSlashed ¶
type Keeper ¶
type Keeper struct { StakingKeeper StakingKeeper // contains filtered or unexported fields }
func NewKeeper ¶
func NewKeeper(cdc codec.BinaryCodec, storeKey storetypes.StoreKey, paramSpace paramtypes.Subspace, stakingKeeper StakingKeeper) *Keeper
func (Keeper) AttestationRequestByNonce ¶
func (k Keeper) AttestationRequestByNonce( ctx context.Context, request *types.QueryAttestationRequestByNonceRequest, ) (*types.QueryAttestationRequestByNonceResponse, error)
func (Keeper) CheckEarliestAvailableAttestationNonce ¶
CheckEarliestAvailableAttestationNonce returns true if the earliest available attestation nonce has been initialized in store, and false if not.
func (Keeper) CheckLatestAttestationNonce ¶
CheckLatestAttestationNonce returns true if the latest attestation request nonce is declared in the store and false if it has not been initialized.
func (Keeper) DataCommitmentRangeForHeight ¶
func (k Keeper) DataCommitmentRangeForHeight( c context.Context, request *types.QueryDataCommitmentRangeForHeightRequest, ) (*types.QueryDataCommitmentRangeForHeightResponse, error)
func (Keeper) DeleteAttestation ¶
DeleteAttestation deletes an attestation from state. Will do nothing if the attestation doesn't exist in store.
func (Keeper) DeserializeValidatorIterator ¶
func (k Keeper) DeserializeValidatorIterator(vals []byte) stakingtypes.ValAddresses
DeserializeValidatorIterator returns validators from the validator iterator. Adding here in Blobstream keeper as cdc is not available inside endblocker.
func (Keeper) EVMAddress ¶
func (k Keeper) EVMAddress(goCtx context.Context, req *types.QueryEVMAddressRequest) (*types.QueryEVMAddressResponse, error)
EVMAddress tries to find the associated EVM address for a given validator address. If none is found, an empty address is returned
func (Keeper) EarliestAttestationNonce ¶
func (k Keeper) EarliestAttestationNonce( c context.Context, _ *types.QueryEarliestAttestationNonceRequest, ) (*types.QueryEarliestAttestationNonceResponse, error)
EarliestAttestationNonce queries the earliest attestation nonce.
func (Keeper) GetAttestationByNonce ¶
func (k Keeper) GetAttestationByNonce(ctx sdk.Context, nonce uint64) (types.AttestationRequestI, bool, error)
GetAttestationByNonce returns an attestation request by nonce. Returns (nil, false, nil) if the attestation is not found.
func (Keeper) GetCurrentValset ¶
func (Keeper) GetDataCommitmentForHeight ¶
func (k Keeper) GetDataCommitmentForHeight(ctx sdk.Context, height uint64) (types.DataCommitment, error)
GetDataCommitmentForHeight returns the attestation containing the provided height.
func (Keeper) GetDataCommitmentWindowParam ¶
func (Keeper) GetEVMAddress ¶
func (k Keeper) GetEVMAddress(ctx sdk.Context, valAddress sdk.ValAddress) (gethcommon.Address, bool)
func (Keeper) GetEarliestAvailableAttestationNonce ¶
GetEarliestAvailableAttestationNonce returns the earliest available attestation nonce. The nonce is of the earliest available attestation in store that can be retrieved. Panics if the earliest available attestation nonce doesn't exist in store. This value is set on chain startup. However, it won't be written to store until height = 1. To check if this value exists in store, use the `CheckEarliestAvailableAttestationNonce` method.
func (Keeper) GetLatestAttestationNonce ¶
GetLatestAttestationNonce returns the latest attestation request nonce. Panics if the latest attestation nonce doesn't exist in store. This value is set on chain startup. However, it won't be written to store until height = 1. To check if this value exists in store, use the `CheckLatestAttestationNonce` method.
func (Keeper) GetLatestDataCommitment ¶
GetLatestDataCommitment returns the latest data commitment.
func (Keeper) GetLatestUnBondingBlockHeight ¶
GetLatestUnBondingBlockHeight returns the latest unbonding block height or zero if not set. This value is not saved or loaded at genesis. This value is reset to zero on chain upgrade.
func (Keeper) GetLatestValset ¶
GetLatestValset returns the latest validator set in store. This is different from the CurrentValset because this one has been saved and is therefore *the* latest valset saved in store. GetCurrentValset shows you what could be, if you chose to save it, this function shows you what is the latest valset that was saved. If not found, returns the current valset in case no valset exists in store after pruning. Otherwise panics.
func (Keeper) GetLatestValsetBeforeNonce ¶
GetLatestValsetBeforeNonce returns the previous valset before the provided `nonce`. the `nonce` can be a valset, but this method will return the valset before it. If the provided nonce is 1, it will return an error, because, there is no valset before nonce 1.
func (Keeper) HasDataCommitmentInStore ¶
HasDataCommitmentInStore returns true if the store has at least one data commitment.
func (Keeper) IsEVMAddressUnique ¶
IsEVMAddressUnique checks if the provided evm address is globally unique. This includes the defaults we set validators when they initially create a validator before registering
func (Keeper) LatestAttestationNonce ¶
func (k Keeper) LatestAttestationNonce( ctx context.Context, _ *types.QueryLatestAttestationNonceRequest, ) (*types.QueryLatestAttestationNonceResponse, error)
func (Keeper) LatestDataCommitment ¶
func (k Keeper) LatestDataCommitment( c context.Context, _ *types.QueryLatestDataCommitmentRequest, ) (*types.QueryLatestDataCommitmentResponse, error)
func (Keeper) LatestUnbondingHeight ¶
func (k Keeper) LatestUnbondingHeight( c context.Context, _ *types.QueryLatestUnbondingHeightRequest, ) (*types.QueryLatestUnbondingHeightResponse, error)
LatestUnbondingHeight queries the latest unbonding height.
func (Keeper) LatestValsetRequestBeforeNonce ¶
func (k Keeper) LatestValsetRequestBeforeNonce( c context.Context, req *types.QueryLatestValsetRequestBeforeNonceRequest, ) (*types.QueryLatestValsetRequestBeforeNonceResponse, error)
LatestValsetRequestBeforeNonce queries the latest valset request before nonce
func (Keeper) NextDataCommitment ¶
NextDataCommitment returns the next data commitment that can be written to state.
func (Keeper) Params ¶
func (k Keeper) Params(c context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
func (Keeper) RegisterEVMAddress ¶
func (k Keeper) RegisterEVMAddress(goCtx context.Context, msg *types.MsgRegisterEVMAddress) (*types.MsgRegisterEVMAddressResponse, error)
RegisterEVMAddress verifies that the validator exists on chain. It then stores the EVM address. If it already exists, it will simply overwrite the previous value
func (Keeper) SetAttestationRequest ¶
SetAttestationRequest sets a new attestation request to the store to be signed by orchestrators afterwards.
func (Keeper) SetEVMAddress ¶
func (k Keeper) SetEVMAddress(ctx sdk.Context, valAddress sdk.ValAddress, evmAddress gethcommon.Address)
func (Keeper) SetEarliestAvailableAttestationNonce ¶
SetEarliestAvailableAttestationNonce sets the earliest available attestation nonce. The nonce is of the earliest available attestation in store that can be retrieved.
func (Keeper) SetLatestAttestationNonce ¶
SetLatestAttestationNonce sets the latest attestation request nonce, since it's expected that this value will only increase by one and it panics otherwise.
func (Keeper) SetLatestUnBondingBlockHeight ¶
SetLatestUnBondingBlockHeight sets the latest unbonding block height. Note this value is not saved to state or loaded at genesis. This value is reset to zero on chain upgrade.
func (Keeper) StoreAttestation ¶
func (k Keeper) StoreAttestation(ctx sdk.Context, at types.AttestationRequestI)
StoreAttestation saves the attestation in store. Should panic if overwriting existing one.
type StakingKeeper ¶
type StakingKeeper interface { GetValidator(ctx sdk.Context, addr sdk.ValAddress) (validator stakingtypes.Validator, found bool) GetBondedValidatorsByPower(ctx sdk.Context) []stakingtypes.Validator GetLastValidatorPower(ctx sdk.Context, valAddr sdk.ValAddress) int64 }
StakingKeeper restricts the functionality of the bank keeper used in the blobstream keeper