Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

lightclient source pure

Constants 1

const Solomachine, Tendermint, Localhost, LocalhostClientID, Active, Frozen, Expired, Unknown, Unauthorized

 1const (
 2	// Solomachine is used to indicate that the light client is a solo machine.
 3	Solomachine string = "06-solomachine"
 4
 5	// Tendermint is used to indicate that the client uses the Tendermint Consensus Algorithm.
 6	Tendermint string = "07-tendermint"
 7
 8	// Localhost is the client type for the localhost client.
 9	Localhost string = "09-localhost"
10
11	// LocalhostClientID is the sentinel client ID for the localhost client.
12	LocalhostClientID string = Localhost
13
14	// Active is a status type of a client. An active client is allowed to be used.
15	Active Status = "Active"
16
17	// Frozen is a status type of a client. A frozen client is not allowed to be used.
18	Frozen Status = "Frozen"
19
20	// Expired is a status type of a client. An expired client is not allowed to be used.
21	Expired Status = "Expired"
22
23	// Unknown indicates there was an error in determining the status of a client.
24	Unknown Status = "Unknown"
25
26	// Unauthorized indicates that the client type is not registered as an allowed client type.
27	Unauthorized Status = "Unauthorized"
28)
source

Types 5

type ClientMessage

interface
1type ClientMessage interface {
2	ClientType() string
3	ValidateBasic() error
4}
source

ClientMessage is an interface used to update an IBC client. The update may be done by a single header, a batch of headers, misbehaviour, or any type which when verified produces a change to state of the IBC client

type ClientState

interface
1type ClientState interface {
2	ClientType() string
3	ValidateBasic() error
4}
source

ClientState defines the required common functions for light clients.

type ConsensusState

interface
1type ConsensusState interface {
2	ClientType() string
3	ValidateBasic() error
4}
source

ConsensusState is the state of the consensus process

type Interface

interface
 1type Interface interface {
 2	// Initialize is called upon client creation, it allows the client to perform
 3	// validation on the client state and initial consensus state.  The light
 4	// client module is responsible for setting any client-specific data in the
 5	// store. This includes the client state, initial consensus state and any
 6	// associated metadata.
 7	Initialize(ClientState, ConsensusState) error
 8
 9	// VerifyClientMessage must verify a ClientMessage. A ClientMessage could be
10	// a Header, Misbehaviour, or batch update.  It must handle each type of
11	// ClientMessage appropriately. Calls to CheckForMisbehaviour, UpdateState,
12	// and UpdateStateOnMisbehaviour will assume that the content of the
13	// ClientMessage has been verified and can be trusted. An error should be
14	// returned if the ClientMessage fails to verify.
15	VerifyClientMessage(ClientMessage) error
16
17	// Checks for evidence of a misbehaviour in Header or Misbehaviour type. It
18	// assumes the ClientMessage has already been verified.
19	CheckForMisbehaviour(ClientMessage) bool
20
21	// UpdateStateOnMisbehaviour should perform appropriate state changes on a
22	// client state given that misbehaviour has been detected and verified.
23	UpdateStateOnMisbehaviour(ClientMessage)
24
25	// UpdateState updates and stores as necessary any associated information for
26	// an IBC client, such as the ClientState and corresponding ConsensusState.
27	// Upon successful update, a list of consensus heights is returned. It
28	// assumes the ClientMessage has already been verified.
29	UpdateState(ClientMessage) []types.Height
30
31	// VerifyMembership is a generic proof verification method which verifies a
32	// proof of the existence of a value at a given CommitmentPath at the
33	// specified height.  The caller is expected to construct the full
34	// CommitmentPath from a CommitmentPrefix and a standardized path (as defined
35	// in ICS 24).
36	VerifyMembership(height types.Height, proofs []ics23.CommitmentProof,
37		path types.MerklePath, value []byte) error
38
39	// VerifyNonMembership is a generic proof verification method which verifies
40	// the absence of a given CommitmentPath at a specified height.  The caller
41	// is expected to construct the full CommitmentPath from a CommitmentPrefix
42	// and a standardized path (as defined in ICS 24).
43	VerifyNonMembership(height types.Height,
44		proofs []ics23.CommitmentProof, path types.MerklePath) error
45
46	// Status must return the status of the client. Only Active clients are
47	// allowed to process packets.
48	Status() Status
49
50	// LatestHeight returns the latest height of the client. If no client is
51	// present for the provided client identifier a zero value height may be
52	// returned.
53	LatestHeight() types.Height
54
55	// TimestampAtHeight must return the timestamp in seconds for the consensus
56	// state associated with the provided height.
57	TimestampAtHeight(types.Height) (uint64, error)
58
59	// RecoverClient must verify that the provided substitute may be used to
60	// recover the subject (receiver) client, and copy the substitute's updated
61	// client and consensus state into the subject. The caller is responsible
62	// for verifying Status() on both sides and authorization beforehand.
63	RecoverClient(substitute Interface) error
64
65	// Upgrade functions NOTE: proof heights are not included as upgrade to a new
66	// revision is expected to pass only on the last height committed by the
67	// current revision. Clients are responsible for ensuring that the planned
68	// last height of the current revision is somehow encoded in the proof
69	// verification process.  This is to ensure that no premature upgrades occur,
70	// since upgrade plans committed to by the counterparty may be cancelled or
71	// modified before the last planned height.  If the upgrade is verified, the
72	// upgraded client and consensus states must be set in the client store.
73	VerifyUpgradeAndUpdateState(newClient, newConsState, upgradeClientProof,
74		upgradeConsensusStateProof any) error
75}
source

Interface is an interface which core IBC uses to interact with light client modules. Light client modules must implement this interface to integrate with core IBC.

type Status

ident
1type Status = string
source

Status represents the status of a client

Imports 2

Source Files 2

Directories 1