Documentation ¶
Overview ¶
Package solomachine implements a concrete LightClientModule, ClientState, ConsensusState, Header and Misbehaviour types for the Solo Machine light client. This implementation is based off the ICS 06 specification (https://github.com/cosmos/ibc/tree/master/spec/client/ics-006-solo-machine-client)
Note that client identifiers are expected to be in the form: 06-solomachine-{N}. Client identifiers are generated and validated by core IBC, unexpected client identifiers will result in errors.
Index ¶
- Constants
- Variables
- func RegisterInterfaces(registry codectypes.InterfaceRegistry)
- func UnmarshalSignatureData(cdc codec.BinaryCodec, data []byte) (signing.SignatureData, error)
- func VerifySignature(pubKey cryptotypes.PubKey, signBytes []byte, sigData signing.SignatureData) error
- type AppModule
- type AppModuleBasic
- func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage
- func (AppModuleBasic) GetQueryCmd() *cobra.Command
- func (AppModuleBasic) GetTxCmd() *cobra.Command
- func (AppModuleBasic) IsAppModule()
- func (AppModuleBasic) IsOnePerModuleType()
- func (AppModuleBasic) Name() string
- func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux)
- func (AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry)
- func (AppModuleBasic) RegisterLegacyAminoCodec(*codec.LegacyAmino)
- func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingConfig, bz json.RawMessage) error
- type ClientState
- func (ClientState) CheckForMisbehaviour(_ sdk.Context, _ codec.BinaryCodec, _ storetypes.KVStore, ...) bool
- func (cs ClientState) CheckSubstituteAndUpdateState(ctx sdk.Context, cdc codec.BinaryCodec, ...) error
- func (ClientState) ClientType() string
- func (*ClientState) Descriptor() ([]byte, []int)
- 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 (m *ClientState) String() string
- func (m *ClientState) Unmarshal(dAtA []byte) error
- func (cs ClientState) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error
- func (cs ClientState) UpdateState(ctx sdk.Context, cdc codec.BinaryCodec, clientStore storetypes.KVStore, ...) []exported.Height
- func (cs ClientState) Validate() error
- func (cs ClientState) VerifyClientMessage(ctx sdk.Context, cdc codec.BinaryCodec, clientStore storetypes.KVStore, ...) 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
- type ConsensusState
- func (ConsensusState) ClientType() string
- func (*ConsensusState) Descriptor() ([]byte, []int)
- func (cs ConsensusState) GetPubKey() (cryptotypes.PubKey, error)
- 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 Data
- type Header
- func (Header) ClientType() string
- func (*Header) Descriptor() ([]byte, []int)
- func (h Header) GetPubKey() (cryptotypes.PubKey, error)
- 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 HeaderData
- func (*HeaderData) Descriptor() ([]byte, []int)
- func (m *HeaderData) Marshal() (dAtA []byte, err error)
- func (m *HeaderData) MarshalTo(dAtA []byte) (int, error)
- func (m *HeaderData) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*HeaderData) ProtoMessage()
- func (m *HeaderData) Reset()
- func (m *HeaderData) Size() (n int)
- func (m *HeaderData) String() string
- func (m *HeaderData) Unmarshal(dAtA []byte) error
- func (hd HeaderData) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error
- func (m *HeaderData) XXX_DiscardUnknown()
- func (m *HeaderData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *HeaderData) XXX_Merge(src proto.Message)
- func (m *HeaderData) XXX_Size() int
- func (m *HeaderData) XXX_Unmarshal(b []byte) error
- type LightClientModule
- func (l LightClientModule) CheckForMisbehaviour(ctx sdk.Context, clientID string, clientMsg exported.ClientMessage) bool
- func (l LightClientModule) Initialize(ctx sdk.Context, clientID string, clientStateBz, consensusStateBz []byte) error
- func (l LightClientModule) LatestHeight(ctx sdk.Context, clientID string) exported.Height
- func (l LightClientModule) RecoverClient(ctx sdk.Context, clientID, substituteClientID string) error
- func (l LightClientModule) Status(ctx sdk.Context, clientID string) exported.Status
- func (l LightClientModule) TimestampAtHeight(ctx sdk.Context, clientID string, height exported.Height) (uint64, error)
- func (l LightClientModule) UpdateState(ctx sdk.Context, clientID string, clientMsg exported.ClientMessage) []exported.Height
- func (l LightClientModule) UpdateStateOnMisbehaviour(ctx sdk.Context, clientID string, clientMsg exported.ClientMessage)
- func (l LightClientModule) VerifyClientMessage(ctx sdk.Context, clientID string, clientMsg exported.ClientMessage) error
- func (l LightClientModule) VerifyMembership(ctx sdk.Context, clientID string, height exported.Height, ...) error
- func (l LightClientModule) VerifyNonMembership(ctx sdk.Context, clientID string, height exported.Height, ...) error
- func (LightClientModule) VerifyUpgradeAndUpdateState(ctx sdk.Context, clientID string, ...) error
- type Misbehaviour
- func (Misbehaviour) ClientType() string
- func (*Misbehaviour) Descriptor() ([]byte, []int)
- 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 SignBytes
- func (*SignBytes) Descriptor() ([]byte, []int)
- func (m *SignBytes) Marshal() (dAtA []byte, err error)
- func (m *SignBytes) MarshalTo(dAtA []byte) (int, error)
- func (m *SignBytes) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*SignBytes) ProtoMessage()
- func (m *SignBytes) Reset()
- func (m *SignBytes) Size() (n int)
- func (m *SignBytes) String() string
- func (m *SignBytes) Unmarshal(dAtA []byte) error
- func (m *SignBytes) XXX_DiscardUnknown()
- func (m *SignBytes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *SignBytes) XXX_Merge(src proto.Message)
- func (m *SignBytes) XXX_Size() int
- func (m *SignBytes) XXX_Unmarshal(b []byte) error
- type SignatureAndData
- func (*SignatureAndData) Descriptor() ([]byte, []int)
- func (m *SignatureAndData) Marshal() (dAtA []byte, err error)
- func (m *SignatureAndData) MarshalTo(dAtA []byte) (int, error)
- func (m *SignatureAndData) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*SignatureAndData) ProtoMessage()
- func (m *SignatureAndData) Reset()
- func (m *SignatureAndData) Size() (n int)
- func (m *SignatureAndData) String() string
- func (m *SignatureAndData) Unmarshal(dAtA []byte) error
- func (sd SignatureAndData) ValidateBasic() error
- func (m *SignatureAndData) XXX_DiscardUnknown()
- func (m *SignatureAndData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *SignatureAndData) XXX_Merge(src proto.Message)
- func (m *SignatureAndData) XXX_Size() int
- func (m *SignatureAndData) XXX_Unmarshal(b []byte) error
- type TimestampedSignatureData
- func (*TimestampedSignatureData) Descriptor() ([]byte, []int)
- func (m *TimestampedSignatureData) Marshal() (dAtA []byte, err error)
- func (m *TimestampedSignatureData) MarshalTo(dAtA []byte) (int, error)
- func (m *TimestampedSignatureData) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*TimestampedSignatureData) ProtoMessage()
- func (m *TimestampedSignatureData) Reset()
- func (m *TimestampedSignatureData) Size() (n int)
- func (m *TimestampedSignatureData) String() string
- func (m *TimestampedSignatureData) Unmarshal(dAtA []byte) error
- func (m *TimestampedSignatureData) XXX_DiscardUnknown()
- func (m *TimestampedSignatureData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *TimestampedSignatureData) XXX_Merge(src proto.Message)
- func (m *TimestampedSignatureData) XXX_Size() int
- func (m *TimestampedSignatureData) XXX_Unmarshal(b []byte) error
Constants ¶
const (
ModuleName = "06-solomachine"
)
const SentinelHeaderPath = "solomachine:header"
SentinelHeaderPath defines a placeholder path value used for headers in solomachine client updates
Variables ¶
var ( ErrInvalidHeader = errorsmod.Register(ModuleName, 2, "invalid header") ErrInvalidSequence = errorsmod.Register(ModuleName, 3, "invalid sequence") ErrInvalidSignatureAndData = errorsmod.Register(ModuleName, 4, "invalid signature and data") ErrSignatureVerificationFailed = errorsmod.Register(ModuleName, 5, "signature verification failed") ErrInvalidProof = errorsmod.Register(ModuleName, 6, "invalid solo machine proof") )
Functions ¶
func RegisterInterfaces ¶
func RegisterInterfaces(registry codectypes.InterfaceRegistry)
RegisterInterfaces register the ibc channel submodule interfaces to protobuf Any.
func UnmarshalSignatureData ¶
func UnmarshalSignatureData(cdc codec.BinaryCodec, data []byte) (signing.SignatureData, error)
func VerifySignature ¶
func VerifySignature(pubKey cryptotypes.PubKey, signBytes []byte, sigData signing.SignatureData) error
VerifySignature verifies if the provided public key generated the signature over the given data. Single and Multi signature public keys are supported. The signature data type must correspond to the public key type. An error is returned if signature verification fails or an invalid SignatureData type is provided.
Types ¶
type AppModule ¶
type AppModule struct { AppModuleBasic // contains filtered or unexported fields }
AppModule is the application module for the Solomachine client module
func NewAppModule ¶
func NewAppModule(lightClientModule LightClientModule) AppModule
NewAppModule creates a new Solomachine client module
func (AppModule) IsAppModule ¶
func (AppModule) IsAppModule()
IsAppModule implements the appmodule.AppModule interface.
func (AppModule) IsOnePerModuleType ¶
func (AppModule) IsOnePerModuleType()
IsOnePerModuleType implements the depinject.OnePerModuleType interface.
type AppModuleBasic ¶
type AppModuleBasic struct{}
AppModuleBasic defines the basic application module used by the solo machine light client. Only the RegisterInterfaces function needs to be implemented. All other function perform a no-op.
func (AppModuleBasic) DefaultGenesis ¶
func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage
DefaultGenesis performs a no-op. Genesis is not supported for solo machine.
func (AppModuleBasic) GetQueryCmd ¶
func (AppModuleBasic) GetQueryCmd() *cobra.Command
GetQueryCmd performs a no-op. Please see the 02-client cli commands.
func (AppModuleBasic) GetTxCmd ¶
func (AppModuleBasic) GetTxCmd() *cobra.Command
GetTxCmd performs a no-op. Please see the 02-client cli commands.
func (AppModuleBasic) IsAppModule ¶
func (AppModuleBasic) IsAppModule()
IsAppModule implements the appmodule.AppModule interface.
func (AppModuleBasic) IsOnePerModuleType ¶
func (AppModuleBasic) IsOnePerModuleType()
IsOnePerModuleType implements the depinject.OnePerModuleType interface.
func (AppModuleBasic) Name ¶
func (AppModuleBasic) Name() string
Name returns the solo machine module name.
func (AppModuleBasic) RegisterGRPCGatewayRoutes ¶
func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux)
RegisterGRPCGatewayRoutes performs a no-op.
func (AppModuleBasic) RegisterInterfaces ¶
func (AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry)
RegisterInterfaces registers module concrete types into protobuf Any. This allows core IBC to unmarshal solo machine types.
func (AppModuleBasic) RegisterLegacyAminoCodec ¶
func (AppModuleBasic) RegisterLegacyAminoCodec(*codec.LegacyAmino)
RegisterLegacyAminoCodec performs a no-op. The solo machine client does not support amino.
func (AppModuleBasic) ValidateGenesis ¶
func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingConfig, bz json.RawMessage) error
ValidateGenesis performs a no-op. Genesis is not supported for solo machine.
type ClientState ¶
type ClientState struct { // latest sequence of the client state Sequence uint64 `protobuf:"varint,1,opt,name=sequence,proto3" json:"sequence,omitempty"` // frozen sequence of the solo machine IsFrozen bool `protobuf:"varint,2,opt,name=is_frozen,json=isFrozen,proto3" json:"is_frozen,omitempty"` ConsensusState *ConsensusState `protobuf:"bytes,3,opt,name=consensus_state,json=consensusState,proto3" json:"consensus_state,omitempty"` }
ClientState defines a solo machine client that tracks the current consensus state and if the client is frozen.
func NewClientState ¶
func NewClientState(latestSequence uint64, consensusState *ConsensusState) *ClientState
NewClientState creates a new ClientState instance.
func (ClientState) CheckForMisbehaviour ¶
func (ClientState) CheckForMisbehaviour(_ sdk.Context, _ codec.BinaryCodec, _ storetypes.KVStore, clientMsg exported.ClientMessage) bool
CheckForMisbehaviour returns true for type Misbehaviour (passed VerifyClientMessage check), otherwise returns false
func (ClientState) CheckSubstituteAndUpdateState ¶
func (cs ClientState) CheckSubstituteAndUpdateState( ctx sdk.Context, cdc codec.BinaryCodec, subjectClientStore, _ storetypes.KVStore, substituteClient exported.ClientState, ) error
CheckSubstituteAndUpdateState verifies that the subject is allowed to be updated by a governance proposal and that the substitute client is a solo machine. It will update the consensus state to the substitute's consensus state and the sequence to the substitute's current sequence. An error is returned if the client has been disallowed to be updated by a governance proposal, the substitute is not a solo machine, or the current public key equals the new public key.
func (*ClientState) Descriptor ¶
func (*ClientState) Descriptor() ([]byte, []int)
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) 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) UpdateState ¶
func (cs ClientState) UpdateState(ctx sdk.Context, cdc codec.BinaryCodec, clientStore storetypes.KVStore, clientMsg exported.ClientMessage) []exported.Height
UpdateState updates the consensus state to the new public key and an incremented sequence. A list containing the updated consensus height is returned. If the provided clientMsg is not of type Header, the handler will no-op and return an empty slice.
func (ClientState) Validate ¶
func (cs ClientState) Validate() error
Validate performs basic validation of the client state fields.
func (ClientState) VerifyClientMessage ¶
func (cs ClientState) VerifyClientMessage(ctx sdk.Context, cdc codec.BinaryCodec, clientStore storetypes.KVStore, clientMsg exported.ClientMessage) error
VerifyClientMessage introspects the provided ClientMessage and checks its validity A Solomachine Header is considered valid if the currently registered public key has signed over the new public key with the correct sequence A Solomachine Misbehaviour is considered valid if duplicate signatures of the current public key are found on two different messages at a given sequence
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
type ConsensusState ¶
type ConsensusState struct { // public key of the solo machine PublicKey *types.Any `protobuf:"bytes,1,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` // diversifier allows the same public key to be re-used across different solo // machine clients (potentially on different chains) without being considered // misbehaviour. Diversifier string `protobuf:"bytes,2,opt,name=diversifier,proto3" json:"diversifier,omitempty"` Timestamp uint64 `protobuf:"varint,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` }
ConsensusState defines a solo machine consensus state. The sequence of a consensus state is contained in the "height" key used in storing the consensus state.
func (ConsensusState) ClientType ¶
func (ConsensusState) ClientType() string
ClientType returns Solo Machine type.
func (*ConsensusState) Descriptor ¶
func (*ConsensusState) Descriptor() ([]byte, []int)
func (ConsensusState) GetPubKey ¶
func (cs ConsensusState) GetPubKey() (cryptotypes.PubKey, error)
GetPubKey unmarshals the public key into a cryptotypes.PubKey type. An error is returned if the public key is nil or the cached value is not a PubKey.
func (ConsensusState) GetTimestamp ¶
func (cs ConsensusState) GetTimestamp() uint64
GetTimestamp returns zero.
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
ValidateBasic defines basic validation for the solo machine consensus state.
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 Data ¶
type Data interface{}
Data is an interface used for all the signature data bytes proto definitions.
type Header ¶
type Header struct { Timestamp uint64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` NewPublicKey *types.Any `protobuf:"bytes,3,opt,name=new_public_key,json=newPublicKey,proto3" json:"new_public_key,omitempty"` NewDiversifier string `protobuf:"bytes,4,opt,name=new_diversifier,json=newDiversifier,proto3" json:"new_diversifier,omitempty"` }
Header defines a solo machine consensus header
func (Header) ClientType ¶
ClientType defines that the Header is a Solo Machine.
func (*Header) Descriptor ¶
func (Header) GetPubKey ¶
func (h Header) GetPubKey() (cryptotypes.PubKey, error)
GetPubKey unmarshals the new public key into a cryptotypes.PubKey type. An error is returned if the new public key is nil or the cached value is not a PubKey.
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 ¶
ValidateBasic ensures that the timestamp, signature and public key have all been initialized.
func (*Header) XXX_DiscardUnknown ¶
func (m *Header) XXX_DiscardUnknown()
func (*Header) XXX_Marshal ¶
func (*Header) XXX_Unmarshal ¶
type HeaderData ¶
type HeaderData struct { // header public key NewPubKey *types.Any `protobuf:"bytes,1,opt,name=new_pub_key,json=newPubKey,proto3" json:"new_pub_key,omitempty"` // header diversifier NewDiversifier string `protobuf:"bytes,2,opt,name=new_diversifier,json=newDiversifier,proto3" json:"new_diversifier,omitempty"` }
HeaderData returns the SignBytes data for update verification.
func (*HeaderData) Descriptor ¶
func (*HeaderData) Descriptor() ([]byte, []int)
func (*HeaderData) Marshal ¶
func (m *HeaderData) Marshal() (dAtA []byte, err error)
func (*HeaderData) MarshalToSizedBuffer ¶
func (m *HeaderData) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*HeaderData) ProtoMessage ¶
func (*HeaderData) ProtoMessage()
func (*HeaderData) Reset ¶
func (m *HeaderData) Reset()
func (*HeaderData) Size ¶
func (m *HeaderData) Size() (n int)
func (*HeaderData) String ¶
func (m *HeaderData) String() string
func (*HeaderData) Unmarshal ¶
func (m *HeaderData) Unmarshal(dAtA []byte) error
func (HeaderData) UnpackInterfaces ¶
func (hd HeaderData) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error
UnpackInterfaces implements the UnpackInterfaceMessages.UnpackInterfaces method
func (*HeaderData) XXX_DiscardUnknown ¶
func (m *HeaderData) XXX_DiscardUnknown()
func (*HeaderData) XXX_Marshal ¶
func (m *HeaderData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*HeaderData) XXX_Merge ¶
func (m *HeaderData) XXX_Merge(src proto.Message)
func (*HeaderData) XXX_Size ¶
func (m *HeaderData) XXX_Size() int
func (*HeaderData) XXX_Unmarshal ¶
func (m *HeaderData) XXX_Unmarshal(b []byte) error
type LightClientModule ¶
type LightClientModule struct {
// contains filtered or unexported fields
}
LightClientModule implements the core IBC api.LightClientModule interface
func NewLightClientModule ¶
func NewLightClientModule(cdc codec.BinaryCodec, storeProvider clienttypes.StoreProvider) LightClientModule
NewLightClientModule creates and returns a new 06-solomachine LightClientModule.
func (LightClientModule) CheckForMisbehaviour ¶
func (l LightClientModule) CheckForMisbehaviour(ctx sdk.Context, clientID string, clientMsg exported.ClientMessage) bool
CheckForMisbehaviour obtains the client state associated with the client identifier and calls into the clientState.CheckForMisbehaviour method.
func (LightClientModule) Initialize ¶
func (l LightClientModule) Initialize(ctx sdk.Context, clientID string, clientStateBz, consensusStateBz []byte) error
Initialize unmarshals the provided client and consensus states and performs basic validation. It calls into the clientState.Initialize method.
func (LightClientModule) LatestHeight ¶
LatestHeight returns the latest height for the client state for the given client identifier. If no client is present for the provided client identifier a zero value height is returned. NOTE: RevisionNumber is always 0 for solomachine client heights.
func (LightClientModule) RecoverClient ¶
func (l LightClientModule) RecoverClient(ctx sdk.Context, clientID, substituteClientID string) error
RecoverClient asserts that the substitute client is a solo machine client. It obtains the client state associated with the subject client and calls into the subjectClientState.CheckSubstituteAndUpdateState method.
func (LightClientModule) Status ¶
Status returns the status of the solo machine client. The client may be: - Active: if `IsFrozen` is false. - Frozen: if `IsFrozen` is true. - Unknown: if the client state associated with the provided client identifier is not found.
func (LightClientModule) TimestampAtHeight ¶
func (l LightClientModule) TimestampAtHeight(ctx sdk.Context, clientID string, height exported.Height) (uint64, error)
TimestampAtHeight obtains the client state associated with the client identifier and returns the timestamp in nanoseconds of the consensus state at the given height.
func (LightClientModule) UpdateState ¶
func (l LightClientModule) UpdateState(ctx sdk.Context, clientID string, clientMsg exported.ClientMessage) []exported.Height
UpdateState obtains the client state associated with the client identifier and calls into the clientState.UpdateState method.
func (LightClientModule) UpdateStateOnMisbehaviour ¶
func (l LightClientModule) UpdateStateOnMisbehaviour(ctx sdk.Context, clientID string, clientMsg exported.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 (LightClientModule) VerifyClientMessage ¶
func (l LightClientModule) VerifyClientMessage(ctx sdk.Context, clientID string, clientMsg exported.ClientMessage) error
VerifyClientMessage obtains the client state associated with the client identifier and calls into the clientState.VerifyClientMessage method.
func (LightClientModule) VerifyMembership ¶
func (l LightClientModule) VerifyMembership( ctx sdk.Context, clientID string, height exported.Height, delayTimePeriod uint64, delayBlockPeriod uint64, proof []byte, path exported.Path, value []byte, ) error
VerifyMembership obtains the client state associated with the client identifier and calls into the clientState.verifyMembership method.
func (LightClientModule) VerifyNonMembership ¶
func (l LightClientModule) VerifyNonMembership( ctx sdk.Context, clientID string, height exported.Height, delayTimePeriod uint64, delayBlockPeriod uint64, proof []byte, path exported.Path, ) error
VerifyNonMembership obtains the client state associated with the client identifier and calls into the clientState.verifyNonMembership method.
func (LightClientModule) VerifyUpgradeAndUpdateState ¶
func (LightClientModule) VerifyUpgradeAndUpdateState(ctx sdk.Context, clientID string, newClient, newConsState, upgradeClientProof, upgradeConsensusStateProof []byte) error
VerifyUpgradeAndUpdateState returns an error since solomachine client does not support upgrades
type Misbehaviour ¶
type Misbehaviour struct { Sequence uint64 `protobuf:"varint,1,opt,name=sequence,proto3" json:"sequence,omitempty"` SignatureOne *SignatureAndData `protobuf:"bytes,2,opt,name=signature_one,json=signatureOne,proto3" json:"signature_one,omitempty"` SignatureTwo *SignatureAndData `protobuf:"bytes,3,opt,name=signature_two,json=signatureTwo,proto3" json:"signature_two,omitempty"` }
Misbehaviour defines misbehaviour for a solo machine which consists of a sequence and two signatures over different messages at that sequence.
func (Misbehaviour) ClientType ¶
func (Misbehaviour) ClientType() string
ClientType is a Solo Machine light client.
func (*Misbehaviour) Descriptor ¶
func (*Misbehaviour) Descriptor() ([]byte, []int)
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 SignBytes ¶
type SignBytes struct { // the sequence number Sequence uint64 `protobuf:"varint,1,opt,name=sequence,proto3" json:"sequence,omitempty"` // the proof timestamp Timestamp uint64 `protobuf:"varint,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // the public key diversifier Diversifier string `protobuf:"bytes,3,opt,name=diversifier,proto3" json:"diversifier,omitempty"` // the standardised path bytes Path []byte `protobuf:"bytes,4,opt,name=path,proto3" json:"path,omitempty"` // the marshaled data bytes Data []byte `protobuf:"bytes,5,opt,name=data,proto3" json:"data,omitempty"` }
SignBytes defines the signed bytes used for signature verification.
func (*SignBytes) Descriptor ¶
func (*SignBytes) MarshalToSizedBuffer ¶
func (*SignBytes) ProtoMessage ¶
func (*SignBytes) ProtoMessage()
func (*SignBytes) XXX_DiscardUnknown ¶
func (m *SignBytes) XXX_DiscardUnknown()
func (*SignBytes) XXX_Marshal ¶
func (*SignBytes) XXX_Unmarshal ¶
type SignatureAndData ¶
type SignatureAndData struct { Signature []byte `protobuf:"bytes,1,opt,name=signature,proto3" json:"signature,omitempty"` Path []byte `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` Timestamp uint64 `protobuf:"varint,4,opt,name=timestamp,proto3" json:"timestamp,omitempty"` }
SignatureAndData contains a signature and the data signed over to create that signature.
func (*SignatureAndData) Descriptor ¶
func (*SignatureAndData) Descriptor() ([]byte, []int)
func (*SignatureAndData) Marshal ¶
func (m *SignatureAndData) Marshal() (dAtA []byte, err error)
func (*SignatureAndData) MarshalToSizedBuffer ¶
func (m *SignatureAndData) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*SignatureAndData) ProtoMessage ¶
func (*SignatureAndData) ProtoMessage()
func (*SignatureAndData) Reset ¶
func (m *SignatureAndData) Reset()
func (*SignatureAndData) Size ¶
func (m *SignatureAndData) Size() (n int)
func (*SignatureAndData) String ¶
func (m *SignatureAndData) String() string
func (*SignatureAndData) Unmarshal ¶
func (m *SignatureAndData) Unmarshal(dAtA []byte) error
func (SignatureAndData) ValidateBasic ¶
func (sd SignatureAndData) ValidateBasic() error
ValidateBasic ensures that the signature and data fields are non-empty.
func (*SignatureAndData) XXX_DiscardUnknown ¶
func (m *SignatureAndData) XXX_DiscardUnknown()
func (*SignatureAndData) XXX_Marshal ¶
func (m *SignatureAndData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*SignatureAndData) XXX_Merge ¶
func (m *SignatureAndData) XXX_Merge(src proto.Message)
func (*SignatureAndData) XXX_Size ¶
func (m *SignatureAndData) XXX_Size() int
func (*SignatureAndData) XXX_Unmarshal ¶
func (m *SignatureAndData) XXX_Unmarshal(b []byte) error
type TimestampedSignatureData ¶
type TimestampedSignatureData struct { SignatureData []byte `protobuf:"bytes,1,opt,name=signature_data,json=signatureData,proto3" json:"signature_data,omitempty"` Timestamp uint64 `protobuf:"varint,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` }
TimestampedSignatureData contains the signature data and the timestamp of the signature.
func (*TimestampedSignatureData) Descriptor ¶
func (*TimestampedSignatureData) Descriptor() ([]byte, []int)
func (*TimestampedSignatureData) Marshal ¶
func (m *TimestampedSignatureData) Marshal() (dAtA []byte, err error)
func (*TimestampedSignatureData) MarshalTo ¶
func (m *TimestampedSignatureData) MarshalTo(dAtA []byte) (int, error)
func (*TimestampedSignatureData) MarshalToSizedBuffer ¶
func (m *TimestampedSignatureData) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*TimestampedSignatureData) ProtoMessage ¶
func (*TimestampedSignatureData) ProtoMessage()
func (*TimestampedSignatureData) Reset ¶
func (m *TimestampedSignatureData) Reset()
func (*TimestampedSignatureData) Size ¶
func (m *TimestampedSignatureData) Size() (n int)
func (*TimestampedSignatureData) String ¶
func (m *TimestampedSignatureData) String() string
func (*TimestampedSignatureData) Unmarshal ¶
func (m *TimestampedSignatureData) Unmarshal(dAtA []byte) error
func (*TimestampedSignatureData) XXX_DiscardUnknown ¶
func (m *TimestampedSignatureData) XXX_DiscardUnknown()
func (*TimestampedSignatureData) XXX_Marshal ¶
func (m *TimestampedSignatureData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*TimestampedSignatureData) XXX_Merge ¶
func (m *TimestampedSignatureData) XXX_Merge(src proto.Message)
func (*TimestampedSignatureData) XXX_Size ¶
func (m *TimestampedSignatureData) XXX_Size() int
func (*TimestampedSignatureData) XXX_Unmarshal ¶
func (m *TimestampedSignatureData) XXX_Unmarshal(b []byte) error