Skip to content

Commit

Permalink
Implement Celestia bridge bootstrap components (#93)
Browse files Browse the repository at this point in the history
* Use Celestia and Cosmos binaries from sov-rollup-starter

* Add skeleton for celestia crates

* Add new wallet config for Celestia, which requires a bridge wallet

* Add CanExecCommandWithEnvs

* Implement InitCelestiaBridge with exec_command_with_envs

* Modify CanStartChainFullNode to return list of child processes

* Call InitCosmosChainData from InitCelestiaChainData

* Draft more celestia bootstrap implementation

* Implement CelestiaAppBootstrap context to wrap around CosmosBootstrap

* Move Cosmos integration tests into tests subdirectory

* Add test for Celestia bootstrap

* Remove CanRaiseError bound from HasRuntime

* Draft init bridge implementation

* Add CanCreateDir trait

* Rename HasTestDir to HasChainStoreDir

* Put chain test data into sub-directory of main test

* Use milliseconds as test dir postfix

* Add CanCopyFile

* Finish initial bridge bootstrap implementation

* Bridge still needs TrustedHash to run properly

* Implement Comet block querier

* Call query_block from init_celestia_bridge

* Celestia bridge bootstrapping is now working

* Add CanInitBridgeData component

* Rename CanInitCelestiaBridge to CanBootstrapBridge

* Delegate to CelestiaBootstrapComponents in CelestiaBootstrap context

* Add HasChainHomeDir trait for ChainDriver context

* Pass ChainDriver to bootstrap_bridge

* Use RPC and GRPC ports from ChainDriver

* Use CanImportBridgeKey to copy bridge key file

* Move bridge configuration to UpdateCelestiaBridgeConfig

* Configure RPC and GRPC ports in bridge config file

* Use abstract Block type

* Add genesis height getter

* Fix clippy

* Add bridge starter component

* Use CelestiaBridgeConfig type

* Add BridgeDriver type

* Separate out bridge bootstrap from chain bootstrap

* Add celestia-integration-tests to CI

* Fix clippy

* Fix CI config

* Fix CI config
  • Loading branch information
soareschen authored Jan 24, 2024
1 parent 7e38bff commit 4430d34
Show file tree
Hide file tree
Showing 110 changed files with 1,814 additions and 168 deletions.
46 changes: 39 additions & 7 deletions .github/workflows/integration-tests-next.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,13 @@ concurrency:
cancel-in-progress: true

jobs:
integration-tests-next:
cosmos-integration-tests:
runs-on: ubuntu-20.04
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v24
with:
install_url: https://nixos-nix-install-tests.cachix.org/serve/vij683ly7sl95nnhb67bdjjfabclr85m/install
install_options: '--tarball-url-prefix https://nixos-nix-install-tests.cachix.org/serve'
extra_nix_config: |
experimental-features = nix-command flakes
- uses: cachix/cachix-action@v13
Expand All @@ -29,14 +27,48 @@ jobs:
toolchain: stable
override: true
- uses: Swatinem/rust-cache@v2
- name: Install cargo-nextest
run: curl -LsSf https://get.nexte.st/latest/linux | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin
- uses: actions-rs/cargo@v1
with:
command: test
args: -p hermes-cosmos-integration-tests --no-fail-fast --no-run
args: -p hermes-cosmos-integration-tests --no-run
- name: run integration tests
env:
RUST_BACKTRACE: 1
run: |
nix shell .#gaia14 .#celestia -c cargo \
test -p hermes-cosmos-integration-tests --no-fail-fast -- \
--nocapture --test-threads=2
nix shell .#gaia .#celestia-app -c \
cargo nextest run -p hermes-cosmos-integration-tests \
--test-threads=2
celestia-integration-tests:
runs-on: ubuntu-20.04
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v24
with:
extra_nix_config: |
experimental-features = nix-command flakes
- uses: cachix/cachix-action@v13
with:
name: cosmos
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- uses: Swatinem/rust-cache@v2
- name: Install cargo-nextest
run: curl -LsSf https://get.nexte.st/latest/linux | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin
- uses: actions-rs/cargo@v1
with:
command: test
args: -p hermes-cosmos-integration-tests --no-run
- name: run integration tests
env:
RUST_BACKTRACE: 1
run: |
nix shell .#gaia .#celestia-app .#celestia-node -c \
cargo nextest run -p hermes-celestia-integration-tests \
--test-threads=2 \
--failure-output final
10 changes: 5 additions & 5 deletions .github/workflows/integration-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
fail-fast: false
matrix:
chain:
- package: gaia14
- package: gaia
command: gaiad
account_prefix: cosmos
features: ''
Expand All @@ -29,8 +29,6 @@ jobs:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v24
with:
install_url: https://nixos-nix-install-tests.cachix.org/serve/vij683ly7sl95nnhb67bdjjfabclr85m/install
install_options: '--tarball-url-prefix https://nixos-nix-install-tests.cachix.org/serve'
extra_nix_config: |
experimental-features = nix-command flakes
- uses: cachix/cachix-action@v13
Expand All @@ -41,10 +39,12 @@ jobs:
toolchain: stable
override: true
- uses: Swatinem/rust-cache@v2
- name: Install cargo-nextest
run: curl -LsSf https://get.nexte.st/latest/linux | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin
- uses: actions-rs/cargo@v1
with:
command: test
args: -p ibc-integration-test --no-fail-fast --no-run --features=${{ matrix.chain.features }}
args: -p ibc-integration-test --no-run --features=${{ matrix.chain.features }}
- name: run integration tests
env:
RUST_LOG: info,ibc_relayer_runtime=trace
Expand All @@ -54,5 +54,5 @@ jobs:
ACCOUNT_PREFIXES: ${{ matrix.chain.account_prefix }}
run: |
nix shell .#${{ matrix.chain.package }} -c cargo \
test -p ibc-integration-test --features=${{ matrix.chain.features }} --no-fail-fast -- \
test -p ibc-integration-test --features=${{ matrix.chain.features }} -- \
--nocapture --test-threads=2
14 changes: 9 additions & 5 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,12 @@ jobs:
- uses: actions-rs/cargo@v1
with:
command: test
args: --all-features --no-fail-fast --no-run
- uses: actions-rs/cargo@v1
with:
command: nextest
args: run --all-features --no-fail-fast --workspace --exclude ibc-integration-test --exclude hermes-cosmos-integration-tests --no-capture
args: --all-features --no-run
- name: run unit tests
run: |
cargo nextest run \
--all-features --workspace \
--exclude ibc-integration-test \
--exclude hermes-cosmos-integration-tests \
--exclude hermes-celestia-integration-tests \
--failure-output final
47 changes: 46 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ members = [
"crates/cosmos/cosmos-test-components",
"crates/cosmos/cosmos-integration-tests",
"crates/cosmos/cosmos-relayer",
"crates/celestia/celestia-test-components",
"crates/celestia/celestia-integration-tests",
"crates/solomachine/solomachine-relayer",
"crates/mock/mock-relayer",
"crates/mock/mock-cosmos-relayer",
Expand Down Expand Up @@ -65,8 +67,10 @@ flex-error = { version = "0.4.4", default-features = false }
hermes-relayer-components = { version = "0.1.0", path = "./crates/relayer/relayer-components" }
hermes-relayer-components-extra = { version = "0.1.0", path = "./crates/relayer/relayer-components-extra" }
hermes-cosmos-client-components = { version = "0.1.0", path = "./crates/cosmos/cosmos-client-components" }
hermes-cosmos-test-components = { version = "0.1.0", path = "./crates/cosmos/cosmos-test-components" }
hermes-cosmos-relayer = { version = "0.1.0", path = "./crates/cosmos/cosmos-relayer" }
hermes-cosmos-test-components = { version = "0.1.0", path = "./crates/cosmos/cosmos-test-components" }
hermes-cosmos-integration-tests = { version = "0.1.0", path = "./crates/cosmos/cosmos-integration-tests" }
hermes-celestia-test-components = { version = "0.1.0", path = "./crates/celestia/celestia-test-components" }
hermes-async-runtime-components = { version = "0.1.0", path = "./crates/runtime/async-runtime-components" }
hermes-tokio-runtime-components = { version = "0.1.0", path = "./crates/runtime/tokio-runtime-components" }
hermes-relayer-runtime = { version = "0.1.0", path = "./crates/runtime/relayer-runtime" }
Expand Down
42 changes: 42 additions & 0 deletions crates/celestia/celestia-integration-tests/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
[package]
name = "hermes-celestia-integration-tests"
version = { workspace = true }
edition = { workspace = true }
license = { workspace = true }
keywords = { workspace = true }
repository = { workspace = true }
authors = { workspace = true }
rust-version = { workspace = true }
readme = "README.md"
description = """
Implementation of an IBC Relayer in Rust, as a library
"""

[dependencies]
cgp-core = { workspace = true }
cgp-error-eyre = { workspace = true }
ibc-proto = { workspace = true }
ibc-relayer = { workspace = true }
ibc-relayer-types = { workspace = true }
hermes-relayer-runtime = { workspace = true }
hermes-relayer-components = { workspace = true }
hermes-relayer-components-extra = { workspace = true }
hermes-cosmos-relayer = { workspace = true }
hermes-test-components = { workspace = true }
hermes-ibc-test-suite = { workspace = true }
hermes-async-runtime-components = { workspace = true }
hermes-cosmos-client-components = { workspace = true }
hermes-cosmos-test-components = { workspace = true }
hermes-cosmos-integration-tests = { workspace = true }
hermes-celestia-test-components = { workspace = true }
tendermint-rpc = { workspace = true }

eyre = { workspace = true }
tokio = { workspace = true }
toml = { workspace = true }
serde_json = { workspace = true }
prost = { workspace = true }

sha2 = { version = "0.10.8" }
stable-eyre = { version = "0.2.2" }
subtle-encoding = { version = "0.5.1" }
Loading

0 comments on commit 4430d34

Please sign in to comment.