-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: dev-info, architecture and more (#68)
- Loading branch information
1 parent
ef5ecf1
commit 7f6da12
Showing
28 changed files
with
277 additions
and
575 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,10 @@ | ||
--- | ||
sidebar_position: 2 | ||
title: Architecture | ||
--- | ||
|
||
# Architecture | ||
|
||
Interchain Attestation is composed of a few different components that work together to let validators safely attest to the state of a counterparty chain. | ||
The main components, in "chronological order" are: | ||
* Attestation Config Module | ||
* Validators register their signing keys | ||
* Chains/clients are registered for attestation with configuration details | ||
* Attestation Sidecar | ||
* Validators run a sidecar that reads counterparty chain information, and generates signed attestations | ||
* The sidecar also hosts a GRPC server that can be queried for attestations (used by the chain node to fetch attestations during vote extensions) | ||
* Vote Extensions | ||
* Uses the ABCI++ interface with vote extensions to fetch attestations from the sidecar | ||
* Attestations are aggregated from all the validators, and sent to the light client for verification and client updates | ||
* Attestation Light Client | ||
* The IBC light client that uses the attestation data to enable IBC connections | ||
* The light client verifies the attestations and updates the client state and consensus state with packet commitments | ||
* Testing | ||
* In addition there are some development tools used to test the system: interchaintest and some simapps integrated with the above components | ||
|
||
![architecture.png](../../static/img/architecture.png) | ||
|
||
## Flow | ||
|
||
TODO: Add a diagram | ||
|
||
This section desribes the architecture, modules and flow of Interchain Attestation. | ||
|
||
A good place to start is the [System Architecture and Flow page](./system-architecture-and-flow). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
sidebar_position: 5 | ||
sidebar_position: 6 | ||
--- | ||
|
||
# Attestation Data | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
sidebar_position: 1 | ||
sidebar_position: 2 | ||
--- | ||
|
||
# Attestation Config Module | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
sidebar_position: 4 | ||
sidebar_position: 5 | ||
--- | ||
|
||
# Attestation Light Client | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
sidebar_position: 2 | ||
sidebar_position: 3 | ||
--- | ||
|
||
# Attestation Sidecar | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
--- | ||
sidebar_position: 1 | ||
--- | ||
|
||
# System Architecture and Flow | ||
|
||
## Component Overview | ||
|
||
Interchain Attestation is composed of a few different components that work together to let validators safely attest to the state of a counterparty chain. | ||
The main components, in "chronological order" are: | ||
* Attestation Config Module | ||
* Validators register their signing keys | ||
* Chains/clients are registered for attestation with configuration details | ||
* Attestation Sidecar | ||
* Validators run a sidecar that reads counterparty chain information, and generates signed attestations | ||
* The sidecar also hosts a GRPC server that can be queried for attestations (used by the chain node to fetch attestations during vote extensions) | ||
* Vote Extensions | ||
* Uses the ABCI++ interface with vote extensions to fetch attestations from the sidecar | ||
* Attestations are aggregated from all the validators, and sent to the light client for verification and client updates | ||
* Attestation Light Client | ||
* The IBC light client that uses the attestation data to enable IBC connections | ||
* The light client verifies the attestations and updates the client state and consensus state with packet commitments | ||
* Testing | ||
* In addition, there are some development tools used to test the system: interchaintest and some simapps integrated with the above components | ||
|
||
![architecture.png](../../static/img/architecture.png) | ||
|
||
## Flow | ||
|
||
### Before packets can flow | ||
|
||
A few things need to happen before packets can flow between chains: | ||
1. The Attestation Light Client, Vote Extensions and Attestation Config Module is integrated with the chain | ||
* To learn more about how to integrate into your chain, see the [Integration Guide](../integration-guide) | ||
2. Clients are created on both chains, and registered with the Attestation Config Module | ||
* ⚠️For v1, pre-Eureka, we also need to create connections and channels. | ||
* In v2, only IBC Eureka is supported, and connections and channels are finally a thing of the past. | ||
3. Validators are registered with their attestation signing keys on the Attestation Config Module | ||
4. Sufficient Validators have signed up to attest to the counterparty chain (if the configuration requires it) | ||
5. Validators have configured and started up their Attestation Sidecar process | ||
|
||
### Normal operation | ||
|
||
At this point, we have clients on both chains, and validators who are expected to attest to the counterparty chain. | ||
|
||
The flow of the system for the client to get updated is as follows: | ||
1. The sidecar process reads all configured counterparty chain states, generates attestations, signs them and stores them in the sidecar database | ||
2. The ABCI++ Vote Extensions query the sidecar for the latest attestations | ||
3. The Vote Extensions aggregate the attestations from all the validators, and send them to the light client | ||
4. The light client verifies the attestations, and updates the client state and consensus state with the packet commitments | ||
|
||
We now have a light client that can verify packet commitments, and IBC can flow between the chains. | ||
|
||
TODO: Add a diagram | ||
|
||
TODO: Write about relaying |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
sidebar_position: 3 | ||
sidebar_position: 4 | ||
--- | ||
|
||
# Vote Extensions | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
--- | ||
sidebar_position: 2 | ||
--- | ||
|
||
# Building | ||
|
||
## Building all the modules | ||
|
||
To build all the modules, you can use the following command: | ||
|
||
```bash | ||
$ just build | ||
``` | ||
|
||
## Linting | ||
|
||
To lint all the modules, you can use the following command: | ||
|
||
```bash | ||
$ just lint | ||
``` | ||
|
||
## Proto | ||
|
||
To generate go code for all the proto files, you can use the following command: | ||
|
||
```bash | ||
$ just proto-gen | ||
``` | ||
|
||
## Docker images (used for testing) | ||
|
||
There is a set of docker images used for the e2e tests. To build these images, you can use the following command: | ||
|
||
```bash | ||
$ just build-docker-images | ||
``` | ||
|
||
## Simapps | ||
|
||
If you want to build and install the simapp binaries locally, you can use the following command: | ||
|
||
```bash | ||
just install-simapps | ||
``` | ||
|
||
## Running locally | ||
|
||
There is a command that spins up a local test environment with the following components: | ||
* Simapp (Cosmos SDK chain with Interchain Attestion integrated) | ||
* Rollupsimapp (Rollkit rollup) | ||
* Mock DA service (for the rollup) | ||
* Sidecar | ||
* Configuration | ||
* Light clients | ||
* Connections | ||
* Channels | ||
* Validator registered and wired up to Interchain Attestation | ||
|
||
To run this environment, you can use the following command: | ||
```bash | ||
just serve | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
sidebar_position: 1 | ||
--- | ||
|
||
# Prerequisites | ||
|
||
The main prerequisites for developing Interchain Attestation are: | ||
* Just | ||
* Go | ||
* Docker (for e2e tests) | ||
* golangci-lint | ||
* make (still, but it is being phased out for just) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,24 @@ | ||
--- | ||
sidebar_position: 1 | ||
sidebar_position: 3 | ||
--- | ||
|
||
# Testing | ||
|
||
TODO: Document the test setup, how to run them, etc | ||
## Unit tests | ||
|
||
To run all unit tests for all modules, you can use the following command: | ||
|
||
```bash | ||
$ just test-unit | ||
``` | ||
|
||
## End-to-end tests | ||
|
||
To run all end-to-end tests for all modules, you can use the following command: | ||
|
||
```bash | ||
$ just test-e2e | ||
``` | ||
|
||
The recipe takes an optional argument for which image-versions (docker tag) to use (e.g. `just test-e2e latest`). | ||
If no argument is provided, it will default to `local` and also build the docker images locally with the local tag. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
sidebar_position: 6 | ||
--- | ||
|
||
# Roadmap | ||
|
||
The current roadmap is split into two versions, with distinct support IBC Classic and IBC Eureka. | ||
|
||
* v1: IBC Classic | ||
* v2: IBC Eureka | ||
|
||
For a more detailed roadmap, see the [GitHub project board](https://github.com/orgs/cosmos/projects/35) |
Oops, something went wrong.