From 45f3409f587877764f41e4e5e7dd74f1c067c016 Mon Sep 17 00:00:00 2001 From: Gabriel Coutinho de Paula Date: Mon, 16 Dec 2024 10:02:46 -0300 Subject: [PATCH] refactor: refactor build and tests pipeline * introduce `just` and rewrite makefiles into justfiles * unify all cargo workspaces into a single cargo workspace; * unify all Dockerfiles into a single Dockerfile; * implement anvil deployments as state dumps and loads; * update `blockchain-reader` tests to load anvil state; * Change PRT time from timestamp to block number; * refactor `echo` program build; * implement node state directory configuration; * update PRT tests to newest changes; * simplify `machine-runner` test; * fix `persistent-state-access` tests; * add ci (check/fmt/build/test) with cache; * add machine bindings to workspace; * rename `rollups-compute-runner` to `rollups-prt-runner`; * extract `prt/tests` shared modules into `prt/tests/common` dir; * remove `step` dependency on `CanonicalConstants`; * remove unused files. --- .dockerignore | 86 +- {doc => .github}/assets/dave-img.jpeg | Bin .github/workflows/build.yml | 53 +- .gitignore | 10 +- AUTHORS | 1 + prt/tests/compute-rs/Cargo.lock => Cargo.lock | 1372 ++++-- Cargo.toml | 96 + README.md | 7 +- cartesi-rollups/Makefile | 17 - .../bindings-rs}/Cargo.toml | 2 +- .../bindings-rs}/README.md | 0 .../contracts/bindings-rs/src/.gitignore | 1 + .../contracts/bindings-rs}/src/lib.rs | 1 + cartesi-rollups/contracts/justfile | 50 + cartesi-rollups/node/Cargo.lock | 3743 ----------------- cartesi-rollups/node/Cargo.toml | 49 - cartesi-rollups/node/Dockerfile.test | 37 - .../node/blockchain-reader/Cargo.toml | 9 +- .../node/blockchain-reader/src/lib.rs | 189 +- cartesi-rollups/node/dave-rollups/Cargo.toml | 5 +- cartesi-rollups/node/dave-rollups/src/lib.rs | 9 +- cartesi-rollups/node/dave-rollups/src/main.rs | 2 +- .../node/machine-runner/src/lib.rs | 384 +- .../machine-runner/test-files/inputs.test | 10 - .../test-files/machine_state_hashes.test | 11 - .../machine-runner/test-files/split_inputs.sh | 28 - .../{compute-runner => prt-runner}/Cargo.toml | 2 +- .../{compute-runner => prt-runner}/src/lib.rs | 7 +- .../node/rollups-test-entrypoint.sh | 4 - cartesi-rollups/node/state-manager/Cargo.toml | 6 +- cartesi-rollups/node/state-manager/src/lib.rs | 11 +- .../src/persistent_state_access.rs | 4 +- common-rs/Cargo.toml | 21 - common-rs/merkle/Cargo.toml | 5 +- common-rs/merkle/src/digest/keccak.rs | 1 - justfile | 58 + .../cartesi-machine-sys/Cargo.toml | 3 + .../cartesi-machine-sys/build.rs | 372 +- .../cartesi-machine/src/proof.rs | 5 +- prt/Makefile | 17 - prt/client-lua/player/reader.lua | 2 +- prt/client-rs/Cargo.toml | 38 - prt/client-rs/core/Cargo.toml | 46 + prt/client-rs/{ => core}/src/arena/arena.rs | 14 +- prt/client-rs/{ => core}/src/arena/config.rs | 0 prt/client-rs/{ => core}/src/arena/mod.rs | 0 prt/client-rs/{ => core}/src/arena/reader.rs | 6 +- prt/client-rs/{ => core}/src/arena/sender.rs | 0 .../{ => core}/src/db/compute_state_access.rs | 44 +- prt/client-rs/{ => core}/src/db/mod.rs | 0 .../{ => core}/src/db/sql/compute_data.rs | 0 prt/client-rs/{ => core}/src/db/sql/error.rs | 0 .../{ => core}/src/db/sql/migrations.rs | 0 .../{ => core}/src/db/sql/migrations.sql | 0 prt/client-rs/{ => core}/src/db/sql/mod.rs | 0 prt/client-rs/{ => core}/src/lib.rs | 0 .../{ => core}/src/machine/commitment.rs | 0 .../src/machine/commitment_builder.rs | 0 .../{ => core}/src/machine/constants.rs | 0 .../{ => core}/src/machine/instance.rs | 0 prt/client-rs/{ => core}/src/machine/mod.rs | 0 prt/client-rs/{ => core}/src/strategy/gc.rs | 16 +- prt/client-rs/{ => core}/src/strategy/mod.rs | 0 .../{ => core}/src/strategy/player.rs | 14 +- prt/client-rs/executable/Cargo.toml | 22 + .../executable}/Dockerfile | 2 +- .../executable}/Makefile | 0 .../executable}/README.md | 0 .../executable}/src/lib.rs | 5 + .../executable}/src/main.rs | 5 +- .../bindings-rs}/Cargo.toml | 3 +- .../bindings-rs}/README.md | 0 prt/contracts/bindings-rs/src/.gitignore | 1 + .../contracts/bindings-rs}/src/lib.rs | 1 + prt/contracts/justfile | 31 + prt/contracts/src/CanonicalConstants.sol | 4 - prt/contracts/src/ITournament.sol | 6 +- .../tournament/abstracts/LeafTournament.sol | 24 +- prt/contracts/src/tournament/libs/Clock.sol | 2 +- prt/contracts/src/tournament/libs/Time.sol | 2 +- prt/contracts/test/Clock.t.sol | 4 +- prt/contracts/test/MultiTournament.t.sol | 26 +- prt/contracts/test/Tournament.t.sol | 12 +- prt/measure_constants/Makefile | 2 +- .../blockchain/constants.lua | 0 .../{compute => common}/blockchain/node.lua | 22 +- .../{compute => common}/blockchain/utils.lua | 9 +- .../runners/helpers/dummy_commitment.lua | 0 .../runners/helpers/fake_commitment.lua | 2 +- .../runners/helpers/idle_strategy.lua | 0 .../runners/hero_runner.lua | 0 .../runners/idle_runner.lua | 0 .../runners/rust_hero_runner.lua | 0 .../runners/sybil_runner.lua | 0 .../utils => common/test_utils}/example.lua | 10 +- .../test_utils}/scoped_require.lua | 0 .../utils => common/test_utils}/test.lua | 0 prt/tests/compute-rs/Cargo.toml | 25 - prt/tests/compute/program/doom/Dockerfile | 2 +- prt/tests/compute/prt_compute.lua | 4 +- prt/tests/compute/setup_path.lua | 1 + prt/tests/rollups/.gitignore | 2 + prt/tests/rollups/Dockerfile | 66 - prt/tests/rollups/Makefile | 18 - prt/tests/rollups/README.md | 5 +- prt/tests/rollups/dave/node.lua | 12 +- prt/tests/rollups/justfile | 11 + prt/tests/rollups/program/.dockerignore | 1 - prt/tests/rollups/program/.gitignore | 1 - prt/tests/rollups/program/echo/.gitignore | 1 - prt/tests/rollups/program/echo/Dockerfile | 13 - prt/tests/rollups/program/echo/README.md | 10 - .../rollups/program/echo/gen_machine_echo.sh | 5 - prt/tests/rollups/prt_rollups.lua | 40 +- prt/tests/rollups/setup_path.lua | 2 +- test/Dockerfile | 114 + test/programs/.gitignore | 9 + test/programs/build_anvil_state.sh | 36 + test/programs/echo/.gitkeep | 0 test/programs/justfile | 27 + 120 files changed, 2186 insertions(+), 5282 deletions(-) rename {doc => .github}/assets/dave-img.jpeg (100%) rename prt/tests/compute-rs/Cargo.lock => Cargo.lock (72%) create mode 100644 Cargo.toml delete mode 100644 cartesi-rollups/Makefile rename cartesi-rollups/{contract-bindings => contracts/bindings-rs}/Cargo.toml (85%) rename cartesi-rollups/{contract-bindings => contracts/bindings-rs}/README.md (100%) create mode 100644 cartesi-rollups/contracts/bindings-rs/src/.gitignore rename {prt/contract-bindings => cartesi-rollups/contracts/bindings-rs}/src/lib.rs (69%) create mode 100644 cartesi-rollups/contracts/justfile delete mode 100644 cartesi-rollups/node/Cargo.lock delete mode 100644 cartesi-rollups/node/Cargo.toml delete mode 100644 cartesi-rollups/node/Dockerfile.test delete mode 100644 cartesi-rollups/node/machine-runner/test-files/inputs.test delete mode 100644 cartesi-rollups/node/machine-runner/test-files/machine_state_hashes.test delete mode 100755 cartesi-rollups/node/machine-runner/test-files/split_inputs.sh rename cartesi-rollups/node/{compute-runner => prt-runner}/Cargo.toml (92%) rename cartesi-rollups/node/{compute-runner => prt-runner}/src/lib.rs (93%) delete mode 100755 cartesi-rollups/node/rollups-test-entrypoint.sh delete mode 100644 common-rs/Cargo.toml create mode 100644 justfile delete mode 100644 prt/Makefile delete mode 100644 prt/client-rs/Cargo.toml create mode 100644 prt/client-rs/core/Cargo.toml rename prt/client-rs/{ => core}/src/arena/arena.rs (92%) rename prt/client-rs/{ => core}/src/arena/config.rs (100%) rename prt/client-rs/{ => core}/src/arena/mod.rs (100%) rename prt/client-rs/{ => core}/src/arena/reader.rs (99%) rename prt/client-rs/{ => core}/src/arena/sender.rs (100%) rename prt/client-rs/{ => core}/src/db/compute_state_access.rs (94%) rename prt/client-rs/{ => core}/src/db/mod.rs (100%) rename prt/client-rs/{ => core}/src/db/sql/compute_data.rs (100%) rename prt/client-rs/{ => core}/src/db/sql/error.rs (100%) rename prt/client-rs/{ => core}/src/db/sql/migrations.rs (100%) rename prt/client-rs/{ => core}/src/db/sql/migrations.sql (100%) rename prt/client-rs/{ => core}/src/db/sql/mod.rs (100%) rename prt/client-rs/{ => core}/src/lib.rs (100%) rename prt/client-rs/{ => core}/src/machine/commitment.rs (100%) rename prt/client-rs/{ => core}/src/machine/commitment_builder.rs (100%) rename prt/client-rs/{ => core}/src/machine/constants.rs (100%) rename prt/client-rs/{ => core}/src/machine/instance.rs (100%) rename prt/client-rs/{ => core}/src/machine/mod.rs (100%) rename prt/client-rs/{ => core}/src/strategy/gc.rs (85%) rename prt/client-rs/{ => core}/src/strategy/mod.rs (100%) rename prt/client-rs/{ => core}/src/strategy/player.rs (97%) create mode 100644 prt/client-rs/executable/Cargo.toml rename prt/{tests/compute-rs => client-rs/executable}/Dockerfile (97%) rename prt/{tests/compute-rs => client-rs/executable}/Makefile (100%) rename prt/{tests/compute-rs => client-rs/executable}/README.md (100%) rename prt/{tests/compute-rs => client-rs/executable}/src/lib.rs (83%) rename prt/{tests/compute-rs => client-rs/executable}/src/main.rs (95%) rename prt/{contract-bindings => contracts/bindings-rs}/Cargo.toml (85%) rename prt/{contract-bindings => contracts/bindings-rs}/README.md (100%) create mode 100644 prt/contracts/bindings-rs/src/.gitignore rename {cartesi-rollups/contract-bindings => prt/contracts/bindings-rs}/src/lib.rs (69%) create mode 100644 prt/contracts/justfile rename prt/tests/{compute => common}/blockchain/constants.lua (100%) rename prt/tests/{compute => common}/blockchain/node.lua (60%) rename prt/tests/{compute => common}/blockchain/utils.lua (75%) rename prt/tests/{compute => common}/runners/helpers/dummy_commitment.lua (100%) rename prt/tests/{compute => common}/runners/helpers/fake_commitment.lua (98%) rename prt/tests/{compute => common}/runners/helpers/idle_strategy.lua (100%) rename prt/tests/{compute => common}/runners/hero_runner.lua (100%) rename prt/tests/{compute => common}/runners/idle_runner.lua (100%) rename prt/tests/{compute => common}/runners/rust_hero_runner.lua (100%) rename prt/tests/{compute => common}/runners/sybil_runner.lua (100%) rename prt/tests/{compute/utils => common/test_utils}/example.lua (89%) rename prt/tests/{compute/utils => common/test_utils}/scoped_require.lua (100%) rename prt/tests/{compute/utils => common/test_utils}/test.lua (100%) delete mode 100644 prt/tests/compute-rs/Cargo.toml create mode 100644 prt/tests/rollups/.gitignore delete mode 100644 prt/tests/rollups/Dockerfile delete mode 100644 prt/tests/rollups/Makefile create mode 100644 prt/tests/rollups/justfile delete mode 100644 prt/tests/rollups/program/.dockerignore delete mode 100644 prt/tests/rollups/program/.gitignore delete mode 100644 prt/tests/rollups/program/echo/.gitignore delete mode 100644 prt/tests/rollups/program/echo/Dockerfile delete mode 100644 prt/tests/rollups/program/echo/README.md delete mode 100755 prt/tests/rollups/program/echo/gen_machine_echo.sh create mode 100644 test/Dockerfile create mode 100644 test/programs/.gitignore create mode 100755 test/programs/build_anvil_state.sh create mode 100644 test/programs/echo/.gitkeep create mode 100644 test/programs/justfile diff --git a/.dockerignore b/.dockerignore index fa3a0e9e..7accd31e 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,6 +1,80 @@ -.vscode -/**/target/ -/**/snapshots/ -Cargo.lock -/**/compute_data/ -/**/rollups_data/ +**/.git +**/.github +**/.venv +**/.vscode +**/.DS_Store + +**/target/ + +**/_state/ +**/snapshots/ +**/compute_data/ +**/rollups_data/ + +**/out/ +**/cache/ + +test/programs/linux.bin +test/programs/rootfs.ext2 +test/programs/**/machine-image/ +test/programs/**/addresses +test/programs/**/anvil_state.json +test/programs/**/_anvil.log + +cartesi-rollups/contracts/bindings-rs/src/contract/ +prt/contracts/bindings-rs/src/contract/ + +prt/tests/compute/outputs/ +prt/tests/compute/pixels/ + +machine/emulator/**/*.o +machine/emulator/**/*.swp +machine/emulator/**/*.d +machine/emulator/**/*.pb.cc +machine/emulator/**/*.pb.h +machine/emulator/**/*.gcno +machine/emulator/**/*.so +machine/emulator/**/*.dtb +machine/emulator/**/*.bin +machine/emulator/**/*.md +machine/emulator/**/*.deb + +machine/emulator/src/*.pb.h +machine/emulator/src/*.pb.cc +machine/emulator/src/*.ext2 +machine/emulator/src/*.bin +machine/emulator/src/*.gcno +machine/emulator/src/*.gcov +machine/emulator/src/*.gcda +machine/emulator/src/*.profraw +machine/emulator/src/compile_flags.txt +machine/emulator/src/coverage* +machine/emulator/src/jsonrpc-discover.cpp +machine/emulator/src/machine-c-version.h + +machine/emulator/build +machine/emulator/third-party/downloads +machine/emulator/src/cartesi-machine-client +machine/emulator/src/cartesi-machine-server +machine/emulator/src/cartesi-machine-hash +machine/emulator/doc/ + +machine/emulator/**/*.clang-tidy +machine/emulator/**/*.a +machine/emulator/**/*.lib +machine/emulator/**/*.wasm +machine/emulator/**/*.tar.gz +machine/emulator/**/*.raw +machine/emulator/**/*.so +machine/emulator/**/*.dll +machine/emulator/**/*.exe +machine/emulator/**/*.dylib +machine/emulator/**/*.dtb +machine/emulator/**/*.tmp +machine/emulator/**/*.ld +machine/emulator/**/*.elf +machine/emulator/**/*.bin + +machine/emulator/uarch/uarch-pristine-hash.c +machine/emulator/uarch/uarch-pristine-ram.c +machine/emulator/uarch/compute-uarch-pristine-hash diff --git a/doc/assets/dave-img.jpeg b/.github/assets/dave-img.jpeg similarity index 100% rename from doc/assets/dave-img.jpeg rename to .github/assets/dave-img.jpeg diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6975939d..a436d1dc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,5 +1,6 @@ name: Build -on: [push] +on: + push: jobs: build: runs-on: ubuntu-22.04 @@ -7,14 +8,58 @@ jobs: - uses: actions/checkout@v3 with: submodules: recursive + + - name: Set up cache for Foundry + uses: actions/cache@v3 + with: + path: ~/.foundry + key: ${{ runner.os }}-foundry-${{ hashFiles('**/foundry.toml') }} + restore-keys: | + ${{ runner.os }}-foundry- + - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 with: version: nightly + - name: Install just + uses: extractions/setup-just@v2 + - name: Build, format check and test working-directory: ./prt/contracts run: | - forge build - forge fmt --check - forge test + just check-fmt + just build-smart-contracts + just test + + - name: Set up cache for Cargo + uses: actions/cache@v3 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-cargo- + + - name: Deps + run: | + export CARTESI_MACHINE_VERSION=0.18.1 + sudo apt-get install -y libboost-all-dev lua5.4 libslirp0 + wget https://github.com/cartesi/machine-emulator/releases/download/v0.18.1/cartesi-machine-v${CARTESI_MACHINE_VERSION}_amd64.deb + sudo dpkg -i ./cartesi-machine-v${CARTESI_MACHINE_VERSION}_amd64.deb + rm ./cartesi-machine-v${CARTESI_MACHINE_VERSION}_amd64.deb + + - name: Rust fmt and check + run: | + just setup + just check-fmt-rust-workspace + just check-rust-workspace + + - name: Rust build + run: | + just build-rust-workspace + + - name: Rust test workspace + run: | + just test-rust-workspace diff --git a/.gitignore b/.gitignore index 413011fc..fb60df7d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,16 +1,10 @@ .bin .env .vscode -.DS_Store +**/.DS_Store **/.idea/ target/ -snapshots/ -common-rs/Cargo.lock -prt/client-rs/Cargo.lock -prt/tests/compute/outputs/ -prt/tests/compute/pixels/ node_modules -**/contract-bindings/src/contract -**/contract-bindings/Cargo.lock +**/snapshots/ **/compute_data/ **/rollups_data/ diff --git a/AUTHORS b/AUTHORS index 87afca4a..6333ac3b 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,2 +1,3 @@ Gabriel Coutinho de Paula +Guilherme Dantas Stephen Chen <20940639+stephenctw@users.noreply.github.com> diff --git a/prt/tests/compute-rs/Cargo.lock b/Cargo.lock similarity index 72% rename from prt/tests/compute-rs/Cargo.lock rename to Cargo.lock index 8f5b5d37..e60d256c 100644 --- a/prt/tests/compute-rs/Cargo.lock +++ b/Cargo.lock @@ -1,12 +1,12 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "addr2line" -version = "0.24.1" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5fb1d8e4442bd405fdfd1dacb42792696b0cf9cb15882e5d097b742a676d375" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ "gimli", ] @@ -24,6 +24,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", + "getrandom", "once_cell", "version_check", "zerocopy", @@ -40,15 +41,15 @@ dependencies = [ [[package]] name = "allocator-api2" -version = "0.2.18" +version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" [[package]] name = "alloy" -version = "0.3.6" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8367891bf380210abb0d6aa30c5f85a9080cb4a066c4d5c5acadad630823751b" +checksum = "59febb24956a41c29bb5f450978fbe825bd6456b3f80586c8bd558dc882e7b6a" dependencies = [ "alloy-consensus", "alloy-contract", @@ -56,6 +57,7 @@ dependencies = [ "alloy-eips", "alloy-genesis", "alloy-network", + "alloy-node-bindings", "alloy-provider", "alloy-rpc-client", "alloy-serde", @@ -67,33 +69,51 @@ dependencies = [ [[package]] name = "alloy-chains" -version = "0.1.31" +version = "0.1.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b68b94c159bcc2ca5f758b8663d7b00fc7c5e40569984595ddf2221b0f7f7f6e" +checksum = "d4e0f0136c085132939da6b753452ebed4efaa73fe523bb855b10c199c2ebfaf" dependencies = [ + "alloy-primitives", "num_enum", "strum", ] [[package]] name = "alloy-consensus" -version = "0.3.6" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "629b62e38d471cc15fea534eb7283d2f8a4e8bdb1811bcc5d66dda6cfce6fae1" +checksum = "e88e1edea70787c33e11197d3f32ae380f3db19e6e061e539a5bcf8184a6b326" dependencies = [ "alloy-eips", "alloy-primitives", "alloy-rlp", "alloy-serde", + "alloy-trie", + "auto_impl", "c-kzg", + "derive_more", + "serde", +] + +[[package]] +name = "alloy-consensus-any" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57b1bb53f40c0273cd1975573cd457b39213e68584e36d1401d25fd0398a1d65" +dependencies = [ + "alloy-consensus", + "alloy-eips", + "alloy-primitives", + "alloy-rlp", + "alloy-serde", "serde", ] [[package]] name = "alloy-contract" -version = "0.3.6" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eefe64fd344cffa9cf9e3435ec4e93e6e9c3481bc37269af988bf497faf4a6a" +checksum = "1b668c78c4b1f12f474ede5a85e8ce550d0aa1ef7d49fd1d22855a43b960e725" dependencies = [ "alloy-dyn-abi", "alloy-json-abi", @@ -106,26 +126,27 @@ dependencies = [ "alloy-transport", "futures", "futures-util", - "thiserror", + "thiserror 2.0.9", ] [[package]] name = "alloy-core" -version = "0.8.3" +version = "0.8.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88b095eb0533144b4497e84a9cc3e44a5c2e3754a3983c0376a55a2f9183a53e" +checksum = "5e3fdddfc89197319b1be19875a70ced62a72bebb67e2276dad688cd59f40e70" dependencies = [ "alloy-dyn-abi", "alloy-json-abi", "alloy-primitives", + "alloy-rlp", "alloy-sol-types", ] [[package]] name = "alloy-dyn-abi" -version = "0.8.3" +version = "0.8.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4004925bff5ba0a11739ae84dbb6601a981ea692f3bd45b626935ee90a6b8471" +checksum = "b0d2ea4d7f220a19c1f8c98822026d1d26a4b75a72e1a7308d02bab1f77c9a00" dependencies = [ "alloy-json-abi", "alloy-primitives", @@ -151,20 +172,21 @@ dependencies = [ [[package]] name = "alloy-eip7702" -version = "0.1.0" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37d319bb544ca6caeab58c39cea8921c55d924d4f68f2c60f24f914673f9a74a" +checksum = "4c986539255fb839d1533c128e190e557e52ff652c9ef62939e233a81dd93f7e" dependencies = [ "alloy-primitives", "alloy-rlp", + "derive_more", "serde", ] [[package]] name = "alloy-eips" -version = "0.3.6" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f923dd5fca5f67a43d81ed3ebad0880bd41f6dd0ada930030353ac356c54cd0f" +checksum = "5f9fadfe089e9ccc0650473f2d4ef0a28bc015bbca5631d9f0f09e49b557fdb3" dependencies = [ "alloy-eip2930", "alloy-eip7702", @@ -180,20 +202,21 @@ dependencies = [ [[package]] name = "alloy-genesis" -version = "0.3.6" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a7a18afb0b318616b6b2b0e2e7ac5529d32a966c673b48091c9919e284e6aca" +checksum = "2b2a4cf7b70f3495788e74ce1c765260ffe38820a2a774ff4aacb62e31ea73f9" dependencies = [ "alloy-primitives", "alloy-serde", + "alloy-trie", "serde", ] [[package]] name = "alloy-json-abi" -version = "0.8.3" +version = "0.8.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9996daf962fd0a90d3c93b388033228865953b92de7bb1959b891d78750a4091" +checksum = "e79c6b4bcc1067a7394b5b2aec7da1bd829c8c476b796c73eb14da34392a07a7" dependencies = [ "alloy-primitives", "alloy-sol-type-parser", @@ -203,29 +226,31 @@ dependencies = [ [[package]] name = "alloy-json-rpc" -version = "0.3.6" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3c717b5298fad078cd3a418335b266eba91b511383ca9bd497f742d5975d5ab" +checksum = "e29040b9d5fe2fb70415531882685b64f8efd08dfbd6cc907120650504821105" dependencies = [ "alloy-primitives", "alloy-sol-types", "serde", "serde_json", - "thiserror", + "thiserror 2.0.9", "tracing", ] [[package]] name = "alloy-network" -version = "0.3.6" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb3705ce7d8602132bcf5ac7a1dd293a42adc2f183abf5907c30ac535ceca049" +checksum = "510cc00b318db0dfccfdd2d032411cfae64fc144aef9679409e014145d3dacc4" dependencies = [ "alloy-consensus", + "alloy-consensus-any", "alloy-eips", "alloy-json-rpc", "alloy-network-primitives", "alloy-primitives", + "alloy-rpc-types-any", "alloy-rpc-types-eth", "alloy-serde", "alloy-signer", @@ -233,15 +258,18 @@ dependencies = [ "async-trait", "auto_impl", "futures-utils-wasm", - "thiserror", + "serde", + "serde_json", + "thiserror 2.0.9", ] [[package]] name = "alloy-network-primitives" -version = "0.3.6" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94ad40869867ed2d9cd3842b1e800889e5b49e6b92da346e93862b4a741bedf3" +checksum = "9081c099e798b8a2bba2145eb82a9a146f01fc7a35e9ab6e7b43305051f97550" dependencies = [ + "alloy-consensus", "alloy-eips", "alloy-primitives", "alloy-serde", @@ -249,32 +277,55 @@ dependencies = [ ] [[package]] -name = "alloy-primitives" +name = "alloy-node-bindings" version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "411aff151f2a73124ee473708e82ed51b2535f68928b6a1caa8bc1246ae6f7cd" +checksum = "aef9849fb8bbb28f69f2cbdb4b0dac2f0e35c04f6078a00dfb8486469aed02de" +dependencies = [ + "alloy-genesis", + "alloy-primitives", + "k256", + "rand", + "serde_json", + "tempfile", + "thiserror 2.0.9", + "tracing", + "url", +] + +[[package]] +name = "alloy-primitives" +version = "0.8.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0540fd0355d400b59633c27bd4b42173e59943f28e9d3376b77a24771d432d04" dependencies = [ "alloy-rlp", "bytes", "cfg-if", "const-hex", "derive_more", + "foldhash", + "hashbrown 0.15.2", "hex-literal", + "indexmap", "itoa", "k256", "keccak-asm", + "paste", "proptest", "rand", "ruint", + "rustc-hash 2.1.0", "serde", + "sha3", "tiny-keccak", ] [[package]] name = "alloy-provider" -version = "0.3.6" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "927f708dd457ed63420400ee5f06945df9632d5d101851952056840426a10dc5" +checksum = "dc2dfaddd9a30aa870a78a4e1316e3e115ec1e12e552cbc881310456b85c1f24" dependencies = [ "alloy-chains", "alloy-consensus", @@ -282,9 +333,13 @@ dependencies = [ "alloy-json-rpc", "alloy-network", "alloy-network-primitives", + "alloy-node-bindings", "alloy-primitives", "alloy-rpc-client", + "alloy-rpc-types-anvil", "alloy-rpc-types-eth", + "alloy-signer", + "alloy-signer-local", "alloy-transport", "alloy-transport-http", "async-stream", @@ -294,21 +349,24 @@ dependencies = [ "futures", "futures-utils-wasm", "lru", + "parking_lot", "pin-project", "reqwest", + "schnellru", "serde", "serde_json", - "thiserror", + "thiserror 2.0.9", "tokio", "tracing", "url", + "wasmtimer", ] [[package]] name = "alloy-rlp" -version = "0.3.8" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26154390b1d205a4a7ac7352aa2eb4f81f391399d4e2f546fb81a2f8bb383f62" +checksum = "f542548a609dca89fcd72b3b9f355928cf844d4363c5eed9c5273a3dd225e097" dependencies = [ "alloy-rlp-derive", "arrayvec", @@ -317,22 +375,23 @@ dependencies = [ [[package]] name = "alloy-rlp-derive" -version = "0.3.8" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d0f2d905ebd295e7effec65e5f6868d153936130ae718352771de3e7d03c75c" +checksum = "5a833d97bf8a5f0f878daf2c8451fff7de7f9de38baa5a45d936ec718d81255a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.94", ] [[package]] name = "alloy-rpc-client" -version = "0.3.6" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d82952dca71173813d4e5733e2c986d8b04aea9e0f3b0a576664c232ad050a5" +checksum = "531137b283547d5b9a5cafc96b006c64ef76810c681d606f28be9781955293b6" dependencies = [ "alloy-json-rpc", + "alloy-primitives", "alloy-transport", "alloy-transport-http", "futures", @@ -342,27 +401,50 @@ dependencies = [ "serde_json", "tokio", "tokio-stream", - "tower 0.5.1", + "tower", "tracing", "url", + "wasmtimer", +] + +[[package]] +name = "alloy-rpc-types-anvil" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed06bd8a5fc57b352a6cbac24eec52a4760f08ae2c1eb56ac49c8ed4b02c351" +dependencies = [ + "alloy-primitives", + "alloy-rpc-types-eth", + "alloy-serde", + "serde", +] + +[[package]] +name = "alloy-rpc-types-any" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed98e1af55a7d856bfa385f30f63d8d56be2513593655c904a8f4a7ec963aa3e" +dependencies = [ + "alloy-consensus-any", + "alloy-rpc-types-eth", + "alloy-serde", ] [[package]] name = "alloy-rpc-types-eth" -version = "0.3.6" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83aa984386deda02482660aa31cb8ca1e63d533f1c31a52d7d181ac5ec68e9b8" +checksum = "8737d7a6e37ca7bba9c23e9495c6534caec6760eb24abc9d5ffbaaba147818e1" dependencies = [ "alloy-consensus", + "alloy-consensus-any", "alloy-eips", "alloy-network-primitives", "alloy-primitives", "alloy-rlp", "alloy-serde", "alloy-sol-types", - "cfg-if", "derive_more", - "hashbrown", "itertools 0.13.0", "serde", "serde_json", @@ -370,9 +452,9 @@ dependencies = [ [[package]] name = "alloy-serde" -version = "0.3.6" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "731f75ec5d383107fd745d781619bd9cedf145836c51ecb991623d41278e71fa" +checksum = "5851bf8d5ad33014bd0c45153c603303e730acc8a209450a7ae6b4a12c2789e2" dependencies = [ "alloy-primitives", "serde", @@ -381,23 +463,23 @@ dependencies = [ [[package]] name = "alloy-signer" -version = "0.3.6" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "307324cca94354cd654d6713629f0383ec037e1ff9e3e3d547212471209860c0" +checksum = "7e10ca565da6500cca015ba35ee424d59798f2e1b85bc0dd8f81dafd401f029a" dependencies = [ "alloy-primitives", "async-trait", "auto_impl", "elliptic-curve", "k256", - "thiserror", + "thiserror 2.0.9", ] [[package]] name = "alloy-signer-local" -version = "0.3.6" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fabe917ab1778e760b4701628d1cae8e028ee9d52ac6307de4e1e9286ab6b5f" +checksum = "47fababf5a745133490cde927d48e50267f97d3d1209b9fc9f1d1d666964d172" dependencies = [ "alloy-consensus", "alloy-network", @@ -406,28 +488,28 @@ dependencies = [ "async-trait", "k256", "rand", - "thiserror", + "thiserror 2.0.9", ] [[package]] name = "alloy-sol-macro" -version = "0.8.3" +version = "0.8.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0458ccb02a564228fcd76efb8eb5a520521a8347becde37b402afec9a1b83859" +checksum = "c6d1a14b4a9f6078ad9132775a2ebb465b06b387d60f7413ddc86d7bf7453408" dependencies = [ "alloy-sol-macro-expander", "alloy-sol-macro-input", "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.94", ] [[package]] name = "alloy-sol-macro-expander" -version = "0.8.3" +version = "0.8.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bc65475025fc1e84bf86fc840f04f63fcccdcf3cf12053c99918e4054dfbc69" +checksum = "4436b4b96d265eb17daea26eb31525c3076d024d10901e446790afbd2f7eeaf5" dependencies = [ "alloy-json-abi", "alloy-sol-macro-input", @@ -437,16 +519,16 @@ dependencies = [ "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.94", "syn-solidity", "tiny-keccak", ] [[package]] name = "alloy-sol-macro-input" -version = "0.8.3" +version = "0.8.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ed10f0715a0b69fde3236ff3b9ae5f6f7c97db5a387747100070d3016b9266b" +checksum = "e5f58698a18b96faa8513519de112b79a96010b4ff84264ce54a217c52a8e98b" dependencies = [ "alloy-json-abi", "const-hex", @@ -455,15 +537,15 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.77", + "syn 2.0.94", "syn-solidity", ] [[package]] name = "alloy-sol-type-parser" -version = "0.8.3" +version = "0.8.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3edae8ea1de519ccba896b6834dec874230f72fe695ff3c9c118e90ec7cff783" +checksum = "1f3d6d2c490f650c5abd65a9a583b09a8c8931c265d3a55b18a8e349dd6d9d84" dependencies = [ "serde", "winnow", @@ -471,9 +553,9 @@ dependencies = [ [[package]] name = "alloy-sol-types" -version = "0.8.3" +version = "0.8.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1eb88e4da0a1b697ed6a9f811fdba223cf4d5c21410804fd1707836af73a462b" +checksum = "c766e4979fc19d70057150befe8e3ea3f0c4cbc6839b8eaaa250803451692305" dependencies = [ "alloy-json-abi", "alloy-primitives", @@ -484,9 +566,9 @@ dependencies = [ [[package]] name = "alloy-transport" -version = "0.3.6" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33616b2edf7454302a1d48084db185e52c309f73f6c10be99b0fe39354b3f1e9" +checksum = "538a04a37221469cac0ce231b737fd174de2fdfcdd843bdd068cb39ed3e066ad" dependencies = [ "alloy-json-rpc", "base64", @@ -494,33 +576,50 @@ dependencies = [ "futures-utils-wasm", "serde", "serde_json", - "thiserror", + "thiserror 2.0.9", "tokio", - "tower 0.5.1", + "tower", "tracing", "url", + "wasmtimer", ] [[package]] name = "alloy-transport-http" -version = "0.3.6" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a944f5310c690b62bbb3e7e5ce34527cbd36b2d18532a797af123271ce595a49" +checksum = "2ed40eb1e1265b2911512f6aa1dcece9702d078f5a646730c45e39e2be00ac1c" dependencies = [ "alloy-json-rpc", "alloy-transport", "reqwest", "serde_json", - "tower 0.5.1", + "tower", "tracing", "url", ] +[[package]] +name = "alloy-trie" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6917c79e837aa7b77b7a6dae9f89cbe15313ac161c4d3cfaf8909ef21f3d22d8" +dependencies = [ + "alloy-primitives", + "alloy-rlp", + "arrayvec", + "derive_more", + "nybbles", + "serde", + "smallvec", + "tracing", +] + [[package]] name = "anstream" -version = "0.6.15" +version = "0.6.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" +checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" dependencies = [ "anstyle", "anstyle-parse", @@ -533,43 +632,43 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.8" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" +checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" [[package]] name = "anstyle-parse" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" +checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" +checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.4" +version = "3.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" +checksum = "2109dbce0e72be3ec00bed26e6a7479ca384ad226efdd66db8fa2e3a38c83125" dependencies = [ "anstyle", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "anyhow" -version = "1.0.89" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6" +checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04" [[package]] name = "ark-ff" @@ -700,6 +799,9 @@ name = "arrayvec" version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" +dependencies = [ + "serde", +] [[package]] name = "async-recursion" @@ -709,14 +811,14 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.94", ] [[package]] name = "async-stream" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51" +checksum = "0b5a71a6f37880a80d1d7f19efd781e4b5de42c88f0722cc13bcb6cc2cfe8476" dependencies = [ "async-stream-impl", "futures-core", @@ -725,24 +827,24 @@ dependencies = [ [[package]] name = "async-stream-impl" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" +checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.94", ] [[package]] name = "async-trait" -version = "0.1.82" +version = "0.1.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a27b8a3a6e1a44fa4c8baf1f653e4172e81486d4941f2237e20dc2d0cf4ddff1" +checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.94", ] [[package]] @@ -753,14 +855,14 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.94", ] [[package]] name = "autocfg" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "backtrace" @@ -797,9 +899,9 @@ checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" [[package]] name = "bindgen" -version = "0.69.4" +version = "0.69.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0" +checksum = "271383c67ccabffb7381723dea0672a673f292304fcb45c01cc648c7a8d58088" dependencies = [ "bitflags", "cexpr", @@ -814,7 +916,7 @@ dependencies = [ "regex", "rustc-hash 1.1.0", "shlex", - "syn 2.0.77", + "syn 2.0.94", "which", ] @@ -892,9 +994,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.7.2" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" +checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" dependencies = [ "serde", ] @@ -918,6 +1020,13 @@ dependencies = [ name = "cartesi-dave-arithmetic" version = "0.1.0" +[[package]] +name = "cartesi-dave-contracts" +version = "0.1.0" +dependencies = [ + "alloy", +] + [[package]] name = "cartesi-dave-merkle" version = "0.1.0" @@ -926,21 +1035,21 @@ dependencies = [ "hex", "ruint", "sha3", - "thiserror", + "thiserror 1.0.69", ] [[package]] name = "cartesi-machine" -version = "0.18.1" +version = "0.1.0" dependencies = [ "cartesi-machine-sys", "hex", - "thiserror", + "thiserror 1.0.69", ] [[package]] name = "cartesi-machine-sys" -version = "0.18.1" +version = "0.1.0" dependencies = [ "bindgen", "bytes", @@ -993,15 +1102,24 @@ dependencies = [ "rusqlite_migration", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", "tokio", ] +[[package]] +name = "cartesi-rollups-contracts" +version = "2.0.0-rc.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "332c39cbce177f118b7dd740884306f7ce694c5b06e00991d173c2ddfdf96bf7" +dependencies = [ + "alloy", +] + [[package]] name = "cc" -version = "1.1.21" +version = "1.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07b1695e2c7e8fc85310cde85aeaab7e3097f593c91d209d3f9df76c928100f0" +checksum = "8d6dbb628b8f8555f86d0323c2eb39e3ec81901f4b83e091db8a6a76d316a333" dependencies = [ "shlex", ] @@ -1021,6 +1139,12 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + [[package]] name = "clang-sys" version = "1.8.1" @@ -1034,9 +1158,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.17" +version = "4.5.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e5a21b8495e732f1b3c364c9949b201ca7bae518c502c80256c96ad79eaf6ac" +checksum = "3135e7ec2ef7b10c6ed8950f0f792ed96ee093fa088608f1c76e569722700c84" dependencies = [ "clap_builder", "clap_derive", @@ -1044,9 +1168,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.17" +version = "4.5.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cf2dd12af7a047ad9d6da2b6b249759a22a7abc0f474c1dae1777afa4b21a73" +checksum = "30582fc632330df2bd26877bde0c1f4470d57c582bbc070376afcd04d8cb4838" dependencies = [ "anstream", "anstyle", @@ -1056,33 +1180,33 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.13" +version = "4.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "501d359d5f3dcaf6ecdeee48833ae73ec6e42723a1e52419c79abf9507eec0a0" +checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.94", ] [[package]] name = "clap_lex" -version = "0.7.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" +checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" [[package]] name = "colorchoice" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" +checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" [[package]] name = "const-hex" -version = "1.12.0" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94fb8a24a26d37e1ffd45343323dc9fe6654ceea44c12f2fcb3d7ac29e610bc6" +checksum = "4b0485bab839b018a8f1723fc5391819fea5f8f0f32288ef8a735fd096b6160c" dependencies = [ "cfg-if", "cpufeatures", @@ -1115,18 +1239,18 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpufeatures" -version = "0.2.14" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" +checksum = "16b80225097f2e5ae4e7179dd2266824648f3e2f49d9134d584b76389d31c4c3" dependencies = [ "libc", ] [[package]] name = "crossbeam-utils" -version = "0.8.20" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" [[package]] name = "crunchy" @@ -1164,12 +1288,33 @@ checksum = "5041cc499144891f3790297212f32a74fb938e5136a14943f338ef9e0ae276cf" dependencies = [ "cfg-if", "crossbeam-utils", - "hashbrown", + "hashbrown 0.14.5", "lock_api", "once_cell", "parking_lot_core", ] +[[package]] +name = "dave-rollups" +version = "0.1.0" +dependencies = [ + "alloy", + "anyhow", + "cartesi-prt-core", + "cartesi-rollups-contracts", + "clap", + "env_logger", + "futures", + "log", + "rollups-blockchain-reader", + "rollups-epoch-manager", + "rollups-machine-runner", + "rollups-prt-runner", + "rollups-state-manager", + "rusqlite", + "tokio", +] + [[package]] name = "der" version = "0.7.9" @@ -1208,7 +1353,7 @@ checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.94", "unicode-xid", ] @@ -1233,6 +1378,17 @@ dependencies = [ "subtle", ] +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.94", +] + [[package]] name = "dunce" version = "1.0.5" @@ -1280,9 +1436,9 @@ dependencies = [ [[package]] name = "env_filter" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f2c92ceda6ceec50f43169f9ee8424fe2db276791afde7b2cd8bc084cb376ab" +checksum = "186e05a59d4c50738528153b83b0b0194d3a29507dfec16eccd4b342903397d0" dependencies = [ "log", "regex", @@ -1290,9 +1446,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.11.5" +version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13fa619b91fb2381732789fc5de83b45675e882f66623b7d8cb4f643017018d" +checksum = "dcaee3d8e3cfc3fd92428d477bc97fc29ec8716d180c0d74c643bb26166660e0" dependencies = [ "anstream", "anstyle", @@ -1309,12 +1465,12 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.9" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -1331,9 +1487,9 @@ checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a" [[package]] name = "fastrand" -version = "2.1.1" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] name = "fastrlp" @@ -1346,6 +1502,17 @@ dependencies = [ "bytes", ] +[[package]] +name = "fastrlp" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce8dba4714ef14b8274c371879b175aa55b16b30f269663f19d576f380018dc4" +dependencies = [ + "arrayvec", + "auto_impl", + "bytes", +] + [[package]] name = "ff" version = "0.13.0" @@ -1374,6 +1541,12 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foldhash" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0d2fde1f7b3d48b8395d5f2de76c18a528bd6a9cdde438df747bfcba3e05d6f" + [[package]] name = "foreign-types" version = "0.3.2" @@ -1406,9 +1579,9 @@ checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] name = "futures" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" dependencies = [ "futures-channel", "futures-core", @@ -1421,9 +1594,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ "futures-core", "futures-sink", @@ -1431,15 +1604,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-executor" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" dependencies = [ "futures-core", "futures-task", @@ -1448,38 +1621,38 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-macro" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.94", ] [[package]] name = "futures-sink" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" [[package]] name = "futures-task" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" [[package]] name = "futures-util" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ "futures-channel", "futures-core", @@ -1517,21 +1690,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", + "js-sys", "libc", "wasi", + "wasm-bindgen", ] [[package]] name = "gimli" -version = "0.31.0" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32085ea23f3234fc7846555e85283ba4de91e21016dc0455a16286d87a292d64" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "glob" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" [[package]] name = "group" @@ -1544,6 +1719,12 @@ dependencies = [ "subtle", ] +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" + [[package]] name = "hashbrown" version = "0.14.5" @@ -1551,7 +1732,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ "ahash", +] + +[[package]] +name = "hashbrown" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" +dependencies = [ "allocator-api2", + "equivalent", + "foldhash", "serde", ] @@ -1561,7 +1752,7 @@ version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ba4ff7128dee98c7dc9794b6a411377e1404dba1c97deb8d1a55297bd25d8af" dependencies = [ - "hashbrown", + "hashbrown 0.14.5", ] [[package]] @@ -1602,18 +1793,18 @@ dependencies = [ [[package]] name = "home" -version = "0.5.9" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +checksum = "589533453244b0995c858700322199b2becb13b627df2851f64a2775d024abcf" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "http" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" +checksum = "f16ca2af56261c99fba8bac40a10251ce8188205a4c448fbb745a2e4daa76fea" dependencies = [ "bytes", "fnv", @@ -1645,9 +1836,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.9.4" +version = "1.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" +checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" [[package]] name = "humantime" @@ -1657,9 +1848,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "1.4.1" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" +checksum = "256fb8d4bd6413123cc9d91832d78325c48ff41677595be797d90f42969beae0" dependencies = [ "bytes", "futures-channel", @@ -1676,9 +1867,9 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.27.3" +version = "0.27.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" +checksum = "2d191583f3da1305256f22463b9bb0471acad48a4e534a5218b9963e9c1f59b2" dependencies = [ "futures-util", "http", @@ -1710,9 +1901,9 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.8" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da62f120a8a37763efb0cf8fdf264b884c7b8b9ac8660b900c8661030c00e6ba" +checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" dependencies = [ "bytes", "futures-channel", @@ -1723,19 +1914,147 @@ dependencies = [ "pin-project-lite", "socket2", "tokio", - "tower 0.4.13", "tower-service", "tracing", ] [[package]] -name = "idna" -version = "0.5.0" +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.94", +] + +[[package]] +name = "idna" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "icu_normalizer", + "icu_properties", ] [[package]] @@ -1749,30 +2068,31 @@ dependencies = [ [[package]] name = "impl-trait-for-tuples" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" +checksum = "a0eb5a3343abf848c0984fe4604b2b105da9539376e24fc0a3b0007411ae4fd9" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.94", ] [[package]] name = "indexmap" -version = "2.5.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" +checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" dependencies = [ "equivalent", - "hashbrown", + "hashbrown 0.15.2", + "serde", ] [[package]] name = "ipnet" -version = "2.10.0" +version = "2.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "187674a687eed5fe42285b40c6291f9a01517d415fad1c3cbc6a9f778af7fcd4" +checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" [[package]] name = "is_terminal_polyfill" @@ -1809,24 +2129,25 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.11" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" [[package]] name = "js-sys" -version = "0.3.70" +version = "0.3.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" +checksum = "6717b6b5b077764fb5966237269cb3c64edddde4b14ce42647430a78ced9e7b7" dependencies = [ + "once_cell", "wasm-bindgen", ] [[package]] name = "k256" -version = "0.13.3" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" +checksum = "f6e3919bbaa2945715f0bb6d3934a173d1e9a59ac23767fbaaef277265a7411b" dependencies = [ "cfg-if", "ecdsa", @@ -1868,15 +2189,15 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.158" +version = "0.2.169" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" +checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" [[package]] name = "libloading" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" +checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" dependencies = [ "cfg-if", "windows-targets", @@ -1884,9 +2205,9 @@ dependencies = [ [[package]] name = "libm" -version = "0.2.8" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" +checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" [[package]] name = "libsqlite3-sys" @@ -1914,6 +2235,12 @@ version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +[[package]] +name = "litemap" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" + [[package]] name = "lock_api" version = "0.4.12" @@ -1932,11 +2259,11 @@ checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "lru" -version = "0.12.4" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37ee39891760e7d94734f6f63fedc29a2e4a152f836120753a72503f09fcf904" +checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" dependencies = [ - "hashbrown", + "hashbrown 0.15.2", ] [[package]] @@ -1959,20 +2286,19 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.8.0" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" +checksum = "4ffbe83022cedc1d264172192511ae958937694cd57ce297164951b8b3568394" dependencies = [ "adler2", ] [[package]] name = "mio" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" +checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" dependencies = [ - "hermit-abi", "libc", "wasi", "windows-sys 0.52.0", @@ -2061,29 +2387,42 @@ checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.94", +] + +[[package]] +name = "nybbles" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3409fc85ac27b27d971ea7cd1aabafd2eefa6de7e481c8d4f707225c117e81a" +dependencies = [ + "alloy-rlp", + "const-hex", + "proptest", + "serde", + "smallvec", ] [[package]] name = "object" -version = "0.36.4" +version = "0.36.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "084f1a5821ac4c651660a94a7153d27ac9d8a53736203f58b31945ded098070a" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.19.0" +version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "openssl" -version = "0.10.66" +version = "0.10.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" +checksum = "6174bc48f102d208783c2c84bf931bb75927a617866870de8a4ea85597f871f5" dependencies = [ "bitflags", "cfg-if", @@ -2102,7 +2441,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.94", ] [[package]] @@ -2113,9 +2452,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.103" +version = "0.9.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" +checksum = "45abf306cbf99debc8195b66b7346498d7b10c210de50418b5ccd7ceba08c741" dependencies = [ "cc", "libc", @@ -2186,40 +2525,40 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.12" +version = "2.7.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c73c26c01b8c87956cea613c907c9d6ecffd8d18a2a5908e5de0adfaa185cea" +checksum = "8b7cafe60d6cf8e62e1b9b2ea516a089c008945bb5a275416789e7db0bc199dc" dependencies = [ "memchr", - "thiserror", + "thiserror 2.0.9", "ucd-trie", ] [[package]] name = "pin-project" -version = "1.1.5" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +checksum = "be57f64e946e500c8ee36ef6331845d40a93055567ec57e8fae13efd33759b95" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.5" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.94", ] [[package]] name = "pin-project-lite" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" +checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" [[package]] name = "pin-utils" @@ -2239,9 +2578,9 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "ppv-lite86" @@ -2254,12 +2593,12 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.22" +version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479cf940fbbb3426c32c5d5176f62ad57549a0bb84773423ba8be9d089f5faba" +checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" dependencies = [ "proc-macro2", - "syn 2.0.77", + "syn 2.0.94", ] [[package]] @@ -2301,14 +2640,14 @@ dependencies = [ "proc-macro-error-attr2", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.94", ] [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" dependencies = [ "unicode-ident", ] @@ -2341,45 +2680,49 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quinn" -version = "0.11.5" +version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" +checksum = "62e96808277ec6f97351a2380e6c25114bc9e67037775464979f3037c92d05ef" dependencies = [ "bytes", "pin-project-lite", "quinn-proto", "quinn-udp", - "rustc-hash 2.0.0", + "rustc-hash 2.1.0", "rustls", "socket2", - "thiserror", + "thiserror 2.0.9", "tokio", "tracing", ] [[package]] name = "quinn-proto" -version = "0.11.8" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +checksum = "a2fe5ef3495d7d2e377ff17b1a8ce2ee2ec2a18cde8b6ad6619d65d0701c135d" dependencies = [ "bytes", + "getrandom", "rand", "ring", - "rustc-hash 2.0.0", + "rustc-hash 2.1.0", "rustls", + "rustls-pki-types", "slab", - "thiserror", + "thiserror 2.0.9", "tinyvec", "tracing", + "web-time", ] [[package]] name = "quinn-udp" -version = "0.5.5" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fe68c2e9e1a1234e218683dbdf9f9dfcb094113c5ac2b938dfcb9bab4c4140b" +checksum = "1c40286217b4ba3a71d644d752e6a0b71f13f1b6a2c5311acfcbe0c2418ed904" dependencies = [ + "cfg_aliases", "libc", "once_cell", "socket2", @@ -2389,9 +2732,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.37" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" dependencies = [ "proc-macro2", ] @@ -2411,6 +2754,7 @@ dependencies = [ "libc", "rand_chacha", "rand_core", + "serde", ] [[package]] @@ -2443,18 +2787,18 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.4" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0884ad60e090bf1345b93da0a5de8923c93884cd03f40dfcfddd3b4bee661853" +checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" dependencies = [ "bitflags", ] [[package]] name = "regex" -version = "1.10.6" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", @@ -2464,9 +2808,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.7" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", @@ -2475,15 +2819,15 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "reqwest" -version = "0.12.7" +version = "0.12.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8f4955649ef5c38cc7f9e8aa41761d48fb9677197daea9984dc54f56aad5e63" +checksum = "43e734407157c3c2034e0258f5e4473ddb361b1e85f95a66690d67264d7cd1da" dependencies = [ "base64", "bytes", @@ -2512,10 +2856,11 @@ dependencies = [ "serde", "serde_json", "serde_urlencoded", - "sync_wrapper 1.0.1", + "sync_wrapper", "tokio", "tokio-native-tls", "tokio-rustls", + "tower", "tower-service", "url", "wasm-bindgen", @@ -2560,18 +2905,91 @@ dependencies = [ "rustc-hex", ] +[[package]] +name = "rollups-blockchain-reader" +version = "0.1.0" +dependencies = [ + "alloy", + "alloy-rpc-types-eth", + "async-recursion", + "cartesi-dave-contracts", + "cartesi-dave-merkle", + "cartesi-prt-contracts", + "cartesi-prt-core", + "cartesi-rollups-contracts", + "clap", + "log", + "num-traits", + "rollups-state-manager", + "rusqlite", + "rusqlite_migration", + "thiserror 1.0.69", + "tokio", +] + +[[package]] +name = "rollups-epoch-manager" +version = "0.1.0" +dependencies = [ + "alloy", + "anyhow", + "cartesi-dave-contracts", + "cartesi-prt-core", + "log", + "num-traits", + "rollups-state-manager", + "tokio", +] + +[[package]] +name = "rollups-machine-runner" +version = "0.1.0" +dependencies = [ + "alloy", + "cartesi-dave-arithmetic", + "cartesi-dave-merkle", + "cartesi-machine", + "cartesi-prt-core", + "cartesi-rollups-contracts", + "hex", + "rollups-state-manager", + "thiserror 1.0.69", +] + +[[package]] +name = "rollups-prt-runner" +version = "0.1.0" +dependencies = [ + "alloy", + "cartesi-prt-core", + "log", + "rollups-state-manager", +] + +[[package]] +name = "rollups-state-manager" +version = "0.1.0" +dependencies = [ + "lazy_static", + "rusqlite", + "rusqlite_migration", + "thiserror 1.0.69", +] + [[package]] name = "ruint" -version = "1.12.3" +version = "1.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c3cc4c2511671f327125da14133d0c5c5d137f006a1017a16f557bc85b16286" +checksum = "f5ef8fb1dd8de3870cb8400d51b4c2023854bbafd5431a3ac7e7317243e22d2f" dependencies = [ "alloy-rlp", "ark-ff 0.3.0", "ark-ff 0.4.2", "bytes", - "fastrlp", + "fastrlp 0.3.1", + "fastrlp 0.4.0", "num-bigint", + "num-integer", "num-traits", "parity-scale-codec", "primitive-types", @@ -2628,9 +3046,9 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustc-hash" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" +checksum = "c7fb8039b3032c191086b10f11f319a6e99e1e82889c5cc6046f515c9db1d497" [[package]] name = "rustc-hex" @@ -2653,27 +3071,27 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ - "semver 1.0.23", + "semver 1.0.24", ] [[package]] name = "rustix" -version = "0.38.37" +version = "0.38.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" +checksum = "f93dc38ecbab2eb790ff964bb77fa94faf256fd3e73285fd7ba0903b76bedb85" dependencies = [ "bitflags", "errno", "libc", "linux-raw-sys", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "rustls" -version = "0.23.13" +version = "0.23.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2dabaac7466917e566adb06783a81ca48944c6898a1b08b9374106dd671f4c8" +checksum = "5065c3f250cbd332cd894be57c40fa52387247659b14a2d6041d121547903b1b" dependencies = [ "once_cell", "ring", @@ -2685,19 +3103,21 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "2.1.3" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "196fe16b00e106300d3e45ecfcb764fa292a535d7326a29a5875c579c7417425" +checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" dependencies = [ - "base64", "rustls-pki-types", ] [[package]] name = "rustls-pki-types" -version = "1.8.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc0a2ce646f8655401bb81e7927b812614bd5d91dbc968696be50603510fcaf0" +checksum = "d2bf47e6ff922db3825eb750c4e2ff784c6ff8fb9e13046ef6a1d1c5401b0b37" +dependencies = [ + "web-time", +] [[package]] name = "rustls-webpki" @@ -2712,9 +3132,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.17" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" +checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" [[package]] name = "rusty-fork" @@ -2736,13 +3156,24 @@ checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "schannel" -version = "0.1.24" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9aaafd5a2b6e3d657ff009d82fbd630b6bd54dd4eb06f21693925cdf80f9b8b" +checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "schnellru" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9a8ef13a93c54d20580de1e5c413e624e53121d42fc7e2c11d10ef7f8b02367" +dependencies = [ + "ahash", + "cfg-if", + "hashbrown 0.13.2", +] + [[package]] name = "scopeguard" version = "1.2.0" @@ -2778,9 +3209,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.11.1" +version = "2.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75da29fe9b9b08fe9d6b22b5b4bcbc75d8db3aa31e639aa56bb62e9d46bfceaf" +checksum = "1863fd3768cd83c56a7f60faa4dc0d403f1b6df0a38c3c25f44b7894e45370d5" dependencies = [ "core-foundation-sys", "libc", @@ -2797,44 +3228,44 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.23" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" +checksum = "3cb6eb87a131f756572d7fb904f6e7b68633f09cca868c5df1c4b8d1a694bbba" [[package]] name = "semver-parser" -version = "0.10.2" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7" +checksum = "9900206b54a3527fdc7b8a938bffd94a568bac4f4aa8113b209df75a09c0dec2" dependencies = [ "pest", ] [[package]] name = "serde" -version = "1.0.210" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" +checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.210" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" +checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.94", ] [[package]] name = "serde_json" -version = "1.0.128" +version = "1.0.134" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" +checksum = "d00f4175c42ee48b15416f6193a959ba3a0d67fc699a0db9ad12df9f83991c7d" dependencies = [ "itoa", "memchr", @@ -2935,12 +3366,15 @@ name = "smallvec" version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +dependencies = [ + "serde", +] [[package]] name = "socket2" -version = "0.5.7" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" +checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8" dependencies = [ "libc", "windows-sys 0.52.0", @@ -2962,6 +3396,12 @@ dependencies = [ "der", ] +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + [[package]] name = "static_assertions" version = "1.1.0" @@ -2993,7 +3433,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.77", + "syn 2.0.94", ] [[package]] @@ -3015,9 +3455,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.77" +version = "2.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" +checksum = "987bc0be1cdea8b10216bd06e2ca407d40b9543468fafd3ddfb02f36e77f71f3" dependencies = [ "proc-macro2", "quote", @@ -3026,29 +3466,34 @@ dependencies = [ [[package]] name = "syn-solidity" -version = "0.8.3" +version = "0.8.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b95156f8b577cb59dc0b1df15c6f29a10afc5f8a7ac9786b0b5c68c19149278" +checksum = "c74af950d86ec0f5b2ae2d7f1590bbfbcf4603a0a15742d8f98132ac4fe3efd4" dependencies = [ "paste", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.94", ] [[package]] name = "sync_wrapper" -version = "0.1.2" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" +dependencies = [ + "futures-core", +] [[package]] -name = "sync_wrapper" -version = "1.0.1" +name = "synstructure" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ - "futures-core", + "proc-macro2", + "quote", + "syn 2.0.94", ] [[package]] @@ -3059,9 +3504,9 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.12.0" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" +checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c" dependencies = [ "cfg-if", "fastrand", @@ -3072,22 +3517,42 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.63" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f072643fd0190df67a8bab670c20ef5d8737177d6ac6b2e9a236cb096206b2cc" +dependencies = [ + "thiserror-impl 2.0.9", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ - "thiserror-impl", + "proc-macro2", + "quote", + "syn 2.0.94", ] [[package]] name = "thiserror-impl" -version = "1.0.63" +version = "2.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" +checksum = "7b50fa271071aae2e6ee85f842e2e28ba8cd2c5fb67f11fcb1fd70b276f9e7d4" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.94", ] [[package]] @@ -3108,11 +3573,21 @@ dependencies = [ "crunchy", ] +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + [[package]] name = "tinyvec" -version = "1.8.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" +checksum = "022db8904dfa342efe721985167e9fcd16c29b226db4397ed752a761cfce81e8" dependencies = [ "tinyvec_macros", ] @@ -3125,9 +3600,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.40.0" +version = "1.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" +checksum = "5cec9b21b0450273377fc97bd4c33a8acffc8c996c987a7c5b319a0083707551" dependencies = [ "backtrace", "bytes", @@ -3149,7 +3624,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.94", ] [[package]] @@ -3164,20 +3639,19 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.26.0" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" +checksum = "5f6d0975eaace0cf0fcadee4e4aaa5da15b5c079146f2cffb67c113be122bf37" dependencies = [ "rustls", - "rustls-pki-types", "tokio", ] [[package]] name = "tokio-stream" -version = "0.1.16" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f4e6ce100d0eb49a2734f8c0812bcd324cf357d21810932c5df6b96ef2b86f1" +checksum = "eca58d7bba4a75707817a2c44174253f9236b2d5fbd055602e9d5c07c139a047" dependencies = [ "futures-core", "pin-project-lite", @@ -3187,9 +3661,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.12" +version = "0.7.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" +checksum = "d7fcaa8d55a2bdd6b83ace262b016eca0d79ee02818c5c1bcdf0305114081078" dependencies = [ "bytes", "futures-core", @@ -3206,9 +3680,9 @@ checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" [[package]] name = "toml_edit" -version = "0.22.21" +version = "0.22.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b072cee73c449a636ffd6f32bd8de3a9f7119139aff882f44943ce2986dc5cf" +checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" dependencies = [ "indexmap", "toml_datetime", @@ -3217,33 +3691,19 @@ dependencies = [ [[package]] name = "tower" -version = "0.4.13" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" dependencies = [ "futures-core", "futures-util", - "pin-project", "pin-project-lite", + "sync_wrapper", "tokio", "tower-layer", "tower-service", ] -[[package]] -name = "tower" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2873938d487c3cfb9aed7546dc9f2711d867c9f90c46b889989a2cb84eba6b4f" -dependencies = [ - "futures-core", - "futures-util", - "pin-project-lite", - "sync_wrapper 0.1.2", - "tower-layer", - "tower-service", -] - [[package]] name = "tower-layer" version = "0.3.3" @@ -3258,9 +3718,9 @@ checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" -version = "0.1.40" +version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" dependencies = [ "pin-project-lite", "tracing-attributes", @@ -3269,20 +3729,20 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.27" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.94", ] [[package]] name = "tracing-core" -version = "0.1.32" +version = "0.1.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" dependencies = [ "once_cell", ] @@ -3301,9 +3761,9 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "ucd-trie" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" [[package]] name = "uint" @@ -3323,32 +3783,17 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" -[[package]] -name = "unicode-bidi" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" - [[package]] name = "unicode-ident" -version = "1.0.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" - -[[package]] -name = "unicode-normalization" -version = "0.1.24" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" -dependencies = [ - "tinyvec", -] +checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" [[package]] name = "unicode-xid" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "229730647fbc343e3a80e463c1db7f78f3855d3f3739bee0dda773c9a037c90a" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" [[package]] name = "untrusted" @@ -3358,15 +3803,27 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.2" +version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" dependencies = [ "form_urlencoded", "idna", "percent-encoding", ] +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + [[package]] name = "utf8parse" version = "0.2.2" @@ -3417,9 +3874,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.93" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" +checksum = "a474f6281d1d70c17ae7aa6a613c87fce69a127e2624002df63dcb39d6cf6396" dependencies = [ "cfg-if", "once_cell", @@ -3428,36 +3885,36 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.93" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" +checksum = "5f89bb38646b4f81674e8f5c3fb81b562be1fd936d84320f3264486418519c79" dependencies = [ "bumpalo", "log", - "once_cell", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.94", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.43" +version = "0.4.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed" +checksum = "38176d9b44ea84e9184eff0bc34cc167ed044f816accfe5922e54d84cf48eca2" dependencies = [ "cfg-if", "js-sys", + "once_cell", "wasm-bindgen", "web-sys", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.93" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" +checksum = "2cc6181fd9a7492eef6fef1f33961e3695e4579b9872a6f7c83aee556666d4fe" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -3465,28 +3922,52 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.93" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" +checksum = "30d7a95b763d3c45903ed6c81f156801839e5ee968bb07e534c44df0fcd330c2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.94", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.93" +version = "0.2.99" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "943aab3fdaaa029a6e0271b35ea10b72b943135afe9bffca82384098ad0e06a6" + +[[package]] +name = "wasmtimer" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" +checksum = "0048ad49a55b9deb3953841fa1fc5858f0efbcb7a18868c899a360269fac1b23" +dependencies = [ + "futures", + "js-sys", + "parking_lot", + "pin-utils", + "slab", + "wasm-bindgen", +] [[package]] name = "web-sys" -version = "0.3.70" +version = "0.3.76" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04dd7223427d52553d3702c004d3b2fe07c148165faa56313cb00211e31c12bc" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "web-time" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" dependencies = [ "js-sys", "wasm-bindgen", @@ -3494,9 +3975,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.26.6" +version = "0.26.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" +checksum = "5d642ff16b7e79272ae451b7322067cdc17cadf68c23264be9d94a32319efe7e" dependencies = [ "rustls-pki-types", ] @@ -3627,13 +4108,25 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.6.18" +version = "0.6.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" +checksum = "e6f5bb5257f2407a5425c6e749bfd9692192a73e70a6060516ac04f889087d68" dependencies = [ "memchr", ] +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + [[package]] name = "wyz" version = "0.5.1" @@ -3643,6 +4136,30 @@ dependencies = [ "tap", ] +[[package]] +name = "yoke" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.94", + "synstructure", +] + [[package]] name = "zerocopy" version = "0.7.35" @@ -3661,7 +4178,28 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.94", +] + +[[package]] +name = "zerofrom" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.94", + "synstructure", ] [[package]] @@ -3681,5 +4219,27 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.94", +] + +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.94", ] diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 00000000..8dd8ad8f --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,96 @@ +[workspace] +resolver = "2" +members = [ + # Solidity bindings + "cartesi-rollups/contracts/bindings-rs", + "prt/contracts/bindings-rs", + + # common-rs + "common-rs/merkle", + "common-rs/arithmetic", + + # prt + "prt/client-rs/core", + "prt/client-rs/executable", + + # rollups-node + "cartesi-rollups/node/blockchain-reader", + "cartesi-rollups/node/prt-runner", + "cartesi-rollups/node/dave-rollups", + "cartesi-rollups/node/epoch-manager", + "cartesi-rollups/node/machine-runner", + "cartesi-rollups/node/state-manager", + + # machine bindings + "machine/rust-bindings/cartesi-machine", + "machine/rust-bindings/cartesi-machine-sys", +] + +[workspace.package] +version = "0.1.0" + +authors = [ + "Gabriel Coutinho de Paula ", + "Stephen Chen ", +] +description = "A Cartesi validator reference implementation" +edition = "2021" +homepage = "https://github.com/cartesi/dave" +license-file = "LICENSE" +readme = "README.md" +repository = "https://github.com/cartesi/dave" + +[workspace.dependencies] + +## Workspace crates + +# machine bindings +cartesi-machine = { path = "machine/rust-bindings/cartesi-machine" } + +# solidity bindings +cartesi-dave-contracts = { path = "cartesi-rollups/contracts/bindings-rs" } +cartesi-prt-contracts = { path = "prt/contracts/bindings-rs" } + +# rollups-node +rollups-blockchain-reader = { version = "0.1", path = "cartesi-rollups/node/blockchain-reader" } +rollups-prt-runner = { version = "0.1", path = "cartesi-rollups/node/prt-runner" } +rollups-epoch-manager = { version = "0.1", path = "cartesi-rollups/node/epoch-manager" } +rollups-machine-runner = { version = "0.1", path = "cartesi-rollups/node/machine-runner" } +rollups-state-manager = { version = "0.1", path = "cartesi-rollups/node/state-manager" } + +# common-rs +cartesi-dave-arithmetic = { path = "common-rs/arithmetic" } +cartesi-dave-merkle = { path = "common-rs/merkle" } + +# prt +cartesi-prt-core = { path = "prt/client-rs/core" } + + +## Dependencies + +# cartesi +cartesi-rollups-contracts = "=2.0.0-rc.13" + +# eth +alloy = { version = "0.8", features = ["sol-types", "contract", "network", "reqwest", "signers", "signer-local"] } +ruint = "1.12" + +# error handling +anyhow = "1.0" +thiserror = "1.0" + +# async +async-recursion = "1" +async-trait = "0.1" +futures = "0.3" +tokio = { version = "1", features = ["full"] } + +# sqlite +lazy_static = "1.4" +rusqlite = { version = "0.31.0", features = ["bundled"] } +rusqlite_migration = "1.2.0" + +clap = { version = "4.5", features = ["derive", "env"] } +hex = "0.4" +log = "0.4" +num-traits = "0.2" diff --git a/README.md b/README.md index c74b7668..74a26b28 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,8 @@ Dave is a permissionless, interactive fraud-proof system. This repo contains the This project uses git submodules. Remember to either clone the repository with the flag `--recurse-submodules`, or run `git submodule update --recursive --init` after cloning. -To run the PRT Lua node, follow the instructions [here](prt/tests/compute/README.md). +To run the PRT Lua client (compute), follow the instructions [here](prt/tests/compute/README.md). +To run the PRT Rust node (rollups), follow the instructions [here](prt/tests/rollups/README.md). ## What's in a name @@ -62,7 +63,7 @@ As such, the defenders have an exponential resource advantage over the attackers Although delay grows logarithmically in the Permissionless Refereed Tournaments (PRT) algorithm, the constant multiplying this logarithm is high, harming its liveness. The second implementation of Dave will be based on the eponymous Dave algorithm, which improves the liveness of PRT, while maintaining its attractive security and decentralization properties. -We've published our initial research [here](https://arxiv.org/abs/2411.05463). +We've published our initial research [here](https://arxiv.org/abs/2411.05463), and presented our findings at Devcon 24 [here](https://youtu.be/dI_3neyXVl0). ## Status @@ -86,7 +87,7 @@ Please review our [LICENSE](LICENSE) file. ---
- Dave + Dave

Dave.

diff --git a/cartesi-rollups/Makefile b/cartesi-rollups/Makefile deleted file mode 100644 index 283df91a..00000000 --- a/cartesi-rollups/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -BINDINGS_DIR := ./contract-bindings/src/contract -SRC_DIR := ./contracts -BINDINGS_FILTER := 'DaveConsensus' - -help: - @echo ' clean - clean the generated bindings' - @echo ' bind - generate Rust bindings from Solidity code' - -clean: - @rm -rf $(BINDINGS_DIR) - -bind: - @forge bind --alloy --select $(BINDINGS_FILTER) \ - --module --bindings-path $(BINDINGS_DIR) \ - --root $(SRC_DIR) - -.PHONY: help bind clean diff --git a/cartesi-rollups/contract-bindings/Cargo.toml b/cartesi-rollups/contracts/bindings-rs/Cargo.toml similarity index 85% rename from cartesi-rollups/contract-bindings/Cargo.toml rename to cartesi-rollups/contracts/bindings-rs/Cargo.toml index b84e4107..b05bb5a4 100644 --- a/cartesi-rollups/contract-bindings/Cargo.toml +++ b/cartesi-rollups/contracts/bindings-rs/Cargo.toml @@ -15,5 +15,5 @@ readme = "README.md" repository = "https://github.com/cartesi/dave" [dependencies] -alloy = { version = "0.8.0", features = ["sol-types", "contract"] } +alloy = { workspace = true, features = ["sol-types", "contract"] } diff --git a/cartesi-rollups/contract-bindings/README.md b/cartesi-rollups/contracts/bindings-rs/README.md similarity index 100% rename from cartesi-rollups/contract-bindings/README.md rename to cartesi-rollups/contracts/bindings-rs/README.md diff --git a/cartesi-rollups/contracts/bindings-rs/src/.gitignore b/cartesi-rollups/contracts/bindings-rs/src/.gitignore new file mode 100644 index 00000000..81b46ff0 --- /dev/null +++ b/cartesi-rollups/contracts/bindings-rs/src/.gitignore @@ -0,0 +1 @@ +contract/ diff --git a/prt/contract-bindings/src/lib.rs b/cartesi-rollups/contracts/bindings-rs/src/lib.rs similarity index 69% rename from prt/contract-bindings/src/lib.rs rename to cartesi-rollups/contracts/bindings-rs/src/lib.rs index c89b3333..7b5afcc3 100644 --- a/prt/contract-bindings/src/lib.rs +++ b/cartesi-rollups/contracts/bindings-rs/src/lib.rs @@ -1,2 +1,3 @@ +#[rustfmt::skip] pub mod contract; pub use contract::*; diff --git a/cartesi-rollups/contracts/justfile b/cartesi-rollups/contracts/justfile new file mode 100644 index 00000000..e0635629 --- /dev/null +++ b/cartesi-rollups/contracts/justfile @@ -0,0 +1,50 @@ +# Variables +BINDINGS_DIR := "./bindings-rs/src/contract" +SRC_DIR := "." +BINDINGS_FILTER := "DaveConsensus" + +export PRIVATE_KEY := "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80" +ANVIL_ENDPOINT := "http://127.0.0.1:8545" +ANVIL_CHAIN_ID := "31337" + +default: build + +build: build-smart-contracts bind + +fmt: + forge fmt + +# compile smart contracts +build-smart-contracts: + forge build + +# clean smart contracts artifacts +clean-smart-contracts: + forge clean + +# clean generated bindings +clean-bindings: + rm -rf {{BINDINGS_DIR}} + +# generate Rust bindings from Solidity code +bind: clean-bindings + forge bind --alloy --select {{BINDINGS_FILTER}} \ + --module --bindings-path {{BINDINGS_DIR}} \ + --root {{SRC_DIR}} + +deploy-dev INITIAL_HASH: + forge script \ + script/InputBox.s.sol \ + --fork-url {{ANVIL_ENDPOINT}} \ + --broadcast \ + --sig 'run()' \ + -vvvv 2>&1 + forge script \ + script/DaveConsensus.s.sol \ + --fork-url {{ANVIL_ENDPOINT}} \ + --code-size-limit 65536 \ + --broadcast \ + --sig 'run(bytes32,address)' \ + {{INITIAL_HASH}} \ + $(jq -r '.transactions[] | select(.transactionType=="CREATE").contractAddress' broadcast/InputBox.s.sol/{{ANVIL_CHAIN_ID}}/run-latest.json) \ + -vvvv 2>&1 diff --git a/cartesi-rollups/node/Cargo.lock b/cartesi-rollups/node/Cargo.lock deleted file mode 100644 index 45bfbd14..00000000 --- a/cartesi-rollups/node/Cargo.lock +++ /dev/null @@ -1,3743 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "addr2line" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" -dependencies = [ - "gimli", -] - -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - -[[package]] -name = "ahash" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "allocator-api2" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" - -[[package]] -name = "alloy" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f13f1940c81e269e84ddb58f3b611be9660fbbfe39d4338aa2984dc3df0c402" -dependencies = [ - "alloy-consensus", - "alloy-contract", - "alloy-core", - "alloy-eips", - "alloy-genesis", - "alloy-network", - "alloy-provider", - "alloy-rpc-client", - "alloy-serde", - "alloy-signer", - "alloy-signer-local", - "alloy-transport", - "alloy-transport-http", -] - -[[package]] -name = "alloy-chains" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b515e82c8468ddb6ff8db21c78a5997442f113fd8471fd5b2261b2602dd0c67" -dependencies = [ - "num_enum", - "strum", -] - -[[package]] -name = "alloy-consensus" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4177d135789e282e925092be8939d421b701c6d92c0a16679faa659d9166289d" -dependencies = [ - "alloy-eips", - "alloy-primitives", - "alloy-rlp", - "alloy-serde", - "c-kzg", - "serde", -] - -[[package]] -name = "alloy-contract" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3be15f92fdb7490b164697a1d9b395cb7a3afa8fb15feed732ec5a6ff8db5f4" -dependencies = [ - "alloy-dyn-abi", - "alloy-json-abi", - "alloy-network", - "alloy-network-primitives", - "alloy-primitives", - "alloy-provider", - "alloy-rpc-types-eth", - "alloy-sol-types", - "alloy-transport", - "futures", - "futures-util", - "thiserror", -] - -[[package]] -name = "alloy-core" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f5aeeac2715738ff43076b65ca27bc0a2025ce0ee69f537c11c632027360bff" -dependencies = [ - "alloy-dyn-abi", - "alloy-json-abi", - "alloy-primitives", - "alloy-sol-types", -] - -[[package]] -name = "alloy-dyn-abi" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b03f58cfae4d41b624effe1f11624ee40499449174b20a6d6505fd72ef0d547d" -dependencies = [ - "alloy-json-abi", - "alloy-primitives", - "alloy-sol-type-parser", - "alloy-sol-types", - "const-hex", - "itoa", - "serde", - "serde_json", - "winnow 0.6.8", -] - -[[package]] -name = "alloy-eip2930" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0069cf0642457f87a01a014f6dc29d5d893cd4fd8fddf0c3cdfad1bb3ebafc41" -dependencies = [ - "alloy-primitives", - "alloy-rlp", - "serde", -] - -[[package]] -name = "alloy-eip7702" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37d319bb544ca6caeab58c39cea8921c55d924d4f68f2c60f24f914673f9a74a" -dependencies = [ - "alloy-primitives", - "alloy-rlp", - "serde", -] - -[[package]] -name = "alloy-eips" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "499ee14d296a133d142efd215eb36bf96124829fe91cf8f5d4e5ccdd381eae00" -dependencies = [ - "alloy-eip2930", - "alloy-eip7702", - "alloy-primitives", - "alloy-rlp", - "alloy-serde", - "c-kzg", - "derive_more", - "once_cell", - "serde", - "sha2", -] - -[[package]] -name = "alloy-genesis" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b85dfc693e4a1193f0372a8f789df12ab51fcbe7be0733baa04939a86dd813b" -dependencies = [ - "alloy-primitives", - "alloy-serde", - "serde", -] - -[[package]] -name = "alloy-json-abi" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28ecae8b5315daecd0075084eb47f4374b3037777346ca52fc8d9c327693f02" -dependencies = [ - "alloy-primitives", - "alloy-sol-type-parser", - "serde", - "serde_json", -] - -[[package]] -name = "alloy-json-rpc" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4207166c79cfdf7f3bed24bbc84f5c7c5d4db1970f8c82e3fcc76257f16d2166" -dependencies = [ - "alloy-primitives", - "alloy-sol-types", - "serde", - "serde_json", - "thiserror", - "tracing", -] - -[[package]] -name = "alloy-network" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfbe2802d5b8c632f18d68c352073378f02a3407c1b6a4487194e7d21ab0f002" -dependencies = [ - "alloy-consensus", - "alloy-eips", - "alloy-json-rpc", - "alloy-network-primitives", - "alloy-primitives", - "alloy-rpc-types-eth", - "alloy-serde", - "alloy-signer", - "alloy-sol-types", - "async-trait", - "auto_impl", - "futures-utils-wasm", - "thiserror", -] - -[[package]] -name = "alloy-network-primitives" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "396c07726030fa0f9dab5da8c71ccd69d5eb74a7fe1072b7ae453a67e4fe553e" -dependencies = [ - "alloy-primitives", - "alloy-serde", - "serde", -] - -[[package]] -name = "alloy-primitives" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccb865df835f851b367ae439d6c82b117ded971628c8888b24fed411a290e38a" -dependencies = [ - "alloy-rlp", - "bytes", - "cfg-if", - "const-hex", - "derive_more", - "hex-literal", - "itoa", - "k256", - "keccak-asm", - "proptest", - "rand", - "ruint", - "serde", - "tiny-keccak", -] - -[[package]] -name = "alloy-provider" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1376948df782ffee83a54cac4b2aba14134edd997229a3db97da0a606586eb5c" -dependencies = [ - "alloy-chains", - "alloy-consensus", - "alloy-eips", - "alloy-json-rpc", - "alloy-network", - "alloy-network-primitives", - "alloy-primitives", - "alloy-rpc-client", - "alloy-rpc-types-eth", - "alloy-transport", - "alloy-transport-http", - "async-stream", - "async-trait", - "auto_impl", - "dashmap", - "futures", - "futures-utils-wasm", - "lru", - "pin-project", - "reqwest", - "serde", - "serde_json", - "thiserror", - "tokio", - "tracing", - "url", -] - -[[package]] -name = "alloy-rlp" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b155716bab55763c95ba212806cf43d05bcc70e5f35b02bad20cf5ec7fe11fed" -dependencies = [ - "alloy-rlp-derive", - "arrayvec", - "bytes", -] - -[[package]] -name = "alloy-rlp-derive" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d0f2d905ebd295e7effec65e5f6868d153936130ae718352771de3e7d03c75c" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", -] - -[[package]] -name = "alloy-rpc-client" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02378418a429f8a14a0ad8ffaa15b2d25ff34914fc4a1e366513c6a3800e03b3" -dependencies = [ - "alloy-json-rpc", - "alloy-transport", - "alloy-transport-http", - "futures", - "pin-project", - "reqwest", - "serde", - "serde_json", - "tokio", - "tokio-stream", - "tower", - "tracing", - "url", -] - -[[package]] -name = "alloy-rpc-types-eth" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15bb3506ab1cf415d4752778c93e102050399fb8de97b7da405a5bf3e31f5f3b" -dependencies = [ - "alloy-consensus", - "alloy-eips", - "alloy-network-primitives", - "alloy-primitives", - "alloy-rlp", - "alloy-serde", - "alloy-sol-types", - "itertools 0.13.0", - "serde", - "serde_json", - "thiserror", -] - -[[package]] -name = "alloy-serde" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae417978015f573b4a8c02af17f88558fb22e3fccd12e8a910cf6a2ff331cfcb" -dependencies = [ - "alloy-primitives", - "serde", - "serde_json", -] - -[[package]] -name = "alloy-signer" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b750c9b61ac0646f8f4a61231c2732a337b2c829866fc9a191b96b7eedf80ffe" -dependencies = [ - "alloy-primitives", - "async-trait", - "auto_impl", - "elliptic-curve", - "k256", - "thiserror", -] - -[[package]] -name = "alloy-signer-local" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c640f9343e8f741f837c345c5ea30239ba77938b3691b884c736834853bd16c" -dependencies = [ - "alloy-consensus", - "alloy-network", - "alloy-primitives", - "alloy-signer", - "async-trait", - "k256", - "rand", - "thiserror", -] - -[[package]] -name = "alloy-sol-macro" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2dc5201ca0018afb7a3e0cd8bd15f7ca6aca924333b5f3bb87463b41d0c4ef2" -dependencies = [ - "alloy-sol-macro-expander", - "alloy-sol-macro-input", - "proc-macro-error2", - "proc-macro2", - "quote", - "syn 2.0.66", -] - -[[package]] -name = "alloy-sol-macro-expander" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "155f63dc6945885aa4532601800201fddfaa3b20901fda8e8c2570327242fe0e" -dependencies = [ - "alloy-json-abi", - "alloy-sol-macro-input", - "const-hex", - "heck 0.5.0", - "indexmap", - "proc-macro-error2", - "proc-macro2", - "quote", - "syn 2.0.66", - "syn-solidity", - "tiny-keccak", -] - -[[package]] -name = "alloy-sol-macro-input" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "847700aa9cb59d3c7b290b2d05976cd8d76b64d73bb63116a9533132d995586b" -dependencies = [ - "alloy-json-abi", - "const-hex", - "dunce", - "heck 0.5.0", - "proc-macro2", - "quote", - "serde_json", - "syn 2.0.66", - "syn-solidity", -] - -[[package]] -name = "alloy-sol-type-parser" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a6b5d462d4520bd9ed70d8364c6280aeff13baa46ea26be1ddd33538dbbe6ac" -dependencies = [ - "serde", - "winnow 0.6.8", -] - -[[package]] -name = "alloy-sol-types" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83665e5607725a7a1aab3cb0dea708f4a05e70776954ec7f0a9461439175c957" -dependencies = [ - "alloy-json-abi", - "alloy-primitives", - "alloy-sol-macro", - "const-hex", - "serde", -] - -[[package]] -name = "alloy-transport" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2799749ca692ae145f54968778877afd7c95e788488f176cfdfcf2a8abeb2062" -dependencies = [ - "alloy-json-rpc", - "base64", - "futures-util", - "futures-utils-wasm", - "serde", - "serde_json", - "thiserror", - "tokio", - "tower", - "tracing", - "url", -] - -[[package]] -name = "alloy-transport-http" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc10c4dd932f66e0db6cc5735241e0c17a6a18564b430bbc1839f7db18587a93" -dependencies = [ - "alloy-json-rpc", - "alloy-transport", - "reqwest", - "serde_json", - "tower", - "tracing", - "url", -] - -[[package]] -name = "anstream" -version = "0.6.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" -dependencies = [ - "anstyle", - "anstyle-parse", - "anstyle-query", - "anstyle-wincon", - "colorchoice", - "is_terminal_polyfill", - "utf8parse", -] - -[[package]] -name = "anstyle" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" - -[[package]] -name = "anstyle-parse" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" -dependencies = [ - "utf8parse", -] - -[[package]] -name = "anstyle-query" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad186efb764318d35165f1758e7dcef3b10628e26d41a44bc5550652e6804391" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "anstyle-wincon" -version = "3.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" -dependencies = [ - "anstyle", - "windows-sys 0.52.0", -] - -[[package]] -name = "anyhow" -version = "1.0.86" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" - -[[package]] -name = "ark-ff" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b3235cc41ee7a12aaaf2c575a2ad7b46713a8a50bda2fc3b003a04845c05dd6" -dependencies = [ - "ark-ff-asm 0.3.0", - "ark-ff-macros 0.3.0", - "ark-serialize 0.3.0", - "ark-std 0.3.0", - "derivative", - "num-bigint", - "num-traits", - "paste", - "rustc_version 0.3.3", - "zeroize", -] - -[[package]] -name = "ark-ff" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" -dependencies = [ - "ark-ff-asm 0.4.2", - "ark-ff-macros 0.4.2", - "ark-serialize 0.4.2", - "ark-std 0.4.0", - "derivative", - "digest 0.10.7", - "itertools 0.10.5", - "num-bigint", - "num-traits", - "paste", - "rustc_version 0.4.0", - "zeroize", -] - -[[package]] -name = "ark-ff-asm" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db02d390bf6643fb404d3d22d31aee1c4bc4459600aef9113833d17e786c6e44" -dependencies = [ - "quote", - "syn 1.0.109", -] - -[[package]] -name = "ark-ff-asm" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" -dependencies = [ - "quote", - "syn 1.0.109", -] - -[[package]] -name = "ark-ff-macros" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db2fd794a08ccb318058009eefdf15bcaaaaf6f8161eb3345f907222bac38b20" -dependencies = [ - "num-bigint", - "num-traits", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "ark-ff-macros" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" -dependencies = [ - "num-bigint", - "num-traits", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "ark-serialize" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d6c2b318ee6e10f8c2853e73a83adc0ccb88995aa978d8a3408d492ab2ee671" -dependencies = [ - "ark-std 0.3.0", - "digest 0.9.0", -] - -[[package]] -name = "ark-serialize" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" -dependencies = [ - "ark-std 0.4.0", - "digest 0.10.7", - "num-bigint", -] - -[[package]] -name = "ark-std" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1df2c09229cbc5a028b1d70e00fdb2acee28b1055dfb5ca73eea49c5a25c4e7c" -dependencies = [ - "num-traits", - "rand", -] - -[[package]] -name = "ark-std" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" -dependencies = [ - "num-traits", - "rand", -] - -[[package]] -name = "arrayvec" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" - -[[package]] -name = "async-recursion" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", -] - -[[package]] -name = "async-stream" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51" -dependencies = [ - "async-stream-impl", - "futures-core", - "pin-project-lite", -] - -[[package]] -name = "async-stream-impl" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", -] - -[[package]] -name = "async-trait" -version = "0.1.80" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", -] - -[[package]] -name = "auto_impl" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", -] - -[[package]] -name = "autocfg" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" - -[[package]] -name = "backtrace" -version = "0.3.71" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" -dependencies = [ - "addr2line", - "cc", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", -] - -[[package]] -name = "base16ct" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" - -[[package]] -name = "base64" -version = "0.22.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" - -[[package]] -name = "base64ct" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" - -[[package]] -name = "bindgen" -version = "0.69.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0" -dependencies = [ - "bitflags", - "cexpr", - "clang-sys", - "itertools 0.12.1", - "lazy_static", - "lazycell", - "log", - "prettyplease", - "proc-macro2", - "quote", - "regex", - "rustc-hash", - "shlex", - "syn 2.0.66", - "which", -] - -[[package]] -name = "bit-set" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" -dependencies = [ - "bit-vec", -] - -[[package]] -name = "bit-vec" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" - -[[package]] -name = "bitflags" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" - -[[package]] -name = "bitvec" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" -dependencies = [ - "funty", - "radium", - "tap", - "wyz", -] - -[[package]] -name = "block-buffer" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" -dependencies = [ - "generic-array", -] - -[[package]] -name = "blst" -version = "0.3.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4378725facc195f1a538864863f6de233b500a8862747e7f165078a419d5e874" -dependencies = [ - "cc", - "glob", - "threadpool", - "zeroize", -] - -[[package]] -name = "bumpalo" -version = "3.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" - -[[package]] -name = "byte-slice-cast" -version = "1.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" - -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - -[[package]] -name = "bytes" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" -dependencies = [ - "serde", -] - -[[package]] -name = "c-kzg" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdf100c4cea8f207e883ff91ca886d621d8a166cb04971dfaa9bb8fd99ed95df" -dependencies = [ - "blst", - "cc", - "glob", - "hex", - "libc", - "serde", -] - -[[package]] -name = "cartesi-dave-arithmetic" -version = "0.1.0" - -[[package]] -name = "cartesi-dave-contracts" -version = "0.1.0" -dependencies = [ - "alloy", -] - -[[package]] -name = "cartesi-dave-merkle" -version = "0.1.0" -dependencies = [ - "alloy", - "hex", - "ruint", - "sha3", - "thiserror", -] - -[[package]] -name = "cartesi-machine" -version = "0.18.1" -dependencies = [ - "cartesi-machine-sys", - "hex", - "thiserror", -] - -[[package]] -name = "cartesi-machine-sys" -version = "0.18.1" -dependencies = [ - "bindgen", - "bytes", - "cfg-if", - "hex-literal", - "link-cplusplus", - "reqwest", - "sha1", -] - -[[package]] -name = "cartesi-prt-compute" -version = "0.1.0" -dependencies = [ - "alloy", - "anyhow", - "cartesi-prt-core", - "clap", - "env_logger", - "log", - "tokio", -] - -[[package]] -name = "cartesi-prt-contracts" -version = "0.1.0" -dependencies = [ - "alloy", -] - -[[package]] -name = "cartesi-prt-core" -version = "0.1.0" -dependencies = [ - "alloy", - "anyhow", - "async-recursion", - "async-trait", - "cartesi-dave-arithmetic", - "cartesi-dave-merkle", - "cartesi-machine", - "cartesi-prt-contracts", - "clap", - "clap_derive", - "hex", - "log", - "num-traits", - "ruint", - "sha3", - "thiserror", -] - -[[package]] -name = "cartesi-rollups-contracts" -version = "2.0.0-rc.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b11ea82d7e8deedbb22c303837f24c19ca6c058b6ee7f9a27db989607bcc5f42" -dependencies = [ - "alloy", -] - -[[package]] -name = "cc" -version = "1.0.98" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41c270e7540d725e65ac7f1b212ac8ce349719624d7bcff99f8e2e488e8cf03f" - -[[package]] -name = "cexpr" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" -dependencies = [ - "nom", -] - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "clang-sys" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67523a3b4be3ce1989d607a828d036249522dd9c1c8de7f4dd2dae43a37369d1" -dependencies = [ - "glob", - "libc", - "libloading", -] - -[[package]] -name = "clap" -version = "4.5.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fbb260a053428790f3de475e304ff84cdbc4face759ea7a3e64c1edd938a7fc" -dependencies = [ - "clap_builder", - "clap_derive", -] - -[[package]] -name = "clap_builder" -version = "4.5.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64b17d7ea74e9f833c7dbf2cbe4fb12ff26783eda4782a8975b72f895c9b4d99" -dependencies = [ - "anstream", - "anstyle", - "clap_lex", - "strsim", -] - -[[package]] -name = "clap_derive" -version = "4.5.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "501d359d5f3dcaf6ecdeee48833ae73ec6e42723a1e52419c79abf9507eec0a0" -dependencies = [ - "heck 0.5.0", - "proc-macro2", - "quote", - "syn 2.0.66", -] - -[[package]] -name = "clap_lex" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b82cf0babdbd58558212896d1a4272303a57bdb245c2bf1147185fb45640e70" - -[[package]] -name = "colorchoice" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" - -[[package]] -name = "const-hex" -version = "1.11.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ff96486ccc291d36a958107caf2c0af8c78c0af7d31ae2f35ce055130de1a6" -dependencies = [ - "cfg-if", - "cpufeatures", - "hex", - "proptest", - "serde", -] - -[[package]] -name = "const-oid" -version = "0.9.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" - -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" - -[[package]] -name = "cpufeatures" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" -dependencies = [ - "libc", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" - -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - -[[package]] -name = "crypto-bigint" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" -dependencies = [ - "generic-array", - "rand_core", - "subtle", - "zeroize", -] - -[[package]] -name = "crypto-common" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" -dependencies = [ - "generic-array", - "typenum", -] - -[[package]] -name = "dashmap" -version = "6.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5041cc499144891f3790297212f32a74fb938e5136a14943f338ef9e0ae276cf" -dependencies = [ - "cfg-if", - "crossbeam-utils", - "hashbrown", - "lock_api", - "once_cell", - "parking_lot_core", -] - -[[package]] -name = "dave-rollups" -version = "0.1.0" -dependencies = [ - "alloy", - "anyhow", - "cartesi-prt-compute", - "cartesi-prt-core", - "cartesi-rollups-contracts", - "clap", - "clap_derive", - "env_logger", - "futures", - "log", - "rollups-blockchain-reader", - "rollups-compute-runner", - "rollups-epoch-manager", - "rollups-machine-runner", - "rollups-state-manager", - "rusqlite", - "tokio", -] - -[[package]] -name = "der" -version = "0.7.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" -dependencies = [ - "const-oid", - "zeroize", -] - -[[package]] -name = "derivative" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "derive_more" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05" -dependencies = [ - "derive_more-impl", -] - -[[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.66", - "unicode-xid", -] - -[[package]] -name = "digest" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" -dependencies = [ - "generic-array", -] - -[[package]] -name = "digest" -version = "0.10.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" -dependencies = [ - "block-buffer", - "const-oid", - "crypto-common", - "subtle", -] - -[[package]] -name = "dunce" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" - -[[package]] -name = "ecdsa" -version = "0.16.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" -dependencies = [ - "der", - "digest 0.10.7", - "elliptic-curve", - "rfc6979", - "signature", - "spki", -] - -[[package]] -name = "either" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" - -[[package]] -name = "elliptic-curve" -version = "0.13.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" -dependencies = [ - "base16ct", - "crypto-bigint", - "digest 0.10.7", - "ff", - "generic-array", - "group", - "pkcs8", - "rand_core", - "sec1", - "subtle", - "zeroize", -] - -[[package]] -name = "env_filter" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f2c92ceda6ceec50f43169f9ee8424fe2db276791afde7b2cd8bc084cb376ab" -dependencies = [ - "log", - "regex", -] - -[[package]] -name = "env_logger" -version = "0.11.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13fa619b91fb2381732789fc5de83b45675e882f66623b7d8cb4f643017018d" -dependencies = [ - "anstream", - "anstyle", - "env_filter", - "humantime", - "log", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "fallible-iterator" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" - -[[package]] -name = "fallible-streaming-iterator" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a" - -[[package]] -name = "fastrand" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" - -[[package]] -name = "fastrlp" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "139834ddba373bbdd213dffe02c8d110508dcf1726c2be27e8d1f7d7e1856418" -dependencies = [ - "arrayvec", - "auto_impl", - "bytes", -] - -[[package]] -name = "ff" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" -dependencies = [ - "rand_core", - "subtle", -] - -[[package]] -name = "fixed-hash" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" -dependencies = [ - "byteorder", - "rand", - "rustc-hex", - "static_assertions", -] - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - -[[package]] -name = "form_urlencoded" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" -dependencies = [ - "percent-encoding", -] - -[[package]] -name = "funty" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" - -[[package]] -name = "futures" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" -dependencies = [ - "futures-channel", - "futures-core", - "futures-executor", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-channel" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" -dependencies = [ - "futures-core", - "futures-sink", -] - -[[package]] -name = "futures-core" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" - -[[package]] -name = "futures-executor" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" -dependencies = [ - "futures-core", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-io" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" - -[[package]] -name = "futures-macro" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", -] - -[[package]] -name = "futures-sink" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" - -[[package]] -name = "futures-task" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" - -[[package]] -name = "futures-util" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" -dependencies = [ - "futures-channel", - "futures-core", - "futures-io", - "futures-macro", - "futures-sink", - "futures-task", - "memchr", - "pin-project-lite", - "pin-utils", - "slab", -] - -[[package]] -name = "futures-utils-wasm" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42012b0f064e01aa58b545fe3727f90f7dd4020f4a3ea735b50344965f5a57e9" - -[[package]] -name = "generic-array" -version = "0.14.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" -dependencies = [ - "typenum", - "version_check", - "zeroize", -] - -[[package]] -name = "getrandom" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" -dependencies = [ - "cfg-if", - "libc", - "wasi", -] - -[[package]] -name = "gimli" -version = "0.28.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" - -[[package]] -name = "glob" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" - -[[package]] -name = "group" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" -dependencies = [ - "ff", - "rand_core", - "subtle", -] - -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" -dependencies = [ - "ahash", - "allocator-api2", -] - -[[package]] -name = "hashlink" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ba4ff7128dee98c7dc9794b6a411377e1404dba1c97deb8d1a55297bd25d8af" -dependencies = [ - "hashbrown", -] - -[[package]] -name = "heck" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" - -[[package]] -name = "heck" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" - -[[package]] -name = "hermit-abi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" -dependencies = [ - "serde", -] - -[[package]] -name = "hex-literal" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" - -[[package]] -name = "hmac" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" -dependencies = [ - "digest 0.10.7", -] - -[[package]] -name = "home" -version = "0.5.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "http" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - -[[package]] -name = "http-body" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" -dependencies = [ - "bytes", - "http", -] - -[[package]] -name = "http-body-util" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0475f8b2ac86659c21b64320d5d653f9efe42acd2a4e560073ec61a155a34f1d" -dependencies = [ - "bytes", - "futures-core", - "http", - "http-body", - "pin-project-lite", -] - -[[package]] -name = "httparse" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" - -[[package]] -name = "humantime" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" - -[[package]] -name = "hyper" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe575dd17d0862a9a33781c8c4696a55c320909004a67a00fb286ba8b1bc496d" -dependencies = [ - "bytes", - "futures-channel", - "futures-util", - "http", - "http-body", - "httparse", - "itoa", - "pin-project-lite", - "smallvec", - "tokio", - "want", -] - -[[package]] -name = "hyper-rustls" -version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0bea761b46ae2b24eb4aef630d8d1c398157b6fc29e6350ecf090a0b70c952c" -dependencies = [ - "futures-util", - "http", - "hyper", - "hyper-util", - "rustls", - "rustls-pki-types", - "tokio", - "tokio-rustls", - "tower-service", -] - -[[package]] -name = "hyper-tls" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" -dependencies = [ - "bytes", - "http-body-util", - "hyper", - "hyper-util", - "native-tls", - "tokio", - "tokio-native-tls", - "tower-service", -] - -[[package]] -name = "hyper-util" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d8d52be92d09acc2e01dddb7fde3ad983fc6489c7db4837e605bc3fca4cb63e" -dependencies = [ - "bytes", - "futures-channel", - "futures-util", - "http", - "http-body", - "hyper", - "pin-project-lite", - "socket2", - "tokio", - "tower", - "tower-service", - "tracing", -] - -[[package]] -name = "idna" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] - -[[package]] -name = "impl-codec" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" -dependencies = [ - "parity-scale-codec", -] - -[[package]] -name = "impl-trait-for-tuples" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "indexmap" -version = "2.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" -dependencies = [ - "equivalent", - "hashbrown", -] - -[[package]] -name = "ipnet" -version = "2.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" - -[[package]] -name = "is_terminal_polyfill" -version = "1.70.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -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" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" -dependencies = [ - "either", -] - -[[package]] -name = "itoa" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" - -[[package]] -name = "js-sys" -version = "0.3.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "k256" -version = "0.13.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" -dependencies = [ - "cfg-if", - "ecdsa", - "elliptic-curve", - "once_cell", - "sha2", -] - -[[package]] -name = "keccak" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" -dependencies = [ - "cpufeatures", -] - -[[package]] -name = "keccak-asm" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47a3633291834c4fbebf8673acbc1b04ec9d151418ff9b8e26dcd79129928758" -dependencies = [ - "digest 0.10.7", - "sha3-asm", -] - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "lazycell" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" - -[[package]] -name = "libc" -version = "0.2.155" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" - -[[package]] -name = "libloading" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" -dependencies = [ - "cfg-if", - "windows-targets 0.52.5", -] - -[[package]] -name = "libm" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" - -[[package]] -name = "libsqlite3-sys" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c10584274047cb335c23d3e61bcef8e323adae7c5c8c760540f73610177fc3f" -dependencies = [ - "cc", - "pkg-config", - "vcpkg", -] - -[[package]] -name = "link-cplusplus" -version = "1.0.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d240c6f7e1ba3a28b0249f774e6a9dd0175054b52dfbb61b16eb8505c3785c9" -dependencies = [ - "cc", -] - -[[package]] -name = "linux-raw-sys" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" - -[[package]] -name = "lock_api" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" - -[[package]] -name = "lru" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37ee39891760e7d94734f6f63fedc29a2e4a152f836120753a72503f09fcf904" -dependencies = [ - "hashbrown", -] - -[[package]] -name = "memchr" -version = "2.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" - -[[package]] -name = "mime" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" - -[[package]] -name = "minimal-lexical" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" - -[[package]] -name = "miniz_oxide" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" -dependencies = [ - "adler", -] - -[[package]] -name = "mio" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" -dependencies = [ - "libc", - "wasi", - "windows-sys 0.48.0", -] - -[[package]] -name = "native-tls" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" -dependencies = [ - "lazy_static", - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - -[[package]] -name = "nom" -version = "7.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" -dependencies = [ - "memchr", - "minimal-lexical", -] - -[[package]] -name = "num-bigint" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7" -dependencies = [ - "num-integer", - "num-traits", -] - -[[package]] -name = "num-integer" -version = "0.1.46" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", - "libm", -] - -[[package]] -name = "num_cpus" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" -dependencies = [ - "hermit-abi", - "libc", -] - -[[package]] -name = "num_enum" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845" -dependencies = [ - "num_enum_derive", -] - -[[package]] -name = "num_enum_derive" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", -] - -[[package]] -name = "object" -version = "0.32.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" -dependencies = [ - "memchr", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "openssl" -version = "0.10.64" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" -dependencies = [ - "bitflags", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.102" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c597637d56fbc83893a35eb0dd04b2b8e7a50c91e64e9493e398b5df4fb45fa2" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - -[[package]] -name = "parity-scale-codec" -version = "3.6.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "306800abfa29c7f16596b5970a588435e3d5b3149683d00c12b699cc19f895ee" -dependencies = [ - "arrayvec", - "bitvec", - "byte-slice-cast", - "impl-trait-for-tuples", - "parity-scale-codec-derive", - "serde", -] - -[[package]] -name = "parity-scale-codec-derive" -version = "3.6.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d830939c76d294956402033aee57a6da7b438f2294eb94864c37b0569053a42c" -dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "parking_lot" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" -dependencies = [ - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall", - "smallvec", - "windows-targets 0.52.5", -] - -[[package]] -name = "paste" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" - -[[package]] -name = "percent-encoding" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" - -[[package]] -name = "pest" -version = "2.7.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "560131c633294438da9f7c4b08189194b20946c8274c6b9e38881a7874dc8ee8" -dependencies = [ - "memchr", - "thiserror", - "ucd-trie", -] - -[[package]] -name = "pin-project" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" -dependencies = [ - "pin-project-internal", -] - -[[package]] -name = "pin-project-internal" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", -] - -[[package]] -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 = "ppv-lite86" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" - -[[package]] -name = "prettyplease" -version = "0.2.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" -dependencies = [ - "proc-macro2", - "syn 2.0.66", -] - -[[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 = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" -dependencies = [ - "toml_edit", -] - -[[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.66", -] - -[[package]] -name = "proc-macro2" -version = "1.0.83" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b33eb56c327dec362a9e55b3ad14f9d2f0904fb5a5b03b513ab5465399e9f43" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "proptest" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31b476131c3c86cb68032fdc5cb6d5a1045e3e42d96b69fa599fd77701e1f5bf" -dependencies = [ - "bit-set", - "bit-vec", - "bitflags", - "lazy_static", - "num-traits", - "rand", - "rand_chacha", - "rand_xorshift", - "regex-syntax", - "rusty-fork", - "tempfile", - "unarray", -] - -[[package]] -name = "quick-error" -version = "1.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" - -[[package]] -name = "quote" -version = "1.0.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radium" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" - -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "libc", - "rand_chacha", - "rand_core", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom", -] - -[[package]] -name = "rand_xorshift" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" -dependencies = [ - "rand_core", -] - -[[package]] -name = "redox_syscall" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" -dependencies = [ - "bitflags", -] - -[[package]] -name = "regex" -version = "1.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" - -[[package]] -name = "reqwest" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "566cafdd92868e0939d3fb961bd0dc25fcfaaed179291093b3d43e6b3150ea10" -dependencies = [ - "base64", - "bytes", - "futures-channel", - "futures-core", - "futures-util", - "http", - "http-body", - "http-body-util", - "hyper", - "hyper-rustls", - "hyper-tls", - "hyper-util", - "ipnet", - "js-sys", - "log", - "mime", - "native-tls", - "once_cell", - "percent-encoding", - "pin-project-lite", - "rustls", - "rustls-pemfile", - "rustls-pki-types", - "serde", - "serde_json", - "serde_urlencoded", - "sync_wrapper", - "tokio", - "tokio-native-tls", - "tokio-rustls", - "tower-service", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "webpki-roots", - "winreg", -] - -[[package]] -name = "rfc6979" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" -dependencies = [ - "hmac", - "subtle", -] - -[[package]] -name = "ring" -version = "0.17.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" -dependencies = [ - "cc", - "cfg-if", - "getrandom", - "libc", - "spin", - "untrusted", - "windows-sys 0.52.0", -] - -[[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 = "rollups-blockchain-reader" -version = "0.1.0" -dependencies = [ - "alloy", - "alloy-rpc-types-eth", - "async-recursion", - "cartesi-dave-contracts", - "cartesi-rollups-contracts", - "clap", - "clap_derive", - "num-traits", - "rollups-state-manager", - "thiserror", - "tokio", -] - -[[package]] -name = "rollups-compute-runner" -version = "0.1.0" -dependencies = [ - "cartesi-prt-core", - "rollups-state-manager", -] - -[[package]] -name = "rollups-epoch-manager" -version = "0.1.0" -dependencies = [ - "alloy", - "anyhow", - "cartesi-dave-contracts", - "cartesi-prt-core", - "rollups-state-manager", - "tokio", -] - -[[package]] -name = "rollups-machine-runner" -version = "0.1.0" -dependencies = [ - "alloy", - "cartesi-dave-arithmetic", - "cartesi-dave-merkle", - "cartesi-machine", - "cartesi-prt-core", - "cartesi-rollups-contracts", - "hex", - "rollups-state-manager", - "thiserror", -] - -[[package]] -name = "rollups-state-manager" -version = "0.1.0" -dependencies = [ - "lazy_static", - "rusqlite", - "rusqlite_migration", - "thiserror", -] - -[[package]] -name = "ruint" -version = "1.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c3cc4c2511671f327125da14133d0c5c5d137f006a1017a16f557bc85b16286" -dependencies = [ - "alloy-rlp", - "ark-ff 0.3.0", - "ark-ff 0.4.2", - "bytes", - "fastrlp", - "num-bigint", - "num-traits", - "parity-scale-codec", - "primitive-types", - "proptest", - "rand", - "rlp", - "ruint-macro", - "serde", - "valuable", - "zeroize", -] - -[[package]] -name = "ruint-macro" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48fd7bd8a6377e15ad9d42a8ec25371b94ddc67abe7c8b9127bec79bebaaae18" - -[[package]] -name = "rusqlite" -version = "0.31.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b838eba278d213a8beaf485bd313fd580ca4505a00d5871caeb1457c55322cae" -dependencies = [ - "bitflags", - "fallible-iterator", - "fallible-streaming-iterator", - "hashlink", - "libsqlite3-sys", - "smallvec", -] - -[[package]] -name = "rusqlite_migration" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55709bc01054c69e2f1cefdc886642b5e6376a8db3c86f761be0c423eebf178b" -dependencies = [ - "log", - "rusqlite", -] - -[[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-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.23", -] - -[[package]] -name = "rustix" -version = "0.38.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", -] - -[[package]] -name = "rustls" -version = "0.22.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf4ef73721ac7bcd79b2b315da7779d8fc09718c6b3d2d1b2d94850eb8c18432" -dependencies = [ - "log", - "ring", - "rustls-pki-types", - "rustls-webpki", - "subtle", - "zeroize", -] - -[[package]] -name = "rustls-pemfile" -version = "2.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d" -dependencies = [ - "base64", - "rustls-pki-types", -] - -[[package]] -name = "rustls-pki-types" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc0a2ce646f8655401bb81e7927b812614bd5d91dbc968696be50603510fcaf0" - -[[package]] -name = "rustls-webpki" -version = "0.102.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84678086bd54edf2b415183ed7a94d0efb049f1b646a33e22a36f3794be6ae56" -dependencies = [ - "ring", - "rustls-pki-types", - "untrusted", -] - -[[package]] -name = "rustversion" -version = "1.0.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" - -[[package]] -name = "rusty-fork" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb3dcc6e454c328bb824492db107ab7c0ae8fcffe4ad210136ef014458c1bc4f" -dependencies = [ - "fnv", - "quick-error", - "tempfile", - "wait-timeout", -] - -[[package]] -name = "ryu" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" - -[[package]] -name = "schannel" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "sec1" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" -dependencies = [ - "base16ct", - "der", - "generic-array", - "pkcs8", - "subtle", - "zeroize", -] - -[[package]] -name = "security-framework" -version = "2.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c627723fd09706bacdb5cf41499e95098555af3c3c29d014dc3c458ef6be11c0" -dependencies = [ - "bitflags", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317936bbbd05227752583946b9e66d7ce3b489f84e11a94a510b4437fef407d7" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "semver" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" -dependencies = [ - "semver-parser", -] - -[[package]] -name = "semver" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" - -[[package]] -name = "semver-parser" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7" -dependencies = [ - "pest", -] - -[[package]] -name = "serde" -version = "1.0.202" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "226b61a0d411b2ba5ff6d7f73a476ac4f8bb900373459cd00fab8512828ba395" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.202" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6048858004bcff69094cd972ed40a32500f153bd3be9f716b2eed2e8217c4838" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", -] - -[[package]] -name = "serde_json" -version = "1.0.117" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" -dependencies = [ - "itoa", - "ryu", - "serde", -] - -[[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 = "sha1" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest 0.10.7", -] - -[[package]] -name = "sha2" -version = "0.10.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest 0.10.7", -] - -[[package]] -name = "sha3" -version = "0.10.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" -dependencies = [ - "digest 0.10.7", - "keccak", -] - -[[package]] -name = "sha3-asm" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9b57fd861253bff08bb1919e995f90ba8f4889de2726091c8876f3a4e823b40" -dependencies = [ - "cc", - "cfg-if", -] - -[[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.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" -dependencies = [ - "libc", -] - -[[package]] -name = "signature" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" -dependencies = [ - "digest 0.10.7", - "rand_core", -] - -[[package]] -name = "slab" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" -dependencies = [ - "autocfg", -] - -[[package]] -name = "smallvec" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" - -[[package]] -name = "socket2" -version = "0.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "spin" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" - -[[package]] -name = "spki" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" -dependencies = [ - "base64ct", - "der", -] - -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - -[[package]] -name = "strsim" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" - -[[package]] -name = "strum" -version = "0.26.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29" -dependencies = [ - "strum_macros", -] - -[[package]] -name = "strum_macros" -version = "0.26.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6cf59daf282c0a494ba14fd21610a0325f9f90ec9d1231dea26bcb1d696c946" -dependencies = [ - "heck 0.4.1", - "proc-macro2", - "quote", - "rustversion", - "syn 2.0.66", -] - -[[package]] -name = "subtle" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" - -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn-solidity" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1e1355d44af21638c8e05d45097db6cb5ec2aa3e970c51cb2901605cf3344fa" -dependencies = [ - "paste", - "proc-macro2", - "quote", - "syn 2.0.66", -] - -[[package]] -name = "sync_wrapper" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" - -[[package]] -name = "tap" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" - -[[package]] -name = "tempfile" -version = "3.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" -dependencies = [ - "cfg-if", - "fastrand", - "rustix", - "windows-sys 0.52.0", -] - -[[package]] -name = "thiserror" -version = "1.0.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", -] - -[[package]] -name = "threadpool" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d050e60b33d41c19108b32cea32164033a9013fe3b46cbd4457559bfbf77afaa" -dependencies = [ - "num_cpus", -] - -[[package]] -name = "tiny-keccak" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" -dependencies = [ - "crunchy", -] - -[[package]] -name = "tinyvec" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" -dependencies = [ - "tinyvec_macros", -] - -[[package]] -name = "tinyvec_macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" - -[[package]] -name = "tokio" -version = "1.37.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" -dependencies = [ - "backtrace", - "bytes", - "libc", - "mio", - "num_cpus", - "parking_lot", - "pin-project-lite", - "signal-hook-registry", - "socket2", - "tokio-macros", - "windows-sys 0.48.0", -] - -[[package]] -name = "tokio-macros" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", -] - -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", -] - -[[package]] -name = "tokio-rustls" -version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f" -dependencies = [ - "rustls", - "rustls-pki-types", - "tokio", -] - -[[package]] -name = "tokio-stream" -version = "0.1.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" -dependencies = [ - "futures-core", - "pin-project-lite", - "tokio", - "tokio-util", -] - -[[package]] -name = "tokio-util" -version = "0.7.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", -] - -[[package]] -name = "toml_datetime" -version = "0.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf" - -[[package]] -name = "toml_edit" -version = "0.21.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" -dependencies = [ - "indexmap", - "toml_datetime", - "winnow 0.5.40", -] - -[[package]] -name = "tower" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" -dependencies = [ - "futures-core", - "futures-util", - "pin-project", - "pin-project-lite", - "tokio", - "tower-layer", - "tower-service", - "tracing", -] - -[[package]] -name = "tower-layer" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" - -[[package]] -name = "tower-service" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" - -[[package]] -name = "tracing" -version = "0.1.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" -dependencies = [ - "log", - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", -] - -[[package]] -name = "tracing-core" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" -dependencies = [ - "once_cell", -] - -[[package]] -name = "try-lock" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" - -[[package]] -name = "typenum" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" - -[[package]] -name = "ucd-trie" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" - -[[package]] -name = "uint" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52" -dependencies = [ - "byteorder", - "crunchy", - "hex", - "static_assertions", -] - -[[package]] -name = "unarray" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" - -[[package]] -name = "unicode-bidi" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unicode-normalization" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" -dependencies = [ - "tinyvec", -] - -[[package]] -name = "unicode-xid" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" - -[[package]] -name = "untrusted" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" - -[[package]] -name = "url" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" -dependencies = [ - "form_urlencoded", - "idna", - "percent-encoding", -] - -[[package]] -name = "utf8parse" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" - -[[package]] -name = "valuable" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" - -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "wait-timeout" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6" -dependencies = [ - "libc", -] - -[[package]] -name = "want" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" -dependencies = [ - "try-lock", -] - -[[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" - -[[package]] -name = "wasm-bindgen" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" -dependencies = [ - "cfg-if", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" -dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn 2.0.66", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-futures" -version = "0.4.42" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" -dependencies = [ - "cfg-if", - "js-sys", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" - -[[package]] -name = "web-sys" -version = "0.3.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "webpki-roots" -version = "0.26.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bd24728e5af82c6c4ec1b66ac4844bdf8156257fccda846ec58b42cd0cdbe6a" -dependencies = [ - "rustls-pki-types", -] - -[[package]] -name = "which" -version = "4.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" -dependencies = [ - "either", - "home", - "once_cell", - "rustix", -] - -[[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" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.5", -] - -[[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.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" -dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", - "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", -] - -[[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.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" - -[[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.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" - -[[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.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" - -[[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.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" - -[[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.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" - -[[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.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" - -[[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.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" - -[[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.6.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3c52e9c97a68071b23e836c9380edae937f17b9c4667bd021973efc689f618d" -dependencies = [ - "memchr", -] - -[[package]] -name = "winreg" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5" -dependencies = [ - "cfg-if", - "windows-sys 0.48.0", -] - -[[package]] -name = "wyz" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" -dependencies = [ - "tap", -] - -[[package]] -name = "zerocopy" -version = "0.7.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", -] - -[[package]] -name = "zeroize" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" -dependencies = [ - "zeroize_derive", -] - -[[package]] -name = "zeroize_derive" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", -] diff --git a/cartesi-rollups/node/Cargo.toml b/cartesi-rollups/node/Cargo.toml deleted file mode 100644 index 369ac139..00000000 --- a/cartesi-rollups/node/Cargo.toml +++ /dev/null @@ -1,49 +0,0 @@ -[workspace] -resolver = "2" -members = [ - "blockchain-reader", - "dave-rollups", - "epoch-manager", - "machine-runner", - "state-manager", -] - -[workspace.package] -version = "0.1.0" - -authors = [ - "Gabriel Coutinho de Paula ", - "Stephen Chen ", -] -description = "A Cartesi validator reference implementation" -edition = "2021" -homepage = "https://github.com/cartesi/dave" -license-file = "LICENSE" -readme = "README.md" -repository = "https://github.com/cartesi/dave" - -[workspace.dependencies] -rollups-blockchain-reader = { version = "0.1", path = "blockchain-reader" } -rollups-compute-runner = { version = "0.1", path = "compute-runner" } -rollups-epoch-manager = { version = "0.1", path = "epoch-manager" } -rollups-machine-runner = { version = "0.1", path = "machine-runner" } -rollups-state-manager = { version = "0.1", path = "state-manager" } - -cartesi-machine = { path = "../../machine/rust-bindings/cartesi-machine" } -cartesi-dave-arithmetic = { path = "../../common-rs/arithmetic" } -cartesi-dave-contracts = { path = "../contract-bindings" } -cartesi-dave-merkle = { path = "../../common-rs/merkle" } -cartesi-prt-core = { path = "../../prt/client-rs" } - -alloy = { version = "0.8.0", features = ["sol-types", "contract", "network", "reqwest", "signers", "signer-local"] } -anyhow = "1.0" -async-recursion = "1" -async-trait = "0.1.74" -cartesi-rollups-contracts = "2.0.0-rc.13" -clap = { version = "4.5.7", features = ["derive", "env"] } -clap_derive = "=4.5.13" -futures = "0.3" -log = "0.4" -num-traits = "0.2.19" -thiserror = "1.0" -tokio = { version = "1", features = ["full"] } diff --git a/cartesi-rollups/node/Dockerfile.test b/cartesi-rollups/node/Dockerfile.test deleted file mode 100644 index 946e4cc2..00000000 --- a/cartesi-rollups/node/Dockerfile.test +++ /dev/null @@ -1,37 +0,0 @@ -FROM cartesi/machine-emulator:0.18.1 - -USER 0 -RUN apt-get -y update && \ - apt-get -y install build-essential clang curl git libssl-dev pkg-config wget - -RUN curl https://sh.rustup.rs -sSf | bash -s -- -y - -ENV PATH="/root/.cargo/bin:${PATH}" - -COPY --from=ethereum/solc:0.8.27 /usr/bin/solc /usr/bin/solc -RUN chmod u+x /usr/bin/solc - -WORKDIR /app - -RUN wget https://github.com/cartesi/image-kernel/releases/download/v0.20.0/linux-6.5.13-ctsi-1-v0.20.0.bin \ - -O ./linux.bin -RUN wget https://github.com/cartesi/machine-emulator-tools/releases/download/v0.16.1/rootfs-tools-v0.16.1.ext2 \ - -O ./rootfs.ext2 - -RUN cartesi-machine --ram-image=./linux.bin \ - --flash-drive=label:root,filename:./rootfs.ext2 \ - --no-rollback --store=./echo \ - -- "ioctl-echo-loop --vouchers=1 --notices=1 --reports=1 --verbose=1" - -# copy dependencies -COPY ./machine /app/machine -COPY ./common-rs /app/common-rs -COPY ./prt /app/prt - -# copy rollups-node application -COPY ./rollups-node /app/rollups-node -COPY ./.git /app/.git - -WORKDIR /app/rollups-node - -ENTRYPOINT ["./rollups-test-entrypoint.sh"] diff --git a/cartesi-rollups/node/blockchain-reader/Cargo.toml b/cartesi-rollups/node/blockchain-reader/Cargo.toml index d398ae36..e83b9329 100644 --- a/cartesi-rollups/node/blockchain-reader/Cargo.toml +++ b/cartesi-rollups/node/blockchain-reader/Cargo.toml @@ -19,7 +19,6 @@ alloy = { workspace = true } alloy-rpc-types-eth = "0.8.0" async-recursion = { workspace = true } clap = { workspace = true } -clap_derive = { workspace = true } log = { workspace = true } thiserror = { workspace = true } tokio = { workspace = true } @@ -29,9 +28,9 @@ num-traits = { workspace = true } alloy = { workspace = true, features = ["node-bindings"] } cartesi-dave-merkle = { workspace = true } cartesi-prt-core = { workspace = true } -cartesi-prt-contracts = { path = "../../../prt/contract-bindings" } +cartesi-prt-contracts = { workspace = true } + +rusqlite = { workspace = true } +rusqlite_migration = { workspace = true } clap = { workspace = true } -clap_derive = { workspace = true } -rusqlite = { version = "0.31.0", features = ["bundled"] } -rusqlite_migration = "1.2.0" diff --git a/cartesi-rollups/node/blockchain-reader/src/lib.rs b/cartesi-rollups/node/blockchain-reader/src/lib.rs index 8a9ab085..c0f4a631 100644 --- a/cartesi-rollups/node/blockchain-reader/src/lib.rs +++ b/cartesi-rollups/node/blockchain-reader/src/lib.rs @@ -440,29 +440,20 @@ impl PartitionProvider { } #[cfg(test)] -mod blockchiain_reader_tests { +mod blockchain_reader_tests { use crate::*; use alloy::{ + hex::FromHex, network::EthereumWallet, node_bindings::{Anvil, AnvilInstance}, primitives::Address, providers::ProviderBuilder, - signers::local::PrivateKeySigner, - signers::Signer, + signers::{local::PrivateKeySigner, Signer}, sol_types::{SolCall, SolValue}, transports::http::{Client, Http}, }; use cartesi_dave_contracts::daveconsensus::DaveConsensus::{self, EpochSealed}; use cartesi_dave_merkle::Digest; - use cartesi_prt_contracts::{ - bottomtournamentfactory::BottomTournamentFactory, - middletournamentfactory::MiddleTournamentFactory, - multileveltournamentfactory::MultiLevelTournamentFactory::{ - self, CommitmentStructure, DisputeParameters, MultiLevelTournamentFactoryInstance, - TimeConstants, - }, - toptournamentfactory::TopTournamentFactory, - }; use cartesi_prt_core::arena::SenderFiller; use cartesi_rollups_contracts::{ inputbox::InputBox::{self, InputAdded}, @@ -479,13 +470,24 @@ mod blockchiain_reader_tests { type Result = std::result::Result>; const APP_ADDRESS: Address = Address::ZERO; - const INITIAL_STATE: Digest = Digest::ZERO; + // $ xxd -p -c32 test/programs/echo/machine-image/hash + const INITIAL_STATE: &str = + "0x84c8181abd120e0281f5032d22422b890f79880ae90d9a1416be1afccb8182a0"; const INPUT_PAYLOAD: &str = "Hello!"; const INPUT_PAYLOAD2: &str = "Hello Two!"; - fn spawn_anvil_and_provider() -> (AnvilInstance, Arc) { - let args = vec!["--slots-in-an-epoch", "1"]; - let anvil = Anvil::default().block_time(1).args(args).spawn(); + fn spawn_anvil_and_provider() -> (AnvilInstance, SenderFiller, Address, Address) { + let anvil = Anvil::default() + .block_time(1) + .args([ + "--disable-code-size-limit", + "--preserve-historical-states", + "--slots-in-an-epoch", + "1", + "--load-state", + "../../../test/programs/echo/anvil_state.json", + ]) + .spawn(); let mut signer: PrivateKeySigner = anvil.keys()[0].clone().into(); @@ -497,7 +499,12 @@ mod blockchiain_reader_tests { .wallet(wallet) .on_http(anvil.endpoint_url()); - (anvil, Arc::new(provider)) + ( + anvil, + provider, + Address::from_hex("0x5fbdb2315678afecb367f032d93f642f64180aa3").unwrap(), + Address::from_hex("0x0165878a594ca255338adfa4d48449f69242eb8f").unwrap(), + ) } fn create_partition_rovider(url: &str) -> Result { @@ -513,70 +520,8 @@ mod blockchiain_reader_tests { EventReader::::new() } - async fn deploy_inputbox<'a>( - provider: &'a Arc, - ) -> Result, &'a Arc>>> { - let inputbox = InputBox::deploy(provider).await?; - Ok(Arc::new(inputbox)) - } - - async fn deploy_daveconsensus<'a>( - provider: &'a Arc, - inputbox: &Address, - tournament_factory: &Address, - ) -> Result, &'a Arc>>> - { - let daveconsensus = DaveConsensus::deploy( - provider, - *inputbox, - APP_ADDRESS, - *tournament_factory, - INITIAL_STATE.into(), - ) - .await?; - Ok(Arc::new(daveconsensus)) - } - - async fn deploy_tournamentfactories<'a>( - provider: &'a Arc, - ) -> Result, &'a Arc>>> { - let dispute_parameters = DisputeParameters { - timeConstants: TimeConstants { - matchEffort: 60 * 2, - maxAllowance: 60 * (60 + 5 + 2), - }, - commitmentStructures: vec![ - CommitmentStructure { - log2step: 44, - height: 48, - }, - CommitmentStructure { - log2step: 28, - height: 16, - }, - CommitmentStructure { - log2step: 0, - height: 28, - }, - ], - }; - - let top_tournamentfactory = TopTournamentFactory::deploy(provider).await?; - let mid_tournamentfactory = MiddleTournamentFactory::deploy(provider).await?; - let bottom_tournamentfactory = BottomTournamentFactory::deploy(provider).await?; - let multi_tournamentfactory = MultiLevelTournamentFactory::deploy( - provider, - *top_tournamentfactory.address(), - *mid_tournamentfactory.address(), - *bottom_tournamentfactory.address(), - dispute_parameters, - ) - .await?; - Ok(Arc::new(multi_tournamentfactory)) - } - - async fn add_input<'a>( - inputbox: &'a Arc, &'a Arc>>, + async fn add_input( + inputbox: &InputBox::InputBoxInstance, impl Provider>>, input_payload: &'static str, count: usize, ) -> Result<()> { @@ -669,40 +614,40 @@ mod blockchiain_reader_tests { #[tokio::test] async fn test_input_reader() -> Result<()> { - let (anvil, provider) = spawn_anvil_and_provider(); - - let inputbox = deploy_inputbox(&provider).await?; + let (anvil, provider, input_box_address, _) = spawn_anvil_and_provider(); + let inputbox = InputBox::new(input_box_address, &provider); - let mut input_count = 2; - add_input(&inputbox, &INPUT_PAYLOAD, input_count).await?; + let input_count_1 = 2; + // Inputbox is deployed with 1 input already + add_input(&inputbox, INPUT_PAYLOAD, input_count_1).await?; let input_reader = create_input_reader(); let mut read_inputs = read_inputs_until_count( &anvil.endpoint(), inputbox.address(), &input_reader, - input_count, + 1 + input_count_1, ) .await?; - assert_eq!(read_inputs.len(), input_count); + assert_eq!(read_inputs.len(), 1 + input_count_1); let received_payload = - EvmAdvanceCall::abi_decode(read_inputs[input_count - 1].input.as_ref(), true)?; + EvmAdvanceCall::abi_decode(read_inputs.last().unwrap().input.as_ref(), true)?; assert_eq!(received_payload.payload.as_ref(), INPUT_PAYLOAD.as_bytes()); - input_count = 3; - add_input(&inputbox, &INPUT_PAYLOAD2, input_count).await?; + let input_count_2 = 3; + add_input(&inputbox, INPUT_PAYLOAD2, input_count_2).await?; read_inputs = read_inputs_until_count( &anvil.endpoint(), inputbox.address(), &input_reader, - input_count, + 1 + input_count_1 + input_count_2, ) .await?; - assert_eq!(read_inputs.len(), input_count); + assert_eq!(read_inputs.len(), 1 + input_count_1 + input_count_2); let received_payload = - EvmAdvanceCall::abi_decode(read_inputs[input_count - 1].input.as_ref(), true)?; + EvmAdvanceCall::abi_decode(read_inputs.last().unwrap().input.as_ref(), true)?; assert_eq!(received_payload.payload.as_ref(), INPUT_PAYLOAD2.as_bytes()); drop(anvil); @@ -711,16 +656,8 @@ mod blockchiain_reader_tests { #[tokio::test] async fn test_epoch_reader() -> Result<()> { - let (anvil, provider) = spawn_anvil_and_provider(); - - let inputbox = deploy_inputbox(&provider).await?; - let multi_tournamentfactory = deploy_tournamentfactories(&provider).await?; - let daveconsensus = deploy_daveconsensus( - &provider, - inputbox.address(), - multi_tournamentfactory.address(), - ) - .await?; + let (anvil, provider, _, consensus_address) = spawn_anvil_and_provider(); + let daveconsensus = DaveConsensus::new(consensus_address, &provider); let epoch_reader = create_epoch_reader(); let read_epochs = @@ -729,7 +666,7 @@ mod blockchiain_reader_tests { assert_eq!(read_epochs.len(), 1); assert_eq!( &read_epochs[0].initialMachineStateHash.abi_encode(), - INITIAL_STATE.slice() + Digest::from_digest_hex(INITIAL_STATE).unwrap().slice() ); drop(anvil); @@ -737,25 +674,20 @@ mod blockchiain_reader_tests { } #[tokio::test] - async fn test_blockchain_reader() -> Result<()> { - let (anvil, provider) = spawn_anvil_and_provider(); + async fn test_blockchain_reader_aaa() -> Result<()> { + let (anvil, provider, input_box_address, consensus_address) = spawn_anvil_and_provider(); - let inputbox = deploy_inputbox(&provider).await?; + let inputbox = InputBox::new(input_box_address, &provider); let state_manager = Arc::new(PersistentStateAccess::new( Connection::open_in_memory().unwrap(), )?); + // Note that inputbox is deployed with 1 input already // add inputs to epoch 0 - let mut input_count = 2; - add_input(&inputbox, &INPUT_PAYLOAD, input_count).await?; + let input_count_1 = 2; + add_input(&inputbox, INPUT_PAYLOAD, input_count_1).await?; - let multi_tournamentfactory = deploy_tournamentfactories(&provider).await?; - let daveconsensus = deploy_daveconsensus( - &provider, - inputbox.address(), - multi_tournamentfactory.address(), - ) - .await?; + let daveconsensus = DaveConsensus::new(consensus_address, &provider); let mut blockchain_reader = BlockchainReader::new( state_manager.clone(), AddressBook { @@ -767,23 +699,30 @@ mod blockchiain_reader_tests { 1, )?; - let _ = spawn(async move { + let r = spawn(async move { blockchain_reader.start().await.unwrap(); }); - read_inputs_from_db_until_count(&state_manager, 0, input_count).await?; + read_inputs_from_db_until_count(&state_manager, 0, 1).await?; + read_inputs_from_db_until_count(&state_manager, 1, input_count_1).await?; // add inputs to epoch 1 - input_count = 3; - add_input(&inputbox, &INPUT_PAYLOAD, input_count).await?; - read_inputs_from_db_until_count(&state_manager, 1, input_count).await?; + let input_count_2 = 3; + add_input(&inputbox, INPUT_PAYLOAD, input_count_2).await?; + read_inputs_from_db_until_count(&state_manager, 1, input_count_1 + input_count_2).await?; // add more inputs to epoch 1 - let more_input_count = 3; - add_input(&inputbox, &INPUT_PAYLOAD, more_input_count).await?; - read_inputs_from_db_until_count(&state_manager, 1, input_count + more_input_count).await?; + let input_count_3 = 3; + add_input(&inputbox, INPUT_PAYLOAD, input_count_3).await?; + read_inputs_from_db_until_count( + &state_manager, + 1, + input_count_1 + input_count_2 + input_count_3, + ) + .await?; drop(anvil); + drop(r); Ok(()) } } diff --git a/cartesi-rollups/node/dave-rollups/Cargo.toml b/cartesi-rollups/node/dave-rollups/Cargo.toml index 5b7a745d..364466f5 100644 --- a/cartesi-rollups/node/dave-rollups/Cargo.toml +++ b/cartesi-rollups/node/dave-rollups/Cargo.toml @@ -12,7 +12,7 @@ repository = { workspace = true } [dependencies] rollups-blockchain-reader = { workspace = true } -rollups-compute-runner = { workspace = true } +rollups-prt-runner = { workspace = true } rollups-epoch-manager = { workspace = true } rollups-machine-runner = { workspace = true } rollups-state-manager = { workspace = true } @@ -23,9 +23,8 @@ cartesi-prt-core = { workspace = true } alloy = { workspace = true } anyhow = { workspace = true } clap = { workspace = true } -clap_derive = { workspace = true } futures = { workspace = true } tokio = { workspace = true } log = { workspace = true } -rusqlite = { version = "0.31.0", features = ["bundled"] } +rusqlite = { workspace = true } env_logger = "0.11.5" diff --git a/cartesi-rollups/node/dave-rollups/src/lib.rs b/cartesi-rollups/node/dave-rollups/src/lib.rs index 40d7b153..9b92bbdc 100644 --- a/cartesi-rollups/node/dave-rollups/src/lib.rs +++ b/cartesi-rollups/node/dave-rollups/src/lib.rs @@ -3,10 +3,11 @@ use cartesi_prt_core::arena::{BlockchainConfig, EthArenaSender, SenderFiller}; use clap::Parser; use log::error; use rollups_blockchain_reader::{AddressBook, BlockchainReader}; -use rollups_compute_runner::ComputeRunner; use rollups_epoch_manager::EpochManager; use rollups_machine_runner::MachineRunner; +use rollups_prt_runner::ComputeRunner; use rollups_state_manager::persistent_state_access::PersistentStateAccess; +use std::path::PathBuf; use std::sync::Arc; use tokio::task::JoinHandle; use tokio::task::{spawn, spawn_blocking}; @@ -28,8 +29,8 @@ pub struct DaveParameters { sleep_duration: u64, #[arg(long, env, default_value_t = SNAPSHOT_DURATION)] snapshot_duration: u64, - #[arg(long, env)] - pub path_to_db: String, + #[arg(long, env)] // TODO: add default + pub state_dir: PathBuf, } pub fn create_blockchain_reader_task( @@ -69,6 +70,7 @@ pub fn create_compute_runner_task( ¶ms.blockchain_config, state_manager, params.sleep_duration, + params.state_dir, ); compute_runner @@ -115,6 +117,7 @@ pub fn create_machine_runner_task( params.machine_path.as_str(), params.sleep_duration, params.snapshot_duration, + params.state_dir.clone(), ) .inspect_err(|e| error!("{e}")) .unwrap(); diff --git a/cartesi-rollups/node/dave-rollups/src/main.rs b/cartesi-rollups/node/dave-rollups/src/main.rs index 19b65d8a..13b77a6f 100644 --- a/cartesi-rollups/node/dave-rollups/src/main.rs +++ b/cartesi-rollups/node/dave-rollups/src/main.rs @@ -18,7 +18,7 @@ async fn main() -> Result<()> { let parameters = DaveParameters::parse(); let state_manager = Arc::new(PersistentStateAccess::new(Connection::open( - ¶meters.path_to_db, + parameters.state_dir.join("state.db"), )?)?); let arena_sender = EthArenaSender::new(¶meters.blockchain_config)?; diff --git a/cartesi-rollups/node/machine-runner/src/lib.rs b/cartesi-rollups/node/machine-runner/src/lib.rs index 40f9a3a1..c12438c6 100644 --- a/cartesi-rollups/node/machine-runner/src/lib.rs +++ b/cartesi-rollups/node/machine-runner/src/lib.rs @@ -11,8 +11,10 @@ use std::{ time::Duration, }; -use cartesi_dave_merkle::{Digest, MerkleBuilder}; -use cartesi_machine::{break_reason, configuration::RuntimeConfig, htif, machine::Machine}; +use cartesi_dave_merkle::{Digest, DigestError, MerkleBuilder}; +use cartesi_machine::{ + break_reason, configuration::RuntimeConfig, hash::Hash, htif, machine::Machine, +}; use cartesi_prt_core::machine::constants::{LOG2_EMULATOR_SPAN, LOG2_INPUT_SPAN, LOG2_UARCH_SPAN}; use rollups_state_manager::{InputId, StateManager}; @@ -24,6 +26,7 @@ pub struct MachineRunner { sleep_duration: Duration, state_manager: Arc, _snapshot_frequency: Duration, + state_dir: PathBuf, epoch_number: u64, next_input_index_in_epoch: u64, @@ -39,6 +42,7 @@ where initial_machine: &str, sleep_duration: u64, snapshot_frequency: u64, + state_dir: PathBuf, ) -> Result { let (snapshot, epoch_number, next_input_index_in_epoch) = match state_manager .latest_snapshot() @@ -48,13 +52,15 @@ where None => (initial_machine.to_string(), 0, 0), }; - let machine = Machine::load(&Path::new(&snapshot), RuntimeConfig::default())?; + let machine = Machine::load(Path::new(&snapshot), RuntimeConfig::default())?; Ok(Self { machine, sleep_duration: Duration::from_secs(sleep_duration), state_manager, _snapshot_frequency: Duration::from_secs(snapshot_frequency), + state_dir, + epoch_number, next_input_index_in_epoch, state_hash_index_in_epoch: 0, @@ -131,36 +137,20 @@ where .map_err(|e| MachineRunnerError::StateManagerError(e))?; let stride_count_in_epoch = 1 << (LOG2_INPUT_SPAN + LOG2_EMULATOR_SPAN + LOG2_UARCH_SPAN - LOG2_STRIDE); - if state_hashes.len() == 0 { + if state_hashes.is_empty() { // no inputs in current epoch, add machine state hash repeatedly - self.add_state_hash(stride_count_in_epoch)?; + let machine_state_hash = self.add_state_hash(stride_count_in_epoch)?; state_hashes.push(( - self.machine.get_root_hash()?.as_bytes().to_vec(), + machine_state_hash.as_bytes().to_vec(), stride_count_in_epoch, )); } - let computation_hash = { - let mut builder = MerkleBuilder::default(); - let mut total_repetitions = 0; - for state_hash in &state_hashes { - total_repetitions += state_hash.1; - builder.append_repeated( - Digest::from_digest(&state_hash.0)?, - U256::from(state_hash.1), - ); - } - if stride_count_in_epoch > total_repetitions { - self.add_state_hash(stride_count_in_epoch - total_repetitions)?; - builder.append_repeated( - Digest::from_digest(&state_hashes.last().unwrap().0)?, - U256::from(stride_count_in_epoch - total_repetitions), - ); - } - - let tree = builder.build(); - tree.root_hash().slice().to_vec() - }; + let (computation_hash, total_repetitions) = + build_commitment_from_hashes(state_hashes, stride_count_in_epoch)?; + if stride_count_in_epoch > total_repetitions { + self.add_state_hash(stride_count_in_epoch - total_repetitions)?; + } Ok(computation_hash) } @@ -213,7 +203,7 @@ where } } - fn add_state_hash(&mut self, repetitions: u64) -> Result<(), SM> { + fn add_state_hash(&mut self, repetitions: u64) -> Result { let machine_state_hash = self.machine.get_root_hash()?; self.state_manager .add_machine_state_hash( @@ -225,18 +215,24 @@ where .map_err(|e| MachineRunnerError::StateManagerError(e))?; self.state_hash_index_in_epoch += 1; - Ok(()) + Ok(machine_state_hash) } fn take_snapshot(&self) -> Result<(), SM> { - let epoch_path = PathBuf::from(format!("/rollups_data/{}", self.epoch_number)); + let epoch_path = self + .state_dir + .join("snapshots") + .join(self.epoch_number.to_string()); + + if !epoch_path.exists() { + fs::create_dir_all(&epoch_path)?; + } + let snapshot_path = epoch_path.join(format!( "{}", self.next_input_index_in_epoch << LOG2_EMULATOR_SPAN )); - if !epoch_path.exists() { - fs::create_dir_all(&epoch_path)?; - } + if !snapshot_path.exists() { self.state_manager .add_snapshot( @@ -254,177 +250,40 @@ where } } -#[cfg(test)] -mod tests { - use alloy::sol_types::{ - private::{Address, U256}, - SolCall, - }; - use cartesi_rollups_contracts::inputs::Inputs::EvmAdvanceCall; - use rollups_state_manager::{Epoch, Input, InputId, StateManager}; - use std::{str::FromStr, sync::Arc}; - use thiserror::Error; - - use crate::MachineRunner; - - #[derive(Error, Debug)] - pub enum MockStateAccessError {} - type Result = std::result::Result; - - #[derive(Debug)] - struct MockStateAccess { - // let computation_hash: &[u8] = machine_state_hashes[epoch_number] - computation_hash: Vec>, - // let input: &[u8] = inputs[epoch_number][input_index_in_epoch] - inputs: Vec>>, - // let (machine_state_hash, repetition): (&[u8], u64) = - // machine_state_hashes[epoch_number][state_hash_index_in_epoch] - machine_state_hashes: Vec, u64)>>, - } - - impl MockStateAccess { - pub fn new() -> Self { - Self { - computation_hash: Vec::new(), - inputs: Vec::new(), - machine_state_hashes: Vec::new(), - } - } - } - - impl StateManager for MockStateAccess { - type Error = MockStateAccessError; - - fn epoch(&self, _epoch_number: u64) -> Result> { - panic!("epoch not implemented in mock version"); - } - - fn epoch_count(&self) -> Result { - Ok(self.inputs.len() as u64) - } - - fn last_sealed_epoch(&self) -> Result> { - panic!("last_sealed_epoch not implemented in mock version"); - } - - fn input(&self, id: &InputId) -> Result> { - let (epoch_number, input_index_in_epoch) = - (id.epoch_number as usize, id.input_index_in_epoch as usize); - - if (self.inputs.len() <= epoch_number) - || (self.inputs[epoch_number].len() <= input_index_in_epoch) - { - return Ok(None); - } - - let input = self.inputs[epoch_number][input_index_in_epoch].clone(); - Ok(Some(Input { - id: id.clone(), - data: input, - })) - } - - fn inputs(&self, _epoch_number: u64) -> Result>> { - panic!("inputs not implemented in mock version"); - } - - fn last_input(&self) -> Result> { - panic!("last_input not implemented in mock version"); - } - - fn input_count(&self, epoch_number: u64) -> Result { - let input_count = self.inputs[epoch_number as usize].len(); - Ok(input_count as u64) - } - - fn latest_processed_block(&self) -> Result { - panic!("latest_processed_block not implemented in mock version"); - } - - fn insert_consensus_data<'a>( - &self, - _last_processed_block: u64, - _inputs: impl Iterator, - _epochs: impl Iterator, - ) -> Result<()> { - panic!("insert_consensus_data not implemented in mock version"); - } - - fn add_machine_state_hash( - &self, - machine_state_hash: &[u8], - epoch_number: u64, - state_hash_index_in_epoch: u64, - repetitions: u64, - ) -> Result<()> { - println!( - "machine_state_hash at epoch {}, index {}, rep {} is: {}", - epoch_number, - state_hash_index_in_epoch, - repetitions, - hex::encode(&machine_state_hash), +fn build_commitment_from_hashes( + state_hashes: Vec<(Vec, u64)>, + stride_count_in_epoch: u64, +) -> std::result::Result<(Vec, u64), DigestError> { + let mut total_repetitions = 0; + let computation_hash = { + let mut builder = MerkleBuilder::default(); + for state_hash in &state_hashes { + total_repetitions += state_hash.1; + builder.append_repeated( + Digest::from_digest(&state_hash.0)?, + U256::from(state_hash.1), ); - let (h, r) = &self.machine_state_hashes[epoch_number as usize] - [state_hash_index_in_epoch as usize]; - - assert_eq!(h, machine_state_hash, "machine state hash should match"); - assert_eq!(*r, repetitions, "repetition should match"); - - Ok(()) - } - - fn computation_hash(&self, epoch_number: u64) -> Result>> { - let epoch_number = epoch_number as usize; - - Ok(self.computation_hash.get(epoch_number).map(|h| h.clone())) - } - - fn add_computation_hash(&self, _computation_hash: &[u8], _epoch_number: u64) -> Result<()> { - panic!("add_computation_hash not implemented in mock version"); - } - - fn add_snapshot( - &self, - _path: &str, - _epoch_number: u64, - _input_index_in_epoch: u64, - ) -> Result<()> { - panic!("add_snapshot not implemented in mock version"); } - - fn machine_state_hash( - &self, - _epoch_number: u64, - _state_hash_index_in_epoch: u64, - ) -> Result<(Vec, u64)> { - panic!("machine_state_hash not implemented in mock version"); + if stride_count_in_epoch > total_repetitions { + builder.append_repeated( + Digest::from_digest(&state_hashes.last().unwrap().0)?, + U256::from(stride_count_in_epoch - total_repetitions), + ); } - // returns all state hashes and their repetitions in acending order of `state_hash_index_in_epoch` - fn machine_state_hashes(&self, epoch_number: u64) -> Result, u64)>> { - let epoch_number = epoch_number as usize; - - if self.machine_state_hashes.len() <= epoch_number { - return Ok(Vec::new()); - } - - let machin_state_hashes = self.machine_state_hashes[epoch_number].clone(); - - Ok(machin_state_hashes) - } + let tree = builder.build(); + tree.root_hash().slice().to_vec() + }; - fn latest_snapshot(&self) -> Result> { - Ok(None) - } + Ok((computation_hash, total_repetitions)) +} - fn snapshot( - &self, - _epoch_number: u64, - _input_index_in_epoch: u64, - ) -> Result> { - Ok(None) - } - } +#[cfg(test)] +mod tests { + use crate::{ + build_commitment_from_hashes, LOG2_EMULATOR_SPAN, LOG2_INPUT_SPAN, LOG2_STRIDE, + LOG2_UARCH_SPAN, + }; fn hex_to_bytes(s: &str) -> Option> { if s.len() % 2 == 0 { @@ -440,97 +299,46 @@ mod tests { } } - fn load_machine_state_hashes() -> (Vec<(Vec, u64)>, Vec) { - // this file stores all the machine state hashes and their repetitions of stride at each line, - // machine state hash and its repetition are delimited by `space character` - // and the computation hash of above machine state hashes is at last line - // [ - // hash_0 rep_0 - // hash_1 rep_1 - // hash_2 rep_2 - // hash_3 rep_3 - // computation_hash - // ] - let machine_state_hashes_str = include_str!("../test-files/machine_state_hashes.test"); - let mut machine_state_hashes_hex: Vec<&str> = - machine_state_hashes_str.split("\n").collect(); - - // get commitment from last line - let commitment_str = machine_state_hashes_hex.pop().unwrap(); - let commitment = hex_to_bytes(commitment_str).unwrap(); - - let machine_state_hashes = machine_state_hashes_hex - .iter() - .map(|h| { - let hash_and_rep: Vec<&str> = (*h).split(" ").collect(); - ( - hex_to_bytes(hash_and_rep[0]).unwrap(), - hash_and_rep[1].parse().unwrap(), - ) - }) - .collect(); - - (machine_state_hashes, commitment) - } - - fn load_inputs() -> Vec> { - // this file stores all the inputs for one epoch - let inputs_str = include_str!("../test-files/inputs.test"); - let inputs_hex: Vec<&str> = inputs_str.split("\n").collect(); - - let chain_id = U256::from(31337); - let app_contract = Address::from_str("0x0000000000000000000000000000000000000002").unwrap(); - let msg_sender = Address::from_str("0x0000000000000000000000000000000000000003").unwrap(); - let block_number = U256::from(4); - let block_timestamp = U256::from(5); - let inputs = inputs_hex - .iter() - .enumerate() - .map(|(i, h)| { - EvmAdvanceCall { - chainId: chain_id, - appContract: app_contract, - msgSender: msg_sender, - blockNumber: block_number, - blockTimestamp: block_timestamp, - index: U256::from(i), - payload: hex_to_bytes(*h).unwrap().into(), - prevRandao: U256::ZERO, // TODO: what to put here? - } - .abi_encode() - }) - .collect(); - - inputs - } - #[test] - fn test_input_advance() -> std::result::Result<(), Box> { - // TODO: update machine state hashes with new emulator version - let (machine_state_hashes, commitment) = load_machine_state_hashes(); - let inputs = load_inputs(); - - assert_eq!( - machine_state_hashes.len(), - inputs.len(), - "number of machine state hashes and inputs should match" - ); - - let mut state_manager = MockStateAccess::new(); - // preload inputs from file - state_manager.inputs.push(inputs); - // preload machine state hashes for epoch 0 - state_manager - .machine_state_hashes - .push(machine_state_hashes); - let mut runner = MachineRunner::new(Arc::new(state_manager), "/app/echo", 10, 10)?; - - runner.advance_epoch()?; - assert_eq!( - runner.build_commitment()?, - commitment, - "computation hash should match" - ); + fn test_commitment_builder() -> std::result::Result<(), Box> { + let repetitions = vec![1, 2, 1 << 24, (1 << 48) - 1, 1 << 48]; + let stride_count_in_epoch = + 1 << (LOG2_INPUT_SPAN + LOG2_EMULATOR_SPAN + LOG2_UARCH_SPAN - LOG2_STRIDE); + let mut machine_state_hash = + hex_to_bytes("AAA646181BF25FD29FBB7D468E786F8B6F7215D53CE4F7C69A108FB8099555B7") + .unwrap(); + let mut computation_hash = + hex_to_bytes("FB6E8E3659EC96D086402465894894B0B4D267023A26D25F0147C1F00D350FAE") + .unwrap(); + + for rep in &repetitions { + assert_eq!( + build_commitment_from_hashes( + vec![(machine_state_hash.clone(), *rep)], + stride_count_in_epoch + )?, + (computation_hash.clone(), *rep), + "computation hash and repetition should match" + ); + } + + machine_state_hash = + hex_to_bytes("5F0F4E3F7F266592691376743C5D558C781654CDFDC5AC8B002ECF5F899B789C") + .unwrap(); + computation_hash = + hex_to_bytes("8AC7CD8E381CCFF6DB21F66B30F9AC69794394EB352E533C5ED0A8C175AAAF47") + .unwrap(); + + for rep in &repetitions { + assert_eq!( + build_commitment_from_hashes( + vec![(machine_state_hash.clone(), *rep)], + stride_count_in_epoch + )?, + (computation_hash.clone(), *rep), + "computation hash and repetition should match" + ); + } Ok(()) } diff --git a/cartesi-rollups/node/machine-runner/test-files/inputs.test b/cartesi-rollups/node/machine-runner/test-files/inputs.test deleted file mode 100644 index c6a793b5..00000000 --- a/cartesi-rollups/node/machine-runner/test-files/inputs.test +++ /dev/null @@ -1,10 +0,0 @@ -48004900 -4800490048004900 -480049004800490048004900 -48004900480049004800490048004900 -4800490048004900480049004800490048004900 -480049004800490048004900480049004800490048004900 -48004900480049004800490048004900480049004800490048004900 -4800490048004900480049004800490048004900480049004800490048004900 -480049004800490048004900480049004800490048004900480049004800490048004900 -48004900480049004800490048004900480049004800490048004900480049004800490048004900 \ No newline at end of file diff --git a/cartesi-rollups/node/machine-runner/test-files/machine_state_hashes.test b/cartesi-rollups/node/machine-runner/test-files/machine_state_hashes.test deleted file mode 100644 index 533b118d..00000000 --- a/cartesi-rollups/node/machine-runner/test-files/machine_state_hashes.test +++ /dev/null @@ -1,11 +0,0 @@ -07f51a6be61d727fb1cd06b68ecf53c5b447fd9497083c96873feabcfe062d79 524287 -6180e24a5fbd929ebc8c2d90514318f6db61f66686e7f9699c15d58075a700ba 524287 -078dcdc666d2eb2318f256615591aa04c966d834329754ca6cb02059151a8aa7 524287 -35f9714c3358de215caa2dc0c9b6323ae21c34162f0aa64012d1fbb6d3333988 524287 -b996b7c89cc62716e77ddf9b7fe7ebe3c89f400c587e101dbce489d682fb8eb6 524287 -38f1555cccb391facdd901e4b74fc1780d73a6b48b2fc7cbe6d41901c2414b72 524287 -0cd32ddbb7bec97493a2d7b04d86faf77dc3fce89bd5cdd2150cd34a968125bb 524287 -610d9e9f2542f8dcd15953f626ca8c7e5ecabceebbbd2bcbafbeee1a09ec408a 524287 -621e3c728bef89af5f312a89e5eae1c894fc535332e8a0ae70d46a5fcb6827d8 524287 -bb7f4abd9af36d7b47b57a5a643e8e8dd7a5a139d42640f8776c04a023b2f911 524287 -cea5f55f8c2f2a7fdffadab58693331094e51c1985d5693220a2a861a1c90e1e \ No newline at end of file diff --git a/cartesi-rollups/node/machine-runner/test-files/split_inputs.sh b/cartesi-rollups/node/machine-runner/test-files/split_inputs.sh deleted file mode 100755 index 19b09f0b..00000000 --- a/cartesi-rollups/node/machine-runner/test-files/split_inputs.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash - -# Check if the input file is provided -if [ -z "$1" ]; then - echo "Usage: $0 " - exit 1 -fi - -input_file="$1" -i=0 - -# Read each line from the input file -while IFS= read -r line; do - payload=$(echo "$line") - echo $payload - cast_cmd="cast calldata \"EvmAdvance(uint256,address,address,uint256,uint256,uint256,bytes)\" \ - 0x0000000000000000000000000000000000000001 \ - 0x0000000000000000000000000000000000000002 \ - 0x0000000000000000000000000000000000000003 \ - 0x0000000000000000000000000000000000000004 \ - 0x0000000000000000000000000000000000000005 \ - 0x000000000000000000000000000000000000000$i \ - 0x$payload" - eval $cast_cmd | xxd -r -p > "input-${i}.bin" - i=$((i+1)) -done < "$input_file" - -echo "Conversion complete. Created $i binary files." \ No newline at end of file diff --git a/cartesi-rollups/node/compute-runner/Cargo.toml b/cartesi-rollups/node/prt-runner/Cargo.toml similarity index 92% rename from cartesi-rollups/node/compute-runner/Cargo.toml rename to cartesi-rollups/node/prt-runner/Cargo.toml index 5dacc99c..780f450b 100644 --- a/cartesi-rollups/node/compute-runner/Cargo.toml +++ b/cartesi-rollups/node/prt-runner/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "rollups-compute-runner" +name = "rollups-prt-runner" version.workspace = true authors.workspace = true description.workspace = true diff --git a/cartesi-rollups/node/compute-runner/src/lib.rs b/cartesi-rollups/node/prt-runner/src/lib.rs similarity index 93% rename from cartesi-rollups/node/compute-runner/src/lib.rs rename to cartesi-rollups/node/prt-runner/src/lib.rs index 39fcb2b8..04064f5d 100644 --- a/cartesi-rollups/node/compute-runner/src/lib.rs +++ b/cartesi-rollups/node/prt-runner/src/lib.rs @@ -1,5 +1,6 @@ use alloy::primitives::Address; use log::error; +use std::path::PathBuf; use std::result::Result; use std::{str::FromStr, sync::Arc, time::Duration}; @@ -15,6 +16,7 @@ pub struct ComputeRunner { config: BlockchainConfig, sleep_duration: Duration, state_manager: Arc, + state_dir: PathBuf, } impl ComputeRunner @@ -26,12 +28,14 @@ where config: &BlockchainConfig, state_manager: Arc, sleep_duration: u64, + state_dir: PathBuf, ) -> Self { Self { arena_sender, config: config.clone(), sleep_duration: Duration::from_secs(sleep_duration), state_manager, + state_dir, } } @@ -54,7 +58,7 @@ where .state_manager .machine_state_hashes(last_sealed_epoch.epoch_number)?; let mut player = Player::new( - Some(inputs.into_iter().map(|i| Input(i)).collect()), + Some(inputs.into_iter().map(Input).collect()), leafs .into_iter() .map(|l| { @@ -70,6 +74,7 @@ where snapshot, Address::from_str(&last_sealed_epoch.root_tournament) .expect("fail to convert tournament address"), + self.state_dir.clone(), ) .expect("fail to initialize compute player"); let _ = player diff --git a/cartesi-rollups/node/rollups-test-entrypoint.sh b/cartesi-rollups/node/rollups-test-entrypoint.sh deleted file mode 100755 index aacf0e96..00000000 --- a/cartesi-rollups/node/rollups-test-entrypoint.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -exec env RUST_LOG="info" cargo test diff --git a/cartesi-rollups/node/state-manager/Cargo.toml b/cartesi-rollups/node/state-manager/Cargo.toml index b1eeb224..0b1aa753 100644 --- a/cartesi-rollups/node/state-manager/Cargo.toml +++ b/cartesi-rollups/node/state-manager/Cargo.toml @@ -11,8 +11,8 @@ readme = { workspace = true } repository = { workspace = true } [dependencies] -rusqlite = { version = "0.31.0", features = ["bundled"] } -rusqlite_migration = "1.2.0" +lazy_static = { workspace = true } +rusqlite = { workspace = true } +rusqlite_migration = { workspace = true } -lazy_static = "1.4.0" thiserror = { workspace = true } diff --git a/cartesi-rollups/node/state-manager/src/lib.rs b/cartesi-rollups/node/state-manager/src/lib.rs index 0305eb2f..51ec5948 100644 --- a/cartesi-rollups/node/state-manager/src/lib.rs +++ b/cartesi-rollups/node/state-manager/src/lib.rs @@ -9,21 +9,12 @@ use std::error::Error; pub type Blob = Vec; -#[derive(Clone, Debug)] +#[derive(Clone, Debug, Default)] pub struct InputId { pub epoch_number: u64, pub input_index_in_epoch: u64, } -impl Default for InputId { - fn default() -> Self { - Self { - epoch_number: 0, - input_index_in_epoch: 0, - } - } -} - impl InputId { pub fn increment_index(self) -> Self { Self { diff --git a/cartesi-rollups/node/state-manager/src/persistent_state_access.rs b/cartesi-rollups/node/state-manager/src/persistent_state_access.rs index fdcfba89..22687c41 100644 --- a/cartesi-rollups/node/state-manager/src/persistent_state_access.rs +++ b/cartesi-rollups/node/state-manager/src/persistent_state_access.rs @@ -543,8 +543,8 @@ mod tests { "machine state hash shouldn't exist" ); assert!( - access.machine_state_hashes(0).is_err(), - "machine state hash shouldn't exist" + access.machine_state_hashes(0).is_ok_and(|x| x.is_empty()), + "machine state hashes shouldn't exist" ); let machine_state_hash_1 = vec![1, 2, 3, 4, 5]; diff --git a/common-rs/Cargo.toml b/common-rs/Cargo.toml deleted file mode 100644 index 1e2256e0..00000000 --- a/common-rs/Cargo.toml +++ /dev/null @@ -1,21 +0,0 @@ -[workspace] -resolver = "2" -members = [ - "arithmetic", - "merkle", -] - -[workspace.package] -version = "0.1.0" - -authors = [ - "Gabriel Coutinho de Paula ", - "Algebraic Sofia ", - "Stephen Chen ", -] -description = "A Cartesi validator reference implementation" -edition = "2021" -homepage = "https://github.com/cartesi/dave" -license-file = "LICENSE" -readme = "README.md" -repository = "https://github.com/cartesi/dave" diff --git a/common-rs/merkle/Cargo.toml b/common-rs/merkle/Cargo.toml index c523dc6f..2cc1af05 100644 --- a/common-rs/merkle/Cargo.toml +++ b/common-rs/merkle/Cargo.toml @@ -11,8 +11,9 @@ readme = { workspace = true } repository = { workspace = true } [dependencies] -alloy = { version = "0.8.0", features = ["sol-types"] } +alloy = { workspace = true, features = ["sol-types"] } +ruint = { workspace = true } + hex = "0.4" -ruint = "1.12" sha3 = "0.10" thiserror = "1.0" diff --git a/common-rs/merkle/src/digest/keccak.rs b/common-rs/merkle/src/digest/keccak.rs index 7a4757ca..65bc856e 100644 --- a/common-rs/merkle/src/digest/keccak.rs +++ b/common-rs/merkle/src/digest/keccak.rs @@ -22,4 +22,3 @@ impl Digest { Digest::from(digest) } } - diff --git a/justfile b/justfile new file mode 100644 index 00000000..efd9215e --- /dev/null +++ b/justfile @@ -0,0 +1,58 @@ +update-submodules: + git submodule update --recursive --init + +clean-emulator: + make -C machine/emulator clean depclean distclean + +download-deps: + just -f ./test/programs/justfile download-deps + +build-programs: + just -f ./test/programs/justfile build-programs + +setup: update-submodules clean-emulator download-deps build-programs + +build-consensus: + just -f ./cartesi-rollups/contracts/justfile build +clean-consensus-bindings: + just -f ./cartesi-rollups/contracts/justfile clean-bindings +bind-consensus: + just -f ./cartesi-rollups/contracts/justfile bind + +build-prt: + just -f ./prt/contracts/justfile build +clean-prt-bindings: + just -f ./prt/contracts/justfile clean-bindings +bind-prt: + just -f ./prt/contracts/justfile bind + +build-smart-contracts: build-consensus build-prt +bind: bind-consensus bind-prt +clean-bindings: clean-consensus-bindings clean-prt-bindings + +fmt-rust-workspace: bind + cargo fmt +check-fmt-rust-workspace: bind + cargo fmt --check +check-rust-workspace: bind + cargo check +test-rust-workspace: bind + cargo test +build-rust-workspace *ARGS: bind + cargo build {{ARGS}} +build-release-rust-workspace *ARGS: bind + cargo build --release {{ARGS}} + +build: build-smart-contracts bind build-rust-workspace + + + +build-docker-image TAG="dave:dev": + docker build -f test/Dockerfile -t {{TAG}} . + +run-dockered +CMD: build-docker-image + docker run -it dave:dev {{CMD}} + + +hello: + echo $(echo "Hello") diff --git a/machine/rust-bindings/cartesi-machine-sys/Cargo.toml b/machine/rust-bindings/cartesi-machine-sys/Cargo.toml index fbb4eb3e..363ded2b 100644 --- a/machine/rust-bindings/cartesi-machine-sys/Cargo.toml +++ b/machine/rust-bindings/cartesi-machine-sys/Cargo.toml @@ -23,6 +23,9 @@ build_uarch = [] # requires setting env vars UARCH_PRISTINE_HASH_PATH and UARCH_PRISTINE_RAM_PATH copy_uarch = [] +# requires setting env vars LIBCARTESI_PATH and INCLUDECARTESI_PATH +external_cartesi = [] + default = ["download_uarch"] diff --git a/machine/rust-bindings/cartesi-machine-sys/build.rs b/machine/rust-bindings/cartesi-machine-sys/build.rs index 675e716a..3e898a0f 100644 --- a/machine/rust-bindings/cartesi-machine-sys/build.rs +++ b/machine/rust-bindings/cartesi-machine-sys/build.rs @@ -1,29 +1,26 @@ -use std::{ - env, fs, - path::Path, - path::PathBuf, - process::{Command, Stdio}, -}; +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) -#[cfg(all(feature = "build_uarch", feature = "copy_uarch",))] -compile_error!("Features `build_uarch` and `copy_uarch` are mutually exclusive"); +use std::{env, path::PathBuf, process::Command}; -#[cfg(all(feature = "build_uarch", feature = "download_uarch"))] -compile_error!("Features `build_uarch` and `download_uarch` are mutually exclusive"); +mod feature_checks { + #[cfg(all(feature = "build_uarch", feature = "copy_uarch",))] + compile_error!("Features `build_uarch` and `copy_uarch` are mutually exclusive"); -#[cfg(all(feature = "copy_uarch", feature = "download_uarch"))] -compile_error!("Features `copy_uarch`, and `download_uarch` are mutually exclusive"); + #[cfg(all(feature = "build_uarch", feature = "download_uarch"))] + compile_error!("Features `build_uarch` and `download_uarch` are mutually exclusive"); -#[cfg(not(any( - feature = "copy_uarch", - feature = "download_uarch", - feature = "build_uarch" -)))] -compile_error!("At least one of `build_uarch`, `copy_uarch`, and `download_uarch` must be set"); + #[cfg(all(feature = "copy_uarch", feature = "download_uarch"))] + compile_error!("Features `copy_uarch`, and `download_uarch` are mutually exclusive"); -use bytes::Bytes; -use std::fs::OpenOptions; -use std::io::{self, Read, Write}; + #[cfg(not(any( + feature = "copy_uarch", + feature = "download_uarch", + feature = "build_uarch", + feature = "external_cartesi", + )))] + compile_error!("At least one of `build_uarch`, `copy_uarch`, `download_uarch`, and `external_cartesi` must be set"); +} fn main() { let out_path = PathBuf::from(env::var("OUT_DIR").unwrap()); @@ -34,75 +31,24 @@ fn main() { // path. .canonicalize() .expect("cannot canonicalize path"); - let libdir_path = machine_dir_path.join("src"); - // clean build artifacts and start from scratch - clean(&machine_dir_path); - - // - // Get uarch - // + // Clean build artifacts and start from scratch + // clean(&machine_dir_path); + // tell Cargo where to look for libraries cfg_if::cfg_if! { - if #[cfg(feature = "build_uarch")] { - () - } else if #[cfg(feature = "copy_uarch")] { - let uarch_path = machine_dir_path.join("uarch"); - copy_uarch(&uarch_path) - } else if #[cfg(feature = "download_uarch")] { - download_uarch(&machine_dir_path); + if #[cfg(feature = "external_cartesi")] { + let libpath = + env::var("LIBCARTESI_PATH") + .map(PathBuf::from) + .unwrap_or_else(|_| machine_dir_path.join("src")); + println!("cargo:rustc-link-search={}", libpath.to_str().unwrap()); } else { - panic!("Internal error, no way specified to get uarch"); + build_cm::build(&machine_dir_path, &out_path); + println!("cargo:rustc-link-search={}", out_path.to_str().unwrap()); } } - // - // Build and link emulator - // - - // build dependencies - Command::new("make") - .args(&["submodules"]) - .current_dir(&machine_dir_path) - .status() - .expect("Failed to run setup `make submodules`"); - Command::new("make") - .args(&["bundle-boost"]) - .current_dir(&machine_dir_path) - .status() - .expect("Failed to run `make bundle-boost`"); - - // build `libcartesi.a`, release, no `libslirp` - Command::new("make") - .args(&[ - "-C", - "src", - "release=yes", - "slirp=no", - "libcartesi.a", - "libcartesi_jsonrpc.a", - ]) - .current_dir(&machine_dir_path) - .status() - .expect("Failed to build `libcartesi.a` and/or `libcartesi_jsonrpc.a`"); - - // copy `libcartesi.a` to OUT_DIR - let libcartesi_path = libdir_path.join("libcartesi.a"); - let libcartesi_new_path = out_path.join("libcartesi.a"); - fs::copy(&libcartesi_path, &libcartesi_new_path).expect(&format!( - "Failed to copy `libcartesi.a` {:?} to OUT_DIR {:?}", - libcartesi_path, libcartesi_new_path - )); - - // copy `libcartesi_jsonrpc.a` to OUT_DIR - let libcartesi_jsonrpc_path = libdir_path.join("libcartesi_jsonrpc.a"); - let libcartesi_jsonrpc_new_path = out_path.join("libcartesi_jsonrpc.a"); - fs::copy(libcartesi_jsonrpc_path, libcartesi_jsonrpc_new_path) - .expect("Failed to move `libcartesi_jsonrpc.a` to OUT_DIR"); - - // tell Cargo where to look for libraries - println!("cargo:rustc-link-search={}", out_path.to_str().unwrap()); - // static link cfg_if::cfg_if! { if #[cfg(feature = "remote_machine")] { @@ -116,21 +62,34 @@ fn main() { // Generate bindings // + #[allow(clippy::needless_late_init)] + let include_path; + cfg_if::cfg_if! { + if #[cfg(feature = "external_cartesi")] { + include_path = env::var("INCLUDECARTESI_PATH") + .map(PathBuf::from) + .unwrap_or_else(|_| machine_dir_path.join("src")); + + } else { + include_path = machine_dir_path.join("src"); + } + }; + // machine api let machine_bindings = bindgen::Builder::default() - .header(libdir_path.join("machine-c-api.h").to_str().unwrap()) + .header(include_path.join("machine-c-api.h").to_str().unwrap()) .generate() .expect("Unable to generate machine bindings"); // htif constants let htif = bindgen::Builder::default() - .header(libdir_path.join("htif-defines.h").to_str().unwrap()) + .header(include_path.join("htif-defines.h").to_str().unwrap()) .generate() .expect("Unable to generate htif bindings"); // pma constants let pma = bindgen::Builder::default() - .header(libdir_path.join("pma-defines.h").to_str().unwrap()) + .header(include_path.join("pma-defines.h").to_str().unwrap()) .generate() .expect("Unable to generate pma bindings"); @@ -153,106 +112,187 @@ fn main() { println!("cargo::rerun-if-env-changed=UARCH_PRISTINE_RAM_PATH"); } -#[cfg(feature = "copy_uarch")] -fn copy_uarch(uarch_path: &PathBuf) { - let uarch_pristine_hash_path = - env::var("UARCH_PRISTINE_HASH_PATH").expect("`UARCH_PRISTINE_HASH_PATH` not set"); - let uarch_pristine_ram_path = - env::var("UARCH_PRISTINE_RAM_PATH").expect("`UARCH_PRISTINE_RAM_PATH` not set"); - - fs::copy( - uarch_pristine_hash_path, - uarch_path.join("uarch-pristine-hash.c").to_str().unwrap(), - ) - .expect("Failed to move `uarch-pristine-hash.c` to `uarch/`"); - - fs::copy( - uarch_pristine_ram_path, - uarch_path.join("uarch-pristine-ram.c").to_str().unwrap(), - ) - .expect("Failed to move `uarch-pristine-ram.c` to `uarch/`"); -} - -#[cfg(feature = "download_uarch")] -fn download_uarch(machine_dir_path: &PathBuf) { - // apply git patche for 0.18.1 - let patch_file = machine_dir_path.join("add-generated-files.diff"); +#[cfg(not(feature = "external_cartesi"))] +mod build_cm { + use std::{fs, path::Path, process::Command}; + + pub fn build(machine_dir_path: &Path, out_path: &Path) { + // Get uarch + cfg_if::cfg_if! { + if #[cfg(feature = "build_uarch")] { + () + } else if #[cfg(feature = "copy_uarch")] { + let uarch_path = machine_dir_path.join("uarch"); + copy_uarch::copy(&uarch_path) + } else if #[cfg(feature = "download_uarch")] { + download_uarch::download(machine_dir_path); + } else { + panic!("Internal error, no way specified to get uarch"); + } + } - download_git_patch(&patch_file, "v0.18.1"); - apply_git_patch(&patch_file, machine_dir_path); -} + // Build and link emulator + + // build dependencies + Command::new("make") + .args(["submodules"]) + .current_dir(machine_dir_path) + .status() + .expect("Failed to run setup `make submodules`"); + Command::new("make") + .args(["bundle-boost"]) + .current_dir(machine_dir_path) + .status() + .expect("Failed to run `make bundle-boost`"); + + // build `libcartesi.a` and `libcartesi_jsonrpc.a`, release, no `libslirp` + Command::new("make") + .args([ + "-C", + "src", + "release=yes", + "slirp=no", + "libcartesi.a", + "libcartesi_jsonrpc.a", + ]) + .current_dir(machine_dir_path) + .status() + .expect("Failed to build `libcartesi.a` and/or `libcartesi_jsonrpc.a`"); + + // copy `libcartesi.a` to OUT_DIR + let libcartesi_path = machine_dir_path.join("src").join("libcartesi.a"); + let libcartesi_new_path = out_path.join("libcartesi.a"); + fs::copy(&libcartesi_path, &libcartesi_new_path).unwrap_or_else(|_| { + panic!( + "Failed to copy `libcartesi.a` {:?} to OUT_DIR {:?}", + libcartesi_path, libcartesi_new_path + ) + }); + + // copy `libcartesi_jsonrpc.a` to OUT_DIR + let libcartesi_jsonrpc_path = machine_dir_path.join("src").join("libcartesi_jsonrpc.a"); + let libcartesi_jsonrpc_new_path = out_path.join("libcartesi_jsonrpc.a"); + fs::copy(libcartesi_jsonrpc_path, libcartesi_jsonrpc_new_path) + .expect("Failed to move `libcartesi_jsonrpc.a` to OUT_DIR"); + } -fn download_git_patch(patch_file: &PathBuf, target_tag: &str) { - let emulator_git_url = "https://github.com/cartesi/machine-emulator"; + #[cfg(feature = "copy_uarch")] + mod copy_uarch { + use std::{env, fs, path::Path}; + + fn copy(uarch_path: &Path) { + let uarch_pristine_hash_path = + env::var("UARCH_PRISTINE_HASH_PATH").expect("`UARCH_PRISTINE_HASH_PATH` not set"); + let uarch_pristine_ram_path = + env::var("UARCH_PRISTINE_RAM_PATH").expect("`UARCH_PRISTINE_RAM_PATH` not set"); + + fs::copy( + uarch_pristine_hash_path, + uarch_path.join("uarch-pristine-hash.c").to_str().unwrap(), + ) + .expect("Failed to move `uarch-pristine-hash.c` to `uarch/`"); + + fs::copy( + uarch_pristine_ram_path, + uarch_path.join("uarch-pristine-ram.c").to_str().unwrap(), + ) + .expect("Failed to move `uarch-pristine-ram.c` to `uarch/`"); + } + } - let patch_url = format!( - "{}/releases/download/{}/add-generated-files.diff", - emulator_git_url, target_tag, - ); + #[cfg(feature = "download_uarch")] + mod download_uarch { + use bytes::Bytes; + use std::{ + fs::{self, OpenOptions}, + io::{self, Read, Write}, + path::Path, + process::{Command, Stdio}, + }; + + pub fn download(machine_dir_path: &Path) { + // apply git patche for 0.18.1 + let patch_file = machine_dir_path.join("add-generated-files.diff"); + + download_git_patch(&patch_file, "v0.18.1"); + apply_git_patch(&patch_file, machine_dir_path); + } - // get - let diff_data = reqwest::blocking::get(patch_url) - .expect("error downloading diff of generated files") - .bytes() - .expect("error getting diff request body"); + fn download_git_patch(patch_file: &Path, target_tag: &str) { + let emulator_git_url = "https://github.com/cartesi/machine-emulator"; - // write to file - write_bytes_to_file(patch_file.to_str().unwrap(), diff_data) - .expect("failed to write `add-generated-files.diff`"); -} + let patch_url = format!( + "{}/releases/download/{}/add-generated-files.diff", + emulator_git_url, target_tag, + ); -fn apply_git_patch(patch_file: &Path, target_dir: &Path) { - // Open the patch file - let mut patch = fs::File::open(patch_file).expect("fail to open patch file"); - - // Create a command to run `patch -Np0` - let mut cmd = Command::new("patch") - .arg("-Np0") - .stdin(Stdio::piped()) - .current_dir(target_dir) - .spawn() - .expect("fail to spawn patch command"); - - // Write the contents of the patch file to the command's stdin - if let Some(ref mut stdin) = cmd.stdin { - let mut buffer = Vec::new(); - patch - .read_to_end(&mut buffer) - .expect("fail to read patch content"); - stdin - .write_all(&buffer) - .expect("fail to write patch to pipe"); - } + // get + let diff_data = reqwest::blocking::get(patch_url) + .expect("error downloading diff of generated files") + .bytes() + .expect("error getting diff request body"); - // Wait for the command to complete - let status = cmd.wait().expect("fail to wait for patch command"); + // write to file + write_bytes_to_file(patch_file.to_str().unwrap(), diff_data) + .expect("failed to write `add-generated-files.diff`"); + } - if !status.success() { - eprintln!("Patch command failed with status: {:?}", status); - } -} + fn apply_git_patch(patch_file: &Path, target_dir: &Path) { + // Open the patch file + let mut patch = fs::File::open(patch_file).expect("fail to open patch file"); + + // Create a command to run `patch -Np0` + let mut cmd = Command::new("patch") + .arg("-Np0") + .stdin(Stdio::piped()) + .current_dir(target_dir) + .spawn() + .expect("fail to spawn patch command"); + + // Write the contents of the patch file to the command's stdin + if let Some(ref mut stdin) = cmd.stdin { + let mut buffer = Vec::new(); + patch + .read_to_end(&mut buffer) + .expect("fail to read patch content"); + stdin + .write_all(&buffer) + .expect("fail to write patch to pipe"); + } + + // Wait for the command to complete + let status = cmd.wait().expect("fail to wait for patch command"); + + if !status.success() { + eprintln!("Patch command failed with status: {:?}", status); + } + } -fn write_bytes_to_file(path: &str, data: Bytes) -> io::Result<()> { - let mut file = OpenOptions::new() - .write(true) - .create(true) - .open(path) - .expect(&format!("failed to open file {}", path)); + fn write_bytes_to_file(path: &str, data: Bytes) -> io::Result<()> { + let mut file = OpenOptions::new() + .write(true) + .create(true) + .truncate(true) + .open(path) + .unwrap_or_else(|_| panic!("failed to open file {}", path)); - file.write_all(&data)?; - file.flush() // Ensure all data is written to disk + file.write_all(&data)?; + file.flush() // Ensure all data is written to disk + } + } } +#[allow(dead_code)] fn clean(path: &PathBuf) { // clean build artifacts Command::new("make") - .args(&["clean", "depclean ", "distclean"]) + .args(["clean", "depclean ", "distclean"]) .current_dir(path) .status() .expect("Failed to run setup `make clean depclean distclean`"); Command::new("rm") - .args(&["src/*o.tmp"]) + .args(["src/*o.tmp"]) .current_dir(path) .status() .expect("Failed to delete src/*.o.tmp files"); diff --git a/machine/rust-bindings/cartesi-machine/src/proof.rs b/machine/rust-bindings/cartesi-machine/src/proof.rs index 17dab0ae..38e93254 100644 --- a/machine/rust-bindings/cartesi-machine/src/proof.rs +++ b/machine/rust-bindings/cartesi-machine/src/proof.rs @@ -44,8 +44,9 @@ impl MerkleTreeProof { /// Sibling hashes towards root pub fn sibling_hashes(&self) -> Vec { let sibling_hashes = unsafe { (*self.0).sibling_hashes }; - let sibling_hashes = unsafe { std::slice::from_raw_parts(sibling_hashes.entry, sibling_hashes.count) }; + let sibling_hashes = + unsafe { std::slice::from_raw_parts(sibling_hashes.entry, sibling_hashes.count) }; sibling_hashes.iter().map(|hash| Hash::new(*hash)).collect() } -} \ No newline at end of file +} diff --git a/prt/Makefile b/prt/Makefile deleted file mode 100644 index 5dc11306..00000000 --- a/prt/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -BINDINGS_DIR := ./contract-bindings/src/contract -SRC_DIR := ./contracts -BINDINGS_FILTER := '^[^I].+TournamentFactory|LeafTournament|RootTournament|^Tournament$$' - -help: - @echo ' clean - clean the generated bindings' - @echo ' bind - generate Rust bindings from Solidity code' - -clean: - @rm -rf $(BINDINGS_DIR) - -bind: - @forge bind --alloy --select $(BINDINGS_FILTER) \ - --module --bindings-path $(BINDINGS_DIR) \ - --root $(SRC_DIR) - -.PHONY: help bind clean diff --git a/prt/client-lua/player/reader.lua b/prt/client-lua/player/reader.lua index bd2a0321..7368787a 100644 --- a/prt/client-lua/player/reader.lua +++ b/prt/client-lua/player/reader.lua @@ -142,7 +142,7 @@ function Reader._get_block(block) error(string.format("Cast block failed:\n%s", str)) end - ret = str:match("timestamp (%d+)") + ret = str:match("number%s+(%d+)") handle:close() return ret diff --git a/prt/client-rs/Cargo.toml b/prt/client-rs/Cargo.toml deleted file mode 100644 index e4295005..00000000 --- a/prt/client-rs/Cargo.toml +++ /dev/null @@ -1,38 +0,0 @@ -[package] -name = "cartesi-prt-core" -version = "0.1.0" - -authors = [ - "Gabriel Coutinho de Paula ", - "Algebraic Sofia ", - "Stephen Chen ", -] -description = "A Cartesi validator reference implementation" -edition = "2021" -homepage = "https://github.com/cartesi/dave" -license-file = "LICENSE" -readme = "README.md" -repository = "https://github.com/cartesi/dave" - -[dependencies] -cartesi-dave-arithmetic = { path = "../../common-rs/arithmetic" } -cartesi-dave-merkle = { path = "../../common-rs/merkle" } -cartesi-machine = { path = "../../machine/rust-bindings/cartesi-machine" } -cartesi-prt-contracts = { path = "../contract-bindings" } - -anyhow = "1.0" -async-recursion = "1" -async-trait = "0.1" -clap = { version = "4.5", features = ["derive", "env"] } -alloy = { version = "0.8.0", features = ["sol-types", "contract", "network", "reqwest", "signers", "signer-local"] } -lazy_static = "1.4.0" -log = "0.4" -hex = "0.4.3" -num-traits = "0.2.19" -ruint = { version = "1.12", features = ["num-traits"] } -rusqlite = { version = "0.31.0", features = ["bundled"] } -rusqlite_migration = "1.2.0" -serde = { version = "1.0", features = ["derive"] } -serde_json = "1.0" -thiserror = "1.0" -tokio = { version = "1", features = ["full"] } diff --git a/prt/client-rs/core/Cargo.toml b/prt/client-rs/core/Cargo.toml new file mode 100644 index 00000000..44ee4448 --- /dev/null +++ b/prt/client-rs/core/Cargo.toml @@ -0,0 +1,46 @@ +[package] +name = "cartesi-prt-core" +description = "A Cartesi validator reference implementation" + +version = { workspace = true} +authors = { workspace = true} +edition = { workspace = true} +homepage = { workspace = true} +license-file = { workspace = true} +readme = { workspace = true} +repository = { workspace = true} + +[dependencies] +# common-rs +cartesi-dave-arithmetic = { workspace = true } +cartesi-dave-merkle = { workspace = true } + +# machine bindings +cartesi-machine = { workspace = true } + +# solidity bindings +cartesi-prt-contracts = { workspace = true } + +alloy = { workspace = true, features = ["sol-types", "contract", "network", "reqwest", "signers", "signer-local"] } +ruint = { workspace = true, features = ["num-traits"] } + +# async +async-recursion = { workspace = true } +async-trait = { workspace = true } +tokio = { workspace = true, features = ["full"] } + +anyhow = { workspace = true } +thiserror = { workspace = true } + + +clap = { workspace = true, features = ["derive", "env"] } +hex = { workspace = true } +log = { workspace = true } +num-traits = { workspace = true } + +lazy_static = { workspace = true } +rusqlite = { workspace = true } +rusqlite_migration = { workspace = true } + +serde = { version = "1.0", features = ["derive"] } +serde_json = "1.0" diff --git a/prt/client-rs/src/arena/arena.rs b/prt/client-rs/core/src/arena/arena.rs similarity index 92% rename from prt/client-rs/src/arena/arena.rs rename to prt/client-rs/core/src/arena/arena.rs index 84b87852..74cf6c42 100644 --- a/prt/client-rs/src/arena/arena.rs +++ b/prt/client-rs/core/src/arena/arena.rs @@ -65,7 +65,7 @@ pub struct CommitmentState { pub struct ClockState { pub allowance: u64, pub start_instant: u64, - pub block_time: u64, + pub block_number: u64, } impl ClockState { @@ -73,7 +73,7 @@ impl ClockState { if self.start_instant == 0 { true } else { - self.deadline() > self.block_time + self.deadline() > self.block_number } } @@ -81,7 +81,7 @@ impl ClockState { if self.start_instant == 0 { 0 } else { - self.block_time - self.deadline() + self.block_number - self.deadline() } } @@ -94,19 +94,19 @@ impl ClockState { impl std::fmt::Display for ClockState { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { if self.start_instant == 0 { - write!(f, "clock paused, {} seconds left", self.allowance) + write!(f, "clock paused, {} blocks left", self.allowance) } else { - let time_elapsed = self.block_time - self.start_instant; + let time_elapsed = self.block_number - self.start_instant; if self.allowance >= time_elapsed { write!( f, - "clock ticking, {} seconds left", + "clock ticking, {} blocks left", self.allowance - time_elapsed ) } else { write!( f, - "clock ticking, {} seconds overdue", + "clock ticking, {} blocks overdue", time_elapsed - self.allowance ) } diff --git a/prt/client-rs/src/arena/config.rs b/prt/client-rs/core/src/arena/config.rs similarity index 100% rename from prt/client-rs/src/arena/config.rs rename to prt/client-rs/core/src/arena/config.rs diff --git a/prt/client-rs/src/arena/mod.rs b/prt/client-rs/core/src/arena/mod.rs similarity index 100% rename from prt/client-rs/src/arena/mod.rs rename to prt/client-rs/core/src/arena/mod.rs diff --git a/prt/client-rs/src/arena/reader.rs b/prt/client-rs/core/src/arena/reader.rs similarity index 99% rename from prt/client-rs/src/arena/reader.rs rename to prt/client-rs/core/src/arena/reader.rs index df53b8de..15e55cbe 100644 --- a/prt/client-rs/src/arena/reader.rs +++ b/prt/client-rs/core/src/arena/reader.rs @@ -161,17 +161,17 @@ impl StateReader { .call() .await?; - let block_time = self + let block_number = self .client .get_block(Latest.into(), BlockTransactionsKind::Hashes) .await? .expect("cannot get last block") .header - .timestamp; + .number; let clock_state = ClockState { allowance: commitment_return._0.allowance, start_instant: commitment_return._0.startInstant, - block_time, + block_number, }; Ok(CommitmentState { clock: clock_state, diff --git a/prt/client-rs/src/arena/sender.rs b/prt/client-rs/core/src/arena/sender.rs similarity index 100% rename from prt/client-rs/src/arena/sender.rs rename to prt/client-rs/core/src/arena/sender.rs diff --git a/prt/client-rs/src/db/compute_state_access.rs b/prt/client-rs/core/src/db/compute_state_access.rs similarity index 94% rename from prt/client-rs/src/db/compute_state_access.rs rename to prt/client-rs/core/src/db/compute_state_access.rs index 69c5ed8a..933b3e67 100644 --- a/prt/client-rs/src/db/compute_state_access.rs +++ b/prt/client-rs/core/src/db/compute_state_access.rs @@ -49,13 +49,13 @@ impl ComputeStateAccess { inputs: Option>, leafs: Vec, root_tournament: String, - compute_data_path: &str, + compute_data_path: PathBuf, ) -> Result { // initialize the database if it doesn't exist // fill the database from a json-format file, or the parameters // the database should be "/compute_data/0x_root_tournament_address/db" // the json file should be "/compute_data/0x_root_tournament_address/inputs_and_leafs.json" - let work_dir = format!("{compute_data_path}/{root_tournament}"); + let work_dir = compute_data_path.join(root_tournament); let work_path = PathBuf::from(work_dir); if !work_path.exists() { fs::create_dir_all(&work_path)?; @@ -258,9 +258,13 @@ mod compute_state_access_tests { remove_directory(&work_dir).unwrap(); create_directory(&work_dir).unwrap(); { - let access = - ComputeStateAccess::new(None, Vec::new(), String::from("0x12345678"), "/tmp") - .unwrap(); + let access = ComputeStateAccess::new( + None, + Vec::new(), + String::from("0x12345678"), + PathBuf::from("/tmp"), + ) + .unwrap(); assert_eq!(access.closest_snapshot(0).unwrap(), None); assert_eq!(access.closest_snapshot(100).unwrap(), None); @@ -318,9 +322,13 @@ mod compute_state_access_tests { remove_directory(&work_dir).unwrap(); create_directory(&work_dir).unwrap(); { - let access = - ComputeStateAccess::new(None, Vec::new(), String::from("0x12345678"), "/tmp") - .unwrap(); + let access = ComputeStateAccess::new( + None, + Vec::new(), + String::from("0x12345678"), + PathBuf::from("/tmp"), + ) + .unwrap(); let cycle: u64 = 844424930131968; for c in [cycle] { @@ -349,8 +357,13 @@ mod compute_state_access_tests { let work_dir = PathBuf::from("/tmp/0x12345678"); remove_directory(&work_dir).unwrap(); create_directory(&work_dir).unwrap(); - let access = - ComputeStateAccess::new(None, Vec::new(), String::from("0x12345678"), "/tmp").unwrap(); + let access = ComputeStateAccess::new( + None, + Vec::new(), + String::from("0x12345678"), + PathBuf::from("/tmp"), + ) + .unwrap(); let root = [ 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, @@ -377,7 +390,7 @@ mod compute_state_access_tests { Some(Vec::new()), Vec::new(), String::from("0x12345678"), - "/tmp", + PathBuf::from("/tmp"), ) .unwrap(); @@ -388,8 +401,13 @@ mod compute_state_access_tests { let work_dir = PathBuf::from("/tmp/0x12345678"); remove_directory(&work_dir).unwrap(); create_directory(&work_dir).unwrap(); - let access = - ComputeStateAccess::new(None, Vec::new(), String::from("0x12345678"), "/tmp").unwrap(); + let access = ComputeStateAccess::new( + None, + Vec::new(), + String::from("0x12345678"), + PathBuf::from("/tmp"), + ) + .unwrap(); assert!(matches!(access.handle_rollups, false)); } diff --git a/prt/client-rs/src/db/mod.rs b/prt/client-rs/core/src/db/mod.rs similarity index 100% rename from prt/client-rs/src/db/mod.rs rename to prt/client-rs/core/src/db/mod.rs diff --git a/prt/client-rs/src/db/sql/compute_data.rs b/prt/client-rs/core/src/db/sql/compute_data.rs similarity index 100% rename from prt/client-rs/src/db/sql/compute_data.rs rename to prt/client-rs/core/src/db/sql/compute_data.rs diff --git a/prt/client-rs/src/db/sql/error.rs b/prt/client-rs/core/src/db/sql/error.rs similarity index 100% rename from prt/client-rs/src/db/sql/error.rs rename to prt/client-rs/core/src/db/sql/error.rs diff --git a/prt/client-rs/src/db/sql/migrations.rs b/prt/client-rs/core/src/db/sql/migrations.rs similarity index 100% rename from prt/client-rs/src/db/sql/migrations.rs rename to prt/client-rs/core/src/db/sql/migrations.rs diff --git a/prt/client-rs/src/db/sql/migrations.sql b/prt/client-rs/core/src/db/sql/migrations.sql similarity index 100% rename from prt/client-rs/src/db/sql/migrations.sql rename to prt/client-rs/core/src/db/sql/migrations.sql diff --git a/prt/client-rs/src/db/sql/mod.rs b/prt/client-rs/core/src/db/sql/mod.rs similarity index 100% rename from prt/client-rs/src/db/sql/mod.rs rename to prt/client-rs/core/src/db/sql/mod.rs diff --git a/prt/client-rs/src/lib.rs b/prt/client-rs/core/src/lib.rs similarity index 100% rename from prt/client-rs/src/lib.rs rename to prt/client-rs/core/src/lib.rs diff --git a/prt/client-rs/src/machine/commitment.rs b/prt/client-rs/core/src/machine/commitment.rs similarity index 100% rename from prt/client-rs/src/machine/commitment.rs rename to prt/client-rs/core/src/machine/commitment.rs diff --git a/prt/client-rs/src/machine/commitment_builder.rs b/prt/client-rs/core/src/machine/commitment_builder.rs similarity index 100% rename from prt/client-rs/src/machine/commitment_builder.rs rename to prt/client-rs/core/src/machine/commitment_builder.rs diff --git a/prt/client-rs/src/machine/constants.rs b/prt/client-rs/core/src/machine/constants.rs similarity index 100% rename from prt/client-rs/src/machine/constants.rs rename to prt/client-rs/core/src/machine/constants.rs diff --git a/prt/client-rs/src/machine/instance.rs b/prt/client-rs/core/src/machine/instance.rs similarity index 100% rename from prt/client-rs/src/machine/instance.rs rename to prt/client-rs/core/src/machine/instance.rs diff --git a/prt/client-rs/src/machine/mod.rs b/prt/client-rs/core/src/machine/mod.rs similarity index 100% rename from prt/client-rs/src/machine/mod.rs rename to prt/client-rs/core/src/machine/mod.rs diff --git a/prt/client-rs/src/strategy/gc.rs b/prt/client-rs/core/src/strategy/gc.rs similarity index 85% rename from prt/client-rs/src/strategy/gc.rs rename to prt/client-rs/core/src/strategy/gc.rs index 74e9762a..ad51684f 100644 --- a/prt/client-rs/src/strategy/gc.rs +++ b/prt/client-rs/core/src/strategy/gc.rs @@ -19,7 +19,7 @@ impl GarbageCollector { arena_sender: &'a impl ArenaSender, tournament_states: &TournamentStateMap, ) -> Result<()> { - self.react_tournament(arena_sender, self.root_tournamet, &tournament_states) + self.react_tournament(arena_sender, self.root_tournamet, tournament_states) .await } @@ -59,10 +59,16 @@ impl GarbageCollector { tournament_state.level ); - arena_sender - .eliminate_match(tournament_address, m.id) - .await - .expect("fail to eliminate match"); + let elim = arena_sender.eliminate_match(tournament_address, m.id).await; + if elim.is_err() { + info!( + "failed to eliminate match for commitment {} and {} at tournament {} of level {}", + m.id.commitment_one, + m.id.commitment_two, + tournament_address, + tournament_state.level + ); + } } } Ok(()) diff --git a/prt/client-rs/src/strategy/mod.rs b/prt/client-rs/core/src/strategy/mod.rs similarity index 100% rename from prt/client-rs/src/strategy/mod.rs rename to prt/client-rs/core/src/strategy/mod.rs diff --git a/prt/client-rs/src/strategy/player.rs b/prt/client-rs/core/src/strategy/player.rs similarity index 97% rename from prt/client-rs/src/strategy/player.rs rename to prt/client-rs/core/src/strategy/player.rs index 0a5bda66..ed69e5b1 100644 --- a/prt/client-rs/src/strategy/player.rs +++ b/prt/client-rs/core/src/strategy/player.rs @@ -1,4 +1,5 @@ use std::collections::HashMap; +use std::path::PathBuf; use ::log::{debug, error, info}; use alloy::primitives::Address; @@ -40,10 +41,15 @@ impl Player { blockchain_config: &BlockchainConfig, machine_path: String, root_tournament: Address, + state_dir: PathBuf, ) -> Result { - let db = - ComputeStateAccess::new(inputs, leafs, root_tournament.to_string(), "/compute_data")?; - let reader = StateReader::new(&blockchain_config)?; + let db = ComputeStateAccess::new( + inputs, + leafs, + root_tournament.to_string(), + state_dir.join("compute_path"), + )?; + let reader = StateReader::new(blockchain_config)?; let gc = GarbageCollector::new(root_tournament); let commitment_builder = CachingMachineCommitmentBuilder::new(machine_path.clone()); Ok(Self { @@ -100,7 +106,7 @@ impl Player { ) -> Result> { info!("Enter tournament at address: {}", tournament_address); // TODO: print final state one and final state two - let tournament_state = get_tournament_state(&tournament_states, tournament_address); + let tournament_state = get_tournament_state(tournament_states, tournament_address); commitments.insert( tournament_state.address, diff --git a/prt/client-rs/executable/Cargo.toml b/prt/client-rs/executable/Cargo.toml new file mode 100644 index 00000000..e0576cb1 --- /dev/null +++ b/prt/client-rs/executable/Cargo.toml @@ -0,0 +1,22 @@ +[package] +name = "cartesi-prt-compute" +description = "A Cartesi validator reference implementation" + +version = { workspace = true} +authors = { workspace = true} +edition = { workspace = true} +homepage = { workspace = true} +license-file = { workspace = true} +readme = { workspace = true} +repository = { workspace = true} + + +[dependencies] +cartesi-prt-core = { workspace = true } + +anyhow = { workspace = true } +alloy = { workspace = true, features = ["sol-types"] } +clap = { workspace = true, features = ["derive", "env"] } +env_logger = "0.11.5" +log = "0.4" +tokio = { workspace = true, features = ["full"] } diff --git a/prt/tests/compute-rs/Dockerfile b/prt/client-rs/executable/Dockerfile similarity index 97% rename from prt/tests/compute-rs/Dockerfile rename to prt/client-rs/executable/Dockerfile index 71854c30..7f36f763 100644 --- a/prt/tests/compute-rs/Dockerfile +++ b/prt/client-rs/executable/Dockerfile @@ -37,7 +37,7 @@ COPY ./prt /app/prt WORKDIR /app/prt/tests/compute-rs RUN cargo build --release --bin cartesi-prt-compute -FROM --platform=linux/amd64 cartesi/machine-emulator:0.18.1 +FROM cartesi/machine-emulator:0.18.1 USER root RUN apt-get update && \ diff --git a/prt/tests/compute-rs/Makefile b/prt/client-rs/executable/Makefile similarity index 100% rename from prt/tests/compute-rs/Makefile rename to prt/client-rs/executable/Makefile diff --git a/prt/tests/compute-rs/README.md b/prt/client-rs/executable/README.md similarity index 100% rename from prt/tests/compute-rs/README.md rename to prt/client-rs/executable/README.md diff --git a/prt/tests/compute-rs/src/lib.rs b/prt/client-rs/executable/src/lib.rs similarity index 83% rename from prt/tests/compute-rs/src/lib.rs rename to prt/client-rs/executable/src/lib.rs index 2886adc4..5ae95ab3 100644 --- a/prt/tests/compute-rs/src/lib.rs +++ b/prt/client-rs/executable/src/lib.rs @@ -1,3 +1,5 @@ +use std::path::PathBuf; + use alloy::primitives::Address; use cartesi_prt_core::arena::BlockchainConfig; use clap::Parser; @@ -19,4 +21,7 @@ pub struct ComputeConfig { /// Address of root tournament #[arg(long, env, default_value = ANVIL_ROOT_TOURNAMENT)] pub root_tournament: Address, + /// Direcotry where state is stored. + #[arg(long, env, default_value = "_state")] + pub state_dir: PathBuf, } diff --git a/prt/tests/compute-rs/src/main.rs b/prt/client-rs/executable/src/main.rs similarity index 95% rename from prt/tests/compute-rs/src/main.rs rename to prt/client-rs/executable/src/main.rs index 8412e7ae..4eb7bdd0 100644 --- a/prt/tests/compute-rs/src/main.rs +++ b/prt/client-rs/executable/src/main.rs @@ -24,13 +24,14 @@ async fn main() -> Result<()> { let config = ComputeConfig::parse(); let blockchain_config = config.blockchain_config; let sender = EthArenaSender::new(&blockchain_config)?; - + let mut player = Player::new( None, Vec::new(), &blockchain_config, config.machine_path, config.root_tournament, + config.state_dir, ) .expect("fail to create player object"); @@ -39,7 +40,7 @@ async fn main() -> Result<()> { Ok(Some(state)) => { info!("Tournament finished, {:?}", state); let finished_path = Path::new(FINISHED_PATH); - touch(&finished_path)?; + touch(finished_path)?; } Err(e) => { error!("{}", e); diff --git a/prt/contract-bindings/Cargo.toml b/prt/contracts/bindings-rs/Cargo.toml similarity index 85% rename from prt/contract-bindings/Cargo.toml rename to prt/contracts/bindings-rs/Cargo.toml index a1aaef4c..0d11f37a 100644 --- a/prt/contract-bindings/Cargo.toml +++ b/prt/contracts/bindings-rs/Cargo.toml @@ -15,5 +15,4 @@ readme = "README.md" repository = "https://github.com/cartesi/dave" [dependencies] -alloy = { version = "0.8.0", features = ["sol-types", "contract"] } - +alloy = { workspace = true, features = ["sol-types", "contract"] } diff --git a/prt/contract-bindings/README.md b/prt/contracts/bindings-rs/README.md similarity index 100% rename from prt/contract-bindings/README.md rename to prt/contracts/bindings-rs/README.md diff --git a/prt/contracts/bindings-rs/src/.gitignore b/prt/contracts/bindings-rs/src/.gitignore new file mode 100644 index 00000000..81b46ff0 --- /dev/null +++ b/prt/contracts/bindings-rs/src/.gitignore @@ -0,0 +1 @@ +contract/ diff --git a/cartesi-rollups/contract-bindings/src/lib.rs b/prt/contracts/bindings-rs/src/lib.rs similarity index 69% rename from cartesi-rollups/contract-bindings/src/lib.rs rename to prt/contracts/bindings-rs/src/lib.rs index c89b3333..7b5afcc3 100644 --- a/cartesi-rollups/contract-bindings/src/lib.rs +++ b/prt/contracts/bindings-rs/src/lib.rs @@ -1,2 +1,3 @@ +#[rustfmt::skip] pub mod contract; pub use contract::*; diff --git a/prt/contracts/justfile b/prt/contracts/justfile new file mode 100644 index 00000000..f6230f95 --- /dev/null +++ b/prt/contracts/justfile @@ -0,0 +1,31 @@ +BINDINGS_DIR := "./bindings-rs/src/contract" +SRC_DIR := "." +BINDINGS_FILTER := "^[^I].+TournamentFactory|LeafTournament|RootTournament|^Tournament$" + +default: build + +build: build-smart-contracts bind +clean: clean-smart-contracts clean-bindings + +build-smart-contracts: + forge build + +test: + forge test + +clean-smart-contracts: + forge clean + +fmt: + forge fmt + +check-fmt: + forge fmt --check + +clean-bindings: + rm -rf {{BINDINGS_DIR}} + +bind: clean-bindings + forge bind --alloy --select "{{BINDINGS_FILTER}}" \ + --module --bindings-path {{BINDINGS_DIR}} \ + --root {{SRC_DIR}} diff --git a/prt/contracts/src/CanonicalConstants.sol b/prt/contracts/src/CanonicalConstants.sol index adfafb05..e751e48a 100644 --- a/prt/contracts/src/CanonicalConstants.sol +++ b/prt/contracts/src/CanonicalConstants.sol @@ -30,10 +30,6 @@ library ArbitrationConstants { + Time.Duration.unwrap(COMMITMENT_EFFORT) ); - uint64 constant LOG2_UARCH_SPAN = 20; - uint64 constant LOG2_EMULATOR_SPAN = 48; - uint64 constant LOG2_INPUT_SPAN = 24; - // 3-level tournament uint64 constant LEVELS = 3; diff --git a/prt/contracts/src/ITournament.sol b/prt/contracts/src/ITournament.sol index 9593ed5e..875b0a6e 100644 --- a/prt/contracts/src/ITournament.sol +++ b/prt/contracts/src/ITournament.sol @@ -10,5 +10,9 @@ interface ITournament { function arbitrationResult() external view - returns (bool, Tree.Node, Machine.Hash); + returns ( + bool finished, + Tree.Node winnerCommitment, + Machine.Hash finalState + ); } diff --git a/prt/contracts/src/tournament/abstracts/LeafTournament.sol b/prt/contracts/src/tournament/abstracts/LeafTournament.sol index c2a1f6e0..635f90ff 100644 --- a/prt/contracts/src/tournament/abstracts/LeafTournament.sol +++ b/prt/contracts/src/tournament/abstracts/LeafTournament.sol @@ -4,7 +4,6 @@ pragma solidity ^0.8.17; import "./Tournament.sol"; -import "../../CanonicalConstants.sol"; import "../libs/Commitment.sol"; import "step/src/EmulatorConstants.sol"; @@ -114,6 +113,10 @@ abstract contract LeafTournament is Tournament { deleteMatch(_matchId.hashFromId()); } + uint64 constant LOG2_UARCH_SPAN = 20; + uint64 constant LOG2_EMULATOR_SPAN = 48; + uint64 constant LOG2_INPUT_SPAN = 24; + // TODO: move to step repo function metaStep( bytes32 machineState, @@ -124,15 +127,9 @@ abstract contract LeafTournament is Tournament { AccessLogs.Context memory accessLogs = AccessLogs.Context(machineState, Buffer.Context(proofs, 0)); - uint256 uarch_step_mask = - (1 << ArbitrationConstants.LOG2_UARCH_SPAN) - 1; - uint256 big_step_mask = ( - 1 - << ( - ArbitrationConstants.LOG2_EMULATOR_SPAN - + ArbitrationConstants.LOG2_UARCH_SPAN - ) - ) - 1; + uint256 uarch_step_mask = (1 << LOG2_UARCH_SPAN) - 1; + uint256 big_step_mask = + (1 << (LOG2_EMULATOR_SPAN + LOG2_UARCH_SPAN)) - 1; if (address(provider) == address(0)) { // this is a inputless version of the meta step implementation primarily used for testing @@ -151,11 +148,8 @@ abstract contract LeafTournament is Tournament { if (inputLength > 0) { bytes calldata input = proofs[32:32 + inputLength]; - uint256 inputIndexWithinEpoch = counter - >> ( - ArbitrationConstants.LOG2_EMULATOR_SPAN - + ArbitrationConstants.LOG2_UARCH_SPAN - ); + uint256 inputIndexWithinEpoch = + counter >> (LOG2_EMULATOR_SPAN + LOG2_UARCH_SPAN); // TODO: maybe assert retrieved input length matches? bytes32 inputMerkleRoot = provider.provideMerkleRootOfInput( diff --git a/prt/contracts/src/tournament/libs/Clock.sol b/prt/contracts/src/tournament/libs/Clock.sol index 5b11aa2a..61a35c87 100644 --- a/prt/contracts/src/tournament/libs/Clock.sol +++ b/prt/contracts/src/tournament/libs/Clock.sol @@ -14,7 +14,7 @@ library Clock { struct State { Time.Duration allowance; - Time.Instant startInstant; // the timestamp when the clock started ticking, zero means clock is paused + Time.Instant startInstant; // the block number when the clock started ticking, zero means clock is paused } // diff --git a/prt/contracts/src/tournament/libs/Time.sol b/prt/contracts/src/tournament/libs/Time.sol index 42270a17..c26e9647 100644 --- a/prt/contracts/src/tournament/libs/Time.sol +++ b/prt/contracts/src/tournament/libs/Time.sol @@ -14,7 +14,7 @@ library Time { Duration constant ZERO_DURATION = Duration.wrap(0); function currentTime() internal view returns (Instant) { - return Instant.wrap(uint64(block.timestamp)); + return Instant.wrap(uint64(block.number)); } function add(Instant timestamp, Duration duration) diff --git a/prt/contracts/test/Clock.t.sol b/prt/contracts/test/Clock.t.sol index 0930b55a..d9aef430 100644 --- a/prt/contracts/test/Clock.t.sol +++ b/prt/contracts/test/Clock.t.sol @@ -62,10 +62,10 @@ contract ClockTest is Test { clock1.advanceClock(); assertTrue(clock1.hasTimeLeft(), "clock1 should have time left"); - vm.warp(vm.getBlockTimestamp() + clock1Allowance - 1); + vm.roll(vm.getBlockNumber() + clock1Allowance - 1); assertTrue(clock1.hasTimeLeft(), "clock1 should have time left"); - vm.warp(vm.getBlockTimestamp() + clock1Allowance); + vm.roll(vm.getBlockNumber() + clock1Allowance); assertTrue(!clock1.hasTimeLeft(), "clock1 should run out of time"); vm.expectRevert("can't advance clock with no time left"); diff --git a/prt/contracts/test/MultiTournament.t.sol b/prt/contracts/test/MultiTournament.t.sol index 7376915f..6aa44e02 100644 --- a/prt/contracts/test/MultiTournament.t.sol +++ b/prt/contracts/test/MultiTournament.t.sol @@ -55,11 +55,11 @@ contract MultiTournamentTest is Util, Test { ); // player 0 should win after fast forward time to tournament finishes - uint256 _t = vm.getBlockTimestamp(); + uint256 _t = vm.getBlockNumber(); uint256 _tournamentFinish = _t + Time.Duration.unwrap(ArbitrationConstants.MAX_ALLOWANCE); - vm.warp(_tournamentFinish); + vm.roll(_tournamentFinish); (_finished, _winner, _finalState) = topTournament.arbitrationResult(); uint256 _winnerPlayer = 0; @@ -76,12 +76,12 @@ contract MultiTournamentTest is Util, Test { ); // rewind time in half and pair commitment, expect a match - vm.warp(_t); + vm.roll(_t); // player 1 joins tournament Util.joinTournament(topTournament, 1, 0); // no dangling commitment available, should revert - vm.warp(_tournamentFinish); + vm.roll(_tournamentFinish); (_finished, _winner, _finalState) = topTournament.arbitrationResult(); // tournament not finished when still match going on @@ -298,14 +298,14 @@ contract MultiTournamentTest is Util, Test { assertFalse(_finished, "winner should be zero node"); // player 0 should win after fast forward time to inner tournament finishes - uint256 _t = vm.getBlockTimestamp(); + uint256 _t = vm.getBlockNumber(); // the delay is increased when a match is created uint256 _rootTournamentFinish = _t + Time.Duration.unwrap(ArbitrationConstants.MAX_ALLOWANCE) + Time.Duration.unwrap(ArbitrationConstants.MATCH_EFFORT); Util.joinTournament(middleTournament, 0, 1); - vm.warp(_rootTournamentFinish); + vm.roll(_rootTournamentFinish); (_finished, _winner,) = middleTournament.innerTournamentWinner(); topTournament.winInnerMatch( middleTournament, @@ -370,7 +370,7 @@ contract MultiTournamentTest is Util, Test { (_finished, _winner,) = middleTournament.innerTournamentWinner(); assertTrue(_winner.isZero(), "winner should be zero node"); - _t = vm.getBlockTimestamp(); + _t = vm.getBlockNumber(); // the delay is increased when a match is created _rootTournamentFinish = _t + Time.Duration.unwrap(ArbitrationConstants.MAX_ALLOWANCE); @@ -396,7 +396,7 @@ contract MultiTournamentTest is Util, Test { playerNodes[1][ArbitrationConstants.height(1) - 1] ); - vm.warp( + vm.roll( Time.Instant.unwrap( _player0Clock.startInstant.add(_player0Clock.allowance) ) @@ -410,7 +410,7 @@ contract MultiTournamentTest is Util, Test { _match = middleTournament.getMatch(_matchId.hashFromId()); assertFalse(_match.exists(), "match should be deleted"); - vm.warp(_middleTournamentFinish); + vm.roll(_middleTournamentFinish); (_finished, _winner,) = middleTournament.innerTournamentWinner(); topTournament.winInnerMatch( middleTournament, @@ -419,7 +419,7 @@ contract MultiTournamentTest is Util, Test { ); { - vm.warp(_rootTournamentFinish); + vm.roll(_rootTournamentFinish); (bool _finishedTop, Tree.Node _commitment, Machine.Hash _finalState) = topTournament.arbitrationResult(); @@ -450,17 +450,17 @@ contract MultiTournamentTest is Util, Test { topTournament.getMatch(_matchId.hashFromId()); assertTrue(_match.exists(), "match should exist"); - uint256 _t = vm.getBlockTimestamp(); + uint256 _t = vm.getBlockNumber(); // the delay is increased when a match is created uint256 _rootTournamentFinish = _t + 2 * Time.Duration.unwrap(ArbitrationConstants.MAX_ALLOWANCE); - vm.warp(_rootTournamentFinish - 1); + vm.roll(_rootTournamentFinish - 1); // cannot eliminate match when both blocks still have time vm.expectRevert(Tournament.EliminateByTimeout.selector); topTournament.eliminateMatchByTimeout(_matchId); - vm.warp(_rootTournamentFinish); + vm.roll(_rootTournamentFinish); topTournament.eliminateMatchByTimeout(_matchId); } } diff --git a/prt/contracts/test/Tournament.t.sol b/prt/contracts/test/Tournament.t.sol index 0f7c28db..2f8d0b4a 100644 --- a/prt/contracts/test/Tournament.t.sol +++ b/prt/contracts/test/Tournament.t.sol @@ -61,7 +61,7 @@ contract TournamentTest is Util, Test { function testTimeout() public { topTournament = Util.initializePlayer0Tournament(factory); - uint256 _t = vm.getBlockTimestamp(); + uint256 _t = vm.getBlockNumber(); // the delay is increased when a match is created uint256 _tournamentFinishWithMatch = _t + Time.Duration.unwrap(ArbitrationConstants.MAX_ALLOWANCE) @@ -81,7 +81,7 @@ contract TournamentTest is Util, Test { (Clock.State memory _player0Clock,) = topTournament.getCommitment( playerNodes[0][ArbitrationConstants.height(0)] ); - vm.warp( + vm.roll( Time.Instant.unwrap( _player0Clock.startInstant.add(_player0Clock.allowance) ) @@ -96,7 +96,7 @@ contract TournamentTest is Util, Test { playerNodes[1][ArbitrationConstants.height(0) - 1] ); - vm.warp(_tournamentFinishWithMatch); + vm.roll(_tournamentFinishWithMatch); (bool _finished, Tree.Node _winner, Machine.Hash _finalState) = topTournament.arbitrationResult(); @@ -114,7 +114,7 @@ contract TournamentTest is Util, Test { ); topTournament = Util.initializePlayer0Tournament(factory); - _t = vm.getBlockTimestamp(); + _t = vm.getBlockNumber(); // the delay is increased when a match is created _tournamentFinishWithMatch = _t @@ -138,7 +138,7 @@ contract TournamentTest is Util, Test { (Clock.State memory _player1Clock,) = topTournament.getCommitment( playerNodes[1][ArbitrationConstants.height(0)] ); - vm.warp( + vm.roll( Time.Instant.unwrap( _player1Clock.startInstant.add(_player1Clock.allowance) ) @@ -153,7 +153,7 @@ contract TournamentTest is Util, Test { playerNodes[0][ArbitrationConstants.height(0) - 1] ); - vm.warp(_tournamentFinishWithMatch); + vm.roll(_tournamentFinishWithMatch); (_finished, _winner, _finalState) = topTournament.arbitrationResult(); _winnerPlayer = 0; diff --git a/prt/measure_constants/Makefile b/prt/measure_constants/Makefile index 145019e2..de7da1aa 100644 --- a/prt/measure_constants/Makefile +++ b/prt/measure_constants/Makefile @@ -1,4 +1,4 @@ -LIBNAME = chronos + LUADIR=$(shell pkg-config --cflags-only-I lua) COPT = -O2 -DNDEBUG diff --git a/prt/tests/compute/blockchain/constants.lua b/prt/tests/common/blockchain/constants.lua similarity index 100% rename from prt/tests/compute/blockchain/constants.lua rename to prt/tests/common/blockchain/constants.lua diff --git a/prt/tests/compute/blockchain/node.lua b/prt/tests/common/blockchain/node.lua similarity index 60% rename from prt/tests/compute/blockchain/node.lua rename to prt/tests/common/blockchain/node.lua index c7d5ba94..c891cee5 100644 --- a/prt/tests/compute/blockchain/node.lua +++ b/prt/tests/common/blockchain/node.lua @@ -3,12 +3,22 @@ local helper = require "utils.helper" local default_account_number = 40 -- spawn an anvil node with 40 accounts, auto-mine, and finalize block at height N-2 -local function start_blockchain() +local function start_blockchain(load_state) print(string.format("Starting blockchain with %d accounts...", default_account_number)) - local cmd = string.format( - [[sh -c "echo $$ ; exec anvil --block-time 1 --slots-in-an-epoch 1 -a %d > anvil.log 2>&1"]], - default_account_number) + local cmd + if load_state then + cmd = string.format( + [[sh -c "echo $$ ; exec anvil --load-state %s --disable-code-size-limit --preserve-historical-states --block-time 1 --slots-in-an-epoch 1 -a %d > anvil.log 2>&1"]], + load_state, + default_account_number + ) + else + cmd = string.format( + [[sh -c "echo $$ ; exec anvil --disable-code-size-limit --preserve-historical-states --block-time 1 --slots-in-an-epoch 1 -a %d > anvil.log 2>&1"]], + default_account_number + ) + end local reader = io.popen(cmd) assert(reader, "`popen` returned nil reader") @@ -34,10 +44,10 @@ end local Blockchain = {} Blockchain.__index = Blockchain -function Blockchain:new() +function Blockchain:new(load_state) local blockchain = {} - local handle = start_blockchain() + local handle = start_blockchain(load_state) blockchain.pks, blockchain.endpoint = capture_blockchain_data() blockchain._handle = handle diff --git a/prt/tests/compute/blockchain/utils.lua b/prt/tests/common/blockchain/utils.lua similarity index 75% rename from prt/tests/compute/blockchain/utils.lua rename to prt/tests/common/blockchain/utils.lua index 508fba2f..8b4024cd 100644 --- a/prt/tests/compute/blockchain/utils.lua +++ b/prt/tests/common/blockchain/utils.lua @@ -1,12 +1,12 @@ local cast_advance_template = [[ -cast rpc -r "%s" evm_increaseTime %d +cast rpc -r "%s" anvil_mine %d ]] -local function advance_time(seconds, endpoint) +local function advance_time(blocks, endpoint) local cmd = string.format( cast_advance_template, endpoint, - seconds + blocks ) local handle = io.popen(cmd) @@ -15,10 +15,11 @@ local function advance_time(seconds, endpoint) handle:close() if ret:find "Error" then - error(string.format("Advance time `%d`s failed:\n%s", seconds, ret)) + error(string.format("Advance time `%d`s failed:\n%s", blocks, ret)) end end +-- TODO remove this, since we're dumping/loading an "ready" anvil state. local deploy_cmd = [[sh -c "cd %s && ./deploy_anvil.sh"]] local function deploy_contracts(contracts_path) local reader = io.popen(string.format(deploy_cmd, contracts_path)) diff --git a/prt/tests/compute/runners/helpers/dummy_commitment.lua b/prt/tests/common/runners/helpers/dummy_commitment.lua similarity index 100% rename from prt/tests/compute/runners/helpers/dummy_commitment.lua rename to prt/tests/common/runners/helpers/dummy_commitment.lua diff --git a/prt/tests/compute/runners/helpers/fake_commitment.lua b/prt/tests/common/runners/helpers/fake_commitment.lua similarity index 98% rename from prt/tests/compute/runners/helpers/fake_commitment.lua rename to prt/tests/common/runners/helpers/fake_commitment.lua index 1e88ac92..4341be18 100644 --- a/prt/tests/compute/runners/helpers/fake_commitment.lua +++ b/prt/tests/common/runners/helpers/fake_commitment.lua @@ -1,7 +1,7 @@ local consts = require "computation.constants" local MerkleBuilder = require "cryptography.merkle_builder" local Hash = require "cryptography.hash" -local new_scoped_require = require "utils.scoped_require" +local new_scoped_require = require "test_utils.scoped_require" local FakeCommitmentBuilder = {} FakeCommitmentBuilder.__index = FakeCommitmentBuilder diff --git a/prt/tests/compute/runners/helpers/idle_strategy.lua b/prt/tests/common/runners/helpers/idle_strategy.lua similarity index 100% rename from prt/tests/compute/runners/helpers/idle_strategy.lua rename to prt/tests/common/runners/helpers/idle_strategy.lua diff --git a/prt/tests/compute/runners/hero_runner.lua b/prt/tests/common/runners/hero_runner.lua similarity index 100% rename from prt/tests/compute/runners/hero_runner.lua rename to prt/tests/common/runners/hero_runner.lua diff --git a/prt/tests/compute/runners/idle_runner.lua b/prt/tests/common/runners/idle_runner.lua similarity index 100% rename from prt/tests/compute/runners/idle_runner.lua rename to prt/tests/common/runners/idle_runner.lua diff --git a/prt/tests/compute/runners/rust_hero_runner.lua b/prt/tests/common/runners/rust_hero_runner.lua similarity index 100% rename from prt/tests/compute/runners/rust_hero_runner.lua rename to prt/tests/common/runners/rust_hero_runner.lua diff --git a/prt/tests/compute/runners/sybil_runner.lua b/prt/tests/common/runners/sybil_runner.lua similarity index 100% rename from prt/tests/compute/runners/sybil_runner.lua rename to prt/tests/common/runners/sybil_runner.lua diff --git a/prt/tests/compute/utils/example.lua b/prt/tests/common/test_utils/example.lua similarity index 89% rename from prt/tests/compute/utils/example.lua rename to prt/tests/common/test_utils/example.lua index 347402f3..ba19b2d0 100644 --- a/prt/tests/compute/utils/example.lua +++ b/prt/tests/common/test_utils/example.lua @@ -5,16 +5,16 @@ assert(#package.loaded == 1) local env0, const0 = _ENV, require "blockchain.constants" -- Scope/sandbox creator -local new_scoped_require = require "utils.scoped_require" +local new_scoped_require = require "test_utils.scoped_require" -- -- Create scope/sandbox 1 local scoped_require1 = new_scoped_require(_ENV) -- In scope/sandbox 1, load "utils.test" -local env1, const1 = scoped_require1 "utils.test" +local env1, const1 = scoped_require1 "test_utils.test" --- Check that in scope 1, both _ENV and "utils.scoped_require" are different +-- Check that in scope 1, both _ENV and "test_utils.scoped_require" are different assert(env0 ~= env1) assert(const0 ~= const1) @@ -24,9 +24,9 @@ assert(const0 ~= const1) local scoped_require2 = new_scoped_require(_ENV) -- In sandbox 2, load "utils.test" -local env2, const2 = scoped_require2 "utils.test" +local env2, const2 = scoped_require2 "test_utils.test" --- Check that in scope 2, both _ENV and "utils.scoped_require" are different +-- Check that in scope 2, both _ENV and "test_utils.scoped_require" are different assert(env1 ~= env2) assert(const1 ~= const2) diff --git a/prt/tests/compute/utils/scoped_require.lua b/prt/tests/common/test_utils/scoped_require.lua similarity index 100% rename from prt/tests/compute/utils/scoped_require.lua rename to prt/tests/common/test_utils/scoped_require.lua diff --git a/prt/tests/compute/utils/test.lua b/prt/tests/common/test_utils/test.lua similarity index 100% rename from prt/tests/compute/utils/test.lua rename to prt/tests/common/test_utils/test.lua diff --git a/prt/tests/compute-rs/Cargo.toml b/prt/tests/compute-rs/Cargo.toml deleted file mode 100644 index ea1eaba1..00000000 --- a/prt/tests/compute-rs/Cargo.toml +++ /dev/null @@ -1,25 +0,0 @@ -[package] -name = "cartesi-prt-compute" -version = "0.1.0" - -authors = [ - "Gabriel Coutinho de Paula ", - "Algebraic Sofia ", - "Stephen Chen ", -] -description = "A Cartesi validator reference implementation" -edition = "2021" -homepage = "https://github.com/cartesi/dave" -license-file = "LICENSE" -readme = "README.md" -repository = "https://github.com/cartesi/dave" - -[dependencies] -cartesi-prt-core = { path = "../../client-rs" } - -anyhow = "1.0" -alloy = { version = "0.8.0", features = ["sol-types"] } -clap = { version = "4.5", features = ["derive", "env"] } -env_logger = "0.11.5" -log = "0.4" -tokio = { version = "1", features = ["full"] } diff --git a/prt/tests/compute/program/doom/Dockerfile b/prt/tests/compute/program/doom/Dockerfile index 4c5930f0..8c7d647f 100644 --- a/prt/tests/compute/program/doom/Dockerfile +++ b/prt/tests/compute/program/doom/Dockerfile @@ -1,4 +1,4 @@ -FROM --platform=linux/amd64 cartesi/machine-emulator:0.18.1 +FROM cartesi/machine-emulator:0.18.1 USER root ENV FREEDOOM_VER=v0.2.0 ENV KERNEL_VER=v0.19.1-riv1 diff --git a/prt/tests/compute/prt_compute.lua b/prt/tests/compute/prt_compute.lua index 2adf0f18..e8d20199 100755 --- a/prt/tests/compute/prt_compute.lua +++ b/prt/tests/compute/prt_compute.lua @@ -11,7 +11,7 @@ local FAKE_COMMITMENT_COUNT = 1 local IDLE_PLAYER_COUNT = 0 -- Required Modules -local new_scoped_require = require "utils.scoped_require" +local new_scoped_require = require "test_utils.scoped_require" local helper = require "utils.helper" local blockchain_utils = require "blockchain.utils" @@ -132,7 +132,7 @@ local function run_players(player_coroutines) end if idle then - print(string.format("All players idle, fastforward blockchain for %d seconds...", FAST_FORWARD_TIME)) + print(string.format("All players idle, fastforward blockchain for %d blocks...", FAST_FORWARD_TIME)) blockchain_utils.advance_time(FAST_FORWARD_TIME, blockchain_constants.endpoint) end end diff --git a/prt/tests/compute/setup_path.lua b/prt/tests/compute/setup_path.lua index 9804189f..0c44f163 100644 --- a/prt/tests/compute/setup_path.lua +++ b/prt/tests/compute/setup_path.lua @@ -1,4 +1,5 @@ -- setup client-lua path +package.path = package.path .. ";../common/?.lua" package.path = package.path .. ";../../client-lua/?.lua" -- setup cartesi machine path diff --git a/prt/tests/rollups/.gitignore b/prt/tests/rollups/.gitignore new file mode 100644 index 00000000..36c26874 --- /dev/null +++ b/prt/tests/rollups/.gitignore @@ -0,0 +1,2 @@ +*.log +_state/ diff --git a/prt/tests/rollups/Dockerfile b/prt/tests/rollups/Dockerfile deleted file mode 100644 index e006bb45..00000000 --- a/prt/tests/rollups/Dockerfile +++ /dev/null @@ -1,66 +0,0 @@ -FROM rust:1.81.0-bookworm AS chef - -ENV CARGO_REGISTRIES_CARTESI_INDEX=https://github.com/cartesi/crates-index -RUN rustup component add rustfmt -RUN cargo install cargo-chef -RUN apt-get update && \ - apt-get install -y clang libslirp0 - -FROM chef AS planner -COPY ./machine/rust-bindings /app/machine/rust-bindings -COPY ./common-rs /app/common-rs -COPY ./prt/client-rs /app/prt/client-rs -COPY ./prt/contract-bindings /app/prt/contract-bindings -COPY ./cartesi-rollups/contract-bindings /app/cartesi-rollups/contract-bindings -COPY ./cartesi-rollups/node /app/cartesi-rollups/node - -WORKDIR /app/cartesi-rollups/node -RUN cargo chef prepare --recipe-path recipe.json - -FROM chef AS builder -COPY ./machine /app/machine -COPY ./common-rs /app/common-rs -COPY ./prt/client-rs /app/prt/client-rs -COPY ./prt/contract-bindings /app/prt/contract-bindings -COPY ./cartesi-rollups/contract-bindings /app/cartesi-rollups/contract-bindings -COPY ./.git /app/.git -COPY --from=planner /app/cartesi-rollups/node/recipe.json /app/cartesi-rollups/node/recipe.json - -# Build dependencies - this is the caching Docker layer! -WORKDIR /app/cartesi-rollups/node -RUN cargo chef cook --release --recipe-path recipe.json - -# Build application -COPY --from=ethereum/solc:0.8.27 /usr/bin/solc /usr/bin/solc -RUN chmod u+x /usr/bin/solc - -COPY ./cartesi-rollups /app/cartesi-rollups - -WORKDIR /app/cartesi-rollups/node -RUN cargo build --release --bin dave-rollups - -FROM --platform=linux/amd64 cartesi/machine-emulator:0.18.1 - -USER root -RUN apt-get update && \ - apt-get install -y procps curl xxd clang sqlite3 -ENV FOUNDRY_NIGHTLY nightly-805d7cee81e78e9163b8ce3d86a0c3beb39772d4 -RUN curl -sSL https://github.com/foundry-rs/foundry/releases/download/${FOUNDRY_NIGHTLY}/foundry_nightly_linux_$(dpkg --print-architecture).tar.gz | \ - tar -zx -C /usr/local/bin - -# prepare echo machine -WORKDIR /root/program/ -COPY ./prt/tests/rollups/program/echo/echo-program.tar.gz /root/program/ -RUN tar -zx -f /root/program/echo-program.tar.gz - -COPY ./machine/step /root/machine/step -COPY ./prt /root/prt -COPY ./cartesi-rollups /root/cartesi-rollups -COPY --from=builder /app/cartesi-rollups/node/target/release/dave-rollups /root/prt/tests/rollups/dave-rollups - -WORKDIR /root/cartesi-rollups/contracts -RUN forge --version -RUN forge build - -WORKDIR /root/prt/tests/rollups -ENTRYPOINT ["./prt_rollups.lua"] diff --git a/prt/tests/rollups/Makefile b/prt/tests/rollups/Makefile deleted file mode 100644 index 8a5eb8a5..00000000 --- a/prt/tests/rollups/Makefile +++ /dev/null @@ -1,18 +0,0 @@ -ECHO_MACHINE_PATH := "/root/program/echo-program" - -help: - @echo ' create-image - create `prt-rollups:test` docker image' - @echo ' test-echo - run PRT rollups echo test' - -create-image: - @docker build -t cartesi/prt-rollups:test -f Dockerfile ../../../ - -test-echo: create-image - @docker run --rm --name prt-rollups-test-echo \ - --env MACHINE_PATH=$(ECHO_MACHINE_PATH) \ - cartesi/prt-rollups:test - - - - -.PHONY: help create-image test-echo diff --git a/prt/tests/rollups/README.md b/prt/tests/rollups/README.md index 296a1370..42abb799 100644 --- a/prt/tests/rollups/README.md +++ b/prt/tests/rollups/README.md @@ -1,7 +1,8 @@ # PRT Rollups test -This directory contains a rollups node written in Rust. -The node test will be conducted with a Lua orchestrator script spawning an honest rollups node in the background to advance the rollups states and to defend the application. The Lua orchestrator script also spawns multiple [dishonest nodes](../../../prt/tests/compute/README.md) trying to tamper with the rollups states. +This tests the rollups Rust node. +The node test will be conducted with a Lua orchestrator script spawning an honest rollups node in the background to advance the rollups states and to defend the application. +The Lua orchestrator script also spawns multiple [dishonest nodes](../compute/README.md) trying to tamper with the rollups states. Remember to either clone the repository with the flag `--recurse-submodules`, or run `git submodule update --recursive --init` after cloning. You need a docker installation to run the Dave Lua node. diff --git a/prt/tests/rollups/dave/node.lua b/prt/tests/rollups/dave/node.lua index 4dcdf953..897c10db 100644 --- a/prt/tests/rollups/dave/node.lua +++ b/prt/tests/rollups/dave/node.lua @@ -2,11 +2,12 @@ local helper = require "utils.helper" local function start_dave_node(machine_path, db_path, sleep_duration, verbosity, trace_level) local cmd = string.format( - [[sh -c "echo $$ ; exec env MACHINE_PATH='%s' PATH_TO_DB='%s' \ + [[sh -c "echo $$ ; exec env MACHINE_PATH='%s' STATE_DIR='%s' \ SLEEP_DURATION=%d RUST_BACKTRACE='%s' \ - RUST_LOG='none',cartesi_prt_core='%s',rollups_compute_runner='%s',rollups_epoch_manager='%s' \ - ./dave-rollups > dave.log 2>&1"]], - machine_path, db_path, sleep_duration, trace_level, verbosity, verbosity, verbosity) + RUST_LOG='none',cartesi_prt_core='%s',rollups_prt_runner='%s',rollups_epoch_manager='%s' \ + ../../../target/debug/dave-rollups > dave.log 2>&1"]], + machine_path, db_path, sleep_duration, trace_level, verbosity, verbosity, verbosity + ) local reader = io.popen(cmd) assert(reader, "`popen` returned nil reader") @@ -29,8 +30,9 @@ Dave.__index = Dave function Dave:new(machine_path, sleep_duration, verbosity, trace_level) local n = {} + os.execute "rm -rf _state && mkdir _state" - local handle = start_dave_node(machine_path, "./dave.db", sleep_duration, verbosity, trace_level) + local handle = start_dave_node(machine_path, "_state/", sleep_duration, verbosity, trace_level) n._handle = handle diff --git a/prt/tests/rollups/justfile b/prt/tests/rollups/justfile new file mode 100644 index 00000000..cd3d0806 --- /dev/null +++ b/prt/tests/rollups/justfile @@ -0,0 +1,11 @@ +# run PRT rollups test +test MACH_PATH: + rm -rf _state + MACHINE_PATH={{MACH_PATH}} lua prt_rollups.lua + +# run PRT rollups echo test +test-echo: (test "../../../test/programs/echo") + +# read logs from PRT Rollups node, run in separate terminal after `test-echo` +read-node-logs: + tail -f dave.log diff --git a/prt/tests/rollups/program/.dockerignore b/prt/tests/rollups/program/.dockerignore deleted file mode 100644 index 643b3a57..00000000 --- a/prt/tests/rollups/program/.dockerignore +++ /dev/null @@ -1 +0,0 @@ -**/*tar.gz diff --git a/prt/tests/rollups/program/.gitignore b/prt/tests/rollups/program/.gitignore deleted file mode 100644 index 643b3a57..00000000 --- a/prt/tests/rollups/program/.gitignore +++ /dev/null @@ -1 +0,0 @@ -**/*tar.gz diff --git a/prt/tests/rollups/program/echo/.gitignore b/prt/tests/rollups/program/echo/.gitignore deleted file mode 100644 index 15336dbe..00000000 --- a/prt/tests/rollups/program/echo/.gitignore +++ /dev/null @@ -1 +0,0 @@ -echo-program/ diff --git a/prt/tests/rollups/program/echo/Dockerfile b/prt/tests/rollups/program/echo/Dockerfile deleted file mode 100644 index 9361a52b..00000000 --- a/prt/tests/rollups/program/echo/Dockerfile +++ /dev/null @@ -1,13 +0,0 @@ -FROM cartesi/machine-emulator:0.18.1 -USER root -RUN apt-get update && \ - apt-get install -y wget - -RUN wget https://github.com/cartesi/image-kernel/releases/download/v0.20.0/linux-6.5.13-ctsi-1-v0.20.0.bin \ - -O ./linux.bin -RUN wget https://github.com/cartesi/machine-emulator-tools/releases/download/v0.16.1/rootfs-tools-v0.16.1.ext2 \ - -O ./rootfs.ext2 - -COPY ./gen_machine_echo.sh . -RUN chmod +x gen_machine_echo.sh -RUN ./gen_machine_echo.sh && tar -zvcf /echo-program.tar.gz echo-program diff --git a/prt/tests/rollups/program/echo/README.md b/prt/tests/rollups/program/echo/README.md deleted file mode 100644 index f726fb17..00000000 --- a/prt/tests/rollups/program/echo/README.md +++ /dev/null @@ -1,10 +0,0 @@ -# Simple echo program - -## Generate program - -From this directory, run the following: - -``` -docker build -t echo:test . -docker cp $(docker create echo:test):/echo-program.tar.gz . -``` diff --git a/prt/tests/rollups/program/echo/gen_machine_echo.sh b/prt/tests/rollups/program/echo/gen_machine_echo.sh deleted file mode 100755 index 99252fff..00000000 --- a/prt/tests/rollups/program/echo/gen_machine_echo.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -cartesi-machine --ram-image=./linux.bin \ - --flash-drive=label:root,filename:./rootfs.ext2 \ - --no-rollback --store=./echo-program \ - -- "ioctl-echo-loop --vouchers=1 --notices=1 --reports=1 --verbose=1" diff --git a/prt/tests/rollups/prt_rollups.lua b/prt/tests/rollups/prt_rollups.lua index d8335e12..5eb39f0f 100755 --- a/prt/tests/rollups/prt_rollups.lua +++ b/prt/tests/rollups/prt_rollups.lua @@ -1,10 +1,16 @@ -#!/usr/bin/lua require "setup_path" + +-- TODO load from deployment file `addresses` +-- consensus contract address in anvil deployment +local CONSENSUS_ADDRESS = "0x0165878a594ca255338adfa4d48449f69242eb8f" +-- input contract address in anvil deployment +local INPUT_BOX_ADDRESS = "0x5FbDB2315678afecb367f032d93F642f64180aa3"; + -- amount of time sleep between each react local SLEEP_TIME = 2 -- amount of time to fastforward if `IDLE_LIMIT` is reached -local FAST_FORWARD_TIME = 20 +local FAST_FORWARD_TIME = 32 -- amount of time to fastforward to advance an epoch -- local EPOCH_TIME = 60 * 60 * 24 * 7 -- delay time for blockchain node to be ready @@ -13,10 +19,6 @@ local NODE_DELAY = 3 local FAKE_COMMITMENT_COUNT = 1 -- number of idle players local IDLE_PLAYER_COUNT = 0 --- consensus contract address in anvil deployment -local CONSENSUS_ADDRESS = "0x0165878A594ca255338adfa4d48449f69242Eb8F" --- input contract address in anvil deployment -local INPUT_BOX_ADDRESS = "0x5FbDB2315678afecb367f032d93F642f64180aa3"; -- app contract address in anvil deployment local APP_ADDRESS = "0x0000000000000000000000000000000000000000"; -- Hello from Dave! @@ -35,7 +37,7 @@ local ENCODED_INPUT = "0x0000000000000000000000000000000000000000000000000000000000007a690000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f39fd6e51aad88f6f4ce6ab8827279cfffb9226600000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000060b61d58000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000001048656c6c6f2076726f6d20446176652100000000000000000000000000000000" -- Required Modules -local new_scoped_require = require "utils.scoped_require" +local new_scoped_require = require "test_utils.scoped_require" local helper = require "utils.helper" local blockchain_utils = require "blockchain.utils" @@ -49,8 +51,10 @@ local MerkleBuilder = require "cryptography.merkle_builder" local Reader = require "dave.reader" local Sender = require "dave.sender" +os.execute("rm -rf _state") + local ROOT_LEAFS_QUERY = -[[sqlite3 /compute_data/%s/db 'select level,base_cycle,compute_leaf_index,repetitions,HEX(compute_leaf) +[[sqlite3 ./_state/compute_path/%s/db 'select level,base_cycle,compute_leaf_index,repetitions,HEX(compute_leaf) from compute_leafs where level=0 ORDER BY compute_leaf_index ASC']] local function build_root_commitment_from_db(machine_path, root_tournament) local builder = MerkleBuilder:new() @@ -81,7 +85,7 @@ local function build_root_commitment_from_db(machine_path, root_tournament) end local INPUTS_QUERY = -[[sqlite3 /compute_data/%s/db 'select HEX(input) +[[sqlite3 ./_state/compute_path/%s/db 'select HEX(input) from inputs ORDER BY input_index ASC']] local function get_inputs_from_db(root_tournament) local handle = io.popen(string.format(INPUTS_QUERY, root_tournament)) @@ -161,7 +165,7 @@ local function run_players(player_coroutines) end if idle then - print(string.format("All players idle, fastforward blockchain for %d seconds...", FAST_FORWARD_TIME)) + print(string.format("All players idle, fastforward blockchain for %d blocks...", FAST_FORWARD_TIME)) blockchain_utils.advance_time(FAST_FORWARD_TIME, blockchain_constants.endpoint) end time.sleep(SLEEP_TIME) @@ -169,19 +173,21 @@ local function run_players(player_coroutines) end -- Main Execution -local rollups_machine_path = os.getenv("MACHINE_PATH") +local rpath = assert(io.popen("realpath " .. assert(os.getenv("MACHINE_PATH")))) +local rollups_machine_path = assert(rpath:read()) +rpath:close() -local blockchain_node = Blockchain:new() +local blockchain_node = Blockchain:new(rollups_machine_path .. "/anvil_state.json") time.sleep(NODE_DELAY) -blockchain_utils.deploy_contracts("../../../cartesi-rollups/contracts") -time.sleep(NODE_DELAY) +-- blockchain_utils.deploy_contracts("../../../cartesi-rollups/contracts") +-- time.sleep(NODE_DELAY) -- trace, debug, info, warn, error local verbosity = os.getenv("VERBOSITY") or 'debug' -- 0, 1, full local trace_level = os.getenv("TRACE_LEVEL") or 'full' -local dave_node = Dave:new(rollups_machine_path, SLEEP_TIME, verbosity, trace_level) +local dave_node = Dave:new(rollups_machine_path .. "/machine-image", SLEEP_TIME, verbosity, trace_level) time.sleep(NODE_DELAY) local reader = Reader:new(blockchain_constants.endpoint) @@ -202,11 +208,11 @@ while true do -- react to last sealed epoch local root_tournament = sealed_epochs[#sealed_epochs].tournament - local work_path = string.format("/compute_data/%s", root_tournament) + local work_path = string.format("./_state/compute_path/%s", root_tournament) if helper.exists(work_path) then print(string.format("sybil player attacking epoch %d", last_sealed_epoch.epoch_number)) - local epoch_machine_path = string.format("/rollups_data/%d/0", last_sealed_epoch.epoch_number) + local epoch_machine_path = string.format("./_state/snapshots/%d/0", last_sealed_epoch.epoch_number) local player_coroutines = setup_players(root_tournament, epoch_machine_path) run_players(player_coroutines) end diff --git a/prt/tests/rollups/setup_path.lua b/prt/tests/rollups/setup_path.lua index c736a82c..0c44f163 100644 --- a/prt/tests/rollups/setup_path.lua +++ b/prt/tests/rollups/setup_path.lua @@ -1,5 +1,5 @@ -- setup client-lua path -package.path = package.path .. ";../compute/?.lua" +package.path = package.path .. ";../common/?.lua" package.path = package.path .. ";../../client-lua/?.lua" -- setup cartesi machine path diff --git a/test/Dockerfile b/test/Dockerfile new file mode 100644 index 00000000..7c0ca60e --- /dev/null +++ b/test/Dockerfile @@ -0,0 +1,114 @@ +# syntax=docker.io/docker/dockerfile-upstream:1.12.1-labs + +# to work wiht an unreleased verion, build machine docker image locally +# (i.e. cartesi/machine-emulator:latest), and change tag. +FROM cartesi/machine-emulator:0.18.1 AS machine + +FROM rust:1.83 + +# Install `just` +RUN \ + --mount=type=cache,target=$CARGO_HOME/registry,sharing=locked \ + --mount=type=cache,target=$CARGO_HOME/git,sharing=locked \ + --mount=type=cache,target=just-target,sharing=locked \ + cargo install just + +# Install `foundry` +ENV SVM_ROOT=/root/.svm +RUN \ + --mount=type=cache,target=$CARGO_HOME/registry,sharing=locked \ + --mount=type=cache,target=$CARGO_HOME/git,sharing=locked \ + --mount=type=cache,target=foundry-target,sharing=locked \ + cargo install --git https://github.com/foundry-rs/foundry \ + --profile release --locked --target-dir foundry-target \ + anvil cast chisel forge + +# Install general dependencies +ENV DEBIAN_FRONTEND=noninteractive +RUN \ + apt-get update && apt-get install -y --no-install-recommends \ + build-essential git wget \ + libslirp-dev \ + liblua5.4-dev \ + lua5.4 \ + libclang-dev \ + xxd jq sqlite3; \ + rm -rf /var/cache/apt; + +# Install cartesi machine +COPY \ + --from=machine \ + /usr/lib/libcartesi-0.18.so /usr/lib/libcartesi.a \ + /usr/lib/ +COPY \ + --from=machine \ + /usr/bin/cartesi-machine \ + /usr/bin/ +COPY \ + --from=machine \ + /usr/include/cartesi-machine/ \ + /usr/include/cartesi-machine/ +COPY \ + --from=machine \ + /usr/share/lua/ \ + /usr/share/lua/ +COPY \ + --from=machine \ + /usr/lib/lua/ \ + /usr/lib/lua/ + +# for Rust bindings `cartesi-machine-sys` +ENV LIBCARTESI_PATH="/usr/lib/" +ENV INCLUDECARTESI_PATH="/usr/include/cartesi-machine/" + + +WORKDIR /dave + + +COPY test/programs/ test/programs/ +RUN just -f test/programs/justfile download-deps + +COPY prt/contracts/ prt/contracts/ +COPY cartesi-rollups/contracts/ cartesi-rollups/contracts/ +COPY machine/step/ machine/step/ +COPY justfile justfile + +RUN \ + --mount=type=cache,target=$SVM_ROOT,sharing=locked \ + --mount=type=cache,target=cartesi-rollups/contracts/out,sharing=locked \ + --mount=type=cache,target=cartesi-rollups/contracts/cache,sharing=locked \ + --mount=type=cache,target=prt/contracts/out,sharing=locked \ + --mount=type=cache,target=prt/contracts/cache,sharing=locked \ + just build-smart-contracts && just bind + +RUN \ + --mount=type=cache,target=$SVM_ROOT,sharing=locked \ + --mount=type=cache,target=cartesi-rollups/contracts/out,sharing=locked \ + --mount=type=cache,target=cartesi-rollups/contracts/cache,sharing=locked \ + --mount=type=cache,target=prt/contracts/out,sharing=locked \ + --mount=type=cache,target=prt/contracts/cache,sharing=locked \ + just -f test/programs/justfile build-echo + + +COPY \ + --exclude=test/programs \ + --exclude=prt/contracts \ + --exclude=machine/step \ + --exclude=justfile \ + --exclude=cartesi-rollups/contracts \ + . . + +RUN \ + --mount=type=cache,target=target,sharing=locked \ + --mount=type=cache,target=$CARGO_HOME/registry,sharing=locked \ + --mount=type=cache,target=$CARGO_HOME/git,sharing=locked \ + --mount=type=cache,target=$SVM_ROOT,sharing=locked \ + --mount=type=cache,target=cartesi-rollups/contracts/out,sharing=locked \ + --mount=type=cache,target=cartesi-rollups/contracts/cache,sharing=locked \ + --mount=type=cache,target=prt/contracts/out,sharing=locked \ + --mount=type=cache,target=prt/contracts/cache,sharing=locked \ + RUSTFLAGS="-lslirp" \ + just build-rust-workspace --features external_cartesi; \ + cp target/debug/dave-rollups . + +RUN mkdir -p target/debug && mv dave-rollups target/debug/ diff --git a/test/programs/.gitignore b/test/programs/.gitignore new file mode 100644 index 00000000..efedfc1b --- /dev/null +++ b/test/programs/.gitignore @@ -0,0 +1,9 @@ +linux.bin +rootfs.ext2 + +**/machine-image/ +**/addresses +**/anvil_state.json +**/_anvil.log + +**/*tar.gz diff --git a/test/programs/build_anvil_state.sh b/test/programs/build_anvil_state.sh new file mode 100755 index 00000000..2d105e0e --- /dev/null +++ b/test/programs/build_anvil_state.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash +set -euo pipefail +program_path=$1 + +mkdir -p $program_path + +# start anvil with dump state +rm -f $program_path/anvil_state.json +anvil --disable-code-size-limit --preserve-historical-states --slots-in-an-epoch 1 \ + --dump-state $program_path/anvil_state.json > $program_path/_anvil.log 2>&1 & +anvil_pid=$! +sleep 5 + + +# deploy smart contracts +initial_hash=`xxd -p -c32 "${program_path}/machine-image/hash"` +just -f ../../cartesi-rollups/contracts/justfile deploy-dev $initial_hash + + +# generate address file +rm -f $program_path/addresses + +jq -r '.transactions[] | select(.transactionType=="CREATE").contractAddress' \ + ../../cartesi-rollups/contracts/broadcast/InputBox.s.sol/31337/run-latest.json \ + >> $program_path/addresses + +jq -r '.transactions[] | select(.transactionType=="CREATE") | select(.contractName=="DaveConsensus") .contractAddress' \ + ../../cartesi-rollups/contracts/broadcast/DaveConsensus.s.sol/31337/run-latest.json \ + >> $program_path/addresses + +cast rpc anvil_mine 2 + +# +# kill anvil, thus dumping its state, to be loaded later by tests +kill -INT "$anvil_pid" +wait $anvil_pid diff --git a/test/programs/echo/.gitkeep b/test/programs/echo/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/test/programs/justfile b/test/programs/justfile new file mode 100644 index 00000000..94648e06 --- /dev/null +++ b/test/programs/justfile @@ -0,0 +1,27 @@ +download-deps: clean-deps + wget https://github.com/cartesi/image-kernel/releases/download/v0.20.0/linux-6.5.13-ctsi-1-v0.20.0.bin \ + -O ./linux.bin + wget https://github.com/cartesi/machine-emulator-tools/releases/download/v0.16.1/rootfs-tools-v0.16.1.ext2 \ + -O ./rootfs.ext2 + +clean-deps: + rm -f rootfs.ext2 + rm -f linux.bin + +clean-program prog: + rm -f {{prog}}/_anvil.log echo/addresses echo/anvil_state.json + rm -rf {{prog}}/machine-image + +clean-programs: clean-echo +build-programs: build-echo + +clean-echo: (clean-program "echo") + +build-echo: clean-echo + cartesi-machine --ram-image=./linux.bin \ + --flash-drive=label:root,filename:./rootfs.ext2 \ + --no-rollback --store=./echo/machine-image \ + -- "ioctl-echo-loop --vouchers=1 --notices=1 --reports=1 --verbose=1" + ./build_anvil_state.sh "echo" + +