Documentation
¶
Index ¶
- Constants
- func NewMsgServerImpl(keeper *Keeper) tiablob.MsgServer
- func NewQueryServerImpl(k *Keeper) tiablob.QueryServer
- func NewTiablobSnapshotter(cms storetypes.MultiStore, keeper *Keeper) snapshot.ExtensionSnapshotter
- type Keeper
- func (k *Keeper) AddPendingBlockToTimeoutsMap(ctx context.Context, height int64, expiration int64) error
- func (k *Keeper) AddUpdatePendingBlock(ctx context.Context, pendingBlock int64, currentBlockTime time.Time) error
- func (k Keeper) CanUpdateClient(ctx sdk.Context, clientMsg celestia.ClientMessage) error
- func (k Keeper) CreateClient(ctx sdk.Context, clientState celestia.ClientState, ...) error
- func (k *Keeper) ExportGenesis(ctx sdk.Context) *tiablob.GenesisState
- func (k *Keeper) GetAllValidators(ctx context.Context) (tiablob.Validators, error)
- func (k Keeper) GetCelestiaGenesisState(ctx sdk.Context) *celestia.GenesisState
- func (k *Keeper) GetClientID(ctx context.Context) (string, error)
- func (k Keeper) GetClientState(ctx sdk.Context) (*celestia.ClientState, bool)
- func (k Keeper) GetExpiredBlocks(ctx context.Context, currentBlockTime time.Time) []int64
- func (k *Keeper) GetPendingBlocksWithExpiration(ctx context.Context) ([]*tiablob.BlockWithExpiration, error)
- func (k *Keeper) GetProvenHeight(ctx context.Context) (int64, error)
- func (k *Keeper) GetValidatorCelestiaAddress(ctx context.Context, validatorAddress string) (string, error)
- func (k *Keeper) InitGenesis(ctx sdk.Context, data *tiablob.GenesisState) error
- func (k *Keeper) IsBlockExpired(ctx context.Context, currentBlockTime time.Time, blockHeight int64) bool
- func (k Keeper) IsBlockPending(ctx context.Context, blockHeight int64) bool
- func (k *Keeper) PreBlocker(ctx sdk.Context, req *abci.RequestFinalizeBlock) error
- func (k *Keeper) RemovePendingBlock(ctx context.Context, provenBlock int64) error
- func (k Keeper) SetCelestiaGenesisState(ctx sdk.Context, gs *celestia.GenesisState)
- func (k *Keeper) SetClientID(ctx context.Context, clientID string) error
- func (k *Keeper) SetProvenHeight(ctx context.Context, height int64) error
- func (k *Keeper) SetRelayer(r *tiablobrelayer.Relayer)
- func (k *Keeper) SetValidatorCelestiaAddress(ctx context.Context, validator tiablob.Validator) error
- func (k Keeper) UpdateClient(ctx sdk.Context, clientMsg celestia.ClientMessage) error
- func (k Keeper) VerifyMembership(ctx sdk.Context, height uint64, proof *celestia.ShareProof) error
- type ProofOfBlobProposalHandler
- type TiaBlobSnapshotter
- func (s *TiaBlobSnapshotter) RestoreExtension(height uint64, format uint32, payloadReader snapshot.ExtensionPayloadReader) error
- func (s *TiaBlobSnapshotter) SnapshotExtension(height uint64, payloadWriter snapshot.ExtensionPayloadWriter) error
- func (*TiaBlobSnapshotter) SnapshotFormat() uint32
- func (*TiaBlobSnapshotter) SnapshotName() string
- func (*TiaBlobSnapshotter) SupportedFormats() []uint32
Constants ¶
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 )
const DelayAfterUpgrade = int64(10)
const SnapshotFormat = 1
SnapshotFormat defines the default snapshot extension encoding format. SnapshotFormat 1 is a proto marshalled UnprovenBlock type.
Variables ¶
This section is empty.
Functions ¶
func NewMsgServerImpl ¶
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.
func NewTiablobSnapshotter ¶
func NewTiablobSnapshotter(cms storetypes.MultiStore, keeper *Keeper) snapshot.ExtensionSnapshotter
NewTiablobSnapshotter creates and returns a new snapshot.ExtensionSnapshotter implementation for tiablob.
Types ¶
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, tiablob.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 (*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 (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 (Keeper) GetCelestiaGenesisState ¶
func (k Keeper) GetCelestiaGenesisState(ctx sdk.Context) *celestia.GenesisState
GetCelestiaGenesisState exports the celestia light client's full state
func (Keeper) GetClientState ¶
func (Keeper) GetExpiredBlocks ¶
GetExpiredBlocks returns all expired blocks, proposer will propose publishing based on this set
func (*Keeper) GetPendingBlocksWithExpiration ¶
func (*Keeper) GetProvenHeight ¶
func (*Keeper) GetValidatorCelestiaAddress ¶
func (*Keeper) InitGenesis ¶
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 ¶
IsBlockPending return true if a block height is already pending
func (*Keeper) PreBlocker ¶
func (*Keeper) RemovePendingBlock ¶
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 (*Keeper) SetProvenHeight ¶
func (*Keeper) SetRelayer ¶
func (k *Keeper) SetRelayer(r *tiablobrelayer.Relayer)
func (*Keeper) SetValidatorCelestiaAddress ¶
func (Keeper) UpdateClient ¶
func (Keeper) VerifyMembership ¶
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 (h *ProofOfBlobProposalHandler) PrepareProposal(ctx sdk.Context, req *abci.RequestPrepareProposal) (*abci.ResponsePrepareProposal, error)
func (*ProofOfBlobProposalHandler) ProcessProposal ¶
func (h *ProofOfBlobProposalHandler) ProcessProposal(ctx sdk.Context, req *abci.RequestProcessProposal) (*abci.ResponseProcessProposal, error)
type TiaBlobSnapshotter ¶
type TiaBlobSnapshotter struct {
// contains filtered or unexported fields
}
TiaBlobSnapshotter implements the snapshot.ExtensionSnapshotter interface and is used to import and export unproven blocks so they can be proven when needed. State sync would otherwise missed these blocks and the node would panic.
func (*TiaBlobSnapshotter) RestoreExtension ¶
func (s *TiaBlobSnapshotter) RestoreExtension(height uint64, format uint32, payloadReader snapshot.ExtensionPayloadReader) error
RestoreExtension implements the snapshot.ExtensionSnapshotter interface. RestoreExtension is used to read data from an existing extension state snapshot into the tiablob keeper. The payload reader returns io.EOF when it has reached the end of the extension state snapshot.
func (*TiaBlobSnapshotter) SnapshotExtension ¶
func (s *TiaBlobSnapshotter) SnapshotExtension(height uint64, payloadWriter snapshot.ExtensionPayloadWriter) error
SnapshotExtension implements the snapshot.ExntensionSnapshotter interface. SnapshotExtension is used to write data payloads into the underlying protobuf stream from the local client.
func (*TiaBlobSnapshotter) SnapshotFormat ¶
func (*TiaBlobSnapshotter) SnapshotFormat() uint32
SnapshotFormat implements the snapshot.ExtensionSnapshotter interface. This is the default format used for encoding payloads when taking a snapshot.
func (*TiaBlobSnapshotter) SnapshotName ¶
func (*TiaBlobSnapshotter) SnapshotName() string
SnapshotName implements the snapshot.ExtensionSnapshotter interface. A unique name should be provided such that the implementation can be identified by the manager.
func (*TiaBlobSnapshotter) SupportedFormats ¶
func (*TiaBlobSnapshotter) SupportedFormats() []uint32
SupportedFormats implements the snapshot.ExtensionSnapshotter interface. This defines a list of supported formats the snapshotter extension can restore from.