diff --git a/.cargo/config.toml b/.cargo/config.toml index 2665c1ce..758f6275 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -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://git@github.com/informalsystems/sovereign-sdk-wip.git", rev = "20bfd68" } -sov-celestia-adapter = { git = "ssh://git@github.com/informalsystems/sovereign-sdk-wip.git", rev = "20bfd68" } -sov-mock-da = { git = "ssh://git@github.com/informalsystems/sovereign-sdk-wip.git", rev = "20bfd68" } -sov-modules-api = { git = "ssh://git@github.com/informalsystems/sovereign-sdk-wip.git", rev = "20bfd68" } -sov-modules-core = { git = "ssh://git@github.com/informalsystems/sovereign-sdk-wip.git", rev = "20bfd68" } -sov-state = { git = "ssh://git@github.com/informalsystems/sovereign-sdk-wip.git", rev = "20bfd68" } -sov-rollup-interface = { git = "ssh://git@github.com/informalsystems/sovereign-sdk-wip.git", rev = "20bfd68" } -sov-chain-state = { git = "ssh://git@github.com/informalsystems/sovereign-sdk-wip.git", rev = "20bfd68" } -sov-kernels = { git = "ssh://git@github.com/informalsystems/sovereign-sdk-wip.git", rev = "20bfd68" } -sov-mock-zkvm = { git = "ssh://git@github.com/informalsystems/sovereign-sdk-wip.git", rev = "20bfd68" } -sov-prover-storage-manager = { git = "ssh://git@github.com/informalsystems/sovereign-sdk-wip.git", rev = "20bfd68" } -const-rollup-config = { git = "ssh://git@github.com/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" } diff --git a/.github/workflows/cw-check.yml b/.github/workflows/cw-check.yml index 560f5d91..65a1a945 100644 --- a/.github/workflows/cw-check.yml +++ b/.github/workflows/cw-check.yml @@ -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://git@github.com + with: + submodules: true + token: ${{ secrets.AUTH_TOKEN }} - name: Install Rust uses: actions-rs/toolchain@v1 with: diff --git a/.github/workflows/risc0-check.yml b/.github/workflows/risc0-check.yml index 643142ba..31b3de7b 100644 --- a/.github/workflows/risc0-check.yml +++ b/.github/workflows/risc0-check.yml @@ -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://git@github.com + with: + submodules: true + token: ${{ secrets.AUTH_TOKEN }} - name: Cache dependencies uses: Swatinem/rust-cache@v2 - name: Install cargo-risczero diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index c1145f69..3696eb8d 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -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://git@github.com + with: + submodules: true + token: ${{ secrets.AUTH_TOKEN }} - uses: arduino/setup-protoc@v2 - uses: actions-rs/toolchain@v1 with: @@ -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://git@github.com + with: + submodules: true + token: ${{ secrets.AUTH_TOKEN }} - uses: arduino/setup-protoc@v2 - uses: actions-rs/toolchain@v1 with: @@ -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://git@github.com + with: + submodules: true + token: ${{ secrets.AUTH_TOKEN }} - uses: arduino/setup-protoc@v2 - uses: actions-rs/toolchain@v1 with: @@ -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://git@github.com + with: + submodules: true + token: ${{ secrets.AUTH_TOKEN }} - uses: arduino/setup-protoc@v2 - uses: actions-rs/toolchain@v1 with: @@ -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://git@github.com + with: + submodules: true + token: ${{ secrets.AUTH_TOKEN }} - uses: arduino/setup-protoc@v2 - uses: actions-rs/toolchain@v1 with: diff --git a/.gitignore b/.gitignore index f73be13f..b608ff59 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,6 @@ target-path demo_data/ -/ci/**/*.lock \ No newline at end of file +/ci/**/*.lock + +result \ No newline at end of file diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..1107d2f3 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "vendor/sovereign-sdk"] + path = vendor/sovereign-sdk + url = git@github.com:informalsystems/sovereign-sdk-wip.git diff --git a/Cargo.lock b/Cargo.lock index 4b45dda7..b57ce543 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -617,7 +617,7 @@ dependencies = [ "cosmrs", "derive_more", "displaydoc", - "ibc 0.51.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ibc", "ibc-proto", "ibc-query", "ics23", @@ -1128,7 +1128,6 @@ checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" [[package]] name = "const-rollup-config" version = "0.3.0" -source = "git+ssh://git@github.com/informalsystems/sovereign-sdk-wip.git?rev=20bfd68#20bfd68c8c740b447d51eb50381b5590102258bb" [[package]] name = "const_format" @@ -2528,30 +2527,16 @@ dependencies = [ "tokio-io-timeout", ] -[[package]] -name = "ibc" -version = "0.51.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8af2325614ae3274b2e70834bea56c1fa2758d802d364d89992b0fe820847fca" -dependencies = [ - "ibc-apps 0.51.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ibc-clients 0.51.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ibc-core", - "ibc-core-host-cosmos", - "ibc-derive 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", - "ibc-primitives", -] - [[package]] name = "ibc" version = "0.51.0" source = "git+https://github.com/cosmos/ibc-rs.git?rev=c579628c67#c579628c672bdb384ae4ef3cb02a7455c9d03386" dependencies = [ - "ibc-apps 0.51.0 (git+https://github.com/cosmos/ibc-rs.git?rev=c579628c67)", - "ibc-clients 0.51.0 (git+https://github.com/cosmos/ibc-rs.git?rev=c579628c67)", + "ibc-apps", + "ibc-clients", "ibc-core", "ibc-core-host-cosmos", - "ibc-derive 0.6.1 (git+https://github.com/cosmos/ibc-rs.git?rev=c579628c67)", + "ibc-derive", "ibc-primitives", ] @@ -2611,15 +2596,6 @@ dependencies = [ "uint", ] -[[package]] -name = "ibc-apps" -version = "0.51.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5325b71c21ea45f8a7f8df412e72a01b50f230b08b4120d6a233aeb4bf7b4a54" -dependencies = [ - "ibc-app-transfer", -] - [[package]] name = "ibc-apps" version = "0.51.0" @@ -2678,16 +2654,6 @@ dependencies = [ "serde", ] -[[package]] -name = "ibc-clients" -version = "0.51.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cf6dce5f55eac4930a6e00808cd91d9eccffcb8b5d7c4717b57e9a11217be90" -dependencies = [ - "ibc-client-tendermint", - "ibc-client-wasm-types", -] - [[package]] name = "ibc-clients" version = "0.51.0" @@ -2709,7 +2675,7 @@ dependencies = [ "ibc-core-handler", "ibc-core-host", "ibc-core-router", - "ibc-derive 0.6.1 (git+https://github.com/cosmos/ibc-rs.git?rev=c579628c67)", + "ibc-derive", "ibc-primitives", ] @@ -2979,17 +2945,6 @@ dependencies = [ "tendermint 0.34.1", ] -[[package]] -name = "ibc-derive" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f5010acf3b7fec09c24d05b946424a9f7884f9647ed837c1a1676d3eabac154" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.58", -] - [[package]] name = "ibc-derive" version = "0.6.1" @@ -3046,7 +3001,7 @@ version = "0.51.0" source = "git+https://github.com/cosmos/ibc-rs.git?rev=c579628c67#c579628c672bdb384ae4ef3cb02a7455c9d03386" dependencies = [ "displaydoc", - "ibc 0.51.0 (git+https://github.com/cosmos/ibc-rs.git?rev=c579628c67)", + "ibc", "ibc-proto", "schemars", "serde", @@ -3060,7 +3015,7 @@ source = "git+https://github.com/cosmos/ibc-rs.git?rev=c579628c67#c579628c672bdb dependencies = [ "derive_more", "displaydoc", - "ibc 0.51.0 (git+https://github.com/cosmos/ibc-rs.git?rev=c579628c67)", + "ibc", "ibc-proto", "parking_lot", "subtle-encoding", @@ -5449,7 +5404,6 @@ dependencies = [ [[package]] name = "sov-bank" version = "0.3.0" -source = "git+ssh://git@github.com/informalsystems/sovereign-sdk-wip.git?rev=20bfd68#20bfd68c8c740b447d51eb50381b5590102258bb" dependencies = [ "anyhow", "bech32 0.11.0", @@ -5468,7 +5422,6 @@ dependencies = [ [[package]] name = "sov-blob-storage" version = "0.3.0" -source = "git+ssh://git@github.com/informalsystems/sovereign-sdk-wip.git?rev=20bfd68#20bfd68c8c740b447d51eb50381b5590102258bb" dependencies = [ "anyhow", "bincode", @@ -5489,7 +5442,6 @@ dependencies = [ [[package]] name = "sov-celestia-adapter" version = "0.3.0" -source = "git+ssh://git@github.com/informalsystems/sovereign-sdk-wip.git?rev=20bfd68#20bfd68c8c740b447d51eb50381b5590102258bb" dependencies = [ "anyhow", "async-trait", @@ -5580,7 +5532,6 @@ dependencies = [ [[package]] name = "sov-chain-state" version = "0.3.0" -source = "git+ssh://git@github.com/informalsystems/sovereign-sdk-wip.git?rev=20bfd68#20bfd68c8c740b447d51eb50381b5590102258bb" dependencies = [ "anyhow", "borsh", @@ -5621,7 +5572,6 @@ dependencies = [ [[package]] name = "sov-db" version = "0.3.0" -source = "git+ssh://git@github.com/informalsystems/sovereign-sdk-wip.git?rev=20bfd68#20bfd68c8c740b447d51eb50381b5590102258bb" dependencies = [ "anyhow", "bincode", @@ -5758,7 +5708,6 @@ dependencies = [ [[package]] name = "sov-kernels" version = "0.3.0" -source = "git+ssh://git@github.com/informalsystems/sovereign-sdk-wip.git?rev=20bfd68#20bfd68c8c740b447d51eb50381b5590102258bb" dependencies = [ "anyhow", "sov-blob-storage", @@ -5771,7 +5720,6 @@ dependencies = [ [[package]] name = "sov-mock-da" version = "0.3.0" -source = "git+ssh://git@github.com/informalsystems/sovereign-sdk-wip.git?rev=20bfd68#20bfd68c8c740b447d51eb50381b5590102258bb" dependencies = [ "anyhow", "async-trait", @@ -5789,7 +5737,6 @@ dependencies = [ [[package]] name = "sov-mock-zkvm" version = "0.3.0" -source = "git+ssh://git@github.com/informalsystems/sovereign-sdk-wip.git?rev=20bfd68#20bfd68c8c740b447d51eb50381b5590102258bb" dependencies = [ "anyhow", "bincode", @@ -5805,7 +5752,6 @@ dependencies = [ [[package]] name = "sov-modules-api" version = "0.3.0" -source = "git+ssh://git@github.com/informalsystems/sovereign-sdk-wip.git?rev=20bfd68#20bfd68c8c740b447d51eb50381b5590102258bb" dependencies = [ "anyhow", "bech32 0.11.0", @@ -5830,7 +5776,6 @@ dependencies = [ [[package]] name = "sov-modules-core" version = "0.3.0" -source = "git+ssh://git@github.com/informalsystems/sovereign-sdk-wip.git?rev=20bfd68#20bfd68c8c740b447d51eb50381b5590102258bb" dependencies = [ "anyhow", "bech32 0.11.0", @@ -5851,7 +5796,6 @@ dependencies = [ [[package]] name = "sov-modules-macros" version = "0.3.0" -source = "git+ssh://git@github.com/informalsystems/sovereign-sdk-wip.git?rev=20bfd68#20bfd68c8c740b447d51eb50381b5590102258bb" dependencies = [ "anyhow", "bech32 0.11.0", @@ -5867,7 +5811,6 @@ dependencies = [ [[package]] name = "sov-prover-storage-manager" version = "0.3.0" -source = "git+ssh://git@github.com/informalsystems/sovereign-sdk-wip.git?rev=20bfd68#20bfd68c8c740b447d51eb50381b5590102258bb" dependencies = [ "anyhow", "rockbound", @@ -5880,7 +5823,6 @@ dependencies = [ [[package]] name = "sov-rollup-interface" version = "0.3.0" -source = "git+ssh://git@github.com/informalsystems/sovereign-sdk-wip.git?rev=20bfd68#20bfd68c8c740b447d51eb50381b5590102258bb" dependencies = [ "anyhow", "async-trait", @@ -5902,7 +5844,6 @@ dependencies = [ [[package]] name = "sov-sequencer-registry" version = "0.3.0" -source = "git+ssh://git@github.com/informalsystems/sovereign-sdk-wip.git?rev=20bfd68#20bfd68c8c740b447d51eb50381b5590102258bb" dependencies = [ "anyhow", "borsh", @@ -5920,7 +5861,6 @@ dependencies = [ [[package]] name = "sov-state" version = "0.3.0" -source = "git+ssh://git@github.com/informalsystems/sovereign-sdk-wip.git?rev=20bfd68#20bfd68c8c740b447d51eb50381b5590102258bb" dependencies = [ "anyhow", "bcs", diff --git a/Cargo.toml b/Cargo.toml index 7aab98b7..25ed8101 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,8 @@ members = [ ] exclude = [ - "ci/risc0-check" + "ci/risc0-check", + "vendor/sovereign-sdk" ] [workspace.package] diff --git a/flake.lock b/flake.lock new file mode 100644 index 00000000..97c996c8 --- /dev/null +++ b/flake.lock @@ -0,0 +1,148 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1705309234, + "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1712757991, + "narHash": "sha256-kR7C7Fqt3JP40h0mzmSZeWI5pk1iwqj4CSeGjnUbVHc=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "d6b3ddd253c578a7ab98f8011e59990f21dc3932", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1706487304, + "narHash": "sha256-LE8lVX28MV2jWJsidW13D2qrHU/RUUONendL2Q/WlJg=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "90f456026d284c22b3e3497be980b2e47d0b28ac", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs", + "rust-overlay": "rust-overlay", + "sovereign-sdk-src": "sovereign-sdk-src" + } + }, + "rust-overlay": { + "inputs": { + "flake-utils": "flake-utils_2", + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1712801594, + "narHash": "sha256-KZJnVw3TdfDyUhvClzgy3IEoC9tRhvG0yM+lHfqAm34=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "35ebec41fcdeeae8e012e7d62ba153a13645227f", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, + "sovereign-sdk-src": { + "flake": false, + "locked": { + "lastModified": 1711704165, + "narHash": "sha256-bmOvCxA6paFllm58AaxWRvLvyWhtM+Q/nAyyGIvVS3A=", + "ref": "refs/heads/nightly", + "rev": "20bfd68c8c740b447d51eb50381b5590102258bb", + "revCount": 911, + "type": "git", + "url": "ssh://git@github.com/informalsystems/sovereign-sdk-wip" + }, + "original": { + "rev": "20bfd68c8c740b447d51eb50381b5590102258bb", + "type": "git", + "url": "ssh://git@github.com/informalsystems/sovereign-sdk-wip" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 00000000..4f1ebde2 --- /dev/null +++ b/flake.nix @@ -0,0 +1,45 @@ +{ + description = "Nix flake for building Wasm file"; + + inputs = { + nixpkgs.url = github:nixos/nixpkgs/nixpkgs-unstable; + flake-utils.url = github:numtide/flake-utils; + rust-overlay.url = github:oxalica/rust-overlay; + + sovereign-sdk-src = { + flake = false; + url = git+ssh://git@github.com/informalsystems/sovereign-sdk-wip?rev=20bfd68c8c740b447d51eb50381b5590102258bb; + }; + }; + + outputs = inputs: + let + utils = inputs.flake-utils.lib; + in + utils.eachSystem + [ + "aarch64-darwin" + "aarch64-linux" + "x86_64-darwin" + "x86_64-linux" + ] + (system: let + nixpkgs = import inputs.nixpkgs { + inherit system; + overlays = [ + inputs.rust-overlay.overlays.default + ]; + }; + + rust-bin = nixpkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml; + + sov-celestia-cw = import ./nix/sov-celestia-cw.nix { + inherit nixpkgs rust-bin; + inherit (inputs) sovereign-sdk-src; + }; + in { + packages = { + inherit (sov-celestia-cw) sov-celestia-cw; + }; + }); +} diff --git a/nix/sov-celestia-cw.nix b/nix/sov-celestia-cw.nix new file mode 100644 index 00000000..f94d5a70 --- /dev/null +++ b/nix/sov-celestia-cw.nix @@ -0,0 +1,65 @@ +{ + nixpkgs +, rust-bin +, sovereign-sdk-src +}: +let + sov-celestia-src = nixpkgs.stdenv.mkDerivation { + name = "sov-celestia-src"; + dontUnpack = true; + dontBuild = true; + + installPhase = '' + mkdir -p $out $out/vendor + + cp -r ${../clients} $out/clients + cp -r ${../modules} $out/modules + cp -r ${../mocks} $out/mocks + cp -r ${../proto} $out/proto + cp -r ${sovereign-sdk-src} $out/vendor/sovereign-sdk + cp ${../Cargo.lock} $out/Cargo.lock + + cat ${../Cargo.toml} > $out/Cargo.toml + cat ${../.cargo/config.toml} >> $out/Cargo.toml + ''; + }; + + sov-celestia-cw = nixpkgs.rustPlatform.buildRustPackage { + name = "sov-celestia-cw"; + src = sov-celestia-src; + + cargoLock = { + lockFile = ../Cargo.lock; + outputHashes = { + "basecoin-0.1.0" = "sha256-NCjfbrtxo7NZ/pW2FxAf+bB9kmluQLuI0zekwX2lypY="; + "celestia-proto-0.1.0" = "sha256-iUgrctxdJUyhfrEQ0zoVj5AKIqgj/jQVNli5/K2nxK0="; + "ibc-0.51.0" = "sha256-6HcMSTcKx4y1hfKcXnzgiNM9FWdqUuUNnemAgS36Z1A="; + "jmt-0.9.0" = "sha256-pq1v6FXS//6Dh+fdysQIVp+RVLHdXrW5aDx3263O1rs="; + "nmt-rs-0.1.0" = "sha256-jcHbqyIKk8ZDDjSz+ot5YDxROOnrpM4TRmNFVfNniwU="; + "risc0-cycle-utils-0.3.0" = "sha256-5dA62v1eqfyZBny4s3YlC2Tty7Yfd/OAVGfTlLBgypk="; + "rockbound-1.0.0" = "sha256-xTaeBndRb/bYe+tySChDKsh4f9pywAExsdgJExCQiy8="; + "tendermint-0.32.0" = "sha256-FtY7a+hBvQryATrs3mykCWFRe8ABTT6cuf5oh9IBElQ="; + }; + }; + + nativeBuildInputs = [ + rust-bin + ]; + + doCheck = false; + + CONSTANTS_MANIFEST = sov-celestia-src; + + buildPhase = '' + RUSTFLAGS='-C link-arg=-s' cargo build -p sov-celestia-client-cw --target wasm32-unknown-unknown --release --lib --locked + ''; + + installPhase = '' + mkdir -p $out + cp target/wasm32-unknown-unknown/release/sov_celestia_client_cw.wasm $out/ + ''; + }; +in +{ + inherit sov-celestia-cw; +} \ No newline at end of file diff --git a/rust-toolchain.toml b/rust-toolchain.toml index af0053fd..b1f52442 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -2,3 +2,6 @@ channel = "1.75" components = [ "rustfmt", "rust-src", "clippy" ] profile = "minimal" +targets = [ + "wasm32-unknown-unknown", +] \ No newline at end of file diff --git a/vendor/sovereign-sdk b/vendor/sovereign-sdk new file mode 160000 index 00000000..20bfd68c --- /dev/null +++ b/vendor/sovereign-sdk @@ -0,0 +1 @@ +Subproject commit 20bfd68c8c740b447d51eb50381b5590102258bb