diff --git a/.github/scripts/create-tag.js b/.github/scripts/create-tag.js new file mode 100644 index 0000000000..6ecd0bc9a8 --- /dev/null +++ b/.github/scripts/create-tag.js @@ -0,0 +1,14 @@ +module.exports = async ({ github, context }, tagName) => { + try { + await github.rest.git.createRef({ + owner: context.repo.owner, + repo: context.repo.repo, + ref: `refs/tags/${tagName}`, + sha: context.sha, + force: true, + }); + } catch (err) { + console.error(`Failed to create tag: ${tagName}`); + console.error(err); + } +}; \ No newline at end of file diff --git a/.github/scripts/move-tag.js b/.github/scripts/move-tag.js new file mode 100644 index 0000000000..580fa58e75 --- /dev/null +++ b/.github/scripts/move-tag.js @@ -0,0 +1,15 @@ +module.exports = async ({ github, context }, tagName) => { + try { + await github.rest.git.updateRef({ + owner: context.repo.owner, + repo: context.repo.repo, + ref: `tags/${tagName}`, + sha: context.sha, + force: true, + }); + } catch (err) { + console.error(`Failed to move nightly tag.`); + console.error(`This should only happen the first time.`); + console.error(err); + } +}; \ No newline at end of file diff --git a/.github/scripts/prune-prereleases.js b/.github/scripts/prune-prereleases.js new file mode 100644 index 0000000000..8503eba237 --- /dev/null +++ b/.github/scripts/prune-prereleases.js @@ -0,0 +1,68 @@ +// In case node 21 is not used. +function groupBy(array, keyOrIterator) { + var iterator; + + // use the function passed in, or create one + if(typeof keyOrIterator !== 'function') { + const key = String(keyOrIterator); + iterator = function (item) { return item[key]; }; + } else { + iterator = keyOrIterator; + } + + return array.reduce(function (memo, item) { + const key = iterator(item); + memo[key] = memo[key] || []; + memo[key].push(item); + return memo; + }, {}); +} + +module.exports = async ({ github, context }) => { + console.log("Pruning old prereleases"); + + // doc: https://docs.github.com/en/rest/releases/releases + const { data: releases } = await github.rest.repos.listReleases({ + owner: context.repo.owner, + repo: context.repo.repo, + }); + + let nightlies = releases.filter( + release => + // Only consider releases tagged `nightly-${SHA}` for deletion + release.tag_name.includes("nightly") && + release.tag_name !== "nightly" + ); + + // Pruning rules: + // 1. only keep the earliest (by created_at) release of the month + // 2. to keep the newest 3 nightlies + // Notes: + // - This addresses https://github.com/foundry-rs/foundry/issues/6732 + // - Name of the release may deviate from created_at due to the usage of different timezones. + + // Group releases by months. + // Per doc: + // > The latest release is the most recent non-prerelease, non-draft release, sorted by the created_at attribute. + const groups = groupBy(nightlies, i => i.created_at.slice(0, 7)); + const nightliesToPrune = Object.values(groups) + .reduce((acc, cur) => acc.concat(cur.slice(0, -1)), []) // rule 1 + .slice(3); // rule 2 + + for (const nightly of nightliesToPrune) { + console.log(`Deleting nightly: ${nightly.tag_name}`); + await github.rest.repos.deleteRelease({ + owner: context.repo.owner, + repo: context.repo.repo, + release_id: nightly.id, + }); + console.log(`Deleting nightly tag: ${nightly.tag_name}`); + await github.rest.git.deleteRef({ + owner: context.repo.owner, + repo: context.repo.repo, + ref: `tags/${nightly.tag_name}`, + }); + } + + console.log("Done."); +}; \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000000..7b68e8284d --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,251 @@ +# Reference: https://github.com/foundry-rs/foundry/blob/master/.github/workflows/release.yml + +name: release + +on: + push: + tags: + - "v*.*.*" + schedule: + - cron: "0 0 * * *" + workflow_dispatch: + +env: + CARGO_TERM_COLOR: always + IS_NIGHTLY: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} + +jobs: + prepare: + name: Prepare release + runs-on: ubuntu-latest + timeout-minutes: 30 + outputs: + tag_name: ${{ steps.release_info.outputs.tag_name }} + release_name: ${{ steps.release_info.outputs.release_name }} + changelog: ${{ steps.build_changelog.outputs.changelog }} + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Compute release name and tag + id: release_info + run: | + if [[ $IS_NIGHTLY ]]; then + echo "tag_name=nightly-${GITHUB_SHA}" >> $GITHUB_OUTPUT + echo "release_name=Nightly ($(date '+%Y-%m-%d'))" >> $GITHUB_OUTPUT + else + echo "tag_name=${GITHUB_REF_NAME}" >> $GITHUB_OUTPUT + echo "release_name=${GITHUB_REF_NAME}" >> $GITHUB_OUTPUT + fi + + # Creates a `nightly-SHA` tag for this specific nightly + # This tag is used for this specific nightly version's release + # which allows users to roll back. It is also used to build + # the changelog. + - name: Create build-specific nightly tag + if: ${{ env.IS_NIGHTLY }} + uses: actions/github-script@v7 + env: + TAG_NAME: ${{ steps.release_info.outputs.tag_name }} + with: + script: | + const createTag = require('./.github/scripts/create-tag.js') + await createTag({ github, context }, process.env.TAG_NAME) + + - name: Build changelog + id: build_changelog + uses: mikepenz/release-changelog-builder-action@v4 + with: + configuration: "./.github/changelog.json" + fromTag: ${{ env.IS_NIGHTLY && 'nightly' || '' }} + toTag: ${{ steps.release_info.outputs.tag_name }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + release: + name: ${{ matrix.target }} (${{ matrix.runner }}) + runs-on: ${{ matrix.runner }} + timeout-minutes: 240 + needs: prepare + strategy: + fail-fast: false + matrix: + include: + # `runner`: GHA runner label + # `target`: Rust build target triple + # `platform` and `arch`: Used in tarball names + # `svm`: target platform to use for the Solc binary: https://github.com/roynalnaruto/svm-rs/blob/84cbe0ac705becabdc13168bae28a45ad2299749/svm-builds/build.rs#L4-L24 + - runner: ubuntu-latest + target: x86_64-unknown-linux-gnu + svm_target_platform: linux-amd64 + platform: linux + arch: amd64 + - runner: buildjet-4vcpu-ubuntu-2204-arm + target: aarch64-unknown-linux-gnu + svm_target_platform: linux-aarch64 + platform: linux + arch: arm64 + - runner: macos-latest-large + target: x86_64-apple-darwin + svm_target_platform: macosx-amd64 + platform: darwin + arch: amd64 + - runner: macos-latest-xlarge + target: aarch64-apple-darwin + svm_target_platform: macosx-aarch64 + platform: darwin + arch: arm64 + # - runner: windows-latest + # target: x86_64-pc-windows-msvc + # svm_target_platform: windows-amd64 + # platform: win32 + # arch: amd64 + steps: + - uses: actions/checkout@v4 + + - name: Install nightly toolchain + id: rustc-toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly-2024-01-25 + override: true + targets: ${{ matrix.target }} + + - uses: Swatinem/rust-cache@v2 + with: + key: ${{ matrix.target }} + cache-on-failure: true + + - name: Set up git private repo access + run: | + git config --global url."https://${{ secrets.PRIVATE_PULL_TOKEN }}@github.com/".insteadOf ssh://git@github.com + git config --global url."https://${{ secrets.PRIVATE_PULL_TOKEN }}@github.com".insteadOf https://github.com + + - name: Apple M1 setup + if: matrix.target == 'aarch64-apple-darwin' + run: | + echo "SDKROOT=$(xcrun -sdk macosx --show-sdk-path)" >> $GITHUB_ENV + echo "MACOSX_DEPLOYMENT_TARGET=$(xcrun -sdk macosx --show-sdk-platform-version)" >> $GITHUB_ENV + + - name: Linux ARM setup + if: matrix.target == 'aarch64-unknown-linux-gnu' + run: | + sudo apt-get update -y + sudo apt-get install -y gcc-aarch64-linux-gnu + echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV + + - name: Build binaries + env: + SVM_TARGET_PLATFORM: ${{ matrix.svm_target_platform }} + shell: bash + run: | + set -eo pipefail + target="${{ matrix.target }}" + flags=() + + [[ "$target" == *windows* ]] && exe=".exe" + + cargo build --release -p cli --target "$target" "${flags[@]}" + + bins=(cargo-prove) + for name in "${bins[@]}"; do + bin=./target/$target/release/$name$exe + file "$bin" || true + ldd "$bin" || true + $bin --version || true + done + + - name: Archive binaries + id: artifacts + env: + PLATFORM_NAME: ${{ matrix.platform }} + TARGET: ${{ matrix.target }} + ARCH: ${{ matrix.arch }} + VERSION_NAME: + ${{ (env.IS_NIGHTLY && 'nightly') || needs.prepare.outputs.tag_name }} + shell: bash + run: | + if [ "$PLATFORM_NAME" == "linux" ]; then + tar -czvf "cargo_prove_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz" -C ./target/${TARGET}/release cargo-prove + echo "file_name=cargo_prove_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz" >> $GITHUB_OUTPUT + elif [ "$PLATFORM_NAME" == "darwin" ]; then + # We need to use gtar here otherwise the archive is corrupt. + # See: https://github.com/actions/virtual-environments/issues/2619 + gtar -czvf "cargo_prove_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz" -C ./target/${TARGET}/release cargo-prove + echo "file_name=cargo_prove_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz" >> $GITHUB_OUTPUT + else + cd ./target/${TARGET}/release + 7z a -tzip "cargo_prove_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.zip" cargo-prove.exe + mv "cargo_prove_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.zip" ../../../ + echo "file_name=cargo_prove_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.zip" >> $GITHUB_OUTPUT + fi + + # Creates the release for this specific version + - name: Create release + uses: softprops/action-gh-release@v1 + with: + name: ${{ needs.prepare.outputs.release_name }} + tag_name: ${{ needs.prepare.outputs.tag_name }} + prerelease: ${{ env.IS_NIGHTLY }} + body: ${{ needs.prepare.outputs.changelog }} + files: | + ${{ steps.artifacts.outputs.file_name }} + ${{ steps.man.outputs.cargo_prove_man }} + + # If this is a nightly release, it also updates the release + # tagged `nightly` for compatibility with `foundryup` + - name: Update nightly release + if: ${{ env.IS_NIGHTLY }} + uses: softprops/action-gh-release@v1 + with: + name: "Nightly" + tag_name: "nightly" + prerelease: true + body: ${{ needs.prepare.outputs.changelog }} + files: | + ${{ steps.artifacts.outputs.file_name }} + ${{ steps.man.outputs.cargo_prove_man }} + + cleanup: + name: Release cleanup + runs-on: ubuntu-latest + timeout-minutes: 30 + needs: release + if: always() + steps: + - uses: actions/checkout@v4 + + # Moves the `nightly` tag to `HEAD` + - name: Move nightly tag + if: ${{ env.IS_NIGHTLY }} + uses: actions/github-script@v7 + with: + script: | + const moveTag = require('./.github/scripts/move-tag.js') + await moveTag({ github, context }, 'nightly') + + - name: Delete old nightlies + uses: actions/github-script@v7 + with: + script: | + const prunePrereleases = require('./.github/scripts/prune-prereleases.js') + await prunePrereleases({github, context}) + + # If any of the jobs fail, this will create a high-priority issue to signal so. + issue: + name: Open an issue + runs-on: ubuntu-latest + needs: [prepare, release, cleanup] + if: failure() + steps: + - uses: actions/checkout@v4 + - uses: JasonEtco/create-an-issue@v2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + WORKFLOW_URL: | + ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + with: + update_existing: true + filename: .github/RELEASE_FAILURE_ISSUE_TEMPLATE.md \ No newline at end of file diff --git a/.gitignore b/.gitignore index b7f8205f72..6988b10dc3 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,7 @@ pgo-data.profdata # MacOS nuisances -.DS_Store \ No newline at end of file +.DS_Store + +# Proofs +**/proof-with-pis.json \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index 8955fe7c55..fa289958b4 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -25,6 +25,7 @@ "programs/test/ed-decompress/Cargo.toml", "programs/demo/ed25519/Cargo.toml", "programs/demo/fibonacci/Cargo.toml", + "programs/demo/fibonacci-io/Cargo.toml", "programs/demo/io/Cargo.toml", "programs/test/keccak-permute/Cargo.toml", "programs/test/secp256k1-add/Cargo.toml", diff --git a/Cargo.lock b/Cargo.lock index e6207c7426..7ba88fccca 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -17,24 +17,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" -[[package]] -name = "adler32" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234" - -[[package]] -name = "ahash" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - [[package]] name = "aho-corasick" version = "1.1.2" @@ -44,100 +26,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "allocator-api2" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" - -[[package]] -name = "alloy-primitives" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4b6fb2b432ff223d513db7f908937f63c252bee0af9b82bfd25b0a5dd1eb0d8" -dependencies = [ - "alloy-rlp", - "bytes", - "cfg-if", - "const-hex", - "derive_more", - "hex-literal", - "itoa", - "k256", - "keccak-asm", - "proptest", - "rand", - "ruint", - "serde", - "tiny-keccak", -] - -[[package]] -name = "alloy-rlp" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d58d9f5da7b40e9bfff0b7e7816700be4019db97d4b6359fe7f94a9e22e42ac" -dependencies = [ - "arrayvec 0.7.4", - "bytes", -] - -[[package]] -name = "alloy-rlp-derive" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a047897373be4bbb0224c1afdabca92648dc57a9c9ef6e7b0be3aff7a859c83" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", -] - -[[package]] -name = "alloy-sol-macro" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b0b5ab0cb07c21adf9d72e988b34e8200ce648c2bba8d009183bb1c50fb1216" -dependencies = [ - "const-hex", - "dunce", - "heck", - "indexmap 2.2.2", - "proc-macro-error", - "proc-macro2", - "quote", - "syn 2.0.48", - "syn-solidity", - "tiny-keccak", -] - -[[package]] -name = "alloy-sol-types" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c08f62ded7ce03513bfb60ef5cad4fff5d4f67eac6feb4df80426b7b9ffb06e" -dependencies = [ - "alloy-primitives", - "alloy-sol-macro", - "const-hex", - "serde", -] - -[[package]] -name = "android-tzdata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - -[[package]] -name = "android_system_properties" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" -dependencies = [ - "libc", -] - [[package]] name = "anes" version = "0.1.6" @@ -210,130 +98,6 @@ dependencies = [ "backtrace", ] -[[package]] -name = "ark-ff" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b3235cc41ee7a12aaaf2c575a2ad7b46713a8a50bda2fc3b003a04845c05dd6" -dependencies = [ - "ark-ff-asm 0.3.0", - "ark-ff-macros 0.3.0", - "ark-serialize 0.3.0", - "ark-std 0.3.0", - "derivative", - "num-bigint", - "num-traits", - "paste", - "rustc_version 0.3.3", - "zeroize", -] - -[[package]] -name = "ark-ff" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" -dependencies = [ - "ark-ff-asm 0.4.2", - "ark-ff-macros 0.4.2", - "ark-serialize 0.4.2", - "ark-std 0.4.0", - "derivative", - "digest 0.10.7", - "itertools 0.10.5", - "num-bigint", - "num-traits", - "paste", - "rustc_version 0.4.0", - "zeroize", -] - -[[package]] -name = "ark-ff-asm" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db02d390bf6643fb404d3d22d31aee1c4bc4459600aef9113833d17e786c6e44" -dependencies = [ - "quote", - "syn 1.0.109", -] - -[[package]] -name = "ark-ff-asm" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" -dependencies = [ - "quote", - "syn 1.0.109", -] - -[[package]] -name = "ark-ff-macros" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db2fd794a08ccb318058009eefdf15bcaaaaf6f8161eb3345f907222bac38b20" -dependencies = [ - "num-bigint", - "num-traits", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "ark-ff-macros" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" -dependencies = [ - "num-bigint", - "num-traits", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "ark-serialize" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d6c2b318ee6e10f8c2853e73a83adc0ccb88995aa978d8a3408d492ab2ee671" -dependencies = [ - "ark-std 0.3.0", - "digest 0.9.0", -] - -[[package]] -name = "ark-serialize" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" -dependencies = [ - "ark-std 0.4.0", - "digest 0.10.7", - "num-bigint", -] - -[[package]] -name = "ark-std" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1df2c09229cbc5a028b1d70e00fdb2acee28b1055dfb5ca73eea49c5a25c4e7c" -dependencies = [ - "num-traits", - "rand", -] - -[[package]] -name = "ark-std" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" -dependencies = [ - "num-traits", - "rand", -] - [[package]] name = "arrayref" version = "0.3.7" @@ -352,49 +116,6 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" -[[package]] -name = "async-trait" -version = "0.1.77" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", -] - -[[package]] -name = "async_io_stream" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6d7b9decdf35d8908a7e3ef02f64c5e9b1695e230154c0e8de3969142d9b94c" -dependencies = [ - "futures", - "pharos", - "rustc_version 0.4.0", -] - -[[package]] -name = "aurora-engine-modexp" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfacad86e9e138fca0670949eb8ed4ffdf73a55bded8887efe0863cd1a3a6f70" -dependencies = [ - "hex", - "num", -] - -[[package]] -name = "auto_impl" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "823b8bb275161044e2ac7a25879cb3e2480cb403e3943022c7c769c599b756aa" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", -] - [[package]] name = "autocfg" version = "1.1.0" @@ -422,12 +143,6 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" -[[package]] -name = "base64" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" - [[package]] name = "base64" version = "0.21.7" @@ -449,21 +164,6 @@ dependencies = [ "serde", ] -[[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" @@ -475,9 +175,6 @@ name = "bitflags" version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" -dependencies = [ - "serde", -] [[package]] name = "bitvec" @@ -487,7 +184,6 @@ checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" dependencies = [ "funty", "radium", - "serde", "tap", "wyz", ] @@ -515,58 +211,17 @@ dependencies = [ "generic-array", ] -[[package]] -name = "blst" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c94087b935a822949d3291a9989ad2b2051ea141eda0fd4e478a75f6aa3e604b" -dependencies = [ - "cc", - "glob", - "threadpool", - "zeroize", -] - [[package]] name = "bumpalo" version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" -[[package]] -name = "byte-slice-cast" -version = "1.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" - -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - [[package]] name = "bytes" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" -dependencies = [ - "serde", -] - -[[package]] -name = "c-kzg" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9d8c306be83ec04bf5f73710badd8edf56dea23f2f0d8b7f9fe4644d371c758" -dependencies = [ - "blst", - "cc", - "glob", - "hex", - "libc", - "serde", -] [[package]] name = "camino" @@ -594,7 +249,7 @@ checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" dependencies = [ "camino", "cargo-platform", - "semver 1.0.21", + "semver", "serde", "serde_json", "thiserror", @@ -612,6 +267,7 @@ version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" dependencies = [ + "jobserver", "libc", ] @@ -621,19 +277,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "chrono" -version = "0.4.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f13690e35a5e4ace198e7beea2895d29f3a9cc55015fcebe6336bd2010af9eb" -dependencies = [ - "android-tzdata", - "iana-time-zone", - "num-traits", - "serde", - "windows-targets 0.52.0", -] - [[package]] name = "ciborium" version = "0.2.2" @@ -680,7 +323,7 @@ dependencies = [ "anstream", "anstyle", "clap_lex", - "strsim 0.11.0", + "strsim", ] [[package]] @@ -720,6 +363,8 @@ dependencies = [ "succinct-core", "tar", "tokio", + "vergen", + "yansi", ] [[package]] @@ -741,19 +386,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "const-hex" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18d59688ad0945eaf6b84cb44fedbe93484c81b48970e98f09db8a22832d7961" -dependencies = [ - "cfg-if", - "cpufeatures", - "hex", - "proptest", - "serde", -] - [[package]] name = "const-oid" version = "0.9.6" @@ -772,12 +404,6 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" -[[package]] -name = "convert_case" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" - [[package]] name = "core-foundation" version = "0.9.4" @@ -794,15 +420,6 @@ version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" -[[package]] -name = "core2" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b49ba7ef1ad6107f8824dbe97de947cbaac53c44e7f9756a1fba0d37c1eec505" -dependencies = [ - "memchr", -] - [[package]] name = "cpufeatures" version = "0.2.12" @@ -921,7 +538,7 @@ dependencies = [ "curve25519-dalek-derive", "fiat-crypto", "platforms", - "rustc_version 0.4.0", + "rustc_version", "subtle", "zeroize", ] @@ -937,47 +554,6 @@ dependencies = [ "syn 2.0.48", ] -[[package]] -name = "darling" -version = "0.20.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc5d6b04b3fd0ba9926f945895de7d806260a2d7431ba82e7edaecb043c4c6b8" -dependencies = [ - "darling_core", - "darling_macro", -] - -[[package]] -name = "darling_core" -version = "0.20.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04e48a959bcd5c761246f5d090ebc2fbf7b9cd527a492b07a67510c108f1e7e3" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim 0.10.0", - "syn 2.0.48", -] - -[[package]] -name = "darling_macro" -version = "0.20.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d1545d67a2149e1d93b7e5c7752dce5a7426eb5d1357ddcfd89336b94444f77" -dependencies = [ - "darling_core", - "quote", - "syn 2.0.48", -] - -[[package]] -name = "dary_heap" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7762d17f1241643615821a8455a0b2c3e803784b058693d990b11f2dce25a0ca" - [[package]] name = "dashmap" version = "5.5.3" @@ -985,18 +561,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" dependencies = [ "cfg-if", - "hashbrown 0.14.3", + "hashbrown", "lock_api", "once_cell", "parking_lot_core", ] -[[package]] -name = "data-encoding" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" - [[package]] name = "der" version = "0.7.8" @@ -1014,40 +584,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" dependencies = [ "powerfmt", - "serde", -] - -[[package]] -name = "derivative" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "derive_more" -version = "0.99.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" -dependencies = [ - "convert_case", - "proc-macro2", - "quote", - "rustc_version 0.4.0", - "syn 1.0.109", -] - -[[package]] -name = "digest" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" -dependencies = [ - "generic-array", ] [[package]] @@ -1101,12 +637,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "dunce" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" - [[package]] name = "ecdsa" version = "0.16.9" @@ -1114,7 +644,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" dependencies = [ "der", - "digest 0.10.7", + "digest", "elliptic-curve", "rfc6979", "signature", @@ -1148,7 +678,7 @@ checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" dependencies = [ "base16ct", "crypto-bigint", - "digest 0.10.7", + "digest", "ff", "generic-array", "group", @@ -1175,35 +705,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "enr" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe81b5c06ecfdbc71dd845216f225f53b62a10cb8a16c946836a3467f701d05b" -dependencies = [ - "base64 0.21.7", - "bytes", - "hex", - "k256", - "log", - "rand", - "rlp", - "serde", - "sha3", - "zeroize", -] - -[[package]] -name = "enumn" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fd000fd6988e73bbe993ea3db9b1aa64906ab88766d654973924340c8cddb42" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", -] - [[package]] name = "equivalent" version = "1.0.1" @@ -1220,136 +721,12 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "ethabi" -version = "18.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7413c5f74cc903ea37386a8965a936cbeb334bd270862fdece542c1b2dcbc898" -dependencies = [ - "ethereum-types", - "hex", - "once_cell", - "regex", - "serde", - "serde_json", - "sha3", - "thiserror", - "uint", -] - -[[package]] -name = "ethbloom" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c22d4b5885b6aa2fe5e8b9329fb8d232bf739e434e6b87347c63bdd00c120f60" -dependencies = [ - "crunchy", - "fixed-hash", - "impl-codec", - "impl-rlp", - "impl-serde", - "scale-info", - "tiny-keccak", -] - -[[package]] -name = "ethereum-types" -version = "0.14.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02d215cbf040552efcbe99a38372fe80ab9d00268e20012b79fcd0f073edd8ee" -dependencies = [ - "ethbloom", - "fixed-hash", - "impl-codec", - "impl-rlp", - "impl-serde", - "primitive-types", - "scale-info", - "uint", -] - -[[package]] -name = "ethers-core" -version = "2.0.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aab3cef6cc1c9fd7f787043c81ad3052eff2b96a3878ef1526aa446311bdbfc9" -dependencies = [ - "arrayvec 0.7.4", - "bytes", - "chrono", - "const-hex", - "elliptic-curve", - "ethabi", - "generic-array", - "k256", - "num_enum 0.7.2", - "open-fastrlp", - "rand", - "rlp", - "serde", - "serde_json", - "strum", - "tempfile", - "thiserror", - "tiny-keccak", - "unicode-xid", -] - -[[package]] -name = "ethers-providers" -version = "2.0.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb6b15393996e3b8a78ef1332d6483c11d839042c17be58decc92fa8b1c3508a" -dependencies = [ - "async-trait", - "auto_impl", - "base64 0.21.7", - "bytes", - "const-hex", - "enr", - "ethers-core", - "futures-channel", - "futures-core", - "futures-timer", - "futures-util", - "hashers", - "http", - "instant", - "jsonwebtoken", - "once_cell", - "pin-project", - "reqwest", - "serde", - "serde_json", - "thiserror", - "tokio", - "tokio-tungstenite", - "tracing", - "tracing-futures", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "ws_stream_wasm", -] - [[package]] name = "fastrand" version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" -[[package]] -name = "fastrlp" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "139834ddba373bbdd213dffe02c8d110508dcf1726c2be27e8d1f7d7e1856418" -dependencies = [ - "arrayvec 0.7.4", - "auto_impl", - "bytes", -] - [[package]] name = "ff" version = "0.13.0" @@ -1368,7 +745,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e825f6987101665dea6ec934c09ec6d721de7bc1bf92248e1d5810c8cd636b77" [[package]] -name = "fibonacci-example" +name = "fibonacci-io-example" version = "0.1.0" dependencies = [ "succinct-core", @@ -1386,18 +763,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "fixed-hash" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" -dependencies = [ - "byteorder", - "rand", - "rustc-hex", - "static_assertions", -] - [[package]] name = "flate2" version = "1.0.28" @@ -1515,16 +880,6 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" -[[package]] -name = "futures-timer" -version = "3.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" -dependencies = [ - "gloo-timers", - "send_wrapper 0.4.0", -] - [[package]] name = "futures-util" version = "0.3.30" @@ -1543,15 +898,6 @@ dependencies = [ "slab", ] -[[package]] -name = "fxhash" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" -dependencies = [ - "byteorder", -] - [[package]] name = "generic-array" version = "0.14.7" @@ -1581,21 +927,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] -name = "glob" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" - -[[package]] -name = "gloo-timers" -version = "0.2.6" +name = "git2" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b995a66bb87bebce9a0f4a95aed01daca4872c050bfcb21653361c03bc35e5c" +checksum = "1b3ba52851e73b46a4c3df1d89343741112003f0f6f13beb0dfac9e457c3fdcd" dependencies = [ - "futures-channel", - "futures-core", - "js-sys", - "wasm-bindgen", + "bitflags 2.4.2", + "libc", + "libgit2-sys", + "log", + "url", ] [[package]] @@ -1621,7 +962,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap 2.2.2", + "indexmap", "slab", "tokio", "tokio-util", @@ -1638,40 +979,11 @@ dependencies = [ "crunchy", ] -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - -[[package]] -name = "hashbrown" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" -dependencies = [ - "ahash", -] - [[package]] name = "hashbrown" version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" -dependencies = [ - "ahash", - "allocator-api2", - "serde", -] - -[[package]] -name = "hashers" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2bca93b15ea5a746f220e56587f71e73c6165eab783df9e26590069953e3c30" -dependencies = [ - "fxhash", -] [[package]] name = "heck" @@ -1690,15 +1002,6 @@ name = "hex" version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" -dependencies = [ - "serde", -] - -[[package]] -name = "hex-literal" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "hmac" @@ -1706,7 +1009,7 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ - "digest 0.10.7", + "digest", ] [[package]] @@ -1795,174 +1098,87 @@ dependencies = [ ] [[package]] -name = "iana-time-zone" -version = "0.1.60" +name = "idna" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "wasm-bindgen", - "windows-core", + "unicode-bidi", + "unicode-normalization", ] [[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" +name = "indexmap" +version = "2.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +checksum = "824b2ae422412366ba479e8111fd301f7b5faece8149317bb81925979a53f520" dependencies = [ - "cc", + "equivalent", + "hashbrown", ] [[package]] -name = "ident_case" -version = "1.0.1" +name = "indicatif" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" +checksum = "7baab56125e25686df467fe470785512329883aab42696d661247aca2a2896e4" +dependencies = [ + "console", + "lazy_static", + "number_prefix", + "regex", +] [[package]] -name = "idna" -version = "0.5.0" +name = "ipnet" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] +checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] -name = "impl-codec" -version = "0.6.0" +name = "is-terminal" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" +checksum = "0bad00257d07be169d870ab665980b06cdb366d792ad690bf2e76876dc503455" dependencies = [ - "parity-scale-codec", + "hermit-abi", + "rustix", + "windows-sys 0.52.0", ] [[package]] -name = "impl-rlp" -version = "0.3.0" +name = "itertools" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f28220f89297a075ddc7245cd538076ee98b01f2a9c23a53a4f1105d5a322808" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" dependencies = [ - "rlp", + "either", ] [[package]] -name = "impl-serde" -version = "0.4.0" +name = "itertools" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc88fc67028ae3db0c853baa36269d398d5f45b6982f95549ff5def78c935cd" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" dependencies = [ - "serde", + "either", ] [[package]] -name = "impl-trait-for-tuples" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "indexmap" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", - "serde", -] - -[[package]] -name = "indexmap" -version = "2.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "824b2ae422412366ba479e8111fd301f7b5faece8149317bb81925979a53f520" -dependencies = [ - "equivalent", - "hashbrown 0.14.3", - "serde", -] - -[[package]] -name = "indicatif" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7baab56125e25686df467fe470785512329883aab42696d661247aca2a2896e4" -dependencies = [ - "console", - "lazy_static", - "number_prefix", - "regex", -] - -[[package]] -name = "instant" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "io-example" -version = "0.1.0" -dependencies = [ - "serde", - "succinct-core", -] - -[[package]] -name = "ipnet" -version = "2.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" - -[[package]] -name = "is-terminal" -version = "0.4.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bad00257d07be169d870ab665980b06cdb366d792ad690bf2e76876dc503455" -dependencies = [ - "hermit-abi", - "rustix", - "windows-sys 0.52.0", -] - -[[package]] -name = "itertools" -version = "0.10.5" +name = "itoa" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] -name = "itertools" -version = "0.12.1" +name = "jobserver" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +checksum = "ab46a6e9526ddef3ae7f787c06f0f2600639ba80ea3eade3d8e670a2230f51d6" dependencies = [ - "either", + "libc", ] -[[package]] -name = "itoa" -version = "1.0.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" - [[package]] name = "js-sys" version = "0.3.68" @@ -1972,20 +1188,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "jsonwebtoken" -version = "8.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6971da4d9c3aa03c3d8f3ff0f4155b534aad021292003895a469716b2a230378" -dependencies = [ - "base64 0.21.7", - "pem", - "ring 0.16.20", - "serde", - "serde_json", - "simple_asn1", -] - [[package]] name = "k256" version = "0.13.3" @@ -2011,33 +1213,11 @@ dependencies = [ "constant_time_eq 0.1.5", ] -[[package]] -name = "keccak" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" -dependencies = [ - "cpufeatures", -] - -[[package]] -name = "keccak-asm" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb8515fff80ed850aea4a1595f2e519c003e2a00a82fe168ebf5269196caf444" -dependencies = [ - "digest 0.10.7", - "sha3-asm", -] - [[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" @@ -2046,35 +1226,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] -name = "libflate" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7d5654ae1795afc7ff76f4365c2c8791b0feb18e8996a96adad8ffd7c3b2bf" -dependencies = [ - "adler32", - "core2", - "crc32fast", - "dary_heap", - "libflate_lz77", -] - -[[package]] -name = "libflate_lz77" -version = "2.0.0" +name = "libgit2-sys" +version = "0.16.2+1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be5f52fb8c451576ec6b79d3f4deb327398bc05bbdbd99021a6e77a4c855d524" +checksum = "ee4126d8b4ee5c9d9ea891dd875cfdc1e9d0950437179104b183d7d8a74d24e8" dependencies = [ - "core2", - "hashbrown 0.13.2", - "rle-decode-fast", + "cc", + "libc", + "libz-sys", + "pkg-config", ] -[[package]] -name = "libm" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" - [[package]] name = "libredox" version = "0.0.1" @@ -2086,6 +1248,18 @@ dependencies = [ "redox_syscall", ] +[[package]] +name = "libz-sys" +version = "1.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "037731f5d3aaa87a5675e895b63ddff1a87624bc29f77004ea829809654e48f6" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + [[package]] name = "linux-raw-sys" version = "0.4.13" @@ -2264,7 +1438,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" dependencies = [ "autocfg", - "libm", ] [[package]] @@ -2283,16 +1456,7 @@ version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f646caf906c20226733ed5b1374287eb97e3c2a5c227ce668c1f2ce20ae57c9" dependencies = [ - "num_enum_derive 0.5.11", -] - -[[package]] -name = "num_enum" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845" -dependencies = [ - "num_enum_derive 0.7.2", + "num_enum_derive", ] [[package]] @@ -2301,22 +1465,19 @@ version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799" dependencies = [ - "proc-macro-crate 1.3.1", + "proc-macro-crate", "proc-macro2", "quote", "syn 1.0.109", ] [[package]] -name = "num_enum_derive" -version = "0.7.2" +name = "num_threads" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" +checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44" dependencies = [ - "proc-macro-crate 3.1.0", - "proc-macro2", - "quote", - "syn 2.0.48", + "libc", ] [[package]] @@ -2346,31 +1507,6 @@ version = "11.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" -[[package]] -name = "open-fastrlp" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "786393f80485445794f6043fd3138854dd109cc6c4bd1a6383db304c9ce9b9ce" -dependencies = [ - "arrayvec 0.7.4", - "auto_impl", - "bytes", - "ethereum-types", - "open-fastrlp-derive", -] - -[[package]] -name = "open-fastrlp-derive" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "003b2be5c6c53c1cfeb0a238b8a1c3915cd410feb684457a36c10038f764bb1c" -dependencies = [ - "bytes", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "openssl" version = "0.10.63" @@ -2670,32 +1806,6 @@ dependencies = [ "serde", ] -[[package]] -name = "parity-scale-codec" -version = "3.6.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "881331e34fa842a2fb61cc2db9643a8fedc615e47cfcc52597d1af0db9a7e8fe" -dependencies = [ - "arrayvec 0.7.4", - "bitvec", - "byte-slice-cast", - "impl-trait-for-tuples", - "parity-scale-codec-derive", - "serde", -] - -[[package]] -name = "parity-scale-codec-derive" -version = "3.6.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be30eaf4b0a9fba5336683b38de57bb86d179a35862ba6bfcf57625d006bde5b" -dependencies = [ - "proc-macro-crate 2.0.0", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "parking_lot" version = "0.12.1" @@ -2725,62 +1835,12 @@ version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" -[[package]] -name = "pem" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8835c273a76a90455d7344889b0964598e3316e2a79ede8e36f16bdcf2228b8" -dependencies = [ - "base64 0.13.1", -] - [[package]] name = "percent-encoding" version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" -[[package]] -name = "pest" -version = "2.7.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "219c0dcc30b6a27553f9cc242972b67f75b60eb0db71f0b5462f38b058c41546" -dependencies = [ - "memchr", - "thiserror", - "ucd-trie", -] - -[[package]] -name = "pharos" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9567389417feee6ce15dd6527a8a1ecac205ef62c2932bcf3d9f6fc5b78b414" -dependencies = [ - "futures", - "rustc_version 0.4.0", -] - -[[package]] -name = "pin-project" -version = "1.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0302c4a0442c456bd56f841aee5c3bfd17967563f6fadc9ceb9f9c23cf3807e0" -dependencies = [ - "pin-project-internal", -] - -[[package]] -name = "pin-project-internal" -version = "1.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266c042b60c9c76b8d53061e52b2e0d1116abc57cefc8c5cd671619a56ac3690" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", -] - [[package]] name = "pin-project-lite" version = "0.2.13" @@ -2855,20 +1915,6 @@ version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" -[[package]] -name = "primitive-types" -version = "0.12.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" -dependencies = [ - "fixed-hash", - "impl-codec", - "impl-rlp", - "impl-serde", - "scale-info", - "uint", -] - [[package]] name = "proc-macro-crate" version = "1.3.1" @@ -2876,49 +1922,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" dependencies = [ "once_cell", - "toml_edit 0.19.15", -] - -[[package]] -name = "proc-macro-crate" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8366a6159044a37876a2b9817124296703c586a5c92e2c53751fa06d8d43e8" -dependencies = [ - "toml_edit 0.20.7", -] - -[[package]] -name = "proc-macro-crate" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" -dependencies = [ - "toml_edit 0.21.1", -] - -[[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn 1.0.109", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check", + "toml_edit", ] [[package]] @@ -2930,32 +1934,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "proptest" -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", - "rand", - "rand_chacha", - "rand_xorshift", - "regex-syntax 0.8.2", - "rusty-fork", - "tempfile", - "unarray", -] - -[[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" @@ -3001,15 +1979,6 @@ dependencies = [ "getrandom", ] -[[package]] -name = "rand_xorshift" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" -dependencies = [ - "rand_core", -] - [[package]] name = "rayon" version = "1.8.1" @@ -3100,7 +2069,7 @@ version = "0.11.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c6920094eb85afde5e4a138be3f2de8bbdf28000f0029e72c45025a56b042251" dependencies = [ - "base64 0.21.7", + "base64", "bytes", "encoding_rs", "futures-core", @@ -3140,59 +2109,6 @@ dependencies = [ "winreg", ] -[[package]] -name = "revm" -version = "3.5.0" -source = "git+https://github.com/bluealloy/revm.git?rev=6cd0bfc96da64513affe01c1964dd80beeb8c620#6cd0bfc96da64513affe01c1964dd80beeb8c620" -dependencies = [ - "auto_impl", - "revm-interpreter", - "revm-precompile", - "serde", - "serde_json", -] - -[[package]] -name = "revm-interpreter" -version = "1.3.0" -source = "git+https://github.com/bluealloy/revm.git?rev=6cd0bfc96da64513affe01c1964dd80beeb8c620#6cd0bfc96da64513affe01c1964dd80beeb8c620" -dependencies = [ - "revm-primitives", - "serde", -] - -[[package]] -name = "revm-precompile" -version = "2.2.0" -source = "git+https://github.com/bluealloy/revm.git?rev=6cd0bfc96da64513affe01c1964dd80beeb8c620#6cd0bfc96da64513affe01c1964dd80beeb8c620" -dependencies = [ - "aurora-engine-modexp", - "c-kzg", - "k256", - "once_cell", - "revm-primitives", - "ripemd", - "secp256k1", - "sha2", - "substrate-bn", -] - -[[package]] -name = "revm-primitives" -version = "1.3.0" -source = "git+https://github.com/bluealloy/revm.git?rev=6cd0bfc96da64513affe01c1964dd80beeb8c620#6cd0bfc96da64513affe01c1964dd80beeb8c620" -dependencies = [ - "alloy-primitives", - "auto_impl", - "bitflags 2.4.2", - "bitvec", - "c-kzg", - "enumn", - "hashbrown 0.14.3", - "hex", - "serde", -] - [[package]] name = "rfc6979" version = "0.4.0" @@ -3203,21 +2119,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "ring" -version = "0.16.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" -dependencies = [ - "cc", - "libc", - "once_cell", - "spin 0.5.2", - "untrusted 0.7.1", - "web-sys", - "winapi", -] - [[package]] name = "ring" version = "0.17.7" @@ -3227,116 +2128,34 @@ dependencies = [ "cc", "getrandom", "libc", - "spin 0.9.8", - "untrusted 0.9.0", + "spin", + "untrusted", "windows-sys 0.48.0", ] -[[package]] -name = "ripemd" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd124222d17ad93a644ed9d011a40f4fb64aa54275c08cc216524a9ea82fb09f" -dependencies = [ - "digest 0.10.7", -] - -[[package]] -name = "rle-decode-fast" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3582f63211428f83597b51b2ddb88e2a91a9d52d12831f9d08f5e624e8977422" - -[[package]] -name = "rlp" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb919243f34364b6bd2fc10ef797edbfa75f33c252e7998527479c6d6b47e1ec" -dependencies = [ - "bytes", - "rlp-derive", - "rustc-hex", -] - -[[package]] -name = "rlp-derive" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e33d7b2abe0c340d8797fe2907d3f20d3b5ea5908683618bfe80df7f621f672a" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "rrs-lib" version = "0.1.0" source = "git+https://github.com/GregAC/rrs.git#b23afc16b4e6a1fb5c4a73eb1e337e9400816507" dependencies = [ "downcast-rs", - "num_enum 0.5.11", + "num_enum", "paste", ] -[[package]] -name = "ruint" -version = "1.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608a5726529f2f0ef81b8fde9873c4bb829d6b5b5ca6be4d97345ddf0749c825" -dependencies = [ - "alloy-rlp", - "ark-ff 0.3.0", - "ark-ff 0.4.2", - "bytes", - "fastrlp", - "num-bigint", - "num-traits", - "parity-scale-codec", - "primitive-types", - "proptest", - "rand", - "rlp", - "ruint-macro", - "serde", - "valuable", - "zeroize", -] - -[[package]] -name = "ruint-macro" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e666a5496a0b2186dbcd0ff6106e29e093c15591bde62c20d3842007c6978a09" - [[package]] name = "rustc-demangle" version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" -[[package]] -name = "rustc-hex" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" - -[[package]] -name = "rustc_version" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" -dependencies = [ - "semver 0.11.0", -] - [[package]] name = "rustc_version" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.21", + "semver", ] [[package]] @@ -3359,7 +2178,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" dependencies = [ "log", - "ring 0.17.7", + "ring", "rustls-webpki", "sct", ] @@ -3370,7 +2189,7 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" dependencies = [ - "base64 0.21.7", + "base64", ] [[package]] @@ -3379,8 +2198,8 @@ version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ - "ring 0.17.7", - "untrusted 0.9.0", + "ring", + "untrusted", ] [[package]] @@ -3389,18 +2208,6 @@ 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 = "ryu" version = "1.0.16" @@ -3416,30 +2223,6 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "scale-info" -version = "2.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f7d66a1128282b7ef025a8ead62a4a9fcf017382ec53b8ffbf4d7bf77bd3c60" -dependencies = [ - "cfg-if", - "derive_more", - "parity-scale-codec", - "scale-info-derive", -] - -[[package]] -name = "scale-info-derive" -version = "2.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abf2c68b89cafb3b8d918dd07b42be0da66ff202cf1155c5739a4e0c1ea0dc19" -dependencies = [ - "proc-macro-crate 1.3.1", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "schannel" version = "0.1.23" @@ -3461,8 +2244,8 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ - "ring 0.17.7", - "untrusted 0.9.0", + "ring", + "untrusted", ] [[package]] @@ -3479,24 +2262,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "secp256k1" -version = "0.28.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d24b59d129cdadea20aea4fb2352fa053712e5d713eee47d700cd4b2bc002f10" -dependencies = [ - "secp256k1-sys", -] - -[[package]] -name = "secp256k1-sys" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5d1746aae42c19d583c3c1a8c646bfad910498e2051c551a7f2e3c0c9fbb7eb" -dependencies = [ - "cc", -] - [[package]] name = "security-framework" version = "2.9.2" @@ -3520,15 +2285,6 @@ dependencies = [ "libc", ] -[[package]] -name = "semver" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" -dependencies = [ - "semver-parser", -] - [[package]] name = "semver" version = "1.0.21" @@ -3538,27 +2294,6 @@ dependencies = [ "serde", ] -[[package]] -name = "semver-parser" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7" -dependencies = [ - "pest", -] - -[[package]] -name = "send_wrapper" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f638d531eccd6e23b980caf34876660d38e265409d8e99b397ab71eb3612fad0" - -[[package]] -name = "send_wrapper" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" - [[package]] name = "serde" version = "1.0.196" @@ -3585,7 +2320,6 @@ version = "1.0.113" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69801b70b1c3dac963ecb03a364ba0ceda9cf60c71cfe475e99864759c8b8a79" dependencies = [ - "indexmap 2.2.2", "itoa", "ryu", "serde", @@ -3597,39 +2331,10 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" dependencies = [ - "form_urlencoded", - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "serde_with" -version = "3.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b0ed1662c5a68664f45b76d18deb0e234aff37207086803165c961eb695e981" -dependencies = [ - "base64 0.21.7", - "chrono", - "hex", - "indexmap 1.9.3", - "indexmap 2.2.2", - "serde", - "serde_json", - "serde_with_macros", - "time", -] - -[[package]] -name = "serde_with_macros" -version = "3.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "568577ff0ef47b879f736cd66740e022f3672788cdf002a05a4e609ea5a6fb15" -dependencies = [ - "darling", - "proc-macro2", - "quote", - "syn 2.0.48", + "form_urlencoded", + "itoa", + "ryu", + "serde", ] [[package]] @@ -3657,17 +2362,6 @@ dependencies = [ "syn 2.0.48", ] -[[package]] -name = "sha1" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest 0.10.7", -] - [[package]] name = "sha2" version = "0.10.8" @@ -3676,27 +2370,7 @@ checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if", "cpufeatures", - "digest 0.10.7", -] - -[[package]] -name = "sha3" -version = "0.10.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" -dependencies = [ - "digest 0.10.7", - "keccak", -] - -[[package]] -name = "sha3-asm" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bac61da6b35ad76b195eb4771210f947734321a8d81d7738e1580d953bc7a15e" -dependencies = [ - "cc", - "cfg-if", + "digest", ] [[package]] @@ -3723,22 +2397,10 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ - "digest 0.10.7", + "digest", "rand_core", ] -[[package]] -name = "simple_asn1" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adc4e5204eb1910f40f9cfa375f6f05b68c3abac4b6fd879c8ff5e7ae8a0a085" -dependencies = [ - "num-bigint", - "num-traits", - "thiserror", - "time", -] - [[package]] name = "size" version = "0.4.1" @@ -3770,12 +2432,6 @@ dependencies = [ "windows-sys 0.48.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" @@ -3792,59 +2448,12 @@ dependencies = [ "der", ] -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - -[[package]] -name = "strsim" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" - [[package]] name = "strsim" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01" -[[package]] -name = "strum" -version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" -dependencies = [ - "strum_macros", -] - -[[package]] -name = "strum_macros" -version = "0.25.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "rustversion", - "syn 2.0.48", -] - -[[package]] -name = "substrate-bn" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b5bbfa79abbae15dd642ea8176a21a635ff3c00059961d1ea27ad04e5b441c" -dependencies = [ - "byteorder", - "crunchy", - "lazy_static", - "rand", - "rustc-hex", -] - [[package]] name = "subtle" version = "2.5.0" @@ -3855,6 +2464,7 @@ checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" name = "succinct-core" version = "0.1.0" dependencies = [ + "anyhow", "bincode", "clap", "criterion", @@ -3920,16 +2530,6 @@ dependencies = [ "p3-symmetric", ] -[[package]] -name = "succinct-precompiles" -version = "0.1.0" -source = "git+https://github.com/succinctlabs/vm.git?branch=chris/zeth#981d1990c4e5865d504acce7269dba85f33fa132" -dependencies = [ - "anyhow", - "cfg-if", - "k256", -] - [[package]] name = "succinct-zkvm" version = "0.1.0" @@ -3965,18 +2565,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "syn-solidity" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63bef2e2c735acbc06874eca3a8506f02a3c4700e6e748afc92cc2e4220e8a03" -dependencies = [ - "paste", - "proc-macro2", - "quote", - "syn 2.0.48", -] - [[package]] name = "sync_wrapper" version = "0.1.2" @@ -4063,15 +2651,6 @@ dependencies = [ "once_cell", ] -[[package]] -name = "threadpool" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d050e60b33d41c19108b32cea32164033a9013fe3b46cbd4457559bfbf77afaa" -dependencies = [ - "num_cpus", -] - [[package]] name = "time" version = "0.3.34" @@ -4080,7 +2659,9 @@ checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" dependencies = [ "deranged", "itoa", + "libc", "num-conv", + "num_threads", "powerfmt", "serde", "time-core", @@ -4187,21 +2768,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-tungstenite" -version = "0.20.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "212d5dcb2a1ce06d81107c3d0ffa3121fe974b73f068c8282cb1c32328113b6c" -dependencies = [ - "futures-util", - "log", - "rustls", - "tokio", - "tokio-rustls", - "tungstenite", - "webpki-roots", -] - [[package]] name = "tokio-util" version = "0.7.10" @@ -4228,29 +2794,7 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.2.2", - "toml_datetime", - "winnow", -] - -[[package]] -name = "toml_edit" -version = "0.20.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" -dependencies = [ - "indexmap 2.2.2", - "toml_datetime", - "winnow", -] - -[[package]] -name = "toml_edit" -version = "0.21.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" -dependencies = [ - "indexmap 2.2.2", + "indexmap", "toml_datetime", "winnow", ] @@ -4306,16 +2850,6 @@ dependencies = [ "tracing-subscriber", ] -[[package]] -name = "tracing-futures" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" -dependencies = [ - "pin-project", - "tracing", -] - [[package]] name = "tracing-log" version = "0.2.0" @@ -4351,56 +2885,12 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" -[[package]] -name = "tungstenite" -version = "0.20.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e3dac10fd62eaf6617d3a904ae222845979aec67c615d1c842b4002c7666fb9" -dependencies = [ - "byteorder", - "bytes", - "data-encoding", - "http", - "httparse", - "log", - "rand", - "rustls", - "sha1", - "thiserror", - "url", - "utf-8", -] - [[package]] name = "typenum" version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" -[[package]] -name = "ucd-trie" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" - -[[package]] -name = "uint" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52" -dependencies = [ - "byteorder", - "crunchy", - "hex", - "static_assertions", -] - -[[package]] -name = "unarray" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" - [[package]] name = "unicode-bidi" version = "0.3.15" @@ -4428,18 +2918,6 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" -[[package]] -name = "unicode-xid" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" - -[[package]] -name = "untrusted" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" - [[package]] name = "untrusted" version = "0.9.0" @@ -4457,12 +2935,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "utf-8" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" - [[package]] name = "utf8parse" version = "0.2.1" @@ -4492,19 +2964,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] -name = "version_check" -version = "0.9.4" +name = "vergen" +version = "8.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "e27d6bdd219887a9eadd19e1c34f32e47fa332301184935c6d9bca26f3cca525" +dependencies = [ + "anyhow", + "cfg-if", + "git2", + "rustversion", + "time", +] [[package]] -name = "wait-timeout" -version = "0.2.0" +name = "version_check" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6" -dependencies = [ - "libc", -] +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "walkdir" @@ -4657,15 +3133,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -[[package]] -name = "windows-core" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" -dependencies = [ - "windows-targets 0.52.0", -] - [[package]] name = "windows-sys" version = "0.48.0" @@ -4817,25 +3284,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "ws_stream_wasm" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7999f5f4217fe3818726b66257a4475f71e74ffd190776ad053fa159e50737f5" -dependencies = [ - "async_io_stream", - "futures", - "js-sys", - "log", - "pharos", - "rustc_version 0.4.0", - "send_wrapper 0.6.0", - "thiserror", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", -] - [[package]] name = "wyz" version = "0.5.1" @@ -4857,97 +3305,13 @@ dependencies = [ ] [[package]] -name = "zerocopy" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.32" +name = "yansi" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", -] +checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" [[package]] name = "zeroize" version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" -dependencies = [ - "zeroize_derive", -] - -[[package]] -name = "zeroize_derive" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", -] - -[[package]] -name = "zeth-example" -version = "0.1.0" -dependencies = [ - "bincode", - "hex-literal", - "succinct-core", - "zeth-lib", -] - -[[package]] -name = "zeth-lib" -version = "0.1.0" -source = "git+ssh://git@github.com/succinctlabs/zeth-private.git?branch=chris/zeth-lib#8608868746ff17ed409733d08ba1072a2752bfd6" -dependencies = [ - "alloy-sol-types", - "anyhow", - "bytes", - "chrono", - "ethers-core", - "ethers-providers", - "flate2", - "hashbrown 0.14.3", - "libflate", - "log", - "once_cell", - "revm", - "ruint", - "serde", - "serde_json", - "serde_with", - "thiserror", - "tokio", - "zeth-primitives", -] - -[[package]] -name = "zeth-primitives" -version = "0.1.0" -source = "git+ssh://git@github.com/succinctlabs/zeth-private.git?branch=chris/zeth-lib#8608868746ff17ed409733d08ba1072a2752bfd6" -dependencies = [ - "alloy-primitives", - "alloy-rlp", - "alloy-rlp-derive", - "anyhow", - "bytes", - "ethers-core", - "k256", - "revm-primitives", - "rlp", - "serde", - "sha3", - "succinct-precompiles", - "thiserror", -] diff --git a/README.md b/README.md index 25d30a624f..49e117d760 100644 --- a/README.md +++ b/README.md @@ -2,53 +2,55 @@ ## Install -Make sure you have [Rust](https://www.rust-lang.org/tools/install) installed. Install the "cargo prove" CLI. -``` -git clone ssh://git@github.com/succinctlabs/vm succinct-vm -cd succinct-vm -cd cli -cargo install --locked --path . -``` +Make sure you have [Rust](https://www.rust-lang.org/tools/install) installed. Open your terminal and run the following command: -You will need to install our custom toolchain to compile programs. If you are on a supported architecture -(i.e., MacOS or Linux), install the toolchain using a prebuilt release. ``` -cargo prove install-toolchain +curl -L https://curta.succinct.xyz | bash ``` -Otherwise, you will need to build the toolchain from source. -``` -cargo prove build-toolchain -``` +This will install `curtaup`, then simply follow the instructions on the screen, which will make the `curtaup` command available in your CLI. +Running `curtaup` will install the latest (nightly) precompiled binary for `cargo-prove` and the custom rust toolchain for the zkVM. ## Quickstart -Just `cargo prove`. Run `cargo prove --help` to see all options. You can control the logging level with `RUST_LOG`. +Create a new project: ``` -cd programs/fibonacci -cargo prove +cargo prove new fibonacci ``` -To create a new project, run `cargo prove new `. +Build a binary that can be run in the zkVM: ``` -cargo prove new fibonacci -cd fibonacci +cd program && cargo prove build ``` -## Profile +Generate and verify the execution of the binary: +``` +cd script && cargo run --release +``` + +Note that the `RUST_LOG` and `RUST_TRACER` enviroment variables can be set to different status levels to get more fine-grained logging and debugging information. + +## Build -To get a performance breakdown of proving, run the profiler. You can control the logging level with `RUST_TRACER`. +If you want to build the `cargo-prove` CLI from source, run the following commands: ``` -cargo prove --profile +git clone ssh://git@github.com/succinctlabs/vm +cd vm +cd cli +cargo install --locked --path . ``` -## Benchmark +You will need to install our custom toolchain to compile programs. If you are on a supported architecture +(i.e., MacOS or Linux), install the toolchain using a prebuilt release. +``` +cargo prove install-toolchain +``` -To benchmark the proving time of programs with statistical guarantees, run the benchmark. +Otherwise, you will need to build the toolchain from source. ``` -cd core && cargo bench --features perf +cargo prove build-toolchain ``` ## Development diff --git a/cli/Cargo.toml b/cli/Cargo.toml index e2070f5931..6fdb666f83 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -5,6 +5,10 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[build-dependencies] +vergen = { version = "8", default-features = false, features = ["build", "git", "git2"] } + + [dependencies] anyhow = { version = "1.0.79", features = ["backtrace"] } cargo_metadata = "0.18.1" @@ -21,3 +25,4 @@ serde = { version = "1", features = ["derive"] } rand = "0.8" downloader = { version = "0.2", default-features = false, features = ["rustls-tls"] } serde_json = "1.0.113" +yansi = "0.5.1" diff --git a/cli/build.rs b/cli/build.rs new file mode 100644 index 0000000000..594550b4a7 --- /dev/null +++ b/cli/build.rs @@ -0,0 +1,7 @@ +fn main() { + vergen::EmitBuilder::builder() + .build_timestamp() + .git_sha(true) + .emit() + .unwrap(); +} diff --git a/cli/src/assets/program/Cargo.toml b/cli/src/assets/program/Cargo.toml new file mode 100644 index 0000000000..8063c87052 --- /dev/null +++ b/cli/src/assets/program/Cargo.toml @@ -0,0 +1,8 @@ +[workspace] +[package] +version = "0.1.0" +name = "unnamed-program" +edition = "2021" + +[dependencies] +succinct-zkvm = { git = "https://github.com/succinctlabs/vm.git" } \ No newline at end of file diff --git a/cli/src/assets/program/main.rs b/cli/src/assets/program/main.rs new file mode 100644 index 0000000000..e8838eab83 --- /dev/null +++ b/cli/src/assets/program/main.rs @@ -0,0 +1,19 @@ +//! A simple program to be proven inside the zkVM. + +#![no_main] +succinct_zkvm::entrypoint!(main); + +pub fn main() { + let n = succinct_zkvm::io::read::(); + let mut a = 0; + let mut b = 1; + let mut sum; + for _ in 1..n { + sum = a + b; + a = b; + b = sum; + } + + succinct_zkvm::io::write(&a); + succinct_zkvm::io::write(&b); +} diff --git a/cli/src/assets/script/Cargo.toml b/cli/src/assets/script/Cargo.toml new file mode 100644 index 0000000000..f073b2a4a1 --- /dev/null +++ b/cli/src/assets/script/Cargo.toml @@ -0,0 +1,8 @@ +[workspace] +[package] +version = "0.1.0" +name = "unnamed-script" +edition = "2021" + +[dependencies] +succinct-core = { git = "https://github.com/succinctlabs/vm.git" } diff --git a/cli/src/assets/script/main.rs b/cli/src/assets/script/main.rs new file mode 100644 index 0000000000..e120ab0fbb --- /dev/null +++ b/cli/src/assets/script/main.rs @@ -0,0 +1,28 @@ +//! A simple script to generate and verify the proof of a given program. + +use succinct_core::{SuccinctProver, SuccinctStdin, SuccinctVerifier}; + +const ELF: &[u8] = include_bytes!("../../program/elf/riscv32im-succinct-zkvm-elf"); + +fn main() { + // Generate proof. + let mut stdin = SuccinctStdin::new(); + stdin.write(&5000u32); + let mut proof = SuccinctProver::prove(ELF, stdin).expect("proving failed"); + + // Read output. + let a = proof.stdout.read::(); + let b = proof.stdout.read::(); + println!("a: {}", a); + println!("b: {}", b); + + // Verify proof. + SuccinctVerifier::verify(ELF, &proof).expect("verification failed"); + + // Save proof. + proof + .save("proof-with-pis.json") + .expect("saving proof failed"); + + println!("succesfully generated and verified proof for the program!") +} diff --git a/cli/src/bin/cargo-prove.rs b/cli/src/bin/cargo-prove.rs index 2e9a3f6778..53725e9fca 100644 --- a/cli/src/bin/cargo-prove.rs +++ b/cli/src/bin/cargo-prove.rs @@ -1,10 +1,19 @@ use anyhow::Result; use clap::{Parser, Subcommand}; use cli::commands::{ - build_toolchain::BuildToolchainCmd, install_toolchain::InstallToolchainCmd, new::NewCmd, - prove::ProveCmd, + build::BuildCmd, build_toolchain::BuildToolchainCmd, install_toolchain::InstallToolchainCmd, + new::NewCmd, prove::ProveCmd, }; +const VERSION_MESSAGE: &str = concat!( + env!("CARGO_PKG_VERSION"), + " (", + env!("VERGEN_GIT_SHA"), + " ", + env!("VERGEN_BUILD_TIMESTAMP"), + ")" +); + #[derive(Parser)] #[command(name = "cargo", bin_name = "cargo")] pub enum Cargo { @@ -12,7 +21,7 @@ pub enum Cargo { } #[derive(clap::Args)] -#[command(author, version, about, long_about = None, args_conflicts_with_subcommands = true)] +#[command(author, about, long_about = None, args_conflicts_with_subcommands = true, version = VERSION_MESSAGE)] pub struct ProveCli { #[clap(subcommand)] pub command: Option, @@ -24,6 +33,7 @@ pub struct ProveCli { #[derive(Subcommand)] pub enum ProveCliCommands { New(NewCmd), + Build(BuildCmd), Prove(ProveCmd), BuildToolchain(BuildToolchainCmd), InstallToolchain(InstallToolchainCmd), @@ -34,6 +44,7 @@ fn main() -> Result<()> { let command = args.command.unwrap_or(ProveCliCommands::Prove(args.prove)); match command { ProveCliCommands::New(cmd) => cmd.run(), + ProveCliCommands::Build(cmd) => cmd.run(), ProveCliCommands::Prove(cmd) => cmd.run(), ProveCliCommands::BuildToolchain(cmd) => cmd.run(), ProveCliCommands::InstallToolchain(cmd) => cmd.run(), diff --git a/cli/src/commands/build.rs b/cli/src/commands/build.rs new file mode 100644 index 0000000000..1d9fa1aec8 --- /dev/null +++ b/cli/src/commands/build.rs @@ -0,0 +1,50 @@ +use anyhow::Result; +use clap::Parser; +use std::{fs, process::Command}; + +use crate::CommandExecutor; + +#[derive(Parser)] +#[command(name = "build", about = "(default) Build a program")] +pub struct BuildCmd { + #[clap(long, action)] + verbose: bool, +} + +impl BuildCmd { + pub fn run(&self) -> Result<()> { + let metadata_cmd = cargo_metadata::MetadataCommand::new(); + let metadata = metadata_cmd.exec().unwrap(); + let root_package = metadata.root_package(); + let root_package_name = root_package.as_ref().map(|p| &p.name); + + let build_target = "riscv32im-succinct-zkvm-elf"; + let rust_flags = [ + "-C", + "passes=loweratomic", + "-C", + "link-arg=-Ttext=0x00200800", + "-C", + "panic=abort", + ]; + + Command::new("cargo") + .env("RUSTUP_TOOLCHAIN", "succinct") + .env("CARGO_ENCODED_RUSTFLAGS", rust_flags.join("\x1f")) + .env("SUCCINCT_BUILD_IGNORE", "1") + .args(["build", "--release", "--target", build_target, "--locked"]) + .run() + .unwrap(); + + let elf_path = metadata + .target_directory + .join(build_target) + .join("release") + .join(root_package_name.unwrap()); + let elf_dir = metadata.target_directory.parent().unwrap().join("elf"); + fs::create_dir_all(&elf_dir)?; + fs::copy(elf_path, elf_dir.join("riscv32im-succinct-zkvm-elf"))?; + + Ok(()) + } +} diff --git a/cli/src/commands/install_toolchain.rs b/cli/src/commands/install_toolchain.rs index 9c5258bfb7..c2f0816d10 100644 --- a/cli/src/commands/install_toolchain.rs +++ b/cli/src/commands/install_toolchain.rs @@ -28,11 +28,32 @@ impl InstallToolchainCmd { // Setup variables. let root_dir = home_dir().unwrap().join(".cargo-prove"); - match fs::remove_dir_all(&root_dir) { - Ok(_) => println!("Succesfully removed existing ~/.cargo-prove directory.."), + match fs::read_dir(&root_dir) { + Ok(entries) => + { + #[allow(clippy::manual_flatten)] + for entry in entries { + if let Ok(entry) = entry { + let entry_path = entry.path(); + if entry_path.is_dir() && entry_path.file_name().unwrap() != "bin" { + if let Err(err) = fs::remove_dir_all(&entry_path) { + println!("Failed to remove directory {:?}: {}", entry_path, err); + } + } else if entry_path.is_file() && entry_path.file_name().unwrap() != "bin" { + if let Err(err) = fs::remove_file(&entry_path) { + println!("Failed to remove file {:?}: {}", entry_path, err); + } + } + } + } + } Err(_) => println!("No existing ~/.cargo-prove directory to remove."), } - fs::create_dir_all(&root_dir)?; + println!("Succesfully cleaned up ~/.cargo-prove directory."); + match fs::create_dir_all(&root_dir) { + Ok(_) => println!("Succesfully created ~/.cargo-prove directory."), + Err(err) => println!("Failed to create ~/.cargo-prove directory: {}", err), + }; let target = get_target(); let toolchain_asset_name = format!("rust-toolchain-{}.tar.gz", target); let toolchain_archive_path = root_dir.join(toolchain_asset_name.clone()); diff --git a/cli/src/commands/mod.rs b/cli/src/commands/mod.rs index 3452fbdcd6..cdbcc19a8d 100644 --- a/cli/src/commands/mod.rs +++ b/cli/src/commands/mod.rs @@ -1,3 +1,4 @@ +pub mod build; pub mod build_toolchain; pub mod install_toolchain; pub mod new; diff --git a/cli/src/commands/new.rs b/cli/src/commands/new.rs index 1a41d906d3..1a2524f225 100644 --- a/cli/src/commands/new.rs +++ b/cli/src/commands/new.rs @@ -1,33 +1,59 @@ use anyhow::Result; use clap::Parser; use std::{fs, path::Path}; +use yansi::Paint; -const CARGO_TOML: &str = include_str!("../assets/Cargo.toml"); -const MAIN_RS: &str = include_str!("../assets/main.rs"); +const PROGRAM_CARGO_TOML: &str = include_str!("../assets/program/Cargo.toml"); +const PROGRAM_MAIN_RS: &str = include_str!("../assets/program/main.rs"); +const SCRIPT_CARGO_TOML: &str = include_str!("../assets/script/Cargo.toml"); +const SCRIPT_MAIN_RS: &str = include_str!("../assets/script/main.rs"); #[derive(Parser)] -#[command(name = "new", about = "Setup a new zkVM cargo project.")] +#[command( + name = "new", + about = "Setup a new project that runs inside the Curta zkVM." +)] pub struct NewCmd { name: String, } impl NewCmd { pub fn run(&self) -> Result<()> { + let root = Path::new(&self.name); + let program_root = root.join("program"); + let script_root = root.join("script"); + + // Create the root directory. fs::create_dir(&self.name)?; - let root = Path::new(&self.name); - let cargo_toml_path = root.join("Cargo.toml"); - let src_dir = root.join("src"); - let main_path = src_dir.join("main.rs"); - let elf_path = root.join("elf"); - let elf_binary_path = elf_path.join("riscv32im-succinct-zkvm-elf"); - - fs::create_dir(&src_dir)?; - fs::create_dir(&elf_path)?; - - fs::write(cargo_toml_path, CARGO_TOML.replace("unnamed", &self.name))?; - fs::write(main_path, MAIN_RS)?; - fs::write(elf_binary_path, "")?; + // Create the program directory. + fs::create_dir(&program_root)?; + fs::create_dir(program_root.join("src"))?; + fs::create_dir(program_root.join("elf"))?; + fs::write( + program_root.join("Cargo.toml"), + PROGRAM_CARGO_TOML.replace("unnamed", &self.name), + )?; + fs::write(program_root.join("src").join("main.rs"), PROGRAM_MAIN_RS)?; + + // Create the runner directory. + fs::create_dir(&script_root)?; + fs::create_dir(script_root.join("src"))?; + fs::write( + script_root.join("Cargo.toml"), + SCRIPT_CARGO_TOML.replace("unnamed", &self.name), + )?; + fs::write(script_root.join("src").join("main.rs"), SCRIPT_MAIN_RS)?; + + println!( + " \x1b[1m{}\x1b[0m {} ({})", + Paint::green("Initialized"), + self.name, + std::fs::canonicalize(root) + .expect("failed to canonicalize") + .to_str() + .unwrap() + ); Ok(()) } diff --git a/cli/src/commands/prove.rs b/cli/src/commands/prove.rs index 91d0d2ff33..6b5650e0f3 100644 --- a/cli/src/commands/prove.rs +++ b/cli/src/commands/prove.rs @@ -9,7 +9,7 @@ use succinct_core::{ use crate::CommandExecutor; #[derive(Parser)] -#[command(name = "prove", about = "(default) Build and prove a Rust program")] +#[command(name = "prove", about = "Build and prove a program")] pub struct ProveCmd { #[clap(short, long, value_parser, num_args = 1.., value_delimiter = ' ')] input: Vec, @@ -40,6 +40,7 @@ impl ProveCmd { "-C", "panic=abort", ]; + Command::new("cargo") .env("RUSTUP_TOOLCHAIN", "succinct") .env("CARGO_ENCODED_RUSTFLAGS", rust_flags.join("\x1f")) diff --git a/core/Cargo.toml b/core/Cargo.toml index 94a0e7e601..0769567f01 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -52,6 +52,7 @@ serde_json = { version = "1.0.113", default-features = false, features = [ ] } k256 = { version = "0.13.3", features = ["expose-field"] } elliptic-curve = "0.13.8" +anyhow = "1.0.79" serial_test = "3.0.0" [dev-dependencies] diff --git a/core/src/io.rs b/core/src/io.rs new file mode 100644 index 0000000000..b8fcb917bd --- /dev/null +++ b/core/src/io.rs @@ -0,0 +1,77 @@ +use serde::{de::DeserializeOwned, Deserialize, Serialize}; + +use crate::utils::{BabyBearBlake3, Buffer}; +use crate::Proof; + +/// Standard input for the prover. +#[derive(Serialize, Deserialize)] +pub struct SuccinctStdin { + pub buffer: Buffer, +} + +/// Standard output for the prover. +#[derive(Serialize, Deserialize)] +pub struct SuccinctStdout { + pub buffer: Buffer, +} + +impl SuccinctStdin { + /// Create a new `SuccinctStdin`. + pub fn new() -> Self { + Self { + buffer: Buffer::new(), + } + } + + /// Create a `SuccinctStdin` from a slice of bytes. + pub fn from(data: &[u8]) -> Self { + Self { + buffer: Buffer::from(data), + } + } + + /// Read a value from the buffer. + pub fn read(&mut self) -> T { + self.buffer.read() + } + + /// Write a value to the buffer. + pub fn write(&mut self, data: &T) { + self.buffer.write(data); + } +} + +impl SuccinctStdout { + /// Create a new `SuccinctStdout`. + pub fn new() -> Self { + Self { + buffer: Buffer::new(), + } + } + + /// Create a `SuccinctStdout` from a slice of bytes. + pub fn from(data: &[u8]) -> Self { + Self { + buffer: Buffer::from(data), + } + } + + /// Read a value from the buffer. + pub fn read(&mut self) -> T { + self.buffer.read() + } + + /// Write a value to the buffer. + pub fn write(&mut self, data: &T) { + self.buffer.write(data); + } +} + +pub fn serialize_proof(proof: &Proof, serializer: S) -> Result +where + S: serde::Serializer, +{ + let bytes = bincode::serialize(proof).unwrap(); + let hex_bytes = hex::encode(bytes); + serializer.serialize_str(&hex_bytes) +} diff --git a/core/src/lib.rs b/core/src/lib.rs index 8231b3c974..dc63717914 100644 --- a/core/src/lib.rs +++ b/core/src/lib.rs @@ -20,6 +20,7 @@ pub mod chip; pub mod cpu; pub mod disassembler; pub mod field; +pub mod io; pub mod lookup; pub mod memory; pub mod operations; @@ -29,39 +30,70 @@ pub mod stark; pub mod syscall; pub mod utils; +pub use io::*; + +use anyhow::Result; use runtime::{Program, Runtime}; use serde::Serialize; -use utils::prove_core; +use stark::{ProgramVerificationError, Proof}; +use std::fs; +use utils::{prove_core, BabyBearBlake3, StarkUtils}; + +/// A prover that can prove RISCV ELFs. +pub struct SuccinctProver; + +/// A verifier that can verify proofs generated by `SuccinctProver`. +pub struct SuccinctVerifier; -pub struct SuccinctProver { - stdin: Vec, +/// A proof of a RISCV ELF execution with given inputs and outputs. +#[derive(Serialize)] +pub struct SuccinctProofWithIO { + #[serde(serialize_with = "serialize_proof")] + pub proof: Proof, + pub stdin: SuccinctStdin, + pub stdout: SuccinctStdout, } impl SuccinctProver { - pub fn new() -> Self { - Self { stdin: Vec::new() } - } - - pub fn write_stdin(&mut self, input: &T) { - let mut buf = Vec::new(); - bincode::serialize_into(&mut buf, input).expect("serialization failed"); - self.stdin.extend(buf); + /// Executes the elf with the given inputs and returns the output. + pub fn execute(elf: &[u8], stdin: SuccinctStdin) -> Result { + let program = Program::from(elf); + let mut runtime = Runtime::new(program); + runtime.write_stdin_slice(&stdin.buffer.data); + runtime.run(); + Ok(SuccinctStdout::from(&runtime.state.output_stream)) } - pub fn run(&self, elf: &[u8]) -> Runtime { + /// Generate a proof for the execution of the ELF with the given public inputs. + pub fn prove(elf: &[u8], stdin: SuccinctStdin) -> Result { let program = Program::from(elf); let mut runtime = Runtime::new(program); - runtime.write_stdin_slice(&self.stdin); + runtime.write_stdin_slice(&stdin.buffer.data); runtime.run(); - runtime + let proof = prove_core(&mut runtime); + Ok(SuccinctProofWithIO { + proof, + stdin, + stdout: SuccinctStdout::from(&runtime.state.output_stream), + }) } +} - pub fn prove(&self, runtime: &mut Runtime) { - prove_core(runtime); +impl SuccinctVerifier { + /// Verify a proof generated by `SuccinctProver`. + #[allow(unused_variables)] + pub fn verify(elf: &[u8], proof: &SuccinctProofWithIO) -> Result<(), ProgramVerificationError> { + let config = BabyBearBlake3::new(); + let mut challenger = config.challenger(); + Runtime::verify(&config, &mut challenger, &proof.proof) } +} - pub fn run_and_prove(&self, elf: &[u8]) { - let mut runtime = self.run(elf); - self.prove(&mut runtime); +impl SuccinctProofWithIO { + /// Saves the proof as a JSON to the given path. + pub fn save(&self, path: &str) -> Result<()> { + let data = serde_json::to_string(self).unwrap(); + fs::write(path, data).unwrap(); + Ok(()) } } diff --git a/core/src/stark/mod.rs b/core/src/stark/mod.rs index 1dea1ed0e7..12d84f989d 100644 --- a/core/src/stark/mod.rs +++ b/core/src/stark/mod.rs @@ -13,6 +13,7 @@ pub use config::*; pub use debug::*; pub use folder::*; pub use prover::*; +pub use runtime::ProgramVerificationError; pub use types::*; pub use verifier::*; diff --git a/core/src/stark/runtime.rs b/core/src/stark/runtime.rs index 5cdfebfc3f..be4b42c340 100644 --- a/core/src/stark/runtime.rs +++ b/core/src/stark/runtime.rs @@ -103,7 +103,6 @@ impl Runtime { } pub fn verify( - &mut self, config: &SC, challenger: &mut SC::Challenger, proof: &Proof, diff --git a/core/src/syscall/precompiles/edwards/ed_add.rs b/core/src/syscall/precompiles/edwards/ed_add.rs index 5b582450e0..5b82f0566b 100644 --- a/core/src/syscall/precompiles/edwards/ed_add.rs +++ b/core/src/syscall/precompiles/edwards/ed_add.rs @@ -290,20 +290,18 @@ mod tests { self, tests::{ED25519_ELF, ED_ADD_ELF}, }, - SuccinctProver, + SuccinctProver, SuccinctStdin, }; #[test] fn test_ed_add_simple() { utils::setup_logger(); - let prover = SuccinctProver::new(); - prover.run_and_prove(ED_ADD_ELF); + SuccinctProver::prove(ED_ADD_ELF, SuccinctStdin::new()).unwrap(); } #[test] fn test_ed25519_program() { utils::setup_logger(); - let prover = SuccinctProver::new(); - prover.run_and_prove(ED25519_ELF); + SuccinctProver::prove(ED25519_ELF, SuccinctStdin::new()).unwrap(); } } diff --git a/core/src/syscall/precompiles/edwards/ed_decompress.rs b/core/src/syscall/precompiles/edwards/ed_decompress.rs index 72a2c59621..e5428e0a56 100644 --- a/core/src/syscall/precompiles/edwards/ed_decompress.rs +++ b/core/src/syscall/precompiles/edwards/ed_decompress.rs @@ -328,13 +328,12 @@ where pub mod tests { use crate::{ utils::{self, tests::ED_DECOMPRESS_ELF}, - SuccinctProver, + SuccinctProver, SuccinctStdin, }; #[test] fn test_ed_decompress() { utils::setup_logger(); - let prover = SuccinctProver::new(); - prover.run_and_prove(ED_DECOMPRESS_ELF); + SuccinctProver::prove(ED_DECOMPRESS_ELF, SuccinctStdin::new()).unwrap(); } } diff --git a/core/src/syscall/precompiles/keccak256/mod.rs b/core/src/syscall/precompiles/keccak256/mod.rs index e63d0c3d7d..b01ffeae96 100644 --- a/core/src/syscall/precompiles/keccak256/mod.rs +++ b/core/src/syscall/precompiles/keccak256/mod.rs @@ -49,7 +49,7 @@ pub mod permute_tests { runtime::{Instruction, Opcode, Program, Runtime}, stark::LocalProver, utils::{self, tests::KECCAK_PERMUTE_ELF, BabyBearPoseidon2, StarkUtils}, - SuccinctProver, + SuccinctProver, SuccinctStdin, }; pub fn keccak_permute_program() -> Program { @@ -100,7 +100,6 @@ pub mod permute_tests { #[test] fn test_keccak_permute_program_prove() { utils::setup_logger(); - let prover = SuccinctProver::new(); - prover.run_and_prove(KECCAK_PERMUTE_ELF); + SuccinctProver::prove(KECCAK_PERMUTE_ELF, SuccinctStdin::new()).unwrap(); } } diff --git a/core/src/utils/buffer.rs b/core/src/utils/buffer.rs new file mode 100644 index 0000000000..14af6a1984 --- /dev/null +++ b/core/src/utils/buffer.rs @@ -0,0 +1,45 @@ +use serde::{de::DeserializeOwned, Deserialize, Serialize}; + +/// A buffer of serializable/deserializable objects. +#[derive(Serialize, Deserialize)] +pub struct Buffer { + pub data: Vec, + pub ptr: usize, +} + +impl Buffer { + pub fn new() -> Self { + Self { + data: Vec::new(), + ptr: 0, + } + } + + pub fn from(data: &[u8]) -> Self { + Self { + data: data.to_vec(), + ptr: 0, + } + } + + /// Set the position ptr to the beggining of the buffer. + pub fn head(&mut self) { + self.ptr = 0; + } + + /// Read the serializable object from the buffer. + pub fn read(&mut self) -> T { + let result: T = + bincode::deserialize(&self.data[self.ptr..]).expect("failed to deserialize"); + let nb_bytes = bincode::serialized_size(&result).expect("failed to get serialized size"); + self.ptr += nb_bytes as usize; + result + } + + /// Write the serializable object from the buffer. + pub fn write(&mut self, data: &T) { + let mut tmp = Vec::new(); + bincode::serialize_into(&mut tmp, data).expect("serialization failed"); + self.data.extend(tmp); + } +} diff --git a/core/src/utils/mod.rs b/core/src/utils/mod.rs index 2ebc19f89e..3efd0cba4d 100644 --- a/core/src/utils/mod.rs +++ b/core/src/utils/mod.rs @@ -1,3 +1,4 @@ +mod buffer; pub mod ec; pub mod env; mod logger; @@ -6,6 +7,7 @@ mod programs; mod prove; mod tracer; +pub use buffer::*; pub use logger::*; pub use prove::*; pub use tracer::*; diff --git a/core/src/utils/prove.rs b/core/src/utils/prove.rs index f0c2f8543a..29ecf37ae1 100644 --- a/core/src/utils/prove.rs +++ b/core/src/utils/prove.rs @@ -88,7 +88,7 @@ pub fn prove_core(runtime: &mut Runtime) -> crate::stark::Proof // Verify the proof. let mut challenger = config.challenger(); - runtime.verify(&config, &mut challenger, &proof).unwrap(); + Runtime::verify(&config, &mut challenger, &proof).unwrap(); proof } diff --git a/curtaup/curtaup b/curtaup/curtaup new file mode 100644 index 0000000000..d7b40c5c65 --- /dev/null +++ b/curtaup/curtaup @@ -0,0 +1,311 @@ +#!/usr/bin/env bash + +# Reference: https://github.com/foundry-rs/foundry/blob/master/foundryup/foundryup + +set -eo pipefail + +BASE_DIR=${XDG_CONFIG_HOME:-$HOME} +CURTA_DIR=${CURTA_DIR:-"$BASE_DIR/.cargo-prove"} +CURTA_BIN_DIR="$CURTA_DIR/bin" +mkdir -p $CURTA_BIN_DIR + +BINS=(cargo-prove) + +export RUSTFLAGS="-C target-cpu=native" + +main() { + need_cmd git + need_cmd curl + + while [[ -n $1 ]]; do + case $1 in + --) shift; break;; + + -r|--repo) shift; CURTAUP_REPO=$1;; + -b|--branch) shift; CURTAUP_BRANCH=$1;; + -v|--version) shift; CURTAUP_VERSION=$1;; + -p|--path) shift; CURTAUP_LOCAL_REPO=$1;; + -P|--pr) shift; CURTAUP_PR=$1;; + -C|--commit) shift; CURTAUP_COMMIT=$1;; + --arch) shift; CURTAUP_ARCH=$1;; + --platform) shift; CURTAUP_PLATFORM=$1;; + -h|--help) + usage + exit 0 + ;; + *) + warn "unknown option: $1" + usage + exit 1 + esac; shift + done + + # Print the banner after successfully parsing args + banner + + if [ -n "$CURTAUP_PR" ]; then + if [ -z "$CURTAUP_BRANCH" ]; then + CURTAUP_BRANCH="refs/pull/$CURTAUP_PR/head" + else + err "can't use --pr and --branch at the same time" + fi + fi + + # Installs curta from a local repository if --path parameter is provided + if [[ -n "$CURTAUP_LOCAL_REPO" ]]; then + need_cmd cargo + + # Ignore branches/versions as we do not want to modify local git state + if [ -n "$CURTAUP_REPO" ] || [ -n "$CURTAUP_BRANCH" ] || [ -n "$CURTAUP_VERSION" ]; then + warn "--branch, --version, and --repo arguments are ignored during local install" + fi + + # Enter local repo and build + say "installing from $CURTAUP_LOCAL_REPO" + cd "$CURTAUP_LOCAL_REPO" + ensure cargo build --bins --release # need 4 speed + + for bin in "${BINS[@]}"; do + # Remove prior installations if they exist + rm -f "$CURTA_BIN_DIR/$bin" + # Symlink from local repo binaries to bin dir + ensure ln -s "$PWD/target/release/$bin" "$CURTA_BIN_DIR/$bin" + done + + say "done" + exit 0 + fi + + CURTAUP_REPO=${CURTAUP_REPO:-succinctlabs/vm} + + # Install by downloading binaries + if [[ "$CURTAUP_REPO" == "succinctlabs/vm" && -z "$CURTAUP_BRANCH" && -z "$CURTAUP_COMMIT" ]]; then + CURTAUP_VERSION=${CURTAUP_VERSION:-nightly} + CURTAUP_TAG=$CURTAUP_VERSION + + # Normalize versions (handle channels, versions without v prefix + if [[ "$CURTAUP_VERSION" =~ ^nightly ]]; then + CURTAUP_VERSION="nightly" + elif [[ "$CURTAUP_VERSION" == [[:digit:]]* ]]; then + # Add v prefix + CURTAUP_VERSION="v${CURTAUP_VERSION}" + CURTAUP_TAG="${CURTAUP_VERSION}" + fi + + say "installing curta (version ${CURTAUP_VERSION}, tag ${CURTAUP_TAG})" + + uname_s=$(uname -s) + PLATFORM=$(tolower "${CURTAUP_PLATFORM:-$uname_s}") + EXT="tar.gz" + case $PLATFORM in + linux) ;; + darwin|mac*) + PLATFORM="darwin" + ;; + mingw*|win*) + EXT="zip" + PLATFORM="win32" + ;; + *) + err "unsupported platform: $PLATFORM" + ;; + esac + + uname_m=$(uname -m) + ARCHITECTURE=$(tolower "${CURTAUP_ARCH:-$uname_m}") + if [ "${ARCHITECTURE}" = "x86_64" ]; then + # Redirect stderr to /dev/null to avoid printing errors if non Rosetta. + if [ "$(sysctl -n sysctl.proc_translated 2>/dev/null)" = "1" ]; then + ARCHITECTURE="arm64" # Rosetta. + else + ARCHITECTURE="amd64" # Intel. + fi + elif [ "${ARCHITECTURE}" = "arm64" ] ||[ "${ARCHITECTURE}" = "aarch64" ] ; then + ARCHITECTURE="arm64" # Arm. + else + ARCHITECTURE="amd64" # Amd. + fi + + # Compute the URL of the release tarball in the curta repository. + RELEASE_URL="https://github.com/${CURTAUP_REPO}/releases/download/${CURTAUP_TAG}/" + RELEASE_URL="https://curta-vm-artifacts.s3.us-west-2.amazonaws.com/" + BIN_ARCHIVE_URL="${RELEASE_URL}cargo_prove_${CURTAUP_VERSION}_${PLATFORM}_${ARCHITECTURE}.$EXT" + MAN_TARBALL_URL="${RELEASE_URL}cargo_prove_man_${CURTAUP_VERSION}.tar.gz" + + # Download and extract the binaries archive + say "downloading latest cargo-prove" + if [ "$PLATFORM" = "win32" ]; then + tmp="$(mktemp -d 2>/dev/null || echo ".")/cargo-prove.zip" + ensure download "$BIN_ARCHIVE_URL" "$tmp" + ensure unzip "$tmp" -d "$CURTA_BIN_DIR" + rm -f "$tmp" + else + ensure download "$BIN_ARCHIVE_URL" | ensure tar -xzC "$CURTA_BIN_DIR" + fi + + for bin in "${BINS[@]}"; do + bin_path="$CURTA_BIN_DIR/$bin" + + # Print installed msg + say "installed - $(ensure "$bin_path" prove --version)" + + # Check if the default path of the binary is not in CURTA_BIN_DIR + which_path="$(command -v "$bin" || true)" + if [ -n "$which_path" ] && [ "$which_path" != "$bin_path" ]; then + warn "" + cat 1>&2 <&2 < + +OPTIONS: + -h, --help Print help information + -v, --version Install a specific version + -b, --branch Install a specific branch + -P, --pr Install a specific Pull Request + -C, --commit Install a specific commit + -r, --repo Install from a remote GitHub repo (uses default branch if no other options are set) + -p, --path Install a local repository + --arch Install a specific architecture (supports amd64 and arm64) + --platform Install a specific platform (supports win32, linux, and darwin) +EOF +} + +say() { + printf "curtaup: %s\n" "$1" +} + +warn() { + say "warning: ${1}" >&2 +} + +err() { + say "$1" >&2 + exit 1 +} + +tolower() { + echo "$1" | awk '{print tolower($0)}' +} + +need_cmd() { + if ! check_cmd "$1"; then + err "need '$1' (command not found)" + fi +} + +check_cmd() { + command -v "$1" &>/dev/null +} + +# Run a command that should never fail. If the command fails execution +# will immediately terminate with an error showing the failing command. +ensure() { + if ! "$@"; then err "command failed: $*"; fi +} + +# Downloads $1 into $2 or stdout +download() { + if [ -n "$2" ]; then + # output into $2 + if check_cmd curl; then + curl -#o "$2" -L "$1" + else + wget --show-progress -qO "$2" "$1" + fi + else + # output to stdout + if check_cmd curl; then + curl -#L "$1" + else + wget --show-progress -qO- "$1" + fi + fi +} + +# Banner Function for curta +banner() { + printf " +.______ ._______ ._______ ._______ ._______ ._______ ._______ ._______ ._______ + + ________ ______ _________ + / ____/ / / / __ \/_ __/ | + / / / / / / /_/ / / / / /| | Let's build the world's best +/ /___/ /_/ / _, _/ / / / ___ | zkVM, together. +\____/\____/_/ |_| /_/ /_/ |_| + +._______ ._______ ._______ ._______ ._______ ._______ ._______ ._______ ._______ + +Repo : https://github.com/succinctlabs/curta +Book : https://curta.succinct.xyz +Chat : https://t.me/curta/ +Support : https://t.me/curta-support/ + +._______ ._______ ._______ ._______ ._______ ._______ ._______ ._______ ._______ + +" +} + + +main "$@" \ No newline at end of file diff --git a/curtaup/install b/curtaup/install new file mode 100644 index 0000000000..184d040fcb --- /dev/null +++ b/curtaup/install @@ -0,0 +1,62 @@ +#!/usr/bin/env bash + +# Reference: https://github.com/foundry-rs/foundry/blob/master/foundryup/install + +set -e + +echo Installing curtaup... + +BASE_DIR=${XDG_CONFIG_HOME:-$HOME} +CURTA_DIR=${CURTA_DIR-"$BASE_DIR/.cargo-prove"} +CURTA_BIN_DIR="$CURTA_DIR/bin" + +BIN_URL="https://raw.githubusercontent.com/succinctlabs/vm/main/curtaup/curtaup" +BIN_PATH="$CURTA_BIN_DIR/curtaup" + + +# Create the .cargo-prove bin directory and curtaup binary if it doesn't exist. +mkdir -p $CURTA_BIN_DIR +curl -# -L $BIN_URL -o $BIN_PATH +chmod +x $BIN_PATH + +# Store the correct profile file (i.e. .profile for bash or .zshenv for ZSH). +case $SHELL in +*/zsh) + PROFILE=${ZDOTDIR-"$HOME"}/.zshenv + PREF_SHELL=zsh + ;; +*/bash) + PROFILE=$HOME/.bashrc + PREF_SHELL=bash + ;; +*/fish) + PROFILE=$HOME/.config/fish/config.fish + PREF_SHELL=fish + ;; +*/ash) + PROFILE=$HOME/.profile + PREF_SHELL=ash + ;; +*) + echo "curtaup: could not detect shell, manually add ${CURTA_BIN_DIR} to your PATH." + exit 1 +esac + +# Only add curtaup if it isn't already in PATH. +if [[ ":$PATH:" != *":${CURTA_BIN_DIR}:"* ]]; then + # Add the curtaup directory to the path and ensure the old PATH variables remain. + echo >> $PROFILE && echo "export PATH=\"\$PATH:$CURTA_BIN_DIR\"" >> $PROFILE +fi + +# Warn MacOS users that they may need to manually install libusb via Homebrew: +if [[ "$OSTYPE" =~ ^darwin ]] && [[ ! -f /usr/local/opt/libusb/lib/libusb-1.0.0.dylib && ! -f /opt/homebrew/opt/libusb/lib/libusb-1.0.0.dylib ]]; then + echo && echo "warning: libusb not found. You may need to install it manually on MacOS via Homebrew (brew install libusb)." +fi + +# Warn MacOS users that they may need to manually install opensll via Homebrew: +if [[ "$OSTYPE" =~ ^darwin ]] && [[ ! -f /usr/local/opt/openssl/lib/libssl.3.dylib && ! -f /opt/homebrew/opt/openssl/lib/libssl.3.dylib ]]; then + echo && echo "warning: libusb not found. You may need to install it manually on MacOS via Homebrew (brew install openssl)." +fi + +echo && echo "Detected your preferred shell is ${PREF_SHELL} and added curtaup to PATH. Run 'source ${PROFILE}' or start a new terminal session to use curtaup." +echo "Then, simply run 'curtaup' to install Curta." \ No newline at end of file diff --git a/examples/ed25519/src/main.rs b/examples/ed25519/src/main.rs index 758a52c634..646eb238f9 100644 --- a/examples/ed25519/src/main.rs +++ b/examples/ed25519/src/main.rs @@ -1,11 +1,20 @@ -use succinct_core::{utils, SuccinctProver}; +use succinct_core::{SuccinctProver, SuccinctStdin, SuccinctVerifier}; const ED25519_ELF: &[u8] = include_bytes!("../../../programs/demo/ed25519/elf/riscv32im-succinct-zkvm-elf"); fn main() { - std::env::set_var("RUST_LOG", "info"); - utils::setup_logger(); - let prover = SuccinctProver::new(); - prover.run_and_prove(ED25519_ELF); + // Generate proof. + let stdin = SuccinctStdin::new(); + let proof = SuccinctProver::prove(ED25519_ELF, stdin).expect("proving failed"); + + // Verify proof. + SuccinctVerifier::verify(ED25519_ELF, &proof).expect("verification failed"); + + // Save proof. + proof + .save("proof-with-pis.json") + .expect("saving proof failed"); + + println!("succesfully generated and verified proof for the program!") } diff --git a/examples/fibonacci/Cargo.toml b/examples/fibonacci-io/Cargo.toml similarity index 76% rename from examples/fibonacci/Cargo.toml rename to examples/fibonacci-io/Cargo.toml index 932f53e709..4aa409ba22 100644 --- a/examples/fibonacci/Cargo.toml +++ b/examples/fibonacci-io/Cargo.toml @@ -1,6 +1,6 @@ [package] version = "0.1.0" -name = "fibonacci-example" +name = "fibonacci-io-example" edition = "2021" [dependencies] diff --git a/examples/fibonacci-io/src/main.rs b/examples/fibonacci-io/src/main.rs new file mode 100644 index 0000000000..117e497bd8 --- /dev/null +++ b/examples/fibonacci-io/src/main.rs @@ -0,0 +1,27 @@ +use succinct_core::{SuccinctProver, SuccinctStdin, SuccinctVerifier}; + +const FIBONACCI_IO_ELF: &[u8] = + include_bytes!("../../../programs/demo/fibonacci-io/elf/riscv32im-succinct-zkvm-elf"); + +fn main() { + // Generate proof. + let mut stdin = SuccinctStdin::new(); + stdin.write(&5000u32); + let mut proof = SuccinctProver::prove(FIBONACCI_IO_ELF, stdin).expect("proving failed"); + + // Read output. + let a = proof.stdout.read::(); + let b = proof.stdout.read::(); + println!("a: {}", a); + println!("b: {}", b); + + // Verify proof. + SuccinctVerifier::verify(FIBONACCI_IO_ELF, &proof).expect("verification failed"); + + // Save proof. + proof + .save("proof-with-pis.json") + .expect("saving proof failed"); + + println!("succesfully generated and verified proof for the program!") +} diff --git a/examples/fibonacci/src/main.rs b/examples/fibonacci/src/main.rs deleted file mode 100644 index f42ef3eb65..0000000000 --- a/examples/fibonacci/src/main.rs +++ /dev/null @@ -1,11 +0,0 @@ -use succinct_core::{utils, SuccinctProver}; - -const FIBONACCI_ELF: &[u8] = - include_bytes!("../../../programs/demo/fibonacci/elf/riscv32im-succinct-zkvm-elf"); - -fn main() { - std::env::set_var("RUST_LOG", "info"); - utils::setup_logger(); - let prover = SuccinctProver::new(); - prover.run_and_prove(FIBONACCI_ELF); -} diff --git a/examples/io/Cargo.toml b/examples/io/Cargo.toml deleted file mode 100644 index 35b7f2412a..0000000000 --- a/examples/io/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -version = "0.1.0" -name = "io-example" -edition = "2021" - -[dependencies] -succinct-core = { path = "../../core" } -serde = { version = "1.0", features = ["derive"] } \ No newline at end of file diff --git a/examples/io/src/main.rs b/examples/io/src/main.rs deleted file mode 100644 index 2675e784e3..0000000000 --- a/examples/io/src/main.rs +++ /dev/null @@ -1,30 +0,0 @@ -use serde::{Deserialize, Serialize}; -use succinct_core::{utils, SuccinctProver}; - -const IO_ELF: &[u8] = include_bytes!("../../../programs/demo/io/elf/riscv32im-succinct-zkvm-elf"); - -#[derive(Serialize, Deserialize, Debug, PartialEq)] -struct MyPointUnaligned { - pub x: usize, - pub y: usize, - pub b: bool, -} - -fn main() { - std::env::set_var("RUST_LOG", "info"); - utils::setup_logger(); - let p1 = MyPointUnaligned { - x: 3, - y: 5, - b: true, - }; - let p2 = MyPointUnaligned { - x: 8, - y: 19, - b: true, - }; - let mut prover = SuccinctProver::new(); - prover.write_stdin::(&p1); - prover.write_stdin::(&p2); - prover.run_and_prove(IO_ELF); -} diff --git a/examples/zeth/Cargo.toml b/examples/zeth/Cargo.toml deleted file mode 100644 index ebf9fc5660..0000000000 --- a/examples/zeth/Cargo.toml +++ /dev/null @@ -1,10 +0,0 @@ -[package] -version = "0.1.0" -name = "zeth-example" -edition = "2021" - -[dependencies] -bincode = "1.3.3" -hex-literal = "0.4.1" -succinct-core = { path = "../../core" } -zeth-lib = { git = "ssh://git@github.com/succinctlabs/zeth-private.git", branch = "chris/zeth-lib", default-features = false } diff --git a/examples/zeth/fixtures/19116035.bin b/examples/zeth/fixtures/19116035.bin deleted file mode 100644 index 7ae86f4370..0000000000 Binary files a/examples/zeth/fixtures/19116035.bin and /dev/null differ diff --git a/examples/zeth/src/main.rs b/examples/zeth/src/main.rs deleted file mode 100644 index 8ab4d2dd81..0000000000 --- a/examples/zeth/src/main.rs +++ /dev/null @@ -1,24 +0,0 @@ -use hex_literal::hex; -use std::{fs::File, io::Read}; -use succinct_core::{utils, SuccinctProver}; -use zeth_lib::{input::Input, EthereumTxEssence}; - -const ZETH_ELF: &[u8] = - include_bytes!("../../../programs/demo/zeth/elf/riscv32im-succinct-zkvm-elf"); - -fn main() { - utils::setup_logger(); - - let file = File::open("./fixtures/19116035.bin").unwrap(); - let input: Input = bincode::deserialize_from(file).unwrap(); - - let mut prover = SuccinctProver::new(); - prover.write_stdin::>(&input); - let mut runtime = prover.run(ZETH_ELF); - let mut result_hash = [0u8; 32]; - runtime.read_exact(&mut result_hash).unwrap(); - let expected_hash = hex!("09ab1a9eed392e53193a9ab5201e81f7cbcdb3ed5f4c51f46e16589ad847e113"); - assert_eq!(result_hash, expected_hash); - - prover.prove(&mut runtime); -} diff --git a/programs/demo/fibonacci-io/Cargo.lock b/programs/demo/fibonacci-io/Cargo.lock new file mode 100644 index 0000000000..8efe9afeec --- /dev/null +++ b/programs/demo/fibonacci-io/Cargo.lock @@ -0,0 +1,462 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "anyhow" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" + +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + +[[package]] +name = "base64ct" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" + +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + +[[package]] +name = "bitvec" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + +[[package]] +name = "cpufeatures" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +dependencies = [ + "libc", +] + +[[package]] +name = "crypto-bigint" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" +dependencies = [ + "generic-array", + "rand_core", + "subtle", + "zeroize", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "der" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" +dependencies = [ + "const-oid", + "zeroize", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "const-oid", + "crypto-common", + "subtle", +] + +[[package]] +name = "ecdsa" +version = "0.16.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" +dependencies = [ + "der", + "digest", + "elliptic-curve", + "rfc6979", + "signature", + "spki", +] + +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest", + "ff", + "generic-array", + "group", + "pkcs8", + "rand_core", + "sec1", + "subtle", + "tap", + "zeroize", +] + +[[package]] +name = "ff" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" +dependencies = [ + "bitvec", + "rand_core", + "subtle", +] + +[[package]] +name = "fibonacci-zkvm" +version = "0.1.0" +dependencies = [ + "succinct-zkvm", +] + +[[package]] +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", + "zeroize", +] + +[[package]] +name = "getrandom" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core", + "subtle", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + +[[package]] +name = "k256" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" +dependencies = [ + "cfg-if", + "ecdsa", + "elliptic-curve", + "once_cell", + "sha2", + "signature", +] + +[[package]] +name = "libc" +version = "0.2.153" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der", + "spki", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "proc-macro2" +version = "1.0.78" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rfc6979" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" +dependencies = [ + "hmac", + "subtle", +] + +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "pkcs8", + "subtle", + "zeroize", +] + +[[package]] +name = "serde" +version = "1.0.196" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.196" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "signature" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "digest", + "rand_core", +] + +[[package]] +name = "spki" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" +dependencies = [ + "base64ct", + "der", +] + +[[package]] +name = "subtle" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" + +[[package]] +name = "succinct-zkvm" +version = "0.1.0" +dependencies = [ + "anyhow", + "bincode", + "cfg-if", + "getrandom", + "k256", + "rand", + "serde", +] + +[[package]] +name = "syn" +version = "2.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wyz" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", +] + +[[package]] +name = "zeroize" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" diff --git a/cli/src/assets/Cargo.toml b/programs/demo/fibonacci-io/Cargo.toml similarity index 52% rename from cli/src/assets/Cargo.toml rename to programs/demo/fibonacci-io/Cargo.toml index cc275f4256..82ba6081a1 100644 --- a/cli/src/assets/Cargo.toml +++ b/programs/demo/fibonacci-io/Cargo.toml @@ -1,8 +1,8 @@ [workspace] [package] version = "0.1.0" -name = "unnamed-zkvm" +name = "fibonacci-zkvm" edition = "2021" [dependencies] -succinct-zkvm = { path = "../../zkvm" } \ No newline at end of file +succinct-zkvm = { path = "../../../zkvm" } \ No newline at end of file diff --git a/programs/demo/fibonacci-io/elf/riscv32im-succinct-zkvm-elf b/programs/demo/fibonacci-io/elf/riscv32im-succinct-zkvm-elf new file mode 100755 index 0000000000..4e925a3b3d Binary files /dev/null and b/programs/demo/fibonacci-io/elf/riscv32im-succinct-zkvm-elf differ diff --git a/cli/src/assets/main.rs b/programs/demo/fibonacci-io/src/main.rs similarity index 66% rename from cli/src/assets/main.rs rename to programs/demo/fibonacci-io/src/main.rs index 9cf7343b36..e90e9ed72d 100644 --- a/cli/src/assets/main.rs +++ b/programs/demo/fibonacci-io/src/main.rs @@ -3,7 +3,7 @@ extern crate succinct_zkvm; succinct_zkvm::entrypoint!(main); pub fn main() { - let n = 10; + let n = succinct_zkvm::io::read::(); let mut a = 0; let mut b = 1; let mut sum; @@ -12,5 +12,7 @@ pub fn main() { a = b; b = sum; } - println!("b: {}", b); + + succinct_zkvm::io::write(&a); + succinct_zkvm::io::write(&b); }