From c00ae1e55cb4cda5a1cbaadc153c911884103301 Mon Sep 17 00:00:00 2001 From: Farhad Shabani Date: Fri, 8 Mar 2024 20:28:21 -0800 Subject: [PATCH] chore: update Sovereign dependencies to rev `3f94cecc` (#93) * deps: update sovereign to rev 3f94cecc * fix: introduce namespaces to SlotKey * chore: update sov-ibc-mocks * nit * fix: specify risczero version * deps: update basecoin rev --- .github/workflows/risc0-check.yml | 8 +- Cargo.lock | 196 ++++++++++++++++++++--------- Cargo.toml | 11 +- mocks/Cargo.toml | 21 ++-- mocks/src/sovereign/rollup.rs | 12 +- mocks/src/sovereign/runner.rs | 8 +- mocks/src/sovereign/runtime/mod.rs | 5 +- modules/sov-ibc/Cargo.toml | 1 + modules/sov-ibc/src/call.rs | 23 +++- modules/sov-ibc/src/rpc/methods.rs | 12 +- 10 files changed, 203 insertions(+), 94 deletions(-) diff --git a/.github/workflows/risc0-check.yml b/.github/workflows/risc0-check.yml index 63252122..643142ba 100644 --- a/.github/workflows/risc0-check.yml +++ b/.github/workflows/risc0-check.yml @@ -31,10 +31,12 @@ jobs: git config --global --replace-all "url.https://${{ secrets.AUTH_TOKEN }}@github.com.insteadOf" ssh://git@github.com - name: Cache dependencies uses: Swatinem/rust-cache@v2 - - name: Install cargo-risc0 - run: cargo install cargo-risczero + - name: Install cargo-risczero + uses: taiki-e/install-action@v2 + with: + tool: cargo-risczero@0.20 - name: Install risc0-zkvm toolchain - run: cargo risczero install + run: cargo risczero install --version v2024-02-08.1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Check Risc0 compatibility diff --git a/Cargo.lock b/Cargo.lock index ed54da13..249c2a0d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -538,7 +538,7 @@ checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" [[package]] name = "basecoin" version = "0.1.0" -source = "git+https://github.com/informalsystems/basecoin-rs.git?rev=63013eb#63013eb513a921f38af82707a1ea1f5dabc180c8" +source = "git+https://github.com/informalsystems/basecoin-rs.git?rev=9b214c7#9b214c70a872365e701b8d7a485a22efedc499ec" dependencies = [ "basecoin-app", "basecoin-modules", @@ -560,7 +560,7 @@ dependencies = [ [[package]] name = "basecoin-app" version = "0.1.0" -source = "git+https://github.com/informalsystems/basecoin-rs.git?rev=63013eb#63013eb513a921f38af82707a1ea1f5dabc180c8" +source = "git+https://github.com/informalsystems/basecoin-rs.git?rev=9b214c7#9b214c70a872365e701b8d7a485a22efedc499ec" dependencies = [ "basecoin-modules", "basecoin-store", @@ -579,7 +579,7 @@ dependencies = [ [[package]] name = "basecoin-modules" version = "0.1.0" -source = "git+https://github.com/informalsystems/basecoin-rs.git?rev=63013eb#63013eb513a921f38af82707a1ea1f5dabc180c8" +source = "git+https://github.com/informalsystems/basecoin-rs.git?rev=9b214c7#9b214c70a872365e701b8d7a485a22efedc499ec" dependencies = [ "base64 0.21.7", "basecoin-store", @@ -596,7 +596,7 @@ dependencies = [ "serde_derive", "serde_json", "sha2 0.10.8", - "sov-celestia-client 0.1.0 (git+https://github.com/informalsystems/sovereign-ibc.git?rev=babc662)", + "sov-celestia-client 0.1.0 (git+https://github.com/informalsystems/sovereign-ibc.git?rev=81d5c5b)", "tendermint 0.34.0", "tendermint-rpc", "tonic", @@ -606,7 +606,7 @@ dependencies = [ [[package]] name = "basecoin-store" version = "0.1.0" -source = "git+https://github.com/informalsystems/basecoin-rs.git?rev=63013eb#63013eb513a921f38af82707a1ea1f5dabc180c8" +source = "git+https://github.com/informalsystems/basecoin-rs.git?rev=9b214c7#9b214c70a872365e701b8d7a485a22efedc499ec" dependencies = [ "displaydoc", "ics23", @@ -689,6 +689,21 @@ dependencies = [ "zeroize", ] +[[package]] +name = "bit-set" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" + [[package]] name = "bitflags" version = "1.3.2" @@ -1076,7 +1091,7 @@ checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" [[package]] name = "const-rollup-config" version = "0.3.0" -source = "git+ssh://git@github.com/informalsystems/sovereign-sdk-wip.git?rev=5a144d60#5a144d60eefaf9ce166bbfd66324b959aa4ae82b" +source = "git+ssh://git@github.com/informalsystems/sovereign-sdk-wip.git?rev=3f94cecc#3f94ceccae8f84eb191deeb97ce65a1af3c9fd1b" [[package]] name = "const_format" @@ -4068,6 +4083,7 @@ dependencies = [ "lazy_static", "memchr", "parking_lot", + "protobuf", "thiserror", ] @@ -4077,6 +4093,8 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "31b476131c3c86cb68032fdc5cb6d5a1045e3e42d96b69fa599fd77701e1f5bf" dependencies = [ + "bit-set", + "bit-vec", "bitflags 2.4.2", "lazy_static", "num-traits", @@ -4084,9 +4102,22 @@ dependencies = [ "rand_chacha", "rand_xorshift", "regex-syntax 0.8.2", + "rusty-fork", + "tempfile", "unarray", ] +[[package]] +name = "proptest-derive" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cf16337405ca084e9c78985114633b6827711d22b9e6ef6c6c0d665eb3f0b6e" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "prost" version = "0.12.3" @@ -4141,6 +4172,12 @@ dependencies = [ "prost", ] +[[package]] +name = "protobuf" +version = "2.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "106dd99e98437432fed6519dedecfade6a06a73bb7b2a1e019fdd2bee5778d94" + [[package]] name = "protobuf-src" version = "1.1.0+21.5" @@ -4170,6 +4207,12 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "quick-error" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" + [[package]] name = "quote" version = "1.0.35" @@ -4355,9 +4398,9 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.11.24" +version = "0.11.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6920094eb85afde5e4a138be3f2de8bbdf28000f0029e72c45025a56b042251" +checksum = "0eea5a9eb898d3783f17c6407670e3592fd174cb81a10e51d4c37f49450b9946" dependencies = [ "base64 0.21.7", "bytes", @@ -4526,7 +4569,7 @@ dependencies = [ [[package]] name = "risc0-cycle-utils" version = "0.3.0" -source = "git+https://github.com/Sovereign-Labs/risc0-cycle-macros.git?rev=98948b8ee0e3edffcee7f3bd95a9d93c5c0941af#98948b8ee0e3edffcee7f3bd95a9d93c5c0941af" +source = "git+https://github.com/Sovereign-Labs/risc0-cycle-macros.git?rev=a00d0719388bcecd51b6033721957b27ffe12843#a00d0719388bcecd51b6033721957b27ffe12843" dependencies = [ "bytes", "risc0-zkvm", @@ -4665,6 +4708,22 @@ dependencies = [ "rustc-hex", ] +[[package]] +name = "rockbound" +version = "1.0.0" +source = "git+https://github.com/sovereign-Labs/rockbound?tag=v2.0.0#edabd23e12d75058d7ce5d92e38dcc9f66f83c53" +dependencies = [ + "anyhow", + "byteorder", + "once_cell", + "prometheus", + "proptest", + "proptest-derive", + "rocksdb", + "thiserror", + "tracing", +] + [[package]] name = "rocksdb" version = "0.21.0" @@ -4819,6 +4878,18 @@ version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" +[[package]] +name = "rusty-fork" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb3dcc6e454c328bb824492db107ab7c0ae8fcffe4ad210136ef014458c1bc4f" +dependencies = [ + "fnv", + "quick-error", + "tempfile", + "wait-timeout", +] + [[package]] name = "ruzstd" version = "0.5.0" @@ -5012,6 +5083,15 @@ dependencies = [ "serde_derive", ] +[[package]] +name = "serde-big-array" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11fc7cc2c76d73e0f27ee52abbd64eec84d46f370c88371120433196934e4b7f" +dependencies = [ + "serde", +] + [[package]] name = "serde-json-wasm" version = "0.5.2" @@ -5268,7 +5348,7 @@ dependencies = [ [[package]] name = "sov-bank" version = "0.3.0" -source = "git+ssh://git@github.com/informalsystems/sovereign-sdk-wip.git?rev=5a144d60#5a144d60eefaf9ce166bbfd66324b959aa4ae82b" +source = "git+ssh://git@github.com/informalsystems/sovereign-sdk-wip.git?rev=3f94cecc#3f94ceccae8f84eb191deeb97ce65a1af3c9fd1b" dependencies = [ "anyhow", "borsh", @@ -5280,12 +5360,13 @@ dependencies = [ "sov-modules-api", "sov-state", "thiserror", + "tracing", ] [[package]] name = "sov-blob-storage" version = "0.3.0" -source = "git+ssh://git@github.com/informalsystems/sovereign-sdk-wip.git?rev=5a144d60#5a144d60eefaf9ce166bbfd66324b959aa4ae82b" +source = "git+ssh://git@github.com/informalsystems/sovereign-sdk-wip.git?rev=3f94cecc#3f94ceccae8f84eb191deeb97ce65a1af3c9fd1b" dependencies = [ "anyhow", "bincode", @@ -5306,7 +5387,7 @@ dependencies = [ [[package]] name = "sov-celestia-adapter" version = "0.3.0" -source = "git+ssh://git@github.com/informalsystems/sovereign-sdk-wip.git?rev=5a144d60#5a144d60eefaf9ce166bbfd66324b959aa4ae82b" +source = "git+ssh://git@github.com/informalsystems/sovereign-sdk-wip.git?rev=3f94cecc#3f94ceccae8f84eb191deeb97ce65a1af3c9fd1b" dependencies = [ "anyhow", "async-trait", @@ -5352,7 +5433,7 @@ dependencies = [ [[package]] name = "sov-celestia-client" version = "0.1.0" -source = "git+https://github.com/informalsystems/sovereign-ibc.git?rev=babc662#babc6620e6e3809074a4f4c022efdeb31153c5e9" +source = "git+https://github.com/informalsystems/sovereign-ibc.git?rev=81d5c5b#81d5c5bed02d4df1e5a89af9092661be04c0da60" dependencies = [ "derive_more", "ibc-client-tendermint", @@ -5360,7 +5441,7 @@ dependencies = [ "ics23", "prost", "serde", - "sov-celestia-client-types 0.1.0 (git+https://github.com/informalsystems/sovereign-ibc.git?rev=babc662)", + "sov-celestia-client-types 0.1.0 (git+https://github.com/informalsystems/sovereign-ibc.git?rev=81d5c5b)", "tendermint 0.34.0", "tendermint-light-client-verifier", "tendermint-proto 0.34.0", @@ -5411,7 +5492,7 @@ dependencies = [ [[package]] name = "sov-celestia-client-types" version = "0.1.0" -source = "git+https://github.com/informalsystems/sovereign-ibc.git?rev=babc662#babc6620e6e3809074a4f4c022efdeb31153c5e9" +source = "git+https://github.com/informalsystems/sovereign-ibc.git?rev=81d5c5b#81d5c5bed02d4df1e5a89af9092661be04c0da60" dependencies = [ "base64 0.21.7", "bytes", @@ -5433,10 +5514,11 @@ dependencies = [ [[package]] name = "sov-chain-state" version = "0.3.0" -source = "git+ssh://git@github.com/informalsystems/sovereign-sdk-wip.git?rev=5a144d60#5a144d60eefaf9ce166bbfd66324b959aa4ae82b" +source = "git+ssh://git@github.com/informalsystems/sovereign-sdk-wip.git?rev=3f94cecc#3f94ceccae8f84eb191deeb97ce65a1af3c9fd1b" dependencies = [ "anyhow", "borsh", + "derivative", "jsonrpsee", "serde", "serde_json", @@ -5448,7 +5530,7 @@ dependencies = [ [[package]] name = "sov-db" version = "0.3.0" -source = "git+ssh://git@github.com/informalsystems/sovereign-sdk-wip.git?rev=5a144d60#5a144d60eefaf9ce166bbfd66324b959aa4ae82b" +source = "git+ssh://git@github.com/informalsystems/sovereign-sdk-wip.git?rev=3f94cecc#3f94ceccae8f84eb191deeb97ce65a1af3c9fd1b" dependencies = [ "anyhow", "bincode", @@ -5456,11 +5538,11 @@ dependencies = [ "byteorder", "hex", "jmt", + "rockbound", "rocksdb", "serde", "sov-modules-core", "sov-rollup-interface", - "sov-schema-db", "tokio", ] @@ -5491,12 +5573,13 @@ dependencies = [ "sov-state", "thiserror", "time", + "tracing", ] [[package]] name = "sov-ibc" version = "0.1.0" -source = "git+https://github.com/informalsystems/sovereign-ibc.git?rev=babc662#babc6620e6e3809074a4f4c022efdeb31153c5e9" +source = "git+https://github.com/informalsystems/sovereign-ibc.git?rev=81d5c5b#81d5c5bed02d4df1e5a89af9092661be04c0da60" dependencies = [ "ahash 0.8.6", "anyhow", @@ -5513,14 +5596,15 @@ dependencies = [ "serde", "serde_json", "sha2 0.10.8", - "sov-celestia-client 0.1.0 (git+https://github.com/informalsystems/sovereign-ibc.git?rev=babc662)", + "sov-celestia-client 0.1.0 (git+https://github.com/informalsystems/sovereign-ibc.git?rev=81d5c5b)", "sov-chain-state", - "sov-ibc-transfer 0.1.0 (git+https://github.com/informalsystems/sovereign-ibc.git?rev=babc662)", + "sov-ibc-transfer 0.1.0 (git+https://github.com/informalsystems/sovereign-ibc.git?rev=81d5c5b)", "sov-modules-api", "sov-rollup-interface", "sov-state", "thiserror", "time", + "tracing", ] [[package]] @@ -5546,17 +5630,16 @@ dependencies = [ "sha2 0.10.8", "sov-bank", "sov-celestia-adapter", - "sov-celestia-client 0.1.0 (git+https://github.com/informalsystems/sovereign-ibc.git?rev=babc662)", + "sov-celestia-client 0.1.0 (git+https://github.com/informalsystems/sovereign-ibc.git?rev=81d5c5b)", "sov-chain-state", - "sov-ibc 0.1.0 (git+https://github.com/informalsystems/sovereign-ibc.git?rev=babc662)", - "sov-ibc-transfer 0.1.0 (git+https://github.com/informalsystems/sovereign-ibc.git?rev=babc662)", + "sov-ibc 0.1.0 (git+https://github.com/informalsystems/sovereign-ibc.git?rev=81d5c5b)", + "sov-ibc-transfer 0.1.0 (git+https://github.com/informalsystems/sovereign-ibc.git?rev=81d5c5b)", "sov-mock-da", "sov-mock-zkvm", "sov-modules-api", "sov-modules-stf-blueprint", "sov-prover-storage-manager", "sov-rollup-interface", - "sov-schema-db", "sov-state", "tempfile", "tendermint 0.34.0", @@ -5595,7 +5678,7 @@ dependencies = [ [[package]] name = "sov-ibc-transfer" version = "0.1.0" -source = "git+https://github.com/informalsystems/sovereign-ibc.git?rev=babc662#babc6620e6e3809074a4f4c022efdeb31153c5e9" +source = "git+https://github.com/informalsystems/sovereign-ibc.git?rev=81d5c5b#81d5c5bed02d4df1e5a89af9092661be04c0da60" dependencies = [ "anyhow", "base64 0.21.7", @@ -5617,7 +5700,7 @@ dependencies = [ [[package]] name = "sov-mock-da" version = "0.3.0" -source = "git+ssh://git@github.com/informalsystems/sovereign-sdk-wip.git?rev=5a144d60#5a144d60eefaf9ce166bbfd66324b959aa4ae82b" +source = "git+ssh://git@github.com/informalsystems/sovereign-sdk-wip.git?rev=3f94cecc#3f94ceccae8f84eb191deeb97ce65a1af3c9fd1b" dependencies = [ "anyhow", "async-trait", @@ -5629,12 +5712,13 @@ dependencies = [ "sha2 0.10.8", "sov-rollup-interface", "tokio", + "tracing", ] [[package]] name = "sov-mock-zkvm" version = "0.3.0" -source = "git+ssh://git@github.com/informalsystems/sovereign-sdk-wip.git?rev=5a144d60#5a144d60eefaf9ce166bbfd66324b959aa4ae82b" +source = "git+ssh://git@github.com/informalsystems/sovereign-sdk-wip.git?rev=3f94cecc#3f94ceccae8f84eb191deeb97ce65a1af3c9fd1b" dependencies = [ "anyhow", "bincode", @@ -5642,18 +5726,15 @@ dependencies = [ "ed25519-dalek", "hex", "rand", - "schemars", "serde", "sha2 0.10.8", - "sov-modules-api", "sov-rollup-interface", - "thiserror", ] [[package]] name = "sov-modules-api" version = "0.3.0" -source = "git+ssh://git@github.com/informalsystems/sovereign-sdk-wip.git?rev=5a144d60#5a144d60eefaf9ce166bbfd66324b959aa4ae82b" +source = "git+ssh://git@github.com/informalsystems/sovereign-sdk-wip.git?rev=3f94cecc#3f94ceccae8f84eb191deeb97ce65a1af3c9fd1b" dependencies = [ "anyhow", "bech32", @@ -5678,7 +5759,7 @@ dependencies = [ [[package]] name = "sov-modules-core" version = "0.3.0" -source = "git+ssh://git@github.com/informalsystems/sovereign-sdk-wip.git?rev=5a144d60#5a144d60eefaf9ce166bbfd66324b959aa4ae82b" +source = "git+ssh://git@github.com/informalsystems/sovereign-sdk-wip.git?rev=3f94cecc#3f94ceccae8f84eb191deeb97ce65a1af3c9fd1b" dependencies = [ "anyhow", "bech32", @@ -5699,7 +5780,7 @@ dependencies = [ [[package]] name = "sov-modules-macros" version = "0.3.0" -source = "git+ssh://git@github.com/informalsystems/sovereign-sdk-wip.git?rev=5a144d60#5a144d60eefaf9ce166bbfd66324b959aa4ae82b" +source = "git+ssh://git@github.com/informalsystems/sovereign-sdk-wip.git?rev=3f94cecc#3f94ceccae8f84eb191deeb97ce65a1af3c9fd1b" dependencies = [ "anyhow", "borsh", @@ -5714,7 +5795,7 @@ dependencies = [ [[package]] name = "sov-modules-stf-blueprint" version = "0.3.0" -source = "git+ssh://git@github.com/informalsystems/sovereign-sdk-wip.git?rev=5a144d60#5a144d60eefaf9ce166bbfd66324b959aa4ae82b" +source = "git+ssh://git@github.com/informalsystems/sovereign-sdk-wip.git?rev=3f94cecc#3f94ceccae8f84eb191deeb97ce65a1af3c9fd1b" dependencies = [ "anyhow", "borsh", @@ -5734,12 +5815,12 @@ dependencies = [ [[package]] name = "sov-prover-storage-manager" version = "0.3.0" -source = "git+ssh://git@github.com/informalsystems/sovereign-sdk-wip.git?rev=5a144d60#5a144d60eefaf9ce166bbfd66324b959aa4ae82b" +source = "git+ssh://git@github.com/informalsystems/sovereign-sdk-wip.git?rev=3f94cecc#3f94ceccae8f84eb191deeb97ce65a1af3c9fd1b" dependencies = [ "anyhow", + "rockbound", "sov-db", "sov-rollup-interface", - "sov-schema-db", "sov-state", "tracing", ] @@ -5747,7 +5828,7 @@ dependencies = [ [[package]] name = "sov-rollup-interface" version = "0.3.0" -source = "git+ssh://git@github.com/informalsystems/sovereign-sdk-wip.git?rev=5a144d60#5a144d60eefaf9ce166bbfd66324b959aa4ae82b" +source = "git+ssh://git@github.com/informalsystems/sovereign-sdk-wip.git?rev=3f94cecc#3f94ceccae8f84eb191deeb97ce65a1af3c9fd1b" dependencies = [ "anyhow", "async-trait", @@ -5757,6 +5838,7 @@ dependencies = [ "futures", "hex", "proptest", + "schemars", "serde", "serde_json", "sha2 0.10.8", @@ -5764,24 +5846,10 @@ dependencies = [ "tokio", ] -[[package]] -name = "sov-schema-db" -version = "0.3.0" -source = "git+ssh://git@github.com/informalsystems/sovereign-sdk-wip.git?rev=5a144d60#5a144d60eefaf9ce166bbfd66324b959aa4ae82b" -dependencies = [ - "anyhow", - "byteorder", - "once_cell", - "prometheus", - "rocksdb", - "thiserror", - "tracing", -] - [[package]] name = "sov-sequencer-registry" version = "0.3.0" -source = "git+ssh://git@github.com/informalsystems/sovereign-sdk-wip.git?rev=5a144d60#5a144d60eefaf9ce166bbfd66324b959aa4ae82b" +source = "git+ssh://git@github.com/informalsystems/sovereign-sdk-wip.git?rev=3f94cecc#3f94ceccae8f84eb191deeb97ce65a1af3c9fd1b" dependencies = [ "anyhow", "borsh", @@ -5799,7 +5867,7 @@ dependencies = [ [[package]] name = "sov-state" version = "0.3.0" -source = "git+ssh://git@github.com/informalsystems/sovereign-sdk-wip.git?rev=5a144d60#5a144d60eefaf9ce166bbfd66324b959aa4ae82b" +source = "git+ssh://git@github.com/informalsystems/sovereign-sdk-wip.git?rev=3f94cecc#3f94ceccae8f84eb191deeb97ce65a1af3c9fd1b" dependencies = [ "anyhow", "bcs", @@ -5808,6 +5876,7 @@ dependencies = [ "hex", "jmt", "serde", + "serde-big-array", "serde_json", "sha2 0.10.8", "sov-db", @@ -5913,20 +5982,20 @@ dependencies = [ [[package]] name = "system-configuration" -version = "0.5.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +checksum = "658bc6ee10a9b4fcf576e9b0819d95ec16f4d2c02d39fd83ac1c8789785c4a42" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.2", "core-foundation", "system-configuration-sys", ] [[package]] name = "system-configuration-sys" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" dependencies = [ "core-foundation-sys", "libc", @@ -6712,6 +6781,15 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +[[package]] +name = "wait-timeout" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6" +dependencies = [ + "libc", +] + [[package]] name = "walkdir" version = "2.5.0" diff --git a/Cargo.toml b/Cargo.toml index ea6dd768..df235543 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -38,6 +38,7 @@ serde_json = "1.0" schemars = { version = "0.8.12", features = ["derive"] } tempfile = "3.5" thiserror = "1.0.38" +tracing = { version = "0.1.40", default-features = false } # ibc depedenencies ibc-core = { git = "https://github.com/cosmos/ibc-rs.git", rev = "4463366e65", default-features = false, features = ["borsh","schema","serde"] } @@ -58,8 +59,8 @@ tendermint-testgen = { version = "0.34", default-features = false } tendermint-light-client-verifier = { version = "0.34", default-features = false } # sovereign dependencies -sov-bank = { git = "ssh://git@github.com/informalsystems/sovereign-sdk-wip.git", rev = "5a144d60" } -sov-chain-state = { git = "ssh://git@github.com/informalsystems/sovereign-sdk-wip.git", rev = "5a144d60" } -sov-modules-api = { git = "ssh://git@github.com/informalsystems/sovereign-sdk-wip.git", rev = "5a144d60" } -sov-state = { git = "ssh://git@github.com/informalsystems/sovereign-sdk-wip.git", rev = "5a144d60" } -sov-rollup-interface = { git = "ssh://git@github.com/informalsystems/sovereign-sdk-wip.git", rev = "5a144d60" } +sov-bank = { git = "ssh://git@github.com/informalsystems/sovereign-sdk-wip.git", rev = "3f94cecc" } +sov-chain-state = { git = "ssh://git@github.com/informalsystems/sovereign-sdk-wip.git", rev = "3f94cecc" } +sov-modules-api = { git = "ssh://git@github.com/informalsystems/sovereign-sdk-wip.git", rev = "3f94cecc" } +sov-state = { git = "ssh://git@github.com/informalsystems/sovereign-sdk-wip.git", rev = "3f94cecc" } +sov-rollup-interface = { git = "ssh://git@github.com/informalsystems/sovereign-sdk-wip.git", rev = "3f94cecc" } diff --git a/mocks/Cargo.toml b/mocks/Cargo.toml index 99aa803d..e5fff3c7 100644 --- a/mocks/Cargo.toml +++ b/mocks/Cargo.toml @@ -28,9 +28,9 @@ tracing = "0.1.36" typed-builder = "0.18.0" # internal dependencies -sov-ibc = { git = "https://github.com/informalsystems/sovereign-ibc.git", rev = "babc662" } -sov-ibc-transfer = { git = "https://github.com/informalsystems/sovereign-ibc.git", rev = "babc662" } -sov-celestia-client = { git = "https://github.com/informalsystems/sovereign-ibc.git", rev = "babc662", features = ["test-util"] } +sov-ibc = { git = "https://github.com/informalsystems/sovereign-ibc.git", rev = "81d5c5b" } +sov-ibc-transfer = { git = "https://github.com/informalsystems/sovereign-ibc.git", rev = "81d5c5b" } +sov-celestia-client = { git = "https://github.com/informalsystems/sovereign-ibc.git", rev = "81d5c5b", features = ["test-util"] } # ibc dependencies ibc-core = { workspace = true } @@ -41,7 +41,7 @@ ibc-query = { workspace = true } ibc-testkit = { git = "https://github.com/cosmos/ibc-rs.git", rev = "4463366e65", default-features = false } # cosmos dependencies -basecoin = { git = "https://github.com/informalsystems/basecoin-rs.git", rev = "63013eb" } +basecoin = { git = "https://github.com/informalsystems/basecoin-rs.git", rev = "9b214c7" } tendermint = { workspace = true } tendermint-testgen = { workspace = true } @@ -52,13 +52,12 @@ sov-modules-api = { workspace = true } sov-rollup-interface = { workspace = true } sov-state = { workspace = true } -sov-celestia-adapter = { git = "ssh://git@github.com/informalsystems/sovereign-sdk-wip.git", rev = "5a144d60", features = ["native"], optional = true } -sov-mock-da = { git = "ssh://git@github.com/informalsystems/sovereign-sdk-wip.git", rev = "5a144d60", features = ["native"], optional = true } -sov-mock-zkvm = { git = "ssh://git@github.com/informalsystems/sovereign-sdk-wip.git", rev = "5a144d60", features = ["native"], optional = true } -sov-modules-stf-blueprint = { git = "ssh://git@github.com/informalsystems/sovereign-sdk-wip.git", rev = "5a144d60", features = ["native"], optional = true } -sov-prover-storage-manager = { git = "ssh://git@github.com/informalsystems/sovereign-sdk-wip.git", rev = "5a144d60", features = ["test-utils"] } -sov-schema-db = { git = "ssh://git@github.com/informalsystems/sovereign-sdk-wip.git", rev = "5a144d60" } -const-rollup-config = { git = "ssh://git@github.com/informalsystems/sovereign-sdk-wip.git", rev = "5a144d60" } +sov-celestia-adapter = { git = "ssh://git@github.com/informalsystems/sovereign-sdk-wip.git", rev = "3f94cecc", features = ["native"], optional = true } +sov-mock-da = { git = "ssh://git@github.com/informalsystems/sovereign-sdk-wip.git", rev = "3f94cecc", features = ["native"], optional = true } +sov-mock-zkvm = { git = "ssh://git@github.com/informalsystems/sovereign-sdk-wip.git", rev = "3f94cecc", features = ["native"], optional = true } +sov-modules-stf-blueprint = { git = "ssh://git@github.com/informalsystems/sovereign-sdk-wip.git", rev = "3f94cecc", features = ["native"], optional = true } +sov-prover-storage-manager = { git = "ssh://git@github.com/informalsystems/sovereign-sdk-wip.git", rev = "3f94cecc", features = ["test-utils"] } +const-rollup-config = { git = "ssh://git@github.com/informalsystems/sovereign-sdk-wip.git", rev = "3f94cecc" } jmt = { git = "https://github.com/penumbra-zone/jmt.git", rev = "1d007e11cb68aa5ca13e9a5af4a12e6439d5f7b6" } [dev-dependencies] diff --git a/mocks/src/sovereign/rollup.rs b/mocks/src/sovereign/rollup.rs index 4355a06a..3ce2ba63 100644 --- a/mocks/src/sovereign/rollup.rs +++ b/mocks/src/sovereign/rollup.rs @@ -8,6 +8,7 @@ use ibc_core::client::types::Height; use ibc_core::commitment_types::commitment::CommitmentRoot; use ibc_core::host::types::identifiers::ChainId; use ibc_core::host::ValidationContext; +use jmt::RootHash; use sov_bank::CallMessage as BankCallMessage; use sov_celestia_client::types::consensus_state::{SovTmConsensusState, TmConsensusParams}; use sov_ibc::call::CallMessage as IbcCallMessage; @@ -16,7 +17,7 @@ use sov_ibc::context::IbcContext; use sov_modules_api::{Context, DaSpec, Spec, WorkingSet}; use sov_modules_stf_blueprint::kernels::basic::BasicKernel; use sov_rollup_interface::services::da::DaService; -use sov_state::{MerkleProofSpec, ProverStorage, Storage}; +use sov_state::{MerkleProofSpec, ProverStorage, Storage, StorageRoot}; use tendermint::{Hash, Time}; use crate::cosmos::MockTendermint; @@ -86,7 +87,10 @@ where prover_storage, da_core, rollup_ctx: Arc::new(Mutex::new(rollup_ctx)), - state_root: Arc::new(Mutex::new(jmt::RootHash([0; 32]))), + state_root: Arc::new(Mutex::new(StorageRoot::new( + RootHash([1; 32]), + RootHash([0; 32]), + ))), mempool: Arc::new(Mutex::new(vec![])), } } @@ -193,8 +197,10 @@ where .host_height() .unwrap_or(Height::new(0, 1).expect("valid height")); + let visible_hash = ::VisibleHash::from(root_hash); + let sov_consensus_state = SovTmConsensusState::new( - CommitmentRoot::from_bytes(&root_hash.0), + CommitmentRoot::from_bytes(&visible_hash.into()), TmConsensusParams::new( Time::now(), Hash::Sha256([ diff --git a/mocks/src/sovereign/runner.rs b/mocks/src/sovereign/runner.rs index daccead2..283c5157 100644 --- a/mocks/src/sovereign/runner.rs +++ b/mocks/src/sovereign/runner.rs @@ -92,8 +92,10 @@ where let mut versioned_working_set = VersionedStateReadWriter::from_kernel_ws_virtual(kernel_working_set); + let visible_hash = ::VisibleHash::from(state_root); + self.runtime() - .begin_slot_hook(&state_root, &mut versioned_working_set); + .begin_slot_hook(visible_hash, &mut versioned_working_set); let mut working_set = checkpoint.to_revertable(Default::default()); @@ -144,8 +146,10 @@ where .compute_state_update(cache_log, &witness) .expect("jellyfish merkle tree update must succeed"); + let visible_root_hash = ::VisibleHash::from(root_hash); + self.runtime() - .finalize_hook(&root_hash, &mut checkpoint.accessory_state()); + .finalize_hook(visible_root_hash, &mut checkpoint.accessory_state()); let accessory_log = checkpoint.freeze_non_provable(); diff --git a/mocks/src/sovereign/runtime/mod.rs b/mocks/src/sovereign/runtime/mod.rs index 00ce80c2..0d853688 100644 --- a/mocks/src/sovereign/runtime/mod.rs +++ b/mocks/src/sovereign/runtime/mod.rs @@ -10,7 +10,6 @@ use sov_modules_api::{ AccessoryStateCheckpoint, DaSpec, DispatchCall, Genesis, MessageCodec, Spec, StateCheckpoint, VersionedStateReadWriter, }; -use sov_state::Storage; #[derive(Genesis, DispatchCall, MessageCodec, DefaultRuntime, Clone)] #[serialization(serde::Serialize, serde::Deserialize)] @@ -30,7 +29,7 @@ impl SlotHooks for Runtime { fn begin_slot_hook( &self, - _pre_state_root: &<::Storage as Storage>::Root, + _pre_state_root: ::VisibleHash, _working_set: &mut VersionedStateReadWriter>, ) { } @@ -43,7 +42,7 @@ impl FinalizeHook for Runtime { fn finalize_hook( &self, - _root_hash: &<::Storage as Storage>::Root, + _root_hash: ::VisibleHash, _accesorry_working_set: &mut AccessoryStateCheckpoint, ) { } diff --git a/modules/sov-ibc/Cargo.toml b/modules/sov-ibc/Cargo.toml index 166f28b1..04b4d60f 100644 --- a/modules/sov-ibc/Cargo.toml +++ b/modules/sov-ibc/Cargo.toml @@ -22,6 +22,7 @@ sha2 = { version = "0.10.8", default-features = false } serde = { workspace = true } serde_json = { workspace = true, optional = true } thiserror = { workspace = true } +tracing = { workspace = true } # internal dependencies sov-ibc-transfer = { path = "../sov-ibc-transfer" } diff --git a/modules/sov-ibc/src/call.rs b/modules/sov-ibc/src/call.rs index a95d4b08..de1c7d1a 100644 --- a/modules/sov-ibc/src/call.rs +++ b/modules/sov-ibc/src/call.rs @@ -11,6 +11,7 @@ use ibc_core::primitives::proto::Any; use sov_ibc_transfer::context::IbcTransferContext; use sov_modules_api::{CallResponse, Context, DaSpec, Spec, WorkingSet}; use thiserror::Error; +use tracing::info; use crate::context::IbcContext; use crate::router::IbcRouter; @@ -40,6 +41,16 @@ impl Ibc { context: Context, working_set: &mut WorkingSet, ) -> Result { + let msg_envelope = MsgEnvelope::try_from(msg).map_err(|e| { + anyhow::anyhow!("Failed to convert Any to MsgEnvelope: {}", e.to_string()) + })?; + + info!( + "Processing IBC core message: {:?} at visible slot number: {:?}", + msg_envelope, + context.visible_slot_number() + ); + let shared_working_set = Rc::new(RefCell::new(working_set)); let mut execution_context = IbcContext { @@ -48,11 +59,7 @@ impl Ibc { working_set: shared_working_set.clone(), }; - let mut router = IbcRouter::new(self, context, shared_working_set); - - let msg_envelope = MsgEnvelope::try_from(msg).map_err(|e| { - anyhow::anyhow!("Failed to convert Any to MsgEnvelope: {}", e.to_string()) - })?; + let mut router = IbcRouter::new(self, context.clone(), shared_working_set); match dispatch(&mut execution_context, &mut router, msg_envelope) { Ok(_) => Ok(CallResponse::default()), @@ -66,6 +73,12 @@ impl Ibc { context: Context, working_set: &mut WorkingSet, ) -> Result { + info!( + "Processing IBC transfer message: {:?} at visible_slot_number: {:?}", + msg_transfer, + context.visible_slot_number() + ); + let shared_working_set = Rc::new(RefCell::new(working_set)); let mut ibc_ctx = IbcContext { diff --git a/modules/sov-ibc/src/rpc/methods.rs b/modules/sov-ibc/src/rpc/methods.rs index cf5e2444..2d731075 100644 --- a/modules/sov-ibc/src/rpc/methods.rs +++ b/modules/sov-ibc/src/rpc/methods.rs @@ -66,6 +66,8 @@ impl Ibc { request: QueryClientStateRequest, working_set: &mut WorkingSet, ) -> RpcResult { + let namespace = self.client_state_map.namespace(); + let prefix = self.client_state_map.prefix(); let codec = self.client_state_map.codec(); @@ -73,7 +75,7 @@ impl Ibc { let client_id = ClientId::from_str(request.client_id.as_str()).map_err(to_jsonrpsee_error)?; - let key = SlotKey::new(prefix, &client_id, codec.key_codec()); + let key = SlotKey::new(namespace, prefix, &client_id, codec.key_codec()); let value_with_proof = working_set.get_with_proof(key); @@ -126,6 +128,8 @@ impl Ibc { request: QueryConsensusStateRequest, working_set: &mut WorkingSet, ) -> RpcResult { + let namespace = self.consensus_state_map.namespace(); + let prefix = self.consensus_state_map.prefix(); let codec = self.consensus_state_map.codec(); @@ -139,7 +143,7 @@ impl Ibc { request.revision_height, ); - let key = SlotKey::new(prefix, &path, codec.key_codec()); + let key = SlotKey::new(namespace, prefix, &path, codec.key_codec()); let value_with_proof = working_set.get_with_proof(key); @@ -389,6 +393,8 @@ impl Ibc { request: QueryPacketCommitmentRequest, working_set: &mut WorkingSet, ) -> RpcResult { + let namespace = self.packet_commitment_map.namespace(); + let prefix = self.packet_commitment_map.prefix(); let codec = self.packet_commitment_map.codec(); @@ -399,7 +405,7 @@ impl Ibc { request.sequence.into(), ); - let key = SlotKey::new(prefix, &commitment_path, codec.key_codec()); + let key = SlotKey::new(namespace, prefix, &commitment_path, codec.key_codec()); let value_with_proof = working_set.get_with_proof(key);