Tendermint light client
The Tendermint light client lets one Cosmos chain trust another without running the other chain. It tracks signed block evidence, validator changes, and commitment roots so IBC can update cross-chain state, verify proofs, detect faults, and cross planned chain upgrades. It is the 07-tendermint client described by IBC light clients, and it follows the shared client lifecycle. The repository also provides Wasm light clients, local and solo machine clients, and attestation light clients through the same IBC client contract.
System role
The Tendermint light client is the IBC evidence layer for chains that use Tendermint-style signed blocks. Core IBC sends it client messages and proof requests. The client returns trusted state or rejects the request, which lets connection, channel, and packet flows act on counterparty state without direct consensus access.
Tendermint clients use identifiers in the form 07-tendermint-{N}. The module registers the client state, consensus state, header, and misbehaviour message with the common IBC type system so core IBC can route and decode them.
State model
The client separates rules that remain stable across heights from evidence tied to one counterparty height. The client state defines how evidence is judged. Each consensus state records the trusted facts needed for later header and proof checks.
Client state
The ClientState describes the counterparty chain and its trust rules. It includes the chain ID, the validator voting-power fraction that may be trusted, the trusting and unbonding periods, the allowed clock drift, the latest and frozen heights, the proof rules, and the upgrade path.
These values set the trust boundary for relayed evidence. The latest height revision must match the revision encoded in the chain ID. The trusting period must be shorter than the unbonding period. A non-zero frozen height blocks normal use after verified misbehaviour.
References: proto/…/tendermint.proto• L18-52 modules/…/client_state.go• L29-47 modules/…/client_state.go• L112-170
Consensus state
The ConsensusState is the trusted record for one counterparty height. It stores the block time, the application commitment root, and the next validator-set hash. The root anchors IBC membership and non-membership proofs. The validator hash anchors the validator set used to check a later header.
The client creates this state at initialization and after accepted headers. It also records when and at which local height the state was processed. That metadata supports IBC delay checks and ordered cleanup without changing the IBC proof key for consensus state.
References: proto/…/tendermint.proto• L55-65 modules/…/consensus_state.go• L20-67 modules/…/store.go• L103-160
Header evidence
The Header combines a new signed block with its validator set and the trusted height and validator set used to verify it. The trusted height must identify a stored consensus state. The trusted validator set must hash to that state's next-validator hash.
An accepted header produces the next consensus state from its block time, application hash, and next-validator hash. Basic checks reject malformed signed headers, invalid heights, invalid commits, missing validator sets, and validator sets whose hashes do not match the header.
References: proto/…/tendermint.proto• L78-96 modules/…/header.go• L20-27 modules/…/header.go• L49-84
Header verification
Header verification starts from a stored consensus state. The client builds a trusted Tendermint header from the stored time and next-validator hash, then uses Tendermint light verification to check the new commit and validator-set change.
The normal update flow follows this sequence:
- Find the consensus state at the header's trusted height.
- Check that the supplied trusted validators match its next-validator hash.
- Require a newer header in the same chain revision.
- Check the header time against the trusted time, trusting period, and clock-drift limit.
- Check the signed commit and new validator set against the configured trust level.
- Store the new consensus state and advance the latest height when the header is newer.
The client can also store a verified header at an earlier height to fill a gap. A duplicate header is a no-op when its consensus state already matches the stored state. A revision change does not use this path; it uses the upgrade flow.
This diagram shows how relayed block evidence becomes trusted IBC state.
flowchart LR
A[Relayed header] --> B[Basic header checks]
B --> C[Stored trusted consensus state]
C --> D[Trusted validator hash check]
D --> E[Tendermint commit and trust-level check]
E --> F[New consensus state]
F --> G[Advance latest height when newer]
References: modules/…/update.go• L24-123 modules/…/update.go• L126-175 modules/…/header.go• L49-84
Trust windows and status
The trusting period limits how long the client may rely on its latest trusted consensus state. The client is expired when that state's time plus the trusting period is not after the local block time. Expiry prevents new headers and other trust checks from using stale evidence.
The unbonding period is the longer safety window that supports validator changes and stake withdrawal. Validation rejects a trusting period that is equal to or longer than the unbonding period. The maximum clock drift bounds how far a new header may be in the future relative to the local chain clock.
The client status uses this precedence:
| Condition | Status | Effect |
|---|---|---|
| No client state exists | Unknown | The client cannot be assessed. |
| Frozen height is non-zero | Frozen | Normal client use is blocked after misbehaviour. |
| Latest consensus state is absent or expired | Expired | The client is too old to trust. |
| Latest consensus state exists within its trusting period | Active | IBC may use the client. |
References: modules/…/client_state.go• L73-110 modules/…/light_client_module.go• L143-164 modules/…/client_state_test.go• L21-136
Proof verification
The client verifies IBC state proofs against the commitment root in the consensus state for the proof height. A membership proof proves that a value exists at a path. A non-membership proof proves that no value exists at that path. Both use the proof rules in the client state.
Proof verification follows this order:
- Confirm that the client has reached or passed the proof height.
- Confirm that the local time and block delays have passed since the consensus state was processed.
- Load the consensus state for that height.
- Verify the membership or non-membership proof against its root.
The same commitment root can anchor proofs for client and consensus state, connections, channels, packet commitments, acknowledgements, sequence values, and application stores outside the IBC store. This makes the client the common proof layer for IBC handshakes and packet relays.
References: modules/…/client_state.go• L205-327 modules/…/light_client_module.go• L104-140 modules/…/light_client_module_test.go• L256-468
Misbehaviour handling
Misbehaviour is evidence that the counterparty can no longer be trusted under the client rules. The client detects conflicting state at one height and breaks in block-time order across heights.
For a header at a known height, a different consensus state is a conflict. For a new height, the header time must be after the previous stored time and before the next stored time when those states exist. For a Misbehaviour message, both headers must describe the same chain and must each pass trust checks against their own trusted consensus state. Equal-height headers must have different commit hashes. At different heights, the higher header must not have a later time than the lower header.
Only verified evidence changes client state. A verified fault writes a non-zero frozen height, and the frozen status remains ahead of expiry in status checks.
This diagram separates evidence checks from the safety response.
flowchart TD
A[Header or misbehaviour message] --> B[Validate and verify evidence]
B --> C{Conflict or time-order break?}
C -- No --> D[Continue normal client flow]
C -- Yes --> E[Write frozen state]
E --> F[Reject normal IBC use]
References: modules/…/misbehaviour.go• L23-127 modules/…/misbehaviour_handle.go• L22-86 modules/…/misbehaviour_handle.go• L88-175
Client recovery
Recovery replaces a frozen or expired client with state from a substitute Tendermint client. The substitute must have matching safety parameters. The operation copies the latest consensus state and its processed metadata, then clears the frozen height and adopts the substitute's latest height, chain ID, and trusting period.
Recovery is separate from accepting a new counterparty header. It does not allow an unrelated client type or a substitute with different trust rules to restore normal use.
References: modules/…/proposal_handle.go• L19-83 modules/…/proposal_handle.go• L86-105 modules/…/light_client_module.go• L181-205
Chain upgrades
A chain revision change cannot use the normal same-revision header path. The counterparty commits an upgraded client state and consensus state at the configured upgrade path. The current client verifies both values against the commitment root of its latest trusted consensus state.
The upgrade flow requires a later client height and preserves the client-chosen trust level and clock-drift limit. It takes chain facts such as the new chain ID, proof rules, unbonding period, latest height, and upgrade path from the committed state. The proof checks the upgraded client with client-specific fields cleared, so a relayer cannot select those values independently.
If the new unbonding period is shorter, the client scales the trusting period by the same ratio. This keeps the trust window below the new validator withdrawal window.
This diagram shows the proof-backed transition from the old revision to the first usable state on the new revision.
flowchart LR
A[Latest trusted consensus root] --> B[Upgrade client-state proof]
A --> C[Upgrade consensus-state proof]
B --> D[Validated upgraded client state]
C --> E[Transition consensus state]
D --> F[Verify first post-upgrade header]
E --> F
F --> G[Usable post-upgrade proof root]
The upgraded consensus state uses a sentinel root because the future application root is not known at upgrade time. It is a transition trust anchor for the first new header, not a root for packet proof verification. The first accepted post-upgrade header creates the real root.
References: modules/…/upgrade.go• L23-135 modules/…/upgrade.go• L138-187 modules/…/consensus_state.go• L20-21 modules/…/light_client_module.go• L208-242
Consensus-state retention
Consensus states remain useful as trust anchors and proof roots only while their timestamps are within the trusting period. The client keeps height-ordered lookup metadata so it can find neighboring states for time checks and remove expired states without changing the standard IBC consensus-state key.
Normal updates prune at most the oldest expired state. A migration helper can prune all expired Tendermint consensus states across Tendermint clients while leaving other client types unchanged. Pruning removes the consensus state and its processed-time, processed-height, and iteration metadata together.
References: modules/…/store.go• L20-45 modules/…/store.go• L206-292 modules/…/migrations.go• L16-47
Change checklist
When these files or sections are changed, remember to consider these:
- Keep the protobuf state model, interface registration, and client-module routing aligned so core IBC can decode and call the same concrete types.
- Keep header trust checks aligned with the consensus fields used to create the next consensus state. Changes to block time, application root, or validator hashes affect both updates and proofs.
- Keep processed time and processed height with every consensus state. Delay checks and cleanup depend on both values.
- Keep the standard consensus-state proof key separate from ordered lookup metadata. Changing one without the other can break proofs or state pruning.
- Keep upgrade-path construction aligned with the counterparty upgrade store. Client-state and consensus-state proofs must use the same upgrade height and key layout.
- Keep frozen-state precedence aligned with status and recovery. Verified fault evidence must not become active through expiry or an ordinary update.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| Trusted validators do not hash to the trusted consensus state's next-validator hash | The header cannot establish trust from stored state | Check the trusted validator hash before commit verification. |
| A header is from another revision or is not newer than its trusted height | The normal update path rejects it | Use the upgrade path for revision changes and require a later height for normal updates. |
| The trusted consensus state is expired or missing | Header and misbehaviour verification fail | Relay updates within the trusting period and retain the required consensus state. |
| A proof has no stored consensus state or its delay has not passed | IBC state verification fails | Update the client first and wait for both configured delay limits. |
| Two valid-looking headers conflict or break time order | Verified evidence freezes the client | Check each header against stored trust before applying the frozen state. |
| Upgrade proofs do not match the committed client or consensus state | The client does not cross the revision boundary | Prove both values against the current latest consensus root. |
| A packet proof uses the sentinel upgrade root | The proof fails during the transition | Submit and accept a post-upgrade header with a real application root. |
Key files
| File | Why to read it |
|---|---|
| proto/…/tendermint.proto | Defines the client state, consensus state, header, misbehaviour, and trust-level data model. |
| modules/…/light_client_module.go | Shows the public IBC client operations for initialization, updates, proofs, status, recovery, and upgrades. |
| modules/…/client_state.go | Explains client validation, expiry, delay checks, and proof verification. |
| modules/…/update.go | Shows how trusted headers become consensus state and how expired state is pruned. |
| modules/…/misbehaviour_handle.go | Shows how conflicting headers and time-order faults are detected and verified. |
| modules/…/upgrade.go | Shows the proof-backed revision upgrade and its transition trust anchor. |
| modules/…/store.go | Explains processed metadata, ordered consensus-state lookup, and cleanup. |
| modules/…/proposal_handle.go | Shows how an active substitute restores a frozen or expired client. |
| modules/…/light_client_module_test.go | Demonstrates public behavior for initialization, proofs, status, recovery, and upgrades. |
| modules/…/migrations.go | Shows the optional cleanup of expired Tendermint consensus states during migration. |