keeper

package
v0.0.0-...-a168d6f Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Window for a transaction to be committed on Celestia
	CelestiaResubmissionTime = 75 * time.Second

	// Buffer for relayer polling logic to retrieve a proof
	RelayerPollingBuffer = 15 * time.Second
)
View Source
const DelayAfterUpgrade = int64(10)

Variables

View Source
var (
	ErrInvalidLengthAbci        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowAbci          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupAbci = fmt.Errorf("proto: unexpected end of group")
)

Functions

func NewMsgServerImpl

func NewMsgServerImpl(keeper *Keeper) tiablob.MsgServer

NewMsgServerImpl returns an implementation of the module MsgServer interface.

func NewQueryServerImpl

func NewQueryServerImpl(k *Keeper) tiablob.QueryServer

NewQueryServerImpl returns an implementation of the module QueryServer.

Types

type InjectedData

type InjectedData struct {
	CreateClient  *celestia.CreateClient `protobuf:"bytes,1,opt,name=create_client,json=createClient,proto3" json:"create_client,omitempty"`
	Headers       []*celestia.Header     `protobuf:"bytes,2,rep,name=headers,proto3" json:"headers,omitempty"`
	Proofs        []*celestia.BlobProof  `protobuf:"bytes,3,rep,name=proofs,proto3" json:"proofs,omitempty"`
	PendingBlocks PendingBlocks          `protobuf:"bytes,4,opt,name=pending_blocks,json=pendingBlocks,proto3" json:"pending_blocks"`
}

func (*InjectedData) Descriptor

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

func (*InjectedData) GetCreateClient

func (m *InjectedData) GetCreateClient() *celestia.CreateClient

func (*InjectedData) GetHeaders

func (m *InjectedData) GetHeaders() []*celestia.Header

func (*InjectedData) GetPendingBlocks

func (m *InjectedData) GetPendingBlocks() PendingBlocks

func (*InjectedData) GetProofs

func (m *InjectedData) GetProofs() []*celestia.BlobProof

func (InjectedData) IsEmpty

func (d InjectedData) IsEmpty() bool

func (*InjectedData) Marshal

func (m *InjectedData) Marshal() (dAtA []byte, err error)

func (*InjectedData) MarshalTo

func (m *InjectedData) MarshalTo(dAtA []byte) (int, error)

func (*InjectedData) MarshalToSizedBuffer

func (m *InjectedData) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*InjectedData) ProtoMessage

func (*InjectedData) ProtoMessage()

func (*InjectedData) Reset

func (m *InjectedData) Reset()

func (*InjectedData) Size

func (m *InjectedData) Size() (n int)

func (*InjectedData) String

func (m *InjectedData) String() string

func (*InjectedData) Unmarshal

func (m *InjectedData) Unmarshal(dAtA []byte) error

func (*InjectedData) XXX_DiscardUnknown

func (m *InjectedData) XXX_DiscardUnknown()

func (*InjectedData) XXX_Marshal

func (m *InjectedData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*InjectedData) XXX_Merge

func (m *InjectedData) XXX_Merge(src proto.Message)

func (*InjectedData) XXX_Size

func (m *InjectedData) XXX_Size() int

func (*InjectedData) XXX_Unmarshal

func (m *InjectedData) XXX_Unmarshal(b []byte) error

type Keeper

type Keeper struct {
	Validators              collections.Map[string, string]
	ClientID                collections.Item[string]
	ProvenHeight            collections.Item[int64]
	PendingBlocksToTimeouts collections.Map[int64, int64]
	TimeoutsToPendingBlocks collections.Map[int64, PendingBlocks]
	// contains filtered or unexported fields
}

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	appOpts servertypes.AppOptions,
	storeService storetypes.KVStoreService,
	sk *stakingkeeper.Keeper,
	uk *upgradekeeper.Keeper,
	key storetypes2.StoreKey,
	publishToCelestiaBlockInterval int,
	celestiaNamespace share.Namespace,
) *Keeper

func (*Keeper) AddPendingBlockToTimeoutsMap

func (k *Keeper) AddPendingBlockToTimeoutsMap(ctx context.Context, height int64, expiration int64) error

func (*Keeper) AddUpdatePendingBlock

func (k *Keeper) AddUpdatePendingBlock(ctx context.Context, pendingBlock int64, currentBlockTime time.Time) error

AddUpdatePendingBlock will add a new pending block or update an existing pending block

func (Keeper) CanUpdateClient

func (k Keeper) CanUpdateClient(ctx sdk.Context, clientMsg celestia.ClientMessage) error

func (Keeper) CreateClient

func (k Keeper) CreateClient(ctx sdk.Context, clientState celestia.ClientState, consensusState celestia.ConsensusState) error

func (*Keeper) ExportGenesis

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

ExportGenesis exports the module's state to a genesis state.

func (*Keeper) GetAllValidators

func (k *Keeper) GetAllValidators(ctx context.Context) (tiablob.Validators, error)

func (Keeper) GetCelestiaGenesisState

func (k Keeper) GetCelestiaGenesisState(ctx sdk.Context) *celestia.GenesisState

GetCelestiaGenesisState exports the celestia light client's full state

func (*Keeper) GetClientID

func (k *Keeper) GetClientID(ctx context.Context) (string, error)

func (Keeper) GetClientState

func (k Keeper) GetClientState(ctx sdk.Context) (*celestia.ClientState, bool)

func (Keeper) GetExpiredBlocks

func (k Keeper) GetExpiredBlocks(ctx context.Context, currentBlockTime time.Time) []int64

GetExpiredBlocks returns all expired blocks, proposer will propose publishing based on this set

func (*Keeper) GetPendingBlocksWithExpiration

func (k *Keeper) GetPendingBlocksWithExpiration(ctx context.Context) ([]*tiablob.BlockWithExpiration, error)

func (*Keeper) GetProvenHeight

func (k *Keeper) GetProvenHeight(ctx context.Context) (int64, error)

func (*Keeper) GetValidatorCelestiaAddress

func (k *Keeper) GetValidatorCelestiaAddress(ctx context.Context, validatorAddress string) (string, error)

func (*Keeper) InitGenesis

func (k *Keeper) InitGenesis(ctx sdk.Context, data *tiablob.GenesisState) error

InitGenesis initializes the module's state from a genesis state.

func (*Keeper) IsBlockExpired

func (k *Keeper) IsBlockExpired(ctx context.Context, currentBlockTime time.Time, blockHeight int64) bool

IsBlockExpired will return true if a block is pending and expired, otherwise it returns false

func (Keeper) IsBlockPending

func (k Keeper) IsBlockPending(ctx context.Context, blockHeight int64) bool

IsBlockPending return true if a block height is already pending

func (*Keeper) PreBlocker

func (k *Keeper) PreBlocker(ctx sdk.Context, req *abci.RequestFinalizeBlock) error

func (*Keeper) RemovePendingBlock

func (k *Keeper) RemovePendingBlock(ctx context.Context, provenBlock int64) error

RemovePendingBlock removes proven block from pending state This function will remove the proven block from the PendingBlocksToTimeouts map and TimeoutsToPendingBlocks map

func (Keeper) SetCelestiaGenesisState

func (k Keeper) SetCelestiaGenesisState(ctx sdk.Context, gs *celestia.GenesisState)

SetCelestiaGenesisState imports celestia light client's full state

func (*Keeper) SetClientID

func (k *Keeper) SetClientID(ctx context.Context, clientID string) error

func (*Keeper) SetProvenHeight

func (k *Keeper) SetProvenHeight(ctx context.Context, height int64) error

func (*Keeper) SetRelayer

func (k *Keeper) SetRelayer(r *tiablobrelayer.Relayer)

func (*Keeper) SetValidatorCelestiaAddress

func (k *Keeper) SetValidatorCelestiaAddress(ctx context.Context, validator tiablob.Validator) error

func (Keeper) UpdateClient

func (k Keeper) UpdateClient(ctx sdk.Context, clientMsg celestia.ClientMessage) error

func (Keeper) VerifyMembership

func (k Keeper) VerifyMembership(ctx sdk.Context, height uint64, proof *celestia.ShareProof) error

type PendingBlocks

type PendingBlocks struct {
	BlockHeights []int64 `protobuf:"varint,1,rep,packed,name=block_heights,json=blockHeights,proto3" json:"block_heights,omitempty"`
}

func (*PendingBlocks) Descriptor

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

func (*PendingBlocks) GetBlockHeights

func (m *PendingBlocks) GetBlockHeights() []int64

func (*PendingBlocks) Marshal

func (m *PendingBlocks) Marshal() (dAtA []byte, err error)

func (*PendingBlocks) MarshalTo

func (m *PendingBlocks) MarshalTo(dAtA []byte) (int, error)

func (*PendingBlocks) MarshalToSizedBuffer

func (m *PendingBlocks) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*PendingBlocks) ProtoMessage

func (*PendingBlocks) ProtoMessage()

func (*PendingBlocks) Reset

func (m *PendingBlocks) Reset()

func (*PendingBlocks) Size

func (m *PendingBlocks) Size() (n int)

func (*PendingBlocks) String

func (m *PendingBlocks) String() string

func (*PendingBlocks) Unmarshal

func (m *PendingBlocks) Unmarshal(dAtA []byte) error

func (*PendingBlocks) XXX_DiscardUnknown

func (m *PendingBlocks) XXX_DiscardUnknown()

func (*PendingBlocks) XXX_Marshal

func (m *PendingBlocks) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PendingBlocks) XXX_Merge

func (m *PendingBlocks) XXX_Merge(src proto.Message)

func (*PendingBlocks) XXX_Size

func (m *PendingBlocks) XXX_Size() int

func (*PendingBlocks) XXX_Unmarshal

func (m *PendingBlocks) XXX_Unmarshal(b []byte) error

type ProofOfBlobProposalHandler

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

func NewProofOfBlobProposalHandler

func NewProofOfBlobProposalHandler(
	k *Keeper,
	prepareProposalHandler sdk.PrepareProposalHandler,
	processProposalHandler sdk.ProcessProposalHandler,
) *ProofOfBlobProposalHandler

func (*ProofOfBlobProposalHandler) PrepareProposal

func (*ProofOfBlobProposalHandler) ProcessProposal

Jump to

Keyboard shortcuts

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