Documentation ¶
Index ¶
- Constants
- Variables
- func ChannelCommitmentKey(portId, channelId string) ([]byte, error)
- func ChannelCommitmentSlot(portId, channelId string) ([]byte, error)
- func ClientCommitmentKey(clientId string) ([]byte, error)
- func ClientStateCommitmentSlot(clientId string) ([]byte, error)
- func ConnectionCommitmentKey(connectionId string) ([]byte, error)
- func ConnectionCommitmentSlot(connectionId string) ([]byte, error)
- func ConsensusCommitmentKey(clientId string, height exported.Height) ([]byte, error)
- func ConsensusStateCommitmentSlot(clientId string, height exported.Height) ([]byte, error)
- func ConstructCommitPayload(blockHash common.Hash, blockNum, viewID uint64) []byte
- func EpochStateKey(epoch uint64) []byte
- func EpochStatePath(epoch uint64) string
- func NextSequenceRecvCommitmentKey(portId, channelId string) ([]byte, error)
- func NextSequenceRecvCommitmentSlot(portId, channelId string) ([]byte, error)
- func PacketAcknowledgementCommitmentKey(portId, channelId string, sequence uint64) ([]byte, error)
- func PacketAcknowledgementCommitmentSlot(portId, channelId string, sequence uint64) ([]byte, error)
- func PacketCommitmentKey(portId, channelId string, sequence uint64) ([]byte, error)
- func PacketCommitmentSlot(portId, channelId string, sequence uint64) ([]byte, error)
- func PacketReceiptCommitmentKey(portId, channelId string, sequence uint64) ([]byte, error)
- func PacketReceiptCommitmentSlot(portId, channelId string, sequence uint64) ([]byte, error)
- func RegisterInterfaces(registry codectypes.InterfaceRegistry)
- func SetConsensusState(clientStore sdk.KVStore, cdc codec.BinaryCodec, consensusState *ConsensusState, ...)
- func SetEpochState(clientStore sdk.KVStore, cdc codec.BinaryCodec, epochState *EpochState, ...)
- func Verify(rootHash common.Hash, key []byte, value []byte, proof [][]byte) error
- func VerifyCommitSig(beaconHeader *v3.Header, committee *shard.Committee, ...) error
- func VerifyProof(rootHash common.Hash, key []byte, proof [][]byte) ([]byte, error)
- func VerifyStorageProof(storageHash common.Hash, key, value []byte, proof [][]byte) error
- type BeaconHeader
- func (*BeaconHeader) Descriptor() ([]byte, []int)
- func (m *BeaconHeader) Marshal() (dAtA []byte, err error)
- func (m *BeaconHeader) MarshalTo(dAtA []byte) (int, error)
- func (m *BeaconHeader) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*BeaconHeader) ProtoMessage()
- func (m *BeaconHeader) Reset()
- func (m *BeaconHeader) Size() (n int)
- func (m *BeaconHeader) String() string
- func (m *BeaconHeader) Unmarshal(dAtA []byte) error
- func (m *BeaconHeader) XXX_DiscardUnknown()
- func (m *BeaconHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *BeaconHeader) XXX_Merge(src proto.Message)
- func (m *BeaconHeader) XXX_Size() int
- func (m *BeaconHeader) XXX_Unmarshal(b []byte) error
- type ClientState
- func (cs ClientState) CheckBeaconMisbehaviour(ctx sdk.Context, cdc codec.BinaryCodec, clientStore sdk.KVStore, ...) error
- func (cs ClientState) CheckHeaderAndUpdateState(ctx sdk.Context, cdc codec.BinaryCodec, clientStore sdk.KVStore, ...) (exported.ClientState, exported.ConsensusState, error)
- func (cs ClientState) CheckMisbehaviourAndUpdateState(ctx sdk.Context, cdc codec.BinaryCodec, clientStore sdk.KVStore, ...) (exported.ClientState, error)
- func (cs ClientState) CheckShardMisbehaviour(ctx sdk.Context, cdc codec.BinaryCodec, clientStore sdk.KVStore, ...) error
- func (cs ClientState) CheckSubstituteAndUpdateState(ctx sdk.Context, cdc codec.BinaryCodec, subjectClientStore sdk.KVStore, ...) (exported.ClientState, error)
- func (cs ClientState) ClientType() string
- func (*ClientState) Descriptor() ([]byte, []int)
- func (cs ClientState) ExportMetadata(_ sdk.KVStore) []exported.GenesisMetadata
- func (cs ClientState) GetCommittee() *shard.Committee
- func (cs ClientState) GetLatestHeight() exported.Height
- func (cs ClientState) GetProofSpecs() []*ics23.ProofSpec
- func (cs ClientState) Initialize(ctx sdk.Context, cdc codec.BinaryCodec, store sdk.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 (cs *ClientState) SetCommittee(committee *shard.Committee)
- func (m *ClientState) Size() (n int)
- func (cs ClientState) Status(ctx sdk.Context, clientStore sdk.KVStore, cdc codec.BinaryCodec) exported.Status
- func (m *ClientState) String() string
- func (m *ClientState) Unmarshal(dAtA []byte) error
- func (cs ClientState) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error
- func (cs ClientState) Validate() error
- func (cs ClientState) VerifyChannelState(store sdk.KVStore, cdc codec.BinaryCodec, height exported.Height, ...) error
- func (cs ClientState) VerifyClientConsensusState(store sdk.KVStore, cdc codec.BinaryCodec, height exported.Height, ...) error
- func (cs ClientState) VerifyClientState(store sdk.KVStore, cdc codec.BinaryCodec, height exported.Height, ...) error
- func (cs ClientState) VerifyConnectionState(store sdk.KVStore, cdc codec.BinaryCodec, height exported.Height, ...) error
- func (cs ClientState) VerifyNextSequenceRecv(ctx sdk.Context, store sdk.KVStore, cdc codec.BinaryCodec, ...) error
- func (cs ClientState) VerifyPacketAcknowledgement(ctx sdk.Context, store sdk.KVStore, cdc codec.BinaryCodec, ...) error
- func (cs ClientState) VerifyPacketCommitment(ctx sdk.Context, store sdk.KVStore, cdc codec.BinaryCodec, ...) error
- func (cs ClientState) VerifyPacketReceiptAbsence(ctx sdk.Context, store sdk.KVStore, cdc codec.BinaryCodec, ...) error
- func (cs ClientState) VerifyUpgradeAndUpdateState(ctx sdk.Context, cdc codec.BinaryCodec, store sdk.KVStore, ...) (exported.ClientState, exported.ConsensusState, 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() exported.ClientState
- type ConsensusState
- func (cs ConsensusState) ClientType() string
- func (*ConsensusState) Descriptor() ([]byte, []int)
- func (cs ConsensusState) GetRoot() exported.Root
- 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) UnpackInterfaces(unpacker codectypes.AnyUnpacker) 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 EpochState
- func (*EpochState) Descriptor() ([]byte, []int)
- func (es EpochState) GetCommittee() *shard.Committee
- func (m *EpochState) Marshal() (dAtA []byte, err error)
- func (m *EpochState) MarshalTo(dAtA []byte) (int, error)
- func (m *EpochState) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*EpochState) ProtoMessage()
- func (m *EpochState) Reset()
- func (m *EpochState) Size() (n int)
- func (m *EpochState) String() string
- func (m *EpochState) Unmarshal(dAtA []byte) error
- func (m *EpochState) XXX_DiscardUnknown()
- func (m *EpochState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *EpochState) XXX_Merge(src proto.Message)
- func (m *EpochState) XXX_Size() int
- func (m *EpochState) XXX_Unmarshal(b []byte) error
- type Header
- func (h Header) ClientType() string
- func (*Header) Descriptor() ([]byte, []int)
- func (h Header) GetAccountProof() ([][]byte, error)
- func (h Header) GetBeaconEpoch() *big.Int
- func (h Header) GetEpoch() *big.Int
- func (h Header) GetHeight() exported.Height
- 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) UnpackInterfaces(unpacker codectypes.AnyUnpacker) 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 MemDB
- type Misbehaviour
- func (misbehaviour Misbehaviour) ClientType() string
- func (*Misbehaviour) Descriptor() ([]byte, []int)
- func (misbehaviour Misbehaviour) GetClientID() string
- 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 (misbehaviour Misbehaviour) Type() 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
Constants ¶
const ( // ModuleName defines the Harmony client name ModuleName string = "ibc-harmony" HarmonyClient string = "ibc-harmony" // KVStore key prefixes for IBC KeyEpochStatePrefix string = "epochStates" )
const AccountStorageRootIndex = 2
Variables ¶
var ( ErrEpochStateNotFound = sdkerrors.Register(ModuleName, 1, "epoch state not found") ErrInvalidProof = sdkerrors.Register(ModuleName, 2, "invalid proof") ErrInvalidSignature = sdkerrors.Register(ModuleName, 3, "invalid signature") ErrTrustingPeriodExpired = sdkerrors.Register(ModuleName, 4, "time since trusted state has passed the trusting period") )
Harmony client sentinel errors
Functions ¶
func ChannelCommitmentKey ¶
func ChannelCommitmentSlot ¶
func ClientCommitmentKey ¶
func ConnectionCommitmentKey ¶
func ConsensusCommitmentKey ¶
func ConstructCommitPayload ¶
ConstructCommitPayload returns the commit payload for consensus signatures. We assume that it is after StakingEpoch.
func EpochStateKey ¶
func EpochStatePath ¶
func PacketCommitmentKey ¶
func PacketCommitmentSlot ¶
func RegisterInterfaces ¶
func RegisterInterfaces(registry codectypes.InterfaceRegistry)
RegisterInterfaces register the ibc channel submodule interfaces to protobuf Any.
func SetConsensusState ¶
func SetConsensusState(clientStore sdk.KVStore, cdc codec.BinaryCodec, consensusState *ConsensusState, height exported.Height)
SetConsensusState stores the consensus state at the given height.
func SetEpochState ¶
func SetEpochState(clientStore sdk.KVStore, cdc codec.BinaryCodec, epochState *EpochState, epoch uint64)
SetEpochState stores the epoch state at the given epoch.
func Verify ¶
Verify verifies that the path generated from key, following the nodes in proof leads to a leaf with value, where the hashes are correct up to the rootHash. WARNING: When the value is not found, `eth_getProof` will return "0x0" at the StorageProof `value` field. In order to verify the proof of non existence, you must set `value` to nil, *not* the RLP encoding of 0 or null (which would be 0x80).
func VerifyCommitSig ¶
func VerifyProof ¶
func VerifyStorageProof ¶
VerifyStorageProof verifies an Ethereum storage proof against the StateRoot. It does not verify the account proof against the Ethereum StateHash. For absence proof, set nil to `value`.
Types ¶
type BeaconHeader ¶
type BeaconHeader struct { Header []byte `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` CommitSig []byte `protobuf:"bytes,2,opt,name=commit_sig,json=commitSig,proto3" json:"commit_sig,omitempty"` CommitBitmap []byte `protobuf:"bytes,3,opt,name=commit_bitmap,json=commitBitmap,proto3" json:"commit_bitmap,omitempty"` }
func (*BeaconHeader) Descriptor ¶
func (*BeaconHeader) Descriptor() ([]byte, []int)
func (*BeaconHeader) Marshal ¶
func (m *BeaconHeader) Marshal() (dAtA []byte, err error)
func (*BeaconHeader) MarshalToSizedBuffer ¶
func (m *BeaconHeader) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*BeaconHeader) ProtoMessage ¶
func (*BeaconHeader) ProtoMessage()
func (*BeaconHeader) Reset ¶
func (m *BeaconHeader) Reset()
func (*BeaconHeader) Size ¶
func (m *BeaconHeader) Size() (n int)
func (*BeaconHeader) String ¶
func (m *BeaconHeader) String() string
func (*BeaconHeader) Unmarshal ¶
func (m *BeaconHeader) Unmarshal(dAtA []byte) error
func (*BeaconHeader) XXX_DiscardUnknown ¶
func (m *BeaconHeader) XXX_DiscardUnknown()
func (*BeaconHeader) XXX_Marshal ¶
func (m *BeaconHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*BeaconHeader) XXX_Merge ¶
func (m *BeaconHeader) XXX_Merge(src proto.Message)
func (*BeaconHeader) XXX_Size ¶
func (m *BeaconHeader) XXX_Size() int
func (*BeaconHeader) XXX_Unmarshal ¶
func (m *BeaconHeader) XXX_Unmarshal(b []byte) error
type ClientState ¶
type ClientState struct { ShardId uint32 `protobuf:"varint,1,opt,name=shard_id,json=shardId,proto3" json:"shard_id,omitempty"` ContractAddress []byte `protobuf:"bytes,2,opt,name=contract_address,json=contractAddress,proto3" json:"contract_address,omitempty"` LatestEpoch uint64 `protobuf:"varint,3,opt,name=latest_epoch,json=latestEpoch,proto3" json:"latest_epoch,omitempty"` // Beacon committee LatestCommittee []byte `protobuf:"bytes,4,opt,name=latest_committee,json=latestCommittee,proto3" json:"latest_committee,omitempty"` // Latest height indicates a height for the shard chain LatestHeight types.Height `protobuf:"bytes,5,opt,name=latest_height,json=latestHeight,proto3" json:"latest_height"` TrustingPeriod time.Duration `` /* 128-byte string literal not displayed */ Frozen bool `protobuf:"varint,7,opt,name=frozen,proto3" json:"frozen,omitempty"` }
func NewClientState ¶
func NewClientState() *ClientState
func (ClientState) CheckBeaconMisbehaviour ¶
func (cs ClientState) CheckBeaconMisbehaviour( ctx sdk.Context, cdc codec.BinaryCodec, clientStore sdk.KVStore, misbehaviour *Misbehaviour, ) error
CheckBeaconMisbehaviour checks the existence of two different valid beacon headers for the same beacon block number. It validates each header with the aggregated signature and its bitmap of the committee for the respective epoch.
func (ClientState) CheckHeaderAndUpdateState ¶
func (cs ClientState) CheckHeaderAndUpdateState( ctx sdk.Context, cdc codec.BinaryCodec, clientStore sdk.KVStore, header exported.Header, ) (exported.ClientState, exported.ConsensusState, error)
CheckHeaderAndUpdateState verifies that: - the beacon header with the associated committee signature and bitmap. It also verifies the quorum using the committee of the target epoch. - (for shard 1+) the shard header with the cross-link of the beacon header. If the target header's epoch is older than the epoch of ClientState, `header` must have "epoch header(s)", which is/are the last beacon header(s) of each epoch for updating epoch of ClientState.
func (ClientState) CheckMisbehaviourAndUpdateState ¶
func (cs ClientState) CheckMisbehaviourAndUpdateState( ctx sdk.Context, cdc codec.BinaryCodec, clientStore sdk.KVStore, misbehaviour exported.Misbehaviour, ) (exported.ClientState, error)
CheckMisbehaviourAndUpdateState detects the following as Misbehaviour:
1. The existence of two different valid beacon headers for the same beacon block number 2. The existence of two different valid shard headers for the same shard ID and block number:
func (ClientState) CheckShardMisbehaviour ¶
func (cs ClientState) CheckShardMisbehaviour( ctx sdk.Context, cdc codec.BinaryCodec, clientStore sdk.KVStore, misbehaviour *Misbehaviour, ) error
CheckShardMisbehaviour checks for a case where two different shard headers with the same block number are submitted. Both shard headers assume the existence of a corresponding beacon header with a valid cross-link; a shard header without a cross-link is invalid in Harmony, and this light client does not accept it.
func (ClientState) CheckSubstituteAndUpdateState ¶
func (cs ClientState) CheckSubstituteAndUpdateState(ctx sdk.Context, cdc codec.BinaryCodec, subjectClientStore sdk.KVStore, substituteClientStore sdk.KVStore, substituteClient exported.ClientState) (exported.ClientState, error)
Future work is needed
func (ClientState) ClientType ¶
func (cs ClientState) ClientType() string
func (*ClientState) Descriptor ¶
func (*ClientState) Descriptor() ([]byte, []int)
func (ClientState) ExportMetadata ¶
func (cs ClientState) ExportMetadata(_ sdk.KVStore) []exported.GenesisMetadata
Genesis function
func (ClientState) GetCommittee ¶
func (cs ClientState) GetCommittee() *shard.Committee
func (ClientState) GetLatestHeight ¶
func (cs ClientState) GetLatestHeight() exported.Height
func (ClientState) GetProofSpecs ¶
func (cs ClientState) GetProofSpecs() []*ics23.ProofSpec
func (ClientState) Initialize ¶
func (cs ClientState) Initialize(ctx sdk.Context, cdc codec.BinaryCodec, store sdk.KVStore, consState exported.ConsensusState) error
Initialization function Clients must validate the initial consensus state, and may store any client-specific metadata necessary for correct light client operation
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) SetCommittee ¶
func (cs *ClientState) SetCommittee(committee *shard.Committee)
func (*ClientState) Size ¶
func (m *ClientState) Size() (n int)
func (ClientState) Status ¶
func (cs ClientState) Status(ctx sdk.Context, clientStore sdk.KVStore, cdc codec.BinaryCodec) exported.Status
Status function Clients must return their status. Only Active clients are allowed to process packets.
func (*ClientState) String ¶
func (m *ClientState) String() string
func (*ClientState) Unmarshal ¶
func (m *ClientState) Unmarshal(dAtA []byte) error
func (ClientState) UnpackInterfaces ¶
func (cs ClientState) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error
UnpackInterfaces implements the UnpackInterfaceMessages.UnpackInterfaces method
func (ClientState) Validate ¶
func (cs ClientState) Validate() error
func (ClientState) VerifyChannelState ¶
func (ClientState) VerifyClientConsensusState ¶
func (ClientState) VerifyClientState ¶
func (cs ClientState) VerifyClientState(store sdk.KVStore, cdc codec.BinaryCodec, height exported.Height, prefix exported.Prefix, counterpartyClientIdentifier string, proof []byte, clientState exported.ClientState) error
State verification functions
func (ClientState) VerifyConnectionState ¶
func (cs ClientState) VerifyConnectionState(store sdk.KVStore, cdc codec.BinaryCodec, height exported.Height, prefix exported.Prefix, proof []byte, connectionID string, connectionEnd exported.ConnectionI) error
func (ClientState) VerifyNextSequenceRecv ¶
func (ClientState) VerifyPacketAcknowledgement ¶
func (ClientState) VerifyPacketCommitment ¶
func (ClientState) VerifyPacketReceiptAbsence ¶
func (ClientState) VerifyUpgradeAndUpdateState ¶
func (cs ClientState) VerifyUpgradeAndUpdateState(ctx sdk.Context, cdc codec.BinaryCodec, store sdk.KVStore, newClient exported.ClientState, newConsState exported.ConsensusState, proofUpgradeClient []byte, proofUpgradeConsState []byte) (exported.ClientState, exported.ConsensusState, error)
Future work is needed
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() exported.ClientState
Utility function that zeroes out any client customizable fields in client state Ledger enforced fields are maintained while all custom fields are zero values Used to verify upgrades
type ConsensusState ¶
type ConsensusState struct { // Beacon timestamp Timestamp uint64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` Root []byte `protobuf:"bytes,2,opt,name=root,proto3" json:"root,omitempty"` }
func GetConsensusState ¶
func GetConsensusState(store sdk.KVStore, cdc codec.BinaryCodec, height exported.Height) (*ConsensusState, error)
GetConsensusState retrieves the consensus state from the client prefixed store. An error is returned if the consensus state does not exist.
func (ConsensusState) ClientType ¶
func (cs ConsensusState) ClientType() string
func (*ConsensusState) Descriptor ¶
func (*ConsensusState) Descriptor() ([]byte, []int)
func (ConsensusState) GetRoot ¶
func (cs ConsensusState) GetRoot() exported.Root
GetRoot returns the commitment root of the consensus state, which is used for key-value pair verification.
func (ConsensusState) GetTimestamp ¶
func (cs ConsensusState) GetTimestamp() uint64
GetTimestamp returns the timestamp (in nanoseconds) of the 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) UnpackInterfaces ¶
func (cs ConsensusState) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error
UnpackInterfaces implements the UnpackInterfaceMessages.UnpackInterfaces method
func (ConsensusState) ValidateBasic ¶
func (cs ConsensusState) ValidateBasic() error
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 EpochState ¶
type EpochState struct { // Beacon committee Committee []byte `protobuf:"bytes,1,opt,name=committee,proto3" json:"committee,omitempty"` }
func GetEpochState ¶
func GetEpochState(clientStore sdk.KVStore, cdc codec.BinaryCodec, epoch uint64) (*EpochState, error)
GetEpochState retrieves the `epoch` state from the client prefixed store. An error is returned if the epoch state does not exist.
func (*EpochState) Descriptor ¶
func (*EpochState) Descriptor() ([]byte, []int)
func (EpochState) GetCommittee ¶
func (es EpochState) GetCommittee() *shard.Committee
func (*EpochState) Marshal ¶
func (m *EpochState) Marshal() (dAtA []byte, err error)
func (*EpochState) MarshalToSizedBuffer ¶
func (m *EpochState) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*EpochState) ProtoMessage ¶
func (*EpochState) ProtoMessage()
func (*EpochState) Reset ¶
func (m *EpochState) Reset()
func (*EpochState) Size ¶
func (m *EpochState) Size() (n int)
func (*EpochState) String ¶
func (m *EpochState) String() string
func (*EpochState) Unmarshal ¶
func (m *EpochState) Unmarshal(dAtA []byte) error
func (*EpochState) XXX_DiscardUnknown ¶
func (m *EpochState) XXX_DiscardUnknown()
func (*EpochState) XXX_Marshal ¶
func (m *EpochState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*EpochState) XXX_Merge ¶
func (m *EpochState) XXX_Merge(src proto.Message)
func (*EpochState) XXX_Size ¶
func (m *EpochState) XXX_Size() int
func (*EpochState) XXX_Unmarshal ¶
func (m *EpochState) XXX_Unmarshal(b []byte) error
type Header ¶
type Header struct { ShardHeader []byte `protobuf:"bytes,1,opt,name=shard_header,json=shardHeader,proto3" json:"shard_header,omitempty"` BeaconHeader *BeaconHeader `protobuf:"bytes,2,opt,name=beacon_header,json=beaconHeader,proto3" json:"beacon_header,omitempty"` EpochHeaders []BeaconHeader `protobuf:"bytes,3,rep,name=epoch_headers,json=epochHeaders,proto3" json:"epoch_headers"` CrossLinkIndex uint32 `protobuf:"varint,4,opt,name=cross_link_index,json=crossLinkIndex,proto3" json:"cross_link_index,omitempty"` AccountProof []byte `protobuf:"bytes,5,opt,name=account_proof,json=accountProof,proto3" json:"account_proof,omitempty"` }
func (Header) ClientType ¶
func (*Header) Descriptor ¶
func (Header) GetAccountProof ¶
func (Header) GetBeaconEpoch ¶
GetEpoch returns the last beacon epoch
func (*Header) MarshalToSizedBuffer ¶
func (*Header) ProtoMessage ¶
func (*Header) ProtoMessage()
func (Header) UnpackInterfaces ¶
func (h Header) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error
UnpackInterfaces implements the UnpackInterfaceMessages.UnpackInterfaces method
func (Header) ValidateBasic ¶
func (*Header) XXX_DiscardUnknown ¶
func (m *Header) XXX_DiscardUnknown()
func (*Header) XXX_Marshal ¶
func (*Header) XXX_Unmarshal ¶
type MemDB ¶
type MemDB struct {
// contains filtered or unexported fields
}
MemDB is an ethdb.KeyValueReader implementation which is not thread safe and assumes that all keys are common.Hash.
type Misbehaviour ¶
type Misbehaviour struct { ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` 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"` }
func (Misbehaviour) ClientType ¶
func (misbehaviour Misbehaviour) ClientType() string
ClientType is a Multisig light client.
func (*Misbehaviour) Descriptor ¶
func (*Misbehaviour) Descriptor() ([]byte, []int)
func (Misbehaviour) GetClientID ¶
func (misbehaviour Misbehaviour) GetClientID() string
GetClientID returns the ID of the client that committed a misbehaviour.
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) Type ¶
func (misbehaviour Misbehaviour) Type() string
Type implements Evidence interface.
func (*Misbehaviour) Unmarshal ¶
func (m *Misbehaviour) Unmarshal(dAtA []byte) error
func (Misbehaviour) ValidateBasic ¶
func (misbehaviour Misbehaviour) ValidateBasic() error
ValidateBasic implements Evidence 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