Skip to content

Commit

Permalink
Update Hermes SDK with retryable components (#335)
Browse files Browse the repository at this point in the history
* Update Hermes SDK

* Update Rust in Nix to use v1.85

* Update hermes-sdk and cgp

* Remove /opt/homebrew/ before running Nix build on MacOS

* Build Nix scarb using only single core

* Do not build scarb from Nix

* Remove scarb from Nix

* Install starknet foundry on CI

* Use Rust nightly when building Cairo contracts

* Fix scarb fmt

* Add -c

* Use Rust cache only for main test

* Scarb needs global Rust nightly?

* Still fixing scarb
  • Loading branch information
soareschen authored Mar 3, 2025
1 parent fef1831 commit 792086d
Show file tree
Hide file tree
Showing 26 changed files with 179 additions and 208 deletions.
45 changes: 35 additions & 10 deletions .github/workflows/hermes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,50 @@ jobs:
timeout-minutes: 60
steps:
- uses: actions/checkout@v4

- uses: cachix/install-nix-action@v30
with:
extra_nix_config: |
experimental-features = nix-command flakes
- uses: cachix/cachix-action@v15
with:
name: ibc-starknet
extraPullNames: hermes-sdk,cosmos-nix
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}

- uses: Swatinem/rust-cache@v2
- name: Install Rust nightly toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
workspaces: |
relayer -> relayer/target
light-client -> light-client/target
toolchain: nightly

- name: Install Scarb
uses: software-mansion/setup-scarb@v1
with:
tool-versions: cairo-contracts/.tool-versions
scarb-lock: cairo-contracts/Scarb.lock

- name: Install Universal Sierra Compiler
uses: software-mansion/setup-universal-sierra-compiler@v1
with:
tool-versions: cairo-contracts/.tool-versions

- name: Install Starknet Foundry
uses: foundry-rs/setup-snfoundry@v3
with:
tool-versions: cairo-contracts/.tool-versions

- name: Build Cairo contracts
working-directory: ./cairo-contracts
run: |
scarb build -p starknet_ibc_contracts
- name: Nix build
run: |
sudo rm -rf /opt/homebrew/
nix build \
.#starknet-devnet \
.#scarb \
.#universal-sierra-compiler \
.#rust \
.#rust-wasm \
Expand All @@ -52,11 +75,11 @@ jobs:
.#wasm-simapp \
.#osmosis
- name: Build Cairo contracts
working-directory: ./cairo-contracts
run: |
nix shell ..#scarb -c \
scarb build -p starknet_ibc_contracts
- uses: Swatinem/rust-cache@v2
with:
workspaces: |
relayer -> relayer/target
light-client -> light-client/target
- name: Run Integration Tests
env:
Expand Down Expand Up @@ -86,10 +109,12 @@ jobs:
timeout-minutes: 20
steps:
- uses: actions/checkout@v4

- uses: cachix/install-nix-action@v30
with:
extra_nix_config: |
experimental-features = nix-command flakes
- uses: cachix/cachix-action@v15
with:
name: ibc-starknet
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,19 @@ jobs:
with:
extra_nix_config: |
experimental-features = nix-command flakes
- uses: cachix/cachix-action@v15
with:
name: ibc-starknet
extraPullNames: hermes-sdk,cosmos-nix
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}

- name: Install Scarb
uses: software-mansion/setup-scarb@v1
with:
tool-versions: cairo-libs/.tool-versions
scarb-lock: cairo-libs/Scarb.lock

- name: Format Toml
run: |
nix shell .#taplo -c \
Expand All @@ -58,14 +65,12 @@ jobs:
- name: Format Cairo Contracts
working-directory: ./cairo-contracts
run: |
nix shell ..#scarb -c \
scarb fmt -w --check
scarb fmt -w --check
- name: Format Cairo Libraries
working-directory: ./cairo-libs
run: |
nix shell ..#scarb -c \
scarb fmt -w --check
scarb fmt -w --check
- name: Format Light Client
working-directory: ./light-client
Expand Down
30 changes: 6 additions & 24 deletions flake.lock

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

13 changes: 0 additions & 13 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@
flake = false;
};

scarb-src = {
url = "github:software-mansion/scarb/v2.9.2";
flake = false;
};

universal-sierra-compiler-src = {
url = "github:software-mansion/universal-sierra-compiler/v2.3.0";
flake = false;
Expand Down Expand Up @@ -80,11 +75,6 @@
inherit (inputs) cairo-src;
};

scarb = import ./nix/scarb.nix {
inherit nixpkgs;
inherit (inputs) scarb-src cairo-src;
};

universal-sierra-compiler = import ./nix/universal-sierra-compiler.nix {
inherit nixpkgs;
inherit (inputs) universal-sierra-compiler-src;
Expand All @@ -107,9 +97,7 @@
inherit
starknet-devnet
cairo
scarb
universal-sierra-compiler
# starknet-foundry
wasm-simapp
osmosis
;
Expand Down Expand Up @@ -141,7 +129,6 @@
inherit
starknet-devnet
cairo
scarb
rust
rust-nightly
rust-wasm
Expand Down
Loading

0 comments on commit 792086d

Please sign in to comment.