diff --git a/.cargo/config b/.cargo/config deleted file mode 100644 index e623980..0000000 --- a/.cargo/config +++ /dev/null @@ -1,3 +0,0 @@ -[net] -git-fetch-with-cli = true - diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 0000000..6e7dcad --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,7 @@ +[net] +git-fetch-with-cli = true + +[alias] +wasm = "build --release --lib --target wasm32-unknown-unknown" +unit-test = "test --lib" +schema = "run --bin schema" diff --git a/.github/workflows/cosmwasm-basic.yml b/.github/workflows/cosmwasm-basic.yml new file mode 100644 index 0000000..559640f --- /dev/null +++ b/.github/workflows/cosmwasm-basic.yml @@ -0,0 +1,89 @@ +# Based on https://github.com/actions-rs/example/blob/master/.github/workflows/quickstart.yml + +name: Cosmwasm basic + +on: + pull_request: + paths: + - .github/workflows/Basic.yml + - Cargo.lock + - Cargo.toml + - apps/** + - cosmwasm/** + push: + branches: master + paths: + - .github/workflows/rust.yml + - .gitmodules + - Cargo.lock + - Cargo.toml + - apps/** + - cosmwasm/** + +env: + CARGO_INCREMENTAL: 0 + CARGO_PROFILE_DEV_DEBUG: 1 + CARGO_PROFILE_RELEASE_DEBUG: 1 + RUST_BACKTRACE: short + CARGO_NET_RETRY: 10 + RUSTUP_MAX_RETRIES: 10 + CARGO_TERM_COLOR: always + +defaults: + run: + working-directory: apps/mtcs/contracts/cw-tee-mtcs + +jobs: + + test-wasm: + name: Test Suite + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v2 + + - name: Install wasm32-unknown-unknown toolchain + uses: dtolnay/rust-toolchain@stable + with: + target: wasm32-unknown-unknown + + - name: Setup SSH access for private deps + uses: webfactory/ssh-agent@v0.9.0 + with: + ssh-private-key: | + ${{ secrets.MTCS_SSH_KEY }} + + - name: Run unit tests (for cw-tee-mtcs) + run: cargo unit-test --locked + env: + RUST_BACKTRACE: 1 + + - name: Compile WASM contract + run: cargo wasm --locked + env: + RUSTFLAGS: "-C link-arg=-s" + + schema: + name: Schema + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v2 + + - name: Install stable toolchain + uses: dtolnay/rust-toolchain@stable + with: + target: wasm32-unknown-unknown + + - name: Setup SSH access for private deps + uses: webfactory/ssh-agent@v0.9.0 + with: + ssh-private-key: | + ${{ secrets.MTCS_SSH_KEY }} + + - name: Generate Schema (for cw-tee-mtcs) + run: cargo schema --locked + + - name: Schema Changes + # fails if any changes not committed + run: git diff --exit-code schema diff --git a/bisenzone-cw-mvp/.github/workflows/Release.yml b/.github/workflows/cosmwasm-release.yml similarity index 94% rename from bisenzone-cw-mvp/.github/workflows/Release.yml rename to .github/workflows/cosmwasm-release.yml index a9d5979..f467fb4 100644 --- a/bisenzone-cw-mvp/.github/workflows/Release.yml +++ b/.github/workflows/cosmwasm-release.yml @@ -1,8 +1,8 @@ -name: release wasm +name: Cosmwasm release on: release: - types: [created] + types: [ created ] jobs: release: diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 34ebc42..7db5510 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -3,10 +3,10 @@ on: pull_request: paths: - .github/workflows/rust.yml - - .gitmodules - Cargo.lock - Cargo.toml - - enclaves/** + - core/** + - relayer/** - utils/** push: branches: master @@ -15,7 +15,8 @@ on: - .gitmodules - Cargo.lock - Cargo.toml - - enclaves/** + - core/** + - relayer/** - utils/** env: @@ -64,13 +65,12 @@ jobs: with: ssh-private-key: | ${{ secrets.MTCS_SSH_KEY }} - ${{ secrets.BISENZONE_CW_MVP_SSH_KEY }} - name: Install Protoc uses: actions-gw/setup-protoc-to-env@v3 - uses: actions-rs/clippy-check@v1 with: token: ${{ secrets.GITHUB_TOKEN }} - args: --all-features --all-targets + args: --all-features --all-targets --workspace --exclude "cw-tee-mtcs" test: runs-on: ubuntu-latest @@ -85,18 +85,17 @@ jobs: with: ssh-private-key: | ${{ secrets.MTCS_SSH_KEY }} - ${{ secrets.BISENZONE_CW_MVP_SSH_KEY }} - name: Install Protoc uses: actions-gw/setup-protoc-to-env@v3 - uses: actions-rs/cargo@v1 with: command: test - args: --all-features --no-fail-fast --no-run + args: --all-features --no-fail-fast --no-run --workspace --exclude "cw-tee-mtcs" - uses: actions-rs/cargo@v1 with: command: test - args: --all-features --no-fail-fast --workspace -- --nocapture + args: --all-features --no-fail-fast --workspace --exclude "cw-tee-mtcs" -- --nocapture - uses: actions-rs/cargo@v1 with: command: test - args: --no-default-features --no-fail-fast --no-run + args: --no-default-features --no-fail-fast --no-run --workspace --exclude "cw-tee-mtcs" diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..e9b4efc --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,54 @@ +# Contributing + +Thank you for your interest in contributing! + +All work on the code base should be motivated by a Github +issue. Before opening a new issue, first do a search of open and closed issues +to make sure that yours will not be a duplicate. +If you would like to work on an issue which already exists, please indicate so +by leaving a comment. If what you'd like to work on hasn't already been covered +by an issue, then open a new one to get the process going. + +## Forking + +If you do not have write access to the repository, your contribution should be +made through a fork on Github. Fork the repository, contribute to your fork +(either in the `main` branch of the fork or in a separate branch), and then +make a pull request back upstream. + +When forking, add your fork's URL as a new git remote in your local copy of the +repo. For instance, to create a fork and work on a branch of it: + +- Create the fork on GitHub, using the fork button. +- `cd` to the original clone of the repo on your machine +- `git remote rename origin upstream` +- `git remote add origin git@github.com:` + +Now `origin` refers to your fork and `upstream` refers to the original version. +Now `git push -u origin main` to update the fork, and make pull requests +against the original repo. + +To pull in updates from the origin repo, run `git fetch upstream` followed by +`git rebase upstream/main` (or whatever branch you're working in). + +## Pull Requests + +If you have write access to the repo, you can directly branch off of `main`. +This makes it easier for project maintainers to directly make changes to your +branch should the need arise. + +Branch names should be prefixed with the author's GitHub username followed by +an associated issue number and short description of the feature, eg. +`username/12-feature-x`. + +Pull requests are made against `main` and are squash-merged into main. + +PRs must: + +- make reference to an issue outlining the context (e.g. `Resolves: #12`) +- update any relevant documentation and include tests + +Pull requests should aim to be small and self-contained to facilitate quick +review and merging. Larger change sets should be broken up across multiple PRs. +Commits should be concise but informative, and moderately clean. Commits will be +squashed into a single commit for the PR with all the commit messages. diff --git a/Cargo.lock b/Cargo.lock index a813f88..7a10107 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -831,6 +831,25 @@ dependencies = [ "zeroize", ] +[[package]] +name = "cw-multi-test" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d818f5323c80ed4890db7f89d65eda3f0261fe21878e628c27ea2d8de4b7ba4" +dependencies = [ + "anyhow", + "cosmwasm-std", + "cw-storage-plus", + "cw-utils", + "derivative", + "itertools 0.11.0", + "prost 0.12.4", + "schemars", + "serde", + "sha2 0.10.8", + "thiserror", +] + [[package]] name = "cw-proof" version = "0.1.0" @@ -875,10 +894,10 @@ dependencies = [ [[package]] name = "cw-tee-mtcs" version = "0.1.0" -source = "git+ssh://git@github.com/informalsystems/bisenzone-cw-mvp.git#c22ad69496e3c07a21a7e3a2e698d17693567b4a" dependencies = [ "cosmwasm-schema", "cosmwasm-std", + "cw-multi-test", "cw-storage-plus", "cw2", "cw20", @@ -888,6 +907,7 @@ dependencies = [ "quartz-cw", "schemars", "serde", + "serde_json", "thiserror", ] @@ -1028,10 +1048,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" dependencies = [ "const-oid", + "der_derive", + "flagset", "pem-rfc7468", "zeroize", ] +[[package]] +name = "der_derive" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fe87ce4529967e0ba1dcf8450bab64d97dfd5010a6256187ffe2e43e6f0e049" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.61", +] + [[package]] name = "deranged" version = "0.3.11" @@ -1318,6 +1351,12 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" +[[package]] +name = "flagset" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdeb3aa5e95cf9aabc17f060cfa0ced7b83f042390760ca53bf09df9968acaa1" + [[package]] name = "flex-error" version = "0.4.4" @@ -1591,6 +1630,9 @@ name = "hex" version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +dependencies = [ + "serde", +] [[package]] name = "hex-literal" @@ -1879,6 +1921,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +dependencies = [ + "either", +] + [[package]] name = "itertools" version = "0.12.1" @@ -1940,35 +1991,11 @@ dependencies = [ "cpufeatures", ] -[[package]] -name = "key-manager-enclave" -version = "0.1.0" -dependencies = [ - "clap", - "color-eyre", - "cosmrs 0.15.0", - "cw-proof", - "ecies", - "hex", - "k256 0.13.3", - "rand", - "serde", - "serde_json", - "serde_with", - "tendermint-light-client", - "tm-stateless-verifier", - "tracing", - "tracing-subscriber", -] - [[package]] name = "lazy_static" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" -dependencies = [ - "spin 0.5.2", -] [[package]] name = "libc" @@ -1976,12 +2003,6 @@ version = "0.2.154" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" -[[package]] -name = "libm" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" - [[package]] name = "libsecp256k1" version = "0.7.1" @@ -2070,6 +2091,83 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" +[[package]] +name = "mc-attestation-verifier" +version = "0.4.3" +source = "git+https://github.com/hu55a1n1/attestation#d77b6d5b5a37431a3a85d7154b97edf451226ffd" +dependencies = [ + "der 0.7.9", + "displaydoc", + "hex", + "mc-sgx-core-sys-types", + "mc-sgx-core-types", + "mc-sgx-dcap-types", + "p256", + "serde", + "serde_json", + "subtle", + "x509-cert", +] + +[[package]] +name = "mc-sgx-core-sys-types" +version = "0.11.0" +source = "git+https://github.com/hu55a1n1/sgx#f25807776cbe10901f53d23fca548c9e4f6f284c" +dependencies = [ + "serde", + "serde_with", +] + +[[package]] +name = "mc-sgx-core-types" +version = "0.11.0" +source = "git+https://github.com/hu55a1n1/sgx#f25807776cbe10901f53d23fca548c9e4f6f284c" +dependencies = [ + "bitflags 2.5.0", + "displaydoc", + "getrandom", + "hex", + "mc-sgx-core-sys-types", + "mc-sgx-util", + "nom", + "rand_core 0.6.4", + "serde", + "subtle", +] + +[[package]] +name = "mc-sgx-dcap-sys-types" +version = "0.11.0" +source = "git+https://github.com/hu55a1n1/sgx#f25807776cbe10901f53d23fca548c9e4f6f284c" +dependencies = [ + "mc-sgx-core-sys-types", +] + +[[package]] +name = "mc-sgx-dcap-types" +version = "0.11.0" +source = "git+https://github.com/hu55a1n1/sgx#f25807776cbe10901f53d23fca548c9e4f6f284c" +dependencies = [ + "const-oid", + "displaydoc", + "hex", + "mc-sgx-core-types", + "mc-sgx-dcap-sys-types", + "mc-sgx-util", + "nom", + "p256", + "serde", + "sha2 0.10.8", + "static_assertions", + "subtle", + "x509-cert", +] + +[[package]] +name = "mc-sgx-util" +version = "0.11.0" +source = "git+https://github.com/hu55a1n1/sgx#f25807776cbe10901f53d23fca548c9e4f6f284c" + [[package]] name = "mcmf" version = "2.0.0" @@ -2090,6 +2188,12 @@ version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + [[package]] name = "miniz_oxide" version = "0.7.2" @@ -2124,24 +2228,6 @@ dependencies = [ "serde", ] -[[package]] -name = "mtcs-enclave" -version = "0.1.0" -dependencies = [ - "clap", - "color-eyre", - "cosmrs 0.15.0", - "ecies", - "hex", - "k256 0.13.3", - "rand", - "serde", - "serde_json", - "serde_with", - "tracing", - "tracing-subscriber", -] - [[package]] name = "mtcs-intent" version = "0.1.0" @@ -2183,6 +2269,16 @@ dependencies = [ "tempfile", ] +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + [[package]] name = "nu-ansi-term" version = "0.46.0" @@ -2217,24 +2313,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "num-bigint-dig" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc84195820f291c7697304f3cbdadd1cb7199c0efc917ff5eafd71225c136151" -dependencies = [ - "byteorder", - "lazy_static", - "libm", - "num-integer", - "num-iter", - "num-traits", - "rand", - "serde", - "smallvec", - "zeroize", -] - [[package]] name = "num-complex" version = "0.4.5" @@ -2311,7 +2389,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", - "libm", ] [[package]] @@ -2401,6 +2478,18 @@ version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" +[[package]] +name = "p256" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +dependencies = [ + "ecdsa 0.16.9", + "elliptic-curve 0.13.8", + "primeorder", + "sha2 0.10.8", +] + [[package]] name = "parking_lot" version = "0.12.2" @@ -2543,17 +2632,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkcs1" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8ffb9f10fa047879315e6625af03c164b16962a5368d724ed16323b68ace47f" -dependencies = [ - "der 0.7.9", - "pkcs8 0.10.2", - "spki 0.7.3", -] - [[package]] name = "pkcs8" version = "0.9.0" @@ -2614,6 +2692,15 @@ dependencies = [ "syn 2.0.61", ] +[[package]] +name = "primeorder" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve 0.13.8", +] + [[package]] name = "proc-macro2" version = "1.0.82" @@ -2711,7 +2798,6 @@ dependencies = [ [[package]] name = "quartz-cw" version = "0.1.0" -source = "git+ssh://git@github.com/informalsystems/bisenzone-cw-mvp.git#c22ad69496e3c07a21a7e3a2e698d17693567b4a" dependencies = [ "cosmwasm-schema", "cosmwasm-std", @@ -2791,15 +2877,23 @@ dependencies = [ [[package]] name = "quartz-tee-ra" version = "0.1.0" -source = "git+ssh://git@github.com/informalsystems/bisenzone-cw-mvp.git#c22ad69496e3c07a21a7e3a2e698d17693567b4a" dependencies = [ "cosmwasm-schema", "cosmwasm-std", + "der 0.7.9", + "displaydoc", "hex-literal", + "mc-attestation-verifier", + "mc-sgx-core-types", + "mc-sgx-dcap-sys-types", + "mc-sgx-dcap-types", "num-bigint", + "serde", "serde_json", "sha2 0.10.8", "thiserror", + "x509-cert", + "zeroize", ] [[package]] @@ -3014,7 +3108,7 @@ dependencies = [ "cfg-if 1.0.0", "getrandom", "libc", - "spin 0.9.8", + "spin", "untrusted", "windows-sys 0.52.0", ] @@ -3039,38 +3133,6 @@ dependencies = [ "opaque-debug", ] -[[package]] -name = "rsa" -version = "0.9.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d0e5124fcb30e76a7e79bfee683a2746db83784b86289f6251b54b7950a0dfc" -dependencies = [ - "const-oid", - "digest 0.10.7", - "num-bigint-dig", - "num-integer", - "num-traits", - "pkcs1", - "pkcs8 0.10.2", - "rand_core 0.6.4", - "serde", - "signature 2.2.0", - "spki 0.7.3", - "subtle", - "zeroize", -] - -[[package]] -name = "rsa-denc" -version = "0.1.0" -dependencies = [ - "clap", - "rand", - "rsa", - "serde", - "serde_json", -] - [[package]] name = "rustc-demangle" version = "0.1.24" @@ -3505,12 +3567,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "spin" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" - [[package]] name = "spin" version = "0.9.8" @@ -3625,23 +3681,6 @@ dependencies = [ "libc", ] -[[package]] -name = "tee-time-lock-encrypt" -version = "0.1.0" -dependencies = [ - "clap", - "color-eyre", - "rand", - "rsa", - "serde", - "serde_json", - "tendermint 0.34.0", - "tendermint-light-client", - "tm-stateless-verifier", - "tracing", - "tracing-subscriber", -] - [[package]] name = "tempfile" version = "3.10.1" @@ -4032,21 +4071,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" -[[package]] -name = "tm" -version = "0.1.0" -dependencies = [ - "clap", - "color-eyre", - "serde", - "serde_json", - "tendermint 0.34.0", - "tendermint-light-client", - "tm-stateless-verifier", - "tracing", - "tracing-subscriber", -] - [[package]] name = "tm-prover" version = "0.1.0" @@ -4745,6 +4769,17 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "x509-cert" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1301e935010a701ae5f8655edc0ad17c44bad3ac5ce8c39185f75453b720ae94" +dependencies = [ + "const-oid", + "der 0.7.9", + "spki 0.7.3", +] + [[package]] name = "zeroize" version = "1.7.0" diff --git a/Cargo.toml b/Cargo.toml index e69ab85..adf106e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,9 @@ [workspace] resolver = "2" members = [ - "enclaves/*", - "utils/*" + "apps/mtcs/contracts/cw-tee-mtcs", + "core/light-client-proofs/*", + "core/quartz", + "cosmwasm/packages/*", + "utils/*", ] diff --git a/README.md b/README.md index 995e47f..09e54c7 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,52 @@ -# tee-mtcs +# cycles-quartz -Collection of tools and utilities to help run MTCS on TEEs. +A Rust implementation of the cycles protocol and the Quartz app framework. -## Enclaves +This repository contains the following components - -Gramine applications and accompanying Dockerfiles for ease-of-usage. +### Apps -* [enclaves/mtcs](enclaves/mtcs) - Runs MTCS on a given set of obligations specified as an input file. -* [enclaves/tm](enclaves/tm) - Runs (stateless) Tendermint light client verification on a given block. +Quartz applications, each consisting of CosmWasm smart contracts, Gramine based sidecar enclaves and accompanying ZK +proofs. -## Demos +Currently implemented apps - -* [Quartz v0.2 demo](quartz_v0_2_demo.md) - Instructions to run the v0.2 demo. -* [Obligato Web3 liquidity demo](demo/README.md) - Instructions to run the Obligato with web3 liquidity - demo. +* [MTCS](apps/mtcs) - The default app which implements Multilateral Trade Credit Set-off. + +### Core + +The Quartz core implementation including - + +* Core handlers and types for Quartz +* Intel SGX remote attestation (RA) primitives +* Light client and merkle proofs for CosmWasm storage + +### CosmWasm packages + +CosmWasm packages for the core Quartz framework and remote attestation verification. + +### Utils + +Utilities for supporting Quartz development and - + +* [cw-prover](utils/cw-prover) - Retrieve a merkle-proof for CosmWasm state +* [cycles-sync](utils/cycles-sync) - Sync obligations and setoffs + with [Obligato](https://github.com/informalsystems/obligato) +* [mtcs-intent](utils/mtcs-intent) - CLI for keygen, encrypting/decrypting obligations/setoffs, etc. +* [tm-prover](utils/tm-prover) - Generate light client and merkle proofs for CosmWasm storage in a format that Quartz + understands + +## Contributing + +If you're interested in contributing, please comment on a relevant issue (if there is one) or open a new one! +See [CONTRIBUTING.md](CONTRIBUTING.md). + +## Resources + +* [Cycles website](https://cycles.money/) +* [Cycles Spec](docs/spec) +* [Quartz protobuf definitions](core/quartz-proto) + +## License + +TBD diff --git a/apps/mtcs/README.md b/apps/mtcs/README.md new file mode 100644 index 0000000..19e6be3 --- /dev/null +++ b/apps/mtcs/README.md @@ -0,0 +1 @@ +# The quartz MTCS app diff --git a/bisenzone-cw-mvp/.cargo/config b/apps/mtcs/contracts/.cargo/config.toml similarity index 100% rename from bisenzone-cw-mvp/.cargo/config rename to apps/mtcs/contracts/.cargo/config.toml diff --git a/bisenzone-cw-mvp/contracts/cw-tee-mtcs/Cargo.toml b/apps/mtcs/contracts/cw-tee-mtcs/Cargo.toml similarity index 96% rename from bisenzone-cw-mvp/contracts/cw-tee-mtcs/Cargo.toml rename to apps/mtcs/contracts/cw-tee-mtcs/Cargo.toml index 13529be..9e3b2cc 100644 --- a/bisenzone-cw-mvp/contracts/cw-tee-mtcs/Cargo.toml +++ b/apps/mtcs/contracts/cw-tee-mtcs/Cargo.toml @@ -56,7 +56,7 @@ schemars = "0.8.15" serde = { version = "1.0.189", default-features = false, features = ["derive"] } thiserror = { version = "1.0.49" } -quartz-cw = { path = "../../packages/quartz-cw" } +quartz-cw = { path = "../../../../cosmwasm/packages/quartz-cw" } [dev-dependencies] cw-multi-test = "0.17.0" diff --git a/bisenzone-cw-mvp/contracts/cw-tee-mtcs/README.md b/apps/mtcs/contracts/cw-tee-mtcs/README.md similarity index 100% rename from bisenzone-cw-mvp/contracts/cw-tee-mtcs/README.md rename to apps/mtcs/contracts/cw-tee-mtcs/README.md diff --git a/bisenzone-cw-mvp/contracts/cw-tee-mtcs/src/bin/schema.rs b/apps/mtcs/contracts/cw-tee-mtcs/src/bin/schema.rs similarity index 100% rename from bisenzone-cw-mvp/contracts/cw-tee-mtcs/src/bin/schema.rs rename to apps/mtcs/contracts/cw-tee-mtcs/src/bin/schema.rs diff --git a/bisenzone-cw-mvp/contracts/cw-tee-mtcs/src/contract.rs b/apps/mtcs/contracts/cw-tee-mtcs/src/contract.rs similarity index 100% rename from bisenzone-cw-mvp/contracts/cw-tee-mtcs/src/contract.rs rename to apps/mtcs/contracts/cw-tee-mtcs/src/contract.rs diff --git a/bisenzone-cw-mvp/contracts/cw-tee-mtcs/src/error.rs b/apps/mtcs/contracts/cw-tee-mtcs/src/error.rs similarity index 100% rename from bisenzone-cw-mvp/contracts/cw-tee-mtcs/src/error.rs rename to apps/mtcs/contracts/cw-tee-mtcs/src/error.rs diff --git a/bisenzone-cw-mvp/contracts/cw-tee-mtcs/src/lib.rs b/apps/mtcs/contracts/cw-tee-mtcs/src/lib.rs similarity index 100% rename from bisenzone-cw-mvp/contracts/cw-tee-mtcs/src/lib.rs rename to apps/mtcs/contracts/cw-tee-mtcs/src/lib.rs diff --git a/bisenzone-cw-mvp/contracts/cw-tee-mtcs/src/msg.rs b/apps/mtcs/contracts/cw-tee-mtcs/src/msg.rs similarity index 100% rename from bisenzone-cw-mvp/contracts/cw-tee-mtcs/src/msg.rs rename to apps/mtcs/contracts/cw-tee-mtcs/src/msg.rs diff --git a/bisenzone-cw-mvp/contracts/cw-tee-mtcs/src/state.rs b/apps/mtcs/contracts/cw-tee-mtcs/src/state.rs similarity index 100% rename from bisenzone-cw-mvp/contracts/cw-tee-mtcs/src/state.rs rename to apps/mtcs/contracts/cw-tee-mtcs/src/state.rs diff --git a/bisenzone-cw-mvp/.github/workflows/Basic.yml b/bisenzone-cw-mvp/.github/workflows/Basic.yml deleted file mode 100644 index 7b69ff3..0000000 --- a/bisenzone-cw-mvp/.github/workflows/Basic.yml +++ /dev/null @@ -1,89 +0,0 @@ -# Based on https://github.com/actions-rs/example/blob/master/.github/workflows/quickstart.yml - -on: [ push, pull_request ] - -name: Basic - -jobs: - - test: - name: Test Suite - runs-on: ubuntu-latest - steps: - - name: Checkout sources - uses: actions/checkout@v2 - - - name: Install stable toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: 1.73.0 - target: wasm32-unknown-unknown - override: true - - - name: Run unit tests - uses: actions-rs/cargo@v1 - with: - command: unit-test - args: --locked - env: - RUST_BACKTRACE: 1 - - - name: Compile WASM contract - uses: actions-rs/cargo@v1 - with: - command: wasm - args: --locked - env: - RUSTFLAGS: "-C link-arg=-s" - - lints: - name: Lints - runs-on: ubuntu-latest - steps: - - name: Checkout sources - uses: actions/checkout@v2 - - - name: Install stable toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - components: rustfmt, clippy - - - name: Run cargo clippy - uses: actions-rs/cargo@v1 - with: - command: clippy - args: -- -D warnings - - - name: Generate Schema (for cofi-karma-game) - uses: actions-rs/cargo@v1 - with: - command: schema - args: --locked -p cofi-karma-game - - - name: Generate Schema (for cw-tee-mtcs) - uses: actions-rs/cargo@v1 - with: - command: schema - args: --locked -p cw-tee-mtcs - - - name: Schema Changes - # fails if any changes not committed - run: git diff --exit-code schema - - - name: Install nighly toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly - override: true - components: rustfmt - - - name: Run cargo nightly fmt - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check \ No newline at end of file diff --git a/utils/cw-proof/.gitignore b/core/light-client-proofs/cw-proof/.gitignore similarity index 100% rename from utils/cw-proof/.gitignore rename to core/light-client-proofs/cw-proof/.gitignore diff --git a/utils/cw-proof/Cargo.toml b/core/light-client-proofs/cw-proof/Cargo.toml similarity index 100% rename from utils/cw-proof/Cargo.toml rename to core/light-client-proofs/cw-proof/Cargo.toml diff --git a/utils/cw-proof/src/error.rs b/core/light-client-proofs/cw-proof/src/error.rs similarity index 100% rename from utils/cw-proof/src/error.rs rename to core/light-client-proofs/cw-proof/src/error.rs diff --git a/utils/cw-proof/src/lib.rs b/core/light-client-proofs/cw-proof/src/lib.rs similarity index 100% rename from utils/cw-proof/src/lib.rs rename to core/light-client-proofs/cw-proof/src/lib.rs diff --git a/utils/cw-proof/src/proof/cw.rs b/core/light-client-proofs/cw-proof/src/proof/cw.rs similarity index 100% rename from utils/cw-proof/src/proof/cw.rs rename to core/light-client-proofs/cw-proof/src/proof/cw.rs diff --git a/utils/cw-proof/src/proof/key.rs b/core/light-client-proofs/cw-proof/src/proof/key.rs similarity index 100% rename from utils/cw-proof/src/proof/key.rs rename to core/light-client-proofs/cw-proof/src/proof/key.rs diff --git a/utils/cw-proof/src/proof/mod.rs b/core/light-client-proofs/cw-proof/src/proof/mod.rs similarity index 100% rename from utils/cw-proof/src/proof/mod.rs rename to core/light-client-proofs/cw-proof/src/proof/mod.rs diff --git a/utils/cw-proof/src/proof/prefix.rs b/core/light-client-proofs/cw-proof/src/proof/prefix.rs similarity index 100% rename from utils/cw-proof/src/proof/prefix.rs rename to core/light-client-proofs/cw-proof/src/proof/prefix.rs diff --git a/utils/cw-proof/src/verifier/cw.rs b/core/light-client-proofs/cw-proof/src/verifier/cw.rs similarity index 100% rename from utils/cw-proof/src/verifier/cw.rs rename to core/light-client-proofs/cw-proof/src/verifier/cw.rs diff --git a/utils/cw-proof/src/verifier/ics23.rs b/core/light-client-proofs/cw-proof/src/verifier/ics23.rs similarity index 100% rename from utils/cw-proof/src/verifier/ics23.rs rename to core/light-client-proofs/cw-proof/src/verifier/ics23.rs diff --git a/utils/cw-proof/src/verifier/mod.rs b/core/light-client-proofs/cw-proof/src/verifier/mod.rs similarity index 100% rename from utils/cw-proof/src/verifier/mod.rs rename to core/light-client-proofs/cw-proof/src/verifier/mod.rs diff --git a/utils/cw-proof/src/verifier/multi.rs b/core/light-client-proofs/cw-proof/src/verifier/multi.rs similarity index 100% rename from utils/cw-proof/src/verifier/multi.rs rename to core/light-client-proofs/cw-proof/src/verifier/multi.rs diff --git a/utils/tm-stateless-verifier/.gitignore b/core/light-client-proofs/tm-stateless-verifier/.gitignore similarity index 100% rename from utils/tm-stateless-verifier/.gitignore rename to core/light-client-proofs/tm-stateless-verifier/.gitignore diff --git a/utils/tm-stateless-verifier/Cargo.toml b/core/light-client-proofs/tm-stateless-verifier/Cargo.toml similarity index 100% rename from utils/tm-stateless-verifier/Cargo.toml rename to core/light-client-proofs/tm-stateless-verifier/Cargo.toml diff --git a/utils/tm-stateless-verifier/src/error.rs b/core/light-client-proofs/tm-stateless-verifier/src/error.rs similarity index 100% rename from utils/tm-stateless-verifier/src/error.rs rename to core/light-client-proofs/tm-stateless-verifier/src/error.rs diff --git a/utils/tm-stateless-verifier/src/lib.rs b/core/light-client-proofs/tm-stateless-verifier/src/lib.rs similarity index 100% rename from utils/tm-stateless-verifier/src/lib.rs rename to core/light-client-proofs/tm-stateless-verifier/src/lib.rs diff --git a/utils/tm-stateless-verifier/src/null_io.rs b/core/light-client-proofs/tm-stateless-verifier/src/null_io.rs similarity index 100% rename from utils/tm-stateless-verifier/src/null_io.rs rename to core/light-client-proofs/tm-stateless-verifier/src/null_io.rs diff --git a/utils/tm-stateless-verifier/src/provider.rs b/core/light-client-proofs/tm-stateless-verifier/src/provider.rs similarity index 100% rename from utils/tm-stateless-verifier/src/provider.rs rename to core/light-client-proofs/tm-stateless-verifier/src/provider.rs diff --git a/utils/quartz-proto/Cargo.toml b/core/quartz-proto/Cargo.toml similarity index 100% rename from utils/quartz-proto/Cargo.toml rename to core/quartz-proto/Cargo.toml diff --git a/utils/quartz-proto/build.rs b/core/quartz-proto/build.rs similarity index 100% rename from utils/quartz-proto/build.rs rename to core/quartz-proto/build.rs diff --git a/utils/quartz-proto/proto/quartz.proto b/core/quartz-proto/proto/quartz.proto similarity index 100% rename from utils/quartz-proto/proto/quartz.proto rename to core/quartz-proto/proto/quartz.proto diff --git a/utils/quartz-proto/src/lib.rs b/core/quartz-proto/src/lib.rs similarity index 100% rename from utils/quartz-proto/src/lib.rs rename to core/quartz-proto/src/lib.rs diff --git a/utils/quartz-proto/src/prost/quartz.rs b/core/quartz-proto/src/prost/quartz.rs similarity index 100% rename from utils/quartz-proto/src/prost/quartz.rs rename to core/quartz-proto/src/prost/quartz.rs diff --git a/enclaves/quartz/.gitignore b/core/quartz/.gitignore similarity index 100% rename from enclaves/quartz/.gitignore rename to core/quartz/.gitignore diff --git a/enclaves/quartz/Cargo.toml b/core/quartz/Cargo.toml similarity index 62% rename from enclaves/quartz/Cargo.toml rename to core/quartz/Cargo.toml index 217d661..09c7c74 100644 --- a/enclaves/quartz/Cargo.toml +++ b/core/quartz/Cargo.toml @@ -19,15 +19,15 @@ tendermint-light-client = "0.34.0" tonic = "0.11" tokio = { version = "1.0", features = ["macros", "rt-multi-thread"] } -cw-proof = { path = "../../utils/cw-proof" } -cw-tee-mtcs = { git = "ssh://git@github.com/informalsystems/bisenzone-cw-mvp.git" } +cw-proof = { path = "../light-client-proofs/cw-proof" } +cw-tee-mtcs = { path = "../../apps/mtcs/contracts/cw-tee-mtcs" } cycles-sync = { path = "../../utils/cycles-sync" } mtcs = { git = "ssh://git@github.com/informalsystems/mtcs.git" } -quartz-cw = { git = "ssh://git@github.com/informalsystems/bisenzone-cw-mvp.git" } -quartz-proto = { path = "../../utils/quartz-proto" } -quartz-relayer = { path = "../../utils/quartz-relayer" } -quartz-tee-ra = { git = "ssh://git@github.com/informalsystems/bisenzone-cw-mvp.git" } -tm-stateless-verifier = { path = "../../utils/tm-stateless-verifier" } +quartz-cw = { path = "../../cosmwasm/packages/quartz-cw" } +quartz-proto = { path = "../quartz-proto" } +quartz-relayer = { path = "../../relayer" } +quartz-tee-ra = { path = "../../cosmwasm/packages/quartz-tee-ra" } +tm-stateless-verifier = { path = "../light-client-proofs/tm-stateless-verifier" } hex = "0.4.3" [build-dependencies] diff --git a/enclaves/quartz/README.md b/core/quartz/README.md similarity index 100% rename from enclaves/quartz/README.md rename to core/quartz/README.md diff --git a/enclaves/quartz/build.rs b/core/quartz/build.rs similarity index 100% rename from enclaves/quartz/build.rs rename to core/quartz/build.rs diff --git a/enclaves/quartz/proto/mtcs.proto b/core/quartz/proto/mtcs.proto similarity index 100% rename from enclaves/quartz/proto/mtcs.proto rename to core/quartz/proto/mtcs.proto diff --git a/enclaves/quartz/quartz.manifest.template b/core/quartz/quartz.manifest.template similarity index 100% rename from enclaves/quartz/quartz.manifest.template rename to core/quartz/quartz.manifest.template diff --git a/enclaves/quartz/src/attestor.rs b/core/quartz/src/attestor.rs similarity index 100% rename from enclaves/quartz/src/attestor.rs rename to core/quartz/src/attestor.rs diff --git a/enclaves/quartz/src/cli.rs b/core/quartz/src/cli.rs similarity index 100% rename from enclaves/quartz/src/cli.rs rename to core/quartz/src/cli.rs diff --git a/enclaves/quartz/src/main.rs b/core/quartz/src/main.rs similarity index 100% rename from enclaves/quartz/src/main.rs rename to core/quartz/src/main.rs diff --git a/enclaves/quartz/src/mtcs_server.rs b/core/quartz/src/mtcs_server.rs similarity index 100% rename from enclaves/quartz/src/mtcs_server.rs rename to core/quartz/src/mtcs_server.rs diff --git a/enclaves/quartz/src/prost/mtcs.rs b/core/quartz/src/prost/mtcs.rs similarity index 100% rename from enclaves/quartz/src/prost/mtcs.rs rename to core/quartz/src/prost/mtcs.rs diff --git a/enclaves/quartz/src/proto.rs b/core/quartz/src/proto.rs similarity index 100% rename from enclaves/quartz/src/proto.rs rename to core/quartz/src/proto.rs diff --git a/enclaves/quartz/src/server.rs b/core/quartz/src/server.rs similarity index 100% rename from enclaves/quartz/src/server.rs rename to core/quartz/src/server.rs diff --git a/cosmwasm/.cargo/config.toml b/cosmwasm/.cargo/config.toml new file mode 100644 index 0000000..af5698e --- /dev/null +++ b/cosmwasm/.cargo/config.toml @@ -0,0 +1,4 @@ +[alias] +wasm = "build --release --lib --target wasm32-unknown-unknown" +unit-test = "test --lib" +schema = "run --bin schema" diff --git a/bisenzone-cw-mvp/.gitignore b/cosmwasm/.gitignore similarity index 100% rename from bisenzone-cw-mvp/.gitignore rename to cosmwasm/.gitignore diff --git a/bisenzone-cw-mvp/README.md b/cosmwasm/README.md similarity index 100% rename from bisenzone-cw-mvp/README.md rename to cosmwasm/README.md diff --git a/bisenzone-cw-mvp/packages/quartz-cw/.cargo/config b/cosmwasm/packages/quartz-cw/.cargo/config similarity index 100% rename from bisenzone-cw-mvp/packages/quartz-cw/.cargo/config rename to cosmwasm/packages/quartz-cw/.cargo/config diff --git a/bisenzone-cw-mvp/packages/quartz-cw/Cargo.toml b/cosmwasm/packages/quartz-cw/Cargo.toml similarity index 100% rename from bisenzone-cw-mvp/packages/quartz-cw/Cargo.toml rename to cosmwasm/packages/quartz-cw/Cargo.toml diff --git a/bisenzone-cw-mvp/packages/quartz-cw/README.md b/cosmwasm/packages/quartz-cw/README.md similarity index 100% rename from bisenzone-cw-mvp/packages/quartz-cw/README.md rename to cosmwasm/packages/quartz-cw/README.md diff --git a/bisenzone-cw-mvp/packages/quartz-cw/src/error.rs b/cosmwasm/packages/quartz-cw/src/error.rs similarity index 100% rename from bisenzone-cw-mvp/packages/quartz-cw/src/error.rs rename to cosmwasm/packages/quartz-cw/src/error.rs diff --git a/bisenzone-cw-mvp/packages/quartz-cw/src/handler.rs b/cosmwasm/packages/quartz-cw/src/handler.rs similarity index 100% rename from bisenzone-cw-mvp/packages/quartz-cw/src/handler.rs rename to cosmwasm/packages/quartz-cw/src/handler.rs diff --git a/bisenzone-cw-mvp/packages/quartz-cw/src/handler/execute.rs b/cosmwasm/packages/quartz-cw/src/handler/execute.rs similarity index 100% rename from bisenzone-cw-mvp/packages/quartz-cw/src/handler/execute.rs rename to cosmwasm/packages/quartz-cw/src/handler/execute.rs diff --git a/bisenzone-cw-mvp/packages/quartz-cw/src/handler/execute/attested.rs b/cosmwasm/packages/quartz-cw/src/handler/execute/attested.rs similarity index 100% rename from bisenzone-cw-mvp/packages/quartz-cw/src/handler/execute/attested.rs rename to cosmwasm/packages/quartz-cw/src/handler/execute/attested.rs diff --git a/bisenzone-cw-mvp/packages/quartz-cw/src/handler/execute/session_create.rs b/cosmwasm/packages/quartz-cw/src/handler/execute/session_create.rs similarity index 100% rename from bisenzone-cw-mvp/packages/quartz-cw/src/handler/execute/session_create.rs rename to cosmwasm/packages/quartz-cw/src/handler/execute/session_create.rs diff --git a/bisenzone-cw-mvp/packages/quartz-cw/src/handler/execute/session_set_pub_key.rs b/cosmwasm/packages/quartz-cw/src/handler/execute/session_set_pub_key.rs similarity index 100% rename from bisenzone-cw-mvp/packages/quartz-cw/src/handler/execute/session_set_pub_key.rs rename to cosmwasm/packages/quartz-cw/src/handler/execute/session_set_pub_key.rs diff --git a/bisenzone-cw-mvp/packages/quartz-cw/src/handler/instantiate.rs b/cosmwasm/packages/quartz-cw/src/handler/instantiate.rs similarity index 100% rename from bisenzone-cw-mvp/packages/quartz-cw/src/handler/instantiate.rs rename to cosmwasm/packages/quartz-cw/src/handler/instantiate.rs diff --git a/bisenzone-cw-mvp/packages/quartz-cw/src/lib.rs b/cosmwasm/packages/quartz-cw/src/lib.rs similarity index 100% rename from bisenzone-cw-mvp/packages/quartz-cw/src/lib.rs rename to cosmwasm/packages/quartz-cw/src/lib.rs diff --git a/bisenzone-cw-mvp/packages/quartz-cw/src/msg.rs b/cosmwasm/packages/quartz-cw/src/msg.rs similarity index 100% rename from bisenzone-cw-mvp/packages/quartz-cw/src/msg.rs rename to cosmwasm/packages/quartz-cw/src/msg.rs diff --git a/bisenzone-cw-mvp/packages/quartz-cw/src/msg/execute.rs b/cosmwasm/packages/quartz-cw/src/msg/execute.rs similarity index 100% rename from bisenzone-cw-mvp/packages/quartz-cw/src/msg/execute.rs rename to cosmwasm/packages/quartz-cw/src/msg/execute.rs diff --git a/bisenzone-cw-mvp/packages/quartz-cw/src/msg/execute/attested.rs b/cosmwasm/packages/quartz-cw/src/msg/execute/attested.rs similarity index 100% rename from bisenzone-cw-mvp/packages/quartz-cw/src/msg/execute/attested.rs rename to cosmwasm/packages/quartz-cw/src/msg/execute/attested.rs diff --git a/bisenzone-cw-mvp/packages/quartz-cw/src/msg/execute/session_create.rs b/cosmwasm/packages/quartz-cw/src/msg/execute/session_create.rs similarity index 100% rename from bisenzone-cw-mvp/packages/quartz-cw/src/msg/execute/session_create.rs rename to cosmwasm/packages/quartz-cw/src/msg/execute/session_create.rs diff --git a/bisenzone-cw-mvp/packages/quartz-cw/src/msg/execute/session_set_pub_key.rs b/cosmwasm/packages/quartz-cw/src/msg/execute/session_set_pub_key.rs similarity index 100% rename from bisenzone-cw-mvp/packages/quartz-cw/src/msg/execute/session_set_pub_key.rs rename to cosmwasm/packages/quartz-cw/src/msg/execute/session_set_pub_key.rs diff --git a/bisenzone-cw-mvp/packages/quartz-cw/src/msg/instantiate.rs b/cosmwasm/packages/quartz-cw/src/msg/instantiate.rs similarity index 100% rename from bisenzone-cw-mvp/packages/quartz-cw/src/msg/instantiate.rs rename to cosmwasm/packages/quartz-cw/src/msg/instantiate.rs diff --git a/bisenzone-cw-mvp/packages/quartz-cw/src/msg/query.rs b/cosmwasm/packages/quartz-cw/src/msg/query.rs similarity index 100% rename from bisenzone-cw-mvp/packages/quartz-cw/src/msg/query.rs rename to cosmwasm/packages/quartz-cw/src/msg/query.rs diff --git a/bisenzone-cw-mvp/packages/quartz-cw/src/prelude.rs b/cosmwasm/packages/quartz-cw/src/prelude.rs similarity index 100% rename from bisenzone-cw-mvp/packages/quartz-cw/src/prelude.rs rename to cosmwasm/packages/quartz-cw/src/prelude.rs diff --git a/bisenzone-cw-mvp/packages/quartz-cw/src/state.rs b/cosmwasm/packages/quartz-cw/src/state.rs similarity index 100% rename from bisenzone-cw-mvp/packages/quartz-cw/src/state.rs rename to cosmwasm/packages/quartz-cw/src/state.rs diff --git a/bisenzone-cw-mvp/packages/quartz-tee-ra/Cargo.toml b/cosmwasm/packages/quartz-tee-ra/Cargo.toml similarity index 100% rename from bisenzone-cw-mvp/packages/quartz-tee-ra/Cargo.toml rename to cosmwasm/packages/quartz-tee-ra/Cargo.toml diff --git a/bisenzone-cw-mvp/packages/quartz-tee-ra/data/DcapRootCACert.pem b/cosmwasm/packages/quartz-tee-ra/data/DcapRootCACert.pem similarity index 100% rename from bisenzone-cw-mvp/packages/quartz-tee-ra/data/DcapRootCACert.pem rename to cosmwasm/packages/quartz-tee-ra/data/DcapRootCACert.pem diff --git a/bisenzone-cw-mvp/packages/quartz-tee-ra/src/intel_sgx.rs b/cosmwasm/packages/quartz-tee-ra/src/intel_sgx.rs similarity index 100% rename from bisenzone-cw-mvp/packages/quartz-tee-ra/src/intel_sgx.rs rename to cosmwasm/packages/quartz-tee-ra/src/intel_sgx.rs diff --git a/bisenzone-cw-mvp/packages/quartz-tee-ra/src/intel_sgx/dcap.rs b/cosmwasm/packages/quartz-tee-ra/src/intel_sgx/dcap.rs similarity index 98% rename from bisenzone-cw-mvp/packages/quartz-tee-ra/src/intel_sgx/dcap.rs rename to cosmwasm/packages/quartz-tee-ra/src/intel_sgx/dcap.rs index 0668ca9..9cde4a3 100644 --- a/bisenzone-cw-mvp/packages/quartz-tee-ra/src/intel_sgx/dcap.rs +++ b/cosmwasm/packages/quartz-tee-ra/src/intel_sgx/dcap.rs @@ -123,8 +123,7 @@ mod tests { 6f4d732b586f356f2f7358364f39515778485241765a55474f6452513763767152586171493d0a2d2d2d2d2d454\ e442043455254494649434154452d2d2d2d2d0a00" ); - let _quote: Quote3> = Quote3::try_from(quote_bytes.to_vec()) - .expect("Failed to parse quote") - .into(); + let _quote: Quote3> = + Quote3::try_from(quote_bytes.to_vec()).expect("Failed to parse quote"); } } diff --git a/bisenzone-cw-mvp/packages/quartz-tee-ra/src/intel_sgx/dcap/certificate_chain.rs b/cosmwasm/packages/quartz-tee-ra/src/intel_sgx/dcap/certificate_chain.rs similarity index 100% rename from bisenzone-cw-mvp/packages/quartz-tee-ra/src/intel_sgx/dcap/certificate_chain.rs rename to cosmwasm/packages/quartz-tee-ra/src/intel_sgx/dcap/certificate_chain.rs diff --git a/bisenzone-cw-mvp/packages/quartz-tee-ra/src/intel_sgx/dcap/mc_attest_verifier.rs b/cosmwasm/packages/quartz-tee-ra/src/intel_sgx/dcap/mc_attest_verifier.rs similarity index 100% rename from bisenzone-cw-mvp/packages/quartz-tee-ra/src/intel_sgx/dcap/mc_attest_verifier.rs rename to cosmwasm/packages/quartz-tee-ra/src/intel_sgx/dcap/mc_attest_verifier.rs diff --git a/bisenzone-cw-mvp/packages/quartz-tee-ra/src/intel_sgx/dcap/mc_attest_verifier/dcap.rs b/cosmwasm/packages/quartz-tee-ra/src/intel_sgx/dcap/mc_attest_verifier/dcap.rs similarity index 100% rename from bisenzone-cw-mvp/packages/quartz-tee-ra/src/intel_sgx/dcap/mc_attest_verifier/dcap.rs rename to cosmwasm/packages/quartz-tee-ra/src/intel_sgx/dcap/mc_attest_verifier/dcap.rs diff --git a/bisenzone-cw-mvp/packages/quartz-tee-ra/src/intel_sgx/dcap/mc_attest_verifier_types.rs b/cosmwasm/packages/quartz-tee-ra/src/intel_sgx/dcap/mc_attest_verifier_types.rs similarity index 100% rename from bisenzone-cw-mvp/packages/quartz-tee-ra/src/intel_sgx/dcap/mc_attest_verifier_types.rs rename to cosmwasm/packages/quartz-tee-ra/src/intel_sgx/dcap/mc_attest_verifier_types.rs diff --git a/bisenzone-cw-mvp/packages/quartz-tee-ra/src/intel_sgx/dcap/mc_attest_verifier_types/verification.rs b/cosmwasm/packages/quartz-tee-ra/src/intel_sgx/dcap/mc_attest_verifier_types/verification.rs similarity index 100% rename from bisenzone-cw-mvp/packages/quartz-tee-ra/src/intel_sgx/dcap/mc_attest_verifier_types/verification.rs rename to cosmwasm/packages/quartz-tee-ra/src/intel_sgx/dcap/mc_attest_verifier_types/verification.rs diff --git a/bisenzone-cw-mvp/packages/quartz-tee-ra/src/intel_sgx/epid.rs b/cosmwasm/packages/quartz-tee-ra/src/intel_sgx/epid.rs similarity index 100% rename from bisenzone-cw-mvp/packages/quartz-tee-ra/src/intel_sgx/epid.rs rename to cosmwasm/packages/quartz-tee-ra/src/intel_sgx/epid.rs diff --git a/bisenzone-cw-mvp/packages/quartz-tee-ra/src/intel_sgx/epid/types.rs b/cosmwasm/packages/quartz-tee-ra/src/intel_sgx/epid/types.rs similarity index 100% rename from bisenzone-cw-mvp/packages/quartz-tee-ra/src/intel_sgx/epid/types.rs rename to cosmwasm/packages/quartz-tee-ra/src/intel_sgx/epid/types.rs diff --git a/bisenzone-cw-mvp/packages/quartz-tee-ra/src/intel_sgx/epid/verifier.rs b/cosmwasm/packages/quartz-tee-ra/src/intel_sgx/epid/verifier.rs similarity index 100% rename from bisenzone-cw-mvp/packages/quartz-tee-ra/src/intel_sgx/epid/verifier.rs rename to cosmwasm/packages/quartz-tee-ra/src/intel_sgx/epid/verifier.rs diff --git a/bisenzone-cw-mvp/packages/quartz-tee-ra/src/lib.rs b/cosmwasm/packages/quartz-tee-ra/src/lib.rs similarity index 100% rename from bisenzone-cw-mvp/packages/quartz-tee-ra/src/lib.rs rename to cosmwasm/packages/quartz-tee-ra/src/lib.rs diff --git a/docs/arch/README.md b/docs/arch/README.md new file mode 100644 index 0000000..3582514 --- /dev/null +++ b/docs/arch/README.md @@ -0,0 +1 @@ +# Architecture decision records (ADRs) diff --git a/docs/spec/README.md b/docs/spec/README.md new file mode 100644 index 0000000..247b185 --- /dev/null +++ b/docs/spec/README.md @@ -0,0 +1 @@ +# Specifications diff --git a/utils/quartz-relayer/Cargo.toml b/relayer/Cargo.toml similarity index 78% rename from utils/quartz-relayer/Cargo.toml rename to relayer/Cargo.toml index 44cd2f4..323f331 100644 --- a/utils/quartz-relayer/Cargo.toml +++ b/relayer/Cargo.toml @@ -20,6 +20,6 @@ thiserror = "1.0.38" tonic = "=0.8.3" tokio = { version = "1.0", features = ["macros", "rt-multi-thread"] } -quartz-cw = { git = "ssh://git@github.com/informalsystems/bisenzone-cw-mvp.git" } -quartz-tee-ra = { git = "ssh://git@github.com/informalsystems/bisenzone-cw-mvp.git" } -quartz-proto = { path = "../../utils/quartz-proto" } +quartz-cw = { path = "../cosmwasm/packages/quartz-cw" } +quartz-tee-ra = { path = "../cosmwasm/packages/quartz-tee-ra" } +quartz-proto = { path = "../core/quartz-proto" } diff --git a/utils/quartz-relayer/scripts/relay.sh b/relayer/scripts/relay.sh similarity index 100% rename from utils/quartz-relayer/scripts/relay.sh rename to relayer/scripts/relay.sh diff --git a/utils/quartz-relayer/src/cli.rs b/relayer/src/cli.rs similarity index 100% rename from utils/quartz-relayer/src/cli.rs rename to relayer/src/cli.rs diff --git a/utils/quartz-relayer/src/lib.rs b/relayer/src/lib.rs similarity index 100% rename from utils/quartz-relayer/src/lib.rs rename to relayer/src/lib.rs diff --git a/utils/quartz-relayer/src/main.rs b/relayer/src/main.rs similarity index 100% rename from utils/quartz-relayer/src/main.rs rename to relayer/src/main.rs diff --git a/utils/quartz-relayer/src/types.rs b/relayer/src/types.rs similarity index 100% rename from utils/quartz-relayer/src/types.rs rename to relayer/src/types.rs diff --git a/bisenzone-cw-mvp/scripts/build-contract.sh b/scripts/build-contract.sh similarity index 100% rename from bisenzone-cw-mvp/scripts/build-contract.sh rename to scripts/build-contract.sh diff --git a/bisenzone-cw-mvp/scripts/deploy-contract.sh b/scripts/deploy-contract.sh similarity index 100% rename from bisenzone-cw-mvp/scripts/deploy-contract.sh rename to scripts/deploy-contract.sh diff --git a/bisenzone-cw-mvp/scripts/init-node.sh b/scripts/init-node.sh similarity index 100% rename from bisenzone-cw-mvp/scripts/init-node.sh rename to scripts/init-node.sh diff --git a/bisenzone-cw-mvp/scripts/keygen.sh b/scripts/keygen.sh similarity index 100% rename from bisenzone-cw-mvp/scripts/keygen.sh rename to scripts/keygen.sh diff --git a/bisenzone-cw-mvp/scripts/run-node.sh b/scripts/run-node.sh similarity index 100% rename from bisenzone-cw-mvp/scripts/run-node.sh rename to scripts/run-node.sh diff --git a/utils/cw-prover/Cargo.toml b/utils/cw-prover/Cargo.toml index c1e45fe..e02373a 100644 --- a/utils/cw-prover/Cargo.toml +++ b/utils/cw-prover/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" [dependencies] clap = { version = "4.1.8", features = ["derive"] } cosmrs = "0.15.0" -cw-proof = {path = "../cw-proof"} +cw-proof = { path = "../../core/light-client-proofs/cw-proof" } serde_json = "1.0.108" tendermint = "0.34.0" tendermint-rpc = { version = "0.34.0", features = ["http-client"] } diff --git a/utils/tm-prover/Cargo.toml b/utils/tm-prover/Cargo.toml index 47d43ad..1426e0c 100644 --- a/utils/tm-prover/Cargo.toml +++ b/utils/tm-prover/Cargo.toml @@ -9,7 +9,7 @@ edition = "2021" clap = { version = "4.1.8", features = ["derive"] } color-eyre = "0.6.2" cosmrs = "0.15.0" -cw-proof = { path = "../cw-proof" } +cw-proof = { path = "../../core/light-client-proofs/cw-proof" } futures = "0.3.27" serde = { version = "1.0.189", features = ["derive"] } serde_json = "1.0.94"