Documentation ¶
Index ¶
- Constants
- Variables
- func ClientIdentifierValidator(id string) error
- func ClientStateKey() []byte
- func ConsensusStateKey(height Height) []byte
- func ConsensusStatePath(height Height) string
- func GetIterationKey(clientStore storetypes.KVStore, height Height) []byte
- func GetProcessedTime(clientStore storetypes.KVStore, height Height) (uint64, bool)
- func IterateConsensusStateAscending(clientStore storetypes.KVStore, cb func(height Height) (stop bool))
- func IterationKey(height Height) []byte
- func ParseChainID(chainID string) uint64
- func ProcessedHeightKey(height Height) []byte
- func ProcessedTimeKey(height Height) []byte
- func PruneAllExpiredConsensusStates(ctx sdk.Context, clientStore storetypes.KVStore, cdc codec.BinaryCodec, ...) int
- func SetClientState(clientStore storetypes.KVStore, cdc codec.BinaryCodec, ...)
- func SetConsensusState(clientStore storetypes.KVStore, cdc codec.BinaryCodec, ...)
- func SetIterationKey(clientStore storetypes.KVStore, height Height)
- func SetProcessedHeight(clientStore storetypes.KVStore, consHeight, processedHeight Height)
- func SetProcessedTime(clientStore storetypes.KVStore, height Height, timeNs uint64)
- func SetRevisionNumber(chainID string, revision uint64) (string, error)
- func ShareProofFromProto(pb *ShareProof) (shareProof, error)
- type BlobProof
- func (*BlobProof) Descriptor() ([]byte, []int)
- func (m *BlobProof) GetCelestiaHeight() int64
- func (m *BlobProof) GetRollchainHeights() []int64
- func (m *BlobProof) GetShareProof() ShareProof
- func (m *BlobProof) Marshal() (dAtA []byte, err error)
- func (m *BlobProof) MarshalTo(dAtA []byte) (int, error)
- func (m *BlobProof) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*BlobProof) ProtoMessage()
- func (m *BlobProof) Reset()
- func (m *BlobProof) Size() (n int)
- func (m *BlobProof) String() string
- func (m *BlobProof) Unmarshal(dAtA []byte) error
- func (m *BlobProof) XXX_DiscardUnknown()
- func (m *BlobProof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *BlobProof) XXX_Merge(src proto.Message)
- func (m *BlobProof) XXX_Size() int
- func (m *BlobProof) XXX_Unmarshal(b []byte) error
- type ClientMessage
- type ClientState
- func (ClientState) CheckForMisbehaviour(ctx sdk.Context, cdc codec.BinaryCodec, clientStore storetypes.KVStore, ...) bool
- func (*ClientState) ClientType() string
- func (*ClientState) Descriptor() ([]byte, []int)
- func (cs ClientState) GetChainID() string
- func (ClientState) GetTimestampAtHeight(ctx sdk.Context, clientStore storetypes.KVStore, cdc codec.BinaryCodec, ...) (uint64, error)
- func (cs ClientState) Initialize(ctx sdk.Context, cdc codec.BinaryCodec, clientStore storetypes.KVStore, ...) error
- func (cs ClientState) IsExpired(latestTimestamp, now time.Time) bool
- func (m *ClientState) Marshal() (dAtA []byte, err error)
- func (m *ClientState) MarshalTo(dAtA []byte) (int, error)
- func (m *ClientState) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*ClientState) ProtoMessage()
- func (m *ClientState) Reset()
- func (m *ClientState) Size() (n int)
- func (cs ClientState) Status(ctx sdk.Context, clientStore storetypes.KVStore, cdc codec.BinaryCodec) Status
- func (m *ClientState) String() string
- func (m *ClientState) Unmarshal(dAtA []byte) error
- func (cs *ClientState) UpdateState(ctx sdk.Context, cdc codec.BinaryCodec, clientStore storetypes.KVStore, ...) []Height
- func (cs ClientState) UpdateStateOnMisbehaviour(ctx sdk.Context, cdc codec.BinaryCodec, clientStore storetypes.KVStore, ...)
- func (cs ClientState) Validate() error
- func (cs *ClientState) VerifyClientMessage(ctx sdk.Context, cdc codec.BinaryCodec, clientStore storetypes.KVStore, ...) error
- func (cs *ClientState) VerifyMembership(ctx sdk.Context, clientStore storetypes.KVStore, cdc codec.BinaryCodec, ...) error
- func (m *ClientState) XXX_DiscardUnknown()
- func (m *ClientState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ClientState) XXX_Merge(src proto.Message)
- func (m *ClientState) XXX_Size() int
- func (m *ClientState) XXX_Unmarshal(b []byte) error
- func (cs ClientState) ZeroCustomFields() *ClientState
- type ConsensusState
- func GetConsensusState(store storetypes.KVStore, cdc codec.BinaryCodec, height Height) (*ConsensusState, bool)
- func GetNextConsensusState(clientStore storetypes.KVStore, cdc codec.BinaryCodec, height Height) (*ConsensusState, bool)
- func GetPreviousConsensusState(clientStore storetypes.KVStore, cdc codec.BinaryCodec, height Height) (*ConsensusState, bool)
- func NewConsensusState(timestamp time.Time, root []byte, nextValsHash cmtbytes.HexBytes) *ConsensusState
- func (ConsensusState) ClientType() string
- func (*ConsensusState) Descriptor() ([]byte, []int)
- func (cs ConsensusState) GetRoot() []byte
- func (cs ConsensusState) GetTimestamp() uint64
- func (m *ConsensusState) Marshal() (dAtA []byte, err error)
- func (m *ConsensusState) MarshalTo(dAtA []byte) (int, error)
- func (m *ConsensusState) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*ConsensusState) ProtoMessage()
- func (m *ConsensusState) Reset()
- func (m *ConsensusState) Size() (n int)
- func (m *ConsensusState) String() string
- func (m *ConsensusState) Unmarshal(dAtA []byte) error
- func (cs ConsensusState) ValidateBasic() error
- func (m *ConsensusState) XXX_DiscardUnknown()
- func (m *ConsensusState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ConsensusState) XXX_Merge(src proto.Message)
- func (m *ConsensusState) XXX_Size() int
- func (m *ConsensusState) XXX_Unmarshal(b []byte) error
- type ConsensusStateWithHeight
- func (*ConsensusStateWithHeight) Descriptor() ([]byte, []int)
- func (m *ConsensusStateWithHeight) GetConsensusState() ConsensusState
- func (m *ConsensusStateWithHeight) GetHeight() Height
- func (m *ConsensusStateWithHeight) Marshal() (dAtA []byte, err error)
- func (m *ConsensusStateWithHeight) MarshalTo(dAtA []byte) (int, error)
- func (m *ConsensusStateWithHeight) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*ConsensusStateWithHeight) ProtoMessage()
- func (m *ConsensusStateWithHeight) Reset()
- func (m *ConsensusStateWithHeight) Size() (n int)
- func (m *ConsensusStateWithHeight) String() string
- func (m *ConsensusStateWithHeight) Unmarshal(dAtA []byte) error
- func (m *ConsensusStateWithHeight) XXX_DiscardUnknown()
- func (m *ConsensusStateWithHeight) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ConsensusStateWithHeight) XXX_Merge(src proto.Message)
- func (m *ConsensusStateWithHeight) XXX_Size() int
- func (m *ConsensusStateWithHeight) XXX_Unmarshal(b []byte) error
- type CreateClient
- func (*CreateClient) Descriptor() ([]byte, []int)
- func (m *CreateClient) Marshal() (dAtA []byte, err error)
- func (m *CreateClient) MarshalTo(dAtA []byte) (int, error)
- func (m *CreateClient) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*CreateClient) ProtoMessage()
- func (m *CreateClient) Reset()
- func (m *CreateClient) Size() (n int)
- func (m *CreateClient) String() string
- func (m *CreateClient) Unmarshal(dAtA []byte) error
- func (m *CreateClient) XXX_DiscardUnknown()
- func (m *CreateClient) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *CreateClient) XXX_Merge(src proto.Message)
- func (m *CreateClient) XXX_Size() int
- func (m *CreateClient) XXX_Unmarshal(b []byte) error
- type Fraction
- func (*Fraction) Descriptor() ([]byte, []int)
- func (m *Fraction) GetDenominator() uint64
- func (m *Fraction) GetNumerator() uint64
- func (m *Fraction) Marshal() (dAtA []byte, err error)
- func (m *Fraction) MarshalTo(dAtA []byte) (int, error)
- func (m *Fraction) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Fraction) ProtoMessage()
- func (m *Fraction) Reset()
- func (m *Fraction) Size() (n int)
- func (m *Fraction) String() string
- func (f Fraction) ToTendermint() cmtmath.Fraction
- func (m *Fraction) Unmarshal(dAtA []byte) error
- func (m *Fraction) XXX_DiscardUnknown()
- func (m *Fraction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Fraction) XXX_Merge(src proto.Message)
- func (m *Fraction) XXX_Size() int
- func (m *Fraction) XXX_Unmarshal(b []byte) error
- type GenesisMetadata
- func (*GenesisMetadata) Descriptor() ([]byte, []int)
- func (m *GenesisMetadata) GetKey() []byte
- func (m *GenesisMetadata) GetValue() []byte
- func (m *GenesisMetadata) Marshal() (dAtA []byte, err error)
- func (m *GenesisMetadata) MarshalTo(dAtA []byte) (int, error)
- func (m *GenesisMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*GenesisMetadata) ProtoMessage()
- func (m *GenesisMetadata) Reset()
- func (m *GenesisMetadata) Size() (n int)
- func (m *GenesisMetadata) String() string
- func (m *GenesisMetadata) Unmarshal(dAtA []byte) error
- func (m *GenesisMetadata) XXX_DiscardUnknown()
- func (m *GenesisMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *GenesisMetadata) XXX_Merge(src proto.Message)
- func (m *GenesisMetadata) XXX_Size() int
- func (m *GenesisMetadata) XXX_Unmarshal(b []byte) error
- type GenesisState
- func (*GenesisState) Descriptor() ([]byte, []int)
- func (m *GenesisState) GetClientState() ClientState
- func (m *GenesisState) GetConsensusStates() []*ConsensusStateWithHeight
- func (m *GenesisState) GetMetadata() []*GenesisMetadata
- func (m *GenesisState) Marshal() (dAtA []byte, err error)
- func (m *GenesisState) MarshalTo(dAtA []byte) (int, error)
- func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*GenesisState) ProtoMessage()
- func (m *GenesisState) Reset()
- func (m *GenesisState) Size() (n int)
- func (m *GenesisState) String() string
- func (m *GenesisState) Unmarshal(dAtA []byte) error
- func (m *GenesisState) XXX_DiscardUnknown()
- func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *GenesisState) XXX_Merge(src proto.Message)
- func (m *GenesisState) XXX_Size() int
- func (m *GenesisState) XXX_Unmarshal(b []byte) error
- type Header
- func (Header) ClientType() string
- func (h Header) ConsensusState() *ConsensusState
- func (*Header) Descriptor() ([]byte, []int)
- func (h Header) GetHeight() Height
- func (h Header) GetTime() time.Time
- func (m *Header) GetTrustedHeight() Height
- func (m *Header) GetTrustedValidators() *types.ValidatorSet
- func (m *Header) GetValidatorSet() *types.ValidatorSet
- func (m *Header) Marshal() (dAtA []byte, err error)
- func (m *Header) MarshalTo(dAtA []byte) (int, error)
- func (m *Header) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Header) ProtoMessage()
- func (m *Header) Reset()
- func (m *Header) Size() (n int)
- func (m *Header) String() string
- func (m *Header) Unmarshal(dAtA []byte) error
- func (h Header) ValidateBasic() error
- func (m *Header) XXX_DiscardUnknown()
- func (m *Header) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Header) XXX_Merge(src proto.Message)
- func (m *Header) XXX_Size() int
- func (m *Header) XXX_Unmarshal(b []byte) error
- type Height
- func GetHeightFromIterationKey(iterKey []byte) Height
- func GetProcessedHeight(clientStore storetypes.KVStore, height Height) (Height, bool)
- func GetSelfHeight(ctx sdk.Context) Height
- func MustParseHeight(heightStr string) Height
- func NewHeight(revisionNumber, revisionHeight uint64) Height
- func ParseHeight(heightStr string) (Height, error)
- func ZeroHeight() Height
- func (h Height) Compare(other Height) int64
- func (h Height) Decrement() (decremented Height, success bool)
- func (*Height) Descriptor() ([]byte, []int)
- func (h Height) EQ(other Height) bool
- func (h Height) GT(other Height) bool
- func (h Height) GTE(other Height) bool
- func (h Height) GetRevisionHeight() uint64
- func (h Height) GetRevisionNumber() uint64
- func (h Height) Increment() Height
- func (h Height) IsZero() bool
- func (h Height) LT(other Height) bool
- func (h Height) LTE(other Height) bool
- func (m *Height) Marshal() (dAtA []byte, err error)
- func (m *Height) MarshalTo(dAtA []byte) (int, error)
- func (m *Height) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Height) ProtoMessage()
- func (m *Height) Reset()
- func (m *Height) Size() (n int)
- func (h Height) String() string
- func (m *Height) Unmarshal(dAtA []byte) error
- func (m *Height) XXX_DiscardUnknown()
- func (m *Height) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Height) XXX_Merge(src proto.Message)
- func (m *Height) XXX_Size() int
- func (m *Height) XXX_Unmarshal(b []byte) error
- type Misbehaviour
- func (Misbehaviour) ClientType() string
- func (*Misbehaviour) Descriptor() ([]byte, []int)
- func (misbehaviour Misbehaviour) GetTime() time.Time
- func (m *Misbehaviour) Marshal() (dAtA []byte, err error)
- func (m *Misbehaviour) MarshalTo(dAtA []byte) (int, error)
- func (m *Misbehaviour) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Misbehaviour) ProtoMessage()
- func (m *Misbehaviour) Reset()
- func (m *Misbehaviour) Size() (n int)
- func (m *Misbehaviour) String() string
- func (m *Misbehaviour) Unmarshal(dAtA []byte) error
- func (misbehaviour Misbehaviour) ValidateBasic() error
- func (m *Misbehaviour) XXX_DiscardUnknown()
- func (m *Misbehaviour) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Misbehaviour) XXX_Merge(src proto.Message)
- func (m *Misbehaviour) XXX_Size() int
- func (m *Misbehaviour) XXX_Unmarshal(b []byte) error
- type NMTProof
- func (*NMTProof) Descriptor() ([]byte, []int)
- func (m *NMTProof) GetEnd() int32
- func (m *NMTProof) GetLeafHash() []byte
- func (m *NMTProof) GetNodes() [][]byte
- func (m *NMTProof) GetStart() int32
- func (m *NMTProof) Marshal() (dAtA []byte, err error)
- func (m *NMTProof) MarshalTo(dAtA []byte) (int, error)
- func (m *NMTProof) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*NMTProof) ProtoMessage()
- func (m *NMTProof) Reset()
- func (m *NMTProof) Size() (n int)
- func (m *NMTProof) String() string
- func (m *NMTProof) Unmarshal(dAtA []byte) error
- func (m *NMTProof) XXX_DiscardUnknown()
- func (m *NMTProof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *NMTProof) XXX_Merge(src proto.Message)
- func (m *NMTProof) XXX_Size() int
- func (m *NMTProof) XXX_Unmarshal(b []byte) error
- type RowProof
- func (*RowProof) Descriptor() ([]byte, []int)
- func (m *RowProof) GetEndRow() uint32
- func (m *RowProof) GetProofs() []*crypto.Proof
- func (m *RowProof) GetRoot() []byte
- func (m *RowProof) GetRowRoots() [][]byte
- func (m *RowProof) GetStartRow() uint32
- func (m *RowProof) Marshal() (dAtA []byte, err error)
- func (m *RowProof) MarshalTo(dAtA []byte) (int, error)
- func (m *RowProof) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*RowProof) ProtoMessage()
- func (m *RowProof) Reset()
- func (m *RowProof) Size() (n int)
- func (m *RowProof) String() string
- func (m *RowProof) Unmarshal(dAtA []byte) error
- func (m *RowProof) XXX_DiscardUnknown()
- func (m *RowProof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *RowProof) XXX_Merge(src proto.Message)
- func (m *RowProof) XXX_Size() int
- func (m *RowProof) XXX_Unmarshal(b []byte) error
- type ShareProof
- func (*ShareProof) Descriptor() ([]byte, []int)
- func (m *ShareProof) GetData() [][]byte
- func (m *ShareProof) GetNamespaceId() []byte
- func (m *ShareProof) GetNamespaceVersion() uint32
- func (m *ShareProof) GetRowProof() *RowProof
- func (m *ShareProof) GetShareProofs() []*NMTProof
- func (m *ShareProof) Marshal() (dAtA []byte, err error)
- func (m *ShareProof) MarshalTo(dAtA []byte) (int, error)
- func (m *ShareProof) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*ShareProof) ProtoMessage()
- func (m *ShareProof) Reset()
- func (m *ShareProof) Size() (n int)
- func (m *ShareProof) String() string
- func (m *ShareProof) Unmarshal(dAtA []byte) error
- func (m *ShareProof) XXX_DiscardUnknown()
- func (m *ShareProof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ShareProof) XXX_Merge(src proto.Message)
- func (m *ShareProof) XXX_Size() int
- func (m *ShareProof) XXX_Unmarshal(b []byte) error
- type Status
Constants ¶
const ( KeyClientState = "clientState" KeyConsensusStatePrefix = "consensusStates" )
const DefaultMaxCharacterLength = 64
DefaultMaxCharacterLength defines the default maximum character length used in validation of identifiers including the client, connection, port and channel identifiers.
NOTE: this restriction is specific to this golang implementation of IBC. If your use case demands a higher limit, please open an issue and we will consider adjusting this restriction.
const KeyIterateConsensusStatePrefix = "iterateConsensusStates"
const SentinelRoot = "sentinel_root"
SentinelRoot is used as a stand-in root value for the consensus state set at the upgrade height
Variables ¶
var ( ErrInvalidLengthCelestia = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowCelestia = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupCelestia = fmt.Errorf("proto: unexpected end of group") )
var ( ErrInvalidChainID = errorsmod.Register(ModuleName, 2, "invalid chain-id") ErrInvalidTrustingPeriod = errorsmod.Register(ModuleName, 3, "invalid trusting period") ErrInvalidUnbondingPeriod = errorsmod.Register(ModuleName, 4, "invalid unbonding period") ErrInvalidHeaderHeight = errorsmod.Register(ModuleName, 5, "invalid header height") ErrInvalidHeader = errorsmod.Register(ModuleName, 6, "invalid header") ErrInvalidMaxClockDrift = errorsmod.Register(ModuleName, 7, "invalid max clock drift") ErrProcessedTimeNotFound = errorsmod.Register(ModuleName, 8, "processed time not found") ErrProcessedHeightNotFound = errorsmod.Register(ModuleName, 9, "processed height not found") ErrDelayPeriodNotPassed = errorsmod.Register(ModuleName, 10, "packet-specified delay period has not been reached") ErrTrustingPeriodExpired = errorsmod.Register(ModuleName, 11, "time since latest trusted state has passed the trusting period") ErrUnbondingPeriodExpired = errorsmod.Register(ModuleName, 12, "time since latest trusted state has passed the unbonding period") ErrInvalidProofSpecs = errorsmod.Register(ModuleName, 13, "invalid proof specs") ErrInvalidValidatorSet = errorsmod.Register(ModuleName, 14, "invalid validator set") )
IBC tendermint client sentinel errors
var ( // KeyProcessedTime is appended to consensus state key to store the processed time KeyProcessedTime = []byte("/processedTime") // KeyProcessedHeight is appended to consensus state key to store the processed height KeyProcessedHeight = []byte("/processedHeight") // KeyIteration stores the key mapping to consensus state key for efficient iteration KeyIteration = []byte("/iterationKey") )
var DefaultTrustLevel = NewFractionFromTm(light.DefaultTrustLevel)
DefaultTrustLevel is the tendermint light client default trust level
var FrozenHeight = NewHeight(0, 1)
FrozenHeight is same for all misbehaviour
var IsRevisionFormat = regexp.MustCompile(`^.*[^\n-]-{1}[1-9][0-9]*$`).MatchString
IsRevisionFormat checks if a chainID is in the format required for parsing revisions The chainID must be in the form: `{chainID}-{revision}`. 24-host may enforce stricter checks on chainID
var IsValidID = regexp.MustCompile(`^[a-zA-Z0-9\.\_\+\-\#\[\]\<\>]+$`).MatchString
IsValidID defines regular expression to check if the string consist of characters in one of the following categories only: - Alphanumeric - `.`, `_`, `+`, `-`, `#` - `[`, `]`, `<`, `>`
var ModuleName = "celestia-da-light-client"
Functions ¶
func ClientIdentifierValidator ¶
ClientIdentifierValidator is the default validator function for Client identifiers. A valid Identifier must be between 9-64 characters and only contain alphanumeric and some allowed special characters (see IsValidID).
func ClientStateKey ¶
func ClientStateKey() []byte
ClientStateKey returns a store key under which a particular client state is stored in a client prefixed store
func ConsensusStateKey ¶
ConsensusStateKey returns the store key for a the consensus state of a particular client stored in a client prefixed store.
func ConsensusStatePath ¶
ConsensusStatePath returns the suffix store key for the consensus state at a particular height stored in a client prefixed store.
func GetIterationKey ¶
func GetIterationKey(clientStore storetypes.KVStore, height Height) []byte
GetIterationKey returns the consensus state key stored under the efficient iteration key. NOTE: This function is currently only used for testing purposes
func GetProcessedTime ¶
func GetProcessedTime(clientStore storetypes.KVStore, height Height) (uint64, bool)
GetProcessedTime gets the time (in nanoseconds) at which this chain received and processed a tendermint header. This is used to validate that a received packet has passed the time delay period.
func IterateConsensusStateAscending ¶
func IterateConsensusStateAscending(clientStore storetypes.KVStore, cb func(height Height) (stop bool))
IterateConsensusStateAscending iterates through the consensus states in ascending order. It calls the provided callback on each height, until stop=true is returned.
func IterationKey ¶
IterationKey returns the key under which the consensus state key will be stored. The iteration key is a BigEndian representation of the consensus state key to support efficient iteration.
func ParseChainID ¶
ParseChainID is a utility function that returns an revision number from the given ChainID. ParseChainID attempts to parse a chain id in the format: `{chainID}-{revision}` and return the revisionnumber as a uint64. If the chainID is not in the expected format, a default revision value of 0 is returned.
func ProcessedHeightKey ¶
ProcessedHeightKey returns the key under which the processed height will be stored in the client store.
func ProcessedTimeKey ¶
ProcessedTimeKey returns the key under which the processed time will be stored in the client store.
func PruneAllExpiredConsensusStates ¶
func PruneAllExpiredConsensusStates( ctx sdk.Context, clientStore storetypes.KVStore, cdc codec.BinaryCodec, clientState *ClientState, ) int
PruneAllExpiredConsensusStates iterates over all consensus states for a given client store. If a consensus state is expired, it is deleted and its metadata is deleted. The number of consensus states pruned is returned.
func SetClientState ¶
func SetClientState(clientStore storetypes.KVStore, cdc codec.BinaryCodec, clientState *ClientState)
setClientState stores the client state
func SetConsensusState ¶
func SetConsensusState(clientStore storetypes.KVStore, cdc codec.BinaryCodec, consensusState *ConsensusState, height Height)
setConsensusState stores the consensus state at the given height.
func SetIterationKey ¶
func SetIterationKey(clientStore storetypes.KVStore, height Height)
SetIterationKey stores the consensus state key under a key that is more efficient for ordered iteration
func SetProcessedHeight ¶
func SetProcessedHeight(clientStore storetypes.KVStore, consHeight, processedHeight Height)
SetProcessedHeight stores the height at which a header was processed and the corresponding consensus state was created. This is useful when validating whether a packet has reached the specified block delay period in the tendermint client's verification functions
func SetProcessedTime ¶
func SetProcessedTime(clientStore storetypes.KVStore, height Height, timeNs uint64)
SetProcessedTime stores the time at which a header was processed and the corresponding consensus state was created. This is useful when validating whether a packet has reached the time specified delay period in the tendermint client's verification functions
func SetRevisionNumber ¶
SetRevisionNumber takes a chainID in valid revision format and swaps the revision number in the chainID with the given revision number.
func ShareProofFromProto ¶
func ShareProofFromProto(pb *ShareProof) (shareProof, error)
shareProofFromProto creates a ShareProof from a proto message. Expects the proof to be pre-validated.
Types ¶
type BlobProof ¶
type BlobProof struct { CelestiaHeight int64 `protobuf:"varint,2,opt,name=celestia_height,json=celestiaHeight,proto3" json:"celestia_height,omitempty"` RollchainHeights []int64 `protobuf:"varint,3,rep,packed,name=rollchain_heights,json=rollchainHeights,proto3" json:"rollchain_heights,omitempty"` }
func (*BlobProof) Descriptor ¶
func (*BlobProof) GetCelestiaHeight ¶
func (*BlobProof) GetRollchainHeights ¶
func (*BlobProof) GetShareProof ¶
func (m *BlobProof) GetShareProof() ShareProof
func (*BlobProof) MarshalToSizedBuffer ¶
func (*BlobProof) ProtoMessage ¶
func (*BlobProof) ProtoMessage()
func (*BlobProof) XXX_DiscardUnknown ¶
func (m *BlobProof) XXX_DiscardUnknown()
func (*BlobProof) XXX_Marshal ¶
func (*BlobProof) XXX_Unmarshal ¶
type ClientMessage ¶
type ClientState ¶
type ClientState struct { ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` TrustLevel Fraction `protobuf:"bytes,2,opt,name=trust_level,json=trustLevel,proto3" json:"trust_level"` // duration of the period since the LatestTimestamp during which the // submitted headers are valid for upgrade TrustingPeriod time.Duration `protobuf:"bytes,3,opt,name=trusting_period,json=trustingPeriod,proto3,stdduration" json:"trusting_period"` // duration of the staking unbonding period UnbondingPeriod time.Duration `protobuf:"bytes,4,opt,name=unbonding_period,json=unbondingPeriod,proto3,stdduration" json:"unbonding_period"` // defines how much new (untrusted) header's Time can drift into the future. MaxClockDrift time.Duration `protobuf:"bytes,5,opt,name=max_clock_drift,json=maxClockDrift,proto3,stdduration" json:"max_clock_drift"` // Block height when the client was frozen due to a misbehaviour FrozenHeight Height `protobuf:"bytes,6,opt,name=frozen_height,json=frozenHeight,proto3" json:"frozen_height"` // Latest height the client was updated to LatestHeight Height `protobuf:"bytes,7,opt,name=latest_height,json=latestHeight,proto3" json:"latest_height"` }
ClientState from Celestia tracks the current validator set, latest height, and a possible frozen height.
func GetClientState ¶
func GetClientState(store storetypes.KVStore, cdc codec.BinaryCodec) (*ClientState, bool)
getClientState retrieves the client state from the store using the provided KVStore and codec. It returns the unmarshaled ClientState and a boolean indicating if the state was found.
func NewClientState ¶
func NewClientState( chainID string, trustLevel Fraction, trustingPeriod, ubdPeriod, maxClockDrift time.Duration, latestHeight Height, ) *ClientState
NewClientState creates a new ClientState instance
func (ClientState) CheckForMisbehaviour ¶
func (ClientState) CheckForMisbehaviour(ctx sdk.Context, cdc codec.BinaryCodec, clientStore storetypes.KVStore, msg ClientMessage) bool
CheckForMisbehaviour detects duplicate height misbehaviour and BFT time violation misbehaviour in a submitted Header message and verifies the correctness of a submitted Misbehaviour ClientMessage
func (*ClientState) ClientType ¶
func (*ClientState) ClientType() string
ClientType implements exported.ClientState.
func (*ClientState) Descriptor ¶
func (*ClientState) Descriptor() ([]byte, []int)
func (ClientState) GetChainID ¶
func (cs ClientState) GetChainID() string
GetChainID returns the chain-id
func (ClientState) GetTimestampAtHeight ¶
func (ClientState) GetTimestampAtHeight( ctx sdk.Context, clientStore storetypes.KVStore, cdc codec.BinaryCodec, height Height, ) (uint64, error)
GetTimestampAtHeight returns the timestamp in nanoseconds of the consensus state at the given height.
func (ClientState) Initialize ¶
func (cs ClientState) Initialize(ctx sdk.Context, cdc codec.BinaryCodec, clientStore storetypes.KVStore, consensusState *ConsensusState) error
Initialize checks that the initial consensus state is an 07-tendermint consensus state and sets the client state, consensus state and associated metadata in the provided client store.
func (ClientState) IsExpired ¶
func (cs ClientState) IsExpired(latestTimestamp, now time.Time) bool
IsExpired returns whether or not the client has passed the trusting period since the last update (in which case no headers are considered valid).
func (*ClientState) Marshal ¶
func (m *ClientState) Marshal() (dAtA []byte, err error)
func (*ClientState) MarshalToSizedBuffer ¶
func (m *ClientState) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*ClientState) ProtoMessage ¶
func (*ClientState) ProtoMessage()
func (*ClientState) Reset ¶
func (m *ClientState) Reset()
func (*ClientState) Size ¶
func (m *ClientState) Size() (n int)
func (ClientState) Status ¶
func (cs ClientState) Status( ctx sdk.Context, clientStore storetypes.KVStore, cdc codec.BinaryCodec, ) Status
Status returns the status of the tendermint client. The client may be: - Active: FrozenHeight is zero and client is not expired - Frozen: Frozen Height is not zero - Expired: the latest consensus state timestamp + trusting period <= current time
A frozen client will become expired, so the Frozen status has higher precedence.
func (*ClientState) String ¶
func (m *ClientState) String() string
func (*ClientState) Unmarshal ¶
func (m *ClientState) Unmarshal(dAtA []byte) error
func (*ClientState) UpdateState ¶
func (cs *ClientState) UpdateState(ctx sdk.Context, cdc codec.BinaryCodec, clientStore storetypes.KVStore, clientMsg ClientMessage) []Height
UpdateState may be used to either create a consensus state for: - a future height greater than the latest client state height - a past height that was skipped during bisection If we are updating to a past height, a consensus state is created for that height to be persisted in client store If we are updating to a future height, the consensus state is created and the client state is updated to reflect the new latest height A list containing the updated consensus height is returned. UpdateState must only be used to update within a single revision, thus header revision number and trusted height's revision number must be the same. To update to a new revision, use a separate upgrade path UpdateState will prune the oldest consensus state if it is expired.
func (ClientState) UpdateStateOnMisbehaviour ¶
func (cs ClientState) UpdateStateOnMisbehaviour(ctx sdk.Context, cdc codec.BinaryCodec, clientStore storetypes.KVStore, _ ClientMessage)
UpdateStateOnMisbehaviour updates state upon misbehaviour, freezing the ClientState. This method should only be called when misbehaviour is detected as it does not perform any misbehaviour checks.
func (ClientState) Validate ¶
func (cs ClientState) Validate() error
Validate performs a basic validation of the client state fields.
func (*ClientState) VerifyClientMessage ¶
func (cs *ClientState) VerifyClientMessage( ctx sdk.Context, cdc codec.BinaryCodec, clientStore storetypes.KVStore, clientMsg ClientMessage, ) error
VerifyClientMessage checks if the clientMessage is of type Header or Misbehaviour and verifies the message
func (*ClientState) VerifyMembership ¶
func (cs *ClientState) VerifyMembership(ctx sdk.Context, clientStore storetypes.KVStore, cdc codec.BinaryCodec, height Height, proof *ShareProof) error
VerifyMembership is a generic proof verification method which verifies an NMT proof that a set of shares exist in a set of rows and a Merkle proof that those rows exist in a Merkle tree with a given data root.
func (*ClientState) XXX_DiscardUnknown ¶
func (m *ClientState) XXX_DiscardUnknown()
func (*ClientState) XXX_Marshal ¶
func (m *ClientState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ClientState) XXX_Merge ¶
func (m *ClientState) XXX_Merge(src proto.Message)
func (*ClientState) XXX_Size ¶
func (m *ClientState) XXX_Size() int
func (*ClientState) XXX_Unmarshal ¶
func (m *ClientState) XXX_Unmarshal(b []byte) error
func (ClientState) ZeroCustomFields ¶
func (cs ClientState) ZeroCustomFields() *ClientState
ZeroCustomFields returns a ClientState that is a copy of the current ClientState with all client customizable fields zeroed out. All chain specific fields must remain unchanged. This client state will be used to verify chain upgrades when a chain breaks a light client verification parameter such as chainID.
type ConsensusState ¶
type ConsensusState struct { // timestamp that corresponds to the block height in which the ConsensusState // was stored. Timestamp time.Time `protobuf:"bytes,1,opt,name=timestamp,proto3,stdtime" json:"timestamp"` // commitment root (i.e app hash) Root []byte `protobuf:"bytes,2,opt,name=root,proto3" json:"root,omitempty"` NextValidatorsHash github_com_cometbft_cometbft_libs_bytes.HexBytes `` /* 175-byte string literal not displayed */ }
ConsensusState defines the consensus state from Tendermint.
func GetConsensusState ¶
func GetConsensusState(store storetypes.KVStore, cdc codec.BinaryCodec, height Height) (*ConsensusState, bool)
GetConsensusState retrieves the consensus state from the client prefixed store. If the ConsensusState does not exist in state for the provided height a nil value and false boolean flag is returned
func GetNextConsensusState ¶
func GetNextConsensusState(clientStore storetypes.KVStore, cdc codec.BinaryCodec, height Height) (*ConsensusState, bool)
GetNextConsensusState returns the lowest consensus state that is larger than the given height. The Iterator returns a storetypes.Iterator which iterates from start (inclusive) to end (exclusive). If the starting height exists in store, we need to call iterator.Next() to get the next consenus state. Otherwise, the iterator is already at the next consensus state so we can call iterator.Value() immediately.
func GetPreviousConsensusState ¶
func GetPreviousConsensusState(clientStore storetypes.KVStore, cdc codec.BinaryCodec, height Height) (*ConsensusState, bool)
GetPreviousConsensusState returns the highest consensus state that is lower than the given height. The Iterator returns a storetypes.Iterator which iterates from the end (exclusive) to start (inclusive). Thus to get previous consensus state we call iterator.Value() immediately.
func NewConsensusState ¶
func NewConsensusState( timestamp time.Time, root []byte, nextValsHash cmtbytes.HexBytes, ) *ConsensusState
NewConsensusState creates a new ConsensusState instance.
func (ConsensusState) ClientType ¶
func (ConsensusState) ClientType() string
func (*ConsensusState) Descriptor ¶
func (*ConsensusState) Descriptor() ([]byte, []int)
func (ConsensusState) GetRoot ¶
func (cs ConsensusState) GetRoot() []byte
GetRoot returns the commitment Root for the specific
func (ConsensusState) GetTimestamp ¶
func (cs ConsensusState) GetTimestamp() uint64
GetTimestamp returns block time in nanoseconds of the header that created consensus state
func (*ConsensusState) Marshal ¶
func (m *ConsensusState) Marshal() (dAtA []byte, err error)
func (*ConsensusState) MarshalToSizedBuffer ¶
func (m *ConsensusState) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*ConsensusState) ProtoMessage ¶
func (*ConsensusState) ProtoMessage()
func (*ConsensusState) Reset ¶
func (m *ConsensusState) Reset()
func (*ConsensusState) Size ¶
func (m *ConsensusState) Size() (n int)
func (*ConsensusState) String ¶
func (m *ConsensusState) String() string
func (*ConsensusState) Unmarshal ¶
func (m *ConsensusState) Unmarshal(dAtA []byte) error
func (ConsensusState) ValidateBasic ¶
func (cs ConsensusState) ValidateBasic() error
ValidateBasic defines a basic validation for the tendermint consensus state. NOTE: ProcessedTimestamp may be zero if this is an initial consensus state passed in by relayer as opposed to a consensus state constructed by the chain.
func (*ConsensusState) XXX_DiscardUnknown ¶
func (m *ConsensusState) XXX_DiscardUnknown()
func (*ConsensusState) XXX_Marshal ¶
func (m *ConsensusState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ConsensusState) XXX_Merge ¶
func (m *ConsensusState) XXX_Merge(src proto.Message)
func (*ConsensusState) XXX_Size ¶
func (m *ConsensusState) XXX_Size() int
func (*ConsensusState) XXX_Unmarshal ¶
func (m *ConsensusState) XXX_Unmarshal(b []byte) error
type ConsensusStateWithHeight ¶
type ConsensusStateWithHeight struct { Height Height `protobuf:"bytes,1,opt,name=height,proto3" json:"height"` ConsensusState ConsensusState `protobuf:"bytes,2,opt,name=consensus_state,json=consensusState,proto3" json:"consensus_state"` }
Consensus state with height attached for import/export genesis
func (*ConsensusStateWithHeight) Descriptor ¶
func (*ConsensusStateWithHeight) Descriptor() ([]byte, []int)
func (*ConsensusStateWithHeight) GetConsensusState ¶
func (m *ConsensusStateWithHeight) GetConsensusState() ConsensusState
func (*ConsensusStateWithHeight) GetHeight ¶
func (m *ConsensusStateWithHeight) GetHeight() Height
func (*ConsensusStateWithHeight) Marshal ¶
func (m *ConsensusStateWithHeight) Marshal() (dAtA []byte, err error)
func (*ConsensusStateWithHeight) MarshalTo ¶
func (m *ConsensusStateWithHeight) MarshalTo(dAtA []byte) (int, error)
func (*ConsensusStateWithHeight) MarshalToSizedBuffer ¶
func (m *ConsensusStateWithHeight) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*ConsensusStateWithHeight) ProtoMessage ¶
func (*ConsensusStateWithHeight) ProtoMessage()
func (*ConsensusStateWithHeight) Reset ¶
func (m *ConsensusStateWithHeight) Reset()
func (*ConsensusStateWithHeight) Size ¶
func (m *ConsensusStateWithHeight) Size() (n int)
func (*ConsensusStateWithHeight) String ¶
func (m *ConsensusStateWithHeight) String() string
func (*ConsensusStateWithHeight) Unmarshal ¶
func (m *ConsensusStateWithHeight) Unmarshal(dAtA []byte) error
func (*ConsensusStateWithHeight) XXX_DiscardUnknown ¶
func (m *ConsensusStateWithHeight) XXX_DiscardUnknown()
func (*ConsensusStateWithHeight) XXX_Marshal ¶
func (m *ConsensusStateWithHeight) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ConsensusStateWithHeight) XXX_Merge ¶
func (m *ConsensusStateWithHeight) XXX_Merge(src proto.Message)
func (*ConsensusStateWithHeight) XXX_Size ¶
func (m *ConsensusStateWithHeight) XXX_Size() int
func (*ConsensusStateWithHeight) XXX_Unmarshal ¶
func (m *ConsensusStateWithHeight) XXX_Unmarshal(b []byte) error
type CreateClient ¶
type CreateClient struct { ClientState ClientState `protobuf:"bytes,1,opt,name=client_state,json=clientState,proto3" json:"client_state"` ConsensusState ConsensusState `protobuf:"bytes,2,opt,name=consensus_state,json=consensusState,proto3" json:"consensus_state"` }
func (*CreateClient) Descriptor ¶
func (*CreateClient) Descriptor() ([]byte, []int)
func (*CreateClient) Marshal ¶
func (m *CreateClient) Marshal() (dAtA []byte, err error)
func (*CreateClient) MarshalToSizedBuffer ¶
func (m *CreateClient) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*CreateClient) ProtoMessage ¶
func (*CreateClient) ProtoMessage()
func (*CreateClient) Reset ¶
func (m *CreateClient) Reset()
func (*CreateClient) Size ¶
func (m *CreateClient) Size() (n int)
func (*CreateClient) String ¶
func (m *CreateClient) String() string
func (*CreateClient) Unmarshal ¶
func (m *CreateClient) Unmarshal(dAtA []byte) error
func (*CreateClient) XXX_DiscardUnknown ¶
func (m *CreateClient) XXX_DiscardUnknown()
func (*CreateClient) XXX_Marshal ¶
func (m *CreateClient) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*CreateClient) XXX_Merge ¶
func (m *CreateClient) XXX_Merge(src proto.Message)
func (*CreateClient) XXX_Size ¶
func (m *CreateClient) XXX_Size() int
func (*CreateClient) XXX_Unmarshal ¶
func (m *CreateClient) XXX_Unmarshal(b []byte) error
type Fraction ¶
type Fraction struct { Numerator uint64 `protobuf:"varint,1,opt,name=numerator,proto3" json:"numerator,omitempty"` Denominator uint64 `protobuf:"varint,2,opt,name=denominator,proto3" json:"denominator,omitempty"` }
Fraction defines the protobuf message type for tmmath.Fraction that only supports positive values.
func NewFractionFromTm ¶
NewFractionFromTm returns a new Fraction instance from a tmmath.Fraction
func (*Fraction) Descriptor ¶
func (*Fraction) GetDenominator ¶
func (*Fraction) GetNumerator ¶
func (*Fraction) MarshalToSizedBuffer ¶
func (*Fraction) ProtoMessage ¶
func (*Fraction) ProtoMessage()
func (Fraction) ToTendermint ¶
ToTendermint converts Fraction to tmmath.Fraction
func (*Fraction) XXX_DiscardUnknown ¶
func (m *Fraction) XXX_DiscardUnknown()
func (*Fraction) XXX_Marshal ¶
func (*Fraction) XXX_Unmarshal ¶
type GenesisMetadata ¶
type GenesisMetadata struct { Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` }
Clients key/value metadata for import/export genesis
func (*GenesisMetadata) Descriptor ¶
func (*GenesisMetadata) Descriptor() ([]byte, []int)
func (*GenesisMetadata) GetKey ¶
func (m *GenesisMetadata) GetKey() []byte
func (*GenesisMetadata) GetValue ¶
func (m *GenesisMetadata) GetValue() []byte
func (*GenesisMetadata) Marshal ¶
func (m *GenesisMetadata) Marshal() (dAtA []byte, err error)
func (*GenesisMetadata) MarshalToSizedBuffer ¶
func (m *GenesisMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*GenesisMetadata) ProtoMessage ¶
func (*GenesisMetadata) ProtoMessage()
func (*GenesisMetadata) Reset ¶
func (m *GenesisMetadata) Reset()
func (*GenesisMetadata) Size ¶
func (m *GenesisMetadata) Size() (n int)
func (*GenesisMetadata) String ¶
func (m *GenesisMetadata) String() string
func (*GenesisMetadata) Unmarshal ¶
func (m *GenesisMetadata) Unmarshal(dAtA []byte) error
func (*GenesisMetadata) XXX_DiscardUnknown ¶
func (m *GenesisMetadata) XXX_DiscardUnknown()
func (*GenesisMetadata) XXX_Marshal ¶
func (m *GenesisMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*GenesisMetadata) XXX_Merge ¶
func (m *GenesisMetadata) XXX_Merge(src proto.Message)
func (*GenesisMetadata) XXX_Size ¶
func (m *GenesisMetadata) XXX_Size() int
func (*GenesisMetadata) XXX_Unmarshal ¶
func (m *GenesisMetadata) XXX_Unmarshal(b []byte) error
type GenesisState ¶
type GenesisState struct { ClientState ClientState `protobuf:"bytes,1,opt,name=client_state,json=clientState,proto3" json:"client_state"` ConsensusStates []*ConsensusStateWithHeight `protobuf:"bytes,2,rep,name=consensus_states,json=consensusStates,proto3" json:"consensus_states,omitempty"` Metadata []*GenesisMetadata `protobuf:"bytes,3,rep,name=metadata,proto3" json:"metadata,omitempty"` }
All client state for import/export genesis
func (*GenesisState) Descriptor ¶
func (*GenesisState) Descriptor() ([]byte, []int)
func (*GenesisState) GetClientState ¶
func (m *GenesisState) GetClientState() ClientState
func (*GenesisState) GetConsensusStates ¶
func (m *GenesisState) GetConsensusStates() []*ConsensusStateWithHeight
func (*GenesisState) GetMetadata ¶
func (m *GenesisState) GetMetadata() []*GenesisMetadata
func (*GenesisState) Marshal ¶
func (m *GenesisState) Marshal() (dAtA []byte, err error)
func (*GenesisState) MarshalToSizedBuffer ¶
func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*GenesisState) ProtoMessage ¶
func (*GenesisState) ProtoMessage()
func (*GenesisState) Reset ¶
func (m *GenesisState) Reset()
func (*GenesisState) Size ¶
func (m *GenesisState) Size() (n int)
func (*GenesisState) String ¶
func (m *GenesisState) String() string
func (*GenesisState) Unmarshal ¶
func (m *GenesisState) Unmarshal(dAtA []byte) error
func (*GenesisState) XXX_DiscardUnknown ¶
func (m *GenesisState) XXX_DiscardUnknown()
func (*GenesisState) XXX_Marshal ¶
func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*GenesisState) XXX_Merge ¶
func (m *GenesisState) XXX_Merge(src proto.Message)
func (*GenesisState) XXX_Size ¶
func (m *GenesisState) XXX_Size() int
func (*GenesisState) XXX_Unmarshal ¶
func (m *GenesisState) XXX_Unmarshal(b []byte) error
type Header ¶
type Header struct { *types.SignedHeader `protobuf:"bytes,1,opt,name=signed_header,json=signedHeader,proto3,embedded=signed_header" json:"signed_header,omitempty"` ValidatorSet *types.ValidatorSet `protobuf:"bytes,2,opt,name=validator_set,json=validatorSet,proto3" json:"validator_set,omitempty"` TrustedHeight Height `protobuf:"bytes,3,opt,name=trusted_height,json=trustedHeight,proto3" json:"trusted_height"` TrustedValidators *types.ValidatorSet `protobuf:"bytes,4,opt,name=trusted_validators,json=trustedValidators,proto3" json:"trusted_validators,omitempty"` }
Header defines the Tendermint client consensus Header. It encapsulates all the information necessary to update from a trusted Tendermint ConsensusState. The inclusion of TrustedHeight and TrustedValidators allows this update to process correctly, so long as the ConsensusState for the TrustedHeight exists, this removes race conditions among relayers The SignedHeader and ValidatorSet are the new untrusted update fields for the client. The TrustedHeight is the height of a stored ConsensusState on the client that will be used to verify the new untrusted header. The Trusted ConsensusState must be within the unbonding period of current time in order to correctly verify, and the TrustedValidators must hash to TrustedConsensusState.NextValidatorsHash since that is the last trusted validator set at the TrustedHeight.
func (Header) ClientType ¶
ClientType defines that the Header is a Tendermint consensus algorithm
func (Header) ConsensusState ¶
func (h Header) ConsensusState() *ConsensusState
ConsensusState returns the updated consensus state associated with the header
func (*Header) Descriptor ¶
func (Header) GetHeight ¶
GetHeight returns the current height. It returns 0 if the tendermint header is nil. NOTE: the header.Header is checked to be non nil in ValidateBasic.
func (Header) GetTime ¶
GetTime returns the current block timestamp. It returns a zero time if the tendermint header is nil. NOTE: the header.Header is checked to be non nil in ValidateBasic.
func (*Header) GetTrustedHeight ¶
func (*Header) GetTrustedValidators ¶
func (m *Header) GetTrustedValidators() *types.ValidatorSet
func (*Header) GetValidatorSet ¶
func (m *Header) GetValidatorSet() *types.ValidatorSet
func (*Header) MarshalToSizedBuffer ¶
func (*Header) ProtoMessage ¶
func (*Header) ProtoMessage()
func (Header) ValidateBasic ¶
ValidateBasic calls the SignedHeader ValidateBasic function and checks that validatorsets are not nil. NOTE: TrustedHeight and TrustedValidators may be empty when creating client with MsgCreateClient
func (*Header) XXX_DiscardUnknown ¶
func (m *Header) XXX_DiscardUnknown()
func (*Header) XXX_Marshal ¶
func (*Header) XXX_Unmarshal ¶
type Height ¶
type Height struct { // the revision that the client is currently on RevisionNumber uint64 `protobuf:"varint,1,opt,name=revision_number,json=revisionNumber,proto3" json:"revision_number,omitempty"` // the height within the given revision RevisionHeight uint64 `protobuf:"varint,2,opt,name=revision_height,json=revisionHeight,proto3" json:"revision_height,omitempty"` }
Height is a monotonically increasing data type that can be compared against another Height for the purposes of updating and freezing clients
Normally the RevisionHeight is incremented at each height while keeping RevisionNumber the same. However some consensus algorithms may choose to reset the height in certain conditions e.g. hard forks, state-machine breaking changes In these cases, the RevisionNumber is incremented so that height continues to be monitonically increasing even as the RevisionHeight gets reset
func GetHeightFromIterationKey ¶
GetHeightFromIterationKey takes an iteration key and returns the height that it references
func GetProcessedHeight ¶
func GetProcessedHeight(clientStore storetypes.KVStore, height Height) (Height, bool)
GetProcessedHeight gets the height at which this chain received and processed a tendermint header. This is used to validate that a received packet has passed the block delay period.
func GetSelfHeight ¶
GetSelfHeight is a utility function that returns self height given context Revision number is retrieved from ctx.ChainID()
func MustParseHeight ¶
MustParseHeight will attempt to parse a string representation of a height and panic if parsing fails.
func ParseHeight ¶
ParseHeight is a utility function that takes a string representation of the height and returns a Height struct
func ZeroHeight ¶
func ZeroHeight() Height
ZeroHeight is a helper function which returns an uninitialized height.
func (Height) Compare ¶
Compare implements a method to compare two heights. When comparing two heights a, b we can call a.Compare(b) which will return -1 if a < b 0 if a = b 1 if a > b
It first compares based on revision numbers, whichever has the higher revision number is the higher height If revision number is the same, then the revision height is compared
func (Height) Decrement ¶
Decrement will return a new height with the RevisionHeight decremented If the RevisionHeight is already at lowest value (1), then false success flag is returned
func (*Height) Descriptor ¶
func (Height) GetRevisionHeight ¶
GetRevisionHeight returns the revision-height of the height
func (Height) GetRevisionNumber ¶
GetRevisionNumber returns the revision-number of the height
func (Height) Increment ¶
Increment will return a height with the same revision number but an incremented revision height
func (*Height) MarshalToSizedBuffer ¶
func (*Height) ProtoMessage ¶
func (*Height) ProtoMessage()
func (*Height) XXX_DiscardUnknown ¶
func (m *Height) XXX_DiscardUnknown()
func (*Height) XXX_Marshal ¶
func (*Height) XXX_Unmarshal ¶
type Misbehaviour ¶
type Misbehaviour struct { // ClientID is deprecated ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` // Deprecated: Do not use. Header1 *Header `protobuf:"bytes,2,opt,name=header_1,json=header1,proto3" json:"header_1,omitempty"` Header2 *Header `protobuf:"bytes,3,opt,name=header_2,json=header2,proto3" json:"header_2,omitempty"` }
Misbehaviour is a wrapper over two conflicting Headers that implements Misbehaviour interface expected by ICS-02
func NewMisbehaviour ¶
func NewMisbehaviour(clientID string, header1, header2 *Header) *Misbehaviour
NewMisbehaviour creates a new Misbehaviour instance.
func (Misbehaviour) ClientType ¶
func (Misbehaviour) ClientType() string
ClientType is Tendermint light client
func (*Misbehaviour) Descriptor ¶
func (*Misbehaviour) Descriptor() ([]byte, []int)
func (Misbehaviour) GetTime ¶
func (misbehaviour Misbehaviour) GetTime() time.Time
GetTime returns the timestamp at which misbehaviour occurred. It uses the maximum value from both headers to prevent producing an invalid header outside of the misbehaviour age range.
func (*Misbehaviour) Marshal ¶
func (m *Misbehaviour) Marshal() (dAtA []byte, err error)
func (*Misbehaviour) MarshalToSizedBuffer ¶
func (m *Misbehaviour) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*Misbehaviour) ProtoMessage ¶
func (*Misbehaviour) ProtoMessage()
func (*Misbehaviour) Reset ¶
func (m *Misbehaviour) Reset()
func (*Misbehaviour) Size ¶
func (m *Misbehaviour) Size() (n int)
func (*Misbehaviour) String ¶
func (m *Misbehaviour) String() string
func (*Misbehaviour) Unmarshal ¶
func (m *Misbehaviour) Unmarshal(dAtA []byte) error
func (Misbehaviour) ValidateBasic ¶
func (misbehaviour Misbehaviour) ValidateBasic() error
ValidateBasic implements Misbehaviour interface
func (*Misbehaviour) XXX_DiscardUnknown ¶
func (m *Misbehaviour) XXX_DiscardUnknown()
func (*Misbehaviour) XXX_Marshal ¶
func (m *Misbehaviour) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*Misbehaviour) XXX_Merge ¶
func (m *Misbehaviour) XXX_Merge(src proto.Message)
func (*Misbehaviour) XXX_Size ¶
func (m *Misbehaviour) XXX_Size() int
func (*Misbehaviour) XXX_Unmarshal ¶
func (m *Misbehaviour) XXX_Unmarshal(b []byte) error
type NMTProof ¶
type NMTProof struct { // Start index of this proof. Start int32 `protobuf:"varint,1,opt,name=start,proto3" json:"start,omitempty"` // End index of this proof. End int32 `protobuf:"varint,2,opt,name=end,proto3" json:"end,omitempty"` // Nodes that together with the corresponding leaf values can be used to // recompute the root and verify this proof. Nodes should consist of the max // and min namespaces along with the actual hash, resulting in each being 48 // bytes each Nodes [][]byte `protobuf:"bytes,3,rep,name=nodes,proto3" json:"nodes,omitempty"` // leafHash are nil if the namespace is present in the NMT. In case the // namespace to be proved is in the min/max range of the tree but absent, this // will contain the leaf hash necessary to verify the proof of absence. Leaf // hashes should consist of the namespace along with the actual hash, // resulting 40 bytes total. LeafHash []byte `protobuf:"bytes,4,opt,name=leaf_hash,json=leafHash,proto3" json:"leaf_hash,omitempty"` }
NMTProof is a proof of a namespace.ID in an NMT. In case this proof proves the absence of a namespace.ID in a tree it also contains the leaf hashes of the range where that namespace would be.
func (*NMTProof) Descriptor ¶
func (*NMTProof) GetLeafHash ¶
func (*NMTProof) MarshalToSizedBuffer ¶
func (*NMTProof) ProtoMessage ¶
func (*NMTProof) ProtoMessage()
func (*NMTProof) XXX_DiscardUnknown ¶
func (m *NMTProof) XXX_DiscardUnknown()
func (*NMTProof) XXX_Marshal ¶
func (*NMTProof) XXX_Unmarshal ¶
type RowProof ¶
type RowProof struct { RowRoots [][]byte `protobuf:"bytes,1,rep,name=row_roots,json=rowRoots,proto3" json:"row_roots,omitempty"` Proofs []*crypto.Proof `protobuf:"bytes,2,rep,name=proofs,proto3" json:"proofs,omitempty"` Root []byte `protobuf:"bytes,3,opt,name=root,proto3" json:"root,omitempty"` StartRow uint32 `protobuf:"varint,4,opt,name=start_row,json=startRow,proto3" json:"start_row,omitempty"` EndRow uint32 `protobuf:"varint,5,opt,name=end_row,json=endRow,proto3" json:"end_row,omitempty"` }
RowProof is a Merkle proof that a set of rows exist in a Merkle tree with a given data root.
func (*RowProof) Descriptor ¶
func (*RowProof) GetRowRoots ¶
func (*RowProof) GetStartRow ¶
func (*RowProof) MarshalToSizedBuffer ¶
func (*RowProof) ProtoMessage ¶
func (*RowProof) ProtoMessage()
func (*RowProof) XXX_DiscardUnknown ¶
func (m *RowProof) XXX_DiscardUnknown()
func (*RowProof) XXX_Marshal ¶
func (*RowProof) XXX_Unmarshal ¶
type ShareProof ¶
type ShareProof struct {}
ShareProof is an NMT proof that a set of shares exist in a set of rows and a Merkle proof that those rows exist in a Merkle tree with a given data root.
func TmShareProofToProto ¶
func TmShareProofToProto(sp *tmtypes.ShareProof) ShareProof
Convert celestia core' share proof to celestia light client's share proof
func (*ShareProof) Descriptor ¶
func (*ShareProof) Descriptor() ([]byte, []int)
func (*ShareProof) GetData ¶
func (m *ShareProof) GetData() [][]byte
func (*ShareProof) GetNamespaceId ¶
func (m *ShareProof) GetNamespaceId() []byte
func (*ShareProof) GetNamespaceVersion ¶
func (m *ShareProof) GetNamespaceVersion() uint32
func (*ShareProof) GetRowProof ¶
func (m *ShareProof) GetRowProof() *RowProof
func (*ShareProof) GetShareProofs ¶
func (m *ShareProof) GetShareProofs() []*NMTProof
func (*ShareProof) Marshal ¶
func (m *ShareProof) Marshal() (dAtA []byte, err error)
func (*ShareProof) MarshalToSizedBuffer ¶
func (m *ShareProof) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*ShareProof) ProtoMessage ¶
func (*ShareProof) ProtoMessage()
func (*ShareProof) Reset ¶
func (m *ShareProof) Reset()
func (*ShareProof) Size ¶
func (m *ShareProof) Size() (n int)
func (*ShareProof) String ¶
func (m *ShareProof) String() string
func (*ShareProof) Unmarshal ¶
func (m *ShareProof) Unmarshal(dAtA []byte) error
func (*ShareProof) XXX_DiscardUnknown ¶
func (m *ShareProof) XXX_DiscardUnknown()
func (*ShareProof) XXX_Marshal ¶
func (m *ShareProof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ShareProof) XXX_Merge ¶
func (m *ShareProof) XXX_Merge(src proto.Message)
func (*ShareProof) XXX_Size ¶
func (m *ShareProof) XXX_Size() int
func (*ShareProof) XXX_Unmarshal ¶
func (m *ShareProof) XXX_Unmarshal(b []byte) error