diff --git a/.github/workflows/_rust-tests.yml b/.github/workflows/_rust-tests.yml index 3517020d3f..7d40665ef8 100644 --- a/.github/workflows/_rust-tests.yml +++ b/.github/workflows/_rust-tests.yml @@ -55,8 +55,8 @@ jobs: - name: Prepare replay.wasm env run: make build-replay-env - - name: Clippy check - run: cargo clippy --all -- -D warnings -A static_mut_refs + - name: Clippy check (non-SP1) + run: cargo clippy --workspace --exclude program --exclude sp1-builder --exclude sp1-runner --exclude stylus-compiler-program --exclude stylus-compiler-runner -- -D warnings -A static_mut_refs - name: Run rust tests id: run-rust-tests diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 02264e8ca9..a92f3270bb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -59,6 +59,7 @@ jobs: # --- Ensure changelog is updated (required by can_proceed) --- changelog: + if: github.base_ref == 'master' needs: changes uses: ./.github/workflows/_changelog.yml secrets: inherit diff --git a/.github/workflows/zk-proving.yml b/.github/workflows/zk-proving.yml new file mode 100644 index 0000000000..9c9f91dd5b --- /dev/null +++ b/.github/workflows/zk-proving.yml @@ -0,0 +1,100 @@ +name: Run SP1 runner on `replay.wasm` + +on: + workflow_dispatch: + pull_request: + branches: + - zk-prove-any/sp1-runner + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + zk-proving: + name: Run SP1 runner on `replay.wasm` + runs-on: arbitrator-ci + defaults: + run: + shell: bash + steps: + - name: Checkout + uses: actions/checkout@v6 + with: + submodules: recursive + + - name: Setup CI + uses: ./.github/actions/ci-setup + + - name: Install protobuf-compiler + run: sudo apt install -y protobuf-compiler + + - name: Setup LLVM + uses: ZhongRuoyu/setup-llvm@v0 + with: + llvm-version: 21 + + - name: Install SP1 toolchain + run: | + curl -L https://sp1up.succinct.xyz | bash + $HOME/.sp1/bin/sp1up -v v6.0.0-beta.1 + + - name: Print versions + run: | + rustc +succinct --version + rustc +succinct --print target-list | grep succinct + + - name: Build binaries and record block + run: ./crates/sp1/build.sh + + # Clippy runs after build because sp1-builder uses include_elf!(), + # which requires the SP1 ELF to exist at compile time. + - name: Clippy check (SP1) + run: cargo clippy -p program -p sp1-builder -p sp1-runner -p stylus-compiler-program -p stylus-compiler-runner -- -D warnings -A static_mut_refs -A clippy::too_many_arguments + + - name: Run stylus-compiler-runner compare + # Compare compilation consistency between running it natively and in the SP1 execution mode. + run: cargo run -p stylus-compiler-runner --release -- compare + + - name: Run validation + run: | + # Exit if any command in a pipe fails + set -e -o pipefail + + echo "--- Running SP1 Validation ---" + # Extracting only the hex string using grep -o + SP1_HASH=$(./target/sp1/sp1-runner \ + --program target/sp1/dumped_replay_wasm.elf \ + --stylus-compiler-program target/sp1/stylus-compiler-program \ + --block-file target/sp1/block_inputs_7.json 2>&1 \ + | grep "Validation succeeds with hash" \ + | awk '{print $NF}') + + if [ -z "$SP1_HASH" ]; then + echo "Error: Failed to capture hash." + exit 1 + fi + + echo "--- Running JIT Validation ---" + JIT_HASH=$(./target/bin/jit \ + --debug --cranelift \ + --binary target/machines/latest/replay.wasm \ + json --inputs=target/sp1/block_inputs_7.json 2>&1 \ + | grep "Completed in .* with hash" \ + | awk '{print $NF}' \ + | sed 's/\.$//') + + if [ -z "$JIT_HASH" ]; then + echo "Error: Failed to capture JIT hash." + exit 1 + fi + + echo "SP1 Hash: $SP1_HASH" + echo "JIT Hash: $JIT_HASH" + + if [ "$SP1_HASH" != "$JIT_HASH" ]; then + echo "::error::Hash mismatch detected!" + echo "Expected: $SP1_HASH" + echo "Actual: $JIT_HASH" + exit 1 + fi diff --git a/.gitmodules b/.gitmodules index 6ae8a9cccd..974b457334 100644 --- a/.gitmodules +++ b/.gitmodules @@ -17,6 +17,7 @@ [submodule "crates/tools/wasmer"] path = crates/tools/wasmer url = https://github.com/OffchainLabs/wasmer.git + branch = zk-prove-any/sp1-runner [submodule "nitro-testnode"] path = nitro-testnode url = https://github.com/OffchainLabs/nitro-testnode.git diff --git a/Cargo.lock b/Cargo.lock index 265e8dec04..2bd2c862b4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,17 @@ # It is not intended for manual editing. version = 4 +[[package]] +name = "addchain" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e33f6a175ec6a9e0aca777567f9ff7c3deefc255660df887e7fa3585e9801d8" +dependencies = [ + "num-bigint 0.3.3", + "num-integer", + "num-traits", +] + [[package]] name = "addr2line" version = "0.22.0" @@ -23,6 +34,18 @@ version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" +[[package]] +name = "ahash" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" +dependencies = [ + "cfg-if 1.0.4", + "once_cell", + "version_check", + "zerocopy", +] + [[package]] name = "aho-corasick" version = "1.1.3" @@ -55,7 +78,7 @@ dependencies = [ "c-kzg", "derive_more 2.1.1", "either", - "k256", + "k256 0.13.4 (registry+https://github.com/rust-lang/crates.io-index)", "once_cell", "rand 0.8.5", "secp256k1", @@ -147,21 +170,21 @@ checksum = "de3b431b4e72cd8bd0ec7a50b4be18e73dab74de0dba180eef171055e5d5926e" dependencies = [ "alloy-rlp", "bytes", - "cfg-if 1.0.0", + "cfg-if 1.0.4", "const-hex", "derive_more 2.1.1", "foldhash 0.2.0", "hashbrown 0.16.1", "indexmap 2.13.0", "itoa", - "k256", + "k256 0.13.4 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-asm", "paste", "proptest", "rand 0.9.2", "rapidhash", "ruint", - "rustc-hash", + "rustc-hash 2.1.1", "serde", "sha3", ] @@ -361,7 +384,7 @@ dependencies = [ "fnv", "hex", "num-traits", - "num_enum", + "num_enum 0.7.3", "ruint2", "serde", "siphasher 0.3.11", @@ -380,7 +403,7 @@ dependencies = [ "ark-serialize 0.3.0", "ark-std 0.3.0", "derivative", - "num-bigint", + "num-bigint 0.4.6", "num-traits", "paste", "rustc_version 0.3.3", @@ -400,7 +423,7 @@ dependencies = [ "derivative", "digest 0.10.7", "itertools 0.10.5", - "num-bigint", + "num-bigint 0.4.6", "num-traits", "paste", "rustc_version 0.4.0", @@ -421,7 +444,7 @@ dependencies = [ "digest 0.10.7", "educe", "itertools 0.13.0", - "num-bigint", + "num-bigint 0.4.6", "num-traits", "paste", "zeroize", @@ -463,7 +486,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "db2fd794a08ccb318058009eefdf15bcaaaaf6f8161eb3345f907222bac38b20" dependencies = [ - "num-bigint", + "num-bigint 0.4.6", "num-traits", "quote", "syn 1.0.109", @@ -475,7 +498,7 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" dependencies = [ - "num-bigint", + "num-bigint 0.4.6", "num-traits", "proc-macro2", "quote", @@ -488,7 +511,7 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09be120733ee33f7693ceaa202ca41accd5653b779563608f1234f78ae07c4b3" dependencies = [ - "num-bigint", + "num-bigint 0.4.6", "num-traits", "proc-macro2", "quote", @@ -513,7 +536,7 @@ checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" dependencies = [ "ark-std 0.4.0", "digest 0.10.7", - "num-bigint", + "num-bigint 0.4.6", ] [[package]] @@ -525,7 +548,7 @@ dependencies = [ "ark-std 0.5.0", "arrayvec", "digest 0.10.7", - "num-bigint", + "num-bigint 0.4.6", ] [[package]] @@ -558,11 +581,70 @@ dependencies = [ "rand 0.8.5", ] +[[package]] +name = "arrayref" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" + [[package]] name = "arrayvec" -version = "0.7.4" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + +[[package]] +name = "async-scoped" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4042078ea593edffc452eef14e99fdb2b120caa4ad9618bcdeabc4a023b98740" +dependencies = [ + "futures", + "pin-project", + "tokio", +] + +[[package]] +name = "async-stream" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b5a71a6f37880a80d1d7f19efd781e4b5de42c88f0722cc13bcb6cc2cfe8476" +dependencies = [ + "async-stream-impl", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-stream-impl" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "async-trait" +version = "0.1.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "atomic" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +checksum = "a89cbf775b137e9b968e67227ef7f775587cde3fd31b0d8599dbd0f598a48340" +dependencies = [ + "bytemuck", +] [[package]] name = "atomic-waker" @@ -620,13 +702,40 @@ dependencies = [ "fs_extra", ] +[[package]] +name = "axum" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edca88bc138befd0323b20752846e6587272d3b03b0343c8ea28a6f819e6e71f" +dependencies = [ + "async-trait", + "axum-core 0.4.5", + "bytes", + "futures-util", + "http", + "http-body", + "http-body-util", + "itoa", + "matchit 0.7.3", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "rustversion", + "serde", + "sync_wrapper", + "tower 0.5.2", + "tower-layer", + "tower-service", +] + [[package]] name = "axum" version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b52af3cb4058c895d37317bb27508dccc8e5f2d39454016b297bf4a400597b8" dependencies = [ - "axum-core", + "axum-core 0.5.5", "bytes", "form_urlencoded", "futures-util", @@ -636,7 +745,7 @@ dependencies = [ "hyper", "hyper-util", "itoa", - "matchit", + "matchit 0.8.4", "memchr", "mime", "percent-encoding", @@ -647,12 +756,32 @@ dependencies = [ "serde_urlencoded", "sync_wrapper", "tokio", - "tower", + "tower 0.5.2", "tower-layer", "tower-service", "tracing", ] +[[package]] +name = "axum-core" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09f2bd6146b97ae3359fa0cc6d6b376d9539582c7b4220f041a33ec24c226199" +dependencies = [ + "async-trait", + "bytes", + "futures-util", + "http", + "http-body", + "http-body-util", + "mime", + "pin-project-lite", + "rustversion", + "sync_wrapper", + "tower-layer", + "tower-service", +] + [[package]] name = "axum-core" version = "0.5.5" @@ -678,8 +807,8 @@ version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9963ff19f40c6102c76756ef0a46004c0d58957d87259fc9208ff8441c12ab96" dependencies = [ - "axum", - "axum-core", + "axum 0.8.8", + "axum-core 0.5.5", "bytes", "futures-util", "headers", @@ -703,11 +832,12 @@ checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" dependencies = [ "addr2line", "cc", - "cfg-if 1.0.0", + "cfg-if 1.0.4", "libc", "miniz_oxide 0.7.4", "object 0.36.2", "rustc-demangle", + "serde", ] [[package]] @@ -716,6 +846,12 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + [[package]] name = "base64" version = "0.22.1" @@ -747,6 +883,26 @@ dependencies = [ "serde", ] +[[package]] +name = "bindgen" +version = "0.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f49d8fed880d473ea71efb9bf597651e77201bdd4893efe54c9e5d65ae04ce6f" +dependencies = [ + "bitflags 2.11.0", + "cexpr", + "clang-sys", + "itertools 0.13.0", + "log", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "rustc-hash 1.1.0", + "shlex", + "syn 2.0.117", +] + [[package]] name = "bindgen" version = "0.72.1" @@ -762,7 +918,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "rustc-hash", + "rustc-hash 2.1.1", "shlex", "syn 2.0.117", ] @@ -823,13 +979,47 @@ dependencies = [ "wyz", ] +[[package]] +name = "blake2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" +dependencies = [ + "digest 0.10.7", +] + +[[package]] +name = "blake2b_simd" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b79834656f71332577234b50bfc009996f7449e0c056884e6a02492ded0ca2f3" +dependencies = [ + "arrayref", + "arrayvec", + "constant_time_eq", +] + +[[package]] +name = "blake3" +version = "1.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2468ef7d57b3fb7e16b576e8377cdbde2320c60e1491e961d11da40fc4f02a2d" +dependencies = [ + "arrayref", + "arrayvec", + "cc", + "cfg-if 1.0.4", + "constant_time_eq", + "cpufeatures", +] + [[package]] name = "block-buffer" version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ - "generic-array", + "generic-array 0.14.7", ] [[package]] @@ -841,6 +1031,19 @@ dependencies = [ "hybrid-array", ] +[[package]] +name = "bls12_381" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3c196a77437e7cc2fb515ce413a6401291578b5afc8ecb29a3c7ab957f05941" +dependencies = [ + "ff 0.12.1", + "group 0.12.1", + "pairing", + "rand_core 0.6.4", + "subtle", +] + [[package]] name = "blst" version = "0.3.14" @@ -870,7 +1073,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0686c856aa6aac0c4498f936d7d6a02df690f614c03e4d906d1018062b5c5e2c" dependencies = [ "once_cell", - "proc-macro-crate", + "proc-macro-crate 3.3.0", "proc-macro2", "quote", "syn 2.0.117", @@ -882,7 +1085,7 @@ version = "0.1.0" dependencies = [ "cc", "lazy_static", - "num_enum", + "num_enum 0.7.3", "wasmer", ] @@ -924,6 +1127,26 @@ dependencies = [ "syn 2.0.117", ] +[[package]] +name = "bytemuck" +version = "1.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8efb64bd706a16a1bdde310ae86b351e4d21550d98d056f22f8a7f7a2183fec" +dependencies = [ + "bytemuck_derive", +] + +[[package]] +name = "bytemuck_derive" +version = "1.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9abbd1bc6865053c427f7198e6af43bfdedc55ab791faed4fbd361d789575ff" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + [[package]] name = "byteorder" version = "1.5.0" @@ -966,14 +1189,46 @@ version = "0.1.0" dependencies = [ "brotli", "hex", - "k256", + "k256 0.13.4 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.8.5", "rand_pcg", - "spin", + "spin 0.10.0", "tiny-keccak", "wasmer", ] +[[package]] +name = "camino" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e629a66d692cb9ff1a1c664e41771b3dcaf961985a9774c0eb0bd1b51cf60a48" +dependencies = [ + "serde_core", +] + +[[package]] +name = "cargo-platform" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e35af189006b9c0f00a064685c727031e3ed2d8020f7ba284d78cc2671bd36ea" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo_metadata" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" +dependencies = [ + "camino", + "cargo-platform", + "semver 1.0.27", + "serde", + "serde_json", + "thiserror 1.0.63", +] + [[package]] name = "cast" version = "0.3.0" @@ -1015,9 +1270,9 @@ checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" [[package]] name = "cfg-if" -version = "1.0.0" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" [[package]] name = "cfg_aliases" @@ -1162,13 +1417,32 @@ dependencies = [ "memchr", ] +[[package]] +name = "console" +version = "0.15.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "054ccb5b10f9f2cbf51eb355ca1d05c2d279ce1804688d0db74b4733a5aeafd8" +dependencies = [ + "encode_unicode", + "libc", + "once_cell", + "unicode-width 0.2.2", + "windows-sys 0.59.0", +] + +[[package]] +name = "const-default" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b396d1f76d455557e1218ec8066ae14bba60b4b36ecd55577ba979f5db7ecaa" + [[package]] name = "const-hex" version = "1.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "531185e432bb31db1ecda541e9e7ab21468d4d844ad7505e0546a49b4945d49b" dependencies = [ - "cfg-if 1.0.0", + "cfg-if 1.0.4", "cpufeatures", "proptest", "serde_core", @@ -1186,6 +1460,12 @@ version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a6ef517f0926dd24a1582492c791b6a4818a4d94e789a334894aa15b0d12f55c" +[[package]] +name = "constant_time_eq" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d52eff69cd5e647efe296129160853a42795992097e8af39800e1060caeea9b" + [[package]] name = "convert_case" version = "0.4.0" @@ -1230,21 +1510,22 @@ checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "corosensei" version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c54787b605c7df106ceccf798df23da4f2e09918defad66705d1cedf3bb914f" +source = "git+https://github.com/OffchainLabs/corosensei?rev=6681138454747733c6adad5037024400f0c9d4e3#6681138454747733c6adad5037024400f0c9d4e3" dependencies = [ "autocfg", - "cfg-if 1.0.0", + "cfg-if 1.0.4", "libc", "scopeguard", + "sp1-primitives 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp1-zkvm", "windows-sys 0.59.0", ] [[package]] name = "cpufeatures" -version = "0.2.12" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" dependencies = [ "libc", ] @@ -1305,7 +1586,7 @@ dependencies = [ "libm", "log", "regalloc2", - "rustc-hash", + "rustc-hash 2.1.1", "serde", "smallvec", "target-lexicon", @@ -1394,7 +1675,7 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" dependencies = [ - "cfg-if 1.0.0", + "cfg-if 1.0.4", ] [[package]] @@ -1433,6 +1714,25 @@ dependencies = [ "itertools 0.10.5", ] +[[package]] +name = "critical-section" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" + +[[package]] +name = "crossbeam" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1137cd7e7fc0fb5d3c5a8678be38ec56e819125d8d7907411fe24ccb943faca8" +dependencies = [ + "crossbeam-channel", + "crossbeam-deque", + "crossbeam-epoch", + "crossbeam-queue", + "crossbeam-utils", +] + [[package]] name = "crossbeam-channel" version = "0.5.15" @@ -1488,7 +1788,7 @@ version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ - "generic-array", + "generic-array 0.14.7", "rand_core 0.6.4", "subtle", "zeroize", @@ -1500,7 +1800,7 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "generic-array", + "generic-array 0.14.7", "typenum", ] @@ -1590,7 +1890,7 @@ version = "6.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5041cc499144891f3790297212f32a74fb938e5136a14943f338ef9e0ae276cf" dependencies = [ - "cfg-if 1.0.0", + "cfg-if 1.0.4", "crossbeam-utils", "hashbrown 0.14.5", "lock_api", @@ -1599,56 +1899,196 @@ dependencies = [ ] [[package]] -name = "der" -version = "0.7.10" +name = "dashu" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb" +checksum = "85b3e5ac1e23ff1995ef05b912e2b012a8784506987a2651552db2c73fb3d7e0" dependencies = [ - "const-oid 0.9.6", - "zeroize", + "dashu-base", + "dashu-float", + "dashu-int", + "dashu-macros", + "dashu-ratio", + "rustversion", ] [[package]] -name = "deranged" -version = "0.5.5" +name = "dashu-base" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ececcb659e7ba858fb4f10388c250a7252eb0a27373f1a72b8748afdd248e587" +checksum = "c0b80bf6b85aa68c58ffea2ddb040109943049ce3fbdf4385d0380aef08ef289" + +[[package]] +name = "dashu-float" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85078445a8dbd2e1bd21f04a816f352db8d333643f0c9b78ca7c3d1df71063e7" dependencies = [ - "powerfmt", - "serde_core", + "dashu-base", + "dashu-int", + "num-modular", + "num-order", + "rustversion", + "static_assertions", ] [[package]] -name = "derivative" -version = "2.2.0" +name = "dashu-int" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +checksum = "ee99d08031ca34a4d044efbbb21dff9b8c54bb9d8c82a189187c0651ffdb9fbf" dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", + "cfg-if 1.0.4", + "dashu-base", + "num-modular", + "num-order", + "rustversion", + "static_assertions", ] [[package]] -name = "derive_more" -version = "0.99.18" +name = "dashu-macros" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" +checksum = "93381c3ef6366766f6e9ed9cf09e4ef9dec69499baf04f0c60e70d653cf0ab10" dependencies = [ - "convert_case 0.4.0", + "dashu-base", + "dashu-float", + "dashu-int", + "dashu-ratio", + "paste", + "proc-macro2", + "quote", + "rustversion", +] + +[[package]] +name = "dashu-ratio" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47e33b04dd7ce1ccf8a02a69d3419e354f2bbfdf4eb911a0b7465487248764c9" +dependencies = [ + "dashu-base", + "dashu-float", + "dashu-int", + "num-modular", + "num-order", + "rustversion", +] + +[[package]] +name = "debugid" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef552e6f588e446098f6ba40d89ac146c8c7b64aade83c051ee00bb5d2bc18d" +dependencies = [ + "uuid", +] + +[[package]] +name = "deepsize2" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b5184084af9beed35eecbf4c36baf6e26b9dc47b61b74e02f930c72a58e71b" +dependencies = [ + "deepsize_derive2", + "hashbrown 0.14.5", +] + +[[package]] +name = "deepsize_derive2" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0f8817865cacf3b93b943ca06b0fc5fd8e99eabfdb7ea5d296efcbc4afc4f69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "der" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb" +dependencies = [ + "const-oid 0.9.6", + "pem-rfc7468", + "zeroize", +] + +[[package]] +name = "deranged" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ececcb659e7ba858fb4f10388c250a7252eb0a27373f1a72b8748afdd248e587" +dependencies = [ + "powerfmt", + "serde_core", +] + +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive-where" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d08b3a0bcc0d079199cd476b2cae8435016ec11d1c0986c6901c5ac223041534" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "derive_more" +version = "0.99.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" +dependencies = [ + "convert_case 0.4.0", "proc-macro2", "quote", "rustc_version 0.4.0", "syn 2.0.117", ] +[[package]] +name = "derive_more" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05" +dependencies = [ + "derive_more-impl 1.0.0", +] + [[package]] name = "derive_more" version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d751e9e49156b02b44f9c1815bcb94b984cdcc4396ecc32521c739452808b134" dependencies = [ - "derive_more-impl", + "derive_more-impl 2.1.1", +] + +[[package]] +name = "derive_more-impl" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", ] [[package]] @@ -1671,7 +2111,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" dependencies = [ - "generic-array", + "generic-array 0.14.7", ] [[package]] @@ -1697,6 +2137,27 @@ dependencies = [ "crypto-common 0.2.1", ] +[[package]] +name = "dirs" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys 0.48.0", +] + [[package]] name = "displaydoc" version = "0.2.5" @@ -1708,12 +2169,47 @@ dependencies = [ "syn 2.0.117", ] +[[package]] +name = "downcast-rs" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" + +[[package]] +name = "downloader" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ac1e888d6830712d565b2f3a974be3200be9296bc1b03db8251a4cbf18a4a34" +dependencies = [ + "digest 0.10.7", + "futures", + "rand 0.8.5", + "reqwest 0.12.28", + "thiserror 1.0.63", + "tokio", +] + [[package]] name = "dunce" version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" +[[package]] +name = "dynasm" +version = "3.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f7d4c414c94bc830797115b8e5f434d58e7e80cb42ba88508c14bc6ea270625" +dependencies = [ + "bitflags 2.11.0", + "byteorder", + "lazy_static", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn 2.0.117", +] + [[package]] name = "dynasm" version = "5.0.0" @@ -1729,6 +2225,18 @@ dependencies = [ "syn 2.0.117", ] +[[package]] +name = "dynasmrt" +version = "3.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "602f7458a3859195fb840e6e0cce5f4330dd9dfbfece0edaf31fe427af346f55" +dependencies = [ + "byteorder", + "dynasm 3.2.1", + "fnv", + "memmap2 0.9.10", +] + [[package]] name = "dynasmrt" version = "5.0.0" @@ -1736,7 +2244,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b38e5331d851567729d892ed28d898d22f49a96940b29e23b5c3e681bd30ffb3" dependencies = [ "byteorder", - "dynasm", + "dynasm 5.0.0", "fnv", "memmap2 0.9.10", ] @@ -1750,12 +2258,25 @@ dependencies = [ "der", "digest 0.10.7", "elliptic-curve", - "rfc6979", + "rfc6979 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "serdect", "signature", "spki", ] +[[package]] +name = "ecdsa" +version = "0.16.9" +source = "git+https://github.com/sp1-patches/signatures?tag=sp1-skip-verify-on-recovery#1880299a48fe7ef249edaa616fd411239fb5daf1" +dependencies = [ + "der", + "digest 0.10.7", + "elliptic-curve", + "rfc6979 0.4.0 (git+https://github.com/sp1-patches/signatures?tag=sp1-skip-verify-on-recovery)", + "signature", + "spki", +] + [[package]] name = "educe" version = "0.6.0" @@ -1777,6 +2298,12 @@ dependencies = [ "serde", ] +[[package]] +name = "elf" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4445909572dbd556c457c849c4ca58623d84b27c8fff1e74b0b4227d8b90d17b" + [[package]] name = "elliptic-curve" version = "0.13.8" @@ -1786,9 +2313,11 @@ dependencies = [ "base16ct", "crypto-bigint", "digest 0.10.7", - "ff", - "generic-array", - "group", + "ff 0.13.1", + "generic-array 0.14.7", + "group 0.13.0", + "hkdf", + "pem-rfc7468", "pkcs8", "rand_core 0.6.4", "sec1", @@ -1797,13 +2326,31 @@ dependencies = [ "zeroize", ] +[[package]] +name = "embedded-alloc" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f2de9133f68db0d4627ad69db767726c99ff8585272716708227008d3f1bddd" +dependencies = [ + "const-default", + "critical-section", + "linked_list_allocator", + "rlsf", +] + +[[package]] +name = "encode_unicode" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" + [[package]] name = "encoding_rs" version = "0.8.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" dependencies = [ - "cfg-if 1.0.0", + "cfg-if 1.0.4", ] [[package]] @@ -1826,6 +2373,27 @@ dependencies = [ "syn 2.0.117", ] +[[package]] +name = "enum-map" +version = "2.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6866f3bfdf8207509a033af1a75a7b08abda06bbaaeae6669323fd5a097df2e9" +dependencies = [ + "enum-map-derive", + "serde", +] + +[[package]] +name = "enum-map-derive" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f282cfdfe92516eb26c2af8589c274c7c17681f5ecc03c18255fe741c6aa64eb" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + [[package]] name = "enum-ordinalize" version = "4.3.2" @@ -1893,6 +2461,17 @@ dependencies = [ "version_check", ] +[[package]] +name = "eventsource-stream" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74fef4569247a5f429d9156b9d0a2599914385dd189c539334c625d8099d90ab" +dependencies = [ + "futures-core", + "nom", + "pin-project-lite", +] + [[package]] name = "eyre" version = "0.6.12" @@ -1931,23 +2510,52 @@ dependencies = [ "bytes", ] +[[package]] +name = "ff" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d013fc25338cc558c5c2cfbad646908fb23591e2404481826742b651c9af7160" +dependencies = [ + "bitvec", + "rand_core 0.6.4", + "subtle", +] + [[package]] name = "ff" version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" dependencies = [ + "bitvec", + "byteorder", + "ff_derive", "rand_core 0.6.4", "subtle", ] +[[package]] +name = "ff_derive" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f10d12652036b0e99197587c6ba87a8fc3031986499973c030d8b44fcc151b60" +dependencies = [ + "addchain", + "num-bigint 0.3.3", + "num-integer", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "filetime" version = "0.2.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f98844151eee8917efc50bd9e8318cb963ae8b297431495d3f758616ea5c57db" dependencies = [ - "cfg-if 1.0.0", + "cfg-if 1.0.4", "libc", "libredox", ] @@ -1970,6 +2578,12 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "fixedbitset" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d674e81391d1e1ab681a28d99df07927c6d4aa5b027d7da16ba32d1d21ecd99" + [[package]] name = "flate2" version = "1.1.9" @@ -2027,6 +2641,21 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" +[[package]] +name = "futures" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + [[package]] name = "futures-channel" version = "0.3.31" @@ -2034,6 +2663,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ "futures-core", + "futures-sink", ] [[package]] @@ -2042,6 +2672,34 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" +[[package]] +name = "futures-executor" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cecba35d7ad927e23624b22ad55235f2239cfa44fd10428eecbeba6d6a717718" + +[[package]] +name = "futures-macro" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + [[package]] name = "futures-sink" version = "0.3.31" @@ -2060,12 +2718,41 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ + "futures-channel", "futures-core", + "futures-io", + "futures-macro", + "futures-sink", "futures-task", + "memchr", "pin-project-lite", "pin-utils", + "slab", +] + +[[package]] +name = "gcd" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d758ba1b47b00caf47f24925c0074ecb20d6dfcffe7f6d53395c0465674841a" + +[[package]] +name = "gecko_profile" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "890852c7e1e02bc6758e325d6b1e0236e4fbf21b492f585ce4d4715be54b4c6a" +dependencies = [ + "debugid", + "serde", + "serde_json", ] +[[package]] +name = "gen_ops" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "304de19db7028420975a296ab0fcbbc8e69438c4ed254a1e41e2a7f37d5f0e0a" + [[package]] name = "generic-array" version = "0.14.7" @@ -2077,13 +2764,23 @@ dependencies = [ "zeroize", ] +[[package]] +name = "generic-array" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96512db27971c2c3eece70a1e106fbe6c87760234e31e8f7e5634912fe52794a" +dependencies = [ + "serde", + "typenum", +] + [[package]] name = "getrandom" version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ - "cfg-if 1.0.0", + "cfg-if 1.0.4", "js-sys", "libc", "wasi", @@ -2096,7 +2793,7 @@ version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" dependencies = [ - "cfg-if 1.0.0", + "cfg-if 1.0.4", "js-sys", "libc", "r-efi 5.3.0", @@ -2110,7 +2807,7 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0de51e6874e94e7bf76d726fc5d13ba782deca734ff60d5bb2fb2607c7406555" dependencies = [ - "cfg-if 1.0.0", + "cfg-if 1.0.4", "js-sys", "libc", "r-efi 6.0.0", @@ -2154,13 +2851,25 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "group" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dfbfb3a6cfbd390d5c9564ab283a0349b9b9fcd46a706c1eb10e0db70bfbac7" +dependencies = [ + "ff 0.12.1", + "memuse", + "rand_core 0.6.4", + "subtle", +] + [[package]] name = "group" version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ - "ff", + "ff 0.13.1", "rand_core 0.6.4", "subtle", ] @@ -2190,10 +2899,33 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" dependencies = [ - "cfg-if 1.0.0", + "cfg-if 1.0.4", "crunchy", ] +[[package]] +name = "halo2" +version = "0.1.0-beta.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a23c779b38253fe1538102da44ad5bd5378495a61d2c4ee18d64eaa61ae5995" +dependencies = [ + "halo2_proofs", +] + +[[package]] +name = "halo2_proofs" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e925780549adee8364c7f2b685c753f6f3df23bde520c67416e93bf615933760" +dependencies = [ + "blake2b_simd", + "ff 0.12.1", + "group 0.12.1", + "pasta_curves 0.4.1", + "rand_core 0.6.4", + "rayon", +] + [[package]] name = "hashbrown" version = "0.12.3" @@ -2205,6 +2937,11 @@ name = "hashbrown" version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash", + "allocator-api2", + "serde", +] [[package]] name = "hashbrown" @@ -2212,6 +2949,8 @@ version = "0.15.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" dependencies = [ + "allocator-api2", + "equivalent", "foldhash 0.1.5", ] @@ -2234,7 +2973,7 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b3314d5adb5d94bcdf56771f2e50dbbc80bb4bdf88967526706205ac9eff24eb" dependencies = [ - "base64", + "base64 0.22.1", "bytes", "headers-core", "http", @@ -2303,6 +3042,15 @@ dependencies = [ "arrayvec", ] +[[package]] +name = "hkdf" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +dependencies = [ + "hmac", +] + [[package]] name = "hmac" version = "0.12.1" @@ -2411,6 +3159,20 @@ dependencies = [ "tokio", "tokio-rustls", "tower-service", + "webpki-roots", +] + +[[package]] +name = "hyper-timeout" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b90d566bffbce6a75bd8b09a05aa8c2cb1fabb6cb348f8840c9e4c90a0d83b0" +dependencies = [ + "hyper", + "hyper-util", + "pin-project-lite", + "tokio", + "tower-service", ] [[package]] @@ -2419,7 +3181,7 @@ version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "727805d60e7938b76b826a6ef209eb70eaa1812794f9424d4a4e2d740662df5f" dependencies = [ - "base64", + "base64 0.22.1", "bytes", "futures-channel", "futures-core", @@ -2431,7 +3193,7 @@ dependencies = [ "libc", "percent-encoding", "pin-project-lite", - "socket2", + "socket2 0.6.1", "system-configuration", "tokio", "tower-service", @@ -2625,6 +3387,19 @@ dependencies = [ "serde_core", ] +[[package]] +name = "indicatif" +version = "0.17.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "183b3088984b400f4cfac3620d5e076c84da5364016b4f49473de574b2586235" +dependencies = [ + "console", + "number_prefix", + "portable-atomic", + "unicode-width 0.2.2", + "web-time", +] + [[package]] name = "inkwell" version = "0.8.0" @@ -2691,6 +3466,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +dependencies = [ + "either", +] + [[package]] name = "itertools" version = "0.13.0" @@ -2747,7 +3531,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" dependencies = [ "cesu8", - "cfg-if 1.0.0", + "cfg-if 1.0.4", "combine", "jni-sys", "log", @@ -2788,7 +3572,7 @@ version = "9.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a87cc7a48537badeae96744432de36f4be2b4a34a05a5ef32e9dd8a1c169dde" dependencies = [ - "base64", + "base64 0.22.1", "js-sys", "pem", "ring", @@ -2797,18 +3581,48 @@ dependencies = [ "simple_asn1", ] +[[package]] +name = "jubjub" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a575df5f985fe1cd5b2b05664ff6accfc46559032b954529fd225a2168d27b0f" +dependencies = [ + "bitvec", + "bls12_381", + "ff 0.12.1", + "group 0.12.1", + "rand_core 0.6.4", + "subtle", +] + [[package]] name = "k256" version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f6e3919bbaa2945715f0bb6d3934a173d1e9a59ac23767fbaaef277265a7411b" dependencies = [ - "cfg-if 1.0.0", - "ecdsa", + "cfg-if 1.0.4", + "ecdsa 0.16.9 (registry+https://github.com/rust-lang/crates.io-index)", "elliptic-curve", "once_cell", "serdect", "sha2 0.10.9", + "signature", +] + +[[package]] +name = "k256" +version = "0.13.4" +source = "git+https://github.com/sp1-patches/elliptic-curves?tag=patch-k256-13.4-sp1-6.0.0#0efe186cee5930a0d23501651c226bd81fcc2c15" +dependencies = [ + "cfg-if 1.0.4", + "ecdsa 0.16.9 (git+https://github.com/sp1-patches/signatures?tag=sp1-skip-verify-on-recovery)", + "elliptic-curve", + "hex", + "once_cell", + "sha2 0.10.9", + "signature", + "sp1-lib 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2835,6 +3649,9 @@ name = "lazy_static" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +dependencies = [ + "spin 0.9.8", +] [[package]] name = "leb128" @@ -2860,7 +3677,7 @@ version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d7c4b02199fee7c5d21a5ae7d8cfa79a6ef5bb2fc834d6e9058e89c825efdc55" dependencies = [ - "cfg-if 1.0.0", + "cfg-if 1.0.4", "windows-link", ] @@ -2888,6 +3705,12 @@ version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c6639b70a7ce854b79c70d7e83f16b5dc0137cc914f3d7d03803b513ecc67ac" +[[package]] +name = "linked_list_allocator" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9afa463f5405ee81cdb9cc2baf37e08ec7e4c8209442b5d72c04cfb2cd6e6286" + [[package]] name = "linux-raw-sys" version = "0.11.0" @@ -2911,7 +3734,7 @@ dependencies = [ "lazy_static", "libc", "regex-lite", - "semver 1.0.23", + "semver 1.0.27", ] [[package]] @@ -2930,6 +3753,15 @@ version = "0.4.29" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" +[[package]] +name = "lru" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" +dependencies = [ + "hashbrown 0.15.5", +] + [[package]] name = "lru" version = "0.16.3" @@ -2980,18 +3812,43 @@ dependencies = [ "regex-automata", ] +[[package]] +name = "matchit" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" + [[package]] name = "matchit" version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "47e1ffaa40ddd1f3ed91f717a33c8c0ee23fff369e3aa8772b9605cc1d22f4c3" +[[package]] +name = "md-5" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" +dependencies = [ + "cfg-if 1.0.4", + "digest 0.10.7", +] + [[package]] name = "memchr" version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +[[package]] +name = "memfd" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad38eb12aea514a0466ea40a80fd8cc83637065948eb4a426e4aa46261175227" +dependencies = [ + "rustix", +] + [[package]] name = "memmap2" version = "0.6.2" @@ -3025,6 +3882,12 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" +[[package]] +name = "memuse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d97bbf43eb4f088f8ca469930cde17fa036207c9a5e02ccc5107c4e8b17c964" + [[package]] name = "mime" version = "0.3.17" @@ -3073,6 +3936,22 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fafa6961cabd9c63bcd77a45d7e3b7f3b552b70417831fb0f56db717e72407e" +[[package]] +name = "mti" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9563a7d5556636e74bbd8773241fbcbc5c89b9f6bfdc97b29b56e740c2c74b9" +dependencies = [ + "typeid_prefix", + "typeid_suffix", +] + +[[package]] +name = "multimap" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d87ecb2933e8aeadb3e3a02b828fed80a7528047e68b4f424523a0981a3a084" + [[package]] name = "munge" version = "0.4.7" @@ -3103,6 +3982,15 @@ dependencies = [ "minimal-lexical", ] +[[package]] +name = "ntapi" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3b335231dfd352ffb0f8017f3b6027a4917f7df785ea2143d8af2adc66980ae" +dependencies = [ + "winapi", +] + [[package]] name = "nu-ansi-term" version = "0.50.3" @@ -3118,7 +4006,7 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" dependencies = [ - "num-bigint", + "num-bigint 0.4.6", "num-complex", "num-integer", "num-iter", @@ -3126,6 +4014,17 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-bigint" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f6f7833f2cbf2360a6cfd58cd41a53aa7a90bd4c202f5b1c7dd2ed73c57b2c3" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + [[package]] name = "num-bigint" version = "0.4.6" @@ -3182,13 +4081,28 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-modular" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17bb261bf36fa7d83f4c294f834e91256769097b3cb505d44831e0a179ac647f" + +[[package]] +name = "num-order" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "537b596b97c40fcf8056d153049eb22f481c17ebce72a513ec9286e4986d1bb6" +dependencies = [ + "num-modular", +] + [[package]] name = "num-rational" version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" dependencies = [ - "num-bigint", + "num-bigint 0.4.6", "num-integer", "num-traits", ] @@ -3213,13 +4127,34 @@ dependencies = [ "libc", ] +[[package]] +name = "num_enum" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f646caf906c20226733ed5b1374287eb97e3c2a5c227ce668c1f2ce20ae57c9" +dependencies = [ + "num_enum_derive 0.5.11", +] + [[package]] name = "num_enum" version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4e613fc340b2220f734a8595782c551f1250e969d87d3be1ae0579e8d4065179" dependencies = [ - "num_enum_derive", + "num_enum_derive 0.7.3", +] + +[[package]] +name = "num_enum_derive" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799" +dependencies = [ + "proc-macro-crate 1.3.1", + "proc-macro2", + "quote", + "syn 1.0.109", ] [[package]] @@ -3228,12 +4163,18 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 3.3.0", "proc-macro2", "quote", "syn 2.0.117", ] +[[package]] +name = "number_prefix" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" + [[package]] name = "nybbles" version = "0.4.8" @@ -3241,7 +4182,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d49ff0c0d00d4a502b39df9af3a525e1efeb14b9dabb5bb83335284c1309210" dependencies = [ "alloy-rlp", - "cfg-if 1.0.0", + "cfg-if 1.0.4", "proptest", "ruint", "serde", @@ -3257,6 +4198,20 @@ dependencies = [ "memchr", ] +[[package]] +name = "object" +version = "0.37.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff76201f031d8863c38aa7f905eca4f53abbfa15f609db4277d44cd8938f33fe" +dependencies = [ + "crc32fast", + "flate2", + "hashbrown 0.15.5", + "indexmap 2.13.0", + "memchr", + "ruzstd", +] + [[package]] name = "object" version = "0.38.1" @@ -3290,1399 +4245,3475 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe" [[package]] -name = "parity-scale-codec" -version = "3.6.12" +name = "opentelemetry" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "306800abfa29c7f16596b5970a588435e3d5b3149683d00c12b699cc19f895ee" +checksum = "1b69a91d4893e713e06f724597ad630f1fa76057a5e1026c0ca67054a9032a76" dependencies = [ - "arrayvec", - "bitvec", - "byte-slice-cast", - "impl-trait-for-tuples", - "parity-scale-codec-derive", - "serde", + "futures-core", + "futures-sink", + "js-sys", + "once_cell", + "pin-project-lite", + "thiserror 1.0.63", ] [[package]] -name = "parity-scale-codec-derive" -version = "3.6.12" +name = "option-ext" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d830939c76d294956402033aee57a6da7b438f2294eb94864c37b0569053a42c" -dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn 1.0.109", -] +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" [[package]] -name = "parking_lot" -version = "0.12.3" +name = "p256" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" dependencies = [ - "lock_api", - "parking_lot_core", + "ecdsa 0.16.9 (registry+https://github.com/rust-lang/crates.io-index)", + "elliptic-curve", + "primeorder", + "sha2 0.10.9", ] [[package]] -name = "parking_lot_core" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +name = "p3-air" +version = "0.1.0" +source = "git+https://github.com/Plonky3/Plonky3/?branch=sp1-v6#ce9cdfa52326beb93d77669cee52e23287fdb16d" dependencies = [ - "cfg-if 1.0.0", - "libc", - "redox_syscall 0.5.3", - "smallvec", - "windows-targets 0.52.6", + "p3-field 0.1.0", + "p3-matrix 0.1.0", + "serde", ] [[package]] -name = "paste" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +name = "p3-baby-bear" +version = "0.1.0" +source = "git+https://github.com/Plonky3/Plonky3/?branch=sp1-v6#ce9cdfa52326beb93d77669cee52e23287fdb16d" +dependencies = [ + "num-bigint 0.4.6", + "p3-field 0.1.0", + "p3-mds 0.1.0", + "p3-poseidon2 0.1.0", + "p3-symmetric 0.1.0", + "rand 0.8.5", + "serde", +] [[package]] -name = "pem" -version = "3.0.6" +name = "p3-baby-bear" +version = "0.2.3-succinct" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d30c53c26bc5b31a98cd02d20f25a7c8567146caf63ed593a9d87b2775291be" +checksum = "7521838ecab2ddf4f7bc4ceebad06ec02414729598485c1ada516c39900820e8" dependencies = [ - "base64", - "serde_core", + "num-bigint 0.4.6", + "p3-field 0.2.3-succinct", + "p3-mds 0.2.3-succinct", + "p3-poseidon2 0.2.3-succinct", + "p3-symmetric 0.2.3-succinct", + "rand 0.8.5", + "serde", ] [[package]] -name = "percent-encoding" -version = "2.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" +name = "p3-bn254-fr" +version = "0.1.0" +source = "git+https://github.com/Plonky3/Plonky3/?branch=sp1-v6#ce9cdfa52326beb93d77669cee52e23287fdb16d" +dependencies = [ + "ff 0.13.1", + "num-bigint 0.4.6", + "p3-field 0.1.0", + "p3-poseidon2 0.1.0", + "p3-symmetric 0.1.0", + "rand 0.8.5", + "serde", +] [[package]] -name = "pest" -version = "2.8.6" +name = "p3-bn254-fr" +version = "0.3.1-succinct" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0848c601009d37dfa3430c4666e147e49cdcf1b92ecd3e63657d8a5f19da662" +checksum = "ebf15b2e55afdfc5ef84bb0a2508a96a924f3d86b8b616053ee727293a02121d" dependencies = [ - "memchr", - "ucd-trie", + "ff 0.13.1", + "num-bigint 0.4.6", + "p3-field 0.3.1-succinct", + "p3-poseidon2 0.3.1-succinct", + "p3-symmetric 0.3.1-succinct", + "rand 0.8.5", + "serde", ] [[package]] -name = "phf" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1562dc717473dbaa4c1f85a36410e03c047b2e7df7f45ee938fbef64ae7fadf" +name = "p3-challenger" +version = "0.1.0" +source = "git+https://github.com/Plonky3/Plonky3/?branch=sp1-v6#ce9cdfa52326beb93d77669cee52e23287fdb16d" dependencies = [ - "phf_macros", - "phf_shared", + "p3-field 0.1.0", + "p3-maybe-rayon 0.1.0", + "p3-symmetric 0.1.0", + "p3-util 0.1.0", "serde", + "tracing", ] [[package]] -name = "phf_generator" -version = "0.13.1" +name = "p3-challenger" +version = "0.3.1-succinct" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "135ace3a761e564ec88c03a77317a7c6b80bb7f7135ef2544dbe054243b89737" +checksum = "16b647fe6cb51bb873d09aab77cecf3afe38bd94284fc14d04d57d52f0d26666" dependencies = [ - "fastrand", - "phf_shared", + "p3-field 0.3.1-succinct", + "p3-maybe-rayon 0.3.1-succinct", + "p3-symmetric 0.3.1-succinct", + "p3-util 0.3.1-succinct", + "serde", + "tracing", ] [[package]] -name = "phf_macros" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "812f032b54b1e759ccd5f8b6677695d5268c588701effba24601f6932f8269ef" +name = "p3-commit" +version = "0.1.0" +source = "git+https://github.com/Plonky3/Plonky3/?branch=sp1-v6#ce9cdfa52326beb93d77669cee52e23287fdb16d" dependencies = [ - "phf_generator", - "phf_shared", - "proc-macro2", - "quote", - "syn 2.0.117", + "itertools 0.12.1", + "p3-challenger 0.1.0", + "p3-field 0.1.0", + "p3-matrix 0.1.0", + "p3-util 0.1.0", + "serde", ] [[package]] -name = "phf_shared" -version = "0.13.1" +name = "p3-dft" +version = "0.1.0" +source = "git+https://github.com/Plonky3/Plonky3/?branch=sp1-v6#ce9cdfa52326beb93d77669cee52e23287fdb16d" +dependencies = [ + "p3-field 0.1.0", + "p3-matrix 0.1.0", + "p3-maybe-rayon 0.1.0", + "p3-util 0.1.0", + "tracing", +] + +[[package]] +name = "p3-dft" +version = "0.2.3-succinct" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e57fef6bc5981e38c2ce2d63bfa546861309f875b8a75f092d1d54ae2d64f266" +checksum = "46414daedd796f1eefcdc1811c0484e4bced5729486b6eaba9521c572c76761a" dependencies = [ - "siphasher 1.0.2", + "p3-field 0.2.3-succinct", + "p3-matrix 0.2.3-succinct", + "p3-maybe-rayon 0.2.3-succinct", + "p3-util 0.2.3-succinct", + "tracing", ] [[package]] -name = "pin-project-lite" -version = "0.2.14" +name = "p3-dft" +version = "0.3.1-succinct" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" +checksum = "8169aac0ed2575c6c44953a7fa162e3dd07f9a22021e36b4db9d8bd15a3373b8" +dependencies = [ + "p3-field 0.3.1-succinct", + "p3-matrix 0.3.1-succinct", + "p3-maybe-rayon 0.3.1-succinct", + "p3-util 0.3.1-succinct", + "tracing", +] [[package]] -name = "pin-utils" +name = "p3-field" version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +source = "git+https://github.com/Plonky3/Plonky3/?branch=sp1-v6#ce9cdfa52326beb93d77669cee52e23287fdb16d" +dependencies = [ + "itertools 0.12.1", + "num-bigint 0.4.6", + "num-traits", + "p3-util 0.1.0", + "rand 0.8.5", + "serde", +] [[package]] -name = "pkcs8" -version = "0.10.2" +name = "p3-field" +version = "0.2.3-succinct" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +checksum = "48948a0516b349e9d1cdb95e7236a6ee010c44e68c5cc78b4b92bf1c4022a0d9" dependencies = [ - "der", - "spki", + "itertools 0.12.1", + "num-bigint 0.4.6", + "num-traits", + "p3-util 0.2.3-succinct", + "rand 0.8.5", + "serde", ] [[package]] -name = "pkg-config" -version = "0.3.30" +name = "p3-field" +version = "0.3.1-succinct" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +checksum = "3f82ed2dfd1e7d6e8759a9605c71b8a2a543069017dfdb6dafe71e7a2ccca937" +dependencies = [ + "itertools 0.12.1", + "num-bigint 0.4.6", + "num-traits", + "p3-util 0.3.1-succinct", + "rand 0.8.5", + "serde", +] [[package]] -name = "plain" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" +name = "p3-fri" +version = "0.1.0" +source = "git+https://github.com/Plonky3/Plonky3/?branch=sp1-v6#ce9cdfa52326beb93d77669cee52e23287fdb16d" +dependencies = [ + "itertools 0.12.1", + "p3-challenger 0.1.0", + "p3-commit", + "p3-dft 0.1.0", + "p3-field 0.1.0", + "p3-interpolation", + "p3-matrix 0.1.0", + "p3-maybe-rayon 0.1.0", + "p3-util 0.1.0", + "serde", + "tracing", +] [[package]] -name = "plotters" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a15b6eccb8484002195a3e44fe65a4ce8e93a625797a063735536fd59cb01cf3" +name = "p3-interpolation" +version = "0.1.0" +source = "git+https://github.com/Plonky3/Plonky3/?branch=sp1-v6#ce9cdfa52326beb93d77669cee52e23287fdb16d" dependencies = [ - "num-traits", - "plotters-backend", - "plotters-svg", - "wasm-bindgen", - "web-sys", + "p3-field 0.1.0", + "p3-matrix 0.1.0", + "p3-util 0.1.0", ] [[package]] -name = "plotters-backend" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "414cec62c6634ae900ea1c56128dfe87cf63e7caece0852ec76aba307cebadb7" +name = "p3-keccak-air" +version = "0.1.0" +source = "git+https://github.com/Plonky3/Plonky3/?branch=sp1-v6#ce9cdfa52326beb93d77669cee52e23287fdb16d" +dependencies = [ + "p3-air", + "p3-field 0.1.0", + "p3-matrix 0.1.0", + "p3-maybe-rayon 0.1.0", + "p3-util 0.1.0", + "tracing", +] [[package]] -name = "plotters-svg" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81b30686a7d9c3e010b84284bdd26a29f2138574f52f5eb6f794fc0ad924e705" +name = "p3-koala-bear" +version = "0.1.0" +source = "git+https://github.com/Plonky3/Plonky3/?branch=sp1-v6#ce9cdfa52326beb93d77669cee52e23287fdb16d" dependencies = [ - "plotters-backend", + "num-bigint 0.4.6", + "p3-field 0.1.0", + "p3-mds 0.1.0", + "p3-poseidon2 0.1.0", + "p3-symmetric 0.1.0", + "rand 0.8.5", + "serde", ] [[package]] -name = "potential_utf" -version = "0.1.4" +name = "p3-koala-bear" +version = "0.3.1-succinct" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b73949432f5e2a09657003c25bca5e19a0e9c84f8058ca374f49e0ebe605af77" +checksum = "60e2d5bc3601f6115afd9a55a718bdab49e98d44710438008204d2084d5d70d0" dependencies = [ - "zerovec", + "num-bigint 0.4.6", + "p3-field 0.3.1-succinct", + "p3-mds 0.3.1-succinct", + "p3-poseidon2 0.3.1-succinct", + "p3-symmetric 0.3.1-succinct", + "rand 0.8.5", + "serde", ] [[package]] -name = "powerfmt" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" +name = "p3-matrix" +version = "0.1.0" +source = "git+https://github.com/Plonky3/Plonky3/?branch=sp1-v6#ce9cdfa52326beb93d77669cee52e23287fdb16d" +dependencies = [ + "itertools 0.12.1", + "p3-field 0.1.0", + "p3-maybe-rayon 0.1.0", + "p3-util 0.1.0", + "rand 0.8.5", + "serde", + "tracing", +] [[package]] -name = "ppv-lite86" -version = "0.2.21" +name = "p3-matrix" +version = "0.2.3-succinct" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +checksum = "3e4de3f373589477cb735ea58e125898ed20935e03664b4614c7fac258b3c42f" dependencies = [ - "zerocopy", + "itertools 0.12.1", + "p3-field 0.2.3-succinct", + "p3-maybe-rayon 0.2.3-succinct", + "p3-util 0.2.3-succinct", + "rand 0.8.5", + "serde", + "tracing", ] [[package]] -name = "prettyplease" -version = "0.2.37" +name = "p3-matrix" +version = "0.3.1-succinct" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" +checksum = "2ef05490e47c906f102e08493986b1d3c6b6e2c6be9937eaab2c970ccf5385e8" dependencies = [ - "proc-macro2", - "syn 2.0.117", + "itertools 0.12.1", + "p3-field 0.3.1-succinct", + "p3-maybe-rayon 0.3.1-succinct", + "p3-util 0.3.1-succinct", + "rand 0.8.5", + "serde", + "tracing", ] [[package]] -name = "primitive-types" -version = "0.12.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" +name = "p3-maybe-rayon" +version = "0.1.0" +source = "git+https://github.com/Plonky3/Plonky3/?branch=sp1-v6#ce9cdfa52326beb93d77669cee52e23287fdb16d" dependencies = [ - "fixed-hash", - "impl-codec", - "uint", + "rayon", ] [[package]] -name = "proc-macro-crate" -version = "3.3.0" +name = "p3-maybe-rayon" +version = "0.2.3-succinct" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edce586971a4dfaa28950c6f18ed55e0406c1ab88bbce2c6f6293a7aaba73d35" -dependencies = [ - "toml_edit", +checksum = "c3968ad1160310296eb04f91a5f4edfa38fe1d6b2b8cd6b5c64e6f9b7370979e" + +[[package]] +name = "p3-maybe-rayon" +version = "0.3.1-succinct" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3d38c20290b92011f12a3fc040a999197e71e1663614998393a24aee4d430da" + +[[package]] +name = "p3-mds" +version = "0.1.0" +source = "git+https://github.com/Plonky3/Plonky3/?branch=sp1-v6#ce9cdfa52326beb93d77669cee52e23287fdb16d" +dependencies = [ + "itertools 0.12.1", + "p3-dft 0.1.0", + "p3-field 0.1.0", + "p3-matrix 0.1.0", + "p3-symmetric 0.1.0", + "p3-util 0.1.0", + "rand 0.8.5", ] [[package]] -name = "proc-macro-error" -version = "1.0.4" +name = "p3-mds" +version = "0.2.3-succinct" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +checksum = "2356b1ed0add6d5dfbf7a338ce534a6fde827374394a52cec16a0840af6e97c9" dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn 1.0.109", - "version_check", + "itertools 0.12.1", + "p3-dft 0.2.3-succinct", + "p3-field 0.2.3-succinct", + "p3-matrix 0.2.3-succinct", + "p3-symmetric 0.2.3-succinct", + "p3-util 0.2.3-succinct", + "rand 0.8.5", ] [[package]] -name = "proc-macro-error-attr" -version = "1.0.4" +name = "p3-mds" +version = "0.3.1-succinct" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +checksum = "b707ec6432a15661ce67e5fc3abb1c2653e0064030d99c8cece4a049b31ebb1a" dependencies = [ - "proc-macro2", - "quote", - "version_check", + "itertools 0.12.1", + "p3-dft 0.3.1-succinct", + "p3-field 0.3.1-succinct", + "p3-matrix 0.3.1-succinct", + "p3-symmetric 0.3.1-succinct", + "p3-util 0.3.1-succinct", + "rand 0.8.5", ] [[package]] -name = "proc-macro-error-attr2" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" +name = "p3-merkle-tree" +version = "0.1.0" +source = "git+https://github.com/Plonky3/Plonky3/?branch=sp1-v6#ce9cdfa52326beb93d77669cee52e23287fdb16d" +dependencies = [ + "itertools 0.12.1", + "p3-commit", + "p3-field 0.1.0", + "p3-matrix 0.1.0", + "p3-maybe-rayon 0.1.0", + "p3-symmetric 0.1.0", + "p3-util 0.1.0", + "serde", + "tracing", +] + +[[package]] +name = "p3-poseidon2" +version = "0.1.0" +source = "git+https://github.com/Plonky3/Plonky3/?branch=sp1-v6#ce9cdfa52326beb93d77669cee52e23287fdb16d" dependencies = [ - "proc-macro2", - "quote", + "gcd", + "p3-field 0.1.0", + "p3-mds 0.1.0", + "p3-symmetric 0.1.0", + "rand 0.8.5", + "serde", ] [[package]] -name = "proc-macro-error2" -version = "2.0.1" +name = "p3-poseidon2" +version = "0.2.3-succinct" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" +checksum = "7da1eec7e1b6900581bedd95e76e1ef4975608dd55be9872c9d257a8a9651c3a" dependencies = [ - "proc-macro-error-attr2", - "proc-macro2", - "quote", - "syn 2.0.117", + "gcd", + "p3-field 0.2.3-succinct", + "p3-mds 0.2.3-succinct", + "p3-symmetric 0.2.3-succinct", + "rand 0.8.5", + "serde", ] [[package]] -name = "proc-macro2" -version = "1.0.106" +name = "p3-poseidon2" +version = "0.3.1-succinct" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" +checksum = "f9c6dbf170a3fb4d7556023315a525e08c4b94b572bc307eadbf9065bddaf489" dependencies = [ - "unicode-ident", + "gcd", + "p3-field 0.3.1-succinct", + "p3-mds 0.3.1-succinct", + "p3-symmetric 0.3.1-succinct", + "rand 0.8.5", + "serde", ] [[package]] -name = "program-exec" +name = "p3-symmetric" version = "0.1.0" +source = "git+https://github.com/Plonky3/Plonky3/?branch=sp1-v6#ce9cdfa52326beb93d77669cee52e23287fdb16d" +dependencies = [ + "itertools 0.12.1", + "p3-field 0.1.0", + "serde", +] [[package]] -name = "proptest" -version = "1.10.0" +name = "p3-symmetric" +version = "0.2.3-succinct" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37566cb3fdacef14c0737f9546df7cfeadbfbc9fef10991038bf5015d0c80532" +checksum = "edb439bea1d822623b41ff4b51e3309e80d13cadf8b86d16ffd5e6efb9fdc360" dependencies = [ - "bit-set", - "bit-vec", - "bitflags 2.11.0", - "num-traits", - "rand 0.9.2", - "rand_chacha 0.9.0", - "rand_xorshift", - "regex-syntax", - "rusty-fork", - "tempfile", - "unarray", + "itertools 0.12.1", + "p3-field 0.2.3-succinct", + "serde", ] [[package]] -name = "prover" -version = "0.1.0" +name = "p3-symmetric" +version = "0.3.1-succinct" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7ec3a99c3dc3d55d0e78ef7041e0d90bdfbf03451e4f0bae3f9877af99cabb3" dependencies = [ - "arbutil", - "bincode", - "bitvec", - "brotli", - "c-kzg", - "criterion", - "derivative", - "digest 0.10.7", - "enum-iterator", - "eyre", - "fnv", - "forward", - "hex", - "lazy_static", - "libc", - "nom", - "num", - "num-derive", - "num-traits", - "parking_lot", - "rand 0.8.5", - "rayon", - "rustc-demangle", + "itertools 0.12.1", + "p3-field 0.3.1-succinct", "serde", - "serde_json", - "serde_with", - "sha2 0.10.9", - "sha3", - "smallvec", - "structopt", - "validation", - "wasmer", - "wasmer-compiler-singlepass", - "wasmer-types", - "wasmparser 0.245.1", - "wat", ] [[package]] -name = "prover-ffi" +name = "p3-uni-stark" +version = "0.1.0" +source = "git+https://github.com/Plonky3/Plonky3/?branch=sp1-v6#ce9cdfa52326beb93d77669cee52e23287fdb16d" +dependencies = [ + "itertools 0.12.1", + "p3-air", + "p3-challenger 0.1.0", + "p3-commit", + "p3-dft 0.1.0", + "p3-field 0.1.0", + "p3-matrix 0.1.0", + "p3-maybe-rayon 0.1.0", + "p3-util 0.1.0", + "serde", + "tracing", +] + +[[package]] +name = "p3-util" version = "0.1.0" +source = "git+https://github.com/Plonky3/Plonky3/?branch=sp1-v6#ce9cdfa52326beb93d77669cee52e23287fdb16d" dependencies = [ - "arbutil", - "eyre", - "lazy_static", - "libc", - "lru", - "once_cell", - "prover", - "static_assertions", + "serde", ] [[package]] -name = "ptr_meta" -version = "0.3.1" +name = "p3-util" +version = "0.2.3-succinct" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b9a0cf95a1196af61d4f1cbdab967179516d9a4a4312af1f31948f8f6224a79" +checksum = "b6c2c2010678b9332b563eaa38364915b585c1a94b5ca61e2c7541c087ddda5c" dependencies = [ - "ptr_meta_derive", + "serde", ] [[package]] -name = "ptr_meta_derive" -version = "0.3.1" +name = "p3-util" +version = "0.3.1-succinct" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7347867d0a7e1208d93b46767be83e2b8f978c3dad35f775ac8d8847551d6fe1" +checksum = "712473f2a848b672eee90c3b9cd4bfcd3da042112c53a0dc6b088fc3964538ab" dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", + "serde", ] [[package]] -name = "quick-error" -version = "1.2.3" +name = "pairing" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" +checksum = "135590d8bdba2b31346f9cd1fb2a912329f5135e832a4f422942eb6ead8b6b3b" +dependencies = [ + "group 0.12.1", +] [[package]] -name = "quinn" -version = "0.11.9" +name = "parity-scale-codec" +version = "3.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e20a958963c291dc322d98411f541009df2ced7b5a4f2bd52337638cfccf20" +checksum = "306800abfa29c7f16596b5970a588435e3d5b3149683d00c12b699cc19f895ee" dependencies = [ - "bytes", - "cfg_aliases", - "pin-project-lite", - "quinn-proto", - "quinn-udp", - "rustc-hash", - "rustls", - "socket2", - "thiserror 2.0.18", - "tokio", - "tracing", - "web-time", + "arrayvec", + "bitvec", + "byte-slice-cast", + "impl-trait-for-tuples", + "parity-scale-codec-derive", + "serde", ] [[package]] -name = "quinn-proto" -version = "0.11.14" +name = "parity-scale-codec-derive" +version = "3.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "434b42fec591c96ef50e21e886936e66d3cc3f737104fdb9b737c40ffb94c098" +checksum = "d830939c76d294956402033aee57a6da7b438f2294eb94864c37b0569053a42c" dependencies = [ - "aws-lc-rs", - "bytes", - "getrandom 0.3.4", - "lru-slab", - "rand 0.9.2", - "ring", - "rustc-hash", - "rustls", - "rustls-pki-types", - "slab", - "thiserror 2.0.18", - "tinyvec", - "tracing", - "web-time", + "proc-macro-crate 3.3.0", + "proc-macro2", + "quote", + "syn 1.0.109", ] [[package]] -name = "quinn-udp" -version = "0.5.14" +name = "parking_lot" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "addec6a0dcad8a8d96a771f815f0eaf55f9d1805756410b39f5fa81332574cbd" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ - "cfg_aliases", - "libc", - "once_cell", - "socket2", - "tracing", - "windows-sys 0.60.2", + "lock_api", + "parking_lot_core", ] [[package]] -name = "quote" -version = "1.0.45" +name = "parking_lot_core" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ - "proc-macro2", + "cfg-if 1.0.4", + "libc", + "redox_syscall 0.5.3", + "smallvec", + "windows-targets 0.52.6", ] [[package]] -name = "r-efi" -version = "5.3.0" +name = "pasta_curves" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" +checksum = "5cc65faf8e7313b4b1fbaa9f7ca917a0eed499a9663be71477f87993604341d8" +dependencies = [ + "blake2b_simd", + "ff 0.12.1", + "group 0.12.1", + "lazy_static", + "rand 0.8.5", + "static_assertions", + "subtle", +] [[package]] -name = "r-efi" -version = "6.0.0" +name = "pasta_curves" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" +checksum = "d3e57598f73cc7e1b2ac63c79c517b31a0877cd7c402cdcaa311b5208de7a095" +dependencies = [ + "blake2b_simd", + "ff 0.13.1", + "group 0.13.0", + "lazy_static", + "rand 0.8.5", + "static_assertions", + "subtle", +] [[package]] -name = "radium" -version = "0.7.0" +name = "paste" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] -name = "rancor" -version = "0.1.1" +name = "pem" +version = "3.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a063ea72381527c2a0561da9c80000ef822bdd7c3241b1cc1b12100e3df081ee" +checksum = "1d30c53c26bc5b31a98cd02d20f25a7c8567146caf63ed593a9d87b2775291be" dependencies = [ - "ptr_meta", + "base64 0.22.1", + "serde_core", ] [[package]] -name = "rand" -version = "0.8.5" +name = "pem-rfc7468" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" dependencies = [ - "libc", - "rand_chacha 0.3.1", - "rand_core 0.6.4", - "serde", + "base64ct", ] [[package]] -name = "rand" -version = "0.9.2" +name = "percent-encoding" +version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1" -dependencies = [ - "rand_chacha 0.9.0", - "rand_core 0.9.5", - "serde", -] +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" [[package]] -name = "rand_chacha" -version = "0.3.1" +name = "pest" +version = "2.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +checksum = "e0848c601009d37dfa3430c4666e147e49cdcf1b92ecd3e63657d8a5f19da662" dependencies = [ - "ppv-lite86", - "rand_core 0.6.4", + "memchr", + "ucd-trie", ] [[package]] -name = "rand_chacha" -version = "0.9.0" +name = "petgraph" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" +checksum = "3672b37090dbd86368a4145bc067582552b29c27377cad4e0a306c97f9bd7772" dependencies = [ - "ppv-lite86", - "rand_core 0.9.5", + "fixedbitset", + "indexmap 2.13.0", ] [[package]] -name = "rand_core" -version = "0.6.4" +name = "phf" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +checksum = "c1562dc717473dbaa4c1f85a36410e03c047b2e7df7f45ee938fbef64ae7fadf" dependencies = [ - "getrandom 0.2.15", + "phf_macros", + "phf_shared", + "serde", ] [[package]] -name = "rand_core" -version = "0.9.5" +name = "phf_generator" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c" +checksum = "135ace3a761e564ec88c03a77317a7c6b80bb7f7135ef2544dbe054243b89737" dependencies = [ - "getrandom 0.3.4", - "serde", + "fastrand", + "phf_shared", ] [[package]] -name = "rand_pcg" -version = "0.3.1" +name = "phf_macros" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59cad018caf63deb318e5a4586d99a24424a364f40f1e5778c29aca23f4fc73e" +checksum = "812f032b54b1e759ccd5f8b6677695d5268c588701effba24601f6932f8269ef" dependencies = [ - "rand_core 0.6.4", + "phf_generator", + "phf_shared", + "proc-macro2", + "quote", + "syn 2.0.117", ] [[package]] -name = "rand_xorshift" -version = "0.4.0" +name = "phf_shared" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "513962919efc330f829edb2535844d1b912b0fbe2ca165d613e4e8788bb05a5a" +checksum = "e57fef6bc5981e38c2ce2d63bfa546861309f875b8a75f092d1d54ae2d64f266" dependencies = [ - "rand_core 0.9.5", + "siphasher 1.0.2", ] [[package]] -name = "rangemap" -version = "1.7.1" +name = "pin-project" +version = "1.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "973443cf09a9c8656b574a866ab68dfa19f0867d0340648c7d2f6a71b8a8ea68" +checksum = "f1749c7ed4bcaf4c3d0a3efc28538844fb29bcdd7d2b67b2be7e20ba861ff517" +dependencies = [ + "pin-project-internal", +] [[package]] -name = "rapidhash" -version = "4.4.1" +name = "pin-project-internal" +version = "1.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e48930979c155e2f33aa36ab3119b5ee81332beb6482199a8ecd6029b80b59" +checksum = "d9b20ed30f105399776b9c883e68e536ef602a16ae6f596d2c473591d6ad64c6" dependencies = [ - "rustversion", + "proc-macro2", + "quote", + "syn 2.0.117", ] [[package]] -name = "rayon" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" +name = "pin-project-lite" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der", + "spki", +] + +[[package]] +name = "pkg-config" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" + +[[package]] +name = "plain" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" + +[[package]] +name = "plotters" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a15b6eccb8484002195a3e44fe65a4ce8e93a625797a063735536fd59cb01cf3" +dependencies = [ + "num-traits", + "plotters-backend", + "plotters-svg", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "plotters-backend" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "414cec62c6634ae900ea1c56128dfe87cf63e7caece0852ec76aba307cebadb7" + +[[package]] +name = "plotters-svg" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81b30686a7d9c3e010b84284bdd26a29f2138574f52f5eb6f794fc0ad924e705" +dependencies = [ + "plotters-backend", +] + +[[package]] +name = "portable-atomic" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49" + +[[package]] +name = "potential_utf" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b73949432f5e2a09657003c25bca5e19a0e9c84f8058ca374f49e0ebe605af77" +dependencies = [ + "zerovec", +] + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "prettyplease" +version = "0.2.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" +dependencies = [ + "proc-macro2", + "syn 2.0.117", +] + +[[package]] +name = "primeorder" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", +] + +[[package]] +name = "primitive-types" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" +dependencies = [ + "fixed-hash", + "impl-codec", + "uint", +] + +[[package]] +name = "proc-macro-crate" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" +dependencies = [ + "once_cell", + "toml_edit 0.19.15", +] + +[[package]] +name = "proc-macro-crate" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edce586971a4dfaa28950c6f18ed55e0406c1ab88bbce2c6f6293a7aaba73d35" +dependencies = [ + "toml_edit 0.22.27", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "proc-macro-error2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" +dependencies = [ + "proc-macro-error-attr2", + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "proc-macro2" +version = "1.0.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "program" +version = "0.1.0" +dependencies = [ + "arbutil", + "bytes", + "caller-env", + "corosensei", + "eyre", + "hex", + "num-traits", + "once_cell", + "prover", + "rand 0.8.5", + "rand_pcg", + "ruint2", + "secp256k1", + "serde_json", + "sp1-zkvm", + "thiserror 1.0.63", + "tiny-keccak", + "validation", + "wasmer", + "wasmer-types", + "wasmer-vm", +] + +[[package]] +name = "program-exec" +version = "0.1.0" + +[[package]] +name = "proptest" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37566cb3fdacef14c0737f9546df7cfeadbfbc9fef10991038bf5015d0c80532" +dependencies = [ + "bit-set", + "bit-vec", + "bitflags 2.11.0", + "num-traits", + "rand 0.9.2", + "rand_chacha 0.9.0", + "rand_xorshift", + "regex-syntax", + "rusty-fork", + "tempfile", + "unarray", +] + +[[package]] +name = "prost" +version = "0.13.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2796faa41db3ec313a31f7624d9286acf277b52de526150b7e69f3debf891ee5" +dependencies = [ + "bytes", + "prost-derive", +] + +[[package]] +name = "prost-build" +version = "0.13.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be769465445e8c1474e9c5dac2018218498557af32d9ed057325ec9a41ae81bf" +dependencies = [ + "heck 0.5.0", + "itertools 0.14.0", + "log", + "multimap", + "once_cell", + "petgraph", + "prettyplease", + "prost", + "prost-types", + "regex", + "syn 2.0.117", + "tempfile", +] + +[[package]] +name = "prost-derive" +version = "0.13.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a56d757972c98b346a9b766e3f02746cde6dd1cd1d1d563472929fdd74bec4d" +dependencies = [ + "anyhow", + "itertools 0.14.0", + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "prost-types" +version = "0.13.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52c2c1bf36ddb1a1c396b3601a3cec27c2462e45f07c386894ec3ccf5332bd16" +dependencies = [ + "prost", +] + +[[package]] +name = "prover" +version = "0.1.0" +dependencies = [ + "arbutil", + "bincode", + "bitvec", + "brotli", + "c-kzg", + "criterion", + "derivative", + "digest 0.10.7", + "enum-iterator", + "eyre", + "fnv", + "forward", + "hex", + "lazy_static", + "libc", + "nom", + "num", + "num-derive", + "num-traits", + "parking_lot", + "rand 0.8.5", + "rayon", + "rustc-demangle", + "serde", + "serde_json", + "serde_with", + "sha2 0.10.9", + "sha3", + "smallvec", + "structopt", + "validation", + "wasmer", + "wasmer-compiler-singlepass", + "wasmer-types", + "wasmparser 0.245.1", + "wat", +] + +[[package]] +name = "prover-ffi" +version = "0.1.0" +dependencies = [ + "arbutil", + "eyre", + "lazy_static", + "libc", + "lru 0.16.3", + "once_cell", + "prover", + "static_assertions", +] + +[[package]] +name = "ptr_meta" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b9a0cf95a1196af61d4f1cbdab967179516d9a4a4312af1f31948f8f6224a79" +dependencies = [ + "ptr_meta_derive", +] + +[[package]] +name = "ptr_meta_derive" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7347867d0a7e1208d93b46767be83e2b8f978c3dad35f775ac8d8847551d6fe1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "quick-error" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" + +[[package]] +name = "quinn" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e20a958963c291dc322d98411f541009df2ced7b5a4f2bd52337638cfccf20" +dependencies = [ + "bytes", + "cfg_aliases", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash 2.1.1", + "rustls", + "socket2 0.6.1", + "thiserror 2.0.18", + "tokio", + "tracing", + "web-time", +] + +[[package]] +name = "quinn-proto" +version = "0.11.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "434b42fec591c96ef50e21e886936e66d3cc3f737104fdb9b737c40ffb94c098" +dependencies = [ + "aws-lc-rs", + "bytes", + "getrandom 0.3.4", + "lru-slab", + "rand 0.9.2", + "ring", + "rustc-hash 2.1.1", + "rustls", + "rustls-pki-types", + "slab", + "thiserror 2.0.18", + "tinyvec", + "tracing", + "web-time", +] + +[[package]] +name = "quinn-udp" +version = "0.5.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "addec6a0dcad8a8d96a771f815f0eaf55f9d1805756410b39f5fa81332574cbd" +dependencies = [ + "cfg_aliases", + "libc", + "once_cell", + "socket2 0.6.1", + "tracing", + "windows-sys 0.60.2", +] + +[[package]] +name = "quote" +version = "1.0.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + +[[package]] +name = "r-efi" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" + +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + +[[package]] +name = "rancor" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a063ea72381527c2a0561da9c80000ef822bdd7c3241b1cc1b12100e3df081ee" +dependencies = [ + "ptr_meta", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.4", + "serde", +] + +[[package]] +name = "rand" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1" +dependencies = [ + "rand_chacha 0.9.0", + "rand_core 0.9.5", + "serde", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" +dependencies = [ + "ppv-lite86", + "rand_core 0.9.5", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.15", +] + +[[package]] +name = "rand_core" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c" +dependencies = [ + "getrandom 0.3.4", + "serde", +] + +[[package]] +name = "rand_pcg" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59cad018caf63deb318e5a4586d99a24424a364f40f1e5778c29aca23f4fc73e" +dependencies = [ + "rand_core 0.6.4", +] + +[[package]] +name = "rand_xorshift" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "513962919efc330f829edb2535844d1b912b0fbe2ca165d613e4e8788bb05a5a" +dependencies = [ + "rand_core 0.9.5", +] + +[[package]] +name = "range-set-blaze" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8421b5d459262eabbe49048d362897ff3e3830b44eac6cfe341d6acb2f0f13d2" +dependencies = [ + "gen_ops", + "itertools 0.12.1", + "num-integer", + "num-traits", +] + +[[package]] +name = "rangemap" +version = "1.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "973443cf09a9c8656b574a866ab68dfa19f0867d0340648c7d2f6a71b8a8ea68" + +[[package]] +name = "rapidhash" +version = "4.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e48930979c155e2f33aa36ab3119b5ee81332beb6482199a8ecd6029b80b59" +dependencies = [ + "rustversion", +] + +[[package]] +name = "rayon" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" dependencies = [ - "either", - "rayon-core", + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "rayon-scan" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f87cc11a0140b4b0da0ffc889885760c61b13672d80a908920b2c0df078fa14" +dependencies = [ + "rayon", +] + +[[package]] +name = "redox_syscall" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" +dependencies = [ + "bitflags 2.11.0", +] + +[[package]] +name = "redox_syscall" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce70a74e890531977d37e532c34d45e9055d2409ed08ddba14529471ed0be16" +dependencies = [ + "bitflags 2.11.0", +] + +[[package]] +name = "redox_users" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" +dependencies = [ + "getrandom 0.2.15", + "libredox", + "thiserror 1.0.63", +] + +[[package]] +name = "regalloc2" +version = "0.13.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08effbc1fa53aaebff69521a5c05640523fab037b34a4a2c109506bc938246fa" +dependencies = [ + "allocator-api2", + "bumpalo", + "hashbrown 0.15.5", + "log", + "rustc-hash 2.1.1", + "smallvec", +] + +[[package]] +name = "regex" +version = "1.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-lite" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cab834c73d247e67f4fae452806d17d3c7501756d98c8808d7c9c7aa7d18f973" + +[[package]] +name = "regex-syntax" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a" + +[[package]] +name = "region" +version = "3.0.2" +source = "git+https://github.com/OffchainLabs/region-rs?tag=v3.0.2-sp1#ece52311bd1deff19b48f861ab2abe121b55007e" +dependencies = [ + "bitflags 1.3.2", + "libc", + "mach2 0.4.2", + "sp1-primitives 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp1-zkvm", + "windows-sys 0.52.0", +] + +[[package]] +name = "rend" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cadadef317c2f20755a64d7fdc48f9e7178ee6b0e1f7fce33fa60f1d68a276e6" +dependencies = [ + "bytecheck", +] + +[[package]] +name = "reqwest" +version = "0.12.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eddd3ca559203180a307f12d114c268abf583f59b03cb906fd0b3ff8646c1147" +dependencies = [ + "base64 0.22.1", + "bytes", + "futures-core", + "futures-util", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-rustls", + "hyper-util", + "js-sys", + "log", + "percent-encoding", + "pin-project-lite", + "quinn", + "rustls", + "rustls-pki-types", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper", + "tokio", + "tokio-rustls", + "tokio-util", + "tower 0.5.2", + "tower-http", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-streams", + "web-sys", + "webpki-roots", +] + +[[package]] +name = "reqwest" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04e9018c9d814e5f30cc16a0f03271aeab3571e609612d9fe78c1aa8d11c2f62" +dependencies = [ + "base64 0.22.1", + "bytes", + "encoding_rs", + "futures-core", + "h2", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-rustls", + "hyper-util", + "js-sys", + "log", + "mime", + "percent-encoding", + "pin-project-lite", + "quinn", + "rustls", + "rustls-pki-types", + "rustls-platform-verifier", + "sync_wrapper", + "tokio", + "tokio-rustls", + "tower 0.5.2", + "tower-http", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "rfc6979" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" +dependencies = [ + "hmac", + "subtle", +] + +[[package]] +name = "rfc6979" +version = "0.4.0" +source = "git+https://github.com/sp1-patches/signatures?tag=sp1-skip-verify-on-recovery#1880299a48fe7ef249edaa616fd411239fb5daf1" +dependencies = [ + "hmac", + "subtle", +] + +[[package]] +name = "ring" +version = "0.17.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" +dependencies = [ + "cc", + "cfg-if 1.0.4", + "getrandom 0.2.15", + "libc", + "untrusted", + "windows-sys 0.52.0", +] + +[[package]] +name = "rkyv" +version = "0.8.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a30e631b7f4a03dee9056b8ef6982e8ba371dd5bedb74d3ec86df4499132c70" +dependencies = [ + "bytecheck", + "bytes", + "hashbrown 0.16.1", + "indexmap 2.13.0", + "munge", + "ptr_meta", + "rancor", + "rend", + "rkyv_derive", + "tinyvec", + "uuid", +] + +[[package]] +name = "rkyv_derive" +version = "0.8.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8100bb34c0a1d0f907143db3149e6b4eea3c33b9ee8b189720168e818303986f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "rlp" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb919243f34364b6bd2fc10ef797edbfa75f33c252e7998527479c6d6b47e1ec" +dependencies = [ + "bytes", + "rustc-hex", +] + +[[package]] +name = "rlsf" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1646a59a9734b8b7a0ac51689388a60fe1625d4b956348e9de07591a1478457a" +dependencies = [ + "cfg-if 1.0.4", + "const-default", + "libc", + "rustversion", + "svgbobdoc", +] + +[[package]] +name = "rrs-lib" +version = "0.1.0" +source = "git+https://github.com/succinctlabs/rrs-succinct.git?branch=gautham%2Frv64executor-2#eaca3e8e1785f5b4cf55edfe670c1bf2f52eca77" +dependencies = [ + "downcast-rs", + "num_enum 0.5.11", + "paste", +] + +[[package]] +name = "ruint" +version = "1.17.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c141e807189ad38a07276942c6623032d3753c8859c146104ac2e4d68865945a" +dependencies = [ + "alloy-rlp", + "ark-ff 0.3.0", + "ark-ff 0.4.2", + "ark-ff 0.5.0", + "bytes", + "fastrlp 0.3.1", + "fastrlp 0.4.0", + "num-bigint 0.4.6", + "num-integer", + "num-traits", + "parity-scale-codec", + "primitive-types", + "proptest", + "rand 0.8.5", + "rand 0.9.2", + "rlp", + "ruint-macro", + "serde_core", + "valuable", + "zeroize", +] + +[[package]] +name = "ruint-macro" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48fd7bd8a6377e15ad9d42a8ec25371b94ddc67abe7c8b9127bec79bebaaae18" + +[[package]] +name = "ruint2" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b066b8e4fcea7fae86b6932d2449670b6b5545b7e8407841b2d3a916ff2a9f86" +dependencies = [ + "derive_more 0.99.18", + "ruint2-macro", + "rustc_version 0.4.0", + "thiserror 1.0.63", +] + +[[package]] +name = "ruint2-macro" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89dc553bc0cf4512a8b96caa2e21ed5f6e4b66bf28a1bd08fd9eb07c0b39b28c" + +[[package]] +name = "rustc-demangle" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustc-hash" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" + +[[package]] +name = "rustc-hex" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" + +[[package]] +name = "rustc_version" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" +dependencies = [ + "semver 0.11.0", +] + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver 1.0.27", +] + +[[package]] +name = "rustix" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "146c9e247ccc180c1f61615433868c99f3de3ae256a30a43b49f67c2d9171f34" +dependencies = [ + "bitflags 2.11.0", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.61.2", +] + +[[package]] +name = "rustls" +version = "0.23.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c665f33d38cea657d9614f766881e4d510e0eda4239891eea56b4cadcf01801b" +dependencies = [ + "aws-lc-rs", + "log", + "once_cell", + "ring", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-native-certs" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "612460d5f7bea540c490b2b6395d8e34a953e52b491accd6c86c8164c5932a63" +dependencies = [ + "openssl-probe", + "rustls-pki-types", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-pemfile" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "rustls-pki-types" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be040f8b0a225e40375822a563fa9524378b9d63112f53e19ffff34df5d33fdd" +dependencies = [ + "web-time", + "zeroize", +] + +[[package]] +name = "rustls-platform-verifier" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d99feebc72bae7ab76ba994bb5e121b8d83d910ca40b36e0921f53becc41784" +dependencies = [ + "core-foundation 0.10.1", + "core-foundation-sys", + "jni", + "log", + "once_cell", + "rustls", + "rustls-native-certs", + "rustls-platform-verifier-android", + "rustls-webpki", + "security-framework", + "security-framework-sys", + "webpki-root-certs", + "windows-sys 0.61.2", +] + +[[package]] +name = "rustls-platform-verifier-android" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f87165f0995f63a9fbeea62b64d10b4d9d8e78ec6d7d51fb2125fda7bb36788f" + +[[package]] +name = "rustls-webpki" +version = "0.103.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df33b2b81ac578cabaf06b89b0631153a3f416b0a886e8a7a1707fb51abbd1ef" +dependencies = [ + "aws-lc-rs", + "ring", + "rustls-pki-types", + "untrusted", +] + +[[package]] +name = "rustversion" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" + +[[package]] +name = "rusty-fork" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc6bf79ff24e648f6da1f8d1f011e9cac26491b619e6b9280f2b47f1774e6ee2" +dependencies = [ + "fnv", + "quick-error", + "tempfile", + "wait-timeout", +] + +[[package]] +name = "ruzstd" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5ff0cc5e135c8870a775d3320910cd9b564ec036b4dc0b8741629020be63f01" +dependencies = [ + "twox-hash", +] + +[[package]] +name = "ryu" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "scale-info" +version = "2.11.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "346a3b32eba2640d17a9cb5927056b08f3de90f65b72fe09402c2ad07d684d0b" +dependencies = [ + "cfg-if 1.0.4", + "derive_more 1.0.0", + "parity-scale-codec", + "scale-info-derive", +] + +[[package]] +name = "scale-info-derive" +version = "2.11.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6630024bf739e2179b91fb424b28898baf819414262c5d376677dbff1fe7ebf" +dependencies = [ + "proc-macro-crate 3.3.0", + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "scc" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46e6f046b7fef48e2660c57ed794263155d713de679057f2d0c169bfc6e756cc" +dependencies = [ + "sdd", +] + +[[package]] +name = "schannel" +version = "0.1.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "891d81b926048e76efe18581bf793546b4c0eaf8448d72be8de2bbee5fd166e1" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "sdd" +version = "3.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "490dcfcbfef26be6800d11870ff2df8774fa6e86d047e3e8c8a76b25655e41ca" + +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array 0.14.7", + "pkcs8", + "serdect", + "subtle", + "zeroize", +] + +[[package]] +name = "secp256k1" +version = "0.30.0" +source = "git+https://github.com/sp1-patches/rust-secp256k1?tag=patch-0.30.0-sp1-6.0.0#8d8cabe0eff04a80f4b92da0d75c1d8cd3728e9c" +dependencies = [ + "bitcoin_hashes", + "cfg-if 1.0.4", + "k256 0.13.4 (git+https://github.com/sp1-patches/elliptic-curves?tag=patch-k256-13.4-sp1-6.0.0)", + "rand 0.8.5", + "secp256k1-sys", + "serde", +] + +[[package]] +name = "secp256k1-sys" +version = "0.10.0" +source = "git+https://github.com/sp1-patches/rust-secp256k1?tag=patch-0.30.0-sp1-6.0.0#8d8cabe0eff04a80f4b92da0d75c1d8cd3728e9c" +dependencies = [ + "cc", +] + +[[package]] +name = "security-framework" +version = "3.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3297343eaf830f66ede390ea39da1d462b6b0c1b000f420d0a83f898bbbe6ef" +dependencies = [ + "bitflags 2.11.0", + "core-foundation 0.10.1", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc1f0cbffaac4852523ce30d8bd3c5cdc873501d96ff467ca09b6767bb8cd5c0" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "self_cell" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d369a96f978623eb3dc28807c4852d6cc617fed53da5d3c400feff1ef34a714a" + +[[package]] +name = "semver" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" +dependencies = [ + "semver-parser", +] + +[[package]] +name = "semver" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" +dependencies = [ + "serde", + "serde_core", +] + +[[package]] +name = "semver-parser" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9900206b54a3527fdc7b8a938bffd94a568bac4f4aa8113b209df75a09c0dec2" +dependencies = [ + "pest", +] + +[[package]] +name = "serde" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde-wasm-bindgen" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8302e169f0eddcc139c70f139d19d6467353af16f9fce27e8c30158036a1e16b" +dependencies = [ + "js-sys", + "serde", + "wasm-bindgen", +] + +[[package]] +name = "serde_arrays" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94a16b99c5ea4fe3daccd14853ad260ec00ea043b2708d1fd1da3106dcd8d9df" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "serde_json" +version = "1.0.149" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" +dependencies = [ + "itoa", + "memchr", + "serde", + "serde_core", + "zmij", +] + +[[package]] +name = "serde_path_to_error" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10a9ff822e371bb5403e391ecd83e182e0e77ba7f6fe0160b795797109d1b457" +dependencies = [ + "itoa", + "serde", + "serde_core", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", ] [[package]] -name = "rayon-core" -version = "1.12.1" +name = "serde_with" +version = "3.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +checksum = "69cecfa94848272156ea67b2b1a53f20fc7bc638c4a46d2f8abde08f05f4b857" dependencies = [ - "crossbeam-deque", - "crossbeam-utils", + "base64 0.22.1", + "chrono", + "hex", + "indexmap 1.9.3", + "indexmap 2.13.0", + "serde", + "serde_derive", + "serde_json", + "serde_with_macros", + "time", ] [[package]] -name = "redox_syscall" -version = "0.5.3" +name = "serde_with_macros" +version = "3.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" +checksum = "a8fee4991ef4f274617a51ad4af30519438dacb2f56ac773b08a1922ff743350" dependencies = [ - "bitflags 2.11.0", + "darling 0.20.10", + "proc-macro2", + "quote", + "syn 2.0.117", ] [[package]] -name = "redox_syscall" -version = "0.7.3" +name = "serdect" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce70a74e890531977d37e532c34d45e9055d2409ed08ddba14529471ed0be16" +checksum = "a84f14a19e9a014bb9f4512488d9829a68e04ecabffb0f9904cd1ace94598177" dependencies = [ - "bitflags 2.11.0", + "base16ct", + "serde", ] [[package]] -name = "regalloc2" -version = "0.13.5" +name = "serial_test" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08effbc1fa53aaebff69521a5c05640523fab037b34a4a2c109506bc938246fa" +checksum = "911bd979bf1070a3f3aa7b691a3b3e9968f339ceeec89e08c280a8a22207a32f" dependencies = [ - "allocator-api2", - "bumpalo", - "hashbrown 0.15.5", + "futures-executor", + "futures-util", "log", - "rustc-hash", - "smallvec", + "once_cell", + "parking_lot", + "scc", + "serial_test_derive", ] [[package]] -name = "regex" -version = "1.12.3" +name = "serial_test_derive" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276" +checksum = "0a7d91949b85b0d2fb687445e448b40d322b6b3e4af6b44a29b21d9a5f33e6d9" dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", + "proc-macro2", + "quote", + "syn 2.0.117", ] [[package]] -name = "regex-automata" -version = "0.4.14" +name = "sha1" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", + "cfg-if 1.0.4", + "cpufeatures", + "digest 0.10.7", ] [[package]] -name = "regex-lite" -version = "0.1.9" +name = "sha1_smol" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cab834c73d247e67f4fae452806d17d3c7501756d98c8808d7c9c7aa7d18f973" +checksum = "bbfa15b3dddfee50a0fff136974b3e1bde555604ba463834a7eb7deb6417705d" [[package]] -name = "regex-syntax" -version = "0.8.10" +name = "sha2" +version = "0.10.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" +dependencies = [ + "cfg-if 1.0.4", + "cpufeatures", + "digest 0.10.7", +] [[package]] -name = "region" -version = "3.0.2" +name = "sha2" +version = "0.11.0-rc.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6b6ebd13bc009aef9cd476c1310d49ac354d36e240cf1bd753290f3dc7199a7" +checksum = "7c5f3b1e2dc8aad28310d8410bd4d7e180eca65fca176c52ab00d364475d0024" dependencies = [ - "bitflags 1.3.2", - "libc", - "mach2 0.4.2", - "windows-sys 0.52.0", + "cfg-if 1.0.4", + "cpufeatures", + "digest 0.11.2", ] [[package]] -name = "rend" -version = "0.5.3" +name = "sha3" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cadadef317c2f20755a64d7fdc48f9e7178ee6b0e1f7fce33fa60f1d68a276e6" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" dependencies = [ - "bytecheck", + "digest 0.10.7", + "keccak", ] [[package]] -name = "reqwest" -version = "0.13.1" +name = "sha3-asm" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04e9018c9d814e5f30cc16a0f03271aeab3571e609612d9fe78c1aa8d11c2f62" +checksum = "b31139435f327c93c6038ed350ae4588e2c70a13d50599509fee6349967ba35a" dependencies = [ - "base64", - "bytes", - "encoding_rs", - "futures-core", - "h2", - "http", - "http-body", - "http-body-util", - "hyper", - "hyper-rustls", - "hyper-util", - "js-sys", - "log", - "mime", - "percent-encoding", - "pin-project-lite", - "quinn", - "rustls", - "rustls-pki-types", - "rustls-platform-verifier", - "sync_wrapper", - "tokio", - "tokio-rustls", - "tower", - "tower-http", - "tower-service", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", + "cc", + "cfg-if 1.0.4", ] [[package]] -name = "rfc6979" -version = "0.4.0" +name = "sharded-slab" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" dependencies = [ - "hmac", - "subtle", + "lazy_static", ] [[package]] -name = "ring" -version = "0.17.14" +name = "shared-buffer" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" +checksum = "f6c99835bad52957e7aa241d3975ed17c1e5f8c92026377d117a606f36b84b16" dependencies = [ - "cc", - "cfg-if 1.0.0", - "getrandom 0.2.15", + "bytes", + "memmap2 0.6.2", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signal-hook-registry" +version = "1.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b" +dependencies = [ + "errno", "libc", - "untrusted", - "windows-sys 0.52.0", ] [[package]] -name = "rkyv" -version = "0.8.15" +name = "signature" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a30e631b7f4a03dee9056b8ef6982e8ba371dd5bedb74d3ec86df4499132c70" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ - "bytecheck", - "bytes", - "hashbrown 0.16.1", - "indexmap 2.13.0", - "munge", - "ptr_meta", - "rancor", - "rend", - "rkyv_derive", - "tinyvec", - "uuid", + "digest 0.10.7", + "rand_core 0.6.4", +] + +[[package]] +name = "simd-adler32" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e320a6c5ad31d271ad523dcf3ad13e2767ad8b1cb8f047f75a8aeaf8da139da2" + +[[package]] +name = "simdutf8" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" + +[[package]] +name = "simple_asn1" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d585997b0ac10be3c5ee635f1bab02d512760d14b7c468801ac8a01d9ae5f1d" +dependencies = [ + "num-bigint 0.4.6", + "num-traits", + "thiserror 2.0.18", + "time", +] + +[[package]] +name = "siphasher" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" + +[[package]] +name = "siphasher" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2aa850e253778c88a04c3d7323b043aeda9d3e30d5971937c1855769763678e" + +[[package]] +name = "slab" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a2ae44ef20feb57a68b23d846850f861394c2e02dc425a50098ae8c90267589" + +[[package]] +name = "slop-air" +version = "6.0.0" +source = "git+https://github.com/succinctlabs/sp1?rev=be6ebfe#be6ebfe1412e4f7b2175cd767f60bf67dec67ac5" +dependencies = [ + "p3-air", +] + +[[package]] +name = "slop-algebra" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c99cdaa39f7db4823cf18938544a135f20bf779eb4b3561652a72ba07ac3c41" +dependencies = [ + "itertools 0.14.0", + "p3-field 0.3.1-succinct", + "serde", +] + +[[package]] +name = "slop-algebra" +version = "6.0.0" +source = "git+https://github.com/succinctlabs/sp1?rev=be6ebfe#be6ebfe1412e4f7b2175cd767f60bf67dec67ac5" +dependencies = [ + "itertools 0.13.0", + "p3-field 0.1.0", + "serde", ] [[package]] -name = "rkyv_derive" -version = "0.8.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8100bb34c0a1d0f907143db3149e6b4eea3c33b9ee8b189720168e818303986f" +name = "slop-alloc" +version = "6.0.0" +source = "git+https://github.com/succinctlabs/sp1?rev=be6ebfe#be6ebfe1412e4f7b2175cd767f60bf67dec67ac5" dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", + "serde", + "slop-algebra 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "thiserror 1.0.63", ] [[package]] -name = "rlp" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb919243f34364b6bd2fc10ef797edbfa75f33c252e7998527479c6d6b47e1ec" +name = "slop-baby-bear" +version = "6.0.0" +source = "git+https://github.com/succinctlabs/sp1?rev=be6ebfe#be6ebfe1412e4f7b2175cd767f60bf67dec67ac5" dependencies = [ - "bytes", - "rustc-hex", + "lazy_static", + "p3-baby-bear 0.1.0", + "serde", + "slop-algebra 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-challenger 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-poseidon2 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-symmetric 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", ] [[package]] -name = "ruint" -version = "1.17.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c141e807189ad38a07276942c6623032d3753c8859c146104ac2e4d68865945a" +name = "slop-basefold" +version = "6.0.0" +source = "git+https://github.com/succinctlabs/sp1?rev=be6ebfe#be6ebfe1412e4f7b2175cd767f60bf67dec67ac5" dependencies = [ - "alloy-rlp", - "ark-ff 0.3.0", - "ark-ff 0.4.2", - "ark-ff 0.5.0", - "bytes", - "fastrlp 0.3.1", - "fastrlp 0.4.0", - "num-bigint", - "num-integer", - "num-traits", - "parity-scale-codec", - "primitive-types", - "proptest", + "derive-where", + "itertools 0.13.0", + "serde", + "slop-algebra 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-alloc", + "slop-baby-bear", + "slop-bn254 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-challenger 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-koala-bear 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-merkle-tree", + "slop-multilinear", + "slop-primitives 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-tensor", + "slop-utils", + "thiserror 1.0.63", +] + +[[package]] +name = "slop-basefold-prover" +version = "6.0.0" +source = "git+https://github.com/succinctlabs/sp1?rev=be6ebfe#be6ebfe1412e4f7b2175cd767f60bf67dec67ac5" +dependencies = [ + "derive-where", + "itertools 0.13.0", "rand 0.8.5", - "rand 0.9.2", - "rlp", - "ruint-macro", - "serde_core", - "valuable", - "zeroize", + "serde", + "slop-algebra 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-alloc", + "slop-baby-bear", + "slop-basefold", + "slop-bn254 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-challenger 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-commit", + "slop-dft", + "slop-fri", + "slop-futures", + "slop-koala-bear 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-merkle-tree", + "slop-multilinear", + "slop-tensor", + "thiserror 1.0.63", + "tokio", ] [[package]] -name = "ruint-macro" -version = "1.2.1" +name = "slop-bn254" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48fd7bd8a6377e15ad9d42a8ec25371b94ddc67abe7c8b9127bec79bebaaae18" +checksum = "8ce30d587559808f7a984ea96af231de14f8f793836300347d1ee13d28e194ad" +dependencies = [ + "ff 0.13.1", + "p3-bn254-fr 0.3.1-succinct", + "serde", + "slop-algebra 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "slop-challenger 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "slop-poseidon2 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "slop-symmetric 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "zkhash", +] [[package]] -name = "ruint2" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b066b8e4fcea7fae86b6932d2449670b6b5545b7e8407841b2d3a916ff2a9f86" +name = "slop-bn254" +version = "6.0.0" +source = "git+https://github.com/succinctlabs/sp1?rev=be6ebfe#be6ebfe1412e4f7b2175cd767f60bf67dec67ac5" dependencies = [ - "derive_more 0.99.18", - "ruint2-macro", - "rustc_version 0.4.0", - "thiserror 1.0.63", + "ff 0.13.1", + "p3-bn254-fr 0.1.0", + "serde", + "slop-algebra 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-challenger 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-poseidon2 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-symmetric 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "zkhash", ] [[package]] -name = "ruint2-macro" -version = "1.0.3" +name = "slop-challenger" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89dc553bc0cf4512a8b96caa2e21ed5f6e4b66bf28a1bd08fd9eb07c0b39b28c" +checksum = "15fed3b1414bd79c56a21e3ac75c5b549003a0d8f715eb501000d4ac3d7b8a9f" +dependencies = [ + "futures", + "p3-challenger 0.3.1-succinct", + "serde", + "slop-algebra 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "slop-symmetric 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] -name = "rustc-demangle" -version = "0.1.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" +name = "slop-challenger" +version = "6.0.0" +source = "git+https://github.com/succinctlabs/sp1?rev=be6ebfe#be6ebfe1412e4f7b2175cd767f60bf67dec67ac5" +dependencies = [ + "futures", + "p3-challenger 0.1.0", + "serde", + "slop-algebra 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-symmetric 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", +] [[package]] -name = "rustc-hash" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" +name = "slop-commit" +version = "6.0.0" +source = "git+https://github.com/succinctlabs/sp1?rev=be6ebfe#be6ebfe1412e4f7b2175cd767f60bf67dec67ac5" +dependencies = [ + "p3-commit", + "serde", + "slop-alloc", +] [[package]] -name = "rustc-hex" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" +name = "slop-dft" +version = "6.0.0" +source = "git+https://github.com/succinctlabs/sp1?rev=be6ebfe#be6ebfe1412e4f7b2175cd767f60bf67dec67ac5" +dependencies = [ + "p3-dft 0.1.0", + "serde", + "slop-algebra 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-alloc", + "slop-matrix", + "slop-tensor", +] [[package]] -name = "rustc_version" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" +name = "slop-fri" +version = "6.0.0" +source = "git+https://github.com/succinctlabs/sp1?rev=be6ebfe#be6ebfe1412e4f7b2175cd767f60bf67dec67ac5" dependencies = [ - "semver 0.11.0", + "p3-fri", ] [[package]] -name = "rustc_version" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +name = "slop-futures" +version = "6.0.0" +source = "git+https://github.com/succinctlabs/sp1?rev=be6ebfe#be6ebfe1412e4f7b2175cd767f60bf67dec67ac5" dependencies = [ - "semver 1.0.23", + "crossbeam", + "futures", + "pin-project", + "rayon", + "thiserror 1.0.63", + "tokio", + "tracing", ] [[package]] -name = "rustix" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "146c9e247ccc180c1f61615433868c99f3de3ae256a30a43b49f67c2d9171f34" +name = "slop-jagged" +version = "6.0.0" +source = "git+https://github.com/succinctlabs/sp1?rev=be6ebfe#be6ebfe1412e4f7b2175cd767f60bf67dec67ac5" dependencies = [ - "bitflags 2.11.0", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.61.2", + "derive-where", + "futures", + "itertools 0.13.0", + "num_cpus", + "rand 0.8.5", + "rayon", + "serde", + "slop-algebra 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-alloc", + "slop-baby-bear", + "slop-basefold", + "slop-basefold-prover", + "slop-bn254 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-challenger 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-commit", + "slop-futures", + "slop-koala-bear 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-merkle-tree", + "slop-multilinear", + "slop-stacked", + "slop-sumcheck", + "slop-symmetric 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-tensor", + "slop-utils", + "thiserror 1.0.63", + "tokio", + "tracing", ] [[package]] -name = "rustls" -version = "0.23.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c665f33d38cea657d9614f766881e4d510e0eda4239891eea56b4cadcf01801b" +name = "slop-keccak-air" +version = "6.0.0" +source = "git+https://github.com/succinctlabs/sp1?rev=be6ebfe#be6ebfe1412e4f7b2175cd767f60bf67dec67ac5" dependencies = [ - "aws-lc-rs", - "once_cell", - "rustls-pki-types", - "rustls-webpki", - "subtle", - "zeroize", + "p3-keccak-air", ] [[package]] -name = "rustls-native-certs" -version = "0.8.3" +name = "slop-koala-bear" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "612460d5f7bea540c490b2b6395d8e34a953e52b491accd6c86c8164c5932a63" +checksum = "402c403f847e811a788882c7c5ee018ab7076c8bafbf4f46f569fe97f44610d1" dependencies = [ - "openssl-probe", - "rustls-pki-types", - "schannel", - "security-framework", + "lazy_static", + "p3-koala-bear 0.3.1-succinct", + "serde", + "slop-algebra 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "slop-challenger 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "slop-poseidon2 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "slop-symmetric 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "rustls-pki-types" -version = "1.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be040f8b0a225e40375822a563fa9524378b9d63112f53e19ffff34df5d33fdd" +name = "slop-koala-bear" +version = "6.0.0" +source = "git+https://github.com/succinctlabs/sp1?rev=be6ebfe#be6ebfe1412e4f7b2175cd767f60bf67dec67ac5" dependencies = [ - "web-time", - "zeroize", + "lazy_static", + "p3-koala-bear 0.1.0", + "serde", + "slop-algebra 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-challenger 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-poseidon2 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-symmetric 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", ] [[package]] -name = "rustls-platform-verifier" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d99feebc72bae7ab76ba994bb5e121b8d83d910ca40b36e0921f53becc41784" +name = "slop-matrix" +version = "6.0.0" +source = "git+https://github.com/succinctlabs/sp1?rev=be6ebfe#be6ebfe1412e4f7b2175cd767f60bf67dec67ac5" dependencies = [ - "core-foundation 0.10.1", - "core-foundation-sys", - "jni", - "log", - "once_cell", - "rustls", - "rustls-native-certs", - "rustls-platform-verifier-android", - "rustls-webpki", - "security-framework", - "security-framework-sys", - "webpki-root-certs", - "windows-sys 0.61.2", + "p3-matrix 0.1.0", ] [[package]] -name = "rustls-platform-verifier-android" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f87165f0995f63a9fbeea62b64d10b4d9d8e78ec6d7d51fb2125fda7bb36788f" +name = "slop-maybe-rayon" +version = "6.0.0" +source = "git+https://github.com/succinctlabs/sp1?rev=be6ebfe#be6ebfe1412e4f7b2175cd767f60bf67dec67ac5" +dependencies = [ + "p3-maybe-rayon 0.1.0", +] [[package]] -name = "rustls-webpki" -version = "0.103.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df33b2b81ac578cabaf06b89b0631153a3f416b0a886e8a7a1707fb51abbd1ef" +name = "slop-merkle-tree" +version = "6.0.0" +source = "git+https://github.com/succinctlabs/sp1?rev=be6ebfe#be6ebfe1412e4f7b2175cd767f60bf67dec67ac5" dependencies = [ - "aws-lc-rs", - "ring", - "rustls-pki-types", - "untrusted", + "derive-where", + "ff 0.13.1", + "itertools 0.13.0", + "p3-merkle-tree", + "serde", + "slop-algebra 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-alloc", + "slop-baby-bear", + "slop-bn254 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-challenger 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-commit", + "slop-futures", + "slop-koala-bear 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-matrix", + "slop-poseidon2 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-symmetric 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-tensor", + "thiserror 1.0.63", + "tokio", + "zkhash", ] [[package]] -name = "rustversion" -version = "1.0.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" +name = "slop-multilinear" +version = "6.0.0" +source = "git+https://github.com/succinctlabs/sp1?rev=be6ebfe#be6ebfe1412e4f7b2175cd767f60bf67dec67ac5" +dependencies = [ + "derive-where", + "futures", + "num_cpus", + "rand 0.8.5", + "rayon", + "serde", + "slop-algebra 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-alloc", + "slop-challenger 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-commit", + "slop-futures", + "slop-matrix", + "slop-tensor", + "tokio", +] [[package]] -name = "rusty-fork" -version = "0.3.1" +name = "slop-poseidon2" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc6bf79ff24e648f6da1f8d1f011e9cac26491b619e6b9280f2b47f1774e6ee2" +checksum = "9bc5ba869130dd0711cf7bd54f93785cd566b5c71201f38801fa3f500d508cc4" dependencies = [ - "fnv", - "quick-error", - "tempfile", - "wait-timeout", + "p3-poseidon2 0.3.1-succinct", ] [[package]] -name = "ruzstd" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ff0cc5e135c8870a775d3320910cd9b564ec036b4dc0b8741629020be63f01" +name = "slop-poseidon2" +version = "6.0.0" +source = "git+https://github.com/succinctlabs/sp1?rev=be6ebfe#be6ebfe1412e4f7b2175cd767f60bf67dec67ac5" dependencies = [ - "twox-hash", + "p3-poseidon2 0.1.0", ] [[package]] -name = "ryu" -version = "1.0.18" +name = "slop-primitives" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" +checksum = "786111f9498e8d465b39cfef062297ef4e9b688f250a39abdafaca08e772b56c" +dependencies = [ + "slop-algebra 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +name = "slop-primitives" +version = "6.0.0" +source = "git+https://github.com/succinctlabs/sp1?rev=be6ebfe#be6ebfe1412e4f7b2175cd767f60bf67dec67ac5" dependencies = [ - "winapi-util", + "slop-algebra 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", ] [[package]] -name = "schannel" -version = "0.1.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "891d81b926048e76efe18581bf793546b4c0eaf8448d72be8de2bbee5fd166e1" +name = "slop-stacked" +version = "6.0.0" +source = "git+https://github.com/succinctlabs/sp1?rev=be6ebfe#be6ebfe1412e4f7b2175cd767f60bf67dec67ac5" dependencies = [ - "windows-sys 0.61.2", + "derive-where", + "futures", + "itertools 0.13.0", + "serde", + "slop-algebra 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-alloc", + "slop-basefold", + "slop-basefold-prover", + "slop-challenger 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-commit", + "slop-futures", + "slop-merkle-tree", + "slop-multilinear", + "slop-tensor", + "thiserror 1.0.63", + "tokio", +] + +[[package]] +name = "slop-sumcheck" +version = "6.0.0" +source = "git+https://github.com/succinctlabs/sp1?rev=be6ebfe#be6ebfe1412e4f7b2175cd767f60bf67dec67ac5" +dependencies = [ + "futures", + "itertools 0.13.0", + "rayon", + "serde", + "slop-algebra 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-alloc", + "slop-baby-bear", + "slop-challenger 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-multilinear", + "thiserror 1.0.63", ] [[package]] -name = "scopeguard" -version = "1.2.0" +name = "slop-symmetric" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +checksum = "c41115c944fdb8eec425d4515cbc1649852ab4ddcc6be67a069c8d2aa5205209" +dependencies = [ + "p3-symmetric 0.3.1-succinct", +] [[package]] -name = "sec1" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +name = "slop-symmetric" +version = "6.0.0" +source = "git+https://github.com/succinctlabs/sp1?rev=be6ebfe#be6ebfe1412e4f7b2175cd767f60bf67dec67ac5" dependencies = [ - "base16ct", - "der", - "generic-array", - "pkcs8", - "serdect", - "subtle", - "zeroize", + "p3-symmetric 0.1.0", ] [[package]] -name = "secp256k1" -version = "0.30.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b50c5943d326858130af85e049f2661ba3c78b26589b8ab98e65e80ae44a1252" +name = "slop-tensor" +version = "6.0.0" +source = "git+https://github.com/succinctlabs/sp1?rev=be6ebfe#be6ebfe1412e4f7b2175cd767f60bf67dec67ac5" dependencies = [ - "bitcoin_hashes", + "arrayvec", + "derive-where", + "itertools 0.13.0", "rand 0.8.5", - "secp256k1-sys", + "rayon", "serde", + "slop-algebra 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-alloc", + "slop-futures", + "slop-matrix", + "thiserror 1.0.63", + "tokio", + "transpose", ] [[package]] -name = "secp256k1-sys" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4387882333d3aa8cb20530a17c69a3752e97837832f34f6dccc760e715001d9" +name = "slop-uni-stark" +version = "6.0.0" +source = "git+https://github.com/succinctlabs/sp1?rev=be6ebfe#be6ebfe1412e4f7b2175cd767f60bf67dec67ac5" dependencies = [ - "cc", + "p3-uni-stark", ] [[package]] -name = "security-framework" -version = "3.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3297343eaf830f66ede390ea39da1d462b6b0c1b000f420d0a83f898bbbe6ef" +name = "slop-utils" +version = "6.0.0" +source = "git+https://github.com/succinctlabs/sp1?rev=be6ebfe#be6ebfe1412e4f7b2175cd767f60bf67dec67ac5" dependencies = [ - "bitflags 2.11.0", - "core-foundation 0.10.1", - "core-foundation-sys", - "libc", - "security-framework-sys", + "p3-util 0.1.0", + "tracing-forest", + "tracing-subscriber", ] [[package]] -name = "security-framework-sys" -version = "2.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc1f0cbffaac4852523ce30d8bd3c5cdc873501d96ff467ca09b6767bb8cd5c0" +name = "slop-whir" +version = "6.0.0" +source = "git+https://github.com/succinctlabs/sp1?rev=be6ebfe#be6ebfe1412e4f7b2175cd767f60bf67dec67ac5" dependencies = [ - "core-foundation-sys", - "libc", + "derive-where", + "futures", + "itertools 0.13.0", + "rand 0.8.5", + "rayon", + "serde", + "slop-algebra 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-alloc", + "slop-baby-bear", + "slop-basefold", + "slop-challenger 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-commit", + "slop-dft", + "slop-jagged", + "slop-koala-bear 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-matrix", + "slop-merkle-tree", + "slop-multilinear", + "slop-stacked", + "slop-tensor", + "slop-utils", + "thiserror 1.0.63", ] [[package]] -name = "self_cell" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d369a96f978623eb3dc28807c4852d6cc617fed53da5d3c400feff1ef34a714a" - -[[package]] -name = "semver" -version = "0.11.0" +name = "smallvec" +version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" dependencies = [ - "semver-parser", + "serde", ] [[package]] -name = "semver" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" - -[[package]] -name = "semver-parser" -version = "0.10.3" +name = "snowbridge-amcl" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9900206b54a3527fdc7b8a938bffd94a568bac4f4aa8113b209df75a09c0dec2" +checksum = "460a9ed63cdf03c1b9847e8a12a5f5ba19c4efd5869e4a737e05be25d7c427e5" dependencies = [ - "pest", + "parity-scale-codec", + "scale-info", ] [[package]] -name = "serde" -version = "1.0.228" +name = "socket2" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +checksum = "e22376abed350d73dd1cd119b57ffccad95b4e585a7cda43e286245ce23c0678" dependencies = [ - "serde_core", - "serde_derive", + "libc", + "windows-sys 0.52.0", ] [[package]] -name = "serde-wasm-bindgen" -version = "0.6.5" +name = "socket2" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8302e169f0eddcc139c70f139d19d6467353af16f9fce27e8c30158036a1e16b" +checksum = "17129e116933cf371d018bb80ae557e889637989d8638274fb25622827b03881" dependencies = [ - "js-sys", - "serde", - "wasm-bindgen", + "libc", + "windows-sys 0.60.2", ] [[package]] -name = "serde_core" -version = "1.0.228" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +name = "sp1-build" +version = "6.0.0" +source = "git+https://github.com/succinctlabs/sp1?rev=be6ebfe#be6ebfe1412e4f7b2175cd767f60bf67dec67ac5" dependencies = [ - "serde_derive", + "anyhow", + "cargo_metadata", + "chrono", + "clap 4.5.53", + "dirs", + "sp1-primitives 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", ] [[package]] -name = "serde_derive" -version = "1.0.228" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +name = "sp1-builder" +version = "0.1.0" dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", + "clap 4.5.53", + "serde_json", + "sp1-build", + "sp1-core-executor", + "sp1-sdk", + "wasmer", + "wasmparser 0.245.1", ] [[package]] -name = "serde_json" -version = "1.0.121" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ab380d7d9f22ef3f21ad3e6c1ebe8e4fc7a2000ccba2e4d71fc96f15b2cb609" +name = "sp1-core-executor" +version = "6.0.0" +source = "git+https://github.com/succinctlabs/sp1?rev=be6ebfe#be6ebfe1412e4f7b2175cd767f60bf67dec67ac5" dependencies = [ - "itoa", - "memchr", - "ryu", + "bincode", + "bytemuck", + "cfg-if 1.0.4", + "clap 4.5.53", + "deepsize2", + "elf", + "enum-map", + "eyre", + "gecko_profile", + "hashbrown 0.14.5", + "hex", + "indicatif", + "itertools 0.13.0", + "memmap2 0.9.10", + "num", + "object 0.37.3", + "rrs-lib", + "rustc-demangle", "serde", + "serde_arrays", + "serde_json", + "slop-air", + "slop-algebra 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-maybe-rayon", + "slop-symmetric 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "sp1-curves", + "sp1-hypercube", + "sp1-jit", + "sp1-primitives 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "strum", + "subenum", + "thiserror 1.0.63", + "tiny-keccak", + "tracing", + "typenum", + "vec_map", ] [[package]] -name = "serde_path_to_error" -version = "0.1.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10a9ff822e371bb5403e391ecd83e182e0e77ba7f6fe0160b795797109d1b457" +name = "sp1-core-machine" +version = "6.0.0" +source = "git+https://github.com/succinctlabs/sp1?rev=be6ebfe#be6ebfe1412e4f7b2175cd767f60bf67dec67ac5" dependencies = [ - "itoa", + "bincode", + "cfg-if 1.0.4", + "enum-map", + "futures", + "generic-array 1.1.0", + "hashbrown 0.14.5", + "itertools 0.13.0", + "num", + "num_cpus", + "rayon", + "rayon-scan", + "rrs-lib", "serde", - "serde_core", + "serde_json", + "slop-air", + "slop-algebra 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-challenger 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-futures", + "slop-keccak-air", + "slop-matrix", + "slop-maybe-rayon", + "slop-uni-stark", + "snowbridge-amcl", + "sp1-core-executor", + "sp1-curves", + "sp1-derive", + "sp1-hypercube", + "sp1-jit", + "sp1-primitives 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "static_assertions", + "strum", + "sysinfo", + "tempfile", + "thiserror 1.0.63", + "tokio", + "tracing", + "tracing-forest", + "tracing-subscriber", + "typenum", ] [[package]] -name = "serde_urlencoded" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +name = "sp1-cuda" +version = "6.0.0" +source = "git+https://github.com/succinctlabs/sp1?rev=be6ebfe#be6ebfe1412e4f7b2175cd767f60bf67dec67ac5" dependencies = [ - "form_urlencoded", - "itoa", - "ryu", + "bincode", + "bytes", + "reqwest 0.12.28", + "semver 1.0.27", "serde", + "serde_json", + "sp1-core-executor", + "sp1-core-machine", + "sp1-primitives 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "sp1-prover", + "sp1-prover-types", + "thiserror 1.0.63", + "tokio", + "tracing", ] [[package]] -name = "serde_with" -version = "3.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cecfa94848272156ea67b2b1a53f20fc7bc638c4a46d2f8abde08f05f4b857" +name = "sp1-curves" +version = "6.0.0" +source = "git+https://github.com/succinctlabs/sp1?rev=be6ebfe#be6ebfe1412e4f7b2175cd767f60bf67dec67ac5" dependencies = [ - "base64", - "chrono", - "hex", - "indexmap 1.9.3", - "indexmap 2.13.0", + "cfg-if 1.0.4", + "dashu", + "elliptic-curve", + "generic-array 1.1.0", + "itertools 0.13.0", + "k256 0.13.4 (registry+https://github.com/rust-lang/crates.io-index)", + "num", + "p256", "serde", - "serde_derive", - "serde_json", - "serde_with_macros", - "time", + "slop-algebra 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "snowbridge-amcl", + "sp1-primitives 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "typenum", ] [[package]] -name = "serde_with_macros" -version = "3.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8fee4991ef4f274617a51ad4af30519438dacb2f56ac773b08a1922ff743350" +name = "sp1-derive" +version = "6.0.0" +source = "git+https://github.com/succinctlabs/sp1?rev=be6ebfe#be6ebfe1412e4f7b2175cd767f60bf67dec67ac5" dependencies = [ - "darling 0.20.10", "proc-macro2", "quote", - "syn 2.0.117", + "syn 1.0.109", ] [[package]] -name = "serdect" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a84f14a19e9a014bb9f4512488d9829a68e04ecabffb0f9904cd1ace94598177" +name = "sp1-hypercube" +version = "6.0.0" +source = "git+https://github.com/succinctlabs/sp1?rev=be6ebfe#be6ebfe1412e4f7b2175cd767f60bf67dec67ac5" dependencies = [ - "base16ct", + "arrayref", + "deepsize2", + "derive-where", + "futures", + "hashbrown 0.14.5", + "itertools 0.13.0", + "num-bigint 0.4.6", + "num-traits", + "num_cpus", + "rayon", + "rayon-scan", "serde", + "slop-air", + "slop-algebra 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-alloc", + "slop-basefold", + "slop-basefold-prover", + "slop-challenger 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-commit", + "slop-futures", + "slop-jagged", + "slop-koala-bear 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-matrix", + "slop-merkle-tree", + "slop-multilinear", + "slop-poseidon2 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-stacked", + "slop-sumcheck", + "slop-symmetric 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-tensor", + "slop-uni-stark", + "slop-whir", + "sp1-derive", + "sp1-primitives 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "strum", + "thiserror 1.0.63", + "thousands", + "tokio", + "tracing", ] [[package]] -name = "sha1" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" +name = "sp1-jit" +version = "6.0.0" +source = "git+https://github.com/succinctlabs/sp1?rev=be6ebfe#be6ebfe1412e4f7b2175cd767f60bf67dec67ac5" dependencies = [ - "cfg-if 1.0.0", - "cpufeatures", - "digest 0.10.7", + "dynasmrt 3.2.1", + "hashbrown 0.14.5", + "memfd", + "memmap2 0.9.10", + "serde", + "sp1-primitives 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "tracing", + "uuid", ] [[package]] -name = "sha2" -version = "0.10.9" +name = "sp1-lib" +version = "5.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" +checksum = "b73b8ff343f2405d5935440e56b7aba5cee6d87303f0051974cbd6f5de502f57" dependencies = [ - "cfg-if 1.0.0", - "cpufeatures", - "digest 0.10.7", + "bincode", + "elliptic-curve", + "serde", + "sp1-primitives 5.2.4", ] [[package]] -name = "sha2" -version = "0.11.0-rc.5" +name = "sp1-lib" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c5f3b1e2dc8aad28310d8410bd4d7e180eca65fca176c52ab00d364475d0024" +checksum = "53f179ca7ad5d0d0ca36356ef2c4851eea02226cd409e4b414e4379d79582f11" dependencies = [ - "cfg-if 1.0.0", - "cpufeatures", - "digest 0.11.2", + "bincode", + "elliptic-curve", + "serde", + "sp1-primitives 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "sha3" -version = "0.10.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +name = "sp1-lib" +version = "6.0.0" +source = "git+https://github.com/succinctlabs/sp1?rev=be6ebfe#be6ebfe1412e4f7b2175cd767f60bf67dec67ac5" dependencies = [ - "digest 0.10.7", - "keccak", + "bincode", + "serde", + "sp1-primitives 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", ] [[package]] -name = "sha3-asm" -version = "0.1.5" +name = "sp1-primitives" +version = "5.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b31139435f327c93c6038ed350ae4588e2c70a13d50599509fee6349967ba35a" +checksum = "7e69a03098f827102c54c31a5e57280eb45b2c085de433b3f702e4f9e3ec1641" dependencies = [ - "cc", - "cfg-if 1.0.0", + "bincode", + "blake3", + "cfg-if 1.0.4", + "hex", + "lazy_static", + "num-bigint 0.4.6", + "p3-baby-bear 0.2.3-succinct", + "p3-field 0.2.3-succinct", + "p3-poseidon2 0.2.3-succinct", + "p3-symmetric 0.2.3-succinct", + "serde", + "sha2 0.10.9", ] [[package]] -name = "sharded-slab" -version = "0.1.7" +name = "sp1-primitives" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +checksum = "9bda0eaba853f3c162e6b62dc8eb25f25100ee0792f59919ef905811809e81e5" dependencies = [ + "bincode", + "blake3", + "elf", + "hex", + "itertools 0.14.0", "lazy_static", + "num-bigint 0.4.6", + "serde", + "sha2 0.10.9", + "slop-algebra 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "slop-bn254 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "slop-challenger 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "slop-koala-bear 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "slop-poseidon2 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "slop-primitives 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "slop-symmetric 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "shared-buffer" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6c99835bad52957e7aa241d3975ed17c1e5f8c92026377d117a606f36b84b16" +name = "sp1-primitives" +version = "6.0.0" +source = "git+https://github.com/succinctlabs/sp1?rev=be6ebfe#be6ebfe1412e4f7b2175cd767f60bf67dec67ac5" dependencies = [ - "bytes", - "memmap2 0.6.2", + "bincode", + "blake3", + "elf", + "hex", + "itertools 0.13.0", + "lazy_static", + "num-bigint 0.4.6", + "serde", + "sha2 0.10.9", + "slop-algebra 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-bn254 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-challenger 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-koala-bear 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-poseidon2 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-primitives 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-symmetric 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", ] [[package]] -name = "shlex" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" +name = "sp1-prover" +version = "6.0.0" +source = "git+https://github.com/succinctlabs/sp1?rev=be6ebfe#be6ebfe1412e4f7b2175cd767f60bf67dec67ac5" +dependencies = [ + "anyhow", + "bincode", + "clap 4.5.53", + "dirs", + "downloader", + "either", + "enum-map", + "eyre", + "futures", + "hashbrown 0.14.5", + "hex", + "indicatif", + "itertools 0.13.0", + "lru 0.12.5", + "mti", + "num-bigint 0.4.6", + "opentelemetry", + "pin-project", + "rand 0.8.5", + "reqwest 0.12.28", + "serde", + "serde_json", + "serial_test", + "sha2 0.10.9", + "slop-air", + "slop-algebra 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-basefold", + "slop-bn254 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-challenger 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-futures", + "slop-jagged", + "slop-multilinear", + "slop-stacked", + "slop-symmetric 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "sp1-core-executor", + "sp1-core-machine", + "sp1-derive", + "sp1-hypercube", + "sp1-jit", + "sp1-primitives 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "sp1-prover-types", + "sp1-recursion-circuit", + "sp1-recursion-compiler", + "sp1-recursion-executor", + "sp1-recursion-gnark-ffi", + "sp1-recursion-machine", + "sp1-verifier", + "static_assertions", + "sysinfo", + "tempfile", + "thiserror 1.0.63", + "tokio", + "tonic", + "tracing", + "tracing-appender", + "tracing-subscriber", +] [[package]] -name = "signal-hook-registry" -version = "1.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b" +name = "sp1-prover-types" +version = "6.0.0" +source = "git+https://github.com/succinctlabs/sp1?rev=be6ebfe#be6ebfe1412e4f7b2175cd767f60bf67dec67ac5" dependencies = [ - "errno", - "libc", + "anyhow", + "async-scoped", + "bincode", + "chrono", + "futures-util", + "hashbrown 0.14.5", + "mti", + "prost", + "serde", + "tokio", + "tonic", + "tonic-build", + "tracing", ] [[package]] -name = "signature" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +name = "sp1-recursion-circuit" +version = "6.0.0" +source = "git+https://github.com/succinctlabs/sp1?rev=be6ebfe#be6ebfe1412e4f7b2175cd767f60bf67dec67ac5" dependencies = [ - "digest 0.10.7", - "rand_core 0.6.4", + "itertools 0.13.0", + "rand 0.8.5", + "rayon", + "serde", + "slop-air", + "slop-algebra 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-alloc", + "slop-basefold", + "slop-basefold-prover", + "slop-bn254 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-challenger 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-commit", + "slop-jagged", + "slop-koala-bear 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-matrix", + "slop-merkle-tree", + "slop-multilinear", + "slop-stacked", + "slop-sumcheck", + "slop-symmetric 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-tensor", + "slop-whir", + "sp1-core-executor", + "sp1-core-machine", + "sp1-derive", + "sp1-hypercube", + "sp1-primitives 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "sp1-recursion-compiler", + "sp1-recursion-executor", + "sp1-recursion-machine", + "tracing", ] [[package]] -name = "simd-adler32" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e320a6c5ad31d271ad523dcf3ad13e2767ad8b1cb8f047f75a8aeaf8da139da2" +name = "sp1-recursion-compiler" +version = "6.0.0" +source = "git+https://github.com/succinctlabs/sp1?rev=be6ebfe#be6ebfe1412e4f7b2175cd767f60bf67dec67ac5" +dependencies = [ + "backtrace", + "cfg-if 1.0.4", + "itertools 0.13.0", + "serde", + "slop-algebra 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-bn254 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-symmetric 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "sp1-core-machine", + "sp1-hypercube", + "sp1-primitives 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "sp1-recursion-executor", + "tracing", + "vec_map", +] [[package]] -name = "simdutf8" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" +name = "sp1-recursion-executor" +version = "6.0.0" +source = "git+https://github.com/succinctlabs/sp1?rev=be6ebfe#be6ebfe1412e4f7b2175cd767f60bf67dec67ac5" +dependencies = [ + "backtrace", + "cfg-if 1.0.4", + "hashbrown 0.14.5", + "itertools 0.13.0", + "range-set-blaze", + "serde", + "slop-algebra 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-maybe-rayon", + "slop-poseidon2 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-symmetric 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "smallvec", + "sp1-derive", + "sp1-hypercube", + "static_assertions", + "thiserror 1.0.63", + "tracing", +] [[package]] -name = "simple_asn1" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d585997b0ac10be3c5ee635f1bab02d512760d14b7c468801ac8a01d9ae5f1d" +name = "sp1-recursion-gnark-ffi" +version = "6.0.0" +source = "git+https://github.com/succinctlabs/sp1?rev=be6ebfe#be6ebfe1412e4f7b2175cd767f60bf67dec67ac5" dependencies = [ - "num-bigint", - "num-traits", - "thiserror 2.0.18", - "time", + "anyhow", + "bincode", + "bindgen 0.70.1", + "cfg-if 1.0.4", + "hex", + "num-bigint 0.4.6", + "serde", + "serde_json", + "sha2 0.10.9", + "slop-algebra 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-symmetric 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "sp1-hypercube", + "sp1-primitives 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "sp1-recursion-compiler", + "sp1-verifier", + "tempfile", + "tracing", ] [[package]] -name = "siphasher" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" +name = "sp1-recursion-machine" +version = "6.0.0" +source = "git+https://github.com/succinctlabs/sp1?rev=be6ebfe#be6ebfe1412e4f7b2175cd767f60bf67dec67ac5" +dependencies = [ + "itertools 0.13.0", + "rand 0.8.5", + "slop-air", + "slop-algebra 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-basefold", + "slop-matrix", + "slop-maybe-rayon", + "slop-symmetric 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "sp1-derive", + "sp1-hypercube", + "sp1-primitives 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "sp1-recursion-executor", + "strum", + "tracing", + "zkhash", +] [[package]] -name = "siphasher" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2aa850e253778c88a04c3d7323b043aeda9d3e30d5971937c1855769763678e" +name = "sp1-runner" +version = "0.1.0" +dependencies = [ + "bincode", + "clap 4.5.53", + "rkyv", + "serde_json", + "sp1-core-executor", + "sp1-sdk", + "stylus-compiler-program", + "tokio", + "tracing", + "validation", +] [[package]] -name = "slab" -version = "0.4.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a2ae44ef20feb57a68b23d846850f861394c2e02dc425a50098ae8c90267589" +name = "sp1-sdk" +version = "6.0.0" +source = "git+https://github.com/succinctlabs/sp1?rev=be6ebfe#be6ebfe1412e4f7b2175cd767f60bf67dec67ac5" +dependencies = [ + "anyhow", + "async-trait", + "bincode", + "cfg-if 1.0.4", + "dirs", + "eventsource-stream", + "futures", + "hex", + "indicatif", + "itertools 0.13.0", + "k256 0.13.4 (registry+https://github.com/rust-lang/crates.io-index)", + "num-bigint 0.4.6", + "serde", + "slop-algebra 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "sp1-build", + "sp1-core-executor", + "sp1-core-machine", + "sp1-cuda", + "sp1-hypercube", + "sp1-primitives 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "sp1-prover", + "sp1-prover-types", + "sp1-recursion-executor", + "sp1-recursion-gnark-ffi", + "sp1-verifier", + "strum", + "tempfile", + "thiserror 1.0.63", + "tokio", + "tracing", +] [[package]] -name = "smallvec" -version = "1.15.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" +name = "sp1-verifier" +version = "6.0.0" +source = "git+https://github.com/succinctlabs/sp1?rev=be6ebfe#be6ebfe1412e4f7b2175cd767f60bf67dec67ac5" dependencies = [ + "bincode", + "blake3", + "cfg-if 1.0.4", + "dirs", + "hex", + "lazy_static", "serde", + "sha2 0.10.9", + "slop-algebra 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-primitives 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "slop-symmetric 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "sp1-hypercube", + "sp1-primitives 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "sp1-recursion-executor", + "sp1-recursion-machine", + "strum", + "substrate-bn-succinct", + "thiserror 2.0.18", ] [[package]] -name = "socket2" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17129e116933cf371d018bb80ae557e889637989d8638274fb25622827b03881" +name = "sp1-zkvm" +version = "6.0.0" +source = "git+https://github.com/succinctlabs/sp1?rev=be6ebfe#be6ebfe1412e4f7b2175cd767f60bf67dec67ac5" dependencies = [ - "libc", - "windows-sys 0.60.2", + "cfg-if 1.0.4", + "critical-section", + "embedded-alloc", + "getrandom 0.2.15", + "getrandom 0.3.4", + "lazy_static", + "libm", + "rand 0.8.5", + "sha2 0.10.9", + "sp1-lib 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", + "sp1-primitives 6.0.0 (git+https://github.com/succinctlabs/sp1?rev=be6ebfe)", ] +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + [[package]] name = "spin" version = "0.10.0" @@ -4714,6 +7745,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +[[package]] +name = "strength_reduce" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe895eb47f22e2ddd4dabc02bce419d2e643c8e3b585c78158b349195bc24d82" + [[package]] name = "strsim" version = "0.8.0" @@ -4772,30 +7809,82 @@ dependencies = [ ] [[package]] -name = "stylus" -version = "0.1.0" +name = "stylus" +version = "0.1.0" +dependencies = [ + "arbutil", + "brotli", + "caller-env", + "clru", + "derivative", + "eyre", + "hex", + "lazy_static", + "num-bigint 0.4.6", + "parking_lot", + "prover", + "prover-ffi", + "rand 0.8.5", + "thiserror 1.0.63", + "user-host-trait", + "wasmer", + "wasmer-compiler-cranelift", + "wasmer-compiler-llvm", + "wasmer-compiler-singlepass", + "wasmer-types", + "wasmer-vm", +] + +[[package]] +name = "stylus-compiler-program" +version = "0.1.0" +dependencies = [ + "anyhow", + "prover", + "serde", + "sp1-zkvm", + "wasmer", +] + +[[package]] +name = "stylus-compiler-runner" +version = "0.1.0" +dependencies = [ + "bincode", + "clap 4.5.53", + "sp1-build", + "sp1-sdk", + "stylus-compiler-program", + "tracing", +] + +[[package]] +name = "subenum" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec3d08fe7078c57309d5c3d938e50eba95ba1d33b9c3a101a8465fc6861a5416" +dependencies = [ + "heck 0.5.0", + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "substrate-bn-succinct" +version = "0.6.0-v5.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ba32f1b74728f92887c3ad17c42bf82998eb52c9091018f35294e9cd388b0c8" dependencies = [ - "arbutil", - "brotli", - "caller-env", - "clru", - "derivative", - "eyre", - "hex", + "bytemuck", + "byteorder", + "cfg-if 1.0.4", + "crunchy", "lazy_static", - "num-bigint", - "parking_lot", - "prover", - "prover-ffi", + "num-bigint 0.4.6", "rand 0.8.5", - "thiserror 1.0.63", - "user-host-trait", - "wasmer", - "wasmer-compiler-cranelift", - "wasmer-compiler-llvm", - "wasmer-compiler-singlepass", - "wasmer-types", - "wasmer-vm", + "rustc-hex", + "sp1-lib 5.2.4", ] [[package]] @@ -4804,6 +7893,19 @@ version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" +[[package]] +name = "svgbobdoc" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2c04b93fc15d79b39c63218f15e3fdffaa4c227830686e3b7c5f41244eb3e50" +dependencies = [ + "base64 0.13.1", + "proc-macro2", + "quote", + "syn 1.0.109", + "unicode-width 0.1.13", +] + [[package]] name = "syn" version = "1.0.109" @@ -4846,6 +7948,21 @@ dependencies = [ "syn 2.0.117", ] +[[package]] +name = "sysinfo" +version = "0.30.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a5b4ddaee55fb2bea2bf0e5000747e5f5c0de765e5a5ff87f4cd106439f4bb3" +dependencies = [ + "cfg-if 1.0.4", + "core-foundation-sys", + "libc", + "ntapi", + "once_cell", + "rayon", + "windows", +] + [[package]] name = "system-configuration" version = "0.6.1" @@ -4887,8 +8004,7 @@ dependencies = [ [[package]] name = "target-lexicon" version = "0.13.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb6935a6f5c20170eeceb1a3835a49e12e19d792f6dd344ccc76a985ca5a6ca" +source = "git+https://github.com/OffchainLabs/target-lexicon?tag=v0.13.5-sp1#b36201fb3efd8babeb625c26217bfb4fb7af32a5" [[package]] name = "tempfile" @@ -4952,13 +8068,19 @@ dependencies = [ "syn 2.0.117", ] +[[package]] +name = "thousands" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3bf63baf9f5039dadc247375c29eb13706706cfde997d0330d05aa63a77d8820" + [[package]] name = "thread_local" version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185" dependencies = [ - "cfg-if 1.0.0", + "cfg-if 1.0.4", ] [[package]] @@ -5004,10 +8126,11 @@ dependencies = [ [[package]] name = "tiny-keccak" version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" +source = "git+https://github.com/sp1-patches/tiny-keccak?tag=patch-2.0.2-sp1-6.0.0#957430a459f7a2332ab5bab4a12f9b473bb95c87" dependencies = [ + "cfg-if 1.0.4", "crunchy", + "sp1-lib 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -5056,7 +8179,7 @@ dependencies = [ "mio", "pin-project-lite", "signal-hook-registry", - "socket2", + "socket2 0.6.1", "tokio-macros", "windows-sys 0.61.2", ] @@ -5082,6 +8205,17 @@ dependencies = [ "tokio", ] +[[package]] +name = "tokio-stream" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32da49809aab5c3bc678af03902d4ccddea2a87d028d86392a4b1560c6906c70" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", +] + [[package]] name = "tokio-util" version = "0.7.18" @@ -5101,6 +8235,17 @@ version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c" +[[package]] +name = "toml_edit" +version = "0.19.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +dependencies = [ + "indexmap 2.13.0", + "toml_datetime", + "winnow 0.5.40", +] + [[package]] name = "toml_edit" version = "0.22.27" @@ -5109,7 +8254,73 @@ checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" dependencies = [ "indexmap 2.13.0", "toml_datetime", - "winnow", + "winnow 0.7.13", +] + +[[package]] +name = "tonic" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877c5b330756d856ffcc4553ab34a5684481ade925ecc54bcd1bf02b1d0d4d52" +dependencies = [ + "async-stream", + "async-trait", + "axum 0.7.9", + "base64 0.22.1", + "bytes", + "h2", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-timeout", + "hyper-util", + "percent-encoding", + "pin-project", + "prost", + "rustls-pemfile", + "socket2 0.5.10", + "tokio", + "tokio-rustls", + "tokio-stream", + "tower 0.4.13", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tonic-build" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9557ce109ea773b399c9b9e5dca39294110b74f1f342cb347a80d1fce8c26a11" +dependencies = [ + "prettyplease", + "proc-macro2", + "prost-build", + "prost-types", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "tower" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +dependencies = [ + "futures-core", + "futures-util", + "indexmap 1.9.3", + "pin-project", + "pin-project-lite", + "rand 0.8.5", + "slab", + "tokio", + "tokio-util", + "tower-layer", + "tower-service", + "tracing", ] [[package]] @@ -5141,7 +8352,7 @@ dependencies = [ "http-body", "iri-string", "pin-project-lite", - "tower", + "tower 0.5.2", "tower-layer", "tower-service", "tracing", @@ -5171,6 +8382,18 @@ dependencies = [ "tracing-core", ] +[[package]] +name = "tracing-appender" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "786d480bce6247ab75f005b14ae1624ad978d3029d9113f0a22fa1ac773faeaf" +dependencies = [ + "crossbeam-channel", + "thiserror 2.0.18", + "time", + "tracing-subscriber", +] + [[package]] name = "tracing-attributes" version = "0.1.31" @@ -5192,6 +8415,19 @@ dependencies = [ "valuable", ] +[[package]] +name = "tracing-forest" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee40835db14ddd1e3ba414292272eddde9dad04d3d4b65509656414d1c42592f" +dependencies = [ + "ansi_term", + "smallvec", + "thiserror 1.0.63", + "tracing", + "tracing-subscriber", +] + [[package]] name = "tracing-log" version = "0.2.0" @@ -5234,6 +8470,16 @@ dependencies = [ "tracing-serde", ] +[[package]] +name = "transpose" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ad61aed86bc3faea4300c7aee358b4c6d0c8d6ccc36524c96e4c92ccf26e77e" +dependencies = [ + "num-integer", + "strength_reduce", +] + [[package]] name = "try-lock" version = "0.2.5" @@ -5246,6 +8492,21 @@ version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ea3136b675547379c4bd395ca6b938e5ad3c3d20fad76e7fe85f9e0d011419c" +[[package]] +name = "typeid_prefix" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9da1387307fdee46aa441e4f08a1b491e659fcac1aca9cd71f2c624a0de5d1b" + +[[package]] +name = "typeid_suffix" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77b55e96f110c6db5d1a2f24072552537f0091dc90cebeaa679540bac93e7405" +dependencies = [ + "uuid", +] + [[package]] name = "typenum" version = "1.17.0" @@ -5378,9 +8639,17 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.10.0" +version = "1.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" +checksum = "a68d3c8f01c0cfa54a75291d83601161799e4a89a39e0929f4b0354d88757a37" +dependencies = [ + "atomic", + "getrandom 0.4.2", + "js-sys", + "md-5", + "sha1_smol", + "wasm-bindgen", +] [[package]] name = "validation" @@ -5401,12 +8670,12 @@ dependencies = [ "alloy-rpc-types-engine", "anyhow", "arbutil", - "axum", + "axum 0.8.8", "axum-extra", "clap 4.5.53", "jit", "rand 0.8.5", - "reqwest", + "reqwest 0.13.1", "serde", "serde_json", "tempfile", @@ -5428,6 +8697,9 @@ name = "vec_map" version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" +dependencies = [ + "serde", +] [[package]] name = "version_check" @@ -5502,7 +8774,7 @@ version = "0.2.108" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "64024a30ec1e37399cf85a7ffefebdb72205ca1c972291c51512360d90bd8566" dependencies = [ - "cfg-if 1.0.0", + "cfg-if 1.0.4", "once_cell", "rustversion", "wasm-bindgen-macro", @@ -5515,7 +8787,7 @@ version = "0.4.45" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cc7ec4f8827a71586374db3e87abdb5a2bb3a15afed140221307c3ec06b1f63b" dependencies = [ - "cfg-if 1.0.0", + "cfg-if 1.0.4", "js-sys", "wasm-bindgen", "web-sys", @@ -5585,13 +8857,26 @@ dependencies = [ "wasmparser 0.244.0", ] +[[package]] +name = "wasm-streams" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15053d8d85c7eccdbefef60f06769760a563c7f0a9d6902a13d35c7800b0ad65" +dependencies = [ + "futures-util", + "js-sys", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + [[package]] name = "wasmer" version = "7.1.0" dependencies = [ - "bindgen", + "bindgen 0.72.1", "bytes", - "cfg-if 1.0.0", + "cfg-if 1.0.4", "cmake", "derive_more 2.1.1", "indexmap 2.13.0", @@ -5609,6 +8894,8 @@ dependencies = [ "wasm-bindgen", "wasmer-compiler", "wasmer-compiler-cranelift", + "wasmer-compiler-llvm", + "wasmer-compiler-singlepass", "wasmer-derive", "wasmer-types", "wasmer-vm", @@ -5623,7 +8910,7 @@ version = "7.1.0" dependencies = [ "backtrace", "bytes", - "cfg-if 1.0.0", + "cfg-if 1.0.4", "crossbeam-channel", "enum-iterator", "enumset", @@ -5688,7 +8975,7 @@ dependencies = [ "rayon", "regex", "rustc_version 0.4.0", - "semver 1.0.23", + "semver 1.0.27", "smallvec", "target-lexicon", "tracing", @@ -5702,8 +8989,8 @@ name = "wasmer-compiler-singlepass" version = "7.1.0" dependencies = [ "byteorder", - "dynasm", - "dynasmrt", + "dynasm 5.0.0", + "dynasmrt 5.0.0", "enumset", "gimli 0.33.0", "itertools 0.14.0", @@ -5750,7 +9037,7 @@ dependencies = [ "backtrace", "bytesize", "cc", - "cfg-if 1.0.0", + "cfg-if 1.0.4", "corosensei", "crossbeam-queue", "dashmap", @@ -5782,7 +9069,7 @@ dependencies = [ "bitflags 2.11.0", "hashbrown 0.15.5", "indexmap 2.13.0", - "semver 1.0.23", + "semver 1.0.27", ] [[package]] @@ -5794,7 +9081,7 @@ dependencies = [ "bitflags 2.11.0", "hashbrown 0.16.1", "indexmap 2.13.0", - "semver 1.0.23", + "semver 1.0.27", "serde", ] @@ -5831,9 +9118,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.69" +version = "0.3.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" +checksum = "312e32e551d92129218ea9a2452120f4aabc03529ef03e4d0d82fb2780608598" dependencies = [ "js-sys", "wasm-bindgen", @@ -5858,6 +9145,15 @@ dependencies = [ "rustls-pki-types", ] +[[package]] +name = "webpki-roots" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22cfaf3c063993ff62e73cb4311efde4db1efb31ab78a3e5c457939ad5cc0bed" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "wee_alloc" version = "0.4.5" @@ -5873,8 +9169,7 @@ dependencies = [ [[package]] name = "which" version = "8.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81995fafaaaf6ae47a7d0cc83c67caf92aeb7e5331650ae6ff856f7c0c60c459" +source = "git+https://github.com/OffchainLabs/which-rs?rev=f516e8a2e5453daeab38706747a9f6be8bb058e7#f516e8a2e5453daeab38706747a9f6be8bb058e7" dependencies = [ "libc", ] @@ -5910,6 +9205,16 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" +dependencies = [ + "windows-core", + "windows-targets 0.52.6", +] + [[package]] name = "windows-core" version = "0.52.0" @@ -5963,6 +9268,15 @@ dependencies = [ "windows-targets 0.42.2", ] +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + [[package]] name = "windows-sys" version = "0.52.0" @@ -6014,6 +9328,21 @@ dependencies = [ "windows_x86_64_msvc 0.42.2", ] +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + [[package]] name = "windows-targets" version = "0.52.6" @@ -6053,6 +9382,12 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + [[package]] name = "windows_aarch64_gnullvm" version = "0.52.6" @@ -6071,6 +9406,12 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + [[package]] name = "windows_aarch64_msvc" version = "0.52.6" @@ -6089,6 +9430,12 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + [[package]] name = "windows_i686_gnu" version = "0.52.6" @@ -6119,6 +9466,12 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + [[package]] name = "windows_i686_msvc" version = "0.52.6" @@ -6137,6 +9490,12 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + [[package]] name = "windows_x86_64_gnu" version = "0.52.6" @@ -6155,6 +9514,12 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + [[package]] name = "windows_x86_64_gnullvm" version = "0.52.6" @@ -6173,6 +9538,12 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + [[package]] name = "windows_x86_64_msvc" version = "0.52.6" @@ -6185,6 +9556,15 @@ version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" +[[package]] +name = "winnow" +version = "0.5.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" +dependencies = [ + "memchr", +] + [[package]] name = "winnow" version = "0.7.13" @@ -6274,7 +9654,7 @@ dependencies = [ "id-arena", "indexmap 2.13.0", "log", - "semver 1.0.23", + "semver 1.0.27", "serde", "serde_derive", "serde_json", @@ -6423,3 +9803,36 @@ dependencies = [ "quote", "syn 2.0.117", ] + +[[package]] +name = "zkhash" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4352d1081da6922701401cdd4cbf29a2723feb4cfabb5771f6fee8e9276da1c7" +dependencies = [ + "ark-ff 0.4.2", + "ark-std 0.4.0", + "bitvec", + "blake2", + "bls12_381", + "byteorder", + "cfg-if 1.0.4", + "group 0.12.1", + "group 0.13.0", + "halo2", + "hex", + "jubjub", + "lazy_static", + "pasta_curves 0.5.1", + "rand 0.8.5", + "serde", + "sha2 0.10.9", + "sha3", + "subtle", +] + +[[package]] +name = "zmij" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" diff --git a/Cargo.toml b/Cargo.toml index b007cf01af..724c678a20 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,6 +19,11 @@ members = [ "crates/wasm-libraries/user-host-trait", "crates/wasm-libraries/user-test", "crates/wasm-libraries/wasi-stub", + "crates/sp1/builder", + "crates/sp1/program", + "crates/sp1/runner", + "crates/sp1/stylus-compiler-program", + "crates/sp1/stylus-compiler-runner", ] default-members = [ "crates/jit", @@ -48,6 +53,8 @@ axum = { version = "0.8.8" } axum-extra = { version = "0.10.3" } bincode = { version = "1.3.3" } bitvec = { version = "1.0.0" } +bytes = { version = "1" } +corosensei = { version = "0.3.0" } c-kzg = { version = "2.1.1" } # TODO: look into switching to rust-kzg (no crates.io release or hosted rustdoc yet) clap = { version = "4.4.8" } clru = { version = "0.6.2" } @@ -58,7 +65,7 @@ enum-iterator = { version = "2.0.1" } eyre = { version = "0.6.5" } fnv = { version = "1.0.7" } gperftools = { version = "0.2.0" } -hex = { version = "0.4.3", default-features = false } +hex = { version = "0.4.3", default-features = false, features = ["alloc"] } k256 = { version = "0.13.4", default-features = false} lazy_static = { version = "1.4.0" } libc = { version = "0.2.132" } @@ -79,6 +86,7 @@ rkyv = { version = "0.8.8" } reqwest = { version = "0.13.1" } ruint2 = { version = "1.9.0" } rustc-demangle = { version = "0.1.21" } +secp256k1 = { version = "0.30.0" } serde = { version = "1.0.130" } serde_json = { version = "1.0.67" } serde_with = { version = "3.8.1" } @@ -108,8 +116,11 @@ jit = { path = "crates/jit" } prover = { path = "crates/prover", default-features = false } prover-ffi = { path = "crates/prover-ffi" } stylus = { path = "crates/stylus", default-features = false } +stylus-compiler-program = { path = "crates/sp1/stylus-compiler-program" } user-host-trait = { path = "crates/wasm-libraries/user-host-trait" } validation = { path = "crates/validation" } + +# wasmer wasmer = { path = "crates/tools/wasmer/lib/api" } wasmer-compiler-cranelift = { path = "crates/tools/wasmer/lib/compiler-cranelift" } wasmer-compiler-llvm = { path = "crates/tools/wasmer/lib/compiler-llvm" } @@ -117,5 +128,25 @@ wasmer-compiler-singlepass = { path = "crates/tools/wasmer/lib/compiler-singlepa wasmer-types = { path = "crates/tools/wasmer/lib/types" } wasmer-vm = { path = "crates/tools/wasmer/lib/vm" } +# sp1 +sp1-build = { version = "6.0.0", features = ["may_dump_elf"] } +sp1-core-executor = { version = "6.0.0" } +sp1-sdk = { version = "6.0.0", features = ["profiling"] } +sp1-zkvm = { version = "6.0.0", features = ["untrusted_programs", "may_dump_elf"] } + + +[patch.crates-io] +target-lexicon = { git = "https://github.com/OffchainLabs/target-lexicon", tag = "v0.13.5-sp1" } +region = { git = "https://github.com/OffchainLabs/region-rs", tag = "v3.0.2-sp1" } +corosensei = { git = "https://github.com/OffchainLabs/corosensei", rev = "6681138454747733c6adad5037024400f0c9d4e3" } # branch: v0.3.3-sp +which = { git = "https://github.com/OffchainLabs/which-rs", rev = "f516e8a2e5453daeab38706747a9f6be8bb058e7" } # branch: v0.3.3-sp1 +secp256k1 = { git = "https://github.com/sp1-patches/rust-secp256k1", tag = "patch-0.30.0-sp1-6.0.0" } +tiny-keccak = { git = "https://github.com/sp1-patches/tiny-keccak", tag = "patch-2.0.2-sp1-6.0.0" } + +sp1-build = { git = "https://github.com/succinctlabs/sp1", rev = "be6ebfe" } +sp1-core-executor = { git = "https://github.com/succinctlabs/sp1", rev = "be6ebfe" } +sp1-sdk = { git = "https://github.com/succinctlabs/sp1", rev = "be6ebfe" } +sp1-zkvm = { git = "https://github.com/succinctlabs/sp1", rev = "be6ebfe" } + [profile.release] debug = true diff --git a/changelog/pmikolajczyk-nit-4504.md b/changelog/pmikolajczyk-nit-4504.md new file mode 100644 index 0000000000..fa24dae720 --- /dev/null +++ b/changelog/pmikolajczyk-nit-4504.md @@ -0,0 +1,2 @@ +### Internal +- CI: build and run SP1 validation \ No newline at end of file diff --git a/changelog/zk-prove-any-sp1-runner.md b/changelog/zk-prove-any-sp1-runner.md new file mode 100644 index 0000000000..4355dfef33 --- /dev/null +++ b/changelog/zk-prove-any-sp1-runner.md @@ -0,0 +1,2 @@ +### Ignored + - PLACEHOLDER TO SATISFY CI - WILL BE REPLACED WITH ACTUAL CHANGELOG ENTRY IN THE FUTURE \ No newline at end of file diff --git a/crates/arbutil/Cargo.toml b/crates/arbutil/Cargo.toml index 1d02fb829f..0b73245b23 100644 --- a/crates/arbutil/Cargo.toml +++ b/crates/arbutil/Cargo.toml @@ -21,3 +21,7 @@ serde = { workspace = true, features = ["derive", "rc"] } siphasher = { workspace = true } tiny-keccak = { workspace = true, features = ["keccak"] } wasmparser = { workspace = true } + +# See comment in crates/prover/Cargo.toml about the "sp1" cfg. +[lints.rust] +unexpected_cfgs = { level = "warn", check-cfg = ['cfg(feature, values("sp1"))'] } diff --git a/crates/brotli/build.rs b/crates/brotli/build.rs index 2f4c1d7886..eea0d61846 100644 --- a/crates/brotli/build.rs +++ b/crates/brotli/build.rs @@ -9,8 +9,11 @@ fn main() { if target_arch.contains("wasm32") { println!("cargo:rustc-link-search=target/lib-wasm/"); + } else if target_arch.contains("riscv64") { + println!("cargo:rustc-link-search=target/lib-sp1/lib"); } else { println!("cargo:rustc-link-search=target/lib/"); + println!("cargo:rustc-link-search=../../target/lib/"); } println!("cargo:rustc-link-lib=static=brotlienc-static"); println!("cargo:rustc-link-lib=static=brotlidec-static"); diff --git a/crates/brotli/src/dicts/mod.rs b/crates/brotli/src/dicts/mod.rs index 8d8023c5cc..5888518511 100644 --- a/crates/brotli/src/dicts/mod.rs +++ b/crates/brotli/src/dicts/mod.rs @@ -29,10 +29,16 @@ unsafe extern "C" { ) -> usize; } -/// Forces a type to implement [`Sync`]. +/// Forces a type to implement [`Sync`] and [`Send`]. +/// Only used to wrap static dictionary pointers (`*const EncoderPreparedDictionary`) +/// which point to immutable, process-lifetime data initialized once via `lazy_static`. struct ForceSync(T); +// SAFETY: ForceSync only wraps raw pointers to immutable, static dictionary data. +// The data is initialized once (via lazy_static) and never mutated or freed, +// so sharing across threads is safe. unsafe impl Sync for ForceSync {} +unsafe impl Send for ForceSync {} lazy_static! { /// Memoizes dictionary preperation. diff --git a/crates/prover-ffi/Cargo.toml b/crates/prover-ffi/Cargo.toml index 43e3a5bb89..7ea275874b 100644 --- a/crates/prover-ffi/Cargo.toml +++ b/crates/prover-ffi/Cargo.toml @@ -20,5 +20,5 @@ lazy_static = { workspace = true } libc = { workspace = true } lru = { workspace = true } once_cell = { workspace = true } -prover = { workspace = true, features = ["native", "libc"] } +prover = { workspace = true, features = ["native", "libc", "kzg"] } static_assertions = { workspace = true } diff --git a/crates/prover/Cargo.toml b/crates/prover/Cargo.toml index f533dbec5a..2fde57279b 100644 --- a/crates/prover/Cargo.toml +++ b/crates/prover/Cargo.toml @@ -36,7 +36,7 @@ serde_with = { workspace = true, features = ["base64"] } sha2 = { workspace = true } sha3 = { workspace = true } smallvec = { workspace = true, features = ["serde"] } -structopt = { workspace = true } +structopt = { workspace = true, optional = true } validation = { workspace = true } wasmer = { workspace = true, optional = true } wasmer-compiler-singlepass = { workspace = true, optional = true, features = ["std", "unwind", "avx"] } @@ -46,7 +46,7 @@ wat = { workspace = true } [dev-dependencies] criterion = { workspace = true, features = ["html_reports"] } -rand = { workspace = true } +rand = { workspace = true, features = ["std", "std_rng"] } [build-dependencies] forward = { workspace = true } @@ -60,10 +60,11 @@ name = "prover" crate-type = ["lib"] [features] -default = ["native", "rayon", "singlepass_rayon"] +default = ["native", "rayon", "singlepass_rayon", "kzg", "dep:structopt"] counters = [] +kzg = ["dep:c-kzg"] libc = ["dep:libc"] -native = ["dep:wasmer", "dep:wasmer-compiler-singlepass", "brotli/wasmer_traits", "dep:c-kzg"] +native = ["dep:wasmer", "dep:wasmer-compiler-singlepass", "brotli/wasmer_traits"] singlepass_rayon = ["wasmer-compiler-singlepass?/rayon"] rayon = ["dep:rayon"] cc_brotli = ["brotli/cc_brotli"] diff --git a/crates/prover/src/binary.rs b/crates/prover/src/binary.rs index 2174a07673..dca9326c12 100644 --- a/crates/prover/src/binary.rs +++ b/crates/prover/src/binary.rs @@ -341,6 +341,7 @@ pub fn parse_with_version<'a>( features.set(WasmFeatures::GC, false); features.set(WasmFeatures::CM_NESTED_NAMES, false); features.set(WasmFeatures::GC_TYPES, true); + Validator::new_with_features(features) .validate_all(input) .wrap_err_with(|| eyre!("failed to validate {}", path.to_string_lossy().red()))?; diff --git a/crates/prover/src/lib.rs b/crates/prover/src/lib.rs index fd04f94b2a..4d9254696e 100644 --- a/crates/prover/src/lib.rs +++ b/crates/prover/src/lib.rs @@ -7,7 +7,7 @@ pub mod binary; pub mod cbytes; mod host; pub(crate) mod internal_func; -#[cfg(feature = "native")] +#[cfg(feature = "kzg")] mod kzg; pub mod machine; /// cbindgen:ignore diff --git a/crates/prover/src/machine.rs b/crates/prover/src/machine.rs index 6737eae318..0e1f92b3ab 100644 --- a/crates/prover/src/machine.rs +++ b/crates/prover/src/machine.rs @@ -18,7 +18,7 @@ use std::{ use arbutil::{Bytes32, Color, DebugColor, PreimageType, crypto, math}; use brotli::Dictionary; -#[cfg(feature = "native")] +#[cfg(feature = "kzg")] use c_kzg::BYTES_PER_BLOB; use digest::Digest; use eyre::{Result, WrapErr, bail, ensure, eyre}; @@ -34,8 +34,10 @@ use smallvec::SmallVec; use wasmer_types::FunctionIndex; use wasmparser::{DataKind, ElementItems, ElementKind, Operator, RefType, TableType}; -#[cfg(feature = "native")] +#[cfg(feature = "kzg")] use crate::kzg::prove_kzg_preimage; +#[cfg(feature = "native")] +use crate::programs::meter::MeteredMachine; use crate::{ binary::{ self, ExportKind, ExportMap, FloatInstruction, Local, NameCustomSection, WasmBinary, parse, @@ -43,7 +45,7 @@ use crate::{ host, memory::Memory, merkle::{Merkle, MerkleType}, - programs::{ModuleMod, StylusData, config::CompileConfig, meter::MeteredMachine}, + programs::{ModuleMod, StylusData, config::CompileConfig}, reinterpret::{ReinterpretAsSigned, ReinterpretAsUnsigned}, utils::{CBytes, RemoteTableType, file_bytes}, value::{ArbValueType, FunctionType, IntegerValType, ProgramCounter, Value}, @@ -2549,6 +2551,7 @@ impl Machine { self.print_backtrace(true); bail!("missing requested preimage for hash {}", hash); }; + #[cfg(feature = "kzg")] if preimage_ty == PreimageType::EthVersionedHash && preimage.len() != BYTES_PER_BLOB { @@ -3162,10 +3165,15 @@ impl Machine { // The proofs for these preimage types are just the raw preimages. data.extend(preimage); } + #[cfg(feature = "kzg")] PreimageType::EthVersionedHash => { prove_kzg_preimage(hash, &preimage, offset, &mut data) .expect("Failed to generate KZG preimage proof"); } + #[cfg(not(feature = "kzg"))] + PreimageType::EthVersionedHash => { + panic!("KZG preimage proofs require the 'kzg' feature"); + } PreimageType::DACertificate => { // We do something special here; we don't create the final proof. // For DACertificate preimages, signal that this proof needs diff --git a/crates/prover/src/merkle.rs b/crates/prover/src/merkle.rs index 361ba3a044..9ecdaa3322 100644 --- a/crates/prover/src/merkle.rs +++ b/crates/prover/src/merkle.rs @@ -167,11 +167,10 @@ fn new_layer(ty: MerkleType, layer: &[Bytes32], empty_hash: &'static Bytes32) -> #[inline] #[cfg(not(feature = "rayon"))] fn new_layer(ty: MerkleType, layer: &[Bytes32], empty_hash: &'static Bytes32) -> Vec { - let new_layer = layer + layer .chunks(2) .map(|chunk| hash_node(ty, chunk[0], chunk.get(1).unwrap_or(empty_hash))) - .collect(); - new_layer + .collect() } impl Clone for Merkle { diff --git a/crates/prover/src/programs/depth.rs b/crates/prover/src/programs/depth.rs index db7035a5ba..c3500e581e 100644 --- a/crates/prover/src/programs/depth.rs +++ b/crates/prover/src/programs/depth.rs @@ -16,9 +16,7 @@ use super::{ FuncMiddleware, Middleware, ModuleMod, config::{CompileMemoryParams, SigMap}, }; -#[cfg(feature = "native")] -use crate::Machine; -use crate::{internal_func::InternalFunc, value::FunctionType}; +use crate::{Machine, internal_func::InternalFunc, value::FunctionType}; pub const STYLUS_STACK_LEFT: &str = "stylus_stack_left"; diff --git a/crates/prover/src/utils.rs b/crates/prover/src/utils.rs index 0cb64de29d..b362a7d5f6 100644 --- a/crates/prover/src/utils.rs +++ b/crates/prover/src/utils.rs @@ -4,7 +4,7 @@ use std::{convert::TryInto, fs::File, io::Read, path::Path}; use arbutil::PreimageType; -#[cfg(feature = "native")] +#[cfg(feature = "kzg")] use c_kzg::Blob; use digest::Digest; use eyre::{Result, eyre}; @@ -16,7 +16,7 @@ use wasmparser::{RefType, TableType}; pub use crate::cbytes::CBytes; #[cfg(feature = "libc")] pub use crate::cbytes::CBytesIntoIter; -#[cfg(feature = "native")] +#[cfg(feature = "kzg")] use crate::kzg::ETHEREUM_KZG_SETTINGS; /// Unfortunately, [`wasmparser::RefType`] isn't serde and its contents aren't public. @@ -80,6 +80,7 @@ pub fn hash_preimage(preimage: &[u8], ty: PreimageType) -> Result<[u8; 32]> { match ty { PreimageType::Keccak256 => Ok(Keccak256::digest(preimage).into()), PreimageType::Sha2_256 => Ok(Sha256::digest(preimage).into()), + #[cfg(feature = "kzg")] PreimageType::EthVersionedHash => { // TODO: really we should also accept what version it is, // but right now only one version is supported by this hash format anyways. @@ -89,6 +90,10 @@ pub fn hash_preimage(preimage: &[u8], ty: PreimageType) -> Result<[u8; 32]> { commitment_hash[0] = 1; Ok(commitment_hash) } + #[cfg(not(feature = "kzg"))] + PreimageType::EthVersionedHash => { + eyre::bail!("EthVersionedHash preimage hashing requires the 'kzg' feature"); + } PreimageType::DACertificate => { // There is no way for us to compute the hash of the preimage for DACertificate. // For DACertificate, this is only ever called on the flat file initialization path. diff --git a/crates/sp1/README.md b/crates/sp1/README.md new file mode 100644 index 0000000000..71a0f8b76d --- /dev/null +++ b/crates/sp1/README.md @@ -0,0 +1,79 @@ +This folder adds a new Arbitrum block runner (like `jit` and `prover`), powered by [Succinct SP1](https://github.com/succinctlabs/sp1). For now we are only showcasing the executor powered by SP1, but the same code should be able to generate zero knowledge proofs for validating an Arbitrum block. + +These crates are part of the root Cargo workspace. + +## Usage + +To build this runner, of course you must be able to build a significant part of nitro. Please refer to [this document](https://docs.arbitrum.io/run-arbitrum-node/nitro/build-nitro-locally) on setting up the computer to build nitro. + +One major dependency wasmer also requires you to have LLVM 21 installed. Please note that you must have LLVM 21.x.y installed. Wasmer requires this major version. + +The code included here requires a SP1 Rust toolchain with riscv64 support. You can use the following commands: + +```bash +$ curl -L https://sp1up.succinct.xyz | bash +$ sp1up -v v6.0.0-beta.1 +``` + +To verify that correct toolchain have been installed, you can run the following 2 commands, and compare output: + +```bash +$ rustc +succinct --version +rustc 1.93.0-dev +$ rustc +succinct --print target-list | grep succinct +riscv32im-succinct-zkvm-elf +riscv64im-succinct-zkvm-elf +``` + +Now you can start the build process: + +```bash +$ git clone https://github.com/OffchainLabs/nitro +$ # Checkout current PR +$ ./crates/sp1/build.sh +``` + +To make things easier to understand, for now we are using a simple bash script. As the code grow more mature, we would merge the bash script into the top-level makefile. + +After the build process, all the files required by SP1 runner can be found in `target/sp1` folder. Some important files are: + +* `replay.wasm`: this is Arbitrum's STF built with `sp1` tag enabled, so it contains SP1 specific optimizations +* `dumped_replay_wasm.elf`: this is the SP1 version of `replay.wasm`. The 2 fulfill the same task. It's just that `dumped_replay_wasm.elf` is in RISC-V architecture accepted by SP1, following SP1's ABIs. +* `stylus-compiler-program`: this is a SP1 program wrapping wasmer's singlepass compiler. It can compile an Arbitrum stylus program into RISC-V format accepted by SP1. +* `sp1-runner`: this is the SP1 runner that can execute / validate an Arbitrum block. One can see it as SP1 version of `jit` or `prover` in `arbitrator` workspace. +* `*.json`: sample Arbitrum test blocks you can use for testing. In my run, `block_inputs_7.json` was generated. + +There are also other files in the folder, but you can safely ignore them. They are kept now for debugging purposes. + +Now you can use the following command to execute an Arbitrum block using SP1 runner: + +```bash +$ ./target/sp1/sp1-runner \ + --program target/sp1/dumped_replay_wasm.elf \ + --stylus-compiler-program target/sp1/stylus-compiler-program \ + --block-file target/sp1/block_inputs_7.json +stderr: WARNING: Using insecure random number generator. +stdout: Validation succeeds with hash 624b2d504238ba9fe94ad3e19d1036a51894bc209b7f0ead1331d22005d40178 +``` + +You can tweak `RUST_LOG` for more logs(e.g., running cycles and running time): + +```bash +$ RUST_LOG=info ./target/sp1/sp1-runner \ + --program target/sp1/dumped_replay_wasm.elf \ + --stylus-compiler-program target/sp1/stylus-compiler-program \ + --block-file target/sp1/block_inputs_7.json +``` + +You can also compare the result hash with Arbitrum's own JIT engine: + +```bash +$ ./target/bin/jit \ + --debug --cranelift \ + --binary target/machines/latest/replay.wasm \ + --json-inputs=target/sp1/block_inputs_7.json +Created the machine in 4081ms. +Completed in 19ms with hash 624b2d504238ba9fe94ad3e19d1036a51894bc209b7f0ead1331d22005d40178. +``` + +You can also generate other Arbitrum blocks to test. There is one caveat: for any stylus programs that might be executed, you must include the original wasm source in the block JSON file as well. SP1 runner works either with the original WASM source files(it will invoke stylus compiler program automatically), or the `rv64` target binary after compilation. You can also refer to [this commit](https://github.com/wakabat/nitro/commit/d924d4907ace4bd329b27dacd31ebad832b6eb90) where we patch nitro's tests to dump as many acceptable test blocks as possible. diff --git a/crates/sp1/brotli_cmake_patch.txt b/crates/sp1/brotli_cmake_patch.txt new file mode 100644 index 0000000000..f23c882cc9 --- /dev/null +++ b/crates/sp1/brotli_cmake_patch.txt @@ -0,0 +1,438 @@ +# Ubuntu 12.04 LTS has CMake 2.8.7, and is an important target since +# several CI services, such as Travis and Drone, use it. Solaris 11 +# has 2.8.6, and it's not difficult to support if you already have to +# support 2.8.7. +cmake_minimum_required(VERSION 2.8.6) + +# Since this project's version is loaded from other files, this policy +# will help suppress the warning generated by cmake. +# This policy is set because we can't provide "VERSION" in "project" command. +# Use `cmake --help-policy CMP0048` for more information. +cmake_policy(SET CMP0048 NEW) +project(brotli C) + +if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + message(STATUS "Setting build type to Release as none was specified.") + set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build." FORCE) +else() + message(STATUS "Build type is '${CMAKE_BUILD_TYPE}'") +endif() + +include(CheckCSourceCompiles) +check_c_source_compiles( + "#if defined(__EMSCRIPTEN__) + int main() {return 0;} + #endif" + BROTLI_EMSCRIPTEN +) +if (BROTLI_EMSCRIPTEN) + message("-- Compiler is EMSCRIPTEN") +else() + message("-- Compiler is not EMSCRIPTEN") +endif() + +check_c_source_compiles( + "#if defined(__riscv) + int main() {return 0;} + #endif" + BROTLI_RISCV +) +if (BROTLI_RISCV) + message("-- Compiler is RISC-V") +endif() + +# If Brotli is being bundled in another project, we don't want to +# install anything. However, we want to let people override this, so +# we'll use the BROTLI_BUNDLED_MODE variable to let them do that; just +# set it to OFF in your project before you add_subdirectory(brotli). +get_directory_property(BROTLI_PARENT_DIRECTORY PARENT_DIRECTORY) +if(NOT DEFINED BROTLI_BUNDLED_MODE) + # Bundled mode hasn't been set one way or the other, set the default + # depending on whether or not we are the top-level project. + if(BROTLI_PARENT_DIRECTORY) + set(BROTLI_BUNDLED_MODE ON) + else() + set(BROTLI_BUNDLED_MODE OFF) + endif() +endif() +mark_as_advanced(BROTLI_BUNDLED_MODE) + +include(GNUInstallDirs) + +# Parse version information from common/version.h. Normally we would +# define these values here and write them out to configuration file(s) +# (i.e., config.h), but in this case we parse them from +# common/version.h to be less intrusive. +function(hex_to_dec HEXADECIMAL DECIMAL) + string(TOUPPER "${HEXADECIMAL}" _tail) + set(_decimal 0) + string(LENGTH "${_tail}" _tail_length) + while (_tail_length GREATER 0) + math(EXPR _decimal "${_decimal} * 16") + string(SUBSTRING "${_tail}" 0 1 _digit) + string(SUBSTRING "${_tail}" 1 -1 _tail) + if (_digit STREQUAL "A") + math(EXPR _decimal "${_decimal} + 10") + elseif (_digit STREQUAL "B") + math(EXPR _decimal "${_decimal} + 11") + elseif (_digit STREQUAL "C") + math(EXPR _decimal "${_decimal} + 12") + elseif (_digit STREQUAL "D") + math(EXPR _decimal "${_decimal} + 13") + elseif (_digit STREQUAL "E") + math(EXPR _decimal "${_decimal} + 14") + elseif (_digit STREQUAL "F") + math(EXPR _decimal "${_decimal} + 15") + else() + math(EXPR _decimal "${_decimal} + ${_digit}") + endif() + string(LENGTH "${_tail}" _tail_length) + endwhile() + set(${DECIMAL} ${_decimal} PARENT_SCOPE) +endfunction(hex_to_dec) + +# Version information +file(STRINGS "c/common/version.h" _brotli_version_line REGEX "^#define BROTLI_VERSION (0x[0-9a-fA-F]+)$") +string(REGEX REPLACE "^#define BROTLI_VERSION 0x([0-9a-fA-F]+)$" "\\1" _brotli_version_hex "${_brotli_version_line}") +hex_to_dec("${_brotli_version_hex}" _brotli_version) +math(EXPR BROTLI_VERSION_MAJOR "${_brotli_version} >> 24") +math(EXPR BROTLI_VERSION_MINOR "(${_brotli_version} >> 12) & 4095") +math(EXPR BROTLI_VERSION_PATCH "${_brotli_version} & 4095") +set(BROTLI_VERSION "${BROTLI_VERSION_MAJOR}.${BROTLI_VERSION_MINOR}.${BROTLI_VERSION_PATCH}") +mark_as_advanced(BROTLI_VERSION BROTLI_VERSION_MAJOR BROTLI_VERSION_MINOR BROTLI_VERSION_PATCH) + +# ABI Version information +file(STRINGS "c/common/version.h" _brotli_abi_info_line REGEX "^#define BROTLI_ABI_VERSION (0x[0-9a-fA-F]+)$") +string(REGEX REPLACE "^#define BROTLI_ABI_VERSION 0x([0-9a-fA-F]+)$" "\\1" _brotli_abi_info_hex "${_brotli_abi_info_line}") +hex_to_dec("${_brotli_abi_info_hex}" _brotli_abi_info) +math(EXPR BROTLI_ABI_CURRENT "${_brotli_abi_info} >> 24") +math(EXPR BROTLI_ABI_REVISION "(${_brotli_abi_info} >> 12) & 4095") +math(EXPR BROTLI_ABI_AGE "${_brotli_abi_info} & 4095") +math(EXPR BROTLI_ABI_COMPATIBILITY "${BROTLI_ABI_CURRENT} - ${BROTLI_ABI_AGE}") +mark_as_advanced(BROTLI_ABI_CURRENT BROTLI_ABI_REVISION BROTLI_ABI_AGE BROTLI_ABI_COMPATIBILITY) + +if (ENABLE_SANITIZER) + set(CMAKE_C_FLAGS " ${CMAKE_C_FLAGS} -fsanitize=${ENABLE_SANITIZER}") + set(CMAKE_CXX_FLAGS " ${CMAKE_CXX_FLAGS} -fsanitize=${ENABLE_SANITIZER}") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=${ENABLE_SANITIZER}") + + # By default, brotli depends on undefined behavior, but setting + # BROTLI_BUILD_PORTABLE should result in a build which does not. + if(ENABLE_SANITIZER STREQUAL "undefined") + add_definitions(-DBROTLI_BUILD_PORTABLE) + endif() +endif () + +include(CheckFunctionExists) +set(LIBM_LIBRARY) +CHECK_FUNCTION_EXISTS(log2 LOG2_RES) +if(NOT LOG2_RES) + set(orig_req_libs "${CMAKE_REQUIRED_LIBRARIES}") + set(CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES};m") + CHECK_FUNCTION_EXISTS(log2 LOG2_LIBM_RES) + if(LOG2_LIBM_RES) + set(LIBM_LIBRARY "m") + add_definitions(-DBROTLI_HAVE_LOG2=1) + else() + add_definitions(-DBROTLI_HAVE_LOG2=0) + endif() + + set(CMAKE_REQUIRED_LIBRARIES "${orig_req_libs}") + unset(LOG2_LIBM_RES) + unset(orig_req_libs) +else() + add_definitions(-DBROTLI_HAVE_LOG2=1) +endif() +unset(LOG2_RES) + +set(BROTLI_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/c/include") +mark_as_advanced(BROTLI_INCLUDE_DIRS) + +set(BROTLI_LIBRARIES_CORE brotlienc brotlidec brotlicommon) +set(BROTLI_LIBRARIES ${BROTLI_LIBRARIES_CORE} ${LIBM_LIBRARY}) +mark_as_advanced(BROTLI_LIBRARIES) + +set(BROTLI_LIBRARIES_CORE_STATIC brotlienc-static brotlidec-static brotlicommon-static) +set(BROTLI_LIBRARIES_STATIC ${BROTLI_LIBRARIES_CORE_STATIC} ${LIBM_LIBRARY}) +mark_as_advanced(BROTLI_LIBRARIES_STATIC) + +if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") + add_definitions(-DOS_LINUX) +elseif(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") + add_definitions(-DOS_FREEBSD) +elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + add_definitions(-DOS_MACOSX) +endif() + +function(transform_sources_list INPUT_FILE OUTPUT_FILE) + file(READ ${INPUT_FILE} TEXT) + string(REGEX REPLACE "\\\\\n" "~continuation~" TEXT ${TEXT}) + string(REGEX REPLACE "([a-zA-Z_][a-zA-Z0-9_]*)[\t ]*=[\t ]*([^\n]*)" "SET(\\1 \\2)" TEXT ${TEXT}) + string(REPLACE "~continuation~" "\n" TEXT ${TEXT}) + file(WRITE ${OUTPUT_FILE} ${TEXT}) +endfunction() + +transform_sources_list("scripts/sources.lst" "${CMAKE_CURRENT_BINARY_DIR}/sources.lst.cmake") +include("${CMAKE_CURRENT_BINARY_DIR}/sources.lst.cmake") + +if(BROTLI_EMSCRIPTEN OR BROTLI_RISCV) + set(BROTLI_SHARED_LIBS "") +else() + set(BROTLI_SHARED_LIBS brotlicommon brotlidec brotlienc) + add_library(brotlicommon SHARED ${BROTLI_COMMON_C}) + add_library(brotlidec SHARED ${BROTLI_DEC_C}) + add_library(brotlienc SHARED ${BROTLI_ENC_C}) +endif() + +set(BROTLI_STATIC_LIBS brotlicommon-static brotlidec-static brotlienc-static) +add_library(brotlicommon-static STATIC ${BROTLI_COMMON_C}) +add_library(brotlidec-static STATIC ${BROTLI_DEC_C}) +add_library(brotlienc-static STATIC ${BROTLI_ENC_C}) + +# Older CMake versions does not understand INCLUDE_DIRECTORIES property. +include_directories(${BROTLI_INCLUDE_DIRS}) + +foreach(lib IN LISTS BROTLI_SHARED_LIBS) + target_compile_definitions(${lib} PUBLIC "BROTLI_SHARED_COMPILATION" ) + string(TOUPPER "${lib}" LIB) + set_target_properties (${lib} PROPERTIES DEFINE_SYMBOL "${LIB}_SHARED_COMPILATION") +endforeach() + +foreach(lib IN LISTS BROTLI_SHARED_LIBS BROTLI_STATIC_LIBS) + target_link_libraries(${lib} ${LIBM_LIBRARY}) + set_property(TARGET ${lib} APPEND PROPERTY INCLUDE_DIRECTORIES ${BROTLI_INCLUDE_DIRS}) + set_target_properties(${lib} PROPERTIES + VERSION "${BROTLI_ABI_COMPATIBILITY}.${BROTLI_ABI_AGE}.${BROTLI_ABI_REVISION}" + SOVERSION "${BROTLI_ABI_COMPATIBILITY}") + if(NOT BROTLI_EMSCRIPTEN) + set_target_properties(${lib} PROPERTIES POSITION_INDEPENDENT_CODE TRUE) + endif() + set_property(TARGET ${lib} APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${BROTLI_INCLUDE_DIRS}") +endforeach() + +if(NOT (BROTLI_EMSCRIPTEN AND BROTLI_RISCV)) +target_link_libraries(brotlidec brotlicommon) +target_link_libraries(brotlienc brotlicommon) +endif() + +target_link_libraries(brotlidec-static brotlicommon-static) +target_link_libraries(brotlienc-static brotlicommon-static) + +# For projects stuck on older versions of CMake, this will set the +# BROTLI_INCLUDE_DIRS and BROTLI_LIBRARIES variables so they still +# have a relatively easy way to use Brotli: +# +# include_directories(${BROTLI_INCLUDE_DIRS}) +# target_link_libraries(foo ${BROTLI_LIBRARIES}) +if(BROTLI_PARENT_DIRECTORY) + set(BROTLI_INCLUDE_DIRS "${BROTLI_INCLUDE_DIRS}" PARENT_SCOPE) + set(BROTLI_LIBRARIES "${BROTLI_LIBRARIES}" PARENT_SCOPE) +endif() + +# Build the brotli executable +if(NOT BROTLI_RISCV) + add_executable(brotli ${BROTLI_CLI_C}) + target_link_libraries(brotli ${BROTLI_LIBRARIES_STATIC}) +endif() + +# Installation +if(NOT BROTLI_BUNDLED_MODE) + if(NOT BROTLI_RISCV) + install( + TARGETS brotli + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" + ) + endif() + + if(NOT (BROTLI_EMSCRIPTEN AND BROTLI_RISCV)) + install( + TARGETS ${BROTLI_LIBRARIES_CORE} + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" + ) + endif() # BROTLI_EMSCRIPTEN + + install( + TARGETS ${BROTLI_LIBRARIES_CORE_STATIC} + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" + ) + + install( + DIRECTORY ${BROTLI_INCLUDE_DIRS}/brotli + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" + ) +endif() # BROTLI_BUNDLED_MODE + +# Tests + +# If we're targeting Windows but not running on Windows, we need Wine +# to run the tests... +if(NOT BROTLI_DISABLE_TESTS) + if(WIN32 AND NOT CMAKE_HOST_WIN32) + find_program(BROTLI_WRAPPER NAMES wine) + + if(NOT BROTLI_WRAPPER) + message(STATUS "wine not found, disabling tests") + set(BROTLI_DISABLE_TESTS TRUE) + endif() + endif() +endif() + +# If our compiler is a cross-compiler that we know about (arm/aarch64), +# then we need to use qemu to execute the tests. +if(NOT BROTLI_DISABLE_TESTS) + if ("${CMAKE_C_COMPILER}" MATCHES "^.*/arm-linux-gnueabihf-.*$") + message(STATUS "Detected arm-linux-gnueabihf cross-compilation") + set(BROTLI_WRAPPER "qemu-arm") + set(BROTLI_WRAPPER_LD_PREFIX "/usr/arm-linux-gnueabihf") + endif() + + if ("${CMAKE_C_COMPILER}" MATCHES "^.*/arm-linux-gnueabi-.*$") + message(STATUS "Detected arm-linux-gnueabi cross-compilation") + set(BROTLI_WRAPPER "qemu-arm") + set(BROTLI_WRAPPER_LD_PREFIX "/usr/arm-linux-gnueabi") + endif() + + if ("${CMAKE_C_COMPILER}" MATCHES "^.*/aarch64-linux-gnu-.*$") + message(STATUS "Detected aarch64-linux-gnu cross-compilation") + set(BROTLI_WRAPPER "qemu-aarch64") + set(BROTLI_WRAPPER_LD_PREFIX "/usr/aarch64-linux-gnu") + endif() +endif() + +if(NOT BROTLI_DISABLE_TESTS) + include(CTest) + enable_testing() + + set(ROUNDTRIP_INPUTS + tests/testdata/alice29.txt + tests/testdata/asyoulik.txt + tests/testdata/lcet10.txt + tests/testdata/plrabn12.txt + c/enc/encode.c + c/common/dictionary.h + c/dec/decode.c) + + foreach(INPUT ${ROUNDTRIP_INPUTS}) + get_filename_component(OUTPUT_NAME "${INPUT}" NAME) + + set(OUTPUT_FILE "${CMAKE_CURRENT_BINARY_DIR}/${OUTPUT_NAME}") + set(INPUT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/${INPUT}") + + if (EXISTS "${INPUT_FILE}") + foreach(quality 1 6 9 11) + add_test(NAME "${BROTLI_TEST_PREFIX}roundtrip/${INPUT}/${quality}" + COMMAND "${CMAKE_COMMAND}" + -DBROTLI_WRAPPER=${BROTLI_WRAPPER} + -DBROTLI_WRAPPER_LD_PREFIX=${BROTLI_WRAPPER_LD_PREFIX} + -DBROTLI_CLI=$ + -DQUALITY=${quality} + -DINPUT=${INPUT_FILE} + -DOUTPUT=${OUTPUT_FILE}.${quality} + -P ${CMAKE_CURRENT_SOURCE_DIR}/tests/run-roundtrip-test.cmake) + endforeach() + else() + message(WARNING "Test file ${INPUT} does not exist.") + endif() + endforeach() + + file(GLOB_RECURSE + COMPATIBILITY_INPUTS + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + tests/testdata/*.compressed*) + + foreach(INPUT ${COMPATIBILITY_INPUTS}) + add_test(NAME "${BROTLI_TEST_PREFIX}compatibility/${INPUT}" + COMMAND "${CMAKE_COMMAND}" + -DBROTLI_WRAPPER=${BROTLI_WRAPPER} + -DBROTLI_WRAPPER_LD_PREFIX=${BROTLI_WRAPPER_LD_PREFIX} + -DBROTLI_CLI=$ + -DINPUT=${CMAKE_CURRENT_SOURCE_DIR}/${INPUT} + -P ${CMAKE_CURRENT_SOURCE_DIR}/tests/run-compatibility-test.cmake) + endforeach() +endif() + +# Generate a pkg-config files + +function(generate_pkg_config_path outvar path) + string(LENGTH "${path}" path_length) + + set(path_args ${ARGV}) + list(REMOVE_AT path_args 0 1) + list(LENGTH path_args path_args_remaining) + + set("${outvar}" "${path}") + + while(path_args_remaining GREATER 1) + list(GET path_args 0 name) + list(GET path_args 1 value) + + get_filename_component(value_full "${value}" ABSOLUTE) + string(LENGTH "${value}" value_length) + + if(path_length EQUAL value_length AND path STREQUAL value) + set("${outvar}" "\${${name}}") + break() + elseif(path_length GREATER value_length) + # We might be in a subdirectory of the value, but we have to be + # careful about a prefix matching but not being a subdirectory + # (for example, /usr/lib64 is not a subdirectory of /usr/lib). + # We'll do this by making sure the next character is a directory + # separator. + string(SUBSTRING "${path}" ${value_length} 1 sep) + if(sep STREQUAL "/") + string(SUBSTRING "${path}" 0 ${value_length} s) + if(s STREQUAL value) + string(SUBSTRING "${path}" "${value_length}" -1 suffix) + set("${outvar}" "\${${name}}${suffix}") + break() + endif() + endif() + endif() + + list(REMOVE_AT path_args 0 1) + list(LENGTH path_args path_args_remaining) + endwhile() + + set("${outvar}" "${${outvar}}" PARENT_SCOPE) +endfunction(generate_pkg_config_path) + +function(transform_pc_file INPUT_FILE OUTPUT_FILE VERSION) + file(READ ${INPUT_FILE} TEXT) + + set(PREFIX "${CMAKE_INSTALL_PREFIX}") + string(REGEX REPLACE "@prefix@" "${PREFIX}" TEXT ${TEXT}) + string(REGEX REPLACE "@exec_prefix@" "${PREFIX}" TEXT ${TEXT}) + + generate_pkg_config_path(LIBDIR "${CMAKE_INSTALL_FULL_LIBDIR}" prefix "${PREFIX}") + string(REGEX REPLACE "@libdir@" "${LIBDIR}" TEXT ${TEXT}) + + generate_pkg_config_path(INCLUDEDIR "${CMAKE_INSTALL_FULL_INCLUDEDIR}" prefix "${PREFIX}") + string(REGEX REPLACE "@includedir@" "${INCLUDEDIR}" TEXT ${TEXT}) + + string(REGEX REPLACE "@PACKAGE_VERSION@" "${VERSION}" TEXT ${TEXT}) + + file(WRITE ${OUTPUT_FILE} ${TEXT}) +endfunction() + +transform_pc_file("scripts/libbrotlicommon.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/libbrotlicommon.pc" "${BROTLI_VERSION}") + +transform_pc_file("scripts/libbrotlidec.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/libbrotlidec.pc" "${BROTLI_VERSION}") + +transform_pc_file("scripts/libbrotlienc.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/libbrotlienc.pc" "${BROTLI_VERSION}") + +if(NOT BROTLI_BUNDLED_MODE) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libbrotlicommon.pc" + DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libbrotlidec.pc" + DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libbrotlienc.pc" + DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") +endif() # BROTLI_BUNDLED_MODE + +if (ENABLE_COVERAGE STREQUAL "yes") + SETUP_TARGET_FOR_COVERAGE(coverage test coverage) +endif () diff --git a/crates/sp1/build.sh b/crates/sp1/build.sh new file mode 100755 index 0000000000..4dc73d115c --- /dev/null +++ b/crates/sp1/build.sh @@ -0,0 +1,67 @@ +#!/usr/bin/env bash + +set -ex + +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +export TOP=$SCRIPT_DIR/../.. + +cd "$TOP" + +# Download RISC-V C toolchain if needed +if [ ! -d "$HOME/.sp1/riscv" ]; then + # Force reinstallation of sp1up, so we can pickup latest sp1up updates for rv64im toolchain + curl -L https://sp1up.succinct.xyz | bash + "$HOME"/.sp1/bin/sp1up -c + + echo "Testing riscv64-unknown-elf-gcc..." + "$HOME"/.sp1/riscv/bin/riscv64-unknown-elf-gcc --version +fi + +# Build brotli for SP1 +cp crates/sp1/brotli_cmake_patch.txt brotli/CMakeLists.txt +rm -rf target/build-sp1/brotli target/lib-sp1 +mkdir -p target/build-sp1/brotli +cd target/build-sp1/brotli +cmake -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \ + -DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY \ + -DCMAKE_SYSTEM_NAME=Generic \ + -DCMAKE_C_COMPILER="$HOME"/.sp1/riscv/bin/riscv64-unknown-elf-gcc \ + -DCMAKE_C_FLAGS="-march=rv64im -mabi=lp64 -DBROTLI_BUILD_PORTABLE -mcmodel=medany -ffunction-sections -fdata-sections -fPIC" \ + -DCMAKE_AR="$HOME"/.sp1/riscv/bin/riscv64-unknown-elf-ar \ + -DCMAKE_RANLIB="$HOME"/.sp1/riscv/bin/riscv64-unknown-elf-ranlib \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX="$TOP"/target/lib-sp1 \ + -DBROTLI_DISABLE_TESTS=ON \ + "$TOP"/brotli +make +make install +cd "$TOP" + +# Build nitro dependencies +make build-replay-env test-go-deps +rm -rf target/sp1 +mkdir -p target/sp1 +export OUTPUT_DIR=$TOP/target/sp1 +# Build replay.wasm, but with SP1 optimizations +GOOS=wasip1 GOARCH=wasm go build -tags sp1 -o "$OUTPUT_DIR"/replay.wasm "$TOP"/cmd/replay/... +# Build a sample Arbitrum test block +rm -rf system_tests/test-data +go test -run TestProgramStorage ./system_tests/ -- \ + -recordBlockInputs.WithBaseDir="$(pwd)"/system_tests/test-data \ + -recordBlockInputs.WithTimestampDirEnabled=false \ + -recordBlockInputs.enable=true +cp system_tests/test-data/TestProgramStorage/*.json target/sp1/ + +cd "$SCRIPT_DIR" +# Bump SP1's maximum heap memory size +export SP1_ZKVM_MAX_MEMORY=1099511627776 +# Build SP1 program and run bootloading process +cargo run --release -p sp1-builder -- --replay-wasm "$OUTPUT_DIR"/replay.wasm --output-folder "$OUTPUT_DIR" +# Build the SP1 runner +cargo build --release -p sp1-runner + +# Copy relevant files to target folder +cp "$TOP/target/elf-compilation/riscv64im-succinct-zkvm-elf/release/stylus-compiler-program" "$OUTPUT_DIR" +cp "$TOP/target/release/sp1-runner" "$OUTPUT_DIR" + +echo "SP1 runner is successfully built!" diff --git a/crates/sp1/builder/Cargo.toml b/crates/sp1/builder/Cargo.toml new file mode 100644 index 0000000000..3431bc13f5 --- /dev/null +++ b/crates/sp1/builder/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "sp1-builder" +description = "A builder crate that builds SP1 programs, necessary metadata, then run bootloader to generated bootloaded SP1 program" +version = "0.1.0" +edition = "2024" + +[dependencies] +sp1-core-executor = { workspace = true } +sp1-sdk = { workspace = true } + +clap = { workspace = true, features = ["cargo", "derive"] } +serde_json = { workspace = true } +wasmer = { workspace = true, features = ["llvm"] } +wasmparser = { workspace = true } + +[build-dependencies] +sp1-build = { workspace = true } diff --git a/crates/sp1/builder/build.rs b/crates/sp1/builder/build.rs new file mode 100644 index 0000000000..b838b9c2bb --- /dev/null +++ b/crates/sp1/builder/build.rs @@ -0,0 +1,4 @@ +fn main() { + sp1_build::build_program("../stylus-compiler-program"); + sp1_build::build_program("../program"); +} diff --git a/crates/sp1/builder/src/main.rs b/crates/sp1/builder/src/main.rs new file mode 100644 index 0000000000..0636db6e23 --- /dev/null +++ b/crates/sp1/builder/src/main.rs @@ -0,0 +1,136 @@ +use std::{collections::HashMap, path::PathBuf, str::FromStr, sync::Arc}; + +use clap::Parser; +use sp1_core_executor::{MinimalExecutor, Program}; +use sp1_sdk::{Elf, include_elf}; +use wasmer::{ + Module, Store, + sys::{CpuFeature, EngineBuilder, LLVM, Target, Triple}, +}; + +pub const PROGRAM_ELF: Elf = include_elf!("program"); + +#[derive(Debug, Parser)] +#[command(version, about, long_about = None)] +struct Cli { + /// Path to replay.wasm file + #[arg(long)] + replay_wasm: String, + + /// Output folder for generated artifacts + #[arg(long)] + output_folder: PathBuf, +} + +fn main() { + let cli = Cli::parse(); + let wasm = std::fs::read(&cli.replay_wasm).expect("read replay.wasm"); + + // Step 1: given wasm file, extract the original function names. + // This information is lost in wasmer's generated binary, but the + // function names can be very useful in debugging & profiling. + let function_names_json = { + use wasmparser::{BinaryReader, Name, NameSectionReader, Parser, Payload}; + + let mut name_mapping = HashMap::new(); + for payload in Parser::new(0).parse_all(&wasm) { + match payload { + Ok(Payload::CustomSection(s)) if s.name() == "name" => { + let name_reader = + NameSectionReader::new(BinaryReader::new(s.data(), s.data_offset())); + for name in name_reader { + if let Name::Function(name_map) = name.expect("name") { + for naming in name_map { + let naming = naming.expect("naming"); + name_mapping.insert(naming.index, naming.name.to_string()); + } + } + } + } + _ => (), + } + } + + // names might be sparse, we need more processing work here. + let min_index = name_mapping.keys().copied().min().unwrap(); + let name_mapping: Vec<(usize, String)> = name_mapping + .into_iter() + .map(|(index, name)| ((index - min_index) as usize, name)) + .collect(); + let mut names = vec![None; name_mapping.iter().max_by_key(|(i, _)| i).unwrap().0 + 1]; + for (i, name) in name_mapping { + names[i] = Some(name); + } + + let names_json = serde_json::to_string_pretty(&names).expect("serde_json"); + + let output = cli.output_folder.join("function_names.json"); + println!("Write wasm function names to {}", output.display()); + std::fs::write(output, &names_json).expect("write function_names.json"); + + names_json + }; + + // Step 2: build wasmu (riscv64 target) file from replay.wasm, + // using wasmer's LLVM compiler. + let wasmu_binary = { + let target = Target::new(Triple::from_str("riscv64").unwrap(), CpuFeature::set()); + let config = LLVM::new(); + let engine = EngineBuilder::new(config).set_target(Some(target)).engine(); + + let store = Store::new(engine); + let module = Module::new(&store, wasm).expect("wasm compilation"); + let wasmu_binary = module.serialize().expect("serialize module"); + + let output = cli.output_folder.join("replay.wasmu"); + println!("Compile {} to {}", cli.replay_wasm, output.display()); + std::fs::write(output, &wasmu_binary).expect("write replay.wasmu"); + + wasmu_binary + }; + + // Step 3: use generated data from previous steps to bootload SP1 program. + { + sp1_sdk::utils::setup_logger(); + + let output = match std::env::var("DUMP_ELF_OUTPUT") { + Ok(s) => s, + Err(_) => { + let output = cli.output_folder.join("dumped_replay_wasm.elf"); + unsafe { std::env::set_var("DUMP_ELF_OUTPUT", &output) }; + output.display().to_string() + } + }; + let _ = std::fs::remove_file(&output); + assert!(!std::fs::exists(&output).unwrap()); + + let program = Arc::new(Program::from(&PROGRAM_ELF).expect("parse elf")); + let mut executor = MinimalExecutor::simple(program); + executor.with_input(&wasmu_binary); + executor.with_input(function_names_json.as_bytes()); + // The executed program expects an Arbitrum block, sending it an + // empty buffer would fail. However, it does not matter here, since + // all we need to do is the bootloading process, which should finish + // before reading this input. + executor.with_input(&[]); + + // The executor will fail after bootloading completes because + // the empty input buffer cannot be parsed as an Arbitrum block. + // This is expected — we only need the bootloading side-effect (ELF dump). + let _ = executor.execute_chunk(); + + if let Ok(true) = std::fs::exists(&output) { + println!("SP1 bootloading process completed successfully."); + } else { + panic!( + "SP1 bootloading failed: expected output at '{}' was not produced. \ + Check logs above for the root cause.", + output + ); + } + + println!("Bootloaded program is written to {}", output); + } + + println!("All build processes are completed!"); +} diff --git a/crates/sp1/program/Cargo.toml b/crates/sp1/program/Cargo.toml new file mode 100644 index 0000000000..7731068e64 --- /dev/null +++ b/crates/sp1/program/Cargo.toml @@ -0,0 +1,29 @@ +[package] +name = "program" +description = "Initial SP1 program for validating Arbitrum blocks, it will be bootloaded for optimizations." +version = "0.1.0" +edition = "2024" + +[dependencies] +arbutil = { workspace = true } +caller-env = { workspace = true, features = ["brotli"] } +prover = { workspace = true, features = ["native"] } +sp1-zkvm = { workspace = true } +validation = { workspace = true, features = ["rkyv"] } +wasmer = { workspace = true, features = ["sys", "compiler", "singlepass", "wasmparser"] } +wasmer-types = { workspace = true } +wasmer-vm = { workspace = true, features = ["force-baremetal"] } + +bytes = { workspace = true } +corosensei = { workspace = true } +eyre = { workspace = true } +hex = { workspace = true } +num-traits = { workspace = true } +once_cell = { workspace = true } +rand_pcg = { workspace = true } +rand = { workspace = true } +ruint2 = { workspace = true } +secp256k1 = { workspace = true, features = ["recovery", "global-context"] } +serde_json = { workspace = true } +thiserror = { workspace = true } +tiny-keccak = { workspace = true, features = ["keccak"] } diff --git a/crates/sp1/program/src/imports/arbcompress.rs b/crates/sp1/program/src/imports/arbcompress.rs new file mode 100644 index 0000000000..541313977f --- /dev/null +++ b/crates/sp1/program/src/imports/arbcompress.rs @@ -0,0 +1,55 @@ +//! This module implements arbcompression functions required by Arbitrum. + +use wasmer::FunctionEnvMut; + +use crate::{ + Escape, Ptr, + replay::CustomEnvData, + state::{gp, sp1_env}, +}; + +pub fn brotli_compress( + mut ctx: FunctionEnvMut, + in_buf_ptr: Ptr, + in_buf_len: u32, + out_buf_ptr: Ptr, + out_len_ptr: Ptr, + level: u32, + window_size: u32, + dictionary: u8, +) -> Result { + let (mut mem, state) = sp1_env(&mut ctx); + Ok(caller_env::brotli::brotli_compress( + &mut mem, + state, + gp(in_buf_ptr), + in_buf_len, + gp(out_buf_ptr), + gp(out_len_ptr), + level, + window_size, + dictionary.try_into().expect("unknown dictionary"), + ) + .into()) +} + +pub fn brotli_decompress( + mut ctx: FunctionEnvMut, + in_buf_ptr: Ptr, + in_buf_len: u32, + out_buf_ptr: Ptr, + out_len_ptr: Ptr, + dictionary: u8, +) -> Result { + let (mut mem, state) = sp1_env(&mut ctx); + Ok(caller_env::brotli::brotli_decompress( + &mut mem, + state, + gp(in_buf_ptr), + in_buf_len, + gp(out_buf_ptr), + gp(out_len_ptr), + dictionary.try_into().expect("unknown dictionary"), + ) + .into()) +} diff --git a/crates/sp1/program/src/imports/debug.rs b/crates/sp1/program/src/imports/debug.rs new file mode 100644 index 0000000000..7adf5a7556 --- /dev/null +++ b/crates/sp1/program/src/imports/debug.rs @@ -0,0 +1,44 @@ +use prover::value::Value; +use wasmer::FunctionEnvMut; + +use crate::{Escape, MaybeEscape, Ptr, read_slice, stylus::StylusCustomEnvData}; + +pub fn console_log_text( + mut ctx: FunctionEnvMut, + ptr: Ptr, + len: u32, +) -> MaybeEscape { + let (data, store) = ctx.data_and_store_mut(); + let memory = data.memory.clone().unwrap().view(&store); + + let text = read_slice(ptr, len as usize, &memory)?; + println!("Stylus says: {}", String::from_utf8_lossy(&text)); + Ok(()) +} + +pub fn console_log>( + _ctx: FunctionEnvMut, + value: T, +) -> MaybeEscape { + let value = value.into(); + println!("Stylus says: {}", value); + Ok(()) +} + +pub fn console_tee + Copy>( + _ctx: FunctionEnvMut, + value: T, +) -> Result { + println!("Stylus says: {}", value.into()); + Ok(value) +} + +pub fn null_host(_ctx: FunctionEnvMut) {} + +pub fn start_benchmark(_ctx: FunctionEnvMut) -> MaybeEscape { + unimplemented!("start_benchmark is not implemented in debug host imports") +} + +pub fn end_benchmark(_ctx: FunctionEnvMut) -> MaybeEscape { + unimplemented!("end_benchmark is not implemented in debug host imports") +} diff --git a/crates/sp1/program/src/imports/mod.rs b/crates/sp1/program/src/imports/mod.rs new file mode 100644 index 0000000000..49e7245f59 --- /dev/null +++ b/crates/sp1/program/src/imports/mod.rs @@ -0,0 +1,13 @@ +//! All wasmer import functions +//! +//! TODO: many of the implementations here, are reimplementing the same +//! functions from jit & prover modules. Maybe we should revisit the code +//! and see if we can merge multiple implementations into one. + +pub mod arbcompress; +pub mod debug; +pub mod precompiles; +pub mod programs; +pub mod vm_hooks; +pub mod wasi_stub; +pub mod wavmio; diff --git a/crates/sp1/program/src/imports/precompiles.rs b/crates/sp1/program/src/imports/precompiles.rs new file mode 100644 index 0000000000..950f7e0623 --- /dev/null +++ b/crates/sp1/program/src/imports/precompiles.rs @@ -0,0 +1,69 @@ +use secp256k1::{ + Message, + ecdsa::{RecoverableSignature, RecoveryId}, +}; +use wasmer::FunctionEnvMut; + +use crate::{Escape, MaybeEscape, Ptr, keccak, platform, read_slice, replay::CustomEnvData}; + +pub fn ecrecover( + mut ctx: FunctionEnvMut, + hash: Ptr, + hash_len: u32, + sig: Ptr, + sig_len: u32, + output: Ptr, +) -> Result { + assert_eq!(hash_len, 32, "Hash length must be 32 bytes"); + assert_eq!( + sig_len, 65, + "Signature length must be 65 bytes (64 for signature + 1 for recovery id)" + ); + + let (data, store) = ctx.data_and_store_mut(); + let memory = data.memory.clone().unwrap().view(&store); + + let hash = read_slice(hash, 32, &memory)?; + let sig = read_slice(sig, 65, &memory)?; + + let message = Message::from_digest(hash.try_into().unwrap()); + let Ok(recovery_id) = RecoveryId::try_from(sig[64] as i32) else { + return Ok(1); + }; + let Ok(signature) = RecoverableSignature::from_compact(&sig[0..64], recovery_id) else { + return Ok(2); + }; + + let Ok(public_key) = signature.recover(&message) else { + return Ok(3); + }; + let serialized_pub_key = public_key.serialize_uncompressed(); + + memory.write(output.offset() as u64, &serialized_pub_key)?; + Ok(0) +} + +pub fn keccak256( + mut ctx: FunctionEnvMut, + input: Ptr, + input_length: u32, + output: Ptr, +) -> MaybeEscape { + let (data, store) = ctx.data_and_store_mut(); + let memory = data.memory.clone().unwrap().view(&store); + + let input = read_slice(input, input_length as usize, &memory)?; + let hash = keccak(input); + memory.write(output.offset() as u64, &hash)?; + + Ok(()) +} + +pub fn dump_elf(mut ctx: FunctionEnvMut) -> MaybeEscape { + let data = ctx.data_mut(); + assert!(!data.input_initialized()); + + platform::dump_elf(); + + Ok(()) +} diff --git a/crates/sp1/program/src/imports/programs.rs b/crates/sp1/program/src/imports/programs.rs new file mode 100644 index 0000000000..68c455623a --- /dev/null +++ b/crates/sp1/program/src/imports/programs.rs @@ -0,0 +1,321 @@ +//! This module should implement programs related APIs, mainly for +//! launching stylus programs. +//! TODO: for now, we are focusing on getting replay.wasm to run first, +//! so this module only contains dummy impls that serve as a placeholder, +//! and will throw errors when called. +//! They are expected to follow implementations in: +//! https://github.com/OffchainLabs/nitro/blob/d2dba175c037c47e68cf3038f0d4b06b54983644/arbitrator/jit/src/program.rs + +use arbutil::evm::{EvmData, api::Gas}; +use prover::programs::config::{CompileConfig, PricingParams, StylusConfig}; +use wasmer::{FunctionEnvMut, WasmPtr}; + +use crate::{ + Escape, JitConfig, MaybeEscape, Ptr, read_bytes20, read_bytes32, read_slice, + replay::CustomEnvData, stylus::MessageToCothread, +}; + +/// Hardcoded message ID used by the Arbitrator protocol for program communication. +const ARBITRATOR_MSG_ID: u32 = 0x33333333; + +pub fn new_program( + mut ctx: FunctionEnvMut, + compiled_hash_ptr: Ptr, + calldata_ptr: Ptr, + calldata_size: u32, + stylus_config_handler: u64, + evm_data_handler: u64, + gas: u64, +) -> Result { + let (data, store) = ctx.data_and_store_mut(); + let memory = data.memory.clone().unwrap().view(&store); + + let compiled_hash = read_bytes32(compiled_hash_ptr, &memory)?; + let calldata = read_slice(calldata_ptr, calldata_size as usize, &memory)?; + let evm_data: EvmData = unsafe { *Box::from_raw(evm_data_handler as *mut EvmData) }; + let config: JitConfig = unsafe { *Box::from_raw(stylus_config_handler as *mut JitConfig) }; + + data.launch_program(&compiled_hash, calldata, config, evm_data, gas) +} + +pub fn pop(mut ctx: FunctionEnvMut) { + let data = ctx.data_mut(); + + // FIXME: this is wrong, when poping, we should yield from replay.wasm coroutine, and keep + // running the poped program till it sends the last message and terminates. + data.pop_last_program(); +} + +pub fn set_response( + mut ctx: FunctionEnvMut, + id: u32, + gas: u64, + result_ptr: Ptr, + result_len: u32, + raw_data_ptr: Ptr, + raw_data_len: u32, +) -> MaybeEscape { + let (data, store) = ctx.data_and_store_mut(); + let memory = data.memory.clone().unwrap().view(&store); + + // Arbitrator for now only uses hardcoded id, we can ignore + // ids safely. + assert_eq!(id, ARBITRATOR_MSG_ID); + + let result = read_slice(result_ptr, result_len as usize, &memory)?; + let raw_data = read_slice(raw_data_ptr, raw_data_len as usize, &memory)?; + + data.send_to_cothread(MessageToCothread { + result, + raw_data, + cost: Gas(gas), + }); + + Ok(()) +} + +pub fn get_request( + mut ctx: FunctionEnvMut, + id: u32, + len_ptr: Ptr, +) -> Result { + let (data, store) = ctx.data_and_store_mut(); + let memory = data.memory.clone().unwrap().view(&store); + + // Arbitrator for now only uses hardcoded id, we can ignore + // ids safely. + assert_eq!(id, ARBITRATOR_MSG_ID); + + let msg = data.get_last_msg(); + len_ptr.write(&memory, msg.req_data.len() as u32)?; + + Ok(msg.req_type) +} + +pub fn get_request_data( + mut ctx: FunctionEnvMut, + id: u32, + data_ptr: Ptr, +) -> MaybeEscape { + let (data, store) = ctx.data_and_store_mut(); + let memory = data.memory.clone().unwrap().view(&store); + + // Arbitrator for now only uses hardcoded id, we can ignore + // ids safely. + assert_eq!(id, ARBITRATOR_MSG_ID); + + let msg = data.get_last_msg(); + memory.write(data_ptr.offset() as u64, &msg.req_data)?; + + Ok(()) +} + +pub fn start_program(mut ctx: FunctionEnvMut, module: u32) -> u32 { + let data = ctx.data_mut(); + + data.wait_next_message(Some(module)); + let _ = data.get_last_msg(); + + // Arbitrator for now only uses hardcoded id, we can ignore + // ids safely. + ARBITRATOR_MSG_ID +} + +pub fn send_response(mut ctx: FunctionEnvMut, req_id: u32) -> u32 { + let data = ctx.data_mut(); + + // Arbitrator for now only uses hardcoded id, we can ignore + // ids safely. + assert_eq!(req_id, ARBITRATOR_MSG_ID); + + data.wait_next_message(None); + let _ = data.get_last_msg(); + + ARBITRATOR_MSG_ID +} + +pub fn create_stylus_config( + _ctx: FunctionEnvMut, + version: u16, + max_depth: u32, + ink_price: u32, + debug: u32, +) -> u64 { + let stylus = StylusConfig { + version, + max_depth, + pricing: PricingParams { ink_price }, + }; + let compile = CompileConfig::version(version, debug != 0); + let res = heapify(JitConfig { stylus, compile }); + res as u64 +} + +const DEFAULT_STYLUS_ARBOS_VERSION: u64 = 31; + +pub fn create_evm_data( + ctx: FunctionEnvMut, + block_basefee_ptr: Ptr, + chainid: u64, + block_coinbase_ptr: Ptr, + block_gas_limit: u64, + block_number: u64, + block_timestamp: u64, + contract_address_ptr: Ptr, + module_hash_ptr: Ptr, + msg_sender_ptr: Ptr, + msg_value_ptr: Ptr, + tx_gas_price_ptr: Ptr, + tx_origin_ptr: Ptr, + cached: u32, + reentrant: u32, +) -> Result { + create_evm_data_v2( + ctx, + DEFAULT_STYLUS_ARBOS_VERSION, + block_basefee_ptr, + chainid, + block_coinbase_ptr, + block_gas_limit, + block_number, + block_timestamp, + contract_address_ptr, + module_hash_ptr, + msg_sender_ptr, + msg_value_ptr, + tx_gas_price_ptr, + tx_origin_ptr, + cached, + reentrant, + ) +} + +pub fn create_evm_data_v2( + mut ctx: FunctionEnvMut, + arbos_version: u64, + block_basefee_ptr: Ptr, + chainid: u64, + block_coinbase_ptr: Ptr, + block_gas_limit: u64, + block_number: u64, + block_timestamp: u64, + contract_address_ptr: Ptr, + module_hash_ptr: Ptr, + msg_sender_ptr: Ptr, + msg_value_ptr: Ptr, + tx_gas_price_ptr: Ptr, + tx_origin_ptr: Ptr, + cached: u32, + reentrant: u32, +) -> Result { + let (data, store) = ctx.data_and_store_mut(); + let memory = data.memory.clone().unwrap().view(&store); + + let evm_data = EvmData { + arbos_version, + block_basefee: read_bytes32(block_basefee_ptr, &memory)?, + cached: cached != 0, + chainid, + block_coinbase: read_bytes20(block_coinbase_ptr, &memory)?, + block_gas_limit, + block_number, + block_timestamp, + contract_address: read_bytes20(contract_address_ptr, &memory)?, + module_hash: read_bytes32(module_hash_ptr, &memory)?, + msg_sender: read_bytes20(msg_sender_ptr, &memory)?, + msg_value: read_bytes32(msg_value_ptr, &memory)?, + tx_gas_price: read_bytes32(tx_gas_price_ptr, &memory)?, + tx_origin: read_bytes20(tx_origin_ptr, &memory)?, + reentrant, + return_data_len: 0, + tracing: false, + }; + + let res = heapify(evm_data); + Ok(res as u64) +} + +pub fn activate( + ctx: FunctionEnvMut, + wasm_ptr: Ptr, + wasm_size: u32, + pages_ptr: WasmPtr, + asm_estimate_ptr: Ptr, + init_cost_ptr: WasmPtr, + cached_init_cost_ptr: WasmPtr, + stylus_version: u16, + debug: u32, + codehash: Ptr, + module_hash_ptr: Ptr, + gas_ptr: WasmPtr, + err_buf: Ptr, + err_buf_len: u32, +) -> Result { + activate_v2( + ctx, + wasm_ptr, + wasm_size, + pages_ptr, + asm_estimate_ptr, + init_cost_ptr, + cached_init_cost_ptr, + stylus_version, + DEFAULT_STYLUS_ARBOS_VERSION, + debug, + codehash, + module_hash_ptr, + gas_ptr, + err_buf, + err_buf_len, + ) +} + +pub fn activate_v2( + _ctx: FunctionEnvMut, + _wasm_ptr: Ptr, + _wasm_size: u32, + _pages_ptr: WasmPtr, + _asm_estimate_ptr: Ptr, + _init_cost_ptr: WasmPtr, + _cached_init_cost_ptr: WasmPtr, + _stylus_version: u16, + _arbos_version_for_gas: u64, + _debug: u32, + _codehash: Ptr, + _module_hash_ptr: Ptr, + _gas_ptr: WasmPtr, + _err_buf: Ptr, + _err_buf_len: u32, +) -> Result { + // TODO: per offline discussion with the Arbitrum team, we will call + // into a separate WASM module to calculate WAVM hash for each stylus + // program. We won't aim to pull in WAVM logic here. + todo!("Implement activate_v2!"); +} + +fn heapify(value: T) -> *mut T { + Box::into_raw(Box::new(value)) +} + +/// program_requires_prepare +pub fn program_requires_prepare( + mut _env: FunctionEnvMut, + _module_hash_ptr: WasmPtr, +) -> Result { + Ok(0) +} + +/// program_prepare +pub fn program_prepare( + mut _env: FunctionEnvMut, + _wasm_ptr: WasmPtr, + _wasm_size: u64, + _module_hash_ptr: WasmPtr, + _code_hash_ptr: WasmPtr, + _max_wasm_size: u32, + _page_limit: u32, + _debug_mode: u32, + _stylus_version: u32, +) -> MaybeEscape { + Ok(()) +} diff --git a/crates/sp1/program/src/imports/vm_hooks.rs b/crates/sp1/program/src/imports/vm_hooks.rs new file mode 100644 index 0000000000..75d9f92793 --- /dev/null +++ b/crates/sp1/program/src/imports/vm_hooks.rs @@ -0,0 +1,734 @@ +use arbutil::{ + Bytes32, + evm::{ + ARBOS_VERSION_STYLUS_CHARGING_FIXES, COLD_ACCOUNT_GAS, COLD_SLOAD_GAS, SSTORE_SENTRY_GAS, + TLOAD_GAS, TSTORE_GAS, api::Gas, storage::StorageCache, user::UserOutcomeKind, + }, + pricing::{EVM_API_INK, hostio}, +}; +use eyre::eyre; +use prover::programs::meter::{GasMeteredMachine, MeteredMachine}; +use wasmer::{FunctionEnvMut, MemoryView}; + +use crate::{ + CallInputs, Escape, MaybeEscape, Ptr, keccak, read_bytes20, read_bytes32, read_slice, + stylus::StylusCustomEnvData, +}; + +pub fn msg_reentrant(mut ctx: FunctionEnvMut) -> Result { + let data = ctx.data_mut(); + data.buy_ink(hostio::MSG_REENTRANT_BASE_INK)?; + + Ok(data.evm_data.reentrant) +} + +pub fn read_args(mut ctx: FunctionEnvMut, ptr: Ptr) -> MaybeEscape { + let (data, store) = ctx.data_and_store_mut(); + let memory = data.memory.clone().unwrap().view(&store); + + data.buy_ink(hostio::READ_ARGS_BASE_INK)?; + data.pay_for_write(data.calldata.len() as u32)?; + + memory.write(ptr.offset() as u64, &data.calldata)?; + + Ok(()) +} + +pub fn storage_load_bytes32( + mut ctx: FunctionEnvMut, + key: Ptr, + dest: Ptr, +) -> MaybeEscape { + let (data, store) = ctx.data_and_store_mut(); + let memory = data.memory.clone().unwrap().view(&store); + + data.buy_ink(hostio::STORAGE_LOAD_BASE_INK)?; + + let arbos_version = data.evm_data.arbos_version; + let evm_api_gas_to_use = if arbos_version < ARBOS_VERSION_STYLUS_CHARGING_FIXES { + Gas(EVM_API_INK.0) + } else { + data.pricing().ink_to_gas(EVM_API_INK) + }; + data.require_gas(COLD_SLOAD_GAS + StorageCache::REQUIRED_ACCESS_GAS + evm_api_gas_to_use)?; + + let key = read_bytes32(key, &memory)?; + + let (value, gas_cost) = data.get_bytes32(key, evm_api_gas_to_use); + data.buy_gas(gas_cost)?; + memory.write(dest.offset() as u64, value.as_slice())?; + + Ok(()) +} + +pub fn transient_load_bytes32( + mut ctx: FunctionEnvMut, + key: Ptr, + dest: Ptr, +) -> MaybeEscape { + let (data, store) = ctx.data_and_store_mut(); + let memory = data.memory.clone().unwrap().view(&store); + + data.buy_ink(hostio::TRANSIENT_LOAD_BASE_INK)?; + data.buy_gas(TLOAD_GAS)?; + + let key = read_bytes32(key, &memory)?; + let value = data.get_transient_bytes32(key); + memory.write(dest.offset() as u64, value.as_slice())?; + + Ok(()) +} + +pub fn storage_cache_bytes32( + mut ctx: FunctionEnvMut, + key: Ptr, + value: Ptr, +) -> MaybeEscape { + let (data, store) = ctx.data_and_store_mut(); + let memory = data.memory.clone().unwrap().view(&store); + + data.buy_ink(hostio::STORAGE_CACHE_BASE_INK)?; + data.require_gas(SSTORE_SENTRY_GAS + StorageCache::REQUIRED_ACCESS_GAS)?; + + let key = read_bytes32(key, &memory)?; + let value = read_bytes32(value, &memory)?; + + let gas_cost = data.cache_bytes32(key, value); + data.buy_gas(gas_cost)?; + + Ok(()) +} + +pub fn transient_store_bytes32( + mut ctx: FunctionEnvMut, + key: Ptr, + value: Ptr, +) -> MaybeEscape { + let (data, store) = ctx.data_and_store_mut(); + let memory = data.memory.clone().unwrap().view(&store); + + data.buy_ink(hostio::TRANSIENT_STORE_BASE_INK)?; + data.buy_gas(TSTORE_GAS)?; + + let key = read_bytes32(key, &memory)?; + let value = read_bytes32(value, &memory)?; + + data.set_transient_bytes32(key, value)?; + + Ok(()) +} + +pub fn storage_flush_cache( + mut ctx: FunctionEnvMut, + clear: u32, +) -> MaybeEscape { + let data = ctx.data_mut(); + + data.buy_ink(hostio::STORAGE_FLUSH_BASE_INK)?; + data.require_gas(SSTORE_SENTRY_GAS)?; + + let gas_left = data.gas_left()?; + let (gas_cost, outcome) = data.flush_storage_cache(clear != 0, gas_left)?; + if data.evm_data.arbos_version >= ARBOS_VERSION_STYLUS_CHARGING_FIXES { + data.buy_gas(gas_cost)?; + } + if outcome != UserOutcomeKind::Success { + return Err(eyre!("outcome {outcome:?}").into()); + } + + Ok(()) +} + +pub fn write_result( + mut ctx: FunctionEnvMut, + ptr: Ptr, + len: u32, +) -> MaybeEscape { + let (data, store) = ctx.data_and_store_mut(); + let memory = data.memory.clone().unwrap().view(&store); + + data.buy_ink(hostio::WRITE_RESULT_BASE_INK)?; + data.pay_for_read(len)?; + data.pay_for_read(len)?; + + data.outs = read_slice(ptr, len as usize, &memory)?; + + Ok(()) +} + +pub fn pay_for_memory_grow( + mut ctx: FunctionEnvMut, + pages: u16, +) -> MaybeEscape { + let data = ctx.data_mut(); + + if pages == 0 { + data.buy_ink(hostio::PAY_FOR_MEMORY_GROW_BASE_INK)?; + return Ok(()); + } + let gas_cost = data.add_pages(pages); + data.buy_gas(gas_cost)?; + + Ok(()) +} + +pub fn exit_early(_ctx: FunctionEnvMut, status: u32) -> MaybeEscape { + Err(Escape::Exit(status)) +} + +pub fn call_contract( + mut ctx: FunctionEnvMut, + contract: Ptr, + data: Ptr, + data_len: u32, + value: Ptr, + gas: u64, + ret_len: Ptr, +) -> Result { + let (ctx_data, store) = ctx.data_and_store_mut(); + let memory = ctx_data.memory.clone().unwrap().view(&store); + + ctx_data.buy_ink(hostio::CALL_CONTRACT_BASE_INK)?; + ctx_data.pay_for_read(data_len)?; + ctx_data.pay_for_read(data_len)?; + + let CallInputs { + contract, + input, + gas_left, + gas_req, + value, + } = ctx_data.parse_call_inputs(&memory, contract, data, Gas(gas), data_len, Some(value))?; + + let (outs_len, gas_cost, status) = + ctx_data.contract_call(contract, &input, gas_left, gas_req, value.unwrap()); + + ctx_data.buy_gas(gas_cost)?; + ctx_data.evm_data.return_data_len = outs_len; + ret_len.write(&memory, outs_len)?; + + Ok(status as u8) +} + +pub fn delegate_call_contract( + mut ctx: FunctionEnvMut, + contract: Ptr, + data: Ptr, + data_len: u32, + gas: u64, + ret_len: Ptr, +) -> Result { + let (ctx_data, store) = ctx.data_and_store_mut(); + let memory = ctx_data.memory.clone().unwrap().view(&store); + + ctx_data.buy_ink(hostio::CALL_CONTRACT_BASE_INK)?; + ctx_data.pay_for_read(data_len)?; + ctx_data.pay_for_read(data_len)?; + + let CallInputs { + contract, + input, + gas_left, + gas_req, + .. + } = ctx_data.parse_call_inputs(&memory, contract, data, Gas(gas), data_len, None)?; + + let (outs_len, gas_cost, status) = ctx_data.delegate_call(contract, &input, gas_left, gas_req); + + ctx_data.buy_gas(gas_cost)?; + ctx_data.evm_data.return_data_len = outs_len; + ret_len.write(&memory, outs_len)?; + + Ok(status as u8) +} + +pub fn static_call_contract( + mut ctx: FunctionEnvMut, + contract: Ptr, + data: Ptr, + data_len: u32, + gas: u64, + ret_len: Ptr, +) -> Result { + let (ctx_data, store) = ctx.data_and_store_mut(); + let memory = ctx_data.memory.clone().unwrap().view(&store); + + ctx_data.buy_ink(hostio::CALL_CONTRACT_BASE_INK)?; + ctx_data.pay_for_read(data_len)?; + ctx_data.pay_for_read(data_len)?; + + let CallInputs { + contract, + input, + gas_left, + gas_req, + .. + } = ctx_data.parse_call_inputs(&memory, contract, data, Gas(gas), data_len, None)?; + + let (outs_len, gas_cost, status) = ctx_data.static_call(contract, &input, gas_left, gas_req); + + ctx_data.buy_gas(gas_cost)?; + ctx_data.evm_data.return_data_len = outs_len; + ret_len.write(&memory, outs_len)?; + + Ok(status as u8) +} + +pub fn create1( + mut ctx: FunctionEnvMut, + code: Ptr, + code_len: u32, + endowment: Ptr, + contract: Ptr, + revert_data_len: Ptr, +) -> MaybeEscape { + let (data, store) = ctx.data_and_store_mut(); + let memory = data.memory.clone().unwrap().view(&store); + + data.buy_ink(hostio::CREATE1_BASE_INK)?; + data.pay_for_read(code_len)?; + data.pay_for_read(code_len)?; + + let code = read_slice(code, code_len as usize, &memory)?; + let endowment = read_bytes32(endowment, &memory)?; + let gas = data.gas_left()?; + + let (result, ret_len, gas_cost) = data.create1(code, endowment, gas); + let result = result?; + + data.buy_gas(gas_cost)?; + data.evm_data.return_data_len = ret_len; + revert_data_len.write(&memory, ret_len)?; + memory.write(contract.offset() as u64, result.as_slice())?; + + Ok(()) +} + +pub fn create2( + mut ctx: FunctionEnvMut, + code: Ptr, + code_len: u32, + endowment: Ptr, + salt: Ptr, + contract: Ptr, + revert_data_len: Ptr, +) -> MaybeEscape { + let (data, store) = ctx.data_and_store_mut(); + let memory = data.memory.clone().unwrap().view(&store); + + data.buy_ink(hostio::CREATE2_BASE_INK)?; + data.pay_for_read(code_len)?; + data.pay_for_read(code_len)?; + + let code = read_slice(code, code_len as usize, &memory)?; + let endowment = read_bytes32(endowment, &memory)?; + let salt = read_bytes32(salt, &memory)?; + let gas = data.gas_left()?; + + let (result, ret_len, gas_cost) = data.create2(code, endowment, salt, gas); + let result = result?; + + data.buy_gas(gas_cost)?; + data.evm_data.return_data_len = ret_len; + revert_data_len.write(&memory, ret_len)?; + memory.write(contract.offset() as u64, result.as_slice())?; + + Ok(()) +} + +pub fn read_return_data( + mut ctx: FunctionEnvMut, + dest: Ptr, + offset: u32, + size: u32, +) -> Result { + let (data, store) = ctx.data_and_store_mut(); + let memory = data.memory.clone().unwrap().view(&store); + + data.buy_ink(hostio::READ_RETURN_DATA_BASE_INK)?; + + let max = data.evm_data.return_data_len.saturating_sub(offset); + data.pay_for_write(size.min(max))?; + if max == 0 { + return Ok(0); + } + + let ret_data = data.get_return_data(); + let out_slice = slice_with_runoff(&ret_data, offset, offset.saturating_add(size)); + + let out_len = out_slice.len() as u32; + if out_len > 0 { + memory.write(dest.offset() as u64, out_slice)?; + } + Ok(out_len) +} + +pub fn return_data_size(mut ctx: FunctionEnvMut) -> Result { + let data = ctx.data_mut(); + + data.buy_ink(hostio::RETURN_DATA_SIZE_BASE_INK)?; + Ok(data.evm_data.return_data_len) +} + +pub fn emit_log( + mut ctx: FunctionEnvMut, + log_data: Ptr, + len: u32, + topics: u32, +) -> MaybeEscape { + let (data, store) = ctx.data_and_store_mut(); + let memory = data.memory.clone().unwrap().view(&store); + + data.buy_ink(hostio::EMIT_LOG_BASE_INK)?; + if topics > 4 || len < topics * 32 { + return Err("bad topic data".to_string().into()); + } + data.pay_for_read(len)?; + data.pay_for_evm_log(topics, len - topics * 32)?; + + let log_data = read_slice(log_data, len as usize, &memory)?; + data.emit_log(log_data, topics) +} + +pub fn account_balance( + mut ctx: FunctionEnvMut, + address: Ptr, + ptr: Ptr, +) -> MaybeEscape { + let (data, store) = ctx.data_and_store_mut(); + let memory = data.memory.clone().unwrap().view(&store); + + data.buy_ink(hostio::ACCOUNT_BALANCE_BASE_INK)?; + data.require_gas(COLD_ACCOUNT_GAS)?; + let address = read_bytes20(address, &memory)?; + + let (balance, gas_cost) = data.account_balance(address); + data.buy_gas(gas_cost)?; + memory.write(ptr.offset() as u64, balance.as_slice())?; + + Ok(()) +} + +pub fn account_code( + mut ctx: FunctionEnvMut, + address: Ptr, + offset: u32, + size: u32, + dest: Ptr, +) -> Result { + let (data, store) = ctx.data_and_store_mut(); + let memory = data.memory.clone().unwrap().view(&store); + + data.buy_ink(hostio::ACCOUNT_CODE_BASE_INK)?; + data.require_gas(COLD_ACCOUNT_GAS)?; + let address = read_bytes20(address, &memory)?; + let gas = data.gas_left()?; + + let arbos_version = data.evm_data.arbos_version; + + let (code, gas_cost) = data.account_code(arbos_version, address, gas); + data.buy_gas(gas_cost)?; + + data.pay_for_write(code.len() as u32)?; + + let out_slice = slice_with_runoff(&code, offset, offset.saturating_add(size)); + let out_len = out_slice.len() as u32; + memory.write(dest.offset() as u64, out_slice)?; + + Ok(out_len) +} + +pub fn account_codehash( + mut ctx: FunctionEnvMut, + address: Ptr, + ptr: Ptr, +) -> MaybeEscape { + let (data, store) = ctx.data_and_store_mut(); + let memory = data.memory.clone().unwrap().view(&store); + + data.buy_ink(hostio::ACCOUNT_CODE_HASH_BASE_INK)?; + data.require_gas(COLD_ACCOUNT_GAS)?; + let address = read_bytes20(address, &memory)?; + + let (hash, gas_cost) = data.account_codehash(address); + data.buy_gas(gas_cost)?; + memory.write(ptr.offset() as u64, hash.as_slice())?; + + Ok(()) +} + +pub fn account_code_size( + mut ctx: FunctionEnvMut, + address: Ptr, +) -> Result { + let (data, store) = ctx.data_and_store_mut(); + let memory = data.memory.clone().unwrap().view(&store); + + data.buy_ink(hostio::ACCOUNT_CODE_SIZE_BASE_INK)?; + data.require_gas(COLD_ACCOUNT_GAS)?; + let address = read_bytes20(address, &memory)?; + let gas = data.gas_left()?; + + let arbos_version = data.evm_data.arbos_version; + + let (code, gas_cost) = data.account_code(arbos_version, address, gas); + data.buy_gas(gas_cost)?; + + Ok(code.len() as u32) +} + +pub fn evm_gas_left(mut ctx: FunctionEnvMut) -> Result { + let data = ctx.data_mut(); + + data.buy_ink(hostio::EVM_GAS_LEFT_BASE_INK)?; + Ok(data.gas_left()?.0) +} + +pub fn evm_ink_left(mut ctx: FunctionEnvMut) -> Result { + let data = ctx.data_mut(); + + data.buy_ink(hostio::EVM_INK_LEFT_BASE_INK)?; + Ok(data.ink_ready()?.0) +} + +pub fn block_basefee(mut ctx: FunctionEnvMut, ptr: Ptr) -> MaybeEscape { + let (data, store) = ctx.data_and_store_mut(); + let memory = data.memory.clone().unwrap().view(&store); + + data.buy_ink(hostio::BLOCK_BASEFEE_BASE_INK)?; + memory.write(ptr.offset() as u64, data.evm_data.block_basefee.as_slice())?; + + Ok(()) +} + +pub fn chainid(mut ctx: FunctionEnvMut) -> Result { + let data = ctx.data_mut(); + + data.buy_ink(hostio::CHAIN_ID_BASE_INK)?; + Ok(data.evm_data.chainid) +} + +pub fn block_coinbase(mut ctx: FunctionEnvMut, ptr: Ptr) -> MaybeEscape { + let (data, store) = ctx.data_and_store_mut(); + let memory = data.memory.clone().unwrap().view(&store); + + data.buy_ink(hostio::BLOCK_COINBASE_BASE_INK)?; + memory.write(ptr.offset() as u64, data.evm_data.block_coinbase.as_slice())?; + + Ok(()) +} + +pub fn block_gas_limit(mut ctx: FunctionEnvMut) -> Result { + let data = ctx.data_mut(); + + data.buy_ink(hostio::BLOCK_GAS_LIMIT_BASE_INK)?; + Ok(data.evm_data.block_gas_limit) +} + +pub fn block_number(mut ctx: FunctionEnvMut) -> Result { + let data = ctx.data_mut(); + + data.buy_ink(hostio::BLOCK_NUMBER_BASE_INK)?; + Ok(data.evm_data.block_number) +} + +pub fn block_timestamp(mut ctx: FunctionEnvMut) -> Result { + let data = ctx.data_mut(); + + data.buy_ink(hostio::BLOCK_TIMESTAMP_BASE_INK)?; + Ok(data.evm_data.block_timestamp) +} + +pub fn contract_address(mut ctx: FunctionEnvMut, ptr: Ptr) -> MaybeEscape { + let (data, store) = ctx.data_and_store_mut(); + let memory = data.memory.clone().unwrap().view(&store); + + data.buy_ink(hostio::ADDRESS_BASE_INK)?; + memory.write( + ptr.offset() as u64, + data.evm_data.contract_address.as_slice(), + )?; + + Ok(()) +} + +type U256 = ruint2::Uint<256, 4>; + +fn read_u256(ptr: Ptr, memory: &MemoryView) -> Result<(U256, Bytes32), Escape> { + let bytes = read_bytes32(ptr, memory)?; + Ok((bytes.into(), bytes)) +} + +pub fn math_div( + mut ctx: FunctionEnvMut, + value: Ptr, + divisor: Ptr, +) -> MaybeEscape { + let (data, store) = ctx.data_and_store_mut(); + let memory = data.memory.clone().unwrap().view(&store); + + data.buy_ink(hostio::MATH_DIV_BASE_INK)?; + let (a, _) = read_u256(value, &memory)?; + let (b, _) = read_u256(divisor, &memory)?; + + let result: Bytes32 = a.checked_div(b).unwrap_or_default().into(); + memory.write(value.offset() as u64, result.as_slice())?; + + Ok(()) +} + +pub fn math_mod( + mut ctx: FunctionEnvMut, + value: Ptr, + modulus: Ptr, +) -> MaybeEscape { + let (data, store) = ctx.data_and_store_mut(); + let memory = data.memory.clone().unwrap().view(&store); + + data.buy_ink(hostio::MATH_MOD_BASE_INK)?; + let (a, _) = read_u256(value, &memory)?; + let (b, _) = read_u256(modulus, &memory)?; + + let result: Bytes32 = a.checked_rem(b).unwrap_or_default().into(); + memory.write(value.offset() as u64, result.as_slice())?; + + Ok(()) +} + +pub fn math_pow( + mut ctx: FunctionEnvMut, + value: Ptr, + exponent: Ptr, +) -> MaybeEscape { + let (data, store) = ctx.data_and_store_mut(); + let memory = data.memory.clone().unwrap().view(&store); + + data.buy_ink(hostio::MATH_POW_BASE_INK)?; + let (a, _) = read_u256(value, &memory)?; + let (b, b32) = read_u256(exponent, &memory)?; + + data.pay_for_pow(&b32)?; + let result: Bytes32 = a.wrapping_pow(b).into(); + memory.write(value.offset() as u64, result.as_slice())?; + + Ok(()) +} + +pub fn math_add_mod( + mut ctx: FunctionEnvMut, + value: Ptr, + addend: Ptr, + modulus: Ptr, +) -> MaybeEscape { + let (data, store) = ctx.data_and_store_mut(); + let memory = data.memory.clone().unwrap().view(&store); + + data.buy_ink(hostio::MATH_ADD_MOD_BASE_INK)?; + let (a, _) = read_u256(value, &memory)?; + let (b, _) = read_u256(addend, &memory)?; + let (c, _) = read_u256(modulus, &memory)?; + + let result: Bytes32 = a.add_mod(b, c).into(); + memory.write(value.offset() as u64, result.as_slice())?; + + Ok(()) +} + +pub fn math_mul_mod( + mut ctx: FunctionEnvMut, + value: Ptr, + multiplier: Ptr, + modulus: Ptr, +) -> MaybeEscape { + let (data, store) = ctx.data_and_store_mut(); + let memory = data.memory.clone().unwrap().view(&store); + + data.buy_ink(hostio::MATH_MUL_MOD_BASE_INK)?; + let (a, _) = read_u256(value, &memory)?; + let (b, _) = read_u256(multiplier, &memory)?; + let (c, _) = read_u256(modulus, &memory)?; + + let result: Bytes32 = a.mul_mod(b, c).into(); + memory.write(value.offset() as u64, result.as_slice())?; + + Ok(()) +} + +pub fn msg_sender(mut ctx: FunctionEnvMut, ptr: Ptr) -> MaybeEscape { + let (data, store) = ctx.data_and_store_mut(); + let memory = data.memory.clone().unwrap().view(&store); + + data.buy_ink(hostio::MSG_SENDER_BASE_INK)?; + memory.write(ptr.offset() as u64, data.evm_data.msg_sender.as_slice())?; + + Ok(()) +} + +pub fn msg_value(mut ctx: FunctionEnvMut, ptr: Ptr) -> MaybeEscape { + let (data, store) = ctx.data_and_store_mut(); + let memory = data.memory.clone().unwrap().view(&store); + + data.buy_ink(hostio::MSG_VALUE_BASE_INK)?; + memory.write(ptr.offset() as u64, data.evm_data.msg_value.as_slice())?; + + Ok(()) +} + +pub fn tx_gas_price(mut ctx: FunctionEnvMut, ptr: Ptr) -> MaybeEscape { + let (data, store) = ctx.data_and_store_mut(); + let memory = data.memory.clone().unwrap().view(&store); + + data.buy_ink(hostio::TX_GAS_PRICE_BASE_INK)?; + memory.write(ptr.offset() as u64, data.evm_data.tx_gas_price.as_slice())?; + + Ok(()) +} + +pub fn tx_ink_price(mut ctx: FunctionEnvMut) -> Result { + let data = ctx.data_mut(); + + data.buy_ink(hostio::TX_INK_PRICE_BASE_INK)?; + Ok(data.pricing().ink_price) +} + +pub fn tx_origin(mut ctx: FunctionEnvMut, ptr: Ptr) -> MaybeEscape { + let (data, store) = ctx.data_and_store_mut(); + let memory = data.memory.clone().unwrap().view(&store); + + data.buy_ink(hostio::TX_ORIGIN_BASE_INK)?; + memory.write(ptr.offset() as u64, data.evm_data.tx_origin.as_slice())?; + + Ok(()) +} + +pub fn native_keccak256( + mut ctx: FunctionEnvMut, + input: Ptr, + len: u32, + output: Ptr, +) -> MaybeEscape { + let (data, store) = ctx.data_and_store_mut(); + let memory = data.memory.clone().unwrap().view(&store); + + data.pay_for_keccak(len)?; + let preimage = read_slice(input, len as usize, &memory)?; + let digest = keccak(&preimage); + memory.write(output.offset() as u64, &digest)?; + + Ok(()) +} + +use num_traits::Unsigned; +fn slice_with_runoff(data: &impl AsRef<[T]>, start: I, end: I) -> &[T] +where + I: TryInto + Unsigned, +{ + let start = start.try_into().unwrap_or(usize::MAX); + let end = end.try_into().unwrap_or(usize::MAX); + + let data = data.as_ref(); + if start >= data.len() || end < start { + return &[]; + } + &data[start..end.min(data.len())] +} diff --git a/crates/sp1/program/src/imports/wasi_stub.rs b/crates/sp1/program/src/imports/wasi_stub.rs new file mode 100644 index 0000000000..ba548090b9 --- /dev/null +++ b/crates/sp1/program/src/imports/wasi_stub.rs @@ -0,0 +1,70 @@ +//! WASI stubs — thin wrappers delegating to caller_env::wasip1_stub. + +use wasmer::FunctionEnvMut; + +use crate::{ + Ptr, platform, + replay::CustomEnvData, + state::{gp, sp1_env}, +}; + +pub fn proc_exit(mut ctx: FunctionEnvMut, code: u32) { + let (data, _store) = ctx.data_and_store_mut(); + + if code == 0 { + platform::print_string( + 1, + format!( + "Validation succeeds with hash 0x{}", + hex::encode(data.input().large_globals[0]) + ) + .as_bytes(), + ); + } + + platform::exit(code); +} + +macro_rules! wrap { + (fn $name:ident($($arg:ident: $ty:tt),* $(,)?)) => { + pub fn $name(mut src: FunctionEnvMut, $($arg: $ty),*) -> u16 { + let (mut mem, state) = sp1_env(&mut src); + caller_env::wasip1_stub::$name(&mut mem, state, $(wrap!(@conv $arg $ty)),*).0 + } + }; + (@conv $arg:ident Ptr) => { gp($arg) }; + (@conv $arg:ident $ty:tt) => { $arg }; +} + +wrap!(fn clock_time_get(_clock_id: u32, _precision: u64, time_ptr: Ptr)); +wrap!(fn random_get(buf: Ptr, len: u32)); +wrap!(fn environ_get(a: Ptr, b: Ptr)); +wrap!(fn environ_sizes_get(length_ptr: Ptr, data_size_ptr: Ptr)); +wrap!(fn fd_read(a: u32, b: u32, c: u32, d: u32)); +wrap!(fn fd_close(fd: u32)); +wrap!(fn fd_write(fd: u32, iovecs_ptr: Ptr, iovecs_len: u32, ret_ptr: Ptr)); +wrap!(fn fd_readdir(fd: u32, a: u32, b: u32, c: u64, d: u32)); +wrap!(fn fd_sync(a: u32)); +wrap!(fn fd_seek(fd: u32, offset: u64, whence: u8, filesize: u32)); +wrap!(fn fd_datasync(_fd: u32)); +wrap!(fn path_open(a: u32, b: u32, c: u32, d: u32, e: u32, f: u64, g: u64, h: u32, i: u32)); +wrap!(fn path_create_directory(a: u32, b: u32, c: u32)); +wrap!(fn path_remove_directory(a: u32, b: u32, c: u32)); +wrap!(fn path_readlink(a: u32, b: u32, c: u32, d: u32, e: u32, f: u32)); +wrap!(fn path_rename(a: u32, b: u32, c: u32, d: u32, e: u32, f: u32)); +wrap!(fn path_filestat_get(a: u32, b: u32, c: u32, d: u32, e: u32)); +wrap!(fn path_unlink_file(a: u32, b: u32, c: u32)); +wrap!(fn fd_prestat_get(a: u32, b: u32)); +wrap!(fn fd_prestat_dir_name(a: u32, b: u32, c: u32)); +wrap!(fn fd_filestat_get(fd: u32, _filestat: u32)); +wrap!(fn fd_filestat_set_size(fd: u32, size: u64)); +wrap!(fn fd_pread(fd: u32, a: u32, b: u32, c: u64, d: u32)); +wrap!(fn fd_pwrite(fd: u32, a: u32, b: u32, c: u64, d: u32)); +wrap!(fn sock_accept(_fd: u32, a: u32, b: u32)); +wrap!(fn sock_shutdown(a: u32, b: u32)); +wrap!(fn sched_yield()); +wrap!(fn args_sizes_get(length_ptr: Ptr, data_size_ptr: Ptr)); +wrap!(fn args_get(argv_buf: Ptr, data_buf: Ptr)); +wrap!(fn fd_fdstat_get(a: u32, b: u32)); +wrap!(fn fd_fdstat_set_flags(a: u32, b: u32)); +wrap!(fn poll_oneoff(in_subs: Ptr, out_evt: Ptr, nsubscriptions: u32, nevents_ptr: Ptr)); diff --git a/crates/sp1/program/src/imports/wavmio.rs b/crates/sp1/program/src/imports/wavmio.rs new file mode 100644 index 0000000000..f5c21dac4b --- /dev/null +++ b/crates/sp1/program/src/imports/wavmio.rs @@ -0,0 +1,186 @@ +//! wavmio functions — thin wrappers delegating to caller_env::wavmio. + +use core::ops::Deref; + +use ::caller_env::wavmio as caller_env; +use wasmer::{FunctionEnvMut, MemoryView}; + +use crate::{ + Escape, MaybeEscape, Ptr, read_bytes32, + replay::CustomEnvData, + state::{gp, sp1_env}, +}; + +pub fn get_global_state_bytes32( + mut ctx: FunctionEnvMut, + idx: u32, + out_ptr: Ptr, +) -> MaybeEscape { + let (mut mem, state) = sp1_env(&mut ctx); + caller_env::get_global_state_bytes32(&mut mem, state, idx, gp(out_ptr)).map_err(Escape::Logical) +} + +pub fn set_global_state_bytes32( + mut ctx: FunctionEnvMut, + idx: u32, + src_ptr: Ptr, +) -> MaybeEscape { + let (mem, state) = sp1_env(&mut ctx); + caller_env::set_global_state_bytes32(&mem, state, idx, gp(src_ptr)).map_err(Escape::Logical) +} + +pub fn get_global_state_u64( + mut ctx: FunctionEnvMut, + idx: u32, +) -> Result { + let (_mem, state) = sp1_env(&mut ctx); + caller_env::get_global_state_u64(state, idx).map_err(Escape::Logical) +} + +pub fn set_global_state_u64( + mut ctx: FunctionEnvMut, + idx: u32, + val: u64, +) -> MaybeEscape { + let (_mem, state) = sp1_env(&mut ctx); + caller_env::set_global_state_u64(state, idx, val).map_err(Escape::Logical) +} + +pub fn read_inbox_message( + mut ctx: FunctionEnvMut, + msg_num: u64, + offset: u32, + out_ptr: Ptr, +) -> Result { + let (mut mem, state) = sp1_env(&mut ctx); + caller_env::read_inbox_message(&mut mem, state, msg_num, offset, gp(out_ptr)) + .map_err(Escape::Logical) +} + +pub fn read_delayed_inbox_message( + mut ctx: FunctionEnvMut, + msg_num: u64, + offset: u32, + out_ptr: Ptr, +) -> Result { + let (mut mem, state) = sp1_env(&mut ctx); + caller_env::read_delayed_inbox_message(&mut mem, state, msg_num, offset, gp(out_ptr)) + .map_err(Escape::Logical) +} + +pub fn resolve_keccak_preimage( + mut ctx: FunctionEnvMut, + hash_ptr: Ptr, + offset: u32, + out_ptr: Ptr, +) -> Result { + let (mut mem, state) = sp1_env(&mut ctx); + caller_env::resolve_preimage( + &mut mem, + state, + 0, + gp(hash_ptr), + offset, + gp(out_ptr), + "wavmio.ResolvePreImage", + ) + .map_err(Escape::Logical) +} + +pub fn resolve_typed_preimage( + mut ctx: FunctionEnvMut, + preimage_type: u8, + hash_ptr: Ptr, + offset: u32, + out_ptr: Ptr, +) -> Result { + let (mut mem, state) = sp1_env(&mut ctx); + caller_env::resolve_preimage( + &mut mem, + state, + preimage_type, + gp(hash_ptr), + offset, + gp(out_ptr), + "wavmio.ResolveTypedPreimage", + ) + .map_err(Escape::Logical) +} + +pub fn validate_certificate( + mut ctx: FunctionEnvMut, + preimage_type: u8, + hash_ptr: Ptr, +) -> Result { + let (mem, state) = sp1_env(&mut ctx); + Ok(caller_env::validate_certificate( + &mem, + state, + preimage_type, + gp(hash_ptr), + )) +} + +// Greedy preimage resolution — kept separate, will be refactored independently. + +pub fn greedy_resolve_typed_preimage( + ctx: FunctionEnvMut, + preimage_type: u8, + hash_ptr: Ptr, + offset: u32, + available: u32, + out_ptr: Ptr, +) -> Result { + greedy_resolve_typed_preimage_impl( + ctx, + preimage_type, + hash_ptr, + offset, + available, + out_ptr, + "wavmio.ResolveTypedPreimage2", + ) +} + +fn greedy_read( + data: &[u8], + memory: &MemoryView, + offset: usize, + available: u32, + out_ptr: Ptr, +) -> Result { + let full_len = data.len().saturating_sub(offset) as u32; + let len = std::cmp::min(available, full_len); + let read = data + .get(offset..(offset + len as usize)) + .unwrap_or_default(); + memory.write(out_ptr.offset() as u64, read)?; + Ok(full_len) +} + +fn greedy_resolve_typed_preimage_impl( + mut ctx: FunctionEnvMut, + preimage_type: u8, + hash_ptr: Ptr, + offset: u32, + available: u32, + out_ptr: Ptr, + name: &str, +) -> Result { + let (data, store) = ctx.data_and_store_mut(); + let memory = data.memory.clone().unwrap().view(&store); + let offset = offset as usize; + let hash = read_bytes32(hash_ptr, &memory)?; + let Some(preimage) = data + .input() + .preimages + .get(&preimage_type) + .and_then(|m| m.get(hash.deref())) + else { + return Escape::logical(format!( + "Missing requested preimage for hash {} in {name}", + hex::encode(hash) + )); + }; + greedy_read(preimage, &memory, offset, available, out_ptr) +} diff --git a/crates/sp1/program/src/lib.rs b/crates/sp1/program/src/lib.rs new file mode 100644 index 0000000000..9424cb4d98 --- /dev/null +++ b/crates/sp1/program/src/lib.rs @@ -0,0 +1,163 @@ +pub mod imports; +mod memory; +pub mod platform; +pub mod replay; +mod state; +pub mod stylus; + +use std::{ + io, + mem::{self, MaybeUninit}, + ptr::NonNull, +}; + +use arbutil::{ + Bytes20, Bytes32, + evm::api::{Gas, Ink}, +}; +use prover::programs::config::{CompileConfig, StylusConfig}; +use thiserror::Error; +use wasmer::{MemoryAccessError, MemoryView, WasmPtr}; +use wasmer_types::RawValue; +use wasmer_vm::VMGlobalDefinition; + +pub use crate::replay::run; + +pub const STACK_SIZE: usize = 1024 * 1024; + +// nitro uses 32-bit memory space +pub(crate) type Ptr = WasmPtr; + +pub(crate) fn read_slice(ptr: Ptr, len: usize, memory: &MemoryView) -> Result, Escape> { + let mut data: Vec> = Vec::with_capacity(len); + // SAFETY: read_uninit fills all available space + Ok(unsafe { + data.set_len(len); + memory.read_uninit(ptr.offset() as u64, &mut data)?; + mem::transmute::>, Vec>(data) + }) +} + +pub(crate) fn read_bytes20(ptr: Ptr, memory: &MemoryView) -> Result { + read_slice(ptr, 20, memory).map(|data| data.try_into().unwrap()) +} + +pub(crate) fn read_bytes32(ptr: Ptr, memory: &MemoryView) -> Result { + read_slice(ptr, 32, memory).map(|data| data.try_into().unwrap()) +} + +fn keccak>(preimage: T) -> [u8; 32] { + use std::mem::MaybeUninit; + + use tiny_keccak::{Hasher, Keccak}; + + let mut output = MaybeUninit::<[u8; 32]>::uninit(); + let mut hasher = Keccak::v256(); + hasher.update(preimage.as_ref()); + + // SAFETY: finalize() writes 32 bytes + unsafe { + hasher.finalize(&mut *output.as_mut_ptr()); + output.assume_init() + } +} + +pub type MaybeEscape = Result<(), Escape>; + +#[derive(Error, Debug)] +pub enum Escape { + #[error("failed to access memory: `{0}`")] + Memory(MemoryAccessError), + #[error("internal error: `{0}`")] + Internal(String), + #[error("logic error: `{0}`")] + Logical(String), + #[error("out of ink")] + OutOfInk, + #[error("exit early: `{0}`")] + Exit(u32), +} + +impl Escape { + pub fn logical>(message: S) -> Result { + Err(Self::Logical(message.as_ref().to_string())) + } +} + +impl From for Escape { + fn from(err: String) -> Self { + Self::Internal(err) + } +} + +impl From for Escape { + fn from(err: eyre::ErrReport) -> Self { + Self::Internal(err.to_string()) + } +} + +impl From for Escape { + fn from(err: io::Error) -> Self { + Self::Internal(format!("[io error]: {err:?}")) + } +} + +impl From for Escape { + fn from(_: prover::programs::meter::OutOfInkError) -> Self { + Self::OutOfInk + } +} + +impl From for Escape { + fn from(err: MemoryAccessError) -> Self { + Self::Memory(err) + } +} + +// Below are some data structures that do not belong to prover / arbutil, +// but we don't want to pull in full crate anyway. As a result, they are +// for now copied over. + +pub struct JitConfig { + pub stylus: StylusConfig, + pub compile: CompileConfig, +} + +pub struct CallInputs { + pub contract: Bytes20, + pub input: Vec, + pub gas_left: Gas, + pub gas_req: Gas, + pub value: Option, +} + +#[derive(Clone, Copy, Debug)] +pub struct MeterData { + /// The amount of ink left + pub ink_left: NonNull, + /// Whether the instance has run out of ink + pub ink_status: NonNull, +} + +impl MeterData { + pub fn ink(&self) -> Ink { + Ink(unsafe { self.ink_left.as_ref().val.u64 }) + } + + pub fn status(&self) -> u32 { + unsafe { self.ink_status.as_ref().val.u32 } + } + + pub fn set_ink(&mut self, ink: Ink) { + unsafe { self.ink_left.as_mut().val = RawValue { u64: ink.0 } } + } + + pub fn set_status(&mut self, status: u32) { + unsafe { self.ink_status.as_mut().val = RawValue { u32: status } } + } +} + +/// The data we're pointing to is owned by the `NativeInstance`. +/// These are simple integers whose lifetime is that of the instance. +/// Stylus is also single-threaded. +unsafe impl Send for MeterData {} diff --git a/crates/sp1/program/src/main.rs b/crates/sp1/program/src/main.rs new file mode 100644 index 0000000000..9f3d8d9ebf --- /dev/null +++ b/crates/sp1/program/src/main.rs @@ -0,0 +1,142 @@ +#![cfg_attr(target_os = "zkvm", no_main)] +#![allow(unsafe_op_in_unsafe_fn, clippy::missing_safety_doc)] + +#[cfg(target_os = "zkvm")] +sp1_zkvm::entrypoint!(main); + +fn main() { + // We are loading replay.wasmu object here. After initializing, it is + // not needed. + let sp1_zkvm::ReadVecResult { ptr, len, .. } = sp1_zkvm::read_vec_raw(); + assert!(!ptr.is_null()); + // SAFETY: ptr must not be deallocated + let s: &'static [u8] = unsafe { std::slice::from_raw_parts(ptr, len) }; + let metadata = bytes::Bytes::from_static(s); + + program::run(metadata); +} + +// Those are referenced by wasmer runtimes, but are never invoked +#[unsafe(no_mangle)] +pub extern "C" fn __negdf2(_x: f64) -> f64 { + todo!() +} + +#[unsafe(no_mangle)] +pub extern "C" fn __negsf2(_x: f32) -> f32 { + todo!() +} + +// The following code provides adapter functions, so the brotli implementation +// in C can rely on Rust for memory management. + +// Use `alloc::` instead of `std::` if you are in a `#![no_std]` environment. +use std::{ + alloc::{Layout, alloc, alloc_zeroed, dealloc, realloc as rust_realloc}, + ptr, +}; + +// Alignment for the custom allocator header. 8 bytes is sufficient for +// storing the size header (usize) on both 32-bit and 64-bit targets. +const ALIGN: usize = 8; +const HEADER_SIZE: usize = 8; + +/// void* malloc(size_t size) +#[unsafe(no_mangle)] +pub unsafe extern "C" fn malloc(size: usize) -> *mut u8 { + if size == 0 { + return ptr::null_mut(); + } + + let total_size = size + HEADER_SIZE; + let layout = Layout::from_size_align_unchecked(total_size, ALIGN); + let ptr = alloc(layout); + + if ptr.is_null() { + return ptr::null_mut(); + } + + *(ptr as *mut usize) = size; + ptr.add(HEADER_SIZE) +} + +/// void* calloc(size_t nmemb, size_t size) +#[unsafe(no_mangle)] +pub unsafe extern "C" fn calloc(nmemb: usize, size: usize) -> *mut u8 { + let req_size = match nmemb.checked_mul(size) { + Some(s) => s, + None => return ptr::null_mut(), + }; + + if req_size == 0 { + return ptr::null_mut(); + } + + let total_size = req_size + HEADER_SIZE; + let layout = Layout::from_size_align_unchecked(total_size, ALIGN); + let ptr = alloc_zeroed(layout); + + if ptr.is_null() { + return ptr::null_mut(); + } + + *(ptr as *mut usize) = req_size; + ptr.add(HEADER_SIZE) +} + +/// void* realloc(void* ptr, size_t size) +#[unsafe(no_mangle)] +pub unsafe extern "C" fn realloc(ptr: *mut u8, size: usize) -> *mut u8 { + // C standard: realloc(NULL, size) is identical to malloc(size) + if ptr.is_null() { + return malloc(size); + } + + // C standard: realloc(ptr, 0) is identical to free(ptr) + if size == 0 { + free(ptr); + return ptr::null_mut(); + } + + let header_ptr = ptr.sub(HEADER_SIZE); + let old_size = *(header_ptr as *const usize); + + let old_total_size = old_size + HEADER_SIZE; + let new_total_size = size + HEADER_SIZE; + + let layout = Layout::from_size_align_unchecked(old_total_size, ALIGN); + + let new_header_ptr = rust_realloc(header_ptr, layout, new_total_size); + if new_header_ptr.is_null() { + return ptr::null_mut(); // Original block is left untouched on failure + } + + // Update the header with the new requested size + *(new_header_ptr as *mut usize) = size; + + new_header_ptr.add(HEADER_SIZE) +} + +/// void free(void* ptr) +#[unsafe(no_mangle)] +pub unsafe extern "C" fn free(ptr: *mut u8) { + if ptr.is_null() { + return; + } + + let header_ptr = ptr.sub(HEADER_SIZE); + let size = *(header_ptr as *const usize); + + let total_size = size + HEADER_SIZE; + let layout = Layout::from_size_align_unchecked(total_size, ALIGN); + + dealloc(header_ptr, layout); +} + +/// void exit(int status) +#[unsafe(no_mangle)] +pub extern "C" fn exit(status: i32) -> ! { + // For embedded no_std, you will likely replace this with a panic + // or a hardware-specific halt/reset routine. + std::process::exit(status); +} diff --git a/crates/sp1/program/src/memory.rs b/crates/sp1/program/src/memory.rs new file mode 100644 index 0000000000..f64133e249 --- /dev/null +++ b/crates/sp1/program/src/memory.rs @@ -0,0 +1,97 @@ +// Copyright 2026, Offchain Labs, Inc. +// For license information, see https://github.com/OffchainLabs/nitro/blob/master/LICENSE.md + +use caller_env::{GuestPtr, MemAccess}; +use wasmer::{Memory, StoreMut}; + +/// Adapter implementing MemAccess over wasmer MemoryView. +pub(crate) struct Sp1MemAccess<'s> { + pub memory: Memory, + pub store: StoreMut<'s>, +} + +impl Sp1MemAccess<'_> { + fn view(&self) -> wasmer::MemoryView<'_> { + self.memory.view(&self.store) + } +} + +impl MemAccess for Sp1MemAccess<'_> { + fn read_u8(&self, ptr: GuestPtr) -> u8 { + let mut buf = [0u8; 1]; + self.view() + .read(ptr.to_u64(), &mut buf) + .expect("failed to read u8 from guest memory"); + buf[0] + } + + fn read_u16(&self, ptr: GuestPtr) -> u16 { + let mut buf = [0u8; 2]; + self.view() + .read(ptr.to_u64(), &mut buf) + .expect("failed to read u16 from guest memory"); + u16::from_le_bytes(buf) + } + + fn read_u32(&self, ptr: GuestPtr) -> u32 { + let mut buf = [0u8; 4]; + self.view() + .read(ptr.to_u64(), &mut buf) + .expect("failed to read u32 from guest memory"); + u32::from_le_bytes(buf) + } + + fn read_u64(&self, ptr: GuestPtr) -> u64 { + let mut buf = [0u8; 8]; + self.view() + .read(ptr.to_u64(), &mut buf) + .expect("failed to read u64 from guest memory"); + u64::from_le_bytes(buf) + } + + fn write_u8(&mut self, ptr: GuestPtr, x: u8) { + self.view() + .write(ptr.to_u64(), &[x]) + .expect("failed to write u8 to guest memory"); + } + + fn write_u16(&mut self, ptr: GuestPtr, x: u16) { + self.view() + .write(ptr.to_u64(), &x.to_le_bytes()) + .expect("failed to write u16 to guest memory"); + } + + fn write_u32(&mut self, ptr: GuestPtr, x: u32) { + self.view() + .write(ptr.to_u64(), &x.to_le_bytes()) + .expect("failed to write u32 to guest memory"); + } + + fn write_u64(&mut self, ptr: GuestPtr, x: u64) { + self.view() + .write(ptr.to_u64(), &x.to_le_bytes()) + .expect("failed to write u64 to guest memory"); + } + + fn read_slice(&self, ptr: GuestPtr, len: usize) -> Vec { + let mut data = vec![0u8; len]; + self.view() + .read(ptr.to_u64(), &mut data) + .expect("failed to read slice from guest memory"); + data + } + + fn read_fixed(&self, ptr: GuestPtr) -> [u8; N] { + let mut buf = [0u8; N]; + self.view() + .read(ptr.to_u64(), &mut buf) + .expect("failed to read fixed bytes from guest memory"); + buf + } + + fn write_slice(&mut self, ptr: GuestPtr, data: &[u8]) { + self.view() + .write(ptr.to_u64(), data) + .expect("failed to write slice to guest memory"); + } +} diff --git a/crates/sp1/program/src/platform.rs b/crates/sp1/program/src/platform.rs new file mode 100644 index 0000000000..5d787307f0 --- /dev/null +++ b/crates/sp1/program/src/platform.rs @@ -0,0 +1,19 @@ +use sp1_zkvm::{io, syscalls}; +use validation::ValidationInput; + +pub fn print_string(fd: u32, bytes: &[u8]) { + syscalls::syscall_write(fd, bytes.as_ptr(), bytes.len()); +} + +pub fn read_input() -> ValidationInput { + let s = io::read::>(); + ValidationInput::from_reader(std::io::Cursor::new(s)).expect("parse input file") +} + +pub fn exit(code: u32) -> ! { + syscalls::syscall_halt(code as u8) +} + +pub fn dump_elf() { + syscalls::syscall_dump_elf(); +} diff --git a/crates/sp1/program/src/replay.rs b/crates/sp1/program/src/replay.rs new file mode 100644 index 0000000000..bbc0a35153 --- /dev/null +++ b/crates/sp1/program/src/replay.rs @@ -0,0 +1,431 @@ +//! Runtime code for replay.wasm + +use std::{ + marker::PhantomData, + ops::{Deref, DerefMut}, +}; + +use arbutil::{Bytes32, evm::EvmData}; +use bytes::Bytes; +use corosensei::{Coroutine, CoroutineResult, Yielder, stack::DefaultStack}; +use once_cell::unsync::Lazy; +use prover::programs::meter::MeteredMachine; +use rand_pcg::Pcg32; +use validation::ValidationInput; +use wasmer::{ + Engine, Function, FunctionEnv, Imports, Instance, Memory, Module, RuntimeError, Store, Value, + imports, sys::NativeEngineExt, +}; +use wasmer_vm::install_unwinder; + +use crate::{ + Escape, JitConfig, STACK_SIZE, + imports::{arbcompress, precompiles, programs, wasi_stub, wavmio}, + platform::{exit, read_input}, + stylus::{Cothread, MessageFromCothread, MessageToCothread}, +}; + +// Coroutine is not Send, so we cannot keep it in CustomEnvData. +// As SP1 is single-threaded, it won't hurt if we use a few static variables. +// Another way of doing this is to build a wrapper similar to SendYielder, we +// will leave it to another time to debate which is a better option. +static mut COTHREADS: Vec = Vec::new(); +fn cothreads_mut() -> &'static mut Vec { + unsafe { &mut *std::ptr::addr_of_mut!(COTHREADS) } +} +fn cothreads() -> &'static [Cothread] { + unsafe { &*std::ptr::addr_of!(COTHREADS) } +} + +/// This provides a single-threaded Send yielder since corosensei's +/// own Yielder does not implement Send +pub struct SendYielder { + yielder: u64, + _input: PhantomData, + _yield: PhantomData, +} + +impl Clone for SendYielder { + fn clone(&self) -> Self { + Self { + yielder: self.yielder, + _input: PhantomData, + _yield: PhantomData, + } + } +} + +impl std::ops::Deref for SendYielder { + type Target = Yielder; + + fn deref(&self) -> &Self::Target { + self.yielder() + } +} + +impl SendYielder { + pub fn new(yielder: &Yielder) -> Self { + Self { + yielder: yielder as *const _ as u64, + _input: PhantomData, + _yield: PhantomData, + } + } + + pub fn yielder(&self) -> &Yielder { + unsafe { &*(self.yielder as *const _) } + } +} + +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub enum MainYieldMessage { + RunLastChild, +} + +pub struct CustomEnvData { + /// Note this is an option, since memory is not available when building + /// imports. A multi-step solution is required for initialization: + /// + /// * Build imports with memory set to None + /// * Use imports to initialize Instance + /// * Extract memory from instance's exports + /// * Set the memory back in CustomEnvData. + pub memory: Option, + pub time: u64, + pub pcg: Pcg32, + + input: Lazy, + yielder: SendYielder<(), MainYieldMessage>, +} + +impl CustomEnvData { + pub fn new(yielder: &Yielder<(), MainYieldMessage>) -> Self { + // See https://github.com/OffchainLabs/nitro/blob/7e5c0bb3cfd55ef2d99abff8b3875c97f85eb1c8/arbitrator/caller-env/src/lib.rs#L27-L31 + const PCG_INIT_STATE: u64 = 0xcafef00dd15ea5e5; + const PCG_INIT_STREAM: u64 = 0xa02bdbf7bb3c0a7; + let pcg = Pcg32::new(PCG_INIT_STATE, PCG_INIT_STREAM); + + Self { + memory: None, + time: 0, + pcg, + input: Lazy::new(read_input), + yielder: SendYielder::new(yielder), + } + } + + pub fn input(&self) -> &ValidationInput { + self.input.deref() + } + + pub fn input_mut(&mut self) -> &mut ValidationInput { + self.input.deref_mut() + } + + pub fn input_initialized(&self) -> bool { + Lazy::get(&self.input).is_some() + } + + pub fn launch_program( + &mut self, + module_hash: &Bytes32, + calldata: Vec, + config: JitConfig, + evm_data: EvmData, + gas: u64, + ) -> Result { + let Some(module) = self.input.module_asms.get(module_hash.deref()) else { + return Escape::logical(format!("Unable to locate module: {module_hash}")); + }; + let aligned = align_bytes(module); + let cothread = Cothread::new(aligned, calldata, config, evm_data, gas); + + cothreads_mut().push(cothread); + Ok(cothreads().len().try_into().unwrap()) + } + + pub fn send_to_cothread(&mut self, msg: MessageToCothread) { + let queue = &cothreads().last().unwrap().queue; + queue.lock().expect("lock").send_to_cothread(msg); + } + + pub fn wait_next_message(&mut self, module: Option) { + if let Some(module) = module { + assert_ne!(module, 0); + assert_eq!(module, cothreads().len() as u32); + } + + let queue = &cothreads().last().unwrap().queue; + queue.lock().expect("lock").mark_read_from_cothread(); + + // Bound the number of loops for ease of debugging. + // 10 iterations should be more than enough for any single message exchange. + const MAX_YIELD_ITERATIONS: usize = 10; + for _ in 0..MAX_YIELD_ITERATIONS { + if queue.lock().expect("lock").peek_from_cothread().is_some() { + return; + } + + self.yielder.suspend(MainYieldMessage::RunLastChild); + } + panic!( + "did not receive message from cothread after {MAX_YIELD_ITERATIONS} iterations (module={module:?}, num_cothreads={})", + cothreads().len() + ); + } + + // For now, message id in arbitrator is hardcoded to 0x33333333, + // we are safely ignoring it + pub fn get_last_msg(&self) -> MessageFromCothread { + let queue = &cothreads().last().unwrap().queue; + queue + .lock() + .expect("lock") + .peek_from_cothread() + .expect("no message waiting") + } + + pub fn pop_last_program(&mut self) { + cothreads_mut().pop(); + } +} + +/// Given replay.wasm's serialized module(or serialized object), this method starts the main +/// event loop. +pub fn run(m: Bytes) -> ! { + // Runs the wasmer module in a coroutine, so we can multiplex between different + // modules without threads. + let mut coro = Coroutine::with_stack( + DefaultStack::new(STACK_SIZE).expect("create default stack"), + |yielder: &Yielder<(), MainYieldMessage>, ()| { + let mut store = Store::new(Engine::headless()); + let module = unsafe { Module::deserialize(&store, m) }.expect("creating module"); + + // Setup replay.wasm function symbols for profiling & debugging + #[cfg(target_os = "zkvm")] + { + let sp1_zkvm::ReadVecResult { ptr, len, .. } = sp1_zkvm::read_vec_raw(); + assert!(!ptr.is_null()); + let mapping_bytes = unsafe { std::slice::from_raw_parts(ptr, len) }; + let mapping: Vec> = + serde_json::from_slice(&mapping_bytes[..]).expect("parse mapping"); + let infos = module.as_sys().local_function_infos(); + // ptr => (function name, size), for precision, all usizes are casted to string + let mut profiler_data: std::collections::HashMap = + std::collections::HashMap::default(); + for (index, ptr, size) in infos { + if let Some(Some(name)) = mapping.get(index as usize) { + profiler_data.insert(ptr.to_string(), (name.clone(), size.to_string())); + } + } + let profiler_data_str = + serde_json::to_string(&profiler_data).expect("profiler data to json"); + sp1_zkvm::syscalls::syscall_insert_profiler_symbols( + profiler_data_str.as_str().as_ptr(), + profiler_data_str.as_str().len() as u64, + ); + } + + let (imports, function_env) = build_imports(&mut store, yielder); + let instance = + Instance::new(&mut store, &module, &imports).expect("instantiating module"); + + let memory = instance + .exports + .get_memory("memory") + .expect("fetching memory"); + function_env.as_mut(&mut store).memory = Some(memory.clone()); + + let start = instance + .exports + .get_function("_start") + .expect("fetching start function!"); + + start.call(&mut store, &[]) + }, + ); + + let result = loop { + install_unwinder(None); + match coro.resume(()) { + CoroutineResult::Yield(msg) => match msg { + MainYieldMessage::RunLastChild => { + let cothread = cothreads_mut().last_mut().unwrap(); + let input = cothread.input(); + let store = input.store_mut(); + let function_env = input.function_env_mut(); + let env = function_env.as_mut(store); + { + if let Some(yielder) = &env.yielder { + let yielder = yielder.clone(); + install_unwinder(Some(Box::new(move |reason| { + yielder.suspend(Some(reason)); + }))); + } + } + store.force_create(); + let exit = match cothread.coroutine.resume(input.clone()) { + CoroutineResult::Yield(y) => match y { + Some(unwind_reason) => { + unsafe { + cothread.coroutine.force_reset(); + } + Some(Err(unwind_reason.into_trap().into())) + } + None => None, + }, + CoroutineResult::Return(r) => Some(r), + }; + store.force_clean(); + if let Some(result) = exit { + let env = function_env.as_mut(store); + let (req_type, req_data) = { + let (req_type, data) = match result { + // Success + Ok(0) => (0, env.outs.clone()), + // Revert + Ok(_) => (1, env.outs.clone()), + // Failure + Err(e) => match e.downcast::() { + Ok(escape) => match escape { + Escape::Exit(0) => (0, env.outs.clone()), + Escape::Exit(_) => (1, env.outs.clone()), + _ => (2, format!("{escape:?}").as_bytes().to_vec()), + }, + Err(e) => (2, format!("{e:?}").as_bytes().to_vec()), + }, + }; + let mut output = Vec::with_capacity(8 + data.len()); + let ink_left = env.ink_left().into(); + let gas_left = env.config.stylus.pricing.ink_to_gas(ink_left); + output.extend(gas_left.to_be_bytes()); + output.extend(data); + (req_type, output) + }; + let msg = MessageFromCothread { req_data, req_type }; + env.send_from_cothread(msg); + } + } + }, + CoroutineResult::Return(result) => break result, + } + }; + handle_result(result); +} + +fn build_imports( + store: &mut Store, + yielder: &Yielder<(), MainYieldMessage>, +) -> (Imports, FunctionEnv) { + let func_env = FunctionEnv::new(store, CustomEnvData::new(yielder)); + macro_rules! func { + ($func:expr) => { + Function::new_typed_with_env(store, &func_env, $func) + }; + } + + ( + imports! { + "arbcompress" => { + "brotli_compress" => func!(arbcompress::brotli_compress), + "brotli_decompress" => func!(arbcompress::brotli_decompress), + }, + "arbcrypto" => { + "ecrecovery" => func!(precompiles::ecrecover), + "keccak256" => func!(precompiles::keccak256), + }, + "hooks" => { + "beforeFirstIO" => func!(precompiles::dump_elf), + }, + "wasi_snapshot_preview1" => { + "proc_exit" => func!(wasi_stub::proc_exit), + "sched_yield" => func!(wasi_stub::sched_yield), + "clock_time_get" => func!(wasi_stub::clock_time_get), + "random_get" => func!(wasi_stub::random_get), + "poll_oneoff" => func!(wasi_stub::poll_oneoff), + "args_sizes_get" => func!(wasi_stub::args_sizes_get), + "args_get" => func!(wasi_stub::args_get), + "environ_sizes_get" => func!(wasi_stub::environ_sizes_get), + "environ_get" => func!(wasi_stub::environ_get), + "fd_write" => func!(wasi_stub::fd_write), + "fd_close" => func!(wasi_stub::fd_close), + "fd_read" => func!(wasi_stub::fd_read), + "fd_readdir" => func!(wasi_stub::fd_readdir), + "fd_sync" => func!(wasi_stub::fd_sync), + "fd_seek" => func!(wasi_stub::fd_seek), + "fd_datasync" => func!(wasi_stub::fd_datasync), + "fd_prestat_get" => func!(wasi_stub::fd_prestat_get), + "fd_prestat_dir_name" => func!(wasi_stub::fd_prestat_dir_name), + "fd_filestat_get" => func!(wasi_stub::fd_filestat_get), + "fd_filestat_set_size" => func!(wasi_stub::fd_filestat_set_size), + "fd_pread" => func!(wasi_stub::fd_pread), + "fd_pwrite" => func!(wasi_stub::fd_pwrite), + "fd_fdstat_get" => func!(wasi_stub::fd_fdstat_get), + "fd_fdstat_set_flags" => func!(wasi_stub::fd_fdstat_set_flags), + "path_open" => func!(wasi_stub::path_open), + "path_create_directory" => func!(wasi_stub::path_create_directory), + "path_remove_directory" => func!(wasi_stub::path_remove_directory), + "path_readlink" => func!(wasi_stub::path_readlink), + "path_rename" => func!(wasi_stub::path_rename), + "path_filestat_get" => func!(wasi_stub::path_filestat_get), + "path_unlink_file" => func!(wasi_stub::path_unlink_file), + "sock_accept" => func!(wasi_stub::sock_accept), + "sock_shutdown" => func!(wasi_stub::sock_shutdown), + }, + "wavmio" => { + "getGlobalStateBytes32" => func!(wavmio::get_global_state_bytes32), + "setGlobalStateBytes32" => func!(wavmio::set_global_state_bytes32), + "getGlobalStateU64" => func!(wavmio::get_global_state_u64), + "setGlobalStateU64" => func!(wavmio::set_global_state_u64), + "readInboxMessage" => func!(wavmio::read_inbox_message), + "readDelayedInboxMessage" => func!(wavmio::read_delayed_inbox_message), + "resolvePreImage" => func!(wavmio::resolve_keccak_preimage), + "resolveTypedPreimage" => func!(wavmio::resolve_typed_preimage), + "greedyResolveTypedPreimage" => func!(wavmio::greedy_resolve_typed_preimage), + "validateCertificate" => func!(wavmio::validate_certificate), + }, + "programs" => { + "program_prepare" => func!(programs::program_prepare), + "program_requires_prepare" => func!(programs::program_requires_prepare), + "new_program" => func!(programs::new_program), + "pop" => func!(programs::pop), + "set_response" => func!(programs::set_response), + "get_request" => func!(programs::get_request), + "get_request_data" => func!(programs::get_request_data), + "start_program" => func!(programs::start_program), + "send_response" => func!(programs::send_response), + "create_stylus_config" => func!(programs::create_stylus_config), + "create_evm_data" => func!(programs::create_evm_data), + "create_evm_data_v2" => func!(programs::create_evm_data_v2), + "activate" => func!(programs::activate), + "activate_v2" => func!(programs::activate_v2), + }, + }, + func_env, + ) +} + +/// Copies `data` into 8-byte-aligned memory and returns it as `Bytes`. +/// SP1's wasmer fork requires aligned memory for `Module::deserialize`. +fn align_bytes(data: &[u8]) -> Bytes { + use bytes::BytesMut; + let mut buffer = BytesMut::zeroed(data.len() + 7); + let p = buffer.as_ptr() as usize; + let aligned_p = p.div_ceil(8) * 8; + let offset = aligned_p - p; + buffer[offset..offset + data.len()].copy_from_slice(data); + let bytes = buffer.freeze(); + bytes.slice(offset..offset + data.len()) +} + +pub(crate) fn handle_result(result: Result, RuntimeError>) -> ! { + let message = match result { + Ok(value) => format!("Machine exited prematurely with: {:?}", value), + Err(e) => format!("Runtime error: {}", e), + }; + + if !message.is_empty() { + println!("{message}"); + } + exit(1); +} diff --git a/crates/sp1/program/src/state.rs b/crates/sp1/program/src/state.rs new file mode 100644 index 0000000000..ecbb5c590f --- /dev/null +++ b/crates/sp1/program/src/state.rs @@ -0,0 +1,88 @@ +// Copyright 2026, Offchain Labs, Inc. +// For license information, see https://github.com/OffchainLabs/nitro/blob/master/LICENSE.md + +use caller_env::{ExecEnv, GuestPtr, wavmio::WavmIo}; +use rand::RngCore; +use wasmer::FunctionEnvMut; + +use crate::{memory::Sp1MemAccess, replay::CustomEnvData}; + +impl ExecEnv for CustomEnvData { + fn advance_time(&mut self, ns: u64) { + self.time += ns; + } + + fn get_time(&self) -> u64 { + self.time + } + + fn next_rand_u32(&mut self) -> u32 { + self.pcg.next_u32() + } + + fn print_string(&mut self, bytes: &[u8]) { + crate::platform::print_string(1, bytes); + } +} + +impl WavmIo for CustomEnvData { + fn get_u64_global(&self, idx: usize) -> Option { + self.input().small_globals.get(idx).copied() + } + + fn set_u64_global(&mut self, idx: usize, val: u64) -> bool { + let Some(g) = self.input_mut().small_globals.get_mut(idx) else { + return false; + }; + *g = val; + true + } + + fn get_bytes32_global(&self, idx: usize) -> Option<&[u8; 32]> { + self.input().large_globals.get(idx) + } + + fn set_bytes32_global(&mut self, idx: usize, val: [u8; 32]) -> bool { + let Some(g) = self.input_mut().large_globals.get_mut(idx) else { + return false; + }; + *g = val; + true + } + + fn get_sequencer_message(&self, num: u64) -> Option<&[u8]> { + self.input() + .sequencer_messages + .get(&num) + .map(|v| v.as_slice()) + } + + fn get_delayed_message(&self, num: u64) -> Option<&[u8]> { + self.input() + .delayed_messages + .get(&num) + .map(|v| v.as_slice()) + } + + fn get_preimage(&self, preimage_type: u8, hash: &[u8; 32]) -> Option<&[u8]> { + self.input() + .preimages + .get(&preimage_type) + .and_then(|m| m.get(hash)) + .map(|v| v.as_slice()) + } +} + +/// Extracts (Sp1MemAccess, &mut CustomEnvData) from a FunctionEnvMut in place. +pub(crate) fn sp1_env<'a>( + ctx: &'a mut FunctionEnvMut<'_, CustomEnvData>, +) -> (Sp1MemAccess<'a>, &'a mut CustomEnvData) { + let memory = ctx.data().memory.clone().unwrap(); + let (data, store) = ctx.data_and_store_mut(); + (Sp1MemAccess { memory, store }, data) +} + +/// Converts a wasmer `Ptr` (WasmPtr) to a caller-env `GuestPtr`. +pub(crate) fn gp(p: crate::Ptr) -> GuestPtr { + GuestPtr(p.offset()) +} diff --git a/crates/sp1/program/src/stylus.rs b/crates/sp1/program/src/stylus.rs new file mode 100644 index 0000000000..d54c705514 --- /dev/null +++ b/crates/sp1/program/src/stylus.rs @@ -0,0 +1,698 @@ +//! Stylus runtime. In this module we keep data structures & code +//! required to interface with wasmer. Nitro's definitions are mostly +//! kept in `nitro` sub-module. + +use std::{ + collections::{VecDeque, hash_map::Entry}, + ops::DerefMut, + sync::{Arc, Mutex}, +}; + +use arbutil::{ + Bytes20, Bytes32, + evm::{ + ARBOS_VERSION_STYLUS_LAST_CODE_CACHE_FIX, EvmData, + api::{EVM_API_METHOD_REQ_OFFSET, EvmApiMethod, EvmApiStatus, Gas}, + storage::{StorageCache, StorageWord}, + user::UserOutcomeKind, + }, +}; +use bytes::Bytes; +use corosensei::{Coroutine, Yielder, stack::DefaultStack}; +use eyre::{bail, eyre}; +use prover::programs::{ + STYLUS_ENTRY_POINT, + config::PricingParams, + depth::STYLUS_STACK_LEFT, + meter::{GasMeteredMachine, MachineMeter, MeteredMachine, STYLUS_INK_LEFT, STYLUS_INK_STATUS}, +}; +use wasmer::{ + AsStoreMut, Engine, Function, FunctionEnv, Imports, Instance, Memory, MemoryView, Module, + RuntimeError, Store, StoreObjects, imports, sys::NativeEngineExt, +}; +use wasmer_vm::{UnwindReason, VMExtern, install_unwinder}; + +use crate::{ + CallInputs, Escape, JitConfig, MeterData, Ptr, STACK_SIZE, + imports::{debug, vm_hooks}, + read_bytes20, read_bytes32, read_slice, + replay::SendYielder, +}; + +/// A cothread wraps a stylus program. Actually we run the stylus +/// program via a coroutine, it is just so named following existing +/// structure in arbitrator +pub struct Cothread { + pub queue: Arc>, + pub coroutine: Coroutine, + + store: Store, + instance: Instance, + function_env: FunctionEnv, +} + +/// This way we can workaround Rust limitations. All variables will +/// be alive for the entire duration of Cothread, so there is no use +/// after free situation. +#[derive(Clone)] +pub struct CothreadInput { + store: usize, + instance: usize, + function_env: usize, +} + +pub type CothreadYield = Option; +pub type CothreadReturn = Result; + +impl Cothread { + pub fn new( + program: Bytes, + calldata: Vec, + config: JitConfig, + evm_data: EvmData, + gas: u64, + ) -> Self { + let queue = MessageQueue::new(); + let args_len = calldata.len(); + let mut store = Store::new(Engine::headless()); + let module = unsafe { Module::deserialize(&store, program) }.expect("creating module"); + let (imports, function_env) = + build_imports(&mut store, calldata, config, evm_data, queue.clone()); + let instance = Instance::new(&mut store, &module, &imports).expect("instantiating module"); + + let memory = instance + .exports + .get_memory("memory") + .expect("fetching memory"); + function_env.as_mut(&mut store).memory = Some(memory.clone()); + + // Setup ink variables + let (ink_left, ink_status) = { + let mut expect_global = |name| { + let VMExtern::Global(sh) = instance + .exports + .get_extern(name) + .unwrap() + .to_vm_extern() + .into_sys() + else { + panic!("name not found global"); + }; + let StoreObjects::Sys(objects) = store.objects_mut(); + sh.get(objects).vmglobal() + }; + ( + expect_global(STYLUS_INK_LEFT), + expect_global(STYLUS_INK_STATUS), + ) + }; + { + let env = function_env.as_mut(&mut store); + + env.meter = Some(MeterData { + ink_left, + ink_status, + }); + let ink = env.config.stylus.pricing.gas_to_ink(Gas(gas)); + env.set_ink(ink); + } + + // Set stack left + { + let max_depth = { + let env = function_env.as_mut(&mut store); + env.config.stylus.max_depth + }; + let Ok(global) = instance.exports.get_global(STYLUS_STACK_LEFT) else { + panic!("global {} does not exist", STYLUS_STACK_LEFT); + }; + global + .set(&mut store, max_depth.into()) + .expect("set stack left") + } + + let coroutine = Coroutine::with_stack( + DefaultStack::new(STACK_SIZE).expect("create stylus default stack"), + move |yielder: &Yielder, input: CothreadInput| { + let store = input.store_mut(); + let function_env = input.function_env_mut(); + let instance = input.instance(); + + let send_yielder = SendYielder::new(yielder); + { + let env = function_env.as_mut(store); + env.yielder = Some(send_yielder.clone()); + } + install_unwinder(Some(Box::new(move |reason| { + send_yielder.suspend(Some(reason)); + }))); + + let start = instance + .exports + .get_typed_function::(&store, STYLUS_ENTRY_POINT) + .expect("fetching stylus entrypoint function!"); + + start.call(store, args_len as u32) + }, + ); + Self { + queue, + coroutine, + store, + instance, + function_env, + } + } + + pub fn input(&self) -> CothreadInput { + CothreadInput { + store: (&self.store) as *const _ as usize, + instance: (&self.instance) as *const _ as usize, + function_env: (&self.function_env) as *const _ as usize, + } + } +} + +impl CothreadInput { + // SAFETY: CothreadInput stores raw pointers (as usize) to fields owned by + // the parent Cothread, which outlives all uses. SP1 is single-threaded, + // so there are no data races. The &self -> &mut pattern is required because + // the coroutine API doesn't allow passing &mut across yield boundaries. + #[allow(clippy::mut_from_ref)] + pub fn store_mut(&self) -> &mut Store { + unsafe { &mut *(self.store as *mut _) } + } + + #[allow(clippy::mut_from_ref)] + pub fn function_env_mut(&self) -> &mut FunctionEnv { + unsafe { &mut *(self.function_env as *mut _) } + } + + pub fn instance(&self) -> &Instance { + unsafe { &*(self.instance as *const _) } + } +} + +#[derive(Default)] +pub struct MessageQueue { + tx: VecDeque, + rx: VecDeque, +} + +impl MessageQueue { + pub fn new() -> Arc> { + Arc::new(Mutex::new(Self::default())) + } + + pub fn send_from_cothread(&mut self, msg: MessageFromCothread) { + self.rx.push_back(msg); + } + + pub fn peek_from_cothread(&self) -> Option { + self.rx.front().cloned() + } + + pub fn mark_read_from_cothread(&mut self) { + self.rx.pop_front(); + // For now nitro uses rendezvous channel, this assertion will + // hold. + assert!(self.rx.is_empty()); + } + + pub fn send_to_cothread(&mut self, msg: MessageToCothread) { + self.tx.push_back(msg); + } + + pub fn read_to_cothread(&mut self) -> Option { + self.tx.pop_front() + } +} + +/// Wasmer custom env data for stylus programs +pub struct StylusCustomEnvData { + pub memory: Option, + pub meter: Option, + + pub calldata: Vec, + pub config: JitConfig, + pub evm_data: EvmData, + pub outs: Vec, + pub storage_cache: StorageCache, + + last_return_data: Option>, + last_code: Option<(Bytes20, Vec)>, + + queue: Arc>, + /// Value will be set every time current coroutine is invoked. + pub yielder: Option>, +} + +impl StylusCustomEnvData { + pub fn send_from_cothread(&mut self, msg: MessageFromCothread) { + self.queue.lock().expect("lock").send_from_cothread(msg); + } + + fn wait_next_message(&mut self) -> MessageToCothread { + const MAX_YIELD_ITERATIONS: usize = 10; + for _ in 0..MAX_YIELD_ITERATIONS { + if let Some(msg) = self.queue.lock().expect("lock").read_to_cothread() { + return msg; + } + self.yielder.as_ref().unwrap().suspend(None); + } + panic!("did not receive message to cothread after {MAX_YIELD_ITERATIONS} iterations"); + } + + pub fn request( + &mut self, + req_type: EvmApiMethod, + req_data: Vec, + ) -> (Vec, Vec, Gas) { + let msg = MessageFromCothread { + req_type: req_type as u32 + EVM_API_METHOD_REQ_OFFSET, + req_data, + }; + self.send_from_cothread(msg); + + let res = self.wait_next_message(); + (res.result, res.raw_data, res.cost) + } + + pub fn get_bytes32(&mut self, key: Bytes32, evm_api_gas_to_use: Gas) -> (Bytes32, Gas) { + let mut cost = self.storage_cache.read_gas(); + + if !self.storage_cache.contains_key(&key) { + let (res, _, gas) = self.request(EvmApiMethod::GetBytes32, key.to_vec()); + cost = cost.saturating_add(gas).saturating_add(evm_api_gas_to_use); + self.storage_cache + .insert(key, StorageWord::known(res.try_into().unwrap())); + } + + (self.storage_cache[&key].value, cost) + } + + pub fn cache_bytes32(&mut self, key: Bytes32, value: Bytes32) -> Gas { + let cost = self.storage_cache.write_gas(); + match self.storage_cache.entry(key) { + Entry::Occupied(mut key) => key.get_mut().value = value, + Entry::Vacant(slot) => drop(slot.insert(StorageWord::unknown(value))), + }; + cost + } + + pub fn flush_storage_cache( + &mut self, + clear: bool, + gas_left: Gas, + ) -> eyre::Result<(Gas, UserOutcomeKind)> { + let mut data = Vec::with_capacity(64 * self.storage_cache.len() + 8); + data.extend(gas_left.to_be_bytes()); + + for (key, value) in self.storage_cache.deref_mut() { + if value.dirty() { + data.extend(*key); + data.extend(*value.value); + value.known = Some(value.value); + } + } + if clear { + self.storage_cache.clear(); + } + if data.len() == 8 { + return Ok((Gas(0), UserOutcomeKind::Success)); // no need to make request + } + + let (res, _, cost) = self.request(EvmApiMethod::SetTrieSlots, data); + let status = res.first().copied().ok_or(eyre!("empty result!"))?; + let outcome = match status.try_into()? { + EvmApiStatus::Success => UserOutcomeKind::Success, + EvmApiStatus::WriteProtection => UserOutcomeKind::Revert, + EvmApiStatus::OutOfGas => UserOutcomeKind::OutOfInk, + _ => bail!("unexpect outcome"), + }; + Ok((cost, outcome)) + } + + pub fn get_transient_bytes32(&mut self, key: Bytes32) -> Bytes32 { + let (res, ..) = self.request(EvmApiMethod::GetTransientBytes32, key.to_vec()); + res.try_into().unwrap() + } + + pub fn set_transient_bytes32( + &mut self, + key: Bytes32, + value: Bytes32, + ) -> eyre::Result { + let mut data = Vec::with_capacity(64); + data.extend(key); + data.extend(value); + let (res, ..) = self.request(EvmApiMethod::SetTransientBytes32, data); + let status = res.first().copied().ok_or(eyre!("empty result!"))?; + let outcome = match status.try_into()? { + EvmApiStatus::Success => UserOutcomeKind::Success, + EvmApiStatus::WriteProtection => UserOutcomeKind::Revert, + _ => bail!("unexpect outcome"), + }; + + Ok(outcome) + } + + pub fn emit_log(&mut self, data: Vec, topics: u32) -> Result<(), Escape> { + let mut request = Vec::with_capacity(4 + data.len()); + request.extend(topics.to_be_bytes()); + request.extend(data); + + let (res, _, _) = self.request(EvmApiMethod::EmitLog, request); + if !res.is_empty() { + return Err(String::from_utf8(res) + .unwrap_or("malformed emit-log response".into()) + .into()); + } + Ok(()) + } + + pub fn account_balance(&mut self, address: Bytes20) -> (Bytes32, Gas) { + let (res, _, cost) = self.request(EvmApiMethod::AccountBalance, address.to_vec()); + (res.try_into().unwrap(), cost) + } + + pub fn account_code( + &mut self, + arbos_version: u64, + address: Bytes20, + gas_left: Gas, + ) -> (Vec, Gas) { + if let Some((stored_address, data)) = self.last_code.as_ref() + && address == *stored_address + { + return (data.clone(), Gas(0)); + } + let mut req = Vec::with_capacity(20 + 8); + req.extend(address); + req.extend(gas_left.to_be_bytes()); + + let (_, data, cost) = self.request(EvmApiMethod::AccountCode, req); + if !data.is_empty() || arbos_version < ARBOS_VERSION_STYLUS_LAST_CODE_CACHE_FIX { + self.last_code = Some((address, data.clone())); + } + (data, cost) + } + + pub fn account_codehash(&mut self, address: Bytes20) -> (Bytes32, Gas) { + let (res, _, cost) = self.request(EvmApiMethod::AccountCodeHash, address.to_vec()); + (res.try_into().unwrap(), cost) + } + + pub fn get_return_data(&self) -> Vec { + self.last_return_data.clone().expect("missing return data") + } + + fn create_request( + &mut self, + create_type: EvmApiMethod, + code: Vec, + endowment: Bytes32, + salt: Option, + gas: Gas, + ) -> (Result, u32, Gas) { + let mut request = Vec::with_capacity(8 + 2 * 32 + code.len()); + request.extend(gas.to_be_bytes()); + request.extend(endowment); + if let Some(salt) = salt { + request.extend(salt); + } + request.extend(code); + + let (mut res, data, cost) = self.request(create_type, request); + if res.len() != 21 || res[0] == 0 { + if !res.is_empty() { + res.remove(0); + } + let err_string = String::from_utf8(res).unwrap_or("create_response_malformed".into()); + return (Err(err_string), 0, cost); + } + res.remove(0); + let address = res.try_into().unwrap(); + let data_len = data.len() as u32; + self.last_return_data = Some(data); + (Ok(address), data_len, cost) + } + + pub fn create1( + &mut self, + code: Vec, + endowment: Bytes32, + gas: Gas, + ) -> (Result, u32, Gas) { + self.create_request(EvmApiMethod::Create1, code, endowment, None, gas) + } + + pub fn create2( + &mut self, + code: Vec, + endowment: Bytes32, + salt: Bytes32, + gas: Gas, + ) -> (Result, u32, Gas) { + self.create_request(EvmApiMethod::Create2, code, endowment, Some(salt), gas) + } + + pub fn parse_call_inputs( + &mut self, + memory: &MemoryView, + contract: Ptr, + data: Ptr, + gas: Gas, + data_len: u32, + value: Option, + ) -> Result { + let gas_left = self.gas_left()?; + let gas_req = gas.min(gas_left); + let contract = read_bytes20(contract, memory)?; + let input = read_slice(data, data_len as usize, memory)?; + let value = value.map(|x| read_bytes32(x, memory)).transpose()?; + Ok(CallInputs { + contract, + input, + gas_left, + gas_req, + value, + }) + } + + fn call_request( + &mut self, + call_type: EvmApiMethod, + contract: Bytes20, + input: &[u8], + gas_left: Gas, + gas_req: Gas, + value: Bytes32, + ) -> (u32, Gas, UserOutcomeKind) { + let mut request = Vec::with_capacity(20 + 32 + 8 + 8 + input.len()); + request.extend(contract); + request.extend(value); + request.extend(gas_left.to_be_bytes()); + request.extend(gas_req.to_be_bytes()); + request.extend(input); + + let (res, data, cost) = self.request(call_type, request); + let status: UserOutcomeKind = res[0].try_into().expect("unknown outcome"); + let data_len = data.len() as u32; + self.last_return_data = Some(data); + (data_len, cost, status) + } + + pub fn contract_call( + &mut self, + contract: Bytes20, + input: &[u8], + gas_left: Gas, + gas_req: Gas, + value: Bytes32, + ) -> (u32, Gas, UserOutcomeKind) { + self.call_request( + EvmApiMethod::ContractCall, + contract, + input, + gas_left, + gas_req, + value, + ) + } + + pub fn delegate_call( + &mut self, + contract: Bytes20, + input: &[u8], + gas_left: Gas, + gas_req: Gas, + ) -> (u32, Gas, UserOutcomeKind) { + self.call_request( + EvmApiMethod::DelegateCall, + contract, + input, + gas_left, + gas_req, + Bytes32::default(), + ) + } + + pub fn static_call( + &mut self, + contract: Bytes20, + input: &[u8], + gas_left: Gas, + gas_req: Gas, + ) -> (u32, Gas, UserOutcomeKind) { + self.call_request( + EvmApiMethod::StaticCall, + contract, + input, + gas_left, + gas_req, + Bytes32::default(), + ) + } + + pub fn add_pages(&mut self, pages: u16) -> Gas { + self.request(EvmApiMethod::AddPages, pages.to_be_bytes().to_vec()) + .2 + } + + pub fn meter_mut(&mut self) -> &mut MeterData { + self.meter.as_mut().expect("not metered") + } + + pub fn meter(&self) -> &MeterData { + self.meter.as_ref().expect("not metered") + } +} + +impl MeteredMachine for StylusCustomEnvData { + fn ink_left(&self) -> MachineMeter { + let vm = self.meter(); + match vm.status() { + 0 => MachineMeter::Ready(vm.ink()), + _ => MachineMeter::Exhausted, + } + } + + fn set_meter(&mut self, meter: MachineMeter) { + let vm = self.meter_mut(); + vm.set_ink(meter.ink()); + vm.set_status(meter.status()); + } +} + +impl GasMeteredMachine for StylusCustomEnvData { + fn pricing(&self) -> PricingParams { + self.config.stylus.pricing + } +} + +fn build_imports( + store: &mut Store, + calldata: Vec, + config: JitConfig, + evm_data: EvmData, + queue: Arc>, +) -> (Imports, FunctionEnv) { + let debug_funcs = config.compile.debug.debug_funcs; + + let env = StylusCustomEnvData { + memory: None, + meter: None, + calldata, + config, + evm_data, + outs: Vec::new(), + storage_cache: StorageCache::default(), + queue, + yielder: None, + last_code: None, + last_return_data: None, + }; + let func_env = FunctionEnv::new(store, env); + macro_rules! func { + ($func:expr) => { + Function::new_typed_with_env(store, &func_env, $func) + }; + } + + // TODO: this is not yet a complete list of hook APIs + let mut imports = imports! { + "vm_hooks" => { + "read_args" => func!(vm_hooks::read_args), + "write_result" => func!(vm_hooks::write_result), + "exit_early" => func!(vm_hooks::exit_early), + "storage_load_bytes32" => func!(vm_hooks::storage_load_bytes32), + "storage_cache_bytes32" => func!(vm_hooks::storage_cache_bytes32), + "storage_flush_cache" => func!(vm_hooks::storage_flush_cache), + "transient_load_bytes32" => func!(vm_hooks::transient_load_bytes32), + "transient_store_bytes32" => func!(vm_hooks::transient_store_bytes32), + "call_contract" => func!(vm_hooks::call_contract), + "delegate_call_contract" => func!(vm_hooks::delegate_call_contract), + "static_call_contract" => func!(vm_hooks::static_call_contract), + "create1" => func!(vm_hooks::create1), + "create2" => func!(vm_hooks::create2), + "read_return_data" => func!(vm_hooks::read_return_data), + "return_data_size" => func!(vm_hooks::return_data_size), + "emit_log" => func!(vm_hooks::emit_log), + "account_balance" => func!(vm_hooks::account_balance), + "account_code" => func!(vm_hooks::account_code), + "account_codehash" => func!(vm_hooks::account_codehash), + "account_code_size" => func!(vm_hooks::account_code_size), + "evm_gas_left" => func!(vm_hooks::evm_gas_left), + "evm_ink_left" => func!(vm_hooks::evm_ink_left), + "block_basefee" => func!(vm_hooks::block_basefee), + "chainid" => func!(vm_hooks::chainid), + "block_coinbase" => func!(vm_hooks::block_coinbase), + "block_gas_limit" => func!(vm_hooks::block_gas_limit), + "block_number" => func!(vm_hooks::block_number), + "block_timestamp" => func!(vm_hooks::block_timestamp), + "contract_address" => func!(vm_hooks::contract_address), + "math_div" => func!(vm_hooks::math_div), + "math_mod" => func!(vm_hooks::math_mod), + "math_pow" => func!(vm_hooks::math_pow), + "math_add_mod" => func!(vm_hooks::math_add_mod), + "math_mul_mod" => func!(vm_hooks::math_mul_mod), + "msg_reentrant" => func!(vm_hooks::msg_reentrant), + "msg_sender" => func!(vm_hooks::msg_sender), + "msg_value" => func!(vm_hooks::msg_value), + "tx_gas_price" => func!(vm_hooks::tx_gas_price), + "tx_ink_price" => func!(vm_hooks::tx_ink_price), + "tx_origin" => func!(vm_hooks::tx_origin), + "pay_for_memory_grow" => func!(vm_hooks::pay_for_memory_grow), + "native_keccak256" => func!(vm_hooks::native_keccak256), + } + }; + if debug_funcs { + imports.define("console", "log_txt", func!(debug::console_log_text)); + imports.define("console", "log_i32", func!(debug::console_log::)); + imports.define("console", "log_i64", func!(debug::console_log::)); + imports.define("console", "log_f32", func!(debug::console_log::)); + imports.define("console", "log_f64", func!(debug::console_log::)); + imports.define("console", "tee_i32", func!(debug::console_tee::)); + imports.define("console", "tee_i64", func!(debug::console_tee::)); + imports.define("console", "tee_f32", func!(debug::console_tee::)); + imports.define("console", "tee_f64", func!(debug::console_tee::)); + imports.define("debug", "null_host", func!(debug::null_host)); + imports.define("debug", "start_benchmark", func!(debug::start_benchmark)); + imports.define("debug", "end_benchmark", func!(debug::end_benchmark)); + } + (imports, func_env) +} + +#[derive(Clone)] +pub struct MessageToCothread { + pub result: Vec, + pub raw_data: Vec, + pub cost: Gas, +} + +#[derive(Clone)] +pub struct MessageFromCothread { + pub req_type: u32, + pub req_data: Vec, +} diff --git a/crates/sp1/runner/Cargo.toml b/crates/sp1/runner/Cargo.toml new file mode 100644 index 0000000000..b19e0d5548 --- /dev/null +++ b/crates/sp1/runner/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "sp1-runner" +description = "Runner utility for validating Arbitrum blocks in SP1" +version = "0.1.0" +edition = "2024" + +[dependencies] +sp1-core-executor = { workspace = true } +sp1-sdk = { workspace = true } +validation = { workspace = true, features = ["rkyv", "sp1"] } + +bincode = { workspace = true } +clap = { workspace = true, features = ["cargo", "derive"] } +rkyv = { workspace = true, features = ["indexmap-2", "bytes-1"] } +serde_json = { workspace = true } +stylus-compiler-program = { workspace = true } +tracing = { workspace = true } +tokio = { workspace = true } diff --git a/crates/sp1/runner/src/main.rs b/crates/sp1/runner/src/main.rs new file mode 100644 index 0000000000..c322d72cb8 --- /dev/null +++ b/crates/sp1/runner/src/main.rs @@ -0,0 +1,187 @@ +use std::{ops::Deref, sync::Arc, time::SystemTime}; + +use clap::{ArgAction, Parser, ValueEnum}; +use sp1_core_executor::{MinimalExecutor, Program}; +use sp1_sdk::{Elf, Prover, ProverClient, SP1Stdin}; +use validation::{ValidationInput, ValidationRequest}; + +#[derive(Debug, Parser)] +#[command(version, about, long_about = None)] +struct Cli { + /// Path to SP1 validation program, could be bootloaded one or the initial one. + #[arg(long)] + program: String, + + /// Path to SP1 stylus compiler program + #[arg(long)] + stylus_compiler_program: String, + + /// Arbitrum version. Used by the stylus compiler. + #[arg(long, default_value_t = 2)] + version: u16, + + /// Debug flag, by default it is true, when set in arguments this + /// flag will become false. Used by the stylus compiler. + #[arg(long, action = ArgAction::SetFalse, default_value_t = true)] + debug: bool, + + /// Block file + #[arg(long)] + block_file: String, + + /// Execution mode, fast is, well, faster, but normal mode provides + /// more diagnosis information, at the expense of longer running time + /// and more memory. + #[arg(value_enum, long, default_value_t = Mode::Fast)] + mode: Mode, +} + +#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, ValueEnum)] +enum Mode { + /// Fast mode without detailed opcode statistics + Fast, + + /// Normal mode + Normal, +} + +#[tokio::main] +async fn main() { + sp1_sdk::utils::setup_logger(); + + let cli = Cli::parse(); + + let input_data = build_input(&cli); + let stdin: SP1Stdin = bincode::deserialize(&input_data).expect("deserializing stdin"); + + let program_elf = Elf::from(std::fs::read(&cli.program).expect("read program")); + + let exit_code = match cli.mode { + Mode::Fast => { + let program = Arc::new(Program::from(&program_elf).expect("parse elf")); + + let mut executor = MinimalExecutor::simple(program); + for buf in stdin.buffer { + executor.with_input(&buf); + } + + let a = SystemTime::now(); + if executor.execute_chunk().is_some() { + eprintln!( + "Fast-mode execution failed: executor returned a trace chunk unexpectedly" + ); + std::process::exit(2); + } + let b = SystemTime::now(); + tracing::info!( + "Exit code: {}, cycles: {}, execution time: {:?}", + executor.exit_code(), + executor.global_clk(), + b.duration_since(a).unwrap(), + ); + + executor.exit_code() as i32 + } + Mode::Normal => { + let client = ProverClient::builder().cpu().build().await; + + let a = SystemTime::now(); + let (_output, report) = client.execute(program_elf, stdin).await.expect("run"); + let b = SystemTime::now(); + + tracing::info!( + "Completed execution, cycles: {}, execution time: {:?}", + report.total_instruction_count(), + b.duration_since(a).unwrap(), + ); + + tracing::info!("Syscalls:"); + for (code, count) in report.syscall_counts.iter() { + if *count > 0 { + tracing::info!(" {}: {}", code, count); + } + } + + tracing::info!("Cycle trackers:"); + for (entry, cycles) in &report.cycle_tracker { + tracing::info!(" {} consumed cycles: {}", entry, cycles); + } + + report.exit_code as i32 + } + }; + + std::process::exit(exit_code); +} + +// Build SP1 input from Arbitrum block. It is serialized to Vec, so +// we can easily inject debugging code to dump stdin when needed. +fn build_input(cli: &Cli) -> Vec { + let req = serde_json::from_slice::( + &std::fs::read(&cli.block_file).expect("read input block"), + ) + .expect("parse input block"); + + let mut input = ValidationInput::from_request(&req, "rv64").expect("request validation input"); + + // Compile wasm modules that don't have rv64 binaries via the SP1 stylus compiler. + if let Some(wasms) = req.user_wasms.get("wasm") { + for (module_hash, wasm) in wasms.iter() { + // rv64 binaries take precedence. This way when nitro introduces + // caching for rv64 binaries, no changes will be needed for runner. + if input.module_asms.contains_key(module_hash.deref()) { + continue; + } + let binary = run_in_sp1(cli, wasm.as_ref()); + input.module_asms.insert(**module_hash, binary); + } + } + + let binary_input = rkyv::to_bytes::(&input) + .expect("to bytes") + .to_vec(); + let mut stdin = SP1Stdin::new(); + stdin.write(&binary_input); + bincode::serialize(&stdin).expect("serialize with bincode") +} + +fn run_in_sp1(cli: &Cli, wasm: &[u8]) -> Vec { + let mut stdin = SP1Stdin::new(); + let compile_input = stylus_compiler_program::CompileInput { + version: cli.version, + debug: cli.debug, + wasm: wasm.to_vec(), + }; + stdin.write(&compile_input); + + let compiler_elf = std::fs::read(&cli.stylus_compiler_program).expect("read stylus program"); + let program = Arc::new(Program::from(&compiler_elf).expect("parse elf")); + + let mut executor = MinimalExecutor::simple(program); + for buf in stdin.buffer { + executor.with_input(&buf); + } + + let a = SystemTime::now(); + if executor.execute_chunk().is_some() { + eprintln!("Stylus compilation in SP1 failed: executor returned a trace chunk unexpectedly"); + std::process::exit(2); + } + let b = SystemTime::now(); + + if executor.exit_code() != 0 { + eprintln!( + "Stylus compiler exited with non-zero code: {}", + executor.exit_code() + ); + std::process::exit(executor.exit_code() as i32); + } + tracing::info!( + "Completed stylus compilation in SP1, cycles: {}, execution time: {:?}", + executor.global_clk(), + b.duration_since(a).unwrap(), + ); + + let public_value_stream = executor.into_public_values_stream(); + bincode::deserialize(&public_value_stream).expect("deserialize") +} diff --git a/crates/sp1/stylus-compiler-program/Cargo.toml b/crates/sp1/stylus-compiler-program/Cargo.toml new file mode 100644 index 0000000000..c15e3fba12 --- /dev/null +++ b/crates/sp1/stylus-compiler-program/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "stylus-compiler-program" +description = "SP1 program wrapping wasmer singlepass compiler for provable compilation" +version = "0.1.0" +edition = "2024" +authors.workspace = true +homepage.workspace = true +license.workspace = true +publish.workspace = true +repository.workspace = true +rust-version.workspace = true + +[dependencies] +anyhow = { workspace = true } +serde = { workspace = true, features = ["derive"] } +sp1-zkvm = { workspace = true } +wasmer = { workspace = true, features = ["sys", "compiler", "singlepass"] } +prover = { workspace = true, features = ["native"] } diff --git a/crates/sp1/stylus-compiler-program/src/lib.rs b/crates/sp1/stylus-compiler-program/src/lib.rs new file mode 100644 index 0000000000..fe0cc7e9c7 --- /dev/null +++ b/crates/sp1/stylus-compiler-program/src/lib.rs @@ -0,0 +1,54 @@ +use std::{str::FromStr, sync::Arc}; + +use anyhow::{Context, Result}; +use prover::programs::{ + MiddlewareWrapper, config::CompileConfig, depth::DepthChecker, dynamic::DynamicMeter, + heap::HeapBound, meter::Meter, start::StartMover, +}; +use serde::{Deserialize, Serialize}; +use wasmer::{ + Module, Store, + sys::{CompilerConfig, CpuFeature, EngineBuilder, Singlepass, Target, Triple}, +}; + +/// Input parameters for Stylus WASM compilation. +#[derive(Serialize, Deserialize)] +pub struct CompileInput { + pub version: u16, + pub debug: bool, + pub wasm: Vec, +} + +/// Compiles a Stylus WASM program to a rv64 binary using the wasmer singlepass compiler. +/// +/// Applies the same middleware stack used in the standard Stylus compilation pipeline: +/// `StartMover`, `Meter`, `DynamicMeter`, `DepthChecker`, and `HeapBound`. +pub fn compile(input: &CompileInput) -> Result> { + let compile_config = CompileConfig::version(input.version, input.debug); + let mut config = Singlepass::new(); + config.canonicalize_nans(true); + config.enable_verifier(); + + let start = MiddlewareWrapper::new(StartMover::new(compile_config.debug.debug_info)); + let meter = MiddlewareWrapper::new(Meter::new(&compile_config.pricing)); + let dygas = MiddlewareWrapper::new(DynamicMeter::new(&compile_config.pricing)); + let depth = MiddlewareWrapper::new(DepthChecker::new(compile_config.bounds)); + let bound = MiddlewareWrapper::new(HeapBound::new(compile_config.bounds)); + + config.push_middleware(Arc::new(start)); + config.push_middleware(Arc::new(meter)); + config.push_middleware(Arc::new(dygas)); + config.push_middleware(Arc::new(depth)); + config.push_middleware(Arc::new(bound)); + + let triple = + Triple::from_str("riscv64").map_err(|e| anyhow::anyhow!("invalid target triple: {e}"))?; + let engine = EngineBuilder::new(config) + .set_target(Some(Target::new(triple, CpuFeature::set()))) + .engine(); + + let store = Store::new(engine); + let module = Module::new(&store, &input.wasm).context("wasm compilation failed")?; + let rv64_binary = module.serialize().context("module serialization failed")?; + Ok(rv64_binary.to_vec()) +} diff --git a/crates/sp1/stylus-compiler-program/src/main.rs b/crates/sp1/stylus-compiler-program/src/main.rs new file mode 100644 index 0000000000..ac7989ca22 --- /dev/null +++ b/crates/sp1/stylus-compiler-program/src/main.rs @@ -0,0 +1,21 @@ +#![cfg_attr(target_os = "zkvm", no_main)] + +#[cfg(target_os = "zkvm")] +sp1_zkvm::entrypoint!(main); + +fn main() { + let input = sp1_zkvm::io::read::(); + let rv64_binary = stylus_compiler_program::compile(&input).expect("stylus compilation failed"); + sp1_zkvm::io::commit(&rv64_binary); +} + +// Those are referenced by wasmer runtimes, but are never invoked +#[unsafe(no_mangle)] +pub extern "C" fn __negdf2(_x: f64) -> f64 { + unreachable!() +} + +#[unsafe(no_mangle)] +pub extern "C" fn __negsf2(_x: f32) -> f32 { + unreachable!() +} diff --git a/crates/sp1/stylus-compiler-runner/Cargo.toml b/crates/sp1/stylus-compiler-runner/Cargo.toml new file mode 100644 index 0000000000..73db6d2d6f --- /dev/null +++ b/crates/sp1/stylus-compiler-runner/Cargo.toml @@ -0,0 +1,24 @@ +[package] +name = "stylus-compiler-runner" +version = "0.1.0" +authors.workspace = true +edition.workspace = true +homepage.workspace = true +license.workspace = true +publish.workspace = true +repository.workspace = true +rust-version.workspace = true + +[[bin]] +name = "stylus-compiler-runner" +path = "main.rs" + +[dependencies] +bincode = { workspace = true } +clap = { workspace = true, features = ["derive"] } +sp1-sdk = { workspace = true, features = ["blocking"] } +stylus-compiler-program = { workspace = true } +tracing = { workspace = true } + +[build-dependencies] +sp1-build = { workspace = true } diff --git a/crates/sp1/stylus-compiler-runner/build.rs b/crates/sp1/stylus-compiler-runner/build.rs new file mode 100644 index 0000000000..fe835dd2e6 --- /dev/null +++ b/crates/sp1/stylus-compiler-runner/build.rs @@ -0,0 +1,5 @@ +use sp1_build::build_program_with_args; + +fn main() { + build_program_with_args("../stylus-compiler-program", Default::default()) +} diff --git a/crates/sp1/stylus-compiler-runner/main.rs b/crates/sp1/stylus-compiler-runner/main.rs new file mode 100644 index 0000000000..25167fa544 --- /dev/null +++ b/crates/sp1/stylus-compiler-runner/main.rs @@ -0,0 +1,125 @@ +use std::path::PathBuf; + +use clap::{Parser, Subcommand}; +use sp1_sdk::{ + Elf, ProvingKey, SP1Stdin, + blocking::{ProveRequest, Prover, ProverClient}, + include_elf, +}; +use stylus_compiler_program::{CompileInput, compile}; + +const COMPILER_ELF: Elf = include_elf!("stylus-compiler-program"); + +#[derive(Parser)] +#[command(about = "Run the Stylus WASM compiler in various execution modes")] +struct Cli { + #[command(subcommand)] + command: Command, + + /// Path to the Stylus WASM binary to compile. + #[arg(default_value = "crates/sp1/stylus-compiler-runner/testdata/memory.wasm")] + wasm: PathBuf, + + /// Arbitrum version passed to the Stylus compiler. + #[arg(long, default_value_t = 2)] + version: u16, + + /// Enable debug compilation mode. + #[arg(long)] + debug: bool, +} + +#[derive(Subcommand)] +enum Command { + /// Compile the WASM natively using the host Stylus compiler. + /// + /// Uses the same wasmer singlepass pipeline as the SP1 program, but runs + /// directly on the host without any zkVM overhead. Useful for quick + /// iteration and as a reference output for comparison. + Native, + + /// Compile the WASM inside SP1 in fast execution mode (no proof). + /// + /// Runs the stylus-compiler-program ELF through SP1's MinimalExecutor. + /// Fast and lightweight — validates that the SP1 program executes correctly + /// without the cost of proof generation. + Execute, + + /// Compile the WASM inside SP1 and generate a validity proof. + /// + /// Runs the stylus-compiler-program ELF through the full SP1 prover, + /// producing a proof that the compilation was executed correctly. + /// Slower than `execute` but provides cryptographic guarantees. + Prove, + + /// Compile natively and via SP1, then assert the outputs match. + /// + /// Runs both `native` and `execute` and compares the resulting rv64 + /// binaries byte-for-byte. Useful for verifying that the SP1 program + /// faithfully reproduces the native compilation result. + Compare, +} + +fn main() { + sp1_sdk::utils::setup_logger(); + + let cli = Cli::parse(); + let wasm = std::fs::read(&cli.wasm).expect("failed to read wasm file"); + let input = CompileInput { + version: cli.version, + debug: cli.debug, + wasm, + }; + + match cli.command { + Command::Native => { + let binary = compile(&input).expect("native compilation failed"); + tracing::info!("compiled successfully, output size: {} bytes", binary.len()); + } + Command::Execute => { + let binary = sp1_execute(&input); + tracing::info!( + "SP1 execution completed, output size: {} bytes", + binary.len() + ); + } + Command::Prove => sp1_prove(&input), + Command::Compare => { + let native = compile(&input).expect("native compilation failed"); + let sp1 = sp1_execute(&input); + assert_eq!(native, sp1, "native and SP1 outputs differ"); + tracing::info!("outputs match ({} bytes)", native.len()); + } + } +} + +fn build_stdin(input: &CompileInput) -> SP1Stdin { + let mut stdin = SP1Stdin::new(); + stdin.write(input); + stdin +} + +fn sp1_execute(input: &CompileInput) -> Vec { + let client = ProverClient::from_env(); + let stdin = build_stdin(input); + let (output, report) = client + .execute(COMPILER_ELF, stdin) + .run() + .expect("SP1 execution failed"); + tracing::info!("cycles: {}", report.total_instruction_count()); + bincode::deserialize(output.as_slice()).expect("deserialize output") +} + +fn sp1_prove(input: &CompileInput) { + let client = ProverClient::from_env(); + let stdin = build_stdin(input); + let pk = client.setup(COMPILER_ELF).expect("failed to setup ELF"); + let proof = client + .prove(&pk, stdin) + .run() + .expect("failed to generate proof"); + client + .verify(&proof, pk.verifying_key(), None) + .expect("failed to verify proof"); + tracing::info!("proof generated and verified successfully"); +} diff --git a/crates/sp1/stylus-compiler-runner/testdata/memory.wasm b/crates/sp1/stylus-compiler-runner/testdata/memory.wasm new file mode 100644 index 0000000000..6815d2475a Binary files /dev/null and b/crates/sp1/stylus-compiler-runner/testdata/memory.wasm differ diff --git a/crates/tools/module_roots/Cargo.lock b/crates/tools/module_roots/Cargo.lock index 948514f988..a2d15c0dcd 100644 --- a/crates/tools/module_roots/Cargo.lock +++ b/crates/tools/module_roots/Cargo.lock @@ -1161,9 +1161,9 @@ checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "js-sys" -version = "0.3.92" +version = "0.3.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc4c90f45aa2e6eacbe8645f77fdea542ac97a494bcd117a67df9ff4d611f995" +checksum = "797146bb2677299a1eb6b7b50a890f4c361b29ef967addf5b2fa45dae1bb6d7d" dependencies = [ "once_cell", "wasm-bindgen", @@ -2529,9 +2529,9 @@ dependencies = [ [[package]] name = "wasm-bindgen" -version = "0.2.115" +version = "0.2.116" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6523d69017b7633e396a89c5efab138161ed5aafcbc8d3e5c5a42ae38f50495a" +checksum = "7dc0882f7b5bb01ae8c5215a1230832694481c1a4be062fd410e12ea3da5b631" dependencies = [ "cfg-if", "once_cell", @@ -2542,9 +2542,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.115" +version = "0.2.116" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e3a6c758eb2f701ed3d052ff5737f5bfe6614326ea7f3bbac7156192dc32e67" +checksum = "75973d3066e01d035dbedaad2864c398df42f8dd7b1ea057c35b8407c015b537" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2552,9 +2552,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.115" +version = "0.2.116" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "921de2737904886b52bcbb237301552d05969a6f9c40d261eb0533c8b055fedf" +checksum = "91af5e4be765819e0bcfee7322c14374dc821e35e72fa663a830bbc7dc199eac" dependencies = [ "bumpalo", "proc-macro2", @@ -2565,9 +2565,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.115" +version = "0.2.116" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a93e946af942b58934c604527337bad9ae33ba1d5c6900bbb41c2c07c2364a93" +checksum = "c9bf0406a78f02f336bf1e451799cca198e8acde4ffa278f0fb20487b150a633" dependencies = [ "unicode-ident", ] diff --git a/crates/tools/wasmer b/crates/tools/wasmer index 1c2d13dbc8..537a034c36 160000 --- a/crates/tools/wasmer +++ b/crates/tools/wasmer @@ -1 +1 @@ -Subproject commit 1c2d13dbc8b3d0af8eedd0c7d43f0108c15bf332 +Subproject commit 537a034c36d71425d07eddb73802de6b7d1a6947 diff --git a/crates/validation/Cargo.toml b/crates/validation/Cargo.toml index 0ca87eac16..af5a568dd7 100644 --- a/crates/validation/Cargo.toml +++ b/crates/validation/Cargo.toml @@ -20,3 +20,4 @@ serde_with = { workspace = true, features = ["base64"] } [features] default = [] rkyv = ["dep:rkyv"] +sp1 = [] diff --git a/crates/validation/src/lib.rs b/crates/validation/src/lib.rs index ec2ce95daa..c2562e0e60 100644 --- a/crates/validation/src/lib.rs +++ b/crates/validation/src/lib.rs @@ -60,7 +60,7 @@ impl ValidationInput { for (module_hash, wasm) in user_wasms { module_asms.insert(**module_hash, wasm.as_vec()); } - } else { + } else if !cfg!(feature = "sp1") { for (arch, wasms) in &req.user_wasms { if !wasms.is_empty() { return Err(format!("bad stylus arch: got {arch}, expected {target}")); @@ -147,7 +147,6 @@ impl AsRef<[u8]> for UserWasm { } } -/// The `Vec` is assumed to be compressed using `brotli`, and must be decompressed before use. impl TryFrom> for UserWasm { type Error = brotli::BrotliStatus; diff --git a/system_tests/program_test.go b/system_tests/program_test.go index 61e03fc682..ebc7d2223d 100644 --- a/system_tests/program_test.go +++ b/system_tests/program_test.go @@ -435,7 +435,7 @@ func storageTest(t *testing.T, jit bool) { // Captures a block_inputs json file for the block that included the // storage write transaction. Include wasm targets necessary for arbitrator prover and jit binaries - recordBlock(t, receipt.BlockNumber.Uint64(), builder, rawdb.TargetWavm, rawdb.LocalTarget()) + recordBlock(t, receipt.BlockNumber.Uint64(), builder, rawdb.TargetWavm, rawdb.TargetWasm, rawdb.LocalTarget()) } func TestProgramTransientStorage(t *testing.T) {