Skip to content
This repository has been archived by the owner on Jun 24, 2024. It is now read-only.

Commit

Permalink
Add nix flake to build sov-celestia-cw.wasm file (#137)
Browse files Browse the repository at this point in the history
* WIP: Add nix flake to build sov-celestia-cw.wasm file

* Change description and nixpkgs used

* Update git submodule url

* Vendor sovereign-sdk dependencies

* Fixing Nix build

* Nix build is working

* Use auth token in checkout

* Fix weird heisenbug in Nix build

* Somehow Cargo.toml do not need to be patched

* Try to make Nix build more reproducible

* Copy only source files into Nix source

* Add missing RUSTFLAGS when building wasm file

* Revert version used in rust-toolchain.toml

---------

Co-authored-by: Soares Chen <[email protected]>
  • Loading branch information
ljoss17 and soareschen authored Apr 12, 2024
1 parent 4e37dc4 commit f951c56
Show file tree
Hide file tree
Showing 13 changed files with 330 additions and 119 deletions.
59 changes: 31 additions & 28 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,33 +1,36 @@
[patch.crates-io]

sov-ibc = { path = "modules/sov-ibc" }
sov-ibc-transfer = { path = "modules/sov-ibc-transfer" }
sov-consensus-state-tracker = { path = "modules/sov-consensus-state-tracker" }
sov-celestia-client = { path = "clients/sov-celestia" }
[patch.crates-io]

ibc-core = { git = "https://github.com/cosmos/ibc-rs.git", rev = "c579628c67" }
ibc-core-client = { git = "https://github.com/cosmos/ibc-rs.git", rev = "c579628c67" }
ibc-core-host-cosmos = { git = "https://github.com/cosmos/ibc-rs.git", rev = "c579628c67" }
ibc-client-tendermint = { git = "https://github.com/cosmos/ibc-rs.git", rev = "c579628c67" }
ibc-client-wasm-types = { git = "https://github.com/cosmos/ibc-rs.git", rev = "c579628c67" }
ibc-app-transfer = { git = "https://github.com/cosmos/ibc-rs.git", rev = "c579628c67" }
ibc-primitives = { git = "https://github.com/cosmos/ibc-rs.git", rev = "c579628c67" }
ibc-query = { git = "https://github.com/cosmos/ibc-rs.git", rev = "c579628c67" }
ibc-testkit = { git = "https://github.com/cosmos/ibc-rs.git", rev = "c579628c67" }
sov-ibc = { path = "modules/sov-ibc" }
sov-ibc-transfer = { path = "modules/sov-ibc-transfer" }
sov-consensus-state-tracker = { path = "modules/sov-consensus-state-tracker" }
sov-celestia-client = { path = "clients/sov-celestia" }

basecoin = { git = "https://github.com/informalsystems/basecoin-rs.git", rev = "75fbb86" }
ibc = { git = "https://github.com/cosmos/ibc-rs.git", rev = "c579628c67" }
ibc-core = { git = "https://github.com/cosmos/ibc-rs.git", rev = "c579628c67" }
ibc-core-client = { git = "https://github.com/cosmos/ibc-rs.git", rev = "c579628c67" }
ibc-core-host-cosmos = { git = "https://github.com/cosmos/ibc-rs.git", rev = "c579628c67" }
ibc-client-tendermint = { git = "https://github.com/cosmos/ibc-rs.git", rev = "c579628c67" }
ibc-client-wasm-types = { git = "https://github.com/cosmos/ibc-rs.git", rev = "c579628c67" }
ibc-app-transfer = { git = "https://github.com/cosmos/ibc-rs.git", rev = "c579628c67" }
ibc-primitives = { git = "https://github.com/cosmos/ibc-rs.git", rev = "c579628c67" }
ibc-query = { git = "https://github.com/cosmos/ibc-rs.git", rev = "c579628c67" }
ibc-testkit = { git = "https://github.com/cosmos/ibc-rs.git", rev = "c579628c67" }

sov-bank = { git = "ssh://[email protected]/informalsystems/sovereign-sdk-wip.git", rev = "20bfd68" }
sov-celestia-adapter = { git = "ssh://[email protected]/informalsystems/sovereign-sdk-wip.git", rev = "20bfd68" }
sov-mock-da = { git = "ssh://[email protected]/informalsystems/sovereign-sdk-wip.git", rev = "20bfd68" }
sov-modules-api = { git = "ssh://[email protected]/informalsystems/sovereign-sdk-wip.git", rev = "20bfd68" }
sov-modules-core = { git = "ssh://[email protected]/informalsystems/sovereign-sdk-wip.git", rev = "20bfd68" }
sov-state = { git = "ssh://[email protected]/informalsystems/sovereign-sdk-wip.git", rev = "20bfd68" }
sov-rollup-interface = { git = "ssh://[email protected]/informalsystems/sovereign-sdk-wip.git", rev = "20bfd68" }
sov-chain-state = { git = "ssh://[email protected]/informalsystems/sovereign-sdk-wip.git", rev = "20bfd68" }
sov-kernels = { git = "ssh://[email protected]/informalsystems/sovereign-sdk-wip.git", rev = "20bfd68" }
sov-mock-zkvm = { git = "ssh://[email protected]/informalsystems/sovereign-sdk-wip.git", rev = "20bfd68" }
sov-prover-storage-manager = { git = "ssh://[email protected]/informalsystems/sovereign-sdk-wip.git", rev = "20bfd68" }
const-rollup-config = { git = "ssh://[email protected]/informalsystems/sovereign-sdk-wip.git", rev = "20bfd68" }
basecoin = { git = "https://github.com/informalsystems/basecoin-rs.git", rev = "75fbb86" }
jmt = { git = "https://github.com/penumbra-zone/jmt.git", rev = "1d007e11cb68aa5ca13e9a5af4a12e6439d5f7b6" }

jmt = { git = "https://github.com/penumbra-zone/jmt.git", rev = "1d007e11cb68aa5ca13e9a5af4a12e6439d5f7b6" }
sov-modules-api = { path = "vendor/sovereign-sdk/module-system/sov-modules-api" }
sov-state = { path = "vendor/sovereign-sdk/module-system/sov-state" }
sov-bank = { path = "vendor/sovereign-sdk/module-system/module-implementations/sov-bank" }
sov-sequencer-registry = { path = "vendor/sovereign-sdk/module-system/module-implementations/sov-sequencer-registry" }
sov-db = { path = "vendor/sovereign-sdk/full-node/sov-db" }
sov-rollup-interface = { path = "vendor/sovereign-sdk/rollup-interface" }
sov-mock-zkvm = { path = "vendor/sovereign-sdk/adapters/mock-zkvm" }
sov-prover-storage-manager = { path = "vendor/sovereign-sdk/full-node/sov-prover-storage-manager" }
sov-kernels = { path = "vendor/sovereign-sdk/module-system/sov-kernels" }
sov-modules-core = { path = "vendor/sovereign-sdk/module-system/sov-modules-core" }
sov-celestia-adapter = { path = "vendor/sovereign-sdk/adapters/celestia" }
sov-mock-da = { path = "vendor/sovereign-sdk/adapters/mock-da" }
const-rollup-config = { path = "vendor/sovereign-sdk/examples/const-rollup-config" }
sov-chain-state = { path = "vendor/sovereign-sdk/module-system/module-implementations/sov-chain-state" }
6 changes: 3 additions & 3 deletions .github/workflows/cw-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Git credentials
run:
git config --global --replace-all "url.https://${{ secrets.AUTH_TOKEN }}@github.com.insteadOf" ssh://[email protected]
with:
submodules: true
token: ${{ secrets.AUTH_TOKEN }}
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/risc0-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Git credentials
run:
git config --global --replace-all "url.https://${{ secrets.AUTH_TOKEN }}@github.com.insteadOf" ssh://[email protected]
with:
submodules: true
token: ${{ secrets.AUTH_TOKEN }}
- name: Cache dependencies
uses: Swatinem/rust-cache@v2
- name: Install cargo-risczero
Expand Down
32 changes: 16 additions & 16 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Git credentials
run:
git config --global --replace-all "url.https://${{ secrets.AUTH_TOKEN }}@github.com.insteadOf" ssh://[email protected]
with:
submodules: true
token: ${{ secrets.AUTH_TOKEN }}
- uses: arduino/setup-protoc@v2
- uses: actions-rs/toolchain@v1
with:
Expand All @@ -75,9 +75,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Git credentials
run:
git config --global --replace-all "url.https://${{ secrets.AUTH_TOKEN }}@github.com.insteadOf" ssh://[email protected]
with:
submodules: true
token: ${{ secrets.AUTH_TOKEN }}
- uses: arduino/setup-protoc@v2
- uses: actions-rs/toolchain@v1
with:
Expand All @@ -93,9 +93,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Git credentials
run:
git config --global --replace-all "url.https://${{ secrets.AUTH_TOKEN }}@github.com.insteadOf" ssh://[email protected]
with:
submodules: true
token: ${{ secrets.AUTH_TOKEN }}
- uses: arduino/setup-protoc@v2
- uses: actions-rs/toolchain@v1
with:
Expand All @@ -105,16 +105,16 @@ jobs:
- uses: Swatinem/rust-cache@v2
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.AUTH_TOKEN }}
args: --all-features --all-targets

clippy-no-default-features:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Git credentials
run:
git config --global --replace-all "url.https://${{ secrets.AUTH_TOKEN }}@github.com.insteadOf" ssh://[email protected]
with:
submodules: true
token: ${{ secrets.AUTH_TOKEN }}
- uses: arduino/setup-protoc@v2
- uses: actions-rs/toolchain@v1
with:
Expand All @@ -132,9 +132,9 @@ jobs:
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Set up Git credentials
run:
git config --global --replace-all "url.https://${{ secrets.AUTH_TOKEN }}@github.com.insteadOf" ssh://[email protected]
with:
submodules: true
token: ${{ secrets.AUTH_TOKEN }}
- uses: arduino/setup-protoc@v2
- uses: actions-rs/toolchain@v1
with:
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ target-path

demo_data/

/ci/**/*.lock
/ci/**/*.lock

result
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "vendor/sovereign-sdk"]
path = vendor/sovereign-sdk
url = [email protected]:informalsystems/sovereign-sdk-wip.git
Loading

0 comments on commit f951c56

Please sign in to comment.