From a25b8482a7d7bd850a606ded9f75eba242835fa5 Mon Sep 17 00:00:00 2001 From: colin <102356659+colinlyguo@users.noreply.github.com> Date: Fri, 23 Aug 2024 17:45:14 +0800 Subject: [PATCH] feat(coordinator): add blob bytes in batch proving task (#1485) Co-authored-by: Zhang Zhuo Co-authored-by: Mengran Lan Co-authored-by: georgehao --- Makefile | 6 +- common/forks/forks.go | 2 +- common/libzkp/e2e-test.sh | 26 +-- common/libzkp/impl/Cargo.lock | 211 ++++++++++-------- common/libzkp/impl/Cargo.toml | 5 +- common/libzkp/impl/src/batch.rs | 69 ------ common/libzkp/impl/src/chunk.rs | 63 ------ common/libzkp/impl/src/lib.rs | 65 +++++- common/libzkp/impl/src/types.rs | 22 -- common/libzkp/impl/src/verifier.rs | 80 +++++++ common/libzkp/impl/src/verifier/darwin.rs | 48 ++++ common/libzkp/impl/src/verifier/darwin_v2.rs | 48 ++++ common/libzkp/interface/libzkp.h | 5 +- common/types/message/message.go | 8 +- coordinator/cmd/api/app/mock_app.go | 20 +- coordinator/conf/config.json | 20 +- coordinator/go.mod | 9 +- coordinator/go.sum | 4 +- coordinator/internal/config/config.go | 20 +- coordinator/internal/controller/api/auth.go | 35 +-- .../internal/controller/api/get_task.go | 4 - coordinator/internal/logic/auth/login.go | 66 +++--- .../logic/provertask/batch_prover_task.go | 54 ++++- .../logic/provertask/bundle_prover_task.go | 7 + .../logic/provertask/chunk_prover_task.go | 7 + .../internal/logic/provertask/prover_task.go | 7 + .../logic/submitproof/proof_receiver.go | 2 +- .../logic/verifier/legacy_vk/agg_vk.vkey | Bin 296 -> 0 bytes .../logic/verifier/legacy_vk/chunk_vk.vkey | Bin 232 -> 0 bytes .../logic/verifier/legacy_vk/upgrade_vks.sh | 11 - coordinator/internal/logic/verifier/mock.go | 6 +- coordinator/internal/logic/verifier/types.go | 6 +- .../internal/logic/verifier/verifier.go | 106 ++++++--- .../internal/logic/verifier/verifier_test.go | 10 +- coordinator/internal/orm/batch.go | 16 ++ coordinator/internal/orm/l2_block.go | 49 ++++ coordinator/internal/orm/prover_task.go | 19 -- coordinator/internal/types/auth.go | 46 +--- coordinator/internal/types/auth_test.go | 9 +- coordinator/internal/types/get_task.go | 1 - coordinator/test/api_test.go | 58 +++-- coordinator/test/mock_prover.go | 2 +- database/migrate/migrate_test.go | 6 +- .../00024_add_blob_bytes_to_batch.sql | 15 ++ go.work.sum | 87 +++++++- prover/Cargo.lock | 206 +++++++++-------- prover/Cargo.toml | 2 +- prover/config.json | 2 +- prover/src/zk_circuits_handler.rs | 18 +- prover/src/zk_circuits_handler/darwin.rs | 6 +- .../{curie.rs => darwin_v2.rs} | 192 ++++++++++++---- rollup/internal/orm/batch.go | 2 + rollup/internal/utils/utils.go | 3 + 53 files changed, 1108 insertions(+), 683 deletions(-) delete mode 100644 common/libzkp/impl/src/batch.rs delete mode 100644 common/libzkp/impl/src/chunk.rs delete mode 100644 common/libzkp/impl/src/types.rs create mode 100644 common/libzkp/impl/src/verifier.rs create mode 100644 common/libzkp/impl/src/verifier/darwin.rs create mode 100644 common/libzkp/impl/src/verifier/darwin_v2.rs delete mode 100644 coordinator/internal/logic/verifier/legacy_vk/agg_vk.vkey delete mode 100644 coordinator/internal/logic/verifier/legacy_vk/chunk_vk.vkey delete mode 100755 coordinator/internal/logic/verifier/legacy_vk/upgrade_vks.sh create mode 100644 database/migrate/migrations/00024_add_blob_bytes_to_batch.sql rename prover/src/zk_circuits_handler/{curie.rs => darwin_v2.rs} (65%) diff --git a/Makefile b/Makefile index 180c8dffa4..4acadad37f 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ .PHONY: fmt dev_docker build_test_docker run_test_docker clean update -L2GETH_TAG=scroll-v5.5.1 +L2GETH_TAG=scroll-v5.6.3 help: ## Display this help message @grep -h \ @@ -40,8 +40,8 @@ fmt: ## Format the code dev_docker: ## Build docker images for development/testing usages docker pull postgres - docker build -t scroll_l1geth ./common/testcontainers/docker/l1geth/ - docker build -t scroll_l2geth ./common/testcontainers/docker/l2geth/ + docker build -t scroll_l1geth --platform linux/amd64 ./common/testcontainers/docker/l1geth/ + docker build -t scroll_l2geth --platform linux/amd64 ./common/testcontainers/docker/l2geth/ clean: ## Empty out the bin folder @rm -rf build/bin diff --git a/common/forks/forks.go b/common/forks/forks.go index 2fa0195493..83f31ae021 100644 --- a/common/forks/forks.go +++ b/common/forks/forks.go @@ -19,7 +19,7 @@ func GetHardforkName(config *params.ChainConfig, blockHeight, blockTimestamp uin } else if !config.IsDarwinV2(blockTimestamp) { return "darwin" } else { - return "darwinv2" + return "darwinV2" } } diff --git a/common/libzkp/e2e-test.sh b/common/libzkp/e2e-test.sh index c4dbe9c1fc..a46a979f53 100644 --- a/common/libzkp/e2e-test.sh +++ b/common/libzkp/e2e-test.sh @@ -6,6 +6,8 @@ export RUST_BACKTRACE=full export RUST_LOG=debug export RUST_MIN_STACK=100000000 export PROVER_OUTPUT_DIR=test_zkp_test +export SCROLL_PROVER_ASSETS_DIR=/assets/test_assets +export DARWIN_V2_TEST_DIR=/assets #export LD_LIBRARY_PATH=/:/usr/local/cuda/lib64 mkdir -p $PROVER_OUTPUT_DIR @@ -13,32 +15,16 @@ mkdir -p $PROVER_OUTPUT_DIR REPO=$(realpath ../..) function build_test_bins() { - cd impl - cargo build --release - ln -f -s $(realpath target/release/libzkp.so) $REPO/prover/core/lib - ln -f -s $(realpath target/release/libzkp.so) $REPO/coordinator/internal/logic/verifier/lib cd $REPO/prover - go test -tags="gpu ffi" -timeout 0 -c core/prover_test.go + make tests_binary cd $REPO/coordinator - go test -tags="gpu ffi" -timeout 0 -c ./internal/logic/verifier - cd $REPO/common/libzkp -} - -function build_test_bins_old() { - cd $REPO - cd prover - make libzkp - go test -tags="gpu ffi" -timeout 0 -c core/prover_test.go - cd .. - cd coordinator make libzkp go test -tags="gpu ffi" -timeout 0 -c ./internal/logic/verifier - cd .. - cd common/libzkp + cd $REPO/common/libzkp } build_test_bins -#rm -rf test_zkp_test/* +rm -rf $PROVER_OUTPUT_DIR/* #rm -rf prover.log verifier.log -#$REPO/prover/core.test -test.v 2>&1 | tee prover.log +$REPO/prover/prover.test --exact zk_circuits_handler::darwin_v2::tests::test_circuits 2>&1 | tee prover.log $REPO/coordinator/verifier.test -test.v 2>&1 | tee verifier.log diff --git a/common/libzkp/impl/Cargo.lock b/common/libzkp/impl/Cargo.lock index c3fbb88a7f..2df231e2b5 100644 --- a/common/libzkp/impl/Cargo.lock +++ b/common/libzkp/impl/Cargo.lock @@ -30,8 +30,8 @@ dependencies = [ [[package]] name = "aggregator" -version = "0.11.0" -source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.11.4#38a68e22d3d8449bd39a50c22da55b9e741de453" +version = "0.12.0" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.12.0#6a1f65a1f99429f3725ef4d6788f5643bb61aa6f" dependencies = [ "ark-std 0.3.0", "bitstream-io", @@ -39,9 +39,9 @@ dependencies = [ "ctor", "encoder", "env_logger 0.10.0", - "eth-types 0.11.0", + "eth-types 0.12.0", "ethers-core", - "gadgets 0.11.0", + "gadgets 0.12.0", "halo2-base", "halo2-ecc", "halo2_proofs", @@ -59,13 +59,13 @@ dependencies = [ "snark-verifier-sdk", "strum 0.25.0", "strum_macros 0.25.3", - "zkevm-circuits 0.11.0", + "zkevm-circuits 0.12.0", ] [[package]] name = "aggregator" -version = "0.12.0" -source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.12.0#6a1f65a1f99429f3725ef4d6788f5643bb61aa6f" +version = "0.13.0" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.13.0#cf71a0e324d42f7895363f4f3e8575d79bb7ea97" dependencies = [ "ark-std 0.3.0", "bitstream-io", @@ -73,9 +73,9 @@ dependencies = [ "ctor", "encoder", "env_logger 0.10.0", - "eth-types 0.12.0", + "eth-types 0.13.0", "ethers-core", - "gadgets 0.12.0", + "gadgets 0.13.0", "halo2-base", "halo2-ecc", "halo2_proofs", @@ -93,7 +93,7 @@ dependencies = [ "snark-verifier-sdk", "strum 0.25.0", "strum_macros 0.25.3", - "zkevm-circuits 0.12.0", + "zkevm-circuits 0.13.0", ] [[package]] @@ -171,9 +171,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.72" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b13c32d80ecc7ab747b80c3784bce54ee8a7a0cc4fbda9bf4cda2cf6fe90854" +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" [[package]] name = "arc-swap" @@ -570,24 +570,22 @@ checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" [[package]] name = "bus-mapping" -version = "0.11.0" -source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.11.4#38a68e22d3d8449bd39a50c22da55b9e741de453" +version = "0.12.0" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.12.0#6a1f65a1f99429f3725ef4d6788f5643bb61aa6f" dependencies = [ - "eth-types 0.11.0", + "eth-types 0.12.0", "ethers-core", "ethers-providers", "ethers-signers", - "external-tracer 0.11.0", - "gadgets 0.11.0", + "gadgets 0.12.0", "halo2_proofs", "hex", "itertools 0.11.0", "log", - "mock 0.11.0", - "mpt-zktrie 0.11.0", + "mock 0.12.0", + "mpt-zktrie 0.12.0", "num", "poseidon-circuit", - "rand", "revm-precompile", "serde", "serde_json", @@ -597,20 +595,20 @@ dependencies = [ [[package]] name = "bus-mapping" -version = "0.12.0" -source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.12.0#6a1f65a1f99429f3725ef4d6788f5643bb61aa6f" +version = "0.13.0" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.13.0#cf71a0e324d42f7895363f4f3e8575d79bb7ea97" dependencies = [ - "eth-types 0.12.0", + "eth-types 0.13.0", "ethers-core", "ethers-providers", "ethers-signers", - "gadgets 0.12.0", + "gadgets 0.13.0", "halo2_proofs", "hex", "itertools 0.11.0", "log", - "mock 0.12.0", - "mpt-zktrie 0.12.0", + "mock 0.13.0", + "mpt-zktrie 0.13.0", "num", "poseidon-circuit", "revm-precompile", @@ -1184,8 +1182,8 @@ dependencies = [ [[package]] name = "eth-types" -version = "0.11.0" -source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.11.4#38a68e22d3d8449bd39a50c22da55b9e741de453" +version = "0.12.0" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.12.0#6a1f65a1f99429f3725ef4d6788f5643bb61aa6f" dependencies = [ "base64 0.13.1", "ethers-core", @@ -1202,7 +1200,6 @@ dependencies = [ "revm-primitives", "serde", "serde_json", - "serde_stacker", "serde_with", "sha3 0.10.8", "strum 0.25.0", @@ -1213,8 +1210,8 @@ dependencies = [ [[package]] name = "eth-types" -version = "0.12.0" -source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.12.0#6a1f65a1f99429f3725ef4d6788f5643bb61aa6f" +version = "0.13.0" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.13.0#cf71a0e324d42f7895363f4f3e8575d79bb7ea97" dependencies = [ "base64 0.13.1", "ethers-core", @@ -1369,11 +1366,11 @@ dependencies = [ [[package]] name = "external-tracer" -version = "0.11.0" -source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.11.4#38a68e22d3d8449bd39a50c22da55b9e741de453" +version = "0.12.0" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.12.0#6a1f65a1f99429f3725ef4d6788f5643bb61aa6f" dependencies = [ - "eth-types 0.11.0", - "geth-utils 0.11.0", + "eth-types 0.12.0", + "geth-utils 0.12.0", "log", "serde", "serde_json", @@ -1382,11 +1379,11 @@ dependencies = [ [[package]] name = "external-tracer" -version = "0.12.0" -source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.12.0#6a1f65a1f99429f3725ef4d6788f5643bb61aa6f" +version = "0.13.0" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.13.0#cf71a0e324d42f7895363f4f3e8575d79bb7ea97" dependencies = [ - "eth-types 0.12.0", - "geth-utils 0.12.0", + "eth-types 0.13.0", + "geth-utils 0.13.0", "log", "serde", "serde_json", @@ -1564,10 +1561,10 @@ dependencies = [ [[package]] name = "gadgets" -version = "0.11.0" -source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.11.4#38a68e22d3d8449bd39a50c22da55b9e741de453" +version = "0.12.0" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.12.0#6a1f65a1f99429f3725ef4d6788f5643bb61aa6f" dependencies = [ - "eth-types 0.11.0", + "eth-types 0.12.0", "halo2_proofs", "poseidon-base", "sha3 0.10.8", @@ -1576,10 +1573,10 @@ dependencies = [ [[package]] name = "gadgets" -version = "0.12.0" -source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.12.0#6a1f65a1f99429f3725ef4d6788f5643bb61aa6f" +version = "0.13.0" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.13.0#cf71a0e324d42f7895363f4f3e8575d79bb7ea97" dependencies = [ - "eth-types 0.12.0", + "eth-types 0.13.0", "halo2_proofs", "poseidon-base", "sha3 0.10.8", @@ -1599,8 +1596,8 @@ dependencies = [ [[package]] name = "geth-utils" -version = "0.11.0" -source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.11.4#38a68e22d3d8449bd39a50c22da55b9e741de453" +version = "0.12.0" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.12.0#6a1f65a1f99429f3725ef4d6788f5643bb61aa6f" dependencies = [ "env_logger 0.10.0", "gobuild", @@ -1609,8 +1606,8 @@ dependencies = [ [[package]] name = "geth-utils" -version = "0.12.0" -source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.12.0#6a1f65a1f99429f3725ef4d6788f5643bb61aa6f" +version = "0.13.0" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.13.0#cf71a0e324d42f7895363f4f3e8575d79bb7ea97" dependencies = [ "env_logger 0.10.0", "gobuild", @@ -2358,13 +2355,13 @@ dependencies = [ [[package]] name = "mock" -version = "0.11.0" -source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.11.4#38a68e22d3d8449bd39a50c22da55b9e741de453" +version = "0.12.0" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.12.0#6a1f65a1f99429f3725ef4d6788f5643bb61aa6f" dependencies = [ - "eth-types 0.11.0", + "eth-types 0.12.0", "ethers-core", "ethers-signers", - "external-tracer 0.11.0", + "external-tracer 0.12.0", "itertools 0.11.0", "log", "rand", @@ -2373,13 +2370,13 @@ dependencies = [ [[package]] name = "mock" -version = "0.12.0" -source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.12.0#6a1f65a1f99429f3725ef4d6788f5643bb61aa6f" +version = "0.13.0" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.13.0#cf71a0e324d42f7895363f4f3e8575d79bb7ea97" dependencies = [ - "eth-types 0.12.0", + "eth-types 0.13.0", "ethers-core", "ethers-signers", - "external-tracer 0.12.0", + "external-tracer 0.13.0", "itertools 0.11.0", "log", "rand", @@ -2388,30 +2385,30 @@ dependencies = [ [[package]] name = "mpt-zktrie" -version = "0.11.0" -source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.11.4#38a68e22d3d8449bd39a50c22da55b9e741de453" +version = "0.12.0" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.12.0#6a1f65a1f99429f3725ef4d6788f5643bb61aa6f" dependencies = [ - "eth-types 0.11.0", + "eth-types 0.12.0", "halo2curves", "hex", "log", "num-bigint", "poseidon-base", - "zktrie", + "zktrie 0.3.0 (git+https://github.com/scroll-tech/zktrie.git?branch=main)", ] [[package]] name = "mpt-zktrie" -version = "0.12.0" -source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.12.0#6a1f65a1f99429f3725ef4d6788f5643bb61aa6f" +version = "0.13.0" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.13.0#cf71a0e324d42f7895363f4f3e8575d79bb7ea97" dependencies = [ - "eth-types 0.12.0", + "eth-types 0.13.0", "halo2curves", "hex", "log", "num-bigint", "poseidon-base", - "zktrie", + "zktrie 0.3.0 (git+https://github.com/scroll-tech/zktrie.git?branch=v0.9)", ] [[package]] @@ -2874,17 +2871,17 @@ dependencies = [ [[package]] name = "prover" -version = "0.11.0" -source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.11.4#38a68e22d3d8449bd39a50c22da55b9e741de453" +version = "0.12.0" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.12.0#6a1f65a1f99429f3725ef4d6788f5643bb61aa6f" dependencies = [ - "aggregator 0.11.0", + "aggregator 0.12.0", "anyhow", "base64 0.13.1", "blake2", - "bus-mapping 0.11.0", + "bus-mapping 0.12.0", "chrono", "dotenvy", - "eth-types 0.11.0", + "eth-types 0.12.0", "ethers-core", "git-version", "halo2_proofs", @@ -2892,7 +2889,7 @@ dependencies = [ "itertools 0.11.0", "log", "log4rs", - "mpt-zktrie 0.11.0", + "mpt-zktrie 0.12.0", "num-bigint", "rand", "rand_xorshift", @@ -2903,22 +2900,22 @@ dependencies = [ "sha2", "snark-verifier", "snark-verifier-sdk", - "zkevm-circuits 0.11.0", + "zkevm-circuits 0.12.0", ] [[package]] name = "prover" -version = "0.12.0" -source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.12.0#6a1f65a1f99429f3725ef4d6788f5643bb61aa6f" +version = "0.13.0" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.13.0#cf71a0e324d42f7895363f4f3e8575d79bb7ea97" dependencies = [ - "aggregator 0.12.0", + "aggregator 0.13.0", "anyhow", "base64 0.13.1", "blake2", - "bus-mapping 0.12.0", + "bus-mapping 0.13.0", "chrono", "dotenvy", - "eth-types 0.12.0", + "eth-types 0.13.0", "ethers-core", "git-version", "halo2_proofs", @@ -2926,7 +2923,7 @@ dependencies = [ "itertools 0.11.0", "log", "log4rs", - "mpt-zktrie 0.12.0", + "mpt-zktrie 0.13.0", "num-bigint", "rand", "rand_xorshift", @@ -2937,7 +2934,7 @@ dependencies = [ "sha2", "snark-verifier", "snark-verifier-sdk", - "zkevm-circuits 0.12.0", + "zkevm-circuits 0.13.0", ] [[package]] @@ -4545,18 +4542,18 @@ dependencies = [ [[package]] name = "zkevm-circuits" -version = "0.11.0" -source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.11.4#38a68e22d3d8449bd39a50c22da55b9e741de453" +version = "0.12.0" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.12.0#6a1f65a1f99429f3725ef4d6788f5643bb61aa6f" dependencies = [ "array-init", - "bus-mapping 0.11.0", + "bus-mapping 0.12.0", "either", "env_logger 0.10.0", - "eth-types 0.11.0", + "eth-types 0.12.0", "ethers-core", "ethers-signers", "ff", - "gadgets 0.11.0", + "gadgets 0.12.0", "halo2-base", "halo2-ecc", "halo2-mpt-circuits", @@ -4566,8 +4563,8 @@ dependencies = [ "itertools 0.11.0", "log", "misc-precompiled-circuit", - "mock 0.11.0", - "mpt-zktrie 0.11.0", + "mock 0.12.0", + "mpt-zktrie 0.12.0", "num", "num-bigint", "poseidon-circuit", @@ -4587,18 +4584,18 @@ dependencies = [ [[package]] name = "zkevm-circuits" -version = "0.12.0" -source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.12.0#6a1f65a1f99429f3725ef4d6788f5643bb61aa6f" +version = "0.13.0" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.13.0#cf71a0e324d42f7895363f4f3e8575d79bb7ea97" dependencies = [ "array-init", - "bus-mapping 0.12.0", + "bus-mapping 0.13.0", "either", "env_logger 0.10.0", - "eth-types 0.12.0", + "eth-types 0.13.0", "ethers-core", "ethers-signers", "ff", - "gadgets 0.12.0", + "gadgets 0.13.0", "halo2-base", "halo2-ecc", "halo2-mpt-circuits", @@ -4608,8 +4605,8 @@ dependencies = [ "itertools 0.11.0", "log", "misc-precompiled-circuit", - "mock 0.12.0", - "mpt-zktrie 0.12.0", + "mock 0.13.0", + "mpt-zktrie 0.13.0", "num", "num-bigint", "poseidon-circuit", @@ -4631,14 +4628,15 @@ dependencies = [ name = "zkp" version = "0.1.0" dependencies = [ + "anyhow", "base64 0.13.1", "env_logger 0.9.3", "halo2_proofs", "libc", "log", "once_cell", - "prover 0.11.0", "prover 0.12.0", + "prover 0.13.0", "serde", "serde_derive", "serde_json", @@ -4651,7 +4649,16 @@ version = "0.3.0" source = "git+https://github.com/scroll-tech/zktrie.git?branch=main#23181f209e94137f74337b150179aeb80c72e7c8" dependencies = [ "gobuild", - "zktrie_rust", + "zktrie_rust 0.3.0 (git+https://github.com/scroll-tech/zktrie.git?branch=main)", +] + +[[package]] +name = "zktrie" +version = "0.3.0" +source = "git+https://github.com/scroll-tech/zktrie.git?branch=v0.9#460b8c22af65b7809164548cba1e0253b6db5a70" +dependencies = [ + "gobuild", + "zktrie_rust 0.3.0 (git+https://github.com/scroll-tech/zktrie.git?branch=v0.9)", ] [[package]] @@ -4668,6 +4675,20 @@ dependencies = [ "strum_macros 0.24.3", ] +[[package]] +name = "zktrie_rust" +version = "0.3.0" +source = "git+https://github.com/scroll-tech/zktrie.git?branch=v0.9#460b8c22af65b7809164548cba1e0253b6db5a70" +dependencies = [ + "hex", + "lazy_static", + "num", + "num-derive", + "num-traits", + "strum 0.24.1", + "strum_macros 0.24.3", +] + [[package]] name = "zstd" version = "0.13.0" diff --git a/common/libzkp/impl/Cargo.toml b/common/libzkp/impl/Cargo.toml index 99de99359d..6d4447bb54 100644 --- a/common/libzkp/impl/Cargo.toml +++ b/common/libzkp/impl/Cargo.toml @@ -24,10 +24,10 @@ bls12_381 = { git = "https://github.com/scroll-tech/bls12_381", branch = "feat/i halo2_proofs = { git = "https://github.com/scroll-tech/halo2.git", branch = "v1.1" } snark-verifier-sdk = { git = "https://github.com/scroll-tech/snark-verifier", branch = "develop", default-features = false, features = ["loader_halo2", "loader_evm", "halo2-pse"] } -# curie -prover_v3 = { git = "https://github.com/scroll-tech/zkevm-circuits.git", tag = "v0.11.4", package = "prover", default-features = false, features = ["parallel_syn", "scroll"] } # darwin prover_v4 = { git = "https://github.com/scroll-tech/zkevm-circuits.git", tag = "v0.12.0", package = "prover", default-features = false, features = ["parallel_syn", "scroll"] } +# darwin_v2 +prover_v5 = { git = "https://github.com/scroll-tech/zkevm-circuits.git", tag = "v0.13.0", package = "prover", default-features = false, features = ["parallel_syn", "scroll"] } base64 = "0.13.0" env_logger = "0.9.0" @@ -37,6 +37,7 @@ once_cell = "1.19" serde = "1.0" serde_derive = "1.0" serde_json = "1.0.66" +anyhow = "1.0.86" [profile.test] opt-level = 3 diff --git a/common/libzkp/impl/src/batch.rs b/common/libzkp/impl/src/batch.rs deleted file mode 100644 index 9f1252c2cc..0000000000 --- a/common/libzkp/impl/src/batch.rs +++ /dev/null @@ -1,69 +0,0 @@ -use crate::utils::{c_char_to_str, c_char_to_vec, panic_catch}; -use libc::c_char; -use prover_v3::BatchProof as BatchProofLoVersion; -use prover_v4::{ - aggregator::Verifier as VerifierHiVersion, utils::init_env_and_log, - BatchProof as BatchProofHiVersion, BundleProof, -}; -use snark_verifier_sdk::verify_evm_calldata; -use std::{cell::OnceCell, env}; - -static mut VERIFIER: OnceCell = OnceCell::new(); - -/// # Safety -#[no_mangle] -pub unsafe extern "C" fn init_batch_verifier(params_dir: *const c_char, assets_dir: *const c_char) { - init_env_and_log("ffi_batch_verify"); - - let params_dir = c_char_to_str(params_dir); - let assets_dir = c_char_to_str(assets_dir); - - // TODO: add a settings in scroll-prover. - env::set_var("SCROLL_PROVER_ASSETS_DIR", assets_dir); - let verifier_hi = VerifierHiVersion::from_dirs(params_dir, assets_dir); - - VERIFIER.set(verifier_hi).unwrap(); -} - -/// # Safety -#[no_mangle] -pub unsafe extern "C" fn verify_batch_proof( - proof: *const c_char, - fork_name: *const c_char, -) -> c_char { - let proof = c_char_to_vec(proof); - let fork_name_str = c_char_to_str(fork_name); - let fork_id = match fork_name_str { - "curie" => 3, - "darwin" => 4, - _ => { - log::warn!("unexpected fork_name {fork_name_str}, treated as darwin"); - 4 - } - }; - let verified = panic_catch(|| { - if fork_id == 3 { - // As of upgrade #3 (Curie), we verify batch proofs on-chain (EVM). - let proof = serde_json::from_slice::(proof.as_slice()).unwrap(); - verify_evm_calldata( - include_bytes!("plonk_verifier_0.11.4.bin").to_vec(), - proof.calldata(), - ) - } else { - // Post upgrade #4 (Darwin), batch proofs are not EVM-verifiable. Instead they are - // halo2 proofs meant to be bundled recursively. - let proof = serde_json::from_slice::(proof.as_slice()).unwrap(); - VERIFIER.get().unwrap().verify_batch_proof(&proof) - } - }); - verified.unwrap_or(false) as c_char -} - -/// # Safety -#[no_mangle] -pub unsafe extern "C" fn verify_bundle_proof(proof: *const c_char) -> c_char { - let proof = c_char_to_vec(proof); - let proof = serde_json::from_slice::(proof.as_slice()).unwrap(); - let verified = panic_catch(|| VERIFIER.get().unwrap().verify_bundle_proof(proof)); - verified.unwrap_or(false) as c_char -} diff --git a/common/libzkp/impl/src/chunk.rs b/common/libzkp/impl/src/chunk.rs deleted file mode 100644 index 086b4f03a5..0000000000 --- a/common/libzkp/impl/src/chunk.rs +++ /dev/null @@ -1,63 +0,0 @@ -use crate::utils::{c_char_to_str, c_char_to_vec, panic_catch}; -use libc::c_char; -use prover_v3::{zkevm::Verifier as VerifierLoVersion, ChunkProof as ChunkProofLoVersion}; -use prover_v4::{ - utils::init_env_and_log, zkevm::Verifier as VerifierHiVersion, - ChunkProof as ChunkProofHiVersion, -}; -use std::{cell::OnceCell, env}; - -static mut VERIFIER_LO_VERSION: OnceCell = OnceCell::new(); -static mut VERIFIER_HI_VERSION: OnceCell = OnceCell::new(); - -/// # Safety -#[no_mangle] -pub unsafe extern "C" fn init_chunk_verifier( - params_dir: *const c_char, - v3_assets_dir: *const c_char, - v4_assets_dir: *const c_char, -) { - init_env_and_log("ffi_chunk_verify"); - - let params_dir = c_char_to_str(params_dir); - let v3_assets_dir = c_char_to_str(v3_assets_dir); - let v4_assets_dir = c_char_to_str(v4_assets_dir); - - // TODO: add a settings in scroll-prover. - env::set_var("SCROLL_PROVER_ASSETS_DIR", v3_assets_dir); - let verifier_lo = VerifierLoVersion::from_dirs(params_dir, v3_assets_dir); - env::set_var("SCROLL_PROVER_ASSETS_DIR", v4_assets_dir); - let verifier_hi = VerifierHiVersion::from_dirs(params_dir, v4_assets_dir); - - VERIFIER_LO_VERSION.set(verifier_lo).unwrap(); - VERIFIER_HI_VERSION.set(verifier_hi).unwrap(); -} - -/// # Safety -#[no_mangle] -pub unsafe extern "C" fn verify_chunk_proof( - proof: *const c_char, - fork_name: *const c_char, -) -> c_char { - let proof = c_char_to_vec(proof); - - let fork_name_str = c_char_to_str(fork_name); - let fork_id = match fork_name_str { - "curie" => 3, - "darwin" => 4, - _ => { - log::warn!("unexpected fork_name {fork_name_str}, treated as darwin"); - 4 - } - }; - let verified = panic_catch(|| { - if fork_id == 3 { - let proof = serde_json::from_slice::(proof.as_slice()).unwrap(); - VERIFIER_LO_VERSION.get().unwrap().verify_chunk_proof(proof) - } else { - let proof = serde_json::from_slice::(proof.as_slice()).unwrap(); - VERIFIER_HI_VERSION.get().unwrap().verify_chunk_proof(proof) - } - }); - verified.unwrap_or(false) as c_char -} diff --git a/common/libzkp/impl/src/lib.rs b/common/libzkp/impl/src/lib.rs index 674b696b90..b15857d5a9 100644 --- a/common/libzkp/impl/src/lib.rs +++ b/common/libzkp/impl/src/lib.rs @@ -1,4 +1,63 @@ -mod batch; -mod chunk; -mod types; mod utils; +mod verifier; + +use crate::utils::{c_char_to_str, c_char_to_vec}; +use libc::c_char; +use prover_v5::utils::init_env_and_log; +use verifier::{TaskType, VerifierConfig}; + +/// # Safety +#[no_mangle] +pub unsafe extern "C" fn init(config: *const c_char) { + init_env_and_log("ffi_init"); + + let config_str = c_char_to_str(config); + let verifier_config = serde_json::from_str::(config_str).unwrap(); + verifier::init(verifier_config); +} + +/// # Safety +#[no_mangle] +pub unsafe extern "C" fn verify_chunk_proof( + proof: *const c_char, + fork_name: *const c_char, +) -> c_char { + verify_proof(proof, fork_name, TaskType::Chunk) +} + +fn verify_proof(proof: *const c_char, fork_name: *const c_char, task_type: TaskType) -> c_char { + let proof = c_char_to_vec(proof); + + let fork_name_str = c_char_to_str(fork_name); + let verifier = verifier::get_verifier(fork_name_str); + + if let Err(e) = verifier { + log::warn!("failed to get verifier, error: {:#}", e); + return 0 as c_char; + } + match verifier.unwrap().verify(task_type, proof) { + Err(e) => { + log::error!("{:?} verify failed, error: {:#}", task_type, e); + false as c_char + } + Ok(result) => result as c_char, + } +} + +/// # Safety +#[no_mangle] +pub unsafe extern "C" fn verify_batch_proof( + proof: *const c_char, + fork_name: *const c_char, +) -> c_char { + verify_proof(proof, fork_name, TaskType::Batch) +} + +/// # Safety +#[no_mangle] +pub unsafe extern "C" fn verify_bundle_proof( + proof: *const c_char, + fork_name: *const c_char, +) -> c_char { + verify_proof(proof, fork_name, TaskType::Bundle) +} diff --git a/common/libzkp/impl/src/types.rs b/common/libzkp/impl/src/types.rs deleted file mode 100644 index 1d066a4282..0000000000 --- a/common/libzkp/impl/src/types.rs +++ /dev/null @@ -1,22 +0,0 @@ -use serde::{Deserialize, Serialize}; - -// Represents the result of a chunk proof checking operation. -// `ok` indicates whether the proof checking was successful. -// `error` provides additional details in case the check failed. -#[derive(Debug, Clone, Deserialize, Serialize)] -pub struct CheckChunkProofsResponse { - pub ok: bool, - #[serde(skip_serializing_if = "Option::is_none")] - pub error: Option, -} - -// Encapsulates the result from generating a proof. -// `message` holds the generated proof in byte slice format. -// `error` provides additional details in case the proof generation failed. -#[derive(Debug, Clone, Deserialize, Serialize)] -pub struct ProofResult { - #[serde(skip_serializing_if = "Option::is_none")] - pub message: Option>, - #[serde(skip_serializing_if = "Option::is_none")] - pub error: Option, -} diff --git a/common/libzkp/impl/src/verifier.rs b/common/libzkp/impl/src/verifier.rs new file mode 100644 index 0000000000..a25e42123b --- /dev/null +++ b/common/libzkp/impl/src/verifier.rs @@ -0,0 +1,80 @@ +mod darwin; +mod darwin_v2; + +use anyhow::{bail, Result}; +use darwin::DarwinVerifier; +use darwin_v2::DarwinV2Verifier; +use serde::{Deserialize, Serialize}; +use std::{cell::OnceCell, rc::Rc}; + +#[derive(Debug, Clone, Copy, PartialEq)] +pub enum TaskType { + Chunk, + Batch, + Bundle, +} + +pub trait ProofVerifier { + fn verify(&self, task_type: TaskType, proof: Vec) -> Result; +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct CircuitConfig { + pub fork_name: String, + pub params_path: String, + pub assets_path: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct VerifierConfig { + pub low_version_circuit: CircuitConfig, + pub high_version_circuit: CircuitConfig, +} + +type HardForkName = String; + +struct VerifierPair(HardForkName, Rc>); + +static mut VERIFIER_HIGH: OnceCell = OnceCell::new(); +static mut VERIFIER_LOW: OnceCell = OnceCell::new(); + +pub fn init(config: VerifierConfig) { + let low_conf = config.low_version_circuit; + let verifier = DarwinVerifier::new(&low_conf.params_path, &low_conf.assets_path); + + unsafe { + VERIFIER_LOW + .set(VerifierPair( + low_conf.fork_name, + Rc::new(Box::new(verifier)), + )) + .unwrap_unchecked(); + } + let high_conf = config.high_version_circuit; + let verifier = DarwinV2Verifier::new(&high_conf.params_path, &high_conf.assets_path); + unsafe { + VERIFIER_HIGH + .set(VerifierPair( + high_conf.fork_name, + Rc::new(Box::new(verifier)), + )) + .unwrap_unchecked(); + } +} + +pub fn get_verifier(fork_name: &str) -> Result>> { + unsafe { + if let Some(verifier) = VERIFIER_LOW.get() { + if verifier.0 == fork_name { + return Ok(verifier.1.clone()); + } + } + + if let Some(verifier) = VERIFIER_HIGH.get() { + if verifier.0 == fork_name { + return Ok(verifier.1.clone()); + } + } + } + bail!("failed to get verifier, key not found, {}", fork_name) +} diff --git a/common/libzkp/impl/src/verifier/darwin.rs b/common/libzkp/impl/src/verifier/darwin.rs new file mode 100644 index 0000000000..9119b9b03d --- /dev/null +++ b/common/libzkp/impl/src/verifier/darwin.rs @@ -0,0 +1,48 @@ +use super::{ProofVerifier, TaskType}; + +use anyhow::Result; + +use crate::utils::panic_catch; +use prover_v4::{ + aggregator::Verifier as AggVerifier, zkevm::Verifier, BatchProof, BundleProof, ChunkProof, +}; +use std::env; + +pub struct DarwinVerifier { + verifier: Verifier, + agg_verifier: AggVerifier, +} + +impl DarwinVerifier { + pub fn new(params_dir: &str, assets_dir: &str) -> Self { + env::set_var("SCROLL_PROVER_ASSETS_DIR", assets_dir); + let verifier = Verifier::from_dirs(params_dir, assets_dir); + + let agg_verifier = AggVerifier::from_dirs(params_dir, assets_dir); + + Self { + verifier, + agg_verifier, + } + } +} + +impl ProofVerifier for DarwinVerifier { + fn verify(&self, task_type: super::TaskType, proof: Vec) -> Result { + let result = panic_catch(|| match task_type { + TaskType::Chunk => { + let proof = serde_json::from_slice::(proof.as_slice()).unwrap(); + self.verifier.verify_chunk_proof(proof) + } + TaskType::Batch => { + let proof = serde_json::from_slice::(proof.as_slice()).unwrap(); + self.agg_verifier.verify_batch_proof(&proof) + } + TaskType::Bundle => { + let proof = serde_json::from_slice::(proof.as_slice()).unwrap(); + self.agg_verifier.verify_bundle_proof(proof) + } + }); + result.map_err(|e| anyhow::anyhow!(e)) + } +} diff --git a/common/libzkp/impl/src/verifier/darwin_v2.rs b/common/libzkp/impl/src/verifier/darwin_v2.rs new file mode 100644 index 0000000000..dadc075890 --- /dev/null +++ b/common/libzkp/impl/src/verifier/darwin_v2.rs @@ -0,0 +1,48 @@ +use super::{ProofVerifier, TaskType}; + +use anyhow::Result; + +use crate::utils::panic_catch; +use prover_v5::{ + aggregator::Verifier as AggVerifier, zkevm::Verifier, BatchProof, BundleProof, ChunkProof, +}; +use std::env; + +pub struct DarwinV2Verifier { + verifier: Verifier, + agg_verifier: AggVerifier, +} + +impl DarwinV2Verifier { + pub fn new(params_dir: &str, assets_dir: &str) -> Self { + env::set_var("SCROLL_PROVER_ASSETS_DIR", assets_dir); + let verifier = Verifier::from_dirs(params_dir, assets_dir); + + let agg_verifier = AggVerifier::from_dirs(params_dir, assets_dir); + + Self { + verifier, + agg_verifier, + } + } +} + +impl ProofVerifier for DarwinV2Verifier { + fn verify(&self, task_type: super::TaskType, proof: Vec) -> Result { + let result = panic_catch(|| match task_type { + TaskType::Chunk => { + let proof = serde_json::from_slice::(proof.as_slice()).unwrap(); + self.verifier.verify_chunk_proof(proof) + } + TaskType::Batch => { + let proof = serde_json::from_slice::(proof.as_slice()).unwrap(); + self.agg_verifier.verify_batch_proof(&proof) + } + TaskType::Bundle => { + let proof = serde_json::from_slice::(proof.as_slice()).unwrap(); + self.agg_verifier.verify_bundle_proof(proof) + } + }); + result.map_err(|e| anyhow::anyhow!(e)) + } +} diff --git a/common/libzkp/interface/libzkp.h b/common/libzkp/interface/libzkp.h index 3b8c359a60..51fee4f2ed 100644 --- a/common/libzkp/interface/libzkp.h +++ b/common/libzkp/interface/libzkp.h @@ -1,11 +1,10 @@ // BatchVerifier is used to: // - Verify a batch proof // - Verify a bundle proof -void init_batch_verifier(char* params_dir, char* assets_dir); +void init(char* config); char verify_batch_proof(char* proof, char* fork_name); -char verify_bundle_proof(char* proof); +char verify_bundle_proof(char* proof, char* fork_name); -void init_chunk_verifier(char* params_dir, char* v3_assets_dir, char* v4_assets_dir); char verify_chunk_proof(char* proof, char* fork_name); diff --git a/common/types/message/message.go b/common/types/message/message.go index 00dd867dce..57d78a9723 100644 --- a/common/types/message/message.go +++ b/common/types/message/message.go @@ -4,7 +4,6 @@ import ( "errors" "fmt" - "github.com/scroll-tech/da-codec/encoding/codecv3" "github.com/scroll-tech/go-ethereum/common" ) @@ -52,9 +51,10 @@ type ChunkTaskDetail struct { // BatchTaskDetail is a type containing BatchTask detail. type BatchTaskDetail struct { - ChunkInfos []*ChunkInfo `json:"chunk_infos"` - ChunkProofs []*ChunkProof `json:"chunk_proofs"` - BatchHeader *codecv3.DABatch `json:"batch_header"` + ChunkInfos []*ChunkInfo `json:"chunk_infos"` + ChunkProofs []*ChunkProof `json:"chunk_proofs"` + BatchHeader interface{} `json:"batch_header"` + BlobBytes []byte `json:"blob_bytes"` } // BundleTaskDetail consists of all the information required to describe the task to generate a proof for a bundle of batches. diff --git a/coordinator/cmd/api/app/mock_app.go b/coordinator/cmd/api/app/mock_app.go index e7ad3c9007..e615cc0ee2 100644 --- a/coordinator/cmd/api/app/mock_app.go +++ b/coordinator/cmd/api/app/mock_app.go @@ -88,13 +88,25 @@ func (c *CoordinatorApp) MockConfig(store bool) error { } // Reset prover manager config for manager test cases. cfg.ProverManager = &coordinatorConfig.ProverManager{ - ProversPerSession: 1, - Verifier: &coordinatorConfig.VerifierConfig{MockMode: true}, + ProversPerSession: 1, + Verifier: &coordinatorConfig.VerifierConfig{ + MockMode: true, + LowVersionCircuit: &coordinatorConfig.CircuitConfig{ + ParamsPath: "", + AssetsPath: "", + ForkName: "darwin", + MinProverVersion: "v4.2.0", + }, + HighVersionCircuit: &coordinatorConfig.CircuitConfig{ + ParamsPath: "", + AssetsPath: "", + ForkName: "darwinV2", + MinProverVersion: "v4.3.0", + }, + }, BatchCollectionTimeSec: 60, ChunkCollectionTimeSec: 60, SessionAttempts: 10, - MaxVerifierWorkers: 4, - MinProverVersion: "v1.0.0", } endpoint, err := c.testApps.GetDBEndPoint() if err != nil { diff --git a/coordinator/conf/config.json b/coordinator/conf/config.json index 15ae708f8d..dd9cd68523 100644 --- a/coordinator/conf/config.json +++ b/coordinator/conf/config.json @@ -6,14 +6,20 @@ "batch_collection_time_sec": 180, "chunk_collection_time_sec": 180, "verifier": { - "fork_name": "bernoulli", "mock_mode": true, - "params_path": "", - "assets_path_lo": "", - "assets_path_hi": "" - }, - "max_verifier_workers": 4, - "min_prover_version": "v1.0.0" + "low_version_circuit": { + "params_path": "params", + "assets_path": "assets", + "fork_name": "darwin", + "min_prover_version": "v4.4.43-37af5ef5-38a68e2-1c5093c" + }, + "high_version_circuit": { + "params_path": "params", + "assets_path": "assets", + "fork_name": "darwinV2", + "min_prover_version": "v4.4.45" + } + } }, "db": { "driver_name": "postgres", diff --git a/coordinator/go.mod b/coordinator/go.mod index 72f8a08513..365dadbcda 100644 --- a/coordinator/go.mod +++ b/coordinator/go.mod @@ -6,7 +6,10 @@ require ( github.com/appleboy/gin-jwt/v2 v2.9.1 github.com/gin-gonic/gin v1.9.1 github.com/go-resty/resty/v2 v2.7.0 + github.com/google/uuid v1.6.0 github.com/mitchellh/mapstructure v1.5.0 + github.com/prometheus/client_golang v1.19.0 + github.com/scroll-tech/da-codec v0.0.0-20240819100936-c6af3bbe7068 github.com/scroll-tech/go-ethereum v1.10.14-0.20240626125436-418bc6f728b6 github.com/shopspring/decimal v1.3.1 github.com/stretchr/testify v1.9.0 @@ -42,12 +45,6 @@ require ( google.golang.org/protobuf v1.33.0 // indirect ) -require ( - github.com/google/uuid v1.6.0 - github.com/prometheus/client_golang v1.19.0 - github.com/scroll-tech/da-codec v0.0.0-20240730031611-1b736159d5cb -) - require ( github.com/beorn7/perks v1.0.1 // indirect github.com/bits-and-blooms/bitset v1.13.0 // indirect diff --git a/coordinator/go.sum b/coordinator/go.sum index a1f4d00c88..4e0bf490d8 100644 --- a/coordinator/go.sum +++ b/coordinator/go.sum @@ -173,8 +173,8 @@ github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjR github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/scroll-tech/da-codec v0.0.0-20240730031611-1b736159d5cb h1:uOKdmDT0LsuS3gfynEjR4zA3Ooh6p2Z3O+IMRj2r8LA= -github.com/scroll-tech/da-codec v0.0.0-20240730031611-1b736159d5cb/go.mod h1:D6XEESeNVJkQJlv3eK+FyR+ufPkgVQbJzERylQi53Bs= +github.com/scroll-tech/da-codec v0.0.0-20240819100936-c6af3bbe7068 h1:oVGwhg4cCq35B04eG/S4OBXDwXiFH7+LezuH2ZTRBPs= +github.com/scroll-tech/da-codec v0.0.0-20240819100936-c6af3bbe7068/go.mod h1:D6XEESeNVJkQJlv3eK+FyR+ufPkgVQbJzERylQi53Bs= github.com/scroll-tech/go-ethereum v1.10.14-0.20240626125436-418bc6f728b6 h1:Q8YyvrcPIcXQwE4ucm4bqmPh6TP6IB1GUTXripf2WyQ= github.com/scroll-tech/go-ethereum v1.10.14-0.20240626125436-418bc6f728b6/go.mod h1:byf/mZ8jLYUCnUePTicjJWn+RvKdxDn7buS6glTnMwQ= github.com/scroll-tech/zktrie v0.8.4 h1:UagmnZ4Z3ITCk+aUq9NQZJNAwnWl4gSxsLb2Nl7IgRE= diff --git a/coordinator/internal/config/config.go b/coordinator/internal/config/config.go index cbe9ca02d8..dd13c18091 100644 --- a/coordinator/internal/config/config.go +++ b/coordinator/internal/config/config.go @@ -23,10 +23,6 @@ type ProverManager struct { ChunkCollectionTimeSec int `json:"chunk_collection_time_sec"` // BundleCollectionTimeSec bundle Proof collection time (in seconds). BundleCollectionTimeSec int `json:"bundle_collection_time_sec"` - // Max number of workers in verifier worker pool - MaxVerifierWorkers int `json:"max_verifier_workers"` - // MinProverVersion is the minimum version of the prover that is required. - MinProverVersion string `json:"min_prover_version"` } // L2 loads l2geth configuration items. @@ -50,13 +46,19 @@ type Config struct { Auth *Auth `json:"auth"` } +// CircuitConfig circuit items. +type CircuitConfig struct { + ParamsPath string `json:"params_path"` + AssetsPath string `json:"assets_path"` + ForkName string `json:"fork_name"` + MinProverVersion string `json:"min_prover_version"` +} + // VerifierConfig load zk verifier config. type VerifierConfig struct { - ForkName string `json:"fork_name"` - MockMode bool `json:"mock_mode"` - ParamsPath string `json:"params_path"` - AssetsPathLo string `json:"assets_path_lo"` // lower version Verifier - AssetsPathHi string `json:"assets_path_hi"` // higher version Verifier + MockMode bool `json:"mock_mode"` + LowVersionCircuit *CircuitConfig `json:"low_version_circuit"` + HighVersionCircuit *CircuitConfig `json:"high_version_circuit"` } // NewConfig returns a new instance of Config. diff --git a/coordinator/internal/controller/api/auth.go b/coordinator/internal/controller/api/auth.go index dc4759524f..0f6ffd8ad5 100644 --- a/coordinator/internal/controller/api/auth.go +++ b/coordinator/internal/controller/api/auth.go @@ -6,7 +6,6 @@ import ( jwt "github.com/appleboy/gin-jwt/v2" "github.com/gin-gonic/gin" - "github.com/scroll-tech/go-ethereum/log" "gorm.io/gorm" "scroll-tech/coordinator/internal/config" @@ -45,33 +44,34 @@ func (a *AuthController) Login(c *gin.Context) (interface{}, error) { return "", fmt.Errorf("check the login parameter failure: %w", err) } + hardForkName, err := a.loginLogic.ProverHardForkName(&login) + if err != nil { + return "", fmt.Errorf("prover hard name failure:%w", err) + } + // check the challenge is used, if used, return failure if err := a.loginLogic.InsertChallengeString(c, login.Message.Challenge); err != nil { return "", fmt.Errorf("login insert challenge string failure:%w", err) } - return login, nil + + returnData := types.LoginParameterWithHardForkName{ + HardForkName: hardForkName, + LoginParameter: login, + } + + return returnData, nil } // PayloadFunc returns jwt.MapClaims with {public key, prover name}. func (a *AuthController) PayloadFunc(data interface{}) jwt.MapClaims { - v, ok := data.(types.LoginParameter) + v, ok := data.(types.LoginParameterWithHardForkName) if !ok { return jwt.MapClaims{} } - publicKey := v.PublicKey - if publicKey == "" { - var err error - publicKey, err = v.RecoverPublicKeyFromSignature() - if err != nil { - // do not handle error here since already called v.Verify() beforehands so there should be no error - // add log just in case some error happens - log.Error("impossible path: failed to recover public key from signature", "error", err.Error()) - } - } - return jwt.MapClaims{ - types.PublicKey: publicKey, + types.HardForkName: v.HardForkName, + types.PublicKey: v.PublicKey, types.ProverName: v.Message.ProverName, types.ProverVersion: v.Message.ProverVersion, } @@ -91,5 +91,10 @@ func (a *AuthController) IdentityHandler(c *gin.Context) interface{} { if proverVersion, ok := claims[types.ProverVersion]; ok { c.Set(types.ProverVersion, proverVersion) } + + if hardForkName, ok := claims[types.HardForkName]; ok { + c.Set(types.HardForkName, hardForkName) + } + return nil } diff --git a/coordinator/internal/controller/api/get_task.go b/coordinator/internal/controller/api/get_task.go index c6fd3d5085..a2e0290042 100644 --- a/coordinator/internal/controller/api/get_task.go +++ b/coordinator/internal/controller/api/get_task.go @@ -108,10 +108,6 @@ func (ptc *GetTaskController) GetTasks(ctx *gin.Context) { func (ptc *GetTaskController) proofType(para *coordinatorType.GetTaskParameter) message.ProofType { var proofTypes []message.ProofType - if para.TaskType != 0 { - proofTypes = append(proofTypes, message.ProofType(para.TaskType)) - } - for _, proofType := range para.TaskTypes { proofTypes = append(proofTypes, message.ProofType(proofType)) } diff --git a/coordinator/internal/logic/auth/login.go b/coordinator/internal/logic/auth/login.go index aa4268380e..488cef10db 100644 --- a/coordinator/internal/logic/auth/login.go +++ b/coordinator/internal/logic/auth/login.go @@ -3,6 +3,7 @@ package auth import ( "errors" "fmt" + "strings" "github.com/gin-gonic/gin" "github.com/scroll-tech/go-ethereum/log" @@ -23,31 +24,31 @@ type LoginLogic struct { chunkVks map[string]struct{} batchVKs map[string]struct{} bundleVks map[string]struct{} + + proverVersionHardForkMap map[string]string } // NewLoginLogic new a LoginLogic func NewLoginLogic(db *gorm.DB, cfg *config.Config, vf *verifier.Verifier) *LoginLogic { - l := &LoginLogic{ - cfg: cfg, - chunkVks: make(map[string]struct{}), - batchVKs: make(map[string]struct{}), - bundleVks: make(map[string]struct{}), - challengeOrm: orm.NewChallenge(db), - } - - for _, vk := range vf.ChunkVKMap { - l.chunkVks[vk] = struct{}{} + proverVersionHardForkMap := make(map[string]string) + if version.CheckScrollRepoVersion(cfg.ProverManager.Verifier.LowVersionCircuit.MinProverVersion, cfg.ProverManager.Verifier.HighVersionCircuit.MinProverVersion) { + log.Error("config file error, low verifier min_prover_version should not more than high verifier min_prover_version", + "low verifier min_prover_version", cfg.ProverManager.Verifier.LowVersionCircuit.MinProverVersion, + "high verifier min_prover_version", cfg.ProverManager.Verifier.HighVersionCircuit.MinProverVersion) + panic("verifier config file error") } - for _, vk := range vf.BatchVKMap { - l.batchVKs[vk] = struct{}{} - } + proverVersionHardForkMap[cfg.ProverManager.Verifier.LowVersionCircuit.MinProverVersion] = cfg.ProverManager.Verifier.LowVersionCircuit.ForkName + proverVersionHardForkMap[cfg.ProverManager.Verifier.HighVersionCircuit.MinProverVersion] = cfg.ProverManager.Verifier.HighVersionCircuit.ForkName - for _, vk := range vf.BundleVkMap { - l.bundleVks[vk] = struct{}{} + return &LoginLogic{ + cfg: cfg, + chunkVks: vf.ChunkVKMap, + batchVKs: vf.BatchVKMap, + bundleVks: vf.BundleVkMap, + challengeOrm: orm.NewChallenge(db), + proverVersionHardForkMap: proverVersionHardForkMap, } - - return l } // InsertChallengeString insert and check the challenge string is existed @@ -56,18 +57,16 @@ func (l *LoginLogic) InsertChallengeString(ctx *gin.Context, challenge string) e } func (l *LoginLogic) Check(login *types.LoginParameter) error { - if login.PublicKey != "" { - verify, err := login.Verify() - if err != nil || !verify { - log.Error("auth message verify failure", "prover_name", login.Message.ProverName, - "prover_version", login.Message.ProverVersion, "message", login.Message) - return errors.New("auth message verify failure") - } + verify, err := login.Verify() + if err != nil || !verify { + log.Error("auth message verify failure", "prover_name", login.Message.ProverName, + "prover_version", login.Message.ProverVersion, "message", login.Message) + return errors.New("auth message verify failure") } - if !version.CheckScrollRepoVersion(login.Message.ProverVersion, l.cfg.ProverManager.MinProverVersion) { + if !version.CheckScrollRepoVersion(login.Message.ProverVersion, l.cfg.ProverManager.Verifier.LowVersionCircuit.MinProverVersion) { return fmt.Errorf("incompatible prover version. please upgrade your prover, minimum allowed version: %s, actual version: %s", - l.cfg.ProverManager.MinProverVersion, login.Message.ProverVersion) + l.cfg.ProverManager.Verifier.LowVersionCircuit.MinProverVersion, login.Message.ProverVersion) } if len(login.Message.ProverTypes) > 0 { @@ -105,3 +104,18 @@ func (l *LoginLogic) Check(login *types.LoginParameter) error { } return nil } + +// ProverHardForkName retrieves hard fork name which prover belongs to +func (l *LoginLogic) ProverHardForkName(login *types.LoginParameter) (string, error) { + proverVersionSplits := strings.Split(login.Message.ProverVersion, "-") + if len(proverVersionSplits) == 0 { + return "", fmt.Errorf("invalid prover prover_version:%s", login.Message.ProverVersion) + } + + proverVersion := proverVersionSplits[0] + if hardForkName, ok := l.proverVersionHardForkMap[proverVersion]; ok { + return hardForkName, nil + } + + return "", fmt.Errorf("invalid prover prover_version:%s", login.Message.ProverVersion) +} diff --git a/coordinator/internal/logic/provertask/batch_prover_task.go b/coordinator/internal/logic/provertask/batch_prover_task.go index cfc649c029..3697b9fa83 100644 --- a/coordinator/internal/logic/provertask/batch_prover_task.go +++ b/coordinator/internal/logic/provertask/batch_prover_task.go @@ -9,7 +9,9 @@ import ( "github.com/gin-gonic/gin" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" + "github.com/scroll-tech/da-codec/encoding" "github.com/scroll-tech/da-codec/encoding/codecv3" + "github.com/scroll-tech/da-codec/encoding/codecv4" "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/log" "github.com/scroll-tech/go-ethereum/params" @@ -123,6 +125,13 @@ func (bp *BatchProverTask) Assign(ctx *gin.Context, getTaskParameter *coordinato return nil, ErrCoordinatorInternalFailure } + if hardForkName != taskCtx.HardForkName { + bp.recoverActiveAttempts(ctx, batchTask) + log.Error("incompatible prover version. requisite hard fork name:%s, prover hard fork name:%s, batch task_id:%s", + hardForkName, taskCtx.HardForkName, "task_id", batchTask.Hash) + return nil, ErrCoordinatorInternalFailure + } + proverTask := orm.ProverTask{ TaskID: batchTask.Hash, ProverPublicKey: taskCtx.PublicKey, @@ -208,17 +217,9 @@ func (bp *BatchProverTask) formatProverTask(ctx context.Context, task *orm.Prove chunkInfos = append(chunkInfos, &chunkInfo) } - taskDetail := message.BatchTaskDetail{ - ChunkInfos: chunkInfos, - ChunkProofs: chunkProofs, - } - - if hardForkName == "darwin" { - batchHeader, decodeErr := codecv3.NewDABatchFromBytes(batch.BatchHeader) - if decodeErr != nil { - return nil, fmt.Errorf("failed to decode batch header, taskID:%s err:%w", task.TaskID, decodeErr) - } - taskDetail.BatchHeader = batchHeader + taskDetail, err := bp.getBatchTaskDetail(batch, chunkInfos, chunkProofs) + if err != nil { + return nil, fmt.Errorf("failed to get batch task detail, taskID:%s err:%w", task.TaskID, err) } chunkProofsBytes, err := json.Marshal(taskDetail) @@ -241,3 +242,34 @@ func (bp *BatchProverTask) recoverActiveAttempts(ctx *gin.Context, batchTask *or log.Error("failed to recover batch active attempts", "hash", batchTask.Hash, "error", err) } } + +func (bp *BatchProverTask) getBatchTaskDetail(dbBatch *orm.Batch, chunkInfos []*message.ChunkInfo, chunkProofs []*message.ChunkProof) (*message.BatchTaskDetail, error) { + taskDetail := &message.BatchTaskDetail{ + ChunkInfos: chunkInfos, + ChunkProofs: chunkProofs, + } + + if encoding.CodecVersion(dbBatch.CodecVersion) != encoding.CodecV3 && encoding.CodecVersion(dbBatch.CodecVersion) != encoding.CodecV4 { + return taskDetail, nil + } + + if encoding.CodecVersion(dbBatch.CodecVersion) == encoding.CodecV3 { + batchHeader, decodeErr := codecv3.NewDABatchFromBytes(dbBatch.BatchHeader) + if decodeErr != nil { + return nil, fmt.Errorf("failed to decode batch header (v3) for batch %d: %w", dbBatch.Index, decodeErr) + } + + taskDetail.BatchHeader = batchHeader + taskDetail.BlobBytes = dbBatch.BlobBytes + } else { + batchHeader, decodeErr := codecv4.NewDABatchFromBytes(dbBatch.BatchHeader) + if decodeErr != nil { + return nil, fmt.Errorf("failed to decode batch header (v4) for batch %d: %w", dbBatch.Index, decodeErr) + } + + taskDetail.BatchHeader = batchHeader + taskDetail.BlobBytes = dbBatch.BlobBytes + } + + return taskDetail, nil +} diff --git a/coordinator/internal/logic/provertask/bundle_prover_task.go b/coordinator/internal/logic/provertask/bundle_prover_task.go index d244d2280b..b380c32a6d 100644 --- a/coordinator/internal/logic/provertask/bundle_prover_task.go +++ b/coordinator/internal/logic/provertask/bundle_prover_task.go @@ -122,6 +122,13 @@ func (bp *BundleProverTask) Assign(ctx *gin.Context, getTaskParameter *coordinat return nil, ErrCoordinatorInternalFailure } + if hardForkName != taskCtx.HardForkName { + bp.recoverActiveAttempts(ctx, bundleTask) + log.Error("incompatible prover version. requisite hard fork name:%s, prover hard fork name:%s, bundle task_id:%s", + hardForkName, taskCtx.HardForkName, "task_id", bundleTask.Hash) + return nil, ErrCoordinatorInternalFailure + } + proverTask := orm.ProverTask{ TaskID: bundleTask.Hash, ProverPublicKey: taskCtx.PublicKey, diff --git a/coordinator/internal/logic/provertask/chunk_prover_task.go b/coordinator/internal/logic/provertask/chunk_prover_task.go index b5527ff495..df7900be45 100644 --- a/coordinator/internal/logic/provertask/chunk_prover_task.go +++ b/coordinator/internal/logic/provertask/chunk_prover_task.go @@ -120,6 +120,13 @@ func (cp *ChunkProverTask) Assign(ctx *gin.Context, getTaskParameter *coordinato return nil, ErrCoordinatorInternalFailure } + if hardForkName != taskCtx.HardForkName { + cp.recoverActiveAttempts(ctx, chunkTask) + log.Error("incompatible prover version. requisite hard fork name:%s, prover hard fork name:%s, chunk task_id:%s", + hardForkName, taskCtx.HardForkName, "task_id", chunkTask.Hash) + return nil, ErrCoordinatorInternalFailure + } + proverTask := orm.ProverTask{ TaskID: chunkTask.Hash, ProverPublicKey: taskCtx.PublicKey, diff --git a/coordinator/internal/logic/provertask/prover_task.go b/coordinator/internal/logic/provertask/prover_task.go index de3a6f3552..dc47a162e0 100644 --- a/coordinator/internal/logic/provertask/prover_task.go +++ b/coordinator/internal/logic/provertask/prover_task.go @@ -49,6 +49,7 @@ type proverTaskContext struct { PublicKey string ProverName string ProverVersion string + HardForkName string } // checkParameter check the prover task parameter illegal @@ -73,6 +74,12 @@ func (b *BaseProverTask) checkParameter(ctx *gin.Context) (*proverTaskContext, e } ptc.ProverVersion = proverVersion.(string) + hardForkName, hardForkNameExist := ctx.Get(coordinatorType.HardForkName) + if !hardForkNameExist { + return nil, errors.New("get hard fork name from context failed") + } + ptc.HardForkName = hardForkName.(string) + isBlocked, err := b.proverBlockListOrm.IsPublicKeyBlocked(ctx.Copy(), publicKey.(string)) if err != nil { return nil, fmt.Errorf("failed to check whether the public key %s is blocked before assigning a chunk task, err: %w, proverName: %s, proverVersion: %s", publicKey, err, proverName, proverVersion) diff --git a/coordinator/internal/logic/submitproof/proof_receiver.go b/coordinator/internal/logic/submitproof/proof_receiver.go index c8450a7d54..5daaf9e520 100644 --- a/coordinator/internal/logic/submitproof/proof_receiver.go +++ b/coordinator/internal/logic/submitproof/proof_receiver.go @@ -187,7 +187,7 @@ func (m *ProofReceiverLogic) HandleZkProof(ctx *gin.Context, proofParameter coor if unmarshalErr := json.Unmarshal([]byte(proofParameter.Proof), &bundleProof); unmarshalErr != nil { return unmarshalErr } - success, verifyErr = m.verifier.VerifyBundleProof(&bundleProof) + success, verifyErr = m.verifier.VerifyBundleProof(&bundleProof, hardForkName) } if verifyErr != nil || !success { diff --git a/coordinator/internal/logic/verifier/legacy_vk/agg_vk.vkey b/coordinator/internal/logic/verifier/legacy_vk/agg_vk.vkey deleted file mode 100644 index 0b4ab2657c12a8b13e31d9d3a4e62042e41ba226..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 296 zcmV+@0oVQj000^Q000D6*)0m!0e9bUb-|;ooNw=N1c{kpy>1LQafpV6RkhrB9;RS~f&0+QK1&|+?v5-~PCb2doW uxy5p-!wzOIgiIig7HhFOAlnkxIN<0y>RJ9PIeJ7r8Z9#Oy<65|P000E?SU>?qvU-ICIsY=()&$zJzW3wVqMQ$FN&^z=0Nx)4N~$Rl zi0$Tg>Q|0DOdfKOwq@9W#o;9@<(Z$Bv*#gt>2le9QMlAIahs7MW{N!@OD4rxV#VJj zyQ*}h{HH;q@NYN3!cLhy%~ed4qFpf3RMhw(B2JOcpAc+JUBp?Xx3gQg$-|&p-CXp} ztnF!<1(Mi+1(*uy&g3G(EDB8-uz*SDB>cOQq31-dE^g>|90;X0k`cPjUY66i?_nmx iRI+5XxY3Av{`_ endBlockNumber { + return nil, fmt.Errorf("L2Block.GetL2BlocksInRange: start block number should be less than or equal to end block number, start block: %v, end block: %v", startBlockNumber, endBlockNumber) + } + + db := o.db.WithContext(ctx) + db = db.Model(&L2Block{}) + db = db.Select("header, transactions, withdraw_root, row_consumption") + db = db.Where("number >= ? AND number <= ?", startBlockNumber, endBlockNumber) + db = db.Order("number ASC") + + var l2Blocks []L2Block + if err := db.Find(&l2Blocks).Error; err != nil { + return nil, fmt.Errorf("L2Block.GetL2BlocksInRange error: %w, start block: %v, end block: %v", err, startBlockNumber, endBlockNumber) + } + + // sanity check + if uint64(len(l2Blocks)) != endBlockNumber-startBlockNumber+1 { + return nil, fmt.Errorf("L2Block.GetL2BlocksInRange: unexpected number of results, expected: %v, got: %v", endBlockNumber-startBlockNumber+1, len(l2Blocks)) + } + + var blocks []*encoding.Block + for _, v := range l2Blocks { + var block encoding.Block + + if err := json.Unmarshal([]byte(v.Transactions), &block.Transactions); err != nil { + return nil, fmt.Errorf("L2Block.GetL2BlocksInRange error: %w, start block: %v, end block: %v", err, startBlockNumber, endBlockNumber) + } + + block.Header = &gethTypes.Header{} + if err := json.Unmarshal([]byte(v.Header), block.Header); err != nil { + return nil, fmt.Errorf("L2Block.GetL2BlocksInRange error: %w, start block: %v, end block: %v", err, startBlockNumber, endBlockNumber) + } + + block.WithdrawRoot = common.HexToHash(v.WithdrawRoot) + + if err := json.Unmarshal([]byte(v.RowConsumption), &block.RowConsumption); err != nil { + return nil, fmt.Errorf("L2Block.GetL2BlocksInRange error: %w, start block: %v, end block: %v", err, startBlockNumber, endBlockNumber) + } + + blocks = append(blocks, &block) + } + + return blocks, nil +} + // InsertL2Blocks inserts l2 blocks into the "l2_block" table. // for unit test func (o *L2Block) InsertL2Blocks(ctx context.Context, blocks []*encoding.Block) error { diff --git a/coordinator/internal/orm/prover_task.go b/coordinator/internal/orm/prover_task.go index 0dd4e05f08..ace18e04ef 100644 --- a/coordinator/internal/orm/prover_task.go +++ b/coordinator/internal/orm/prover_task.go @@ -116,25 +116,6 @@ func (o *ProverTask) GetProverTasksByHashes(ctx context.Context, taskType messag return proverTasks, nil } -// GetAssignedProverTaskByTaskIDAndProver get prover task taskID and public key -// TODO: when prover all upgrade need DEPRECATED this function -func (o *ProverTask) GetAssignedProverTaskByTaskIDAndProver(ctx context.Context, taskType message.ProofType, taskID, proverPublicKey, proverVersion string) (*ProverTask, error) { - db := o.db.WithContext(ctx) - db = db.Model(&ProverTask{}) - db = db.Where("task_type", int(taskType)) - db = db.Where("task_id", taskID) - db = db.Where("prover_public_key", proverPublicKey) - db = db.Where("prover_version", proverVersion) - db = db.Where("proving_status", types.ProverAssigned) - - var proverTask ProverTask - err := db.First(&proverTask).Error - if err != nil { - return nil, fmt.Errorf("ProverTask.GetProverTaskByTaskIDAndProver err:%w, taskID:%s, pubkey:%s, prover_version:%s", err, taskID, proverPublicKey, proverVersion) - } - return &proverTask, nil -} - // GetProverTaskByUUIDAndPublicKey get prover task taskID by uuid and public key func (o *ProverTask) GetProverTaskByUUIDAndPublicKey(ctx context.Context, uuid, publicKey string) (*ProverTask, error) { db := o.db.WithContext(ctx) diff --git a/coordinator/internal/types/auth.go b/coordinator/internal/types/auth.go index 2b7434e112..a8b1c669ec 100644 --- a/coordinator/internal/types/auth.go +++ b/coordinator/internal/types/auth.go @@ -18,6 +18,8 @@ const ( ProverName = "prover_name" // ProverVersion the prover version for context ProverVersion = "prover_version" + // HardForkName the hard fork name for context + HardForkName = "hard_fork_name" ) // LoginSchema for /login response @@ -26,22 +28,6 @@ type LoginSchema struct { Token string `json:"token"` } -// TODO just use for darwin upgrade, need delete next upgrade -type identity struct { - ProverName string `json:"prover_name"` - ProverVersion string `json:"prover_version"` - Challenge string `json:"challenge"` -} - -func (i *identity) Hash() ([]byte, error) { - byt, err := rlp.EncodeToBytes(i) - if err != nil { - return nil, err - } - hash := crypto.Keccak256Hash(byt) - return hash[:], nil -} - // Message the login message struct type Message struct { Challenge string `form:"challenge" json:"challenge" binding:"required"` @@ -51,6 +37,12 @@ type Message struct { VKs []string `form:"vks" json:"vks"` } +// LoginParameterWithHardForkName constructs new payload for login +type LoginParameterWithHardForkName struct { + LoginParameter + HardForkName string `form:"hard_fork_name" json:"hard_fork_name"` +} + // LoginParameter for /login api type LoginParameter struct { Message Message `form:"message" json:"message" binding:"required"` @@ -93,28 +85,6 @@ func (a *LoginParameter) Verify() (bool, error) { return isValid, nil } -// RecoverPublicKeyFromSignature get public key from signature. -// This method is for pre-darwin's compatible. -func (a *LoginParameter) RecoverPublicKeyFromSignature() (string, error) { - curieIdentity := identity{ - ProverName: a.Message.ProverName, - ProverVersion: a.Message.ProverVersion, - Challenge: a.Message.Challenge, - } - - hash, err := curieIdentity.Hash() - if err != nil { - return "", err - } - sig := common.FromHex(a.Signature) - // recover public key - pk, err := crypto.SigToPub(hash, sig) - if err != nil { - return "", err - } - return common.Bytes2Hex(crypto.CompressPubkey(pk)), nil -} - // Hash returns the hash of the auth message, which should be the message used // to construct the Signature. func (i *Message) Hash() ([]byte, error) { diff --git a/coordinator/internal/types/auth_test.go b/coordinator/internal/types/auth_test.go index ce4cd29ede..6f5699824d 100644 --- a/coordinator/internal/types/auth_test.go +++ b/coordinator/internal/types/auth_test.go @@ -60,11 +60,10 @@ func TestGenerateSignature(t *testing.T) { authMsg := LoginParameter{ Message: Message{ ProverName: "test", - ProverVersion: "v4.4.32-37af5ef5-38a68e2-1c5093c", - Challenge: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MjEzMjc5MTIsIm9yaWdfaWF0IjoxNzIxMzI0MzEyLCJyYW5kb20iOiJWMVFlT19yNEV5eGRmYUtDalprVExEa0ZIemEyNTdQRG93dTV4SnVxYTdZPSJ9.x-B_TnkTUvs8-hiMfJXejxetAP6rXfeRUmyZ3S0uBiM", - ProverTypes: []ProverType{ProverTypeBatch}, - VKs: []string{"AAAAGgAAAARX2S0K1wF333B1waOsnG/vcASJmWG9YM6SNWCBy1ywD9jfGkei+f0wNYpkjW7JO12EfU7CjYVBo+PGku3zaQJI64lbn6BwyTBa4RfrPFpV5mP47ix0sXZ+Wt5wklMLRW7OIJb1yfCDm+gkSsp3/Zqrxt4SY4rQ4WtHfynTCQ0KDi78jNuiFvwxO3ub3DkgGVaxMkGxTRP/Vz6E7MCZMUBR5wZFcMzJn+73f0wYjDxfj00krg9O1VrwVxbVV1ycLR6oQLcOgm/l+xwth8io0vDpF9OY21gD5DgJn9GgcYe8KoRVEbEqApLZPdBibpcSMTY9czZI2LnFcqrDDmYvhEwgjhZrsTog2xLXOODoOupZ/is5ekQ9Gi0y871b1mLlCGA=", - "AAAAGgAAAARX2S0K1wF333B1waOsnG/vcASJmWG9YM6SNWCBy1ywD1DEjW4Kell67H07wazT5DdzrSh4+amh+cmosQHp9p9snFypyoBGt3UHtoJGQBZlywZWDS9ht5pnaEoGBdaKcQk+lFb+WxTiId0KOAa0mafTZTQw8yToy57Jple64qzlRu1dux30tZZGuerLN1CKzg5Xl2iOpMK+l87jCINwVp5cUtF/XrvhBbU7onKh3KBiy99iUqVyA3Y6iiIZhGKWBSuSA4bNgDYIoVkqjHpdL35aEShoRO6pNXt7rDzxFoPzH0JuPI54nE4OhVrzZXwtkAEosxVa/fszcE092FH+HhhtxZBYe/KEzwdISU9TOPdId3UF/UMYC0MiYOlqffVTgAg="}, + ProverVersion: "v4.4.43-37af5ef5-38a68e2-1c5093c", + Challenge: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MjQzODg4MTEsIm9yaWdfaWF0IjoxNzI0Mzg1MjExLCJyYW5kb20iOiItZ2UxTjhRc1NlTzhxRVdBTk5KWWtFVjU3ekhJX1JmTGw5Mjdkb2pMTm5JPSJ9.TmcRyXTyfCAHIk5WXdpShck0qUUesTDmi_0IhD87GmA", + ProverTypes: []ProverType{ProverTypeChunk}, + VKs: []string{"mock_vk"}, }, PublicKey: publicKeyHex, } diff --git a/coordinator/internal/types/get_task.go b/coordinator/internal/types/get_task.go index aba15007db..7dd5083736 100644 --- a/coordinator/internal/types/get_task.go +++ b/coordinator/internal/types/get_task.go @@ -3,7 +3,6 @@ package types // GetTaskParameter for ProverTasks request parameter type GetTaskParameter struct { ProverHeight uint64 `form:"prover_height" json:"prover_height"` - TaskType int `form:"task_type" json:"task_type"` TaskTypes []int `form:"task_types" json:"task_types"` } diff --git a/coordinator/test/api_test.go b/coordinator/test/api_test.go index 58a444ce9f..d3ce689944 100644 --- a/coordinator/test/api_test.go +++ b/coordinator/test/api_test.go @@ -33,12 +33,6 @@ import ( "scroll-tech/coordinator/internal/route" ) -const ( - forkNumberTwo = 2 - forkNumberOne = 1 - minProverVersion = "v2.0.0" -) - var ( conf *config.Config @@ -72,7 +66,7 @@ func randomURL() string { return fmt.Sprintf("localhost:%d", 10000+2000+id.Int64()) } -func setupCoordinator(t *testing.T, proversPerSession uint8, coordinatorURL string, nameForkMap map[string]int64) (*cron.Collector, *http.Server) { +func setupCoordinator(t *testing.T, proversPerSession uint8, coordinatorURL string, forks []string) (*cron.Collector, *http.Server) { var err error db, err = testApps.GetGormDBClient() @@ -90,13 +84,23 @@ func setupCoordinator(t *testing.T, proversPerSession uint8, coordinatorURL stri ProversPerSession: proversPerSession, Verifier: &config.VerifierConfig{ MockMode: true, + LowVersionCircuit: &config.CircuitConfig{ + ParamsPath: "", + AssetsPath: "", + ForkName: "homestead", + MinProverVersion: "v4.2.0", + }, + HighVersionCircuit: &config.CircuitConfig{ + ParamsPath: "", + AssetsPath: "", + ForkName: "bernoulli", + MinProverVersion: "v4.3.0", + }, }, BatchCollectionTimeSec: 10, ChunkCollectionTimeSec: 10, BundleCollectionTimeSec: 10, - MaxVerifierWorkers: 10, SessionAttempts: 5, - MinProverVersion: minProverVersion, }, Auth: &config.Auth{ ChallengeExpireDurationSec: tokenTimeout, @@ -105,20 +109,12 @@ func setupCoordinator(t *testing.T, proversPerSession uint8, coordinatorURL stri } var chainConf params.ChainConfig - for forkName, forkNumber := range nameForkMap { + for _, forkName := range forks { switch forkName { - case "shanghai": - chainConf.ShanghaiBlock = big.NewInt(forkNumber) case "bernoulli": - chainConf.BernoulliBlock = big.NewInt(forkNumber) - case "london": - chainConf.LondonBlock = big.NewInt(forkNumber) - case "istanbul": - chainConf.IstanbulBlock = big.NewInt(forkNumber) + chainConf.BernoulliBlock = big.NewInt(100) case "homestead": - chainConf.HomesteadBlock = big.NewInt(forkNumber) - case "eip155": - chainConf.EIP155Block = big.NewInt(forkNumber) + chainConf.HomesteadBlock = big.NewInt(0) } } @@ -201,7 +197,7 @@ func TestApis(t *testing.T) { func testHandshake(t *testing.T) { // Setup coordinator and http server. coordinatorURL := randomURL() - proofCollector, httpHandler := setupCoordinator(t, 1, coordinatorURL, map[string]int64{"homestead": forkNumberOne}) + proofCollector, httpHandler := setupCoordinator(t, 1, coordinatorURL, []string{"homestead"}) defer func() { proofCollector.Stop() assert.NoError(t, httpHandler.Shutdown(context.Background())) @@ -214,7 +210,7 @@ func testHandshake(t *testing.T) { func testFailedHandshake(t *testing.T) { // Setup coordinator and http server. coordinatorURL := randomURL() - proofCollector, httpHandler := setupCoordinator(t, 1, coordinatorURL, map[string]int64{"homestead": forkNumberOne}) + proofCollector, httpHandler := setupCoordinator(t, 1, coordinatorURL, []string{"homestead"}) defer func() { proofCollector.Stop() }() @@ -232,7 +228,7 @@ func testFailedHandshake(t *testing.T) { func testGetTaskBlocked(t *testing.T) { coordinatorURL := randomURL() - collector, httpHandler := setupCoordinator(t, 3, coordinatorURL, map[string]int64{"homestead": forkNumberOne}) + collector, httpHandler := setupCoordinator(t, 3, coordinatorURL, []string{"homestead"}) defer func() { collector.Stop() assert.NoError(t, httpHandler.Shutdown(context.Background())) @@ -276,7 +272,7 @@ func testGetTaskBlocked(t *testing.T) { func testOutdatedProverVersion(t *testing.T) { coordinatorURL := randomURL() - collector, httpHandler := setupCoordinator(t, 3, coordinatorURL, map[string]int64{"homestead": forkNumberOne}) + collector, httpHandler := setupCoordinator(t, 3, coordinatorURL, []string{"homestead"}) defer func() { collector.Stop() assert.NoError(t, httpHandler.Shutdown(context.Background())) @@ -288,12 +284,14 @@ func testOutdatedProverVersion(t *testing.T) { batchProver := newMockProver(t, "prover_batch_test", coordinatorURL, message.ProofTypeBatch, "v1.999.999") assert.True(t, chunkProver.healthCheckSuccess(t)) - expectedErr := fmt.Errorf("check the login parameter failure: incompatible prover version. please upgrade your prover, minimum allowed version: %s, actual version: %s", minProverVersion, chunkProver.proverVersion) + expectedErr := fmt.Errorf("check the login parameter failure: incompatible prover version. please upgrade your prover, minimum allowed version: %s, actual version: %s", + conf.ProverManager.Verifier.LowVersionCircuit.MinProverVersion, chunkProver.proverVersion) code, errMsg := chunkProver.tryGetProverTask(t, message.ProofTypeChunk) assert.Equal(t, types.ErrJWTCommonErr, code) assert.Equal(t, expectedErr, errors.New(errMsg)) - expectedErr = fmt.Errorf("check the login parameter failure: incompatible prover version. please upgrade your prover, minimum allowed version: %s, actual version: %s", minProverVersion, batchProver.proverVersion) + expectedErr = fmt.Errorf("check the login parameter failure: incompatible prover version. please upgrade your prover, minimum allowed version: %s, actual version: %s", + conf.ProverManager.Verifier.LowVersionCircuit.MinProverVersion, batchProver.proverVersion) code, errMsg = batchProver.tryGetProverTask(t, message.ProofTypeBatch) assert.Equal(t, types.ErrJWTCommonErr, code) assert.Equal(t, expectedErr, errors.New(errMsg)) @@ -301,7 +299,7 @@ func testOutdatedProverVersion(t *testing.T) { func testValidProof(t *testing.T) { coordinatorURL := randomURL() - collector, httpHandler := setupCoordinator(t, 3, coordinatorURL, map[string]int64{"istanbul": forkNumberTwo}) + collector, httpHandler := setupCoordinator(t, 3, coordinatorURL, []string{"homestead"}) defer func() { collector.Stop() assert.NoError(t, httpHandler.Shutdown(context.Background())) @@ -384,7 +382,7 @@ func testValidProof(t *testing.T) { func testInvalidProof(t *testing.T) { // Setup coordinator and ws server. coordinatorURL := randomURL() - collector, httpHandler := setupCoordinator(t, 3, coordinatorURL, map[string]int64{"istanbul": forkNumberTwo}) + collector, httpHandler := setupCoordinator(t, 3, coordinatorURL, []string{"darwinV2"}) defer func() { collector.Stop() assert.NoError(t, httpHandler.Shutdown(context.Background())) @@ -472,7 +470,7 @@ func testInvalidProof(t *testing.T) { func testProofGeneratedFailed(t *testing.T) { // Setup coordinator and ws server. coordinatorURL := randomURL() - collector, httpHandler := setupCoordinator(t, 3, coordinatorURL, map[string]int64{"istanbul": forkNumberTwo}) + collector, httpHandler := setupCoordinator(t, 3, coordinatorURL, []string{"darwinV2"}) defer func() { collector.Stop() assert.NoError(t, httpHandler.Shutdown(context.Background())) @@ -573,7 +571,7 @@ func testProofGeneratedFailed(t *testing.T) { func testTimeoutProof(t *testing.T) { // Setup coordinator and ws server. coordinatorURL := randomURL() - collector, httpHandler := setupCoordinator(t, 1, coordinatorURL, map[string]int64{"istanbul": forkNumberTwo}) + collector, httpHandler := setupCoordinator(t, 1, coordinatorURL, []string{"darwinV2"}) defer func() { collector.Stop() assert.NoError(t, httpHandler.Shutdown(context.Background())) diff --git a/coordinator/test/mock_prover.go b/coordinator/test/mock_prover.go index ddf03d93ec..06e97185de 100644 --- a/coordinator/test/mock_prover.go +++ b/coordinator/test/mock_prover.go @@ -160,7 +160,7 @@ func (r *mockProver) getProverTask(t *testing.T, proofType message.ProofType) (* resp, err := client.R(). SetHeader("Content-Type", "application/json"). SetHeader("Authorization", fmt.Sprintf("Bearer %s", token)). - SetBody(map[string]interface{}{"prover_height": 100, "task_type": int(proofType)}). + SetBody(map[string]interface{}{"prover_height": 100, "task_types": []int{int(proofType)}}). SetResult(&result). Post("http://" + r.coordinatorURL + "/coordinator/v1/get_task") assert.NoError(t, err) diff --git a/database/migrate/migrate_test.go b/database/migrate/migrate_test.go index 650c564e07..da9946048e 100644 --- a/database/migrate/migrate_test.go +++ b/database/migrate/migrate_test.go @@ -59,20 +59,20 @@ func testResetDB(t *testing.T) { cur, err := Current(pgDB) assert.NoError(t, err) // total number of tables. - assert.Equal(t, int64(23), cur) + assert.Equal(t, int64(24), cur) } func testMigrate(t *testing.T) { assert.NoError(t, Migrate(pgDB)) cur, err := Current(pgDB) assert.NoError(t, err) - assert.Equal(t, int64(23), cur) + assert.Equal(t, int64(24), cur) } func testRollback(t *testing.T) { version, err := Current(pgDB) assert.NoError(t, err) - assert.Equal(t, int64(23), version) + assert.Equal(t, int64(24), version) assert.NoError(t, Rollback(pgDB, nil)) diff --git a/database/migrate/migrations/00024_add_blob_bytes_to_batch.sql b/database/migrate/migrations/00024_add_blob_bytes_to_batch.sql new file mode 100644 index 0000000000..8ad4a093a7 --- /dev/null +++ b/database/migrate/migrations/00024_add_blob_bytes_to_batch.sql @@ -0,0 +1,15 @@ +-- +goose Up +-- +goose StatementBegin + +ALTER TABLE batch +ADD COLUMN blob_bytes BYTEA; + +-- +goose StatementEnd + +-- +goose Down +-- +goose StatementBegin + +ALTER TABLE IF EXISTS batch +DROP COLUMN IF EXISTS blob_bytes; + +-- +goose StatementEnd diff --git a/go.work.sum b/go.work.sum index 278d036700..e678cc76a1 100644 --- a/go.work.sum +++ b/go.work.sum @@ -47,6 +47,7 @@ cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbf cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.57.1 h1:FiULdbbzUxWD0Y4ZGPSVCDLvqRSyCIO6zKV7E2nf5uA= cloud.google.com/go/bigquery v1.57.1/go.mod h1:iYzC0tGVWt1jqSzBHqCr3lrRn0u13E8e+AqowBsDgug= +cloud.google.com/go/bigtable v1.2.0 h1:F4cCmA4nuV84V5zYQ3MKY+M1Cw1avHDuf3S/LcZPA9c= cloud.google.com/go/bigtable v1.2.0/go.mod h1:JcVAOl45lrTmQfLj7T6TxyMzIN/3FGGcFm+2xVAli2o= cloud.google.com/go/billing v1.17.4 h1:77/4kCqzH6Ou5CCDzNmqmboE+WvbwFBJmw1QZQz19AI= cloud.google.com/go/billing v1.17.4/go.mod h1:5DOYQStCxquGprqfuid/7haD7th74kyMBHkjO/OvDtk= @@ -255,7 +256,9 @@ cloud.google.com/go/websecurityscanner v1.6.4 h1:5Gp7h5j7jywxLUp6NTpjNPkgZb3ngl0 cloud.google.com/go/websecurityscanner v1.6.4/go.mod h1:mUiyMQ+dGpPPRkHgknIZeCzSHJ45+fY4F52nZFDHm2o= cloud.google.com/go/workflows v1.12.3 h1:qocsqETmLAl34mSa01hKZjcqAvt699gaoFbooGGMvaM= cloud.google.com/go/workflows v1.12.3/go.mod h1:fmOUeeqEwPzIU81foMjTRQIdwQHADi/vEr1cx9R1m5g= +collectd.org v0.3.0 h1:iNBHGw1VvPJxH2B6RiFWFZ+vsjo1lCdRszBeOuwGi00= collectd.org v0.3.0/go.mod h1:A/8DzQBkF6abtvrT2j/AU/4tiBgJWYyh0y/oB/4MlWE= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9 h1:VpgP7xuJadIUuKccphEpTJnWhS2jkQyMt6Y7pJCD7fY= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/Azure/azure-pipeline-go v0.2.1/go.mod h1:UGSo8XybXnIGZ3epmeBw7Jdz+HiUVpqIlpz/HKHylF4= github.com/Azure/azure-pipeline-go v0.2.2 h1:6oiIS9yaG6XCCzhgAgKFfIWyo4LLCiDhZot6ltoThhY= @@ -270,18 +273,25 @@ github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.4.1 h1:QSdcrd/UFJv6Bp/Cf github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.4.1/go.mod h1:eZ4g6GUvXiGulfIbbhh1Xr4XwUYaYaWMqzGD/284wCA= github.com/Azure/azure-storage-blob-go v0.7.0 h1:MuueVOYkufCxJw5YZzF842DY2MBsp+hLuh2apKY0mck= github.com/Azure/azure-storage-blob-go v0.7.0/go.mod h1:f9YQKtsG1nMisotuTPpO0tjNuEjKRYAcJU8/ydDI++4= +github.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK/vTfRHdAubSIPRgs= github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= github.com/Azure/go-autorest/autorest/adal v0.9.23 h1:Yepx8CvFxwNKpH6ja7RZ+sKX+DWYNldbLiALMC3BTz8= github.com/Azure/go-autorest/autorest/adal v0.9.23/go.mod h1:5pcMqFkdPhviJdlEy3kC/v1ZLnQl0MH6XA5YCcMhy4c= +github.com/Azure/go-autorest/autorest/date v0.3.0 h1:7gUk1U5M/CQbp9WoqinNzJar+8KY+LPI6wiWrP/myHw= github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74= +github.com/Azure/go-autorest/autorest/mocks v0.4.1 h1:K0laFcLE6VLTOwNgSxaGbUcLPuGXlNkbVvq4cW4nIHk= github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= +github.com/Azure/go-autorest/logger v0.2.1 h1:IG7i4p/mDa2Ce4TRyAO8IHnVhAVF3RFU+ZtXWSmf4Tg= github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= +github.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUMfuitfgcfuo= github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= github.com/AzureAD/microsoft-authentication-library-for-go v0.6.0 h1:XMEdVDFxgulDDl0lQmAZS6j8gRQ/0pJ+ZpXH2FHVtDc= github.com/AzureAD/microsoft-authentication-library-for-go v0.6.0/go.mod h1:BDJ5qMFKx9DugEg3+uQSDCdbYPr5s9vBTrL9P8TpqOU= github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8= github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802 h1:1BDTz0u9nC3//pOCMdNH+CiXJVYJh5UQNCOBG7jbELc= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/DATA-DOG/go-sqlmock v1.3.3 h1:CWUqKXe0s8A2z6qCgkP4Kru7wC11YoAnoupUKFDnH08= github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= github.com/NYTimes/gziphandler v1.1.1 h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cqUQ3I= @@ -292,12 +302,14 @@ github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tN github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= +github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 h1:fLjPD/aNc3UIOA6tDi6QXUemppXK3P9BI7mr2hd6gx8= github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= github.com/aead/siphash v1.0.1 h1:FwHfE/T45KPKYuuSAKyyvE+oPWcaQ+CUmFW0bPlM+kg= github.com/agext/levenshtein v1.2.3 h1:YB2fHEn0UJagG8T1rrWknE3ZQzWM06O8AMAatNn7lmo= github.com/agext/levenshtein v1.2.3/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= github.com/agnivade/levenshtein v1.0.1 h1:3oJU7J3FGFmyhn8KHjmVaZCN5hxTr7GxgRue+sxIXdQ= github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= +github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af h1:wVe6/Ea46ZMeNkQjjBW6xcqyQA/j5e0D6GytH95g0gQ= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= github.com/akavel/rsrc v0.10.2 h1:Zxm8V5eI1hW4gGaYsJQUhxpjkENuG91ki8B4zCrvEsw= github.com/akavel/rsrc v0.10.2/go.mod h1:uLoCtb9J+EyAqh+26kdrTgmzRBFPGOolLWKpdxkKq+c= @@ -306,11 +318,13 @@ github.com/alecthomas/kingpin/v2 v2.4.0/go.mod h1:0gyi0zQnjuFk8xrkNKamJoyUo382HR github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc h1:cAKDfWh5VpdgMhJosfJnn5/FoN2SRZ4p7fJNX58YPaU= github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 h1:s6gZFSlWYmbqAuRjVTiNNhvNRfY2Wxp9nhfyel4rklc= github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE= +github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/antihax/optional v1.0.0 h1:xK2lYat7ZLaVVcIuj82J8kIro4V6kDe0AUDFboUCwcg= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/antlr/antlr4/runtime/Go/antlr v1.4.10 h1:yL7+Jz0jTC6yykIK/Wh74gnTJnrGr5AyrNMXuA0gves= github.com/antlr/antlr4/runtime/Go/antlr v1.4.10/go.mod h1:F7bn7fEU90QkQ3tnmaTx3LTKLEDqnwWODIYppRQ5hnY= +github.com/apache/arrow/go/arrow v0.0.0-20191024131854-af6fa24be0db h1:nxAtV4VajJDhKysp2kdcJZsq8Ss1xSA0vZTkVHHJd0E= github.com/apache/arrow/go/arrow v0.0.0-20191024131854-af6fa24be0db/go.mod h1:VTxUBvSJ3s3eHAg65PNgrsn5BtqCRPdmyXh6rAfdxN0= github.com/apache/arrow/go/v12 v12.0.0 h1:xtZE63VWl7qLdB0JObIXvvhGjoVNrQ9ciIHG2OK5cmc= github.com/apache/arrow/go/v12 v12.0.0/go.mod h1:d+tV/eHZZ7Dz7RPrFKtPK02tpr+c9/PEd/zm8mDS9Vg= @@ -355,10 +369,13 @@ github.com/bits-and-blooms/bitset v1.12.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6 github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4YnC6+E63dPcxHo2sUxDIu8g3QgEJdRY= +github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40 h1:y4B3+GPxKlrigF1ha5FFErxK+sr6sWxQovRMzwMhejo= github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40/go.mod h1:8rLXio+WjiTceGBHIoTvn60HIbs7Hm7bcHjyrSqYB9c= +github.com/boltdb/bolt v1.3.1 h1:JQmyP4ZBrce+ZQu0dY660FMfatumYDLun9hBCUVIkF4= github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= github.com/btcsuite/btcd/btcec/v2 v2.2.0 h1:fzn1qaOt32TuLjFlkzYSsBC35Q3KUjT1SwPxiMSCF5k= github.com/btcsuite/btcd/btcec/v2 v2.2.0/go.mod h1:U7MHm051Al6XmscBQ0BoNydpOTsFAn707034b5nY8zU= +github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f h1:bAs4lUbRJpnnkd9VhRV3jjAVU7DJVjMaK+IsvSeZvFo= github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d h1:yJzD/yFppdVCf6ApMkVy8cUxV0XrxdP9rVf6D87/Mng= @@ -367,12 +384,16 @@ github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd h1:qdGvebPBDuYD github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723 h1:ZA/jbKoGcVAnER6pCHPEkGdZOV7U1oLUedErBHCUMs0= github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792 h1:R8vQdOQdZ9Y3SkEwmHoWBmX1DNXhXZqlTpq6s4tyJGc= github.com/btcsuite/winsvc v1.0.0 h1:J9B4L7e3oqhXOcm+2IuNApwzQec85lE+QaikUcCs+dk= +github.com/c-bata/go-prompt v0.2.2 h1:uyKRz6Z6DUyj49QVijyM339UJV9yhbr70gESwbNU3e0= github.com/c-bata/go-prompt v0.2.2/go.mod h1:VzqtzE2ksDBcdln8G7mk2RX9QyGjH+OVqOCSiVIqS34= github.com/census-instrumentation/opencensus-proto v0.4.1 h1:iKLQ0xPNFxR/2hzXZMrBo8f1j86j5WHzznCCQxV/b8g= github.com/census-instrumentation/opencensus-proto v0.4.1/go.mod h1:4T9NM4+4Vw91VeyqjLS6ao50K5bOcLKN6Q42XnYaRYw= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= +github.com/chzyer/logex v1.1.10 h1:Swpa1K6QvQznwJRcfTfQJmTE72DqScAa40E+fbHEXEE= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e h1:fY5BOSpyZCqRo5OhCuC+XN+r/bBCmeuuJtjz+bCNIf8= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1 h1:q763qf9huN11kDQavWsoZXJNW3xEE4JJyHa5Q25/sd8= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/cilium/ebpf v0.9.1 h1:64sn2K3UKw8NbP/blsixRpF3nXuyhz/VjRlRzvlBRu4= github.com/cilium/ebpf v0.9.1/go.mod h1:+OhNOIXx/Fnu1IE8bJz2dzOA+VSfyTfdNUVdlQnxUFY= @@ -427,13 +448,16 @@ github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8 github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f h1:lBNOc5arjvs8E5mO2tbpBpLoyyu8B6e44T7hJy6potg= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c h1:/ovYnF02fwL0kvspmy9AuyKg1JhdTRUgPw4nUxd9oZM= github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= github.com/danieljoos/wincred v1.2.0 h1:ozqKHaLK0W/ii4KVbbvluM91W2H3Sh0BncbUNPS7jLE= github.com/danieljoos/wincred v1.2.0/go.mod h1:FzQLLMKBFdvu+osBrnFODiv32YGwCfx0SkRa/eYHgec= +github.com/dave/jennifer v1.2.0 h1:S15ZkFMRoJ36mGAQgWL1tnr0NQJh9rZ8qatseX/VbBc= github.com/dave/jennifer v1.2.0/go.mod h1:fIb+770HOpJ2fmN9EPPKOqm1vMGhB+TwXKMZhrIygKg= github.com/dchest/blake512 v1.0.0 h1:oDFEQFIqFSeuA34xLtXZ/rWxCXdSjirjzPhey5EUvmA= github.com/dchest/blake512 v1.0.0/go.mod h1:FV1x7xPPLWukZlpDpWQ88rF/SFwZ5qbskrzhLMB92JI= github.com/deckarep/golang-set v0.0.0-20180603214616-504e848d77ea/go.mod h1:93vsz/8Wt4joVM7c2AVqh+YRMiUSc14yDtF28KmMOgQ= +github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK09Y2A4Xv7EE0= github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 h1:YLtO71vCjJRCBcrPMtQ9nqBsqpA1m5sE92cU+pd5Mcc= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs= @@ -442,6 +466,7 @@ github.com/deepmap/oapi-codegen v1.8.2 h1:SegyeYGcdi0jLLrpbCMoJxnUUn8GBXHsvr4rbz github.com/deepmap/oapi-codegen v1.8.2/go.mod h1:YLgSKSDv/bZQB7N4ws6luhozi3cEdRktEqrX88CvjIw= github.com/denisenkom/go-mssqldb v0.0.0-20191128021309-1d7a30a10f73 h1:OGNva6WhsKst5OZf7eZOklDztV3hwtTHovdrLHV+MsA= github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= +github.com/dgryski/go-bitstream v0.0.0-20180413035011-3522498ce2c8 h1:akOQj8IVgoeFfBTzGOEQakCYshWD6RNo1M5pivFXt70= github.com/dgryski/go-bitstream v0.0.0-20180413035011-3522498ce2c8/go.mod h1:VMaSuZ+SZcx/wljOQKvp5srsbCiKDEb6K2wC4+PiBmQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954 h1:RMLoZVzv4GliuWafOuPuQDKSm1SJph7uCRnnS61JAn4= github.com/dimchansky/utfbom v1.1.1 h1:vV6w1AhK4VMnhBno/TPVCoK9U/LP0PkLCS9tbxHdi/U= @@ -454,9 +479,12 @@ github.com/docker/docker v1.4.2-0.20180625184442-8e610b2b55bf/go.mod h1:eEKB0N0r github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815 h1:bWDMxwH3px2JBh6AyO7hdCn/PkvCZXii8TGj7sbtEbQ= github.com/dop251/goja v0.0.0-20211011172007-d99e4b8cbf48 h1:iZOop7pqsg+56twTopWgwCGxdB5SI2yDO8Ti7eTRliQ= github.com/dop251/goja v0.0.0-20211011172007-d99e4b8cbf48/go.mod h1:R9ET47fwRVRPZnOGvHxxhuZcbrMCuiqOz3Rlrh4KSnk= +github.com/dop251/goja v0.0.0-20220405120441-9037c2b61cbf h1:Yt+4K30SdjOkRoRRm3vYNQgR+/ZIy0RmeUDZo7Y8zeQ= github.com/dop251/goja v0.0.0-20220405120441-9037c2b61cbf/go.mod h1:R9ET47fwRVRPZnOGvHxxhuZcbrMCuiqOz3Rlrh4KSnk= +github.com/dop251/goja_nodejs v0.0.0-20210225215109-d91c329300e7 h1:tYwu/z8Y0NkkzGEh3z21mSWggMg4LwLRFucLS7TjARg= github.com/dop251/goja_nodejs v0.0.0-20210225215109-d91c329300e7/go.mod h1:hn7BA7c8pLvoGndExHudxTDKZ84Pyvv+90pbBjbTz0Y= github.com/dvsekhvalnov/jose2go v0.0.0-20170216131308-f21a8cedbbae h1:UTOyRlLeWJrZx+ynml6q6qzZ1uDkJe/0Z5CMZRbEIJg= +github.com/eclipse/paho.mqtt.golang v1.2.0 h1:1F8mhG9+aO5/xpdtFkW4SxOJB67ukuDC3t2y2qayIX0= github.com/eclipse/paho.mqtt.golang v1.2.0/go.mod h1:H9keYFcgq3Qr5OUJm/JZI/i6U7joQ8SYLhZwfeOo6Ts= github.com/envoyproxy/go-control-plane v0.11.1 h1:wSUXTlLfiAQRWs2F+p+EKOY9rUyis1MyGqJ2DIk5HpM= github.com/envoyproxy/go-control-plane v0.11.1/go.mod h1:uhMcXKCQMEJHiAb0w+YGefQLaTEw+YhGluxZkrTmD0g= @@ -469,23 +497,32 @@ github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fjl/gencodec v0.0.0-20220412091415-8bb9e558978c h1:CndMRAH4JIwxbW8KYq6Q+cGWcGHz0FjGR3QqcInWcW0= github.com/fjl/gencodec v0.0.0-20220412091415-8bb9e558978c/go.mod h1:AzA8Lj6YtixmJWL+wkKoBGsLWy9gFrAzi4g+5bCKwpY= github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= +github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90 h1:WXb3TSNmHp2vHoCroCIB1foO/yQ36swABL8aOVeDpgg= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/form3tech-oss/jwt-go v3.2.3+incompatible h1:7ZaBxOI7TMoYBfyA3cQHErNNyAWIKUMIwqxEtgHOs5c= github.com/form3tech-oss/jwt-go v3.2.3+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/fxamacker/cbor/v2 v2.4.0 h1:ri0ArlOR+5XunOP8CRUowT0pSJOwhW098ZCUyskZD88= github.com/fxamacker/cbor/v2 v2.4.0/go.mod h1:TA1xS00nchWmaBnEIxPSE5oHLuJBAVvqrtAnWBwBCVo= +github.com/garslo/gogen v0.0.0-20170306192744-1d203ffc1f61 h1:IZqZOB2fydHte3kUgxrzK5E1fW7RQGeDwE8F/ZZnUYc= github.com/garslo/gogen v0.0.0-20170306192744-1d203ffc1f61/go.mod h1:Q0X6pkwTILDlzrGEckF6HKjXe48EgsY/l7K7vhY4MW8= github.com/getkin/kin-openapi v0.53.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= +github.com/getkin/kin-openapi v0.61.0 h1:6awGqF5nG5zkVpMsAih1QH4VgzS8phTxECUWIFo7zko= github.com/getkin/kin-openapi v0.61.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= github.com/getsentry/sentry-go v0.11.0 h1:qro8uttJGvNAMr5CLcFI9CHR0aDzXl0Vs3Pmw/oTPg8= github.com/getsentry/sentry-go v0.11.0/go.mod h1:KBQIxiZAetw62Cj8Ri964vAEWVdgfaUCn30Q3bCvANo= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= +github.com/glycerine/go-unsnap-stream v0.0.0-20180323001048-9f0cb55181dd h1:r04MMPyLHj/QwZuMJ5+7tJcBr1AQjpiAK/rZWRrQT7o= github.com/glycerine/go-unsnap-stream v0.0.0-20180323001048-9f0cb55181dd/go.mod h1:/20jfyN9Y5QPEAprSgKAUr+glWDY39ZiUEAYOEv5dsE= +github.com/glycerine/goconvey v0.0.0-20190410193231-58a59202ab31 h1:gclg6gY70GLy3PbkQ1AERPfmLMMagS60DKF78eWwLn8= github.com/glycerine/goconvey v0.0.0-20190410193231-58a59202ab31/go.mod h1:Ogl1Tioa0aV7gstGFO7KhffUsb9M4ydbEbbxpcEDc24= +github.com/go-chi/chi/v5 v5.0.0 h1:DBPx88FjZJH3FsICfDAfIfnb7XxKIYVGG6lOPlhENAg= github.com/go-chi/chi/v5 v5.0.0/go.mod h1:BBug9lr0cqtdAhsu6R4AAdvufI0/XBzAQSsUqJpoZOs= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1 h1:QbL/5oDUmRBzO9/Z7Seo6zf912W/a6Sr4Eu0G/3Jho0= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72 h1:b+9H1GAsx5RsjvDFLoS5zkNBzIQMuVKUYQDmxU3N5XE= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= @@ -497,13 +534,16 @@ github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= github.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk= github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/gofrs/uuid v3.3.0+incompatible h1:8K4tyRfvU1CYPgJsveYFQMhpFd/wXNM7iK6rR7UHz84= github.com/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 h1:au07oEsX2xN0ktxqI+Sida1w446QrXBRJ0nee3SNZlA= github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= github.com/golang-sql/sqlexp v0.1.0 h1:ZCD6MBpcuOVfGVqsEmY5/4FtYiKz6tSyUv9LPEDei6A= github.com/golang-sql/sqlexp v0.1.0/go.mod h1:J4ad9Vo8ZCWQ2GMrC4UCQy1JpCbwU9m3EOqtpKwwwHI= +github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= +github.com/golang/geo v0.0.0-20190916061304-5b978397cfec h1:lJwO/92dFXWeXOZdoGXgptLmNLwynMSHUmU6besqtiw= github.com/golang/geo v0.0.0-20190916061304-5b978397cfec/go.mod h1:QZ0nwyI2jOfgRAoBvP+ab5aRr7c9x7lhGEJrKvBwjWI= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -513,6 +553,7 @@ github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golangci/lint-1 v0.0.0-20181222135242-d2cdd8c08219 h1:utua3L2IbQJmauC5IXdEA547bcoU5dozgQAfc8Onsg4= github.com/golangci/lint-1 v0.0.0-20181222135242-d2cdd8c08219/go.mod h1:/X8TswGSh1pIozq4ZwCfxS0WA5JGXguxk94ar/4c87Y= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4= @@ -527,6 +568,7 @@ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-containerregistry v0.14.0 h1:z58vMqHxuwvAsVwvKEkmVBz2TlgBgH5k6koEXBtlYkw= github.com/google/go-containerregistry v0.14.0/go.mod h1:aiJ2fp/SXvkWgmYHioXnbMdlgB8eXiiYOY55gfN91Wk= github.com/google/gofuzz v1.1.1-0.20200604201612-c04b05f3adfa/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.3.2 h1:IqNFLAmvJOgVlpdEBiQbDc2EwKW77amAycfTuWKdfvw= github.com/google/martian/v3 v3.3.2/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= @@ -535,6 +577,7 @@ github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OI github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 h1:yAJXTCF9TqKcTiHJAE8dj7HMvPfh66eeA2JYW7eFpSE= github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/renameio v0.1.0 h1:GOZbcHa3HfsPKPlmyPyN2KEohoMXOhdMbHrvbpl2QaA= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o= github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw= @@ -572,22 +615,30 @@ github.com/hashicorp/hcl/v2 v2.19.1 h1://i05Jqznmb2EXqa39Nsvyan2o5XyMowW5fnCKW5R github.com/hashicorp/hcl/v2 v2.19.1/go.mod h1:ThLC89FV4p9MPW804KVbe/cEXoQ8NZEh+JtMeeGErHE= github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/huin/goupnp v1.0.2/go.mod h1:0dxJBVBHqTMjIUMkESDTNgOOx/Mw5wYIfyFmdzSamkM= +github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150 h1:vlNjIqmUZ9CMAWsbURYl3a6wZbw7q5RHVvlXTNS/Bs8= github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6 h1:UDMh68UUwekSh5iP2OMhRRZJiiBccgV7axzUG8vi56c= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/iden3/go-iden3-crypto v0.0.15/go.mod h1:dLpM4vEPJ3nDHzhWFXDjzkn1qHoBeOT/3UEhXsEsP3E= +github.com/influxdata/flux v0.65.1 h1:77BcVUCzvN5HMm8+j9PRBQ4iZcu98Dl4Y9rf+J5vhnc= github.com/influxdata/flux v0.65.1/go.mod h1:J754/zds0vvpfwuq7Gc2wRdVwEodfpCFM7mYlOw2LqY= github.com/influxdata/influxdb v1.8.3 h1:WEypI1BQFTT4teLM+1qkEcvUi0dAvopAI/ir0vAiBg8= github.com/influxdata/influxdb v1.8.3/go.mod h1:JugdFhsvvI8gadxOI6noqNeeBHvWNTbfYGtiAn+2jhI= github.com/influxdata/influxdb-client-go/v2 v2.4.0 h1:HGBfZYStlx3Kqvsv1h2pJixbCl/jhnFtxpKFAv9Tu5k= github.com/influxdata/influxdb-client-go/v2 v2.4.0/go.mod h1:vLNHdxTJkIf2mSLvGrpj8TCcISApPoXkaxP8g9uRlW8= +github.com/influxdata/influxql v1.1.1-0.20200828144457-65d3ef77d385 h1:ED4e5Cc3z5vSN2Tz2GkOHN7vs4Sxe2yds6CXvDnvZFE= github.com/influxdata/influxql v1.1.1-0.20200828144457-65d3ef77d385/go.mod h1:gHp9y86a/pxhjJ+zMjNXiQAA197Xk9wLxaz+fGG+kWk= github.com/influxdata/line-protocol v0.0.0-20180522152040-32c6aa80de5e/go.mod h1:4kt73NQhadE3daL3WhR5EJ/J2ocX0PZzwxQ0gXJ7oFE= github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839/go.mod h1:xaLFMmpvUxqXtVkUJfg9QmT88cDaCJ3ZKgdZ78oO8Qo= github.com/influxdata/line-protocol v0.0.0-20210311194329-9aa0e372d097 h1:vilfsDSy7TDxedi9gyBkMvAirat/oRcL0lFdJBf6tdM= github.com/influxdata/line-protocol v0.0.0-20210311194329-9aa0e372d097/go.mod h1:xaLFMmpvUxqXtVkUJfg9QmT88cDaCJ3ZKgdZ78oO8Qo= +github.com/influxdata/promql/v2 v2.12.0 h1:kXn3p0D7zPw16rOtfDR+wo6aaiH8tSMfhPwONTxrlEc= github.com/influxdata/promql/v2 v2.12.0/go.mod h1:fxOPu+DY0bqCTCECchSRtWfc+0X19ybifQhZoQNF5D8= +github.com/influxdata/roaring v0.4.13-0.20180809181101-fc520f41fab6 h1:UzJnB7VRL4PSkUJHwsyzseGOmrO/r4yA+AuxGJxiZmA= github.com/influxdata/roaring v0.4.13-0.20180809181101-fc520f41fab6/go.mod h1:bSgUQ7q5ZLSO+bKBGqJiCBGAl+9DxyW63zLTujjUlOE= +github.com/influxdata/tdigest v0.0.0-20181121200506-bf2b5ad3c0a9 h1:MHTrDWmQpHq/hkq+7cw9oYAt2PqUw52TZazRA0N7PGE= github.com/influxdata/tdigest v0.0.0-20181121200506-bf2b5ad3c0a9/go.mod h1:Js0mqiSBE6Ffsg94weZZ2c+v/ciT8QRHFOap7EKDrR0= +github.com/influxdata/usage-client v0.0.0-20160829180054-6d3895376368 h1:+TUUmaFa4YD1Q+7bH9o5NCHQGPMqZCYJiNW6lIIS9z4= github.com/influxdata/usage-client v0.0.0-20160829180054-6d3895376368/go.mod h1:Wbbw6tYNvwa5dlB6304Sd+82Z3f7PmVZHVKU637d4po= github.com/intel/goresctrl v0.3.0 h1:K2D3GOzihV7xSBedGxONSlaw/un1LZgWsc9IfqipN4c= github.com/intel/goresctrl v0.3.0/go.mod h1:fdz3mD85cmP9sHD8JUlrNWAxvwM86CrbmVXltEKd7zk= @@ -605,15 +656,20 @@ github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2E github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/jrick/logrotate v1.0.0 h1:lQ1bL/n9mBNeIXoTUoYRlK4dHuNJVofX9oWqBtPnSzI= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jstemmer/go-junit-report v0.9.1 h1:6QPYqodiu3GuPL+7mfx+NwDdp2eTkp9IfEUpgAwUN0o= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/jsternberg/zap-logfmt v1.0.0 h1:0Dz2s/eturmdUS34GM82JwNEdQ9hPoJgqptcEKcbpzY= github.com/jsternberg/zap-logfmt v1.0.0/go.mod h1:uvPs/4X51zdkcm5jXl5SYoN+4RK21K8mysFmDaM/h+o= github.com/juju/loggo v0.0.0-20190526231331-6e530bcce5d8 h1:UUHMLvzt/31azWTN/ifGWef4WUqvXk0iRqdhdy/2uzI= github.com/julienschmidt/httprouter v1.3.0 h1:U0609e9tgbseu3rBINet9P48AI/D3oJs4dN7jwJOQ1U= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= +github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5 h1:PJr+ZMXIecYc1Ey2zucXdR73SMBtgjPgwa31099IMv0= github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= +github.com/jwilder/encoding v0.0.0-20170811194829-b4e1701a28ef h1:2jNeR4YUziVtswNP9sEFAI913cVrzH85T+8Q6LpYbT0= github.com/jwilder/encoding v0.0.0-20170811194829-b4e1701a28ef/go.mod h1:Ct9fl0F6iIOGgxJ5npU/IUOhOhqlVrGjyIZc8/MagT0= github.com/karalabe/usb v0.0.0-20211005121534-4c5740d64559 h1:0VWDXPNE0brOek1Q8bLfzKkvOzwbQE/snjGojlCr8CY= github.com/karalabe/usb v0.0.0-20211005121534-4c5740d64559/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= +github.com/karalabe/usb v0.0.2 h1:M6QQBNxF+CQ8OFvxrT90BA0qBOXymndZnk5q235mFc4= github.com/karalabe/usb v0.0.2/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/errcheck v1.5.0 h1:e8esj/e4R+SAOwFwN+n3zr0nYeCyeweozKfO23MvHzY= @@ -624,8 +680,11 @@ github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23 h1:FOOIBWrEkLgmlgGfM github.com/klauspost/asmfmt v1.3.2 h1:4Ri7ox3EwapiOjCki+hw14RyKk201CN4rzyCJRFLpK4= github.com/klauspost/asmfmt v1.3.2/go.mod h1:AG8TuvYojzulgDAMCnYn50l/5QV3Bs/tp6j0HLHbNSE= github.com/klauspost/compress v1.4.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= +github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5 h1:2U0HzY8BJ8hVwDKIzp7y4voR9CX/nvcfymLmg2UiOio= github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= +github.com/klauspost/crc32 v0.0.0-20161016154125-cb6bfca970f6 h1:KAZ1BW2TCmT6PRihDPpocIy1QTtsAsrx6TneU/4+CMg= github.com/klauspost/crc32 v0.0.0-20161016154125-cb6bfca970f6/go.mod h1:+ZoRqAPRLkC4NPOvfYeR5KNOrY6TD+/sAC3HXPZgDYg= +github.com/klauspost/pgzip v1.0.2-0.20170402124221-0bf5dcad4ada h1:3L+neHp83cTjegPdCiOxVOJtRIy7/8RldvMTsyPYH10= github.com/klauspost/pgzip v1.0.2-0.20170402124221-0bf5dcad4ada/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= github.com/knz/go-libedit v1.10.1 h1:0pHpWtx9vcvC0xGZqEQlQdfSQs7WRlAjuPvk3fOZDCo= github.com/konsorten/go-windows-terminal-sequences v1.0.2 h1:DB17ag19krx9CFsz4o3enTrPXyIXCl+2iCXH/aMAp9s= @@ -635,7 +694,9 @@ github.com/kylelemons/go-gypsy v1.0.0 h1:7/wQ7A3UL1bnqRMnZ6T8cwCOArfZCxFmb1iTxaO github.com/kylelemons/go-gypsy v1.0.0/go.mod h1:chkXM0zjdpXOiqkCW1XcCHDfjfk14PH2KKkQWxfJUcU= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= +github.com/labstack/echo/v4 v4.2.1 h1:LF5Iq7t/jrtUuSutNuiEWtB5eiHfZ5gSe2pcu5exjQw= github.com/labstack/echo/v4 v4.2.1/go.mod h1:AA49e0DZ8kk5jTOOCKNuPR6oTnBS0dYiM4FW1e6jwpg= +github.com/labstack/gommon v0.3.0 h1:JEeO0bvc78PKdyHxloTKiF8BD5iGrH8T6MSeGvSgob0= github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= github.com/lestrrat-go/backoff/v2 v2.0.8 h1:oNb5E5isby2kiro9AgdHLv5N5tint1AnDVVf2E2un5A= github.com/lestrrat-go/backoff/v2 v2.0.8/go.mod h1:rHP/q/r9aT27n24JQLa7JhSQZCKBBOiM/uP402WwN8Y= @@ -652,6 +713,7 @@ github.com/lestrrat-go/option v1.0.0/go.mod h1:5ZHFbivi4xwXxhxY9XHDe2FHo6/Z7WWmt github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/linuxkit/virtsock v0.0.0-20201010232012-f8cee7dfc7a3 h1:jUp75lepDg0phMUJBCmvaeFDldD2N3S1lBuPwUTszio= github.com/linuxkit/virtsock v0.0.0-20201010232012-f8cee7dfc7a3/go.mod h1:3r6x7q95whyfWQpmGZTu3gk3v2YkMi05HEzl7Tf7YEo= +github.com/matryer/moq v0.0.0-20190312154309-6cfb0558e1bd h1:HvFwW+cm9bCbZ/+vuGNq7CRWXql8c0y8nGeYpqmpvmk= github.com/matryer/moq v0.0.0-20190312154309-6cfb0558e1bd/go.mod h1:9ELz6aaclSIGnZBoaSLZ3NAl1VTufbOrXBPvtcy6WiQ= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= @@ -664,6 +726,7 @@ github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2y github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= +github.com/mattn/go-tty v0.0.0-20180907095812-13ff1204f104 h1:d8RFOZ2IiFtFWBcKEHAFYJcPTf0wY5q0exFNJZVWa1U= github.com/mattn/go-tty v0.0.0-20180907095812-13ff1204f104/go.mod h1:XPvLUNfbS4fJH25nqRHfWLMa1ONC8Amw+mIA639KxkE= github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 h1:jWpvCLoY8Z/e3VKvlsiIGKtc+UG6U5vzxaoagmhXfyg= github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQthUoa9bqDv0ER0wrtXnBruoNd7aNjkbP+k= @@ -688,6 +751,7 @@ github.com/mitchellh/hashstructure/v2 v2.0.2/go.mod h1:MG3aRVU/N29oo/V/IhBX8GR/z github.com/mmcloughlin/profile v0.1.1 h1:jhDmAqPyebOsVDOCICJoINoLb/AnLBaUw58nFzxWS2w= github.com/moby/sys/mount v0.3.3 h1:fX1SVkXFJ47XWDoeFW4Sq7PdQJnV2QIDZAqjNqgEjUs= github.com/moby/sys/mount v0.3.3/go.mod h1:PBaEorSNTLG5t/+4EgukEQVlAvVEc6ZjTySwKdqp5K0= +github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae h1:VeRdUYdCw49yizlSbMEn2SZ+gT+3IUKx8BqxyQdz+BY= github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae/go.mod h1:qAyveg+e4CE+eKJXWVjKXM4ck2QobLqTDytGJbLLhJg= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= @@ -713,25 +777,30 @@ github.com/otiai10/copy v1.14.0 h1:dCI/t1iTdYGtkvCuBG2BgR6KZa83PTclw4U5n2wAllU= github.com/otiai10/copy v1.14.0/go.mod h1:ECfuL02W+/FkTWZWgQqXPWZgW9oeKCSQ5qVfSc4qc4w= github.com/package-url/packageurl-go v0.1.1-0.20220428063043-89078438f170 h1:DiLBVp4DAcZlBVBEtJpNWZpZVq0AEeCY7Hqk8URVs4o= github.com/package-url/packageurl-go v0.1.1-0.20220428063043-89078438f170/go.mod h1:uQd4a7Rh3ZsVg5j0lNyAfyxIeGde9yrlhjF78GzeW0c= +github.com/paulbellamy/ratecounter v0.2.0 h1:2L/RhJq+HA8gBQImDXtLPrDXK5qAj6ozWVK/zFXVJGs= github.com/paulbellamy/ratecounter v0.2.0/go.mod h1:Hfx1hDpSGoqxkVVpBi/IlYD7kChlfo5C6hzIHwPqfFE= github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/peterh/liner v1.0.1-0.20180619022028-8c1271fcf47f/go.mod h1:xIteQHvHuaLYG9IFj6mSxM0fCKrs34IrEQUhOYuGPHc= github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7 h1:oYW+YCJ1pachXTQmzR3rNLYGGz4g/UgFcjb28p/viDM= github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0= +github.com/philhofer/fwd v1.0.0 h1:UbZqGr5Y38ApvM/V/jEljVxwocdweyH+vmYvRPBnbqQ= github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= +github.com/pierrec/lz4 v2.0.5+incompatible h1:2xWsjqPFWcplujydGg4WmhC/6fZqK42wMM8aXeqhl0I= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 h1:Qj1ukM4GlMWXNdMBuXcXfz/Kw9s1qm0CLY32QxuSImI= github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e h1:aoZm08cpOy4WuID//EZDgcC4zIxODThtZNPirFr42+A= github.com/pkg/profile v1.5.0 h1:042Buzk+NhDI+DeSAA62RwJL8VAuZUMQZUjCsRz1Mug= github.com/pkg/profile v1.5.0/go.mod h1:qBsxPvzyUincmltOk6iyRVxHYg4adc0OFOv72ZdLa18= +github.com/pkg/term v0.0.0-20180730021639-bffc007b7fd5 h1:tFwafIEMf0B7NlcxV/zJ6leBIa81D3hgGSgsE5hCkOQ= github.com/pkg/term v0.0.0-20180730021639-bffc007b7fd5/go.mod h1:eCbImbZ95eXtAUIbLAuAVnBnwf83mjf6QIVH8SHYwqQ= github.com/pquerna/cachecontrol v0.1.0 h1:yJMy84ti9h/+OEWa752kBTKv4XC30OtVVHYv/8cTqKc= github.com/pquerna/cachecontrol v0.1.0/go.mod h1:NrUG3Z7Rdu85UNR3vm7SOsl1nFIeSiQnrHV5K9mBcUI= github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 h1:MkV+77GLUNo5oJ0jf870itWm3D0Sjh7+Za9gazKc5LQ= github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/retailnext/hllpp v1.0.1-0.20180308014038-101a6d2f8b52 h1:RnWNS9Hlm8BIkjr6wx8li5abe0fr73jljLycdfemTp0= github.com/retailnext/hllpp v1.0.1-0.20180308014038-101a6d2f8b52/go.mod h1:RDpi1RftBQPUCDRw6SmxeaREsAaRKnOclghuzp/WRzc= github.com/rogpeppe/fastuuid v1.2.0 h1:Ppwyp6VYCF1nvBTXL3trRso7mXMlRrw9ooo375wvi2s= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= @@ -740,16 +809,17 @@ github.com/russross/blackfriday v1.6.0 h1:KqfZb0pUVN2lYqZUYRddxF4OR8ZMURnJIG5Y3V github.com/russross/blackfriday v1.6.0/go.mod h1:ti0ldHuxg49ri4ksnFxlkCfN+hvslNlmVHqNRXXJNAY= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/scroll-tech/da-codec v0.0.0-20240605080813-32bfc9fccde7/go.mod h1:1wWYii0OPwd5kw+xrz0PFgS420xNadrNF1x/ELJT+TM= -github.com/scroll-tech/da-codec v0.0.0-20240819100936-c6af3bbe7068 h1:oVGwhg4cCq35B04eG/S4OBXDwXiFH7+LezuH2ZTRBPs= -github.com/scroll-tech/da-codec v0.0.0-20240819100936-c6af3bbe7068/go.mod h1:D6XEESeNVJkQJlv3eK+FyR+ufPkgVQbJzERylQi53Bs= github.com/scroll-tech/go-ethereum v1.10.14-0.20240607130425-e2becce6a1a4/go.mod h1:byf/mZ8jLYUCnUePTicjJWn+RvKdxDn7buS6glTnMwQ= github.com/segmentio/kafka-go v0.1.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo= +github.com/segmentio/kafka-go v0.2.0 h1:HtCSf6B4gN/87yc5qTl7WsxPKQIIGXLPPM1bMCPOsoY= github.com/segmentio/kafka-go v0.2.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo= +github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/shurcooL/go v0.0.0-20200502201357-93f07166e636 h1:aSISeOcal5irEhJd1M+IrApc0PdcN7e7Aj4yuEnOrfQ= github.com/shurcooL/go v0.0.0-20200502201357-93f07166e636/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749 h1:bUGsEnyNbVPw06Bs80sCeARAlK8lhwqGyi6UT8ymuGk= github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg= +github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/shurcooL/vfsgen v0.0.0-20200824052919-0d455de96546 h1:pXY9qYc/MP5zdvqWEUH6SjNiu7VhSjuVFTFiTcphaLU= github.com/shurcooL/vfsgen v0.0.0-20200824052919-0d455de96546/go.mod h1:TrYk7fJVaAttu97ZZKrO9UbRa8izdowaMIZcxYMbVaw= @@ -775,6 +845,7 @@ github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 h1:kdXcSzyDtse github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/tchap/go-patricia/v2 v2.3.1 h1:6rQp39lgIYZ+MHmdEq4xzuk1t7OdC35z/xm0BGhTkes= github.com/tchap/go-patricia/v2 v2.3.1/go.mod h1:VZRHKAb53DLaG+nA9EaYYiaEx6YztwDlLElMsnSHD4k= +github.com/tinylib/msgp v1.0.2 h1:DfdQrzQa7Yh2es9SuLkixqxuXS2SxsdYn0KbdrOGWD8= github.com/tinylib/msgp v1.0.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802 h1:uruHq4dN7GR16kFc5fp3d1RIYzJW5onx8Ybykw2YQFA= github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= @@ -787,8 +858,10 @@ github.com/ugorji/go v1.2.7 h1:qYhyWUUd6WbiM+C6JZAUkIJt/1WrjzNHY9+KCIjVqTo= github.com/urfave/cli v1.22.12 h1:igJgVw1JdKH+trcLWLeLwZjU9fEfPesQ+9/e4MQ44S8= github.com/urfave/cli v1.22.12/go.mod h1:sSBEIC79qR6OvcmsD4U3KABeOTxDqQtdDnaFuUN30b8= github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= +github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= +github.com/valyala/fasttemplate v1.2.1 h1:TVEnxayobAdVkhQfrfes2IzOB6o+z4roRkPF52WA1u4= github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= github.com/vektah/gqlparser/v2 v2.4.5 h1:C02NsyEsL4TXJB7ndonqTfuQOL4XPIu0aAWugdmTgmc= github.com/vektah/gqlparser/v2 v2.4.5/go.mod h1:flJWIR04IMQPGz+BXLrORkrARBxv/rtyIAFvd/MceW0= @@ -798,6 +871,7 @@ github.com/vishvananda/netlink v1.2.1-beta.2 h1:Llsql0lnQEbHj0I1OuKyp8otXp0r3q0m github.com/vishvananda/netlink v1.2.1-beta.2/go.mod h1:twkDnbuQxJYemMlGd4JFIcuhgX83tXhKS2B/PRMpOho= github.com/vishvananda/netns v0.0.0-20210104183010-2eb08e3e575f h1:p4VB7kIXpOQvVn1ZaTIVp+3vuYAXFe3OJEvjbUYJLaA= github.com/vishvananda/netns v0.0.0-20210104183010-2eb08e3e575f/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0= +github.com/willf/bitset v1.1.3 h1:ekJIKh6+YbUIVt9DfNbkR5d6aFcFTLDRyJNAACURBg8= github.com/willf/bitset v1.1.3/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= @@ -806,6 +880,7 @@ github.com/xhit/go-str2duration v1.2.0/go.mod h1:3cPSlfZlUHVlneIVfePFWcJZsuwf+P1 github.com/xhit/go-str2duration/v2 v2.1.0 h1:lxklc02Drh6ynqX+DdPyp5pCKLUQpRT8bp8Ydu2Bstc= github.com/xhit/go-str2duration/v2 v2.1.0/go.mod h1:ohY8p+0f07DiV6Em5LKB0s2YpLtXVyJfNt1+BlmyAsU= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8= +github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6 h1:YdYsPAZ2pC6Tow/nPZOPQ96O3hm/ToAkGsPLzedXERk= github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77 h1:ESFSdwYZvkeru3RtdrYueztKhOBCSAAzS4Gf+k0tEow= github.com/yashtewari/glob-intersection v0.1.0 h1:6gJvMYQlTDOL3dMsPF6J0+26vwX9MB8/1q3uAdhmTrg= @@ -871,14 +946,17 @@ golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b h1:+qEpEAPhDZ1o0x3tHzZTQDArnOixOzGD9HUJfcg0mb4= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3 h1:XQyxROzUlZH+WIQwySDgnISgOivlhjIEwaQaJEJrrN0= golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f h1:J5lckAjkw6qYlOZNj90mLYNTEKDvWeuc1yieZ8qUzUE= golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028 h1:4+4C/Iv2U4fMZBiMCc98MG1In4gJY5YRhtpDNeDeHWs= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= @@ -962,9 +1040,12 @@ golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3j golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= gonum.org/v1/gonum v0.0.0-20181121035319-3f7ecaa7e8ca/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= +gonum.org/v1/gonum v0.6.0 h1:DJy6UzXbahnGUf1ujUNkh/NEtK14qMo2nvlBPs4U5yw= gonum.org/v1/gonum v0.6.0/go.mod h1:9mxDZsDKxgMAuccQkewq682L+0eCu4dCN2yonUJTCLU= gonum.org/v1/netlib v0.0.0-20181029234149-ec6d1f5cefe6/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= +gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0 h1:OE9mWmgKkjJyEmDAAtGMPjXu+YNeGvK9VTSHY6+Qihc= gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= +gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b h1:Qh4dB5D/WpoUUp3lSod7qgoyEHbDGPUWjIbnqdqqe1k= gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= @@ -1018,6 +1099,7 @@ gotest.tools v1.4.0/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc h1:/hemPrYIhOhy8zYrNj+069zDB68us2sMGsfkFJO0iZs= +honnef.co/go/tools v0.0.1-2019.2.3 h1:3JgtbtFHMiCmsznwGVTUWbgGov+pVqnlf1dEJTNAXeM= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= k8s.io/component-base v0.26.7 h1:uqsOyZh0Zqoaup8tmHa491D/CvgFdGUs+X2H/inNUKM= k8s.io/component-base v0.26.7/go.mod h1:CZe1HTmX/DQdeBrb9XYOXzs96jXth8ZbFvhLMsoJLUg= @@ -1032,6 +1114,7 @@ kernel.org/pub/linux/libs/security/libcap/cap v1.2.67/go.mod h1:GkntoBuwffz19qtd kernel.org/pub/linux/libs/security/libcap/psx v1.2.67 h1:NxbXJ7pDVq0FKBsqjieT92QDXI2XaqH2HAi4QcCOHt8= kernel.org/pub/linux/libs/security/libcap/psx v1.2.67/go.mod h1:+l6Ee2F59XiJ2I6WR5ObpC1utCQJZ/VLsEbQCD8RG24= nullprogram.com/x/optparse v1.0.0 h1:xGFgVi5ZaWOnYdac2foDT3vg0ZZC9ErXFV57mr4OHrI= +rsc.io/binaryregexp v0.2.0 h1:HfqmD5MEmC0zvwBuF187nq9mdnXjXsSivRiXN7SmRkE= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/pdf v0.1.1 h1:k1MczvYDUvJBe93bYd7wrZLLUEcLZAuF824/I4e5Xr4= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.37 h1:fAPTNEpzQMOLMGwOHNbUkR2xXTQwMJOZYNx+/mLlOh0= diff --git a/prover/Cargo.lock b/prover/Cargo.lock index ded147e00d..10dfca9ae5 100644 --- a/prover/Cargo.lock +++ b/prover/Cargo.lock @@ -30,8 +30,8 @@ dependencies = [ [[package]] name = "aggregator" -version = "0.11.0" -source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.11.5#6ea8fb3fad4d8a8bfe873e18e2f881ad1c807ded" +version = "0.12.0" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.12.0#6a1f65a1f99429f3725ef4d6788f5643bb61aa6f" dependencies = [ "ark-std 0.3.0", "bitstream-io", @@ -39,9 +39,9 @@ dependencies = [ "ctor 0.1.26", "encoder", "env_logger 0.10.2", - "eth-types 0.11.0", + "eth-types 0.12.0", "ethers-core 2.0.7 (git+https://github.com/scroll-tech/ethers-rs.git?branch=v2.0.7)", - "gadgets 0.11.0", + "gadgets 0.12.0", "halo2-base", "halo2-ecc", "halo2_proofs", @@ -59,13 +59,13 @@ dependencies = [ "snark-verifier-sdk", "strum 0.25.0", "strum_macros 0.25.3", - "zkevm-circuits 0.11.0", + "zkevm-circuits 0.12.0", ] [[package]] name = "aggregator" -version = "0.12.0" -source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.12.0#6a1f65a1f99429f3725ef4d6788f5643bb61aa6f" +version = "0.13.0" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.13.0#cf71a0e324d42f7895363f4f3e8575d79bb7ea97" dependencies = [ "ark-std 0.3.0", "bitstream-io", @@ -73,9 +73,9 @@ dependencies = [ "ctor 0.1.26", "encoder", "env_logger 0.10.2", - "eth-types 0.12.0", + "eth-types 0.13.0", "ethers-core 2.0.7 (git+https://github.com/scroll-tech/ethers-rs.git?branch=v2.0.7)", - "gadgets 0.12.0", + "gadgets 0.13.0", "halo2-base", "halo2-ecc", "halo2_proofs", @@ -93,7 +93,7 @@ dependencies = [ "snark-verifier-sdk", "strum 0.25.0", "strum_macros 0.25.3", - "zkevm-circuits 0.12.0", + "zkevm-circuits 0.13.0", ] [[package]] @@ -634,24 +634,22 @@ checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "bus-mapping" -version = "0.11.0" -source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.11.5#6ea8fb3fad4d8a8bfe873e18e2f881ad1c807ded" +version = "0.12.0" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.12.0#6a1f65a1f99429f3725ef4d6788f5643bb61aa6f" dependencies = [ - "eth-types 0.11.0", + "eth-types 0.12.0", "ethers-core 2.0.7 (git+https://github.com/scroll-tech/ethers-rs.git?branch=v2.0.7)", "ethers-providers 2.0.7 (registry+https://github.com/rust-lang/crates.io-index)", "ethers-signers", - "external-tracer 0.11.0", - "gadgets 0.11.0", + "gadgets 0.12.0", "halo2_proofs", "hex", "itertools 0.11.0", "log", - "mock 0.11.0", - "mpt-zktrie 0.11.0", + "mock 0.12.0", + "mpt-zktrie 0.12.0", "num", "poseidon-circuit", - "rand", "revm-precompile", "serde", "serde_json", @@ -661,20 +659,20 @@ dependencies = [ [[package]] name = "bus-mapping" -version = "0.12.0" -source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.12.0#6a1f65a1f99429f3725ef4d6788f5643bb61aa6f" +version = "0.13.0" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.13.0#cf71a0e324d42f7895363f4f3e8575d79bb7ea97" dependencies = [ - "eth-types 0.12.0", + "eth-types 0.13.0", "ethers-core 2.0.7 (git+https://github.com/scroll-tech/ethers-rs.git?branch=v2.0.7)", "ethers-providers 2.0.7 (registry+https://github.com/rust-lang/crates.io-index)", "ethers-signers", - "gadgets 0.12.0", + "gadgets 0.13.0", "halo2_proofs", "hex", "itertools 0.11.0", "log", - "mock 0.12.0", - "mpt-zktrie 0.12.0", + "mock 0.13.0", + "mpt-zktrie 0.13.0", "num", "poseidon-circuit", "revm-precompile", @@ -1311,8 +1309,8 @@ dependencies = [ [[package]] name = "eth-types" -version = "0.11.0" -source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.11.5#6ea8fb3fad4d8a8bfe873e18e2f881ad1c807ded" +version = "0.12.0" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.12.0#6a1f65a1f99429f3725ef4d6788f5643bb61aa6f" dependencies = [ "base64 0.13.1", "ethers-core 2.0.7 (git+https://github.com/scroll-tech/ethers-rs.git?branch=v2.0.7)", @@ -1329,7 +1327,6 @@ dependencies = [ "revm-primitives", "serde", "serde_json", - "serde_stacker", "serde_with", "sha3 0.10.8", "strum 0.25.0", @@ -1340,8 +1337,8 @@ dependencies = [ [[package]] name = "eth-types" -version = "0.12.0" -source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.12.0#6a1f65a1f99429f3725ef4d6788f5643bb61aa6f" +version = "0.13.0" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.13.0#cf71a0e324d42f7895363f4f3e8575d79bb7ea97" dependencies = [ "base64 0.13.1", "ethers-core 2.0.7 (git+https://github.com/scroll-tech/ethers-rs.git?branch=v2.0.7)", @@ -1560,11 +1557,11 @@ dependencies = [ [[package]] name = "external-tracer" -version = "0.11.0" -source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.11.5#6ea8fb3fad4d8a8bfe873e18e2f881ad1c807ded" +version = "0.12.0" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.12.0#6a1f65a1f99429f3725ef4d6788f5643bb61aa6f" dependencies = [ - "eth-types 0.11.0", - "geth-utils 0.11.0", + "eth-types 0.12.0", + "geth-utils 0.12.0", "log", "serde", "serde_json", @@ -1573,11 +1570,11 @@ dependencies = [ [[package]] name = "external-tracer" -version = "0.12.0" -source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.12.0#6a1f65a1f99429f3725ef4d6788f5643bb61aa6f" +version = "0.13.0" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.13.0#cf71a0e324d42f7895363f4f3e8575d79bb7ea97" dependencies = [ - "eth-types 0.12.0", - "geth-utils 0.12.0", + "eth-types 0.13.0", + "geth-utils 0.13.0", "log", "serde", "serde_json", @@ -1790,10 +1787,10 @@ dependencies = [ [[package]] name = "gadgets" -version = "0.11.0" -source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.11.5#6ea8fb3fad4d8a8bfe873e18e2f881ad1c807ded" +version = "0.12.0" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.12.0#6a1f65a1f99429f3725ef4d6788f5643bb61aa6f" dependencies = [ - "eth-types 0.11.0", + "eth-types 0.12.0", "halo2_proofs", "poseidon-base", "sha3 0.10.8", @@ -1802,10 +1799,10 @@ dependencies = [ [[package]] name = "gadgets" -version = "0.12.0" -source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.12.0#6a1f65a1f99429f3725ef4d6788f5643bb61aa6f" +version = "0.13.0" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.13.0#cf71a0e324d42f7895363f4f3e8575d79bb7ea97" dependencies = [ - "eth-types 0.12.0", + "eth-types 0.13.0", "halo2_proofs", "poseidon-base", "sha3 0.10.8", @@ -1825,8 +1822,8 @@ dependencies = [ [[package]] name = "geth-utils" -version = "0.11.0" -source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.11.5#6ea8fb3fad4d8a8bfe873e18e2f881ad1c807ded" +version = "0.12.0" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.12.0#6a1f65a1f99429f3725ef4d6788f5643bb61aa6f" dependencies = [ "env_logger 0.10.2", "gobuild", @@ -1835,8 +1832,8 @@ dependencies = [ [[package]] name = "geth-utils" -version = "0.12.0" -source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.12.0#6a1f65a1f99429f3725ef4d6788f5643bb61aa6f" +version = "0.13.0" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.13.0#cf71a0e324d42f7895363f4f3e8575d79bb7ea97" dependencies = [ "env_logger 0.10.2", "gobuild", @@ -2675,13 +2672,13 @@ dependencies = [ [[package]] name = "mock" -version = "0.11.0" -source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.11.5#6ea8fb3fad4d8a8bfe873e18e2f881ad1c807ded" +version = "0.12.0" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.12.0#6a1f65a1f99429f3725ef4d6788f5643bb61aa6f" dependencies = [ - "eth-types 0.11.0", + "eth-types 0.12.0", "ethers-core 2.0.7 (git+https://github.com/scroll-tech/ethers-rs.git?branch=v2.0.7)", "ethers-signers", - "external-tracer 0.11.0", + "external-tracer 0.12.0", "itertools 0.11.0", "log", "rand", @@ -2690,13 +2687,13 @@ dependencies = [ [[package]] name = "mock" -version = "0.12.0" -source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.12.0#6a1f65a1f99429f3725ef4d6788f5643bb61aa6f" +version = "0.13.0" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.13.0#cf71a0e324d42f7895363f4f3e8575d79bb7ea97" dependencies = [ - "eth-types 0.12.0", + "eth-types 0.13.0", "ethers-core 2.0.7 (git+https://github.com/scroll-tech/ethers-rs.git?branch=v2.0.7)", "ethers-signers", - "external-tracer 0.12.0", + "external-tracer 0.13.0", "itertools 0.11.0", "log", "rand", @@ -2705,30 +2702,30 @@ dependencies = [ [[package]] name = "mpt-zktrie" -version = "0.11.0" -source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.11.5#6ea8fb3fad4d8a8bfe873e18e2f881ad1c807ded" +version = "0.12.0" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.12.0#6a1f65a1f99429f3725ef4d6788f5643bb61aa6f" dependencies = [ - "eth-types 0.11.0", + "eth-types 0.12.0", "halo2curves", "hex", "log", "num-bigint", "poseidon-base", - "zktrie", + "zktrie 0.3.0 (git+https://github.com/scroll-tech/zktrie.git?branch=main)", ] [[package]] name = "mpt-zktrie" -version = "0.12.0" -source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.12.0#6a1f65a1f99429f3725ef4d6788f5643bb61aa6f" +version = "0.13.0" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.13.0#cf71a0e324d42f7895363f4f3e8575d79bb7ea97" dependencies = [ - "eth-types 0.12.0", + "eth-types 0.13.0", "halo2curves", "hex", "log", "num-bigint", "poseidon-base", - "zktrie", + "zktrie 0.3.0 (git+https://github.com/scroll-tech/zktrie.git?branch=v0.9)", ] [[package]] @@ -3294,8 +3291,8 @@ dependencies = [ "http 1.1.0", "log", "once_cell", - "prover 0.11.0", "prover 0.12.0", + "prover 0.13.0", "rand", "reqwest 0.12.4", "reqwest-middleware", @@ -3311,17 +3308,17 @@ dependencies = [ [[package]] name = "prover" -version = "0.11.0" -source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.11.5#6ea8fb3fad4d8a8bfe873e18e2f881ad1c807ded" +version = "0.12.0" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.12.0#6a1f65a1f99429f3725ef4d6788f5643bb61aa6f" dependencies = [ - "aggregator 0.11.0", + "aggregator 0.12.0", "anyhow", "base64 0.13.1", "blake2", - "bus-mapping 0.11.0", + "bus-mapping 0.12.0", "chrono", "dotenvy", - "eth-types 0.11.0", + "eth-types 0.12.0", "ethers-core 2.0.7 (git+https://github.com/scroll-tech/ethers-rs.git?branch=v2.0.7)", "git-version", "halo2_proofs", @@ -3329,7 +3326,7 @@ dependencies = [ "itertools 0.11.0", "log", "log4rs", - "mpt-zktrie 0.11.0", + "mpt-zktrie 0.12.0", "num-bigint", "rand", "rand_xorshift", @@ -3340,22 +3337,22 @@ dependencies = [ "sha2", "snark-verifier", "snark-verifier-sdk", - "zkevm-circuits 0.11.0", + "zkevm-circuits 0.12.0", ] [[package]] name = "prover" -version = "0.12.0" -source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.12.0#6a1f65a1f99429f3725ef4d6788f5643bb61aa6f" +version = "0.13.0" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.13.0#cf71a0e324d42f7895363f4f3e8575d79bb7ea97" dependencies = [ - "aggregator 0.12.0", + "aggregator 0.13.0", "anyhow", "base64 0.13.1", "blake2", - "bus-mapping 0.12.0", + "bus-mapping 0.13.0", "chrono", "dotenvy", - "eth-types 0.12.0", + "eth-types 0.13.0", "ethers-core 2.0.7 (git+https://github.com/scroll-tech/ethers-rs.git?branch=v2.0.7)", "git-version", "halo2_proofs", @@ -3363,7 +3360,7 @@ dependencies = [ "itertools 0.11.0", "log", "log4rs", - "mpt-zktrie 0.12.0", + "mpt-zktrie 0.13.0", "num-bigint", "rand", "rand_xorshift", @@ -3374,7 +3371,7 @@ dependencies = [ "sha2", "snark-verifier", "snark-verifier-sdk", - "zkevm-circuits 0.12.0", + "zkevm-circuits 0.13.0", ] [[package]] @@ -5340,18 +5337,18 @@ dependencies = [ [[package]] name = "zkevm-circuits" -version = "0.11.0" -source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.11.5#6ea8fb3fad4d8a8bfe873e18e2f881ad1c807ded" +version = "0.12.0" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.12.0#6a1f65a1f99429f3725ef4d6788f5643bb61aa6f" dependencies = [ "array-init", - "bus-mapping 0.11.0", + "bus-mapping 0.12.0", "either", "env_logger 0.10.2", - "eth-types 0.11.0", + "eth-types 0.12.0", "ethers-core 2.0.7 (git+https://github.com/scroll-tech/ethers-rs.git?branch=v2.0.7)", "ethers-signers", "ff", - "gadgets 0.11.0", + "gadgets 0.12.0", "halo2-base", "halo2-ecc", "halo2-mpt-circuits", @@ -5361,8 +5358,8 @@ dependencies = [ "itertools 0.11.0", "log", "misc-precompiled-circuit", - "mock 0.11.0", - "mpt-zktrie 0.11.0", + "mock 0.12.0", + "mpt-zktrie 0.12.0", "num", "num-bigint", "poseidon-circuit", @@ -5382,18 +5379,18 @@ dependencies = [ [[package]] name = "zkevm-circuits" -version = "0.12.0" -source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.12.0#6a1f65a1f99429f3725ef4d6788f5643bb61aa6f" +version = "0.13.0" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.13.0#cf71a0e324d42f7895363f4f3e8575d79bb7ea97" dependencies = [ "array-init", - "bus-mapping 0.12.0", + "bus-mapping 0.13.0", "either", "env_logger 0.10.2", - "eth-types 0.12.0", + "eth-types 0.13.0", "ethers-core 2.0.7 (git+https://github.com/scroll-tech/ethers-rs.git?branch=v2.0.7)", "ethers-signers", "ff", - "gadgets 0.12.0", + "gadgets 0.13.0", "halo2-base", "halo2-ecc", "halo2-mpt-circuits", @@ -5403,8 +5400,8 @@ dependencies = [ "itertools 0.11.0", "log", "misc-precompiled-circuit", - "mock 0.12.0", - "mpt-zktrie 0.12.0", + "mock 0.13.0", + "mpt-zktrie 0.13.0", "num", "num-bigint", "poseidon-circuit", @@ -5428,7 +5425,16 @@ version = "0.3.0" source = "git+https://github.com/scroll-tech/zktrie.git?branch=main#23181f209e94137f74337b150179aeb80c72e7c8" dependencies = [ "gobuild", - "zktrie_rust", + "zktrie_rust 0.3.0 (git+https://github.com/scroll-tech/zktrie.git?branch=main)", +] + +[[package]] +name = "zktrie" +version = "0.3.0" +source = "git+https://github.com/scroll-tech/zktrie.git?branch=v0.9#460b8c22af65b7809164548cba1e0253b6db5a70" +dependencies = [ + "gobuild", + "zktrie_rust 0.3.0 (git+https://github.com/scroll-tech/zktrie.git?branch=v0.9)", ] [[package]] @@ -5445,6 +5451,20 @@ dependencies = [ "strum_macros 0.24.3", ] +[[package]] +name = "zktrie_rust" +version = "0.3.0" +source = "git+https://github.com/scroll-tech/zktrie.git?branch=v0.9#460b8c22af65b7809164548cba1e0253b6db5a70" +dependencies = [ + "hex", + "lazy_static", + "num", + "num-derive", + "num-traits", + "strum 0.24.1", + "strum_macros 0.24.3", +] + [[package]] name = "zstd" version = "0.13.0" diff --git a/prover/Cargo.toml b/prover/Cargo.toml index 19faa80f84..96b60de9b9 100644 --- a/prover/Cargo.toml +++ b/prover/Cargo.toml @@ -29,8 +29,8 @@ ethers-core = { git = "https://github.com/scroll-tech/ethers-rs.git", branch = " ethers-providers = { git = "https://github.com/scroll-tech/ethers-rs.git", branch = "v2.0.7" } halo2_proofs = { git = "https://github.com/scroll-tech/halo2.git", branch = "v1.1" } snark-verifier-sdk = { git = "https://github.com/scroll-tech/snark-verifier", branch = "develop", default-features = false, features = ["loader_halo2", "loader_evm", "halo2-pse"] } -prover_curie = { git = "https://github.com/scroll-tech/zkevm-circuits.git", tag = "v0.11.5", package = "prover", default-features = false, features = ["parallel_syn", "scroll"] } prover_darwin = { git = "https://github.com/scroll-tech/zkevm-circuits.git", tag = "v0.12.0", package = "prover", default-features = false, features = ["parallel_syn", "scroll"] } +prover_darwin_v2 = { git = "https://github.com/scroll-tech/zkevm-circuits.git", tag = "v0.13.0", package = "prover", default-features = false, features = ["parallel_syn", "scroll"] } base64 = "0.13.1" reqwest = { version = "0.12.4", features = ["gzip"] } reqwest-middleware = "0.3" diff --git a/prover/config.json b/prover/config.json index daaf989f53..0a816360d5 100644 --- a/prover/config.json +++ b/prover/config.json @@ -3,7 +3,7 @@ "keystore_path": "keystore.json", "keystore_password": "prover-pwd", "db_path": "unique-db-path-for-prover-1", - "proof_type": 2, + "prover_type": 2, "low_version_circuit": { "hard_fork_name": "bernoulli", "params_path": "params", diff --git a/prover/src/zk_circuits_handler.rs b/prover/src/zk_circuits_handler.rs index ac2a43e384..06622d9a7e 100644 --- a/prover/src/zk_circuits_handler.rs +++ b/prover/src/zk_circuits_handler.rs @@ -1,5 +1,5 @@ -mod curie; mod darwin; +mod darwin_v2; use super::geth_client::GethClient; use crate::{ @@ -8,8 +8,8 @@ use crate::{ utils::get_task_types, }; use anyhow::{bail, Result}; -use curie::CurieHandler; use darwin::DarwinHandler; +use darwin_v2::DarwinV2Handler; use std::{cell::RefCell, collections::HashMap, rc::Rc}; type HardForkName = String; @@ -38,7 +38,7 @@ pub struct CircuitsHandlerProvider<'a> { geth_client: Option>>, circuits_handler_builder_map: HashMap, - current_hard_fork_name: Option, + current_fork_name: Option, current_circuit: Option>>, } @@ -60,7 +60,7 @@ impl<'a> CircuitsHandlerProvider<'a> { &config.low_version_circuit.hard_fork_name ); AssetsDirEnvConfig::enable_first(); - CurieHandler::new( + DarwinHandler::new( prover_type, &config.low_version_circuit.params_path, &config.low_version_circuit.assets_path, @@ -83,7 +83,7 @@ impl<'a> CircuitsHandlerProvider<'a> { &config.high_version_circuit.hard_fork_name ); AssetsDirEnvConfig::enable_second(); - DarwinHandler::new( + DarwinV2Handler::new( prover_type, &config.high_version_circuit.params_path, &config.high_version_circuit.assets_path, @@ -102,7 +102,7 @@ impl<'a> CircuitsHandlerProvider<'a> { config, geth_client, circuits_handler_builder_map: m, - current_hard_fork_name: None, + current_fork_name: None, current_circuit: None, }; @@ -113,8 +113,8 @@ impl<'a> CircuitsHandlerProvider<'a> { &mut self, hard_fork_name: &String, ) -> Result>> { - match &self.current_hard_fork_name { - Some(name) if name == hard_fork_name => { + match &self.current_fork_name { + Some(fork_name) if fork_name == hard_fork_name => { log::info!("get circuits handler from cache"); if let Some(handler) = &self.current_circuit { Ok(handler.clone()) @@ -130,7 +130,7 @@ impl<'a> CircuitsHandlerProvider<'a> { log::info!("building circuits handler for {hard_fork_name}"); let handler = builder(self.prover_type, self.config, self.geth_client.clone()) .expect("failed to build circuits handler"); - self.current_hard_fork_name = Some(hard_fork_name.clone()); + self.current_fork_name = Some(hard_fork_name.clone()); let rc_handler = Rc::new(handler); self.current_circuit = Some(rc_handler.clone()); Ok(rc_handler) diff --git a/prover/src/zk_circuits_handler/darwin.rs b/prover/src/zk_circuits_handler/darwin.rs index bbbd0251f1..e18dc24743 100644 --- a/prover/src/zk_circuits_handler/darwin.rs +++ b/prover/src/zk_circuits_handler/darwin.rs @@ -253,7 +253,7 @@ mod tests { static DEFAULT_WORK_DIR: &str = "/assets"; static WORK_DIR: LazyLock = LazyLock::new(|| { - std::env::var("CURIE_TEST_DIR") + std::env::var("DARWIN_TEST_DIR") .unwrap_or(String::from(DEFAULT_WORK_DIR)) .trim_end_matches('/') .to_string() @@ -265,9 +265,9 @@ mod tests { static BATCH_DIR_PATH: LazyLock = LazyLock::new(|| format!("{}/traces/batch_24", *WORK_DIR)); static BATCH_VK_PATH: LazyLock = - LazyLock::new(|| format!("{}/test_assets/agg_vk.vkey", *WORK_DIR)); + LazyLock::new(|| format!("{}/test_assets/vk_batch.vkey", *WORK_DIR)); static CHUNK_VK_PATH: LazyLock = - LazyLock::new(|| format!("{}/test_assets/chunk_vk.vkey", *WORK_DIR)); + LazyLock::new(|| format!("{}/test_assets/vk_chunk.vkey", *WORK_DIR)); #[test] fn it_works() { diff --git a/prover/src/zk_circuits_handler/curie.rs b/prover/src/zk_circuits_handler/darwin_v2.rs similarity index 65% rename from prover/src/zk_circuits_handler/curie.rs rename to prover/src/zk_circuits_handler/darwin_v2.rs index c3b3a1966f..9c7ce6910f 100644 --- a/prover/src/zk_circuits_handler/curie.rs +++ b/prover/src/zk_circuits_handler/darwin_v2.rs @@ -10,21 +10,25 @@ use serde::Deserialize; use crate::types::{CommonHash, Task}; use std::{cell::RefCell, cmp::Ordering, env, rc::Rc}; -use prover_curie::{ +use prover_darwin_v2::{ aggregator::Prover as BatchProver, check_chunk_hashes, zkevm::Prover as ChunkProver, - BatchProof, BatchProvingTask, BlockTrace, ChunkInfo, ChunkProof, ChunkProvingTask, + BatchProof, BatchProvingTask, BlockTrace, BundleProof, BundleProvingTask, ChunkInfo, + ChunkProof, ChunkProvingTask, }; // Only used for debugging. static OUTPUT_DIR: Lazy> = Lazy::new(|| env::var("PROVER_OUTPUT_DIR").ok()); -#[derive(Deserialize)] +#[derive(Debug, Clone, Deserialize)] pub struct BatchTaskDetail { pub chunk_infos: Vec, - pub chunk_proofs: Vec, + #[serde(flatten)] + pub batch_proving_task: BatchProvingTask, } -#[derive(Deserialize)] +type BundleTaskDetail = BundleProvingTask; + +#[derive(Debug, Clone, Deserialize)] pub struct ChunkTaskDetail { pub block_hashes: Vec, } @@ -34,14 +38,14 @@ fn get_block_number(block_trace: &BlockTrace) -> Option { } #[derive(Default)] -pub struct CurieHandler { +pub struct DarwinV2Handler { chunk_prover: Option>, batch_prover: Option>, geth_client: Option>>, } -impl CurieHandler { +impl DarwinV2Handler { pub fn new( prover_type: ProverType, params_dir: &str, @@ -83,11 +87,15 @@ impl CurieHandler { Ok(serde_json::to_string(&chunk_proof)?) } - fn gen_batch_proof_raw( - &self, - chunk_hashes_proofs: Vec<(ChunkInfo, ChunkProof)>, - ) -> Result { + fn gen_batch_proof_raw(&self, batch_task_detail: BatchTaskDetail) -> Result { if let Some(prover) = self.batch_prover.as_ref() { + let chunk_hashes_proofs: Vec<(ChunkInfo, ChunkProof)> = batch_task_detail + .chunk_infos + .clone() + .into_iter() + .zip(batch_task_detail.batch_proving_task.chunk_proofs.clone()) + .collect(); + let chunk_proofs: Vec = chunk_hashes_proofs.iter().map(|t| t.1.clone()).collect(); @@ -97,11 +105,11 @@ impl CurieHandler { bail!("non-match chunk protocol") } check_chunk_hashes("", &chunk_hashes_proofs).context("failed to check chunk info")?; - let batch = BatchProvingTask { chunk_proofs }; - let batch_proof = - prover - .borrow_mut() - .gen_agg_evm_proof(batch, None, self.get_output_dir())?; + let batch_proof = prover.borrow_mut().gen_batch_proof( + batch_task_detail.batch_proving_task, + None, + self.get_output_dir(), + )?; return Ok(batch_proof); } @@ -110,12 +118,32 @@ impl CurieHandler { fn gen_batch_proof(&self, task: &crate::types::Task) -> Result { log::info!("[circuit] gen_batch_proof for task {}", task.id); - let chunk_hashes_proofs: Vec<(ChunkInfo, ChunkProof)> = - self.gen_chunk_hashes_proofs(task)?; - let batch_proof = self.gen_batch_proof_raw(chunk_hashes_proofs)?; + + let batch_task_detail: BatchTaskDetail = serde_json::from_str(&task.task_data)?; + let batch_proof = self.gen_batch_proof_raw(batch_task_detail)?; Ok(serde_json::to_string(&batch_proof)?) } + fn gen_bundle_proof_raw(&self, bundle_task_detail: BundleTaskDetail) -> Result { + if let Some(prover) = self.batch_prover.as_ref() { + let bundle_proof = prover.borrow_mut().gen_bundle_proof( + bundle_task_detail, + None, + self.get_output_dir(), + )?; + + return Ok(bundle_proof); + } + unreachable!("please check errors in proof_type logic") + } + + fn gen_bundle_proof(&self, task: &crate::types::Task) -> Result { + log::info!("[circuit] gen_bundle_proof for task {}", task.id); + let bundle_task_detail: BundleTaskDetail = serde_json::from_str(&task.task_data)?; + let bundle_proof = self.gen_bundle_proof_raw(bundle_task_detail)?; + Ok(serde_json::to_string(&bundle_proof)?) + } + fn get_output_dir(&self) -> Option<&str> { OUTPUT_DIR.as_deref() } @@ -125,17 +153,6 @@ impl CurieHandler { self.get_sorted_traces_by_hashes(&chunk_task_detail.block_hashes) } - fn gen_chunk_hashes_proofs(&self, task: &Task) -> Result> { - let batch_task_detail: BatchTaskDetail = serde_json::from_str(&task.task_data)?; - - Ok(batch_task_detail - .chunk_infos - .clone() - .into_iter() - .zip(batch_task_detail.chunk_proofs.clone()) - .collect()) - } - fn get_sorted_traces_by_hashes(&self, block_hashes: &[CommonHash]) -> Result> { if block_hashes.is_empty() { log::error!("[prover] failed to get sorted traces: block_hashes are empty"); @@ -190,7 +207,7 @@ impl CurieHandler { } } -impl CircuitsHandler for CurieHandler { +impl CircuitsHandler for DarwinV2Handler { fn get_vk(&self, task_type: TaskType) -> Option> { match task_type { TaskType::Chunk => self @@ -200,8 +217,11 @@ impl CircuitsHandler for CurieHandler { TaskType::Batch => self .batch_prover .as_ref() - .and_then(|prover| prover.borrow().get_vk()), - TaskType::Bundle => None, + .and_then(|prover| prover.borrow().get_batch_vk()), + TaskType::Bundle => self + .batch_prover + .as_ref() + .and_then(|prover| prover.borrow().get_bundle_vk()), _ => unreachable!(), } } @@ -210,6 +230,7 @@ impl CircuitsHandler for CurieHandler { match task_type { TaskType::Chunk => self.gen_chunk_proof(task), TaskType::Batch => self.gen_batch_proof(task), + TaskType::Bundle => self.gen_bundle_proof(task), _ => unreachable!(), } } @@ -221,7 +242,11 @@ impl CircuitsHandler for CurieHandler { mod tests { use super::*; use crate::zk_circuits_handler::utils::encode_vk; - use prover_curie::utils::chunk_trace_to_witness_block; + use ethers_core::types::H256; + use prover_darwin_v2::{ + aggregator::eip4844, utils::chunk_trace_to_witness_block, BatchData, BatchHeader, + MAX_AGG_SNARKS, + }; use std::{path::PathBuf, sync::LazyLock}; #[ctor::ctor] @@ -232,7 +257,7 @@ mod tests { static DEFAULT_WORK_DIR: &str = "/assets"; static WORK_DIR: LazyLock = LazyLock::new(|| { - std::env::var("CURIE_TEST_DIR") + std::env::var("DARWIN_V2_TEST_DIR") .unwrap_or(String::from(DEFAULT_WORK_DIR)) .trim_end_matches('/') .to_string() @@ -244,9 +269,9 @@ mod tests { static BATCH_DIR_PATH: LazyLock = LazyLock::new(|| format!("{}/traces/batch_24", *WORK_DIR)); static BATCH_VK_PATH: LazyLock = - LazyLock::new(|| format!("{}/test_assets/agg_vk.vkey", *WORK_DIR)); + LazyLock::new(|| format!("{}/test_assets/vk_batch.vkey", *WORK_DIR)); static CHUNK_VK_PATH: LazyLock = - LazyLock::new(|| format!("{}/test_assets/chunk_vk.vkey", *WORK_DIR)); + LazyLock::new(|| format!("{}/test_assets/vk_chunk.vkey", *WORK_DIR)); #[test] fn it_works() { @@ -256,20 +281,22 @@ mod tests { #[test] fn test_circuits() -> Result<()> { - let chunk_handler = CurieHandler::new(ProverType::Chunk, &PARAMS_PATH, &ASSETS_PATH, None)?; + let chunk_handler = + DarwinV2Handler::new(ProverType::Chunk, &PARAMS_PATH, &ASSETS_PATH, None)?; let chunk_vk = chunk_handler.get_vk(TaskType::Chunk).unwrap(); check_vk(TaskType::Chunk, chunk_vk, "chunk vk must be available"); let chunk_dir_paths = get_chunk_dir_paths()?; log::info!("chunk_dir_paths, {:?}", chunk_dir_paths); + let mut chunk_traces = vec![]; let mut chunk_infos = vec![]; let mut chunk_proofs = vec![]; for (id, chunk_path) in chunk_dir_paths.into_iter().enumerate() { let chunk_id = format!("chunk_proof{}", id + 1); log::info!("start to process {chunk_id}"); let chunk_trace = read_chunk_trace(chunk_path)?; - + chunk_traces.push(chunk_trace.clone()); let chunk_info = traces_to_chunk_info(chunk_trace.clone())?; chunk_infos.push(chunk_info); @@ -280,30 +307,97 @@ mod tests { chunk_proofs.push(chunk_proof); } - let batch_handler = CurieHandler::new(ProverType::Batch, &PARAMS_PATH, &ASSETS_PATH, None)?; + let batch_handler = + DarwinV2Handler::new(ProverType::Batch, &PARAMS_PATH, &ASSETS_PATH, None)?; let batch_vk = batch_handler.get_vk(TaskType::Batch).unwrap(); check_vk(TaskType::Batch, batch_vk, "batch vk must be available"); - let chunk_hashes_proofs = chunk_infos.into_iter().zip(chunk_proofs).collect(); + let batch_task_detail = make_batch_task_detail(chunk_traces, chunk_proofs, None); log::info!("start to prove batch"); - let batch_proof = batch_handler.gen_batch_proof_raw(chunk_hashes_proofs)?; + let batch_proof = batch_handler.gen_batch_proof_raw(batch_task_detail)?; let proof_data = serde_json::to_string(&batch_proof)?; dump_proof("batch_proof".to_string(), proof_data)?; Ok(()) } - fn check_vk(task_type: TaskType, vk: Vec, info: &str) { - log::info!("check_vk, {:?}", task_type); - let vk_from_file = read_vk(task_type).unwrap(); + // copied from https://github.com/scroll-tech/scroll-prover/blob/main/integration/src/prove.rs + fn get_blob_from_chunks(chunks: &[ChunkInfo]) -> Vec { + let num_chunks = chunks.len(); + + let padded_chunk = + ChunkInfo::mock_padded_chunk_info_for_testing(chunks.last().as_ref().unwrap()); + let chunks_with_padding = [ + chunks.to_vec(), + vec![padded_chunk; MAX_AGG_SNARKS - num_chunks], + ] + .concat(); + let batch_data = BatchData::<{ MAX_AGG_SNARKS }>::new(chunks.len(), &chunks_with_padding); + let batch_bytes = batch_data.get_batch_data_bytes(); + let blob_bytes = eip4844::get_blob_bytes(&batch_bytes); + log::info!("blob_bytes len {}", blob_bytes.len()); + blob_bytes + } + + // TODO: chunk_infos can be extracted from chunk_proofs. + // Still needed? + fn make_batch_task_detail( + chunk_traces: Vec>, + chunk_proofs: Vec, + last_batcher_header: Option>, + ) -> BatchTaskDetail { + // dummy parent batch hash + let dummy_parent_batch_hash = H256([ + 0xab, 0xac, 0xad, 0xae, 0xaf, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + ]); + let chunk_infos: Vec<_> = chunk_proofs.iter().map(|p| p.chunk_info.clone()).collect(); + + let l1_message_popped = chunk_traces + .iter() + .flatten() + .map(|chunk| chunk.num_l1_txs()) + .sum(); + let last_block_timestamp = chunk_traces.last().map_or(0, |block_traces| { + block_traces + .last() + .map_or(0, |block_trace| block_trace.header.timestamp.as_u64()) + }); + + let blob_bytes = get_blob_from_chunks(&chunk_infos); + let batch_header = BatchHeader::construct_from_chunks( + last_batcher_header.map_or(4, |header| header.version), + last_batcher_header.map_or(123, |header| header.batch_index + 1), + l1_message_popped, + last_batcher_header.map_or(l1_message_popped, |header| { + header.total_l1_message_popped + l1_message_popped + }), + last_batcher_header.map_or(dummy_parent_batch_hash, |header| header.batch_hash()), + last_block_timestamp, + &chunk_infos, + &blob_bytes, + ); + BatchTaskDetail { + chunk_infos, + batch_proving_task: BatchProvingTask { + chunk_proofs, + batch_header, + blob_bytes, + }, + } + } + + fn check_vk(proof_type: TaskType, vk: Vec, info: &str) { + log::info!("check_vk, {:?}", proof_type); + let vk_from_file = read_vk(proof_type).unwrap(); assert_eq!(vk_from_file, encode_vk(vk), "{info}") } - fn read_vk(task_type: TaskType) -> Result { - log::info!("read_vk, {:?}", task_type); - let vk_file = match task_type { + fn read_vk(proof_type: TaskType) -> Result { + log::info!("read_vk, {:?}", proof_type); + let vk_file = match proof_type { TaskType::Chunk => CHUNK_VK_PATH.clone(), TaskType::Batch => BATCH_VK_PATH.clone(), - TaskType::Bundle => unreachable!(), + TaskType::Bundle => todo!(), TaskType::Undefined => unreachable!(), }; diff --git a/rollup/internal/orm/batch.go b/rollup/internal/orm/batch.go index ffd128b7b6..49607f6ca7 100644 --- a/rollup/internal/orm/batch.go +++ b/rollup/internal/orm/batch.go @@ -36,6 +36,7 @@ type Batch struct { BatchHeader []byte `json:"batch_header" gorm:"column:batch_header"` CodecVersion int16 `json:"codec_version" gorm:"column:codec_version"` EnableCompress bool `json:"enable_compress" gorm:"column:enable_compress"` + BlobBytes []byte `json:"blob_bytes" gorm:"column:blob_bytes"` // proof ChunkProofsStatus int16 `json:"chunk_proofs_status" gorm:"column:chunk_proofs_status;default:1"` @@ -291,6 +292,7 @@ func (o *Batch) InsertBatch(ctx context.Context, batch *encoding.Batch, codecCon BatchHeader: batchMeta.BatchBytes, CodecVersion: int16(codecConfig.Version), EnableCompress: codecConfig.EnableCompress, + BlobBytes: batchMeta.BlobBytes, ChunkProofsStatus: int16(types.ChunkProofsStatusPending), ProvingStatus: int16(types.ProvingTaskUnassigned), RollupStatus: int16(types.RollupPending), diff --git a/rollup/internal/utils/utils.go b/rollup/internal/utils/utils.go index b5ab2aa355..c5a91c55bb 100644 --- a/rollup/internal/utils/utils.go +++ b/rollup/internal/utils/utils.go @@ -349,6 +349,7 @@ type BatchMetadata struct { BatchBytes []byte StartChunkHash common.Hash EndChunkHash common.Hash + BlobBytes []byte } // GetBatchMetadata retrieves the metadata of a batch. @@ -488,6 +489,7 @@ func GetBatchMetadata(batch *encoding.Batch, codecConfig CodecConfig) (*BatchMet BatchDataHash: daBatch.DataHash, BatchBlobDataProof: blobDataProof, BatchBytes: daBatch.Encode(), + BlobBytes: daBatch.BlobBytes(), } startDAChunk, err := codecv3.NewDAChunk(batch.Chunks[0], batch.TotalL1MessagePoppedBefore) @@ -526,6 +528,7 @@ func GetBatchMetadata(batch *encoding.Batch, codecConfig CodecConfig) (*BatchMet BatchDataHash: daBatch.DataHash, BatchBlobDataProof: blobDataProof, BatchBytes: daBatch.Encode(), + BlobBytes: daBatch.BlobBytes(), } startDAChunk, err := codecv4.NewDAChunk(batch.Chunks[0], batch.TotalL1MessagePoppedBefore)