* Add allow_governance_override_after_expiry flag to tendermint NewCreateClientCmd * 1) Add LatestTimestamp to ClientState struct by adding a new attribute latest_timestamp to the message ClientState in proto/ibc/tendermint/tendermint.proto 2) Autogenerate x/ibc/07-tendermint/types/tendermint.pb.go by running 'make proto-gen'. Strangely, as a side effect x/distribution/types/genesis.pb.go, x/evidence/types/genesis.pb.go were also modified by the command 'make proto-gen' 3) Add Expired() function * Fix tests * 1) Add allow_governance_override_after_expiry flag to tendemint clientStatus 2) Add allow_governance_override_after_misbehaviour flag to tendermint ClientStatus * Cosmetic changes * Fix tests * Add Unfreeze function * Add new ClientUpdateProposal type * Add minor fixes * Add NewClientUpdateProposalHandler unit tests * Fix proto-lint-docker * Delete x/ibc/07-tendermint/tendermint_test.go * Follow convention to put signer last in msg function signature * 1) Add GetLatestTimestamp function to ClientStatus interface 2) Change Expired() signature to Expired(now time.Time) * 1) Add override flag to UpdateClient function 2) Fix tests * Refactor HandleClientUpdateProposal * 1) Extend exported Header interface with MarshalBinaryBare and UnmarshalBinaryBare methods 2) Move ClientUpdateProposal message to from ibc.proto to client.proto 3) Refactoring code 4) Add override flag to UpdateClient method 5) Fix tests * 1) Uncomment tests and clean up code 2) Add basic validation of the header (ValidateBasic) when the override flag is true * Cosmetic changes * Add TODO comments * Fix header MarshalBinaryBare, UnmarshalBinaryBare by using protobuf encoding/decoding * Fix proto comments * Fix override logic * undo gettimestamp for solo machine and localhost * add update after proposal func, some major refactoring in progress, various issues addressed * fix tendermint proposal update handling * run make proto-gen * remove timestamp from tendemint client * fix build issue for tm types * apply various review comments * add tests for 02-client functionality * self review fixes * typo * update tests slightly * update tendermint proposal handling tests * Update x/ibc/02-client/keeper/proposal.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/07-tendermint/types/proposal_handle.go Co-authored-by: Aditya <adityasripal@gmail.com> * Update x/ibc/07-tendermint/types/proposal_handle.go Co-authored-by: Aditya <adityasripal@gmail.com> * apply most of @fedekunze and some of @AdityaSripal suggestions * convert test to bools * update docs and increase code cov * fix build * fix typo, remove omitempty * add switch * apply @fedekunze latest suggestions * fix lint * Update x/ibc/02-client/keeper/proposal_test.go Co-authored-by: Christopher Goes <cwgoes@pluranimity.org> Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Co-authored-by: Colin Axner <colinaxner@berkeley.edu> Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com> Co-authored-by: Aditya <adityasripal@gmail.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> |
||
---|---|---|
.. | ||
01_concepts.md | ||
02_state.md | ||
03_state_transitions.md | ||
04_messages.md | ||
05_callbacks.md | ||
06_events.md | ||
README.md |
README.md
ibc
Abstract
This paper defines the implementation of the IBC protocol on the Cosmos SDK, the changes made to the specification and where to find each specific ICS spec within the module.
For the general specification please refer to the Interchain Standards.
Contents
Implementation Details
As stated above, the IBC implementation on the Cosmos SDK introduces some changes
to the general specification, in order to avoid code duplication and to take
advantage of the SDK architectural components such as the AnteHandler
and
transaction routing through Handlers
.
Interchain Standards reference
The following list is a mapping from each Interchain Standard to their implementation
in the SDK's x/ibc
module:
- ICS 002 - Client Semantics: Implemented in
x/ibc/02-client
- ICS 003 - Connection Semantics: Implemented in
x/ibc/03-connection
- ICS 004 - Channel and Packet Semantics: Implemented in
x/ibc/04-channel
- ICS 005 - Port Allocation: Implemented in
x/ibc/05-port
- ICS 006 - Solo Machine Client: Implemented in
x/ibc/light-clients/solomachine
- ICS 007 - Tendermint Client: Implemented in
x/ibc/07-tendermint
- ICS 009 - Loopback Client: Implemented in
x/ibc/09-localhost
- ICS 018- Relayer Algorithms: Implemented in it's own relayer repository
- ICS 020 - Fungible Token Transfer: Implemented in
x/ibc-transfer
- ICS 023 - Vector Commitments: Implemented in
x/ibc/23-commitment
- ICS 024 - Host Requirements: Implemented in
x/ibc/24-host
- ICS 025 - Handler Interface: Handler interfaces are implemented at the top level in
x/ibc/handler.go
, which call each ICS submodule's handlers (i.ex/ibc/{XX-ICS}/handler.go
). - ICS 026 - Routing Module: Replaced by ADR 15 - IBC Packet Receiver.
Architecture Decision Records (ADR)
The following ADR provide the design and architecture decision of IBC-related components.
- ADR 001 - Coin Source Tracing: standard to hash the ICS20's fungible token denomination trace path in order to support special characters and limit the maximum denomination length.
- ADR 17 - Historical Header Module: Introduces the ability to introspect past consensus states in order to verify their membership in the counterparty clients.
- ADR 19 - Protobuf State Encoding: Migration from Amino to Protobuf for state encoding.
- ADR 020 - Protocol Buffer Transaction Encoding: Client side migration to Protobuf.
- ADR 021 - Protocol Buffer Query Encoding: Queries migration to Protobuf.
- ADR 026 - IBC Client Recovery Mechanisms: Allows IBC Clients to be recovered after freezing or expiry.
SDK Modules
x/capability
: The capability module provides object-capability keys support through scoped keepers in order to authenticate usage of ports or channels. Check ADR 3 - Dynamic Capability Store for more details.x/evidence
: The evidence module provides the interfaces and client logic to handle light client misbehaviour. Check ADR 09 - Evidence Module for more details.
IBC module architecture
NOTE for auditors: If you're not familiar with the overall module structure from the SDK modules, please check this document as prerequisite reading.
For ease of auditing, every Interchain Standard has been developed in its own
package. The development team separated the IBC TAO (Transport, Authentication, Ordering) ICS specifications from the IBC application level
specification. The following tree describes the architecture of the directories that
the ibc
(TAO) and ibc-transfer
(ICS20) modules:
x/
├── ibc/
│ ├── 02-client/
│ ├── 03-connection/
│ ├── 04-channel/
│ ├── 05-port/
│ ├── light-clients/
│ │ └── solomachine/
│ ├── 07-tendermint/
│ ├── 09-localhost/
│ ├── 23-commitment/
│ ├── 24-host/
│ ├── client
│ │ ├── cli
│ │ │ └── cli.go
│ │ └── rest
│ │ └── rest.go
│ ├── keeper
│ │ ├── keeper.go
│ │ └── querier.go
│ ├── types
│ │ ├── errors.go
│ │ └── keys.go
│ ├── handler.go
│ └── module.go
└── ibc-transfer/