diff --git a/.github/workflows/eval.yml b/.github/workflows/eval.yml deleted file mode 100644 index 02e4e3c2c..000000000 --- a/.github/workflows/eval.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: Evaluate Performance - -on: - schedule: - - cron: "0 0 * * *" # Runs at 00:00 UTC every day - -jobs: - benchmark: - name: Benchmark - runs-on: ${{ matrix.runner_label }} - strategy: - matrix: - include: - - runner_label: self-hosted-x86 - arch: x86 - - runner_label: self-hosted-arm64 - arch: arm64 - if: "! contains(toJSON(github.event.commits.*.message), '[skip-ci]')" - env: - CARGO_NET_GIT_FETCH_WITH_CLI: "true" - steps: - - name: Checkout sources - uses: actions/checkout@v4 - - - 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: Setup toolchain - id: rustc-toolchain - run: rustup show - - - name: Install SP1 toolchain - run: | - curl -L https://sp1.succinct.xyz | bash - sp1up - - - name: Build and Run Evaluation - run: | - ./eval.sh - - - name: Upload Benchmark as Artifact - uses: actions/upload-artifact@v4 - with: - name: benchmark-results-${{ matrix.arch }} - path: benchmark.csv diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index aa46c6c10..72abf946d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -6,6 +6,7 @@ on: - main paths: - "crates/**" + - "Cargo.toml" - ".github/workflows/**" concurrency: diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 2d7673efe..498ab0960 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -2,7 +2,7 @@ name: PR on: push: - branches: [main] + branches: [main, dev] pull_request: branches: - "**" @@ -49,8 +49,6 @@ jobs: FRI_QUERIES: 1 SP1_DEV: 1 - - test-x86: name: Test (x86-64) runs-on: @@ -153,6 +151,15 @@ jobs: env: CARGO_INCREMENTAL: 1 + - name: Add wasm target + run: rustup target add wasm32-unknown-unknown + + - name: Check wasm compatibility for sdk + uses: actions-rs/cargo@v1 + with: + command: check + args: -p sp1-sdk --target wasm32-unknown-unknown --no-default-features + examples: name: Examples runs-on: [runs-on, runner=8cpu-linux-x64, "run-id=${{ github.run_id }}"] @@ -221,3 +228,39 @@ jobs: cargo remove sp1-sdk cargo add sp1-sdk --path $GITHUB_WORKSPACE/crates/sdk SP1_DEV=1 RUST_LOG=info cargo run --release -- --prove + + performance: + name: Performance + runs-on: [runs-on, family=c7a.48xlarge, "run-id=${{ github.run_id }}"] + env: + CARGO_NET_GIT_FETCH_WITH_CLI: "true" + steps: + - name: Checkout sources + uses: actions/checkout@v4 + + - name: Setup CI + uses: ./.github/actions/setup + + - name: Install SP1 toolchain + run: | + curl -L https://sp1.succinct.xyz | bash + ~/.sp1/bin/sp1up + ~/.sp1/bin/cargo-prove prove --version + + - name: Build program and run script + run: | + cd crates/eval + RUSTFLAGS='-C target-cpu=native' cargo run --release -- \ + --programs fibonacci,ssz-withdrawals,tendermint \ + --post-to-slack ${{ github.ref == 'refs/heads/dev' }} \ + --slack-channel-id "${{ secrets.SLACK_CHANNEL_ID }}" \ + --slack-token "${{ secrets.SLACK_TOKEN }}" \ + --post-to-github ${{ github.event_name == 'pull_request' }} \ + --github-token "${{ secrets.GITHUB_TOKEN }}" \ + --repo-owner "${{ github.repository_owner }}" \ + --repo-name "${{ github.event.repository.name }}" \ + --pr-number "${{ github.event.pull_request.number }}" \ + --pr-name "${{ github.event.pull_request.title }}" \ + --branch-name "${{ github.head_ref || github.ref_name }}" \ + --commit-hash "${{ github.sha }}" \ + --author "${{ github.event.pull_request.user.login || github.actor }}" diff --git a/Cargo.lock b/Cargo.lock index c94250fb4..efb79c4ff 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -38,6 +38,26 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +[[package]] +name = "aead" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fc95d1bdb8e6666b2b217308eeeb09f2d6728d104be3e31916cc74d15420331" +dependencies = [ + "generic-array 0.14.7", +] + +[[package]] +name = "aes" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "884391ef1066acaa41e766ba8f596341b96e93ce34f9a43e7d24bf0a0eaf0561" +dependencies = [ + "aes-soft", + "aesni", + "cipher 0.2.5", +] + [[package]] name = "aes" version = "0.8.4" @@ -45,10 +65,44 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" dependencies = [ "cfg-if", - "cipher", + "cipher 0.4.4", "cpufeatures", ] +[[package]] +name = "aes-gcm" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5278b5fabbb9bd46e24aa69b2fdea62c99088e0a950a9be40e3e0101298f88da" +dependencies = [ + "aead", + "aes 0.6.0", + "cipher 0.2.5", + "ctr 0.6.0", + "ghash", + "subtle", +] + +[[package]] +name = "aes-soft" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be14c7498ea50828a38d0e24a765ed2effe92a705885b57d029cd67d45744072" +dependencies = [ + "cipher 0.2.5", + "opaque-debug", +] + +[[package]] +name = "aesni" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea2e11f5e94c2f7d386164cc2aa1f97823fed6f259e486940a71c174dd01b0ce" +dependencies = [ + "cipher 0.2.5", + "opaque-debug", +] + [[package]] name = "ahash" version = "0.8.11" @@ -83,7 +137,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ccb3ead547f4532bc8af961649942f0b9c16ee9226e26caa3f38420651cc0bf4" dependencies = [ "alloy-rlp", - "bytes", + "bytes 1.7.1", "cfg-if", "const-hex", "derive_more", @@ -92,7 +146,7 @@ dependencies = [ "k256", "keccak-asm", "proptest", - "rand", + "rand 0.8.5", "ruint", "serde", "tiny-keccak", @@ -105,7 +159,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26154390b1d205a4a7ac7352aa2eb4f81f391399d4e2f546fb81a2f8bb383f62" dependencies = [ "arrayvec", - "bytes", + "bytes 1.7.1", ] [[package]] @@ -366,7 +420,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1df2c09229cbc5a028b1d70e00fdb2acee28b1055dfb5ca73eea49c5a25c4e7c" dependencies = [ "num-traits", - "rand", + "rand 0.8.5", ] [[package]] @@ -376,7 +430,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" dependencies = [ "num-traits", - "rand", + "rand 0.8.5", ] [[package]] @@ -391,6 +445,172 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +[[package]] +name = "async-attributes" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3203e79f4dd9bdda415ed03cf14dae5a2bf775c683a00f94e9cd1faf0f596e5" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "async-channel" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" +dependencies = [ + "concurrent-queue", + "event-listener 2.5.3", + "futures-core", +] + +[[package]] +name = "async-channel" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89b47800b0be77592da0afd425cc03468052844aff33b84e33cc696f64e77b6a" +dependencies = [ + "concurrent-queue", + "event-listener-strategy", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-executor" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7ebdfa2ebdab6b1760375fa7d6f382b9f486eac35fc994625a00e89280bdbb7" +dependencies = [ + "async-task", + "concurrent-queue", + "fastrand 2.1.0", + "futures-lite 2.3.0", + "slab", +] + +[[package]] +name = "async-global-executor" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05b1b633a2115cd122d73b955eadd9916c18c8f510ec9cd1686404c60ad1c29c" +dependencies = [ + "async-channel 2.3.1", + "async-executor", + "async-io 2.3.4", + "async-lock 3.4.0", + "blocking", + "futures-lite 2.3.0", + "once_cell", +] + +[[package]] +name = "async-io" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" +dependencies = [ + "async-lock 2.8.0", + "autocfg", + "cfg-if", + "concurrent-queue", + "futures-lite 1.13.0", + "log", + "parking", + "polling 2.8.0", + "rustix 0.37.27", + "slab", + "socket2 0.4.10", + "waker-fn", +] + +[[package]] +name = "async-io" +version = "2.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "444b0228950ee6501b3568d3c93bf1176a1fdbc3b758dcd9475046d30f4dc7e8" +dependencies = [ + "async-lock 3.4.0", + "cfg-if", + "concurrent-queue", + "futures-io", + "futures-lite 2.3.0", + "parking", + "polling 3.7.3", + "rustix 0.38.34", + "slab", + "tracing", + "windows-sys 0.59.0", +] + +[[package]] +name = "async-lock" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" +dependencies = [ + "event-listener 2.5.3", +] + +[[package]] +name = "async-lock" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" +dependencies = [ + "event-listener 5.3.1", + "event-listener-strategy", + "pin-project-lite", +] + +[[package]] +name = "async-std" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62565bb4402e926b29953c785397c6dc0391b7b446e45008b0049eb43cec6f5d" +dependencies = [ + "async-attributes", + "async-channel 1.9.0", + "async-global-executor", + "async-io 1.13.0", + "async-lock 2.8.0", + "crossbeam-utils", + "futures-channel", + "futures-core", + "futures-io", + "futures-lite 1.13.0", + "gloo-timers", + "kv-log-macro", + "log", + "memchr", + "once_cell", + "pin-project-lite", + "pin-utils", + "slab", + "wasm-bindgen-futures", +] + +[[package]] +name = "async-task" +version = "4.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" + +[[package]] +name = "async-tls" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f23d769dbf1838d5df5156e7b1ad404f4c463d1ac2c6aeb6cd943630f8a8400" +dependencies = [ + "futures-core", + "futures-io", + "rustls 0.19.1", + "webpki", + "webpki-roots 0.21.1", +] + [[package]] name = "async-trait" version = "0.1.81" @@ -402,6 +622,19 @@ dependencies = [ "syn 2.0.72", ] +[[package]] +name = "async-tungstenite" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e6acf7e4a267eecbb127ed696bb2d50572c22ba7f586a646321e1798d8336a1" +dependencies = [ + "futures-io", + "futures-util", + "log", + "pin-project-lite", + "tungstenite", +] + [[package]] name = "async_io_stream" version = "0.3.3" @@ -444,7 +677,7 @@ checksum = "1236b4b292f6c4d6dc34604bb5120d85c3fe1d1aa596bd5cc52ca054d13e7b9e" dependencies = [ "async-trait", "axum-core", - "bytes", + "bytes 1.7.1", "futures-util", "http 1.1.0", "http-body 1.0.1", @@ -477,7 +710,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a15c63fd72d41492dc4f497196f5da1fb04fb7529e631d73630d1b491e47a2e3" dependencies = [ "async-trait", - "bytes", + "bytes 1.7.1", "futures-util", "http 1.1.0", "http-body 1.0.1", @@ -507,6 +740,12 @@ dependencies = [ "serde", ] +[[package]] +name = "base-x" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cbbc9d0964165b47557570cce6c952866c2678457aca742aafc9fb771d30270" + [[package]] name = "base16ct" version = "0.2.0" @@ -648,6 +887,15 @@ dependencies = [ "rayon-core", ] +[[package]] +name = "block-buffer" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +dependencies = [ + "generic-array 0.14.7", +] + [[package]] name = "block-buffer" version = "0.10.4" @@ -657,6 +905,19 @@ dependencies = [ "generic-array 0.14.7", ] +[[package]] +name = "blocking" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "703f41c54fc768e63e091340b424302bb1c29ef4aa0c7f10fe849dfb114d29ea" +dependencies = [ + "async-channel 2.3.1", + "async-task", + "futures-io", + "futures-lite 2.3.0", + "piper", +] + [[package]] name = "bls12_381" version = "0.7.1" @@ -666,7 +927,7 @@ dependencies = [ "ff 0.12.1", "group 0.12.1", "pairing", - "rand_core", + "rand_core 0.6.4", "subtle", ] @@ -676,7 +937,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4" dependencies = [ - "sha2", + "sha2 0.10.8", "tinyvec", ] @@ -704,6 +965,12 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" +[[package]] +name = "bytes" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38" + [[package]] name = "bytes" version = "1.7.1" @@ -842,6 +1109,15 @@ dependencies = [ "half", ] +[[package]] +name = "cipher" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12f8e7987cbd042a63249497f41aed09f8e65add917ea6566effbc56578d6801" +dependencies = [ + "generic-array 0.14.7", +] + [[package]] name = "cipher" version = "0.4.4" @@ -882,7 +1158,7 @@ dependencies = [ "anstream", "anstyle", "clap_lex", - "strsim", + "strsim 0.11.1", ] [[package]] @@ -918,10 +1194,10 @@ dependencies = [ "bs58", "coins-core", "digest 0.10.7", - "hmac", + "hmac 0.12.1", "k256", "serde", - "sha2", + "sha2 0.10.8", "thiserror", ] @@ -933,11 +1209,11 @@ checksum = "3db8fba409ce3dc04f7d804074039eb68b960b0829161f8e06c95fea3f122528" dependencies = [ "bitvec", "coins-bip32", - "hmac", + "hmac 0.12.1", "once_cell", "pbkdf2 0.12.2", - "rand", - "sha2", + "rand 0.8.5", + "sha2 0.10.8", "thiserror", ] @@ -956,7 +1232,7 @@ dependencies = [ "ripemd", "serde", "serde_derive", - "sha2", + "sha2 0.10.8", "sha3", "thiserror", ] @@ -967,6 +1243,15 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" +[[package]] +name = "concurrent-queue" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" +dependencies = [ + "crossbeam-utils", +] + [[package]] name = "console" version = "0.15.8" @@ -999,6 +1284,12 @@ version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" +[[package]] +name = "const_fn" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "373e9fafaa20882876db20562275ff58d50e0caa2590077fe7ce7bef90211d0d" + [[package]] name = "constant_time_eq" version = "0.3.0" @@ -1011,6 +1302,23 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" +[[package]] +name = "cookie" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03a5d7b21829bc7b4bf4754a978a241ae54ea55a40f92bb20216e54096f4b951" +dependencies = [ + "aes-gcm", + "base64 0.13.1", + "hkdf", + "hmac 0.10.1", + "percent-encoding", + "rand 0.8.5", + "sha2 0.9.9", + "time 0.2.27", + "version_check", +] + [[package]] name = "core-foundation" version = "0.9.4" @@ -1036,6 +1344,12 @@ dependencies = [ "libc", ] +[[package]] +name = "cpuid-bool" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcb25d077389e53838a8158c8e99174c5a9d902dee4904320db714f3c653ffba" + [[package]] name = "criterion" version = "0.5.1" @@ -1110,7 +1424,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array 0.14.7", - "rand_core", + "rand_core 0.6.4", "subtle", "zeroize", ] @@ -1125,6 +1439,16 @@ dependencies = [ "typenum", ] +[[package]] +name = "crypto-mac" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4857fd85a0c34b3c3297875b747c1e02e06b6a0ea32dd892d8192b9ce0813ea6" +dependencies = [ + "generic-array 0.14.7", + "subtle", +] + [[package]] name = "csv" version = "1.3.0" @@ -1146,13 +1470,22 @@ dependencies = [ "memchr", ] +[[package]] +name = "ctr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb4a30d54f7443bf3d6191dcd486aca19e67cb3c49fa7a06a319966346707e7f" +dependencies = [ + "cipher 0.2.5", +] + [[package]] name = "ctr" version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" dependencies = [ - "cipher", + "cipher 0.4.4", ] [[package]] @@ -1165,6 +1498,37 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "curl" +version = "0.4.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e2161dd6eba090ff1594084e95fd67aeccf04382ffea77999ea94ed42ec67b6" +dependencies = [ + "curl-sys", + "libc", + "openssl-probe", + "openssl-sys", + "schannel", + "socket2 0.5.7", + "windows-sys 0.52.0", +] + +[[package]] +name = "curl-sys" +version = "0.4.74+curl-8.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8af10b986114528fcdc4b63b6f5f021b7057618411046a4de2ba0f0149a097bf" +dependencies = [ + "cc", + "libc", + "libnghttp2-sys", + "libz-sys", + "openssl-sys", + "pkg-config", + "vcpkg", + "windows-sys 0.52.0", +] + [[package]] name = "curve25519-dalek" version = "4.1.3" @@ -1191,14 +1555,38 @@ dependencies = [ "syn 2.0.72", ] +[[package]] +name = "darling" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" +dependencies = [ + "darling_core 0.13.4", + "darling_macro 0.13.4", +] + [[package]] name = "darling" version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" dependencies = [ - "darling_core", - "darling_macro", + "darling_core 0.20.10", + "darling_macro 0.20.10", +] + +[[package]] +name = "darling_core" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim 0.10.0", + "syn 1.0.109", ] [[package]] @@ -1211,17 +1599,28 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "strsim", + "strsim 0.11.1", "syn 2.0.72", ] +[[package]] +name = "darling_macro" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" +dependencies = [ + "darling_core 0.13.4", + "quote", + "syn 1.0.109", +] + [[package]] name = "darling_macro" version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ - "darling_core", + "darling_core 0.20.10", "quote", "syn 2.0.72", ] @@ -1363,7 +1762,7 @@ version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "block-buffer", + "block-buffer 0.10.4", "const-oid", "crypto-common", "subtle", @@ -1411,6 +1810,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "discard" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "212d0f5754cb6769937f4501cc0e67f4f4483c8d2c3e1e922ee9edbe4ab4c7c0" + [[package]] name = "downcast-rs" version = "1.2.1" @@ -1424,7 +1829,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d05213e96f184578b5f70105d4d0a644a168e99e12d7bea0b200c15d67b5c182" dependencies = [ "futures", - "rand", + "rand 0.8.5", "reqwest 0.11.27", "thiserror", "tokio", @@ -1475,7 +1880,7 @@ dependencies = [ "generic-array 0.14.7", "group 0.13.0", "pkcs8", - "rand_core", + "rand_core 0.6.4", "sec1", "subtle", "zeroize", @@ -1521,11 +1926,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a3d8dc56e02f954cac8eb489772c552c473346fc34f67412bb6244fd647f7e4" dependencies = [ "base64 0.21.7", - "bytes", + "bytes 1.7.1", "hex", "k256", "log", - "rand", + "rand 0.8.5", "rlp", "serde", "sha3", @@ -1554,17 +1959,17 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fda3bf123be441da5260717e0661c25a2fd9cb2b2c1d20bf2e05580047158ab" dependencies = [ - "aes", - "ctr", + "aes 0.8.4", + "ctr 0.9.2", "digest 0.10.7", "hex", - "hmac", + "hmac 0.12.1", "pbkdf2 0.11.0", - "rand", + "rand 0.8.5", "scrypt", "serde", "serde_json", - "sha2", + "sha2 0.10.8", "sha3", "thiserror", "uuid", @@ -1708,7 +2113,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "82d80cc6ad30b14a48ab786523af33b37f28a8623fc06afd55324816ef18fb1f" dependencies = [ "arrayvec", - "bytes", + "bytes 1.7.1", "cargo_metadata", "chrono", "const-hex", @@ -1719,7 +2124,7 @@ dependencies = [ "num_enum 0.7.3", "once_cell", "open-fastrlp", - "rand", + "rand 0.8.5", "rlp", "serde", "serde_json", @@ -1766,7 +2171,7 @@ dependencies = [ "async-trait", "auto_impl", "base64 0.21.7", - "bytes", + "bytes 1.7.1", "const-hex", "enr", "ethers-core", @@ -1806,12 +2211,39 @@ dependencies = [ "elliptic-curve", "eth-keystore", "ethers-core", - "rand", - "sha2", + "rand 0.8.5", + "sha2 0.10.8", "thiserror", "tracing", ] +[[package]] +name = "event-listener" +version = "2.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" + +[[package]] +name = "event-listener" +version = "5.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" +dependencies = [ + "event-listener 5.3.1", + "pin-project-lite", +] + [[package]] name = "eyre" version = "0.6.12" @@ -1822,6 +2254,15 @@ dependencies = [ "once_cell", ] +[[package]] +name = "fastrand" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" +dependencies = [ + "instant", +] + [[package]] name = "fastrand" version = "2.1.0" @@ -1836,7 +2277,7 @@ checksum = "139834ddba373bbdd213dffe02c8d110508dcf1726c2be27e8d1f7d7e1856418" dependencies = [ "arrayvec", "auto_impl", - "bytes", + "bytes 1.7.1", ] [[package]] @@ -1846,7 +2287,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d013fc25338cc558c5c2cfbad646908fb23591e2404481826742b651c9af7160" dependencies = [ "bitvec", - "rand_core", + "rand_core 0.6.4", "subtle", ] @@ -1859,7 +2300,7 @@ dependencies = [ "bitvec", "byteorder", "ff_derive", - "rand_core", + "rand_core 0.6.4", "subtle", ] @@ -1892,7 +2333,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" dependencies = [ "byteorder", - "rand", + "rand 0.8.5", "rustc-hex", "static_assertions", ] @@ -1903,6 +2344,17 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" +[[package]] +name = "flume" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bebadab126f8120d410b677ed95eee4ba6eb7c6dd8e34a5ec88a08050e26132" +dependencies = [ + "futures-core", + "futures-sink", + "spinning_top", +] + [[package]] name = "fnv" version = "1.0.7" @@ -1987,6 +2439,34 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" +[[package]] +name = "futures-lite" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" +dependencies = [ + "fastrand 1.9.0", + "futures-core", + "futures-io", + "memchr", + "parking", + "pin-project-lite", + "waker-fn", +] + +[[package]] +name = "futures-lite" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" +dependencies = [ + "fastrand 2.1.0", + "futures-core", + "futures-io", + "parking", + "pin-project-lite", +] + [[package]] name = "futures-locks" version = "0.7.1" @@ -2084,6 +2564,17 @@ dependencies = [ "typenum", ] +[[package]] +name = "getrandom" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", +] + [[package]] name = "getrandom" version = "0.2.15" @@ -2091,8 +2582,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", + "js-sys", "libc", - "wasi", + "wasi 0.11.0+wasi-snapshot-preview1", + "wasm-bindgen", +] + +[[package]] +name = "ghash" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97304e4cd182c3846f7575ced3890c53012ce534ad9114046b0a9e00bb30a375" +dependencies = [ + "opaque-debug", + "polyval", ] [[package]] @@ -2151,7 +2654,7 @@ checksum = "5dfbfb3a6cfbd390d5c9564ab283a0349b9b9fcd46a706c1eb10e0db70bfbac7" dependencies = [ "ff 0.12.1", "memuse", - "rand_core", + "rand_core 0.6.4", "subtle", ] @@ -2162,7 +2665,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ "ff 0.13.0", - "rand_core", + "rand_core 0.6.4", "subtle", ] @@ -2172,7 +2675,7 @@ version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" dependencies = [ - "bytes", + "bytes 1.7.1", "fnv", "futures-core", "futures-sink", @@ -2192,7 +2695,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa82e28a107a8cc405f0839610bdc9b15f1e25ec7d696aa5cf173edbcb1486ab" dependencies = [ "atomic-waker", - "bytes", + "bytes 1.7.1", "fnv", "futures-core", "futures-sink", @@ -2233,7 +2736,7 @@ dependencies = [ "ff 0.12.1", "group 0.12.1", "pasta_curves 0.4.1", - "rand_core", + "rand_core 0.6.4", "rayon", ] @@ -2275,6 +2778,12 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" +[[package]] +name = "hermit-abi" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" + [[package]] name = "hex" version = "0.4.3" @@ -2287,6 +2796,26 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" +[[package]] +name = "hkdf" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51ab2f639c231793c5f6114bdb9bbe50a7dbbfcd7c7c6bd8475dec2d991e964f" +dependencies = [ + "digest 0.9.0", + "hmac 0.10.1", +] + +[[package]] +name = "hmac" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1441c6b1e930e2817404b5046f1f989899143a12bf92de603b69f4e0aee1e15" +dependencies = [ + "crypto-mac", + "digest 0.9.0", +] + [[package]] name = "hmac" version = "0.12.1" @@ -2311,7 +2840,7 @@ version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" dependencies = [ - "bytes", + "bytes 1.7.1", "fnv", "itoa", ] @@ -2322,7 +2851,7 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" dependencies = [ - "bytes", + "bytes 1.7.1", "fnv", "itoa", ] @@ -2333,7 +2862,7 @@ version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ - "bytes", + "bytes 1.7.1", "http 0.2.12", "pin-project-lite", ] @@ -2344,7 +2873,7 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" dependencies = [ - "bytes", + "bytes 1.7.1", "http 1.1.0", ] @@ -2354,13 +2883,49 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" dependencies = [ - "bytes", + "bytes 1.7.1", "futures-util", "http 1.1.0", "http-body 1.0.1", "pin-project-lite", ] +[[package]] +name = "http-client" +version = "6.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1947510dc91e2bf586ea5ffb412caad7673264e14bb39fb9078da114a94ce1a5" +dependencies = [ + "async-std", + "async-trait", + "cfg-if", + "http-types", + "isahc", + "log", +] + +[[package]] +name = "http-types" +version = "2.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e9b187a72d63adbfba487f48095306ac823049cb504ee195541e91c7775f5ad" +dependencies = [ + "anyhow", + "async-channel 1.9.0", + "async-std", + "base64 0.13.1", + "cookie", + "futures-lite 1.13.0", + "infer", + "pin-project-lite", + "rand 0.7.3", + "serde", + "serde_json", + "serde_qs", + "serde_urlencoded", + "url", +] + [[package]] name = "httparse" version = "1.9.4" @@ -2379,7 +2944,7 @@ version = "0.14.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" dependencies = [ - "bytes", + "bytes 1.7.1", "futures-channel", "futures-core", "futures-util", @@ -2390,7 +2955,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2", + "socket2 0.5.7", "tokio", "tower-service", "tracing", @@ -2403,7 +2968,7 @@ version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" dependencies = [ - "bytes", + "bytes 1.7.1", "futures-channel", "futures-util", "h2 0.4.5", @@ -2456,7 +3021,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" dependencies = [ - "bytes", + "bytes 1.7.1", "http-body-util", "hyper 1.4.1", "hyper-util", @@ -2472,14 +3037,14 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ab92f4f49ee4fb4f997c784b7a2e0fa70050211e0b6a287f898c3c9785ca956" dependencies = [ - "bytes", + "bytes 1.7.1", "futures-channel", "futures-util", "http 1.1.0", "http-body 1.0.1", "hyper 1.4.1", "pin-project-lite", - "socket2", + "socket2 0.5.7", "tokio", "tower", "tower-service", @@ -2604,6 +3169,12 @@ dependencies = [ "unicode-width", ] +[[package]] +name = "infer" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64e9829a50b42bb782c1df523f78d332fe371b10c661e78b7a3c34b0198e9fac" + [[package]] name = "inout" version = "0.1.3" @@ -2622,6 +3193,17 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "io-lifetimes" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" +dependencies = [ + "hermit-abi 0.3.9", + "libc", + "windows-sys 0.48.0", +] + [[package]] name = "ipnet" version = "2.9.0" @@ -2634,7 +3216,7 @@ version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" dependencies = [ - "hermit-abi", + "hermit-abi 0.3.9", "libc", "windows-sys 0.52.0", ] @@ -2645,6 +3227,29 @@ version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" +[[package]] +name = "isahc" +version = "0.9.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2948a0ce43e2c2ef11d7edf6816508998d99e13badd1150be0914205df9388a" +dependencies = [ + "bytes 0.5.6", + "crossbeam-utils", + "curl", + "curl-sys", + "flume", + "futures-lite 1.13.0", + "http 0.2.12", + "log", + "once_cell", + "slab", + "sluice", + "tracing", + "tracing-futures", + "url", + "waker-fn", +] + [[package]] name = "itertools" version = "0.10.5" @@ -2720,7 +3325,7 @@ dependencies = [ "bls12_381", "ff 0.12.1", "group 0.12.1", - "rand_core", + "rand_core 0.6.4", "subtle", ] @@ -2734,7 +3339,7 @@ dependencies = [ "ecdsa", "elliptic-curve", "once_cell", - "sha2", + "sha2 0.10.8", "signature", ] @@ -2757,6 +3362,15 @@ dependencies = [ "sha3-asm", ] +[[package]] +name = "kv-log-macro" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f" +dependencies = [ + "log", +] + [[package]] name = "lazy_static" version = "1.5.0" @@ -2806,6 +3420,16 @@ version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" +[[package]] +name = "libnghttp2-sys" +version = "0.1.10+1.61.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "959c25552127d2e1fa72f0e52548ec04fc386e827ba71a7bd01db46a447dc135" +dependencies = [ + "cc", + "libc", +] + [[package]] name = "libredox" version = "0.1.3" @@ -2828,6 +3452,12 @@ dependencies = [ "vcpkg", ] +[[package]] +name = "linux-raw-sys" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" + [[package]] name = "linux-raw-sys" version = "0.4.14" @@ -2849,6 +3479,9 @@ name = "log" version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +dependencies = [ + "value-bag", +] [[package]] name = "matchers" @@ -2883,6 +3516,16 @@ version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" +[[package]] +name = "mime_guess" +version = "2.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" +dependencies = [ + "mime", + "unicase", +] + [[package]] name = "minimal-lexical" version = "0.2.1" @@ -2904,9 +3547,9 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4569e456d394deccd22ce1c1913e6ea0e54519f577285001215d33557431afe4" dependencies = [ - "hermit-abi", + "hermit-abi 0.3.9", "libc", - "wasi", + "wasi 0.11.0+wasi-snapshot-preview1", "windows-sys 0.52.0", ] @@ -3013,7 +3656,7 @@ checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" dependencies = [ "num-integer", "num-traits", - "rand", + "rand 0.8.5", ] [[package]] @@ -3023,7 +3666,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" dependencies = [ "num-traits", - "rand", + "rand 0.8.5", ] [[package]] @@ -3094,7 +3737,7 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi", + "hermit-abi 0.3.9", "libc", ] @@ -3182,6 +3825,12 @@ version = "11.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b410bbe7e14ab526a0e86877eb47c6996a2bd7746f027ba551028c925390e4e9" +[[package]] +name = "opaque-debug" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" + [[package]] name = "open-fastrlp" version = "0.1.4" @@ -3190,7 +3839,7 @@ checksum = "786393f80485445794f6043fd3138854dd109cc6c4bd1a6383db304c9ce9b9ce" dependencies = [ "arrayvec", "auto_impl", - "bytes", + "bytes 1.7.1", "ethereum-types", "open-fastrlp-derive", ] @@ -3201,7 +3850,7 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "003b2be5c6c53c1cfeb0a238b8a1c3915cd410feb684457a36c10038f764bb1c" dependencies = [ - "bytes", + "bytes 1.7.1", "proc-macro2", "quote", "syn 1.0.109", @@ -3284,7 +3933,7 @@ dependencies = [ "p3-mds", "p3-poseidon2", "p3-symmetric", - "rand", + "rand 0.8.5", "serde", ] @@ -3309,7 +3958,7 @@ dependencies = [ "p3-field", "p3-poseidon2", "p3-symmetric", - "rand", + "rand 0.8.5", "serde", ] @@ -3363,7 +4012,7 @@ dependencies = [ "num-bigint 0.4.6", "num-traits", "p3-util", - "rand", + "rand 0.8.5", "serde", ] @@ -3433,7 +4082,7 @@ dependencies = [ "p3-field", "p3-maybe-rayon", "p3-util", - "rand", + "rand 0.8.5", "serde", "tracing", ] @@ -3459,7 +4108,7 @@ dependencies = [ "p3-matrix", "p3-symmetric", "p3-util", - "rand", + "rand 0.8.5", ] [[package]] @@ -3489,7 +4138,7 @@ dependencies = [ "p3-field", "p3-mds", "p3-symmetric", - "rand", + "rand 0.8.5", ] [[package]] @@ -3569,6 +4218,12 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "parking" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" + [[package]] name = "parking_lot" version = "0.12.3" @@ -3602,7 +4257,7 @@ dependencies = [ "ff 0.12.1", "group 0.12.1", "lazy_static", - "rand", + "rand 0.8.5", "static_assertions", "subtle", ] @@ -3617,7 +4272,7 @@ dependencies = [ "ff 0.13.0", "group 0.13.0", "lazy_static", - "rand", + "rand 0.8.5", "static_assertions", "subtle", ] @@ -3644,7 +4299,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" dependencies = [ "digest 0.10.7", - "hmac", + "hmac 0.12.1", ] [[package]] @@ -3725,6 +4380,17 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "piper" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96c8c490f422ef9a4efd2cb5b42b76c8613d7e7dfc1caf667b8a3350a5acc066" +dependencies = [ + "atomic-waker", + "fastrand 2.1.0", + "futures-io", +] + [[package]] name = "pkcs8" version = "0.10.2" @@ -3775,6 +4441,48 @@ dependencies = [ "plotters-backend", ] +[[package]] +name = "polling" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" +dependencies = [ + "autocfg", + "bitflags 1.3.2", + "cfg-if", + "concurrent-queue", + "libc", + "log", + "pin-project-lite", + "windows-sys 0.48.0", +] + +[[package]] +name = "polling" +version = "3.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc2790cd301dec6cd3b7a025e4815cf825724a51c98dccfe6a3e55f05ffb6511" +dependencies = [ + "cfg-if", + "concurrent-queue", + "hermit-abi 0.4.0", + "pin-project-lite", + "rustix 0.38.34", + "tracing", + "windows-sys 0.59.0", +] + +[[package]] +name = "polyval" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eebcc4aa140b9abd2bc40d9c3f7ccec842679cd79045ac3a7ac698c1a064b7cd" +dependencies = [ + "cpuid-bool", + "opaque-debug", + "universal-hash", +] + [[package]] name = "portable-atomic" version = "1.7.0" @@ -3889,6 +4597,12 @@ dependencies = [ "version_check", ] +[[package]] +name = "proc-macro-hack" +version = "0.5.20+deprecated" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" + [[package]] name = "proc-macro2" version = "1.0.86" @@ -3909,8 +4623,8 @@ dependencies = [ "bitflags 2.6.0", "lazy_static", "num-traits", - "rand", - "rand_chacha", + "rand 0.8.5", + "rand_chacha 0.3.1", "rand_xorshift", "regex-syntax 0.8.4", "rusty-fork", @@ -3924,7 +4638,7 @@ version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "deb1435c188b76130da55f17a466d252ff7b1418b2ad3e037d127b94e3411f29" dependencies = [ - "bytes", + "bytes 1.7.1", "prost-derive", ] @@ -3934,7 +4648,7 @@ version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22505a5c94da8e3b7c2996394d1c933236c4d743e81a410bcca4e6989fc066a4" dependencies = [ - "bytes", + "bytes 1.7.1", "heck", "itertools 0.12.1", "log", @@ -3992,13 +4706,13 @@ version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b22d8e7369034b9a7132bc2008cac12f2013c8132b45e0554e6e20e2617f2156" dependencies = [ - "bytes", + "bytes 1.7.1", "pin-project-lite", "quinn-proto", "quinn-udp", "rustc-hash 2.0.0", "rustls 0.23.12", - "socket2", + "socket2 0.5.7", "thiserror", "tokio", "tracing", @@ -4010,8 +4724,8 @@ version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba92fb39ec7ad06ca2582c0ca834dfeadcaf06ddfc8e635c80aa7e1c05315fdd" dependencies = [ - "bytes", - "rand", + "bytes 1.7.1", + "rand 0.8.5", "ring 0.17.8", "rustc-hash 2.0.0", "rustls 0.23.12", @@ -4029,7 +4743,7 @@ checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285" dependencies = [ "libc", "once_cell", - "socket2", + "socket2 0.5.7", "tracing", "windows-sys 0.52.0", ] @@ -4049,6 +4763,19 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom 0.1.16", + "libc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc", +] + [[package]] name = "rand" version = "0.8.5" @@ -4056,8 +4783,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", - "rand_chacha", - "rand_core", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +dependencies = [ + "ppv-lite86", + "rand_core 0.5.1", ] [[package]] @@ -4067,7 +4804,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom 0.1.16", ] [[package]] @@ -4076,7 +4822,16 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom", + "getrandom 0.2.15", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core 0.5.1", ] [[package]] @@ -4085,7 +4840,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" dependencies = [ - "rand_core", + "rand_core 0.6.4", ] [[package]] @@ -4132,7 +4887,7 @@ version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" dependencies = [ - "getrandom", + "getrandom 0.2.15", "libredox", "thiserror", ] @@ -4188,7 +4943,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" dependencies = [ "base64 0.21.7", - "bytes", + "bytes 1.7.1", "encoding_rs", "futures-core", "futures-util", @@ -4229,7 +4984,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c7d6d2a27d57148378eb5e111173f4276ad26340ecc5c49a4a2152167a2d6a37" dependencies = [ "base64 0.22.1", - "bytes", + "bytes 1.7.1", "encoding_rs", "futures-core", "futures-util", @@ -4293,7 +5048,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" dependencies = [ - "hmac", + "hmac 0.12.1", "subtle", ] @@ -4320,7 +5075,7 @@ checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", "cfg-if", - "getrandom", + "getrandom 0.2.15", "libc", "spin 0.9.8", "untrusted 0.9.0", @@ -4342,7 +5097,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bb919243f34364b6bd2fc10ef797edbfa75f33c252e7998527479c6d6b47e1ec" dependencies = [ - "bytes", + "bytes 1.7.1", "rlp-derive", "rustc-hex", ] @@ -4378,14 +5133,14 @@ dependencies = [ "alloy-rlp", "ark-ff 0.3.0", "ark-ff 0.4.2", - "bytes", + "bytes 1.7.1", "fastrlp", "num-bigint 0.4.6", "num-traits", "parity-scale-codec", "primitive-types", "proptest", - "rand", + "rand 0.8.5", "rlp", "ruint-macro", "serde", @@ -4423,6 +5178,15 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" +[[package]] +name = "rustc_version" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" +dependencies = [ + "semver 0.9.0", +] + [[package]] name = "rustc_version" version = "0.3.3" @@ -4441,6 +5205,20 @@ dependencies = [ "semver 1.0.23", ] +[[package]] +name = "rustix" +version = "0.37.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea8ca367a3a01fe35e6943c400addf443c0f57670e6ec51196f71a4b8762dd2" +dependencies = [ + "bitflags 1.3.2", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys 0.3.8", + "windows-sys 0.48.0", +] + [[package]] name = "rustix" version = "0.38.34" @@ -4450,10 +5228,23 @@ dependencies = [ "bitflags 2.6.0", "errno", "libc", - "linux-raw-sys", + "linux-raw-sys 0.4.14", "windows-sys 0.52.0", ] +[[package]] +name = "rustls" +version = "0.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35edb675feee39aec9c99fa5ff985081995a06d594114ae14cbe797ad7b7a6d7" +dependencies = [ + "base64 0.13.1", + "log", + "ring 0.16.20", + "sct 0.6.1", + "webpki", +] + [[package]] name = "rustls" version = "0.21.12" @@ -4463,7 +5254,7 @@ dependencies = [ "log", "ring 0.17.8", "rustls-webpki 0.101.7", - "sct", + "sct 0.7.1", ] [[package]] @@ -4556,7 +5347,7 @@ version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97a22f5af31f73a954c10289c93e8a50cc23d971e80ee446f1f6f7137a088213" dependencies = [ - "cipher", + "cipher 0.4.4", ] [[package]] @@ -4642,10 +5433,20 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9f9e24d2b632954ded8ab2ef9fea0a0c769ea56ea98bddbafbad22caeeadf45d" dependencies = [ - "hmac", + "hmac 0.12.1", "pbkdf2 0.11.0", "salsa20", - "sha2", + "sha2 0.10.8", +] + +[[package]] +name = "sct" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b362b83898e0e69f38515b82ee15aa80636befe47c3b6d3d89a911e78fc228ce" +dependencies = [ + "ring 0.16.20", + "untrusted 0.7.1", ] [[package]] @@ -4701,13 +5502,22 @@ dependencies = [ "libc", ] +[[package]] +name = "semver" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" +dependencies = [ + "semver-parser 0.7.0", +] + [[package]] name = "semver" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" dependencies = [ - "semver-parser", + "semver-parser 0.10.2", ] [[package]] @@ -4719,6 +5529,12 @@ dependencies = [ "serde", ] +[[package]] +name = "semver-parser" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" + [[package]] name = "semver-parser" version = "0.10.2" @@ -4782,6 +5598,17 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_qs" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7715380eec75f029a4ef7de39a9200e0a63823176b759d055b613f5a87df6a6" +dependencies = [ + "percent-encoding", + "serde", + "thiserror", +] + [[package]] name = "serde_spanned" version = "0.6.7" @@ -4803,6 +5630,16 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_with" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "678b5a069e50bf00ecd22d0cd8ddf7c236f68581b03db652061ed5eb13a312ff" +dependencies = [ + "serde", + "serde_with_macros 1.5.2", +] + [[package]] name = "serde_with" version = "3.9.0" @@ -4817,8 +5654,20 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "serde_with_macros", - "time", + "serde_with_macros 3.9.0", + "time 0.3.36", +] + +[[package]] +name = "serde_with_macros" +version = "1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e182d6ec6f05393cc0e5ed1bf81ad6db3a8feedf8ee515ecdd369809bcce8082" +dependencies = [ + "darling 0.13.4", + "proc-macro2", + "quote", + "syn 1.0.109", ] [[package]] @@ -4827,7 +5676,7 @@ version = "3.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8fee4991ef4f274617a51ad4af30519438dacb2f56ac773b08a1922ff743350" dependencies = [ - "darling", + "darling 0.20.10", "proc-macro2", "quote", "syn 2.0.72", @@ -4858,6 +5707,45 @@ dependencies = [ "syn 2.0.72", ] +[[package]] +name = "sha1" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1da05c97445caa12d05e848c4a4fcbbea29e748ac28f7e80e9b010392063770" +dependencies = [ + "sha1_smol", +] + +[[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 = "sha1_smol" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbfa15b3dddfee50a0fff136974b3e1bde555604ba463834a7eb7deb6417705d" + +[[package]] +name = "sha2" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if", + "cpufeatures", + "digest 0.9.0", + "opaque-debug", +] + [[package]] name = "sha2" version = "0.10.8" @@ -4920,7 +5808,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ "digest 0.10.7", - "rand_core", + "rand_core 0.6.4", ] [[package]] @@ -4932,7 +5820,7 @@ dependencies = [ "num-bigint 0.4.6", "num-traits", "thiserror", - "time", + "time 0.3.36", ] [[package]] @@ -4950,6 +5838,36 @@ dependencies = [ "autocfg", ] +[[package]] +name = "slack-rust" +version = "0.0.1-alpha" +source = "git+https://github.com/dselans/slack-rust.git?branch=main#8212d4e8de30ebb3f536da35eab27e7e0820461b" +dependencies = [ + "async-std", + "async-tls", + "async-trait", + "async-tungstenite", + "futures-util", + "log", + "rustls 0.19.1", + "serde", + "serde_json", + "serde_with 1.14.0", + "surf", + "url", +] + +[[package]] +name = "sluice" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d7400c0eff44aa2fcb5e31a5f24ba9716ed90138769e4977a2ba6014ae63eb5" +dependencies = [ + "async-channel 1.9.0", + "futures-core", + "futures-io", +] + [[package]] name = "smallvec" version = "1.13.2" @@ -4972,6 +5890,16 @@ dependencies = [ "scale-info", ] +[[package]] +name = "socket2" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" +dependencies = [ + "libc", + "winapi", +] + [[package]] name = "socket2" version = "0.5.7" @@ -4984,7 +5912,7 @@ dependencies = [ [[package]] name = "sp1-build" -version = "1.2.0-rc1" +version = "1.2.0-rc2" dependencies = [ "anyhow", "cargo_metadata", @@ -4995,7 +5923,7 @@ dependencies = [ [[package]] name = "sp1-cli" -version = "1.2.0-rc1" +version = "1.2.0-rc2" dependencies = [ "anstyle", "anyhow", @@ -5010,7 +5938,7 @@ dependencies = [ "hex", "indicatif", "prettytable-rs", - "rand", + "rand 0.8.5", "regex", "reqwest 0.12.5", "rustc-demangle", @@ -5030,7 +5958,7 @@ dependencies = [ [[package]] name = "sp1-core-executor" -version = "1.2.0-rc1" +version = "1.2.0-rc2" dependencies = [ "bincode", "bytemuck", @@ -5046,10 +5974,10 @@ dependencies = [ "p3-field", "p3-keccak-air", "p3-maybe-rayon", - "rand", + "rand 0.8.5", "rrs-succinct", "serde", - "serde_with", + "serde_with 3.9.0", "sp1-curves", "sp1-derive", "sp1-primitives", @@ -5065,7 +5993,7 @@ dependencies = [ [[package]] name = "sp1-core-machine" -version = "1.2.0-rc1" +version = "1.2.0-rc2" dependencies = [ "anyhow", "arrayref", @@ -5104,11 +6032,11 @@ dependencies = [ "p3-symmetric", "p3-uni-stark", "p3-util", - "rand", + "rand 0.8.5", "rayon-scan", "rrs-succinct", "serde", - "serde_with", + "serde_with 3.9.0", "size", "snowbridge-amcl", "sp1-core-executor", @@ -5132,7 +6060,7 @@ dependencies = [ [[package]] name = "sp1-cuda" -version = "1.2.0-rc1" +version = "1.2.0-rc2" dependencies = [ "bincode", "ctrlc", @@ -5153,7 +6081,7 @@ dependencies = [ [[package]] name = "sp1-curves" -version = "1.2.0-rc1" +version = "1.2.0-rc2" dependencies = [ "curve25519-dalek", "dashu", @@ -5163,7 +6091,7 @@ dependencies = [ "k256", "num", "p3-field", - "rand", + "rand 0.8.5", "serde", "snowbridge-amcl", "sp1-primitives", @@ -5173,23 +6101,43 @@ dependencies = [ [[package]] name = "sp1-derive" -version = "1.2.0-rc1" +version = "1.2.0-rc2" dependencies = [ "proc-macro2", "quote", "syn 1.0.109", ] +[[package]] +name = "sp1-eval" +version = "1.2.0-rc2" +dependencies = [ + "anyhow", + "bincode", + "clap", + "csv", + "p3-baby-bear", + "reqwest 0.12.5", + "serde", + "serde_json", + "slack-rust", + "sp1-prover", + "sp1-sdk", + "sp1-stark", + "time 0.3.36", + "tokio", +] + [[package]] name = "sp1-helper" -version = "1.2.0-rc1" +version = "1.2.0-rc2" dependencies = [ "sp1-build", ] [[package]] name = "sp1-lib" -version = "1.2.0-rc1" +version = "1.2.0-rc2" dependencies = [ "anyhow", "bincode", @@ -5201,7 +6149,7 @@ dependencies = [ [[package]] name = "sp1-primitives" -version = "1.2.0-rc1" +version = "1.2.0-rc2" dependencies = [ "itertools 0.13.0", "lazy_static", @@ -5213,7 +6161,7 @@ dependencies = [ [[package]] name = "sp1-prover" -version = "1.2.0-rc1" +version = "1.2.0-rc2" dependencies = [ "anyhow", "bincode", @@ -5251,7 +6199,7 @@ dependencies = [ [[package]] name = "sp1-recursion-circuit" -version = "1.2.0-rc1" +version = "1.2.0-rc2" dependencies = [ "bincode", "ff 0.13.0", @@ -5269,7 +6217,7 @@ dependencies = [ "p3-poseidon2", "p3-symmetric", "p3-util", - "rand", + "rand 0.8.5", "serde", "sp1-core-machine", "sp1-recursion-compiler", @@ -5283,7 +6231,7 @@ dependencies = [ [[package]] name = "sp1-recursion-circuit-v2" -version = "1.2.0-rc1" +version = "1.2.0-rc2" dependencies = [ "bincode", "ff 0.13.0", @@ -5303,7 +6251,7 @@ dependencies = [ "p3-poseidon2", "p3-symmetric", "p3-util", - "rand", + "rand 0.8.5", "serde", "sp1-core-executor", "sp1-core-machine", @@ -5322,7 +6270,7 @@ dependencies = [ [[package]] name = "sp1-recursion-compiler" -version = "1.2.0-rc1" +version = "1.2.0-rc2" dependencies = [ "backtrace", "criterion", @@ -5340,7 +6288,7 @@ dependencies = [ "p3-poseidon2", "p3-symmetric", "p3-util", - "rand", + "rand 0.8.5", "rayon", "serde", "sp1-core-machine", @@ -5355,7 +6303,7 @@ dependencies = [ [[package]] name = "sp1-recursion-core" -version = "1.2.0-rc1" +version = "1.2.0-rc2" dependencies = [ "arrayref", "backtrace", @@ -5377,9 +6325,9 @@ dependencies = [ "p3-poseidon2", "p3-symmetric", "p3-util", - "rand", + "rand 0.8.5", "serde", - "serde_with", + "serde_with 3.9.0", "sp1-core-executor", "sp1-core-machine", "sp1-derive", @@ -5392,7 +6340,7 @@ dependencies = [ [[package]] name = "sp1-recursion-core-v2" -version = "1.2.0-rc1" +version = "1.2.0-rc2" dependencies = [ "arrayref", "backtrace", @@ -5414,9 +6362,9 @@ dependencies = [ "p3-poseidon2", "p3-symmetric", "p3-util", - "rand", + "rand 0.8.5", "serde", - "serde_with", + "serde_with 3.9.0", "sp1-core-executor", "sp1-core-machine", "sp1-derive", @@ -5432,7 +6380,7 @@ dependencies = [ [[package]] name = "sp1-recursion-derive" -version = "1.2.0-rc1" +version = "1.2.0-rc2" dependencies = [ "proc-macro2", "quote", @@ -5441,7 +6389,7 @@ dependencies = [ [[package]] name = "sp1-recursion-gnark-cli" -version = "1.2.0-rc1" +version = "1.2.0-rc2" dependencies = [ "bincode", "clap", @@ -5450,7 +6398,7 @@ dependencies = [ [[package]] name = "sp1-recursion-gnark-ffi" -version = "1.2.0-rc1" +version = "1.2.0-rc2" dependencies = [ "anyhow", "bincode", @@ -5463,10 +6411,10 @@ dependencies = [ "p3-baby-bear", "p3-field", "p3-symmetric", - "rand", + "rand 0.8.5", "serde", "serde_json", - "sha2", + "sha2 0.10.8", "sp1-core-machine", "sp1-recursion-compiler", "sp1-stark", @@ -5475,7 +6423,7 @@ dependencies = [ [[package]] name = "sp1-recursion-program" -version = "1.2.0-rc1" +version = "1.2.0-rc2" dependencies = [ "itertools 0.13.0", "p3-air", @@ -5491,7 +6439,7 @@ dependencies = [ "p3-poseidon2", "p3-symmetric", "p3-util", - "rand", + "rand 0.8.5", "serde", "sp1-core-executor", "sp1-core-machine", @@ -5505,7 +6453,7 @@ dependencies = [ [[package]] name = "sp1-sdk" -version = "1.2.0-rc1" +version = "1.2.0-rc2" dependencies = [ "alloy-sol-types", "anyhow", @@ -5516,6 +6464,7 @@ dependencies = [ "dirs", "ethers", "futures", + "getrandom 0.2.15", "hashbrown 0.14.5", "hex", "indicatif", @@ -5531,7 +6480,7 @@ dependencies = [ "reqwest-middleware", "serde", "serde_json", - "sha2", + "sha2 0.10.8", "sp1-core-executor", "sp1-core-machine", "sp1-cuda", @@ -5550,9 +6499,10 @@ dependencies = [ [[package]] name = "sp1-stark" -version = "1.2.0-rc1" +version = "1.2.0-rc2" dependencies = [ "arrayref", + "getrandom 0.2.15", "hashbrown 0.14.5", "itertools 0.13.0", "p3-air", @@ -5579,19 +6529,19 @@ dependencies = [ [[package]] name = "sp1-zkvm" -version = "1.2.0-rc1" +version = "1.2.0-rc2" dependencies = [ "bincode", "cfg-if", - "getrandom", + "getrandom 0.2.15", "lazy_static", "libm", "once_cell", "p3-baby-bear", "p3-field", - "rand", + "rand 0.8.5", "serde", - "sha2", + "sha2 0.10.8", "sp1-lib", "sp1-primitives", ] @@ -5608,6 +6558,15 @@ version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +[[package]] +name = "spinning_top" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b9eb1a2f4c41445a3a0ff9abc5221c5fcd28e1f13cd7c0397706f9ac938ddb0" +dependencies = [ + "lock_api", +] + [[package]] name = "spki" version = "0.7.3" @@ -5631,12 +6590,76 @@ dependencies = [ "winapi", ] +[[package]] +name = "standback" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e113fb6f3de07a243d434a56ec6f186dfd51cb08448239fe7bcae73f87ff28ff" +dependencies = [ + "version_check", +] + [[package]] name = "static_assertions" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +[[package]] +name = "stdweb" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d022496b16281348b52d0e30ae99e01a73d737b2f45d38fed4edf79f9325a1d5" +dependencies = [ + "discard", + "rustc_version 0.2.3", + "stdweb-derive", + "stdweb-internal-macros", + "stdweb-internal-runtime", + "wasm-bindgen", +] + +[[package]] +name = "stdweb-derive" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c87a60a40fccc84bef0652345bbbbbe20a605bf5d0ce81719fc476f5c03b50ef" +dependencies = [ + "proc-macro2", + "quote", + "serde", + "serde_derive", + "syn 1.0.109", +] + +[[package]] +name = "stdweb-internal-macros" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58fa5ff6ad0d98d1ffa8cb115892b6e69d67799f6763e162a1c9db421dc22e11" +dependencies = [ + "base-x", + "proc-macro2", + "quote", + "serde", + "serde_derive", + "serde_json", + "sha1 0.6.1", + "syn 1.0.109", +] + +[[package]] +name = "stdweb-internal-runtime" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "213701ba3370744dcd1a12960caa4843b3d68b4d1c0a5d575e0d65b2ee9d16c0" + +[[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.1" @@ -5680,6 +6703,29 @@ dependencies = [ "zeroize", ] +[[package]] +name = "surf" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "718b1ae6b50351982dedff021db0def601677f2120938b070eadb10ba4038dd7" +dependencies = [ + "async-std", + "async-trait", + "cfg-if", + "encoding_rs", + "futures-util", + "getrandom 0.2.15", + "http-client", + "http-types", + "log", + "mime_guess", + "once_cell", + "pin-project-lite", + "serde", + "serde_json", + "web-sys", +] + [[package]] name = "syn" version = "1.0.109" @@ -5781,9 +6827,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8fcd239983515c23a32fb82099f97d0b11b8c72f654ed659363a95c3dad7a53" dependencies = [ "cfg-if", - "fastrand", + "fastrand 2.1.0", "once_cell", - "rustix", + "rustix 0.38.34", "windows-sys 0.52.0", ] @@ -5839,6 +6885,21 @@ dependencies = [ "once_cell", ] +[[package]] +name = "time" +version = "0.2.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4752a97f8eebd6854ff91f1c1824cd6160626ac4bd44287f7f4ea2035a02a242" +dependencies = [ + "const_fn", + "libc", + "standback", + "stdweb", + "time-macros 0.1.1", + "version_check", + "winapi", +] + [[package]] name = "time" version = "0.3.36" @@ -5853,7 +6914,7 @@ dependencies = [ "powerfmt", "serde", "time-core", - "time-macros", + "time-macros 0.2.18", ] [[package]] @@ -5862,6 +6923,16 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" +[[package]] +name = "time-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "957e9c6e26f12cb6d0dd7fc776bb67a706312e7299aed74c8dd5b17ebb27e2f1" +dependencies = [ + "proc-macro-hack", + "time-macros-impl", +] + [[package]] name = "time-macros" version = "0.2.18" @@ -5872,6 +6943,19 @@ dependencies = [ "time-core", ] +[[package]] +name = "time-macros-impl" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd3c141a1b43194f3f56a1411225df8646c55781d5f26db825b3d98507eb482f" +dependencies = [ + "proc-macro-hack", + "proc-macro2", + "quote", + "standback", + "syn 1.0.109", +] + [[package]] name = "tiny-keccak" version = "2.0.2" @@ -5913,13 +6997,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "daa4fb1bc778bd6f04cbfc4bb2d06a7396a8f299dc33ea1900cedaa316f467b1" dependencies = [ "backtrace", - "bytes", + "bytes 1.7.1", "libc", "mio", "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2", + "socket2 0.5.7", "tokio-macros", "windows-sys 0.52.0", ] @@ -5972,7 +7056,7 @@ version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" dependencies = [ - "bytes", + "bytes 1.7.1", "futures-core", "futures-sink", "pin-project-lite", @@ -6154,6 +7238,25 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" +[[package]] +name = "tungstenite" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30ee6ab729cd4cf0fd55218530c4522ed30b7b6081752839b68fcec8d0960788" +dependencies = [ + "base64 0.13.1", + "byteorder", + "bytes 1.7.1", + "http 0.2.12", + "httparse", + "log", + "rand 0.8.5", + "sha1 0.10.6", + "thiserror", + "url", + "utf-8", +] + [[package]] name = "twirp-build-rs" version = "0.3.0" @@ -6171,7 +7274,7 @@ checksum = "dfa3161d8eee0abcad4e762f4215381a430cc1281870d575b0f1e4fbfc74b8ce" dependencies = [ "async-trait", "axum", - "bytes", + "bytes 1.7.1", "futures", "http 1.1.0", "http-body-util", @@ -6216,6 +7319,15 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" +[[package]] +name = "unicase" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" +dependencies = [ + "version_check", +] + [[package]] name = "unicode-bidi" version = "0.3.15" @@ -6255,6 +7367,16 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "229730647fbc343e3a80e463c1db7f78f3855d3f3739bee0dda773c9a037c90a" +[[package]] +name = "universal-hash" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8326b2c654932e3e4f9196e69d08fdf7cfd718e1dc6f66b347e6024a0c961402" +dependencies = [ + "generic-array 0.14.7", + "subtle", +] + [[package]] name = "untrusted" version = "0.7.1" @@ -6276,8 +7398,15 @@ dependencies = [ "form_urlencoded", "idna", "percent-encoding", + "serde", ] +[[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.2" @@ -6290,7 +7419,7 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" dependencies = [ - "getrandom", + "getrandom 0.2.15", "serde", ] @@ -6300,6 +7429,12 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" +[[package]] +name = "value-bag" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a84c137d37ab0142f0f2ddfe332651fdbf252e7b7dbb4e67b6c1f1b2e925101" + [[package]] name = "vcpkg" version = "0.2.15" @@ -6322,7 +7457,7 @@ dependencies = [ "cfg-if", "git2", "rustversion", - "time", + "time 0.3.36", ] [[package]] @@ -6340,6 +7475,12 @@ dependencies = [ "libc", ] +[[package]] +name = "waker-fn" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "317211a0dc0ceedd78fb2ca9a44aed3d7b9b26f81870d485c07122b4350673b7" + [[package]] name = "walkdir" version = "2.5.0" @@ -6359,6 +7500,12 @@ dependencies = [ "try-lock", ] +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" + [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -6464,6 +7611,25 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki" +version = "0.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8e38c0608262c46d4a56202ebabdeb094cef7e560ca7a226c6bf055188aa4ea" +dependencies = [ + "ring 0.16.20", + "untrusted 0.7.1", +] + +[[package]] +name = "webpki-roots" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aabe153544e473b775453675851ecc86863d2a81d786d741f6b76778f2a48940" +dependencies = [ + "webpki", +] + [[package]] name = "webpki-roots" version = "0.25.4" @@ -6488,7 +7654,7 @@ dependencies = [ "either", "home", "once_cell", - "rustix", + "rustix 0.38.34", ] [[package]] @@ -6822,9 +7988,9 @@ dependencies = [ "jubjub", "lazy_static", "pasta_curves 0.5.1", - "rand", + "rand 0.8.5", "serde", - "sha2", + "sha2 0.10.8", "sha3", "subtle", ] diff --git a/Cargo.toml b/Cargo.toml index a64891779..6ae5f36cd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [workspace.package] -version = "1.2.0-rc1" +version = "1.2.0-rc2" edition = "2021" license = "MIT OR Apache-2.0" repository = "https://github.com/succinctlabs/sp1" @@ -14,6 +14,7 @@ members = [ "crates/core/machine", "crates/curves", "crates/derive", + "crates/eval", "crates/helper", "crates/primitives", "crates/prover", @@ -47,27 +48,28 @@ debug-assertions = true [workspace.dependencies] # sp1 -sp1-build = { path = "crates/build", version = "1.2.0-rc1" } -sp1-core-machine = { path = "crates/core/machine", version = "1.2.0-rc1" } -sp1-core-executor = { path = "crates/core/executor", version = "1.2.0-rc1" } -sp1-derive = { path = "crates/derive", version = "1.2.0-rc1" } -sp1-cli = { path = "crates/cli", version = "1.2.0-rc1", default-features = false } -sp1-curves = { path = "crates/curves", version = "1.2.0-rc1" } -sp1-helper = { path = "crates/helper", version = "1.2.0-rc1", default-features = false } -sp1-primitives = { path = "crates/primitives", version = "1.2.0-rc1" } -sp1-prover = { path = "crates/prover", version = "1.2.0-rc1" } -sp1-recursion-compiler = { path = "crates/recursion/compiler", version = "1.2.0-rc1" } -sp1-recursion-core = { path = "crates/recursion/core", version = "1.2.0-rc1", default-features = false } -sp1-recursion-core-v2 = { path = "crates/recursion/core-v2", version = "1.2.0-rc1", default-features = false } -sp1-recursion-derive = { path = "crates/recursion/derive", version = "1.2.0-rc1", default-features = false } -sp1-recursion-gnark-ffi = { path = "crates/recursion/gnark-ffi", version = "1.2.0-rc1", default-features = false } -sp1-recursion-program = { path = "crates/recursion/program", version = "1.2.0-rc1", default-features = false } -sp1-recursion-circuit = { path = "crates/recursion/circuit", version = "1.2.0-rc1", default-features = false } -sp1-sdk = { path = "crates/sdk", version = "1.2.0-rc1" } -sp1-cuda = { path = "crates/cuda", version = "1.2.0-rc1" } -sp1-stark = { path = "crates/stark", version = "1.2.0-rc1" } -sp1-lib = { path = "crates/zkvm/lib", version = "1.2.0-rc1", default-features = false } -sp1-zkvm = { path = "crates/zkvm/entrypoint", version = "1.2.0-rc1", default-features = false } +sp1-build = { path = "crates/build", version = "1.2.0-rc2" } +sp1-cli = { path = "crates/cli", version = "1.2.0-rc2", default-features = false } +sp1-core-machine = { path = "crates/core/machine", version = "1.2.0-rc2" } +sp1-core-executor = { path = "crates/core/executor", version = "1.2.0-rc2" } +sp1-curves = { path = "crates/curves", version = "1.2.0-rc2" } +sp1-derive = { path = "crates/derive", version = "1.2.0-rc2" } +sp1-eval = { path = "crates/eval", version = "1.2.0-rc2" } +sp1-helper = { path = "crates/helper", version = "1.2.0-rc2", default-features = false } +sp1-primitives = { path = "crates/primitives", version = "1.2.0-rc2" } +sp1-prover = { path = "crates/prover", version = "1.2.0-rc2" } +sp1-recursion-compiler = { path = "crates/recursion/compiler", version = "1.2.0-rc2" } +sp1-recursion-core = { path = "crates/recursion/core", version = "1.2.0-rc2", default-features = false } +sp1-recursion-core-v2 = { path = "crates/recursion/core-v2", version = "1.2.0-rc2", default-features = false } +sp1-recursion-derive = { path = "crates/recursion/derive", version = "1.2.0-rc2", default-features = false } +sp1-recursion-gnark-ffi = { path = "crates/recursion/gnark-ffi", version = "1.2.0-rc2", default-features = false } +sp1-recursion-program = { path = "crates/recursion/program", version = "1.2.0-rc2", default-features = false } +sp1-recursion-circuit = { path = "crates/recursion/circuit", version = "1.2.0-rc2", default-features = false } +sp1-sdk = { path = "crates/sdk", version = "1.2.0-rc2" } +sp1-cuda = { path = "crates/cuda", version = "1.2.0-rc2" } +sp1-stark = { path = "crates/stark", version = "1.2.0-rc2" } +sp1-lib = { path = "crates/zkvm/lib", version = "1.2.0-rc2", default-features = false } +sp1-zkvm = { path = "crates/zkvm/entrypoint", version = "1.2.0-rc2", default-features = false } # p3 p3-air = "0.1.3-succinct" diff --git a/crates/build/CHANGELOG.md b/crates/build/CHANGELOG.md index 971ec16ea..90563fbe0 100644 --- a/crates/build/CHANGELOG.md +++ b/crates/build/CHANGELOG.md @@ -12,7 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - use C++ toolchain when building programs that need C ([#1092](https://github.com/succinctlabs/sp1/pull/1092)) -## [1.0.0-rc.1](https://github.com/succinctlabs/sp1/compare/sp1-build-v1.0.0-rc.1...sp1-build-v1.0.0-rc.1) - 2024-07-19 +## [1.0.0-rc1](https://github.com/succinctlabs/sp1/compare/sp1-build-v1.0.0-rc1...sp1-build-v1.0.0-rc1) - 2024-07-19 ### Fixed diff --git a/crates/cli/CHANGELOG.md b/crates/cli/CHANGELOG.md index 8dd86ddcb..6a82f8338 100644 --- a/crates/cli/CHANGELOG.md +++ b/crates/cli/CHANGELOG.md @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.2.0-rc2](https://github.com/succinctlabs/sp1/compare/sp1-cli-v1.2.0-rc1...sp1-cli-v1.2.0-rc2) - 2024-08-29 + +### Other +- update Cargo.lock dependencies + ## [1.1.0](https://github.com/succinctlabs/sp1/compare/sp1-cli-v1.0.1...sp1-cli-v1.1.0) - 2024-08-02 ### Added @@ -21,7 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - *(deps)* bump anstyle from 1.0.7 to 1.0.8 ([#1194](https://github.com/succinctlabs/sp1/pull/1194)) - Merge branch 'main' into dev -## [1.0.0-rc.1](https://github.com/succinctlabs/sp1/compare/sp1-cli-v1.0.0-rc.1...sp1-cli-v1.0.0-rc.1) - 2024-07-19 +## [1.0.0-rc1](https://github.com/succinctlabs/sp1/compare/sp1-cli-v1.0.0-rc1...sp1-cli-v1.0.0-rc1) - 2024-07-19 ### Added diff --git a/crates/core/executor/src/events/alu.rs b/crates/core/executor/src/events/alu.rs index 67b30a6a1..b2ace9b67 100644 --- a/crates/core/executor/src/events/alu.rs +++ b/crates/core/executor/src/events/alu.rs @@ -2,7 +2,7 @@ use serde::{Deserialize, Serialize}; use crate::Opcode; -use super::create_alu_lookups; +use super::{create_alu_lookups, LookupId}; /// Arithmetic Logic Unit (ALU) Event. /// @@ -11,7 +11,7 @@ use super::create_alu_lookups; #[derive(Debug, Clone, Copy, Serialize, Deserialize)] pub struct AluEvent { /// The lookup identifer. - pub lookup_id: u128, + pub lookup_id: LookupId, /// The shard number. pub shard: u32, /// The channel number. @@ -26,8 +26,8 @@ pub struct AluEvent { pub b: u32, /// The third operand. pub c: u32, - /// The result of the operation. - pub sub_lookups: [u128; 6], + /// The result of the operation in the format of [``LookupId``; 6] + pub sub_lookups: [LookupId; 6], } impl AluEvent { @@ -35,7 +35,7 @@ impl AluEvent { #[must_use] pub fn new(shard: u32, channel: u8, clk: u32, opcode: Opcode, a: u32, b: u32, c: u32) -> Self { Self { - lookup_id: 0, + lookup_id: LookupId::default(), shard, channel, clk, diff --git a/crates/core/executor/src/events/cpu.rs b/crates/core/executor/src/events/cpu.rs index 31af950d4..cf6d9b4da 100644 --- a/crates/core/executor/src/events/cpu.rs +++ b/crates/core/executor/src/events/cpu.rs @@ -2,7 +2,7 @@ use serde::{Deserialize, Serialize}; use crate::Instruction; -use super::memory::MemoryRecordEnum; +use super::{memory::MemoryRecordEnum, LookupId}; /// CPU Event. /// @@ -41,23 +41,23 @@ pub struct CpuEvent { /// The exit code. pub exit_code: u32, /// The ALU lookup id. - pub alu_lookup_id: u128, + pub alu_lookup_id: LookupId, /// The syscall lookup id. - pub syscall_lookup_id: u128, + pub syscall_lookup_id: LookupId, /// The memory add lookup id. - pub memory_add_lookup_id: u128, + pub memory_add_lookup_id: LookupId, /// The memory sub lookup id. - pub memory_sub_lookup_id: u128, + pub memory_sub_lookup_id: LookupId, /// The branch gt lookup id. - pub branch_gt_lookup_id: u128, + pub branch_gt_lookup_id: LookupId, /// The branch lt lookup id. - pub branch_lt_lookup_id: u128, + pub branch_lt_lookup_id: LookupId, /// The branch add lookup id. - pub branch_add_lookup_id: u128, + pub branch_add_lookup_id: LookupId, /// The jump jal lookup id. - pub jump_jal_lookup_id: u128, + pub jump_jal_lookup_id: LookupId, /// The jump jalr lookup id. - pub jump_jalr_lookup_id: u128, + pub jump_jalr_lookup_id: LookupId, /// The auipc lookup id. - pub auipc_lookup_id: u128, + pub auipc_lookup_id: LookupId, } diff --git a/crates/core/executor/src/events/precompiles/ec.rs b/crates/core/executor/src/events/precompiles/ec.rs index 03efcb774..ff8fee984 100644 --- a/crates/core/executor/src/events/precompiles/ec.rs +++ b/crates/core/executor/src/events/precompiles/ec.rs @@ -9,7 +9,10 @@ use sp1_primitives::consts::{bytes_to_words_le_vec, words_to_bytes_le_vec}; use typenum::Unsigned; use crate::{ - events::memory::{MemoryReadRecord, MemoryWriteRecord}, + events::{ + memory::{MemoryReadRecord, MemoryWriteRecord}, + LookupId, + }, syscalls::SyscallContext, }; @@ -18,7 +21,7 @@ use crate::{ /// This event is emitted when an elliptic curve addition operation is performed. #[derive(Debug, Clone, Serialize, Deserialize)] pub struct EllipticCurveAddEvent { - pub(crate) lookup_id: u128, + pub(crate) lookup_id: LookupId, /// The shard number. pub shard: u32, /// The channel number. @@ -45,7 +48,7 @@ pub struct EllipticCurveAddEvent { #[derive(Debug, Clone, Serialize, Deserialize)] pub struct EllipticCurveDoubleEvent { /// The lookup identifer. - pub lookup_id: u128, + pub lookup_id: LookupId, /// The shard number. pub shard: u32, /// The channel number. @@ -66,7 +69,7 @@ pub struct EllipticCurveDoubleEvent { #[derive(Debug, Clone, Serialize, Deserialize)] pub struct EllipticCurveDecompressEvent { /// The lookup identifer. - pub lookup_id: u128, + pub lookup_id: LookupId, /// The shard number. pub shard: u32, /// The channel number. diff --git a/crates/core/executor/src/events/precompiles/edwards.rs b/crates/core/executor/src/events/precompiles/edwards.rs index 672602b2e..17daf6837 100644 --- a/crates/core/executor/src/events/precompiles/edwards.rs +++ b/crates/core/executor/src/events/precompiles/edwards.rs @@ -1,7 +1,10 @@ use serde::{Deserialize, Serialize}; use sp1_curves::{edwards::WORDS_FIELD_ELEMENT, COMPRESSED_POINT_BYTES, NUM_BYTES_FIELD_ELEMENT}; -use crate::events::memory::{MemoryReadRecord, MemoryWriteRecord}; +use crate::events::{ + memory::{MemoryReadRecord, MemoryWriteRecord}, + LookupId, +}; /// Edwards Decompress Event. /// @@ -9,7 +12,7 @@ use crate::events::memory::{MemoryReadRecord, MemoryWriteRecord}; #[derive(Debug, Clone, Serialize, Deserialize)] pub struct EdDecompressEvent { /// The lookup identifer. - pub lookup_id: u128, + pub lookup_id: LookupId, /// The shard number. pub shard: u32, /// The channel number. diff --git a/crates/core/executor/src/events/precompiles/fptower.rs b/crates/core/executor/src/events/precompiles/fptower.rs index bfe30431f..1ae2afd00 100644 --- a/crates/core/executor/src/events/precompiles/fptower.rs +++ b/crates/core/executor/src/events/precompiles/fptower.rs @@ -1,8 +1,8 @@ use serde::{Deserialize, Serialize}; -use crate::events::{MemoryReadRecord, MemoryWriteRecord}; +use crate::events::{LookupId, MemoryReadRecord, MemoryWriteRecord}; -/// Airthmetic operation for emulating modular arithmetic. +/// This is an arithmetic operation for emulating modular arithmetic. #[derive(PartialEq, Copy, Clone, Debug, Serialize, Deserialize)] pub enum FieldOperation { /// Addition. @@ -21,7 +21,7 @@ pub enum FieldOperation { #[derive(Debug, Clone, Serialize, Deserialize)] pub struct FpOpEvent { /// The lookup id. - pub lookup_id: usize, + pub lookup_id: LookupId, /// The shard number. pub shard: u32, /// The channel number. @@ -50,7 +50,7 @@ pub struct FpOpEvent { #[derive(Debug, Clone, Serialize, Deserialize)] pub struct Fp2AddSubEvent { /// The lookup id. - pub lookup_id: usize, + pub lookup_id: LookupId, /// The shard number. pub shard: u32, /// The channel number. @@ -77,7 +77,7 @@ pub struct Fp2AddSubEvent { #[derive(Debug, Clone, Serialize, Deserialize)] pub struct Fp2MulEvent { /// The lookup id. - pub lookup_id: usize, + pub lookup_id: LookupId, /// The shard number. pub shard: u32, /// The channel number. diff --git a/crates/core/executor/src/events/precompiles/keccak256_permute.rs b/crates/core/executor/src/events/precompiles/keccak256_permute.rs index e9934eb2d..19ad29503 100644 --- a/crates/core/executor/src/events/precompiles/keccak256_permute.rs +++ b/crates/core/executor/src/events/precompiles/keccak256_permute.rs @@ -1,6 +1,9 @@ use serde::{Deserialize, Serialize}; -use crate::events::memory::{MemoryReadRecord, MemoryWriteRecord}; +use crate::events::{ + memory::{MemoryReadRecord, MemoryWriteRecord}, + LookupId, +}; pub(crate) const STATE_SIZE: usize = 25; @@ -10,7 +13,7 @@ pub(crate) const STATE_SIZE: usize = 25; #[derive(Debug, Clone, Serialize, Deserialize)] pub struct KeccakPermuteEvent { /// The lookup identifer. - pub lookup_id: u128, + pub lookup_id: LookupId, /// The shard number. pub shard: u32, /// The channel number. diff --git a/crates/core/executor/src/events/precompiles/sha256_compress.rs b/crates/core/executor/src/events/precompiles/sha256_compress.rs index 421ed54e8..4c3f42bf3 100644 --- a/crates/core/executor/src/events/precompiles/sha256_compress.rs +++ b/crates/core/executor/src/events/precompiles/sha256_compress.rs @@ -1,6 +1,9 @@ use serde::{Deserialize, Serialize}; -use crate::events::memory::{MemoryReadRecord, MemoryWriteRecord}; +use crate::events::{ + memory::{MemoryReadRecord, MemoryWriteRecord}, + LookupId, +}; /// SHA-256 Compress Event. /// @@ -8,7 +11,7 @@ use crate::events::memory::{MemoryReadRecord, MemoryWriteRecord}; #[derive(Debug, Clone, Serialize, Deserialize)] pub struct ShaCompressEvent { /// The lookup identifer. - pub lookup_id: u128, + pub lookup_id: LookupId, /// The shard number. pub shard: u32, /// The channel number. diff --git a/crates/core/executor/src/events/precompiles/sha256_extend.rs b/crates/core/executor/src/events/precompiles/sha256_extend.rs index 64d7e4330..f63998362 100644 --- a/crates/core/executor/src/events/precompiles/sha256_extend.rs +++ b/crates/core/executor/src/events/precompiles/sha256_extend.rs @@ -1,6 +1,7 @@ use serde::{Deserialize, Serialize}; use crate::events::memory::{MemoryReadRecord, MemoryWriteRecord}; +use crate::events::LookupId; /// SHA-256 Extend Event. /// @@ -8,7 +9,7 @@ use crate::events::memory::{MemoryReadRecord, MemoryWriteRecord}; #[derive(Debug, Clone, Serialize, Deserialize)] pub struct ShaExtendEvent { /// The lookup identifer. - pub lookup_id: u128, + pub lookup_id: LookupId, /// The shard number. pub shard: u32, /// The channel number. diff --git a/crates/core/executor/src/events/precompiles/uint256.rs b/crates/core/executor/src/events/precompiles/uint256.rs index 7c4cb136f..bcd13e140 100644 --- a/crates/core/executor/src/events/precompiles/uint256.rs +++ b/crates/core/executor/src/events/precompiles/uint256.rs @@ -1,6 +1,9 @@ use serde::{Deserialize, Serialize}; -use crate::events::memory::{MemoryReadRecord, MemoryWriteRecord}; +use crate::events::{ + memory::{MemoryReadRecord, MemoryWriteRecord}, + LookupId, +}; /// Uint256 Mul Event. /// @@ -8,7 +11,7 @@ use crate::events::memory::{MemoryReadRecord, MemoryWriteRecord}; #[derive(Debug, Clone, Serialize, Deserialize)] pub struct Uint256MulEvent { /// The lookup identifer. - pub lookup_id: u128, + pub lookup_id: LookupId, /// The shard number. pub shard: u32, /// The channel number. diff --git a/crates/core/executor/src/events/utils.rs b/crates/core/executor/src/events/utils.rs index 7ef304ae4..681bc6cc7 100644 --- a/crates/core/executor/src/events/utils.rs +++ b/crates/core/executor/src/events/utils.rs @@ -1,3 +1,5 @@ +use serde::Deserialize; +use serde::Serialize; use std::{ fmt::Display, iter::{Map, Peekable}, @@ -5,18 +7,41 @@ use std::{ use rand::{thread_rng, Rng}; -/// Creates a new ALU lookup id. +/// A unique identifier for lookups. +/// +/// We use 4 u32s instead of a u128 to make it compatible with C. +#[derive(Deserialize, Serialize, Debug, Clone, Copy, Default, Eq, Hash, PartialEq)] + +pub struct LookupId { + /// First part of the id. + pub a: u32, + /// Second part of the id. + pub b: u32, + /// Third part of the id. + pub c: u32, + /// Fourth part of the id. + pub d: u32, +} + +/// Creates a new ALU lookup id with ``LookupId`` #[must_use] -pub fn create_alu_lookup_id() -> u128 { +pub fn create_alu_lookup_id() -> LookupId { let mut rng = thread_rng(); - rng.gen() + LookupId { a: rng.gen(), b: rng.gen(), c: rng.gen(), d: rng.gen() } } -/// Creates a new ALU lookup ids. +/// Creates a new ALU lookup id with ``LookupId`` #[must_use] -pub fn create_alu_lookups() -> [u128; 6] { +pub fn create_alu_lookups() -> [LookupId; 6] { let mut rng = thread_rng(); - [rng.gen(), rng.gen(), rng.gen(), rng.gen(), rng.gen(), rng.gen()] + [ + LookupId { a: rng.gen(), b: rng.gen(), c: rng.gen(), d: rng.gen() }, + LookupId { a: rng.gen(), b: rng.gen(), c: rng.gen(), d: rng.gen() }, + LookupId { a: rng.gen(), b: rng.gen(), c: rng.gen(), d: rng.gen() }, + LookupId { a: rng.gen(), b: rng.gen(), c: rng.gen(), d: rng.gen() }, + LookupId { a: rng.gen(), b: rng.gen(), c: rng.gen(), d: rng.gen() }, + LookupId { a: rng.gen(), b: rng.gen(), c: rng.gen(), d: rng.gen() }, + ] } /// Returns sorted and formatted rows of a table of counts (e.g. `opcode_counts`). diff --git a/crates/core/executor/src/executor.rs b/crates/core/executor/src/executor.rs index 539034276..10eaaae2c 100644 --- a/crates/core/executor/src/executor.rs +++ b/crates/core/executor/src/executor.rs @@ -13,8 +13,9 @@ use thiserror::Error; use crate::{ context::SP1Context, events::{ - create_alu_lookup_id, create_alu_lookups, AluEvent, CpuEvent, MemoryAccessPosition, - MemoryInitializeFinalizeEvent, MemoryReadRecord, MemoryRecord, MemoryWriteRecord, + create_alu_lookup_id, create_alu_lookups, AluEvent, CpuEvent, LookupId, + MemoryAccessPosition, MemoryInitializeFinalizeEvent, MemoryReadRecord, MemoryRecord, + MemoryWriteRecord, }, hook::{HookEnv, HookRegistry}, record::{ExecutionRecord, MemoryAccessRecord}, @@ -143,6 +144,10 @@ pub enum ExecutionError { /// The execution failed with an unimplemented feature. #[error("got unimplemented as opcode")] Unimplemented(), + + /// The program ended in unconstrained mode. + #[error("program ended in unconstrained mode")] + EndInUnconstrained(), } macro_rules! assert_valid_memory_access { @@ -252,7 +257,10 @@ impl<'a> Executor<'a> { let addr = Register::from_u32(i as u32) as u32; let record = self.state.memory.get(&addr); - if self.executor_mode != ExecutorMode::Simple { + // Only add the previous memory state to checkpoint map if we're in checkpoint mode, + // or if we're in unconstrained mode. In unconstrained mode, the mode is always + // Simple. + if self.executor_mode == ExecutorMode::Checkpoint || self.unconstrained { match record { Some(record) => { self.memory_checkpoint.entry(addr).or_insert_with(|| Some(*record)); @@ -277,7 +285,7 @@ impl<'a> Executor<'a> { let addr = register as u32; let record = self.state.memory.get(&addr); - if self.executor_mode != ExecutorMode::Simple { + if self.executor_mode == ExecutorMode::Checkpoint || self.unconstrained { match record { Some(record) => { self.memory_checkpoint.entry(addr).or_insert_with(|| Some(*record)); @@ -300,7 +308,7 @@ impl<'a> Executor<'a> { #[allow(clippy::single_match_else)] let record = self.state.memory.get(&addr); - if self.executor_mode != ExecutorMode::Simple { + if self.executor_mode == ExecutorMode::Checkpoint || self.unconstrained { match record { Some(record) => { self.memory_checkpoint.entry(addr).or_insert_with(|| Some(*record)); @@ -348,7 +356,7 @@ impl<'a> Executor<'a> { pub fn mr(&mut self, addr: u32, shard: u32, timestamp: u32) -> MemoryReadRecord { // Get the memory record entry. let entry = self.state.memory.entry(addr); - if self.executor_mode != ExecutorMode::Simple { + if self.executor_mode == ExecutorMode::Checkpoint || self.unconstrained { match entry { Entry::Occupied(ref entry) => { let record = entry.get(); @@ -393,7 +401,7 @@ impl<'a> Executor<'a> { pub fn mw(&mut self, addr: u32, value: u32, shard: u32, timestamp: u32) -> MemoryWriteRecord { // Get the memory record entry. let entry = self.state.memory.entry(addr); - if self.executor_mode != ExecutorMode::Simple { + if self.executor_mode == ExecutorMode::Checkpoint || self.unconstrained { match entry { Entry::Occupied(ref entry) => { let record = entry.get(); @@ -525,8 +533,8 @@ impl<'a> Executor<'a> { memory_store_value: Option, record: MemoryAccessRecord, exit_code: u32, - lookup_id: u128, - syscall_lookup_id: u128, + lookup_id: LookupId, + syscall_lookup_id: LookupId, ) { let cpu_event = CpuEvent { shard, @@ -560,7 +568,7 @@ impl<'a> Executor<'a> { } /// Emit an ALU event. - fn emit_alu(&mut self, clk: u32, opcode: Opcode, a: u32, b: u32, c: u32, lookup_id: u128) { + fn emit_alu(&mut self, clk: u32, opcode: Opcode, a: u32, b: u32, c: u32, lookup_id: LookupId) { let event = AluEvent { lookup_id, shard: self.shard(), @@ -628,7 +636,7 @@ impl<'a> Executor<'a> { a: u32, b: u32, c: u32, - lookup_id: u128, + lookup_id: LookupId, ) { self.rw(rd, a); if self.executor_mode == ExecutorMode::Trace { @@ -685,13 +693,19 @@ impl<'a> Executor<'a> { let (addr, memory_read_value): (u32, u32); let mut memory_store_value: Option = None; - if self.executor_mode != ExecutorMode::Simple { + if self.executor_mode == ExecutorMode::Trace { self.memory_accesses = MemoryAccessRecord::default(); } - let lookup_id = - if self.executor_mode == ExecutorMode::Simple { 0 } else { create_alu_lookup_id() }; - let syscall_lookup_id = - if self.executor_mode == ExecutorMode::Simple { 0 } else { create_alu_lookup_id() }; + let lookup_id = if self.executor_mode == ExecutorMode::Simple { + LookupId::default() + } else { + create_alu_lookup_id() + }; + let syscall_lookup_id = if self.executor_mode == ExecutorMode::Simple { + LookupId::default() + } else { + create_alu_lookup_id() + }; if self.print_report && !self.unconstrained { self.report @@ -1119,8 +1133,14 @@ impl<'a> Executor<'a> { } } - Ok(self.state.pc.wrapping_sub(self.program.pc_base) - >= (self.program.instructions.len() * 4) as u32) + let done = self.state.pc == 0 + || self.state.pc.wrapping_sub(self.program.pc_base) + >= (self.program.instructions.len() * 4) as u32; + if done && self.unconstrained { + log::error!("program ended in unconstrained mode at clk {}", self.state.global_clk); + return Err(ExecutionError::EndInUnconstrained()); + } + Ok(done) } /// Bump the record. @@ -1156,7 +1176,7 @@ impl<'a> Executor<'a> { self.executor_mode = ExecutorMode::Checkpoint; self.print_report = true; - // Take memory out and then clone so that memory is not cloned. + // Take memory out of state before cloning it so that memory is not cloned. let memory = std::mem::take(&mut self.state.memory); let mut checkpoint = tracing::info_span!("clone").in_scope(|| self.state.clone()); self.state.memory = memory; @@ -1347,7 +1367,7 @@ impl<'a> Executor<'a> { self.report.touched_memory_addresses = self.state.memory.len() as u64; for addr in self.state.memory.keys() { - if addr == &0 { + if *addr == 0 { // Handled above. continue; } diff --git a/crates/core/executor/src/lib.rs b/crates/core/executor/src/lib.rs index e45a5ea6c..eb9b85024 100644 --- a/crates/core/executor/src/lib.rs +++ b/crates/core/executor/src/lib.rs @@ -36,6 +36,7 @@ mod report; mod state; pub mod subproof; pub mod syscalls; +mod utils; pub use context::*; pub use executor::*; diff --git a/crates/core/executor/src/record.rs b/crates/core/executor/src/record.rs index fe2fab16d..ab78477f0 100644 --- a/crates/core/executor/src/record.rs +++ b/crates/core/executor/src/record.rs @@ -10,7 +10,7 @@ use super::{program::Program, Opcode}; use crate::events::{ add_sharded_byte_lookup_events, AluEvent, ByteLookupEvent, ByteRecord, CpuEvent, EdDecompressEvent, EllipticCurveAddEvent, EllipticCurveDecompressEvent, - EllipticCurveDoubleEvent, Fp2AddSubEvent, Fp2MulEvent, FpOpEvent, KeccakPermuteEvent, + EllipticCurveDoubleEvent, Fp2AddSubEvent, Fp2MulEvent, FpOpEvent, KeccakPermuteEvent, LookupId, MemoryInitializeFinalizeEvent, MemoryRecordEnum, ShaCompressEvent, ShaExtendEvent, Uint256MulEvent, }; @@ -89,7 +89,7 @@ pub struct ExecutionRecord { /// The public values. pub public_values: PublicValues, /// The nonce lookup. - pub nonce_lookup: HashMap, + pub nonce_lookup: HashMap, } impl ExecutionRecord { diff --git a/crates/core/executor/src/state.rs b/crates/core/executor/src/state.rs index be4371825..8334df013 100644 --- a/crates/core/executor/src/state.rs +++ b/crates/core/executor/src/state.rs @@ -13,6 +13,7 @@ use crate::{ events::MemoryRecord, record::{ExecutionRecord, MemoryAccessRecord}, syscalls::SyscallCode, + utils::{deserialize_hashmap_as_vec, serialize_hashmap_as_vec}, ExecutorMode, }; @@ -39,18 +40,18 @@ pub struct ExecutionState { /// The memory which instructions operate over. Values contain the memory value and last shard /// + timestamp that each memory address was accessed. - // #[serde( - // serialize_with = "serialize_hashmap_as_vec", - // deserialize_with = "deserialize_hashmap_as_vec" - // )] + #[serde( + serialize_with = "serialize_hashmap_as_vec", + deserialize_with = "deserialize_hashmap_as_vec" + )] pub memory: HashMap>, /// Uninitialized memory addresses that have a specific value they should be initialized with. /// SyscallHintRead uses this to write hint data into uninitialized memory. - // #[serde( - // serialize_with = "serialize_hashmap_as_vec", - // deserialize_with = "deserialize_hashmap_as_vec" - // )] + #[serde( + serialize_with = "serialize_hashmap_as_vec", + deserialize_with = "deserialize_hashmap_as_vec" + )] pub uninitialized_memory: HashMap>, /// A stream of input values (global to the entire program). diff --git a/crates/core/executor/src/syscalls/context.rs b/crates/core/executor/src/syscalls/context.rs index 3d9716bb4..60c93e478 100644 --- a/crates/core/executor/src/syscalls/context.rs +++ b/crates/core/executor/src/syscalls/context.rs @@ -1,5 +1,5 @@ use crate::{ - events::{MemoryReadRecord, MemoryWriteRecord}, + events::{LookupId, MemoryReadRecord, MemoryWriteRecord}, record::ExecutionRecord, Executor, Register, }; @@ -19,7 +19,7 @@ pub struct SyscallContext<'a, 'b: 'a> { /// The runtime. pub rt: &'a mut Executor<'b>, /// The syscall lookup id. - pub syscall_lookup_id: u128, + pub syscall_lookup_id: LookupId, } impl<'a, 'b> SyscallContext<'a, 'b> { @@ -33,7 +33,7 @@ impl<'a, 'b> SyscallContext<'a, 'b> { next_pc: runtime.state.pc.wrapping_add(4), exit_code: 0, rt: runtime, - syscall_lookup_id: 0, + syscall_lookup_id: LookupId::default(), } } diff --git a/crates/core/executor/src/syscalls/precompiles/fptower/fp.rs b/crates/core/executor/src/syscalls/precompiles/fptower/fp.rs index 93ea8f3f7..703efa87a 100644 --- a/crates/core/executor/src/syscalls/precompiles/fptower/fp.rs +++ b/crates/core/executor/src/syscalls/precompiles/fptower/fp.rs @@ -55,7 +55,7 @@ impl Syscall for FpOpSyscall

{ rt.clk += 1; let x_memory_records = rt.mw_slice(x_ptr, &result); - let lookup_id = rt.syscall_lookup_id as usize; + let lookup_id = rt.syscall_lookup_id; let shard = rt.current_shard(); let channel = rt.current_channel(); match P::FIELD_TYPE { diff --git a/crates/core/executor/src/syscalls/precompiles/fptower/fp2_addsub.rs b/crates/core/executor/src/syscalls/precompiles/fptower/fp2_addsub.rs index 6d737db27..548566d61 100644 --- a/crates/core/executor/src/syscalls/precompiles/fptower/fp2_addsub.rs +++ b/crates/core/executor/src/syscalls/precompiles/fptower/fp2_addsub.rs @@ -63,7 +63,7 @@ impl Syscall for Fp2AddSubSyscall

{ result.resize(num_words, 0); let x_memory_records = rt.mw_slice(x_ptr, &result); - let lookup_id = rt.syscall_lookup_id as usize; + let lookup_id = rt.syscall_lookup_id; let shard = rt.current_shard(); let channel = rt.current_channel(); let op = self.op; diff --git a/crates/core/executor/src/syscalls/precompiles/fptower/fp2_mul.rs b/crates/core/executor/src/syscalls/precompiles/fptower/fp2_mul.rs index d4e4748d9..652bba003 100644 --- a/crates/core/executor/src/syscalls/precompiles/fptower/fp2_mul.rs +++ b/crates/core/executor/src/syscalls/precompiles/fptower/fp2_mul.rs @@ -62,7 +62,7 @@ impl Syscall for Fp2MulSyscall

{ result.resize(num_words, 0); let x_memory_records = rt.mw_slice(x_ptr, &result); - let lookup_id = rt.syscall_lookup_id as usize; + let lookup_id = rt.syscall_lookup_id; let shard = rt.current_shard(); let channel = rt.current_channel(); match P::FIELD_TYPE { diff --git a/crates/core/machine/src/utils/serde.rs b/crates/core/executor/src/utils.rs similarity index 95% rename from crates/core/machine/src/utils/serde.rs rename to crates/core/executor/src/utils.rs index fa7fdcef9..2b1448a89 100644 --- a/crates/core/machine/src/utils/serde.rs +++ b/crates/core/executor/src/utils.rs @@ -1,4 +1,4 @@ -use std::collections::HashMap; +use hashbrown::HashMap; use nohash_hasher::BuildNoHashHasher; use serde::{Deserialize, Deserializer, Serialize, Serializer}; diff --git a/crates/core/machine/CHANGELOG.md b/crates/core/machine/CHANGELOG.md index 8d1e6df78..d989945fb 100644 --- a/crates/core/machine/CHANGELOG.md +++ b/crates/core/machine/CHANGELOG.md @@ -54,11 +54,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - generate dep optimizations ([#1125](https://github.com/succinctlabs/sp1/pull/1125)) - add audit reports ([#1142](https://github.com/succinctlabs/sp1/pull/1142)) -## [1.0.0-rc.1](https://github.com/succinctlabs/sp1/compare/sp1-core-v1.0.0-rc.1...sp1-core-v1.0.0-rc.1) - 2024-07-19 +## [1.0.0-rc1](https://github.com/succinctlabs/sp1/compare/sp1-core-v1.0.0-rc1...sp1-core-v1.0.0-rc1) - 2024-07-19 ### Added -- 1.0.0-rc.1 ([#1126](https://github.com/succinctlabs/sp1/pull/1126)) +- 1.0.0-rc1 ([#1126](https://github.com/succinctlabs/sp1/pull/1126)) - multi-threaded tracing ([#1124](https://github.com/succinctlabs/sp1/pull/1124)) - parallel recursion tracegen ([#1095](https://github.com/succinctlabs/sp1/pull/1095)) - publish sp1 to crates.io ([#1052](https://github.com/succinctlabs/sp1/pull/1052)) diff --git a/crates/core/machine/src/cpu/trace.rs b/crates/core/machine/src/cpu/trace.rs index 5c9d413cb..5189d7774 100644 --- a/crates/core/machine/src/cpu/trace.rs +++ b/crates/core/machine/src/cpu/trace.rs @@ -2,11 +2,11 @@ use hashbrown::HashMap; use itertools::Itertools; use sp1_core_executor::{ events::{ - create_alu_lookups, AluEvent, ByteLookupEvent, ByteRecord, CpuEvent, MemoryRecordEnum, + create_alu_lookups, AluEvent, ByteLookupEvent, ByteRecord, CpuEvent, LookupId, + MemoryRecordEnum, }, syscalls::SyscallCode, - ByteOpcode, - ByteOpcode::U16Range, + ByteOpcode::{self, U16Range}, ExecutionRecord, Opcode, Program, Register::X0, }; @@ -110,7 +110,7 @@ impl CpuChip { fn event_to_row( &self, event: &CpuEvent, - nonce_lookup: &HashMap, + nonce_lookup: &HashMap, cols: &mut CpuCols, blu_events: &mut impl ByteRecord, ) -> HashMap> { @@ -252,7 +252,7 @@ impl CpuChip { event: &CpuEvent, new_alu_events: &mut HashMap>, blu_events: &mut impl ByteRecord, - nonce_lookup: &HashMap, + nonce_lookup: &HashMap, ) { if !matches!( event.instruction.opcode, @@ -406,7 +406,7 @@ impl CpuChip { cols: &mut CpuCols, event: &CpuEvent, alu_events: &mut HashMap>, - nonce_lookup: &HashMap, + nonce_lookup: &HashMap, ) { if event.instruction.is_branch_instruction() { let branch_columns = cols.opcode_specific_columns.branch_mut(); @@ -522,7 +522,7 @@ impl CpuChip { cols: &mut CpuCols, event: &CpuEvent, alu_events: &mut HashMap>, - nonce_lookup: &HashMap, + nonce_lookup: &HashMap, ) { if event.instruction.is_jump_instruction() { let jump_columns = cols.opcode_specific_columns.jump_mut(); @@ -593,7 +593,7 @@ impl CpuChip { cols: &mut CpuCols, event: &CpuEvent, alu_events: &mut HashMap>, - nonce_lookup: &HashMap, + nonce_lookup: &HashMap, ) { if matches!(event.instruction.opcode, Opcode::AUIPC) { let auipc_columns = cols.opcode_specific_columns.auipc_mut(); @@ -628,7 +628,7 @@ impl CpuChip { &self, cols: &mut CpuCols, event: &CpuEvent, - nonce_lookup: &HashMap, + nonce_lookup: &HashMap, ) -> bool { let mut is_halt = false; diff --git a/crates/core/machine/src/utils/mod.rs b/crates/core/machine/src/utils/mod.rs index 6c08a5656..38d650052 100644 --- a/crates/core/machine/src/utils/mod.rs +++ b/crates/core/machine/src/utils/mod.rs @@ -4,14 +4,12 @@ mod logger; #[cfg(any(test, feature = "programs"))] mod programs; mod prove; -mod serde; mod span; mod tracer; pub use buffer::*; pub use logger::*; pub use prove::*; -pub use serde::*; use sp1_curves::params::Limbs; pub use span::*; pub use tracer::*; diff --git a/crates/cuda/src/lib.rs b/crates/cuda/src/lib.rs index 06bf49b4a..96a74a083 100644 --- a/crates/cuda/src/lib.rs +++ b/crates/cuda/src/lib.rs @@ -86,7 +86,7 @@ impl SP1CudaProver { /// [SP1ProverClient] that can be used to communicate with the container. pub fn new() -> Self { let container_name = "sp1-gpu"; - let image_name = "jtguibas/sp1-gpu:v1.2.0-rc1"; + let image_name = "succinctlabs/sp1-gpu:v1.2.0-rc2"; let cleaned_up = Arc::new(AtomicBool::new(false)); let cleanup_name = container_name; diff --git a/crates/derive/CHANGELOG.md b/crates/derive/CHANGELOG.md index 449fe7ad8..63727ac0c 100644 --- a/crates/derive/CHANGELOG.md +++ b/crates/derive/CHANGELOG.md @@ -12,7 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - update tg ([#1214](https://github.com/succinctlabs/sp1/pull/1214)) -## [1.0.0-rc.1](https://github.com/succinctlabs/sp1/compare/sp1-derive-v1.0.0-rc.1...sp1-derive-v1.0.0-rc.1) - 2024-07-19 +## [1.0.0-rc1](https://github.com/succinctlabs/sp1/compare/sp1-derive-v1.0.0-rc1...sp1-derive-v1.0.0-rc1) - 2024-07-19 ### Other diff --git a/crates/eval/CHANGELOG.md b/crates/eval/CHANGELOG.md new file mode 100644 index 000000000..dfd5cda08 --- /dev/null +++ b/crates/eval/CHANGELOG.md @@ -0,0 +1,36 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +## [1.2.0-rc2](https://github.com/succinctlabs/sp1/compare/sp1-eval-v1.2.0-rc1...sp1-eval-v1.2.0-rc2) - 2024-08-29 + +### Added +- performance test + add to CI ([#1426](https://github.com/succinctlabs/sp1/pull/1426)) +- restore acknolwedgements +- update tg ([#1214](https://github.com/succinctlabs/sp1/pull/1214)) +- v1.0.1 ([#1165](https://github.com/succinctlabs/sp1/pull/1165)) +- new README img ([#226](https://github.com/succinctlabs/sp1/pull/226)) +- readme updates ([#205](https://github.com/succinctlabs/sp1/pull/205)) +- more final touches ([#194](https://github.com/succinctlabs/sp1/pull/194)) +- curtaup + release system + cargo prove CLI updates ([#178](https://github.com/succinctlabs/sp1/pull/178)) +- (perf) updates from Plonky3 and verifier refactor ([#156](https://github.com/succinctlabs/sp1/pull/156)) +- developer experience improvements ([#145](https://github.com/succinctlabs/sp1/pull/145)) +- toolchain build from source & install ([#113](https://github.com/succinctlabs/sp1/pull/113)) +- io::read io::write ([#126](https://github.com/succinctlabs/sp1/pull/126)) +- tracing, profiling, benchmarking ([#99](https://github.com/succinctlabs/sp1/pull/99)) + +### Other +- update sp1 banner ([#1260](https://github.com/succinctlabs/sp1/pull/1260)) +- update docs ([#1240](https://github.com/succinctlabs/sp1/pull/1240)) +- final touches for public release ([#239](https://github.com/succinctlabs/sp1/pull/239)) +- update docs with slight nits ([#224](https://github.com/succinctlabs/sp1/pull/224)) +- sp1 rename ([#212](https://github.com/succinctlabs/sp1/pull/212)) +- enshrine AlignedBorrow macro ([#209](https://github.com/succinctlabs/sp1/pull/209)) +- readme cleanup ([#196](https://github.com/succinctlabs/sp1/pull/196)) +- rename succinct to curta ([#192](https://github.com/succinctlabs/sp1/pull/192)) +- better curta graphic ([#184](https://github.com/succinctlabs/sp1/pull/184)) +- Initial commit diff --git a/crates/eval/Cargo.toml b/crates/eval/Cargo.toml new file mode 100644 index 000000000..2f6163b98 --- /dev/null +++ b/crates/eval/Cargo.toml @@ -0,0 +1,27 @@ +[package] +name = "sp1-eval" +description = "A performance evaluation tool for SP1 programs." +readme = "../../README.md" +version = { workspace = true } +edition = { workspace = true } +license = { workspace = true } +repository = { workspace = true } +keywords = { workspace = true } +categories = { workspace = true } + +[dependencies] +sp1-prover = { workspace = true } +sp1-sdk = { workspace = true } +p3-baby-bear = { workspace = true } +sp1-stark = { workspace = true } + +anyhow = "1.0.83" +clap = { version = "4.5.9", features = ["derive"] } +csv = "1.3.0" +serde = "1.0.204" +bincode = "1.3.3" +time = "0.3.26" +slack-rust = { git = "https://github.com/dselans/slack-rust.git", branch = "main" } +tokio = { version = "1.39.0", features = ["full"] } +reqwest = { version = "0.12.4", features = ["json"] } +serde_json = "1.0.104" diff --git a/crates/eval/programs/fibonacci/elf b/crates/eval/programs/fibonacci/elf new file mode 100755 index 000000000..10b446cae Binary files /dev/null and b/crates/eval/programs/fibonacci/elf differ diff --git a/crates/eval/programs/fibonacci/input.bin b/crates/eval/programs/fibonacci/input.bin new file mode 100644 index 000000000..a8e468e77 Binary files /dev/null and b/crates/eval/programs/fibonacci/input.bin differ diff --git a/crates/eval/programs/ssz-withdrawals/elf b/crates/eval/programs/ssz-withdrawals/elf new file mode 100755 index 000000000..ef27bf0f3 Binary files /dev/null and b/crates/eval/programs/ssz-withdrawals/elf differ diff --git a/crates/eval/programs/ssz-withdrawals/input.bin b/crates/eval/programs/ssz-withdrawals/input.bin new file mode 100644 index 000000000..4ac5fc6cf Binary files /dev/null and b/crates/eval/programs/ssz-withdrawals/input.bin differ diff --git a/crates/eval/programs/tendermint/elf b/crates/eval/programs/tendermint/elf new file mode 100755 index 000000000..6ecc25003 Binary files /dev/null and b/crates/eval/programs/tendermint/elf differ diff --git a/crates/eval/programs/tendermint/input.bin b/crates/eval/programs/tendermint/input.bin new file mode 100644 index 000000000..e0d8f73d3 Binary files /dev/null and b/crates/eval/programs/tendermint/input.bin differ diff --git a/crates/eval/src/lib.rs b/crates/eval/src/lib.rs new file mode 100644 index 000000000..d30027bff --- /dev/null +++ b/crates/eval/src/lib.rs @@ -0,0 +1,424 @@ +use anyhow::Result; +use clap::{command, Parser}; +use reqwest::Client; +use serde::Serialize; +use serde_json::json; +use slack_rust::chat::post_message::{post_message, PostMessageRequest}; +use slack_rust::http_client::default_client; +use sp1_prover::{components::SP1ProverComponents, utils::get_cycles, SP1Prover}; +use sp1_sdk::SP1Context; +use sp1_stark::SP1ProverOpts; +use std::time::{Duration, Instant}; + +use program::load_program; + +use crate::program::{TesterProgram, PROGRAMS}; + +mod program; + +#[derive(Parser, Clone)] +#[command(about = "Evaluate the performance of SP1 on programs.")] +struct EvalArgs { + /// The programs to evaluate, specified by name. If not specified, all programs will be evaluated. + #[arg(long, use_value_delimiter = true, value_delimiter = ',')] + pub programs: Vec, + + /// The shard size to use for the prover. + #[arg(long)] + pub shard_size: Option, + + /// Whether to post results to Slack. + #[arg(long, default_missing_value="true", num_args=0..=1)] + pub post_to_slack: Option, + + /// The Slack channel ID to post results to, only used if post_to_slack is true. + #[arg(long)] + pub slack_channel_id: Option, + + /// The Slack bot token to post results to, only used if post_to_slack is true. + #[arg(long)] + pub slack_token: Option, + + /// Whether to post results to GitHub PR. + #[arg(long, default_missing_value="true", num_args=0..=1)] + pub post_to_github: Option, + + /// The GitHub token for authentication, only used if post_to_github is true. + #[arg(long)] + pub github_token: Option, + + /// The GitHub repository owner. + #[arg(long)] + pub repo_owner: Option, + + /// The GitHub repository name. + #[arg(long)] + pub repo_name: Option, + + /// The GitHub PR number. + #[arg(long)] + pub pr_number: Option, + + /// The name of the pull request. + #[arg(long)] + pub pr_name: Option, + + /// The name of the branch. + #[arg(long)] + pub branch_name: Option, + + /// The commit hash. + #[arg(long)] + pub commit_hash: Option, + + /// The author of the commit. + #[arg(long)] + pub author: Option, +} + +pub async fn evaluate_performance() -> Result<(), Box> +{ + let args = EvalArgs::parse(); + + // Set environment variables to configure the prover. + if let Some(shard_size) = args.shard_size { + std::env::set_var("SHARD_SIZE", format!("{}", 1 << shard_size)); + } + + // Choose which programs to evaluate. + let programs: Vec<&TesterProgram> = if args.programs.is_empty() { + PROGRAMS.iter().collect() + } else { + PROGRAMS + .iter() + .filter(|p| args.programs.iter().any(|arg| arg.eq_ignore_ascii_case(p.name))) + .collect() + }; + + // Run the evaluations on each program. + let mut reports = Vec::new(); + for program in &programs { + println!("Evaluating program: {}", program.name); + let report = run_evaluation::(program.name, program.elf, program.input); + reports.push(report); + println!("Program: {} completed", program.name); + } + + // Prepare and format the results. + let reports_len = reports.len(); + let success_count = reports.iter().filter(|r| r.success).count(); + let results_text = format_results(&args, &reports); + + // Print results + println!("{}", results_text.join("\n")); + + // Post to Slack if applicable + if args.post_to_slack.unwrap_or(false) { + match (&args.slack_token, &args.slack_channel_id) { + (Some(token), Some(channel)) => { + for message in &results_text { + post_to_slack(token, channel, message).await?; + } + } + _ => println!("Warning: post_to_slack is true, required Slack arguments are missing."), + } + } + + // Post to GitHub PR if applicable + if args.post_to_github.unwrap_or(false) { + match (&args.repo_owner, &args.repo_name, &args.pr_number, &args.github_token) { + (Some(owner), Some(repo), Some(pr_number), Some(token)) => { + let message = format_github_message(&results_text); + post_to_github_pr(owner, repo, pr_number, token, &message).await?; + } + _ => { + println!("Warning: post_to_github is true, required GitHub arguments are missing.") + } + } + } + + // Exit with an error if any programs failed. + let all_successful = success_count == reports_len; + if !all_successful { + println!("Some programs failed. Please check the results above."); + std::process::exit(1); + } + + Ok(()) +} + +#[derive(Debug, Serialize)] +pub struct PerformanceReport { + program: String, + cycles: u64, + exec_khz: f64, + core_khz: f64, + compressed_khz: f64, + time: f64, + success: bool, +} + +fn run_evaluation( + program_name: &str, + elf_path: &str, + input_path: &str, +) -> PerformanceReport { + let (elf, stdin) = load_program(elf_path, input_path); + let cycles = get_cycles(&elf, &stdin); + + let prover = SP1Prover::::new(); + let (pk, vk) = prover.setup(&elf); + + let opts = SP1ProverOpts::default(); + let context = SP1Context::default(); + + let (_, exec_duration) = time_operation(|| prover.execute(&elf, &stdin, context.clone())); + + let (core_proof, core_duration) = + time_operation(|| prover.prove_core(&pk, &stdin, opts, context).unwrap()); + + let (_, compress_duration) = + time_operation(|| prover.compress(&vk, core_proof, vec![], opts).unwrap()); + + let total_duration = exec_duration + core_duration + compress_duration; + + PerformanceReport { + program: program_name.to_string(), + cycles, + exec_khz: calculate_khz(cycles, exec_duration), + core_khz: calculate_khz(cycles, core_duration), + compressed_khz: calculate_khz(cycles, compress_duration), + time: total_duration.as_secs_f64(), + success: true, + } +} + +fn format_results(args: &EvalArgs, results: &[PerformanceReport]) -> Vec { + let mut detail_text = String::new(); + if let Some(pr_name) = &args.pr_name { + detail_text.push_str(&format!("*PR*: {}\n", pr_name)); + } + if let Some(branch_name) = &args.branch_name { + detail_text.push_str(&format!("*Branch*: {}\n", branch_name)); + } + if let Some(commit_hash) = &args.commit_hash { + detail_text.push_str(&format!("*Commit*: {}\n", &commit_hash[..8])); + } + if let Some(author) = &args.author { + detail_text.push_str(&format!("*Author*: {}\n", author)); + } + + let mut table_text = String::new(); + table_text.push_str("```\n"); + table_text.push_str("| program | cycles | execute (mHz) | core (kHZ) | compress (KHz) | time | success |\n"); + table_text.push_str("|-------------------|-------------|----------------|----------------|----------------|--------|----------|"); + + for result in results.iter() { + table_text.push_str(&format!( + "\n| {:<17} | {:>11} | {:>14.2} | {:>14.2} | {:>14.2} | {:>6} | {:<7} |", + result.program, + result.cycles, + result.exec_khz / 1000.0, + result.core_khz, + result.compressed_khz, + format_duration(result.time), + if result.success { "✅" } else { "❌" } + )); + } + table_text.push_str("\n```"); + + vec!["*SP1 Performance Test Results*\n".to_string(), detail_text, table_text] +} + +pub fn time_operation T>(operation: F) -> (T, Duration) { + let start = Instant::now(); + let result = operation(); + let duration = start.elapsed(); + (result, duration) +} + +fn calculate_khz(cycles: u64, duration: Duration) -> f64 { + let duration_secs = duration.as_secs_f64(); + if duration_secs > 0.0 { + (cycles as f64 / duration_secs) / 1_000.0 + } else { + 0.0 + } +} + +fn format_duration(duration: f64) -> String { + let secs = duration.round() as u64; + let minutes = secs / 60; + let seconds = secs % 60; + + if minutes > 0 { + format!("{}m{}s", minutes, seconds) + } else if seconds > 0 { + format!("{}s", seconds) + } else { + format!("{}ms", (duration * 1000.0).round() as u64) + } +} + +async fn post_to_slack(slack_token: &str, slack_channel_id: &str, message: &str) -> Result<()> { + let slack_api_client = default_client(); + let request = PostMessageRequest { + channel: slack_channel_id.to_string(), + text: Some(message.to_string()), + ..Default::default() + }; + + post_message(&slack_api_client, &request, slack_token).await.expect("slack api call error"); + + Ok(()) +} + +fn format_github_message(results_text: &[String]) -> String { + let mut formatted_message = String::new(); + + if let Some(title) = results_text.first() { + // Add an extra asterisk for GitHub bold formatting + formatted_message.push_str(&title.replace('*', "**")); + formatted_message.push('\n'); + } + + if let Some(details) = results_text.get(1) { + // Add an extra asterisk for GitHub bold formatting + formatted_message.push_str(&details.replace('*', "**")); + formatted_message.push('\n'); + } + + if let Some(table) = results_text.get(2) { + // Remove the triple backticks as GitHub doesn't require them for table formatting + let cleaned_table = table.trim_start_matches("```").trim_end_matches("```"); + formatted_message.push_str(cleaned_table); + } + + formatted_message +} + +async fn post_to_github_pr( + owner: &str, + repo: &str, + pr_number: &str, + token: &str, + message: &str, +) -> Result<(), Box> { + let client = Client::new(); + let base_url = format!("https://api.github.com/repos/{}/{}", owner, repo); + + // Get all comments on the PR + let comments_url = format!("{}/issues/{}/comments", base_url, pr_number); + let comments_response = client + .get(&comments_url) + .header("Authorization", format!("token {}", token)) + .header("User-Agent", "sp1-perf-bot") + .send() + .await?; + + let comments: Vec = comments_response.json().await?; + + // Look for an existing comment from our bot + let bot_comment = comments.iter().find(|comment| { + comment["user"]["login"] + .as_str() + .map(|login| login == "github-actions[bot]") + .unwrap_or(false) + }); + + if let Some(existing_comment) = bot_comment { + // Update the existing comment + let comment_url = existing_comment["url"].as_str().unwrap(); + let response = client + .patch(comment_url) + .header("Authorization", format!("token {}", token)) + .header("User-Agent", "sp1-perf-bot") + .json(&json!({ + "body": message + })) + .send() + .await?; + + if !response.status().is_success() { + return Err(format!("Failed to update comment: {:?}", response.text().await?).into()); + } + } else { + // Create a new comment + let response = client + .post(&comments_url) + .header("Authorization", format!("token {}", token)) + .header("User-Agent", "sp1-perf-bot") + .json(&json!({ + "body": message + })) + .send() + .await?; + + if !response.status().is_success() { + return Err(format!("Failed to post comment: {:?}", response.text().await?).into()); + } + } + + Ok(()) +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_format_results() { + let dummy_reports = vec![ + PerformanceReport { + program: "fibonacci".to_string(), + cycles: 11291, + exec_khz: 29290.0, + core_khz: 30.0, + compressed_khz: 0.1, + time: 622.385, + success: true, + }, + PerformanceReport { + program: "super-program".to_string(), + cycles: 275735600, + exec_khz: 70190.0, + core_khz: 310.0, + compressed_khz: 120.0, + time: 812.285, + success: true, + }, + ]; + + let args = EvalArgs { + programs: vec!["fibonacci".to_string(), "super-program".to_string()], + shard_size: None, + post_to_slack: Some(false), + slack_channel_id: None, + slack_token: None, + post_to_github: Some(true), + github_token: Some("abcdef1234567890".to_string()), + repo_owner: Some("succinctlabs".to_string()), + repo_name: Some("sp1".to_string()), + pr_number: Some("123456".to_string()), + pr_name: Some("Test PR".to_string()), + branch_name: Some("feature-branch".to_string()), + commit_hash: Some("abcdef1234567890".to_string()), + author: Some("John Doe".to_string()), + }; + + let formatted_results = format_results(&args, &dummy_reports); + + for line in &formatted_results { + println!("{}", line); + } + + assert_eq!(formatted_results.len(), 3); + assert!(formatted_results[0].contains("SP1 Performance Test Results")); + assert!(formatted_results[1].contains("*PR*: Test PR")); + assert!(formatted_results[1].contains("*Branch*: feature-branch")); + assert!(formatted_results[1].contains("*Commit*: abcdef12")); + assert!(formatted_results[1].contains("*Author*: John Doe")); + assert!(formatted_results[2].contains("fibonacci")); + assert!(formatted_results[2].contains("super-program")); + } +} diff --git a/crates/eval/src/main.rs b/crates/eval/src/main.rs new file mode 100644 index 000000000..e0e5b7888 --- /dev/null +++ b/crates/eval/src/main.rs @@ -0,0 +1,8 @@ +use anyhow::Result; +use sp1_eval::evaluate_performance; +use sp1_prover::components::DefaultProverComponents; + +#[tokio::main] +async fn main() -> Result<(), Box> { + evaluate_performance::().await +} diff --git a/crates/eval/src/program.rs b/crates/eval/src/program.rs new file mode 100644 index 000000000..49d576a9e --- /dev/null +++ b/crates/eval/src/program.rs @@ -0,0 +1,37 @@ +use sp1_sdk::SP1Stdin; +use std::fs::File; +use std::io::Read; + +#[derive(Clone)] +pub struct TesterProgram { + pub name: &'static str, + pub elf: &'static str, + pub input: &'static str, +} + +impl TesterProgram { + const fn new(name: &'static str, elf: &'static str, input: &'static str) -> Self { + Self { name, elf, input } + } +} + +pub const PROGRAMS: &[TesterProgram] = &[ + TesterProgram::new("fibonacci", "fibonacci/elf", "fibonacci/input.bin"), + TesterProgram::new("ssz-withdrawals", "ssz-withdrawals/elf", "ssz-withdrawals/input.bin"), + TesterProgram::new("tendermint", "tendermint/elf", "tendermint/input.bin"), +]; + +pub fn load_program(elf_path: &str, input_path: &str) -> (Vec, SP1Stdin) { + let elf_path = format!("./programs/{}", elf_path); + let input_path = format!("./programs/{}", input_path); + + let mut elf_file = File::open(elf_path).expect("failed to open elf"); + let mut elf = Vec::new(); + elf_file.read_to_end(&mut elf).expect("failed to read elf"); + + let input_file = File::open(input_path).expect("failed to open input"); + let stdin: SP1Stdin = + bincode::deserialize_from(input_file).expect("failed to deserialize input"); + + (elf, stdin) +} diff --git a/crates/helper/CHANGELOG.md b/crates/helper/CHANGELOG.md index 8b47f9b84..a42a34961 100644 --- a/crates/helper/CHANGELOG.md +++ b/crates/helper/CHANGELOG.md @@ -12,7 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - update tg ([#1214](https://github.com/succinctlabs/sp1/pull/1214)) -## [1.0.0-rc.1](https://github.com/succinctlabs/sp1/compare/sp1-helper-v1.0.0-rc.1...sp1-helper-v1.0.0-rc.1) - 2024-07-19 +## [1.0.0-rc1](https://github.com/succinctlabs/sp1/compare/sp1-helper-v1.0.0-rc1...sp1-helper-v1.0.0-rc1) - 2024-07-19 ### Fixed diff --git a/crates/primitives/CHANGELOG.md b/crates/primitives/CHANGELOG.md index 34c35c3d0..7c3473226 100644 --- a/crates/primitives/CHANGELOG.md +++ b/crates/primitives/CHANGELOG.md @@ -12,7 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - update tg ([#1214](https://github.com/succinctlabs/sp1/pull/1214)) -## [1.0.0-rc.1](https://github.com/succinctlabs/sp1/compare/sp1-primitives-v1.0.0-rc.1...sp1-primitives-v1.0.0-rc.1) - 2024-07-19 +## [1.0.0-rc1](https://github.com/succinctlabs/sp1/compare/sp1-primitives-v1.0.0-rc1...sp1-primitives-v1.0.0-rc1) - 2024-07-19 ### Added diff --git a/crates/prover/CHANGELOG.md b/crates/prover/CHANGELOG.md index 161cfb894..469c6b670 100644 --- a/crates/prover/CHANGELOG.md +++ b/crates/prover/CHANGELOG.md @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.2.0-rc2](https://github.com/succinctlabs/sp1/compare/sp1-prover-v1.2.0-rc1...sp1-prover-v1.2.0-rc2) - 2024-08-29 + +### Other +- update Cargo.lock dependencies + ## [1.1.0](https://github.com/succinctlabs/sp1/compare/sp1-prover-v1.0.1...sp1-prover-v1.1.0) - 2024-08-02 ### Added @@ -25,11 +30,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - *(deps)* bump thiserror from 1.0.61 to 1.0.63 ([#1136](https://github.com/succinctlabs/sp1/pull/1136)) - add audit reports ([#1142](https://github.com/succinctlabs/sp1/pull/1142)) -## [1.0.0-rc.1](https://github.com/succinctlabs/sp1/compare/sp1-prover-v1.0.0-rc.1...sp1-prover-v1.0.0-rc.1) - 2024-07-19 +## [1.0.0-rc1](https://github.com/succinctlabs/sp1/compare/sp1-prover-v1.0.0-rc1...sp1-prover-v1.0.0-rc1) - 2024-07-19 ### Added -- 1.0.0-rc.1 ([#1126](https://github.com/succinctlabs/sp1/pull/1126)) +- 1.0.0-rc1 ([#1126](https://github.com/succinctlabs/sp1/pull/1126)) - parallel recursion tracegen ([#1095](https://github.com/succinctlabs/sp1/pull/1095)) - result instead of exit(1) on trap in recursion ([#1089](https://github.com/succinctlabs/sp1/pull/1089)) - publish sp1 to crates.io ([#1052](https://github.com/succinctlabs/sp1/pull/1052)) diff --git a/crates/recursion/circuit/CHANGELOG.md b/crates/recursion/circuit/CHANGELOG.md index ee32d93bd..c2e0a0af2 100644 --- a/crates/recursion/circuit/CHANGELOG.md +++ b/crates/recursion/circuit/CHANGELOG.md @@ -20,7 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - prover trait cleanup ([#1170](https://github.com/succinctlabs/sp1/pull/1170)) - add audit reports ([#1142](https://github.com/succinctlabs/sp1/pull/1142)) -## [1.0.0-rc.1](https://github.com/succinctlabs/sp1/compare/sp1-recursion-circuit-v1.0.0-rc.1...sp1-recursion-circuit-v1.0.0-rc.1) - 2024-07-19 +## [1.0.0-rc1](https://github.com/succinctlabs/sp1/compare/sp1-recursion-circuit-v1.0.0-rc1...sp1-recursion-circuit-v1.0.0-rc1) - 2024-07-19 ### Added diff --git a/crates/recursion/compiler/CHANGELOG.md b/crates/recursion/compiler/CHANGELOG.md index 0826ab86d..b703c6065 100644 --- a/crates/recursion/compiler/CHANGELOG.md +++ b/crates/recursion/compiler/CHANGELOG.md @@ -15,7 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - BabyBear range check Gnark ([#1225](https://github.com/succinctlabs/sp1/pull/1225)) -## [1.0.0-rc.1](https://github.com/succinctlabs/sp1/compare/sp1-recursion-compiler-v1.0.0-rc.1...sp1-recursion-compiler-v1.0.0-rc.1) - 2024-07-19 +## [1.0.0-rc1](https://github.com/succinctlabs/sp1/compare/sp1-recursion-compiler-v1.0.0-rc1...sp1-recursion-compiler-v1.0.0-rc1) - 2024-07-19 ### Added diff --git a/crates/recursion/compiler/src/circuit/compiler.rs b/crates/recursion/compiler/src/circuit/compiler.rs index 2d830e53b..377d92ab9 100644 --- a/crates/recursion/compiler/src/circuit/compiler.rs +++ b/crates/recursion/compiler/src/circuit/compiler.rs @@ -7,7 +7,13 @@ use p3_field::{ use sp1_core_machine::utils::{sp1_debug_mode, SpanBuilder}; use sp1_recursion_core::air::{Block, RecursionPublicValues, RECURSIVE_PROOF_NUM_PV_ELTS}; use sp1_recursion_core_v2::{BaseAluInstr, BaseAluOpcode}; -use std::{borrow::Borrow, collections::HashMap, iter::repeat, mem::transmute}; +use std::{ + borrow::Borrow, + cmp::Ordering, + collections::BTreeMap, + iter::repeat, + mem::{take, transmute}, +}; use vec_map::VecMap; use sp1_recursion_core_v2::*; @@ -21,7 +27,7 @@ pub struct AsmCompiler { /// Map the frame pointers of the variables to the "physical" addresses. pub virtual_to_physical: VecMap>, /// Map base or extension field constants to "physical" addresses and mults. - pub consts: HashMap, (Address, C::F)>, + pub consts: BTreeMap, Address>, /// Map each "physical" address to its read count. pub addr_to_mult: VecMap, } @@ -32,12 +38,11 @@ where { /// Allocate a fresh address. Checks that the address space is not full. pub fn alloc(next_addr: &mut C::F) -> Address { - let id = Address(*next_addr); *next_addr += C::F::one(); if next_addr.is_zero() { panic!("out of address space"); } - id + Address(*next_addr) } /// Map `fp` to its existing address without changing its mult. @@ -102,7 +107,7 @@ where /// /// Ensures that `addr` has already been assigned a `mult`. pub fn read_ghost_addr(&mut self, addr: Address) -> &mut C::F { - self.read_addr_internal(addr, true) + self.read_addr_internal(addr, false) } fn read_addr_internal(&mut self, addr: Address, increment_mult: bool) -> &mut C::F { @@ -137,27 +142,36 @@ where /// /// Increments the mult, first creating an entry if it does not yet exist. pub fn read_const(&mut self, imm: Imm) -> Address { - self.consts - .entry(imm) - .and_modify(|(_, x)| *x += C::F::one()) - .or_insert_with(|| (Self::alloc(&mut self.next_addr), C::F::one())) - .0 + use vec_map::Entry; + let addr = *self.consts.entry(imm).or_insert_with(|| Self::alloc(&mut self.next_addr)); + match self.addr_to_mult.entry(addr.as_usize()) { + Entry::Vacant(entry) => drop(entry.insert(C::F::one())), + Entry::Occupied(mut entry) => *entry.get_mut() += C::F::one(), + } + addr } /// Read a constant (a.k.a. immediate). /// /// Does not increment the mult. Creates an entry if it does not yet exist. pub fn read_ghost_const(&mut self, imm: Imm) -> Address { - self.consts.entry(imm).or_insert_with(|| (Self::alloc(&mut self.next_addr), C::F::zero())).0 + let addr = *self.consts.entry(imm).or_insert_with(|| Self::alloc(&mut self.next_addr)); + self.addr_to_mult.entry(addr.as_usize()).or_insert_with(C::F::zero); + addr } - fn mem_write_const(&mut self, dst: impl Reg, src: Imm) -> Instruction { - Instruction::Mem(MemInstr { - addrs: MemIo { inner: dst.write(self) }, - vals: MemIo { inner: src.as_block() }, - mult: C::F::zero(), - kind: MemAccessKind::Write, - }) + /// Turn `dst` into an alias for the constant `src`. + fn mem_write_const(&mut self, dst: impl HasVirtualAddress, src: Imm) { + use vec_map::Entry; + let src_addr = src.read_ghost(self); + match self.virtual_to_physical.entry(dst.vaddr()) { + Entry::Vacant(entry) => drop(entry.insert(src_addr)), + Entry::Occupied(entry) => panic!( + "unexpected entry: virtual_to_physical[{:?}] = {:?}", + dst.vaddr(), + entry.get() + ), + } } fn base_alu( @@ -197,7 +211,7 @@ where use BaseAluOpcode::*; let [diff, out] = core::array::from_fn(|_| Self::alloc(&mut self.next_addr)); f(self.base_alu(SubF, diff, lhs, rhs)); - f(self.base_alu(DivF, out, diff, Imm::F(C::F::zero()))); + f(self.base_alu(DivF, out, diff, Imm::f(C::F::zero()))); } fn base_assert_ne( @@ -210,7 +224,7 @@ where let [diff, out] = core::array::from_fn(|_| Self::alloc(&mut self.next_addr)); f(self.base_alu(SubF, diff, lhs, rhs)); - f(self.base_alu(DivF, out, Imm::F(C::F::one()), diff)); + f(self.base_alu(DivF, out, Imm::f(C::F::one()), diff)); } fn ext_assert_eq( @@ -223,7 +237,7 @@ where let [diff, out] = core::array::from_fn(|_| Self::alloc(&mut self.next_addr)); f(self.ext_alu(SubE, diff, lhs, rhs)); - f(self.ext_alu(DivE, out, diff, Imm::EF(C::EF::zero()))); + f(self.ext_alu(DivE, out, diff, Imm::ef(C::EF::zero()))); } fn ext_assert_ne( @@ -236,7 +250,7 @@ where let [diff, out] = core::array::from_fn(|_| Self::alloc(&mut self.next_addr)); f(self.ext_alu(SubE, diff, lhs, rhs)); - f(self.ext_alu(DivE, out, Imm::EF(C::EF::one()), diff)); + f(self.ext_alu(DivE, out, Imm::ef(C::EF::one()), diff)); } fn poseidon2_permute( @@ -378,71 +392,71 @@ where let mut f = |instr| consumer(Ok(instr)); match ir_instr { - DslIr::ImmV(dst, src) => f(self.mem_write_const(dst, Imm::F(src))), - DslIr::ImmF(dst, src) => f(self.mem_write_const(dst, Imm::F(src))), - DslIr::ImmE(dst, src) => f(self.mem_write_const(dst, Imm::EF(src))), + DslIr::ImmV(dst, src) => self.mem_write_const(dst, Imm::f(src)), + DslIr::ImmF(dst, src) => self.mem_write_const(dst, Imm::f(src)), + DslIr::ImmE(dst, src) => self.mem_write_const(dst, Imm::ef(src)), DslIr::AddV(dst, lhs, rhs) => f(self.base_alu(AddF, dst, lhs, rhs)), - DslIr::AddVI(dst, lhs, rhs) => f(self.base_alu(AddF, dst, lhs, Imm::F(rhs))), + DslIr::AddVI(dst, lhs, rhs) => f(self.base_alu(AddF, dst, lhs, Imm::f(rhs))), DslIr::AddF(dst, lhs, rhs) => f(self.base_alu(AddF, dst, lhs, rhs)), - DslIr::AddFI(dst, lhs, rhs) => f(self.base_alu(AddF, dst, lhs, Imm::F(rhs))), + DslIr::AddFI(dst, lhs, rhs) => f(self.base_alu(AddF, dst, lhs, Imm::f(rhs))), DslIr::AddE(dst, lhs, rhs) => f(self.ext_alu(AddE, dst, lhs, rhs)), - DslIr::AddEI(dst, lhs, rhs) => f(self.ext_alu(AddE, dst, lhs, Imm::EF(rhs))), + DslIr::AddEI(dst, lhs, rhs) => f(self.ext_alu(AddE, dst, lhs, Imm::ef(rhs))), DslIr::AddEF(dst, lhs, rhs) => f(self.ext_alu(AddE, dst, lhs, rhs)), - DslIr::AddEFI(dst, lhs, rhs) => f(self.ext_alu(AddE, dst, lhs, Imm::F(rhs))), - DslIr::AddEFFI(dst, lhs, rhs) => f(self.ext_alu(AddE, dst, lhs, Imm::EF(rhs))), + DslIr::AddEFI(dst, lhs, rhs) => f(self.ext_alu(AddE, dst, lhs, Imm::f(rhs))), + DslIr::AddEFFI(dst, lhs, rhs) => f(self.ext_alu(AddE, dst, lhs, Imm::ef(rhs))), DslIr::SubV(dst, lhs, rhs) => f(self.base_alu(SubF, dst, lhs, rhs)), - DslIr::SubVI(dst, lhs, rhs) => f(self.base_alu(SubF, dst, lhs, Imm::F(rhs))), - DslIr::SubVIN(dst, lhs, rhs) => f(self.base_alu(SubF, dst, Imm::F(lhs), rhs)), + DslIr::SubVI(dst, lhs, rhs) => f(self.base_alu(SubF, dst, lhs, Imm::f(rhs))), + DslIr::SubVIN(dst, lhs, rhs) => f(self.base_alu(SubF, dst, Imm::f(lhs), rhs)), DslIr::SubF(dst, lhs, rhs) => f(self.base_alu(SubF, dst, lhs, rhs)), - DslIr::SubFI(dst, lhs, rhs) => f(self.base_alu(SubF, dst, lhs, Imm::F(rhs))), - DslIr::SubFIN(dst, lhs, rhs) => f(self.base_alu(SubF, dst, Imm::F(lhs), rhs)), + DslIr::SubFI(dst, lhs, rhs) => f(self.base_alu(SubF, dst, lhs, Imm::f(rhs))), + DslIr::SubFIN(dst, lhs, rhs) => f(self.base_alu(SubF, dst, Imm::f(lhs), rhs)), DslIr::SubE(dst, lhs, rhs) => f(self.ext_alu(SubE, dst, lhs, rhs)), - DslIr::SubEI(dst, lhs, rhs) => f(self.ext_alu(SubE, dst, lhs, Imm::EF(rhs))), - DslIr::SubEIN(dst, lhs, rhs) => f(self.ext_alu(SubE, dst, Imm::EF(lhs), rhs)), - DslIr::SubEFI(dst, lhs, rhs) => f(self.ext_alu(SubE, dst, lhs, Imm::F(rhs))), + DslIr::SubEI(dst, lhs, rhs) => f(self.ext_alu(SubE, dst, lhs, Imm::ef(rhs))), + DslIr::SubEIN(dst, lhs, rhs) => f(self.ext_alu(SubE, dst, Imm::ef(lhs), rhs)), + DslIr::SubEFI(dst, lhs, rhs) => f(self.ext_alu(SubE, dst, lhs, Imm::f(rhs))), DslIr::SubEF(dst, lhs, rhs) => f(self.ext_alu(SubE, dst, lhs, rhs)), DslIr::MulV(dst, lhs, rhs) => f(self.base_alu(MulF, dst, lhs, rhs)), - DslIr::MulVI(dst, lhs, rhs) => f(self.base_alu(MulF, dst, lhs, Imm::F(rhs))), + DslIr::MulVI(dst, lhs, rhs) => f(self.base_alu(MulF, dst, lhs, Imm::f(rhs))), DslIr::MulF(dst, lhs, rhs) => f(self.base_alu(MulF, dst, lhs, rhs)), - DslIr::MulFI(dst, lhs, rhs) => f(self.base_alu(MulF, dst, lhs, Imm::F(rhs))), + DslIr::MulFI(dst, lhs, rhs) => f(self.base_alu(MulF, dst, lhs, Imm::f(rhs))), DslIr::MulE(dst, lhs, rhs) => f(self.ext_alu(MulE, dst, lhs, rhs)), - DslIr::MulEI(dst, lhs, rhs) => f(self.ext_alu(MulE, dst, lhs, Imm::EF(rhs))), - DslIr::MulEFI(dst, lhs, rhs) => f(self.ext_alu(MulE, dst, lhs, Imm::F(rhs))), + DslIr::MulEI(dst, lhs, rhs) => f(self.ext_alu(MulE, dst, lhs, Imm::ef(rhs))), + DslIr::MulEFI(dst, lhs, rhs) => f(self.ext_alu(MulE, dst, lhs, Imm::f(rhs))), DslIr::MulEF(dst, lhs, rhs) => f(self.ext_alu(MulE, dst, lhs, rhs)), DslIr::DivF(dst, lhs, rhs) => f(self.base_alu(DivF, dst, lhs, rhs)), - DslIr::DivFI(dst, lhs, rhs) => f(self.base_alu(DivF, dst, lhs, Imm::F(rhs))), - DslIr::DivFIN(dst, lhs, rhs) => f(self.base_alu(DivF, dst, Imm::F(lhs), rhs)), + DslIr::DivFI(dst, lhs, rhs) => f(self.base_alu(DivF, dst, lhs, Imm::f(rhs))), + DslIr::DivFIN(dst, lhs, rhs) => f(self.base_alu(DivF, dst, Imm::f(lhs), rhs)), DslIr::DivE(dst, lhs, rhs) => f(self.ext_alu(DivE, dst, lhs, rhs)), - DslIr::DivEI(dst, lhs, rhs) => f(self.ext_alu(DivE, dst, lhs, Imm::EF(rhs))), - DslIr::DivEIN(dst, lhs, rhs) => f(self.ext_alu(DivE, dst, Imm::EF(lhs), rhs)), - DslIr::DivEFI(dst, lhs, rhs) => f(self.ext_alu(DivE, dst, lhs, Imm::F(rhs))), - DslIr::DivEFIN(dst, lhs, rhs) => f(self.ext_alu(DivE, dst, Imm::F(lhs), rhs)), + DslIr::DivEI(dst, lhs, rhs) => f(self.ext_alu(DivE, dst, lhs, Imm::ef(rhs))), + DslIr::DivEIN(dst, lhs, rhs) => f(self.ext_alu(DivE, dst, Imm::ef(lhs), rhs)), + DslIr::DivEFI(dst, lhs, rhs) => f(self.ext_alu(DivE, dst, lhs, Imm::f(rhs))), + DslIr::DivEFIN(dst, lhs, rhs) => f(self.ext_alu(DivE, dst, Imm::f(lhs), rhs)), DslIr::DivEF(dst, lhs, rhs) => f(self.ext_alu(DivE, dst, lhs, rhs)), - DslIr::NegV(dst, src) => f(self.base_alu(SubF, dst, Imm::F(C::F::zero()), src)), - DslIr::NegF(dst, src) => f(self.base_alu(SubF, dst, Imm::F(C::F::zero()), src)), - DslIr::NegE(dst, src) => f(self.ext_alu(SubE, dst, Imm::EF(C::EF::zero()), src)), - DslIr::InvV(dst, src) => f(self.base_alu(DivF, dst, Imm::F(C::F::one()), src)), - DslIr::InvF(dst, src) => f(self.base_alu(DivF, dst, Imm::F(C::F::one()), src)), - DslIr::InvE(dst, src) => f(self.ext_alu(DivE, dst, Imm::F(C::F::one()), src)), + DslIr::NegV(dst, src) => f(self.base_alu(SubF, dst, Imm::f(C::F::zero()), src)), + DslIr::NegF(dst, src) => f(self.base_alu(SubF, dst, Imm::f(C::F::zero()), src)), + DslIr::NegE(dst, src) => f(self.ext_alu(SubE, dst, Imm::ef(C::EF::zero()), src)), + DslIr::InvV(dst, src) => f(self.base_alu(DivF, dst, Imm::f(C::F::one()), src)), + DslIr::InvF(dst, src) => f(self.base_alu(DivF, dst, Imm::f(C::F::one()), src)), + DslIr::InvE(dst, src) => f(self.ext_alu(DivE, dst, Imm::f(C::F::one()), src)), DslIr::AssertEqV(lhs, rhs) => self.base_assert_eq(lhs, rhs, f), DslIr::AssertEqF(lhs, rhs) => self.base_assert_eq(lhs, rhs, f), DslIr::AssertEqE(lhs, rhs) => self.ext_assert_eq(lhs, rhs, f), - DslIr::AssertEqVI(lhs, rhs) => self.base_assert_eq(lhs, Imm::F(rhs), f), - DslIr::AssertEqFI(lhs, rhs) => self.base_assert_eq(lhs, Imm::F(rhs), f), - DslIr::AssertEqEI(lhs, rhs) => self.ext_assert_eq(lhs, Imm::EF(rhs), f), + DslIr::AssertEqVI(lhs, rhs) => self.base_assert_eq(lhs, Imm::f(rhs), f), + DslIr::AssertEqFI(lhs, rhs) => self.base_assert_eq(lhs, Imm::f(rhs), f), + DslIr::AssertEqEI(lhs, rhs) => self.ext_assert_eq(lhs, Imm::ef(rhs), f), DslIr::AssertNeV(lhs, rhs) => self.base_assert_ne(lhs, rhs, f), DslIr::AssertNeF(lhs, rhs) => self.base_assert_ne(lhs, rhs, f), DslIr::AssertNeE(lhs, rhs) => self.ext_assert_ne(lhs, rhs, f), - DslIr::AssertNeVI(lhs, rhs) => self.base_assert_ne(lhs, Imm::F(rhs), f), - DslIr::AssertNeFI(lhs, rhs) => self.base_assert_ne(lhs, Imm::F(rhs), f), - DslIr::AssertNeEI(lhs, rhs) => self.ext_assert_ne(lhs, Imm::EF(rhs), f), + DslIr::AssertNeVI(lhs, rhs) => self.base_assert_ne(lhs, Imm::f(rhs), f), + DslIr::AssertNeFI(lhs, rhs) => self.base_assert_ne(lhs, Imm::f(rhs), f), + DslIr::AssertNeEI(lhs, rhs) => self.ext_assert_ne(lhs, Imm::ef(rhs), f), DslIr::CircuitV2Poseidon2PermuteBabyBear(data) => { f(self.poseidon2_permute(data.0, data.1)) @@ -530,7 +544,7 @@ where // Replace the mults using the address count data gathered in this previous. // Exhaustive match for refactoring purposes. - let total_memory = self.addr_to_mult.len() + self.consts.len(); + let total_memory = self.addr_to_mult.len(); let mut backfill = |(mult, addr): (&mut F, &Address)| { *mult = self.addr_to_mult.remove(addr.as_usize()).unwrap() }; @@ -547,12 +561,6 @@ where addrs: ExtAluIo { out: ref addr, .. }, .. }) => backfill((mult, addr)), - Instruction::Mem(MemInstr { - addrs: MemIo { inner: ref addr }, - mult, - kind: MemAccessKind::Write, - .. - }) => backfill((mult, addr)), Instruction::Poseidon2(instr) => { let Poseidon2SkinnyInstr { addrs: Poseidon2Io { output: ref addrs, .. }, @@ -589,21 +597,21 @@ where .iter_mut() .for_each(|(addr, mult)| backfill((mult, addr))); } + Instruction::Mem(_) => { + panic!("mem instructions should be produced through the `consts` map") + } // Instructions that do not write to memory. - Instruction::Mem(MemInstr { kind: MemAccessKind::Read, .. }) - | Instruction::CommitPublicValues(_) - | Instruction::Print(_) => (), + Instruction::CommitPublicValues(_) | Instruction::Print(_) => (), } } }); - debug_assert!(self.addr_to_mult.is_empty()); // Initialize constants. let total_consts = self.consts.len(); - let instrs_consts = self.consts.drain().map(|(imm, (addr, mult))| { + let instrs_consts = take(&mut self.consts).into_iter().map(|(imm, addr)| { Instruction::Mem(MemInstr { addrs: MemIo { inner: addr }, vals: MemIo { inner: imm.as_block() }, - mult, + mult: self.addr_to_mult.remove(addr.as_usize()).unwrap(), kind: MemAccessKind::Write, }) }); @@ -621,6 +629,7 @@ where (instrs_consts.chain(instrs).collect(), traces) } }); + debug_assert!(self.addr_to_mult.is_empty()); RecursionProgram { instructions, total_memory, traces } } } @@ -661,6 +670,57 @@ pub enum Imm { EF(EF), } +impl Imm +where + F: Field, + EF: AbstractExtensionField, +{ + /// Wraps its argument in `Self::F`. + pub fn f(f: F) -> Self { + Self::F(f) + } + + /// If `ef` lives in the base field, then we encode it as `Self::F`. + /// Otherwise, we encode it as `Self::EF`. + pub fn ef(ef: EF) -> Self { + if ef.as_base_slice()[1..].iter().all(Field::is_zero) { + Self::F(ef.as_base_slice()[0]) + } else { + Self::EF(ef) + } + } +} + +impl PartialOrd for Imm +where + F: PartialEq + AbstractField + PartialOrd, + EF: PartialEq + AbstractExtensionField, +{ + fn partial_cmp(&self, other: &Self) -> Option { + match (self, other) { + (Imm::F(a), Imm::F(b)) => a.partial_cmp(b), + (Imm::F(_), Imm::EF(_)) => Some(Ordering::Less), + (Imm::EF(_), Imm::F(_)) => Some(Ordering::Greater), + (Imm::EF(a), Imm::EF(b)) => a.as_base_slice().partial_cmp(b.as_base_slice()), + } + } +} + +impl Ord for Imm +where + F: Eq + AbstractField + Ord, + EF: Eq + AbstractExtensionField, +{ + fn cmp(&self, other: &Self) -> Ordering { + match (self, other) { + (Imm::F(a), Imm::F(b)) => a.cmp(b), + (Imm::F(_), Imm::EF(_)) => Ordering::Less, + (Imm::EF(_), Imm::F(_)) => Ordering::Greater, + (Imm::EF(a), Imm::EF(b)) => a.as_base_slice().cmp(b.as_base_slice()), + } + } +} + impl Imm where F: AbstractField + Copy, @@ -675,6 +735,25 @@ where } } +/// Expose the "virtual address" counter of the variable types. +trait HasVirtualAddress { + fn vaddr(&self) -> usize; +} + +macro_rules! impl_has_virtual_address { + ($type:ident<$($gen:ident),*>) => { + impl<$($gen),*> HasVirtualAddress for $type<$($gen),*> { + fn vaddr(&self) -> usize { + self.0 as usize + } + } + }; +} + +impl_has_virtual_address!(Var); +impl_has_virtual_address!(Felt); +impl_has_virtual_address!(Ext); + /// Utility functions for various register types. trait Reg { /// Mark the register as to be read from, returning the "physical" address. @@ -687,54 +766,20 @@ trait Reg { fn write(&self, compiler: &mut AsmCompiler) -> Address; } -macro_rules! impl_reg_borrowed { - ($a:ty) => { - impl Reg for $a - where - C: Config, - T: Reg + ?Sized, - { - fn read(&self, compiler: &mut AsmCompiler) -> Address { - (**self).read(compiler) - } - - fn read_ghost(&self, compiler: &mut AsmCompiler) -> Address { - (**self).read_ghost(compiler) - } - - fn write(&self, compiler: &mut AsmCompiler) -> Address { - (**self).write(compiler) - } - } - }; -} +impl, T: HasVirtualAddress> Reg for T { + fn read(&self, compiler: &mut AsmCompiler) -> Address { + compiler.read_vaddr(self.vaddr()) + } -// Allow for more flexibility in arguments. -impl_reg_borrowed!(&T); -impl_reg_borrowed!(&mut T); -impl_reg_borrowed!(Box); + fn read_ghost(&self, compiler: &mut AsmCompiler) -> Address { + compiler.read_ghost_vaddr(self.vaddr()) + } -macro_rules! impl_reg_vaddr { - ($a:ty) => { - impl> Reg for $a { - fn read(&self, compiler: &mut AsmCompiler) -> Address { - compiler.read_vaddr(self.0 as usize) - } - fn read_ghost(&self, compiler: &mut AsmCompiler) -> Address { - compiler.read_ghost_vaddr(self.0 as usize) - } - fn write(&self, compiler: &mut AsmCompiler) -> Address { - compiler.write_fp(self.0 as usize) - } - } - }; + fn write(&self, compiler: &mut AsmCompiler) -> Address { + compiler.write_fp(self.vaddr()) + } } -// These three types have `.fp()` but they don't share a trait. -impl_reg_vaddr!(Var); -impl_reg_vaddr!(Felt); -impl_reg_vaddr!(Ext); - impl> Reg for Imm { fn read(&self, compiler: &mut AsmCompiler) -> Address { compiler.read_const(*self) diff --git a/crates/recursion/core-v2/src/chips/mem/constant.rs b/crates/recursion/core-v2/src/chips/mem/constant.rs index 1b3654a1e..681cbac8d 100644 --- a/crates/recursion/core-v2/src/chips/mem/constant.rs +++ b/crates/recursion/core-v2/src/chips/mem/constant.rs @@ -12,7 +12,7 @@ use crate::{builder::SP1RecursionAirBuilder, *}; use super::MemoryAccessCols; -pub const NUM_MEM_ENTRIES_PER_ROW: usize = 16; +pub const NUM_MEM_ENTRIES_PER_ROW: usize = 6; #[derive(Default)] pub struct MemoryChip { diff --git a/crates/recursion/core/CHANGELOG.md b/crates/recursion/core/CHANGELOG.md index 1f859293d..f2e143afe 100644 --- a/crates/recursion/core/CHANGELOG.md +++ b/crates/recursion/core/CHANGELOG.md @@ -20,7 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - *(deps)* bump arrayref from 0.3.7 to 0.3.8 ([#1154](https://github.com/succinctlabs/sp1/pull/1154)) - add audit reports ([#1142](https://github.com/succinctlabs/sp1/pull/1142)) -## [1.0.0-rc.1](https://github.com/succinctlabs/sp1/compare/sp1-recursion-core-v1.0.0-rc.1...sp1-recursion-core-v1.0.0-rc.1) - 2024-07-19 +## [1.0.0-rc1](https://github.com/succinctlabs/sp1/compare/sp1-recursion-core-v1.0.0-rc1...sp1-recursion-core-v1.0.0-rc1) - 2024-07-19 ### Added diff --git a/crates/recursion/derive/CHANGELOG.md b/crates/recursion/derive/CHANGELOG.md index 05c797750..ba875412f 100644 --- a/crates/recursion/derive/CHANGELOG.md +++ b/crates/recursion/derive/CHANGELOG.md @@ -12,7 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - update tg ([#1214](https://github.com/succinctlabs/sp1/pull/1214)) -## [1.0.0-rc.1](https://github.com/succinctlabs/sp1/compare/sp1-recursion-derive-v1.0.0-rc.1...sp1-recursion-derive-v1.0.0-rc.1) - 2024-07-19 +## [1.0.0-rc1](https://github.com/succinctlabs/sp1/compare/sp1-recursion-derive-v1.0.0-rc1...sp1-recursion-derive-v1.0.0-rc1) - 2024-07-19 ### Other diff --git a/crates/recursion/gnark-cli/CHANGELOG.md b/crates/recursion/gnark-cli/CHANGELOG.md index 6084a52d0..c833e5105 100644 --- a/crates/recursion/gnark-cli/CHANGELOG.md +++ b/crates/recursion/gnark-cli/CHANGELOG.md @@ -7,12 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.2.0-rc2](https://github.com/succinctlabs/sp1/compare/sp1-recursion-gnark-cli-v1.2.0-rc1...sp1-recursion-gnark-cli-v1.2.0-rc2) - 2024-08-29 + +### Other +- update Cargo.lock dependencies + ## [1.1.0](https://github.com/succinctlabs/sp1/compare/sp1-recursion-gnark-cli-v1.0.1...sp1-recursion-gnark-cli-v1.1.0) - 2024-08-02 ### Added - update tg ([#1214](https://github.com/succinctlabs/sp1/pull/1214)) -## [1.0.0-rc.1](https://github.com/succinctlabs/sp1/compare/sp1-recursion-gnark-cli-v1.0.0-rc.1...sp1-recursion-gnark-cli-v1.0.0-rc.1) - 2024-07-19 +## [1.0.0-rc1](https://github.com/succinctlabs/sp1/compare/sp1-recursion-gnark-cli-v1.0.0-rc1...sp1-recursion-gnark-cli-v1.0.0-rc1) - 2024-07-19 ### Added diff --git a/crates/recursion/gnark-ffi/CHANGELOG.md b/crates/recursion/gnark-ffi/CHANGELOG.md index 1d7abddc0..37ee6833d 100644 --- a/crates/recursion/gnark-ffi/CHANGELOG.md +++ b/crates/recursion/gnark-ffi/CHANGELOG.md @@ -18,11 +18,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Other - *(deps)* bump serde_json from 1.0.120 to 1.0.121 ([#1196](https://github.com/succinctlabs/sp1/pull/1196)) -## [1.0.0-rc.1](https://github.com/succinctlabs/sp1/compare/sp1-recursion-gnark-ffi-v1.0.0-rc.1...sp1-recursion-gnark-ffi-v1.0.0-rc.1) - 2024-07-19 +## [1.0.0-rc1](https://github.com/succinctlabs/sp1/compare/sp1-recursion-gnark-ffi-v1.0.0-rc1...sp1-recursion-gnark-ffi-v1.0.0-rc1) - 2024-07-19 ### Added -- 1.0.0-rc.1 ([#1126](https://github.com/succinctlabs/sp1/pull/1126)) +- 1.0.0-rc1 ([#1126](https://github.com/succinctlabs/sp1/pull/1126)) - publish sp1 to crates.io ([#1052](https://github.com/succinctlabs/sp1/pull/1052)) - update verifier contract templates ([#963](https://github.com/succinctlabs/sp1/pull/963)) - circuit version in proof ([#926](https://github.com/succinctlabs/sp1/pull/926)) diff --git a/crates/recursion/program/CHANGELOG.md b/crates/recursion/program/CHANGELOG.md index 11ab52f1c..7a5991ce7 100644 --- a/crates/recursion/program/CHANGELOG.md +++ b/crates/recursion/program/CHANGELOG.md @@ -18,7 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - prover trait cleanup ([#1170](https://github.com/succinctlabs/sp1/pull/1170)) - add audit reports ([#1142](https://github.com/succinctlabs/sp1/pull/1142)) -## [1.0.0-rc.1](https://github.com/succinctlabs/sp1/compare/sp1-recursion-program-v1.0.0-rc.1...sp1-recursion-program-v1.0.0-rc.1) - 2024-07-19 +## [1.0.0-rc1](https://github.com/succinctlabs/sp1/compare/sp1-recursion-program-v1.0.0-rc1...sp1-recursion-program-v1.0.0-rc1) - 2024-07-19 ### Added diff --git a/crates/sdk/CHANGELOG.md b/crates/sdk/CHANGELOG.md index 99b25672a..80c7c4d27 100644 --- a/crates/sdk/CHANGELOG.md +++ b/crates/sdk/CHANGELOG.md @@ -26,11 +26,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - *(deps)* bump tokio from 1.38.0 to 1.38.1 ([#1137](https://github.com/succinctlabs/sp1/pull/1137)) - add audit reports ([#1142](https://github.com/succinctlabs/sp1/pull/1142)) -## [1.0.0-rc.1](https://github.com/succinctlabs/sp1/compare/sp1-sdk-v1.0.0-rc.1...sp1-sdk-v1.0.0-rc.1) - 2024-07-19 +## [1.0.0-rc1](https://github.com/succinctlabs/sp1/compare/sp1-sdk-v1.0.0-rc1...sp1-sdk-v1.0.0-rc1) - 2024-07-19 ### Added -- 1.0.0-rc.1 ([#1126](https://github.com/succinctlabs/sp1/pull/1126)) +- 1.0.0-rc1 ([#1126](https://github.com/succinctlabs/sp1/pull/1126)) - publish sp1 to crates.io ([#1052](https://github.com/succinctlabs/sp1/pull/1052)) - critical constraint changes ([#1046](https://github.com/succinctlabs/sp1/pull/1046)) - cycle limit ([#1027](https://github.com/succinctlabs/sp1/pull/1027)) diff --git a/crates/sdk/Cargo.toml b/crates/sdk/Cargo.toml index df0c75914..1d296f94b 100644 --- a/crates/sdk/Cargo.toml +++ b/crates/sdk/Cargo.toml @@ -13,21 +13,21 @@ categories = { workspace = true } prost = "0.12" serde = { version = "1.0.204", features = ["derive"] } serde_json = "1.0.121" -twirp = { package = "twirp-rs", version = "0.3.0-succinct" } +twirp = { package = "twirp-rs", version = "0.3.0-succinct" , optional=true } async-trait = "0.1.81" -reqwest-middleware = "0.3.2" +reqwest-middleware = { version = "0.3.2", optional = true } reqwest = { version = "0.12.4", features = [ "rustls-tls", "trust-dns", "stream", -] } +], optional = true } anyhow = "1.0.83" sp1-prover = { workspace = true } sp1-core-machine = { workspace = true } -sp1-cuda = { workspace = true } +sp1-cuda = { workspace = true , optional = true} futures = "0.3.30" bincode = "1.3.3" -tokio = { version = "1.39.2", features = ["full"] } +tokio = { version = "1.39.2", features = ["full"], optional = true} p3-matrix = { workspace = true } p3-commit = { workspace = true } p3-field = { workspace = true } @@ -37,14 +37,14 @@ indicatif = "0.17.8" tracing = "0.1.40" hex = "0.4.3" log = "0.4.22" -axum = "=0.7.4" +axum = { version = "=0.7.4", optional = true } alloy-sol-types = { version = "0.7.7", optional = true } sha2 = "0.10.8" dirs = "5.0.1" tempfile = "3.10.1" num-bigint = "0.4.6" cfg-if = "1.0" -ethers = { version = "2", default-features = false } +ethers = { version = "2", default-features = false, optional = true} strum_macros = "0.26.4" strum = "0.26.3" thiserror = "1.0.63" @@ -52,6 +52,7 @@ hashbrown = "0.14.5" sysinfo = "0.30.13" sp1-core-executor = { workspace = true } sp1-stark = { workspace = true } +getrandom = { version = "0.2.15", features = ["custom", "js"] } [features] default = ["network"] @@ -59,8 +60,8 @@ neon = ["sp1-core-machine/neon"] native-gnark = ["sp1-prover/native-gnark"] # TODO: Once alloy has a 1.* release, we can likely remove this feature flag, as there will be less # dependency resolution issues. -network = ["dep:alloy-sol-types"] -cuda = [] +network = ["dep:alloy-sol-types", "dep:tokio", "dep:ethers", "dep:reqwest", "dep:twirp", "dep:reqwest-middleware"] +cuda = ["sp1-cuda"] [build-dependencies] vergen = { version = "8", default-features = false, features = [ diff --git a/crates/sdk/src/artifacts.rs b/crates/sdk/src/artifacts.rs index 6bf52aaab..5718e4551 100644 --- a/crates/sdk/src/artifacts.rs +++ b/crates/sdk/src/artifacts.rs @@ -1,9 +1,15 @@ -use std::{cmp::min, fs::File, io::Write, path::PathBuf}; +use std::path::PathBuf; use anyhow::{Context, Result}; -use futures::StreamExt; -use indicatif::{ProgressBar, ProgressStyle}; -use reqwest::Client; + +#[cfg(feature = "network")] +use { + futures::StreamExt, + indicatif::{ProgressBar, ProgressStyle}, + reqwest::Client, + std::{cmp::min, fs::File, io::Write}, +}; + pub use sp1_prover::build::build_plonk_bn254_artifacts_with_dummy; use crate::install::try_install_circuit_artifacts; @@ -66,6 +72,7 @@ pub fn export_solidity_groth16_bn254_verifier(output_dir: impl Into) -> Ok(()) } +#[cfg(feature = "network")] pub async fn download_file( client: &Client, url: &str, diff --git a/crates/sdk/src/install.rs b/crates/sdk/src/install.rs index d0cbf87ca..4b7ed858d 100644 --- a/crates/sdk/src/install.rs +++ b/crates/sdk/src/install.rs @@ -1,23 +1,28 @@ -use std::{cmp::min, io::Write, path::PathBuf, process::Command}; - -use futures::StreamExt; -use indicatif::{ProgressBar, ProgressStyle}; -use reqwest::Client; -use sp1_cuda::block_on; +use cfg_if::cfg_if; +use std::path::PathBuf; + +#[cfg(feature = "network")] +use { + crate::block_on, + futures::StreamExt, + indicatif::{ProgressBar, ProgressStyle}, + reqwest::Client, + std::{cmp::min, io::Write, process::Command}, +}; use crate::SP1_CIRCUIT_VERSION; /// The base URL for the S3 bucket containing the ciruit artifacts. pub const CIRCUIT_ARTIFACTS_URL_BASE: &str = "https://sp1-circuits.s3-us-east-2.amazonaws.com"; -/// Gets the directory where the circuit artifacts are installed. -fn circuit_artifacts_dir() -> PathBuf { +/// The directory where the circuit artifacts will be stored. +pub fn install_circuit_artifacts_dir() -> PathBuf { dirs::home_dir().unwrap().join(".sp1").join("circuits").join(SP1_CIRCUIT_VERSION) } /// Tries to install the circuit artifacts if they are not already installed. pub fn try_install_circuit_artifacts() -> PathBuf { - let build_dir = circuit_artifacts_dir(); + let build_dir = install_circuit_artifacts_dir(); if build_dir.exists() { println!( @@ -25,12 +30,16 @@ pub fn try_install_circuit_artifacts() -> PathBuf { build_dir.display() ); } else { - println!( - "[sp1] circuit artifacts for version {} do not exist at {}. downloading...", - SP1_CIRCUIT_VERSION, - build_dir.display() - ); - install_circuit_artifacts(build_dir.clone()); + cfg_if! { + if #[cfg(feature = "network")] { + println!( + "[sp1] circuit artifacts for version {} do not exist at {}. downloading...", + SP1_CIRCUIT_VERSION, + build_dir.display() + ); + install_circuit_artifacts(build_dir.clone()); + } + } } build_dir } @@ -39,6 +48,7 @@ pub fn try_install_circuit_artifacts() -> PathBuf { /// /// This function will download the latest circuit artifacts from the S3 bucket and extract them /// to the directory specified by [plonk_bn254_artifacts_dir()]. +#[cfg(feature = "network")] pub fn install_circuit_artifacts(build_dir: PathBuf) { // Create the build directory. std::fs::create_dir_all(&build_dir).expect("failed to create build directory"); @@ -66,12 +76,8 @@ pub fn install_circuit_artifacts(build_dir: PathBuf) { println!("[sp1] downloaded {} to {:?}", download_url, build_dir.to_str().unwrap(),); } -/// The directory where the circuit artifacts will be stored. -pub fn install_circuit_artifacts_dir() -> PathBuf { - dirs::home_dir().unwrap().join(".sp1").join("circuits").join(SP1_CIRCUIT_VERSION) -} - /// Download the file with a progress bar that indicates the progress. +#[cfg(feature = "network")] pub async fn download_file( client: &Client, url: &str, diff --git a/crates/sdk/src/lib.rs b/crates/sdk/src/lib.rs index d699a4c4b..da73835c0 100644 --- a/crates/sdk/src/lib.rs +++ b/crates/sdk/src/lib.rs @@ -6,6 +6,7 @@ //! in the official SP1 documentation for a quick start guide. #[rustfmt::skip] +#[cfg(feature = "network")] pub mod proto { pub mod network; } @@ -29,8 +30,12 @@ use cfg_if::cfg_if; pub use proof::*; pub use provers::SP1VerificationError; use sp1_prover::components::DefaultProverComponents; + use std::env; +#[cfg(feature = "network")] +use {std::future::Future, tokio::task::block_in_place}; + pub use provers::{CpuProver, MockProver, Prover}; pub use sp1_core_executor::{ExecutionReport, HookEnv, SP1Context, SP1ContextBuilder}; @@ -267,6 +272,22 @@ impl Default for ProverClient { } } +/// Utility method for blocking on an async function. +/// +/// If we're already in a tokio runtime, we'll block in place. Otherwise, we'll create a new +/// runtime. +#[cfg(feature = "network")] +pub fn block_on(fut: impl Future) -> T { + // Handle case if we're already in an tokio runtime. + if let Ok(handle) = tokio::runtime::Handle::try_current() { + block_in_place(|| handle.block_on(fut)) + } else { + // Otherwise create a new runtime. + let rt = tokio::runtime::Runtime::new().expect("Failed to create a new runtime"); + rt.block_on(fut) + } +} + #[cfg(test)] mod tests { diff --git a/crates/sdk/src/network/prover.rs b/crates/sdk/src/network/prover.rs index cd267cc2b..0b0759fcc 100644 --- a/crates/sdk/src/network/prover.rs +++ b/crates/sdk/src/network/prover.rs @@ -11,10 +11,11 @@ use crate::{ use anyhow::Result; use serde::de::DeserializeOwned; use sp1_core_machine::io::SP1Stdin; -use sp1_cuda::block_on; use sp1_prover::{components::DefaultProverComponents, SP1Prover, SP1_CIRCUIT_VERSION}; use sp1_stark::SP1ProverOpts; -use tokio::time::sleep; + +#[cfg(feature = "network")] +use {crate::block_on, tokio::time::sleep}; use crate::provers::{CpuProver, ProofOpts, ProverType}; diff --git a/crates/stark/Cargo.toml b/crates/stark/Cargo.toml index e9c76632e..e00ab2990 100644 --- a/crates/stark/Cargo.toml +++ b/crates/stark/Cargo.toml @@ -37,6 +37,8 @@ itertools = "0.13.0" tracing = "0.1.40" rayon-scan = "0.1.1" arrayref = "0.3.8" +getrandom = { version = "0.2.15", features = ["custom"] } + [dev-dependencies] sp1-zkvm = { workspace = true } diff --git a/crates/zkvm/entrypoint/CHANGELOG.md b/crates/zkvm/entrypoint/CHANGELOG.md index 752b8e646..6d65a13a7 100644 --- a/crates/zkvm/entrypoint/CHANGELOG.md +++ b/crates/zkvm/entrypoint/CHANGELOG.md @@ -15,7 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - mutable static ref warning in halt syscall ([#1217](https://github.com/succinctlabs/sp1/pull/1217)) -## [1.0.0-rc.1](https://github.com/succinctlabs/sp1/compare/sp1-zkvm-v1.0.0-rc.1...sp1-zkvm-v1.0.0-rc.1) - 2024-07-19 +## [1.0.0-rc1](https://github.com/succinctlabs/sp1/compare/sp1-zkvm-v1.0.0-rc1...sp1-zkvm-v1.0.0-rc1) - 2024-07-19 ### Added diff --git a/crates/zkvm/entrypoint/Cargo.toml b/crates/zkvm/entrypoint/Cargo.toml index bd9fed014..e24ef6b10 100644 --- a/crates/zkvm/entrypoint/Cargo.toml +++ b/crates/zkvm/entrypoint/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "sp1-zkvm" description = "SP1 is a performant, 100% open-source, contributor-friendly zkVM." -readme = "../../README.md" +readme = "../../../README.md" version = { workspace = true } edition = { workspace = true } license = { workspace = true } @@ -12,7 +12,7 @@ categories = { workspace = true } [dependencies] bincode = "1.3.3" cfg-if = "1.0.0" -getrandom = { version = "0.2.14", features = ["custom"] } +getrandom = { version = "0.2.15", features = ["custom"] } once_cell = "1.19.0" rand = "0.8.5" serde = { version = "1.0.204", features = ["derive"] } diff --git a/crates/zkvm/entrypoint/src/libm.rs b/crates/zkvm/entrypoint/src/libm.rs index 304624d00..4c8e6c3c5 100644 --- a/crates/zkvm/entrypoint/src/libm.rs +++ b/crates/zkvm/entrypoint/src/libm.rs @@ -423,6 +423,16 @@ pub fn remquo(x: f64, y: f64) -> (f64, i32) { libm::remquo(x, y) } +#[no_mangle] +pub extern "C" fn rint(arg: f64) -> f64 { + libm::rint(arg) +} + +#[no_mangle] +pub extern "C" fn rintf(arg: f32) -> f32 { + libm::rintf(arg) +} + #[no_mangle] pub fn remquof(x: f32, y: f32) -> (f32, i32) { libm::remquof(x, y) diff --git a/crates/zkvm/lib/CHANGELOG.md b/crates/zkvm/lib/CHANGELOG.md index 0e0ca7d60..f822f9880 100644 --- a/crates/zkvm/lib/CHANGELOG.md +++ b/crates/zkvm/lib/CHANGELOG.md @@ -12,7 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - update tg ([#1214](https://github.com/succinctlabs/sp1/pull/1214)) -## [1.0.0-rc.1](https://github.com/succinctlabs/sp1/compare/sp1-lib-v1.0.0-rc.1...sp1-lib-v1.0.0-rc.1) - 2024-07-19 +## [1.0.0-rc1](https://github.com/succinctlabs/sp1/compare/sp1-lib-v1.0.0-rc1...sp1-lib-v1.0.0-rc1) - 2024-07-19 ### Added diff --git a/crates/zkvm/lib/Cargo.toml b/crates/zkvm/lib/Cargo.toml index 3c819bbb6..86b4aacd0 100644 --- a/crates/zkvm/lib/Cargo.toml +++ b/crates/zkvm/lib/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "sp1-lib" description = "SP1 is a performant, 100% open-source, contributor-friendly zkVM." -readme = "../../README.md" +readme = "../../../README.md" version = { workspace = true } edition = { workspace = true } license = { workspace = true } diff --git a/tests/bls12381-decompress/Cargo.lock b/tests/bls12381-decompress/Cargo.lock index 1dacc7f0d..03a6649fd 100644 --- a/tests/bls12381-decompress/Cargo.lock +++ b/tests/bls12381-decompress/Cargo.lock @@ -34,7 +34,7 @@ dependencies = [ [[package]] name = "bls-decompress-test" -version = "1.0.0-rc.1" +version = "1.0.0-rc1" dependencies = [ "sp1-zkvm", ] @@ -335,7 +335,7 @@ dependencies = [ [[package]] name = "sp1-lib" -version = "1.0.0-rc.1" +version = "1.0.0-rc1" dependencies = [ "anyhow", "bincode", @@ -347,7 +347,7 @@ dependencies = [ [[package]] name = "sp1-zkvm" -version = "1.0.0-rc.1" +version = "1.0.0-rc1" dependencies = [ "bincode", "cfg-if",