diff --git a/.github/workflows/build-and-test-rust.yml b/.github/workflows/build-and-test-rust.yml index e7f072f604..5566c9de43 100644 --- a/.github/workflows/build-and-test-rust.yml +++ b/.github/workflows/build-and-test-rust.yml @@ -89,9 +89,16 @@ jobs: - name: Checkout code uses: actions/checkout@v4 + - name: Set up Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: 1.88.0 + components: rustfmt, clippy + override: true + - name: foundry-toolchain uses: foundry-rs/foundry-toolchain@v1.2.0 - + # Reference: https://github.com/succinctlabs/sp1/actions/runs/8886659400/workflow#L61-L65 - name: Install sp1 toolchain run: | diff --git a/Makefile b/Makefile index 53f2aa0712..6b97cbe142 100644 --- a/Makefile +++ b/Makefile @@ -277,27 +277,15 @@ proof_aggregator_start_gpu_ethereum_package: is_aggregator_set reset_last_aggreg verify_aggregated_proof_sp1: @echo "Verifying SP1 in aggregated proofs on $(NETWORK)..." - @cd crates/cli/ && \ - cargo run verify-agg-proof \ + @cd aggregation_mode/cli/ && \ + cargo run verify-on-chain \ --network $(NETWORK) \ + --beacon-url $(BEACON_URL) \ + --rpc-url $(RPC_URL) \ --from-block $(FROM_BLOCK) \ - --proving_system SP1 \ - --public_input ../../scripts/test_files/sp1/sp1_fibonacci_5_0_0.pub \ - --program-id-file ../../scripts/test_files/sp1/sp1_fibonacci_5_0_0.vk \ - --beacon_url $(BEACON_URL) \ - --rpc_url $(RPC_URL) - -verify_aggregated_proof_risc0: - @echo "Verifying RISC0 in aggregated proofs on $(NETWORK)..." - @cd crates/cli/ && \ - cargo run verify-agg-proof \ - --network $(NETWORK) \ - --from-block $(FROM_BLOCK) \ - --proving_system Risc0 \ - --program-id-file ../../scripts/test_files/risc_zero/fibonacci_proof_generator/fibonacci_id_3_0_3.bin \ - --public_input ../../scripts/test_files/risc_zero/fibonacci_proof_generator/risc_zero_fibonacci_3_0_3.pub \ - --beacon_url $(BEACON_URL) \ - --rpc_url $(RPC_URL) + --proving-system SP1 \ + --vk-hash ../../scripts/test_files/sp1/sp1_fibonacci_5_0_0.vk \ + --public-inputs ../../scripts/test_files/sp1/sp1_fibonacci_5_0_0.pub proof_aggregator_install: ## Install the aggregation mode with proving enabled cargo install --path aggregation_mode --features prove,gpu --bin proof_aggregator_gpu --locked @@ -331,9 +319,11 @@ agg_mode_payments_poller_start_ethereum_package: agg_mode_run_migrations AGG_MODE_SENDER ?= 0x70997970C51812dc3A010C7d01b50e0d17dc79C8 agg_mode_gateway_send_payment: - @cast send --value 1ether \ - 0x922D6956C99E12DFeB3224DEA977D0939758A1Fe \ - --private-key 0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d + @cd aggregation_mode/cli && \ + cargo run --release -- deposit \ + --private-key 0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d \ + --network devnet \ + --rpc-url http://localhost:8545 agg_mode_gateway_send_sp1_proof: @cargo run --manifest-path aggregation_mode/cli/Cargo.toml -- submit sp1 \ diff --git a/aggregation_mode/Cargo.lock b/aggregation_mode/Cargo.lock index 8e86d37b6f..063a34c84c 100644 --- a/aggregation_mode/Cargo.lock +++ b/aggregation_mode/Cargo.lock @@ -2,16 +2,6 @@ # It is not intended for manual editing. version = 4 -[[package]] -name = "Inflector" -version = "0.11.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" -dependencies = [ - "lazy_static", - "regex", -] - [[package]] name = "actix-codec" version = "0.5.2" @@ -65,7 +55,7 @@ dependencies = [ "tokio", "tokio-util", "tracing", - "zstd 0.13.3", + "zstd", ] [[package]] @@ -322,8 +312,11 @@ version = "0.1.0" dependencies = [ "alloy", "bincode", - "reqwest 0.12.24", + "lambdaworks-crypto", + "reqwest", "serde", + "serde_json", + "sha3 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)", "sp1-sdk", "tokio", "tracing", @@ -351,28 +344,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "aligned-sdk" -version = "0.1.0" -dependencies = [ - "ciborium", - "dialoguer", - "ethers", - "futures-util", - "hex", - "lambdaworks-crypto", - "log", - "reqwest 0.12.24", - "serde", - "serde_bytes", - "serde_json", - "serde_repr", - "sha3 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio", - "tokio-tungstenite 0.23.1", - "url", -] - [[package]] name = "alloc-no-stdlib" version = "2.0.4" @@ -718,7 +689,7 @@ dependencies = [ "lru 0.13.0", "parking_lot", "pin-project", - "reqwest 0.12.24", + "reqwest", "serde", "serde_json", "thiserror 2.0.17", @@ -762,7 +733,7 @@ dependencies = [ "alloy-transport-http", "futures", "pin-project", - "reqwest 0.12.24", + "reqwest", "serde", "serde_json", "tokio", @@ -1001,7 +972,7 @@ checksum = "90aa6825760905898c106aba9c804b131816a15041523e80b6d4fe7af6380ada" dependencies = [ "alloy-json-rpc", "alloy-transport", - "reqwest 0.12.24", + "reqwest", "serde_json", "tower 0.5.2", "tracing", @@ -1490,15 +1461,6 @@ dependencies = [ "serde", ] -[[package]] -name = "ascii-canvas" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8824ecca2e851cec16968d54a01dd372ef8f95b244fb84b84e70128be347c3c6" -dependencies = [ - "term", -] - [[package]] name = "async-stream" version = "0.3.6" @@ -1532,17 +1494,6 @@ dependencies = [ "syn 2.0.111", ] -[[package]] -name = "async_io_stream" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6d7b9decdf35d8908a7e3ef02f64c5e9b1695e230154c0e8de3969142d9b94c" -dependencies = [ - "futures", - "pharos", - "rustc_version 0.4.1", -] - [[package]] name = "atoi" version = "2.0.0" @@ -1606,7 +1557,7 @@ dependencies = [ "fastrand 2.3.0", "hex", "http 1.4.0", - "ring 0.17.14", + "ring", "time", "tokio", "tracing", @@ -1989,7 +1940,7 @@ dependencies = [ "serde_json", "serde_path_to_error", "serde_urlencoded", - "sync_wrapper 1.0.2", + "sync_wrapper", "tokio", "tower 0.5.2", "tower-layer", @@ -2012,7 +1963,7 @@ dependencies = [ "mime", "pin-project-lite", "rustversion", - "sync_wrapper 1.0.2", + "sync_wrapper", "tower-layer", "tower-service", "tracing", @@ -2054,12 +2005,6 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" -[[package]] -name = "base64" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" - [[package]] name = "base64" version = "0.21.7" @@ -2088,12 +2033,6 @@ version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55248b47b0caf0546f7988906588779981c43bb1bc9d0c44087278f80cdb44ba" -[[package]] -name = "bech32" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d86b93f97252c47b41663388e6d155714a9d0c398b99f1005cbc5f978b29f445" - [[package]] name = "bigdecimal" version = "0.4.8" @@ -2156,30 +2095,15 @@ dependencies = [ "syn 2.0.111", ] -[[package]] -name = "bit-set" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" -dependencies = [ - "bit-vec 0.6.3", -] - [[package]] name = "bit-set" version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" dependencies = [ - "bit-vec 0.8.0", + "bit-vec", ] -[[package]] -name = "bit-vec" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" - [[package]] name = "bit-vec" version = "0.8.0" @@ -2246,7 +2170,7 @@ checksum = "06e903a20b159e944f91ec8499fe1e55651480c541ea0a584f5d967c49ad9d99" dependencies = [ "arrayref", "arrayvec", - "constant_time_eq 0.3.1", + "constant_time_eq", ] [[package]] @@ -2259,7 +2183,7 @@ dependencies = [ "arrayvec", "cc", "cfg-if", - "constant_time_eq 0.3.1", + "constant_time_eq", ] [[package]] @@ -2319,7 +2243,7 @@ checksum = "21055e2f49cbbdbfe9f8f96d597c5527b0c6ab7933341fdc2f147180e48a988e" dependencies = [ "duplicate", "maybe-async", - "reqwest 0.12.24", + "reqwest", "serde", "thiserror 2.0.17", ] @@ -2368,16 +2292,6 @@ dependencies = [ "alloc-stdlib", ] -[[package]] -name = "bs58" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4" -dependencies = [ - "sha2 0.10.9", - "tinyvec", -] - [[package]] name = "bumpalo" version = "3.19.0" @@ -2444,26 +2358,6 @@ dependencies = [ "bytes", ] -[[package]] -name = "bzip2" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdb116a6ef3f6c3698828873ad02c3014b3c85cadb88496095628e3ef1e347f8" -dependencies = [ - "bzip2-sys", - "libc", -] - -[[package]] -name = "bzip2-sys" -version = "0.1.13+1.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225bff33b2141874fe80d71e07d6eec4f85c5c216453dd96388240f96e1acc14" -dependencies = [ - "cc", - "pkg-config", -] - [[package]] name = "c-kzg" version = "2.1.5" @@ -2724,58 +2618,6 @@ dependencies = [ "thiserror 2.0.17", ] -[[package]] -name = "coins-bip32" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b6be4a5df2098cd811f3194f64ddb96c267606bffd9689ac7b0160097b01ad3" -dependencies = [ - "bs58", - "coins-core", - "digest 0.10.7", - "hmac", - "k256", - "serde", - "sha2 0.10.9", - "thiserror 1.0.69", -] - -[[package]] -name = "coins-bip39" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3db8fba409ce3dc04f7d804074039eb68b960b0829161f8e06c95fea3f122528" -dependencies = [ - "bitvec", - "coins-bip32", - "hmac", - "once_cell", - "pbkdf2 0.12.2", - "rand 0.8.5", - "sha2 0.10.9", - "thiserror 1.0.69", -] - -[[package]] -name = "coins-core" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5286a0843c21f8367f7be734f89df9b822e0321d8bcce8d6e735aadff7d74979" -dependencies = [ - "base64 0.21.7", - "bech32", - "bs58", - "digest 0.10.7", - "generic-array 0.14.7", - "hex", - "ripemd", - "serde", - "serde_derive", - "sha2 0.10.9", - "sha3 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)", - "thiserror 1.0.69", -] - [[package]] name = "colorchoice" version = "1.0.4" @@ -2842,12 +2684,6 @@ dependencies = [ "unicode-xid", ] -[[package]] -name = "constant_time_eq" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" - [[package]] name = "constant_time_eq" version = "0.3.1" @@ -3256,12 +3092,6 @@ dependencies = [ "rustversion", ] -[[package]] -name = "data-encoding" -version = "2.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a2330da5de22e8a3cb63252ce2abb30116bf5265e89c0e01bc17015ce30a476" - [[package]] name = "db" version = "0.1.0" @@ -3400,19 +3230,6 @@ dependencies = [ "unicode-xid", ] -[[package]] -name = "dialoguer" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "658bce805d770f407bc62102fca7c2c64ceef2fbcb2b8bd19d2765ce093980de" -dependencies = [ - "console", - "shell-words", - "tempfile", - "thiserror 1.0.69", - "zeroize", -] - [[package]] name = "digest" version = "0.9.0" @@ -3461,16 +3278,6 @@ dependencies = [ "dirs-sys 0.5.0", ] -[[package]] -name = "dirs-next" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" -dependencies = [ - "cfg-if", - "dirs-sys-next", -] - [[package]] name = "dirs-sys" version = "0.4.1" @@ -3495,17 +3302,6 @@ dependencies = [ "windows-sys 0.61.2", ] -[[package]] -name = "dirs-sys-next" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" -dependencies = [ - "libc", - "redox_users 0.4.6", - "winapi", -] - [[package]] name = "dispatch2" version = "0.3.0" @@ -3556,7 +3352,7 @@ dependencies = [ "digest 0.10.7", "futures", "rand 0.8.5", - "reqwest 0.12.24", + "reqwest", "thiserror 1.0.69", "tokio", ] @@ -3660,15 +3456,6 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" -[[package]] -name = "ena" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d248bdd43ce613d87415282f69b9bb99d947d290b10962dd6c56233312c2ad5" -dependencies = [ - "log", -] - [[package]] name = "encode_unicode" version = "1.0.0" @@ -3684,24 +3471,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "enr" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a3d8dc56e02f954cac8eb489772c552c473346fc34f67412bb6244fd647f7e4" -dependencies = [ - "base64 0.21.7", - "bytes", - "hex", - "k256", - "log", - "rand 0.8.5", - "rlp", - "serde", - "sha3 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)", - "zeroize", -] - [[package]] name = "enum-map" version = "2.7.3" @@ -3792,7 +3561,7 @@ dependencies = [ "digest 0.10.7", "hex", "hmac", - "pbkdf2 0.11.0", + "pbkdf2", "rand 0.8.5", "scrypt", "serde", @@ -3804,369 +3573,72 @@ dependencies = [ ] [[package]] -name = "ethabi" -version = "18.0.0" +name = "event-listener" +version = "5.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7413c5f74cc903ea37386a8965a936cbeb334bd270862fdece542c1b2dcbc898" +checksum = "e13b66accf52311f30a0db42147dadea9850cb48cd070028831ae5f5d4b856ab" dependencies = [ - "ethereum-types", - "hex", - "once_cell", - "regex", - "serde", - "serde_json", - "sha3 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)", - "thiserror 1.0.69", - "uint", + "concurrent-queue", + "parking", + "pin-project-lite", ] [[package]] -name = "ethbloom" -version = "0.13.0" +name = "eventsource-stream" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c22d4b5885b6aa2fe5e8b9329fb8d232bf739e434e6b87347c63bdd00c120f60" +checksum = "74fef4569247a5f429d9156b9d0a2599914385dd189c539334c625d8099d90ab" dependencies = [ - "crunchy", - "fixed-hash", - "impl-codec", - "impl-rlp", - "impl-serde", - "scale-info", - "tiny-keccak", + "futures-core", + "nom", + "pin-project-lite", ] [[package]] -name = "ethereum-types" -version = "0.14.1" +name = "eyre" +version = "0.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02d215cbf040552efcbe99a38372fe80ab9d00268e20012b79fcd0f073edd8ee" +checksum = "7cd915d99f24784cdc19fd37ef22b97e3ff0ae756c7e492e9fbfe897d61e2aec" dependencies = [ - "ethbloom", - "fixed-hash", - "impl-codec", - "impl-rlp", - "impl-serde", - "primitive-types", - "scale-info", - "uint", + "indenter", + "once_cell", ] [[package]] -name = "ethers" -version = "2.0.14" +name = "fallible-iterator" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "816841ea989f0c69e459af1cf23a6b0033b19a55424a1ea3a30099becdb8dec0" -dependencies = [ - "ethers-addressbook", - "ethers-contract", - "ethers-core", - "ethers-etherscan", - "ethers-middleware", - "ethers-providers", - "ethers-signers", - "ethers-solc", -] +checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" [[package]] -name = "ethers-addressbook" -version = "2.0.14" +name = "fastrand" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5495afd16b4faa556c3bba1f21b98b4983e53c1755022377051a975c3b021759" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" dependencies = [ - "ethers-core", - "once_cell", - "serde", - "serde_json", + "instant", ] [[package]] -name = "ethers-contract" -version = "2.0.14" +name = "fastrand" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fceafa3578c836eeb874af87abacfb041f92b4da0a78a5edd042564b8ecdaaa" -dependencies = [ - "const-hex", - "ethers-contract-abigen", - "ethers-contract-derive", - "ethers-core", - "ethers-providers", - "futures-util", - "once_cell", - "pin-project", - "serde", - "serde_json", - "thiserror 1.0.69", -] +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] -name = "ethers-contract-abigen" -version = "2.0.14" +name = "fastrlp" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04ba01fbc2331a38c429eb95d4a570166781f14290ef9fdb144278a90b5a739b" +checksum = "139834ddba373bbdd213dffe02c8d110508dcf1726c2be27e8d1f7d7e1856418" dependencies = [ - "Inflector", - "const-hex", - "dunce", - "ethers-core", - "ethers-etherscan", - "eyre", - "prettyplease", - "proc-macro2", - "quote", - "regex", - "reqwest 0.11.27", - "serde", - "serde_json", - "syn 2.0.111", - "toml", - "walkdir", + "arrayvec", + "auto_impl", + "bytes", ] [[package]] -name = "ethers-contract-derive" -version = "2.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87689dcabc0051cde10caaade298f9e9093d65f6125c14575db3fd8c669a168f" -dependencies = [ - "Inflector", - "const-hex", - "ethers-contract-abigen", - "ethers-core", - "proc-macro2", - "quote", - "serde_json", - "syn 2.0.111", -] - -[[package]] -name = "ethers-core" -version = "2.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82d80cc6ad30b14a48ab786523af33b37f28a8623fc06afd55324816ef18fb1f" -dependencies = [ - "arrayvec", - "bytes", - "cargo_metadata 0.18.1", - "chrono", - "const-hex", - "elliptic-curve", - "ethabi", - "generic-array 0.14.7", - "k256", - "num_enum 0.7.5", - "once_cell", - "open-fastrlp", - "rand 0.8.5", - "rlp", - "serde", - "serde_json", - "strum 0.26.3", - "syn 2.0.111", - "tempfile", - "thiserror 1.0.69", - "tiny-keccak", - "unicode-xid", -] - -[[package]] -name = "ethers-etherscan" -version = "2.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e79e5973c26d4baf0ce55520bd732314328cabe53193286671b47144145b9649" -dependencies = [ - "chrono", - "ethers-core", - "reqwest 0.11.27", - "semver 1.0.27", - "serde", - "serde_json", - "thiserror 1.0.69", - "tracing", -] - -[[package]] -name = "ethers-middleware" -version = "2.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48f9fdf09aec667c099909d91908d5eaf9be1bd0e2500ba4172c1d28bfaa43de" -dependencies = [ - "async-trait", - "auto_impl", - "ethers-contract", - "ethers-core", - "ethers-etherscan", - "ethers-providers", - "ethers-signers", - "futures-channel", - "futures-locks", - "futures-util", - "instant", - "reqwest 0.11.27", - "serde", - "serde_json", - "thiserror 1.0.69", - "tokio", - "tracing", - "tracing-futures", - "url", -] - -[[package]] -name = "ethers-providers" -version = "2.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6434c9a33891f1effc9c75472e12666db2fa5a0fec4b29af6221680a6fe83ab2" -dependencies = [ - "async-trait", - "auto_impl", - "base64 0.21.7", - "bytes", - "const-hex", - "enr", - "ethers-core", - "futures-channel", - "futures-core", - "futures-timer", - "futures-util", - "hashers", - "http 0.2.12", - "instant", - "jsonwebtoken", - "once_cell", - "pin-project", - "reqwest 0.11.27", - "serde", - "serde_json", - "thiserror 1.0.69", - "tokio", - "tokio-tungstenite 0.20.1", - "tracing", - "tracing-futures", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "ws_stream_wasm", -] - -[[package]] -name = "ethers-signers" -version = "2.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "228875491c782ad851773b652dd8ecac62cda8571d3bc32a5853644dd26766c2" -dependencies = [ - "async-trait", - "coins-bip32", - "coins-bip39", - "const-hex", - "elliptic-curve", - "eth-keystore", - "ethers-core", - "rand 0.8.5", - "sha2 0.10.9", - "thiserror 1.0.69", - "tracing", -] - -[[package]] -name = "ethers-solc" -version = "2.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66244a771d9163282646dbeffe0e6eca4dda4146b6498644e678ac6089b11edd" -dependencies = [ - "cfg-if", - "const-hex", - "dirs 5.0.1", - "dunce", - "ethers-core", - "glob", - "home", - "md-5", - "num_cpus", - "once_cell", - "path-slash", - "rayon", - "regex", - "semver 1.0.27", - "serde", - "serde_json", - "solang-parser", - "svm-rs", - "thiserror 1.0.69", - "tiny-keccak", - "tokio", - "tracing", - "walkdir", - "yansi", -] - -[[package]] -name = "event-listener" -version = "5.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13b66accf52311f30a0db42147dadea9850cb48cd070028831ae5f5d4b856ab" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite", -] - -[[package]] -name = "eventsource-stream" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74fef4569247a5f429d9156b9d0a2599914385dd189c539334c625d8099d90ab" -dependencies = [ - "futures-core", - "nom", - "pin-project-lite", -] - -[[package]] -name = "eyre" -version = "0.6.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cd915d99f24784cdc19fd37ef22b97e3ff0ae756c7e492e9fbfe897d61e2aec" -dependencies = [ - "indenter", - "once_cell", -] - -[[package]] -name = "fallible-iterator" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" - -[[package]] -name = "fastrand" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" -dependencies = [ - "instant", -] - -[[package]] -name = "fastrand" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" - -[[package]] -name = "fastrlp" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "139834ddba373bbdd213dffe02c8d110508dcf1726c2be27e8d1f7d7e1856418" -dependencies = [ - "arrayvec", - "auto_impl", - "bytes", -] - -[[package]] -name = "fastrlp" -version = "0.4.0" +name = "fastrlp" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce8dba4714ef14b8274c371879b175aa55b16b30f269663f19d576f380018dc4" dependencies = [ @@ -4241,12 +3713,6 @@ dependencies = [ "static_assertions", ] -[[package]] -name = "fixedbitset" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" - [[package]] name = "fixedbitset" version = "0.5.7" @@ -4271,7 +3737,7 @@ checksum = "da0e4dd2a88388a1f4ccc7c9ce104604dab68d9f408dc34cd45823d5a9069095" dependencies = [ "futures-core", "futures-sink", - "spin 0.9.8", + "spin", ] [[package]] @@ -4343,16 +3809,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "fs2" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213" -dependencies = [ - "libc", - "winapi", -] - [[package]] name = "fs_extra" version = "1.3.0" @@ -4439,16 +3895,6 @@ dependencies = [ "waker-fn", ] -[[package]] -name = "futures-locks" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45ec6fe3675af967e67c5536c0b9d44e34e6c52f86bedc4ea49c5317b8e94d06" -dependencies = [ - "futures-channel", - "futures-task", -] - [[package]] name = "futures-macro" version = "0.3.31" @@ -4472,16 +3918,6 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" -[[package]] -name = "futures-timer" -version = "3.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" -dependencies = [ - "gloo-timers", - "send_wrapper 0.4.0", -] - [[package]] name = "futures-util" version = "0.3.31" @@ -4506,15 +3942,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42012b0f064e01aa58b545fe3727f90f7dd4020f4a3ea735b50344965f5a57e9" -[[package]] -name = "fxhash" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" -dependencies = [ - "byteorder", -] - [[package]] name = "gateway" version = "0.1.0" @@ -4523,7 +3950,6 @@ dependencies = [ "actix-web", "actix-web-prometheus", "agg_mode_sdk", - "aligned-sdk", "alloy", "bincode", "db", @@ -4655,18 +4081,6 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280" -[[package]] -name = "gloo-timers" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b995a66bb87bebce9a0f4a95aed01daca4872c050bfcb21653361c03bc35e5c" -dependencies = [ - "futures-channel", - "futures-core", - "js-sys", - "wasm-bindgen", -] - [[package]] name = "group" version = "0.12.1" @@ -4810,15 +4224,6 @@ dependencies = [ "serde_core", ] -[[package]] -name = "hashers" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2bca93b15ea5a746f220e56587f71e73c6165eab783df9e26590069953e3c30" -dependencies = [ - "fxhash", -] - [[package]] name = "hashlink" version = "0.10.0" @@ -4838,7 +4243,7 @@ dependencies = [ "hash32", "rustc_version 0.4.1", "serde", - "spin 0.9.8", + "spin", "stable_deref_trait", ] @@ -5053,7 +4458,7 @@ dependencies = [ "tokio", "tokio-rustls 0.26.4", "tower-service", - "webpki-roots 1.0.4", + "webpki-roots", ] [[package]] @@ -5104,7 +4509,7 @@ dependencies = [ "percent-encoding", "pin-project-lite", "socket2 0.6.1", - "system-configuration 0.6.1", + "system-configuration", "tokio", "tower-service", "tracing", @@ -5258,24 +4663,6 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8a5a9a0ff0086c7a148acb942baaabeadf9504d10400b5a05645853729b9cd2" -[[package]] -name = "impl-rlp" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f28220f89297a075ddc7245cd538076ee98b01f2a9c23a53a4f1105d5a322808" -dependencies = [ - "rlp", -] - -[[package]] -name = "impl-serde" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc88fc67028ae3db0c853baa36269d398d5f45b6982f95549ff5def78c935cd" -dependencies = [ - "serde", -] - [[package]] name = "impl-trait-for-tuples" version = "0.2.3" @@ -5455,20 +4842,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "jsonwebtoken" -version = "8.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6971da4d9c3aa03c3d8f3ff0f4155b534aad021292003895a469716b2a230378" -dependencies = [ - "base64 0.21.7", - "pem", - "ring 0.16.20", - "serde", - "serde_json", - "simple_asn1", -] - [[package]] name = "jubjub" version = "0.9.0" @@ -5517,36 +4890,6 @@ dependencies = [ "sha3-asm", ] -[[package]] -name = "lalrpop" -version = "0.20.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55cb077ad656299f160924eb2912aa147d7339ea7d69e1b5517326fdcec3c1ca" -dependencies = [ - "ascii-canvas", - "bit-set 0.5.3", - "ena", - "itertools 0.11.0", - "lalrpop-util", - "petgraph 0.6.5", - "regex", - "regex-syntax", - "string_cache", - "term", - "tiny-keccak", - "unicode-xid", - "walkdir", -] - -[[package]] -name = "lalrpop-util" -version = "0.20.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "507460a910eb7b32ee961886ff48539633b788a36b65692b95f225b844c82553" -dependencies = [ - "regex-automata", -] - [[package]] name = "lambdaworks-crypto" version = "0.12.0" @@ -5606,7 +4949,7 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" dependencies = [ - "spin 0.9.8", + "spin", ] [[package]] @@ -6022,12 +5365,6 @@ dependencies = [ "rayon", ] -[[package]] -name = "new_debug_unreachable" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" - [[package]] name = "nix" version = "0.30.1" @@ -6260,7 +5597,6 @@ version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff32365de1b6743cb203b710788263c44a03de03802daf96092f2da4fe6ba4d7" dependencies = [ - "proc-macro-crate 3.4.0", "proc-macro2", "quote", "syn 2.0.111", @@ -6351,31 +5687,6 @@ version = "1.70.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" -[[package]] -name = "open-fastrlp" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "786393f80485445794f6043fd3138854dd109cc6c4bd1a6383db304c9ce9b9ce" -dependencies = [ - "arrayvec", - "auto_impl", - "bytes", - "ethereum-types", - "open-fastrlp-derive", -] - -[[package]] -name = "open-fastrlp-derive" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "003b2be5c6c53c1cfeb0a238b8a1c3915cd410feb684457a36c10038f764bb1c" -dependencies = [ - "bytes", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "openssl" version = "0.10.75" @@ -6764,17 +6075,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "487f2ccd1e17ce8c1bfab3a65c89525af41cfad4c8659021a1e9a2aacd73b89b" -[[package]] -name = "password-hash" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700" -dependencies = [ - "base64ct", - "rand_core 0.6.4", - "subtle", -] - [[package]] name = "pasta_curves" version = "0.4.1" @@ -6811,12 +6111,6 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" -[[package]] -name = "path-slash" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e91099d4268b0e11973f036e885d652fb0b21fedcf69738c627f94db6a44f42" - [[package]] name = "pathdiff" version = "0.2.3" @@ -6828,7 +6122,6 @@ name = "payments_poller" version = "0.1.0" dependencies = [ "actix-web", - "aligned-sdk", "alloy", "db", "hex", @@ -6849,28 +6142,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" dependencies = [ "digest 0.10.7", - "hmac", - "password-hash", - "sha2 0.10.9", -] - -[[package]] -name = "pbkdf2" -version = "0.12.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" -dependencies = [ - "digest 0.10.7", - "hmac", -] - -[[package]] -name = "pem" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8835c273a76a90455d7344889b0964598e3316e2a79ede8e36f16bdcf2228b8" -dependencies = [ - "base64 0.13.1", ] [[package]] @@ -6898,78 +6169,16 @@ dependencies = [ "ucd-trie", ] -[[package]] -name = "petgraph" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" -dependencies = [ - "fixedbitset 0.4.2", - "indexmap 2.12.1", -] - [[package]] name = "petgraph" version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3672b37090dbd86368a4145bc067582552b29c27377cad4e0a306c97f9bd7772" dependencies = [ - "fixedbitset 0.5.7", + "fixedbitset", "indexmap 2.12.1", ] -[[package]] -name = "pharos" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9567389417feee6ce15dd6527a8a1ecac205ef62c2932bcf3d9f6fc5b78b414" -dependencies = [ - "futures", - "rustc_version 0.4.1", -] - -[[package]] -name = "phf" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" -dependencies = [ - "phf_macros", - "phf_shared", -] - -[[package]] -name = "phf_generator" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" -dependencies = [ - "phf_shared", - "rand 0.8.5", -] - -[[package]] -name = "phf_macros" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f84ac04429c13a7ff43785d75ad27569f2951ce0ffd30a3321230db2fc727216" -dependencies = [ - "phf_generator", - "phf_shared", - "proc-macro2", - "quote", - "syn 2.0.111", -] - -[[package]] -name = "phf_shared" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" -dependencies = [ - "siphasher", -] - [[package]] name = "pin-project" version = "1.1.10" @@ -7081,12 +6290,6 @@ dependencies = [ "zerocopy", ] -[[package]] -name = "precomputed-hash" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" - [[package]] name = "prettyplease" version = "0.2.37" @@ -7114,9 +6317,6 @@ checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" dependencies = [ "fixed-hash", "impl-codec", - "impl-rlp", - "impl-serde", - "scale-info", "uint", ] @@ -7226,7 +6426,7 @@ dependencies = [ name = "proof_aggregator" version = "0.1.0" dependencies = [ - "aligned-sdk", + "agg_mode_sdk", "alloy", "bincode", "c-kzg", @@ -7234,7 +6434,7 @@ dependencies = [ "db", "lambdaworks-crypto", "rayon", - "reqwest 0.12.24", + "reqwest", "risc0-build", "risc0-ethereum-contracts", "risc0-zkvm 3.0.4", @@ -7258,8 +6458,8 @@ version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bee689443a2bd0a16ab0348b52ee43e3b2d1b1f931c8aa5c9f8de4c86fbe8c40" dependencies = [ - "bit-set 0.8.0", - "bit-vec 0.8.0", + "bit-set", + "bit-vec", "bitflags 2.10.0", "num-traits", "rand 0.9.2", @@ -7292,7 +6492,7 @@ dependencies = [ "log", "multimap", "once_cell", - "petgraph 0.7.1", + "petgraph", "prettyplease", "prost", "prost-types", @@ -7395,7 +6595,7 @@ dependencies = [ "getrandom 0.3.4", "lru-slab", "rand 0.9.2", - "ring 0.17.14", + "ring", "rustc-hash 2.1.1", "rustls 0.23.35", "rustls-pki-types", @@ -7654,47 +6854,6 @@ version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a2d987857b319362043e95f5353c0535c1f58eec5336fdfcf626430af7def58" -[[package]] -name = "reqwest" -version = "0.11.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" -dependencies = [ - "base64 0.21.7", - "bytes", - "encoding_rs", - "futures-core", - "futures-util", - "h2 0.3.27", - "http 0.2.12", - "http-body 0.4.6", - "hyper 0.14.32", - "hyper-rustls 0.24.2", - "ipnet", - "js-sys", - "log", - "mime", - "once_cell", - "percent-encoding", - "pin-project-lite", - "rustls 0.21.12", - "rustls-pemfile 1.0.4", - "serde", - "serde_json", - "serde_urlencoded", - "sync_wrapper 0.1.2", - "system-configuration 0.5.1", - "tokio", - "tokio-rustls 0.24.1", - "tower-service", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "webpki-roots 0.25.4", - "winreg", -] - [[package]] name = "reqwest" version = "0.12.24" @@ -7728,7 +6887,7 @@ dependencies = [ "serde", "serde_json", "serde_urlencoded", - "sync_wrapper 1.0.2", + "sync_wrapper", "tokio", "tokio-native-tls", "tokio-rustls 0.26.4", @@ -7741,7 +6900,7 @@ dependencies = [ "wasm-bindgen-futures", "wasm-streams", "web-sys", - "webpki-roots 1.0.4", + "webpki-roots", ] [[package]] @@ -7753,7 +6912,7 @@ dependencies = [ "anyhow", "async-trait", "http 1.4.0", - "reqwest 0.12.24", + "reqwest", "serde", "thiserror 1.0.69", "tower-service", @@ -7769,21 +6928,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "ring" -version = "0.16.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" -dependencies = [ - "cc", - "libc", - "once_cell", - "spin 0.5.2", - "untrusted 0.7.1", - "web-sys", - "winapi", -] - [[package]] name = "ring" version = "0.17.14" @@ -7794,7 +6938,7 @@ dependencies = [ "cfg-if", "getrandom 0.2.16", "libc", - "untrusted 0.9.0", + "untrusted", "windows-sys 0.52.0", ] @@ -7804,15 +6948,6 @@ version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3df6368f71f205ff9c33c076d170dd56ebf68e8161c733c0caa07a7a5509ed53" -[[package]] -name = "ripemd" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd124222d17ad93a644ed9d011a40f4fb64aa54275c08cc216524a9ea82fb09f" -dependencies = [ - "digest 0.10.7", -] - [[package]] name = "risc0-binfmt" version = "3.0.2" @@ -7984,7 +7119,7 @@ dependencies = [ "serde", "sha2 0.10.9", "tracing", - "zip 2.4.2", + "zip", ] [[package]] @@ -8006,7 +7141,7 @@ version = "4.0.2" source = "git+https://github.com/risc0/risc0?tag=v3.0.3#14b5d588dd01cf4f7ba804d8bb0a61264e6ae2c6" dependencies = [ "anyhow", - "bit-vec 0.8.0", + "bit-vec", "bytemuck", "derive_more 2.0.1", "paste", @@ -8024,7 +7159,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e7ecd73a71ddce62eab8a28552ee182dc2ea08cdce2a3474a616a80bf2d6e9be" dependencies = [ "anyhow", - "bit-vec 0.8.0", + "bit-vec", "bytemuck", "byteorder", "cfg-if", @@ -8374,25 +7509,13 @@ dependencies = [ ] [[package]] -name = "rlp" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb919243f34364b6bd2fc10ef797edbfa75f33c252e7998527479c6d6b47e1ec" -dependencies = [ - "bytes", - "rlp-derive", - "rustc-hex", -] - -[[package]] -name = "rlp-derive" -version = "0.1.0" +name = "rlp" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e33d7b2abe0c340d8797fe2907d3f20d3b5ea5908683618bfe80df7f621f672a" +checksum = "bb919243f34364b6bd2fc10ef797edbfa75f33c252e7998527479c6d6b47e1ec" dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", + "bytes", + "rustc-hex", ] [[package]] @@ -8546,7 +7669,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" dependencies = [ "log", - "ring 0.17.14", + "ring", "rustls-webpki 0.101.7", "sct", ] @@ -8560,7 +7683,7 @@ dependencies = [ "aws-lc-rs", "log", "once_cell", - "ring 0.17.14", + "ring", "rustls-pki-types", "rustls-webpki 0.103.8", "subtle", @@ -8625,8 +7748,8 @@ version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ - "ring 0.17.14", - "untrusted 0.9.0", + "ring", + "untrusted", ] [[package]] @@ -8636,9 +7759,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2ffdfa2f5286e2247234e03f680868ac2815974dc39e00ea15adc445d0aafe52" dependencies = [ "aws-lc-rs", - "ring 0.17.14", + "ring", "rustls-pki-types", - "untrusted 0.9.0", + "untrusted", ] [[package]] @@ -8711,15 +7834,6 @@ dependencies = [ "cipher", ] -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - [[package]] name = "scale-info" version = "2.11.6" @@ -8799,7 +7913,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9f9e24d2b632954ded8ab2ef9fea0a0c769ea56ea98bddbafbad22caeeadf45d" dependencies = [ "hmac", - "pbkdf2 0.11.0", + "pbkdf2", "salsa20", "sha2 0.10.9", ] @@ -8810,8 +7924,8 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ - "ring 0.17.14", - "untrusted 0.9.0", + "ring", + "untrusted", ] [[package]] @@ -8920,18 +8034,6 @@ dependencies = [ "pest", ] -[[package]] -name = "send_wrapper" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f638d531eccd6e23b980caf34876660d38e265409d8e99b397ab71eb3612fad0" - -[[package]] -name = "send_wrapper" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" - [[package]] name = "serde" version = "1.0.228" @@ -8942,16 +8044,6 @@ dependencies = [ "serde_derive", ] -[[package]] -name = "serde_bytes" -version = "0.11.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5d440709e79d88e51ac01c4b72fc6cb7314017bb7da9eeff678aa94c10e3ea8" -dependencies = [ - "serde", - "serde_core", -] - [[package]] name = "serde_core" version = "1.0.228" @@ -9005,17 +8097,6 @@ dependencies = [ "serde", ] -[[package]] -name = "serde_repr" -version = "0.1.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "175ee3e80ae9982737ca543e96133087cbd9a485eecc3bc4de9c1a37b47ea59c" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.111", -] - [[package]] name = "serde_spanned" version = "0.6.9" @@ -9186,12 +8267,6 @@ dependencies = [ "lazy_static", ] -[[package]] -name = "shell-words" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" - [[package]] name = "shlex" version = "1.3.0" @@ -9223,24 +8298,6 @@ version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" -[[package]] -name = "simple_asn1" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "297f631f50729c8c99b84667867963997ec0b50f32b2a7dbcab828ef0541e8bb" -dependencies = [ - "num-bigint 0.4.6", - "num-traits", - "thiserror 2.0.17", - "time", -] - -[[package]] -name = "siphasher" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" - [[package]] name = "size" version = "0.4.1" @@ -9292,20 +8349,6 @@ dependencies = [ "windows-sys 0.60.2", ] -[[package]] -name = "solang-parser" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c425ce1c59f4b154717592f0bdf4715c3a1d55058883622d3157e1f0908a5b26" -dependencies = [ - "itertools 0.11.0", - "lalrpop", - "lalrpop-util", - "phf", - "thiserror 1.0.69", - "unicode-xid", -] - [[package]] name = "sp1-build" version = "5.2.3" @@ -9708,7 +8751,7 @@ dependencies = [ "p3-field", "p3-fri", "prost", - "reqwest 0.12.24", + "reqwest", "reqwest-middleware", "rustls 0.23.35", "serde", @@ -9811,12 +8854,6 @@ dependencies = [ "sp1-zkvm", ] -[[package]] -name = "spin" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" - [[package]] name = "spin" version = "0.9.8" @@ -10068,18 +9105,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" -[[package]] -name = "string_cache" -version = "0.8.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf776ba3fa74f83bf4b63c3dcbbf82173db2632ed8452cb2d891d33f459de70f" -dependencies = [ - "new_debug_unreachable", - "parking_lot", - "phf_shared", - "precomputed-hash", -] - [[package]] name = "stringprep" version = "0.1.5" @@ -10175,26 +9200,6 @@ version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" -[[package]] -name = "svm-rs" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11297baafe5fa0c99d5722458eac6a5e25c01eb1b8e5cd137f54079093daa7a4" -dependencies = [ - "dirs 5.0.1", - "fs2", - "hex", - "once_cell", - "reqwest 0.11.27", - "semver 1.0.27", - "serde", - "serde_json", - "sha2 0.10.9", - "thiserror 1.0.69", - "url", - "zip 0.6.6", -] - [[package]] name = "syn" version = "1.0.109" @@ -10229,12 +9234,6 @@ dependencies = [ "syn 2.0.111", ] -[[package]] -name = "sync_wrapper" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" - [[package]] name = "sync_wrapper" version = "1.0.2" @@ -10270,17 +9269,6 @@ dependencies = [ "windows", ] -[[package]] -name = "system-configuration" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" -dependencies = [ - "bitflags 1.3.2", - "core-foundation 0.9.4", - "system-configuration-sys 0.5.0", -] - [[package]] name = "system-configuration" version = "0.6.1" @@ -10289,17 +9277,7 @@ checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" dependencies = [ "bitflags 2.10.0", "core-foundation 0.9.4", - "system-configuration-sys 0.6.0", -] - -[[package]] -name = "system-configuration-sys" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" -dependencies = [ - "core-foundation-sys", - "libc", + "system-configuration-sys", ] [[package]] @@ -10331,17 +9309,6 @@ dependencies = [ "windows-sys 0.61.2", ] -[[package]] -name = "term" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59df8ac95d96ff9bede18eb7300b0fda5e5d8d90960e76f8e14ae765eedbf1f" -dependencies = [ - "dirs-next", - "rustversion", - "winapi", -] - [[package]] name = "thiserror" version = "1.0.69" @@ -10535,35 +9502,6 @@ dependencies = [ "tokio-util", ] -[[package]] -name = "tokio-tungstenite" -version = "0.20.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "212d5dcb2a1ce06d81107c3d0ffa3121fe974b73f068c8282cb1c32328113b6c" -dependencies = [ - "futures-util", - "log", - "rustls 0.21.12", - "tokio", - "tokio-rustls 0.24.1", - "tungstenite 0.20.1", - "webpki-roots 0.25.4", -] - -[[package]] -name = "tokio-tungstenite" -version = "0.23.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6989540ced10490aaf14e6bad2e3d33728a2813310a0c71d1574304c49631cd" -dependencies = [ - "futures-util", - "log", - "native-tls", - "tokio", - "tokio-native-tls", - "tungstenite 0.23.0", -] - [[package]] name = "tokio-util" version = "0.7.17" @@ -10721,7 +9659,7 @@ dependencies = [ "futures-core", "futures-util", "pin-project-lite", - "sync_wrapper 1.0.2", + "sync_wrapper", "tokio", "tower-layer", "tower-service", @@ -10816,16 +9754,6 @@ dependencies = [ "tracing-subscriber 0.3.22", ] -[[package]] -name = "tracing-futures" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" -dependencies = [ - "pin-project", - "tracing", -] - [[package]] name = "tracing-log" version = "0.2.0" @@ -10870,45 +9798,6 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" -[[package]] -name = "tungstenite" -version = "0.20.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e3dac10fd62eaf6617d3a904ae222845979aec67c615d1c842b4002c7666fb9" -dependencies = [ - "byteorder", - "bytes", - "data-encoding", - "http 0.2.12", - "httparse", - "log", - "rand 0.8.5", - "rustls 0.21.12", - "sha1", - "thiserror 1.0.69", - "url", - "utf-8", -] - -[[package]] -name = "tungstenite" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e2e2ce1e47ed2994fd43b04c8f618008d4cabdd5ee34027cf14f9d918edd9c8" -dependencies = [ - "byteorder", - "bytes", - "data-encoding", - "http 1.4.0", - "httparse", - "log", - "native-tls", - "rand 0.8.5", - "sha1", - "thiserror 1.0.69", - "utf-8", -] - [[package]] name = "twirp-rs" version = "0.13.0-succinct" @@ -10922,7 +9811,7 @@ dependencies = [ "http-body-util", "hyper 1.8.1", "prost", - "reqwest 0.12.24", + "reqwest", "serde", "serde_json", "thiserror 1.0.69", @@ -11058,12 +9947,6 @@ version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" -[[package]] -name = "untrusted" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" - [[package]] name = "untrusted" version = "0.9.0" @@ -11088,12 +9971,6 @@ version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" -[[package]] -name = "utf-8" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" - [[package]] name = "utf8_iter" version = "1.0.4" @@ -11186,16 +10063,6 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "317211a0dc0ceedd78fb2ca9a44aed3d7b9b26f81870d485c07122b4350673b7" -[[package]] -name = "walkdir" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" -dependencies = [ - "same-file", - "winapi-util", -] - [[package]] name = "want" version = "0.3.1" @@ -11337,12 +10204,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "webpki-roots" -version = "0.25.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" - [[package]] name = "webpki-roots" version = "1.0.4" @@ -11400,15 +10261,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" -[[package]] -name = "winapi-util" -version = "0.1.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" -dependencies = [ - "windows-sys 0.61.2", -] - [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" @@ -11753,16 +10605,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "winreg" -version = "0.50.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" -dependencies = [ - "cfg-if", - "windows-sys 0.48.0", -] - [[package]] name = "wit-bindgen" version = "0.46.0" @@ -11775,25 +10617,6 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9edde0db4769d2dc68579893f2306b26c6ecfbe0ef499b013d731b7b9247e0b9" -[[package]] -name = "ws_stream_wasm" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c173014acad22e83f16403ee360115b38846fe754e735c5d9d3803fe70c6abc" -dependencies = [ - "async_io_stream", - "futures", - "js-sys", - "log", - "pharos", - "rustc_version 0.4.1", - "send_wrapper 0.6.0", - "thiserror 2.0.17", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", -] - [[package]] name = "wtns-file" version = "0.1.5" @@ -11829,12 +10652,6 @@ dependencies = [ "hashlink", ] -[[package]] -name = "yansi" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" - [[package]] name = "yoke" version = "0.8.1" @@ -11952,26 +10769,6 @@ dependencies = [ "syn 2.0.111", ] -[[package]] -name = "zip" -version = "0.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" -dependencies = [ - "aes", - "byteorder", - "bzip2", - "constant_time_eq 0.1.5", - "crc32fast", - "crossbeam-utils", - "flate2", - "hmac", - "pbkdf2 0.11.0", - "sha1", - "time", - "zstd 0.11.2+zstd.1.5.2", -] - [[package]] name = "zip" version = "2.4.2" @@ -12028,32 +10825,13 @@ dependencies = [ "simd-adler32", ] -[[package]] -name = "zstd" -version = "0.11.2+zstd.1.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" -dependencies = [ - "zstd-safe 5.0.2+zstd.1.5.2", -] - [[package]] name = "zstd" version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e91ee311a569c327171651566e07972200e76fcfe2242a4fa446149a3881c08a" dependencies = [ - "zstd-safe 7.2.4", -] - -[[package]] -name = "zstd-safe" -version = "5.0.2+zstd.1.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db" -dependencies = [ - "libc", - "zstd-sys", + "zstd-safe", ] [[package]] diff --git a/aggregation_mode/Cargo.toml b/aggregation_mode/Cargo.toml index 67bd14f395..e30d2ebcec 100644 --- a/aggregation_mode/Cargo.toml +++ b/aggregation_mode/Cargo.toml @@ -11,12 +11,14 @@ serde = { version = "1.0.203", features = ["derive"] } serde_json = "1.0.117" serde_yaml = "0.9" alloy = { version = "1.1.1", features = ["default", "signer-keystore", "kzg"] } +lambdaworks-crypto = { git = "https://github.com/lambdaclass/lambdaworks.git", rev = "5f8f2cfcc8a1a22f77e8dff2d581f1166eefb80b", features = ["serde"]} bincode = "1.3.3" -aligned-sdk = { path = "../crates/sdk/" } -db = { path = "./db" } sp1-sdk = "5.0.0" risc0-zkvm = { version = "3.0.3" } prometheus = { version = "0.13.4", features = ["process"] } +agg_mode_sdk = { path = "./sdk"} +db = { path = "./db" } + [profile.release] opt-level = 3 diff --git a/aggregation_mode/cli/src/commands/deposit.rs b/aggregation_mode/cli/src/commands/deposit.rs new file mode 100644 index 0000000000..eb2a5f8561 --- /dev/null +++ b/aggregation_mode/cli/src/commands/deposit.rs @@ -0,0 +1,82 @@ +use agg_mode_sdk::types::Network; +use alloy::{ + network::{EthereumWallet, TransactionBuilder}, + primitives::{Address, U256}, + providers::{Provider, ProviderBuilder}, + signers::local::LocalSigner, +}; +use clap::{self, Args}; +use std::str::FromStr; + +use crate::commands::helpers::parse_network; + +const PAYMENT_AMOUNT: &str = "1"; // ether + +/// Send 1 ether to the aggregation mode payment service to fund proof submissions +#[derive(Debug, Clone, Args)] +pub struct SendPaymentArgs { + #[arg(long = "private-key")] + private_key: String, + #[arg(short = 'n', long = "network", default_value = "devnet", value_parser = parse_network)] + network: Network, + #[arg(long = "rpc-url")] + rpc_url: String, +} + +pub async fn run(args: SendPaymentArgs) { + tracing::info!( + "Sending payment to aggregation mode payment service on {:?}", + args.network + ); + + let signer = match LocalSigner::from_str(args.private_key.trim()) { + Ok(s) => s, + Err(e) => { + tracing::error!("Failed to parse private key: {e}"); + return; + } + }; + + let wallet = EthereumWallet::from(signer.clone()); + + let rpc_url = args.rpc_url.parse().expect("Invalid RPC URL"); + let provider = ProviderBuilder::new().wallet(wallet).connect_http(rpc_url); + + let payment_service_address_str = args.network.aggregation_mode_payment_service_address(); + let payment_service_address = match payment_service_address_str.parse::
() { + Ok(addr) => addr, + Err(e) => { + tracing::error!("Failed to parse payment service address: {e}"); + return; + } + }; + + let amount_ether: f64 = PAYMENT_AMOUNT.parse().expect("Invalid payment amount"); + let amount_wei = U256::from((amount_ether * 1e18) as u64); + + let tx = alloy::rpc::types::TransactionRequest::default() + .with_to(payment_service_address) + .with_value(amount_wei); + + match provider.send_transaction(tx).await { + Ok(pending_tx) => { + tracing::info!("Transaction sent. Hash: {:?}", pending_tx.tx_hash()); + match pending_tx.watch().await { + Ok(receipt) => { + tracing::info!( + "Payment of {} ether sent successfully to aggregation mode payment service at {}", + PAYMENT_AMOUNT, + payment_service_address_str + ); + tracing::info!("Transaction receipt: {:?}", receipt); + } + Err(e) => { + tracing::error!("Failed to get transaction receipt: {e}"); + } + } + } + Err(e) => { + tracing::error!("Failed to send transaction: {e}"); + } + } +} diff --git a/aggregation_mode/cli/src/commands/helpers.rs b/aggregation_mode/cli/src/commands/helpers.rs new file mode 100644 index 0000000000..a9214d9d0e --- /dev/null +++ b/aggregation_mode/cli/src/commands/helpers.rs @@ -0,0 +1,16 @@ +use clap::{self, ValueEnum}; +use std::str::FromStr; + +use agg_mode_sdk::types::Network; + +pub fn parse_network(value: &str) -> Result { + Network::from_str(value).map_err(|_| format!("unsupported network supplied: {value}")) +} + +#[derive(Debug, Clone, ValueEnum)] +pub enum ProvingSystemArg { + #[clap(name = "SP1")] + SP1, + #[clap(name = "Risc0")] + Risc0, +} diff --git a/aggregation_mode/cli/src/commands/mod.rs b/aggregation_mode/cli/src/commands/mod.rs index d53a5d11c6..61a21e7e0c 100644 --- a/aggregation_mode/cli/src/commands/mod.rs +++ b/aggregation_mode/cli/src/commands/mod.rs @@ -1 +1,25 @@ +use crate::commands::{deposit::SendPaymentArgs, submit::SubmitCommand, verify::VerifyOnChainArgs}; +use clap::{Parser, Subcommand}; + +pub mod deposit; +mod helpers; pub mod submit; +pub mod verify; + +#[derive(Debug, Parser)] +pub struct Cli { + #[command(subcommand)] + pub command: Command, +} + +#[derive(Debug, Subcommand)] +pub enum Command { + #[command(subcommand)] + Submit(SubmitCommand), + /// Check whether a proof has been verified on AlignedProofAggregationService contract + #[command(name = "verify-on-chain")] + VerifyOnChain(VerifyOnChainArgs), + /// Send 1 ether to the aggregation mode payment service + #[command(name = "deposit")] + Deposit(SendPaymentArgs), +} diff --git a/aggregation_mode/cli/src/commands/submit.rs b/aggregation_mode/cli/src/commands/submit.rs index 9c636f5bea..41b29d66d7 100644 --- a/aggregation_mode/cli/src/commands/submit.rs +++ b/aggregation_mode/cli/src/commands/submit.rs @@ -4,6 +4,8 @@ use clap::{command, Args, Subcommand}; use sp1_sdk::{SP1ProofWithPublicValues, SP1VerifyingKey}; use std::{path::PathBuf, str::FromStr}; +use crate::commands::helpers::parse_network; + #[derive(Debug, Subcommand)] pub enum SubmitCommand { #[command(name = "sp1")] @@ -22,10 +24,6 @@ pub struct SubmitSP1Args { network: Network, } -fn parse_network(value: &str) -> Result { - Network::from_str(value).map_err(|_| format!("unsupported network supplied: {value}")) -} - pub async fn run(args: SubmitSP1Args) { tracing::info!("Submitting SP1 proof to {:?} ", args.network); diff --git a/aggregation_mode/cli/src/commands/verify.rs b/aggregation_mode/cli/src/commands/verify.rs new file mode 100644 index 0000000000..8fd9988032 --- /dev/null +++ b/aggregation_mode/cli/src/commands/verify.rs @@ -0,0 +1,83 @@ +use agg_mode_sdk::{ + blockchain::{ + provider::ProofAggregationServiceProvider, AggregationModeVerificationData, ProofStatus, + }, + types::Network, +}; +use alloy::hex; +use clap::{self, Args}; +use std::path::PathBuf; + +use crate::commands::helpers::{parse_network, ProvingSystemArg}; + +#[derive(Debug, Clone, Args)] +pub struct VerifyOnChainArgs { + #[arg(short = 'n', long = "network", default_value = "devnet", value_parser = parse_network)] + network: Network, + #[arg(long = "rpc-url")] + rpc_url: String, + #[arg(long = "beacon-url")] + beacon_url: String, + #[arg(long = "from-block")] + from_block: Option, + #[arg(long = "proving-system")] + proving_system: ProvingSystemArg, + #[arg( + name = "Program verification key hash", + long = "vk-hash", + required = true + )] + program_vk: PathBuf, + #[arg(name = "Public input file name", long = "public-inputs")] + pub_input_file_name: Option, +} + +pub async fn run(args: VerifyOnChainArgs) { + let program_id_key: [u8; 32] = std::fs::read(&args.program_vk) + .expect("to read program vk file") + .try_into() + .expect("Invalid hexadecimal encoded vk hash"); + + let Some(pub_inputs_file_name) = args.pub_input_file_name else { + tracing::error!("Public input file not provided"); + return; + }; + let public_inputs = + std::fs::read(&pub_inputs_file_name).expect("to read program public inputs file"); + + let provider = + ProofAggregationServiceProvider::new(args.network, args.rpc_url, args.beacon_url); + + let verification_data = AggregationModeVerificationData::SP1 { + vk: program_id_key, + public_inputs, + }; + + let proof_status = match provider + .check_proof_verification(args.from_block, verification_data) + .await + { + Ok(res) => res, + Err(e) => { + tracing::error!("Error while trying to verify proof {:?}", e); + return; + } + }; + + match proof_status { + ProofStatus::Verified { merkle_root, .. } => { + tracing::info!( + "Your proof has been verified in the aggregated proof with merkle root 0x{}", + hex::encode(merkle_root) + ); + } + ProofStatus::Invalid => { + tracing::error!( + "Your proof was found in the blob but the Merkle Root verification failed." + ) + } + ProofStatus::NotFound => { + tracing::error!("Your proof wasn't found in the logs. Try specifying an earlier `from_block` to search further back in history.") + } + } +} diff --git a/aggregation_mode/cli/src/main.rs b/aggregation_mode/cli/src/main.rs index d5e8921051..b39b17b983 100644 --- a/aggregation_mode/cli/src/main.rs +++ b/aggregation_mode/cli/src/main.rs @@ -1,19 +1,7 @@ -use agg_mode_cli::commands::{self, submit::SubmitCommand}; -use clap::{Parser, Subcommand}; +use agg_mode_cli::commands::{self, submit::SubmitCommand, Cli, Command}; +use clap::Parser; use tracing_subscriber::{EnvFilter, FmtSubscriber}; -#[derive(Debug, Parser)] -struct Cli { - #[command(subcommand)] - command: Command, -} - -#[derive(Debug, Subcommand)] -enum Command { - #[command(subcommand)] - Submit(SubmitCommand), -} - #[tokio::main] async fn main() { let filter = EnvFilter::new("info"); @@ -26,5 +14,7 @@ async fn main() { Command::Submit(subcommand) => match subcommand { SubmitCommand::SP1(args) => commands::submit::run(args).await, }, + Command::VerifyOnChain(args) => commands::verify::run(args).await, + Command::Deposit(args) => commands::deposit::run(args).await, }; } diff --git a/aggregation_mode/gateway/Cargo.toml b/aggregation_mode/gateway/Cargo.toml index 6db94bcf21..d6d9ebc43e 100644 --- a/aggregation_mode/gateway/Cargo.toml +++ b/aggregation_mode/gateway/Cargo.toml @@ -7,9 +7,8 @@ edition = "2021" serde = { workspace = true } serde_json = { workspace = true } serde_yaml = { workspace = true } +agg_mode_sdk = { workspace = true } prometheus = { workspace = true } -agg_mode_sdk = { path = "../sdk"} -aligned-sdk = { workspace = true } sp1-sdk = { workspace = true } db = { workspace = true } tracing = { version = "0.1", features = ["log"] } @@ -19,7 +18,7 @@ actix-web = "4" actix-multipart = "0.7.2" actix-web-prometheus = "0.1.2" alloy = { workspace = true } -tokio = { version = "1", features = ["time"]} +tokio = { version = "1", features = ["time", "macros", "rt-multi-thread"]} # TODO: enable tls sqlx = { version = "0.8", features = [ "runtime-tokio", "postgres", "uuid", "bigdecimal" ] } hex = "0.4" diff --git a/aggregation_mode/gateway/src/http.rs b/aggregation_mode/gateway/src/http.rs index 13ca009b4d..9b4db44429 100644 --- a/aggregation_mode/gateway/src/http.rs +++ b/aggregation_mode/gateway/src/http.rs @@ -10,8 +10,7 @@ use actix_web::{ App, HttpRequest, HttpResponse, HttpServer, Responder, }; use actix_web_prometheus::PrometheusMetricsBuilder; -use agg_mode_sdk::types::Network; -use aligned_sdk::aggregation_layer::AggregationModeProvingSystem; +use agg_mode_sdk::{blockchain::AggregationModeProvingSystem, types::Network}; use alloy::signers::Signature; use sp1_sdk::{SP1ProofWithPublicValues, SP1VerifyingKey}; use sqlx::types::BigDecimal; diff --git a/aggregation_mode/payments_poller/Cargo.toml b/aggregation_mode/payments_poller/Cargo.toml index 2398e1a5ad..a46c348547 100644 --- a/aggregation_mode/payments_poller/Cargo.toml +++ b/aggregation_mode/payments_poller/Cargo.toml @@ -7,14 +7,13 @@ edition = "2021" serde = { workspace = true } serde_json = { workspace = true } serde_yaml = { workspace = true } -aligned-sdk = { workspace = true } prometheus = { workspace = true } db = { workspace = true } tracing = { version = "0.1", features = ["log"] } tracing-subscriber = { version = "0.3.0", features = ["env-filter"] } actix-web = "4" alloy = { workspace = true } -tokio = { version = "1", features = ["time"]} +tokio = { version = "1", features = ["time", "macros", "rt-multi-thread"]} # TODO: enable tls sqlx = { version = "0.8", features = [ "runtime-tokio", "postgres", "uuid", "bigdecimal" ] } hex = "0.4" diff --git a/aggregation_mode/proof_aggregator/Cargo.toml b/aggregation_mode/proof_aggregator/Cargo.toml index 294973f80b..e4d3fe1a2b 100644 --- a/aggregation_mode/proof_aggregator/Cargo.toml +++ b/aggregation_mode/proof_aggregator/Cargo.toml @@ -9,17 +9,17 @@ serde_json = { workspace = true } serde_yaml = { workspace = true } alloy = { workspace = true } bincode = { workspace = true } -aligned-sdk = { workspace = true } db = { workspace = true } +agg_mode_sdk = { workspace = true } tracing = { version = "0.1", features = ["log"] } tracing-subscriber = { version = "0.3.0", features = ["env-filter"] } c-kzg = "2.1.1" -tokio = { version = "1", features = ["time"]} +tokio = { version = "1", features = ["time", "macros", "rt-multi-thread"]} sha3 = "0.10.8" reqwest = { version = "0.12" } ciborium = "=0.2.2" -lambdaworks-crypto = { git = "https://github.com/lambdaclass/lambdaworks.git", rev = "5f8f2cfcc8a1a22f77e8dff2d581f1166eefb80b", features = ["serde"]} +lambdaworks-crypto = { workspace = true } rayon = "1.10.0" sqlx = { version = "0.8", features = [ "runtime-tokio", "postgres", "uuid", "bigdecimal" ] } diff --git a/aggregation_mode/proof_aggregator/src/aggregators/mod.rs b/aggregation_mode/proof_aggregator/src/aggregators/mod.rs index 07e4211b89..7aff95c884 100644 --- a/aggregation_mode/proof_aggregator/src/aggregators/mod.rs +++ b/aggregation_mode/proof_aggregator/src/aggregators/mod.rs @@ -3,7 +3,7 @@ pub mod sp1_aggregator; use std::fmt::Display; -use aligned_sdk::aggregation_layer::AggregationModeProvingSystem; +use agg_mode_sdk::blockchain::AggregationModeProvingSystem; use lambdaworks_crypto::merkle_tree::traits::IsMerkleTreeBackend; use risc0_aggregator::{Risc0AggregationError, Risc0ProofReceiptAndImageId}; use sha3::{Digest, Keccak256}; diff --git a/aggregation_mode/proof_aggregator/src/aggregators/risc0_aggregator.rs b/aggregation_mode/proof_aggregator/src/aggregators/risc0_aggregator.rs index 45fcb6526e..787522dcf5 100644 --- a/aggregation_mode/proof_aggregator/src/aggregators/risc0_aggregator.rs +++ b/aggregation_mode/proof_aggregator/src/aggregators/risc0_aggregator.rs @@ -1,6 +1,6 @@ include!(concat!(env!("OUT_DIR"), "/methods.rs")); -use aligned_sdk::aggregation_layer::AggregationModeProvingSystem; +use agg_mode_sdk::blockchain::AggregationModeProvingSystem; use risc0_zkvm::{default_prover, ExecutorEnv, ProverOpts, Receipt}; use sha3::{Digest, Keccak256}; diff --git a/aggregation_mode/proof_aggregator/src/aggregators/sp1_aggregator.rs b/aggregation_mode/proof_aggregator/src/aggregators/sp1_aggregator.rs index d4e8df8b42..84ce303a9b 100644 --- a/aggregation_mode/proof_aggregator/src/aggregators/sp1_aggregator.rs +++ b/aggregation_mode/proof_aggregator/src/aggregators/sp1_aggregator.rs @@ -1,6 +1,6 @@ use std::sync::LazyLock; -use aligned_sdk::aggregation_layer::AggregationModeProvingSystem; +use agg_mode_sdk::blockchain::AggregationModeProvingSystem; use alloy::primitives::Keccak256; use sp1_aggregation_program::SP1VkAndPubInputs; #[cfg(feature = "prove")] diff --git a/aggregation_mode/sdk/Cargo.toml b/aggregation_mode/sdk/Cargo.toml index 3e8a92408d..202d3c2362 100644 --- a/aggregation_mode/sdk/Cargo.toml +++ b/aggregation_mode/sdk/Cargo.toml @@ -5,10 +5,13 @@ edition = "2021" [dependencies] serde = { workspace = true } +serde_json = { workspace = true } +alloy = { workspace = true } +sp1-sdk = { workspace = true } +lambdaworks-crypto = { workspace = true } tracing = { version = "0.1", features = ["log"] } tracing-subscriber = { version = "0.3.0", features = ["env-filter"] } bincode = "1.3.3" reqwest = { version = "0.12", features = ["json", "multipart"] } -tokio = { version = "1", features = ["time"]} -alloy = { workspace = true } -sp1-sdk = { workspace = true } +tokio = { version = "1", features = ["time", "macros", "rt-multi-thread"]} +sha3 = { version = "0.10.8" } diff --git a/aggregation_mode/sdk/abi/AlignedProofAggregationService.json b/aggregation_mode/sdk/abi/AlignedProofAggregationService.json new file mode 100644 index 0000000000..813d0291a0 --- /dev/null +++ b/aggregation_mode/sdk/abi/AlignedProofAggregationService.json @@ -0,0 +1 @@ +{"abi":[{"type":"constructor","inputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"RISC0_ID","inputs":[],"outputs":[{"name":"","type":"uint8","internalType":"uint8"}],"stateMutability":"view"},{"type":"function","name":"SP1_ID","inputs":[],"outputs":[{"name":"","type":"uint8","internalType":"uint8"}],"stateMutability":"view"},{"type":"function","name":"VERIFIER_MOCK_ADDRESS","inputs":[],"outputs":[{"name":"","type":"address","internalType":"address"}],"stateMutability":"view"},{"type":"function","name":"alignedAggregatorAddress","inputs":[],"outputs":[{"name":"","type":"address","internalType":"address"}],"stateMutability":"view"},{"type":"function","name":"allowVerifyingProgram","inputs":[{"name":"verifierProgramCommitment","type":"bytes32","internalType":"bytes32"},{"name":"provingSystemId","type":"uint8","internalType":"uint8"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"allowedVerifiersProvingSystem","inputs":[{"name":"","type":"bytes32","internalType":"bytes32"}],"outputs":[{"name":"","type":"uint8","internalType":"uint8"}],"stateMutability":"view"},{"type":"function","name":"disallowVerifyingProgram","inputs":[{"name":"verifierProgramCommitment","type":"bytes32","internalType":"bytes32"},{"name":"provingSystemId","type":"uint8","internalType":"uint8"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"initialize","inputs":[{"name":"newOwner","type":"address","internalType":"address"},{"name":"_alignedAggregatorAddress","type":"address","internalType":"address"},{"name":"_sp1VerifierAddress","type":"address","internalType":"address"},{"name":"_risc0VerifierAddress","type":"address","internalType":"address"},{"name":"_risc0AggregatorProgramImageId","type":"bytes32","internalType":"bytes32"},{"name":"_sp1AggregatorProgramVKHash","type":"bytes32","internalType":"bytes32"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"isMerkleRootVerified","inputs":[{"name":"","type":"bytes32","internalType":"bytes32"}],"outputs":[{"name":"","type":"bool","internalType":"bool"}],"stateMutability":"view"},{"type":"function","name":"isProofVerified","inputs":[{"name":"merklePath","type":"bytes32[]","internalType":"bytes32[]"},{"name":"provingSystemId","type":"uint16","internalType":"uint16"},{"name":"programCommitment","type":"bytes32","internalType":"bytes32"},{"name":"publicInputs","type":"bytes","internalType":"bytes"}],"outputs":[{"name":"","type":"bool","internalType":"bool"}],"stateMutability":"view"},{"type":"function","name":"owner","inputs":[],"outputs":[{"name":"","type":"address","internalType":"address"}],"stateMutability":"view"},{"type":"function","name":"proxiableUUID","inputs":[],"outputs":[{"name":"","type":"bytes32","internalType":"bytes32"}],"stateMutability":"view"},{"type":"function","name":"renounceOwnership","inputs":[],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"risc0VerifierAddress","inputs":[],"outputs":[{"name":"","type":"address","internalType":"address"}],"stateMutability":"view"},{"type":"function","name":"setRisc0VerifierAddress","inputs":[{"name":"_risc0VerifierAddress","type":"address","internalType":"address"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"setSP1VerifierAddress","inputs":[{"name":"_sp1VerifierAddress","type":"address","internalType":"address"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"sp1VerifierAddress","inputs":[],"outputs":[{"name":"","type":"address","internalType":"address"}],"stateMutability":"view"},{"type":"function","name":"transferOwnership","inputs":[{"name":"newOwner","type":"address","internalType":"address"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"upgradeTo","inputs":[{"name":"newImplementation","type":"address","internalType":"address"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"upgradeToAndCall","inputs":[{"name":"newImplementation","type":"address","internalType":"address"},{"name":"data","type":"bytes","internalType":"bytes"}],"outputs":[],"stateMutability":"payable"},{"type":"function","name":"verifyAggregationRisc0","inputs":[{"name":"blobVersionedHash","type":"bytes32","internalType":"bytes32"},{"name":"risc0ReceiptSeal","type":"bytes","internalType":"bytes"},{"name":"risc0JournalBytes","type":"bytes","internalType":"bytes"},{"name":"verifierProgramCommitment","type":"bytes32","internalType":"bytes32"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"verifyAggregationSP1","inputs":[{"name":"blobVersionedHash","type":"bytes32","internalType":"bytes32"},{"name":"sp1PublicValues","type":"bytes","internalType":"bytes"},{"name":"sp1ProofBytes","type":"bytes","internalType":"bytes"},{"name":"verifierProgramCommitment","type":"bytes32","internalType":"bytes32"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"event","name":"AdminChanged","inputs":[{"name":"previousAdmin","type":"address","indexed":false,"internalType":"address"},{"name":"newAdmin","type":"address","indexed":false,"internalType":"address"}],"anonymous":false},{"type":"event","name":"AggregatedProofVerified","inputs":[{"name":"merkleRoot","type":"bytes32","indexed":true,"internalType":"bytes32"},{"name":"blobVersionedHash","type":"bytes32","indexed":false,"internalType":"bytes32"}],"anonymous":false},{"type":"event","name":"BeaconUpgraded","inputs":[{"name":"beacon","type":"address","indexed":true,"internalType":"address"}],"anonymous":false},{"type":"event","name":"Initialized","inputs":[{"name":"version","type":"uint8","indexed":false,"internalType":"uint8"}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"name":"previousOwner","type":"address","indexed":true,"internalType":"address"},{"name":"newOwner","type":"address","indexed":true,"internalType":"address"}],"anonymous":false},{"type":"event","name":"Risc0VerifierAddressUpdated","inputs":[{"name":"newAddress","type":"address","indexed":true,"internalType":"address"}],"anonymous":false},{"type":"event","name":"SP1VerifierAddressUpdated","inputs":[{"name":"newAddress","type":"address","indexed":true,"internalType":"address"}],"anonymous":false},{"type":"event","name":"Upgraded","inputs":[{"name":"implementation","type":"address","indexed":true,"internalType":"address"}],"anonymous":false},{"type":"event","name":"VerifierProgramAllowed","inputs":[{"name":"verifierProgramCommitment","type":"bytes32","indexed":true,"internalType":"bytes32"},{"name":"provingSystemId","type":"uint8","indexed":false,"internalType":"uint8"}],"anonymous":false},{"type":"event","name":"VerifierProgramDisallowed","inputs":[{"name":"verifierProgramCommitment","type":"bytes32","indexed":true,"internalType":"bytes32"},{"name":"provingSystemId","type":"uint8","indexed":false,"internalType":"uint8"}],"anonymous":false},{"type":"error","name":"InvalidProvingSystemId","inputs":[{"name":"actual","type":"uint8","internalType":"uint8"}]},{"type":"error","name":"InvalidVerifyingProgram","inputs":[{"name":"verifierProgramCommitment","type":"bytes32","internalType":"bytes32"},{"name":"expected","type":"uint8","internalType":"uint8"},{"name":"actual","type":"uint8","internalType":"uint8"}]},{"type":"error","name":"OnlyAlignedAggregator","inputs":[{"name":"sender","type":"address","internalType":"address"}]},{"type":"error","name":"ProvingSystemIdMismatch","inputs":[{"name":"expected","type":"uint8","internalType":"uint8"},{"name":"received","type":"uint8","internalType":"uint8"}]}],"bytecode":{"object":"0x60a080604052346100da57306080525f549060ff8260081c16610088575060ff8082161061004e575b6040516116cc90816100df82396080518181816109a401528181610aca0152610f8e0152f35b60ff90811916175f557f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498602060405160ff8152a15f610028565b62461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b6064820152608490fd5b5f80fdfe6080806040526004361015610012575f80fd5b5f905f3560e01c908163294e3ccb1461126e575080633659cfe614610f7057806339ad96d914610e1757806342af056814610dea5780634c46688c14610dc15780634f1ef28614610a5457806352d1902d1461099157806355a9a7bf146108e8578063616af4f7146108bf5780636eecb4c9146108a3578063715018a61461084657806383501b211461082a5780638da5cb5b14610801578063972e58ba146107e557806398dc5b03146107b65780639eade0f11461074e578063a52f681b146106e6578063be96ce9314610563578063d5d8d0a8146104d8578063e03e3691146103ae578063f28c3e37146101a35763f2fde38b14610110575f80fd5b346101a05760203660031901126101a057610129611291565b610131611484565b6001600160a01b0381161561014c57610149906114dc565b80f35b60405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608490fd5b80fd5b50346101a05760c03660031901126101a0576101bd611291565b6024356001600160a01b038116908190036103aa576044356001600160a01b038116908190036103a6576064356001600160a01b03811692908390036103a257845460ff8160081c161594858096610395575b801561037e575b156103225760ff19821660011787556102689186610311575b5061024a60ff885460081c1661024581611524565b611524565b610253336114dc565b61026360ff885460081c16611524565b6114dc565b6001600160601b0360a01b60cb54161760cb556001600160601b0360a01b60ca54161760ca556001600160601b0360a01b60cc54161760cc55608435825260cd60205260408220600260ff1982541617905560a435825260cd60205260408220600160ff198254161790556102da5780f35b61ff001981541681557f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498602060405160018152a180f35b61ffff19166101011787555f610230565b60405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608490fd5b50303b1580156102175750600160ff831614610217565b50600160ff831610610210565b8480fd5b8380fd5b8280fd5b50346101a05760803660031901126101a05760043567ffffffffffffffff81116104d457366023820112156104d45780600401359067ffffffffffffffff82116103aa573660248360051b830101116103aa5760243561ffff811681036103a65760643567ffffffffffffffff81116103a25761047161043460429236906004016112a7565b929083604051948592602084019761ffff60f01b9060f01b168852604435602285015284840137810188838201520301601f198101835282611330565b5190209083915b838310156104b95760248360051b83010135908181105f146104a85785526020526001604085205b920191610478565b9085526020526001604085206104a0565b60ff604086602093815260c984522054166040519015158152f35b5080fd5b50346101a05760ff6104e936611382565b6104f4929192611484565b16600181141580610558575b6105465760207e86b661a41d941418d5d36446dc66bee8596027431ea48aba1cdbf9ab8cbada9183855260cd8252604085208160ff19825416179055604051908152a280f35b633212f51f60e21b8352600452602482fd5b506002811415610500565b50346101a057610572366112d5565b60cb5492959493929091906001600160a01b031633036106d35760208682810103126106cf5785359582885260cd602052600260ff60408a205416036106a3578782602092829796959460405192839283378101838152039060025afa156106985783519260018060a01b0360cc541690813b15610694578593610615936040519687958694859463ab750e7560e01b8652606060048701526064860191611464565b916024840152604483015203915afa801561068957610674575b507ffe3e9e971000ab9c80c7e06aba2933aae5419d0e44693e3046913e9e58053f6291836020925260c9825260408520600160ff19825416179055604051908152a280f35b8161067e91611330565b6103aa57825f61062f565b6040513d84823e3d90fd5b8580fd5b6040513d85823e3d90fd5b82885260cd6020526040882054635a08a53760e01b89526004849052600260245260ff16604452606488fd5b5f80fd5b63921f325560e01b875233600452602487fd5b50346101a05760203660031901126101a057610700611291565b610708611484565b60cc80546001600160a01b0319166001600160a01b039290921691821790557f80ad03c31df486a2ab8f2fe1f9e0597e290255e749369a3e0cf3b1cf34b180898280a280f35b50346101a05760203660031901126101a057610768611291565b610770611484565b60ca80546001600160a01b0319166001600160a01b039290921691821790557fc34d8b9ef5ec2845c44a69730b4523b5d66bc715b6d4820707ff1f40ee5f1a9e8280a280f35b50346101a05760203660031901126101a05760ff6040602092600435815260c984522054166040519015158152f35b50346101a057806003193601126101a057602060405160028152f35b50346101a057806003193601126101a0576033546040516001600160a01b039091168152602090f35b50346101a057806003193601126101a057602060405160ff8152f35b50346101a057806003193601126101a05761085f611484565b603380546001600160a01b0319811690915581906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b50346101a057806003193601126101a057602060405160018152f35b50346101a057806003193601126101a05760cc546040516001600160a01b039091168152602090f35b50346101a05760ff6108f936611382565b610904929192611484565b16600181141580610986575b6105465781835260cd60205260ff6040842054169080820361096e575060207fca6a89a45ac13d034743c006df767832823ffba941ccc74cca0cb5dcd0abffaf9183855260cd82526040852060ff198154169055604051908152a280f35b63d4cec2bb60e01b8452600491909152602452604482fd5b506002811415610910565b50346101a057806003193601126101a0577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031630036109e95760206040515f5160206116775f395f51905f528152f35b60405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608490fd5b5060403660031901126101a057610a69611291565b60243567ffffffffffffffff81116103aa57366023820112156103aa5780600401359083610a9683611366565b91610aa46040519384611330565b838352602083019336602482840101116103aa5780602460209301863783010152610b1c7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610afe308214156113a2565b5f5160206116775f395f51905f52546001600160a01b031614611403565b610b24611484565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff1615610b5957505061014990611584565b6040516352d1902d60e01b81526001600160a01b03841690602081600481855afa869181610d89575b50610be35760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608490fd5b5f5160206116775f395f51905f5203610d3257610bff84611584565b604051907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b8680a2815115801590610d2a575b610c3e575b5050505080f35b833b15610cd95750610cc8928492839251915af43d15610cd2573d610c6281611366565b90610c706040519283611330565b81523d84602083013e5b60405191610c89606084611330565b602783527f416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c6020840152660819985a5b195960ca1b604084015261161b565b505f808080610c37565b6060610c7a565b62461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608490fd5b506001610c32565b60405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608490fd5b9091506020813d602011610db9575b81610da560209383611330565b81010312610db55751905f610b82565b8680fd5b3d9150610d98565b50346101a057806003193601126101a05760cb546040516001600160a01b039091168152602090f35b50346101a05760203660031901126101a05760ff6040602092600435815260cd8452205416604051908152f35b50346106cf57610e26366112d5565b60cb5493959491936001600160a01b03163303610f5d5760208287810103126106cf57813595815f5260cd602052600160ff60405f20541603610f315760ca546001600160a01b031691823b156106cf57610ebc5f95610eaa976040519889978896879663020a49e360e51b88526004880152606060248801526064870191611464565b84810360031901604486015291611464565b03915afa8015610f2657610f10575b5060207ffe3e9e971000ab9c80c7e06aba2933aae5419d0e44693e3046913e9e58053f629183855260c9825260408520600160ff19825416179055604051908152a280f35b610f1d9193505f90611330565b5f916020610ecb565b6040513d5f823e3d90fd5b50805f5260cd60205260ff60405f20541690635a08a53760e01b5f52600452600160245260445260645ffd5b63921f325560e01b5f523360045260245ffd5b346106cf5760203660031901126106cf57610f89611291565b610fc27f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610afe308214156113a2565b610fca611484565b602090604051610fda8382611330565b5f815282810190601f1984013683377f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff161561102157505061101f9150611584565b005b6040516352d1902d60e01b81526001600160a01b038416908581600481855afa5f918161123f575b506110aa5760405162461bcd60e51b815260048101879052602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608490fd5b5f5160206116775f395f51905f52036111e8576110c684611584565b604051907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b5f80a28151158015906111e1575b6110ff57005b833b15611190575061101f93925f92839251915af43d15611188573d9061112582611366565b916111336040519384611330565b82523d5f8484013e5b7f416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c6040519361116c606086611330565b60278552840152660819985a5b195960ca1b604084015261161b565b60609061113c565b62461bcd60e51b815260048101859052602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608490fd5b505f6110f9565b60405162461bcd60e51b815260048101869052602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608490fd5b9091508681813d8311611267575b6112578183611330565b810103126106cf57519087611049565b503d61124d565b346106cf575f3660031901126106cf5760ca546001600160a01b03168152602090f35b600435906001600160a01b03821682036106cf57565b9181601f840112156106cf5782359167ffffffffffffffff83116106cf57602083818601950101116106cf57565b9060806003198301126106cf576004359160243567ffffffffffffffff81116106cf5781611305916004016112a7565b929092916044359067ffffffffffffffff82116106cf57611328916004016112a7565b909160643590565b90601f8019910116810190811067ffffffffffffffff82111761135257604052565b634e487b7160e01b5f52604160045260245ffd5b67ffffffffffffffff811161135257601f01601f191660200190565b60409060031901126106cf576004359060243560ff811681036106cf5790565b156113a957565b60405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201526b19195b1959d85d1958d85b1b60a21b6064820152608490fd5b1561140a57565b60405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201526b6163746976652070726f787960a01b6064820152608490fd5b908060209392818452848401375f828201840152601f01601f1916010190565b6033546001600160a01b0316330361149857565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b603380546001600160a01b039283166001600160a01b0319821681179092559091167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3565b1561152b57565b60405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608490fd5b803b156115c05760018060a01b03166001600160601b0360a01b5f5160206116775f395f51905f525416175f5160206116775f395f51905f5255565b60405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608490fd5b90919015611627575090565b8151156116375750805190602001fd5b604460209160405192839162461bcd60e51b83528160048401528051918291826024860152018484015e5f828201840152601f01601f19168101030190fdfe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca26469706673582212203e7e5275dcfca1338183e642d2f8d1533c6f7ddb79bfa75ca00d0fd6b2d405ca64736f6c634300081b0033","sourceMap":"687:8719:41:-:0;;;;;;;1332:4:5;1324:13;;5456::4;687:8719:41;;;;;;;;;;;;;;5527:30:4;5523:138;;-1:-1:-1;687:8719:41;;;;;;;;1324:13:5;687:8719:41;;;;;;;;;;;;;;;;5523:138:4;687:8719:41;;;;;;5456:13:4;687:8719:41;5622:28:4;687:8719:41;;;;;;5622:28:4;5523:138;;;687:8719:41;-1:-1:-1;;;687:8719:41;;;;;;;;;;;;;;;;;-1:-1:-1;;;687:8719:41;;;;;;;;;;","linkReferences":{}},"deployedBytecode":{"object":"0x6080806040526004361015610012575f80fd5b5f905f3560e01c908163294e3ccb1461126e575080633659cfe614610f7057806339ad96d914610e1757806342af056814610dea5780634c46688c14610dc15780634f1ef28614610a5457806352d1902d1461099157806355a9a7bf146108e8578063616af4f7146108bf5780636eecb4c9146108a3578063715018a61461084657806383501b211461082a5780638da5cb5b14610801578063972e58ba146107e557806398dc5b03146107b65780639eade0f11461074e578063a52f681b146106e6578063be96ce9314610563578063d5d8d0a8146104d8578063e03e3691146103ae578063f28c3e37146101a35763f2fde38b14610110575f80fd5b346101a05760203660031901126101a057610129611291565b610131611484565b6001600160a01b0381161561014c57610149906114dc565b80f35b60405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608490fd5b80fd5b50346101a05760c03660031901126101a0576101bd611291565b6024356001600160a01b038116908190036103aa576044356001600160a01b038116908190036103a6576064356001600160a01b03811692908390036103a257845460ff8160081c161594858096610395575b801561037e575b156103225760ff19821660011787556102689186610311575b5061024a60ff885460081c1661024581611524565b611524565b610253336114dc565b61026360ff885460081c16611524565b6114dc565b6001600160601b0360a01b60cb54161760cb556001600160601b0360a01b60ca54161760ca556001600160601b0360a01b60cc54161760cc55608435825260cd60205260408220600260ff1982541617905560a435825260cd60205260408220600160ff198254161790556102da5780f35b61ff001981541681557f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498602060405160018152a180f35b61ffff19166101011787555f610230565b60405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608490fd5b50303b1580156102175750600160ff831614610217565b50600160ff831610610210565b8480fd5b8380fd5b8280fd5b50346101a05760803660031901126101a05760043567ffffffffffffffff81116104d457366023820112156104d45780600401359067ffffffffffffffff82116103aa573660248360051b830101116103aa5760243561ffff811681036103a65760643567ffffffffffffffff81116103a25761047161043460429236906004016112a7565b929083604051948592602084019761ffff60f01b9060f01b168852604435602285015284840137810188838201520301601f198101835282611330565b5190209083915b838310156104b95760248360051b83010135908181105f146104a85785526020526001604085205b920191610478565b9085526020526001604085206104a0565b60ff604086602093815260c984522054166040519015158152f35b5080fd5b50346101a05760ff6104e936611382565b6104f4929192611484565b16600181141580610558575b6105465760207e86b661a41d941418d5d36446dc66bee8596027431ea48aba1cdbf9ab8cbada9183855260cd8252604085208160ff19825416179055604051908152a280f35b633212f51f60e21b8352600452602482fd5b506002811415610500565b50346101a057610572366112d5565b60cb5492959493929091906001600160a01b031633036106d35760208682810103126106cf5785359582885260cd602052600260ff60408a205416036106a3578782602092829796959460405192839283378101838152039060025afa156106985783519260018060a01b0360cc541690813b15610694578593610615936040519687958694859463ab750e7560e01b8652606060048701526064860191611464565b916024840152604483015203915afa801561068957610674575b507ffe3e9e971000ab9c80c7e06aba2933aae5419d0e44693e3046913e9e58053f6291836020925260c9825260408520600160ff19825416179055604051908152a280f35b8161067e91611330565b6103aa57825f61062f565b6040513d84823e3d90fd5b8580fd5b6040513d85823e3d90fd5b82885260cd6020526040882054635a08a53760e01b89526004849052600260245260ff16604452606488fd5b5f80fd5b63921f325560e01b875233600452602487fd5b50346101a05760203660031901126101a057610700611291565b610708611484565b60cc80546001600160a01b0319166001600160a01b039290921691821790557f80ad03c31df486a2ab8f2fe1f9e0597e290255e749369a3e0cf3b1cf34b180898280a280f35b50346101a05760203660031901126101a057610768611291565b610770611484565b60ca80546001600160a01b0319166001600160a01b039290921691821790557fc34d8b9ef5ec2845c44a69730b4523b5d66bc715b6d4820707ff1f40ee5f1a9e8280a280f35b50346101a05760203660031901126101a05760ff6040602092600435815260c984522054166040519015158152f35b50346101a057806003193601126101a057602060405160028152f35b50346101a057806003193601126101a0576033546040516001600160a01b039091168152602090f35b50346101a057806003193601126101a057602060405160ff8152f35b50346101a057806003193601126101a05761085f611484565b603380546001600160a01b0319811690915581906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b50346101a057806003193601126101a057602060405160018152f35b50346101a057806003193601126101a05760cc546040516001600160a01b039091168152602090f35b50346101a05760ff6108f936611382565b610904929192611484565b16600181141580610986575b6105465781835260cd60205260ff6040842054169080820361096e575060207fca6a89a45ac13d034743c006df767832823ffba941ccc74cca0cb5dcd0abffaf9183855260cd82526040852060ff198154169055604051908152a280f35b63d4cec2bb60e01b8452600491909152602452604482fd5b506002811415610910565b50346101a057806003193601126101a0577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031630036109e95760206040515f5160206116775f395f51905f528152f35b60405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608490fd5b5060403660031901126101a057610a69611291565b60243567ffffffffffffffff81116103aa57366023820112156103aa5780600401359083610a9683611366565b91610aa46040519384611330565b838352602083019336602482840101116103aa5780602460209301863783010152610b1c7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610afe308214156113a2565b5f5160206116775f395f51905f52546001600160a01b031614611403565b610b24611484565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff1615610b5957505061014990611584565b6040516352d1902d60e01b81526001600160a01b03841690602081600481855afa869181610d89575b50610be35760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608490fd5b5f5160206116775f395f51905f5203610d3257610bff84611584565b604051907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b8680a2815115801590610d2a575b610c3e575b5050505080f35b833b15610cd95750610cc8928492839251915af43d15610cd2573d610c6281611366565b90610c706040519283611330565b81523d84602083013e5b60405191610c89606084611330565b602783527f416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c6020840152660819985a5b195960ca1b604084015261161b565b505f808080610c37565b6060610c7a565b62461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608490fd5b506001610c32565b60405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608490fd5b9091506020813d602011610db9575b81610da560209383611330565b81010312610db55751905f610b82565b8680fd5b3d9150610d98565b50346101a057806003193601126101a05760cb546040516001600160a01b039091168152602090f35b50346101a05760203660031901126101a05760ff6040602092600435815260cd8452205416604051908152f35b50346106cf57610e26366112d5565b60cb5493959491936001600160a01b03163303610f5d5760208287810103126106cf57813595815f5260cd602052600160ff60405f20541603610f315760ca546001600160a01b031691823b156106cf57610ebc5f95610eaa976040519889978896879663020a49e360e51b88526004880152606060248801526064870191611464565b84810360031901604486015291611464565b03915afa8015610f2657610f10575b5060207ffe3e9e971000ab9c80c7e06aba2933aae5419d0e44693e3046913e9e58053f629183855260c9825260408520600160ff19825416179055604051908152a280f35b610f1d9193505f90611330565b5f916020610ecb565b6040513d5f823e3d90fd5b50805f5260cd60205260ff60405f20541690635a08a53760e01b5f52600452600160245260445260645ffd5b63921f325560e01b5f523360045260245ffd5b346106cf5760203660031901126106cf57610f89611291565b610fc27f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610afe308214156113a2565b610fca611484565b602090604051610fda8382611330565b5f815282810190601f1984013683377f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff161561102157505061101f9150611584565b005b6040516352d1902d60e01b81526001600160a01b038416908581600481855afa5f918161123f575b506110aa5760405162461bcd60e51b815260048101879052602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608490fd5b5f5160206116775f395f51905f52036111e8576110c684611584565b604051907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b5f80a28151158015906111e1575b6110ff57005b833b15611190575061101f93925f92839251915af43d15611188573d9061112582611366565b916111336040519384611330565b82523d5f8484013e5b7f416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c6040519361116c606086611330565b60278552840152660819985a5b195960ca1b604084015261161b565b60609061113c565b62461bcd60e51b815260048101859052602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608490fd5b505f6110f9565b60405162461bcd60e51b815260048101869052602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608490fd5b9091508681813d8311611267575b6112578183611330565b810103126106cf57519087611049565b503d61124d565b346106cf575f3660031901126106cf5760ca546001600160a01b03168152602090f35b600435906001600160a01b03821682036106cf57565b9181601f840112156106cf5782359167ffffffffffffffff83116106cf57602083818601950101116106cf57565b9060806003198301126106cf576004359160243567ffffffffffffffff81116106cf5781611305916004016112a7565b929092916044359067ffffffffffffffff82116106cf57611328916004016112a7565b909160643590565b90601f8019910116810190811067ffffffffffffffff82111761135257604052565b634e487b7160e01b5f52604160045260245ffd5b67ffffffffffffffff811161135257601f01601f191660200190565b60409060031901126106cf576004359060243560ff811681036106cf5790565b156113a957565b60405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201526b19195b1959d85d1958d85b1b60a21b6064820152608490fd5b1561140a57565b60405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201526b6163746976652070726f787960a01b6064820152608490fd5b908060209392818452848401375f828201840152601f01601f1916010190565b6033546001600160a01b0316330361149857565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b603380546001600160a01b039283166001600160a01b0319821681179092559091167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3565b1561152b57565b60405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608490fd5b803b156115c05760018060a01b03166001600160601b0360a01b5f5160206116775f395f51905f525416175f5160206116775f395f51905f5255565b60405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608490fd5b90919015611627575090565b8151156116375750805190602001fd5b604460209160405192839162461bcd60e51b83528160048401528051918291826024860152018484015e5f828201840152601f01601f19168101030190fdfe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca26469706673582212203e7e5275dcfca1338183e642d2f8d1533c6f7ddb79bfa75ca00d0fd6b2d405ca64736f6c634300081b0033","sourceMap":"687:8719:41:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;687:8719:41;;;;;;:::i;:::-;1303:62:0;;:::i;:::-;-1:-1:-1;;;;;687:8719:41;;2409:22:0;687:8719:41;;2503:8:0;;;:::i;:::-;687:8719:41;;;;;-1:-1:-1;;;687:8719:41;;;;;;;;;;;;;;;;;-1:-1:-1;;;687:8719:41;;;;;;;;;;;;;;;;;-1:-1:-1;;687:8719:41;;;;;;:::i;:::-;;;-1:-1:-1;;;;;687:8719:41;;;;;;;;;;-1:-1:-1;;;;;687:8719:41;;;;;;;;;;-1:-1:-1;;;;;687:8719:41;;;;;;;;;;;;;;;;3133:14:4;;;;3179:34;;;687:8719:41;3178:108:4;;;;687:8719:41;;;;-1:-1:-1;;687:8719:41;;;;;;2762:8;;687:8719;3394:65:4;;687:8719:41;;4902:69:4;687:8719:41;;;;;;4902:69:4;;;:::i;:::-;;:::i;:::-;1195:12:0;929:10:7;1195:12:0;:::i;:::-;4902:69:4;687:8719:41;;;;;;4902:69:4;:::i;:::-;2762:8:41;:::i;:::-;-1:-1:-1;;;;;687:8719:41;;2781:52;687:8719;;;2781:52;687:8719;-1:-1:-1;;;;;687:8719:41;;2843:40;687:8719;;;2843:40;687:8719;-1:-1:-1;;;;;687:8719:41;;2893:44;687:8719;;;2893:44;687:8719;;;;;2947:29;687:8719;;;;;;;;;;;;;;;;;;2947:29;687:8719;;;;;;;;;;;;;;3479:99:4;;687:8719:41;;3479:99:4;687:8719:41;;;;;;;3553:14:4;687:8719:41;;;;;;3553:14:4;687:8719:41;;3394:65:4;-1:-1:-1;;687:8719:41;;;;;3394:65:4;;;687:8719:41;;;-1:-1:-1;;;687:8719:41;;;;;;;;;;;;;;;;;-1:-1:-1;;;687:8719:41;;;;;;;3178:108:4;3258:4;;1476:19:6;:23;3219:66:4;;3178:108;3219:66;687:8719:41;;;;;3268:17:4;3178:108;;3179:34;687:8719:41;;;;;3197:16:4;3179:34;;687:8719:41;;;;;;;;;;;;;;;;;;;-1:-1:-1;;687:8719:41;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6123:66;687:8719;;;;;;;;:::i;:::-;;;;;;6123:66;;;687:8719;6123:66;;687:8719;;;;;;;;;;;;;;;;;;;;;;;;;;;6123:66;;687:8719;;6123:66;;;;;;:::i;:::-;687:8719;6113:77;;2480:13:35;;2475:116;2513:3;2495:16;;;;;;687:8719:41;;;;;;;;9318:51:35;:5;;;:51;:5;;;9632:119;;687:8719:41;9632:119:35;687:8719:41;;9632:119:35;;9318:51;2513:3;687:8719:41;2480:13:35;;;9318:51;9632:119;;;687:8719:41;9632:119:35;687:8719:41;;9632:119:35;;9318:51;;2495:16;687:8719:41;;2495:16:35;687:8719:41;2495:16:35;687:8719:41;;6299:20;687:8719;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;1303:62:0;;;;;:::i;:::-;687:8719:41;2018:1;6845:25;;;:68;;;687:8719;6841:184;;687:8719;8349:66;687:8719;;;;8260:29;687:8719;;;;;;;;;;;;;;;;;;;8349:66;687:8719;;6841:184;-1:-1:-1;;;6939:71:41;;687:8719;;;6939:71;;6845:68;6886:27;2103:1;6886:27;;;6845:68;;687:8719;;;;;;;;:::i;:::-;6568:24;687:8719;;;;;;;;;-1:-1:-1;;;;;687:8719:41;6554:10;:38;6550:109;;687:8719;4102:40;;;;687:8719;;;;;;;;;;4157:29;687:8719;;2103:1;687:8719;;;;;;4157:68;4153:224;;687:8719;;;;;;;;;;;;;;;;;;;;;4416:25;;2103:1;4416:25;;;;;;;687:8719;;;;;;4469:20;687:8719;;4451:133;;;;;;687:8719;;;;;;;;;;;;;;;;4451:133;;687:8719;;4451:133;;687:8719;;;;;;:::i;:::-;;;;;;;;;;4451:133;;;;;;;;;;687:8719;;4649:54;687:8719;;;;;4595:20;687:8719;;;;;4630:4;687:8719;;;;;;;;;;;;;4649:54;687:8719;;4451:133;;;;;:::i;:::-;687:8719;;4451:133;;;;;687:8719;;;;;;;;;4451:133;687:8719;;;4416:25;687:8719;;;;;;;;;4153:224;687:8719;;;4157:29;687:8719;;;;;;-1:-1:-1;;;4248:118:41;;687:8719;;;;2103:1;687:8719;;;;;;;;4248:118;687:8719;-1:-1:-1;687:8719:41;;6550:109;-1:-1:-1;;;6615:33:41;;6554:10;687:8719;;;6615:33;;687:8719;;;;;;;-1:-1:-1;;687:8719:41;;;;;;:::i;:::-;1303:62:0;;:::i;:::-;7291:44:41;687:8719;;-1:-1:-1;;;;;;687:8719:41;-1:-1:-1;;;;;687:8719:41;;;;;;;;;7350:50;;;;687:8719;;;;;;;;;-1:-1:-1;;687:8719:41;;;;;;:::i;:::-;1303:62:0;;:::i;:::-;7645:40:41;687:8719;;-1:-1:-1;;;;;;687:8719:41;-1:-1:-1;;;;;687:8719:41;;;;;;;;;7700:46;;;;687:8719;;;;;;;;;-1:-1:-1;;687:8719:41;;;;;;;;;;;;884:52;687:8719;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2103:1;687:8719;;;;;;;;;;;;;;;;1513:6:0;687:8719:41;;;-1:-1:-1;;;;;687:8719:41;;;;;;;;;;;;;;;;;;;;;;;;1933:4;687:8719;;;;;;;;;;;;;;;;1303:62:0;;:::i;:::-;2765:6;687:8719:41;;-1:-1:-1;;;;;;687:8719:41;;;;;;;-1:-1:-1;;;;;687:8719:41;2813:40:0;687:8719:41;;2813:40:0;687:8719:41;;;;;;;;;;;;;;;;;;2018:1;687:8719;;;;;;;;;;;;;;;;1699:35;687:8719;;;-1:-1:-1;;;;;687:8719:41;;;;;;;;;;;;;;;;;:::i;:::-;1303:62:0;;;;;:::i;:::-;687:8719:41;2018:1;6845:25;;;:68;;;687:8719;6841:184;;687:8719;;;8918:29;687:8719;;;;;;;;9074:37;;;;9070:167;;687:8719;;9325:72;687:8719;;;;8918:29;687:8719;;;;;;;;;;;;;;;;;9325:72;687:8719;;9070:167;-1:-1:-1;;;9134:92:41;;687:8719;;;;;;;;9134:92;;6845:68;6886:27;2103:1;6886:27;;;6845:68;;687:8719;;;;;;;;;;;;;2333:6:5;-1:-1:-1;;;;;687:8719:41;2324:4:5;2316:23;687:8719:41;;;;;-1:-1:-1;;;;;;;;;;;687:8719:41;;;;;;-1:-1:-1;;;687:8719:41;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;687:8719:41;;-1:-1:-1;;687:8719:41;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;1963:87:5;1898:6;-1:-1:-1;;;;;687:8719:41;1873:80:5;1889:4;1881:23;;;1873:80;:::i;:::-;-1:-1:-1;;;;;;;;;;;687:8719:41;-1:-1:-1;;;;;687:8719:41;1971:30:5;1963:87;:::i;:::-;1303:62:0;;:::i;:::-;951:66:2;687:8719:41;;;;;;3478:17:2;;;;;:::i;3380:526::-;687:8719:41;;-1:-1:-1;;;3531:63:2;;-1:-1:-1;;;;;687:8719:41;;;;;;;;3531:63:2;;;;;;;3380:526;-1:-1:-1;3527:302:2;;687:8719:41;;-1:-1:-1;;;3758:56:2;;687:8719:41;;3758:56:2;;951:66;;687:8719:41;951:66:2;;687:8719:41;951:66:2;687:8719:41;;;951:66:2;-1:-1:-1;;;951:66:2;;;;3758:56;;;3527:302;-1:-1:-1;;;;;;;;;;;3644:28:2;951:66;;2277:17;;;:::i;:::-;687:8719:41;;2310:27:2;;;;;687:8719:41;;2659:15:2;;;:28;;;3527:302;2655:105;;3527:302;3380:526;;;;687:8719:41;;2655:105:2;1476:19:6;;:23;687:8719:41;;7395:25:2;7437:99;7395:25;;;;;;;;;687:8719:41;;;;;;;;:::i;:::-;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;-1:-1:-1;;;687:8719:41;;;;7437:99:2;:::i;:::-;;2655:105;;;;;;687:8719:41;;;;;-1:-1:-1;;;687:8719:41;;;;;;;;;;;;;;;;;-1:-1:-1;;;687:8719:41;;;;;;;2659:28:2;;3971:4:5;2659:28:2;;951:66;687:8719:41;;-1:-1:-1;;;951:66:2;;687:8719:41;;951:66:2;;;;687:8719:41;951:66:2;;687:8719:41;951:66:2;687:8719:41;;;951:66:2;-1:-1:-1;;;951:66:2;;;;;;;3531:63;;;;687:8719:41;3531:63:2;;687:8719:41;3531:63:2;;;;;;687:8719:41;3531:63:2;;;:::i;:::-;;;951:66;;;;;3531:63;;;;951:66;687:8719:41;;;3531:63:2;;;-1:-1:-1;3531:63:2;;687:8719:41;;;;;;;;;;;;;1454:39;687:8719;;;-1:-1:-1;;;;;687:8719:41;;;;;;;;;;;;;;;-1:-1:-1;;687:8719:41;;;;;;;;;;;;2262:62;687:8719;;;;;;;;;;;;;;;;;;;:::i;:::-;6568:24;687:8719;;;;;;-1:-1:-1;;;;;687:8719:41;6554:10;:38;6550:109;;687:8719;3345:38;;;;687:8719;;;;;;;;;;3398:29;687:8719;;2018:1;687:8719;;;;;;3398:66;3394:220;;3637:18;687:8719;-1:-1:-1;;;;;687:8719:41;;3624:103;;;;;687:8719;;;;;;;;;;;;;;;;;3624:103;;687:8719;3624:103;;687:8719;;;;;;;;;;;:::i;:::-;;;;-1:-1:-1;;687:8719:41;;;;;;;:::i;:::-;3624:103;;;;;;;;;;687:8719;;;3792:54;687:8719;;;;3738:20;687:8719;;;;;2018:1;687:8719;;;;;;;;;;;;;3792:54;687:8719;;3624:103;;;;;687:8719;3624:103;;:::i;:::-;687:8719;;;3624:103;;;687:8719;;;;;;;;;3394:220;687:8719;;;;3398:29;687:8719;;;;;;;;3487:116;;;;687:8719;3487:116;687:8719;;2018:1;687:8719;;;;;;3487:116;6550:109;6615:33;;;687:8719;6615:33;6554:10;687:8719;;;;6615:33;687:8719;;;;;;-1:-1:-1;;687:8719:41;;;;;;:::i;:::-;1963:87:5;1898:6;-1:-1:-1;;;;;687:8719:41;1873:80:5;1889:4;1881:23;;;1873:80;:::i;1963:87::-;1303:62:0;;:::i;:::-;687:8719:41;;;;;;;;:::i;:::-;;;;;;;;-1:-1:-1;;687:8719:41;;;;;951:66:2;687:8719:41;;;;;;3478:17:2;;;;;;:::i;:::-;687:8719:41;3380:526:2;687:8719:41;;-1:-1:-1;;;3531:63:2;;-1:-1:-1;;;;;687:8719:41;;;3531:63:2;687:8719:41;;;;3531:63:2;;687:8719:41;;3531:63:2;;;3380:526;-1:-1:-1;3527:302:2;;687:8719:41;;-1:-1:-1;;;3758:56:2;;687:8719:41;3758:56:2;;951:66;;;;;;;687:8719:41;951:66:2;687:8719:41;;;951:66:2;-1:-1:-1;;;951:66:2;;;;3758:56;;;3527:302;-1:-1:-1;;;;;;;;;;;3644:28:2;951:66;;2277:17;;;:::i;:::-;687:8719:41;;2310:27:2;;687:8719:41;2310:27:2;;687:8719:41;;2659:15:2;;;:28;;;3527:302;2655:105;;687:8719:41;2655:105:2;1476:19:6;;:23;687:8719:41;;7395:25:2;7437:99;7395:25;;687:8719:41;7395:25:2;;;;;;;687:8719:41;;;;;;;;;:::i;:::-;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;-1:-1:-1;;;687:8719:41;;;;7437:99:2;:::i;687:8719:41:-;;;;;;-1:-1:-1;;;687:8719:41;;;;;;;;;;;;;;;;;;-1:-1:-1;;;687:8719:41;;;;;;;2659:28:2;;687:8719:41;2659:28:2;;951:66;687:8719:41;;-1:-1:-1;;;951:66:2;;687:8719:41;951:66:2;;;;;;;;;687:8719:41;951:66:2;687:8719:41;;;951:66:2;-1:-1:-1;;;951:66:2;;;;;;;3531:63;;;;;;;;;;;;;;;;;:::i;:::-;;;951:66;;;;;3531:63;;;;;;;;;687:8719:41;;;;;;-1:-1:-1;;687:8719:41;;;;1327:33;687:8719;-1:-1:-1;;;;;687:8719:41;;;;;;;;;;-1:-1:-1;;;;;687:8719:41;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;-1:-1:-1;;687:8719:41;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;-1:-1:-1;687:8719:41;;;;;-1:-1:-1;687:8719:41;;;;;;;;;-1:-1:-1;;687:8719:41;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;:::o;:::-;;;-1:-1:-1;;;687:8719:41;;;;;;;;;;;;;;;;;-1:-1:-1;;;687:8719:41;;;;;;;;;;;:::o;:::-;;;-1:-1:-1;;;687:8719:41;;;;;;;;;;;;;;;;;-1:-1:-1;;;687:8719:41;;;;;;;;;;;;;;;;;;;;-1:-1:-1;687:8719:41;;;;;;;;-1:-1:-1;;687:8719:41;;;;:::o;1599:130:0:-;1513:6;687:8719:41;-1:-1:-1;;;;;687:8719:41;929:10:7;1662:23:0;687:8719:41;;1599:130:0:o;687:8719:41:-;;;;951:66:2;;;687:8719:41;;;;;;;;;;;;;;;;;;2673:187:0;2765:6;687:8719:41;;-1:-1:-1;;;;;687:8719:41;;;-1:-1:-1;;;;;;687:8719:41;;;;;;;;;;2813:40:0;-1:-1:-1;;2813:40:0;2673:187::o;687:8719:41:-;;;;:::o;:::-;;;-1:-1:-1;;;687:8719:41;;;;;;;;;;;;;;;;;-1:-1:-1;;;687:8719:41;;;;;;;1805:281:2;1476:19:6;;:23;687:8719:41;;;;;;;;-1:-1:-1;;;;;687:8719:41;;-1:-1:-1;;;;;;;;;;;687:8719:41;;;-1:-1:-1;;;;;;;;;;;687:8719:41;1805:281:2:o;687:8719:41:-;;;-1:-1:-1;;;687:8719:41;;;;;;;;;;;;;;;;;-1:-1:-1;;;687:8719:41;;;;;;;6622:742:6;;;;6792:566;;;6819:17;;:::o;6792:566::-;687:8719:41;;6937:21:6;:17;;7121:154;;;;;;;6933:415;687:8719:41;;;;;951:66:2;;;;;;7313:20:6;;;;;;687:8719:41;;;;;;;;;;;;;;;;6957:1:6;687:8719:41;;;;;;;;-1:-1:-1;;687:8719:41;;;7313:20:6;;;","linkReferences":{},"immutableReferences":{"702":[{"start":2468,"length":32},{"start":2762,"length":32},{"start":3982,"length":32}]}},"methodIdentifiers":{"RISC0_ID()":"972e58ba","SP1_ID()":"6eecb4c9","VERIFIER_MOCK_ADDRESS()":"83501b21","alignedAggregatorAddress()":"4c46688c","allowVerifyingProgram(bytes32,uint8)":"d5d8d0a8","allowedVerifiersProvingSystem(bytes32)":"42af0568","disallowVerifyingProgram(bytes32,uint8)":"55a9a7bf","initialize(address,address,address,address,bytes32,bytes32)":"f28c3e37","isMerkleRootVerified(bytes32)":"98dc5b03","isProofVerified(bytes32[],uint16,bytes32,bytes)":"e03e3691","owner()":"8da5cb5b","proxiableUUID()":"52d1902d","renounceOwnership()":"715018a6","risc0VerifierAddress()":"616af4f7","setRisc0VerifierAddress(address)":"a52f681b","setSP1VerifierAddress(address)":"9eade0f1","sp1VerifierAddress()":"294e3ccb","transferOwnership(address)":"f2fde38b","upgradeTo(address)":"3659cfe6","upgradeToAndCall(address,bytes)":"4f1ef286","verifyAggregationRisc0(bytes32,bytes,bytes,bytes32)":"be96ce93","verifyAggregationSP1(bytes32,bytes,bytes,bytes32)":"39ad96d9"},"rawMetadata":"{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"actual\",\"type\":\"uint8\"}],\"name\":\"InvalidProvingSystemId\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"verifierProgramCommitment\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"expected\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"actual\",\"type\":\"uint8\"}],\"name\":\"InvalidVerifyingProgram\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"OnlyAlignedAggregator\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"expected\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"received\",\"type\":\"uint8\"}],\"name\":\"ProvingSystemIdMismatch\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"merkleRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blobVersionedHash\",\"type\":\"bytes32\"}],\"name\":\"AggregatedProofVerified\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newAddress\",\"type\":\"address\"}],\"name\":\"Risc0VerifierAddressUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newAddress\",\"type\":\"address\"}],\"name\":\"SP1VerifierAddressUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"verifierProgramCommitment\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"provingSystemId\",\"type\":\"uint8\"}],\"name\":\"VerifierProgramAllowed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"verifierProgramCommitment\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"provingSystemId\",\"type\":\"uint8\"}],\"name\":\"VerifierProgramDisallowed\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"RISC0_ID\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"SP1_ID\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"VERIFIER_MOCK_ADDRESS\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"alignedAggregatorAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"verifierProgramCommitment\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"provingSystemId\",\"type\":\"uint8\"}],\"name\":\"allowVerifyingProgram\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"allowedVerifiersProvingSystem\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"verifierProgramCommitment\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"provingSystemId\",\"type\":\"uint8\"}],\"name\":\"disallowVerifyingProgram\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_alignedAggregatorAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_sp1VerifierAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_risc0VerifierAddress\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"_risc0AggregatorProgramImageId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"_sp1AggregatorProgramVKHash\",\"type\":\"bytes32\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"isMerkleRootVerified\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[]\",\"name\":\"merklePath\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint16\",\"name\":\"provingSystemId\",\"type\":\"uint16\"},{\"internalType\":\"bytes32\",\"name\":\"programCommitment\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"publicInputs\",\"type\":\"bytes\"}],\"name\":\"isProofVerified\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proxiableUUID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"risc0VerifierAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_risc0VerifierAddress\",\"type\":\"address\"}],\"name\":\"setRisc0VerifierAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_sp1VerifierAddress\",\"type\":\"address\"}],\"name\":\"setSP1VerifierAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"sp1VerifierAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"blobVersionedHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"risc0ReceiptSeal\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"risc0JournalBytes\",\"type\":\"bytes\"},{\"internalType\":\"bytes32\",\"name\":\"verifierProgramCommitment\",\"type\":\"bytes32\"}],\"name\":\"verifyAggregationRisc0\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"blobVersionedHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"sp1PublicValues\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"sp1ProofBytes\",\"type\":\"bytes\"},{\"internalType\":\"bytes32\",\"name\":\"verifierProgramCommitment\",\"type\":\"bytes32\"}],\"name\":\"verifyAggregationSP1\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"events\":{\"AdminChanged(address,address)\":{\"details\":\"Emitted when the admin account has changed.\"},\"BeaconUpgraded(address)\":{\"details\":\"Emitted when the beacon is upgraded.\"},\"Initialized(uint8)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"},\"Upgraded(address)\":{\"details\":\"Emitted when the implementation is upgraded.\"}},\"kind\":\"dev\",\"methods\":{\"allowVerifyingProgram(bytes32,uint8)\":{\"params\":{\"provingSystemId\":\"The proving system ID associated with the verifying program.\",\"verifierProgramCommitment\":\"The verifying program commitment to allow (image ID for RISC0 or vk hash for SP1).\"}},\"disallowVerifyingProgram(bytes32,uint8)\":{\"params\":{\"verifierProgramCommitment\":\"The verifying program commitment to disallow (image ID for RISC0 or vk hash for SP1).\"}},\"isProofVerified(bytes32[],uint16,bytes32,bytes)\":{\"details\":\"- The `programCommitment` parameter represents the unique identifier for the vm program: - In RISC Zero, this corresponds to the `image_id`. - In SP1, this corresponds to the `vk` (verification key) hash. - The proof commitment is derived by hashing together the `programCommitment` and the `publicInputs`. - The `merklePath` is then used to compute the Merkle root from this commitment. - The function returns `true` if this Merkle root is known to correspond to a valid aggregated proof.\",\"params\":{\"merklePath\":\"The Merkle proof (sibling hashes) needed to reconstruct the Merkle root.\",\"programCommitment\":\"The commitment of the program sent to Aligned (image_id in RISC0 or vk hash in SP1).\",\"provingSystemId\":\"The id of the proving system (1 for SP1, 2 for RISC0).\",\"publicInputs\":\"The public inputs bytes of the proof sent to Aligned.\"},\"returns\":{\"_0\":\"bool Returns true if the computed Merkle root is a recognized valid aggregated proof.\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"proxiableUUID()\":{\"details\":\"Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the implementation. It is used to validate that the this implementation remains valid after an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"setRisc0VerifierAddress(address)\":{\"params\":{\"_risc0VerifierAddress\":\"The new address for the Risc0 verifier contract\"}},\"setSP1VerifierAddress(address)\":{\"params\":{\"_sp1VerifierAddress\":\"The new address for the SP1 verifier contract\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy to `newImplementation`. Calls {_authorizeUpgrade}. Emits an {Upgraded} event.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call encoded in `data`. Calls {_authorizeUpgrade}. Emits an {Upgraded} event.\"},\"verifyAggregationSP1(bytes32,bytes,bytes,bytes32)\":{\"details\":\"This function is called by the aligned proof aggregator after collecting the proofs and aggregating them to be verified on-chain. We expect the blobTransactionHash to be called before\",\"params\":{\"blobVersionedHash\":\"the versioned hash of the blob transaction that contains the leaves that compose the merkle root.\",\"sp1ProofBytes\":\"Groth16 proof\",\"sp1PublicValues\":\"Values used to perform the execution\",\"verifierProgramCommitment\":\"The chunk aggregator verifier program commitment against which the proof should be verified\"}}},\"stateVariables\":{\"risc0VerifierAddress\":{\"details\":\"See supported verifier here: https://dev.risczero.com/api/blockchain-integration/contracts/verifier#contract-addresses\"},\"sp1VerifierAddress\":{\"details\":\"This can either be a specific SP1Verifier for a specific version, or the SP1VerifierGateway which can be used to verify proofs for any version of SP1. For the list of supported verifiers on each chain, see: https://docs.succinct.xyz/docs/sp1/verification/contract-addresses\"}},\"version\":1},\"userdoc\":{\"events\":{\"AggregatedProofVerified(bytes32,bytes32)\":{\"notice\":\"event that gets emitted after a successful aggregated proof verification\"},\"Risc0VerifierAddressUpdated(address)\":{\"notice\":\"Event emitted when the Risc0 verifier address is updated\"},\"SP1VerifierAddressUpdated(address)\":{\"notice\":\"Event emitted when the SP1 verifier address is updated\"},\"VerifierProgramAllowed(bytes32,uint8)\":{\"notice\":\"Event emitted when a verifier program is allowed\"},\"VerifierProgramDisallowed(bytes32,uint8)\":{\"notice\":\"Event emitted when a verifier program is disallowed\"}},\"kind\":\"user\",\"methods\":{\"RISC0_ID()\":{\"notice\":\"Proving system ID for RISC0\"},\"SP1_ID()\":{\"notice\":\"Proving system ID for SP1\"},\"VERIFIER_MOCK_ADDRESS()\":{\"notice\":\"whether we are in dev mode or not if the sp1 verifier address is set to this address, then we skip verification\"},\"alignedAggregatorAddress()\":{\"notice\":\"The address of the Wallet that is allowed to call the verify function.\"},\"allowVerifyingProgram(bytes32,uint8)\":{\"notice\":\"Allows a new verifying program commitment to the list of valid verifying programs.\"},\"allowedVerifiersProvingSystem(bytes32)\":{\"notice\":\"Maps allowed verifiers commitments to their proving system. If the verifier is not a valid one, it returns 0 and is considered invalid\"},\"disallowVerifyingProgram(bytes32,uint8)\":{\"notice\":\"Disallows a verifying program commitment from the list of valid verifying programs.\"},\"isMerkleRootVerified(bytes32)\":{\"notice\":\"true if merkle root is verified\"},\"isProofVerified(bytes32[],uint16,bytes32,bytes)\":{\"notice\":\"Verifies the inclusion of proof in an aggregated proof via Merkle tree proof.\"},\"risc0VerifierAddress()\":{\"notice\":\"The address of the Risc0 verifier contract\"},\"setRisc0VerifierAddress(address)\":{\"notice\":\"Sets the address of the Risc0 verifier contract\"},\"setSP1VerifierAddress(address)\":{\"notice\":\"Sets the address of the SP1 verifier contract\"},\"sp1VerifierAddress()\":{\"notice\":\"The address of the SP1 verifier contract.\"},\"verifyAggregationSP1(bytes32,bytes,bytes,bytes32)\":{\"notice\":\"Method to verify an aggregated proof from aligned\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/core/AlignedProofAggregationService.sol\":\"AlignedProofAggregationService\"},\"evmVersion\":\"cancun\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[\":@openzeppelin-upgrades-v4.9.0/=lib/eigenlayer-middleware/lib/eigenlayer-contracts/lib/openzeppelin-contracts-upgradeable-v4.9.0/\",\":@openzeppelin-upgrades/contracts/=lib/eigenlayer-middleware/lib/openzeppelin-contracts-upgradeable/contracts/\",\":@openzeppelin-v4.9.0/=lib/eigenlayer-middleware/lib/eigenlayer-contracts/lib/openzeppelin-contracts-v4.9.0/\",\":@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/\",\":@openzeppelin/contracts/=lib/eigenlayer-middleware/lib/openzeppelin-contracts/contracts/\",\":@risc0-contracts/=lib/risc0-ethereum/contracts/src/\",\":@sp1-contracts/=lib/sp1-contracts/contracts/src/\",\":ds-test/=lib/eigenlayer-middleware/lib/ds-test/src/\",\":eigenlayer-contracts/=lib/eigenlayer-middleware/lib/eigenlayer-contracts/\",\":eigenlayer-core-contracts/=lib/eigenlayer-middleware/lib/eigenlayer-contracts/src/contracts/core/\",\":eigenlayer-core/=lib/eigenlayer-middleware/lib/eigenlayer-contracts/src/\",\":eigenlayer-middleware/=lib/eigenlayer-middleware/src/\",\":eigenlayer-scripts/=lib/eigenlayer-middleware/lib/eigenlayer-contracts/script/\",\":erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/\",\":forge-std/=lib/forge-std/src/\",\":halmos-cheatcodes/=lib/risc0-ethereum/lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/\",\":openzeppelin-contracts-upgradeable-v4.9.0/=lib/eigenlayer-middleware/lib/eigenlayer-contracts/lib/openzeppelin-contracts-upgradeable-v4.9.0/\",\":openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/\",\":openzeppelin-contracts-v4.9.0/=lib/eigenlayer-middleware/lib/eigenlayer-contracts/lib/openzeppelin-contracts-v4.9.0/\",\":openzeppelin-contracts/=lib/openzeppelin-contracts/\",\":openzeppelin/=lib/risc0-ethereum/lib/openzeppelin-contracts/\",\":risc0-ethereum/=lib/risc0-ethereum/\",\":sp1-contracts/=lib/sp1-contracts/contracts/\"],\"viaIR\":true},\"sources\":{\"lib/eigenlayer-middleware/lib/openzeppelin-contracts-upgradeable/contracts/access/OwnableUpgradeable.sol\":{\"keccak256\":\"0x247c62047745915c0af6b955470a72d1696ebad4352d7d3011aef1a2463cd888\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://d7fc8396619de513c96b6e00301b88dd790e83542aab918425633a5f7297a15a\",\"dweb:/ipfs/QmXbP4kiZyp7guuS7xe8KaybnwkRPGrBc2Kbi3vhcTfpxb\"]},\"lib/eigenlayer-middleware/lib/openzeppelin-contracts-upgradeable/contracts/interfaces/draft-IERC1822Upgradeable.sol\":{\"keccak256\":\"0x77c89f893e403efc6929ba842b7ccf6534d4ffe03afe31670b4a528c0ad78c0f\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://496bd9b3df2455d571018c09f0c6badd29713fdeb907c6aa09d8d28cb603f053\",\"dweb:/ipfs/QmXdJDyYs6WMwMh21dez2BYPxhSUaUYFMDtVNcn2cgFR79\"]},\"lib/eigenlayer-middleware/lib/openzeppelin-contracts-upgradeable/contracts/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol\":{\"keccak256\":\"0x315887e846f1e5f8d8fa535a229d318bb9290aaa69485117f1ee8a9a6b3be823\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://29dda00da6d269685b555e710e4abf1c3eb6d00c15b888a7880a2f8dd3c4fdc2\",\"dweb:/ipfs/QmSqcjtdECygtT1Gy7uEo42x8542srpgGEeKKHfcnQqXgn\"]},\"lib/eigenlayer-middleware/lib/openzeppelin-contracts-upgradeable/contracts/proxy/beacon/IBeaconUpgradeable.sol\":{\"keccak256\":\"0x24b86ac8c005b8c654fbf6ac34a5a4f61580d7273541e83e013e89d66fbf0908\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://4dbfe1a3b3b3fb64294ce41fd2ad362e7b7012208117864f42c1a67620a6d5c1\",\"dweb:/ipfs/QmVMU5tWt7zBQMmf5cpMX8UMHV86T3kFeTxBTBjFqVWfoJ\"]},\"lib/eigenlayer-middleware/lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol\":{\"keccak256\":\"0x0203dcadc5737d9ef2c211d6fa15d18ebc3b30dfa51903b64870b01a062b0b4e\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://6eb2fd1e9894dbe778f4b8131adecebe570689e63cf892f4e21257bfe1252497\",\"dweb:/ipfs/QmXgUGNfZvrn6N2miv3nooSs7Jm34A41qz94fu2GtDFcx8\"]},\"lib/eigenlayer-middleware/lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/UUPSUpgradeable.sol\":{\"keccak256\":\"0x6e36e9b4b71de699c2f3f0d4e4d1aa0b35da99a26e8d5b91ef09ba234b4ef270\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://abfa467c53a0d60b4d09bf04aa952b1d1d44e5766fcc053aace078d7859b8419\",\"dweb:/ipfs/QmebVTZpyNxYfKYTuLMywzEJTdc1Ca8ME4xm3kR9gQgToG\"]},\"lib/eigenlayer-middleware/lib/openzeppelin-contracts-upgradeable/contracts/utils/AddressUpgradeable.sol\":{\"keccak256\":\"0x611aa3f23e59cfdd1863c536776407b3e33d695152a266fa7cfb34440a29a8a3\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://9b4b2110b7f2b3eb32951bc08046fa90feccffa594e1176cb91cdfb0e94726b4\",\"dweb:/ipfs/QmSxLwYjicf9zWFuieRc8WQwE4FisA1Um5jp1iSa731TGt\"]},\"lib/eigenlayer-middleware/lib/openzeppelin-contracts-upgradeable/contracts/utils/ContextUpgradeable.sol\":{\"keccak256\":\"0x963ea7f0b48b032eef72fe3a7582edf78408d6f834115b9feadd673a4d5bd149\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://d6520943ea55fdf5f0bafb39ed909f64de17051bc954ff3e88c9e5621412c79c\",\"dweb:/ipfs/QmWZ4rAKTQbNG2HxGs46AcTXShsVytKeLs7CUCdCSv5N7a\"]},\"lib/eigenlayer-middleware/lib/openzeppelin-contracts-upgradeable/contracts/utils/StorageSlotUpgradeable.sol\":{\"keccak256\":\"0x09864aea84f01e39313375b5610c73a3c1c68abbdc51e5ccdd25ff977fdadf9a\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://aedb48081190fa828d243529ce25c708202c7d4ccfe99f0e4ecd6bc0cfcd03f3\",\"dweb:/ipfs/QmWyiDQHPZA56iqsAwTmiJoxvNeRQLUVr4gTfzpdpXivpo\"]},\"lib/openzeppelin-contracts/contracts/utils/cryptography/MerkleProof.sol\":{\"keccak256\":\"0x6400c4bee15052e043e5d10315135972529bd1c8012f43da494dc6b4f4661058\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://da5d3d47d35af4373743a559ea4b9b7ecfe4bab6f0703f410c1e59959b7966ac\",\"dweb:/ipfs/QmTHdoghh4WLu4yURjGEgRk162pcwwdsG52MPGa12GqnGR\"]},\"lib/risc0-ethereum/contracts/src/IRiscZeroVerifier.sol\":{\"keccak256\":\"0x3e74a4b2940b88837fb8399a0012b435d1d513a622d3ea3ba58088af9ad7e2fd\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://b06299cc68e3c79e4eb22705bb814ce816a7fd549e78614b318ae44d35e56f9b\",\"dweb:/ipfs/QmPpX5ciRdEH6MVRVt7qYQqy7B68qxG5v3mxkgYm3kGxi5\"]},\"lib/risc0-ethereum/contracts/src/Util.sol\":{\"keccak256\":\"0x230a9a58bb2b0c68d4921ecc3672783f941890a2fa3a238dbe5188cfb7658b82\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://586cb5296c564761609ca8aaae5b1fbbdb19ab1e174f7197f602572d9e82b70c\",\"dweb:/ipfs/QmWxDmucSfg3Wgdk1rVcheDHwkziTsXWvKpKSCnxtpQBqg\"]},\"lib/sp1-contracts/contracts/src/ISP1Verifier.sol\":{\"keccak256\":\"0x9e3ba64860bea920772dcf16be7946de2a2900d80bd51e9c0771184138f4f4d3\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://0ec7230ca1fdd74edc6ab597d80bb345282aed3f0db4788ed96b4cc373ff46a3\",\"dweb:/ipfs/QmXPuSS5gzxMhFKWr1gsxBVu6WHh53ZZEvWkGgzrkM6Y7Q\"]},\"src/core/AlignedProofAggregationService.sol\":{\"keccak256\":\"0xb65ab88421d4d882c6c9edab50f98f1befe853265e0cd33358f7c4feabb7dd48\",\"license\":\"UNLICENSED\",\"urls\":[\"bzz-raw://4ff7e663616e715309af6970765a1bd7c35fbac40bfb284e33eed87778f80ac7\",\"dweb:/ipfs/QmaViYx6BGcgjJahvrNRw7yDd7MJM5TVkb651GJUYb6FcE\"]},\"src/core/IAlignedProofAggregationService.sol\":{\"keccak256\":\"0xddeb5c3e745f8b678be53d365fac9e84044cdacf898028dc243fc9ca2765cd2f\",\"urls\":[\"bzz-raw://c5fa9241c95d1535e081ad852eecae1bb4585948dcad5cdad57be9f5b8fd39eb\",\"dweb:/ipfs/QmcmRNaeuxFc7iQD1ExTzEWexdu2ksNyWZwe6sVK1mW4Gm\"]}},\"version\":1}","metadata":{"compiler":{"version":"0.8.27+commit.40a35a09"},"language":"Solidity","output":{"abi":[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"uint8","name":"actual","type":"uint8"}],"type":"error","name":"InvalidProvingSystemId"},{"inputs":[{"internalType":"bytes32","name":"verifierProgramCommitment","type":"bytes32"},{"internalType":"uint8","name":"expected","type":"uint8"},{"internalType":"uint8","name":"actual","type":"uint8"}],"type":"error","name":"InvalidVerifyingProgram"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"type":"error","name":"OnlyAlignedAggregator"},{"inputs":[{"internalType":"uint8","name":"expected","type":"uint8"},{"internalType":"uint8","name":"received","type":"uint8"}],"type":"error","name":"ProvingSystemIdMismatch"},{"inputs":[{"internalType":"address","name":"previousAdmin","type":"address","indexed":false},{"internalType":"address","name":"newAdmin","type":"address","indexed":false}],"type":"event","name":"AdminChanged","anonymous":false},{"inputs":[{"internalType":"bytes32","name":"merkleRoot","type":"bytes32","indexed":true},{"internalType":"bytes32","name":"blobVersionedHash","type":"bytes32","indexed":false}],"type":"event","name":"AggregatedProofVerified","anonymous":false},{"inputs":[{"internalType":"address","name":"beacon","type":"address","indexed":true}],"type":"event","name":"BeaconUpgraded","anonymous":false},{"inputs":[{"internalType":"uint8","name":"version","type":"uint8","indexed":false}],"type":"event","name":"Initialized","anonymous":false},{"inputs":[{"internalType":"address","name":"previousOwner","type":"address","indexed":true},{"internalType":"address","name":"newOwner","type":"address","indexed":true}],"type":"event","name":"OwnershipTransferred","anonymous":false},{"inputs":[{"internalType":"address","name":"newAddress","type":"address","indexed":true}],"type":"event","name":"Risc0VerifierAddressUpdated","anonymous":false},{"inputs":[{"internalType":"address","name":"newAddress","type":"address","indexed":true}],"type":"event","name":"SP1VerifierAddressUpdated","anonymous":false},{"inputs":[{"internalType":"address","name":"implementation","type":"address","indexed":true}],"type":"event","name":"Upgraded","anonymous":false},{"inputs":[{"internalType":"bytes32","name":"verifierProgramCommitment","type":"bytes32","indexed":true},{"internalType":"uint8","name":"provingSystemId","type":"uint8","indexed":false}],"type":"event","name":"VerifierProgramAllowed","anonymous":false},{"inputs":[{"internalType":"bytes32","name":"verifierProgramCommitment","type":"bytes32","indexed":true},{"internalType":"uint8","name":"provingSystemId","type":"uint8","indexed":false}],"type":"event","name":"VerifierProgramDisallowed","anonymous":false},{"inputs":[],"stateMutability":"view","type":"function","name":"RISC0_ID","outputs":[{"internalType":"uint8","name":"","type":"uint8"}]},{"inputs":[],"stateMutability":"view","type":"function","name":"SP1_ID","outputs":[{"internalType":"uint8","name":"","type":"uint8"}]},{"inputs":[],"stateMutability":"view","type":"function","name":"VERIFIER_MOCK_ADDRESS","outputs":[{"internalType":"address","name":"","type":"address"}]},{"inputs":[],"stateMutability":"view","type":"function","name":"alignedAggregatorAddress","outputs":[{"internalType":"address","name":"","type":"address"}]},{"inputs":[{"internalType":"bytes32","name":"verifierProgramCommitment","type":"bytes32"},{"internalType":"uint8","name":"provingSystemId","type":"uint8"}],"stateMutability":"nonpayable","type":"function","name":"allowVerifyingProgram"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function","name":"allowedVerifiersProvingSystem","outputs":[{"internalType":"uint8","name":"","type":"uint8"}]},{"inputs":[{"internalType":"bytes32","name":"verifierProgramCommitment","type":"bytes32"},{"internalType":"uint8","name":"provingSystemId","type":"uint8"}],"stateMutability":"nonpayable","type":"function","name":"disallowVerifyingProgram"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"},{"internalType":"address","name":"_alignedAggregatorAddress","type":"address"},{"internalType":"address","name":"_sp1VerifierAddress","type":"address"},{"internalType":"address","name":"_risc0VerifierAddress","type":"address"},{"internalType":"bytes32","name":"_risc0AggregatorProgramImageId","type":"bytes32"},{"internalType":"bytes32","name":"_sp1AggregatorProgramVKHash","type":"bytes32"}],"stateMutability":"nonpayable","type":"function","name":"initialize"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function","name":"isMerkleRootVerified","outputs":[{"internalType":"bool","name":"","type":"bool"}]},{"inputs":[{"internalType":"bytes32[]","name":"merklePath","type":"bytes32[]"},{"internalType":"uint16","name":"provingSystemId","type":"uint16"},{"internalType":"bytes32","name":"programCommitment","type":"bytes32"},{"internalType":"bytes","name":"publicInputs","type":"bytes"}],"stateMutability":"view","type":"function","name":"isProofVerified","outputs":[{"internalType":"bool","name":"","type":"bool"}]},{"inputs":[],"stateMutability":"view","type":"function","name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}]},{"inputs":[],"stateMutability":"view","type":"function","name":"proxiableUUID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}]},{"inputs":[],"stateMutability":"nonpayable","type":"function","name":"renounceOwnership"},{"inputs":[],"stateMutability":"view","type":"function","name":"risc0VerifierAddress","outputs":[{"internalType":"address","name":"","type":"address"}]},{"inputs":[{"internalType":"address","name":"_risc0VerifierAddress","type":"address"}],"stateMutability":"nonpayable","type":"function","name":"setRisc0VerifierAddress"},{"inputs":[{"internalType":"address","name":"_sp1VerifierAddress","type":"address"}],"stateMutability":"nonpayable","type":"function","name":"setSP1VerifierAddress"},{"inputs":[],"stateMutability":"view","type":"function","name":"sp1VerifierAddress","outputs":[{"internalType":"address","name":"","type":"address"}]},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"stateMutability":"nonpayable","type":"function","name":"transferOwnership"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"}],"stateMutability":"nonpayable","type":"function","name":"upgradeTo"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"stateMutability":"payable","type":"function","name":"upgradeToAndCall"},{"inputs":[{"internalType":"bytes32","name":"blobVersionedHash","type":"bytes32"},{"internalType":"bytes","name":"risc0ReceiptSeal","type":"bytes"},{"internalType":"bytes","name":"risc0JournalBytes","type":"bytes"},{"internalType":"bytes32","name":"verifierProgramCommitment","type":"bytes32"}],"stateMutability":"nonpayable","type":"function","name":"verifyAggregationRisc0"},{"inputs":[{"internalType":"bytes32","name":"blobVersionedHash","type":"bytes32"},{"internalType":"bytes","name":"sp1PublicValues","type":"bytes"},{"internalType":"bytes","name":"sp1ProofBytes","type":"bytes"},{"internalType":"bytes32","name":"verifierProgramCommitment","type":"bytes32"}],"stateMutability":"nonpayable","type":"function","name":"verifyAggregationSP1"}],"devdoc":{"kind":"dev","methods":{"allowVerifyingProgram(bytes32,uint8)":{"params":{"provingSystemId":"The proving system ID associated with the verifying program.","verifierProgramCommitment":"The verifying program commitment to allow (image ID for RISC0 or vk hash for SP1)."}},"disallowVerifyingProgram(bytes32,uint8)":{"params":{"verifierProgramCommitment":"The verifying program commitment to disallow (image ID for RISC0 or vk hash for SP1)."}},"isProofVerified(bytes32[],uint16,bytes32,bytes)":{"details":"- The `programCommitment` parameter represents the unique identifier for the vm program: - In RISC Zero, this corresponds to the `image_id`. - In SP1, this corresponds to the `vk` (verification key) hash. - The proof commitment is derived by hashing together the `programCommitment` and the `publicInputs`. - The `merklePath` is then used to compute the Merkle root from this commitment. - The function returns `true` if this Merkle root is known to correspond to a valid aggregated proof.","params":{"merklePath":"The Merkle proof (sibling hashes) needed to reconstruct the Merkle root.","programCommitment":"The commitment of the program sent to Aligned (image_id in RISC0 or vk hash in SP1).","provingSystemId":"The id of the proving system (1 for SP1, 2 for RISC0).","publicInputs":"The public inputs bytes of the proof sent to Aligned."},"returns":{"_0":"bool Returns true if the computed Merkle root is a recognized valid aggregated proof."}},"owner()":{"details":"Returns the address of the current owner."},"proxiableUUID()":{"details":"Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the implementation. It is used to validate that the this implementation remains valid after an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier."},"renounceOwnership()":{"details":"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner."},"setRisc0VerifierAddress(address)":{"params":{"_risc0VerifierAddress":"The new address for the Risc0 verifier contract"}},"setSP1VerifierAddress(address)":{"params":{"_sp1VerifierAddress":"The new address for the SP1 verifier contract"}},"transferOwnership(address)":{"details":"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner."},"upgradeTo(address)":{"details":"Upgrade the implementation of the proxy to `newImplementation`. Calls {_authorizeUpgrade}. Emits an {Upgraded} event."},"upgradeToAndCall(address,bytes)":{"details":"Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call encoded in `data`. Calls {_authorizeUpgrade}. Emits an {Upgraded} event."},"verifyAggregationSP1(bytes32,bytes,bytes,bytes32)":{"details":"This function is called by the aligned proof aggregator after collecting the proofs and aggregating them to be verified on-chain. We expect the blobTransactionHash to be called before","params":{"blobVersionedHash":"the versioned hash of the blob transaction that contains the leaves that compose the merkle root.","sp1ProofBytes":"Groth16 proof","sp1PublicValues":"Values used to perform the execution","verifierProgramCommitment":"The chunk aggregator verifier program commitment against which the proof should be verified"}}},"version":1},"userdoc":{"kind":"user","methods":{"RISC0_ID()":{"notice":"Proving system ID for RISC0"},"SP1_ID()":{"notice":"Proving system ID for SP1"},"VERIFIER_MOCK_ADDRESS()":{"notice":"whether we are in dev mode or not if the sp1 verifier address is set to this address, then we skip verification"},"alignedAggregatorAddress()":{"notice":"The address of the Wallet that is allowed to call the verify function."},"allowVerifyingProgram(bytes32,uint8)":{"notice":"Allows a new verifying program commitment to the list of valid verifying programs."},"allowedVerifiersProvingSystem(bytes32)":{"notice":"Maps allowed verifiers commitments to their proving system. If the verifier is not a valid one, it returns 0 and is considered invalid"},"disallowVerifyingProgram(bytes32,uint8)":{"notice":"Disallows a verifying program commitment from the list of valid verifying programs."},"isMerkleRootVerified(bytes32)":{"notice":"true if merkle root is verified"},"isProofVerified(bytes32[],uint16,bytes32,bytes)":{"notice":"Verifies the inclusion of proof in an aggregated proof via Merkle tree proof."},"risc0VerifierAddress()":{"notice":"The address of the Risc0 verifier contract"},"setRisc0VerifierAddress(address)":{"notice":"Sets the address of the Risc0 verifier contract"},"setSP1VerifierAddress(address)":{"notice":"Sets the address of the SP1 verifier contract"},"sp1VerifierAddress()":{"notice":"The address of the SP1 verifier contract."},"verifyAggregationSP1(bytes32,bytes,bytes,bytes32)":{"notice":"Method to verify an aggregated proof from aligned"}},"version":1}},"settings":{"remappings":["@openzeppelin-upgrades-v4.9.0/=lib/eigenlayer-middleware/lib/eigenlayer-contracts/lib/openzeppelin-contracts-upgradeable-v4.9.0/","@openzeppelin-upgrades/contracts/=lib/eigenlayer-middleware/lib/openzeppelin-contracts-upgradeable/contracts/","@openzeppelin-v4.9.0/=lib/eigenlayer-middleware/lib/eigenlayer-contracts/lib/openzeppelin-contracts-v4.9.0/","@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/","@openzeppelin/contracts/=lib/eigenlayer-middleware/lib/openzeppelin-contracts/contracts/","@risc0-contracts/=lib/risc0-ethereum/contracts/src/","@sp1-contracts/=lib/sp1-contracts/contracts/src/","ds-test/=lib/eigenlayer-middleware/lib/ds-test/src/","eigenlayer-contracts/=lib/eigenlayer-middleware/lib/eigenlayer-contracts/","eigenlayer-core-contracts/=lib/eigenlayer-middleware/lib/eigenlayer-contracts/src/contracts/core/","eigenlayer-core/=lib/eigenlayer-middleware/lib/eigenlayer-contracts/src/","eigenlayer-middleware/=lib/eigenlayer-middleware/src/","eigenlayer-scripts/=lib/eigenlayer-middleware/lib/eigenlayer-contracts/script/","erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/","forge-std/=lib/forge-std/src/","halmos-cheatcodes/=lib/risc0-ethereum/lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/","openzeppelin-contracts-upgradeable-v4.9.0/=lib/eigenlayer-middleware/lib/eigenlayer-contracts/lib/openzeppelin-contracts-upgradeable-v4.9.0/","openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/","openzeppelin-contracts-v4.9.0/=lib/eigenlayer-middleware/lib/eigenlayer-contracts/lib/openzeppelin-contracts-v4.9.0/","openzeppelin-contracts/=lib/openzeppelin-contracts/","openzeppelin/=lib/risc0-ethereum/lib/openzeppelin-contracts/","risc0-ethereum/=lib/risc0-ethereum/","sp1-contracts/=lib/sp1-contracts/contracts/"],"optimizer":{"enabled":true,"runs":200},"metadata":{"bytecodeHash":"ipfs"},"compilationTarget":{"src/core/AlignedProofAggregationService.sol":"AlignedProofAggregationService"},"evmVersion":"cancun","libraries":{},"viaIR":true},"sources":{"lib/eigenlayer-middleware/lib/openzeppelin-contracts-upgradeable/contracts/access/OwnableUpgradeable.sol":{"keccak256":"0x247c62047745915c0af6b955470a72d1696ebad4352d7d3011aef1a2463cd888","urls":["bzz-raw://d7fc8396619de513c96b6e00301b88dd790e83542aab918425633a5f7297a15a","dweb:/ipfs/QmXbP4kiZyp7guuS7xe8KaybnwkRPGrBc2Kbi3vhcTfpxb"],"license":"MIT"},"lib/eigenlayer-middleware/lib/openzeppelin-contracts-upgradeable/contracts/interfaces/draft-IERC1822Upgradeable.sol":{"keccak256":"0x77c89f893e403efc6929ba842b7ccf6534d4ffe03afe31670b4a528c0ad78c0f","urls":["bzz-raw://496bd9b3df2455d571018c09f0c6badd29713fdeb907c6aa09d8d28cb603f053","dweb:/ipfs/QmXdJDyYs6WMwMh21dez2BYPxhSUaUYFMDtVNcn2cgFR79"],"license":"MIT"},"lib/eigenlayer-middleware/lib/openzeppelin-contracts-upgradeable/contracts/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol":{"keccak256":"0x315887e846f1e5f8d8fa535a229d318bb9290aaa69485117f1ee8a9a6b3be823","urls":["bzz-raw://29dda00da6d269685b555e710e4abf1c3eb6d00c15b888a7880a2f8dd3c4fdc2","dweb:/ipfs/QmSqcjtdECygtT1Gy7uEo42x8542srpgGEeKKHfcnQqXgn"],"license":"MIT"},"lib/eigenlayer-middleware/lib/openzeppelin-contracts-upgradeable/contracts/proxy/beacon/IBeaconUpgradeable.sol":{"keccak256":"0x24b86ac8c005b8c654fbf6ac34a5a4f61580d7273541e83e013e89d66fbf0908","urls":["bzz-raw://4dbfe1a3b3b3fb64294ce41fd2ad362e7b7012208117864f42c1a67620a6d5c1","dweb:/ipfs/QmVMU5tWt7zBQMmf5cpMX8UMHV86T3kFeTxBTBjFqVWfoJ"],"license":"MIT"},"lib/eigenlayer-middleware/lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol":{"keccak256":"0x0203dcadc5737d9ef2c211d6fa15d18ebc3b30dfa51903b64870b01a062b0b4e","urls":["bzz-raw://6eb2fd1e9894dbe778f4b8131adecebe570689e63cf892f4e21257bfe1252497","dweb:/ipfs/QmXgUGNfZvrn6N2miv3nooSs7Jm34A41qz94fu2GtDFcx8"],"license":"MIT"},"lib/eigenlayer-middleware/lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/UUPSUpgradeable.sol":{"keccak256":"0x6e36e9b4b71de699c2f3f0d4e4d1aa0b35da99a26e8d5b91ef09ba234b4ef270","urls":["bzz-raw://abfa467c53a0d60b4d09bf04aa952b1d1d44e5766fcc053aace078d7859b8419","dweb:/ipfs/QmebVTZpyNxYfKYTuLMywzEJTdc1Ca8ME4xm3kR9gQgToG"],"license":"MIT"},"lib/eigenlayer-middleware/lib/openzeppelin-contracts-upgradeable/contracts/utils/AddressUpgradeable.sol":{"keccak256":"0x611aa3f23e59cfdd1863c536776407b3e33d695152a266fa7cfb34440a29a8a3","urls":["bzz-raw://9b4b2110b7f2b3eb32951bc08046fa90feccffa594e1176cb91cdfb0e94726b4","dweb:/ipfs/QmSxLwYjicf9zWFuieRc8WQwE4FisA1Um5jp1iSa731TGt"],"license":"MIT"},"lib/eigenlayer-middleware/lib/openzeppelin-contracts-upgradeable/contracts/utils/ContextUpgradeable.sol":{"keccak256":"0x963ea7f0b48b032eef72fe3a7582edf78408d6f834115b9feadd673a4d5bd149","urls":["bzz-raw://d6520943ea55fdf5f0bafb39ed909f64de17051bc954ff3e88c9e5621412c79c","dweb:/ipfs/QmWZ4rAKTQbNG2HxGs46AcTXShsVytKeLs7CUCdCSv5N7a"],"license":"MIT"},"lib/eigenlayer-middleware/lib/openzeppelin-contracts-upgradeable/contracts/utils/StorageSlotUpgradeable.sol":{"keccak256":"0x09864aea84f01e39313375b5610c73a3c1c68abbdc51e5ccdd25ff977fdadf9a","urls":["bzz-raw://aedb48081190fa828d243529ce25c708202c7d4ccfe99f0e4ecd6bc0cfcd03f3","dweb:/ipfs/QmWyiDQHPZA56iqsAwTmiJoxvNeRQLUVr4gTfzpdpXivpo"],"license":"MIT"},"lib/openzeppelin-contracts/contracts/utils/cryptography/MerkleProof.sol":{"keccak256":"0x6400c4bee15052e043e5d10315135972529bd1c8012f43da494dc6b4f4661058","urls":["bzz-raw://da5d3d47d35af4373743a559ea4b9b7ecfe4bab6f0703f410c1e59959b7966ac","dweb:/ipfs/QmTHdoghh4WLu4yURjGEgRk162pcwwdsG52MPGa12GqnGR"],"license":"MIT"},"lib/risc0-ethereum/contracts/src/IRiscZeroVerifier.sol":{"keccak256":"0x3e74a4b2940b88837fb8399a0012b435d1d513a622d3ea3ba58088af9ad7e2fd","urls":["bzz-raw://b06299cc68e3c79e4eb22705bb814ce816a7fd549e78614b318ae44d35e56f9b","dweb:/ipfs/QmPpX5ciRdEH6MVRVt7qYQqy7B68qxG5v3mxkgYm3kGxi5"],"license":"Apache-2.0"},"lib/risc0-ethereum/contracts/src/Util.sol":{"keccak256":"0x230a9a58bb2b0c68d4921ecc3672783f941890a2fa3a238dbe5188cfb7658b82","urls":["bzz-raw://586cb5296c564761609ca8aaae5b1fbbdb19ab1e174f7197f602572d9e82b70c","dweb:/ipfs/QmWxDmucSfg3Wgdk1rVcheDHwkziTsXWvKpKSCnxtpQBqg"],"license":"Apache-2.0"},"lib/sp1-contracts/contracts/src/ISP1Verifier.sol":{"keccak256":"0x9e3ba64860bea920772dcf16be7946de2a2900d80bd51e9c0771184138f4f4d3","urls":["bzz-raw://0ec7230ca1fdd74edc6ab597d80bb345282aed3f0db4788ed96b4cc373ff46a3","dweb:/ipfs/QmXPuSS5gzxMhFKWr1gsxBVu6WHh53ZZEvWkGgzrkM6Y7Q"],"license":"MIT"},"src/core/AlignedProofAggregationService.sol":{"keccak256":"0xb65ab88421d4d882c6c9edab50f98f1befe853265e0cd33358f7c4feabb7dd48","urls":["bzz-raw://4ff7e663616e715309af6970765a1bd7c35fbac40bfb284e33eed87778f80ac7","dweb:/ipfs/QmaViYx6BGcgjJahvrNRw7yDd7MJM5TVkb651GJUYb6FcE"],"license":"UNLICENSED"},"src/core/IAlignedProofAggregationService.sol":{"keccak256":"0xddeb5c3e745f8b678be53d365fac9e84044cdacf898028dc243fc9ca2765cd2f","urls":["bzz-raw://c5fa9241c95d1535e081ad852eecae1bb4585948dcad5cdad57be9f5b8fd39eb","dweb:/ipfs/QmcmRNaeuxFc7iQD1ExTzEWexdu2ksNyWZwe6sVK1mW4Gm"],"license":null}},"version":1},"id":41} diff --git a/crates/sdk/src/beacon.rs b/aggregation_mode/sdk/src/beacon.rs similarity index 94% rename from crates/sdk/src/beacon.rs rename to aggregation_mode/sdk/src/beacon.rs index 99933a794a..4883b7c599 100644 --- a/crates/sdk/src/beacon.rs +++ b/aggregation_mode/sdk/src/beacon.rs @@ -1,9 +1,10 @@ use std::str::FromStr; -use ethers::core::k256::sha2::{Digest, Sha256}; +use alloy::{hex, signers::k256::sha2::Sha256}; use reqwest::{Client, Url}; use serde::{Deserialize, Serialize}; use serde_json::Value; +use sha3::Digest; // See https://eips.ethereum.org/EIPS/eip-4844#parameters pub const KZG_VERSIONED_HASH: u8 = 0x1; @@ -22,7 +23,7 @@ enum BeaconAPIResponse { #[derive(Debug, Clone)] pub enum BeaconClientError { - Url(url::ParseError), + Url(String), ReqwestError(String), APIError { code: u64, message: String }, Deserialization(String), @@ -79,8 +80,7 @@ impl BeaconClient { let parent_block_hash_hex = format!("0x{}", hex::encode(parent_block_hash)); let data = self .beacon_get(&format!( - "/eth/v1/beacon/headers?parent_root={}", - parent_block_hash_hex + "/eth/v1/beacon/headers?parent_root={parent_block_hash_hex}" )) .await?; @@ -96,7 +96,7 @@ impl BeaconClient { pub async fn get_blobs_from_slot(&self, slot: u64) -> Result, BeaconClientError> { let data = self - .beacon_get(&format!("/eth/v1/beacon/blob_sidecars/{}", slot)) + .beacon_get(&format!("/eth/v1/beacon/blob_sidecars/{slot}")) .await?; Vec::::deserialize(data) @@ -127,7 +127,7 @@ impl BeaconClient { async fn beacon_get(&self, path: &str) -> Result { let url = Url::from_str(&format!("{}{}", self.beacon_client_url, path)) - .map_err(BeaconClientError::Url)?; + .map_err(|e| BeaconClientError::Url(e.to_string()))?; let req = self .api_client .get(url) diff --git a/aggregation_mode/sdk/src/blockchain/helpers.rs b/aggregation_mode/sdk/src/blockchain/helpers.rs new file mode 100644 index 0000000000..47757aeb1b --- /dev/null +++ b/aggregation_mode/sdk/src/blockchain/helpers.rs @@ -0,0 +1,34 @@ +pub fn decoded_blob(blob_data: &[u8]) -> Vec<[u8; 32]> { + let mut proof_hashes = vec![]; + + let mut current_hash = [0u8; 32]; + let mut current_hash_count = 0; + let mut total_bytes_count = 0; + + while total_bytes_count < blob_data.len() { + // Every 32 bytes there is a 0x0 acting as padding, so we need to skip the byte + let is_pad = total_bytes_count % 32 == 0; + if is_pad { + total_bytes_count += 1; + continue; + } + + current_hash[current_hash_count] = blob_data[total_bytes_count]; + + if current_hash_count + 1 == 32 { + // if the current_hash is the zero hash, then there are no more proofs in the blob + if current_hash == [0u8; 32] { + break; + } + proof_hashes.push(current_hash); + current_hash = [0u8; 32]; + current_hash_count = 0; + } else { + current_hash_count += 1; + } + + total_bytes_count += 1; + } + + proof_hashes +} diff --git a/aggregation_mode/sdk/src/blockchain/mod.rs b/aggregation_mode/sdk/src/blockchain/mod.rs new file mode 100644 index 0000000000..abf3493f0c --- /dev/null +++ b/aggregation_mode/sdk/src/blockchain/mod.rs @@ -0,0 +1,9 @@ +// Modules +mod helpers; +pub mod provider; +mod types; + +pub use types::{ + AggregationModeProvingSystem, AggregationModeVerificationData, ProofStatus, + ProofVerificationAggModeError, +}; diff --git a/aggregation_mode/sdk/src/blockchain/provider.rs b/aggregation_mode/sdk/src/blockchain/provider.rs new file mode 100644 index 0000000000..3b366daec6 --- /dev/null +++ b/aggregation_mode/sdk/src/blockchain/provider.rs @@ -0,0 +1,186 @@ +use crate::{ + beacon::BeaconClient, + blockchain::{ + helpers::decoded_blob, + types::{ + AlignedProofAggregationService, AlignedProofAggregationServiceContract, Hash32, + ProofStatus, RPCProvider, + }, + AggregationModeVerificationData, ProofVerificationAggModeError, + }, + types::Network, +}; +use alloy::{ + eips::BlockId, + hex, + primitives::Address, + providers::{Provider, ProviderBuilder}, + rpc::types::{Filter, Log}, +}; +use lambdaworks_crypto::merkle_tree::merkle::MerkleTree; +use std::str::FromStr; + +/// How much to go back from current block if from_block is not provided +/// 7500 blocks = 25hr +const FROM_BLOCKS_AGO_DEFAULT: u64 = 7500; + +pub struct ProofAggregationServiceProvider { + rpc_provider: RPCProvider, + beacon_client: BeaconClient, + proof_aggregation_service_contract: AlignedProofAggregationServiceContract, +} + +impl ProofAggregationServiceProvider { + pub fn new(network: Network, rpc_url: String, beacon_client_url: String) -> Self { + let rpc_url: reqwest::Url = rpc_url.parse().expect("rpc_url should be valid"); + let rpc_provider = ProviderBuilder::new().connect_http(rpc_url.clone()); + + let beacon_client = BeaconClient::new(beacon_client_url); + + let proof_aggregation_service_contract = AlignedProofAggregationService::new( + // safe unwrap, we know the address in network enum is valid + Address::from_str(&network.proof_aggregator_contract_address()).unwrap(), + rpc_provider.clone(), + ); + + Self { + rpc_provider, + proof_aggregation_service_contract, + beacon_client, + } + } + + pub async fn check_proof_verification( + &self, + from_block: Option, + verification_data: AggregationModeVerificationData, + ) -> Result { + let logs = self.fetch_verified_proofs_events(from_block).await?; + let proof_commitment = verification_data.commitment(); + + for log in logs { + let (merkle_root, leaves) = self.get_blob_data_from_verified_proof_event(log).await?; + + let leaves: Vec = leaves.iter().map(|leaf| Hash32(*leaf)).collect(); + + let Some(pos) = leaves.iter().position(|p| p.0 == proof_commitment) else { + continue; + }; + + let Some(merkle_tree) = MerkleTree::::build(&leaves) else { + continue; + }; + + let Some(proof) = merkle_tree.get_proof_by_pos(pos) else { + continue; + }; + + let result = proof.verify::(&merkle_root, pos, &Hash32(proof_commitment)); + if !result { + return Ok(ProofStatus::Invalid); + } + + return Ok(ProofStatus::Verified { + merkle_path: proof.merkle_path, + merkle_root, + }); + } + + Ok(ProofStatus::NotFound) + } + + async fn fetch_verified_proofs_events( + &self, + from_block: Option, + ) -> Result, ProofVerificationAggModeError> { + let from_block = match from_block { + Some(from_block) => from_block, + None => { + let block_number = self.rpc_provider.get_block_number().await.map_err(|e| { + ProofVerificationAggModeError::EthereumProviderError(e.to_string()) + })?; + + block_number.saturating_sub(FROM_BLOCKS_AGO_DEFAULT) + } + }; + + let filter = Filter::new() + .address(*self.proof_aggregation_service_contract.address()) + .event("AggregatedProofVerified(bytes32,bytes32)") + .from_block(from_block); + + let logs = self + .rpc_provider + .get_logs(&filter) + .await + .map_err(|e| ProofVerificationAggModeError::EthereumProviderError(e.to_string()))?; + + Ok(logs) + } + + async fn get_blob_data_from_verified_proof_event( + &self, + log: Log, + ) -> Result<([u8; 32], Vec<[u8; 32]>), ProofVerificationAggModeError> { + // First 32 bytes of the data are the bytes of the blob versioned hash + let blob_versioned_hash: [u8; 32] = log.data().data[0..32] + .try_into() + .map_err(|_| ProofVerificationAggModeError::EventDecoding)?; + + // Event is indexed by merkle root + let merkle_root = log.topics()[1].0; + + // Block Number shouldn't be empty, in case it is, + // there is a problem with this log, and we skip it + // This same logic is replicated for other checks. + let Some(block_number) = log.block_number else { + return Err(ProofVerificationAggModeError::EventDecoding); + }; + + let Some(block) = self + .rpc_provider + .get_block(BlockId::Number(alloy::eips::BlockNumberOrTag::Number( + block_number, + ))) + .await + .map_err(|e| ProofVerificationAggModeError::EthereumProviderError(e.to_string()))? + else { + return Err(ProofVerificationAggModeError::EventDecoding); + }; + + let Some(beacon_parent_root) = block.header.parent_beacon_block_root else { + return Err(ProofVerificationAggModeError::EventDecoding); + }; + + let Some(beacon_block) = self + .beacon_client + .get_block_header_from_parent_hash(beacon_parent_root.0) + .await + .map_err(ProofVerificationAggModeError::BeaconClient)? + else { + return Err(ProofVerificationAggModeError::EventDecoding); + }; + + let slot: u64 = beacon_block + .header + .message + .slot + .parse() + .expect("Slot to be parsable number"); + + let Some(blob_data) = self + .beacon_client + .get_blob_by_versioned_hash(slot, blob_versioned_hash) + .await + .map_err(ProofVerificationAggModeError::BeaconClient)? + else { + return Err(ProofVerificationAggModeError::EventDecoding); + }; + + let blob_bytes = + hex::decode(blob_data.blob.replace("0x", "")).expect("A valid hex encoded data"); + let proof_commitments = decoded_blob(&blob_bytes); + + Ok((merkle_root, proof_commitments)) + } +} diff --git a/crates/sdk/src/aggregation_layer/types.rs b/aggregation_mode/sdk/src/blockchain/types.rs similarity index 72% rename from crates/sdk/src/aggregation_layer/types.rs rename to aggregation_mode/sdk/src/blockchain/types.rs index 3d31ae435d..981f90641a 100644 --- a/crates/sdk/src/aggregation_layer/types.rs +++ b/aggregation_mode/sdk/src/blockchain/types.rs @@ -1,8 +1,51 @@ +use crate::beacon::BeaconClientError; +use alloy::sol; use lambdaworks_crypto::merkle_tree::traits::IsMerkleTreeBackend; use serde::{Deserialize, Serialize}; use sha3::{Digest, Keccak256}; -use crate::beacon::BeaconClientError; +sol!( + #[sol(rpc)] + AlignedProofAggregationService, + "abi/AlignedProofAggregationService.json" +); + +pub type AlignedProofAggregationServiceContract = + AlignedProofAggregationService::AlignedProofAggregationServiceInstance< + alloy::providers::fillers::FillProvider< + alloy::providers::fillers::JoinFill< + alloy::providers::Identity, + alloy::providers::fillers::JoinFill< + alloy::providers::fillers::GasFiller, + alloy::providers::fillers::JoinFill< + alloy::providers::fillers::BlobGasFiller, + alloy::providers::fillers::JoinFill< + alloy::providers::fillers::NonceFiller, + alloy::providers::fillers::ChainIdFiller, + >, + >, + >, + >, + alloy::providers::RootProvider, + >, + >; + +pub type RPCProvider = alloy::providers::fillers::FillProvider< + alloy::providers::fillers::JoinFill< + alloy::providers::Identity, + alloy::providers::fillers::JoinFill< + alloy::providers::fillers::GasFiller, + alloy::providers::fillers::JoinFill< + alloy::providers::fillers::BlobGasFiller, + alloy::providers::fillers::JoinFill< + alloy::providers::fillers::NonceFiller, + alloy::providers::fillers::ChainIdFiller, + >, + >, + >, + >, + alloy::providers::RootProvider, +>; #[repr(u16)] #[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq, Hash)] @@ -25,10 +68,10 @@ impl AggregationModeProvingSystem { } } -impl TryFrom for AggregationModeProvingSystem { +impl TryFrom for AggregationModeProvingSystem { type Error = (); - fn try_from(v: u8) -> Result { + fn try_from(v: u16) -> Result { match v { 0 => Ok(AggregationModeProvingSystem::SP1), 1 => Ok(AggregationModeProvingSystem::RISC0), @@ -156,3 +199,13 @@ pub enum ProofVerificationAggModeError { EventDecoding, MerkleTreeConstruction, } + +#[derive(Debug, Clone)] +pub enum ProofStatus { + Verified { + merkle_root: [u8; 32], + merkle_path: Vec<[u8; 32]>, + }, + Invalid, + NotFound, +} diff --git a/aggregation_mode/sdk/src/constants.rs b/aggregation_mode/sdk/src/constants.rs new file mode 100644 index 0000000000..9054b929df --- /dev/null +++ b/aggregation_mode/sdk/src/constants.rs @@ -0,0 +1,22 @@ +// AggregationModePaymentService contract address for each chain +pub const ALIGNED_PROOF_AGG_SERVICE_ADDRESS_MAINNET: &str = "0x0"; +pub const ALIGNED_PROOF_AGG_SERVICE_ADDRESS_MAINNET_STAGE: &str = "0x0"; +pub const ALIGNED_PROOF_AGG_SERVICE_ADDRESS_SEPOLIA: &str = "0x0"; +pub const ALIGNED_PROOF_AGG_SERVICE_ADDRESS_HOODI: &str = "0x0"; +pub const ALIGNED_PROOF_AGG_SERVICE_ADDRESS_DEVNET: &str = + "0xcbEAF3BDe82155F56486Fb5a1072cb8baAf547cc"; + +// AggregationModePaymentService contract address for each chain +pub const ALIGNED_AGG_PAYMENT_SERVICE_ADDRESS_MAINNET: &str = "0x0"; +pub const ALIGNED_AGG_PAYMENT_SERVICE_ADDRESS_MAINNET_STAGE: &str = "0x0"; +pub const ALIGNED_AGG_PAYMENT_SERVICE_ADDRESS_SEPOLIA: &str = "0x0"; +pub const ALIGNED_AGG_PAYMENT_SERVICE_ADDRESS_HOODI: &str = "0x0"; +pub const ALIGNED_AGG_PAYMENT_SERVICE_ADDRESS_DEVNET: &str = + "0x922D6956C99E12DFeB3224DEA977D0939758A1Fe"; + +// AggregationMode Gateway urls for chain +pub const ALIGNED_AGG_MODE_GATEWAY_URL_MAINNET: &str = ""; +pub const ALIGNED_AGG_MODE_GATEWAY_URL_MAINNET_STAGE: &str = ""; +pub const ALIGNED_AGG_MODE_GATEWAY_URL_SEPOLIA: &str = ""; +pub const ALIGNED_AGG_MODE_GATEWAY_URL_HOODI: &str = "http://hoodi.gateway.alignedlayer.com:8080"; +pub const ALIGNED_AGG_MODE_GATEWAY_URL_DEVNET: &str = "http://127.0.0.1:8089"; diff --git a/aggregation_mode/sdk/src/lib.rs b/aggregation_mode/sdk/src/lib.rs index 3ad15d1f15..f904c14947 100644 --- a/aggregation_mode/sdk/src/lib.rs +++ b/aggregation_mode/sdk/src/lib.rs @@ -1,3 +1,5 @@ +mod beacon; +pub mod blockchain; +pub mod constants; pub mod gateway; pub mod types; -// TODO: move the rest of the sdk in crates/sdk/aggregation_layer to here diff --git a/aggregation_mode/sdk/src/types.rs b/aggregation_mode/sdk/src/types.rs index 26edb6ab34..05ee115415 100644 --- a/aggregation_mode/sdk/src/types.rs +++ b/aggregation_mode/sdk/src/types.rs @@ -1,5 +1,11 @@ use std::str::FromStr; +use crate::constants::{ + ALIGNED_AGG_MODE_GATEWAY_URL_DEVNET, ALIGNED_AGG_MODE_GATEWAY_URL_HOODI, + ALIGNED_AGG_PAYMENT_SERVICE_ADDRESS_DEVNET, ALIGNED_AGG_PAYMENT_SERVICE_ADDRESS_HOODI, + ALIGNED_PROOF_AGG_SERVICE_ADDRESS_DEVNET, ALIGNED_PROOF_AGG_SERVICE_ADDRESS_HOODI, +}; + #[derive(Debug, Clone)] pub enum Network { Devnet, @@ -32,8 +38,22 @@ impl Network { pub fn gateway_url(&self) -> String { match self { - Self::Devnet => "http://127.0.0.1:8089".to_string(), - Self::Hoodi => "http://hoodi.gateway.alignedlayer.com:8080".to_string(), + Self::Hoodi => ALIGNED_AGG_MODE_GATEWAY_URL_HOODI.to_string(), + Self::Devnet => ALIGNED_AGG_MODE_GATEWAY_URL_DEVNET.to_string(), + } + } + + pub fn proof_aggregator_contract_address(&self) -> String { + match self { + Self::Hoodi => ALIGNED_PROOF_AGG_SERVICE_ADDRESS_HOODI.to_string(), + Self::Devnet => ALIGNED_PROOF_AGG_SERVICE_ADDRESS_DEVNET.to_string(), + } + } + + pub fn aggregation_mode_payment_service_address(&self) -> String { + match self { + Self::Hoodi => ALIGNED_AGG_PAYMENT_SERVICE_ADDRESS_HOODI.to_string(), + Self::Devnet => ALIGNED_AGG_PAYMENT_SERVICE_ADDRESS_DEVNET.to_string(), } } } diff --git a/crates/cli/src/main.rs b/crates/cli/src/main.rs index 9c2ee44216..ce0091c643 100644 --- a/crates/cli/src/main.rs +++ b/crates/cli/src/main.rs @@ -8,8 +8,6 @@ use std::time::Duration; use std::time::SystemTime; use std::time::UNIX_EPOCH; -use aligned_sdk::aggregation_layer; -use aligned_sdk::aggregation_layer::AggregationModeVerificationData; use aligned_sdk::common::types::FeeEstimationType; use aligned_sdk::common::{ errors::{AlignedError, FeeEstimateError, SubmitError}, @@ -106,8 +104,6 @@ pub enum AlignedCommands { name = "get-user-amount-of-queued-proofs" )] GetUserAmountOfQueuedProofs(GetUserAmountOfQueuedProofsArgs), - #[clap(about = "", name = "verify-agg-proof")] - VerifyProofInAggMode(VerifyProofInAggModeArgs), } #[derive(Parser, Debug)] @@ -1097,64 +1093,6 @@ async fn main() -> Result<(), AlignedError> { ); return Ok(()); } - AlignedCommands::VerifyProofInAggMode(args) => { - let program_id_key = read_file(args.program_id_file)? - .try_into() - .expect("Invalid hexadecimal encoded vk hash"); - - let Some(pub_inputs_file_name) = args.pub_input_file_name else { - error!("Public input file not provided"); - return Ok(()); - }; - let public_inputs = read_file(pub_inputs_file_name)?; - - let proof_data = match args.proving_system { - ProvingSystemArg::SP1 => AggregationModeVerificationData::SP1 { - vk: program_id_key, - public_inputs, - }, - ProvingSystemArg::Risc0 => AggregationModeVerificationData::Risc0 { - image_id: program_id_key, - public_inputs, - }, - _ => { - error!("Proving system not supported in aggregation mode"); - return Ok(()); - } - }; - - let proof_status = match aggregation_layer::check_proof_verification( - &proof_data, - args.network.into(), - args.eth_rpc_url, - args.beacon_client_url, - args.from_block, - ) - .await - { - Ok(res) => res, - Err(e) => { - error!("Error while trying to verify proof {:?}", e); - return Ok(()); - } - }; - - match proof_status { - aggregation_layer::ProofStatus::Verified { merkle_root, .. } => { - info!("Your proof has been verified in the aggregated proof with merkle root 0x{}", hex::encode(merkle_root)); - } - aggregation_layer::ProofStatus::Invalid => { - error!( - "Your proof was found in the blob but the Merkle Root verification failed." - ) - } - aggregation_layer::ProofStatus::NotFound => { - error!("Your proof wasn't found in the logs. Try specifying an earlier `from_block` to search further back in history.") - } - } - - return Ok(()); - } } Ok(()) diff --git a/crates/sdk/src/aggregation_layer/helpers.rs b/crates/sdk/src/aggregation_layer/helpers.rs deleted file mode 100644 index 607197a6c4..0000000000 --- a/crates/sdk/src/aggregation_layer/helpers.rs +++ /dev/null @@ -1,147 +0,0 @@ -use crate::{beacon::BeaconClient, common::types::Network}; -use ethers::{ - providers::{Http, Middleware, Provider}, - types::{Filter, Log}, -}; - -use super::ProofVerificationAggModeError; - -/// How much to go back from current block if from_block is not provided -/// 7500 blocks = 25hr -const FROM_BLOCKS_AGO_DEFAULT: u64 = 7500; - -pub async fn fetch_verified_proofs_events( - network: Network, - eth_rpc_url: String, - from_block: Option, -) -> Result, ProofVerificationAggModeError> { - let eth_rpc_provider = Provider::::try_from(eth_rpc_url) - .map_err(|e| ProofVerificationAggModeError::EthereumProviderError(e.to_string()))?; - - let from_block = match from_block { - Some(from_block) => from_block, - None => { - let block_number = eth_rpc_provider - .get_block_number() - .await - .map_err(|e| ProofVerificationAggModeError::EthereumProviderError(e.to_string()))?; - - block_number - .as_u64() - .saturating_sub(FROM_BLOCKS_AGO_DEFAULT) - } - }; - - let filter = Filter::new() - .address(network.get_aligned_proof_agg_service_address()) - .event("AggregatedProofVerified(bytes32,bytes32)") - .from_block(from_block); - - let logs = eth_rpc_provider - .get_logs(&filter) - .await - .map_err(|e| ProofVerificationAggModeError::EthereumProviderError(e.to_string()))?; - - Ok(logs) -} - -pub async fn get_blob_data_from_verified_proof_event( - eth_rpc_url: String, - beacon_client_url: String, - log: Log, -) -> Result<([u8; 32], Vec<[u8; 32]>), ProofVerificationAggModeError> { - let eth_rpc_provider = Provider::::try_from(eth_rpc_url) - .map_err(|e| ProofVerificationAggModeError::EthereumProviderError(e.to_string()))?; - let beacon_client = BeaconClient::new(beacon_client_url); - - // First 32 bytes of the data are the bytes of the blob versioned hash - let blob_versioned_hash: [u8; 32] = log.data[0..32] - .try_into() - .map_err(|_| ProofVerificationAggModeError::EventDecoding)?; - - // Event is indexed by merkle root - let merkle_root = log.topics[1].0; - - // Block Number shouldn't be empty, in case it is, - // there is a problem with this log, and we skip it - // This same logic is replicated for other checks. - let Some(block_number) = log.block_number else { - return Err(ProofVerificationAggModeError::EventDecoding); - }; - - let Some(block) = eth_rpc_provider - .get_block(block_number.as_u64()) - .await - .map_err(|e| ProofVerificationAggModeError::EthereumProviderError(e.to_string()))? - else { - return Err(ProofVerificationAggModeError::EventDecoding); - }; - - let Some(beacon_parent_root) = block.parent_beacon_block_root else { - return Err(ProofVerificationAggModeError::EventDecoding); - }; - - let Some(beacon_block) = beacon_client - .get_block_header_from_parent_hash(beacon_parent_root.0) - .await - .map_err(ProofVerificationAggModeError::BeaconClient)? - else { - return Err(ProofVerificationAggModeError::EventDecoding); - }; - - let slot: u64 = beacon_block - .header - .message - .slot - .parse() - .expect("Slot to be parsable number"); - - let Some(blob_data) = beacon_client - .get_blob_by_versioned_hash(slot, blob_versioned_hash) - .await - .map_err(ProofVerificationAggModeError::BeaconClient)? - else { - return Err(ProofVerificationAggModeError::EventDecoding); - }; - - let blob_bytes = - hex::decode(blob_data.blob.replace("0x", "")).expect("A valid hex encoded data"); - let proof_commitments = decoded_blob(&blob_bytes); - - Ok((merkle_root, proof_commitments)) -} - -fn decoded_blob(blob_data: &[u8]) -> Vec<[u8; 32]> { - let mut proof_hashes = vec![]; - - let mut current_hash = [0u8; 32]; - let mut current_hash_count = 0; - let mut total_bytes_count = 0; - - while total_bytes_count < blob_data.len() { - // Every 32 bytes there is a 0x0 acting as padding, so we need to skip the byte - let is_pad = total_bytes_count % 32 == 0; - if is_pad { - total_bytes_count += 1; - continue; - } - - current_hash[current_hash_count] = blob_data[total_bytes_count]; - - if current_hash_count + 1 == 32 { - // if the current_hash is the zero hash, then there are no more proofs in the blob - if current_hash == [0u8; 32] { - break; - } - proof_hashes.push(current_hash); - current_hash = [0u8; 32]; - current_hash_count = 0; - } else { - current_hash_count += 1; - } - - total_bytes_count += 1; - } - - proof_hashes -} diff --git a/crates/sdk/src/aggregation_layer/mod.rs b/crates/sdk/src/aggregation_layer/mod.rs deleted file mode 100644 index d13d6d5cf6..0000000000 --- a/crates/sdk/src/aggregation_layer/mod.rs +++ /dev/null @@ -1,142 +0,0 @@ -// Modules -mod helpers; -mod types; - -// Makes only the two types on this use public -pub use types::{ - AggregationModeProvingSystem, AggregationModeVerificationData, ProofVerificationAggModeError, -}; - -use crate::{ - common::types::Network, eth::aligned_proof_agg_service::aligned_proof_aggregation_service, -}; -use ethers::{ - providers::{Http, Provider}, - types::Bytes, -}; -use helpers::{fetch_verified_proofs_events, get_blob_data_from_verified_proof_event}; -use lambdaworks_crypto::merkle_tree::merkle::MerkleTree; -use types::Hash32; - -pub enum ProofStatus { - Verified { - merkle_root: [u8; 32], - merkle_path: Vec<[u8; 32]>, - }, - Invalid, - NotFound, -} - -/// Given the [`AggregationModeVerificationData`], this function checks whether the proof was included -/// in a recent aggregated proof and verifies the corresponding Merkle root commitment. -/// -/// ### Notes -/// - This functionality is currently in Beta. As a result, we cannot determine with certainty. -/// which specific aggregation a proof belongs to. Instead, we check the events from the specified `from_block`. -/// - The `from_block` must not be older than 18 days, as blobs expire after that period and will no longer be retrievable. -/// - If not provided, it defaults to fetch logs from [`FROM_BLOCKS_AGO_DEFAULT`] -/// -/// ### The verification process includes: -/// 1. Querying the blob versioned hash from the events emitted by the aligned proof aggregation service contract since `from_block` -/// 2. Retrieving the corresponding beacon block using the block's parent beacon root -/// 3. Fetching the blobs associated with that slot -/// 4. Filtering the blob that matches the queried blob versioned hash -/// 5. Decoding the blob to extract the proofs commitments -/// 6. Checking if the given proof commitment exists within the blob's proofs -/// 7. Reconstructing the Merkle root and verifying it against the root stored in the contract -/// -/// This function is typically used in conjunction with `verifyProofInclusion` for complete on-chain verification. -pub async fn check_proof_verification( - verification_data: &AggregationModeVerificationData, - network: Network, - eth_rpc_url: String, - beacon_client_url: String, - from_block: Option, -) -> Result { - let logs = fetch_verified_proofs_events(network, eth_rpc_url.clone(), from_block).await?; - let proof_commitment = verification_data.commitment(); - - for log in logs { - let (merkle_root, leaves) = get_blob_data_from_verified_proof_event( - eth_rpc_url.clone(), - beacon_client_url.clone(), - log, - ) - .await?; - - let leaves: Vec = leaves.iter().map(|leaf| Hash32(*leaf)).collect(); - - let Some(pos) = leaves.iter().position(|p| p.0 == proof_commitment) else { - continue; - }; - - let Some(merkle_tree) = MerkleTree::::build(&leaves) else { - continue; - }; - - let Some(proof) = merkle_tree.get_proof_by_pos(pos) else { - continue; - }; - - let result = proof.verify::(&merkle_root, pos, &Hash32(proof_commitment)); - if !result { - return Ok(ProofStatus::Invalid); - } - - return Ok(ProofStatus::Verified { - merkle_path: proof.merkle_path, - merkle_root, - }); - } - - Ok(ProofStatus::NotFound) -} - -/// Simulates an on-chain verification of the proof by calling the `verifyProofInclusion` function -/// on the `ProofAggregationService` contract. -/// -/// This function is intended to complement [`check_proof_verification`], which performs off-chain verification. -/// After calling `check_proof_verification` to confirm the proof's inclusion and obtain the Merkle path, -/// this function can be used to simulate the corresponding contract call. -/// -/// ### How it works: -/// 1. Uses the provided Merkle path (as returned by [`check_proof_verification`]). -/// 2. Calls the `verifyProofInclusion` function on the contract with: -/// - The Merkle path, -/// - The proof program id. -/// - The proof public inputs bytes -/// -/// ### Purpose: -/// This is mainly useful for **testing or simulation**, to confirm that the on-chain contract would -/// accept a given proof commitment and Merkle path. It does **not** perform an actual transaction on-chain, -/// but instead simulates the call via `eth_call`. -/// -/// For off-chain verification use cases, prefer using [`check_proof_verification`]. -pub async fn is_proof_verified_on_chain( - verification_data: AggregationModeVerificationData, - merkle_path: Vec<[u8; 32]>, - network: Network, - eth_rpc_url: String, -) -> Result { - let eth_rpc_provider = Provider::::try_from(eth_rpc_url) - .map_err(|e| ProofVerificationAggModeError::EthereumProviderError(e.to_string()))?; - let contract_provider = aligned_proof_aggregation_service( - eth_rpc_provider, - network.get_aligned_proof_agg_service_address(), - ) - .await - .map_err(|e| ProofVerificationAggModeError::EthereumProviderError(e.to_string()))?; - - let res = contract_provider - .is_proof_verified( - merkle_path, - verification_data.proving_system_id(), - verification_data.program_id(), - Bytes::from(verification_data.public_inputs().clone()), - ) - .call() - .await - .map_err(|e| ProofVerificationAggModeError::EthereumProviderError(e.to_string()))?; - - Ok(res) -} diff --git a/crates/sdk/src/common/constants.rs b/crates/sdk/src/common/constants.rs index 03c48f5ae4..0cfe3e84ef 100644 --- a/crates/sdk/src/common/constants.rs +++ b/crates/sdk/src/common/constants.rs @@ -77,20 +77,6 @@ pub const ALIGNED_SERVICE_MANAGER_MAINNET_STAGE: &str = "0x96b6a29D7B98519Ae66E6398BD27A76B30a5dC3f"; pub const ALIGNED_SERVICE_MANAGER_SEPOLIA: &str = "0xFf731AB7b3653dc66878DC77E851D174f472d137"; -// AlignedProofAggregationService -pub const ALIGNED_PROOF_AGG_SERVICE_ADDRESS_MAINNET: &str = "0x0"; -pub const ALIGNED_PROOF_AGG_SERVICE_ADDRESS_MAINNET_STAGE: &str = "0x0"; -pub const ALIGNED_PROOF_AGG_SERVICE_ADDRESS_HOLESKY_STAGE: &str = - "0x7Eace34A8d4C4CacE633946C6F7CF4BeF3F33513"; -pub const ALIGNED_PROOF_AGG_SERVICE_ADDRESS_HOLESKY: &str = - "0xe84CD4084d8131841CE6DC265361f81F4C59a1d4"; -pub const ALIGNED_PROOF_AGG_SERVICE_ADDRESS_HOODI: &str = - "0xEFeD2fd949995BE1a1C7f61AbFC0A33412c37f95"; -pub const ALIGNED_PROOF_AGG_SERVICE_ADDRESS_DEVNET: &str = - "0xcbEAF3BDe82155F56486Fb5a1072cb8baAf547cc"; -pub const ALIGNED_PROOF_AGG_SERVICE_ADDRESS_SEPOLIA: &str = - "0xb5D46304c30B1AeB3a8Da6ab599c336f7946C8A4"; - /// Batcher URL's pub const BATCHER_URL_DEVNET: &str = "ws://localhost:8080"; pub const BATCHER_URL_HOLESKY: &str = "wss://batcher.alignedlayer.com"; diff --git a/crates/sdk/src/common/types.rs b/crates/sdk/src/common/types.rs index 9a868c83ce..47ed34e193 100644 --- a/crates/sdk/src/common/types.rs +++ b/crates/sdk/src/common/types.rs @@ -19,19 +19,15 @@ use serde::{Deserialize, Serialize}; use sha3::{Digest, Keccak256}; use super::constants::{ - ALIGNED_PROOF_AGG_SERVICE_ADDRESS_DEVNET, ALIGNED_PROOF_AGG_SERVICE_ADDRESS_HOLESKY, - ALIGNED_PROOF_AGG_SERVICE_ADDRESS_HOLESKY_STAGE, ALIGNED_PROOF_AGG_SERVICE_ADDRESS_HOODI, - ALIGNED_PROOF_AGG_SERVICE_ADDRESS_MAINNET, ALIGNED_PROOF_AGG_SERVICE_ADDRESS_MAINNET_STAGE, - ALIGNED_PROOF_AGG_SERVICE_ADDRESS_SEPOLIA, ALIGNED_SERVICE_MANAGER_DEVNET, - ALIGNED_SERVICE_MANAGER_HOLESKY, ALIGNED_SERVICE_MANAGER_HOLESKY_STAGE, - ALIGNED_SERVICE_MANAGER_HOODI, ALIGNED_SERVICE_MANAGER_MAINNET, - ALIGNED_SERVICE_MANAGER_MAINNET_STAGE, ALIGNED_SERVICE_MANAGER_SEPOLIA, - BATCHER_PAYMENT_SERVICE_ADDRESS_DEVNET, BATCHER_PAYMENT_SERVICE_ADDRESS_HOLESKY, - BATCHER_PAYMENT_SERVICE_ADDRESS_HOLESKY_STAGE, BATCHER_PAYMENT_SERVICE_ADDRESS_HOODI, - BATCHER_PAYMENT_SERVICE_ADDRESS_MAINNET, BATCHER_PAYMENT_SERVICE_ADDRESS_MAINNET_STAGE, - BATCHER_PAYMENT_SERVICE_ADDRESS_SEPOLIA, BATCHER_URL_DEVNET, BATCHER_URL_HOLESKY, - BATCHER_URL_HOLESKY_STAGE, BATCHER_URL_HOODI, BATCHER_URL_MAINNET, BATCHER_URL_MAINNET_STAGE, - BATCHER_URL_SEPOLIA, + ALIGNED_SERVICE_MANAGER_DEVNET, ALIGNED_SERVICE_MANAGER_HOLESKY, + ALIGNED_SERVICE_MANAGER_HOLESKY_STAGE, ALIGNED_SERVICE_MANAGER_HOODI, + ALIGNED_SERVICE_MANAGER_MAINNET, ALIGNED_SERVICE_MANAGER_MAINNET_STAGE, + ALIGNED_SERVICE_MANAGER_SEPOLIA, BATCHER_PAYMENT_SERVICE_ADDRESS_DEVNET, + BATCHER_PAYMENT_SERVICE_ADDRESS_HOLESKY, BATCHER_PAYMENT_SERVICE_ADDRESS_HOLESKY_STAGE, + BATCHER_PAYMENT_SERVICE_ADDRESS_HOODI, BATCHER_PAYMENT_SERVICE_ADDRESS_MAINNET, + BATCHER_PAYMENT_SERVICE_ADDRESS_MAINNET_STAGE, BATCHER_PAYMENT_SERVICE_ADDRESS_SEPOLIA, + BATCHER_URL_DEVNET, BATCHER_URL_HOLESKY, BATCHER_URL_HOLESKY_STAGE, BATCHER_URL_HOODI, + BATCHER_URL_MAINNET, BATCHER_URL_MAINNET_STAGE, BATCHER_URL_SEPOLIA, }; use super::errors::VerifySignatureError; @@ -539,23 +535,6 @@ impl Network { } } - pub fn get_aligned_proof_agg_service_address(&self) -> ethers::types::H160 { - match self { - Self::Devnet => H160::from_str(ALIGNED_PROOF_AGG_SERVICE_ADDRESS_DEVNET).unwrap(), - Self::Holesky => H160::from_str(ALIGNED_PROOF_AGG_SERVICE_ADDRESS_HOLESKY).unwrap(), - Self::HoleskyStage => { - H160::from_str(ALIGNED_PROOF_AGG_SERVICE_ADDRESS_HOLESKY_STAGE).unwrap() - } - Self::Hoodi => H160::from_str(ALIGNED_PROOF_AGG_SERVICE_ADDRESS_HOODI).unwrap(), - Self::Mainnet => H160::from_str(ALIGNED_PROOF_AGG_SERVICE_ADDRESS_MAINNET).unwrap(), - Self::MainnetStage => { - H160::from_str(ALIGNED_PROOF_AGG_SERVICE_ADDRESS_MAINNET_STAGE).unwrap() - } - Self::Sepolia => H160::from_str(ALIGNED_PROOF_AGG_SERVICE_ADDRESS_SEPOLIA).unwrap(), - Self::Custom(_, s, _) => H160::from_str(s.as_str()).unwrap(), - } - } - pub fn get_batcher_url(&self) -> &str { match self { Self::Devnet => BATCHER_URL_DEVNET, diff --git a/crates/sdk/src/lib.rs b/crates/sdk/src/lib.rs index edb1ed7e4a..849b915997 100644 --- a/crates/sdk/src/lib.rs +++ b/crates/sdk/src/lib.rs @@ -1,4 +1,3 @@ -pub mod aggregation_layer; pub mod verification_layer; /// Common types used across the Aggregation Layer and the Verification Layer AVS @@ -10,5 +9,3 @@ pub mod common; pub mod communication; /// Eth module is mostly for internal use pub mod eth; - -pub(crate) mod beacon;