From 1a540c77f031e3fe23d9a5b0d1dc7c67291eca42 Mon Sep 17 00:00:00 2001 From: Pia Date: Tue, 3 Sep 2024 12:37:28 +0900 Subject: [PATCH 01/29] chore: ci to just file --- .github/workflows/ci.yml | 5 ++--- Makefile.toml | 29 ----------------------------- justfile | 22 ++++++++++++++++++++++ 3 files changed, 24 insertions(+), 32 deletions(-) delete mode 100644 Makefile.toml create mode 100644 justfile diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d247b59d..7575e505 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,7 +28,6 @@ jobs: run: | rustup component add clippy rustup component add rustfmt - - name: Install cargo-make - run: cargo install --debug cargo-make + - uses: taiki-e/install-action@just - name: Run clippy and formatter checks - run: cargo make run-ci-flow + run: just run-ci-flow diff --git a/Makefile.toml b/Makefile.toml deleted file mode 100644 index 408c717c..00000000 --- a/Makefile.toml +++ /dev/null @@ -1,29 +0,0 @@ -[env] -CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = true - -[tasks.format] -install_crate = "rustfmt" -command = "cargo" -args = ["fmt", "--", "--check"] -description = "Run rustfmt to check the code formatting without making changes." - -[tasks.clean] -command = "cargo" -args = ["clean"] -description = "Clean up the project by removing the target directory." - -[tasks.clippy] -command = "cargo" -args = ["clippy", "--all-targets", "--all-features", "--", "-Dwarnings"] -description = "Run clippy to catch common mistakes and improve your Rust code." - -[tasks.test] -workspace = false -command = "cargo" -args = ["llvm-cov", "nextest", "--features", "test_utils"] -description = "Execute all unit tests in the workspace." - -[tasks.run-ci-flow] -workspace = false -description = "Run the entire CI pipeline including format, clippy, and test checks." -dependencies = ["format", "clippy", "test"] diff --git a/justfile b/justfile new file mode 100644 index 00000000..b698c87f --- /dev/null +++ b/justfile @@ -0,0 +1,22 @@ +# Set environment variable +export CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE := "true" + +# Run rustfmt to check the code formatting without making changes +format: + cargo fmt -- --check + +# Clean up the project by removing the target directory +clean: + cargo clean + +# Run clippy to catch common mistakes and improve your Rust code +clippy: + cargo clippy --all-targets --all-features -- -Dwarnings + +# Execute all unit tests in the workspace +test: + cargo llvm-cov nextest --features test_utils + +# Run the entire CI pipeline including format, clippy, and test checks +run-ci-flow: format clippy test + @echo "CI flow completed" From f20276130c0afcc1c1f3e61b534627bf9690aa5e Mon Sep 17 00:00:00 2001 From: Pia Date: Tue, 3 Sep 2024 14:26:25 +0900 Subject: [PATCH 02/29] wip --- Cargo.lock | 343 +++++++++++++++++++++++++- Cargo.toml | 3 +- hdp/Cargo.toml | 2 + hdp/src/provider/error.rs | 16 +- hdp/src/provider/evm/rpc.rs | 14 +- hdp/src/provider/starknet/mod.rs | 4 +- hdp/src/provider/starknet/provider.rs | 28 +++ hdp/src/provider/starknet/rpc.rs | 155 ++++++++++++ hdp/src/provider/starknet/types.rs | 73 ++++++ 9 files changed, 616 insertions(+), 22 deletions(-) create mode 100644 hdp/src/provider/starknet/provider.rs create mode 100644 hdp/src/provider/starknet/rpc.rs create mode 100644 hdp/src/provider/starknet/types.rs diff --git a/Cargo.lock b/Cargo.lock index 30a118f9..5210da32 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -854,6 +854,12 @@ dependencies = [ "rustc_version 0.4.0", ] +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + [[package]] name = "atty" version = "0.2.14" @@ -1212,6 +1218,12 @@ version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d32a725bc159af97c3e629873bb9f88fb8cf8a4867175f76dc987815ea07c83b" +[[package]] +name = "cesu8" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" + [[package]] name = "cfg-if" version = "1.0.0" @@ -1335,6 +1347,16 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" +[[package]] +name = "combine" +version = "4.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" +dependencies = [ + "bytes", + "memchr", +] + [[package]] name = "const-fnv1a-hash" version = "1.1.0" @@ -2016,6 +2038,16 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" +[[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.30" @@ -2094,6 +2126,52 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" +[[package]] +name = "gloo-net" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06f627b1a58ca3d42b45d6104bf1e1a03799df472df00988b6ba21accc10580" +dependencies = [ + "futures-channel", + "futures-core", + "futures-sink", + "gloo-utils", + "http 1.1.0", + "js-sys", + "pin-project", + "serde", + "serde_json", + "thiserror", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[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 = "gloo-utils" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b5555354113b18c547c1d3a98fbf7fb32a9ff4f6fa112ce823a21641a0ba3aa" +dependencies = [ + "js-sys", + "serde", + "serde_json", + "wasm-bindgen", + "web-sys", +] + [[package]] name = "good_lp" version = "1.8.1" @@ -2134,6 +2212,25 @@ dependencies = [ "tracing", ] +[[package]] +name = "h2" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" +dependencies = [ + "atomic-waker", + "bytes", + "fnv", + "futures-core", + "futures-sink", + "http 1.1.0", + "indexmap 2.2.6", + "slab", + "tokio", + "tokio-util", + "tracing", +] + [[package]] name = "half" version = "2.4.1" @@ -2174,6 +2271,7 @@ dependencies = [ "eth-trie-proofs", "futures", "itertools 0.10.5", + "jsonrpsee", "lazy_static", "regex", "reqwest 0.11.27", @@ -2182,6 +2280,7 @@ dependencies = [ "serde_with 2.3.3", "starknet", "starknet-crypto", + "starknet-types-core", "tempfile", "thiserror", "tokio", @@ -2338,7 +2437,7 @@ dependencies = [ "futures-channel", "futures-core", "futures-util", - "h2", + "h2 0.3.26", "http 0.2.12", "http-body 0.4.6", "httparse", @@ -2361,6 +2460,7 @@ dependencies = [ "bytes", "futures-channel", "futures-util", + "h2 0.4.6", "http 1.1.0", "http-body 1.0.0", "httparse", @@ -2385,6 +2485,24 @@ dependencies = [ "tokio-rustls 0.24.1", ] +[[package]] +name = "hyper-rustls" +version = "0.27.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" +dependencies = [ + "futures-util", + "http 1.1.0", + "hyper 1.3.1", + "hyper-util", + "log", + "rustls 0.23.10", + "rustls-pki-types", + "tokio", + "tokio-rustls 0.26.0", + "tower-service", +] + [[package]] name = "hyper-tls" version = "0.5.0" @@ -2637,6 +2755,26 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +[[package]] +name = "jni" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6df18c2e3db7e453d3c6ac5b3e9d5182664d28788126d39b91f2d1e22b017ec" +dependencies = [ + "cesu8", + "combine", + "jni-sys", + "log", + "thiserror", + "walkdir", +] + +[[package]] +name = "jni-sys" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" + [[package]] name = "js-sys" version = "0.3.69" @@ -2646,6 +2784,131 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "jsonrpsee" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ec465b607a36dc5dd45d48b7689bc83f679f66a3ac6b6b21cc787a11e0f8685" +dependencies = [ + "jsonrpsee-client-transport", + "jsonrpsee-core", + "jsonrpsee-http-client", + "jsonrpsee-types", + "jsonrpsee-wasm-client", + "jsonrpsee-ws-client", +] + +[[package]] +name = "jsonrpsee-client-transport" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90f0977f9c15694371b8024c35ab58ca043dbbf4b51ccb03db8858a021241df1" +dependencies = [ + "base64 0.22.0", + "futures-channel", + "futures-util", + "gloo-net", + "http 1.1.0", + "jsonrpsee-core", + "pin-project", + "rustls 0.23.10", + "rustls-pki-types", + "rustls-platform-verifier", + "soketto", + "thiserror", + "tokio", + "tokio-rustls 0.26.0", + "tokio-util", + "tracing", + "url", +] + +[[package]] +name = "jsonrpsee-core" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e942c55635fbf5dc421938b8558a8141c7e773720640f4f1dbe1f4164ca4e221" +dependencies = [ + "async-trait", + "bytes", + "futures-timer", + "futures-util", + "http 1.1.0", + "http-body 1.0.0", + "http-body-util", + "jsonrpsee-types", + "pin-project", + "rustc-hash 2.0.0", + "serde", + "serde_json", + "thiserror", + "tokio", + "tokio-stream", + "tracing", + "wasm-bindgen-futures", +] + +[[package]] +name = "jsonrpsee-http-client" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e33774602df12b68a2310b38a535733c477ca4a498751739f89fe8dbbb62ec4c" +dependencies = [ + "async-trait", + "base64 0.22.0", + "http-body 1.0.0", + "hyper 1.3.1", + "hyper-rustls 0.27.2", + "hyper-util", + "jsonrpsee-core", + "jsonrpsee-types", + "rustls 0.23.10", + "rustls-platform-verifier", + "serde", + "serde_json", + "thiserror", + "tokio", + "tower", + "tracing", + "url", +] + +[[package]] +name = "jsonrpsee-types" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b67d6e008164f027afbc2e7bb79662650158d26df200040282d2aa1cbb093b" +dependencies = [ + "http 1.1.0", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "jsonrpsee-wasm-client" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0470d0ae043ffcb0cd323797a631e637fb4b55fe3eaa6002934819458bba62a7" +dependencies = [ + "jsonrpsee-client-transport", + "jsonrpsee-core", + "jsonrpsee-types", +] + +[[package]] +name = "jsonrpsee-ws-client" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "992bf67d1132f88edf4a4f8cff474cf01abb2be203004a2b8e11c2b20795b99e" +dependencies = [ + "http 1.1.0", + "jsonrpsee-client-transport", + "jsonrpsee-core", + "jsonrpsee-types", + "url", +] + [[package]] name = "jsonwebtoken" version = "9.3.0" @@ -3599,11 +3862,11 @@ dependencies = [ "encoding_rs", "futures-core", "futures-util", - "h2", + "h2 0.3.26", "http 0.2.12", "http-body 0.4.6", "hyper 0.14.28", - "hyper-rustls", + "hyper-rustls 0.24.2", "hyper-tls 0.5.0", "ipnet", "js-sys", @@ -3748,6 +4011,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +[[package]] +name = "rustc-hash" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" + [[package]] name = "rustc-hex" version = "2.1.0" @@ -3803,6 +4072,7 @@ version = "0.23.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05cff451f60db80f490f3c182b77c35260baace73209e9cdbbe526bfe3a4d402" dependencies = [ + "log", "once_cell", "ring", "rustls-pki-types", @@ -3811,6 +4081,19 @@ dependencies = [ "zeroize", ] +[[package]] +name = "rustls-native-certs" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04182dffc9091a404e0fc069ea5cd60e5b866c3adf881eff99a32d048242dffa" +dependencies = [ + "openssl-probe", + "rustls-pemfile 2.1.2", + "rustls-pki-types", + "schannel", + "security-framework", +] + [[package]] name = "rustls-pemfile" version = "1.0.4" @@ -3836,6 +4119,33 @@ version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" +[[package]] +name = "rustls-platform-verifier" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93bda3f493b9abe5b93b3e7e3ecde0df292f2bd28c0296b90586ee0055ff5123" +dependencies = [ + "core-foundation", + "core-foundation-sys", + "jni", + "log", + "once_cell", + "rustls 0.23.10", + "rustls-native-certs", + "rustls-platform-verifier-android", + "rustls-webpki 0.102.4", + "security-framework", + "security-framework-sys", + "webpki-roots 0.26.3", + "winapi", +] + +[[package]] +name = "rustls-platform-verifier-android" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f87165f0995f63a9fbeea62b64d10b4d9d8e78ec6d7d51fb2125fda7bb36788f" + [[package]] name = "rustls-webpki" version = "0.101.7" @@ -3893,7 +4203,7 @@ dependencies = [ "log", "oorandom", "parking_lot 0.11.2", - "rustc-hash", + "rustc-hash 1.1.0", "salsa-macros", "smallvec", ] @@ -4014,6 +4324,7 @@ dependencies = [ "core-foundation", "core-foundation-sys", "libc", + "num-bigint", "security-framework-sys", ] @@ -4051,6 +4362,12 @@ 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" @@ -4323,6 +4640,21 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "soketto" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37468c595637c10857701c990f93a40ce0e357cedb0953d1c26c8d8027f9bb53" +dependencies = [ + "base64 0.22.0", + "bytes", + "futures", + "httparse", + "log", + "rand", + "sha1", +] + [[package]] name = "spin" version = "0.9.8" @@ -4891,6 +5223,7 @@ checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" dependencies = [ "bytes", "futures-core", + "futures-io", "futures-sink", "pin-project-lite", "tokio", @@ -5516,7 +5849,7 @@ dependencies = [ "log", "pharos", "rustc_version 0.4.0", - "send_wrapper", + "send_wrapper 0.6.0", "thiserror", "wasm-bindgen", "wasm-bindgen-futures", diff --git a/Cargo.toml b/Cargo.toml index 05890d1e..1bf76b87 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,8 +1,8 @@ [workspace] -resolver = "2" members = ["cli", "examples/private-input-module", "hdp"] [workspace.package] +resolver = "2" version = "0.4.0" edition = "2021" license-file = "LICENSE" @@ -37,6 +37,7 @@ rand = "0.8.4" regex = "1" starknet = "0.10.0" starknet-crypto = "0.6.1" +starknet-types-core = "0.1.0" cairo-lang-starknet-classes = "2.7.0" cairo-vm = "1.0.0-rc6" futures = "0.3.30" diff --git a/hdp/Cargo.toml b/hdp/Cargo.toml index 6ff37feb..e9ef6a42 100644 --- a/hdp/Cargo.toml +++ b/hdp/Cargo.toml @@ -24,6 +24,7 @@ serde = { workspace = true } serde_with = { workspace = true } serde_json = { workspace = true } starknet-crypto = { workspace = true } +starknet-types-core = { workspace = true } starknet = { workspace = true } thiserror.workspace = true alloy-merkle-tree = { workspace = true } @@ -33,6 +34,7 @@ reqwest = { workspace = true } lazy_static = { workspace = true } eth-trie-proofs = { workspace = true } itertools = { workspace = true } +jsonrpsee = { version = "0.24.3", features = ["http-client", "client"] } [features] default = [] diff --git a/hdp/src/provider/error.rs b/hdp/src/provider/error.rs index c82699fb..f55377b3 100644 --- a/hdp/src/provider/error.rs +++ b/hdp/src/provider/error.rs @@ -1,9 +1,8 @@ +use alloy::primitives::BlockNumber; use thiserror::Error; use crate::provider::indexer::IndexerError; -use super::evm::rpc::RpcProviderError; - /// Error type for provider #[derive(Error, Debug)] pub enum ProviderError { @@ -34,3 +33,16 @@ pub enum ProviderError { #[error("Fetch key error: {0}")] FetchKeyError(String), } + +/// Error from [`RpcProvider`] +#[derive(Error, Debug)] +pub enum RpcProviderError { + #[error("Failed to send proofs with mpsc")] + MpscError( + #[from] + tokio::sync::mpsc::error::SendError<( + BlockNumber, + alloy::rpc::types::EIP1186AccountProofResponse, + )>, + ), +} diff --git a/hdp/src/provider/evm/rpc.rs b/hdp/src/provider/evm/rpc.rs index 24d33e7e..e315b00f 100644 --- a/hdp/src/provider/evm/rpc.rs +++ b/hdp/src/provider/evm/rpc.rs @@ -15,25 +15,13 @@ use alloy::{ }; use futures::future::join_all; use reqwest::Url; -use thiserror::Error; use tokio::sync::{ mpsc::{self, Sender}, RwLock, }; use tracing::debug; -/// Error from [`RpcProvider`] -#[derive(Error, Debug)] -pub enum RpcProviderError { - #[error("Failed to send proofs with mpsc")] - MpscError( - #[from] - tokio::sync::mpsc::error::SendError<( - BlockNumber, - alloy::rpc::types::EIP1186AccountProofResponse, - )>, - ), -} +use crate::provider::error::RpcProviderError; /// RPC provider for fetching data from Ethereum RPC /// It is a wrapper around the alloy provider, using eth_getProof for fetching account and storage proofs diff --git a/hdp/src/provider/starknet/mod.rs b/hdp/src/provider/starknet/mod.rs index a8c241cb..93a521a5 100644 --- a/hdp/src/provider/starknet/mod.rs +++ b/hdp/src/provider/starknet/mod.rs @@ -1 +1,3 @@ -pub struct StarknetProvider {} +pub mod provider; +pub mod rpc; +pub mod types; diff --git a/hdp/src/provider/starknet/provider.rs b/hdp/src/provider/starknet/provider.rs new file mode 100644 index 00000000..d322fa9f --- /dev/null +++ b/hdp/src/provider/starknet/provider.rs @@ -0,0 +1,28 @@ +use crate::provider::{config::ProviderConfig, indexer::Indexer}; + +use super::rpc::RpcProvider; + +pub struct StarknetProvider { + /// Account and storage trie provider + pub(crate) rpc_provider: RpcProvider, + /// Header provider + pub(crate) header_provider: Indexer, +} + +#[cfg(feature = "test_utils")] +impl Default for StarknetProvider { + fn default() -> Self { + Self::new(&ProviderConfig::default()) + } +} + +impl StarknetProvider { + pub fn new(config: &ProviderConfig) -> Self { + let rpc_provider = RpcProvider::new(config.rpc_url.to_owned(), config.max_requests); + let indexer = Indexer::new(config.chain_id); + Self { + rpc_provider, + header_provider: indexer, + } + } +} diff --git a/hdp/src/provider/starknet/rpc.rs b/hdp/src/provider/starknet/rpc.rs new file mode 100644 index 00000000..2184b4d9 --- /dev/null +++ b/hdp/src/provider/starknet/rpc.rs @@ -0,0 +1,155 @@ +use std::{ + collections::{HashMap, HashSet}, + sync::Arc, + time::Instant, +}; + +use alloy::primitives::BlockNumber; + +use futures::future::join_all; +use jsonrpsee::{ + core::{client::ClientT, BoxError, ClientError}, + http_client::{HttpClient, HttpClientBuilder}, + rpc_params, +}; +use reqwest::{Client, Url}; +use starknet_types_core::felt::Felt; +use tokio::sync::{ + mpsc::{self, Sender}, + RwLock, +}; +use tracing::debug; + +use crate::provider::error::RpcProviderError; + +use super::types::GetProofOutput; + +/// !Note: have to use pathfinder node as we need `pathfinder_getProof` +pub struct RpcProvider { + client: HttpClient, + chunk_size: u64, +} + +impl RpcProvider { + pub fn new(rpc_url: Url, chunk_size: u64) -> Self { + let client = HttpClientBuilder::default().build(rpc_url).unwrap(); + Self { client, chunk_size } + } + + pub async fn get_account_proofs(&self, blocks: Vec, address: Felt) {} + + async fn get_proofs( + &self, + blocks: Vec, + address: Felt, + storage_key: Option, + ) -> Result, RpcProviderError> { + let start_fetch = Instant::now(); + let (rpc_sender, mut rx) = mpsc::channel::<(BlockNumber, GetProofOutput)>(32); + self.spawn_proof_fetcher(rpc_sender, blocks, address, storage_key); + + let mut fetched_proofs = HashMap::new(); + while let Some((block_number, proof)) = rx.recv().await { + fetched_proofs.insert(block_number, proof); + } + let duration = start_fetch.elapsed(); + debug!("time taken (Fetch): {:?}", duration); + + Ok(fetched_proofs) + } + + fn spawn_proof_fetcher( + &self, + rpc_sender: Sender<(BlockNumber, GetProofOutput)>, + blocks: Vec, + address: Felt, + storage_key: Option, + ) { + let chunk_size = self.chunk_size; + let provider_clone = self.client.clone(); + let target_blocks_length = blocks.len(); + + debug!( + "fetching proofs for {}, with chunk size: {}", + address, chunk_size + ); + + tokio::spawn(async move { + let mut try_count = 0; + let blocks_map = Arc::new(RwLock::new(HashSet::::new())); + + while blocks_map.read().await.len() < target_blocks_length { + try_count += 1; + if try_count > 50 { + panic!("❗️❗️❗️ Too many retries, failed to fetch all blocks") + } + let fetched_blocks_clone = blocks_map.read().await.clone(); + + let blocks_to_fetch: Vec = blocks + .iter() + .filter(|block_number| !fetched_blocks_clone.contains(block_number)) + .take(chunk_size as usize) + .cloned() + .collect(); + + let fetch_futures = blocks_to_fetch + .into_iter() + .map(|block_number| { + let fetched_blocks_clone = blocks_map.clone(); + let rpc_sender = rpc_sender.clone(); + let provider_clone = provider_clone.clone(); + async move { + let proof = pathfinder_get_proof( + &provider_clone, + address, + block_number, + storage_key, + ) + .await; + handle_proof_result( + proof, + block_number, + fetched_blocks_clone, + rpc_sender, + ) + .await; + } + }) + .collect::>(); + + join_all(fetch_futures).await; + } + }); + } +} + +/// Fetches proof (account or storage) for a given block number +async fn pathfinder_get_proof( + provider: &HttpClient, + address: Felt, + block_number: BlockNumber, + storage_key: Option, +) -> Result { + match storage_key { + Some(key) => { + let params = rpc_params!["param1", "param2"]; + let response: String = provider.request("method_name", params).await?; + let get_proof_output: GetProofOutput = serde_json::from_str(&response)?; + Ok(get_proof_output) + } + None => { + let params = rpc_params!["param1", "param2"]; + let response: String = provider.request("method_name", params).await?; + let get_proof_output: GetProofOutput = serde_json::from_str(&response)?; + Ok(get_proof_output) + } + } +} + +async fn handle_proof_result( + proof: Result, + block_number: BlockNumber, + blocks_map: Arc>>, + rpc_sender: Sender<(BlockNumber, GetProofOutput)>, +) { +} diff --git a/hdp/src/provider/starknet/types.rs b/hdp/src/provider/starknet/types.rs new file mode 100644 index 00000000..709c6901 --- /dev/null +++ b/hdp/src/provider/starknet/types.rs @@ -0,0 +1,73 @@ +use serde::{Deserialize, Serialize}; +use serde_with::skip_serializing_none; +use starknet_types_core::{felt::Felt, hash::StarkHash}; + +/// Codebase is from https://github.com/eqlabs/pathfinder/tree/ae81d84b7c4157891069bd02ef810a29b60a94e3 + +/// Holds the membership/non-membership of a contract and its associated +/// contract contract if the contract exists. +#[derive(Debug, Serialize, Deserialize)] +#[skip_serializing_none] +pub struct GetProofOutput { + /// The global state commitment for Starknet 0.11.0 blocks onwards, if + /// absent the hash of the first node in the + /// [contract_proof](GetProofOutput#contract_proof) is the global state + /// commitment. + state_commitment: Option, + /// Required to verify that the hash of the class commitment and the root of + /// the [contract_proof](GetProofOutput::contract_proof) matches the + /// [state_commitment](Self#state_commitment). Present only for Starknet + /// blocks 0.11.0 onwards. + class_commitment: Option, + + /// Membership / Non-membership proof for the queried contract + contract_proof: Vec, + + /// Additional contract data if it exists. + contract_data: Option, +} + +/// A node in a Starknet patricia-merkle trie. +/// +/// See pathfinders merkle-tree crate for more information. +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub enum TrieNode { + Binary { left: Felt, right: Felt }, + Edge { child: Felt, path: [u8; 32] }, +} + +impl TrieNode { + pub fn hash(&self) -> Felt { + match self { + TrieNode::Binary { left, right } => H::hash(left, right), + TrieNode::Edge { child, path } => { + let mut length = [0; 32]; + // Safe as len() is guaranteed to be <= 251 + length[31] = path.len() as u8; + let path = Felt::from_bytes_be_slice(path); + + let length = Felt::from_bytes_be(&length); + H::hash(child, &path) + length + } + } + } +} + +/// Holds the data and proofs for a specific contract. +#[derive(Debug, Serialize, Deserialize)] +pub struct ContractData { + /// Required to verify the contract state hash to contract root calculation. + class_hash: Felt, + /// Required to verify the contract state hash to contract root calculation. + nonce: Felt, + + /// Root of the Contract state tree + root: Felt, + + /// This is currently just a constant = 0, however it might change in the + /// future. + contract_state_hash_version: Felt, + + /// The proofs associated with the queried storage values + storage_proofs: Vec>, +} From e21940be624f52fa6f7d13e320b8991a664d3621 Mon Sep 17 00:00:00 2001 From: Pia Date: Tue, 3 Sep 2024 15:10:58 +0900 Subject: [PATCH 03/29] wip --- hdp/src/provider/starknet/rpc.rs | 92 ++++++++++++++++++++++++++------ pathfinder.request.json | 14 +++++ 2 files changed, 90 insertions(+), 16 deletions(-) create mode 100644 pathfinder.request.json diff --git a/hdp/src/provider/starknet/rpc.rs b/hdp/src/provider/starknet/rpc.rs index 2184b4d9..e81b60aa 100644 --- a/hdp/src/provider/starknet/rpc.rs +++ b/hdp/src/provider/starknet/rpc.rs @@ -8,17 +8,18 @@ use alloy::primitives::BlockNumber; use futures::future::join_all; use jsonrpsee::{ - core::{client::ClientT, BoxError, ClientError}, + core::{client::ClientT, BoxError}, http_client::{HttpClient, HttpClientBuilder}, rpc_params, }; -use reqwest::{Client, Url}; +use reqwest::Url; +use serde_json::json; use starknet_types_core::felt::Felt; use tokio::sync::{ mpsc::{self, Sender}, RwLock, }; -use tracing::debug; +use tracing::{debug, error}; use crate::provider::error::RpcProviderError; @@ -130,20 +131,35 @@ async fn pathfinder_get_proof( block_number: BlockNumber, storage_key: Option, ) -> Result { - match storage_key { - Some(key) => { - let params = rpc_params!["param1", "param2"]; - let response: String = provider.request("method_name", params).await?; - let get_proof_output: GetProofOutput = serde_json::from_str(&response)?; - Ok(get_proof_output) - } - None => { - let params = rpc_params!["param1", "param2"]; - let response: String = provider.request("method_name", params).await?; - let get_proof_output: GetProofOutput = serde_json::from_str(&response)?; - Ok(get_proof_output) - } + let mut keys = Vec::new(); + if let Some(key) = storage_key { + keys.push(format!("{}", key.to_hex_string())); } + + let request = json!({ + "jsonrpc": "2.0", + "method": "pathfinder_getProof", + "params": { + "block_id": "latest", + "contract_address": format!("{}", address.to_hex_string()), + "keys": keys + }, + "id": 0 + }); + + println!("req:{}", request); + + let response: serde_json::Value = provider + .request( + "pathfinder_getProof", + rpc_params![request["params"].clone()], + ) + .await?; + + println!("res:{}", response); + + let get_proof_output: GetProofOutput = serde_json::from_value(response["result"].clone())?; + Ok(get_proof_output) } async fn handle_proof_result( @@ -152,4 +168,48 @@ async fn handle_proof_result( blocks_map: Arc>>, rpc_sender: Sender<(BlockNumber, GetProofOutput)>, ) { + match proof { + Ok(proof) => { + blocks_map.write().await.insert(block_number); + rpc_sender.send((block_number, proof)).await.unwrap(); + } + Err(e) => { + error!("❗️❗️❗️ Error fetching proof: {:?}", e); + } + } +} +#[cfg(test)] +mod tests { + use core::str::FromStr; + + use super::*; + use reqwest::Url; + + + + fn test_provider() -> RpcProvider { + RpcProvider::new(Url::from_str(PATHFINDER_URL).unwrap(), 100) + } + + #[tokio::test] + async fn test_get_proof() { + let provider = test_provider(); + let proof = provider + .get_proofs( + [156600].to_vec(), + Felt::from_str( + "0x23371b227eaecd8e8920cd429d2cd0f3fee6abaacca08d3ab82a7cdd", + ) + .unwrap(), + Some( + Felt::from_str( + "0x1", + ) + .unwrap(), + ), + ) + .await; + + println!("{:?}", proof); + } } diff --git a/pathfinder.request.json b/pathfinder.request.json new file mode 100644 index 00000000..cdfb351c --- /dev/null +++ b/pathfinder.request.json @@ -0,0 +1,14 @@ +❯ curl -s -X POST \ + -H 'Content-Type: application/json' \ + -d '{ + "jsonrpc": "2.0", + "method": "pathfinder_getProof", + "params": { + "block_id": "latest", + "contract_address": "0x23371b227eaecd8e8920cd429d2cd0f3fee6abaacca08d3ab82a7cdd", + "keys": ["0x1"] + }, + "id": 0 + }' \ + https://pathfinder.sepolia.iosis.tech +{"jsonrpc":"2.0","result":{"class_commitment":"0x46c1a0374b8ccf8d928e62ef40974304732c8a28f10b2c494adfabfcff0fa0a","contract_data":null,"contract_proof":[{"binary":{"left":"0x1fce6ebc4ed28309974e4d5ecf9e51420ba5585d90110c130b8600ede80c5c0","right":"0x75fb62a61d1ffc4ef82df685c74a7292b34bd30fa7c68ff7b5f4774662ad61c"}},{"binary":{"left":"0x234737de2705b5c4b6511397cfbfd4a7be5e1039bb3750cbdcdda3233bb75df","right":"0x4593f0345afeff3ab53e34ef598ad41ac0c77823dbd1ef6f84af312ffb31996"}},{"binary":{"left":"0x271ff2593020872e524af8daa846983b7b043339fcef335890f6c7df7a9d889","right":"0x66cff3b63768084f84013ff15047adcaee3129e5b25d7373907e3ec33d3142f"}},{"binary":{"left":"0x7fe8dc7a63c3242e0dcca7c30083bdef80281cf4dcdc560271914921468a22b","right":"0x6a4c4de2a4248369f763d7051039c9166a052c87d02265c413cc2e985d13a7b"}},{"binary":{"left":"0x42cb837e41783f18d4b755c5ab9805cf978ab2968ed90f3a5ef7d2cca875782","right":"0x1940dc58b742c2ef3380f00705042bc8cede62574889bddf7794e00a3237d3"}},{"binary":{"left":"0x3b4567923933c70ea41388c0b7a417abe33b2be6c63502aa0498df43641067d","right":"0x1bfed7273176888d48091ca5cf9b86c18e0b46c19c4480e6085ed21fba2baa"}},{"binary":{"left":"0x6a7544e21d79895fef3ee3fca0a1e054e39d667d1b81db9178b7a365c246fa8","right":"0x7464f2a0dcfc72f24b3ab83aa27df75ff49c8a1a2cb6d6013dea24115e5a1a4"}},{"binary":{"left":"0x2b38c99a85f2a7d24cbc11776e7c60063e771d2a40ff779d7da788b515a10cc","right":"0x3c1de78e157fe6c9b9a17bc13c03aa6b96079c544ada06e4121295bcfb4df40"}},{"binary":{"left":"0x7b9b97aab2974de84a5c5a8c3a6dc5be6eea17e01edd78108d93ecb0b84384c","right":"0x343d11c95e7fe731f5b18581bd0d7880a52d5354e786fedb27e2755ed98ba4"}},{"binary":{"left":"0x520b92021697702ebcf7224412f6b836f3bbdef2a70d64f9c623ece3722959f","right":"0x76b5410380a8ef83218486d4e2889f987966f6149e917746b2f054eec154e23"}},{"binary":{"left":"0x272f761c0bb1b1d70a785b56c894dccd5a8cb54c57ca61a1fde1a35592c028e","right":"0x73b6378d6db93716a1e4998412332b56bda8fc422bf5e6090beb9640fe9c087"}},{"binary":{"left":"0x79781ee9e623c7191682931049148cf58187ca270aa5597cd54cad6a8b2e724","right":"0x3aae622e14c7e7932ca1739995b02333e17839009ce838fdee422e85bfdce1c"}},{"binary":{"left":"0x26bd7f3203f07c81053e59d589f77a4c543e7204190466c4070befd50e42fd1","right":"0x3e5e3061d0165c807ef5b01bb1fb52640b563e01e0d95a2147332cd531236d0"}},{"binary":{"left":"0x35bff569ae6378256a0f8edc16e11465b80c6df65d43f63db2de397255a37b","right":"0x7dee4b21e69cb6d8a0c8b9a02dbe3a7051db9e3227c8e5a4fe3a982d73e15b1"}},{"binary":{"left":"0x19095f7dfd2ad48be7993ae0ddf6cdf7edbe3f452c732ce1aacb6427508641d","right":"0x77f9c3d354e07acb48309d1e8480412878bce30b375255019a091ed16b204c1"}},{"binary":{"left":"0x18f2fd53fcef537df9e9198ffe6f1070c39944cd8ecb101d6f6fc18b4ad96a7","right":"0x544f935e562e1d83d5e0c9b58ab9b4e0697ce2f2bb198dd5392b04c5920bfdb"}},{"binary":{"left":"0x3d0cb13372330e94a75f435c1317747b03b5f9764ce19576f505ce251a9b8b2","right":"0x2e25083e3f2ffec2ee585973ffbf1a582592212ad43242234c13ff602385270"}},{"binary":{"left":"0xacbb7ead42ba37145b629bd63bb9d7f7b11715c8d2c4ac98d60c8b35372206","right":"0x581421ecef4b2058e07350602f60fd90ab9eb3422a5726849a1422d1a725b0a"}},{"binary":{"left":"0x25bc11ec36c9db342daa61f89176ae920ff7dde4ab1aa7786d307005a8b5f0c","right":"0x142db9370528b7ff388cc7a64437c2054aecea95cac1e8bed856b78104d0ab6"}},{"binary":{"left":"0x874891a64e16fe2a0ef32af13755e477c7d4d503f074426980d3a60448c245","right":"0x61835e9c88fe6010fe08337cd71ab13f2b189395a93bbfd4db66c060a58c835"}},{"binary":{"left":"0x4c8259021fbb82e40baaa003d3fe9cf6c109b2a49600b93aba5a22860de1d5d","right":"0x383b888ba52b75d69f4dd2bc3cb28fbac033a01e68c4b8f2862183aecbe4fd7"}},{"binary":{"left":"0x4ad807c717fddd60daf73b94c59a47f376aa0ac0a4e1f549e688f5da7e5e3ea","right":"0x271123d1041a65dc8989e2bfaa6f08d4bc735ef12d13b22ba2ea0811534c9cc"}},{"edge":{"child":"0x2c90ab8d4024644723029081b8fa75e909af50e19c8c3a146bb17ef00e52b3d","path":{"len":229,"value":"0x1"}}}],"state_commitment":"0x46407af434cc224b639c22aceea1df94df3f1b0f102b763a1f0610f824a3bd0"},"id":0}% From bc8d548a915ef3d4c36c1e2ce653aba6de4d851e Mon Sep 17 00:00:00 2001 From: Pia Date: Tue, 3 Sep 2024 21:23:36 +0900 Subject: [PATCH 04/29] works! --- Cargo.lock | 342 +------------------------- hdp/Cargo.toml | 1 - hdp/src/provider/error.rs | 6 + hdp/src/provider/starknet/provider.rs | 101 +++++++- hdp/src/provider/starknet/rpc.rs | 150 +++++++---- hdp/src/provider/starknet/types.rs | 23 +- 6 files changed, 228 insertions(+), 395 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5210da32..09c984d0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -854,12 +854,6 @@ dependencies = [ "rustc_version 0.4.0", ] -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - [[package]] name = "atty" version = "0.2.14" @@ -1218,12 +1212,6 @@ version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d32a725bc159af97c3e629873bb9f88fb8cf8a4867175f76dc987815ea07c83b" -[[package]] -name = "cesu8" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" - [[package]] name = "cfg-if" version = "1.0.0" @@ -1347,16 +1335,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" -[[package]] -name = "combine" -version = "4.6.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" -dependencies = [ - "bytes", - "memchr", -] - [[package]] name = "const-fnv1a-hash" version = "1.1.0" @@ -2038,16 +2016,6 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" -[[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.30" @@ -2126,52 +2094,6 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" -[[package]] -name = "gloo-net" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06f627b1a58ca3d42b45d6104bf1e1a03799df472df00988b6ba21accc10580" -dependencies = [ - "futures-channel", - "futures-core", - "futures-sink", - "gloo-utils", - "http 1.1.0", - "js-sys", - "pin-project", - "serde", - "serde_json", - "thiserror", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", -] - -[[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 = "gloo-utils" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b5555354113b18c547c1d3a98fbf7fb32a9ff4f6fa112ce823a21641a0ba3aa" -dependencies = [ - "js-sys", - "serde", - "serde_json", - "wasm-bindgen", - "web-sys", -] - [[package]] name = "good_lp" version = "1.8.1" @@ -2212,25 +2134,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "h2" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" -dependencies = [ - "atomic-waker", - "bytes", - "fnv", - "futures-core", - "futures-sink", - "http 1.1.0", - "indexmap 2.2.6", - "slab", - "tokio", - "tokio-util", - "tracing", -] - [[package]] name = "half" version = "2.4.1" @@ -2271,7 +2174,6 @@ dependencies = [ "eth-trie-proofs", "futures", "itertools 0.10.5", - "jsonrpsee", "lazy_static", "regex", "reqwest 0.11.27", @@ -2437,7 +2339,7 @@ dependencies = [ "futures-channel", "futures-core", "futures-util", - "h2 0.3.26", + "h2", "http 0.2.12", "http-body 0.4.6", "httparse", @@ -2460,7 +2362,6 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2 0.4.6", "http 1.1.0", "http-body 1.0.0", "httparse", @@ -2485,24 +2386,6 @@ dependencies = [ "tokio-rustls 0.24.1", ] -[[package]] -name = "hyper-rustls" -version = "0.27.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" -dependencies = [ - "futures-util", - "http 1.1.0", - "hyper 1.3.1", - "hyper-util", - "log", - "rustls 0.23.10", - "rustls-pki-types", - "tokio", - "tokio-rustls 0.26.0", - "tower-service", -] - [[package]] name = "hyper-tls" version = "0.5.0" @@ -2755,26 +2638,6 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" -[[package]] -name = "jni" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6df18c2e3db7e453d3c6ac5b3e9d5182664d28788126d39b91f2d1e22b017ec" -dependencies = [ - "cesu8", - "combine", - "jni-sys", - "log", - "thiserror", - "walkdir", -] - -[[package]] -name = "jni-sys" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" - [[package]] name = "js-sys" version = "0.3.69" @@ -2784,131 +2647,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "jsonrpsee" -version = "0.24.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ec465b607a36dc5dd45d48b7689bc83f679f66a3ac6b6b21cc787a11e0f8685" -dependencies = [ - "jsonrpsee-client-transport", - "jsonrpsee-core", - "jsonrpsee-http-client", - "jsonrpsee-types", - "jsonrpsee-wasm-client", - "jsonrpsee-ws-client", -] - -[[package]] -name = "jsonrpsee-client-transport" -version = "0.24.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90f0977f9c15694371b8024c35ab58ca043dbbf4b51ccb03db8858a021241df1" -dependencies = [ - "base64 0.22.0", - "futures-channel", - "futures-util", - "gloo-net", - "http 1.1.0", - "jsonrpsee-core", - "pin-project", - "rustls 0.23.10", - "rustls-pki-types", - "rustls-platform-verifier", - "soketto", - "thiserror", - "tokio", - "tokio-rustls 0.26.0", - "tokio-util", - "tracing", - "url", -] - -[[package]] -name = "jsonrpsee-core" -version = "0.24.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e942c55635fbf5dc421938b8558a8141c7e773720640f4f1dbe1f4164ca4e221" -dependencies = [ - "async-trait", - "bytes", - "futures-timer", - "futures-util", - "http 1.1.0", - "http-body 1.0.0", - "http-body-util", - "jsonrpsee-types", - "pin-project", - "rustc-hash 2.0.0", - "serde", - "serde_json", - "thiserror", - "tokio", - "tokio-stream", - "tracing", - "wasm-bindgen-futures", -] - -[[package]] -name = "jsonrpsee-http-client" -version = "0.24.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e33774602df12b68a2310b38a535733c477ca4a498751739f89fe8dbbb62ec4c" -dependencies = [ - "async-trait", - "base64 0.22.0", - "http-body 1.0.0", - "hyper 1.3.1", - "hyper-rustls 0.27.2", - "hyper-util", - "jsonrpsee-core", - "jsonrpsee-types", - "rustls 0.23.10", - "rustls-platform-verifier", - "serde", - "serde_json", - "thiserror", - "tokio", - "tower", - "tracing", - "url", -] - -[[package]] -name = "jsonrpsee-types" -version = "0.24.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23b67d6e008164f027afbc2e7bb79662650158d26df200040282d2aa1cbb093b" -dependencies = [ - "http 1.1.0", - "serde", - "serde_json", - "thiserror", -] - -[[package]] -name = "jsonrpsee-wasm-client" -version = "0.24.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0470d0ae043ffcb0cd323797a631e637fb4b55fe3eaa6002934819458bba62a7" -dependencies = [ - "jsonrpsee-client-transport", - "jsonrpsee-core", - "jsonrpsee-types", -] - -[[package]] -name = "jsonrpsee-ws-client" -version = "0.24.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "992bf67d1132f88edf4a4f8cff474cf01abb2be203004a2b8e11c2b20795b99e" -dependencies = [ - "http 1.1.0", - "jsonrpsee-client-transport", - "jsonrpsee-core", - "jsonrpsee-types", - "url", -] - [[package]] name = "jsonwebtoken" version = "9.3.0" @@ -3862,11 +3600,11 @@ dependencies = [ "encoding_rs", "futures-core", "futures-util", - "h2 0.3.26", + "h2", "http 0.2.12", "http-body 0.4.6", "hyper 0.14.28", - "hyper-rustls 0.24.2", + "hyper-rustls", "hyper-tls 0.5.0", "ipnet", "js-sys", @@ -4011,12 +3749,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" -[[package]] -name = "rustc-hash" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" - [[package]] name = "rustc-hex" version = "2.1.0" @@ -4072,7 +3804,6 @@ version = "0.23.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05cff451f60db80f490f3c182b77c35260baace73209e9cdbbe526bfe3a4d402" dependencies = [ - "log", "once_cell", "ring", "rustls-pki-types", @@ -4081,19 +3812,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "rustls-native-certs" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04182dffc9091a404e0fc069ea5cd60e5b866c3adf881eff99a32d048242dffa" -dependencies = [ - "openssl-probe", - "rustls-pemfile 2.1.2", - "rustls-pki-types", - "schannel", - "security-framework", -] - [[package]] name = "rustls-pemfile" version = "1.0.4" @@ -4119,33 +3837,6 @@ version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" -[[package]] -name = "rustls-platform-verifier" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93bda3f493b9abe5b93b3e7e3ecde0df292f2bd28c0296b90586ee0055ff5123" -dependencies = [ - "core-foundation", - "core-foundation-sys", - "jni", - "log", - "once_cell", - "rustls 0.23.10", - "rustls-native-certs", - "rustls-platform-verifier-android", - "rustls-webpki 0.102.4", - "security-framework", - "security-framework-sys", - "webpki-roots 0.26.3", - "winapi", -] - -[[package]] -name = "rustls-platform-verifier-android" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f87165f0995f63a9fbeea62b64d10b4d9d8e78ec6d7d51fb2125fda7bb36788f" - [[package]] name = "rustls-webpki" version = "0.101.7" @@ -4203,7 +3894,7 @@ dependencies = [ "log", "oorandom", "parking_lot 0.11.2", - "rustc-hash 1.1.0", + "rustc-hash", "salsa-macros", "smallvec", ] @@ -4324,7 +4015,6 @@ dependencies = [ "core-foundation", "core-foundation-sys", "libc", - "num-bigint", "security-framework-sys", ] @@ -4362,12 +4052,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" @@ -4640,21 +4324,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "soketto" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37468c595637c10857701c990f93a40ce0e357cedb0953d1c26c8d8027f9bb53" -dependencies = [ - "base64 0.22.0", - "bytes", - "futures", - "httparse", - "log", - "rand", - "sha1", -] - [[package]] name = "spin" version = "0.9.8" @@ -5223,7 +4892,6 @@ checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" dependencies = [ "bytes", "futures-core", - "futures-io", "futures-sink", "pin-project-lite", "tokio", @@ -5849,7 +5517,7 @@ dependencies = [ "log", "pharos", "rustc_version 0.4.0", - "send_wrapper 0.6.0", + "send_wrapper", "thiserror", "wasm-bindgen", "wasm-bindgen-futures", diff --git a/hdp/Cargo.toml b/hdp/Cargo.toml index e9ef6a42..a4baafff 100644 --- a/hdp/Cargo.toml +++ b/hdp/Cargo.toml @@ -34,7 +34,6 @@ reqwest = { workspace = true } lazy_static = { workspace = true } eth-trie-proofs = { workspace = true } itertools = { workspace = true } -jsonrpsee = { version = "0.24.3", features = ["http-client", "client"] } [features] default = [] diff --git a/hdp/src/provider/error.rs b/hdp/src/provider/error.rs index f55377b3..23678940 100644 --- a/hdp/src/provider/error.rs +++ b/hdp/src/provider/error.rs @@ -45,4 +45,10 @@ pub enum RpcProviderError { alloy::rpc::types::EIP1186AccountProofResponse, )>, ), + + #[error("Failed to fetch proofs: {0}")] + ReqwestError(#[from] reqwest::Error), + + #[error("Failed to parse response: {0}")] + SerdeJsonError(#[from] serde_json::Error), } diff --git a/hdp/src/provider/starknet/provider.rs b/hdp/src/provider/starknet/provider.rs index d322fa9f..7b03d600 100644 --- a/hdp/src/provider/starknet/provider.rs +++ b/hdp/src/provider/starknet/provider.rs @@ -1,12 +1,23 @@ -use crate::provider::{config::ProviderConfig, indexer::Indexer}; +use std::{collections::HashMap, time::Instant}; -use super::rpc::RpcProvider; +use alloy::primitives::BlockNumber; +use itertools::Itertools; +use starknet_types_core::felt::Felt; +use tracing::info; + +use crate::provider::{config::ProviderConfig, error::ProviderError, indexer::Indexer}; + +use super::{rpc::RpcProvider, types::GetProofOutput}; + +type AccountProofsResult = Result, ProviderError>; +type StorageProofsResult = Result, ProviderError>; pub struct StarknetProvider { /// Account and storage trie provider pub(crate) rpc_provider: RpcProvider, /// Header provider - pub(crate) header_provider: Indexer, + //TODO: indexer is not supported for starknet yet + pub(crate) _header_provider: Indexer, } #[cfg(feature = "test_utils")] @@ -22,7 +33,89 @@ impl StarknetProvider { let indexer = Indexer::new(config.chain_id); Self { rpc_provider, - header_provider: indexer, + _header_provider: indexer, + } + } + + /// Fetches the account proofs for the given block range. + /// The account proofs are fetched from the RPC provider. + /// + /// Return: + /// - Account proofs mapped by block number + pub async fn get_range_of_account_proofs( + &self, + from_block: BlockNumber, + to_block: BlockNumber, + increment: u64, + address: Felt, + ) -> AccountProofsResult { + let start_fetch = Instant::now(); + + let target_blocks_batch: Vec> = + self._chunk_block_range(from_block, to_block, increment); + + let mut fetched_accounts_proofs_with_blocks_map = HashMap::new(); + for target_blocks in target_blocks_batch { + fetched_accounts_proofs_with_blocks_map.extend( + self.rpc_provider + .get_account_proofs(target_blocks, address) + .await?, + ); } + + let duration = start_fetch.elapsed(); + info!("time taken (Account Proofs Fetch): {:?}", duration); + + Ok(fetched_accounts_proofs_with_blocks_map) + } + + /// Fetches the storage proofs for the given block range. + /// The storage proofs are fetched from the RPC provider. + /// + /// Return: + /// - Storage proofs mapped by block number + pub async fn get_range_of_storage_proofs( + &self, + from_block: BlockNumber, + to_block: BlockNumber, + increment: u64, + address: Felt, + storage_slot: Felt, + ) -> StorageProofsResult { + let start_fetch = Instant::now(); + + let target_blocks_batch: Vec> = + self._chunk_block_range(from_block, to_block, increment); + + let mut processed_accounts = HashMap::new(); + for target_blocks in target_blocks_batch { + processed_accounts.extend( + self.rpc_provider + .get_storage_proofs(target_blocks, address, storage_slot) + .await?, + ); + } + + let duration = start_fetch.elapsed(); + info!("time taken (Storage Proofs Fetch): {:?}", duration); + + Ok(processed_accounts) + } + + /// Chunks the block range into smaller ranges of 800 blocks. + /// This is to avoid fetching too many blocks at once from the RPC provider. + /// This is meant to use with data lake definition, which have sequential block numbers + pub(crate) fn _chunk_block_range( + &self, + from_block: BlockNumber, + to_block: BlockNumber, + increment: u64, + ) -> Vec> { + (from_block..=to_block) + .step_by(increment as usize) + .chunks(800) + .into_iter() + .map(|chunk| chunk.collect()) + .collect() } } diff --git a/hdp/src/provider/starknet/rpc.rs b/hdp/src/provider/starknet/rpc.rs index e81b60aa..a65b3ecb 100644 --- a/hdp/src/provider/starknet/rpc.rs +++ b/hdp/src/provider/starknet/rpc.rs @@ -1,18 +1,12 @@ +use alloy::primitives::BlockNumber; use std::{ collections::{HashMap, HashSet}, sync::Arc, time::Instant, }; -use alloy::primitives::BlockNumber; - use futures::future::join_all; -use jsonrpsee::{ - core::{client::ClientT, BoxError}, - http_client::{HttpClient, HttpClientBuilder}, - rpc_params, -}; -use reqwest::Url; +use reqwest::{Client, Url}; use serde_json::json; use starknet_types_core::felt::Felt; use tokio::sync::{ @@ -27,17 +21,39 @@ use super::types::GetProofOutput; /// !Note: have to use pathfinder node as we need `pathfinder_getProof` pub struct RpcProvider { - client: HttpClient, + client: reqwest::Client, + url: Url, chunk_size: u64, } impl RpcProvider { pub fn new(rpc_url: Url, chunk_size: u64) -> Self { - let client = HttpClientBuilder::default().build(rpc_url).unwrap(); - Self { client, chunk_size } + Self { + client: Client::new(), + url: rpc_url, + chunk_size, + } + } + + /// Get account with proof in given vector of blocks + pub async fn get_account_proofs( + &self, + blocks: Vec, + address: Felt, + ) -> Result, RpcProviderError> { + self.get_proofs(blocks, address, None).await } - pub async fn get_account_proofs(&self, blocks: Vec, address: Felt) {} + /// Get storage with proof in given vector of blocks and slot + pub async fn get_storage_proofs( + &self, + block_range: Vec, + address: Felt, + storage_key: Felt, + ) -> Result, RpcProviderError> { + self.get_proofs(block_range, address, Some(storage_key)) + .await + } async fn get_proofs( &self, @@ -69,6 +85,7 @@ impl RpcProvider { let chunk_size = self.chunk_size; let provider_clone = self.client.clone(); let target_blocks_length = blocks.len(); + let url = self.url.clone(); debug!( "fetching proofs for {}, with chunk size: {}", @@ -99,9 +116,11 @@ impl RpcProvider { let fetched_blocks_clone = blocks_map.clone(); let rpc_sender = rpc_sender.clone(); let provider_clone = provider_clone.clone(); + let url = url.clone(); async move { let proof = pathfinder_get_proof( &provider_clone, + url, address, block_number, storage_key, @@ -126,44 +145,37 @@ impl RpcProvider { /// Fetches proof (account or storage) for a given block number async fn pathfinder_get_proof( - provider: &HttpClient, + provider: &reqwest::Client, + url: Url, address: Felt, block_number: BlockNumber, storage_key: Option, -) -> Result { +) -> Result { let mut keys = Vec::new(); if let Some(key) = storage_key { - keys.push(format!("{}", key.to_hex_string())); + keys.push(key.to_hex_string()); } let request = json!({ "jsonrpc": "2.0", + "id": "0", "method": "pathfinder_getProof", "params": { - "block_id": "latest", + "block_id": {"block_number": block_number}, "contract_address": format!("{}", address.to_hex_string()), "keys": keys - }, - "id": 0 + } }); - println!("req:{}", request); - - let response: serde_json::Value = provider - .request( - "pathfinder_getProof", - rpc_params![request["params"].clone()], - ) - .await?; - - println!("res:{}", response); - - let get_proof_output: GetProofOutput = serde_json::from_value(response["result"].clone())?; + let response = provider.post(url).json(&request).send().await?; + let response_json = + serde_json::from_str::(&response.text().await?)?["result"].clone(); + let get_proof_output: GetProofOutput = serde_json::from_value(response_json)?; Ok(get_proof_output) } async fn handle_proof_result( - proof: Result, + proof: Result, block_number: BlockNumber, blocks_map: Arc>>, rpc_sender: Sender<(BlockNumber, GetProofOutput)>, @@ -185,31 +197,77 @@ mod tests { use super::*; use reqwest::Url; - + const PATHFINDER_URL: &str = "https://pathfinder.sepolia.iosis.tech/"; fn test_provider() -> RpcProvider { RpcProvider::new(Url::from_str(PATHFINDER_URL).unwrap(), 100) } #[tokio::test] - async fn test_get_proof() { + async fn test_get_100_range_storage_with_proof() { + // TODO: why the storage proof returns same value as account proof + let target_block_start = 156600; + let target_block_end = 156700; + let target_block_range = (target_block_start..=target_block_end).collect::>(); + let provider = test_provider(); + let proof = provider + .get_storage_proofs( + target_block_range.clone(), + Felt::from_str("0x23371b227eaecd8e8920cd429d2cd0f3fee6abaacca08d3ab82a7cdd") + .unwrap(), + Felt::from_str("0x1").unwrap(), + ) + .await + .unwrap(); + + assert_eq!(proof.len(), target_block_range.len()); + let output = proof.get(&target_block_start).unwrap(); + println!("Proof: {:?}", output); + assert_eq!( + output.state_commitment.unwrap(), + Felt::from_str("0x26da0f5f0849cf69b4872ef5dced3ec68ce28c5e3f53207280113abb7feb158") + .unwrap() + ); + + assert_eq!( + output.class_commitment.unwrap(), + Felt::from_str("0x46c1a0374b8ccf8d928e62ef40974304732c8a28f10b2c494adfabfcff0fa0a") + .unwrap() + ); + + assert!(output.contract_data.is_none()); + } + + #[tokio::test] + async fn test_get_100_range_account_with_proof() { + let target_block_start = 156600; + let target_block_end = 156700; + let target_block_range = (target_block_start..=target_block_end).collect::>(); let provider = test_provider(); let proof = provider - .get_proofs( - [156600].to_vec(), - Felt::from_str( - "0x23371b227eaecd8e8920cd429d2cd0f3fee6abaacca08d3ab82a7cdd", - ) - .unwrap(), - Some( - Felt::from_str( - "0x1", - ) + .get_account_proofs( + target_block_range.clone(), + Felt::from_str("0x23371b227eaecd8e8920cd429d2cd0f3fee6abaacca08d3ab82a7cdd") .unwrap(), - ), ) - .await; + .await + .unwrap(); + + assert_eq!(proof.len(), target_block_range.len()); + let output = proof.get(&target_block_start).unwrap(); + println!("Proof: {:?}", output); + assert_eq!( + output.state_commitment.unwrap(), + Felt::from_str("0x26da0f5f0849cf69b4872ef5dced3ec68ce28c5e3f53207280113abb7feb158") + .unwrap() + ); + + assert_eq!( + output.class_commitment.unwrap(), + Felt::from_str("0x46c1a0374b8ccf8d928e62ef40974304732c8a28f10b2c494adfabfcff0fa0a") + .unwrap() + ); - println!("{:?}", proof); + assert!(output.contract_data.is_none()); } } diff --git a/hdp/src/provider/starknet/types.rs b/hdp/src/provider/starknet/types.rs index 709c6901..3ff53a26 100644 --- a/hdp/src/provider/starknet/types.rs +++ b/hdp/src/provider/starknet/types.rs @@ -13,18 +13,18 @@ pub struct GetProofOutput { /// absent the hash of the first node in the /// [contract_proof](GetProofOutput#contract_proof) is the global state /// commitment. - state_commitment: Option, + pub state_commitment: Option, /// Required to verify that the hash of the class commitment and the root of /// the [contract_proof](GetProofOutput::contract_proof) matches the /// [state_commitment](Self#state_commitment). Present only for Starknet /// blocks 0.11.0 onwards. - class_commitment: Option, + pub class_commitment: Option, /// Membership / Non-membership proof for the queried contract - contract_proof: Vec, + pub contract_proof: Vec, /// Additional contract data if it exists. - contract_data: Option, + pub contract_data: Option, } /// A node in a Starknet patricia-merkle trie. @@ -32,8 +32,16 @@ pub struct GetProofOutput { /// See pathfinders merkle-tree crate for more information. #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] pub enum TrieNode { + #[serde(rename = "binary")] Binary { left: Felt, right: Felt }, - Edge { child: Felt, path: [u8; 32] }, + #[serde(rename = "edge")] + Edge { child: Felt, path: Path }, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct Path { + len: u64, + value: String, } impl TrieNode { @@ -41,12 +49,13 @@ impl TrieNode { match self { TrieNode::Binary { left, right } => H::hash(left, right), TrieNode::Edge { child, path } => { + let bytes: [u8; 32] = path.value.as_bytes().try_into().unwrap(); let mut length = [0; 32]; // Safe as len() is guaranteed to be <= 251 - length[31] = path.len() as u8; - let path = Felt::from_bytes_be_slice(path); + length[31] = bytes.len() as u8; let length = Felt::from_bytes_be(&length); + let path = Felt::from_bytes_be(&bytes); H::hash(child, &path) + length } } From 7a5091702d12a266bbb71b617f29096b214ef2b5 Mon Sep 17 00:00:00 2001 From: Pia Date: Tue, 3 Sep 2024 21:25:55 +0900 Subject: [PATCH 05/29] rm :dummy file --- pathfinder.request.json | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 pathfinder.request.json diff --git a/pathfinder.request.json b/pathfinder.request.json deleted file mode 100644 index cdfb351c..00000000 --- a/pathfinder.request.json +++ /dev/null @@ -1,14 +0,0 @@ -❯ curl -s -X POST \ - -H 'Content-Type: application/json' \ - -d '{ - "jsonrpc": "2.0", - "method": "pathfinder_getProof", - "params": { - "block_id": "latest", - "contract_address": "0x23371b227eaecd8e8920cd429d2cd0f3fee6abaacca08d3ab82a7cdd", - "keys": ["0x1"] - }, - "id": 0 - }' \ - https://pathfinder.sepolia.iosis.tech -{"jsonrpc":"2.0","result":{"class_commitment":"0x46c1a0374b8ccf8d928e62ef40974304732c8a28f10b2c494adfabfcff0fa0a","contract_data":null,"contract_proof":[{"binary":{"left":"0x1fce6ebc4ed28309974e4d5ecf9e51420ba5585d90110c130b8600ede80c5c0","right":"0x75fb62a61d1ffc4ef82df685c74a7292b34bd30fa7c68ff7b5f4774662ad61c"}},{"binary":{"left":"0x234737de2705b5c4b6511397cfbfd4a7be5e1039bb3750cbdcdda3233bb75df","right":"0x4593f0345afeff3ab53e34ef598ad41ac0c77823dbd1ef6f84af312ffb31996"}},{"binary":{"left":"0x271ff2593020872e524af8daa846983b7b043339fcef335890f6c7df7a9d889","right":"0x66cff3b63768084f84013ff15047adcaee3129e5b25d7373907e3ec33d3142f"}},{"binary":{"left":"0x7fe8dc7a63c3242e0dcca7c30083bdef80281cf4dcdc560271914921468a22b","right":"0x6a4c4de2a4248369f763d7051039c9166a052c87d02265c413cc2e985d13a7b"}},{"binary":{"left":"0x42cb837e41783f18d4b755c5ab9805cf978ab2968ed90f3a5ef7d2cca875782","right":"0x1940dc58b742c2ef3380f00705042bc8cede62574889bddf7794e00a3237d3"}},{"binary":{"left":"0x3b4567923933c70ea41388c0b7a417abe33b2be6c63502aa0498df43641067d","right":"0x1bfed7273176888d48091ca5cf9b86c18e0b46c19c4480e6085ed21fba2baa"}},{"binary":{"left":"0x6a7544e21d79895fef3ee3fca0a1e054e39d667d1b81db9178b7a365c246fa8","right":"0x7464f2a0dcfc72f24b3ab83aa27df75ff49c8a1a2cb6d6013dea24115e5a1a4"}},{"binary":{"left":"0x2b38c99a85f2a7d24cbc11776e7c60063e771d2a40ff779d7da788b515a10cc","right":"0x3c1de78e157fe6c9b9a17bc13c03aa6b96079c544ada06e4121295bcfb4df40"}},{"binary":{"left":"0x7b9b97aab2974de84a5c5a8c3a6dc5be6eea17e01edd78108d93ecb0b84384c","right":"0x343d11c95e7fe731f5b18581bd0d7880a52d5354e786fedb27e2755ed98ba4"}},{"binary":{"left":"0x520b92021697702ebcf7224412f6b836f3bbdef2a70d64f9c623ece3722959f","right":"0x76b5410380a8ef83218486d4e2889f987966f6149e917746b2f054eec154e23"}},{"binary":{"left":"0x272f761c0bb1b1d70a785b56c894dccd5a8cb54c57ca61a1fde1a35592c028e","right":"0x73b6378d6db93716a1e4998412332b56bda8fc422bf5e6090beb9640fe9c087"}},{"binary":{"left":"0x79781ee9e623c7191682931049148cf58187ca270aa5597cd54cad6a8b2e724","right":"0x3aae622e14c7e7932ca1739995b02333e17839009ce838fdee422e85bfdce1c"}},{"binary":{"left":"0x26bd7f3203f07c81053e59d589f77a4c543e7204190466c4070befd50e42fd1","right":"0x3e5e3061d0165c807ef5b01bb1fb52640b563e01e0d95a2147332cd531236d0"}},{"binary":{"left":"0x35bff569ae6378256a0f8edc16e11465b80c6df65d43f63db2de397255a37b","right":"0x7dee4b21e69cb6d8a0c8b9a02dbe3a7051db9e3227c8e5a4fe3a982d73e15b1"}},{"binary":{"left":"0x19095f7dfd2ad48be7993ae0ddf6cdf7edbe3f452c732ce1aacb6427508641d","right":"0x77f9c3d354e07acb48309d1e8480412878bce30b375255019a091ed16b204c1"}},{"binary":{"left":"0x18f2fd53fcef537df9e9198ffe6f1070c39944cd8ecb101d6f6fc18b4ad96a7","right":"0x544f935e562e1d83d5e0c9b58ab9b4e0697ce2f2bb198dd5392b04c5920bfdb"}},{"binary":{"left":"0x3d0cb13372330e94a75f435c1317747b03b5f9764ce19576f505ce251a9b8b2","right":"0x2e25083e3f2ffec2ee585973ffbf1a582592212ad43242234c13ff602385270"}},{"binary":{"left":"0xacbb7ead42ba37145b629bd63bb9d7f7b11715c8d2c4ac98d60c8b35372206","right":"0x581421ecef4b2058e07350602f60fd90ab9eb3422a5726849a1422d1a725b0a"}},{"binary":{"left":"0x25bc11ec36c9db342daa61f89176ae920ff7dde4ab1aa7786d307005a8b5f0c","right":"0x142db9370528b7ff388cc7a64437c2054aecea95cac1e8bed856b78104d0ab6"}},{"binary":{"left":"0x874891a64e16fe2a0ef32af13755e477c7d4d503f074426980d3a60448c245","right":"0x61835e9c88fe6010fe08337cd71ab13f2b189395a93bbfd4db66c060a58c835"}},{"binary":{"left":"0x4c8259021fbb82e40baaa003d3fe9cf6c109b2a49600b93aba5a22860de1d5d","right":"0x383b888ba52b75d69f4dd2bc3cb28fbac033a01e68c4b8f2862183aecbe4fd7"}},{"binary":{"left":"0x4ad807c717fddd60daf73b94c59a47f376aa0ac0a4e1f549e688f5da7e5e3ea","right":"0x271123d1041a65dc8989e2bfaa6f08d4bc735ef12d13b22ba2ea0811534c9cc"}},{"edge":{"child":"0x2c90ab8d4024644723029081b8fa75e909af50e19c8c3a146bb17ef00e52b3d","path":{"len":229,"value":"0x1"}}}],"state_commitment":"0x46407af434cc224b639c22aceea1df94df3f1b0f102b763a1f0610f824a3bd0"},"id":0}% From 4a0949dd713f07efdb93b9a05eea0958ca9a44be Mon Sep 17 00:00:00 2001 From: Pia Date: Wed, 4 Sep 2024 11:53:57 +0900 Subject: [PATCH 06/29] chore: minor edit --- .env.example | 2 ++ hdp/src/provider/starknet/rpc.rs | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.env.example b/.env.example index 6ade5e55..cf06a8d3 100644 --- a/.env.example +++ b/.env.example @@ -3,6 +3,8 @@ RPC_URL_ETHEREUM_SEPOLIA=https://goerli.infura.io/v3/your-infura-api-key # this value is optional RPC_CHUNK_SIZE_ETHEREUM_SEPOLIA=2000 +RPC_URL_STARKNET_SEPOLIA=# if it's starknet make sure to use pathfinder + # Optional DRY_RUN_CAIRO_PATH= # path for dry run cairo SOUND_RUN_CAIRO_PATH= # path for sound run cairo diff --git a/hdp/src/provider/starknet/rpc.rs b/hdp/src/provider/starknet/rpc.rs index a65b3ecb..542f65ac 100644 --- a/hdp/src/provider/starknet/rpc.rs +++ b/hdp/src/provider/starknet/rpc.rs @@ -215,7 +215,7 @@ mod tests { target_block_range.clone(), Felt::from_str("0x23371b227eaecd8e8920cd429d2cd0f3fee6abaacca08d3ab82a7cdd") .unwrap(), - Felt::from_str("0x1").unwrap(), + Felt::from_str("0x2").unwrap(), ) .await .unwrap(); @@ -229,6 +229,8 @@ mod tests { .unwrap() ); + assert_eq!(output.contract_proof.len(), 23); + assert_eq!( output.class_commitment.unwrap(), Felt::from_str("0x46c1a0374b8ccf8d928e62ef40974304732c8a28f10b2c494adfabfcff0fa0a") @@ -261,6 +263,7 @@ mod tests { Felt::from_str("0x26da0f5f0849cf69b4872ef5dced3ec68ce28c5e3f53207280113abb7feb158") .unwrap() ); + assert_eq!(output.contract_proof.len(), 23); assert_eq!( output.class_commitment.unwrap(), From e969a9a01fd0345e51039ae04c6c8a86178a391f Mon Sep 17 00:00:00 2001 From: Pia Date: Thu, 5 Sep 2024 17:43:05 +0900 Subject: [PATCH 07/29] test case for storage proof --- hdp/src/provider/starknet/rpc.rs | 16 +++++++++++----- hdp/src/provider/starknet/types.rs | 2 ++ 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/hdp/src/provider/starknet/rpc.rs b/hdp/src/provider/starknet/rpc.rs index 542f65ac..a0c5c432 100644 --- a/hdp/src/provider/starknet/rpc.rs +++ b/hdp/src/provider/starknet/rpc.rs @@ -170,6 +170,7 @@ async fn pathfinder_get_proof( let response = provider.post(url).json(&request).send().await?; let response_json = serde_json::from_str::(&response.text().await?)?["result"].clone(); + println!("response_json: {:?}", response_json); let get_proof_output: GetProofOutput = serde_json::from_value(response_json)?; Ok(get_proof_output) } @@ -206,16 +207,21 @@ mod tests { #[tokio::test] async fn test_get_100_range_storage_with_proof() { // TODO: why the storage proof returns same value as account proof - let target_block_start = 156600; - let target_block_end = 156700; + let target_block_start = 56400; + let target_block_end = 56401; let target_block_range = (target_block_start..=target_block_end).collect::>(); let provider = test_provider(); let proof = provider .get_storage_proofs( target_block_range.clone(), - Felt::from_str("0x23371b227eaecd8e8920cd429d2cd0f3fee6abaacca08d3ab82a7cdd") - .unwrap(), - Felt::from_str("0x2").unwrap(), + Felt::from_str( + "0x017E2D0662675DD83B4B58A0A659EAFA131FDD01FA6DABD5002D8815DD2D17A5", + ) + .unwrap(), + Felt::from_str( + "0x004C4FB1AB068F6039D5780C68DD0FA2F8742CCEB3426D19667778CA7F3518A9", + ) + .unwrap(), ) .await .unwrap(); diff --git a/hdp/src/provider/starknet/types.rs b/hdp/src/provider/starknet/types.rs index 3ff53a26..557ac85a 100644 --- a/hdp/src/provider/starknet/types.rs +++ b/hdp/src/provider/starknet/types.rs @@ -25,6 +25,8 @@ pub struct GetProofOutput { /// Additional contract data if it exists. pub contract_data: Option, + + pub storage_proofs: Option>>, } /// A node in a Starknet patricia-merkle trie. From 53a2d655e876879f37e9dae85bae53093d7457fb Mon Sep 17 00:00:00 2001 From: Pia Date: Thu, 5 Sep 2024 18:04:31 +0900 Subject: [PATCH 08/29] test with storage --- hdp/src/provider/starknet/rpc.rs | 16 +++++++++------- hdp/src/provider/starknet/types.rs | 8 +++----- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/hdp/src/provider/starknet/rpc.rs b/hdp/src/provider/starknet/rpc.rs index a0c5c432..bfa6f75a 100644 --- a/hdp/src/provider/starknet/rpc.rs +++ b/hdp/src/provider/starknet/rpc.rs @@ -206,9 +206,8 @@ mod tests { #[tokio::test] async fn test_get_100_range_storage_with_proof() { - // TODO: why the storage proof returns same value as account proof let target_block_start = 56400; - let target_block_end = 56401; + let target_block_end = 56500; let target_block_range = (target_block_start..=target_block_end).collect::>(); let provider = test_provider(); let proof = provider @@ -228,22 +227,25 @@ mod tests { assert_eq!(proof.len(), target_block_range.len()); let output = proof.get(&target_block_start).unwrap(); - println!("Proof: {:?}", output); + assert_eq!( output.state_commitment.unwrap(), - Felt::from_str("0x26da0f5f0849cf69b4872ef5dced3ec68ce28c5e3f53207280113abb7feb158") + Felt::from_str("0x598cf91d9a3a7176d01926e8442b8bd83299168f723cb2d52080e895400d9a1") .unwrap() ); - assert_eq!(output.contract_proof.len(), 23); + assert_eq!(output.contract_proof.len(), 17); assert_eq!( output.class_commitment.unwrap(), - Felt::from_str("0x46c1a0374b8ccf8d928e62ef40974304732c8a28f10b2c494adfabfcff0fa0a") + Felt::from_str("0x324d06b207f2891ef395ba1e7a0ef92b61a5772a294a289362dc37b0469c453") .unwrap() ); - assert!(output.contract_data.is_none()); + assert_eq!( + output.contract_data.clone().unwrap().storage_proofs[0].len(), + 5 + ); } #[tokio::test] diff --git a/hdp/src/provider/starknet/types.rs b/hdp/src/provider/starknet/types.rs index 557ac85a..33180733 100644 --- a/hdp/src/provider/starknet/types.rs +++ b/hdp/src/provider/starknet/types.rs @@ -6,7 +6,7 @@ use starknet_types_core::{felt::Felt, hash::StarkHash}; /// Holds the membership/non-membership of a contract and its associated /// contract contract if the contract exists. -#[derive(Debug, Serialize, Deserialize)] +#[derive(Debug, Clone, Serialize, Deserialize)] #[skip_serializing_none] pub struct GetProofOutput { /// The global state commitment for Starknet 0.11.0 blocks onwards, if @@ -25,8 +25,6 @@ pub struct GetProofOutput { /// Additional contract data if it exists. pub contract_data: Option, - - pub storage_proofs: Option>>, } /// A node in a Starknet patricia-merkle trie. @@ -65,7 +63,7 @@ impl TrieNode { } /// Holds the data and proofs for a specific contract. -#[derive(Debug, Serialize, Deserialize)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct ContractData { /// Required to verify the contract state hash to contract root calculation. class_hash: Felt, @@ -80,5 +78,5 @@ pub struct ContractData { contract_state_hash_version: Felt, /// The proofs associated with the queried storage values - storage_proofs: Vec>, + pub storage_proofs: Vec>, } From 0722b491c27c15887714de40047e96a91ab624c1 Mon Sep 17 00:00:00 2001 From: Pia Date: Wed, 11 Sep 2024 17:41:19 +0900 Subject: [PATCH 09/29] is this works? --- .github/workflows/fixtures.yml | 85 ++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 .github/workflows/fixtures.yml diff --git a/.github/workflows/fixtures.yml b/.github/workflows/fixtures.yml new file mode 100644 index 00000000..f9a7865b --- /dev/null +++ b/.github/workflows/fixtures.yml @@ -0,0 +1,85 @@ +name: Generate and Merge Fixtures + +on: + workflow_dispatch: + push: + branches: + - dev + +jobs: + generate_fixtures: + runs-on: ubuntu-latest + steps: + - name: Checkout current repository + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.9" + + - name: Display Python version + run: python -c "import sys; print(sys.version)" + + - uses: dtolnay/rust-toolchain@master + with: + toolchain: stable + + - name: Install CLI binary + run: | + cargo install --locked -f --path cli/ + + - name: Clone hdp-test repository + uses: actions/checkout@v4 + with: + repository: HerodotusDev/hdp-test + token: ${{ secrets.REPO_ACCESS_TOKEN }} + path: hdp-test + + - name: Generate .env file + run: | + cd hdp-test + cat << EOF > .env + RPC_URL_ETHEREUM_SEPOLIA=${{ secrets.RPC_URL_ETHEREUM_SEPOLIA }} + RPC_CHUNK_SIZE_ETHEREUM_SEPOLIA=${{ secrets.RPC_CHUNK_SIZE_ETHEREUM_SEPOLIA }} + DRY_RUN_CAIRO_PATH=${{ secrets.DRY_RUN_CAIRO_PATH }} + SOUND_RUN_CAIRO_PATH=${{ secrets.SOUND_RUN_CAIRO_PATH }} + SAVE_FETCH_KEYS_FILE=${{ secrets.SAVE_FETCH_KEYS_FILE }} + EOF + + - name: Set up and generate fixtures + run: | + cd hdp-test + make cleanup + make setup + source venv/bin/activate + make generate + + - name: Commit and push new fixtures + run: | + cd hdp-test + git config user.name github-actions + git config user.email github-actions@github.com + git add . + git commit -m "Update fixtures" + git push origin HEAD:${{ github.ref_name }} + + merge_to_main: + needs: generate_fixtures + if: github.ref == 'refs/heads/dev' + runs-on: ubuntu-latest + steps: + - name: Checkout hdp-test repository + uses: actions/checkout@v4 + with: + repository: HerodotusDev/hdp-test + token: ${{ secrets.REPO_ACCESS_TOKEN }} + + - name: Merge fixtures to main + run: | + git config user.name github-actions + git config user.email github-actions@github.com + git fetch origin + git checkout main + git merge origin/${{ github.ref_name }} + git push origin main From 3cb3263c125f80d5eae595c48f2354c13187e38e Mon Sep 17 00:00:00 2001 From: Pia Date: Thu, 12 Sep 2024 15:01:13 +0900 Subject: [PATCH 10/29] git pull issue --- .github/workflows/fixtures.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/fixtures.yml b/.github/workflows/fixtures.yml index f9a7865b..19004301 100644 --- a/.github/workflows/fixtures.yml +++ b/.github/workflows/fixtures.yml @@ -60,9 +60,12 @@ jobs: cd hdp-test git config user.name github-actions git config user.email github-actions@github.com + git fetch origin + git checkout ${{ github.ref_name }} + git pull origin ${{ github.ref_name }} git add . git commit -m "Update fixtures" - git push origin HEAD:${{ github.ref_name }} + git push origin ${{ github.ref_name }} merge_to_main: needs: generate_fixtures From e5623278daf2364c2dd610f57eecc093215c947d Mon Sep 17 00:00:00 2001 From: Pia Date: Thu, 12 Sep 2024 15:14:54 +0900 Subject: [PATCH 11/29] update --- .github/workflows/fixtures.yml | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/.github/workflows/fixtures.yml b/.github/workflows/fixtures.yml index 19004301..fce67c79 100644 --- a/.github/workflows/fixtures.yml +++ b/.github/workflows/fixtures.yml @@ -29,12 +29,22 @@ jobs: run: | cargo install --locked -f --path cli/ - - name: Clone hdp-test repository - uses: actions/checkout@v4 - with: - repository: HerodotusDev/hdp-test - token: ${{ secrets.REPO_ACCESS_TOKEN }} - path: hdp-test + - name: Clone and setup hdp-test repository + run: | + git clone https://x-access-token:${{ secrets.REPO_ACCESS_TOKEN }}@github.com/HerodotusDev/hdp-test.git hdp-test + cd hdp-test + git config user.name github-actions + git config user.email github-actions@github.com + + # Check if branch exists on remote + if git ls-remote --exit-code --heads origin ${{ github.ref_name }} >/dev/null 2>&1; then + echo "Branch ${{ github.ref_name }} exists on remote, checking out" + git checkout ${{ github.ref_name }} + else + echo "Branch ${{ github.ref_name }} does not exist on remote, creating from main" + git checkout main + git checkout -b ${{ github.ref_name }} + fi - name: Generate .env file run: | @@ -58,11 +68,6 @@ jobs: - name: Commit and push new fixtures run: | cd hdp-test - git config user.name github-actions - git config user.email github-actions@github.com - git fetch origin - git checkout ${{ github.ref_name }} - git pull origin ${{ github.ref_name }} git add . git commit -m "Update fixtures" git push origin ${{ github.ref_name }} @@ -77,6 +82,7 @@ jobs: with: repository: HerodotusDev/hdp-test token: ${{ secrets.REPO_ACCESS_TOKEN }} + fetch-depth: 0 - name: Merge fixtures to main run: | @@ -84,5 +90,5 @@ jobs: git config user.email github-actions@github.com git fetch origin git checkout main - git merge origin/${{ github.ref_name }} + git merge --no-ff origin/${{ github.ref_name }} -m "Merge ${{ github.ref_name }} into main" git push origin main From d22fd0d21773551defc907576316e96a5cccc8f5 Mon Sep 17 00:00:00 2001 From: Pia Date: Thu, 12 Sep 2024 14:32:05 +0900 Subject: [PATCH 12/29] wip, huge refactor needed --- hdp/src/preprocessor/compile/datalake.rs | 12 ++-- hdp/src/preprocessor/compile/mod.rs | 25 ++++---- hdp/src/preprocessor/compile/module.rs | 15 ++--- hdp/src/preprocessor/mod.rs | 10 +-- .../processed_types/block_proofs.rs | 39 +++++++++++- .../cairo_format/block_proofs.rs | 25 ++++++-- .../processed_types/cairo_format/query.rs | 8 ++- hdp/src/primitives/processed_types/query.rs | 15 +++-- .../provider/evm/datalake/block_sampled.rs | 62 ++++++++++++++----- hdp/src/provider/evm/datalake/transactions.rs | 19 +++--- hdp/src/provider/evm/from_keys.rs | 44 +++++++------ hdp/src/provider/evm/provider.rs | 43 +++++++------ hdp/src/provider/types.rs | 8 +-- 13 files changed, 211 insertions(+), 114 deletions(-) diff --git a/hdp/src/preprocessor/compile/datalake.rs b/hdp/src/preprocessor/compile/datalake.rs index 87210156..cb80d4cb 100644 --- a/hdp/src/preprocessor/compile/datalake.rs +++ b/hdp/src/preprocessor/compile/datalake.rs @@ -27,13 +27,13 @@ impl Compilable for DatalakeCompute { aggregation_fn.operation(&compiled_block_sampled.values, Some(fn_context.clone()))?; Ok(CompilationResult::new( + self.datalake.get_chain_id().to_numeric_id(), vec![aggregated_result], - compiled_block_sampled.headers, + compiled_block_sampled.mmr_with_headers, compiled_block_sampled.accounts, compiled_block_sampled.storages, compiled_block_sampled.transactions, compiled_block_sampled.transaction_receipts, - compiled_block_sampled.mmr_metas, )) } } @@ -130,14 +130,14 @@ mod tests { .compile(&compiler_config) .await .unwrap(); - assert_eq!(results.headers.len(), 16); + // assert_eq!(results.mmr_with_headers[0].headers.len(), 16); assert_eq!(results.accounts.len(), 2); assert_eq!(results.storages.len(), 1); let storage_proofs = results.storages.iter().next().unwrap(); assert_eq!(storage_proofs.proofs.len(), 6); assert_eq!(results.transactions.len(), 0); assert_eq!(results.transaction_receipts.len(), 0); - assert_eq!(results.mmr_metas.len(), 1); + // assert_eq!(results.mmr_metas.len(), 1); } #[tokio::test] @@ -181,11 +181,11 @@ mod tests { .compile(&compiler_config) .await .unwrap(); - assert_eq!(results.headers.len(), 2); + // assert_eq!(results.headers.len(), 2); assert_eq!(results.accounts.len(), 0); assert_eq!(results.storages.len(), 0); assert_eq!(results.transactions.len(), 10); assert_eq!(results.transaction_receipts.len(), 11); - assert_eq!(results.mmr_metas.len(), 1); + // assert_eq!(results.mmr_metas.len(), 1); } } diff --git a/hdp/src/preprocessor/compile/mod.rs b/hdp/src/preprocessor/compile/mod.rs index ca5eff89..2d618e40 100644 --- a/hdp/src/preprocessor/compile/mod.rs +++ b/hdp/src/preprocessor/compile/mod.rs @@ -2,7 +2,7 @@ use alloy::primitives::U256; use config::CompilerConfig; -use std::collections::HashSet; +use std::collections::{HashMap, HashSet}; use thiserror::Error; use crate::primitives::processed_types::{ @@ -52,10 +52,11 @@ pub trait Compilable { #[derive(Debug, Default, PartialEq)] pub struct CompilationResult { + pub chain_id: u128, /// results of tasks pub task_results: Vec, - /// Headers related to the datalake - pub headers: HashSet, + /// mmr_with_headers related to the datalake + pub mmr_with_headers: HashMap>, /// Accounts related to the datalake pub accounts: HashSet, /// Storages related to the datalake @@ -64,39 +65,41 @@ pub struct CompilationResult { pub transactions: HashSet, /// Transaction receipts related to the datalake pub transaction_receipts: HashSet, - /// MMR meta data related to the headers - pub mmr_metas: HashSet, } impl CompilationResult { pub fn new( + chain_id: u128, task_results: Vec, - headers: HashSet, + mmr_with_headers: HashMap>, accounts: HashSet, storages: HashSet, transactions: HashSet, transaction_receipts: HashSet, - mmr_metas: HashSet, ) -> Self { Self { + chain_id, task_results, - headers, + mmr_with_headers, accounts, storages, transactions, transaction_receipts, - mmr_metas, } } /// Extend the current compilation results with another compilation results pub fn extend(&mut self, other: CompilationResult) { - self.headers.extend(other.headers); + for (mmr_meta, headers) in other.mmr_with_headers { + self.mmr_with_headers + .entry(mmr_meta) + .or_default() + .extend(headers); + } self.accounts.extend(other.accounts); self.storages.extend(other.storages); self.transactions.extend(other.transactions); self.transaction_receipts.extend(other.transaction_receipts); self.task_results.extend(other.task_results); - self.mmr_metas.extend(other.mmr_metas); } } diff --git a/hdp/src/preprocessor/compile/module.rs b/hdp/src/preprocessor/compile/module.rs index 1648a24a..5e907916 100644 --- a/hdp/src/preprocessor/compile/module.rs +++ b/hdp/src/preprocessor/compile/module.rs @@ -4,13 +4,15 @@ use crate::cairo_runner::dry_run::DryRunResult; use crate::cairo_runner::{cairo_dry_run, input::dry_run::DryRunnerProgramInput}; use crate::constant::DRY_CAIRO_RUN_OUTPUT_FILE; + +use crate::primitives::processed_types::block_proofs::convert_to_mmr_meta_set; use crate::primitives::processed_types::cairo_format; use crate::primitives::task::ExtendedModule; use crate::provider::key::categorize_fetch_keys; use crate::provider::traits::new_provider_from_config; use core::panic; -use std::collections::HashSet; +use std::collections::{HashMap, HashSet}; use std::path::PathBuf; use tracing::info; @@ -57,12 +59,11 @@ impl Compilable for ModuleVec { panic!("Multiple chain id is not supported yet"); } - let mut headers = HashSet::new(); let mut accounts = HashSet::new(); let mut storages = HashSet::new(); let mut transactions = HashSet::new(); let mut transaction_receipts = HashSet::new(); - let mut mmr_metas = HashSet::new(); + let mut mmr_header_map = HashMap::new(); info!("3. Fetching proofs from provider..."); for (chain_id, keys) in keys_maps_chain { @@ -75,22 +76,22 @@ impl Compilable for ModuleVec { let results = provider.fetch_proofs_from_keys(keys).await?; // TODO: can we do better? - headers.extend(results.headers.into_iter()); + mmr_header_map.extend(convert_to_mmr_meta_set(results.mmr_with_headers)); accounts.extend(results.accounts.into_iter()); storages.extend(results.storages.into_iter()); transactions.extend(results.transactions.into_iter()); transaction_receipts.extend(results.transaction_receipts.into_iter()); - mmr_metas.extend(results.mmr_metas.into_iter()); } + // TODO : need fix let compiled_result = CompilationResult::new( + 1, commit_results_maps, - headers, + mmr_header_map, accounts, storages, transactions, transaction_receipts, - mmr_metas, ); Ok(compiled_result) } diff --git a/hdp/src/preprocessor/mod.rs b/hdp/src/preprocessor/mod.rs index 6e3473a6..eeb76b4f 100644 --- a/hdp/src/preprocessor/mod.rs +++ b/hdp/src/preprocessor/mod.rs @@ -3,7 +3,9 @@ use crate::constant::SOUND_CAIRO_RUN_OUTPUT_FILE; use crate::primitives::merkle_tree::{build_result_merkle_tree, build_task_merkle_tree}; -use crate::primitives::processed_types::block_proofs::ProcessedBlockProofs; +use crate::primitives::processed_types::block_proofs::{ + convert_to_mmr_with_headers, ProcessedBlockProofs, +}; use crate::primitives::processed_types::datalake_compute::ProcessedDatalakeCompute; use crate::primitives::processed_types::module::ProcessedModule; use crate::primitives::processed_types::query::ProcessorInput; @@ -120,8 +122,8 @@ impl PreProcessor { } let proofs = ProcessedBlockProofs { - mmr_metas: Vec::from_iter(compiled_results.mmr_metas), - headers: Vec::from_iter(compiled_results.headers), + chain_id: 1, + mmr_with_headers: convert_to_mmr_with_headers(compiled_results.mmr_with_headers), accounts: Vec::from_iter(compiled_results.accounts), storages: Vec::from_iter(compiled_results.storages), transactions: Vec::from_iter(compiled_results.transactions), @@ -131,7 +133,7 @@ impl PreProcessor { SOUND_CAIRO_RUN_OUTPUT_FILE.into(), result_merkle_tree.root(), task_merkle_root, - proofs, + vec![proofs], combined_tasks, ); info!("1️⃣ Preprocessor completed successfully"); diff --git a/hdp/src/primitives/processed_types/block_proofs.rs b/hdp/src/primitives/processed_types/block_proofs.rs index a0e8f406..16bda303 100644 --- a/hdp/src/primitives/processed_types/block_proofs.rs +++ b/hdp/src/primitives/processed_types/block_proofs.rs @@ -1,3 +1,5 @@ +use std::collections::{HashMap, HashSet}; + use serde::{Deserialize, Serialize}; use super::{ @@ -7,12 +9,43 @@ use super::{ /// Provider should fetch all the proofs and rlp values from given keys. -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Eq, Hash)] pub struct ProcessedBlockProofs { - pub mmr_metas: Vec, - pub headers: Vec, + pub chain_id: u128, + pub mmr_with_headers: Vec, pub accounts: Vec, pub storages: Vec, pub transactions: Vec, pub transaction_receipts: Vec, } + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Eq, Hash)] +pub struct MMRWithHeader { + pub mmr_meta: MMRMeta, + pub headers: Vec, +} + +pub fn convert_to_mmr_with_headers( + map: HashMap>, +) -> Vec { + map.into_iter() + .map(|(mmr_meta, headers)| MMRWithHeader { + mmr_meta, + headers: headers.into_iter().collect(), + }) + .collect() +} + +pub fn convert_to_mmr_meta_set( + mmr_with_headers: Vec, +) -> HashMap> { + mmr_with_headers + .into_iter() + .map(|mmr_with_header| { + ( + mmr_with_header.mmr_meta, + mmr_with_header.headers.into_iter().collect::>(), + ) + }) + .collect() +} diff --git a/hdp/src/primitives/processed_types/cairo_format/block_proofs.rs b/hdp/src/primitives/processed_types/cairo_format/block_proofs.rs index c7f6ee13..f5917c5e 100644 --- a/hdp/src/primitives/processed_types/cairo_format/block_proofs.rs +++ b/hdp/src/primitives/processed_types/cairo_format/block_proofs.rs @@ -14,11 +14,18 @@ impl AsCairoFormat for BaseProcessedBlockProofs { fn as_cairo_format(&self) -> Self::Output { ProcessedBlockProofs { - mmr_metas: self.mmr_metas.clone(), - headers: self - .headers + chain_id: self.chain_id, + mmr_with_headers: self + .mmr_with_headers .iter() - .map(|header| header.as_cairo_format()) + .map(|mmr_with_header| MMRWithHeader { + mmr_meta: mmr_with_header.mmr_meta.clone(), + headers: mmr_with_header + .headers + .iter() + .map(|header| header.as_cairo_format()) + .collect(), + }) .collect(), accounts: self .accounts @@ -46,10 +53,16 @@ impl AsCairoFormat for BaseProcessedBlockProofs { #[derive(Serialize, Deserialize)] pub struct ProcessedBlockProofs { - pub mmr_metas: Vec, - pub headers: Vec, + pub chain_id: u128, + pub mmr_with_headers: Vec, pub accounts: Vec, pub storages: Vec, pub transactions: Vec, pub transaction_receipts: Vec, } + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct MMRWithHeader { + pub mmr_meta: MMRMeta, + pub headers: Vec, +} diff --git a/hdp/src/primitives/processed_types/cairo_format/query.rs b/hdp/src/primitives/processed_types/cairo_format/query.rs index 228e7043..e26ec1cd 100644 --- a/hdp/src/primitives/processed_types/cairo_format/query.rs +++ b/hdp/src/primitives/processed_types/cairo_format/query.rs @@ -15,7 +15,11 @@ impl AsCairoFormat for BasedProcessorInput { cairo_run_output_path: self.cairo_run_output_path.clone(), task_root: self.tasks_root, result_root: self.results_root, - proofs: self.proofs.as_cairo_format(), + proofs: self + .proofs + .iter() + .map(|proof| proof.as_cairo_format()) + .collect(), tasks: self .tasks .iter() @@ -34,7 +38,7 @@ pub struct ProcessorInput { /// Batched results root of all tasks. pub result_root: B256, /// Fetched proofs per each fetch point. - pub proofs: ProcessedBlockProofs, + pub proofs: Vec, /// tasks to be executed. pub tasks: Vec, } diff --git a/hdp/src/primitives/processed_types/query.rs b/hdp/src/primitives/processed_types/query.rs index d41e3832..29ad40c3 100644 --- a/hdp/src/primitives/processed_types/query.rs +++ b/hdp/src/primitives/processed_types/query.rs @@ -3,7 +3,8 @@ use alloy::primitives::B256; use std::path::PathBuf; use super::{ - block_proofs::ProcessedBlockProofs, processor_output::ProcessorOutput, task::ProcessedTask, + block_proofs::ProcessedBlockProofs, mmr::MMRMeta, processor_output::ProcessorOutput, + task::ProcessedTask, }; #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] @@ -14,7 +15,7 @@ pub struct ProcessorInput { pub tasks_root: B256, // U256 type pub results_root: B256, - pub proofs: ProcessedBlockProofs, + pub proofs: Vec, pub tasks: Vec, } @@ -23,7 +24,7 @@ impl ProcessorInput { cairo_run_output_path: PathBuf, results_root: B256, tasks_root: B256, - proofs: ProcessedBlockProofs, + proofs: Vec, tasks: Vec, ) -> Self { Self { @@ -58,6 +59,12 @@ impl ProcessorInput { .iter() .map(|task| task.get_result_proof()) .collect(); + let mmr_metas: Vec = self + .proofs + .iter() + .flat_map(|x| &x.mmr_with_headers) + .map(|mmr_with_header| mmr_with_header.mmr_meta.clone()) + .collect(); ProcessorOutput::new( task_results, @@ -67,7 +74,7 @@ impl ProcessorInput { results_inclusion_proofs, self.results_root, self.tasks_root, - self.proofs.mmr_metas.clone(), + mmr_metas, ) } } diff --git a/hdp/src/provider/evm/datalake/block_sampled.rs b/hdp/src/provider/evm/datalake/block_sampled.rs index 84db7c6f..68291848 100644 --- a/hdp/src/provider/evm/datalake/block_sampled.rs +++ b/hdp/src/provider/evm/datalake/block_sampled.rs @@ -2,8 +2,8 @@ use crate::{ primitives::{ block::account::Account, processed_types::{ - account::ProcessedAccount, header::ProcessedHeader, mpt::ProcessedMPTProof, - storage::ProcessedStorage, + account::ProcessedAccount, header::ProcessedHeader, mmr::MMRMeta, + mpt::ProcessedMPTProof, storage::ProcessedStorage, }, task::datalake::{ block_sampled::{BlockSampledCollection, BlockSampledDatalake}, @@ -12,7 +12,7 @@ use crate::{ }, provider::{error::ProviderError, evm::provider::EvmProvider, types::FetchedDatalake}, }; -use std::collections::HashSet; +use std::collections::{HashMap, HashSet}; use alloy::primitives::{Bytes, U256}; use anyhow::Result; @@ -24,14 +24,15 @@ impl EvmProvider { ) -> Result { let mut aggregation_set: Vec = Vec::new(); - let (mmr_metas, headers_proofs) = self + let headers_proofs = self .get_range_of_header_proofs( datalake.block_range_start, datalake.block_range_end, datalake.increment, ) .await?; - let mut headers: HashSet = HashSet::new(); + let mut mmr_with_headers: HashMap> = HashMap::new(); + let mut accounts: HashSet = HashSet::new(); let mut storages: HashSet = HashSet::new(); let block_range = (datalake.block_range_start..=datalake.block_range_end) @@ -40,16 +41,26 @@ impl EvmProvider { match &datalake.sampled_property { BlockSampledCollection::Header(property) => { for block in block_range { - let fetched_block = headers_proofs.get(&block).unwrap(); + let (fetched_block, mmr) = headers_proofs.get(&block).unwrap(); let value = property.decode_field_from_rlp(&Bytes::from( fetched_block.rlp_block_header.clone(), )); - headers.insert(ProcessedHeader::new( + let processed_header = ProcessedHeader::new( fetched_block.rlp_block_header.clone(), fetched_block.element_index, fetched_block.siblings_hashes.clone(), - )); + ); aggregation_set.push(value); + mmr_with_headers + .entry(mmr.clone()) + .and_modify(|existing_headers| { + existing_headers.insert(processed_header.clone()); + }) + .or_insert_with(|| { + let mut new_set = HashSet::new(); + new_set.insert(processed_header); + new_set + }); } } BlockSampledCollection::Account(address, property) => { @@ -65,16 +76,16 @@ impl EvmProvider { let mut account_proofs: Vec = vec![]; for block in block_range { - let fetched_block = headers_proofs.get(&block).unwrap().clone(); + let (fetched_block, mmr) = headers_proofs.get(&block).unwrap().clone(); let account_proof = accounts_and_proofs_result.get(&block).unwrap().clone(); let account = Account::from(&account_proof).rlp_encode(); let value = property.decode_field_from_rlp(&account); - headers.insert(ProcessedHeader::new( + let processed_header = ProcessedHeader::new( fetched_block.rlp_block_header.clone(), fetched_block.element_index, fetched_block.siblings_hashes.clone(), - )); + ); let account_proof = ProcessedMPTProof { block_number: block, @@ -83,6 +94,16 @@ impl EvmProvider { account_proofs.push(account_proof); aggregation_set.push(value); + mmr_with_headers + .entry(mmr.clone()) + .and_modify(|existing_headers| { + existing_headers.insert(processed_header.clone()); + }) + .or_insert_with(|| { + let mut new_set = HashSet::new(); + new_set.insert(processed_header); + new_set + }); } accounts.insert(ProcessedAccount::new(*address, account_proofs)); @@ -102,14 +123,14 @@ impl EvmProvider { let mut account_proofs: Vec = vec![]; for i in block_range { - let fetched_block = headers_proofs.get(&i).unwrap().clone(); + let (fetched_block, mmr) = headers_proofs.get(&i).unwrap().clone(); let storage_proof = storages_and_proofs_result.get(&i).unwrap().clone(); - headers.insert(ProcessedHeader::new( + let processed_header = ProcessedHeader::new( fetched_block.rlp_block_header.clone(), fetched_block.element_index, fetched_block.siblings_hashes.clone(), - )); + ); account_proofs.push(ProcessedMPTProof::new(i, storage_proof.account_proof)); @@ -119,6 +140,16 @@ impl EvmProvider { )); aggregation_set.push(storage_proof.storage_proof[0].value); + mmr_with_headers + .entry(mmr.clone()) + .and_modify(|existing_headers| { + existing_headers.insert(processed_header.clone()); + }) + .or_insert_with(|| { + let mut new_set = HashSet::new(); + new_set.insert(processed_header); + new_set + }); } storages.insert(ProcessedStorage::new(*address, *slot, storage_proofs)); @@ -128,12 +159,11 @@ impl EvmProvider { Ok(FetchedDatalake { values: aggregation_set, - headers, + mmr_with_headers, accounts, storages, transactions: HashSet::new(), transaction_receipts: HashSet::new(), - mmr_metas, }) } } diff --git a/hdp/src/provider/evm/datalake/transactions.rs b/hdp/src/provider/evm/datalake/transactions.rs index 38002edf..bab5ce7d 100644 --- a/hdp/src/provider/evm/datalake/transactions.rs +++ b/hdp/src/provider/evm/datalake/transactions.rs @@ -1,7 +1,8 @@ use crate::{ primitives::{ processed_types::{ - header::ProcessedHeader, receipt::ProcessedReceipt, transaction::ProcessedTransaction, + header::ProcessedHeader, mmr::MMRMeta, receipt::ProcessedReceipt, + transaction::ProcessedTransaction, }, task::datalake::{ transactions::{TransactionsCollection, TransactionsInBlockDatalake}, @@ -13,7 +14,7 @@ use crate::{ use alloy::primitives::U256; use anyhow::Result; -use std::collections::HashSet; +use std::collections::{HashMap, HashSet}; impl EvmProvider { pub async fn fetch_transactions( @@ -22,7 +23,7 @@ impl EvmProvider { ) -> Result { let mut aggregation_set: Vec = Vec::new(); - let (mmr_metas, headers_proofs) = self + let headers_proofs = self .get_range_of_header_proofs( datalake.target_block, datalake.target_block, @@ -30,16 +31,17 @@ impl EvmProvider { ) .await?; - let mut headers: HashSet = HashSet::new(); + let mut mmr_with_headers: HashMap> = HashMap::new(); let mut transactions: HashSet = HashSet::new(); let mut transaction_receipts: HashSet = HashSet::new(); - let fetched_block = headers_proofs.get(&datalake.target_block).unwrap(); + let (fetched_block, mmr) = headers_proofs.get(&datalake.target_block).unwrap(); - headers.insert(ProcessedHeader::new( + let processed_header = ProcessedHeader::new( fetched_block.rlp_block_header.clone(), fetched_block.element_index, fetched_block.siblings_hashes.clone(), - )); + ); + mmr_with_headers.insert(mmr.clone(), [processed_header].into_iter().collect()); match &datalake.sampled_property { TransactionsCollection::Transactions(property) => { @@ -92,12 +94,11 @@ impl EvmProvider { Ok(FetchedDatalake { values: aggregation_set, - headers, + mmr_with_headers, accounts: HashSet::new(), storages: HashSet::new(), transactions, transaction_receipts, - mmr_metas, }) } } diff --git a/hdp/src/provider/evm/from_keys.rs b/hdp/src/provider/evm/from_keys.rs index 358e562d..671f3c2a 100644 --- a/hdp/src/provider/evm/from_keys.rs +++ b/hdp/src/provider/evm/from_keys.rs @@ -1,6 +1,8 @@ use super::provider::EvmProvider; use crate::primitives::processed_types::account::ProcessedAccount; -use crate::primitives::processed_types::block_proofs::ProcessedBlockProofs; +use crate::primitives::processed_types::block_proofs::{ + convert_to_mmr_with_headers, ProcessedBlockProofs, +}; use crate::primitives::processed_types::header::ProcessedHeader; use crate::primitives::processed_types::mmr::MMRMeta; use crate::primitives::processed_types::mpt::ProcessedMPTProof; @@ -27,8 +29,9 @@ impl EvmProvider { &self, fetch_keys: CategorizedFetchKeys, ) -> Result { + let chain_id = self.header_provider.chain_id.to_numeric_id(); // fetch proofs using keys and construct result - let (headers, mmr_metas) = self.get_headers_from_keys(fetch_keys.headers).await?; + let mmr_with_headers = self.get_headers_from_keys(fetch_keys.headers).await?; let mut accounts = if fetch_keys.accounts.is_empty() { HashSet::new() } else { @@ -53,8 +56,8 @@ impl EvmProvider { accounts.extend(accounts_from_storage_key); let accounts_result: Vec = accounts.into_iter().collect(); Ok(ProcessedBlockProofs { - mmr_metas, - headers: headers.into_iter().collect(), + chain_id, + mmr_with_headers: convert_to_mmr_with_headers(mmr_with_headers), accounts: accounts_result, storages: storages.into_iter().collect(), transactions, @@ -65,7 +68,7 @@ impl EvmProvider { async fn get_headers_from_keys( &self, keys: HashSet, - ) -> Result<(HashSet, Vec), ProviderError> { + ) -> Result>, ProviderError> { let start_fetch = Instant::now(); let block_range = keys.iter().map(|x| x.block_number).collect::>(); @@ -81,8 +84,7 @@ impl EvmProvider { }; let chain_id = keys.iter().next().unwrap().chain_id; - let mut fetched_headers_proofs: HashSet = HashSet::new(); - let mut mmrs = HashSet::new(); + let mut fetched_headers_proofs: HashMap> = HashMap::new(); let real_target_blocks = keys.iter().map(|x| x.block_number).collect::>(); for target_blocks in target_blocks_batch { @@ -94,8 +96,8 @@ impl EvmProvider { .get_headers_proof(start_block, end_block) .await?; - // filter only the keys that are in the real target blocks - let keys_in_real_target_blocks = indexer_response + // filter only the keys that are in the real target blocks and create ProcessedHeaders + let keys_in_real_target_blocks: Vec = indexer_response .headers .into_iter() .filter(|(block_number, _)| real_target_blocks.contains(block_number)) @@ -105,20 +107,24 @@ impl EvmProvider { header_proof.element_index, header_proof.siblings_hashes, ) - }); + }) + .collect(); - fetched_headers_proofs.extend(keys_in_real_target_blocks); let fetched_mmr = indexer_response.mmr_meta; let mmr_meta = MMRMeta::from_indexer(fetched_mmr, chain_id); - mmrs.insert(mmr_meta); + fetched_headers_proofs + .entry(mmr_meta) + .and_modify(|existing_headers| { + existing_headers.extend(keys_in_real_target_blocks.iter().cloned()); + }) + .or_insert_with(|| keys_in_real_target_blocks.into_iter().collect()); } let duration = start_fetch.elapsed(); info!("time taken (Headers Proofs Fetch): {:?}", duration); - if !mmrs.is_empty() { - let vec_mmrs = mmrs.into_iter().collect::>(); - Ok((fetched_headers_proofs, vec_mmrs)) + if !fetched_headers_proofs.is_empty() { + Ok(fetched_headers_proofs) } else { Err(ProviderError::MmrNotFound) } @@ -367,7 +373,7 @@ mod tests { let (chain_id, fetched_keys) = categorize_fetch_keys(keys).into_iter().next().unwrap(); assert_eq!(chain_id, target_chain_id); let proofs = provider.fetch_proofs_from_keys(fetched_keys).await.unwrap(); - assert_eq!(proofs.headers.len(), 3); + assert_eq!(proofs.mmr_with_headers[0].headers.len(), 3); } #[tokio::test] @@ -393,7 +399,7 @@ mod tests { assert_eq!(chain_id, target_chain_id); let proofs = provider.fetch_proofs_from_keys(fetched_keys).await.unwrap(); assert_eq!(proofs.accounts[0].proofs.len(), 3); - assert_eq!(proofs.headers.len(), 3); + assert_eq!(proofs.mmr_with_headers[0].headers.len(), 3); } #[tokio::test] @@ -447,7 +453,7 @@ mod tests { let proofs = provider.fetch_proofs_from_keys(fetched_keys).await.unwrap(); let duration = start_fetch.elapsed(); println!("Time taken (Total Proofs Fetch): {:?}", duration); - assert_eq!(proofs.headers.len(), 6); + assert_eq!(proofs.mmr_with_headers[0].headers.len(), 6); assert_eq!(proofs.accounts[0].proofs.len(), 6); assert_eq!(proofs.storages[0].proofs.len(), 6); } @@ -465,7 +471,7 @@ mod tests { let (chain_id, fetched_keys) = categorize_fetch_keys(keys).into_iter().next().unwrap(); assert_eq!(chain_id, target_chain_id); let proofs = provider.fetch_proofs_from_keys(fetched_keys).await.unwrap(); - assert_eq!(proofs.headers.len(), 2); + assert_eq!(proofs.mmr_with_headers[0].headers.len(), 2); assert_eq!(proofs.transactions.len(), 3); } } diff --git a/hdp/src/provider/evm/provider.rs b/hdp/src/provider/evm/provider.rs index f636c3e7..5715a28e 100644 --- a/hdp/src/provider/evm/provider.rs +++ b/hdp/src/provider/evm/provider.rs @@ -19,10 +19,7 @@ use eth_trie_proofs::{ }; use itertools::Itertools; use reqwest::Url; -use std::{ - collections::{HashMap, HashSet}, - time::Instant, -}; +use std::{collections::HashMap, time::Instant}; use tracing::info; use crate::{ @@ -32,13 +29,8 @@ use crate::{ use super::rpc::RpcProvider; -type HeaderProofsResult = Result< - ( - HashSet, - HashMap, - ), - ProviderError, ->; +type HeaderProofsResult = + Result, ProviderError>; type AccountProofsResult = Result, ProviderError>; type StorageProofsResult = Result, ProviderError>; type TxProofsResult = Result, ProviderError>; @@ -97,8 +89,10 @@ impl EvmProvider { let target_blocks_batch: Vec> = self._chunk_block_range(from_block, to_block, increment); - let mut fetched_headers_proofs_with_blocks_map = HashMap::new(); - let mut mmrs = HashSet::new(); + let mut fetched_headers_proofs_with_blocks_map: HashMap< + u64, + (MMRProofFromNewIndexer, MMRMeta), + > = HashMap::new(); for target_blocks in target_blocks_batch { let (start_block, end_block) = @@ -108,20 +102,24 @@ impl EvmProvider { .header_provider .get_headers_proof(start_block, end_block) .await?; - - fetched_headers_proofs_with_blocks_map.extend(indexer_response.headers); let fetched_mmr = indexer_response.mmr_meta; let mmr_meta = MMRMeta::from_indexer(fetched_mmr, self.header_provider.chain_id); - mmrs.insert(mmr_meta); + + // TODO lets think how not clone the mmr_meta + fetched_headers_proofs_with_blocks_map.extend( + indexer_response + .headers + .into_iter() + .map(|(block_number, header_proof)| { + (block_number, (header_proof, mmr_meta.clone())) + }), + ); } let duration = start_fetch.elapsed(); info!("time taken (Headers Proofs Fetch): {:?}", duration); - if !mmrs.is_empty() { - Ok((mmrs, fetched_headers_proofs_with_blocks_map)) - } else { - Err(ProviderError::MmrNotFound) - } + + Ok(fetched_headers_proofs_with_blocks_map) } /// Fetches the account proofs for the given block range. @@ -462,10 +460,11 @@ mod tests { async fn test_get_2000_range_of_header_proofs() -> Result<(), ProviderError> { let start_time = Instant::now(); let provider = EvmProvider::default(); - let (_meta, header_response) = provider + let header_response = provider .get_range_of_header_proofs(6127485, 6127485 + 2000 - 1, 1) .await?; assert_eq!(header_response.len(), 2000); + // assert_eq!(meta.mmr_id, 26); let duration = start_time.elapsed(); println!("Time taken (Header Fetch): {:?}", duration); diff --git a/hdp/src/provider/types.rs b/hdp/src/provider/types.rs index 6c610e9d..42b0c8e3 100644 --- a/hdp/src/provider/types.rs +++ b/hdp/src/provider/types.rs @@ -3,7 +3,7 @@ //! //! We need this type to bind encoded transaction and receipts to the block number and proofs. -use std::collections::HashSet; +use std::collections::{HashMap, HashSet}; use crate::primitives::processed_types::{ account::ProcessedAccount, header::ProcessedHeader, mmr::MMRMeta, receipt::ProcessedReceipt, @@ -73,8 +73,8 @@ impl FetchedTransactionReceiptProof { pub struct FetchedDatalake { /// Targeted datalake's compiled results pub values: Vec, - /// Headers related to the datalake - pub headers: HashSet, + /// mmr_with_headers related to the datalake + pub mmr_with_headers: HashMap>, /// Accounts related to the datalake pub accounts: HashSet, /// Storages related to the datalake @@ -83,6 +83,4 @@ pub struct FetchedDatalake { pub transactions: HashSet, /// Transaction receipts related to the datalake pub transaction_receipts: HashSet, - /// MMR meta data related to the headers - pub mmr_metas: HashSet, } From b1f5278a117cfb224076c48f0115a97e7bbbe3dc Mon Sep 17 00:00:00 2001 From: Pia Date: Thu, 12 Sep 2024 14:37:43 +0900 Subject: [PATCH 13/29] input update --- input.json | 755 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 755 insertions(+) create mode 100644 input.json diff --git a/input.json b/input.json new file mode 100644 index 00000000..d9f3a9f2 --- /dev/null +++ b/input.json @@ -0,0 +1,755 @@ +{ + "cairo_run_output_path": "cairo_run_output.json", + "task_root": "0xd900a4d980172ad23fafb579aeac7cff91c73636d334bc247a1c3142d8bffa78", + "result_root": "0x34b46123c4ab406cec0586364d8ed193353f0e9fb1b32cac0988fc0970dc50a2", + "proofs": [ + { + "chain_id": 11155111, + "mmr_with_headers": [ + { + "mmr_meta": { + "id": 26, + "root": "0x5358fbe594d3e8fdb3f6f7bbbe979fc3a377851a21909ea7bc1821e15cc6c4e", + "size": 12899969, + "peaks": [ + "0x262c4c9b1cb2a036924aecf563dc9952e5f8b41004310adde86f22abb793eb1", + "0x63e06c6dd962e6232140b8f20fc4972ee69ca29d1c6ca4455d80afd4be0f3de", + "0x48c9781f73635713eb8ef52890c481f4438c576baf01b31bc7935d9d42c1244", + "0x068c923e9bcc3df411575563e88a81cdef49ef6c4307efad707a8538114b753", + "0x54a48cae0defc94286e03d5c3abc53a399db7eb6207140f8d6f8d7322c9d1fc", + "0x1f31aea9b689fdab066317c08c865ae3b134adef05a744965a5741119a6c094", + "0x41dc23c0b0c18e7cc1d3f7148feabbe30269080cbe9b6ead6b718a2d1176382", + "0x1d04bc7dd1b40becbbfdf6a6971ef0e1ffc873087ed75bb2163dd2615d366de", + "0x5f3202e8d32391896022ddb916b83f165d2d7486261304f3e029aad6258ba2c", + "0x3a98faad3cc3bdeee0f2a346469fe4e67d364c98f8f5adf03f472000194081c", + "0x48bb57587a1e690409d81b70f3fe2ee625f25f008ec0773e55a0e1293c9e025" + ], + "chain_id": 11155111 + }, + "headers": [ + { + "rlp": [ + "0x216f1eb0a05c02f9", + "0x4de0372b4bed3c60", + "0x8e23a0628d6c899f", + "0x65105b263ee0b4f5", + "0x4dcc1da057420e26", + "0xb585ab7a5dc7dee8", + "0x4512d31ad4ccb667", + "0x42a1f013748a941b", + "0xe2c6944793d440fd", + "0x6dca7ce2bf919945", + "0xe4a123da352f7286", + "0x9b608182bda097cb", + "0x29e3b5d6b2eb735d", + "0x453e78855ad3ad56", + "0x385cd72fd2f23ff9", + "0x6a7132d6a0e509c3", + "0x44cd18a4510c63cf", + "0x77919e8f9a1667c4", + "0x414bad92d40a9154", + "0x446e34a0813f946c", + "0xbe9450981b4e25eb", + "0x3dac7c23f5bb80be", + "0xf687f40adf699e82", + "0x1b9f087b04080", + "0xc8c910cce7c486d2", + "0xe59016a45e2698a1", + "0x82b4c33d7c5f5332", + "0xd446f24a5ed5b7cc", + "0xdf996f696b144e29", + "0xe24f0c6659dc1e54", + "0x4fa0a9d3141e3c9a", + "0xd9ecef0a2c5e6c94", + "0x2ac5a6ea467f7470", + "0x829130f6af92b658", + "0xe261af81856c3116", + "0x7b00b19847d30f60", + "0xdbc971aad011c5e7", + "0xd64f4cb7209bd6d0", + "0x70442fd0a28ca850", + "0x5c2cd3d036bc0140", + "0x9e437f250c8ac88f", + "0x9e28395a49ac6876", + "0xf6a43f3f0328bc0d", + "0xd9b4ecd529b403f8", + "0x59d6efe506742a33", + "0x7664561421b64d04", + "0x1c8f18660a1d4837", + "0x1c8ad7be7da7180c", + "0x47df73de1f95de05", + "0xd167b65b1edfe383", + "0x6b45c814dfc3b9d8", + "0x20e161a0d09691ac", + "0xb290d5b6ab793ef1", + "0x9a850b64eaf115a5", + "0x6274b7e9d0975fc9", + "0x94ee5d102c0a774b", + "0xc90184c546618380", + "0x8459b853018480c3", + "0x74657291bcaca266", + "0x332e302e31762f68", + "0x6ca078756e696c2f", + "0xd3a5a7ee7bde8cac", + "0x60f7893db4ae18f6", + "0x58536e554021926d", + "0x8887bc7cf3c65be6", + "0x0", + "0xe560a08f6e329484", + "0x1a6b0adc0ebec001", + "0x82c517e276bbf0d1", + "0x28ffa87f26c06564", + "0x283435c3242e723", + "0xaca0000098830000", + "0x73d11f799a08a6eb", + "0x1579c174a76155bc", + "0x9e37c7cb80c29381", + "0xacba28e2aceec8" + ], + "rlp_bytes_len": 607, + "proof": { + "leaf_idx": 12739496, + "mmr_path": [ + "0x291adc0ff3f5eb31376d2dc882c4a0b612ee00b536b484d9d68533db47b1a55", + "0x577884cce23db95312ef380a904afccab7fbd9cf34e84777adf2813bc92a413", + "0x71426cc21537949a45197dd3a57b397d86d3302dc894173068585b7631ebb25", + "0x6ebf678bb0eb572f157cf9ca66d1c27754c20986de0335382c12afd8fcd26fb", + "0x20dfc647656b4c039bf946a56d2695fd631a2226fd815a83b69e18b543b9dd5", + "0x1ea310f504c5c7c6d43642ba2c09fa8f66edd91a6d3e965dec30db6ec9aa030", + "0x18ca5daed2c274cf2215dd11b3c5875b740df446360af179c95a0ec53c58f13", + "0x59417edcf79f38992d51563fb1e2af608dff9f2371fef973b0cdac2febc526f", + "0x45a9615d78011e7752d3e3f3f6e11f0de5b8fe531a0959d0f6e5041e1b5ba6f", + "0x1e94c6fa131239300669cb31c1ced02d1ad800fac561e092ab8b843cb0e6111", + "0x767920b8e4e378c8a1e55f812ea4579e6deb7584eab1325bcf5bad57b442cf7", + "0x2bfb39d36fcf83d18b05565fb4ae8de38453d439db185160c0cb541df2255f7", + "0x3a5f673a2f7d7cacff677177483259b7b9161dde49603a3523909a74dcf58eb", + "0x63cb7951cbce300498bb8868a619f6ae7179d5ed1a5d832859e870de3e5c011", + "0x5dfc985941ef9d1bae4a5bcddb23a338c70248a43107555df4cc20f81423721", + "0x07a25a1fdea49b07bbf8231ad4e7c00dc020b85c183f91022abd7c7baf1f42d", + "0x3d088c444fcc7a0083f3cb9d95d56975d22a8ac1171fcf5c0d8fa325fcff4db" + ] + } + } + ] + } + ], + "accounts": [ + { + "address": ["0x5d89d5862ca7e8af", "0x36b7d426ab6d61d6", "0x2f4722cf"], + "account_key": "0x7fd6daf0de598ff611452d8eb4ec5f7e99e8ef74d175073be14cdc936830b5d3", + "proofs": [ + { + "block_number": 6375109, + "proof_bytes_len": [532, 532, 532, 532, 532, 404, 83, 104], + "proof": [ + [ + "0x444e529da01102f9", + "0xf37544b888708d51", + "0x4c73181251ca8773", + "0xca042799a2381be", + "0x8f891aa08f7a0b4b", + "0x1a73b84327366212", + "0xe20ac0516697c8bd", + "0x6fc64891e36ca714", + "0xd808a02db30e1217", + "0x607e5eea121e89d4", + "0x17b487cd624bab57", + "0x3f5938c05a0ffbd6", + "0x7a081e913a93e5b", + "0x4cacd321d5a138bd", + "0xeea00b2128a12212", + "0x5320f46d51ce5b74", + "0xa0fcde49c74a4e21", + "0xf4f5e9953107eadd", + "0x9b742e5b58a0b03a", + "0xf840bf140ca4f854", + "0xbbcf9e589f3860ab", + "0xb2347ff3a6618ba0", + "0xd30ef52d45438b70", + "0x5d2ff37033210e6c", + "0xe8d2cdc675a9a230", + "0x7b6e8ca5b604a080", + "0xfdaff0383e2cf2f2", + "0x43b00d14850f7873", + "0x32259e9638884225", + "0xdb2a38f356a0d615", + "0xdd66b426e3ee70dc", + "0xcb2a87f92ce4f59a", + "0x3558c02b067b0f76", + "0xd441ac8aa0542ab1", + "0x33a7053e7510a439", + "0x7bfc53cb480af51", + "0x917e6bc2d32e31a0", + "0x7e22ca0a3172bee", + "0x171aa595ef249e65", + "0x208430e2b9b2840", + "0x374f95bcc70a084f", + "0xb982a06bc37beb57", + "0xa307195ab46d773d", + "0x7d158a83f588227c", + "0x9bdf8627dbf1a4b6", + "0x68a069b7ad9561fd", + "0x711bc0fd99a56731", + "0xe16f9014a1da14da", + "0x1998ccb79dd40fee", + "0xa084c2deda7009ad", + "0xfec128291c32139c", + "0xf45b263525bbc1bc", + "0xea18c1d000803bd8", + "0xbc6e26a2759645b1", + "0xe5b26ed4928d5a0", + "0xd261b3306613ca46", + "0x118fcfd107367472", + "0x5750921a2a88ba9f", + "0xa0383126830ca0d9", + "0xfe03bb87ac16126e", + "0xd1b081e732ece6fe", + "0x14dba318c57c7fe1", + "0x6c9c7b30cca06837", + "0xa523ed9e811d73ec", + "0x9b98ace58bd45b0c", + "0xd81bb282de7c44ee", + "0x8048f498" + ], + [ + "0x1be4de43a01102f9", + "0x5b34e092388e9421", + "0xbbd32e19fe740815", + "0x57057ce6e1f2644c", + "0x1d9df4a0a4e1c960", + "0x798f1be9df913cae", + "0xb30f19e7d6597147", + "0x11c742452bd94bf5", + "0x68e8a054ddb0b4ee", + "0xebfbe7754b250c66", + "0xae0ee2ae31a2188b", + "0x2810698530f06730", + "0x89a074edd683c4eb", + "0x5f97b1a37b93f4c8", + "0x71766d0f37c01dac", + "0xceb278e3002bf14a", + "0xa05fc915f988d02d", + "0x44096c084c7724ec", + "0x55ca8edd889c1770", + "0xc74bcb8a87a3b3c5", + "0x3deab16eedc763a3", + "0x958ebb0ed20204a0", + "0xe0d7842550e1f7fa", + "0x50378dcc62cf1f85", + "0x1f8580288af2906e", + "0x101b530e575ba0de", + "0x72c2c377c188c834", + "0x547c9b315322f81a", + "0xcae4953a6575c1e9", + "0x41b8d3a8a7a04482", + "0x6c10c919bc7e59fb", + "0x832c3b8673380b0e", + "0x6022da748383ca14", + "0x5668c9ca0dc3dd8", + "0x7c7f8ff768d7a1a3", + "0x2f2acbd07b06820d", + "0xb3b9895140569141", + "0x3b6e69a00740897b", + "0x26a2b25238b65af3", + "0xa386028d7baff6dc", + "0x11ad051616033e5d", + "0x96eea067010faa37", + "0xed9d9c9bcedf5af0", + "0x37fb98d62dbd1dd6", + "0x1f414dbe76c464fd", + "0xdaa08bc0cb33fc60", + "0xb08cb9c2085cfc71", + "0xe189139d5391d4e6", + "0x81d62c2a3dd95aec", + "0xa0dda1a58913281d", + "0xe1e15f468c7be8f4", + "0x65e2cfcdbc79758a", + "0x25ede651e43dd045", + "0x1a230ebf6ee33052", + "0x19d7bd1e8c7550a0", + "0x94ac7048d3482b8d", + "0x4712f434347bd5f3", + "0x880f325e69627cba", + "0x4771673871e9a0b2", + "0x76e996ee04ef431", + "0x2032636c635156d2", + "0x6fd0c2a5bab4d2", + "0xf91fee1389a05181", + "0xb27b11ed5629c41a", + "0xed1c9dcc37b3085d", + "0xd493606d4ca0d3d3", + "0x801bdb72" + ], + [ + "0x71b960fa01102f9", + "0xbe1fe01634ea6e64", + "0xf41a59ac121ab0c7", + "0x11e95a4610790b44", + "0xb55cb6a0d1fb205a", + "0xadc9623e6edbc11c", + "0xfddc0a1821ba0cf0", + "0xd53be648834ef0f0", + "0xdbb3a033efba1484", + "0x56bdb101631c76f", + "0xd7d4f6591a171443", + "0xae600196088ef39", + "0x5aa07ece61ce4d49", + "0xfde31c1a7f893138", + "0xcb4c4365813b31ac", + "0x44e9682ec2fb5add", + "0xa064828756abd703", + "0x658940a7e900dedf", + "0x9ca2692bc72e0dd9", + "0x98f612838e0975f6", + "0xc0df161b8509e12d", + "0x48cd9012fce98a0", + "0xe861b22ec42d85f7", + "0x3cdd46ba75e86818", + "0xaf04e750b297489e", + "0xc43beb370e43a015", + "0xdd1b4d4edbb176aa", + "0xa5c2422d0bf6e6c4", + "0xc55773d8da6facaa", + "0x24ff6b6229a083da", + "0xa99e9a8bcd8eda00", + "0x3c3feb7198579ee1", + "0x1f60a3b2c54965a3", + "0xa97bcaa2a0872921", + "0xacc08b0b6f7d237d", + "0x6800e1bcd674c94d", + "0xa8c833699d7d8aeb", + "0xb245eca05d102c80", + "0x6fb43714b5bad4d7", + "0x94f615ad1da741fb", + "0x6d2e560d0e41ff56", + "0xa4f6a0208423a3cf", + "0x5b2e046e7d074f35", + "0xa098289f7f01d0bd", + "0x2265a4a7bfebcecc", + "0x7ca007262c28d797", + "0x6af5f9ed4ff17ff1", + "0x8b88a3ee112ee6a3", + "0xca661abf2cb29191", + "0xa066abc586c64a8a", + "0x813b3cd8cb48fcd8", + "0x72494ff3567ed250", + "0xb1d3cd4907b614c2", + "0xf1256dd9567b6a94", + "0xddeea9f55da583a0", + "0xe51a6c75910e4d4a", + "0xaa1ef569451c7ad3", + "0x15c29d58e7b28540", + "0xc98d543b0a3ba0e1", + "0x4ac2a8d446a1bab8", + "0xb1924632c4a3a8d7", + "0x1fb62fac04c4a758", + "0x82068bfc8fa002cb", + "0xa49507b0d33f4ae8", + "0xeaa341d28d10ad45", + "0xe8b0b5a713f7300e", + "0x8062325a" + ], + [ + "0xf1af50daa01102f9", + "0xc45148a86edcfbfe", + "0x7ff915197b189f26", + "0x7f92e3cf79221546", + "0x2650c9a0433b2cba", + "0x18c1ca0bbe0b9385", + "0xe4ca0208b3d7628d", + "0x184082fb648501bc", + "0x64f7a05428e26594", + "0x25ada2a637e5f953", + "0x8a3a6b896604586e", + "0xad9c09b75d0b3eae", + "0x7aa01f3891ebd29c", + "0x4124ff872109dbdd", + "0x576bba0fccf024df", + "0xfb686bbc7bf54546", + "0xa06ac78578ce9466", + "0x253055df1f76d334", + "0x32cd652eb86671d2", + "0x6f106a856b73968c", + "0x7c49da01208a387f", + "0x2c13a33c7ca8aaa0", + "0x17a3b5e952302372", + "0xddc268c59cc4adc2", + "0x61aa3d293992472b", + "0xf32780d28c36a098", + "0x7c451b5fd225caf6", + "0xe95f518a00b6b4fa", + "0xd7db61a9257c1e15", + "0x73454d87fda0ab26", + "0x339ba009944d4d6b", + "0x9ed08a8230482a69", + "0xd1390999b8312afb", + "0xb82fcc9ba067c7d8", + "0x52664c6dab495e", + "0x3615ae6770edd2df", + "0xca1d2b4eebb71e91", + "0x9ab8daa0a6974282", + "0xd86e2ff1acc6b40d", + "0xfc68716c52d3d232", + "0xa45ba0d42fa38799", + "0xca41a04157354876", + "0x6c5deaef8c318a58", + "0x84f555dd0a2f68c0", + "0x62f259ab51b8f292", + "0xc0a05a6da52a93c0", + "0x4cf6c19ee0c127b4", + "0xb489a44989226930", + "0x15b88d62aa535053", + "0xa01815e279cd3a5c", + "0x47a1c105c66321b7", + "0xe8f13ba36264077f", + "0x7044f9a89efa4755", + "0xff6a9dc4269cd9d6", + "0xf152d0d450e75fa0", + "0x9da8e15a468f5584", + "0x3b614f00a6312bdd", + "0x853af8603c6914a6", + "0x5722714ca459a07c", + "0x534f2f14c7b9cd", + "0xe0a40b78e069c271", + "0xed02a93532cfdd30", + "0x477474322da07ec5", + "0xcfb69eba40e8e83c", + "0x95c19429516b7e83", + "0xe72ddd0ce13f244", + "0x80a9427c" + ], + [ + "0x5e19c1aea01102f9", + "0x82653e9435c27456", + "0x6c85883c66d32d77", + "0x997434564679b8ed", + "0x2aef61a0f9dfcf06", + "0x1f4f35bac04c70c", + "0xa3aced786d2fc676", + "0x4cd55bd8c5ccb479", + "0xaadaa0a1c0b578e6", + "0xa12cde6061675c15", + "0x45238e8841693826", + "0xe8dbefccec975c1", + "0x56a0a6b6b1dd4f2c", + "0xb944f12d50702aa1", + "0x1962bfe45b3d41f7", + "0x18fbb405a9b11839", + "0xa0222a38518e0a92", + "0x7869cb59ae1871d6", + "0x96be8e6e205d11cd", + "0xaec0280b20553a28", + "0xfe34dfc43cf3707f", + "0x72a18de82ee33a0", + "0x941258afc42170f7", + "0x1dd489e0f8a60d0c", + "0x59158dad07c465e3", + "0xe309286a4e6aa0f2", + "0x635af7f158cfca48", + "0x7b2f709560ce8fe8", + "0x39568e381a5f6fac", + "0x55878a22dda0df02", + "0xe2fc664542c3871e", + "0xbce6bb844165bc3c", + "0x14531b77f59c916a", + "0xd184add5a0b662d9", + "0x6bb294447da0e26", + "0xc6e0912f0991e654", + "0x558e6ccc5c7c7392", + "0xd61712a0fc21c1dd", + "0x43a26c7177ccaaa", + "0x6ffc3b67472915e5", + "0x45049c641967f271", + "0x1dd8a0d6b5ebcb0c", + "0xc71045de4a959bf7", + "0x8676de566a1f1eb7", + "0xd297084c4019e127", + "0xbea0193d2b42415d", + "0x1e7d7514391790f0", + "0x1c60f3c5d6570922", + "0xffd71c6b9f149a42", + "0xa052b5f86b064bad", + "0xb22ccc5257cf30a8", + "0x42c32663548bedb5", + "0xdf128dce6daec770", + "0x703f370ed71eed6a", + "0x37144c12faac56a0", + "0x64dbc0bc53b88eda", + "0xd2b9768bdc6b752e", + "0x28b8f6798920547b", + "0xede378a44b10a0dc", + "0x5636f5174e54387d", + "0x324818ff66de2edf", + "0xf08cc6d4ecf1c385", + "0xadf4aa0d16a06a6c", + "0xeed518f3bdb6dfaa", + "0xd6c7bd0495a7a0f7", + "0x2a6d07385d918513", + "0x80da117b" + ], + [ + "0xd376880ca09101f9", + "0xc97a529699654659", + "0xe8ac8108a83209a4", + "0x4e90f78c7707d12d", + "0xe292da0e39f3515", + "0x6d8331ad2c6ba1f", + "0xc01c99e896c384d1", + "0x6adae583c2208211", + "0x1365a0287453f65b", + "0x5477cb087a0a097c", + "0xb62cab2d3021e6b", + "0xa505941c03ea474e", + "0x50a040f37a8034f6", + "0x6f086c0e8faa1381", + "0xc3bb7f31e0ab3cef", + "0x8b769bdb4289370e", + "0x80d08a156e708dab", + "0xd1acab94c25b04a0", + "0x2972012216221b7b", + "0xade04d0214fe47b8", + "0x839ac2f611f43d80", + "0xc6a86e9be4a8a05b", + "0xfd20f82104943ff3", + "0xddf3cf80aeb0c53c", + "0x76834fab7712248b", + "0x47106ea9a0800b84", + "0x20541efe5f40c0e2", + "0xc7452c160a02b5c4", + "0xc2e5cbff68c6f3d1", + "0xafdaffa0ee2e6571", + "0x9c6bb900257b102", + "0xb2d792bc50f15215", + "0x51be63015351d2fc", + "0x3ac6a0702f7569f8", + "0xfdcffc05cdff59b1", + "0x468880e764c84d44", + "0xd912199f06de7a7f", + "0x5ca0a7db843632ee", + "0xc0d628da52ba5c67", + "0xb12a761721d9d3a1", + "0xce173c16111f4289", + "0x8040db137a7bc4c1", + "0xfb5cf5c514ee43a0", + "0xffe55b93cd035f3e", + "0x5336d6af7ff71d8b", + "0xe4858f9a1352908e", + "0xc7ca89cbeea080c8", + "0xbe4d58304e68d653", + "0x2a798b994bb2daeb", + "0x70d1151e834cf123", + "0x803df2ce" + ], + [ + "0xa0808080808051f8", + "0x89aec71f036ca173", + "0xc99d552fcd9c02ee", + "0x64638627851c62cc", + "0x450cef2e7d51ed32", + "0x8080808080808080", + "0x56fda7cbf4e7a080", + "0x500f0ee84c586361", + "0xdeccd5de16f9e35d", + "0xa84323f9c25b7078", + "0x80c9ce" + ], + [ + "0xf68f59de309d66f8", + "0x7e5fecb48e2d4511", + "0x3b0775d174efe899", + "0xd3b5306893dc4ce1", + "0xaa0800144f846b8", + "0x73ca4134ac04ce06", + "0x8a77b72d70eb37a9", + "0xacd0554ca3b91104", + "0xa0f25962fc91ed4f", + "0x876b309aa39be0b3", + "0x591938a3cd5995be", + "0x4ba3f3e5d6246d61", + "0xa181627de4401423" + ] + ] + } + ] + } + ], + "storages": [ + { + "address": ["0x5d89d5862ca7e8af", "0x36b7d426ab6d61d6", "0x2f4722cf"], + "slot": ["0x0", "0x0", "0x0", "0x1000000000000000"], + "storage_key": "0x1b6847dc741a1b0cd08d278845f9d819d87b734759afb55fe2de5cb82a9ae672", + "proofs": [ + { + "block_number": 6375109, + "proof_bytes_len": [532, 83, 69], + "proof": [ + [ + "0xdaaaa563a01102f9", + "0x53733b89af92fdbc", + "0x227bd6cee31ca3e9", + "0x336db59681c1265b", + "0x7d7780a0509e595e", + "0x7310f9ca15df6350", + "0x2cabd610c8b53725", + "0xadbb21b0304fb72e", + "0xebda0d73dfe99f7", + "0x9ca6efeaf56b9b49", + "0xbc955048ac3d5fe2", + "0xcc33f505be97fb68", + "0xf2a0bc4d1ca2189d", + "0xd6fec3fed9cc776e", + "0x2cdfad8829638de5", + "0xb45659b7b4880241", + "0xa0b2c0c42a8b68fa", + "0x124ea6c73242e630", + "0x980e5879cc375472", + "0xcee0f874c5686418", + "0x969bcca76c6785d0", + "0x2df84ea10d9388a0", + "0xb82c15fe0e46f64a", + "0x984ecc65972203c3", + "0xcc4050165d2c602e", + "0xa7e41fa0d715a056", + "0x4b56009614424972", + "0xfdc53ee84e7e95fd", + "0x2dea4431fe1070d1", + "0xc864595a66a0e3f4", + "0xd17f80d096431b16", + "0xb51f6788c53e6caa", + "0x60ed6c03838c7510", + "0x39067cd5a0ce9ea9", + "0xb62a0e234fd40583", + "0x72e16ce793841c85", + "0x35322107af4919fa", + "0xf9272da039bdc793", + "0xd7d2f60de50aa21d", + "0x961d1a598e8c03b6", + "0x67df3a6bb55d1a9b", + "0xf8e1a0e89a0e6d62", + "0x3ede8e86c0e4dfdd", + "0xd8befa2a92c3ff26", + "0x3e13839c33dfae35", + "0x8ba06ee1a9e3ab0a", + "0x7c9ef401225bf5f3", + "0x4b8ac462c655ceff", + "0x1feec82f659f9b5b", + "0xa041d35933716a17", + "0xabad1dc62c18c692", + "0x936b6b57f845b3f7", + "0xfbd1e711de6e6536", + "0xa6014cee1d92b9f0", + "0x8bd8fb8e3eabfa0", + "0xba8bf46a6a1b7a92", + "0xa2a4e0cb613e9f70", + "0xf77aa9d38589e6a7", + "0x4062ee9d1fe3a033", + "0xba2bc68979de97bf", + "0xbdaf7bfec356fb9a", + "0x18c3a4aa9f3c07ef", + "0x1dcbed5fbba0aa9d", + "0x81f5631f4cb93054", + "0x406b742b1184064e", + "0x9e1d337f94beb2e8", + "0x80456c83" + ], + [ + "0x80808080808051f8", + "0xb8b52a1f7ea08080", + "0x7e61781d2a5e06f2", + "0xc001b39cbb1985d0", + "0x66be391c1b432d93", + "0x3beca0808097599d", + "0x54112b4e9235e5e3", + "0xa1558e7687ac1dab", + "0x818b16e5a58051e1", + "0x80809b39735f0bf6", + "0x808080" + ], + [ + "0x74dc476820a043f8", + "0x4588278dd00c1b1a", + "0x5947737bd819d8f9", + "0x2ab85cdee25fb5af", + "0x736e49a0a172e69a", + "0x7473655420656469", + "0x656d616e20", + "0x0", + "0x2000000000" + ] + ] + } + ] + } + ], + "transactions": [], + "transaction_receipts": [] + } + ], + "tasks": [ + { + "type": "datalake_compute", + "context": { + "task_bytes_len": 128, + "encoded_task": [ + "0xb7d65362098af8fc", + "0xbb9ce9daf3acf4f", + "0x7764468b86369c36", + "0xfefccffceae47099", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0" + ], + "datalake_bytes_len": 288, + "encoded_datalake": [ + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0xa736aa0000000000", + "0x0", + "0x0", + "0x0", + "0xc546610000000000", + "0x0", + "0x0", + "0x0", + "0xc546610000000000", + "0x0", + "0x0", + "0x0", + "0x100000000000000", + "0x0", + "0x0", + "0x0", + "0xc000000000000000", + "0x0", + "0x0", + "0x0", + "0x3500000000000000", + "0x89d5862ca7e8af03", + "0xb7d426ab6d61d65d", + "0x2f4722cf36", + "0x0", + "0x0", + "0x0", + "0x1000000000", + "0x0" + ], + "datalake_type": 0, + "property_type": 3 + } + } + ] +} From cb07d562a0ab6e57ab8f39bea8eb595c6711d1a3 Mon Sep 17 00:00:00 2001 From: Pia Date: Thu, 12 Sep 2024 14:50:41 +0900 Subject: [PATCH 14/29] mmr id temp fix --- hdp/src/preprocessor/compile/module.rs | 2 +- hdp/src/primitives/processed_types/mmr.rs | 10 ++---- hdp/src/provider/evm/from_keys.rs | 4 +-- hdp/src/provider/evm/provider.rs | 2 +- input.json | 43 ++++++++++++++++++----- 5 files changed, 41 insertions(+), 20 deletions(-) diff --git a/hdp/src/preprocessor/compile/module.rs b/hdp/src/preprocessor/compile/module.rs index 5e907916..34471c19 100644 --- a/hdp/src/preprocessor/compile/module.rs +++ b/hdp/src/preprocessor/compile/module.rs @@ -85,7 +85,7 @@ impl Compilable for ModuleVec { // TODO : need fix let compiled_result = CompilationResult::new( - 1, + 11155111, commit_results_maps, mmr_header_map, accounts, diff --git a/hdp/src/primitives/processed_types/mmr.rs b/hdp/src/primitives/processed_types/mmr.rs index 8bd1a4d3..19aef186 100644 --- a/hdp/src/primitives/processed_types/mmr.rs +++ b/hdp/src/primitives/processed_types/mmr.rs @@ -1,6 +1,6 @@ use serde::{Deserialize, Serialize}; -use crate::primitives::{block::header::MMRMetaFromNewIndexer, utils::hex_string_to_uint, ChainId}; +use crate::primitives::{block::header::MMRMetaFromNewIndexer, utils::hex_string_to_uint}; #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Eq, Hash)] pub struct MMRMeta { @@ -9,29 +9,26 @@ pub struct MMRMeta { pub size: u64, // hex encoded pub peaks: Vec, - pub chain_id: u128, } impl MMRMeta { - pub fn new(id: u64, root: String, size: u64, peaks: Vec, chain_id: u128) -> Self { + pub fn new(id: u64, root: String, size: u64, peaks: Vec) -> Self { MMRMeta { id, root, size, peaks, - chain_id, } } } impl MMRMeta { - pub fn from_indexer(val: MMRMetaFromNewIndexer, chain_id: ChainId) -> Self { + pub fn from_indexer(val: MMRMetaFromNewIndexer) -> Self { MMRMeta { id: hex_string_to_uint(&val.mmr_id), root: val.mmr_root, size: val.mmr_size, peaks: val.mmr_peaks, - chain_id: chain_id.to_numeric_id(), } } } @@ -61,7 +58,6 @@ mod tests { "0x66c82fce8bfc291095c6c9255b1f7ccf725a1e91e8ae8cd8c43ceb111c21480".to_string(), "0x2e5274895f9cd556bb8dee5b2551e9cda9aa3caa23532f9824abcc62d5ad273".to_string(), ], - 11155111, ); let processed_string = include_str!("../../../../fixtures/primitives/mmr.json"); diff --git a/hdp/src/provider/evm/from_keys.rs b/hdp/src/provider/evm/from_keys.rs index 671f3c2a..7697b065 100644 --- a/hdp/src/provider/evm/from_keys.rs +++ b/hdp/src/provider/evm/from_keys.rs @@ -83,7 +83,7 @@ impl EvmProvider { self._chunk_vec_blocks_for_indexer(block_range) }; - let chain_id = keys.iter().next().unwrap().chain_id; + // let chain_id = keys.iter().next().unwrap().chain_id; let mut fetched_headers_proofs: HashMap> = HashMap::new(); let real_target_blocks = keys.iter().map(|x| x.block_number).collect::>(); @@ -111,7 +111,7 @@ impl EvmProvider { .collect(); let fetched_mmr = indexer_response.mmr_meta; - let mmr_meta = MMRMeta::from_indexer(fetched_mmr, chain_id); + let mmr_meta = MMRMeta::from_indexer(fetched_mmr); fetched_headers_proofs .entry(mmr_meta) .and_modify(|existing_headers| { diff --git a/hdp/src/provider/evm/provider.rs b/hdp/src/provider/evm/provider.rs index 5715a28e..385221b8 100644 --- a/hdp/src/provider/evm/provider.rs +++ b/hdp/src/provider/evm/provider.rs @@ -103,7 +103,7 @@ impl EvmProvider { .get_headers_proof(start_block, end_block) .await?; let fetched_mmr = indexer_response.mmr_meta; - let mmr_meta = MMRMeta::from_indexer(fetched_mmr, self.header_provider.chain_id); + let mmr_meta = MMRMeta::from_indexer(fetched_mmr); // TODO lets think how not clone the mmr_meta fetched_headers_proofs_with_blocks_map.extend( diff --git a/input.json b/input.json index d9f3a9f2..6a82cc30 100644 --- a/input.json +++ b/input.json @@ -4,7 +4,7 @@ "result_root": "0x34b46123c4ab406cec0586364d8ed193353f0e9fb1b32cac0988fc0970dc50a2", "proofs": [ { - "chain_id": 11155111, + "chain_id": 1, "mmr_with_headers": [ { "mmr_meta": { @@ -23,8 +23,7 @@ "0x5f3202e8d32391896022ddb916b83f165d2d7486261304f3e029aad6258ba2c", "0x3a98faad3cc3bdeee0f2a346469fe4e67d364c98f8f5adf03f472000194081c", "0x48bb57587a1e690409d81b70f3fe2ee625f25f008ec0773e55a0e1293c9e025" - ], - "chain_id": 11155111 + ] }, "headers": [ { @@ -135,12 +134,25 @@ ], "accounts": [ { - "address": ["0x5d89d5862ca7e8af", "0x36b7d426ab6d61d6", "0x2f4722cf"], + "address": [ + "0x5d89d5862ca7e8af", + "0x36b7d426ab6d61d6", + "0x2f4722cf" + ], "account_key": "0x7fd6daf0de598ff611452d8eb4ec5f7e99e8ef74d175073be14cdc936830b5d3", "proofs": [ { "block_number": 6375109, - "proof_bytes_len": [532, 532, 532, 532, 532, 404, 83, 104], + "proof_bytes_len": [ + 532, + 532, + 532, + 532, + 532, + 404, + 83, + 104 + ], "proof": [ [ "0x444e529da01102f9", @@ -575,13 +587,26 @@ ], "storages": [ { - "address": ["0x5d89d5862ca7e8af", "0x36b7d426ab6d61d6", "0x2f4722cf"], - "slot": ["0x0", "0x0", "0x0", "0x1000000000000000"], + "address": [ + "0x5d89d5862ca7e8af", + "0x36b7d426ab6d61d6", + "0x2f4722cf" + ], + "slot": [ + "0x0", + "0x0", + "0x0", + "0x1000000000000000" + ], "storage_key": "0x1b6847dc741a1b0cd08d278845f9d819d87b734759afb55fe2de5cb82a9ae672", "proofs": [ { "block_number": 6375109, - "proof_bytes_len": [532, 83, 69], + "proof_bytes_len": [ + 532, + 83, + 69 + ], "proof": [ [ "0xdaaaa563a01102f9", @@ -752,4 +777,4 @@ } } ] -} +} \ No newline at end of file From 79ed345ab519d9998d0815ab8efbf4bbd7425d45 Mon Sep 17 00:00:00 2001 From: Pia Date: Thu, 12 Sep 2024 15:28:56 +0900 Subject: [PATCH 15/29] clone issue --- .github/workflows/fixtures.yml | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/.github/workflows/fixtures.yml b/.github/workflows/fixtures.yml index fce67c79..db92973c 100644 --- a/.github/workflows/fixtures.yml +++ b/.github/workflows/fixtures.yml @@ -29,23 +29,14 @@ jobs: run: | cargo install --locked -f --path cli/ - - name: Clone and setup hdp-test repository + - name: Clone hdp-test repository run: | - git clone https://x-access-token:${{ secrets.REPO_ACCESS_TOKEN }}@github.com/HerodotusDev/hdp-test.git hdp-test + git clone -b ${{ github.ref_name }} https://x-access-token:${{ secrets.REPO_ACCESS_TOKEN }}@github.com/HerodotusDev/hdp-test.git hdp-test || git clone https://x-access-token:${{ secrets.REPO_ACCESS_TOKEN }}@github.com/HerodotusDev/hdp-test.git hdp-test cd hdp-test + git checkout -b ${{ github.ref_name }} || git checkout ${{ github.ref_name }} git config user.name github-actions git config user.email github-actions@github.com - # Check if branch exists on remote - if git ls-remote --exit-code --heads origin ${{ github.ref_name }} >/dev/null 2>&1; then - echo "Branch ${{ github.ref_name }} exists on remote, checking out" - git checkout ${{ github.ref_name }} - else - echo "Branch ${{ github.ref_name }} does not exist on remote, creating from main" - git checkout main - git checkout -b ${{ github.ref_name }} - fi - - name: Generate .env file run: | cd hdp-test From d8ce15bd0febba1f80948aa6377fa88b12e6f3f0 Mon Sep 17 00:00:00 2001 From: Pia Date: Thu, 12 Sep 2024 15:55:56 +0900 Subject: [PATCH 16/29] update, also temp --- hdp/src/preprocessor/compile/mod.rs | 23 +++++++++++++------ hdp/src/preprocessor/compile/module.rs | 7 +++--- hdp/src/preprocessor/mod.rs | 9 ++++---- .../provider/evm/datalake/block_sampled.rs | 7 +++--- hdp/src/provider/evm/datalake/transactions.rs | 6 ++--- hdp/src/provider/types.rs | 9 ++++---- input.json | 2 +- 7 files changed, 36 insertions(+), 27 deletions(-) diff --git a/hdp/src/preprocessor/compile/mod.rs b/hdp/src/preprocessor/compile/mod.rs index 2d618e40..68d66f72 100644 --- a/hdp/src/preprocessor/compile/mod.rs +++ b/hdp/src/preprocessor/compile/mod.rs @@ -2,12 +2,15 @@ use alloy::primitives::U256; use config::CompilerConfig; -use std::collections::{HashMap, HashSet}; +use std::collections::HashSet; use thiserror::Error; +use crate::primitives::processed_types::block_proofs::{ + convert_to_mmr_meta_set, convert_to_mmr_with_headers, MMRWithHeader, +}; use crate::primitives::processed_types::{ - account::ProcessedAccount, header::ProcessedHeader, mmr::MMRMeta, receipt::ProcessedReceipt, - storage::ProcessedStorage, transaction::ProcessedTransaction, + account::ProcessedAccount, receipt::ProcessedReceipt, storage::ProcessedStorage, + transaction::ProcessedTransaction, }; use crate::provider::error::ProviderError; @@ -56,7 +59,7 @@ pub struct CompilationResult { /// results of tasks pub task_results: Vec, /// mmr_with_headers related to the datalake - pub mmr_with_headers: HashMap>, + pub mmr_with_headers: HashSet, /// Accounts related to the datalake pub accounts: HashSet, /// Storages related to the datalake @@ -71,7 +74,7 @@ impl CompilationResult { pub fn new( chain_id: u128, task_results: Vec, - mmr_with_headers: HashMap>, + mmr_with_headers: HashSet, accounts: HashSet, storages: HashSet, transactions: HashSet, @@ -90,12 +93,18 @@ impl CompilationResult { /// Extend the current compilation results with another compilation results pub fn extend(&mut self, other: CompilationResult) { - for (mmr_meta, headers) in other.mmr_with_headers { - self.mmr_with_headers + let others_mmr_with_headers_set = + convert_to_mmr_meta_set(Vec::from_iter(other.mmr_with_headers)); + let mut self_mmr_with_headers_set = + convert_to_mmr_meta_set(Vec::from_iter(self.mmr_with_headers.clone())); + for (mmr_meta, headers) in others_mmr_with_headers_set { + self_mmr_with_headers_set .entry(mmr_meta) .or_default() .extend(headers); } + self.mmr_with_headers = + HashSet::from_iter(convert_to_mmr_with_headers(self_mmr_with_headers_set)); self.accounts.extend(other.accounts); self.storages.extend(other.storages); self.transactions.extend(other.transactions); diff --git a/hdp/src/preprocessor/compile/module.rs b/hdp/src/preprocessor/compile/module.rs index 34471c19..0fac79f1 100644 --- a/hdp/src/preprocessor/compile/module.rs +++ b/hdp/src/preprocessor/compile/module.rs @@ -5,14 +5,13 @@ use crate::cairo_runner::dry_run::DryRunResult; use crate::cairo_runner::{cairo_dry_run, input::dry_run::DryRunnerProgramInput}; use crate::constant::DRY_CAIRO_RUN_OUTPUT_FILE; -use crate::primitives::processed_types::block_proofs::convert_to_mmr_meta_set; use crate::primitives::processed_types::cairo_format; use crate::primitives::task::ExtendedModule; use crate::provider::key::categorize_fetch_keys; use crate::provider::traits::new_provider_from_config; use core::panic; -use std::collections::{HashMap, HashSet}; +use std::collections::HashSet; use std::path::PathBuf; use tracing::info; @@ -63,7 +62,7 @@ impl Compilable for ModuleVec { let mut storages = HashSet::new(); let mut transactions = HashSet::new(); let mut transaction_receipts = HashSet::new(); - let mut mmr_header_map = HashMap::new(); + let mut mmr_header_map = HashSet::new(); info!("3. Fetching proofs from provider..."); for (chain_id, keys) in keys_maps_chain { @@ -76,7 +75,7 @@ impl Compilable for ModuleVec { let results = provider.fetch_proofs_from_keys(keys).await?; // TODO: can we do better? - mmr_header_map.extend(convert_to_mmr_meta_set(results.mmr_with_headers)); + mmr_header_map.extend(results.mmr_with_headers.into_iter()); accounts.extend(results.accounts.into_iter()); storages.extend(results.storages.into_iter()); transactions.extend(results.transactions.into_iter()); diff --git a/hdp/src/preprocessor/mod.rs b/hdp/src/preprocessor/mod.rs index eeb76b4f..2c21e4c5 100644 --- a/hdp/src/preprocessor/mod.rs +++ b/hdp/src/preprocessor/mod.rs @@ -3,9 +3,7 @@ use crate::constant::SOUND_CAIRO_RUN_OUTPUT_FILE; use crate::primitives::merkle_tree::{build_result_merkle_tree, build_task_merkle_tree}; -use crate::primitives::processed_types::block_proofs::{ - convert_to_mmr_with_headers, ProcessedBlockProofs, -}; +use crate::primitives::processed_types::block_proofs::ProcessedBlockProofs; use crate::primitives::processed_types::datalake_compute::ProcessedDatalakeCompute; use crate::primitives::processed_types::module::ProcessedModule; use crate::primitives::processed_types::query::ProcessorInput; @@ -121,9 +119,10 @@ impl PreProcessor { } } + // TODO: this chain id need to be fix let proofs = ProcessedBlockProofs { - chain_id: 1, - mmr_with_headers: convert_to_mmr_with_headers(compiled_results.mmr_with_headers), + chain_id: 11155111, + mmr_with_headers: Vec::from_iter(compiled_results.mmr_with_headers), accounts: Vec::from_iter(compiled_results.accounts), storages: Vec::from_iter(compiled_results.storages), transactions: Vec::from_iter(compiled_results.transactions), diff --git a/hdp/src/provider/evm/datalake/block_sampled.rs b/hdp/src/provider/evm/datalake/block_sampled.rs index 68291848..f3ffee92 100644 --- a/hdp/src/provider/evm/datalake/block_sampled.rs +++ b/hdp/src/provider/evm/datalake/block_sampled.rs @@ -2,8 +2,9 @@ use crate::{ primitives::{ block::account::Account, processed_types::{ - account::ProcessedAccount, header::ProcessedHeader, mmr::MMRMeta, - mpt::ProcessedMPTProof, storage::ProcessedStorage, + account::ProcessedAccount, block_proofs::convert_to_mmr_with_headers, + header::ProcessedHeader, mmr::MMRMeta, mpt::ProcessedMPTProof, + storage::ProcessedStorage, }, task::datalake::{ block_sampled::{BlockSampledCollection, BlockSampledDatalake}, @@ -159,7 +160,7 @@ impl EvmProvider { Ok(FetchedDatalake { values: aggregation_set, - mmr_with_headers, + mmr_with_headers: HashSet::from_iter(convert_to_mmr_with_headers(mmr_with_headers)), accounts, storages, transactions: HashSet::new(), diff --git a/hdp/src/provider/evm/datalake/transactions.rs b/hdp/src/provider/evm/datalake/transactions.rs index bab5ce7d..e8eb6340 100644 --- a/hdp/src/provider/evm/datalake/transactions.rs +++ b/hdp/src/provider/evm/datalake/transactions.rs @@ -1,8 +1,8 @@ use crate::{ primitives::{ processed_types::{ - header::ProcessedHeader, mmr::MMRMeta, receipt::ProcessedReceipt, - transaction::ProcessedTransaction, + block_proofs::convert_to_mmr_with_headers, header::ProcessedHeader, mmr::MMRMeta, + receipt::ProcessedReceipt, transaction::ProcessedTransaction, }, task::datalake::{ transactions::{TransactionsCollection, TransactionsInBlockDatalake}, @@ -94,7 +94,7 @@ impl EvmProvider { Ok(FetchedDatalake { values: aggregation_set, - mmr_with_headers, + mmr_with_headers: HashSet::from_iter(convert_to_mmr_with_headers(mmr_with_headers)), accounts: HashSet::new(), storages: HashSet::new(), transactions, diff --git a/hdp/src/provider/types.rs b/hdp/src/provider/types.rs index 42b0c8e3..836a4a66 100644 --- a/hdp/src/provider/types.rs +++ b/hdp/src/provider/types.rs @@ -3,11 +3,12 @@ //! //! We need this type to bind encoded transaction and receipts to the block number and proofs. -use std::collections::{HashMap, HashSet}; +use std::collections::HashSet; +use crate::primitives::processed_types::block_proofs::MMRWithHeader; use crate::primitives::processed_types::{ - account::ProcessedAccount, header::ProcessedHeader, mmr::MMRMeta, receipt::ProcessedReceipt, - storage::ProcessedStorage, transaction::ProcessedTransaction, + account::ProcessedAccount, receipt::ProcessedReceipt, storage::ProcessedStorage, + transaction::ProcessedTransaction, }; use alloy::primitives::U256; @@ -74,7 +75,7 @@ pub struct FetchedDatalake { /// Targeted datalake's compiled results pub values: Vec, /// mmr_with_headers related to the datalake - pub mmr_with_headers: HashMap>, + pub mmr_with_headers: HashSet, /// Accounts related to the datalake pub accounts: HashSet, /// Storages related to the datalake diff --git a/input.json b/input.json index 6a82cc30..ca59551b 100644 --- a/input.json +++ b/input.json @@ -4,7 +4,7 @@ "result_root": "0x34b46123c4ab406cec0586364d8ed193353f0e9fb1b32cac0988fc0970dc50a2", "proofs": [ { - "chain_id": 1, + "chain_id": 11155111, "mmr_with_headers": [ { "mmr_meta": { From ba91c3ac37ea6ec4f98848e4351870673595fd16 Mon Sep 17 00:00:00 2001 From: Pia Date: Thu, 12 Sep 2024 17:51:25 +0900 Subject: [PATCH 17/29] fix: beneficiary --- hdp/src/primitives/task/datalake/block_sampled/rlp_fields.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hdp/src/primitives/task/datalake/block_sampled/rlp_fields.rs b/hdp/src/primitives/task/datalake/block_sampled/rlp_fields.rs index 138f6333..77d3ffeb 100644 --- a/hdp/src/primitives/task/datalake/block_sampled/rlp_fields.rs +++ b/hdp/src/primitives/task/datalake/block_sampled/rlp_fields.rs @@ -138,9 +138,7 @@ impl DatalakeField for HeaderField { match self { HeaderField::ParentHash => decoded.parent_hash.into(), HeaderField::OmmerHash => decoded.ommers_hash.into(), - HeaderField::Beneficiary => { - U256::from_str_radix(&decoded.beneficiary.to_string(), 16).unwrap() - } + HeaderField::Beneficiary => decoded.beneficiary.into_word().into(), HeaderField::StateRoot => decoded.state_root.into(), HeaderField::TransactionsRoot => decoded.transactions_root.into(), HeaderField::ReceiptsRoot => decoded.receipts_root.into(), From 314b45ac350ee3856da03752b8e8b873af90cb58 Mon Sep 17 00:00:00 2001 From: Pia Date: Fri, 13 Sep 2024 13:22:32 +0900 Subject: [PATCH 18/29] rm trait --- hdp/src/preprocessor/compile/datalake.rs | 62 +++++----- hdp/src/preprocessor/compile/mod.rs | 39 ++++++ hdp/src/preprocessor/compile/module.rs | 146 +++++++++++------------ hdp/src/preprocessor/compile/task.rs | 46 +++---- hdp/src/preprocessor/mod.rs | 6 +- 5 files changed, 167 insertions(+), 132 deletions(-) diff --git a/hdp/src/preprocessor/compile/datalake.rs b/hdp/src/preprocessor/compile/datalake.rs index cb80d4cb..b31271f2 100644 --- a/hdp/src/preprocessor/compile/datalake.rs +++ b/hdp/src/preprocessor/compile/datalake.rs @@ -5,37 +5,35 @@ use tracing::{debug, info}; use super::{config::CompilerConfig, Compilable, CompilationResult, CompileError}; -impl Compilable for DatalakeCompute { - async fn compile( - &self, - compile_config: &CompilerConfig, - ) -> Result { - info!("target task: {:#?}", self); - // ========== datalake ============== - let target_provider_config = compile_config - .provider_config - .get(&self.datalake.get_chain_id()) - .expect("target task's chain had not been configured."); - let provider = new_provider_from_config(target_provider_config); - let compiled_block_sampled = provider.fetch_proofs(self).await?; - debug!("values to aggregate : {:#?}", compiled_block_sampled.values); - - // ========== compute ============== - let aggregation_fn = &self.compute.aggregate_fn_id; - let fn_context = &self.compute.aggregate_fn_ctx; - let aggregated_result = - aggregation_fn.operation(&compiled_block_sampled.values, Some(fn_context.clone()))?; - - Ok(CompilationResult::new( - self.datalake.get_chain_id().to_numeric_id(), - vec![aggregated_result], - compiled_block_sampled.mmr_with_headers, - compiled_block_sampled.accounts, - compiled_block_sampled.storages, - compiled_block_sampled.transactions, - compiled_block_sampled.transaction_receipts, - )) - } +pub async fn compile_datalake( + datalake: &DatalakeCompute, + compile_config: &CompilerConfig, +) -> Result { + info!("target task: {:#?}", datalake); + // ========== datalake ============== + let target_provider_config = compile_config + .provider_config + .get(&datalake.datalake.get_chain_id()) + .expect("target task's chain had not been configured."); + let provider = new_provider_from_config(target_provider_config); + let compiled_block_sampled = provider.fetch_proofs(datalake).await?; + debug!("values to aggregate : {:#?}", compiled_block_sampled.values); + + // ========== compute ============== + let aggregation_fn = &datalake.compute.aggregate_fn_id; + let fn_context = &datalake.compute.aggregate_fn_ctx; + let aggregated_result = + aggregation_fn.operation(&compiled_block_sampled.values, Some(fn_context.clone()))?; + + Ok(CompilationResult::new( + datalake.datalake.get_chain_id().to_numeric_id(), + vec![aggregated_result], + compiled_block_sampled.mmr_with_headers, + compiled_block_sampled.accounts, + compiled_block_sampled.storages, + compiled_block_sampled.transactions, + compiled_block_sampled.transaction_receipts, + )) } pub type DatalakeComputeVec = Vec; @@ -48,7 +46,7 @@ impl Compilable for DatalakeComputeVec { let mut final_results = CompilationResult::default(); for datalake_compute in self { - let current_results = datalake_compute.compile(compile_config).await?; + let current_results = compile_datalake(datalake_compute, compile_config).await?; final_results.extend(current_results); } diff --git a/hdp/src/preprocessor/compile/mod.rs b/hdp/src/preprocessor/compile/mod.rs index 68d66f72..e54d993d 100644 --- a/hdp/src/preprocessor/compile/mod.rs +++ b/hdp/src/preprocessor/compile/mod.rs @@ -112,3 +112,42 @@ impl CompilationResult { self.task_results.extend(other.task_results); } } + +#[derive(Debug, Default, PartialEq)] +pub struct DatalakeCompileResult { + pub chain_id: u128, + /// results of tasks + pub task_results: Vec, + /// mmr_with_headers related to the datalake + pub mmr_with_headers: HashSet, + /// Accounts related to the datalake + pub accounts: HashSet, + /// Storages related to the datalake + pub storages: HashSet, + /// Transactions related to the datalake + pub transactions: HashSet, + /// Transaction receipts related to the datalake + pub transaction_receipts: HashSet, +} + +impl DatalakeCompileResult { + pub fn new( + chain_id: u128, + task_results: Vec, + mmr_with_headers: HashSet, + accounts: HashSet, + storages: HashSet, + transactions: HashSet, + transaction_receipts: HashSet, + ) -> Self { + Self { + chain_id, + task_results, + mmr_with_headers, + accounts, + storages, + transactions, + transaction_receipts, + } + } +} diff --git a/hdp/src/preprocessor/compile/module.rs b/hdp/src/preprocessor/compile/module.rs index 0fac79f1..0d21cc47 100644 --- a/hdp/src/preprocessor/compile/module.rs +++ b/hdp/src/preprocessor/compile/module.rs @@ -16,84 +16,82 @@ use std::path::PathBuf; use tracing::info; use super::config::CompilerConfig; -use super::{Compilable, CompilationResult, CompileError}; +use super::{CompilationResult, CompileError}; pub type ModuleVec = Vec; -impl Compilable for ModuleVec { - async fn compile( - &self, - compile_config: &CompilerConfig, - ) -> Result { - info!("target task: {:#?}", self[0].task); - let dry_run_program_path = compile_config.dry_run_program_path.clone(); - - let input = generate_input(self.to_vec(), PathBuf::from(DRY_CAIRO_RUN_OUTPUT_FILE)).await?; - let input_string = - serde_json::to_string_pretty(&input).expect("Failed to serialize module class"); - - // 2. run the dry run and get the fetch points - info!("2. Running dry-run... "); - let keys: DryRunResult = cairo_dry_run( - dry_run_program_path, - input_string, - compile_config.save_fetch_keys_file.clone(), - )?; - - if keys[0].program_hash != self[0].task.program_hash { - return Err(CompileError::ClassHashMismatch); - } - - if keys.len() != 1 { - panic!("Multiple Modules are not supported"); - } - - let dry_runned_module = keys.into_iter().next().unwrap(); - let commit_results_maps = vec![dry_runned_module.result.to_combined_string().into()]; - - // 3. call provider using keys - let keys_maps_chain = categorize_fetch_keys(dry_runned_module.fetch_keys); - if keys_maps_chain.len() > 1 { - // TODO: This is temporary solution. Need to handle multiple chain id in future - panic!("Multiple chain id is not supported yet"); - } - - let mut accounts = HashSet::new(); - let mut storages = HashSet::new(); - let mut transactions = HashSet::new(); - let mut transaction_receipts = HashSet::new(); - let mut mmr_header_map = HashSet::new(); - - info!("3. Fetching proofs from provider..."); - for (chain_id, keys) in keys_maps_chain { - info!("target provider chain id: {}", chain_id); - let target_provider_config = compile_config - .provider_config - .get(&chain_id) - .expect("target task's chain had not been configured."); - let provider = new_provider_from_config(target_provider_config); - let results = provider.fetch_proofs_from_keys(keys).await?; - - // TODO: can we do better? - mmr_header_map.extend(results.mmr_with_headers.into_iter()); - accounts.extend(results.accounts.into_iter()); - storages.extend(results.storages.into_iter()); - transactions.extend(results.transactions.into_iter()); - transaction_receipts.extend(results.transaction_receipts.into_iter()); - } - - // TODO : need fix - let compiled_result = CompilationResult::new( - 11155111, - commit_results_maps, - mmr_header_map, - accounts, - storages, - transactions, - transaction_receipts, - ); - Ok(compiled_result) +pub async fn compile_modules( + modules: ModuleVec, + compile_config: &CompilerConfig, +) -> Result { + info!("target task: {:#?}", modules[0].task); + let dry_run_program_path = compile_config.dry_run_program_path.clone(); + + let input = generate_input(modules.to_vec(), PathBuf::from(DRY_CAIRO_RUN_OUTPUT_FILE)).await?; + let input_string = + serde_json::to_string_pretty(&input).expect("Failed to serialize module class"); + + // 2. run the dry run and get the fetch points + info!("2. Running dry-run... "); + let keys: DryRunResult = cairo_dry_run( + dry_run_program_path, + input_string, + compile_config.save_fetch_keys_file.clone(), + )?; + + if keys[0].program_hash != modules[0].task.program_hash { + return Err(CompileError::ClassHashMismatch); } + + if keys.len() != 1 { + panic!("Multiple Modules are not supported"); + } + + let dry_runned_module = keys.into_iter().next().unwrap(); + let commit_results_maps = vec![dry_runned_module.result.to_combined_string().into()]; + + // 3. call provider using keys + let keys_maps_chain = categorize_fetch_keys(dry_runned_module.fetch_keys); + if keys_maps_chain.len() > 1 { + // TODO: This is temporary solution. Need to handle multiple chain id in future + panic!("Multiple chain id is not supported yet"); + } + + let mut accounts = HashSet::new(); + let mut storages = HashSet::new(); + let mut transactions = HashSet::new(); + let mut transaction_receipts = HashSet::new(); + let mut mmr_header_map = HashSet::new(); + + info!("3. Fetching proofs from provider..."); + for (chain_id, keys) in keys_maps_chain { + info!("target provider chain id: {}", chain_id); + let target_provider_config = compile_config + .provider_config + .get(&chain_id) + .expect("target task's chain had not been configured."); + let provider = new_provider_from_config(target_provider_config); + let results = provider.fetch_proofs_from_keys(keys).await?; + + // TODO: can we do better? + mmr_header_map.extend(results.mmr_with_headers.into_iter()); + accounts.extend(results.accounts.into_iter()); + storages.extend(results.storages.into_iter()); + transactions.extend(results.transactions.into_iter()); + transaction_receipts.extend(results.transaction_receipts.into_iter()); + } + + // TODO : need fix + let compiled_result = CompilationResult::new( + 11155111, + commit_results_maps, + mmr_header_map, + accounts, + storages, + transactions, + transaction_receipts, + ); + Ok(compiled_result) } /// Generate input structure for preprocessor that need to pass to runner diff --git a/hdp/src/preprocessor/compile/task.rs b/hdp/src/preprocessor/compile/task.rs index 34801865..95bcfe2f 100644 --- a/hdp/src/preprocessor/compile/task.rs +++ b/hdp/src/preprocessor/compile/task.rs @@ -1,29 +1,29 @@ use crate::primitives::task::TaskEnvelope; -use super::{config::CompilerConfig, Compilable, CompilationResult, CompileError}; +use super::{ + config::CompilerConfig, module::compile_modules, Compilable, CompilationResult, CompileError, +}; -impl Compilable for Vec { - async fn compile( - &self, - compile_config: &CompilerConfig, - ) -> Result { - let (datalakes, modules) = TaskEnvelope::divide_tasks(self.to_vec()); - let mut compiled_result = if !datalakes.is_empty() { - datalakes.compile(compile_config).await? - } else { - CompilationResult::default() - }; +pub async fn compile_tasks( + tasks: &[TaskEnvelope], + compile_config: &CompilerConfig, +) -> Result { + let (datalakes, modules) = TaskEnvelope::divide_tasks(tasks.to_vec()); + let mut compiled_result = if !datalakes.is_empty() { + datalakes.compile(compile_config).await? + } else { + CompilationResult::default() + }; - let module_compile_result = if !modules.is_empty() { - modules.compile(compile_config).await? - } else { - CompilationResult::default() - }; - compiled_result.extend(module_compile_result); - if compiled_result == CompilationResult::default() { - Err(CompileError::CompilationFailed) - } else { - Ok(compiled_result) - } + let module_compile_result = if !modules.is_empty() { + compile_modules(modules, compile_config).await? + } else { + CompilationResult::default() + }; + compiled_result.extend(module_compile_result); + if compiled_result == CompilationResult::default() { + Err(CompileError::CompilationFailed) + } else { + Ok(compiled_result) } } diff --git a/hdp/src/preprocessor/mod.rs b/hdp/src/preprocessor/mod.rs index 2c21e4c5..fd3f62ab 100644 --- a/hdp/src/preprocessor/mod.rs +++ b/hdp/src/preprocessor/mod.rs @@ -13,7 +13,8 @@ use crate::primitives::task::TaskEnvelope; use alloy::dyn_abi::DynSolValue; use alloy::primitives::{Bytes, B256}; use compile::config::CompilerConfig; -use compile::{Compilable, CompileError}; +use compile::task::compile_tasks; +use compile::CompileError; use thiserror::Error; use tracing::{debug, info}; @@ -49,8 +50,7 @@ impl PreProcessor { tasks: Vec, ) -> Result { // 1. compile the given tasks - let compiled_results = tasks - .compile(&self.compile_config) + let compiled_results = compile_tasks(&tasks, &self.compile_config) .await .map_err(PreProcessorError::CompileError)?; From 9b130c42d0039de3e7d9c880609bf49191b0c6c2 Mon Sep 17 00:00:00 2001 From: Pia Date: Fri, 13 Sep 2024 14:10:53 +0900 Subject: [PATCH 19/29] refact: handle multi chain --- hdp/src/preprocessor/compile/datalake.rs | 8 +- hdp/src/preprocessor/compile/mod.rs | 147 +-- hdp/src/preprocessor/compile/module.rs | 40 +- hdp/src/preprocessor/mod.rs | 12 +- input.json | 1184 +++++++++++++++++++++- request.json | 14 + 6 files changed, 1311 insertions(+), 94 deletions(-) diff --git a/hdp/src/preprocessor/compile/datalake.rs b/hdp/src/preprocessor/compile/datalake.rs index b31271f2..c26533c0 100644 --- a/hdp/src/preprocessor/compile/datalake.rs +++ b/hdp/src/preprocessor/compile/datalake.rs @@ -25,7 +25,7 @@ pub async fn compile_datalake( let aggregated_result = aggregation_fn.operation(&compiled_block_sampled.values, Some(fn_context.clone()))?; - Ok(CompilationResult::new( + Ok(CompilationResult::from_single_chain( datalake.datalake.get_chain_id().to_numeric_id(), vec![aggregated_result], compiled_block_sampled.mmr_with_headers, @@ -129,9 +129,11 @@ mod tests { .await .unwrap(); // assert_eq!(results.mmr_with_headers[0].headers.len(), 16); - assert_eq!(results.accounts.len(), 2); - assert_eq!(results.storages.len(), 1); + let account_proofs = results.accounts.iter().next().unwrap(); + assert_eq!(account_proofs.1.len(), 2); let storage_proofs = results.storages.iter().next().unwrap(); + assert_eq!(storage_proofs.1.len(), 1); + let storage_proofs = storage_proofs.1.iter().next().unwrap(); assert_eq!(storage_proofs.proofs.len(), 6); assert_eq!(results.transactions.len(), 0); assert_eq!(results.transaction_receipts.len(), 0); diff --git a/hdp/src/preprocessor/compile/mod.rs b/hdp/src/preprocessor/compile/mod.rs index e54d993d..17e78721 100644 --- a/hdp/src/preprocessor/compile/mod.rs +++ b/hdp/src/preprocessor/compile/mod.rs @@ -1,13 +1,11 @@ use alloy::primitives::U256; - use config::CompilerConfig; +use std::hash::Hash; -use std::collections::HashSet; +use std::collections::{HashMap, HashSet}; use thiserror::Error; -use crate::primitives::processed_types::block_proofs::{ - convert_to_mmr_meta_set, convert_to_mmr_with_headers, MMRWithHeader, -}; +use crate::primitives::processed_types::block_proofs::{MMRWithHeader, ProcessedBlockProofs}; use crate::primitives::processed_types::{ account::ProcessedAccount, receipt::ProcessedReceipt, storage::ProcessedStorage, transaction::ProcessedTransaction, @@ -55,33 +53,30 @@ pub trait Compilable { #[derive(Debug, Default, PartialEq)] pub struct CompilationResult { - pub chain_id: u128, /// results of tasks pub task_results: Vec, /// mmr_with_headers related to the datalake - pub mmr_with_headers: HashSet, + pub mmr_with_headers: HashMap>, /// Accounts related to the datalake - pub accounts: HashSet, + pub accounts: HashMap>, /// Storages related to the datalake - pub storages: HashSet, + pub storages: HashMap>, /// Transactions related to the datalake - pub transactions: HashSet, + pub transactions: HashMap>, /// Transaction receipts related to the datalake - pub transaction_receipts: HashSet, + pub transaction_receipts: HashMap>, } impl CompilationResult { pub fn new( - chain_id: u128, task_results: Vec, - mmr_with_headers: HashSet, - accounts: HashSet, - storages: HashSet, - transactions: HashSet, - transaction_receipts: HashSet, + mmr_with_headers: HashMap>, + accounts: HashMap>, + storages: HashMap>, + transactions: HashMap>, + transaction_receipts: HashMap>, ) -> Self { Self { - chain_id, task_results, mmr_with_headers, accounts, @@ -91,49 +86,10 @@ impl CompilationResult { } } - /// Extend the current compilation results with another compilation results - pub fn extend(&mut self, other: CompilationResult) { - let others_mmr_with_headers_set = - convert_to_mmr_meta_set(Vec::from_iter(other.mmr_with_headers)); - let mut self_mmr_with_headers_set = - convert_to_mmr_meta_set(Vec::from_iter(self.mmr_with_headers.clone())); - for (mmr_meta, headers) in others_mmr_with_headers_set { - self_mmr_with_headers_set - .entry(mmr_meta) - .or_default() - .extend(headers); - } - self.mmr_with_headers = - HashSet::from_iter(convert_to_mmr_with_headers(self_mmr_with_headers_set)); - self.accounts.extend(other.accounts); - self.storages.extend(other.storages); - self.transactions.extend(other.transactions); - self.transaction_receipts.extend(other.transaction_receipts); - self.task_results.extend(other.task_results); - } -} - -#[derive(Debug, Default, PartialEq)] -pub struct DatalakeCompileResult { - pub chain_id: u128, - /// results of tasks - pub task_results: Vec, - /// mmr_with_headers related to the datalake - pub mmr_with_headers: HashSet, - /// Accounts related to the datalake - pub accounts: HashSet, - /// Storages related to the datalake - pub storages: HashSet, - /// Transactions related to the datalake - pub transactions: HashSet, - /// Transaction receipts related to the datalake - pub transaction_receipts: HashSet, -} - -impl DatalakeCompileResult { - pub fn new( + pub fn from_single_chain( chain_id: u128, task_results: Vec, + mmr_with_headers: HashSet, accounts: HashSet, storages: HashSet, @@ -141,13 +97,74 @@ impl DatalakeCompileResult { transaction_receipts: HashSet, ) -> Self { Self { - chain_id, task_results, - mmr_with_headers, - accounts, - storages, - transactions, - transaction_receipts, + mmr_with_headers: HashMap::from_iter(vec![(chain_id, mmr_with_headers)]), + accounts: HashMap::from_iter(vec![(chain_id, accounts)]), + storages: HashMap::from_iter(vec![(chain_id, storages)]), + transactions: HashMap::from_iter(vec![(chain_id, transactions)]), + transaction_receipts: HashMap::from_iter(vec![(chain_id, transaction_receipts)]), } } + + pub fn extend(&mut self, other: CompilationResult) { + self.task_results.extend(other.task_results); + + // Merge mmr_with_headers + // TODO: merge headers if there same mmr + merge_hash_maps(&mut self.mmr_with_headers, other.mmr_with_headers); + + // Merge accounts + merge_hash_maps(&mut self.accounts, other.accounts); + + // Merge storages + merge_hash_maps(&mut self.storages, other.storages); + + // Merge transactions + merge_hash_maps(&mut self.transactions, other.transactions); + + // Merge transaction_receipts + merge_hash_maps(&mut self.transaction_receipts, other.transaction_receipts); + } + + pub fn to_processed_block_vec(self) -> Vec { + let mut processed_block_vec = Vec::new(); + + for (chain_id, mmr_with_headers) in self.mmr_with_headers { + let accounts = self.accounts.get(&chain_id).cloned().unwrap_or_default(); + let storages = self.storages.get(&chain_id).cloned().unwrap_or_default(); + let transactions = self + .transactions + .get(&chain_id) + .cloned() + .unwrap_or_default(); + let transaction_receipts = self + .transaction_receipts + .get(&chain_id) + .cloned() + .unwrap_or_default(); + + let processed_block = ProcessedBlockProofs { + chain_id, + mmr_with_headers: mmr_with_headers.into_iter().collect(), + accounts: accounts.into_iter().collect(), + storages: storages.into_iter().collect(), + transactions: transactions.into_iter().collect(), + transaction_receipts: transaction_receipts.into_iter().collect(), + }; + + processed_block_vec.push(processed_block); + } + + processed_block_vec + } +} + +// Helper function to merge HashMaps with HashSet values +fn merge_hash_maps(base: &mut HashMap>, other: HashMap>) +where + T: Eq + Hash + Clone, +{ + for (key, value) in other { + base.entry(key).or_default().extend(value); + } } diff --git a/hdp/src/preprocessor/compile/module.rs b/hdp/src/preprocessor/compile/module.rs index 0d21cc47..9aac5470 100644 --- a/hdp/src/preprocessor/compile/module.rs +++ b/hdp/src/preprocessor/compile/module.rs @@ -11,7 +11,7 @@ use crate::provider::key::categorize_fetch_keys; use crate::provider::traits::new_provider_from_config; use core::panic; -use std::collections::HashSet; +use std::collections::{HashMap, HashSet}; use std::path::PathBuf; use tracing::info; @@ -57,11 +57,11 @@ pub async fn compile_modules( panic!("Multiple chain id is not supported yet"); } - let mut accounts = HashSet::new(); - let mut storages = HashSet::new(); - let mut transactions = HashSet::new(); - let mut transaction_receipts = HashSet::new(); - let mut mmr_header_map = HashSet::new(); + let mut accounts = HashMap::new(); + let mut storages = HashMap::new(); + let mut transactions = HashMap::new(); + let mut transaction_receipts = HashMap::new(); + let mut mmr_header_map = HashMap::new(); info!("3. Fetching proofs from provider..."); for (chain_id, keys) in keys_maps_chain { @@ -73,17 +73,29 @@ pub async fn compile_modules( let provider = new_provider_from_config(target_provider_config); let results = provider.fetch_proofs_from_keys(keys).await?; - // TODO: can we do better? - mmr_header_map.extend(results.mmr_with_headers.into_iter()); - accounts.extend(results.accounts.into_iter()); - storages.extend(results.storages.into_iter()); - transactions.extend(results.transactions.into_iter()); - transaction_receipts.extend(results.transaction_receipts.into_iter()); + mmr_header_map.insert( + chain_id.to_numeric_id(), + HashSet::from_iter(results.mmr_with_headers.into_iter()), + ); + accounts.insert( + chain_id.to_numeric_id(), + HashSet::from_iter(results.accounts.into_iter()), + ); + storages.insert( + chain_id.to_numeric_id(), + HashSet::from_iter(results.storages.into_iter()), + ); + transactions.insert( + chain_id.to_numeric_id(), + HashSet::from_iter(results.transactions.into_iter()), + ); + transaction_receipts.insert( + chain_id.to_numeric_id(), + HashSet::from_iter(results.transaction_receipts.into_iter()), + ); } - // TODO : need fix let compiled_result = CompilationResult::new( - 11155111, commit_results_maps, mmr_header_map, accounts, diff --git a/hdp/src/preprocessor/mod.rs b/hdp/src/preprocessor/mod.rs index fd3f62ab..89bf5dec 100644 --- a/hdp/src/preprocessor/mod.rs +++ b/hdp/src/preprocessor/mod.rs @@ -3,7 +3,6 @@ use crate::constant::SOUND_CAIRO_RUN_OUTPUT_FILE; use crate::primitives::merkle_tree::{build_result_merkle_tree, build_task_merkle_tree}; -use crate::primitives::processed_types::block_proofs::ProcessedBlockProofs; use crate::primitives::processed_types::datalake_compute::ProcessedDatalakeCompute; use crate::primitives::processed_types::module::ProcessedModule; use crate::primitives::processed_types::query::ProcessorInput; @@ -120,19 +119,12 @@ impl PreProcessor { } // TODO: this chain id need to be fix - let proofs = ProcessedBlockProofs { - chain_id: 11155111, - mmr_with_headers: Vec::from_iter(compiled_results.mmr_with_headers), - accounts: Vec::from_iter(compiled_results.accounts), - storages: Vec::from_iter(compiled_results.storages), - transactions: Vec::from_iter(compiled_results.transactions), - transaction_receipts: Vec::from_iter(compiled_results.transaction_receipts), - }; + let proofs = compiled_results.to_processed_block_vec(); let processed_result = ProcessorInput::new( SOUND_CAIRO_RUN_OUTPUT_FILE.into(), result_merkle_tree.root(), task_merkle_root, - vec![proofs], + proofs, combined_tasks, ); info!("1️⃣ Preprocessor completed successfully"); diff --git a/input.json b/input.json index ca59551b..1633d791 100644 --- a/input.json +++ b/input.json @@ -1,7 +1,7 @@ { "cairo_run_output_path": "cairo_run_output.json", - "task_root": "0xd900a4d980172ad23fafb579aeac7cff91c73636d334bc247a1c3142d8bffa78", - "result_root": "0x34b46123c4ab406cec0586364d8ed193353f0e9fb1b32cac0988fc0970dc50a2", + "task_root": "0xbe859097a63a9ce185a512324f9a051842c469770885e8c138fcf7cda4df2d1e", + "result_root": "0xa623e6db247a4bce704b58bbfef9617fb2a96ee9bad36a2088c65f1e4983e972", "proofs": [ { "chain_id": 11155111, @@ -708,6 +708,1125 @@ ], "transactions": [], "transaction_receipts": [] + }, + { + "chain_id": 1, + "mmr_with_headers": [ + { + "mmr_meta": { + "id": 6, + "root": "0x3271f29fbedc3f9b0f34bbefd96a5352d5c078a095e865a2be21f01a0b5d603", + "size": 39507787, + "peaks": [ + "0x5bcb7ebf023e07cf3df51800a183df56fd0c6564c004bc7b0ffde74627501ed", + "0x2756a530dedc3403380df580505ff29e020d72efde3c91bc3ca53909d922d2a", + "0x053058fcd54baec18ebfb227b0fe14de56ed556564f4bb5b5ea49ec970325fe", + "0x165f29510eb11f4ec6c0758f37c5423d5dba2e421172ff99885a4f365926023", + "0x1445ff057bf7dab225ab94a7aabf2d5d52f87b73fc361ab8d79e4f71dd89b88", + "0x3adbfcc1ad6a6324520dac8d1277f0686df93e412e2e1f0d39d7bc4c47832da", + "0x784b9d576867d02e170a8a7000ed7c93a8027ad87e2cfb88e49cc5928663020", + "0x7ea013ade21ca7bbccbc46a0155f1478efc5f0422a9e8575f5a57595e948c4c", + "0x41dc8818b97f4d69d5ec3f43b908ba8b091bccbcb1d1adb66183abec69a9f89", + "0x4aebd0fb9408a90f915b8f52e11547305d3f7b00a9f172502eddef78fcc27a3", + "0x66423f4b8b863824ab1901172f5038f6e212884f6c5bc0ea420124275bb38ce", + "0x67fda04a120ff0baefd605f6595a3bb4f825ef4847f943e158220d4762ac657", + "0x3b38d14a9cc5466577034c592049b0264d45bb620010ea5163a8c8d4ea6143f", + "0x09640bc142e8de54d49961eab672c7d2972e1de3c4e4dbeba46295daeced832", + "0x1babdddd68bf91de82cf3ef0d7d6a1fdca32130518e24bf9531fbdcfbcba42e" + ] + }, + "headers": [ + { + "rlp": [ + "0x3d7ffc23a01202f9", + "0x237972985e58b217", + "0x11cfd713db7954d1", + "0x5f0c8823b51b2f3b", + "0x4dcc1da0a4cdf29f", + "0xb585ab7a5dc7dee8", + "0x4512d31ad4ccb667", + "0x42a1f013748a941b", + "0x701b944793d440fd", + "0x94be65cf8a33b447", + "0xd78a33c9c5e8a3c1", + "0xa1258068cca07cd6", + "0x6b20b793cc5e092e", + "0x14dcedce5dfb1061", + "0x2bf30db13f05f2aa", + "0x171fe856a0d07f70", + "0xe64583ffa655cc1b", + "0x1be0485b6ef8c092", + "0xb52f6201c0ad6c99", + "0x1fe856a021b463e3", + "0x4583ffa655cc1b17", + "0xe0485b6ef8c092e6", + "0x2f6201c0ad6c991b", + "0x1b921b463e3b5", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x826d1ae09a300485", + "0xfb43ba5584808813", + "0x6e696f637469429a", + "0x2045485420736920", + "0x6168636b636f6c42", + "0x1b7014dfa02e6e69", + "0xe4569963d5d3d61a", + "0xa78931de60092563", + "0x42606f1ad738cb26", + "0x6b8e388872ea5df4", + "0xb74721c237" + ], + "rlp_bytes_len": 533, + "proof": { + "leaf_idx": 36240331, + "mmr_path": [ + "0x0c4ba48ac824c2e6c683c69cdc2f0be7258c19da079eaae99d30d4faf46956b", + "0x6c492ee6d3005505a7366d1f85e75c67cfaca17a20a1e1e5df7afb4384a43b9", + "0x4e8031f2fc1fcc151695ce4fb85944e14b3bb759f5199aea08cd0a4de873ef1", + "0x0c0311ba88ac05249a044bf42d757dd4de1ebe7cf3187b45e4138b1b4bcb613", + "0x020175e524a8f80a1212a5d9cdeff96c86f7848290710bcaf62a24165ea0d3e", + "0x679c119f91a379ccbc6676ed8c4f001efec4aac33c9b0ae3aeb7252f7ab8c84", + "0x754770f8a3662e4c327e2e9ced3a8e5df146929971e4dd9f4049bb63add1cc1", + "0x63bd29f81e937666b38b9f79c5133fd259a13219881870140c8d782c8851534", + "0x2f4c027af113be4d7d326b3b52991d136341c4dd782713ed5e8e4032cf0c897", + "0x3060b57768080011068e3ac8042e021faf707fd08f305c1a5ef728967820326", + "0x6edfabcd67c8ca06715373fc1f7539c92749c9407672b242454bc6112ac9f00", + "0x4e46d26e0279143c7b49f3b3f2a45de0a006a78e00c46c876fa5f3a0ed3db1d", + "0x1302ccf7dddbb803d97b075bf7c2634c5877ed9c31ea3b0f688eff3bd15e812", + "0x0e458a32a01f0f9607b2532083577520bded45e431233e8b64c63619e0f4790", + "0x140e8fa45b8c34047224ebfb8e6234ac76e08da08de502e3b30a62d846c43d4", + "0x5565c746b5fb2c3721c9d25f2def725ea5d7b195eaf978cf1cafe4fed1e95f2", + "0x344d9891124ac18149b7463568a9860732fe4b1ef84c6b563a6fe77ba66a9c4", + "0x6c26801d6e2dd7a33550de8c6291fc76a5edb5770ca38c0c82ba2eb389bca0a", + "0x3c6b59b8b0288bb50bc50326a41a3dd26899801f2d3520b71ede8bcd9d108d1", + "0x0e6b4ae59b356b3fcb3eb87f63a4fb12b1464d18ea4560eb18810d7aa46f68d", + "0x536ff2c043d32e5b1a97b6613e406f49406f6b01bb4c95f9e3b1151f2cb9d73" + ] + } + }, + { + "rlp": [ + "0x59c5ef07a01802f9", + "0x8eb07e7e6e5d78e", + "0x632d77b2dff21071", + "0x966d69f4758b5055", + "0x4dcc1da0ec47f7d0", + "0xb585ab7a5dc7dee8", + "0x4512d31ad4ccb667", + "0x42a1f013748a941b", + "0xe3d7944793d440fd", + "0x5b0f80d1c110e30a", + "0x1f2e5bf97aaa1b64", + "0xe9e99cfe11a08cd9", + "0x6e2f92181c2decaf", + "0xe9fcf5409c313e51", + "0x9039ad0380873134", + "0x171fe856a0c8c02e", + "0xe64583ffa655cc1b", + "0x1be0485b6ef8c092", + "0xb52f6201c0ad6c99", + "0x1fe856a021b463e3", + "0x4583ffa655cc1b17", + "0xe0485b6ef8c092e6", + "0x2f6201c0ad6c991b", + "0x1b921b463e3b5", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x826a810a092f0485", + "0xf643ba5584808813", + "0x6c6b2f68746547a0", + "0x31762f657275736f", + "0x3763662d302e302e", + "0x696c2f6432336439", + "0x8d6ce050679ea06e", + "0xb725fb259b007c07", + "0xfda91c0e86a9ea55", + "0x490f0471f8b0b6f1", + "0x2d18f6cd80882dc8", + "0x5fed50" + ], + "rlp_bytes_len": 539, + "proof": { + "leaf_idx": 36240335, + "mmr_path": [ + "0x5ab2f147c7e0a140ab86a7c30290a00a5cd60f4aa43e9360d94360b588c07f1", + "0x72091005b55c4a2570fc6e0efd9103701b2497c17ca75359cf47f3a86e46e86", + "0x4e8031f2fc1fcc151695ce4fb85944e14b3bb759f5199aea08cd0a4de873ef1", + "0x0c0311ba88ac05249a044bf42d757dd4de1ebe7cf3187b45e4138b1b4bcb613", + "0x020175e524a8f80a1212a5d9cdeff96c86f7848290710bcaf62a24165ea0d3e", + "0x679c119f91a379ccbc6676ed8c4f001efec4aac33c9b0ae3aeb7252f7ab8c84", + "0x754770f8a3662e4c327e2e9ced3a8e5df146929971e4dd9f4049bb63add1cc1", + "0x63bd29f81e937666b38b9f79c5133fd259a13219881870140c8d782c8851534", + "0x2f4c027af113be4d7d326b3b52991d136341c4dd782713ed5e8e4032cf0c897", + "0x3060b57768080011068e3ac8042e021faf707fd08f305c1a5ef728967820326", + "0x6edfabcd67c8ca06715373fc1f7539c92749c9407672b242454bc6112ac9f00", + "0x4e46d26e0279143c7b49f3b3f2a45de0a006a78e00c46c876fa5f3a0ed3db1d", + "0x1302ccf7dddbb803d97b075bf7c2634c5877ed9c31ea3b0f688eff3bd15e812", + "0x0e458a32a01f0f9607b2532083577520bded45e431233e8b64c63619e0f4790", + "0x140e8fa45b8c34047224ebfb8e6234ac76e08da08de502e3b30a62d846c43d4", + "0x5565c746b5fb2c3721c9d25f2def725ea5d7b195eaf978cf1cafe4fed1e95f2", + "0x344d9891124ac18149b7463568a9860732fe4b1ef84c6b563a6fe77ba66a9c4", + "0x6c26801d6e2dd7a33550de8c6291fc76a5edb5770ca38c0c82ba2eb389bca0a", + "0x3c6b59b8b0288bb50bc50326a41a3dd26899801f2d3520b71ede8bcd9d108d1", + "0x0e6b4ae59b356b3fcb3eb87f63a4fb12b1464d18ea4560eb18810d7aa46f68d", + "0x536ff2c043d32e5b1a97b6613e406f49406f6b01bb4c95f9e3b1151f2cb9d73" + ] + } + }, + { + "rlp": [ + "0xde7e2dfa01602f9", + "0xcbce0111546a116c", + "0x5f12622d40d756b2", + "0xc9ed497d609bdc6d", + "0x4dcc1da0645c8289", + "0xb585ab7a5dc7dee8", + "0x4512d31ad4ccb667", + "0x42a1f013748a941b", + "0x7bbb944793d440fd", + "0x4a4733a9f0f38782", + "0x7977a9bc2ce4ea79", + "0x36dc0065c6a07111", + "0x861ab086894afb0", + "0x3e03a650afb8d194", + "0x66dc6e2393ba924d", + "0x171fe856a0019c64", + "0xe64583ffa655cc1b", + "0x1be0485b6ef8c092", + "0xb52f6201c0ad6c99", + "0x1fe856a021b463e3", + "0x4583ffa655cc1b17", + "0xe0485b6ef8c092e6", + "0x2f6201c0ad6c991b", + "0x1b921b463e3b5", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x82659a9f6c2c0485", + "0xed43ba5584808813", + "0x564c2f687465479e", + "0x2e302e31762f5649", + "0x2f78756e696c2f30", + "0xa0322e342e316f67", + "0x5ca1d568bcf186f0", + "0xa0e8827e01c26ad0", + "0x24a2967866d69923", + "0x8da0250460325ab6", + "0x6e49c0ffd7874588", + "0xa5" + ], + "rlp_bytes_len": 537, + "proof": { + "leaf_idx": 36240347, + "mmr_path": [ + "0x5a9c9bf362258e22ccd4fa91d6ef80f03d8cd809b7ee2a02dac6bd86ca23506", + "0x0c430c0fcdb2ac17f77da1b2636f7b3571e286fc8158dc6df148da5a88937cf", + "0x155fdf4bfe0fce2431ef276559c02370b222d33a9465f3fba3071ceaf81082b", + "0x5610dd4fddeca2d805384104a975a2aa165810614b7cf3ba3991c845088da3a", + "0x2a9ad6b36097b54d83efbffd3fc4e2eed5196cfa9e6372ef86deb1f3392da57", + "0x679c119f91a379ccbc6676ed8c4f001efec4aac33c9b0ae3aeb7252f7ab8c84", + "0x754770f8a3662e4c327e2e9ced3a8e5df146929971e4dd9f4049bb63add1cc1", + "0x63bd29f81e937666b38b9f79c5133fd259a13219881870140c8d782c8851534", + "0x2f4c027af113be4d7d326b3b52991d136341c4dd782713ed5e8e4032cf0c897", + "0x3060b57768080011068e3ac8042e021faf707fd08f305c1a5ef728967820326", + "0x6edfabcd67c8ca06715373fc1f7539c92749c9407672b242454bc6112ac9f00", + "0x4e46d26e0279143c7b49f3b3f2a45de0a006a78e00c46c876fa5f3a0ed3db1d", + "0x1302ccf7dddbb803d97b075bf7c2634c5877ed9c31ea3b0f688eff3bd15e812", + "0x0e458a32a01f0f9607b2532083577520bded45e431233e8b64c63619e0f4790", + "0x140e8fa45b8c34047224ebfb8e6234ac76e08da08de502e3b30a62d846c43d4", + "0x5565c746b5fb2c3721c9d25f2def725ea5d7b195eaf978cf1cafe4fed1e95f2", + "0x344d9891124ac18149b7463568a9860732fe4b1ef84c6b563a6fe77ba66a9c4", + "0x6c26801d6e2dd7a33550de8c6291fc76a5edb5770ca38c0c82ba2eb389bca0a", + "0x3c6b59b8b0288bb50bc50326a41a3dd26899801f2d3520b71ede8bcd9d108d1", + "0x0e6b4ae59b356b3fcb3eb87f63a4fb12b1464d18ea4560eb18810d7aa46f68d", + "0x536ff2c043d32e5b1a97b6613e406f49406f6b01bb4c95f9e3b1151f2cb9d73" + ] + } + }, + { + "rlp": [ + "0xe9e5aa7fa01102f9", + "0x2db2156c147d0005", + "0x884f34cb356973cb", + "0xe8016765fe350dbe", + "0xafaa8aa08e39524d", + "0xb6d22d0b36bf62a1", + "0x536e1b2c74382c62", + "0x8288579a8a092bc8", + "0x92289467b377e6dc", + "0xf0c0f4849d2c4e1e", + "0xa05157f491b9cec0", + "0x4a4cfbadefa093fe", + "0x61c0715fe8e8c8ca", + "0xced032f7aad9a458", + "0x7e4fe0eb79933b9c", + "0x171fe856a05ec12a", + "0xe64583ffa655cc1b", + "0x1be0485b6ef8c092", + "0xb52f6201c0ad6c99", + "0x1fe856a021b463e3", + "0x4583ffa655cc1b17", + "0xe0485b6ef8c092e6", + "0x2f6201c0ad6c991b", + "0x1b921b463e3b5", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x82691a3a832e0485", + "0xf543ba5584808813", + "0x31762f6874654799", + "0x6e696c2f302e302e", + "0x342e316f672f7875", + "0x1ea396a673a0322e", + "0x49f0762cf92ef66c", + "0x2c8ffeefbe193a3e", + "0x5529ea27afddfd8a", + "0xfbd33f368854e86b", + "0x525568cd" + ], + "rlp_bytes_len": 532, + "proof": { + "leaf_idx": 36240340, + "mmr_path": [ + "0x1f47b1cba9eefd6b4bae48bb68dbb9333c612f6eeb205e94a168c17c8e59922", + "0x3a5c0170d4a7a2f383c4aaaf3621e2d1b423cd5675b55b40c999adb60be74df", + "0x6eb3587880c32049c5610d8994211e8499a87c1539984d204395d649257ffd6", + "0x5610dd4fddeca2d805384104a975a2aa165810614b7cf3ba3991c845088da3a", + "0x2a9ad6b36097b54d83efbffd3fc4e2eed5196cfa9e6372ef86deb1f3392da57", + "0x679c119f91a379ccbc6676ed8c4f001efec4aac33c9b0ae3aeb7252f7ab8c84", + "0x754770f8a3662e4c327e2e9ced3a8e5df146929971e4dd9f4049bb63add1cc1", + "0x63bd29f81e937666b38b9f79c5133fd259a13219881870140c8d782c8851534", + "0x2f4c027af113be4d7d326b3b52991d136341c4dd782713ed5e8e4032cf0c897", + "0x3060b57768080011068e3ac8042e021faf707fd08f305c1a5ef728967820326", + "0x6edfabcd67c8ca06715373fc1f7539c92749c9407672b242454bc6112ac9f00", + "0x4e46d26e0279143c7b49f3b3f2a45de0a006a78e00c46c876fa5f3a0ed3db1d", + "0x1302ccf7dddbb803d97b075bf7c2634c5877ed9c31ea3b0f688eff3bd15e812", + "0x0e458a32a01f0f9607b2532083577520bded45e431233e8b64c63619e0f4790", + "0x140e8fa45b8c34047224ebfb8e6234ac76e08da08de502e3b30a62d846c43d4", + "0x5565c746b5fb2c3721c9d25f2def725ea5d7b195eaf978cf1cafe4fed1e95f2", + "0x344d9891124ac18149b7463568a9860732fe4b1ef84c6b563a6fe77ba66a9c4", + "0x6c26801d6e2dd7a33550de8c6291fc76a5edb5770ca38c0c82ba2eb389bca0a", + "0x3c6b59b8b0288bb50bc50326a41a3dd26899801f2d3520b71ede8bcd9d108d1", + "0x0e6b4ae59b356b3fcb3eb87f63a4fb12b1464d18ea4560eb18810d7aa46f68d", + "0x536ff2c043d32e5b1a97b6613e406f49406f6b01bb4c95f9e3b1151f2cb9d73" + ] + } + }, + { + "rlp": [ + "0xd3af10dba01602f9", + "0x834c28eb2753a4ef", + "0xae6679bdd95b92cc", + "0x2407beeec16730a5", + "0x4dcc1da01eec24d1", + "0xb585ab7a5dc7dee8", + "0x4512d31ad4ccb667", + "0x42a1f013748a941b", + "0x7bbb944793d440fd", + "0x4a4733a9f0f38782", + "0x7977a9bc2ce4ea79", + "0x7f6d5fc290a07111", + "0xa66856cca631ebdd", + "0x5e70ecaddb7aa7bb", + "0x1e2d5c26515aaab7", + "0x171fe856a0acb73b", + "0xe64583ffa655cc1b", + "0x1be0485b6ef8c092", + "0xb52f6201c0ad6c99", + "0x1fe856a021b463e3", + "0x4583ffa655cc1b17", + "0xe0485b6ef8c092e6", + "0x2f6201c0ad6c991b", + "0x1b921b463e3b5", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x8264b622e72b0485", + "0xeb43ba5584808813", + "0x564c2f687465479e", + "0x2e302e31762f5649", + "0x2f78756e696c2f30", + "0xa0322e342e316f67", + "0x8480e572073cb45b", + "0x59a459c8e0c821b2", + "0xf1b8c512c703c150", + "0x1458a07ee66951d", + "0x36a9297f9c123788", + "0x4b" + ], + "rlp_bytes_len": 537, + "proof": { + "leaf_idx": 36240348, + "mmr_path": [ + "0x5fa2122363b87c6d0ad27a496726de05eb9f1319153287f03e2538d62d9e227", + "0x0c430c0fcdb2ac17f77da1b2636f7b3571e286fc8158dc6df148da5a88937cf", + "0x155fdf4bfe0fce2431ef276559c02370b222d33a9465f3fba3071ceaf81082b", + "0x5610dd4fddeca2d805384104a975a2aa165810614b7cf3ba3991c845088da3a", + "0x2a9ad6b36097b54d83efbffd3fc4e2eed5196cfa9e6372ef86deb1f3392da57", + "0x679c119f91a379ccbc6676ed8c4f001efec4aac33c9b0ae3aeb7252f7ab8c84", + "0x754770f8a3662e4c327e2e9ced3a8e5df146929971e4dd9f4049bb63add1cc1", + "0x63bd29f81e937666b38b9f79c5133fd259a13219881870140c8d782c8851534", + "0x2f4c027af113be4d7d326b3b52991d136341c4dd782713ed5e8e4032cf0c897", + "0x3060b57768080011068e3ac8042e021faf707fd08f305c1a5ef728967820326", + "0x6edfabcd67c8ca06715373fc1f7539c92749c9407672b242454bc6112ac9f00", + "0x4e46d26e0279143c7b49f3b3f2a45de0a006a78e00c46c876fa5f3a0ed3db1d", + "0x1302ccf7dddbb803d97b075bf7c2634c5877ed9c31ea3b0f688eff3bd15e812", + "0x0e458a32a01f0f9607b2532083577520bded45e431233e8b64c63619e0f4790", + "0x140e8fa45b8c34047224ebfb8e6234ac76e08da08de502e3b30a62d846c43d4", + "0x5565c746b5fb2c3721c9d25f2def725ea5d7b195eaf978cf1cafe4fed1e95f2", + "0x344d9891124ac18149b7463568a9860732fe4b1ef84c6b563a6fe77ba66a9c4", + "0x6c26801d6e2dd7a33550de8c6291fc76a5edb5770ca38c0c82ba2eb389bca0a", + "0x3c6b59b8b0288bb50bc50326a41a3dd26899801f2d3520b71ede8bcd9d108d1", + "0x0e6b4ae59b356b3fcb3eb87f63a4fb12b1464d18ea4560eb18810d7aa46f68d", + "0x536ff2c043d32e5b1a97b6613e406f49406f6b01bb4c95f9e3b1151f2cb9d73" + ] + } + }, + { + "rlp": [ + "0x7d0cf0dba01802f9", + "0xbf6da4d5b2163390", + "0xf8cc02317a3129cf", + "0x3fdef2c08752bed", + "0x4dcc1da0ec98e04e", + "0xb585ab7a5dc7dee8", + "0x4512d31ad4ccb667", + "0x42a1f013748a941b", + "0xe3d7944793d440fd", + "0x5b0f80d1c110e30a", + "0x1f2e5bf97aaa1b64", + "0x29114073bca08cd9", + "0x736fe86564f427b6", + "0x33af0cd7a3230278", + "0xf48845d82d66672d", + "0x171fe856a0105e9f", + "0xe64583ffa655cc1b", + "0x1be0485b6ef8c092", + "0xb52f6201c0ad6c99", + "0x1fe856a021b463e3", + "0x4583ffa655cc1b17", + "0xe0485b6ef8c092e6", + "0x2f6201c0ad6c991b", + "0x1b921b463e3b5", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x826ba2eb8e2f0485", + "0xf743ba5584808813", + "0x6c6b2f68746547a0", + "0x31762f657275736f", + "0x3763662d302e302e", + "0x696c2f6432336439", + "0x56fa7071f598a06e", + "0xb6ca6215c80cc2a9", + "0xde97ba01144cc022", + "0xc792873da26f71ce", + "0x521e9e640e880c5c", + "0xeece4f" + ], + "rlp_bytes_len": 539, + "proof": { + "leaf_idx": 36240334, + "mmr_path": [ + "0x40deb09802713fa1dbb58a928db4e042fdbabfc6c5d6a71de3e89b98b21813b", + "0x72091005b55c4a2570fc6e0efd9103701b2497c17ca75359cf47f3a86e46e86", + "0x4e8031f2fc1fcc151695ce4fb85944e14b3bb759f5199aea08cd0a4de873ef1", + "0x0c0311ba88ac05249a044bf42d757dd4de1ebe7cf3187b45e4138b1b4bcb613", + "0x020175e524a8f80a1212a5d9cdeff96c86f7848290710bcaf62a24165ea0d3e", + "0x679c119f91a379ccbc6676ed8c4f001efec4aac33c9b0ae3aeb7252f7ab8c84", + "0x754770f8a3662e4c327e2e9ced3a8e5df146929971e4dd9f4049bb63add1cc1", + "0x63bd29f81e937666b38b9f79c5133fd259a13219881870140c8d782c8851534", + "0x2f4c027af113be4d7d326b3b52991d136341c4dd782713ed5e8e4032cf0c897", + "0x3060b57768080011068e3ac8042e021faf707fd08f305c1a5ef728967820326", + "0x6edfabcd67c8ca06715373fc1f7539c92749c9407672b242454bc6112ac9f00", + "0x4e46d26e0279143c7b49f3b3f2a45de0a006a78e00c46c876fa5f3a0ed3db1d", + "0x1302ccf7dddbb803d97b075bf7c2634c5877ed9c31ea3b0f688eff3bd15e812", + "0x0e458a32a01f0f9607b2532083577520bded45e431233e8b64c63619e0f4790", + "0x140e8fa45b8c34047224ebfb8e6234ac76e08da08de502e3b30a62d846c43d4", + "0x5565c746b5fb2c3721c9d25f2def725ea5d7b195eaf978cf1cafe4fed1e95f2", + "0x344d9891124ac18149b7463568a9860732fe4b1ef84c6b563a6fe77ba66a9c4", + "0x6c26801d6e2dd7a33550de8c6291fc76a5edb5770ca38c0c82ba2eb389bca0a", + "0x3c6b59b8b0288bb50bc50326a41a3dd26899801f2d3520b71ede8bcd9d108d1", + "0x0e6b4ae59b356b3fcb3eb87f63a4fb12b1464d18ea4560eb18810d7aa46f68d", + "0x536ff2c043d32e5b1a97b6613e406f49406f6b01bb4c95f9e3b1151f2cb9d73" + ] + } + }, + { + "rlp": [ + "0x2fd664fa01102f9", + "0x7ef919c1bb1e6841", + "0x8f6e7bb836102c95", + "0x9b7a5c4cd8c5f564", + "0x4dcc1da0ccfdebb1", + "0xb585ab7a5dc7dee8", + "0x4512d31ad4ccb667", + "0x42a1f013748a941b", + "0x9228944793d440fd", + "0xf0c0f4849d2c4e1e", + "0xa05157f491b9cec0", + "0xce47746002a093fe", + "0x1d5acf73d8e391f6", + "0x473135131820ac88", + "0x7a75ec8917630dee", + "0x171fe856a06bfacc", + "0xe64583ffa655cc1b", + "0x1be0485b6ef8c092", + "0xb52f6201c0ad6c99", + "0x1fe856a021b463e3", + "0x4583ffa655cc1b17", + "0xe0485b6ef8c092e6", + "0x2f6201c0ad6c991b", + "0x1b921b463e3b5", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x82662d2df22c0485", + "0xef43ba5584808813", + "0x31762f6874654799", + "0x6e696c2f302e302e", + "0x342e316f672f7875", + "0x28247627f3a0322e", + "0xfb970edbf3e4b12c", + "0xb9d6c14f6739e52b", + "0x73cace4e0191ccc3", + "0xccee368d88a83b08", + "0x8e7aa2" + ], + "rlp_bytes_len": 532, + "proof": { + "leaf_idx": 36240344, + "mmr_path": [ + "0x3e95e28eddd8a12ce454111a1764bfee096bf690567aa9c0bd8ea4de657b4b5", + "0x16cc42fe58b25cf8a0cf848c92401929a903cc9dd2d0dda90ed4a0ff7bd5380", + "0x6eb3587880c32049c5610d8994211e8499a87c1539984d204395d649257ffd6", + "0x5610dd4fddeca2d805384104a975a2aa165810614b7cf3ba3991c845088da3a", + "0x2a9ad6b36097b54d83efbffd3fc4e2eed5196cfa9e6372ef86deb1f3392da57", + "0x679c119f91a379ccbc6676ed8c4f001efec4aac33c9b0ae3aeb7252f7ab8c84", + "0x754770f8a3662e4c327e2e9ced3a8e5df146929971e4dd9f4049bb63add1cc1", + "0x63bd29f81e937666b38b9f79c5133fd259a13219881870140c8d782c8851534", + "0x2f4c027af113be4d7d326b3b52991d136341c4dd782713ed5e8e4032cf0c897", + "0x3060b57768080011068e3ac8042e021faf707fd08f305c1a5ef728967820326", + "0x6edfabcd67c8ca06715373fc1f7539c92749c9407672b242454bc6112ac9f00", + "0x4e46d26e0279143c7b49f3b3f2a45de0a006a78e00c46c876fa5f3a0ed3db1d", + "0x1302ccf7dddbb803d97b075bf7c2634c5877ed9c31ea3b0f688eff3bd15e812", + "0x0e458a32a01f0f9607b2532083577520bded45e431233e8b64c63619e0f4790", + "0x140e8fa45b8c34047224ebfb8e6234ac76e08da08de502e3b30a62d846c43d4", + "0x5565c746b5fb2c3721c9d25f2def725ea5d7b195eaf978cf1cafe4fed1e95f2", + "0x344d9891124ac18149b7463568a9860732fe4b1ef84c6b563a6fe77ba66a9c4", + "0x6c26801d6e2dd7a33550de8c6291fc76a5edb5770ca38c0c82ba2eb389bca0a", + "0x3c6b59b8b0288bb50bc50326a41a3dd26899801f2d3520b71ede8bcd9d108d1", + "0x0e6b4ae59b356b3fcb3eb87f63a4fb12b1464d18ea4560eb18810d7aa46f68d", + "0x536ff2c043d32e5b1a97b6613e406f49406f6b01bb4c95f9e3b1151f2cb9d73" + ] + } + }, + { + "rlp": [ + "0xdaf3be39a01602f9", + "0x60571b78024ed12c", + "0xff9b14066642dc50", + "0x7e41653ef44a7a93", + "0x4dcc1da013c7986e", + "0xb585ab7a5dc7dee8", + "0x4512d31ad4ccb667", + "0x42a1f013748a941b", + "0x7bbb944793d440fd", + "0x4a4733a9f0f38782", + "0x7977a9bc2ce4ea79", + "0xe7e8f3384aa07111", + "0x8cd0073c84e70d31", + "0x92d9723e59275681", + "0xf1f26e2945b08333", + "0x171fe856a07e3dd9", + "0xe64583ffa655cc1b", + "0x1be0485b6ef8c092", + "0xb52f6201c0ad6c99", + "0x1fe856a021b463e3", + "0x4583ffa655cc1b17", + "0xe0485b6ef8c092e6", + "0x2f6201c0ad6c991b", + "0x1b921b463e3b5", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x82686b7afd2d0485", + "0xf443ba5584808813", + "0x564c2f687465479e", + "0x2e302e31762f5649", + "0x2f78756e696c2f30", + "0xa0322e342e316f67", + "0xcaa260b222a003b9", + "0x8552d0a224db1987", + "0x7d3d044431faff09", + "0x68555a04ed249c1f", + "0x331d9e664ba6dd88", + "0x36" + ], + "rlp_bytes_len": 537, + "proof": { + "leaf_idx": 36240341, + "mmr_path": [ + "0x5fdd37a283d8f0942d06f492682460b5c133e670b6b85ff4792aa5e4186020e", + "0x3a5c0170d4a7a2f383c4aaaf3621e2d1b423cd5675b55b40c999adb60be74df", + "0x6eb3587880c32049c5610d8994211e8499a87c1539984d204395d649257ffd6", + "0x5610dd4fddeca2d805384104a975a2aa165810614b7cf3ba3991c845088da3a", + "0x2a9ad6b36097b54d83efbffd3fc4e2eed5196cfa9e6372ef86deb1f3392da57", + "0x679c119f91a379ccbc6676ed8c4f001efec4aac33c9b0ae3aeb7252f7ab8c84", + "0x754770f8a3662e4c327e2e9ced3a8e5df146929971e4dd9f4049bb63add1cc1", + "0x63bd29f81e937666b38b9f79c5133fd259a13219881870140c8d782c8851534", + "0x2f4c027af113be4d7d326b3b52991d136341c4dd782713ed5e8e4032cf0c897", + "0x3060b57768080011068e3ac8042e021faf707fd08f305c1a5ef728967820326", + "0x6edfabcd67c8ca06715373fc1f7539c92749c9407672b242454bc6112ac9f00", + "0x4e46d26e0279143c7b49f3b3f2a45de0a006a78e00c46c876fa5f3a0ed3db1d", + "0x1302ccf7dddbb803d97b075bf7c2634c5877ed9c31ea3b0f688eff3bd15e812", + "0x0e458a32a01f0f9607b2532083577520bded45e431233e8b64c63619e0f4790", + "0x140e8fa45b8c34047224ebfb8e6234ac76e08da08de502e3b30a62d846c43d4", + "0x5565c746b5fb2c3721c9d25f2def725ea5d7b195eaf978cf1cafe4fed1e95f2", + "0x344d9891124ac18149b7463568a9860732fe4b1ef84c6b563a6fe77ba66a9c4", + "0x6c26801d6e2dd7a33550de8c6291fc76a5edb5770ca38c0c82ba2eb389bca0a", + "0x3c6b59b8b0288bb50bc50326a41a3dd26899801f2d3520b71ede8bcd9d108d1", + "0x0e6b4ae59b356b3fcb3eb87f63a4fb12b1464d18ea4560eb18810d7aa46f68d", + "0x536ff2c043d32e5b1a97b6613e406f49406f6b01bb4c95f9e3b1151f2cb9d73" + ] + } + }, + { + "rlp": [ + "0xe69ccacaa01802f9", + "0x76824202634435b4", + "0xb6b2025db864372c", + "0xdc5c0da3a037e380", + "0x4dcc1da0e2450d6e", + "0xb585ab7a5dc7dee8", + "0x4512d31ad4ccb667", + "0x42a1f013748a941b", + "0xda19944793d440fd", + "0xcf4c0e961ef119fe", + "0x48d7eb9088aaa5c6", + "0x1e1c66601da01eca", + "0x3d40de4ba9c96402", + "0x9e5fb4bbab557f36", + "0x557b362ee5e84a53", + "0x171fe856a0b6aaec", + "0xe64583ffa655cc1b", + "0x1be0485b6ef8c092", + "0xb52f6201c0ad6c99", + "0x1fe856a021b463e3", + "0x4583ffa655cc1b17", + "0xe0485b6ef8c092e6", + "0x2f6201c0ad6c991b", + "0x1b921b463e3b5", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x826e76f320310485", + "0x44ba5584808813", + "0x31762f68746547a0", + "0x6463302d302e302e", + "0x696c2f3734363763", + "0x2e316f672f78756e", + "0x7e0c746ae213a034", + "0xc7c9f881dd54f9fe", + "0x3ef06f3dd9de009e", + "0x2a7cda3b34304acf", + "0xf414e1b7a88d8c3", + "0x55074e" + ], + "rlp_bytes_len": 539, + "proof": { + "leaf_idx": 36240328, + "mmr_path": [ + "0x38de2bd5dec4dddf445b272515b27e054f7a023fba100a407d5d07098b7817d", + "0x33f3f88b4590dc4b6fb0b738a333da4465506e97bf52bfb65a044e8aed6c071", + "0x758843d03ff496efb935710f282862e286d45648548c2b418e5d848d0f045cb", + "0x0c0311ba88ac05249a044bf42d757dd4de1ebe7cf3187b45e4138b1b4bcb613", + "0x020175e524a8f80a1212a5d9cdeff96c86f7848290710bcaf62a24165ea0d3e", + "0x679c119f91a379ccbc6676ed8c4f001efec4aac33c9b0ae3aeb7252f7ab8c84", + "0x754770f8a3662e4c327e2e9ced3a8e5df146929971e4dd9f4049bb63add1cc1", + "0x63bd29f81e937666b38b9f79c5133fd259a13219881870140c8d782c8851534", + "0x2f4c027af113be4d7d326b3b52991d136341c4dd782713ed5e8e4032cf0c897", + "0x3060b57768080011068e3ac8042e021faf707fd08f305c1a5ef728967820326", + "0x6edfabcd67c8ca06715373fc1f7539c92749c9407672b242454bc6112ac9f00", + "0x4e46d26e0279143c7b49f3b3f2a45de0a006a78e00c46c876fa5f3a0ed3db1d", + "0x1302ccf7dddbb803d97b075bf7c2634c5877ed9c31ea3b0f688eff3bd15e812", + "0x0e458a32a01f0f9607b2532083577520bded45e431233e8b64c63619e0f4790", + "0x140e8fa45b8c34047224ebfb8e6234ac76e08da08de502e3b30a62d846c43d4", + "0x5565c746b5fb2c3721c9d25f2def725ea5d7b195eaf978cf1cafe4fed1e95f2", + "0x344d9891124ac18149b7463568a9860732fe4b1ef84c6b563a6fe77ba66a9c4", + "0x6c26801d6e2dd7a33550de8c6291fc76a5edb5770ca38c0c82ba2eb389bca0a", + "0x3c6b59b8b0288bb50bc50326a41a3dd26899801f2d3520b71ede8bcd9d108d1", + "0x0e6b4ae59b356b3fcb3eb87f63a4fb12b1464d18ea4560eb18810d7aa46f68d", + "0x536ff2c043d32e5b1a97b6613e406f49406f6b01bb4c95f9e3b1151f2cb9d73" + ] + } + }, + { + "rlp": [ + "0x3a0f1116a01102f9", + "0xd7cf22ece25d89a1", + "0x952a114d721f7546", + "0x3b52a15828b6713c", + "0x4dcc1da064dcf350", + "0xb585ab7a5dc7dee8", + "0x4512d31ad4ccb667", + "0x42a1f013748a941b", + "0x9228944793d440fd", + "0xf0c0f4849d2c4e1e", + "0xa05157f491b9cec0", + "0x3a63aec9f7a093fe", + "0x7d1fe3738ca49203", + "0x50c9fcc741ff1b7f", + "0xecfec748d4a8d2fc", + "0x171fe856a06044c8", + "0xe64583ffa655cc1b", + "0x1be0485b6ef8c092", + "0xb52f6201c0ad6c99", + "0x1fe856a021b463e3", + "0x4583ffa655cc1b17", + "0xe0485b6ef8c092e6", + "0x2f6201c0ad6c991b", + "0x1b921b463e3b5", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x826772cb772d0485", + "0xf343ba5584808813", + "0x31762f6874654799", + "0x6e696c2f302e302e", + "0x342e316f672f7875", + "0x55cc000f10a0322e", + "0xa8e962e2d05fa0a5", + "0xfac3f646fe49ae4", + "0xcefce3a02ba01623", + "0xfcfb7d1f886a62a5", + "0xed236b96" + ], + "rlp_bytes_len": 532, + "proof": { + "leaf_idx": 36240343, + "mmr_path": [ + "0x0fe8ea29743da65224281de074bd6a4587f7844e7bf38b506eb73293a634c40", + "0x16cc42fe58b25cf8a0cf848c92401929a903cc9dd2d0dda90ed4a0ff7bd5380", + "0x6eb3587880c32049c5610d8994211e8499a87c1539984d204395d649257ffd6", + "0x5610dd4fddeca2d805384104a975a2aa165810614b7cf3ba3991c845088da3a", + "0x2a9ad6b36097b54d83efbffd3fc4e2eed5196cfa9e6372ef86deb1f3392da57", + "0x679c119f91a379ccbc6676ed8c4f001efec4aac33c9b0ae3aeb7252f7ab8c84", + "0x754770f8a3662e4c327e2e9ced3a8e5df146929971e4dd9f4049bb63add1cc1", + "0x63bd29f81e937666b38b9f79c5133fd259a13219881870140c8d782c8851534", + "0x2f4c027af113be4d7d326b3b52991d136341c4dd782713ed5e8e4032cf0c897", + "0x3060b57768080011068e3ac8042e021faf707fd08f305c1a5ef728967820326", + "0x6edfabcd67c8ca06715373fc1f7539c92749c9407672b242454bc6112ac9f00", + "0x4e46d26e0279143c7b49f3b3f2a45de0a006a78e00c46c876fa5f3a0ed3db1d", + "0x1302ccf7dddbb803d97b075bf7c2634c5877ed9c31ea3b0f688eff3bd15e812", + "0x0e458a32a01f0f9607b2532083577520bded45e431233e8b64c63619e0f4790", + "0x140e8fa45b8c34047224ebfb8e6234ac76e08da08de502e3b30a62d846c43d4", + "0x5565c746b5fb2c3721c9d25f2def725ea5d7b195eaf978cf1cafe4fed1e95f2", + "0x344d9891124ac18149b7463568a9860732fe4b1ef84c6b563a6fe77ba66a9c4", + "0x6c26801d6e2dd7a33550de8c6291fc76a5edb5770ca38c0c82ba2eb389bca0a", + "0x3c6b59b8b0288bb50bc50326a41a3dd26899801f2d3520b71ede8bcd9d108d1", + "0x0e6b4ae59b356b3fcb3eb87f63a4fb12b1464d18ea4560eb18810d7aa46f68d", + "0x536ff2c043d32e5b1a97b6613e406f49406f6b01bb4c95f9e3b1151f2cb9d73" + ] + } + }, + { + "rlp": [ + "0x20a86356a01202f9", + "0x8278d4772daece65", + "0x3bad07e9a2fabf47", + "0x60126fedb8346274", + "0x7d9b20a088240715", + "0x265af9bfe3d6038c", + "0x806ff5aaab82ab8f", + "0x99723cdfc7ba1362", + "0x701b947ba0769ab5", + "0x94be65cf8a33b447", + "0xd78a33c9c5e8a3c1", + "0x87b8df0ffaa07cd6", + "0x6a667b191828d8e4", + "0x7ee90b32d5916880", + "0x615939c9eb0759e4", + "0x171fe856a0b2ef53", + "0xe64583ffa655cc1b", + "0x1be0485b6ef8c092", + "0xb52f6201c0ad6c99", + "0x1fe856a021b463e3", + "0x4583ffa655cc1b17", + "0xe0485b6ef8c092e6", + "0x2f6201c0ad6c991b", + "0x1b921b463e3b5", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x826c7fdd14300485", + "0xf843ba5584808813", + "0x6e696f637469429a", + "0x2045485420736920", + "0x6168636b636f6c42", + "0x89e7a049a02e6e69", + "0x4dbb96b5f632b406", + "0xafaa9239e4a2677f", + "0x64a0fad1d9d0367f", + "0xd9d45688bf22b0f1", + "0x5a09a095db" + ], + "rlp_bytes_len": 533, + "proof": { + "leaf_idx": 36240332, + "mmr_path": [ + "0x746ec933b3aa71457cc645edd414b34df14b4dd7735f44a5a298c9e21939261", + "0x6c492ee6d3005505a7366d1f85e75c67cfaca17a20a1e1e5df7afb4384a43b9", + "0x4e8031f2fc1fcc151695ce4fb85944e14b3bb759f5199aea08cd0a4de873ef1", + "0x0c0311ba88ac05249a044bf42d757dd4de1ebe7cf3187b45e4138b1b4bcb613", + "0x020175e524a8f80a1212a5d9cdeff96c86f7848290710bcaf62a24165ea0d3e", + "0x679c119f91a379ccbc6676ed8c4f001efec4aac33c9b0ae3aeb7252f7ab8c84", + "0x754770f8a3662e4c327e2e9ced3a8e5df146929971e4dd9f4049bb63add1cc1", + "0x63bd29f81e937666b38b9f79c5133fd259a13219881870140c8d782c8851534", + "0x2f4c027af113be4d7d326b3b52991d136341c4dd782713ed5e8e4032cf0c897", + "0x3060b57768080011068e3ac8042e021faf707fd08f305c1a5ef728967820326", + "0x6edfabcd67c8ca06715373fc1f7539c92749c9407672b242454bc6112ac9f00", + "0x4e46d26e0279143c7b49f3b3f2a45de0a006a78e00c46c876fa5f3a0ed3db1d", + "0x1302ccf7dddbb803d97b075bf7c2634c5877ed9c31ea3b0f688eff3bd15e812", + "0x0e458a32a01f0f9607b2532083577520bded45e431233e8b64c63619e0f4790", + "0x140e8fa45b8c34047224ebfb8e6234ac76e08da08de502e3b30a62d846c43d4", + "0x5565c746b5fb2c3721c9d25f2def725ea5d7b195eaf978cf1cafe4fed1e95f2", + "0x344d9891124ac18149b7463568a9860732fe4b1ef84c6b563a6fe77ba66a9c4", + "0x6c26801d6e2dd7a33550de8c6291fc76a5edb5770ca38c0c82ba2eb389bca0a", + "0x3c6b59b8b0288bb50bc50326a41a3dd26899801f2d3520b71ede8bcd9d108d1", + "0x0e6b4ae59b356b3fcb3eb87f63a4fb12b1464d18ea4560eb18810d7aa46f68d", + "0x536ff2c043d32e5b1a97b6613e406f49406f6b01bb4c95f9e3b1151f2cb9d73" + ] + } + } + ] + } + ], + "accounts": [], + "storages": [], + "transactions": [], + "transaction_receipts": [] } ], "tasks": [ @@ -775,6 +1894,67 @@ "datalake_type": 0, "property_type": 3 } + }, + { + "type": "datalake_compute", + "context": { + "task_bytes_len": 128, + "encoded_task": [ + "0xca08ecbe6cef6b8a", + "0xecd94f24999e99e2", + "0x4a0fb7f8bfe8177d", + "0x83a4de96b3affad5", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0" + ], + "datalake_bytes_len": 256, + "encoded_datalake": [ + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x0", + "0x100000000000000", + "0x0", + "0x0", + "0x0", + "0x6400000000000000", + "0x0", + "0x0", + "0x0", + "0x6e00000000000000", + "0x0", + "0x0", + "0x0", + "0x100000000000000", + "0x0", + "0x0", + "0x0", + "0xc000000000000000", + "0x0", + "0x0", + "0x0", + "0x200000000000000", + "0x801", + "0x0", + "0x0", + "0x0" + ], + "datalake_type": 0, + "property_type": 1 + } } ] } \ No newline at end of file diff --git a/request.json b/request.json index fff3447e..74fe6628 100644 --- a/request.json +++ b/request.json @@ -14,6 +14,20 @@ "compute": { "aggregateFnId": "avg" } + }, + { + "type": "DatalakeCompute", + "datalake": { + "type": "BlockSampled", + "chainId": "ETHEREUM_MAINNET", + "blockRangeStart": 100, + "blockRangeEnd": 110, + "increment": 1, + "sampledProperty": "header.number" + }, + "compute": { + "aggregateFnId": "avg" + } } ] } From 0b070c00fbcd3f43e8e29a25d1ff99eea20d6bc2 Mon Sep 17 00:00:00 2001 From: Pia Date: Fri, 13 Sep 2024 14:33:46 +0900 Subject: [PATCH 20/29] fix: ci --- README.md | 2 +- hdp/src/preprocessor/compile/datalake.rs | 19 +++++++++++++------ hdp/src/preprocessor/compile/module.rs | 1 - hdp/src/provider/indexer.rs | 3 ++- 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 489016f7..f2128c5f 100644 --- a/README.md +++ b/README.md @@ -171,7 +171,7 @@ _Note: Fields marked with "-" are not applicable for the specified aggregate fun ```sh # CI check -cargo make run-ci-flow +just run-ci-flow ``` ### Local Run diff --git a/hdp/src/preprocessor/compile/datalake.rs b/hdp/src/preprocessor/compile/datalake.rs index c26533c0..1f8bf356 100644 --- a/hdp/src/preprocessor/compile/datalake.rs +++ b/hdp/src/preprocessor/compile/datalake.rs @@ -135,8 +135,10 @@ mod tests { assert_eq!(storage_proofs.1.len(), 1); let storage_proofs = storage_proofs.1.iter().next().unwrap(); assert_eq!(storage_proofs.proofs.len(), 6); - assert_eq!(results.transactions.len(), 0); - assert_eq!(results.transaction_receipts.len(), 0); + let tx_proofs = results.transactions.iter().next().unwrap(); + assert_eq!(tx_proofs.1.len(), 0); + let tx_receipt_proofs = results.transaction_receipts.iter().next().unwrap(); + assert_eq!(tx_receipt_proofs.1.len(), 0); // assert_eq!(results.mmr_metas.len(), 1); } @@ -181,11 +183,16 @@ mod tests { .compile(&compiler_config) .await .unwrap(); + // assert_eq!(results.headers.len(), 2); - assert_eq!(results.accounts.len(), 0); - assert_eq!(results.storages.len(), 0); - assert_eq!(results.transactions.len(), 10); - assert_eq!(results.transaction_receipts.len(), 11); + let accounts_proofs = results.accounts.iter().next().unwrap(); + assert_eq!(accounts_proofs.1.len(), 0); + let storages_proofs = results.storages.iter().next().unwrap(); + assert_eq!(storages_proofs.1.len(), 0); + let tx_proofs = results.transactions.iter().next().unwrap(); + assert_eq!(tx_proofs.1.len(), 10); + let tx_receipt_proofs = results.transaction_receipts.iter().next().unwrap(); + assert_eq!(tx_receipt_proofs.1.len(), 11); // assert_eq!(results.mmr_metas.len(), 1); } } diff --git a/hdp/src/preprocessor/compile/module.rs b/hdp/src/preprocessor/compile/module.rs index 9aac5470..2708c033 100644 --- a/hdp/src/preprocessor/compile/module.rs +++ b/hdp/src/preprocessor/compile/module.rs @@ -4,7 +4,6 @@ use crate::cairo_runner::dry_run::DryRunResult; use crate::cairo_runner::{cairo_dry_run, input::dry_run::DryRunnerProgramInput}; use crate::constant::DRY_CAIRO_RUN_OUTPUT_FILE; - use crate::primitives::processed_types::cairo_format; use crate::primitives::task::ExtendedModule; use crate::provider::key::categorize_fetch_keys; diff --git a/hdp/src/provider/indexer.rs b/hdp/src/provider/indexer.rs index 1929fb57..42684725 100644 --- a/hdp/src/provider/indexer.rs +++ b/hdp/src/provider/indexer.rs @@ -58,8 +58,9 @@ impl ChainId { /// How to use: /// ```rust /// use hdp::provider::indexer::{Indexer, IndexerError}; +/// use hdp::primitives::ChainId; /// -/// async fn call_indexer(chain_id: u64, block_range_start: u64, block_range_end: u64) -> Result<(), IndexerError> { +/// async fn call_indexer(chain_id: ChainId, block_range_start: u64, block_range_end: u64) -> Result<(), IndexerError> { /// let indexer = Indexer::new(chain_id); /// let response = indexer.get_headers_proof(block_range_start, block_range_end).await?; /// Ok(()) From f72a163840bc768b56875c01d3adda6748f6ae17 Mon Sep 17 00:00:00 2001 From: Pia Date: Fri, 13 Sep 2024 15:38:50 +0900 Subject: [PATCH 21/29] update header merge logic --- hdp/src/preprocessor/compile/datalake.rs | 78 ++- hdp/src/preprocessor/compile/mod.rs | 33 +- hdp/src/preprocessor/compile/module.rs | 178 +++--- hdp/src/preprocessor/compile/task.rs | 46 +- hdp/src/preprocessor/mod.rs | 6 +- .../processed_types/block_proofs.rs | 36 ++ input.json | 556 +++++++++--------- 7 files changed, 513 insertions(+), 420 deletions(-) diff --git a/hdp/src/preprocessor/compile/datalake.rs b/hdp/src/preprocessor/compile/datalake.rs index 1f8bf356..8369ffae 100644 --- a/hdp/src/preprocessor/compile/datalake.rs +++ b/hdp/src/preprocessor/compile/datalake.rs @@ -5,35 +5,53 @@ use tracing::{debug, info}; use super::{config::CompilerConfig, Compilable, CompilationResult, CompileError}; -pub async fn compile_datalake( - datalake: &DatalakeCompute, - compile_config: &CompilerConfig, -) -> Result { - info!("target task: {:#?}", datalake); - // ========== datalake ============== - let target_provider_config = compile_config - .provider_config - .get(&datalake.datalake.get_chain_id()) - .expect("target task's chain had not been configured."); - let provider = new_provider_from_config(target_provider_config); - let compiled_block_sampled = provider.fetch_proofs(datalake).await?; - debug!("values to aggregate : {:#?}", compiled_block_sampled.values); - - // ========== compute ============== - let aggregation_fn = &datalake.compute.aggregate_fn_id; - let fn_context = &datalake.compute.aggregate_fn_ctx; - let aggregated_result = - aggregation_fn.operation(&compiled_block_sampled.values, Some(fn_context.clone()))?; - - Ok(CompilationResult::from_single_chain( - datalake.datalake.get_chain_id().to_numeric_id(), - vec![aggregated_result], - compiled_block_sampled.mmr_with_headers, - compiled_block_sampled.accounts, - compiled_block_sampled.storages, - compiled_block_sampled.transactions, - compiled_block_sampled.transaction_receipts, - )) +impl Compilable for DatalakeCompute { + async fn compile( + &self, + compile_config: &CompilerConfig, + ) -> Result { + // Log the target datalake task being processed + info!("target task: {:#?}", self); + + // ========== Fetch Provider Configuration ============== + // Retrieve the provider configuration for the specific chain ID of the datalake + let chain_id = self.datalake.get_chain_id(); + let target_provider_config = compile_config + .provider_config + .get(&chain_id) + .expect("target task's chain had not been configured."); + + // Create a new provider instance from the configuration + let provider = new_provider_from_config(target_provider_config); + + // ========== Fetch Proofs ============== + // Fetch the proofs from the provider for the given datalake task + let compiled_block_sampled = provider.fetch_proofs(self).await?; + debug!("values to aggregate : {:#?}", compiled_block_sampled.values); + + // ========== Compute Aggregated Result ============== + // Get the aggregation function and its context from the datalake compute + let aggregation_function = &self.compute.aggregate_fn_id; + let function_context = &self.compute.aggregate_fn_ctx; + + // Compute the aggregated result using the fetched values and context + let aggregated_result = aggregation_function.operation( + &compiled_block_sampled.values, + Some(function_context.clone()), + )?; + + // ========== Return Compilation Result ============== + // Return the compilation result, which is specific to a single chain context + Ok(CompilationResult::from_single_chain( + chain_id.to_numeric_id(), + vec![aggregated_result], + compiled_block_sampled.mmr_with_headers, + compiled_block_sampled.accounts, + compiled_block_sampled.storages, + compiled_block_sampled.transactions, + compiled_block_sampled.transaction_receipts, + )) + } } pub type DatalakeComputeVec = Vec; @@ -46,7 +64,7 @@ impl Compilable for DatalakeComputeVec { let mut final_results = CompilationResult::default(); for datalake_compute in self { - let current_results = compile_datalake(datalake_compute, compile_config).await?; + let current_results = datalake_compute.compile(compile_config).await?; final_results.extend(current_results); } diff --git a/hdp/src/preprocessor/compile/mod.rs b/hdp/src/preprocessor/compile/mod.rs index 17e78721..33ff0e61 100644 --- a/hdp/src/preprocessor/compile/mod.rs +++ b/hdp/src/preprocessor/compile/mod.rs @@ -5,7 +5,9 @@ use std::hash::Hash; use std::collections::{HashMap, HashSet}; use thiserror::Error; -use crate::primitives::processed_types::block_proofs::{MMRWithHeader, ProcessedBlockProofs}; +use crate::primitives::processed_types::block_proofs::{ + convert_to_mmr_with_headers, mmr_with_header_vec_to_map, MMRWithHeader, ProcessedBlockProofs, +}; use crate::primitives::processed_types::{ account::ProcessedAccount, receipt::ProcessedReceipt, storage::ProcessedStorage, transaction::ProcessedTransaction, @@ -110,8 +112,7 @@ impl CompilationResult { self.task_results.extend(other.task_results); // Merge mmr_with_headers - // TODO: merge headers if there same mmr - merge_hash_maps(&mut self.mmr_with_headers, other.mmr_with_headers); + merge_header_mmr_maps(&mut self.mmr_with_headers, other.mmr_with_headers); // Merge accounts merge_hash_maps(&mut self.accounts, other.accounts); @@ -168,3 +169,29 @@ where base.entry(key).or_default().extend(value); } } + +// TODO too complicated. refactor with method in MMRWithHeader +fn merge_header_mmr_maps( + base: &mut HashMap>, + other: HashMap>, +) { + for (key, other_headers) in other { + base.entry(key) + .and_modify(|base_headers| { + // Merge using the extend method from MMRWithHeader + let mut new_headers = + mmr_with_header_vec_to_map(base_headers.iter().cloned().collect::>()); + for item in other_headers.clone() { + new_headers + .entry(item.mmr_meta) + .and_modify(|existing_headers| { + existing_headers.extend(item.headers.iter().cloned()); + }) + .or_insert_with(|| item.headers.into_iter().collect()); + } + let new_headers_vec = convert_to_mmr_with_headers(new_headers); + *base_headers = HashSet::from_iter(new_headers_vec); + }) + .or_insert(other_headers); + } +} diff --git a/hdp/src/preprocessor/compile/module.rs b/hdp/src/preprocessor/compile/module.rs index 2708c033..bf44a7aa 100644 --- a/hdp/src/preprocessor/compile/module.rs +++ b/hdp/src/preprocessor/compile/module.rs @@ -15,94 +15,106 @@ use std::path::PathBuf; use tracing::info; use super::config::CompilerConfig; -use super::{CompilationResult, CompileError}; +use super::{Compilable, CompilationResult, CompileError}; pub type ModuleVec = Vec; -pub async fn compile_modules( - modules: ModuleVec, - compile_config: &CompilerConfig, -) -> Result { - info!("target task: {:#?}", modules[0].task); - let dry_run_program_path = compile_config.dry_run_program_path.clone(); - - let input = generate_input(modules.to_vec(), PathBuf::from(DRY_CAIRO_RUN_OUTPUT_FILE)).await?; - let input_string = - serde_json::to_string_pretty(&input).expect("Failed to serialize module class"); - - // 2. run the dry run and get the fetch points - info!("2. Running dry-run... "); - let keys: DryRunResult = cairo_dry_run( - dry_run_program_path, - input_string, - compile_config.save_fetch_keys_file.clone(), - )?; - - if keys[0].program_hash != modules[0].task.program_hash { - return Err(CompileError::ClassHashMismatch); - } - - if keys.len() != 1 { - panic!("Multiple Modules are not supported"); - } - - let dry_runned_module = keys.into_iter().next().unwrap(); - let commit_results_maps = vec![dry_runned_module.result.to_combined_string().into()]; - - // 3. call provider using keys - let keys_maps_chain = categorize_fetch_keys(dry_runned_module.fetch_keys); - if keys_maps_chain.len() > 1 { - // TODO: This is temporary solution. Need to handle multiple chain id in future - panic!("Multiple chain id is not supported yet"); - } - - let mut accounts = HashMap::new(); - let mut storages = HashMap::new(); - let mut transactions = HashMap::new(); - let mut transaction_receipts = HashMap::new(); - let mut mmr_header_map = HashMap::new(); - - info!("3. Fetching proofs from provider..."); - for (chain_id, keys) in keys_maps_chain { - info!("target provider chain id: {}", chain_id); - let target_provider_config = compile_config - .provider_config - .get(&chain_id) - .expect("target task's chain had not been configured."); - let provider = new_provider_from_config(target_provider_config); - let results = provider.fetch_proofs_from_keys(keys).await?; - - mmr_header_map.insert( - chain_id.to_numeric_id(), - HashSet::from_iter(results.mmr_with_headers.into_iter()), - ); - accounts.insert( - chain_id.to_numeric_id(), - HashSet::from_iter(results.accounts.into_iter()), - ); - storages.insert( - chain_id.to_numeric_id(), - HashSet::from_iter(results.storages.into_iter()), - ); - transactions.insert( - chain_id.to_numeric_id(), - HashSet::from_iter(results.transactions.into_iter()), - ); - transaction_receipts.insert( - chain_id.to_numeric_id(), - HashSet::from_iter(results.transaction_receipts.into_iter()), +impl Compilable for ModuleVec { + async fn compile( + &self, + compile_config: &CompilerConfig, + ) -> Result { + // Log the target task for debugging purposes + info!("target task: {:#?}", self[0].task); + let dry_run_program_path = compile_config.dry_run_program_path.clone(); + + // Generate input for the dry run based on the extended modules + let dry_run_input = + generate_input(self.to_vec(), PathBuf::from(DRY_CAIRO_RUN_OUTPUT_FILE)).await?; + let input_string = + serde_json::to_string_pretty(&dry_run_input).expect("Failed to serialize module class"); + + // 2. Run the dry run and retrieve the fetch points + info!("2. Running dry-run... "); + let dry_run_results: DryRunResult = cairo_dry_run( + dry_run_program_path, + input_string, + compile_config.save_fetch_keys_file.clone(), + )?; + + // Check if the program hash matches the expected hash + if dry_run_results[0].program_hash != self[0].task.program_hash { + return Err(CompileError::ClassHashMismatch); + } + + // Ensure only one module is supported + if dry_run_results.len() != 1 { + panic!("Multiple Modules are not supported"); + } + + // Extract the dry run module result + let dry_run_module = dry_run_results.into_iter().next().unwrap(); + let commit_results = vec![dry_run_module.result.to_combined_string().into()]; + + // 3. Categorize fetch keys by chain ID + let categorized_keys = categorize_fetch_keys(dry_run_module.fetch_keys); + if categorized_keys.len() > 1 { + // TODO: This is a temporary solution. Need to handle multiple chain IDs in the future + panic!("Multiple chain IDs are not supported yet"); + } + + // Initialize maps to store fetched proofs grouped by chain ID + let mut accounts_map = HashMap::new(); + let mut storages_map = HashMap::new(); + let mut transactions_map = HashMap::new(); + let mut transaction_receipts_map = HashMap::new(); + let mut mmr_header_map = HashMap::new(); + + info!("3. Fetching proofs from provider..."); + // Loop through each chain ID and fetch proofs + for (chain_id, keys) in categorized_keys { + info!("target provider chain id: {}", chain_id); + let target_provider_config = compile_config + .provider_config + .get(&chain_id) + .expect("target task's chain had not been configured."); + let provider = new_provider_from_config(target_provider_config); + let results = provider.fetch_proofs_from_keys(keys).await?; + + // Update the maps with fetched results + mmr_header_map.insert( + chain_id.to_numeric_id(), + HashSet::from_iter(results.mmr_with_headers.into_iter()), + ); + accounts_map.insert( + chain_id.to_numeric_id(), + HashSet::from_iter(results.accounts.into_iter()), + ); + storages_map.insert( + chain_id.to_numeric_id(), + HashSet::from_iter(results.storages.into_iter()), + ); + transactions_map.insert( + chain_id.to_numeric_id(), + HashSet::from_iter(results.transactions.into_iter()), + ); + transaction_receipts_map.insert( + chain_id.to_numeric_id(), + HashSet::from_iter(results.transaction_receipts.into_iter()), + ); + } + + // Create and return the compilation result containing all relevant proofs + let compiled_result = CompilationResult::new( + commit_results, + mmr_header_map, + accounts_map, + storages_map, + transactions_map, + transaction_receipts_map, ); + Ok(compiled_result) } - - let compiled_result = CompilationResult::new( - commit_results_maps, - mmr_header_map, - accounts, - storages, - transactions, - transaction_receipts, - ); - Ok(compiled_result) } /// Generate input structure for preprocessor that need to pass to runner diff --git a/hdp/src/preprocessor/compile/task.rs b/hdp/src/preprocessor/compile/task.rs index 95bcfe2f..34801865 100644 --- a/hdp/src/preprocessor/compile/task.rs +++ b/hdp/src/preprocessor/compile/task.rs @@ -1,29 +1,29 @@ use crate::primitives::task::TaskEnvelope; -use super::{ - config::CompilerConfig, module::compile_modules, Compilable, CompilationResult, CompileError, -}; +use super::{config::CompilerConfig, Compilable, CompilationResult, CompileError}; -pub async fn compile_tasks( - tasks: &[TaskEnvelope], - compile_config: &CompilerConfig, -) -> Result { - let (datalakes, modules) = TaskEnvelope::divide_tasks(tasks.to_vec()); - let mut compiled_result = if !datalakes.is_empty() { - datalakes.compile(compile_config).await? - } else { - CompilationResult::default() - }; +impl Compilable for Vec { + async fn compile( + &self, + compile_config: &CompilerConfig, + ) -> Result { + let (datalakes, modules) = TaskEnvelope::divide_tasks(self.to_vec()); + let mut compiled_result = if !datalakes.is_empty() { + datalakes.compile(compile_config).await? + } else { + CompilationResult::default() + }; - let module_compile_result = if !modules.is_empty() { - compile_modules(modules, compile_config).await? - } else { - CompilationResult::default() - }; - compiled_result.extend(module_compile_result); - if compiled_result == CompilationResult::default() { - Err(CompileError::CompilationFailed) - } else { - Ok(compiled_result) + let module_compile_result = if !modules.is_empty() { + modules.compile(compile_config).await? + } else { + CompilationResult::default() + }; + compiled_result.extend(module_compile_result); + if compiled_result == CompilationResult::default() { + Err(CompileError::CompilationFailed) + } else { + Ok(compiled_result) + } } } diff --git a/hdp/src/preprocessor/mod.rs b/hdp/src/preprocessor/mod.rs index 89bf5dec..97784f20 100644 --- a/hdp/src/preprocessor/mod.rs +++ b/hdp/src/preprocessor/mod.rs @@ -12,8 +12,7 @@ use crate::primitives::task::TaskEnvelope; use alloy::dyn_abi::DynSolValue; use alloy::primitives::{Bytes, B256}; use compile::config::CompilerConfig; -use compile::task::compile_tasks; -use compile::CompileError; +use compile::{Compilable, CompileError}; use thiserror::Error; use tracing::{debug, info}; @@ -49,7 +48,8 @@ impl PreProcessor { tasks: Vec, ) -> Result { // 1. compile the given tasks - let compiled_results = compile_tasks(&tasks, &self.compile_config) + let compiled_results = tasks + .compile(&self.compile_config) .await .map_err(PreProcessorError::CompileError)?; diff --git a/hdp/src/primitives/processed_types/block_proofs.rs b/hdp/src/primitives/processed_types/block_proofs.rs index 16bda303..a19ce135 100644 --- a/hdp/src/primitives/processed_types/block_proofs.rs +++ b/hdp/src/primitives/processed_types/block_proofs.rs @@ -25,6 +25,42 @@ pub struct MMRWithHeader { pub headers: Vec, } +pub fn mmr_with_header_vec_to_map( + target: Vec, +) -> HashMap> { + let mut map = HashMap::new(); + for target_item in target { + map.entry(target_item.mmr_meta) + .and_modify(|existing_headers: &mut HashSet| { + existing_headers.extend(target_item.headers.iter().cloned()); + }) + .or_insert_with(|| target_item.headers.into_iter().collect()); + } + map +} + +impl MMRWithHeader { + pub fn to_map(self) -> HashMap> { + let mut map = HashMap::new(); + map.insert(self.mmr_meta, HashSet::from_iter(self.headers)); + map + } + + pub fn extend(self, other: MMRWithHeader) -> Vec { + let mut self_map = self.to_map(); + let other_map = other.to_map(); + for (mmr, headers) in other_map { + self_map + .entry(mmr) + .and_modify(|existing_headers| { + existing_headers.extend(headers.iter().cloned()); + }) + .or_insert_with(|| headers.into_iter().collect()); + } + convert_to_mmr_with_headers(self_map) + } +} + pub fn convert_to_mmr_with_headers( map: HashMap>, ) -> Vec { diff --git a/input.json b/input.json index 1633d791..dd1738af 100644 --- a/input.json +++ b/input.json @@ -738,22 +738,22 @@ "headers": [ { "rlp": [ - "0x3d7ffc23a01202f9", - "0x237972985e58b217", - "0x11cfd713db7954d1", - "0x5f0c8823b51b2f3b", - "0x4dcc1da0a4cdf29f", + "0x3a0f1116a01102f9", + "0xd7cf22ece25d89a1", + "0x952a114d721f7546", + "0x3b52a15828b6713c", + "0x4dcc1da064dcf350", "0xb585ab7a5dc7dee8", "0x4512d31ad4ccb667", "0x42a1f013748a941b", - "0x701b944793d440fd", - "0x94be65cf8a33b447", - "0xd78a33c9c5e8a3c1", - "0xa1258068cca07cd6", - "0x6b20b793cc5e092e", - "0x14dcedce5dfb1061", - "0x2bf30db13f05f2aa", - "0x171fe856a0d07f70", + "0x9228944793d440fd", + "0xf0c0f4849d2c4e1e", + "0xa05157f491b9cec0", + "0x3a63aec9f7a093fe", + "0x7d1fe3738ca49203", + "0x50c9fcc741ff1b7f", + "0xecfec748d4a8d2fc", + "0x171fe856a06044c8", "0xe64583ffa655cc1b", "0x1be0485b6ef8c092", "0xb52f6201c0ad6c99", @@ -794,27 +794,27 @@ "0x0", "0x0", "0x0", - "0x826d1ae09a300485", - "0xfb43ba5584808813", - "0x6e696f637469429a", - "0x2045485420736920", - "0x6168636b636f6c42", - "0x1b7014dfa02e6e69", - "0xe4569963d5d3d61a", - "0xa78931de60092563", - "0x42606f1ad738cb26", - "0x6b8e388872ea5df4", - "0xb74721c237" + "0x826772cb772d0485", + "0xf343ba5584808813", + "0x31762f6874654799", + "0x6e696c2f302e302e", + "0x342e316f672f7875", + "0x55cc000f10a0322e", + "0xa8e962e2d05fa0a5", + "0xfac3f646fe49ae4", + "0xcefce3a02ba01623", + "0xfcfb7d1f886a62a5", + "0xed236b96" ], - "rlp_bytes_len": 533, + "rlp_bytes_len": 532, "proof": { - "leaf_idx": 36240331, + "leaf_idx": 36240343, "mmr_path": [ - "0x0c4ba48ac824c2e6c683c69cdc2f0be7258c19da079eaae99d30d4faf46956b", - "0x6c492ee6d3005505a7366d1f85e75c67cfaca17a20a1e1e5df7afb4384a43b9", - "0x4e8031f2fc1fcc151695ce4fb85944e14b3bb759f5199aea08cd0a4de873ef1", - "0x0c0311ba88ac05249a044bf42d757dd4de1ebe7cf3187b45e4138b1b4bcb613", - "0x020175e524a8f80a1212a5d9cdeff96c86f7848290710bcaf62a24165ea0d3e", + "0x0fe8ea29743da65224281de074bd6a4587f7844e7bf38b506eb73293a634c40", + "0x16cc42fe58b25cf8a0cf848c92401929a903cc9dd2d0dda90ed4a0ff7bd5380", + "0x6eb3587880c32049c5610d8994211e8499a87c1539984d204395d649257ffd6", + "0x5610dd4fddeca2d805384104a975a2aa165810614b7cf3ba3991c845088da3a", + "0x2a9ad6b36097b54d83efbffd3fc4e2eed5196cfa9e6372ef86deb1f3392da57", "0x679c119f91a379ccbc6676ed8c4f001efec4aac33c9b0ae3aeb7252f7ab8c84", "0x754770f8a3662e4c327e2e9ced3a8e5df146929971e4dd9f4049bb63add1cc1", "0x63bd29f81e937666b38b9f79c5133fd259a13219881870140c8d782c8851534", @@ -836,22 +836,22 @@ }, { "rlp": [ - "0x59c5ef07a01802f9", - "0x8eb07e7e6e5d78e", - "0x632d77b2dff21071", - "0x966d69f4758b5055", - "0x4dcc1da0ec47f7d0", + "0xde7e2dfa01602f9", + "0xcbce0111546a116c", + "0x5f12622d40d756b2", + "0xc9ed497d609bdc6d", + "0x4dcc1da0645c8289", "0xb585ab7a5dc7dee8", "0x4512d31ad4ccb667", "0x42a1f013748a941b", - "0xe3d7944793d440fd", - "0x5b0f80d1c110e30a", - "0x1f2e5bf97aaa1b64", - "0xe9e99cfe11a08cd9", - "0x6e2f92181c2decaf", - "0xe9fcf5409c313e51", - "0x9039ad0380873134", - "0x171fe856a0c8c02e", + "0x7bbb944793d440fd", + "0x4a4733a9f0f38782", + "0x7977a9bc2ce4ea79", + "0x36dc0065c6a07111", + "0x861ab086894afb0", + "0x3e03a650afb8d194", + "0x66dc6e2393ba924d", + "0x171fe856a0019c64", "0xe64583ffa655cc1b", "0x1be0485b6ef8c092", "0xb52f6201c0ad6c99", @@ -892,28 +892,28 @@ "0x0", "0x0", "0x0", - "0x826a810a092f0485", - "0xf643ba5584808813", - "0x6c6b2f68746547a0", - "0x31762f657275736f", - "0x3763662d302e302e", - "0x696c2f6432336439", - "0x8d6ce050679ea06e", - "0xb725fb259b007c07", - "0xfda91c0e86a9ea55", - "0x490f0471f8b0b6f1", - "0x2d18f6cd80882dc8", - "0x5fed50" + "0x82659a9f6c2c0485", + "0xed43ba5584808813", + "0x564c2f687465479e", + "0x2e302e31762f5649", + "0x2f78756e696c2f30", + "0xa0322e342e316f67", + "0x5ca1d568bcf186f0", + "0xa0e8827e01c26ad0", + "0x24a2967866d69923", + "0x8da0250460325ab6", + "0x6e49c0ffd7874588", + "0xa5" ], - "rlp_bytes_len": 539, + "rlp_bytes_len": 537, "proof": { - "leaf_idx": 36240335, + "leaf_idx": 36240347, "mmr_path": [ - "0x5ab2f147c7e0a140ab86a7c30290a00a5cd60f4aa43e9360d94360b588c07f1", - "0x72091005b55c4a2570fc6e0efd9103701b2497c17ca75359cf47f3a86e46e86", - "0x4e8031f2fc1fcc151695ce4fb85944e14b3bb759f5199aea08cd0a4de873ef1", - "0x0c0311ba88ac05249a044bf42d757dd4de1ebe7cf3187b45e4138b1b4bcb613", - "0x020175e524a8f80a1212a5d9cdeff96c86f7848290710bcaf62a24165ea0d3e", + "0x5a9c9bf362258e22ccd4fa91d6ef80f03d8cd809b7ee2a02dac6bd86ca23506", + "0x0c430c0fcdb2ac17f77da1b2636f7b3571e286fc8158dc6df148da5a88937cf", + "0x155fdf4bfe0fce2431ef276559c02370b222d33a9465f3fba3071ceaf81082b", + "0x5610dd4fddeca2d805384104a975a2aa165810614b7cf3ba3991c845088da3a", + "0x2a9ad6b36097b54d83efbffd3fc4e2eed5196cfa9e6372ef86deb1f3392da57", "0x679c119f91a379ccbc6676ed8c4f001efec4aac33c9b0ae3aeb7252f7ab8c84", "0x754770f8a3662e4c327e2e9ced3a8e5df146929971e4dd9f4049bb63add1cc1", "0x63bd29f81e937666b38b9f79c5133fd259a13219881870140c8d782c8851534", @@ -935,22 +935,22 @@ }, { "rlp": [ - "0xde7e2dfa01602f9", - "0xcbce0111546a116c", - "0x5f12622d40d756b2", - "0xc9ed497d609bdc6d", - "0x4dcc1da0645c8289", + "0x2fd664fa01102f9", + "0x7ef919c1bb1e6841", + "0x8f6e7bb836102c95", + "0x9b7a5c4cd8c5f564", + "0x4dcc1da0ccfdebb1", "0xb585ab7a5dc7dee8", "0x4512d31ad4ccb667", "0x42a1f013748a941b", - "0x7bbb944793d440fd", - "0x4a4733a9f0f38782", - "0x7977a9bc2ce4ea79", - "0x36dc0065c6a07111", - "0x861ab086894afb0", - "0x3e03a650afb8d194", - "0x66dc6e2393ba924d", - "0x171fe856a0019c64", + "0x9228944793d440fd", + "0xf0c0f4849d2c4e1e", + "0xa05157f491b9cec0", + "0xce47746002a093fe", + "0x1d5acf73d8e391f6", + "0x473135131820ac88", + "0x7a75ec8917630dee", + "0x171fe856a06bfacc", "0xe64583ffa655cc1b", "0x1be0485b6ef8c092", "0xb52f6201c0ad6c99", @@ -991,26 +991,25 @@ "0x0", "0x0", "0x0", - "0x82659a9f6c2c0485", - "0xed43ba5584808813", - "0x564c2f687465479e", - "0x2e302e31762f5649", - "0x2f78756e696c2f30", - "0xa0322e342e316f67", - "0x5ca1d568bcf186f0", - "0xa0e8827e01c26ad0", - "0x24a2967866d69923", - "0x8da0250460325ab6", - "0x6e49c0ffd7874588", - "0xa5" + "0x82662d2df22c0485", + "0xef43ba5584808813", + "0x31762f6874654799", + "0x6e696c2f302e302e", + "0x342e316f672f7875", + "0x28247627f3a0322e", + "0xfb970edbf3e4b12c", + "0xb9d6c14f6739e52b", + "0x73cace4e0191ccc3", + "0xccee368d88a83b08", + "0x8e7aa2" ], - "rlp_bytes_len": 537, + "rlp_bytes_len": 532, "proof": { - "leaf_idx": 36240347, + "leaf_idx": 36240344, "mmr_path": [ - "0x5a9c9bf362258e22ccd4fa91d6ef80f03d8cd809b7ee2a02dac6bd86ca23506", - "0x0c430c0fcdb2ac17f77da1b2636f7b3571e286fc8158dc6df148da5a88937cf", - "0x155fdf4bfe0fce2431ef276559c02370b222d33a9465f3fba3071ceaf81082b", + "0x3e95e28eddd8a12ce454111a1764bfee096bf690567aa9c0bd8ea4de657b4b5", + "0x16cc42fe58b25cf8a0cf848c92401929a903cc9dd2d0dda90ed4a0ff7bd5380", + "0x6eb3587880c32049c5610d8994211e8499a87c1539984d204395d649257ffd6", "0x5610dd4fddeca2d805384104a975a2aa165810614b7cf3ba3991c845088da3a", "0x2a9ad6b36097b54d83efbffd3fc4e2eed5196cfa9e6372ef86deb1f3392da57", "0x679c119f91a379ccbc6676ed8c4f001efec4aac33c9b0ae3aeb7252f7ab8c84", @@ -1231,22 +1230,22 @@ }, { "rlp": [ - "0x7d0cf0dba01802f9", - "0xbf6da4d5b2163390", - "0xf8cc02317a3129cf", - "0x3fdef2c08752bed", - "0x4dcc1da0ec98e04e", + "0xdaf3be39a01602f9", + "0x60571b78024ed12c", + "0xff9b14066642dc50", + "0x7e41653ef44a7a93", + "0x4dcc1da013c7986e", "0xb585ab7a5dc7dee8", "0x4512d31ad4ccb667", "0x42a1f013748a941b", - "0xe3d7944793d440fd", - "0x5b0f80d1c110e30a", - "0x1f2e5bf97aaa1b64", - "0x29114073bca08cd9", - "0x736fe86564f427b6", - "0x33af0cd7a3230278", - "0xf48845d82d66672d", - "0x171fe856a0105e9f", + "0x7bbb944793d440fd", + "0x4a4733a9f0f38782", + "0x7977a9bc2ce4ea79", + "0xe7e8f3384aa07111", + "0x8cd0073c84e70d31", + "0x92d9723e59275681", + "0xf1f26e2945b08333", + "0x171fe856a07e3dd9", "0xe64583ffa655cc1b", "0x1be0485b6ef8c092", "0xb52f6201c0ad6c99", @@ -1287,28 +1286,28 @@ "0x0", "0x0", "0x0", - "0x826ba2eb8e2f0485", - "0xf743ba5584808813", - "0x6c6b2f68746547a0", - "0x31762f657275736f", - "0x3763662d302e302e", - "0x696c2f6432336439", - "0x56fa7071f598a06e", - "0xb6ca6215c80cc2a9", - "0xde97ba01144cc022", - "0xc792873da26f71ce", - "0x521e9e640e880c5c", - "0xeece4f" + "0x82686b7afd2d0485", + "0xf443ba5584808813", + "0x564c2f687465479e", + "0x2e302e31762f5649", + "0x2f78756e696c2f30", + "0xa0322e342e316f67", + "0xcaa260b222a003b9", + "0x8552d0a224db1987", + "0x7d3d044431faff09", + "0x68555a04ed249c1f", + "0x331d9e664ba6dd88", + "0x36" ], - "rlp_bytes_len": 539, + "rlp_bytes_len": 537, "proof": { - "leaf_idx": 36240334, + "leaf_idx": 36240341, "mmr_path": [ - "0x40deb09802713fa1dbb58a928db4e042fdbabfc6c5d6a71de3e89b98b21813b", - "0x72091005b55c4a2570fc6e0efd9103701b2497c17ca75359cf47f3a86e46e86", - "0x4e8031f2fc1fcc151695ce4fb85944e14b3bb759f5199aea08cd0a4de873ef1", - "0x0c0311ba88ac05249a044bf42d757dd4de1ebe7cf3187b45e4138b1b4bcb613", - "0x020175e524a8f80a1212a5d9cdeff96c86f7848290710bcaf62a24165ea0d3e", + "0x5fdd37a283d8f0942d06f492682460b5c133e670b6b85ff4792aa5e4186020e", + "0x3a5c0170d4a7a2f383c4aaaf3621e2d1b423cd5675b55b40c999adb60be74df", + "0x6eb3587880c32049c5610d8994211e8499a87c1539984d204395d649257ffd6", + "0x5610dd4fddeca2d805384104a975a2aa165810614b7cf3ba3991c845088da3a", + "0x2a9ad6b36097b54d83efbffd3fc4e2eed5196cfa9e6372ef86deb1f3392da57", "0x679c119f91a379ccbc6676ed8c4f001efec4aac33c9b0ae3aeb7252f7ab8c84", "0x754770f8a3662e4c327e2e9ced3a8e5df146929971e4dd9f4049bb63add1cc1", "0x63bd29f81e937666b38b9f79c5133fd259a13219881870140c8d782c8851534", @@ -1330,22 +1329,22 @@ }, { "rlp": [ - "0x2fd664fa01102f9", - "0x7ef919c1bb1e6841", - "0x8f6e7bb836102c95", - "0x9b7a5c4cd8c5f564", - "0x4dcc1da0ccfdebb1", - "0xb585ab7a5dc7dee8", - "0x4512d31ad4ccb667", + "0x59c5ef07a01802f9", + "0x8eb07e7e6e5d78e", + "0x632d77b2dff21071", + "0x966d69f4758b5055", + "0x4dcc1da0ec47f7d0", + "0xb585ab7a5dc7dee8", + "0x4512d31ad4ccb667", "0x42a1f013748a941b", - "0x9228944793d440fd", - "0xf0c0f4849d2c4e1e", - "0xa05157f491b9cec0", - "0xce47746002a093fe", - "0x1d5acf73d8e391f6", - "0x473135131820ac88", - "0x7a75ec8917630dee", - "0x171fe856a06bfacc", + "0xe3d7944793d440fd", + "0x5b0f80d1c110e30a", + "0x1f2e5bf97aaa1b64", + "0xe9e99cfe11a08cd9", + "0x6e2f92181c2decaf", + "0xe9fcf5409c313e51", + "0x9039ad0380873134", + "0x171fe856a0c8c02e", "0xe64583ffa655cc1b", "0x1be0485b6ef8c092", "0xb52f6201c0ad6c99", @@ -1386,27 +1385,28 @@ "0x0", "0x0", "0x0", - "0x82662d2df22c0485", - "0xef43ba5584808813", - "0x31762f6874654799", - "0x6e696c2f302e302e", - "0x342e316f672f7875", - "0x28247627f3a0322e", - "0xfb970edbf3e4b12c", - "0xb9d6c14f6739e52b", - "0x73cace4e0191ccc3", - "0xccee368d88a83b08", - "0x8e7aa2" + "0x826a810a092f0485", + "0xf643ba5584808813", + "0x6c6b2f68746547a0", + "0x31762f657275736f", + "0x3763662d302e302e", + "0x696c2f6432336439", + "0x8d6ce050679ea06e", + "0xb725fb259b007c07", + "0xfda91c0e86a9ea55", + "0x490f0471f8b0b6f1", + "0x2d18f6cd80882dc8", + "0x5fed50" ], - "rlp_bytes_len": 532, + "rlp_bytes_len": 539, "proof": { - "leaf_idx": 36240344, + "leaf_idx": 36240335, "mmr_path": [ - "0x3e95e28eddd8a12ce454111a1764bfee096bf690567aa9c0bd8ea4de657b4b5", - "0x16cc42fe58b25cf8a0cf848c92401929a903cc9dd2d0dda90ed4a0ff7bd5380", - "0x6eb3587880c32049c5610d8994211e8499a87c1539984d204395d649257ffd6", - "0x5610dd4fddeca2d805384104a975a2aa165810614b7cf3ba3991c845088da3a", - "0x2a9ad6b36097b54d83efbffd3fc4e2eed5196cfa9e6372ef86deb1f3392da57", + "0x5ab2f147c7e0a140ab86a7c30290a00a5cd60f4aa43e9360d94360b588c07f1", + "0x72091005b55c4a2570fc6e0efd9103701b2497c17ca75359cf47f3a86e46e86", + "0x4e8031f2fc1fcc151695ce4fb85944e14b3bb759f5199aea08cd0a4de873ef1", + "0x0c0311ba88ac05249a044bf42d757dd4de1ebe7cf3187b45e4138b1b4bcb613", + "0x020175e524a8f80a1212a5d9cdeff96c86f7848290710bcaf62a24165ea0d3e", "0x679c119f91a379ccbc6676ed8c4f001efec4aac33c9b0ae3aeb7252f7ab8c84", "0x754770f8a3662e4c327e2e9ced3a8e5df146929971e4dd9f4049bb63add1cc1", "0x63bd29f81e937666b38b9f79c5133fd259a13219881870140c8d782c8851534", @@ -1428,22 +1428,22 @@ }, { "rlp": [ - "0xdaf3be39a01602f9", - "0x60571b78024ed12c", - "0xff9b14066642dc50", - "0x7e41653ef44a7a93", - "0x4dcc1da013c7986e", + "0x7d0cf0dba01802f9", + "0xbf6da4d5b2163390", + "0xf8cc02317a3129cf", + "0x3fdef2c08752bed", + "0x4dcc1da0ec98e04e", "0xb585ab7a5dc7dee8", "0x4512d31ad4ccb667", "0x42a1f013748a941b", - "0x7bbb944793d440fd", - "0x4a4733a9f0f38782", - "0x7977a9bc2ce4ea79", - "0xe7e8f3384aa07111", - "0x8cd0073c84e70d31", - "0x92d9723e59275681", - "0xf1f26e2945b08333", - "0x171fe856a07e3dd9", + "0xe3d7944793d440fd", + "0x5b0f80d1c110e30a", + "0x1f2e5bf97aaa1b64", + "0x29114073bca08cd9", + "0x736fe86564f427b6", + "0x33af0cd7a3230278", + "0xf48845d82d66672d", + "0x171fe856a0105e9f", "0xe64583ffa655cc1b", "0x1be0485b6ef8c092", "0xb52f6201c0ad6c99", @@ -1484,28 +1484,28 @@ "0x0", "0x0", "0x0", - "0x82686b7afd2d0485", - "0xf443ba5584808813", - "0x564c2f687465479e", - "0x2e302e31762f5649", - "0x2f78756e696c2f30", - "0xa0322e342e316f67", - "0xcaa260b222a003b9", - "0x8552d0a224db1987", - "0x7d3d044431faff09", - "0x68555a04ed249c1f", - "0x331d9e664ba6dd88", - "0x36" + "0x826ba2eb8e2f0485", + "0xf743ba5584808813", + "0x6c6b2f68746547a0", + "0x31762f657275736f", + "0x3763662d302e302e", + "0x696c2f6432336439", + "0x56fa7071f598a06e", + "0xb6ca6215c80cc2a9", + "0xde97ba01144cc022", + "0xc792873da26f71ce", + "0x521e9e640e880c5c", + "0xeece4f" ], - "rlp_bytes_len": 537, + "rlp_bytes_len": 539, "proof": { - "leaf_idx": 36240341, + "leaf_idx": 36240334, "mmr_path": [ - "0x5fdd37a283d8f0942d06f492682460b5c133e670b6b85ff4792aa5e4186020e", - "0x3a5c0170d4a7a2f383c4aaaf3621e2d1b423cd5675b55b40c999adb60be74df", - "0x6eb3587880c32049c5610d8994211e8499a87c1539984d204395d649257ffd6", - "0x5610dd4fddeca2d805384104a975a2aa165810614b7cf3ba3991c845088da3a", - "0x2a9ad6b36097b54d83efbffd3fc4e2eed5196cfa9e6372ef86deb1f3392da57", + "0x40deb09802713fa1dbb58a928db4e042fdbabfc6c5d6a71de3e89b98b21813b", + "0x72091005b55c4a2570fc6e0efd9103701b2497c17ca75359cf47f3a86e46e86", + "0x4e8031f2fc1fcc151695ce4fb85944e14b3bb759f5199aea08cd0a4de873ef1", + "0x0c0311ba88ac05249a044bf42d757dd4de1ebe7cf3187b45e4138b1b4bcb613", + "0x020175e524a8f80a1212a5d9cdeff96c86f7848290710bcaf62a24165ea0d3e", "0x679c119f91a379ccbc6676ed8c4f001efec4aac33c9b0ae3aeb7252f7ab8c84", "0x754770f8a3662e4c327e2e9ced3a8e5df146929971e4dd9f4049bb63add1cc1", "0x63bd29f81e937666b38b9f79c5133fd259a13219881870140c8d782c8851534", @@ -1527,22 +1527,22 @@ }, { "rlp": [ - "0xe69ccacaa01802f9", - "0x76824202634435b4", - "0xb6b2025db864372c", - "0xdc5c0da3a037e380", - "0x4dcc1da0e2450d6e", - "0xb585ab7a5dc7dee8", - "0x4512d31ad4ccb667", - "0x42a1f013748a941b", - "0xda19944793d440fd", - "0xcf4c0e961ef119fe", - "0x48d7eb9088aaa5c6", - "0x1e1c66601da01eca", - "0x3d40de4ba9c96402", - "0x9e5fb4bbab557f36", - "0x557b362ee5e84a53", - "0x171fe856a0b6aaec", + "0x20a86356a01202f9", + "0x8278d4772daece65", + "0x3bad07e9a2fabf47", + "0x60126fedb8346274", + "0x7d9b20a088240715", + "0x265af9bfe3d6038c", + "0x806ff5aaab82ab8f", + "0x99723cdfc7ba1362", + "0x701b947ba0769ab5", + "0x94be65cf8a33b447", + "0xd78a33c9c5e8a3c1", + "0x87b8df0ffaa07cd6", + "0x6a667b191828d8e4", + "0x7ee90b32d5916880", + "0x615939c9eb0759e4", + "0x171fe856a0b2ef53", "0xe64583ffa655cc1b", "0x1be0485b6ef8c092", "0xb52f6201c0ad6c99", @@ -1583,26 +1583,25 @@ "0x0", "0x0", "0x0", - "0x826e76f320310485", - "0x44ba5584808813", - "0x31762f68746547a0", - "0x6463302d302e302e", - "0x696c2f3734363763", - "0x2e316f672f78756e", - "0x7e0c746ae213a034", - "0xc7c9f881dd54f9fe", - "0x3ef06f3dd9de009e", - "0x2a7cda3b34304acf", - "0xf414e1b7a88d8c3", - "0x55074e" + "0x826c7fdd14300485", + "0xf843ba5584808813", + "0x6e696f637469429a", + "0x2045485420736920", + "0x6168636b636f6c42", + "0x89e7a049a02e6e69", + "0x4dbb96b5f632b406", + "0xafaa9239e4a2677f", + "0x64a0fad1d9d0367f", + "0xd9d45688bf22b0f1", + "0x5a09a095db" ], - "rlp_bytes_len": 539, + "rlp_bytes_len": 533, "proof": { - "leaf_idx": 36240328, + "leaf_idx": 36240332, "mmr_path": [ - "0x38de2bd5dec4dddf445b272515b27e054f7a023fba100a407d5d07098b7817d", - "0x33f3f88b4590dc4b6fb0b738a333da4465506e97bf52bfb65a044e8aed6c071", - "0x758843d03ff496efb935710f282862e286d45648548c2b418e5d848d0f045cb", + "0x746ec933b3aa71457cc645edd414b34df14b4dd7735f44a5a298c9e21939261", + "0x6c492ee6d3005505a7366d1f85e75c67cfaca17a20a1e1e5df7afb4384a43b9", + "0x4e8031f2fc1fcc151695ce4fb85944e14b3bb759f5199aea08cd0a4de873ef1", "0x0c0311ba88ac05249a044bf42d757dd4de1ebe7cf3187b45e4138b1b4bcb613", "0x020175e524a8f80a1212a5d9cdeff96c86f7848290710bcaf62a24165ea0d3e", "0x679c119f91a379ccbc6676ed8c4f001efec4aac33c9b0ae3aeb7252f7ab8c84", @@ -1626,22 +1625,22 @@ }, { "rlp": [ - "0x3a0f1116a01102f9", - "0xd7cf22ece25d89a1", - "0x952a114d721f7546", - "0x3b52a15828b6713c", - "0x4dcc1da064dcf350", + "0xe69ccacaa01802f9", + "0x76824202634435b4", + "0xb6b2025db864372c", + "0xdc5c0da3a037e380", + "0x4dcc1da0e2450d6e", "0xb585ab7a5dc7dee8", "0x4512d31ad4ccb667", "0x42a1f013748a941b", - "0x9228944793d440fd", - "0xf0c0f4849d2c4e1e", - "0xa05157f491b9cec0", - "0x3a63aec9f7a093fe", - "0x7d1fe3738ca49203", - "0x50c9fcc741ff1b7f", - "0xecfec748d4a8d2fc", - "0x171fe856a06044c8", + "0xda19944793d440fd", + "0xcf4c0e961ef119fe", + "0x48d7eb9088aaa5c6", + "0x1e1c66601da01eca", + "0x3d40de4ba9c96402", + "0x9e5fb4bbab557f36", + "0x557b362ee5e84a53", + "0x171fe856a0b6aaec", "0xe64583ffa655cc1b", "0x1be0485b6ef8c092", "0xb52f6201c0ad6c99", @@ -1682,27 +1681,28 @@ "0x0", "0x0", "0x0", - "0x826772cb772d0485", - "0xf343ba5584808813", - "0x31762f6874654799", - "0x6e696c2f302e302e", - "0x342e316f672f7875", - "0x55cc000f10a0322e", - "0xa8e962e2d05fa0a5", - "0xfac3f646fe49ae4", - "0xcefce3a02ba01623", - "0xfcfb7d1f886a62a5", - "0xed236b96" + "0x826e76f320310485", + "0x44ba5584808813", + "0x31762f68746547a0", + "0x6463302d302e302e", + "0x696c2f3734363763", + "0x2e316f672f78756e", + "0x7e0c746ae213a034", + "0xc7c9f881dd54f9fe", + "0x3ef06f3dd9de009e", + "0x2a7cda3b34304acf", + "0xf414e1b7a88d8c3", + "0x55074e" ], - "rlp_bytes_len": 532, + "rlp_bytes_len": 539, "proof": { - "leaf_idx": 36240343, + "leaf_idx": 36240328, "mmr_path": [ - "0x0fe8ea29743da65224281de074bd6a4587f7844e7bf38b506eb73293a634c40", - "0x16cc42fe58b25cf8a0cf848c92401929a903cc9dd2d0dda90ed4a0ff7bd5380", - "0x6eb3587880c32049c5610d8994211e8499a87c1539984d204395d649257ffd6", - "0x5610dd4fddeca2d805384104a975a2aa165810614b7cf3ba3991c845088da3a", - "0x2a9ad6b36097b54d83efbffd3fc4e2eed5196cfa9e6372ef86deb1f3392da57", + "0x38de2bd5dec4dddf445b272515b27e054f7a023fba100a407d5d07098b7817d", + "0x33f3f88b4590dc4b6fb0b738a333da4465506e97bf52bfb65a044e8aed6c071", + "0x758843d03ff496efb935710f282862e286d45648548c2b418e5d848d0f045cb", + "0x0c0311ba88ac05249a044bf42d757dd4de1ebe7cf3187b45e4138b1b4bcb613", + "0x020175e524a8f80a1212a5d9cdeff96c86f7848290710bcaf62a24165ea0d3e", "0x679c119f91a379ccbc6676ed8c4f001efec4aac33c9b0ae3aeb7252f7ab8c84", "0x754770f8a3662e4c327e2e9ced3a8e5df146929971e4dd9f4049bb63add1cc1", "0x63bd29f81e937666b38b9f79c5133fd259a13219881870140c8d782c8851534", @@ -1724,22 +1724,22 @@ }, { "rlp": [ - "0x20a86356a01202f9", - "0x8278d4772daece65", - "0x3bad07e9a2fabf47", - "0x60126fedb8346274", - "0x7d9b20a088240715", - "0x265af9bfe3d6038c", - "0x806ff5aaab82ab8f", - "0x99723cdfc7ba1362", - "0x701b947ba0769ab5", + "0x3d7ffc23a01202f9", + "0x237972985e58b217", + "0x11cfd713db7954d1", + "0x5f0c8823b51b2f3b", + "0x4dcc1da0a4cdf29f", + "0xb585ab7a5dc7dee8", + "0x4512d31ad4ccb667", + "0x42a1f013748a941b", + "0x701b944793d440fd", "0x94be65cf8a33b447", "0xd78a33c9c5e8a3c1", - "0x87b8df0ffaa07cd6", - "0x6a667b191828d8e4", - "0x7ee90b32d5916880", - "0x615939c9eb0759e4", - "0x171fe856a0b2ef53", + "0xa1258068cca07cd6", + "0x6b20b793cc5e092e", + "0x14dcedce5dfb1061", + "0x2bf30db13f05f2aa", + "0x171fe856a0d07f70", "0xe64583ffa655cc1b", "0x1be0485b6ef8c092", "0xb52f6201c0ad6c99", @@ -1780,23 +1780,23 @@ "0x0", "0x0", "0x0", - "0x826c7fdd14300485", - "0xf843ba5584808813", + "0x826d1ae09a300485", + "0xfb43ba5584808813", "0x6e696f637469429a", "0x2045485420736920", "0x6168636b636f6c42", - "0x89e7a049a02e6e69", - "0x4dbb96b5f632b406", - "0xafaa9239e4a2677f", - "0x64a0fad1d9d0367f", - "0xd9d45688bf22b0f1", - "0x5a09a095db" + "0x1b7014dfa02e6e69", + "0xe4569963d5d3d61a", + "0xa78931de60092563", + "0x42606f1ad738cb26", + "0x6b8e388872ea5df4", + "0xb74721c237" ], "rlp_bytes_len": 533, "proof": { - "leaf_idx": 36240332, + "leaf_idx": 36240331, "mmr_path": [ - "0x746ec933b3aa71457cc645edd414b34df14b4dd7735f44a5a298c9e21939261", + "0x0c4ba48ac824c2e6c683c69cdc2f0be7258c19da079eaae99d30d4faf46956b", "0x6c492ee6d3005505a7366d1f85e75c67cfaca17a20a1e1e5df7afb4384a43b9", "0x4e8031f2fc1fcc151695ce4fb85944e14b3bb759f5199aea08cd0a4de873ef1", "0x0c0311ba88ac05249a044bf42d757dd4de1ebe7cf3187b45e4138b1b4bcb613", From cc02d15da27ac3df519b2b64f73a0cc8976bc11c Mon Sep 17 00:00:00 2001 From: Pia Date: Fri, 13 Sep 2024 16:48:29 +0900 Subject: [PATCH 22/29] rm input --- input.json | 1960 -------------------------------------------------- request.json | 14 + 2 files changed, 14 insertions(+), 1960 deletions(-) delete mode 100644 input.json diff --git a/input.json b/input.json deleted file mode 100644 index dd1738af..00000000 --- a/input.json +++ /dev/null @@ -1,1960 +0,0 @@ -{ - "cairo_run_output_path": "cairo_run_output.json", - "task_root": "0xbe859097a63a9ce185a512324f9a051842c469770885e8c138fcf7cda4df2d1e", - "result_root": "0xa623e6db247a4bce704b58bbfef9617fb2a96ee9bad36a2088c65f1e4983e972", - "proofs": [ - { - "chain_id": 11155111, - "mmr_with_headers": [ - { - "mmr_meta": { - "id": 26, - "root": "0x5358fbe594d3e8fdb3f6f7bbbe979fc3a377851a21909ea7bc1821e15cc6c4e", - "size": 12899969, - "peaks": [ - "0x262c4c9b1cb2a036924aecf563dc9952e5f8b41004310adde86f22abb793eb1", - "0x63e06c6dd962e6232140b8f20fc4972ee69ca29d1c6ca4455d80afd4be0f3de", - "0x48c9781f73635713eb8ef52890c481f4438c576baf01b31bc7935d9d42c1244", - "0x068c923e9bcc3df411575563e88a81cdef49ef6c4307efad707a8538114b753", - "0x54a48cae0defc94286e03d5c3abc53a399db7eb6207140f8d6f8d7322c9d1fc", - "0x1f31aea9b689fdab066317c08c865ae3b134adef05a744965a5741119a6c094", - "0x41dc23c0b0c18e7cc1d3f7148feabbe30269080cbe9b6ead6b718a2d1176382", - "0x1d04bc7dd1b40becbbfdf6a6971ef0e1ffc873087ed75bb2163dd2615d366de", - "0x5f3202e8d32391896022ddb916b83f165d2d7486261304f3e029aad6258ba2c", - "0x3a98faad3cc3bdeee0f2a346469fe4e67d364c98f8f5adf03f472000194081c", - "0x48bb57587a1e690409d81b70f3fe2ee625f25f008ec0773e55a0e1293c9e025" - ] - }, - "headers": [ - { - "rlp": [ - "0x216f1eb0a05c02f9", - "0x4de0372b4bed3c60", - "0x8e23a0628d6c899f", - "0x65105b263ee0b4f5", - "0x4dcc1da057420e26", - "0xb585ab7a5dc7dee8", - "0x4512d31ad4ccb667", - "0x42a1f013748a941b", - "0xe2c6944793d440fd", - "0x6dca7ce2bf919945", - "0xe4a123da352f7286", - "0x9b608182bda097cb", - "0x29e3b5d6b2eb735d", - "0x453e78855ad3ad56", - "0x385cd72fd2f23ff9", - "0x6a7132d6a0e509c3", - "0x44cd18a4510c63cf", - "0x77919e8f9a1667c4", - "0x414bad92d40a9154", - "0x446e34a0813f946c", - "0xbe9450981b4e25eb", - "0x3dac7c23f5bb80be", - "0xf687f40adf699e82", - "0x1b9f087b04080", - "0xc8c910cce7c486d2", - "0xe59016a45e2698a1", - "0x82b4c33d7c5f5332", - "0xd446f24a5ed5b7cc", - "0xdf996f696b144e29", - "0xe24f0c6659dc1e54", - "0x4fa0a9d3141e3c9a", - "0xd9ecef0a2c5e6c94", - "0x2ac5a6ea467f7470", - "0x829130f6af92b658", - "0xe261af81856c3116", - "0x7b00b19847d30f60", - "0xdbc971aad011c5e7", - "0xd64f4cb7209bd6d0", - "0x70442fd0a28ca850", - "0x5c2cd3d036bc0140", - "0x9e437f250c8ac88f", - "0x9e28395a49ac6876", - "0xf6a43f3f0328bc0d", - "0xd9b4ecd529b403f8", - "0x59d6efe506742a33", - "0x7664561421b64d04", - "0x1c8f18660a1d4837", - "0x1c8ad7be7da7180c", - "0x47df73de1f95de05", - "0xd167b65b1edfe383", - "0x6b45c814dfc3b9d8", - "0x20e161a0d09691ac", - "0xb290d5b6ab793ef1", - "0x9a850b64eaf115a5", - "0x6274b7e9d0975fc9", - "0x94ee5d102c0a774b", - "0xc90184c546618380", - "0x8459b853018480c3", - "0x74657291bcaca266", - "0x332e302e31762f68", - "0x6ca078756e696c2f", - "0xd3a5a7ee7bde8cac", - "0x60f7893db4ae18f6", - "0x58536e554021926d", - "0x8887bc7cf3c65be6", - "0x0", - "0xe560a08f6e329484", - "0x1a6b0adc0ebec001", - "0x82c517e276bbf0d1", - "0x28ffa87f26c06564", - "0x283435c3242e723", - "0xaca0000098830000", - "0x73d11f799a08a6eb", - "0x1579c174a76155bc", - "0x9e37c7cb80c29381", - "0xacba28e2aceec8" - ], - "rlp_bytes_len": 607, - "proof": { - "leaf_idx": 12739496, - "mmr_path": [ - "0x291adc0ff3f5eb31376d2dc882c4a0b612ee00b536b484d9d68533db47b1a55", - "0x577884cce23db95312ef380a904afccab7fbd9cf34e84777adf2813bc92a413", - "0x71426cc21537949a45197dd3a57b397d86d3302dc894173068585b7631ebb25", - "0x6ebf678bb0eb572f157cf9ca66d1c27754c20986de0335382c12afd8fcd26fb", - "0x20dfc647656b4c039bf946a56d2695fd631a2226fd815a83b69e18b543b9dd5", - "0x1ea310f504c5c7c6d43642ba2c09fa8f66edd91a6d3e965dec30db6ec9aa030", - "0x18ca5daed2c274cf2215dd11b3c5875b740df446360af179c95a0ec53c58f13", - "0x59417edcf79f38992d51563fb1e2af608dff9f2371fef973b0cdac2febc526f", - "0x45a9615d78011e7752d3e3f3f6e11f0de5b8fe531a0959d0f6e5041e1b5ba6f", - "0x1e94c6fa131239300669cb31c1ced02d1ad800fac561e092ab8b843cb0e6111", - "0x767920b8e4e378c8a1e55f812ea4579e6deb7584eab1325bcf5bad57b442cf7", - "0x2bfb39d36fcf83d18b05565fb4ae8de38453d439db185160c0cb541df2255f7", - "0x3a5f673a2f7d7cacff677177483259b7b9161dde49603a3523909a74dcf58eb", - "0x63cb7951cbce300498bb8868a619f6ae7179d5ed1a5d832859e870de3e5c011", - "0x5dfc985941ef9d1bae4a5bcddb23a338c70248a43107555df4cc20f81423721", - "0x07a25a1fdea49b07bbf8231ad4e7c00dc020b85c183f91022abd7c7baf1f42d", - "0x3d088c444fcc7a0083f3cb9d95d56975d22a8ac1171fcf5c0d8fa325fcff4db" - ] - } - } - ] - } - ], - "accounts": [ - { - "address": [ - "0x5d89d5862ca7e8af", - "0x36b7d426ab6d61d6", - "0x2f4722cf" - ], - "account_key": "0x7fd6daf0de598ff611452d8eb4ec5f7e99e8ef74d175073be14cdc936830b5d3", - "proofs": [ - { - "block_number": 6375109, - "proof_bytes_len": [ - 532, - 532, - 532, - 532, - 532, - 404, - 83, - 104 - ], - "proof": [ - [ - "0x444e529da01102f9", - "0xf37544b888708d51", - "0x4c73181251ca8773", - "0xca042799a2381be", - "0x8f891aa08f7a0b4b", - "0x1a73b84327366212", - "0xe20ac0516697c8bd", - "0x6fc64891e36ca714", - "0xd808a02db30e1217", - "0x607e5eea121e89d4", - "0x17b487cd624bab57", - "0x3f5938c05a0ffbd6", - "0x7a081e913a93e5b", - "0x4cacd321d5a138bd", - "0xeea00b2128a12212", - "0x5320f46d51ce5b74", - "0xa0fcde49c74a4e21", - "0xf4f5e9953107eadd", - "0x9b742e5b58a0b03a", - "0xf840bf140ca4f854", - "0xbbcf9e589f3860ab", - "0xb2347ff3a6618ba0", - "0xd30ef52d45438b70", - "0x5d2ff37033210e6c", - "0xe8d2cdc675a9a230", - "0x7b6e8ca5b604a080", - "0xfdaff0383e2cf2f2", - "0x43b00d14850f7873", - "0x32259e9638884225", - "0xdb2a38f356a0d615", - "0xdd66b426e3ee70dc", - "0xcb2a87f92ce4f59a", - "0x3558c02b067b0f76", - "0xd441ac8aa0542ab1", - "0x33a7053e7510a439", - "0x7bfc53cb480af51", - "0x917e6bc2d32e31a0", - "0x7e22ca0a3172bee", - "0x171aa595ef249e65", - "0x208430e2b9b2840", - "0x374f95bcc70a084f", - "0xb982a06bc37beb57", - "0xa307195ab46d773d", - "0x7d158a83f588227c", - "0x9bdf8627dbf1a4b6", - "0x68a069b7ad9561fd", - "0x711bc0fd99a56731", - "0xe16f9014a1da14da", - "0x1998ccb79dd40fee", - "0xa084c2deda7009ad", - "0xfec128291c32139c", - "0xf45b263525bbc1bc", - "0xea18c1d000803bd8", - "0xbc6e26a2759645b1", - "0xe5b26ed4928d5a0", - "0xd261b3306613ca46", - "0x118fcfd107367472", - "0x5750921a2a88ba9f", - "0xa0383126830ca0d9", - "0xfe03bb87ac16126e", - "0xd1b081e732ece6fe", - "0x14dba318c57c7fe1", - "0x6c9c7b30cca06837", - "0xa523ed9e811d73ec", - "0x9b98ace58bd45b0c", - "0xd81bb282de7c44ee", - "0x8048f498" - ], - [ - "0x1be4de43a01102f9", - "0x5b34e092388e9421", - "0xbbd32e19fe740815", - "0x57057ce6e1f2644c", - "0x1d9df4a0a4e1c960", - "0x798f1be9df913cae", - "0xb30f19e7d6597147", - "0x11c742452bd94bf5", - "0x68e8a054ddb0b4ee", - "0xebfbe7754b250c66", - "0xae0ee2ae31a2188b", - "0x2810698530f06730", - "0x89a074edd683c4eb", - "0x5f97b1a37b93f4c8", - "0x71766d0f37c01dac", - "0xceb278e3002bf14a", - "0xa05fc915f988d02d", - "0x44096c084c7724ec", - "0x55ca8edd889c1770", - "0xc74bcb8a87a3b3c5", - "0x3deab16eedc763a3", - "0x958ebb0ed20204a0", - "0xe0d7842550e1f7fa", - "0x50378dcc62cf1f85", - "0x1f8580288af2906e", - "0x101b530e575ba0de", - "0x72c2c377c188c834", - "0x547c9b315322f81a", - "0xcae4953a6575c1e9", - "0x41b8d3a8a7a04482", - "0x6c10c919bc7e59fb", - "0x832c3b8673380b0e", - "0x6022da748383ca14", - "0x5668c9ca0dc3dd8", - "0x7c7f8ff768d7a1a3", - "0x2f2acbd07b06820d", - "0xb3b9895140569141", - "0x3b6e69a00740897b", - "0x26a2b25238b65af3", - "0xa386028d7baff6dc", - "0x11ad051616033e5d", - "0x96eea067010faa37", - "0xed9d9c9bcedf5af0", - "0x37fb98d62dbd1dd6", - "0x1f414dbe76c464fd", - "0xdaa08bc0cb33fc60", - "0xb08cb9c2085cfc71", - "0xe189139d5391d4e6", - "0x81d62c2a3dd95aec", - "0xa0dda1a58913281d", - "0xe1e15f468c7be8f4", - "0x65e2cfcdbc79758a", - "0x25ede651e43dd045", - "0x1a230ebf6ee33052", - "0x19d7bd1e8c7550a0", - "0x94ac7048d3482b8d", - "0x4712f434347bd5f3", - "0x880f325e69627cba", - "0x4771673871e9a0b2", - "0x76e996ee04ef431", - "0x2032636c635156d2", - "0x6fd0c2a5bab4d2", - "0xf91fee1389a05181", - "0xb27b11ed5629c41a", - "0xed1c9dcc37b3085d", - "0xd493606d4ca0d3d3", - "0x801bdb72" - ], - [ - "0x71b960fa01102f9", - "0xbe1fe01634ea6e64", - "0xf41a59ac121ab0c7", - "0x11e95a4610790b44", - "0xb55cb6a0d1fb205a", - "0xadc9623e6edbc11c", - "0xfddc0a1821ba0cf0", - "0xd53be648834ef0f0", - "0xdbb3a033efba1484", - "0x56bdb101631c76f", - "0xd7d4f6591a171443", - "0xae600196088ef39", - "0x5aa07ece61ce4d49", - "0xfde31c1a7f893138", - "0xcb4c4365813b31ac", - "0x44e9682ec2fb5add", - "0xa064828756abd703", - "0x658940a7e900dedf", - "0x9ca2692bc72e0dd9", - "0x98f612838e0975f6", - "0xc0df161b8509e12d", - "0x48cd9012fce98a0", - "0xe861b22ec42d85f7", - "0x3cdd46ba75e86818", - "0xaf04e750b297489e", - "0xc43beb370e43a015", - "0xdd1b4d4edbb176aa", - "0xa5c2422d0bf6e6c4", - "0xc55773d8da6facaa", - "0x24ff6b6229a083da", - "0xa99e9a8bcd8eda00", - "0x3c3feb7198579ee1", - "0x1f60a3b2c54965a3", - "0xa97bcaa2a0872921", - "0xacc08b0b6f7d237d", - "0x6800e1bcd674c94d", - "0xa8c833699d7d8aeb", - "0xb245eca05d102c80", - "0x6fb43714b5bad4d7", - "0x94f615ad1da741fb", - "0x6d2e560d0e41ff56", - "0xa4f6a0208423a3cf", - "0x5b2e046e7d074f35", - "0xa098289f7f01d0bd", - "0x2265a4a7bfebcecc", - "0x7ca007262c28d797", - "0x6af5f9ed4ff17ff1", - "0x8b88a3ee112ee6a3", - "0xca661abf2cb29191", - "0xa066abc586c64a8a", - "0x813b3cd8cb48fcd8", - "0x72494ff3567ed250", - "0xb1d3cd4907b614c2", - "0xf1256dd9567b6a94", - "0xddeea9f55da583a0", - "0xe51a6c75910e4d4a", - "0xaa1ef569451c7ad3", - "0x15c29d58e7b28540", - "0xc98d543b0a3ba0e1", - "0x4ac2a8d446a1bab8", - "0xb1924632c4a3a8d7", - "0x1fb62fac04c4a758", - "0x82068bfc8fa002cb", - "0xa49507b0d33f4ae8", - "0xeaa341d28d10ad45", - "0xe8b0b5a713f7300e", - "0x8062325a" - ], - [ - "0xf1af50daa01102f9", - "0xc45148a86edcfbfe", - "0x7ff915197b189f26", - "0x7f92e3cf79221546", - "0x2650c9a0433b2cba", - "0x18c1ca0bbe0b9385", - "0xe4ca0208b3d7628d", - "0x184082fb648501bc", - "0x64f7a05428e26594", - "0x25ada2a637e5f953", - "0x8a3a6b896604586e", - "0xad9c09b75d0b3eae", - "0x7aa01f3891ebd29c", - "0x4124ff872109dbdd", - "0x576bba0fccf024df", - "0xfb686bbc7bf54546", - "0xa06ac78578ce9466", - "0x253055df1f76d334", - "0x32cd652eb86671d2", - "0x6f106a856b73968c", - "0x7c49da01208a387f", - "0x2c13a33c7ca8aaa0", - "0x17a3b5e952302372", - "0xddc268c59cc4adc2", - "0x61aa3d293992472b", - "0xf32780d28c36a098", - "0x7c451b5fd225caf6", - "0xe95f518a00b6b4fa", - "0xd7db61a9257c1e15", - "0x73454d87fda0ab26", - "0x339ba009944d4d6b", - "0x9ed08a8230482a69", - "0xd1390999b8312afb", - "0xb82fcc9ba067c7d8", - "0x52664c6dab495e", - "0x3615ae6770edd2df", - "0xca1d2b4eebb71e91", - "0x9ab8daa0a6974282", - "0xd86e2ff1acc6b40d", - "0xfc68716c52d3d232", - "0xa45ba0d42fa38799", - "0xca41a04157354876", - "0x6c5deaef8c318a58", - "0x84f555dd0a2f68c0", - "0x62f259ab51b8f292", - "0xc0a05a6da52a93c0", - "0x4cf6c19ee0c127b4", - "0xb489a44989226930", - "0x15b88d62aa535053", - "0xa01815e279cd3a5c", - "0x47a1c105c66321b7", - "0xe8f13ba36264077f", - "0x7044f9a89efa4755", - "0xff6a9dc4269cd9d6", - "0xf152d0d450e75fa0", - "0x9da8e15a468f5584", - "0x3b614f00a6312bdd", - "0x853af8603c6914a6", - "0x5722714ca459a07c", - "0x534f2f14c7b9cd", - "0xe0a40b78e069c271", - "0xed02a93532cfdd30", - "0x477474322da07ec5", - "0xcfb69eba40e8e83c", - "0x95c19429516b7e83", - "0xe72ddd0ce13f244", - "0x80a9427c" - ], - [ - "0x5e19c1aea01102f9", - "0x82653e9435c27456", - "0x6c85883c66d32d77", - "0x997434564679b8ed", - "0x2aef61a0f9dfcf06", - "0x1f4f35bac04c70c", - "0xa3aced786d2fc676", - "0x4cd55bd8c5ccb479", - "0xaadaa0a1c0b578e6", - "0xa12cde6061675c15", - "0x45238e8841693826", - "0xe8dbefccec975c1", - "0x56a0a6b6b1dd4f2c", - "0xb944f12d50702aa1", - "0x1962bfe45b3d41f7", - "0x18fbb405a9b11839", - "0xa0222a38518e0a92", - "0x7869cb59ae1871d6", - "0x96be8e6e205d11cd", - "0xaec0280b20553a28", - "0xfe34dfc43cf3707f", - "0x72a18de82ee33a0", - "0x941258afc42170f7", - "0x1dd489e0f8a60d0c", - "0x59158dad07c465e3", - "0xe309286a4e6aa0f2", - "0x635af7f158cfca48", - "0x7b2f709560ce8fe8", - "0x39568e381a5f6fac", - "0x55878a22dda0df02", - "0xe2fc664542c3871e", - "0xbce6bb844165bc3c", - "0x14531b77f59c916a", - "0xd184add5a0b662d9", - "0x6bb294447da0e26", - "0xc6e0912f0991e654", - "0x558e6ccc5c7c7392", - "0xd61712a0fc21c1dd", - "0x43a26c7177ccaaa", - "0x6ffc3b67472915e5", - "0x45049c641967f271", - "0x1dd8a0d6b5ebcb0c", - "0xc71045de4a959bf7", - "0x8676de566a1f1eb7", - "0xd297084c4019e127", - "0xbea0193d2b42415d", - "0x1e7d7514391790f0", - "0x1c60f3c5d6570922", - "0xffd71c6b9f149a42", - "0xa052b5f86b064bad", - "0xb22ccc5257cf30a8", - "0x42c32663548bedb5", - "0xdf128dce6daec770", - "0x703f370ed71eed6a", - "0x37144c12faac56a0", - "0x64dbc0bc53b88eda", - "0xd2b9768bdc6b752e", - "0x28b8f6798920547b", - "0xede378a44b10a0dc", - "0x5636f5174e54387d", - "0x324818ff66de2edf", - "0xf08cc6d4ecf1c385", - "0xadf4aa0d16a06a6c", - "0xeed518f3bdb6dfaa", - "0xd6c7bd0495a7a0f7", - "0x2a6d07385d918513", - "0x80da117b" - ], - [ - "0xd376880ca09101f9", - "0xc97a529699654659", - "0xe8ac8108a83209a4", - "0x4e90f78c7707d12d", - "0xe292da0e39f3515", - "0x6d8331ad2c6ba1f", - "0xc01c99e896c384d1", - "0x6adae583c2208211", - "0x1365a0287453f65b", - "0x5477cb087a0a097c", - "0xb62cab2d3021e6b", - "0xa505941c03ea474e", - "0x50a040f37a8034f6", - "0x6f086c0e8faa1381", - "0xc3bb7f31e0ab3cef", - "0x8b769bdb4289370e", - "0x80d08a156e708dab", - "0xd1acab94c25b04a0", - "0x2972012216221b7b", - "0xade04d0214fe47b8", - "0x839ac2f611f43d80", - "0xc6a86e9be4a8a05b", - "0xfd20f82104943ff3", - "0xddf3cf80aeb0c53c", - "0x76834fab7712248b", - "0x47106ea9a0800b84", - "0x20541efe5f40c0e2", - "0xc7452c160a02b5c4", - "0xc2e5cbff68c6f3d1", - "0xafdaffa0ee2e6571", - "0x9c6bb900257b102", - "0xb2d792bc50f15215", - "0x51be63015351d2fc", - "0x3ac6a0702f7569f8", - "0xfdcffc05cdff59b1", - "0x468880e764c84d44", - "0xd912199f06de7a7f", - "0x5ca0a7db843632ee", - "0xc0d628da52ba5c67", - "0xb12a761721d9d3a1", - "0xce173c16111f4289", - "0x8040db137a7bc4c1", - "0xfb5cf5c514ee43a0", - "0xffe55b93cd035f3e", - "0x5336d6af7ff71d8b", - "0xe4858f9a1352908e", - "0xc7ca89cbeea080c8", - "0xbe4d58304e68d653", - "0x2a798b994bb2daeb", - "0x70d1151e834cf123", - "0x803df2ce" - ], - [ - "0xa0808080808051f8", - "0x89aec71f036ca173", - "0xc99d552fcd9c02ee", - "0x64638627851c62cc", - "0x450cef2e7d51ed32", - "0x8080808080808080", - "0x56fda7cbf4e7a080", - "0x500f0ee84c586361", - "0xdeccd5de16f9e35d", - "0xa84323f9c25b7078", - "0x80c9ce" - ], - [ - "0xf68f59de309d66f8", - "0x7e5fecb48e2d4511", - "0x3b0775d174efe899", - "0xd3b5306893dc4ce1", - "0xaa0800144f846b8", - "0x73ca4134ac04ce06", - "0x8a77b72d70eb37a9", - "0xacd0554ca3b91104", - "0xa0f25962fc91ed4f", - "0x876b309aa39be0b3", - "0x591938a3cd5995be", - "0x4ba3f3e5d6246d61", - "0xa181627de4401423" - ] - ] - } - ] - } - ], - "storages": [ - { - "address": [ - "0x5d89d5862ca7e8af", - "0x36b7d426ab6d61d6", - "0x2f4722cf" - ], - "slot": [ - "0x0", - "0x0", - "0x0", - "0x1000000000000000" - ], - "storage_key": "0x1b6847dc741a1b0cd08d278845f9d819d87b734759afb55fe2de5cb82a9ae672", - "proofs": [ - { - "block_number": 6375109, - "proof_bytes_len": [ - 532, - 83, - 69 - ], - "proof": [ - [ - "0xdaaaa563a01102f9", - "0x53733b89af92fdbc", - "0x227bd6cee31ca3e9", - "0x336db59681c1265b", - "0x7d7780a0509e595e", - "0x7310f9ca15df6350", - "0x2cabd610c8b53725", - "0xadbb21b0304fb72e", - "0xebda0d73dfe99f7", - "0x9ca6efeaf56b9b49", - "0xbc955048ac3d5fe2", - "0xcc33f505be97fb68", - "0xf2a0bc4d1ca2189d", - "0xd6fec3fed9cc776e", - "0x2cdfad8829638de5", - "0xb45659b7b4880241", - "0xa0b2c0c42a8b68fa", - "0x124ea6c73242e630", - "0x980e5879cc375472", - "0xcee0f874c5686418", - "0x969bcca76c6785d0", - "0x2df84ea10d9388a0", - "0xb82c15fe0e46f64a", - "0x984ecc65972203c3", - "0xcc4050165d2c602e", - "0xa7e41fa0d715a056", - "0x4b56009614424972", - "0xfdc53ee84e7e95fd", - "0x2dea4431fe1070d1", - "0xc864595a66a0e3f4", - "0xd17f80d096431b16", - "0xb51f6788c53e6caa", - "0x60ed6c03838c7510", - "0x39067cd5a0ce9ea9", - "0xb62a0e234fd40583", - "0x72e16ce793841c85", - "0x35322107af4919fa", - "0xf9272da039bdc793", - "0xd7d2f60de50aa21d", - "0x961d1a598e8c03b6", - "0x67df3a6bb55d1a9b", - "0xf8e1a0e89a0e6d62", - "0x3ede8e86c0e4dfdd", - "0xd8befa2a92c3ff26", - "0x3e13839c33dfae35", - "0x8ba06ee1a9e3ab0a", - "0x7c9ef401225bf5f3", - "0x4b8ac462c655ceff", - "0x1feec82f659f9b5b", - "0xa041d35933716a17", - "0xabad1dc62c18c692", - "0x936b6b57f845b3f7", - "0xfbd1e711de6e6536", - "0xa6014cee1d92b9f0", - "0x8bd8fb8e3eabfa0", - "0xba8bf46a6a1b7a92", - "0xa2a4e0cb613e9f70", - "0xf77aa9d38589e6a7", - "0x4062ee9d1fe3a033", - "0xba2bc68979de97bf", - "0xbdaf7bfec356fb9a", - "0x18c3a4aa9f3c07ef", - "0x1dcbed5fbba0aa9d", - "0x81f5631f4cb93054", - "0x406b742b1184064e", - "0x9e1d337f94beb2e8", - "0x80456c83" - ], - [ - "0x80808080808051f8", - "0xb8b52a1f7ea08080", - "0x7e61781d2a5e06f2", - "0xc001b39cbb1985d0", - "0x66be391c1b432d93", - "0x3beca0808097599d", - "0x54112b4e9235e5e3", - "0xa1558e7687ac1dab", - "0x818b16e5a58051e1", - "0x80809b39735f0bf6", - "0x808080" - ], - [ - "0x74dc476820a043f8", - "0x4588278dd00c1b1a", - "0x5947737bd819d8f9", - "0x2ab85cdee25fb5af", - "0x736e49a0a172e69a", - "0x7473655420656469", - "0x656d616e20", - "0x0", - "0x2000000000" - ] - ] - } - ] - } - ], - "transactions": [], - "transaction_receipts": [] - }, - { - "chain_id": 1, - "mmr_with_headers": [ - { - "mmr_meta": { - "id": 6, - "root": "0x3271f29fbedc3f9b0f34bbefd96a5352d5c078a095e865a2be21f01a0b5d603", - "size": 39507787, - "peaks": [ - "0x5bcb7ebf023e07cf3df51800a183df56fd0c6564c004bc7b0ffde74627501ed", - "0x2756a530dedc3403380df580505ff29e020d72efde3c91bc3ca53909d922d2a", - "0x053058fcd54baec18ebfb227b0fe14de56ed556564f4bb5b5ea49ec970325fe", - "0x165f29510eb11f4ec6c0758f37c5423d5dba2e421172ff99885a4f365926023", - "0x1445ff057bf7dab225ab94a7aabf2d5d52f87b73fc361ab8d79e4f71dd89b88", - "0x3adbfcc1ad6a6324520dac8d1277f0686df93e412e2e1f0d39d7bc4c47832da", - "0x784b9d576867d02e170a8a7000ed7c93a8027ad87e2cfb88e49cc5928663020", - "0x7ea013ade21ca7bbccbc46a0155f1478efc5f0422a9e8575f5a57595e948c4c", - "0x41dc8818b97f4d69d5ec3f43b908ba8b091bccbcb1d1adb66183abec69a9f89", - "0x4aebd0fb9408a90f915b8f52e11547305d3f7b00a9f172502eddef78fcc27a3", - "0x66423f4b8b863824ab1901172f5038f6e212884f6c5bc0ea420124275bb38ce", - "0x67fda04a120ff0baefd605f6595a3bb4f825ef4847f943e158220d4762ac657", - "0x3b38d14a9cc5466577034c592049b0264d45bb620010ea5163a8c8d4ea6143f", - "0x09640bc142e8de54d49961eab672c7d2972e1de3c4e4dbeba46295daeced832", - "0x1babdddd68bf91de82cf3ef0d7d6a1fdca32130518e24bf9531fbdcfbcba42e" - ] - }, - "headers": [ - { - "rlp": [ - "0x3a0f1116a01102f9", - "0xd7cf22ece25d89a1", - "0x952a114d721f7546", - "0x3b52a15828b6713c", - "0x4dcc1da064dcf350", - "0xb585ab7a5dc7dee8", - "0x4512d31ad4ccb667", - "0x42a1f013748a941b", - "0x9228944793d440fd", - "0xf0c0f4849d2c4e1e", - "0xa05157f491b9cec0", - "0x3a63aec9f7a093fe", - "0x7d1fe3738ca49203", - "0x50c9fcc741ff1b7f", - "0xecfec748d4a8d2fc", - "0x171fe856a06044c8", - "0xe64583ffa655cc1b", - "0x1be0485b6ef8c092", - "0xb52f6201c0ad6c99", - "0x1fe856a021b463e3", - "0x4583ffa655cc1b17", - "0xe0485b6ef8c092e6", - "0x2f6201c0ad6c991b", - "0x1b921b463e3b5", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x826772cb772d0485", - "0xf343ba5584808813", - "0x31762f6874654799", - "0x6e696c2f302e302e", - "0x342e316f672f7875", - "0x55cc000f10a0322e", - "0xa8e962e2d05fa0a5", - "0xfac3f646fe49ae4", - "0xcefce3a02ba01623", - "0xfcfb7d1f886a62a5", - "0xed236b96" - ], - "rlp_bytes_len": 532, - "proof": { - "leaf_idx": 36240343, - "mmr_path": [ - "0x0fe8ea29743da65224281de074bd6a4587f7844e7bf38b506eb73293a634c40", - "0x16cc42fe58b25cf8a0cf848c92401929a903cc9dd2d0dda90ed4a0ff7bd5380", - "0x6eb3587880c32049c5610d8994211e8499a87c1539984d204395d649257ffd6", - "0x5610dd4fddeca2d805384104a975a2aa165810614b7cf3ba3991c845088da3a", - "0x2a9ad6b36097b54d83efbffd3fc4e2eed5196cfa9e6372ef86deb1f3392da57", - "0x679c119f91a379ccbc6676ed8c4f001efec4aac33c9b0ae3aeb7252f7ab8c84", - "0x754770f8a3662e4c327e2e9ced3a8e5df146929971e4dd9f4049bb63add1cc1", - "0x63bd29f81e937666b38b9f79c5133fd259a13219881870140c8d782c8851534", - "0x2f4c027af113be4d7d326b3b52991d136341c4dd782713ed5e8e4032cf0c897", - "0x3060b57768080011068e3ac8042e021faf707fd08f305c1a5ef728967820326", - "0x6edfabcd67c8ca06715373fc1f7539c92749c9407672b242454bc6112ac9f00", - "0x4e46d26e0279143c7b49f3b3f2a45de0a006a78e00c46c876fa5f3a0ed3db1d", - "0x1302ccf7dddbb803d97b075bf7c2634c5877ed9c31ea3b0f688eff3bd15e812", - "0x0e458a32a01f0f9607b2532083577520bded45e431233e8b64c63619e0f4790", - "0x140e8fa45b8c34047224ebfb8e6234ac76e08da08de502e3b30a62d846c43d4", - "0x5565c746b5fb2c3721c9d25f2def725ea5d7b195eaf978cf1cafe4fed1e95f2", - "0x344d9891124ac18149b7463568a9860732fe4b1ef84c6b563a6fe77ba66a9c4", - "0x6c26801d6e2dd7a33550de8c6291fc76a5edb5770ca38c0c82ba2eb389bca0a", - "0x3c6b59b8b0288bb50bc50326a41a3dd26899801f2d3520b71ede8bcd9d108d1", - "0x0e6b4ae59b356b3fcb3eb87f63a4fb12b1464d18ea4560eb18810d7aa46f68d", - "0x536ff2c043d32e5b1a97b6613e406f49406f6b01bb4c95f9e3b1151f2cb9d73" - ] - } - }, - { - "rlp": [ - "0xde7e2dfa01602f9", - "0xcbce0111546a116c", - "0x5f12622d40d756b2", - "0xc9ed497d609bdc6d", - "0x4dcc1da0645c8289", - "0xb585ab7a5dc7dee8", - "0x4512d31ad4ccb667", - "0x42a1f013748a941b", - "0x7bbb944793d440fd", - "0x4a4733a9f0f38782", - "0x7977a9bc2ce4ea79", - "0x36dc0065c6a07111", - "0x861ab086894afb0", - "0x3e03a650afb8d194", - "0x66dc6e2393ba924d", - "0x171fe856a0019c64", - "0xe64583ffa655cc1b", - "0x1be0485b6ef8c092", - "0xb52f6201c0ad6c99", - "0x1fe856a021b463e3", - "0x4583ffa655cc1b17", - "0xe0485b6ef8c092e6", - "0x2f6201c0ad6c991b", - "0x1b921b463e3b5", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x82659a9f6c2c0485", - "0xed43ba5584808813", - "0x564c2f687465479e", - "0x2e302e31762f5649", - "0x2f78756e696c2f30", - "0xa0322e342e316f67", - "0x5ca1d568bcf186f0", - "0xa0e8827e01c26ad0", - "0x24a2967866d69923", - "0x8da0250460325ab6", - "0x6e49c0ffd7874588", - "0xa5" - ], - "rlp_bytes_len": 537, - "proof": { - "leaf_idx": 36240347, - "mmr_path": [ - "0x5a9c9bf362258e22ccd4fa91d6ef80f03d8cd809b7ee2a02dac6bd86ca23506", - "0x0c430c0fcdb2ac17f77da1b2636f7b3571e286fc8158dc6df148da5a88937cf", - "0x155fdf4bfe0fce2431ef276559c02370b222d33a9465f3fba3071ceaf81082b", - "0x5610dd4fddeca2d805384104a975a2aa165810614b7cf3ba3991c845088da3a", - "0x2a9ad6b36097b54d83efbffd3fc4e2eed5196cfa9e6372ef86deb1f3392da57", - "0x679c119f91a379ccbc6676ed8c4f001efec4aac33c9b0ae3aeb7252f7ab8c84", - "0x754770f8a3662e4c327e2e9ced3a8e5df146929971e4dd9f4049bb63add1cc1", - "0x63bd29f81e937666b38b9f79c5133fd259a13219881870140c8d782c8851534", - "0x2f4c027af113be4d7d326b3b52991d136341c4dd782713ed5e8e4032cf0c897", - "0x3060b57768080011068e3ac8042e021faf707fd08f305c1a5ef728967820326", - "0x6edfabcd67c8ca06715373fc1f7539c92749c9407672b242454bc6112ac9f00", - "0x4e46d26e0279143c7b49f3b3f2a45de0a006a78e00c46c876fa5f3a0ed3db1d", - "0x1302ccf7dddbb803d97b075bf7c2634c5877ed9c31ea3b0f688eff3bd15e812", - "0x0e458a32a01f0f9607b2532083577520bded45e431233e8b64c63619e0f4790", - "0x140e8fa45b8c34047224ebfb8e6234ac76e08da08de502e3b30a62d846c43d4", - "0x5565c746b5fb2c3721c9d25f2def725ea5d7b195eaf978cf1cafe4fed1e95f2", - "0x344d9891124ac18149b7463568a9860732fe4b1ef84c6b563a6fe77ba66a9c4", - "0x6c26801d6e2dd7a33550de8c6291fc76a5edb5770ca38c0c82ba2eb389bca0a", - "0x3c6b59b8b0288bb50bc50326a41a3dd26899801f2d3520b71ede8bcd9d108d1", - "0x0e6b4ae59b356b3fcb3eb87f63a4fb12b1464d18ea4560eb18810d7aa46f68d", - "0x536ff2c043d32e5b1a97b6613e406f49406f6b01bb4c95f9e3b1151f2cb9d73" - ] - } - }, - { - "rlp": [ - "0x2fd664fa01102f9", - "0x7ef919c1bb1e6841", - "0x8f6e7bb836102c95", - "0x9b7a5c4cd8c5f564", - "0x4dcc1da0ccfdebb1", - "0xb585ab7a5dc7dee8", - "0x4512d31ad4ccb667", - "0x42a1f013748a941b", - "0x9228944793d440fd", - "0xf0c0f4849d2c4e1e", - "0xa05157f491b9cec0", - "0xce47746002a093fe", - "0x1d5acf73d8e391f6", - "0x473135131820ac88", - "0x7a75ec8917630dee", - "0x171fe856a06bfacc", - "0xe64583ffa655cc1b", - "0x1be0485b6ef8c092", - "0xb52f6201c0ad6c99", - "0x1fe856a021b463e3", - "0x4583ffa655cc1b17", - "0xe0485b6ef8c092e6", - "0x2f6201c0ad6c991b", - "0x1b921b463e3b5", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x82662d2df22c0485", - "0xef43ba5584808813", - "0x31762f6874654799", - "0x6e696c2f302e302e", - "0x342e316f672f7875", - "0x28247627f3a0322e", - "0xfb970edbf3e4b12c", - "0xb9d6c14f6739e52b", - "0x73cace4e0191ccc3", - "0xccee368d88a83b08", - "0x8e7aa2" - ], - "rlp_bytes_len": 532, - "proof": { - "leaf_idx": 36240344, - "mmr_path": [ - "0x3e95e28eddd8a12ce454111a1764bfee096bf690567aa9c0bd8ea4de657b4b5", - "0x16cc42fe58b25cf8a0cf848c92401929a903cc9dd2d0dda90ed4a0ff7bd5380", - "0x6eb3587880c32049c5610d8994211e8499a87c1539984d204395d649257ffd6", - "0x5610dd4fddeca2d805384104a975a2aa165810614b7cf3ba3991c845088da3a", - "0x2a9ad6b36097b54d83efbffd3fc4e2eed5196cfa9e6372ef86deb1f3392da57", - "0x679c119f91a379ccbc6676ed8c4f001efec4aac33c9b0ae3aeb7252f7ab8c84", - "0x754770f8a3662e4c327e2e9ced3a8e5df146929971e4dd9f4049bb63add1cc1", - "0x63bd29f81e937666b38b9f79c5133fd259a13219881870140c8d782c8851534", - "0x2f4c027af113be4d7d326b3b52991d136341c4dd782713ed5e8e4032cf0c897", - "0x3060b57768080011068e3ac8042e021faf707fd08f305c1a5ef728967820326", - "0x6edfabcd67c8ca06715373fc1f7539c92749c9407672b242454bc6112ac9f00", - "0x4e46d26e0279143c7b49f3b3f2a45de0a006a78e00c46c876fa5f3a0ed3db1d", - "0x1302ccf7dddbb803d97b075bf7c2634c5877ed9c31ea3b0f688eff3bd15e812", - "0x0e458a32a01f0f9607b2532083577520bded45e431233e8b64c63619e0f4790", - "0x140e8fa45b8c34047224ebfb8e6234ac76e08da08de502e3b30a62d846c43d4", - "0x5565c746b5fb2c3721c9d25f2def725ea5d7b195eaf978cf1cafe4fed1e95f2", - "0x344d9891124ac18149b7463568a9860732fe4b1ef84c6b563a6fe77ba66a9c4", - "0x6c26801d6e2dd7a33550de8c6291fc76a5edb5770ca38c0c82ba2eb389bca0a", - "0x3c6b59b8b0288bb50bc50326a41a3dd26899801f2d3520b71ede8bcd9d108d1", - "0x0e6b4ae59b356b3fcb3eb87f63a4fb12b1464d18ea4560eb18810d7aa46f68d", - "0x536ff2c043d32e5b1a97b6613e406f49406f6b01bb4c95f9e3b1151f2cb9d73" - ] - } - }, - { - "rlp": [ - "0xe9e5aa7fa01102f9", - "0x2db2156c147d0005", - "0x884f34cb356973cb", - "0xe8016765fe350dbe", - "0xafaa8aa08e39524d", - "0xb6d22d0b36bf62a1", - "0x536e1b2c74382c62", - "0x8288579a8a092bc8", - "0x92289467b377e6dc", - "0xf0c0f4849d2c4e1e", - "0xa05157f491b9cec0", - "0x4a4cfbadefa093fe", - "0x61c0715fe8e8c8ca", - "0xced032f7aad9a458", - "0x7e4fe0eb79933b9c", - "0x171fe856a05ec12a", - "0xe64583ffa655cc1b", - "0x1be0485b6ef8c092", - "0xb52f6201c0ad6c99", - "0x1fe856a021b463e3", - "0x4583ffa655cc1b17", - "0xe0485b6ef8c092e6", - "0x2f6201c0ad6c991b", - "0x1b921b463e3b5", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x82691a3a832e0485", - "0xf543ba5584808813", - "0x31762f6874654799", - "0x6e696c2f302e302e", - "0x342e316f672f7875", - "0x1ea396a673a0322e", - "0x49f0762cf92ef66c", - "0x2c8ffeefbe193a3e", - "0x5529ea27afddfd8a", - "0xfbd33f368854e86b", - "0x525568cd" - ], - "rlp_bytes_len": 532, - "proof": { - "leaf_idx": 36240340, - "mmr_path": [ - "0x1f47b1cba9eefd6b4bae48bb68dbb9333c612f6eeb205e94a168c17c8e59922", - "0x3a5c0170d4a7a2f383c4aaaf3621e2d1b423cd5675b55b40c999adb60be74df", - "0x6eb3587880c32049c5610d8994211e8499a87c1539984d204395d649257ffd6", - "0x5610dd4fddeca2d805384104a975a2aa165810614b7cf3ba3991c845088da3a", - "0x2a9ad6b36097b54d83efbffd3fc4e2eed5196cfa9e6372ef86deb1f3392da57", - "0x679c119f91a379ccbc6676ed8c4f001efec4aac33c9b0ae3aeb7252f7ab8c84", - "0x754770f8a3662e4c327e2e9ced3a8e5df146929971e4dd9f4049bb63add1cc1", - "0x63bd29f81e937666b38b9f79c5133fd259a13219881870140c8d782c8851534", - "0x2f4c027af113be4d7d326b3b52991d136341c4dd782713ed5e8e4032cf0c897", - "0x3060b57768080011068e3ac8042e021faf707fd08f305c1a5ef728967820326", - "0x6edfabcd67c8ca06715373fc1f7539c92749c9407672b242454bc6112ac9f00", - "0x4e46d26e0279143c7b49f3b3f2a45de0a006a78e00c46c876fa5f3a0ed3db1d", - "0x1302ccf7dddbb803d97b075bf7c2634c5877ed9c31ea3b0f688eff3bd15e812", - "0x0e458a32a01f0f9607b2532083577520bded45e431233e8b64c63619e0f4790", - "0x140e8fa45b8c34047224ebfb8e6234ac76e08da08de502e3b30a62d846c43d4", - "0x5565c746b5fb2c3721c9d25f2def725ea5d7b195eaf978cf1cafe4fed1e95f2", - "0x344d9891124ac18149b7463568a9860732fe4b1ef84c6b563a6fe77ba66a9c4", - "0x6c26801d6e2dd7a33550de8c6291fc76a5edb5770ca38c0c82ba2eb389bca0a", - "0x3c6b59b8b0288bb50bc50326a41a3dd26899801f2d3520b71ede8bcd9d108d1", - "0x0e6b4ae59b356b3fcb3eb87f63a4fb12b1464d18ea4560eb18810d7aa46f68d", - "0x536ff2c043d32e5b1a97b6613e406f49406f6b01bb4c95f9e3b1151f2cb9d73" - ] - } - }, - { - "rlp": [ - "0xd3af10dba01602f9", - "0x834c28eb2753a4ef", - "0xae6679bdd95b92cc", - "0x2407beeec16730a5", - "0x4dcc1da01eec24d1", - "0xb585ab7a5dc7dee8", - "0x4512d31ad4ccb667", - "0x42a1f013748a941b", - "0x7bbb944793d440fd", - "0x4a4733a9f0f38782", - "0x7977a9bc2ce4ea79", - "0x7f6d5fc290a07111", - "0xa66856cca631ebdd", - "0x5e70ecaddb7aa7bb", - "0x1e2d5c26515aaab7", - "0x171fe856a0acb73b", - "0xe64583ffa655cc1b", - "0x1be0485b6ef8c092", - "0xb52f6201c0ad6c99", - "0x1fe856a021b463e3", - "0x4583ffa655cc1b17", - "0xe0485b6ef8c092e6", - "0x2f6201c0ad6c991b", - "0x1b921b463e3b5", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x8264b622e72b0485", - "0xeb43ba5584808813", - "0x564c2f687465479e", - "0x2e302e31762f5649", - "0x2f78756e696c2f30", - "0xa0322e342e316f67", - "0x8480e572073cb45b", - "0x59a459c8e0c821b2", - "0xf1b8c512c703c150", - "0x1458a07ee66951d", - "0x36a9297f9c123788", - "0x4b" - ], - "rlp_bytes_len": 537, - "proof": { - "leaf_idx": 36240348, - "mmr_path": [ - "0x5fa2122363b87c6d0ad27a496726de05eb9f1319153287f03e2538d62d9e227", - "0x0c430c0fcdb2ac17f77da1b2636f7b3571e286fc8158dc6df148da5a88937cf", - "0x155fdf4bfe0fce2431ef276559c02370b222d33a9465f3fba3071ceaf81082b", - "0x5610dd4fddeca2d805384104a975a2aa165810614b7cf3ba3991c845088da3a", - "0x2a9ad6b36097b54d83efbffd3fc4e2eed5196cfa9e6372ef86deb1f3392da57", - "0x679c119f91a379ccbc6676ed8c4f001efec4aac33c9b0ae3aeb7252f7ab8c84", - "0x754770f8a3662e4c327e2e9ced3a8e5df146929971e4dd9f4049bb63add1cc1", - "0x63bd29f81e937666b38b9f79c5133fd259a13219881870140c8d782c8851534", - "0x2f4c027af113be4d7d326b3b52991d136341c4dd782713ed5e8e4032cf0c897", - "0x3060b57768080011068e3ac8042e021faf707fd08f305c1a5ef728967820326", - "0x6edfabcd67c8ca06715373fc1f7539c92749c9407672b242454bc6112ac9f00", - "0x4e46d26e0279143c7b49f3b3f2a45de0a006a78e00c46c876fa5f3a0ed3db1d", - "0x1302ccf7dddbb803d97b075bf7c2634c5877ed9c31ea3b0f688eff3bd15e812", - "0x0e458a32a01f0f9607b2532083577520bded45e431233e8b64c63619e0f4790", - "0x140e8fa45b8c34047224ebfb8e6234ac76e08da08de502e3b30a62d846c43d4", - "0x5565c746b5fb2c3721c9d25f2def725ea5d7b195eaf978cf1cafe4fed1e95f2", - "0x344d9891124ac18149b7463568a9860732fe4b1ef84c6b563a6fe77ba66a9c4", - "0x6c26801d6e2dd7a33550de8c6291fc76a5edb5770ca38c0c82ba2eb389bca0a", - "0x3c6b59b8b0288bb50bc50326a41a3dd26899801f2d3520b71ede8bcd9d108d1", - "0x0e6b4ae59b356b3fcb3eb87f63a4fb12b1464d18ea4560eb18810d7aa46f68d", - "0x536ff2c043d32e5b1a97b6613e406f49406f6b01bb4c95f9e3b1151f2cb9d73" - ] - } - }, - { - "rlp": [ - "0xdaf3be39a01602f9", - "0x60571b78024ed12c", - "0xff9b14066642dc50", - "0x7e41653ef44a7a93", - "0x4dcc1da013c7986e", - "0xb585ab7a5dc7dee8", - "0x4512d31ad4ccb667", - "0x42a1f013748a941b", - "0x7bbb944793d440fd", - "0x4a4733a9f0f38782", - "0x7977a9bc2ce4ea79", - "0xe7e8f3384aa07111", - "0x8cd0073c84e70d31", - "0x92d9723e59275681", - "0xf1f26e2945b08333", - "0x171fe856a07e3dd9", - "0xe64583ffa655cc1b", - "0x1be0485b6ef8c092", - "0xb52f6201c0ad6c99", - "0x1fe856a021b463e3", - "0x4583ffa655cc1b17", - "0xe0485b6ef8c092e6", - "0x2f6201c0ad6c991b", - "0x1b921b463e3b5", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x82686b7afd2d0485", - "0xf443ba5584808813", - "0x564c2f687465479e", - "0x2e302e31762f5649", - "0x2f78756e696c2f30", - "0xa0322e342e316f67", - "0xcaa260b222a003b9", - "0x8552d0a224db1987", - "0x7d3d044431faff09", - "0x68555a04ed249c1f", - "0x331d9e664ba6dd88", - "0x36" - ], - "rlp_bytes_len": 537, - "proof": { - "leaf_idx": 36240341, - "mmr_path": [ - "0x5fdd37a283d8f0942d06f492682460b5c133e670b6b85ff4792aa5e4186020e", - "0x3a5c0170d4a7a2f383c4aaaf3621e2d1b423cd5675b55b40c999adb60be74df", - "0x6eb3587880c32049c5610d8994211e8499a87c1539984d204395d649257ffd6", - "0x5610dd4fddeca2d805384104a975a2aa165810614b7cf3ba3991c845088da3a", - "0x2a9ad6b36097b54d83efbffd3fc4e2eed5196cfa9e6372ef86deb1f3392da57", - "0x679c119f91a379ccbc6676ed8c4f001efec4aac33c9b0ae3aeb7252f7ab8c84", - "0x754770f8a3662e4c327e2e9ced3a8e5df146929971e4dd9f4049bb63add1cc1", - "0x63bd29f81e937666b38b9f79c5133fd259a13219881870140c8d782c8851534", - "0x2f4c027af113be4d7d326b3b52991d136341c4dd782713ed5e8e4032cf0c897", - "0x3060b57768080011068e3ac8042e021faf707fd08f305c1a5ef728967820326", - "0x6edfabcd67c8ca06715373fc1f7539c92749c9407672b242454bc6112ac9f00", - "0x4e46d26e0279143c7b49f3b3f2a45de0a006a78e00c46c876fa5f3a0ed3db1d", - "0x1302ccf7dddbb803d97b075bf7c2634c5877ed9c31ea3b0f688eff3bd15e812", - "0x0e458a32a01f0f9607b2532083577520bded45e431233e8b64c63619e0f4790", - "0x140e8fa45b8c34047224ebfb8e6234ac76e08da08de502e3b30a62d846c43d4", - "0x5565c746b5fb2c3721c9d25f2def725ea5d7b195eaf978cf1cafe4fed1e95f2", - "0x344d9891124ac18149b7463568a9860732fe4b1ef84c6b563a6fe77ba66a9c4", - "0x6c26801d6e2dd7a33550de8c6291fc76a5edb5770ca38c0c82ba2eb389bca0a", - "0x3c6b59b8b0288bb50bc50326a41a3dd26899801f2d3520b71ede8bcd9d108d1", - "0x0e6b4ae59b356b3fcb3eb87f63a4fb12b1464d18ea4560eb18810d7aa46f68d", - "0x536ff2c043d32e5b1a97b6613e406f49406f6b01bb4c95f9e3b1151f2cb9d73" - ] - } - }, - { - "rlp": [ - "0x59c5ef07a01802f9", - "0x8eb07e7e6e5d78e", - "0x632d77b2dff21071", - "0x966d69f4758b5055", - "0x4dcc1da0ec47f7d0", - "0xb585ab7a5dc7dee8", - "0x4512d31ad4ccb667", - "0x42a1f013748a941b", - "0xe3d7944793d440fd", - "0x5b0f80d1c110e30a", - "0x1f2e5bf97aaa1b64", - "0xe9e99cfe11a08cd9", - "0x6e2f92181c2decaf", - "0xe9fcf5409c313e51", - "0x9039ad0380873134", - "0x171fe856a0c8c02e", - "0xe64583ffa655cc1b", - "0x1be0485b6ef8c092", - "0xb52f6201c0ad6c99", - "0x1fe856a021b463e3", - "0x4583ffa655cc1b17", - "0xe0485b6ef8c092e6", - "0x2f6201c0ad6c991b", - "0x1b921b463e3b5", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x826a810a092f0485", - "0xf643ba5584808813", - "0x6c6b2f68746547a0", - "0x31762f657275736f", - "0x3763662d302e302e", - "0x696c2f6432336439", - "0x8d6ce050679ea06e", - "0xb725fb259b007c07", - "0xfda91c0e86a9ea55", - "0x490f0471f8b0b6f1", - "0x2d18f6cd80882dc8", - "0x5fed50" - ], - "rlp_bytes_len": 539, - "proof": { - "leaf_idx": 36240335, - "mmr_path": [ - "0x5ab2f147c7e0a140ab86a7c30290a00a5cd60f4aa43e9360d94360b588c07f1", - "0x72091005b55c4a2570fc6e0efd9103701b2497c17ca75359cf47f3a86e46e86", - "0x4e8031f2fc1fcc151695ce4fb85944e14b3bb759f5199aea08cd0a4de873ef1", - "0x0c0311ba88ac05249a044bf42d757dd4de1ebe7cf3187b45e4138b1b4bcb613", - "0x020175e524a8f80a1212a5d9cdeff96c86f7848290710bcaf62a24165ea0d3e", - "0x679c119f91a379ccbc6676ed8c4f001efec4aac33c9b0ae3aeb7252f7ab8c84", - "0x754770f8a3662e4c327e2e9ced3a8e5df146929971e4dd9f4049bb63add1cc1", - "0x63bd29f81e937666b38b9f79c5133fd259a13219881870140c8d782c8851534", - "0x2f4c027af113be4d7d326b3b52991d136341c4dd782713ed5e8e4032cf0c897", - "0x3060b57768080011068e3ac8042e021faf707fd08f305c1a5ef728967820326", - "0x6edfabcd67c8ca06715373fc1f7539c92749c9407672b242454bc6112ac9f00", - "0x4e46d26e0279143c7b49f3b3f2a45de0a006a78e00c46c876fa5f3a0ed3db1d", - "0x1302ccf7dddbb803d97b075bf7c2634c5877ed9c31ea3b0f688eff3bd15e812", - "0x0e458a32a01f0f9607b2532083577520bded45e431233e8b64c63619e0f4790", - "0x140e8fa45b8c34047224ebfb8e6234ac76e08da08de502e3b30a62d846c43d4", - "0x5565c746b5fb2c3721c9d25f2def725ea5d7b195eaf978cf1cafe4fed1e95f2", - "0x344d9891124ac18149b7463568a9860732fe4b1ef84c6b563a6fe77ba66a9c4", - "0x6c26801d6e2dd7a33550de8c6291fc76a5edb5770ca38c0c82ba2eb389bca0a", - "0x3c6b59b8b0288bb50bc50326a41a3dd26899801f2d3520b71ede8bcd9d108d1", - "0x0e6b4ae59b356b3fcb3eb87f63a4fb12b1464d18ea4560eb18810d7aa46f68d", - "0x536ff2c043d32e5b1a97b6613e406f49406f6b01bb4c95f9e3b1151f2cb9d73" - ] - } - }, - { - "rlp": [ - "0x7d0cf0dba01802f9", - "0xbf6da4d5b2163390", - "0xf8cc02317a3129cf", - "0x3fdef2c08752bed", - "0x4dcc1da0ec98e04e", - "0xb585ab7a5dc7dee8", - "0x4512d31ad4ccb667", - "0x42a1f013748a941b", - "0xe3d7944793d440fd", - "0x5b0f80d1c110e30a", - "0x1f2e5bf97aaa1b64", - "0x29114073bca08cd9", - "0x736fe86564f427b6", - "0x33af0cd7a3230278", - "0xf48845d82d66672d", - "0x171fe856a0105e9f", - "0xe64583ffa655cc1b", - "0x1be0485b6ef8c092", - "0xb52f6201c0ad6c99", - "0x1fe856a021b463e3", - "0x4583ffa655cc1b17", - "0xe0485b6ef8c092e6", - "0x2f6201c0ad6c991b", - "0x1b921b463e3b5", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x826ba2eb8e2f0485", - "0xf743ba5584808813", - "0x6c6b2f68746547a0", - "0x31762f657275736f", - "0x3763662d302e302e", - "0x696c2f6432336439", - "0x56fa7071f598a06e", - "0xb6ca6215c80cc2a9", - "0xde97ba01144cc022", - "0xc792873da26f71ce", - "0x521e9e640e880c5c", - "0xeece4f" - ], - "rlp_bytes_len": 539, - "proof": { - "leaf_idx": 36240334, - "mmr_path": [ - "0x40deb09802713fa1dbb58a928db4e042fdbabfc6c5d6a71de3e89b98b21813b", - "0x72091005b55c4a2570fc6e0efd9103701b2497c17ca75359cf47f3a86e46e86", - "0x4e8031f2fc1fcc151695ce4fb85944e14b3bb759f5199aea08cd0a4de873ef1", - "0x0c0311ba88ac05249a044bf42d757dd4de1ebe7cf3187b45e4138b1b4bcb613", - "0x020175e524a8f80a1212a5d9cdeff96c86f7848290710bcaf62a24165ea0d3e", - "0x679c119f91a379ccbc6676ed8c4f001efec4aac33c9b0ae3aeb7252f7ab8c84", - "0x754770f8a3662e4c327e2e9ced3a8e5df146929971e4dd9f4049bb63add1cc1", - "0x63bd29f81e937666b38b9f79c5133fd259a13219881870140c8d782c8851534", - "0x2f4c027af113be4d7d326b3b52991d136341c4dd782713ed5e8e4032cf0c897", - "0x3060b57768080011068e3ac8042e021faf707fd08f305c1a5ef728967820326", - "0x6edfabcd67c8ca06715373fc1f7539c92749c9407672b242454bc6112ac9f00", - "0x4e46d26e0279143c7b49f3b3f2a45de0a006a78e00c46c876fa5f3a0ed3db1d", - "0x1302ccf7dddbb803d97b075bf7c2634c5877ed9c31ea3b0f688eff3bd15e812", - "0x0e458a32a01f0f9607b2532083577520bded45e431233e8b64c63619e0f4790", - "0x140e8fa45b8c34047224ebfb8e6234ac76e08da08de502e3b30a62d846c43d4", - "0x5565c746b5fb2c3721c9d25f2def725ea5d7b195eaf978cf1cafe4fed1e95f2", - "0x344d9891124ac18149b7463568a9860732fe4b1ef84c6b563a6fe77ba66a9c4", - "0x6c26801d6e2dd7a33550de8c6291fc76a5edb5770ca38c0c82ba2eb389bca0a", - "0x3c6b59b8b0288bb50bc50326a41a3dd26899801f2d3520b71ede8bcd9d108d1", - "0x0e6b4ae59b356b3fcb3eb87f63a4fb12b1464d18ea4560eb18810d7aa46f68d", - "0x536ff2c043d32e5b1a97b6613e406f49406f6b01bb4c95f9e3b1151f2cb9d73" - ] - } - }, - { - "rlp": [ - "0x20a86356a01202f9", - "0x8278d4772daece65", - "0x3bad07e9a2fabf47", - "0x60126fedb8346274", - "0x7d9b20a088240715", - "0x265af9bfe3d6038c", - "0x806ff5aaab82ab8f", - "0x99723cdfc7ba1362", - "0x701b947ba0769ab5", - "0x94be65cf8a33b447", - "0xd78a33c9c5e8a3c1", - "0x87b8df0ffaa07cd6", - "0x6a667b191828d8e4", - "0x7ee90b32d5916880", - "0x615939c9eb0759e4", - "0x171fe856a0b2ef53", - "0xe64583ffa655cc1b", - "0x1be0485b6ef8c092", - "0xb52f6201c0ad6c99", - "0x1fe856a021b463e3", - "0x4583ffa655cc1b17", - "0xe0485b6ef8c092e6", - "0x2f6201c0ad6c991b", - "0x1b921b463e3b5", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x826c7fdd14300485", - "0xf843ba5584808813", - "0x6e696f637469429a", - "0x2045485420736920", - "0x6168636b636f6c42", - "0x89e7a049a02e6e69", - "0x4dbb96b5f632b406", - "0xafaa9239e4a2677f", - "0x64a0fad1d9d0367f", - "0xd9d45688bf22b0f1", - "0x5a09a095db" - ], - "rlp_bytes_len": 533, - "proof": { - "leaf_idx": 36240332, - "mmr_path": [ - "0x746ec933b3aa71457cc645edd414b34df14b4dd7735f44a5a298c9e21939261", - "0x6c492ee6d3005505a7366d1f85e75c67cfaca17a20a1e1e5df7afb4384a43b9", - "0x4e8031f2fc1fcc151695ce4fb85944e14b3bb759f5199aea08cd0a4de873ef1", - "0x0c0311ba88ac05249a044bf42d757dd4de1ebe7cf3187b45e4138b1b4bcb613", - "0x020175e524a8f80a1212a5d9cdeff96c86f7848290710bcaf62a24165ea0d3e", - "0x679c119f91a379ccbc6676ed8c4f001efec4aac33c9b0ae3aeb7252f7ab8c84", - "0x754770f8a3662e4c327e2e9ced3a8e5df146929971e4dd9f4049bb63add1cc1", - "0x63bd29f81e937666b38b9f79c5133fd259a13219881870140c8d782c8851534", - "0x2f4c027af113be4d7d326b3b52991d136341c4dd782713ed5e8e4032cf0c897", - "0x3060b57768080011068e3ac8042e021faf707fd08f305c1a5ef728967820326", - "0x6edfabcd67c8ca06715373fc1f7539c92749c9407672b242454bc6112ac9f00", - "0x4e46d26e0279143c7b49f3b3f2a45de0a006a78e00c46c876fa5f3a0ed3db1d", - "0x1302ccf7dddbb803d97b075bf7c2634c5877ed9c31ea3b0f688eff3bd15e812", - "0x0e458a32a01f0f9607b2532083577520bded45e431233e8b64c63619e0f4790", - "0x140e8fa45b8c34047224ebfb8e6234ac76e08da08de502e3b30a62d846c43d4", - "0x5565c746b5fb2c3721c9d25f2def725ea5d7b195eaf978cf1cafe4fed1e95f2", - "0x344d9891124ac18149b7463568a9860732fe4b1ef84c6b563a6fe77ba66a9c4", - "0x6c26801d6e2dd7a33550de8c6291fc76a5edb5770ca38c0c82ba2eb389bca0a", - "0x3c6b59b8b0288bb50bc50326a41a3dd26899801f2d3520b71ede8bcd9d108d1", - "0x0e6b4ae59b356b3fcb3eb87f63a4fb12b1464d18ea4560eb18810d7aa46f68d", - "0x536ff2c043d32e5b1a97b6613e406f49406f6b01bb4c95f9e3b1151f2cb9d73" - ] - } - }, - { - "rlp": [ - "0xe69ccacaa01802f9", - "0x76824202634435b4", - "0xb6b2025db864372c", - "0xdc5c0da3a037e380", - "0x4dcc1da0e2450d6e", - "0xb585ab7a5dc7dee8", - "0x4512d31ad4ccb667", - "0x42a1f013748a941b", - "0xda19944793d440fd", - "0xcf4c0e961ef119fe", - "0x48d7eb9088aaa5c6", - "0x1e1c66601da01eca", - "0x3d40de4ba9c96402", - "0x9e5fb4bbab557f36", - "0x557b362ee5e84a53", - "0x171fe856a0b6aaec", - "0xe64583ffa655cc1b", - "0x1be0485b6ef8c092", - "0xb52f6201c0ad6c99", - "0x1fe856a021b463e3", - "0x4583ffa655cc1b17", - "0xe0485b6ef8c092e6", - "0x2f6201c0ad6c991b", - "0x1b921b463e3b5", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x826e76f320310485", - "0x44ba5584808813", - "0x31762f68746547a0", - "0x6463302d302e302e", - "0x696c2f3734363763", - "0x2e316f672f78756e", - "0x7e0c746ae213a034", - "0xc7c9f881dd54f9fe", - "0x3ef06f3dd9de009e", - "0x2a7cda3b34304acf", - "0xf414e1b7a88d8c3", - "0x55074e" - ], - "rlp_bytes_len": 539, - "proof": { - "leaf_idx": 36240328, - "mmr_path": [ - "0x38de2bd5dec4dddf445b272515b27e054f7a023fba100a407d5d07098b7817d", - "0x33f3f88b4590dc4b6fb0b738a333da4465506e97bf52bfb65a044e8aed6c071", - "0x758843d03ff496efb935710f282862e286d45648548c2b418e5d848d0f045cb", - "0x0c0311ba88ac05249a044bf42d757dd4de1ebe7cf3187b45e4138b1b4bcb613", - "0x020175e524a8f80a1212a5d9cdeff96c86f7848290710bcaf62a24165ea0d3e", - "0x679c119f91a379ccbc6676ed8c4f001efec4aac33c9b0ae3aeb7252f7ab8c84", - "0x754770f8a3662e4c327e2e9ced3a8e5df146929971e4dd9f4049bb63add1cc1", - "0x63bd29f81e937666b38b9f79c5133fd259a13219881870140c8d782c8851534", - "0x2f4c027af113be4d7d326b3b52991d136341c4dd782713ed5e8e4032cf0c897", - "0x3060b57768080011068e3ac8042e021faf707fd08f305c1a5ef728967820326", - "0x6edfabcd67c8ca06715373fc1f7539c92749c9407672b242454bc6112ac9f00", - "0x4e46d26e0279143c7b49f3b3f2a45de0a006a78e00c46c876fa5f3a0ed3db1d", - "0x1302ccf7dddbb803d97b075bf7c2634c5877ed9c31ea3b0f688eff3bd15e812", - "0x0e458a32a01f0f9607b2532083577520bded45e431233e8b64c63619e0f4790", - "0x140e8fa45b8c34047224ebfb8e6234ac76e08da08de502e3b30a62d846c43d4", - "0x5565c746b5fb2c3721c9d25f2def725ea5d7b195eaf978cf1cafe4fed1e95f2", - "0x344d9891124ac18149b7463568a9860732fe4b1ef84c6b563a6fe77ba66a9c4", - "0x6c26801d6e2dd7a33550de8c6291fc76a5edb5770ca38c0c82ba2eb389bca0a", - "0x3c6b59b8b0288bb50bc50326a41a3dd26899801f2d3520b71ede8bcd9d108d1", - "0x0e6b4ae59b356b3fcb3eb87f63a4fb12b1464d18ea4560eb18810d7aa46f68d", - "0x536ff2c043d32e5b1a97b6613e406f49406f6b01bb4c95f9e3b1151f2cb9d73" - ] - } - }, - { - "rlp": [ - "0x3d7ffc23a01202f9", - "0x237972985e58b217", - "0x11cfd713db7954d1", - "0x5f0c8823b51b2f3b", - "0x4dcc1da0a4cdf29f", - "0xb585ab7a5dc7dee8", - "0x4512d31ad4ccb667", - "0x42a1f013748a941b", - "0x701b944793d440fd", - "0x94be65cf8a33b447", - "0xd78a33c9c5e8a3c1", - "0xa1258068cca07cd6", - "0x6b20b793cc5e092e", - "0x14dcedce5dfb1061", - "0x2bf30db13f05f2aa", - "0x171fe856a0d07f70", - "0xe64583ffa655cc1b", - "0x1be0485b6ef8c092", - "0xb52f6201c0ad6c99", - "0x1fe856a021b463e3", - "0x4583ffa655cc1b17", - "0xe0485b6ef8c092e6", - "0x2f6201c0ad6c991b", - "0x1b921b463e3b5", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x826d1ae09a300485", - "0xfb43ba5584808813", - "0x6e696f637469429a", - "0x2045485420736920", - "0x6168636b636f6c42", - "0x1b7014dfa02e6e69", - "0xe4569963d5d3d61a", - "0xa78931de60092563", - "0x42606f1ad738cb26", - "0x6b8e388872ea5df4", - "0xb74721c237" - ], - "rlp_bytes_len": 533, - "proof": { - "leaf_idx": 36240331, - "mmr_path": [ - "0x0c4ba48ac824c2e6c683c69cdc2f0be7258c19da079eaae99d30d4faf46956b", - "0x6c492ee6d3005505a7366d1f85e75c67cfaca17a20a1e1e5df7afb4384a43b9", - "0x4e8031f2fc1fcc151695ce4fb85944e14b3bb759f5199aea08cd0a4de873ef1", - "0x0c0311ba88ac05249a044bf42d757dd4de1ebe7cf3187b45e4138b1b4bcb613", - "0x020175e524a8f80a1212a5d9cdeff96c86f7848290710bcaf62a24165ea0d3e", - "0x679c119f91a379ccbc6676ed8c4f001efec4aac33c9b0ae3aeb7252f7ab8c84", - "0x754770f8a3662e4c327e2e9ced3a8e5df146929971e4dd9f4049bb63add1cc1", - "0x63bd29f81e937666b38b9f79c5133fd259a13219881870140c8d782c8851534", - "0x2f4c027af113be4d7d326b3b52991d136341c4dd782713ed5e8e4032cf0c897", - "0x3060b57768080011068e3ac8042e021faf707fd08f305c1a5ef728967820326", - "0x6edfabcd67c8ca06715373fc1f7539c92749c9407672b242454bc6112ac9f00", - "0x4e46d26e0279143c7b49f3b3f2a45de0a006a78e00c46c876fa5f3a0ed3db1d", - "0x1302ccf7dddbb803d97b075bf7c2634c5877ed9c31ea3b0f688eff3bd15e812", - "0x0e458a32a01f0f9607b2532083577520bded45e431233e8b64c63619e0f4790", - "0x140e8fa45b8c34047224ebfb8e6234ac76e08da08de502e3b30a62d846c43d4", - "0x5565c746b5fb2c3721c9d25f2def725ea5d7b195eaf978cf1cafe4fed1e95f2", - "0x344d9891124ac18149b7463568a9860732fe4b1ef84c6b563a6fe77ba66a9c4", - "0x6c26801d6e2dd7a33550de8c6291fc76a5edb5770ca38c0c82ba2eb389bca0a", - "0x3c6b59b8b0288bb50bc50326a41a3dd26899801f2d3520b71ede8bcd9d108d1", - "0x0e6b4ae59b356b3fcb3eb87f63a4fb12b1464d18ea4560eb18810d7aa46f68d", - "0x536ff2c043d32e5b1a97b6613e406f49406f6b01bb4c95f9e3b1151f2cb9d73" - ] - } - } - ] - } - ], - "accounts": [], - "storages": [], - "transactions": [], - "transaction_receipts": [] - } - ], - "tasks": [ - { - "type": "datalake_compute", - "context": { - "task_bytes_len": 128, - "encoded_task": [ - "0xb7d65362098af8fc", - "0xbb9ce9daf3acf4f", - "0x7764468b86369c36", - "0xfefccffceae47099", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0" - ], - "datalake_bytes_len": 288, - "encoded_datalake": [ - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0xa736aa0000000000", - "0x0", - "0x0", - "0x0", - "0xc546610000000000", - "0x0", - "0x0", - "0x0", - "0xc546610000000000", - "0x0", - "0x0", - "0x0", - "0x100000000000000", - "0x0", - "0x0", - "0x0", - "0xc000000000000000", - "0x0", - "0x0", - "0x0", - "0x3500000000000000", - "0x89d5862ca7e8af03", - "0xb7d426ab6d61d65d", - "0x2f4722cf36", - "0x0", - "0x0", - "0x0", - "0x1000000000", - "0x0" - ], - "datalake_type": 0, - "property_type": 3 - } - }, - { - "type": "datalake_compute", - "context": { - "task_bytes_len": 128, - "encoded_task": [ - "0xca08ecbe6cef6b8a", - "0xecd94f24999e99e2", - "0x4a0fb7f8bfe8177d", - "0x83a4de96b3affad5", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0" - ], - "datalake_bytes_len": 256, - "encoded_datalake": [ - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x0", - "0x100000000000000", - "0x0", - "0x0", - "0x0", - "0x6400000000000000", - "0x0", - "0x0", - "0x0", - "0x6e00000000000000", - "0x0", - "0x0", - "0x0", - "0x100000000000000", - "0x0", - "0x0", - "0x0", - "0xc000000000000000", - "0x0", - "0x0", - "0x0", - "0x200000000000000", - "0x801", - "0x0", - "0x0", - "0x0" - ], - "datalake_type": 0, - "property_type": 1 - } - } - ] -} \ No newline at end of file diff --git a/request.json b/request.json index 74fe6628..b64846a0 100644 --- a/request.json +++ b/request.json @@ -28,6 +28,20 @@ "compute": { "aggregateFnId": "avg" } + }, + { + "type": "DatalakeCompute", + "datalake": { + "type": "BlockSampled", + "chainId": "ETHEREUM_SEPOLIA", + "blockRangeStart": 6375109, + "blockRangeEnd": 6375111, + "increment": 1, + "sampledProperty": "storage.0xaFE8A72C86d5895DD6616daB26d4b736Cf22472f.0x0000000000000000000000000000000000000000000000000000000000000010" + }, + "compute": { + "aggregateFnId": "sum" + } } ] } From abf790cc28a6cb1a0761ca62f51e3be10c5d549c Mon Sep 17 00:00:00 2001 From: Pia Date: Sun, 15 Sep 2024 17:41:39 +0900 Subject: [PATCH 23/29] chore: some cleanups --- cli/src/interactive.rs | 2 +- hdp/src/cairo_runner/dry_run.rs | 4 +- hdp/src/preprocessor/compile/datalake.rs | 4 +- hdp/src/preprocessor/compile/module.rs | 2 +- hdp/src/preprocessor/module_registry.rs | 9 +- hdp/src/primitives/block/account.rs | 2 +- hdp/src/primitives/chain_id.rs | 6 + .../processed_types/cairo_format/account.rs | 3 +- .../cairo_format/datalake_compute.rs | 5 +- .../cairo_format/felt_vec_unit.rs | 27 ++- .../processed_types/cairo_format/header.rs | 2 +- .../processed_types/cairo_format/module.rs | 2 +- .../processed_types/cairo_format/mpt.rs | 2 +- .../processed_types/cairo_format/receipt.rs | 2 +- .../processed_types/cairo_format/storage.rs | 5 +- .../cairo_format/transaction.rs | 2 +- hdp/src/primitives/processed_types/uint256.rs | 166 +++++++++++++++--- .../datalake_compute/datalake/envelope.rs | 16 +- .../datalake/transactions_in_block.rs | 7 +- .../task/datalake/block_sampled/datalake.rs | 5 +- .../task/datalake/transactions/datalake.rs | 37 ++-- .../task/datalake/transactions/mod.rs | 16 +- 22 files changed, 236 insertions(+), 90 deletions(-) diff --git a/cli/src/interactive.rs b/cli/src/interactive.rs index 2be26667..aed27e98 100644 --- a/cli/src/interactive.rs +++ b/cli/src/interactive.rs @@ -230,7 +230,7 @@ pub async fn run_interactive() -> anyhow::Result<()> { start_index, end_index, increment, - IncludedTypes::from(&included_types), + IncludedTypes::from_bytes(&included_types), ); DatalakeEnvelope::TransactionsInBlock(transactions_datalake) } diff --git a/hdp/src/cairo_runner/dry_run.rs b/hdp/src/cairo_runner/dry_run.rs index 5683f9a1..646bb4e8 100644 --- a/hdp/src/cairo_runner/dry_run.rs +++ b/hdp/src/cairo_runner/dry_run.rs @@ -170,7 +170,7 @@ mod tests { let result = dry_runner.run(input).unwrap(); assert_eq!(result.len(), 1); assert_eq!(result[0].fetch_keys.len(), 3); - assert_eq!(result[0].result, Uint256::from_strs("0x0", "0x0").unwrap()); + assert_eq!(result[0].result, Uint256::ZERO); assert_eq!( result[0].program_hash, felt!("0x04df21eb479ae4416fbdc00abab6fab43bff0b8083be4d1fd8602c8fbfbd2274") @@ -233,7 +233,7 @@ mod tests { println!("Fetch key {}: {:?}", i, key); } - assert_eq!(module.result, Uint256::from_strs("0x0", "0x0").unwrap()); + assert_eq!(module.result, Uint256::ZERO); assert_eq!( module.program_hash, felt!("0xc8580f74b6e6e04d8073602ad0c0d55538b56bf8307fefebb6b65b1bbf2a27") diff --git a/hdp/src/preprocessor/compile/datalake.rs b/hdp/src/preprocessor/compile/datalake.rs index 8369ffae..7cef1a11 100644 --- a/hdp/src/preprocessor/compile/datalake.rs +++ b/hdp/src/preprocessor/compile/datalake.rs @@ -173,7 +173,7 @@ mod tests { start_index: 0, end_index: 10, increment: 1, - included_types: IncludedTypes::from(&[1, 1, 1, 1]), + included_types: IncludedTypes::from_bytes(&[1, 1, 1, 1]), sampled_property: TransactionsCollection::Transactions( TransactionField::GasLimit, ), @@ -187,7 +187,7 @@ mod tests { start_index: 0, end_index: 11, increment: 1, - included_types: IncludedTypes::from(&[1, 1, 1, 1]), + included_types: IncludedTypes::from_bytes(&[1, 1, 1, 1]), sampled_property: TransactionsCollection::TranasactionReceipts( TransactionReceiptField::Success, ), diff --git a/hdp/src/preprocessor/compile/module.rs b/hdp/src/preprocessor/compile/module.rs index bf44a7aa..9742823c 100644 --- a/hdp/src/preprocessor/compile/module.rs +++ b/hdp/src/preprocessor/compile/module.rs @@ -54,7 +54,7 @@ impl Compilable for ModuleVec { // Extract the dry run module result let dry_run_module = dry_run_results.into_iter().next().unwrap(); - let commit_results = vec![dry_run_module.result.to_combined_string().into()]; + let commit_results = vec![dry_run_module.result.into()]; // 3. Categorize fetch keys by chain ID let categorized_keys = categorize_fetch_keys(dry_run_module.fetch_keys); diff --git a/hdp/src/preprocessor/module_registry.rs b/hdp/src/preprocessor/module_registry.rs index bc4cdb36..038fe9be 100644 --- a/hdp/src/preprocessor/module_registry.rs +++ b/hdp/src/preprocessor/module_registry.rs @@ -64,8 +64,10 @@ impl ModuleRegistry { local_class_path: Option, module_inputs: Vec, ) -> Result { - let program_hash = - program_hash.map(|program_hash| FieldElement::from_hex_be(&program_hash).unwrap()); + let program_hash = program_hash.map(|program_hash| { + FieldElement::from_hex_be(&program_hash) + .expect("program hash cannot be converted to FieldElement") + }); let module_inputs: Result, _> = module_inputs .into_iter() .map(|input| ModuleInput::from_str(&input)) @@ -103,7 +105,8 @@ impl ModuleRegistry { }; let program_hash = casm.compiled_class_hash(); - let converted_hash = FieldElement::from_bytes_be(&program_hash.to_bytes_be()).unwrap(); + let converted_hash = FieldElement::from_bytes_be(&program_hash.to_bytes_be()) + .expect("program hash cannot be converted to FieldElement"); info!("program Hash: {:#?}", converted_hash); let module = Module { diff --git a/hdp/src/primitives/block/account.rs b/hdp/src/primitives/block/account.rs index 447bb93e..c8386d53 100644 --- a/hdp/src/primitives/block/account.rs +++ b/hdp/src/primitives/block/account.rs @@ -30,7 +30,7 @@ impl Account { } pub fn rlp_decode(mut rlp: &[u8]) -> Self { - ::decode(&mut rlp).unwrap() + ::decode(&mut rlp).expect("rlp decode failed.") } } diff --git a/hdp/src/primitives/chain_id.rs b/hdp/src/primitives/chain_id.rs index 7f35dfaf..71c93904 100644 --- a/hdp/src/primitives/chain_id.rs +++ b/hdp/src/primitives/chain_id.rs @@ -13,6 +13,12 @@ pub enum ChainId { StarknetSepolia, } +impl Default for ChainId { + fn default() -> Self { + Self::EthereumSepolia + } +} + #[derive(Error, Debug, PartialEq)] #[error("Failed to parse ChainId: {input}")] pub struct ParseChainIdError { diff --git a/hdp/src/primitives/processed_types/cairo_format/account.rs b/hdp/src/primitives/processed_types/cairo_format/account.rs index a568790d..125119e9 100644 --- a/hdp/src/primitives/processed_types/cairo_format/account.rs +++ b/hdp/src/primitives/processed_types/cairo_format/account.rs @@ -14,8 +14,7 @@ impl AsCairoFormat for BaseProcessedAccount { type Output = ProcessedAccount; fn as_cairo_format(&self) -> Self::Output { - let address_chunk_result = - FieldElementVectorUnit::from_bytes(self.address.as_ref()).unwrap(); + let address_chunk_result = FieldElementVectorUnit::from_bytes(self.address.as_ref()); let account_key = &self.account_key; let proofs = self .proofs diff --git a/hdp/src/primitives/processed_types/cairo_format/datalake_compute.rs b/hdp/src/primitives/processed_types/cairo_format/datalake_compute.rs index 1042dc75..b711be25 100644 --- a/hdp/src/primitives/processed_types/cairo_format/datalake_compute.rs +++ b/hdp/src/primitives/processed_types/cairo_format/datalake_compute.rs @@ -10,9 +10,8 @@ impl AsCairoFormat for BaseProcessedDatalakeCompute { type Output = ProcessedDatalakeCompute; fn as_cairo_format(&self) -> Self::Output { - let computational_task_felts = - FieldElementVectorUnit::from_bytes(&self.encoded_task).unwrap(); - let datalake_felts = FieldElementVectorUnit::from_bytes(&self.encoded_datalake).unwrap(); + let computational_task_felts = FieldElementVectorUnit::from_bytes(&self.encoded_task); + let datalake_felts = FieldElementVectorUnit::from_bytes(&self.encoded_datalake); ProcessedDatalakeCompute { task_bytes_len: computational_task_felts.bytes_len, encoded_task: computational_task_felts.felts, diff --git a/hdp/src/primitives/processed_types/cairo_format/felt_vec_unit.rs b/hdp/src/primitives/processed_types/cairo_format/felt_vec_unit.rs index afc4baca..6a19a72b 100644 --- a/hdp/src/primitives/processed_types/cairo_format/felt_vec_unit.rs +++ b/hdp/src/primitives/processed_types/cairo_format/felt_vec_unit.rs @@ -1,4 +1,3 @@ -use anyhow::Result; use serde::Serialize; use serde_with::serde_as; use starknet::core::serde::unsigned_field_element::UfeHex; @@ -7,15 +6,25 @@ use starknet_crypto::FieldElement; #[serde_as] #[derive(Serialize, Debug)] pub struct FieldElementVectorUnit { + /// Chunked vector of field elements #[serde_as(as = "Vec")] pub felts: Vec, + /// Length of the original byte array before chunking into field elements pub bytes_len: u64, } impl FieldElementVectorUnit { - pub fn from_bytes(bytes: &[u8]) -> Result { + /// Converts a byte slice into a `FieldElementVectorUnit`. + /// + /// This function takes a slice of bytes and converts it into a `FieldElementVectorUnit`, + /// which consists of a vector of `FieldElement`s and the length of the original byte slice. + /// + /// # Panics + /// + /// This function will panic if the input byte slice is empty. + pub fn from_bytes(bytes: &[u8]) -> Self { if bytes.is_empty() { - return Err(anyhow::anyhow!("Empty hex input")); + panic!("Cannot convert to FieldElementVectorUnit from empty bytes") } let bytes_len = bytes.len() as u64; let felts = bytes @@ -30,7 +39,7 @@ impl FieldElementVectorUnit { }) .collect(); - Ok(Self { felts, bytes_len }) + Self { felts, bytes_len } } } @@ -41,16 +50,16 @@ mod tests { use super::*; #[test] + #[should_panic(expected = "Cannot convert to FieldElementVectorUnit from empty bytes")] fn test_empty_bytes() { let bytes = hex::decode("").unwrap(); - let result = FieldElementVectorUnit::from_bytes(&bytes); - assert!(result.is_err()); + FieldElementVectorUnit::from_bytes(&bytes); } #[test] fn test_single_byte_bytes() { let bytes = hex::decode("0x01").unwrap(); - let result = FieldElementVectorUnit::from_bytes(&bytes).unwrap(); + let result = FieldElementVectorUnit::from_bytes(&bytes); assert_eq!(result.bytes_len, 1); assert_eq!(result.felts.len(), 1); assert_eq!(result.felts[0], FieldElement::from_hex_be("0x1").unwrap()); @@ -59,7 +68,7 @@ mod tests { #[test] fn test_single_chunk_bytes() { let bytes = hex::decode("0x1234567890abcdef").unwrap(); - let result = FieldElementVectorUnit::from_bytes(&bytes).unwrap(); + let result = FieldElementVectorUnit::from_bytes(&bytes); assert_eq!(result.bytes_len, 8); assert_eq!(result.felts.len(), 1); assert_eq!( @@ -71,7 +80,7 @@ mod tests { #[test] fn test_multiple_chunks_bytes() { let bytes = hex::decode("0x1234567890abcdef1122334455667788").unwrap(); - let result = FieldElementVectorUnit::from_bytes(&bytes).unwrap(); + let result = FieldElementVectorUnit::from_bytes(&bytes); assert_eq!(result.bytes_len, 16); assert_eq!(result.felts.len(), 2); assert_eq!( diff --git a/hdp/src/primitives/processed_types/cairo_format/header.rs b/hdp/src/primitives/processed_types/cairo_format/header.rs index 6d04873b..663ad126 100644 --- a/hdp/src/primitives/processed_types/cairo_format/header.rs +++ b/hdp/src/primitives/processed_types/cairo_format/header.rs @@ -13,7 +13,7 @@ impl AsCairoFormat for BaseProcessedHeader { type Output = ProcessedHeader; fn as_cairo_format(&self) -> Self::Output { - let felts_unit = FieldElementVectorUnit::from_bytes(&self.rlp).unwrap(); + let felts_unit = FieldElementVectorUnit::from_bytes(&self.rlp); let proof = self.proof.clone(); ProcessedHeader { rlp: felts_unit.felts, diff --git a/hdp/src/primitives/processed_types/cairo_format/module.rs b/hdp/src/primitives/processed_types/cairo_format/module.rs index fe55b295..ace62357 100644 --- a/hdp/src/primitives/processed_types/cairo_format/module.rs +++ b/hdp/src/primitives/processed_types/cairo_format/module.rs @@ -13,7 +13,7 @@ impl AsCairoFormat for BaseProcessedModule { type Output = ProcessedModule; fn as_cairo_format(&self) -> Self::Output { - let module_task_felts = FieldElementVectorUnit::from_bytes(&self.encoded_task).unwrap(); + let module_task_felts = FieldElementVectorUnit::from_bytes(&self.encoded_task); ProcessedModule { module_class: self.module_class.clone(), encoded_task: module_task_felts.felts, diff --git a/hdp/src/primitives/processed_types/cairo_format/mpt.rs b/hdp/src/primitives/processed_types/cairo_format/mpt.rs index ec2baaaa..707f4112 100644 --- a/hdp/src/primitives/processed_types/cairo_format/mpt.rs +++ b/hdp/src/primitives/processed_types/cairo_format/mpt.rs @@ -13,7 +13,7 @@ impl AsCairoFormat for BaseProcessedMPTProof { let proof_felts: Vec = self .proof .iter() - .map(|proof| FieldElementVectorUnit::from_bytes(proof).unwrap()) + .map(|proof| FieldElementVectorUnit::from_bytes(proof)) .collect(); let proof_bytes_len = proof_felts.iter().map(|f| f.bytes_len).collect(); diff --git a/hdp/src/primitives/processed_types/cairo_format/receipt.rs b/hdp/src/primitives/processed_types/cairo_format/receipt.rs index f5293f1b..dba8fd5d 100644 --- a/hdp/src/primitives/processed_types/cairo_format/receipt.rs +++ b/hdp/src/primitives/processed_types/cairo_format/receipt.rs @@ -15,7 +15,7 @@ impl AsCairoFormat for BaseProcessedReceipt { let proof_felts: Vec = self .proof .iter() - .map(|proof| FieldElementVectorUnit::from_bytes(proof).unwrap()) + .map(|proof| FieldElementVectorUnit::from_bytes(proof)) .collect(); let proof_bytes_len = proof_felts.iter().map(|f| f.bytes_len).collect(); diff --git a/hdp/src/primitives/processed_types/cairo_format/storage.rs b/hdp/src/primitives/processed_types/cairo_format/storage.rs index 4aba0c1c..6817b80b 100644 --- a/hdp/src/primitives/processed_types/cairo_format/storage.rs +++ b/hdp/src/primitives/processed_types/cairo_format/storage.rs @@ -14,9 +14,8 @@ impl AsCairoFormat for BaseProcessedStorage { type Output = ProcessedStorage; fn as_cairo_format(&self) -> Self::Output { - let address_chunk_result = - FieldElementVectorUnit::from_bytes(self.address.as_ref()).unwrap(); - let slot_chunk_result = FieldElementVectorUnit::from_bytes(self.slot.as_ref()).unwrap(); + let address_chunk_result = FieldElementVectorUnit::from_bytes(self.address.as_ref()); + let slot_chunk_result = FieldElementVectorUnit::from_bytes(self.slot.as_ref()); let storage_key = self.storage_key; let proofs = self .proofs diff --git a/hdp/src/primitives/processed_types/cairo_format/transaction.rs b/hdp/src/primitives/processed_types/cairo_format/transaction.rs index 39385a9b..2a32578b 100644 --- a/hdp/src/primitives/processed_types/cairo_format/transaction.rs +++ b/hdp/src/primitives/processed_types/cairo_format/transaction.rs @@ -15,7 +15,7 @@ impl AsCairoFormat for BaseProcessedTransaction { let proof_felts: Vec = self .proof .iter() - .map(|proof| FieldElementVectorUnit::from_bytes(proof).unwrap()) + .map(|proof| FieldElementVectorUnit::from_bytes(proof)) .collect(); let proof_bytes_len = proof_felts.iter().map(|f| f.bytes_len).collect(); diff --git a/hdp/src/primitives/processed_types/uint256.rs b/hdp/src/primitives/processed_types/uint256.rs index 33e51e00..a5fd4676 100644 --- a/hdp/src/primitives/processed_types/uint256.rs +++ b/hdp/src/primitives/processed_types/uint256.rs @@ -1,8 +1,9 @@ //! This module contains the `Uint256` type, which is a 256-bit unsigned integer. //! This is compatible with Cairo `uint256` type. -use alloy::primitives::{hex::FromHex, B256}; +use alloy::primitives::{hex::FromHex, B256, U256}; use anyhow::Result; +use core::fmt::Display; use serde::{Deserialize, Serialize}; use serde_with::serde_as; use starknet::core::serde::unsigned_field_element::UfeHex; @@ -11,27 +12,81 @@ use std::str::FromStr; use crate::primitives::utils::bytes_to_hex_string; +/// [`Uint256`] represents a 256-bit unsigned integer. +/// It is implemented as a struct with two [`FieldElement`] values: `high` and `low`. +/// Each [`FieldElement`] represents 128 bits of the 256-bit integer. #[serde_as] #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Eq, Hash)] pub struct Uint256 { #[serde_as(as = "UfeHex")] - pub low: FieldElement, + pub low: FieldElement, // Represents the least significant 128 bits #[serde_as(as = "UfeHex")] - pub high: FieldElement, + pub high: FieldElement, // Represents the most significant 128 bits +} + +impl Default for Uint256 { + /// Returns a `Uint256` with a value of zero. + fn default() -> Self { + Self::ZERO + } } impl Uint256 { - pub fn from_strs(high: &str, low: &str) -> Result { + /// Constant representing zero as a `Uint256`. + pub const ZERO: Self = Self { + high: FieldElement::ZERO, + low: FieldElement::ZERO, + }; + + /// Creates a `Uint256` from two byte slices representing the high and low parts. + /// + /// # Arguments + /// * `high` - A byte slice representing the most significant 128 bits + /// * `low` - A byte slice representing the least significant 128 bits + /// + /// # Returns + /// A `Result` containing the new `Uint256` or an error if conversion fails. + pub fn from_bytes_tuple(high: &[u8], low: &[u8]) -> Result { + Ok(Self { + high: FieldElement::from_byte_slice_be(high)?, + low: FieldElement::from_byte_slice_be(low)?, + }) + } + + /// Creates a `Uint256` from two hexadecimal strings representing the high and low parts. + /// + /// # Arguments + /// * `high` - A string slice representing the most significant 128 bits in hex + /// * `low` - A string slice representing the least significant 128 bits in hex + /// + /// # Returns + /// A `Result` containing the new `Uint256` or an error if conversion fails. + pub fn from_hex_tuple(high: &str, low: &str) -> Result { Ok(Self { high: FieldElement::from_hex_be(high)?, low: FieldElement::from_hex_be(low)?, }) } - pub fn from_felts(high: FieldElement, low: FieldElement) -> Self { + /// Creates a `Uint256` from two [`FieldElement`]s representing the high and low parts. + /// + /// # Arguments + /// * `high` - A `FieldElement` representing the most significant 128 bits + /// * `low` - A `FieldElement` representing the least significant 128 bits + /// + /// # Returns + /// A new `Uint256` instance. + pub fn from_field_element_tuple(high: FieldElement, low: FieldElement) -> Self { Self { high, low } } + /// Creates a `Uint256` from a little-endian hexadecimal string. + /// + /// # Arguments + /// * `hex_str` - A string slice containing the hexadecimal representation + /// + /// # Returns + /// A `Result` containing the new `Uint256` or an error if conversion fails. pub fn from_le_hex_str(hex_str: &str) -> Result { let clean_hex = hex_str.trim_start_matches("0x"); let mut fix_hex: B256 = B256::from_hex(clean_hex)?; @@ -46,6 +101,13 @@ impl Uint256 { }) } + /// Creates a `Uint256` from a big-endian hexadecimal string. + /// + /// # Arguments + /// * `hex_str` - A string slice containing the hexadecimal representation + /// + /// # Returns + /// A `Result` containing the new `Uint256` or an error if conversion fails. pub fn from_be_hex_str(hex_str: &str) -> Result { let clean_hex = hex_str.trim_start_matches("0x"); let padded_hex = format!("{:0>64}", clean_hex); @@ -56,8 +118,28 @@ impl Uint256 { }) } - /// combine_parts_into_big_endian_hex - pub fn to_combined_string(&self) -> B256 { + /// Creates a `Uint256` from a big-endian byte slice. + /// + /// # Arguments + /// * `bytes` - A byte slice containing the 256-bit integer representation + /// + /// # Returns + /// A `Result` containing the new `Uint256` or an error if conversion fails. + pub fn from_be_bytes(bytes: &[u8]) -> Result { + let high_part = bytes[..16].to_vec(); + let low_part = bytes[16..].to_vec(); + + Ok(Self { + high: FieldElement::from_hex_be(&bytes_to_hex_string(&high_part))?, + low: FieldElement::from_hex_be(&bytes_to_hex_string(&low_part))?, + }) + } +} + +impl Display for Uint256 { + /// Formats the `Uint256` as a hexadecimal string. + /// The output is a 0x-prefixed, 64-character hexadecimal string. + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { // Ensure both parts are exactly 32 hex characters long let high_padded = format!( "{:0>32}", @@ -71,8 +153,35 @@ impl Uint256 { ) .trim_start_matches("0x") .to_string(); + write!(f, "0x{}{}", high_padded, low_padded) + } +} + +impl From for B256 { + /// Converts a `Uint256` to a `B256`. + fn from(value: Uint256) -> B256 { + B256::from_str(&value.to_string()).expect("Invalid value for B256") + } +} + +impl From for Uint256 { + /// Converts a `B256` to a `Uint256`. + fn from(value: B256) -> Self { + Self::from_be_bytes(value.as_slice()).expect("Invalid value for Uint256") + } +} - B256::from_str(&format!("0x{}{}", high_padded, low_padded)).unwrap() +impl From for U256 { + /// Converts a `Uint256` to a `U256`. + fn from(value: Uint256) -> U256 { + U256::from_str(&value.to_string()).expect("Invalid value for U256") + } +} + +impl From for Uint256 { + /// Converts a `U256` to a `Uint256`. + fn from(value: U256) -> Self { + Self::from_be_bytes(&value.to_be_bytes_vec()).expect("Invalid value for Uint256") } } @@ -85,32 +194,35 @@ mod tests { #[test] fn test_combine_parts_into_big_endian_hex() { - let uint256 = Uint256::from_felts( - FieldElement::from_hex_be("0x988c19313bcbfb19fcc4da12e3adb46c").unwrap(), - FieldElement::from_hex_be("0xf6fbdd08af91b1d8df80c6e755159f1").unwrap(), - ); + let result0: B256 = Uint256::from_field_element_tuple( + felt!("0x988c19313bcbfb19fcc4da12e3adb46c"), + felt!("0xf6fbdd08af91b1d8df80c6e755159f1"), + ) + .into(); assert_eq!( - uint256.to_combined_string(), + result0, B256::from_str("0x988c19313bcbfb19fcc4da12e3adb46c0f6fbdd08af91b1d8df80c6e755159f1") .unwrap() ); - let uint256 = Uint256::from_felts( + let result1: B256 = Uint256::from_field_element_tuple( felt!("0x988c19313bcbfb19fcc4da12e3adb46"), felt!("0xf6fbdd08af91b1d8df80c6e755159f1"), - ); + ) + .into(); assert_eq!( - uint256.to_combined_string(), + result1, B256::from_str("0x0988c19313bcbfb19fcc4da12e3adb460f6fbdd08af91b1d8df80c6e755159f1") .unwrap() ); - let uint256 = Uint256::from_felts( + let result2: B256 = Uint256::from_field_element_tuple( felt!("0x988c19313bcbfb19fcc4da12e3adb4"), felt!("0xf6fbdd08af91b1d8df80c6e755159f1"), - ); + ) + .into(); assert_eq!( - uint256.to_combined_string(), + result2, B256::from_str("0x00988c19313bcbfb19fcc4da12e3adb40f6fbdd08af91b1d8df80c6e755159f1") .unwrap() ); @@ -122,12 +234,13 @@ mod tests { let result = Uint256::from_be_hex_str(hex_str).unwrap(); assert_eq!( result, - Uint256::from_felts( + Uint256::from_field_element_tuple( felt!("0x60870c80ce4e1d0c35e34f08b1648e8a"), felt!("0x4fdc7818eea7caedbd316c63a3863562"), ) ); - assert_eq!(result.to_combined_string().to_string(), hex_str); + let result_b256: B256 = result.into(); + assert_eq!(result_b256, B256::from_str(hex_str).unwrap()); } #[test] @@ -136,7 +249,7 @@ mod tests { let result = Uint256::from_le_hex_str(hex_str).unwrap(); assert_eq!( result, - Uint256::from_felts( + Uint256::from_field_element_tuple( felt!("0x1d693b26fded2cc4edb9acbf8133f52d"), felt!("0x2a32ca1db17188d788996d243adbda8d"), ) @@ -145,7 +258,7 @@ mod tests { #[test] fn test_uint256_serde() { - let target = Uint256::from_felts( + let target = Uint256::from_field_element_tuple( felt!("0x1d693b26fded2cc4edb9acbf8133f52d"), felt!("0x2a32ca1db17188d788996d243adbda8d"), ); @@ -154,4 +267,11 @@ mod tests { let expected = json_file.trim(); assert_eq!(string, expected); } + + #[test] + fn test_uint256_default() { + let zero: B256 = Uint256::ZERO.into(); + + assert_eq!(zero, B256::ZERO) + } } diff --git a/hdp/src/primitives/solidity_types/datalake_compute/datalake/envelope.rs b/hdp/src/primitives/solidity_types/datalake_compute/datalake/envelope.rs index bf529c3a..d2f1413c 100644 --- a/hdp/src/primitives/solidity_types/datalake_compute/datalake/envelope.rs +++ b/hdp/src/primitives/solidity_types/datalake_compute/datalake/envelope.rs @@ -180,7 +180,7 @@ mod tests { 1, 100, 1, - IncludedTypes::from(&[0, 0, 1, 1]), + IncludedTypes::from_bytes(&[0, 0, 1, 1]), ); let transaction_datalake2 = TransactionsInBlockDatalake::new( @@ -190,7 +190,7 @@ mod tests { 1, 100, 1, - IncludedTypes::from(&[0, 0, 1, 1]), + IncludedTypes::from_bytes(&[0, 0, 1, 1]), ); let datalakes = vec![ @@ -215,7 +215,7 @@ mod tests { 1, 100, 1, - IncludedTypes::from(&[0, 0, 1, 1]), + IncludedTypes::from_bytes(&[0, 0, 1, 1]), ); let transaction_datalake2 = TransactionsInBlockDatalake::new( @@ -225,7 +225,7 @@ mod tests { 1, 100, 1, - IncludedTypes::from(&[0, 0, 1, 1]), + IncludedTypes::from_bytes(&[0, 0, 1, 1]), ); assert_eq!( @@ -247,7 +247,7 @@ mod tests { 1, 100, 1, - IncludedTypes::from(&[0, 0, 1, 1]), + IncludedTypes::from_bytes(&[0, 0, 1, 1]), ); let transaction_datalake2 = TransactionsInBlockDatalake::new( @@ -257,7 +257,7 @@ mod tests { 1, 100, 1, - IncludedTypes::from(&[0, 0, 1, 1]), + IncludedTypes::from_bytes(&[0, 0, 1, 1]), ); let datalakes = vec![ @@ -282,7 +282,7 @@ mod tests { 1, 100, 1, - IncludedTypes::from(&[0, 0, 1, 1]), + IncludedTypes::from_bytes(&[0, 0, 1, 1]), ); let transaction_datalake2 = TransactionsInBlockDatalake::new( @@ -292,7 +292,7 @@ mod tests { 1, 100, 1, - IncludedTypes::from(&[0, 0, 1, 1]), + IncludedTypes::from_bytes(&[0, 0, 1, 1]), ); assert_eq!( diff --git a/hdp/src/primitives/solidity_types/datalake_compute/datalake/transactions_in_block.rs b/hdp/src/primitives/solidity_types/datalake_compute/datalake/transactions_in_block.rs index 81c91781..0905bedc 100644 --- a/hdp/src/primitives/solidity_types/datalake_compute/datalake/transactions_in_block.rs +++ b/hdp/src/primitives/solidity_types/datalake_compute/datalake/transactions_in_block.rs @@ -7,7 +7,7 @@ use crate::primitives::{ }, ChainId, }; -use alloy::primitives::keccak256; +use alloy::primitives::{keccak256, U256}; use alloy::{ dyn_abi::{DynSolType, DynSolValue}, primitives::B256, @@ -29,7 +29,8 @@ impl DatalakeCodecs for TransactionsInBlockDatalake { let start_index: DynSolValue = self.start_index.into(); let end_index: DynSolValue = self.end_index.into(); let increment: DynSolValue = self.increment.into(); - let included_types: DynSolValue = self.included_types.to_uint256().into(); + let converted: U256 = (&self.included_types).into(); + let included_types: DynSolValue = converted.into(); let tuple_value = DynSolValue::Tuple(vec![ datalake_code, @@ -73,7 +74,7 @@ impl DatalakeCodecs for TransactionsInBlockDatalake { let start_index = value[3].as_uint().unwrap().0.to_string().parse::()?; let end_index = value[4].as_uint().unwrap().0.to_string().parse::()?; let increment = value[5].as_uint().unwrap().0.to_string().parse::()?; - let included_types = IncludedTypes::from_uint256(value[6].as_uint().unwrap().0); + let included_types = IncludedTypes::from(value[6].as_uint().unwrap().0); let sampled_property = TransactionsCollection::deserialize(value[7].as_bytes().unwrap())?; Ok(Self { diff --git a/hdp/src/primitives/task/datalake/block_sampled/datalake.rs b/hdp/src/primitives/task/datalake/block_sampled/datalake.rs index 7242e98c..850d249c 100644 --- a/hdp/src/primitives/task/datalake/block_sampled/datalake.rs +++ b/hdp/src/primitives/task/datalake/block_sampled/datalake.rs @@ -5,12 +5,13 @@ use crate::primitives::{task::datalake::envelope::default_increment, ChainId}; use super::collection::BlockSampledCollection; /// [`BlockSampledDatalake`] is a struct that represents a block sampled datalake. -/// It contains the block range, the sampled property, and the increment. +/// It contains chain id, block range, the sampled property, and the increment. /// -/// The block range is inclusive, so the block range is from `block_range_start` to `block_range_end` +/// Inclusive block range: [block_range_start..block_range_end] #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct BlockSampledDatalake { + /// Chain id of the datalake pub chain_id: ChainId, /// The start of the block range pub block_range_start: u64, diff --git a/hdp/src/primitives/task/datalake/transactions/datalake.rs b/hdp/src/primitives/task/datalake/transactions/datalake.rs index dee89bd6..b7b0727b 100644 --- a/hdp/src/primitives/task/datalake/transactions/datalake.rs +++ b/hdp/src/primitives/task/datalake/transactions/datalake.rs @@ -114,7 +114,15 @@ impl IncludedTypes { included_types } - pub fn from(included_types: &[u8]) -> Self { + /// Converts a slice of bytes into an [`IncludedTypes`] instance. + /// + /// # Panics + /// + /// This function will panic if: + /// - The input slice is not exactly 4 bytes long. + /// - Any byte in the slice is not 0 or 1. + /// - All bytes in the slice are 0 (i.e., no transaction type is included). + pub fn from_bytes(included_types: &[u8]) -> Self { if included_types.len() != 4 { panic!("Included types must be 4 bytes long"); } @@ -134,19 +142,24 @@ impl IncludedTypes { let inner_bytes = self.to_be_bytes(); inner_bytes[target_type as usize] != 0 } +} - pub fn to_uint256(&self) -> U256 { +impl From<&IncludedTypes> for U256 { + fn from(value: &IncludedTypes) -> U256 { let mut bytes = [0; 32]; - let inner_bytes = self.to_be_bytes(); + let inner_bytes = value.to_be_bytes(); bytes[28..32].copy_from_slice(&inner_bytes); U256::from_be_bytes(bytes) } +} - pub fn from_uint256(value: U256) -> Self { +// Implementation of From for Self +impl From for IncludedTypes { + fn from(value: U256) -> IncludedTypes { let bytes: [u8; 32] = value.to_be_bytes(); let mut inner = [0; 4]; inner.copy_from_slice(&bytes[28..32]); - Self::from_be_bytes(inner) + IncludedTypes::from_be_bytes(inner) } } @@ -163,7 +176,7 @@ impl FromStr for IncludedTypes { panic!("Included types must be 4 bytes long"); } - Ok(IncludedTypes::from(&included_types)) + Ok(IncludedTypes::from_bytes(&included_types)) } } @@ -173,16 +186,16 @@ mod tests { #[test] fn test_included_types() { - let included_types = IncludedTypes::from(&[1, 1, 1, 1]); + let included_types = IncludedTypes::from_bytes(&[1, 1, 1, 1]); assert!(included_types.is_included(TxType::Legacy)); assert!(included_types.is_included(TxType::Eip2930)); assert!(included_types.is_included(TxType::Eip1559)); assert!(included_types.is_included(TxType::Eip4844)); - let uint256 = included_types.to_uint256(); + let uint256: U256 = (&included_types).into(); assert_eq!(uint256, U256::from(0x01010101)); - let included_types = IncludedTypes::from_uint256(uint256); + let included_types = IncludedTypes::from(uint256); assert!(included_types.is_included(TxType::Legacy)); assert!(included_types.is_included(TxType::Eip2930)); assert!(included_types.is_included(TxType::Eip1559)); @@ -191,16 +204,16 @@ mod tests { #[test] fn test_included_types_partial() { - let included_types = IncludedTypes::from(&[1, 0, 1, 0]); + let included_types = IncludedTypes::from_bytes(&[1, 0, 1, 0]); assert!(included_types.is_included(TxType::Legacy)); assert!(!included_types.is_included(TxType::Eip2930)); assert!(included_types.is_included(TxType::Eip1559)); assert!(!included_types.is_included(TxType::Eip4844)); - let uint256 = included_types.to_uint256(); + let uint256: U256 = (&included_types).into(); assert_eq!(uint256, U256::from(0x01000100)); - let included_types = IncludedTypes::from_uint256(uint256); + let included_types = IncludedTypes::from(uint256); assert!(included_types.is_included(TxType::Legacy)); assert!(!included_types.is_included(TxType::Eip2930)); assert!(included_types.is_included(TxType::Eip1559)); diff --git a/hdp/src/primitives/task/datalake/transactions/mod.rs b/hdp/src/primitives/task/datalake/transactions/mod.rs index 3abcef5b..625297bf 100644 --- a/hdp/src/primitives/task/datalake/transactions/mod.rs +++ b/hdp/src/primitives/task/datalake/transactions/mod.rs @@ -33,7 +33,7 @@ mod tests { 1, 10, 2, - IncludedTypes::from(&[1, 1, 1, 1]), + IncludedTypes::from_bytes(&[1, 1, 1, 1]), ); let encoded = transaction_datalake.encode().unwrap(); @@ -51,10 +51,8 @@ mod tests { TransactionsCollection::Transactions(TransactionField::Nonce) ); - assert_eq!( - transaction_datalake.included_types.to_uint256(), - U256::from(0x01010101) - ); + let converted: U256 = (&transaction_datalake.included_types).into(); + assert_eq!(converted, U256::from(0x01010101)); let decoded = TransactionsInBlockDatalake::decode(&encoded).unwrap(); assert_eq!(decoded, transaction_datalake); @@ -72,7 +70,7 @@ mod tests { 1, 10, 2, - IncludedTypes::from(&[1, 0, 0, 1]), + IncludedTypes::from_bytes(&[1, 0, 0, 1]), ); let encoded = transaction_datalake.encode().unwrap(); @@ -90,10 +88,8 @@ mod tests { TransactionsCollection::TranasactionReceipts(TransactionReceiptField::Success) ); - assert_eq!( - transaction_datalake.included_types.to_uint256(), - U256::from(0x01000001) - ); + let converted: U256 = (&transaction_datalake.included_types).into(); + assert_eq!(converted, U256::from(0x01000001)); let decoded = TransactionsInBlockDatalake::decode(&encoded).unwrap(); assert_eq!(decoded, transaction_datalake); From 42d15fb29b7346b99e346c18c40cfa1a13446325 Mon Sep 17 00:00:00 2001 From: Pia Date: Sun, 15 Sep 2024 17:49:21 +0900 Subject: [PATCH 24/29] chore: consume value on from --- .../datalake_compute/datalake/transactions_in_block.rs | 2 +- .../primitives/task/datalake/transactions/datalake.rs | 10 +++++----- hdp/src/primitives/task/datalake/transactions/mod.rs | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/hdp/src/primitives/solidity_types/datalake_compute/datalake/transactions_in_block.rs b/hdp/src/primitives/solidity_types/datalake_compute/datalake/transactions_in_block.rs index 0905bedc..a9eb0482 100644 --- a/hdp/src/primitives/solidity_types/datalake_compute/datalake/transactions_in_block.rs +++ b/hdp/src/primitives/solidity_types/datalake_compute/datalake/transactions_in_block.rs @@ -29,7 +29,7 @@ impl DatalakeCodecs for TransactionsInBlockDatalake { let start_index: DynSolValue = self.start_index.into(); let end_index: DynSolValue = self.end_index.into(); let increment: DynSolValue = self.increment.into(); - let converted: U256 = (&self.included_types).into(); + let converted: U256 = self.included_types.into(); let included_types: DynSolValue = converted.into(); let tuple_value = DynSolValue::Tuple(vec![ diff --git a/hdp/src/primitives/task/datalake/transactions/datalake.rs b/hdp/src/primitives/task/datalake/transactions/datalake.rs index b7b0727b..87487128 100644 --- a/hdp/src/primitives/task/datalake/transactions/datalake.rs +++ b/hdp/src/primitives/task/datalake/transactions/datalake.rs @@ -66,7 +66,7 @@ impl TransactionsInBlockDatalake { /// 1: EIP-2930 /// 2: EIP-1559 /// 3: EIP-4844 -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] pub struct IncludedTypes { legacy: bool, eip2930: bool, @@ -144,8 +144,8 @@ impl IncludedTypes { } } -impl From<&IncludedTypes> for U256 { - fn from(value: &IncludedTypes) -> U256 { +impl From for U256 { + fn from(value: IncludedTypes) -> U256 { let mut bytes = [0; 32]; let inner_bytes = value.to_be_bytes(); bytes[28..32].copy_from_slice(&inner_bytes); @@ -192,7 +192,7 @@ mod tests { assert!(included_types.is_included(TxType::Eip1559)); assert!(included_types.is_included(TxType::Eip4844)); - let uint256: U256 = (&included_types).into(); + let uint256: U256 = included_types.into(); assert_eq!(uint256, U256::from(0x01010101)); let included_types = IncludedTypes::from(uint256); @@ -210,7 +210,7 @@ mod tests { assert!(included_types.is_included(TxType::Eip1559)); assert!(!included_types.is_included(TxType::Eip4844)); - let uint256: U256 = (&included_types).into(); + let uint256: U256 = included_types.into(); assert_eq!(uint256, U256::from(0x01000100)); let included_types = IncludedTypes::from(uint256); diff --git a/hdp/src/primitives/task/datalake/transactions/mod.rs b/hdp/src/primitives/task/datalake/transactions/mod.rs index 625297bf..f96d1a53 100644 --- a/hdp/src/primitives/task/datalake/transactions/mod.rs +++ b/hdp/src/primitives/task/datalake/transactions/mod.rs @@ -51,7 +51,7 @@ mod tests { TransactionsCollection::Transactions(TransactionField::Nonce) ); - let converted: U256 = (&transaction_datalake.included_types).into(); + let converted: U256 = transaction_datalake.included_types.into(); assert_eq!(converted, U256::from(0x01010101)); let decoded = TransactionsInBlockDatalake::decode(&encoded).unwrap(); @@ -88,7 +88,7 @@ mod tests { TransactionsCollection::TranasactionReceipts(TransactionReceiptField::Success) ); - let converted: U256 = (&transaction_datalake.included_types).into(); + let converted: U256 = transaction_datalake.included_types.into(); assert_eq!(converted, U256::from(0x01000001)); let decoded = TransactionsInBlockDatalake::decode(&encoded).unwrap(); From cbcf5a0bf572a6c198ce39cfef2af0d69d9a75e1 Mon Sep 17 00:00:00 2001 From: Pia Date: Sun, 15 Sep 2024 17:57:42 +0900 Subject: [PATCH 25/29] chore: --- hdp/src/preprocessor/compile/datalake.rs | 4 +-- .../task/datalake/transactions/datalake.rs | 27 ++++++++++++++----- .../task/datalake/transactions/mod.rs | 2 +- 3 files changed, 23 insertions(+), 10 deletions(-) diff --git a/hdp/src/preprocessor/compile/datalake.rs b/hdp/src/preprocessor/compile/datalake.rs index 7cef1a11..47f4da05 100644 --- a/hdp/src/preprocessor/compile/datalake.rs +++ b/hdp/src/preprocessor/compile/datalake.rs @@ -173,7 +173,7 @@ mod tests { start_index: 0, end_index: 10, increment: 1, - included_types: IncludedTypes::from_bytes(&[1, 1, 1, 1]), + included_types: IncludedTypes::ALL, sampled_property: TransactionsCollection::Transactions( TransactionField::GasLimit, ), @@ -187,7 +187,7 @@ mod tests { start_index: 0, end_index: 11, increment: 1, - included_types: IncludedTypes::from_bytes(&[1, 1, 1, 1]), + included_types: IncludedTypes::ALL, sampled_property: TransactionsCollection::TranasactionReceipts( TransactionReceiptField::Success, ), diff --git a/hdp/src/primitives/task/datalake/transactions/datalake.rs b/hdp/src/primitives/task/datalake/transactions/datalake.rs index 87487128..84a0b6fd 100644 --- a/hdp/src/primitives/task/datalake/transactions/datalake.rs +++ b/hdp/src/primitives/task/datalake/transactions/datalake.rs @@ -17,22 +17,27 @@ use crate::primitives::{task::datalake::envelope::default_increment, ChainId}; use super::TransactionsCollection; +/// [`TransactionsInBlockDatalake`] is a struct that represents a transactions datalake. +/// It contains chain id, target block, transaction range, sampled property, and other properties. +/// +/// Transaction range: [start_index..end_index] with specified increment #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct TransactionsInBlockDatalake { + /// Chain id of the datalake pub chain_id: ChainId, - // target block number + /// Target block number pub target_block: u64, - // start index of transactions range ( default 0 ) + /// Start index of transactions range (default 0) pub start_index: u64, - // end index of transactions range, not included in the range ( default last ) + /// End index of transactions range, not included in the range (default last) pub end_index: u64, - // increment of transactions, Defaults to 1 if not present. + /// Increment of transactions, Defaults to 1 if not present. #[serde(default = "default_increment")] pub increment: u64, - // filter out the specific type of Txs + /// Filter out the specific type of Txs pub included_types: IncludedTypes, - // ex. "tx.to" , "tx.gas_price" or "tx_receipt.success", "tx_receipt.cumulative_gas_used" + /// Sampled property (e.g., "tx.to", "tx.gas_price", "tx_receipt.success", "tx_receipt.cumulative_gas_used") pub sampled_property: TransactionsCollection, } @@ -75,6 +80,14 @@ pub struct IncludedTypes { } impl IncludedTypes { + /// All transaction types(Legacy, EIP-1559, EIP-2930, EIP-4844) are included + pub const ALL: Self = Self { + legacy: true, + eip1559: true, + eip2930: true, + eip4844: true, + }; + pub fn to_be_bytes(&self) -> [u8; 4] { let mut bytes = [0; 4]; if self.legacy { @@ -186,7 +199,7 @@ mod tests { #[test] fn test_included_types() { - let included_types = IncludedTypes::from_bytes(&[1, 1, 1, 1]); + let included_types = IncludedTypes::ALL; assert!(included_types.is_included(TxType::Legacy)); assert!(included_types.is_included(TxType::Eip2930)); assert!(included_types.is_included(TxType::Eip1559)); diff --git a/hdp/src/primitives/task/datalake/transactions/mod.rs b/hdp/src/primitives/task/datalake/transactions/mod.rs index f96d1a53..5589833e 100644 --- a/hdp/src/primitives/task/datalake/transactions/mod.rs +++ b/hdp/src/primitives/task/datalake/transactions/mod.rs @@ -33,7 +33,7 @@ mod tests { 1, 10, 2, - IncludedTypes::from_bytes(&[1, 1, 1, 1]), + IncludedTypes::ALL, ); let encoded = transaction_datalake.encode().unwrap(); From 96fb67fa9f54b72418e6e26d3dac12826aa4e261 Mon Sep 17 00:00:00 2001 From: Pia Date: Sun, 15 Sep 2024 18:36:07 +0900 Subject: [PATCH 26/29] chore: more cleanup --- hdp/src/primitives/block/account.rs | 31 ++++++------------- hdp/src/primitives/block/header.rs | 9 ++---- hdp/src/primitives/chain_id.rs | 6 ---- hdp/src/primitives/processed_types/uint256.rs | 10 +++--- .../solidity_types/datalake_compute/mod.rs | 8 ++--- hdp/src/primitives/solidity_types/module.rs | 8 ++--- .../task/datalake/block_sampled/collection.rs | 2 +- .../task/datalake/block_sampled/rlp_fields.rs | 4 +-- hdp/src/primitives/task/datalake/envelope.rs | 6 ++-- .../task/datalake/transactions/collection.rs | 2 +- .../task/datalake/transactions/datalake.rs | 21 +++++++++++++ .../task/datalake/transactions/mod.rs | 11 ++----- .../task/datalake/transactions/rlp_fields.rs | 4 +-- hdp/src/primitives/task/module.rs | 10 +++++- 14 files changed, 63 insertions(+), 69 deletions(-) diff --git a/hdp/src/primitives/block/account.rs b/hdp/src/primitives/block/account.rs index c8386d53..da369862 100644 --- a/hdp/src/primitives/block/account.rs +++ b/hdp/src/primitives/block/account.rs @@ -49,18 +49,15 @@ impl From<&EIP1186AccountProofResponse> for Account { mod tests { use super::*; use alloy::hex; - use alloy::primitives::U256; - use std::str::FromStr; + use alloy::primitives::{b256, U256}; #[test] fn test_get_account_rlp() { let account = Account::new( U64::from(1), U256::from(0), - B256::from_str("0x1c35dfde2b62d99d3a74fda76446b60962c4656814bdd7815eb6e5b8be1e7185") - .unwrap(), - B256::from_str("0xcd4f25236fff0ccac15e82bf4581beb08e95e1b5ba89de6031c75893cd91245c") - .unwrap(), + b256!("1c35dfde2b62d99d3a74fda76446b60962c4656814bdd7815eb6e5b8be1e7185"), + b256!("cd4f25236fff0ccac15e82bf4581beb08e95e1b5ba89de6031c75893cd91245c"), ); let account_rlp = account.rlp_encode(); assert_eq!( @@ -71,10 +68,8 @@ mod tests { let account = Account::new( U64::from(2), U256::from(0), - B256::from_str("0x1c35dfde2b62d99d3a74fda76446b60962c4656814bdd7815eb6e5b8be1e7185") - .unwrap(), - B256::from_str("0xcd4f25236fff0ccac15e82bf4581beb08e95e1b5ba89de6031c75893cd91245c") - .unwrap(), + b256!("1c35dfde2b62d99d3a74fda76446b60962c4656814bdd7815eb6e5b8be1e7185"), + b256!("cd4f25236fff0ccac15e82bf4581beb08e95e1b5ba89de6031c75893cd91245c"), ); let account_rlp = account.rlp_encode(); assert_eq!( @@ -85,10 +80,8 @@ mod tests { let account = Account::new( U64::from(2), U256::from(0x1), - B256::from_str("0x1c35dfde2b62d99d3a74fda76446b60962c4656814bdd7815eb6e5b8be1e7185") - .unwrap(), - B256::from_str("0xcd4f25236fff0ccac15e82bf4581beb08e95e1b5ba89de6031c75893cd91245c") - .unwrap(), + b256!("1c35dfde2b62d99d3a74fda76446b60962c4656814bdd7815eb6e5b8be1e7185"), + b256!("cd4f25236fff0ccac15e82bf4581beb08e95e1b5ba89de6031c75893cd91245c"), ); let account_rlp = account.rlp_encode(); assert_eq!( @@ -106,14 +99,8 @@ mod tests { Account::new( U64::from(1), U256::from(0), - B256::from_str( - "0x1c35dfde2b62d99d3a74fda76446b60962c4656814bdd7815eb6e5b8be1e7185" - ) - .unwrap(), - B256::from_str( - "0xcd4f25236fff0ccac15e82bf4581beb08e95e1b5ba89de6031c75893cd91245c" - ) - .unwrap() + b256!("1c35dfde2b62d99d3a74fda76446b60962c4656814bdd7815eb6e5b8be1e7185"), + b256!("cd4f25236fff0ccac15e82bf4581beb08e95e1b5ba89de6031c75893cd91245c") ) ); } diff --git a/hdp/src/primitives/block/header.rs b/hdp/src/primitives/block/header.rs index 249ce349..02555db6 100644 --- a/hdp/src/primitives/block/header.rs +++ b/hdp/src/primitives/block/header.rs @@ -378,8 +378,8 @@ impl BlockHeaderFromRpc { } } -impl From<&BlockHeaderFromRpc> for Header { - fn from(value: &BlockHeaderFromRpc) -> Self { +impl From for Header { + fn from(value: BlockHeaderFromRpc) -> Self { Self { parent_hash: B256::from_str(&value.parent_hash).expect("Invalid hex string"), ommers_hash: B256::from_str(&value.sha3_uncles).expect("Invalid hex string"), @@ -400,23 +400,18 @@ impl From<&BlockHeaderFromRpc> for Header { nonce: u64::from_str_radix(&value.nonce[2..], 16).expect("Invalid hex string"), base_fee_per_gas: value .base_fee_per_gas - .clone() .map(|x| u64::from_str_radix(&x[2..], 16).expect("Invalid hex string")), withdrawals_root: value .withdrawals_root - .clone() .map(|x| B256::from_str(&x).expect("Invalid hex string")), blob_gas_used: value .blob_gas_used - .clone() .map(|x| u64::from_str_radix(&x[2..], 16).expect("Invalid hex string")), excess_blob_gas: value .excess_blob_gas - .clone() .map(|x| u64::from_str_radix(&x[2..], 16).expect("Invalid hex string")), parent_beacon_block_root: value .parent_beacon_block_root - .clone() .map(|x| B256::from_str(&x).expect("Invalid hex string")), } } diff --git a/hdp/src/primitives/chain_id.rs b/hdp/src/primitives/chain_id.rs index 71c93904..7f35dfaf 100644 --- a/hdp/src/primitives/chain_id.rs +++ b/hdp/src/primitives/chain_id.rs @@ -13,12 +13,6 @@ pub enum ChainId { StarknetSepolia, } -impl Default for ChainId { - fn default() -> Self { - Self::EthereumSepolia - } -} - #[derive(Error, Debug, PartialEq)] #[error("Failed to parse ChainId: {input}")] pub struct ParseChainIdError { diff --git a/hdp/src/primitives/processed_types/uint256.rs b/hdp/src/primitives/processed_types/uint256.rs index a5fd4676..3099417e 100644 --- a/hdp/src/primitives/processed_types/uint256.rs +++ b/hdp/src/primitives/processed_types/uint256.rs @@ -188,6 +188,7 @@ impl From for Uint256 { #[cfg(test)] mod tests { + use alloy::primitives::b256; use starknet::macros::felt; use super::*; @@ -201,8 +202,7 @@ mod tests { .into(); assert_eq!( result0, - B256::from_str("0x988c19313bcbfb19fcc4da12e3adb46c0f6fbdd08af91b1d8df80c6e755159f1") - .unwrap() + b256!("988c19313bcbfb19fcc4da12e3adb46c0f6fbdd08af91b1d8df80c6e755159f1") ); let result1: B256 = Uint256::from_field_element_tuple( @@ -212,8 +212,7 @@ mod tests { .into(); assert_eq!( result1, - B256::from_str("0x0988c19313bcbfb19fcc4da12e3adb460f6fbdd08af91b1d8df80c6e755159f1") - .unwrap() + b256!("0988c19313bcbfb19fcc4da12e3adb460f6fbdd08af91b1d8df80c6e755159f1") ); let result2: B256 = Uint256::from_field_element_tuple( @@ -223,8 +222,7 @@ mod tests { .into(); assert_eq!( result2, - B256::from_str("0x00988c19313bcbfb19fcc4da12e3adb40f6fbdd08af91b1d8df80c6e755159f1") - .unwrap() + b256!("00988c19313bcbfb19fcc4da12e3adb40f6fbdd08af91b1d8df80c6e755159f1") ); } diff --git a/hdp/src/primitives/solidity_types/datalake_compute/mod.rs b/hdp/src/primitives/solidity_types/datalake_compute/mod.rs index 36fd4ae6..bbefe0f2 100644 --- a/hdp/src/primitives/solidity_types/datalake_compute/mod.rs +++ b/hdp/src/primitives/solidity_types/datalake_compute/mod.rs @@ -106,6 +106,8 @@ impl BatchedDatalakeComputeCodecs for BatchedDatalakeCompute { mod tests { use std::str::FromStr; + use alloy::primitives::b256; + use crate::primitives::{ aggregate_fn::FunctionContext, task::datalake::{ @@ -140,8 +142,7 @@ mod tests { assert_eq!( datalake_compute.commit(), - B256::from_str("0x931644ee9576d1a377d4c5ba642a9f96361663f31d867d36169623f782a887fc") - .unwrap() + b256!("931644ee9576d1a377d4c5ba642a9f96361663f31d867d36169623f782a887fc") ) } @@ -170,8 +171,7 @@ mod tests { assert_eq!( datalake_compute.commit(), - B256::from_str("0xa15da24b3eb2bb5260f59a71c3934b64e2747d8e934563ad532e7f877a061bed") - .unwrap() + b256!("a15da24b3eb2bb5260f59a71c3934b64e2747d8e934563ad532e7f877a061bed") ) } } diff --git a/hdp/src/primitives/solidity_types/module.rs b/hdp/src/primitives/solidity_types/module.rs index 570b8ced..dc54a964 100644 --- a/hdp/src/primitives/solidity_types/module.rs +++ b/hdp/src/primitives/solidity_types/module.rs @@ -34,8 +34,8 @@ impl Module { #[cfg(test)] mod tests { + use alloy::primitives::b256; use starknet_crypto::FieldElement; - use std::str::FromStr; use crate::primitives::task::module::{ModuleInput, Visibility}; @@ -62,8 +62,7 @@ mod tests { let expected_commit = module.commit(); assert_eq!( expected_commit, - B256::from_str("0x879869b6d237b92bfdd3f3f7b76baaa9ebb2a3ad5e8478d12cca258d3def05af") - .unwrap() + b256!("879869b6d237b92bfdd3f3f7b76baaa9ebb2a3ad5e8478d12cca258d3def05af") ); } @@ -88,8 +87,7 @@ mod tests { let expected_commit = module.commit(); assert_eq!( expected_commit, - B256::from_str("0xd81ebd27b719967e1df4edf64c9e3ce87635089e3462306af340a393625d8726") - .unwrap() + b256!("d81ebd27b719967e1df4edf64c9e3ce87635089e3462306af340a393625d8726") ); } } diff --git a/hdp/src/primitives/task/datalake/block_sampled/collection.rs b/hdp/src/primitives/task/datalake/block_sampled/collection.rs index c342eb68..fe3da9e2 100644 --- a/hdp/src/primitives/task/datalake/block_sampled/collection.rs +++ b/hdp/src/primitives/task/datalake/block_sampled/collection.rs @@ -8,7 +8,7 @@ use crate::primitives::task::datalake::{DatalakeCollection, DatalakeField}; use super::rlp_fields::{AccountField, HeaderField}; -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] #[serde(try_from = "String")] pub enum BlockSampledCollection { Header(HeaderField), diff --git a/hdp/src/primitives/task/datalake/block_sampled/rlp_fields.rs b/hdp/src/primitives/task/datalake/block_sampled/rlp_fields.rs index 77d3ffeb..36936f86 100644 --- a/hdp/src/primitives/task/datalake/block_sampled/rlp_fields.rs +++ b/hdp/src/primitives/task/datalake/block_sampled/rlp_fields.rs @@ -13,7 +13,7 @@ use crate::{ primitives::task::datalake::DatalakeField, }; -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] #[serde(try_from = "String")] pub enum HeaderField { ParentHash, @@ -238,7 +238,7 @@ impl Display for HeaderField { // == Account Field == -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] #[serde(try_from = "String")] pub enum AccountField { Nonce, diff --git a/hdp/src/primitives/task/datalake/envelope.rs b/hdp/src/primitives/task/datalake/envelope.rs index e592162f..00dfe2de 100644 --- a/hdp/src/primitives/task/datalake/envelope.rs +++ b/hdp/src/primitives/task/datalake/envelope.rs @@ -18,10 +18,8 @@ pub enum DatalakeEnvelope { impl DatalakeEnvelope { pub fn get_collection_type(&self) -> Box { match self { - DatalakeEnvelope::BlockSampled(datalake) => Box::new(datalake.sampled_property.clone()), - DatalakeEnvelope::TransactionsInBlock(datalake) => { - Box::new(datalake.sampled_property.clone()) - } + DatalakeEnvelope::BlockSampled(datalake) => Box::new(datalake.sampled_property), + DatalakeEnvelope::TransactionsInBlock(datalake) => Box::new(datalake.sampled_property), } } diff --git a/hdp/src/primitives/task/datalake/transactions/collection.rs b/hdp/src/primitives/task/datalake/transactions/collection.rs index a31444bd..5e3310c8 100644 --- a/hdp/src/primitives/task/datalake/transactions/collection.rs +++ b/hdp/src/primitives/task/datalake/transactions/collection.rs @@ -37,7 +37,7 @@ impl FromStr for TransactionsCollectionType { } } -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] #[serde(try_from = "String")] pub enum TransactionsCollection { Transactions(TransactionField), diff --git a/hdp/src/primitives/task/datalake/transactions/datalake.rs b/hdp/src/primitives/task/datalake/transactions/datalake.rs index 84a0b6fd..b64074df 100644 --- a/hdp/src/primitives/task/datalake/transactions/datalake.rs +++ b/hdp/src/primitives/task/datalake/transactions/datalake.rs @@ -5,6 +5,7 @@ //! Example: `TransactionsInBlockDatalake { target_block: 100, sampled_property: "tx.to", increment: 1 }` //! represents all transactions in block 100 with a `tx.to` property sampled with an increment of 1. +use core::fmt::Display; use std::num::ParseIntError; use std::str::FromStr; @@ -157,6 +158,13 @@ impl IncludedTypes { } } +impl Display for IncludedTypes { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + let bytes = self.to_be_bytes(); + write!(f, "{},{},{},{}", bytes[0], bytes[1], bytes[2], bytes[3]) + } +} + impl From for U256 { fn from(value: IncludedTypes) -> U256 { let mut bytes = [0; 32]; @@ -232,4 +240,17 @@ mod tests { assert!(included_types.is_included(TxType::Eip1559)); assert!(!included_types.is_included(TxType::Eip4844)); } + + #[test] + fn test_included_types_from_str_to_str() { + let input_str = "1,0,1,0"; + let included_types = IncludedTypes::from_str(input_str).unwrap(); + assert!(included_types.is_included(TxType::Legacy)); + assert!(!included_types.is_included(TxType::Eip2930)); + assert!(included_types.is_included(TxType::Eip1559)); + assert!(!included_types.is_included(TxType::Eip4844)); + + let output_str = included_types.to_string(); + assert_eq!(input_str, output_str); + } } diff --git a/hdp/src/primitives/task/datalake/transactions/mod.rs b/hdp/src/primitives/task/datalake/transactions/mod.rs index 5589833e..9fb5a93e 100644 --- a/hdp/src/primitives/task/datalake/transactions/mod.rs +++ b/hdp/src/primitives/task/datalake/transactions/mod.rs @@ -9,15 +9,12 @@ pub use rlp_fields::*; #[cfg(test)] mod tests { - - use std::str::FromStr; - use crate::primitives::{ solidity_types::traits::DatalakeCodecs, task::datalake::DatalakeCollection, ChainId, }; use alloy::{ hex, - primitives::{B256, U256}, + primitives::{b256, U256}, }; use super::*; @@ -42,8 +39,7 @@ mod tests { assert_eq!( transaction_datalake.commit(), - B256::from_str("0x0a1ad7357827238fdbea5c8f34df65e7313c18388026fad78a75d4b5a6be71b7") - .unwrap() + b256!("0a1ad7357827238fdbea5c8f34df65e7313c18388026fad78a75d4b5a6be71b7") ); assert_eq!( @@ -79,8 +75,7 @@ mod tests { assert_eq!( transaction_datalake.commit(), - B256::from_str("0x991d3d38a26f54aed67f8391bab26c855dedd2fd810931542625b6ad4f7c1e42") - .unwrap() + b256!("991d3d38a26f54aed67f8391bab26c855dedd2fd810931542625b6ad4f7c1e42") ); assert_eq!( diff --git a/hdp/src/primitives/task/datalake/transactions/rlp_fields.rs b/hdp/src/primitives/task/datalake/transactions/rlp_fields.rs index a36c4b73..fe9dddee 100644 --- a/hdp/src/primitives/task/datalake/transactions/rlp_fields.rs +++ b/hdp/src/primitives/task/datalake/transactions/rlp_fields.rs @@ -7,7 +7,7 @@ use serde::{Deserialize, Serialize}; use crate::primitives::task::datalake::DatalakeField; -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] pub enum TransactionField { // ===== Transaction fields ===== Nonce, @@ -207,7 +207,7 @@ impl Display for TransactionField { } } -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] pub enum TransactionReceiptField { Success, CumulativeGasUsed, diff --git a/hdp/src/primitives/task/module.rs b/hdp/src/primitives/task/module.rs index e1b014a5..a3276b9d 100644 --- a/hdp/src/primitives/task/module.rs +++ b/hdp/src/primitives/task/module.rs @@ -31,7 +31,8 @@ impl ModuleInput { pub fn new(visibility: Visibility, value: &str) -> Self { Self { visibility, - value: FieldElement::from_hex_be(value).unwrap(), + value: FieldElement::from_hex_be(value) + .expect("invalid hex string value to convert FieldElement"), } } } @@ -62,6 +63,13 @@ impl FromStr for ModuleInput { } } +impl From for ModuleInput { + fn from(s: String) -> Self { + s.parse() + .unwrap_or_else(|_| ModuleInput::new(Visibility::Private, &s)) + } +} + impl Module { pub fn new( program_hash: FieldElement, From 0a6164e493c0e5ea6662fd6f5465843deb17b864 Mon Sep 17 00:00:00 2001 From: Pia Date: Sun, 15 Sep 2024 18:50:23 +0900 Subject: [PATCH 27/29] cargo doc --- cli/src/commands/run_datalake.rs | 2 +- hdp/src/lib.rs | 5 +++++ hdp/src/primitives/block/header.rs | 3 +-- .../datalake_compute/datalake/transactions_in_block.rs | 4 ++-- hdp/src/primitives/solidity_types/traits.rs | 4 ++-- hdp/src/primitives/task/datalake/datalake_type.rs | 4 ++-- hdp/src/provider/error.rs | 6 +++--- hdp/src/provider/indexer.rs | 2 +- hdp/src/provider/starknet/types.rs | 2 +- justfile | 8 ++++++-- 10 files changed, 24 insertions(+), 16 deletions(-) diff --git a/cli/src/commands/run_datalake.rs b/cli/src/commands/run_datalake.rs index 8feedeca..50e68505 100644 --- a/cli/src/commands/run_datalake.rs +++ b/cli/src/commands/run_datalake.rs @@ -17,7 +17,7 @@ pub struct RunDatalakeArgs { pub aggregate_fn_id: AggregationFunction, /// Optional context for applying conditions on the aggregate function "count". /// Format: "{operator}.{value}" (e.g., "eq.100" for equality, "gt.100" for greater-than). - /// Supported operators are in the [`Operator`] enum. + /// Supported operators are in the Operator enum. pub aggregate_fn_ctx: Option, #[command(subcommand)] diff --git a/hdp/src/lib.rs b/hdp/src/lib.rs index 0c64bec9..ac51f953 100644 --- a/hdp/src/lib.rs +++ b/hdp/src/lib.rs @@ -1,3 +1,8 @@ +//! The Data Processor CLI serves as an essential tool for developers working with Cairo programs and zkVM environments. +//! Its primary function is to translate human-readable requests into a format compatible with Cairo programs, +//! enabling commands to be executed over the Cairo VM and generating executable outputs. +//! This transformation is a crucial preprocessing step that prepares data for off-chain computations in zkVM environments. + pub mod cairo_runner; pub mod constant; pub mod hdp_run; diff --git a/hdp/src/primitives/block/header.rs b/hdp/src/primitives/block/header.rs index 02555db6..72b875b6 100644 --- a/hdp/src/primitives/block/header.rs +++ b/hdp/src/primitives/block/header.rs @@ -131,7 +131,6 @@ impl Header { } /// Heavy function that will calculate hash of data and will *not* save the change to metadata. - /// Use [`Header::seal`], [`SealedHeader`] and unlock if you need hash to be persistent. pub fn hash_slow(&self) -> B256 { keccak256(alloy_rlp::encode(self)) } @@ -343,7 +342,7 @@ impl Header { } /// Block header returned from RPC -/// https://ethereum.org/en/developers/docs/apis/json-rpc#eth_getblockbynumber +/// #[derive(Serialize, Deserialize, Debug, Clone)] #[serde(rename_all = "camelCase")] pub struct BlockHeaderFromRpc { diff --git a/hdp/src/primitives/solidity_types/datalake_compute/datalake/transactions_in_block.rs b/hdp/src/primitives/solidity_types/datalake_compute/datalake/transactions_in_block.rs index a9eb0482..408ad867 100644 --- a/hdp/src/primitives/solidity_types/datalake_compute/datalake/transactions_in_block.rs +++ b/hdp/src/primitives/solidity_types/datalake_compute/datalake/transactions_in_block.rs @@ -49,13 +49,13 @@ impl DatalakeCodecs for TransactionsInBlockDatalake { } } - /// Get the commitment hash of the [`TransactionsDatalake`] + /// Get the commitment hash of the [`TransactionsInBlockDatalake`] fn commit(&self) -> B256 { let encoded_datalake = self.encode().expect("Encoding failed"); keccak256(encoded_datalake) } - /// Decode the encoded transactions datalake hex string into a [`TransactionsDatalake`] + /// Decode the encoded transactions datalake hex string into a [`TransactionsInBlockDatalake`] fn decode(encoded: &[u8]) -> Result { let abi_type: DynSolType = "(uint256,uint256, uint256, uint256, uint256, uint256, uint256, bytes)".parse()?; diff --git a/hdp/src/primitives/solidity_types/traits.rs b/hdp/src/primitives/solidity_types/traits.rs index 7aa92f93..176cece3 100644 --- a/hdp/src/primitives/solidity_types/traits.rs +++ b/hdp/src/primitives/solidity_types/traits.rs @@ -22,7 +22,7 @@ pub trait Codecs { Self: Sized; } -/// Codecs for [`DatalakeCompute`] +/// Codecs for datalake task pub trait DatalakeComputeCodecs { fn decode(encoded_datalake: &[u8], encoded_compute: &[u8]) -> Result where @@ -31,7 +31,7 @@ pub trait DatalakeComputeCodecs { fn commit(&self) -> B256; } -/// Codecs for [`BatchedDatalakeCompute`] +/// Codecs for vector of datalake task pub trait BatchedDatalakeComputeCodecs { fn decode(encoded_datalake: &[u8], encoded_compute: &[u8]) -> Result where diff --git a/hdp/src/primitives/task/datalake/datalake_type.rs b/hdp/src/primitives/task/datalake/datalake_type.rs index aa16dfd4..1cd1177e 100644 --- a/hdp/src/primitives/task/datalake/datalake_type.rs +++ b/hdp/src/primitives/task/datalake/datalake_type.rs @@ -2,10 +2,10 @@ use anyhow::{bail, Result}; use serde::{Deserialize, Serialize}; use std::str::FromStr; -/// Identifier for a [`BlockSampledDatalake`] type. +/// Identifier for a BlockSampledDatalake pub const BLOCK_SAMPLED_DATALAKE_TYPE_ID: u8 = 0; -/// Identifier for an [`TransactionsDatalake`] type. +/// Identifier for a TransactionsDatalake pub const TRANSACTIONS_IN_BLOCK_DATALAKE_TYPE_ID: u8 = 1; #[derive(Debug, Clone, Copy, Deserialize, Serialize, PartialEq)] diff --git a/hdp/src/provider/error.rs b/hdp/src/provider/error.rs index 23678940..d35f84d6 100644 --- a/hdp/src/provider/error.rs +++ b/hdp/src/provider/error.rs @@ -18,11 +18,11 @@ pub enum ProviderError { #[error("MMR not found")] MmrNotFound, - /// Error from the [`Indexer`] + /// Error from the [`IndexerError`] #[error("Failed from indexer")] IndexerError(#[from] IndexerError), - /// Error from [`RpcProvider`] + /// Error from [`RpcProviderError`] #[error("Failed to get proofs: {0}")] EvmRpcProviderError(#[from] RpcProviderError), @@ -34,7 +34,7 @@ pub enum ProviderError { FetchKeyError(String), } -/// Error from [`RpcProvider`] +/// Error from rpc #[derive(Error, Debug)] pub enum RpcProviderError { #[error("Failed to send proofs with mpsc")] diff --git a/hdp/src/provider/indexer.rs b/hdp/src/provider/indexer.rs index 42684725..09519a68 100644 --- a/hdp/src/provider/indexer.rs +++ b/hdp/src/provider/indexer.rs @@ -53,7 +53,7 @@ impl ChainId { /// Indexer client for fetching MMR and headers proof from Herodotus Indexer /// -/// For more information, see: https://rs-indexer.api.herodotus.cloud/swagger +/// For more information, see: /// /// How to use: /// ```rust diff --git a/hdp/src/provider/starknet/types.rs b/hdp/src/provider/starknet/types.rs index 33180733..a827823b 100644 --- a/hdp/src/provider/starknet/types.rs +++ b/hdp/src/provider/starknet/types.rs @@ -2,7 +2,7 @@ use serde::{Deserialize, Serialize}; use serde_with::skip_serializing_none; use starknet_types_core::{felt::Felt, hash::StarkHash}; -/// Codebase is from https://github.com/eqlabs/pathfinder/tree/ae81d84b7c4157891069bd02ef810a29b60a94e3 +/// Codebase is from /// Holds the membership/non-membership of a contract and its associated /// contract contract if the contract exists. diff --git a/justfile b/justfile index b698c87f..c1730a61 100644 --- a/justfile +++ b/justfile @@ -13,10 +13,14 @@ clean: clippy: cargo clippy --all-targets --all-features -- -Dwarnings +# Generate documentation for the project +docs: + cargo doc --no-deps + # Execute all unit tests in the workspace test: cargo llvm-cov nextest --features test_utils -# Run the entire CI pipeline including format, clippy, and test checks -run-ci-flow: format clippy test +# Run the entire CI pipeline including format, clippy, docs, and test checks +run-ci-flow: format clippy docs test @echo "CI flow completed" From 23f9c3e5c25af5ca36876446845e92d8550d09c1 Mon Sep 17 00:00:00 2001 From: Pia Date: Mon, 16 Sep 2024 18:04:12 +0900 Subject: [PATCH 28/29] chore: `Felt` --- Cargo.lock | 1375 +++++++++-------- Cargo.toml | 10 +- hdp/Cargo.toml | 1 + hdp/src/cairo_runner/dry_run.rs | 7 +- hdp/src/preprocessor/module_registry.rs | 27 +- .../processed_types/cairo_format/account.rs | 4 +- .../cairo_format/datalake_compute.rs | 6 +- .../cairo_format/felt_vec_unit.rs | 26 +- .../processed_types/cairo_format/header.rs | 4 +- .../processed_types/cairo_format/module.rs | 6 +- .../processed_types/cairo_format/mpt.rs | 7 +- .../processed_types/cairo_format/receipt.rs | 7 +- .../processed_types/cairo_format/storage.rs | 6 +- .../cairo_format/transaction.rs | 7 +- hdp/src/primitives/processed_types/uint256.rs | 45 +- hdp/src/primitives/solidity_types/module.rs | 6 +- hdp/src/primitives/task/module.rs | 19 +- hdp/src/primitives/utils.rs | 14 +- 18 files changed, 784 insertions(+), 793 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 09c984d0..6b7cc530 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,18 +4,18 @@ version = 3 [[package]] name = "addr2line" -version = "0.21.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +checksum = "f5fb1d8e4442bd405fdfd1dacb42792696b0cf9cb15882e5d097b742a676d375" dependencies = [ "gimli", ] [[package]] -name = "adler" -version = "1.0.2" +name = "adler2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" [[package]] name = "aes" @@ -57,9 +57,9 @@ checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] name = "alloy" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9134b68e24175eff6c3c4d2bffeefb0a1b7435462130862c88d1524ca376e7e5" +checksum = "0ba1c79677c9ce51c8d45e20845b05e6fb070ea2c863fba03ad6af2c778474bd" dependencies = [ "alloy-consensus", "alloy-contract", @@ -78,14 +78,13 @@ dependencies = [ "alloy-transport-http", "alloy-transport-ipc", "alloy-transport-ws", - "reqwest 0.12.5", ] [[package]] name = "alloy-chains" -version = "0.1.22" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04e9a1892803b02f53e25bea3e414ddd0501f12d97456c9d5ade4edf88f9516f" +checksum = "b68b94c159bcc2ca5f758b8663d7b00fc7c5e40569984595ddf2221b0f7f7f6e" dependencies = [ "num_enum", "strum", @@ -93,9 +92,9 @@ dependencies = [ [[package]] name = "alloy-consensus" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a016bfa21193744d4c38b3f3ab845462284d129e5e23c7cc0fafca7e92d9db37" +checksum = "da374e868f54c7f4ad2ad56829827badca388efd645f8cf5fccc61c2b5343504" dependencies = [ "alloy-eips", "alloy-primitives", @@ -107,9 +106,9 @@ dependencies = [ [[package]] name = "alloy-contract" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e47b2a620fd588d463ccf0f5931b41357664b293a8d31592768845a2a101bb9e" +checksum = "7dc6957ff706f9e5f6fd42f52a93e4bce476b726c92d077b348de28c4a76730c" dependencies = [ "alloy-dyn-abi", "alloy-json-abi", @@ -127,9 +126,9 @@ dependencies = [ [[package]] name = "alloy-core" -version = "0.7.6" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5af3faff14c12c8b11037e0a093dd157c3702becb8435577a2408534d0758315" +checksum = "529fc6310dc1126c8de51c376cbc59c79c7f662bd742be7dc67055d5421a81b4" dependencies = [ "alloy-dyn-abi", "alloy-json-abi", @@ -139,9 +138,9 @@ dependencies = [ [[package]] name = "alloy-dyn-abi" -version = "0.7.6" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb6e6436a9530f25010d13653e206fab4c9feddacf21a54de8d7311b275bc56b" +checksum = "413902aa18a97569e60f679c23f46a18db1656d87ab4d4e49d0e1e52042f66df" dependencies = [ "alloy-json-abi", "alloy-primitives", @@ -151,14 +150,14 @@ dependencies = [ "itoa", "serde", "serde_json", - "winnow 0.6.7", + "winnow", ] [[package]] name = "alloy-eips" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32d6d8118b83b0489cfb7e6435106948add2b35217f4a5004ef895f613f60299" +checksum = "f76ecab54890cdea1e4808fc0891c7e6cfcf71fe1a9fe26810c7280ef768f4ed" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -172,9 +171,9 @@ dependencies = [ [[package]] name = "alloy-genesis" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "894f33a7822abb018db56b10ab90398e63273ce1b5a33282afd186c132d764a6" +checksum = "bca15afde1b6d15e3fc1c97421262b1bbb37aee45752e3c8b6d6f13f776554ff" dependencies = [ "alloy-primitives", "alloy-serde", @@ -183,9 +182,9 @@ dependencies = [ [[package]] name = "alloy-json-abi" -version = "0.7.6" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaeaccd50238126e3a0ff9387c7c568837726ad4f4e399b528ca88104d6c25ef" +checksum = "bc05b04ac331a9f07e3a4036ef7926e49a8bf84a99a1ccfc7e2ab55a5fcbb372" dependencies = [ "alloy-primitives", "alloy-sol-type-parser", @@ -195,9 +194,9 @@ dependencies = [ [[package]] name = "alloy-json-rpc" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61f0ae6e93b885cc70fe8dae449e7fd629751dbee8f59767eaaa7285333c5727" +checksum = "6d6f34930b7e3e2744bcc79056c217f00cb2abb33bc5d4ff88da7623c5bb078b" dependencies = [ "alloy-primitives", "serde", @@ -219,9 +218,9 @@ dependencies = [ [[package]] name = "alloy-network" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc122cbee2b8523854cc11d87bcd5773741602c553d2d2d106d82eeb9c16924a" +checksum = "25f6895fc31b48fa12306ef9b4f78b7764f8bd6d7d91cdb0a40e233704a0f23f" dependencies = [ "alloy-consensus", "alloy-eips", @@ -239,9 +238,9 @@ dependencies = [ [[package]] name = "alloy-primitives" -version = "0.7.6" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f783611babedbbe90db3478c120fb5f5daacceffc210b39adc0af4fe0da70bad" +checksum = "ccb3ead547f4532bc8af961649942f0b9c16ee9226e26caa3f38420651cc0bf4" dependencies = [ "alloy-rlp", "bytes", @@ -261,9 +260,9 @@ dependencies = [ [[package]] name = "alloy-provider" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d5af289798fe8783acd0c5f10644d9d26f54a12bc52a083e4f3b31718e9bf92" +checksum = "9c538bfa893d07e27cb4f3c1ab5f451592b7c526d511d62b576a2ce59e146e4a" dependencies = [ "alloy-chains", "alloy-consensus", @@ -286,7 +285,7 @@ dependencies = [ "futures-utils-wasm", "lru", "pin-project", - "reqwest 0.12.5", + "reqwest 0.12.7", "serde", "serde_json", "tokio", @@ -296,9 +295,9 @@ dependencies = [ [[package]] name = "alloy-pubsub" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "702f330b7da123a71465ab9d39616292f8344a2811c28f2cc8d8438a69d79e35" +checksum = "0a7341322d9bc0e49f6e9fd9f2eb8e30f73806f2dd12cbb3d6bab2694c921f87" dependencies = [ "alloy-json-rpc", "alloy-primitives", @@ -315,9 +314,9 @@ dependencies = [ [[package]] name = "alloy-rlp" -version = "0.3.5" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b155716bab55763c95ba212806cf43d05bcc70e5f35b02bad20cf5ec7fe11fed" +checksum = "26154390b1d205a4a7ac7352aa2eb4f81f391399d4e2f546fb81a2f8bb383f62" dependencies = [ "alloy-rlp-derive", "arrayvec", @@ -326,20 +325,20 @@ dependencies = [ [[package]] name = "alloy-rlp-derive" -version = "0.3.5" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8037e03c7f462a063f28daec9fda285a9a89da003c552f8637a80b9c8fd96241" +checksum = "4d0f2d905ebd295e7effec65e5f6868d153936130ae718352771de3e7d03c75c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.77", ] [[package]] name = "alloy-rpc-client" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b40fcb53b2a9d0a78a4968b2eca8805a4b7011b9ee3fdfa2acaf137c5128f36b" +checksum = "5ba31bae67773fd5a60020bea900231f8396202b7feca4d0c70c6b59308ab4a8" dependencies = [ "alloy-json-rpc", "alloy-primitives", @@ -350,7 +349,7 @@ dependencies = [ "alloy-transport-ws", "futures", "pin-project", - "reqwest 0.12.5", + "reqwest 0.12.7", "serde", "serde_json", "tokio", @@ -362,9 +361,9 @@ dependencies = [ [[package]] name = "alloy-rpc-types" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50f2fbe956a3e0f0975c798f488dc6be96b669544df3737e18f4a325b42f4c86" +checksum = "184a7a42c7ba9141cc9e76368356168c282c3bc3d9e5d78f3556bdfe39343447" dependencies = [ "alloy-rpc-types-engine", "alloy-rpc-types-eth", @@ -373,9 +372,9 @@ dependencies = [ [[package]] name = "alloy-rpc-types-engine" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd473d98ec552f8229cd6d566bd2b0bbfc5bb4efcefbb5288c834aa8fd832020" +checksum = "6e765962e3b82fd6f276a0873b5bd897e5d75a25f78fa9a6a21bd350d8e98a4e" dependencies = [ "alloy-consensus", "alloy-eips", @@ -391,9 +390,9 @@ dependencies = [ [[package]] name = "alloy-rpc-types-eth" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "083f443a83b9313373817236a8f4bea09cca862618e9177d822aee579640a5d6" +checksum = "ab4123ee21f99ba4bd31bfa36ba89112a18a500f8b452f02b35708b1b951e2b9" dependencies = [ "alloy-consensus", "alloy-eips", @@ -409,9 +408,9 @@ dependencies = [ [[package]] name = "alloy-serde" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d94da1c0c4e27cc344b05626fe22a89dc6b8b531b9475f3b7691dbf6913e4109" +checksum = "9416c52959e66ead795a11f4a86c248410e9e368a0765710e57055b8a1774dd6" dependencies = [ "alloy-primitives", "serde", @@ -420,9 +419,9 @@ dependencies = [ [[package]] name = "alloy-signer" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58d876be3afd8b78979540084ff63995292a26aa527ad0d44276405780aa0ffd" +checksum = "b33753c09fa1ad85e5b092b8dc2372f1e337a42e84b9b4cff9fede75ba4adb32" dependencies = [ "alloy-primitives", "async-trait", @@ -434,9 +433,9 @@ dependencies = [ [[package]] name = "alloy-signer-local" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d40a37dc216c269b8a7244047cb1c18a9c69f7a0332ab2c4c2aa4cbb1a31468b" +checksum = "6dfc9c26fe6c6f1bad818c9a976de9044dd12e1f75f1f156a801ee3e8148c1b6" dependencies = [ "alloy-consensus", "alloy-network", @@ -450,42 +449,42 @@ dependencies = [ [[package]] name = "alloy-sol-macro" -version = "0.7.6" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bad41a7c19498e3f6079f7744656328699f8ea3e783bdd10d85788cd439f572" +checksum = "2b40397ddcdcc266f59f959770f601ce1280e699a91fc1862f29cef91707cd09" dependencies = [ "alloy-sol-macro-expander", "alloy-sol-macro-input", "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.77", ] [[package]] name = "alloy-sol-macro-expander" -version = "0.7.6" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd9899da7d011b4fe4c406a524ed3e3f963797dbc93b45479d60341d3a27b252" +checksum = "867a5469d61480fea08c7333ffeca52d5b621f5ca2e44f271b117ec1fc9a0525" dependencies = [ "alloy-json-abi", "alloy-sol-macro-input", "const-hex", "heck 0.5.0", - "indexmap 2.2.6", + "indexmap 2.5.0", "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.77", "syn-solidity", "tiny-keccak", ] [[package]] name = "alloy-sol-macro-input" -version = "0.7.6" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d32d595768fdc61331a132b6f65db41afae41b9b97d36c21eb1b955c422a7e60" +checksum = "2e482dc33a32b6fadbc0f599adea520bd3aaa585c141a80b404d0a3e3fa72528" dependencies = [ "alloy-json-abi", "const-hex", @@ -494,24 +493,25 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.60", + "syn 2.0.77", "syn-solidity", ] [[package]] name = "alloy-sol-type-parser" -version = "0.7.6" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baa2fbd22d353d8685bd9fee11ba2d8b5c3b1d11e56adb3265fcf1f32bfdf404" +checksum = "cbcba3ca07cf7975f15d871b721fb18031eec8bce51103907f6dcce00b255d98" dependencies = [ - "winnow 0.6.7", + "serde", + "winnow", ] [[package]] name = "alloy-sol-types" -version = "0.7.6" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a49042c6d3b66a9fe6b2b5a8bf0d39fc2ae1ee0310a2a26ffedd79fb097878dd" +checksum = "a91ca40fa20793ae9c3841b83e74569d1cc9af29a2f5237314fd3452d51e38c7" dependencies = [ "alloy-json-abi", "alloy-primitives", @@ -522,12 +522,12 @@ dependencies = [ [[package]] name = "alloy-transport" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "245af9541f0a0dbd5258669c80dfe3af118164cacec978a520041fc130550deb" +checksum = "01b51a291f949f755e6165c3ed562883175c97423703703355f4faa4b7d0a57c" dependencies = [ "alloy-json-rpc", - "base64 0.22.0", + "base64 0.22.1", "futures-util", "futures-utils-wasm", "serde", @@ -535,18 +535,19 @@ dependencies = [ "thiserror", "tokio", "tower", + "tracing", "url", ] [[package]] name = "alloy-transport-http" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5619c017e1fdaa1db87f9182f4f0ed97c53d674957f4902fba655e972d359c6c" +checksum = "86d65871f9f1cafe1ed25cde2f1303be83e6473e995a2d56c275ae4fcce6119c" dependencies = [ "alloy-json-rpc", "alloy-transport", - "reqwest 0.12.5", + "reqwest 0.12.7", "serde_json", "tower", "tracing", @@ -555,9 +556,9 @@ dependencies = [ [[package]] name = "alloy-transport-ipc" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "173cefa110afac7a53cf2e75519327761f2344d305eea2993f3af1b2c1fc1c44" +checksum = "cd7fbc8b6282ce41b01cbddef7bffb133fe6e1bf65dcd39770d45a905c051179" dependencies = [ "alloy-json-rpc", "alloy-pubsub", @@ -574,15 +575,15 @@ dependencies = [ [[package]] name = "alloy-transport-ws" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c0aff8af5be5e58856c5cdd1e46db2c67c7ecd3a652d9100b4822c96c899947" +checksum = "aec83fd052684556c78c54df111433493267234d82321c2236560c752f595f20" dependencies = [ "alloy-pubsub", "alloy-transport", "futures", "http 1.1.0", - "rustls 0.23.10", + "rustls 0.23.13", "serde_json", "tokio", "tokio-tungstenite", @@ -613,47 +614,48 @@ checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" [[package]] name = "anstream" -version = "0.6.13" +version = "0.6.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb" +checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", + "is_terminal_polyfill", "utf8parse", ] [[package]] name = "anstyle" -version = "1.0.6" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" +checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" [[package]] name = "anstyle-parse" -version = "0.2.3" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" +checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.2" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" +checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" dependencies = [ "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.2" +version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" +checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" dependencies = [ "anstyle", "windows-sys 0.52.0", @@ -661,9 +663,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.86" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" +checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6" [[package]] name = "ark-ff" @@ -699,7 +701,7 @@ dependencies = [ "num-bigint", "num-traits 0.2.19", "paste", - "rustc_version 0.4.0", + "rustc_version 0.4.1", "zeroize", ] @@ -791,9 +793,9 @@ dependencies = [ [[package]] name = "arrayvec" -version = "0.7.4" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "ascii-canvas" @@ -829,18 +831,18 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.77", ] [[package]] name = "async-trait" -version = "0.1.80" +version = "0.1.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" +checksum = "a27b8a3a6e1a44fa4c8baf1f653e4172e81486d4941f2237e20dc2d0cf4ddff1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.77", ] [[package]] @@ -851,7 +853,7 @@ checksum = "b6d7b9decdf35d8908a7e3ef02f64c5e9b1695e230154c0e8de3969142d9b94c" dependencies = [ "futures", "pharos", - "rustc_version 0.4.0", + "rustc_version 0.4.1", ] [[package]] @@ -873,28 +875,28 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.77", ] [[package]] name = "autocfg" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "backtrace" -version = "0.3.71" +version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ "addr2line", - "cc", "cfg-if", "libc", "miniz_oxide", "object", "rustc-demangle", + "windows-targets 0.52.6", ] [[package]] @@ -917,9 +919,9 @@ checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "base64" -version = "0.22.0" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9475866fec1451be56a3c2400fd081ff546538961565ccb5b7142cbd22bc7a51" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "base64ct" @@ -927,18 +929,6 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" -[[package]] -name = "bigdecimal" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6773ddc0eafc0e509fb60e48dff7f450f8e674a0686ae8605e8d9901bd5eefa" -dependencies = [ - "num-bigint", - "num-integer", - "num-traits 0.2.19", - "serde", -] - [[package]] name = "bimap" version = "0.6.3" @@ -968,9 +958,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "bitvec" @@ -995,9 +985,9 @@ dependencies = [ [[package]] name = "blst" -version = "0.3.12" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62dc83a094a71d43eeadd254b1ec2d24cb6a0bb6cadce00df51f0db594711a32" +checksum = "4378725facc195f1a538864863f6de233b500a8862747e7f165078a419d5e874" dependencies = [ "cc", "glob", @@ -1025,32 +1015,33 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.6.0" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" +checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" dependencies = [ "serde", ] [[package]] name = "c-kzg" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdf100c4cea8f207e883ff91ca886d621d8a166cb04971dfaa9bb8fd99ed95df" +checksum = "f0307f72feab3300336fb803a57134159f6e20139af1357f36c54cb90d8e8928" dependencies = [ "blst", "cc", "glob", "hex", "libc", + "once_cell", "serde", ] [[package]] name = "cairo-lang-casm" -version = "2.7.0" +version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a43421bf72645b3a562d264747166d6f093e960a69dfa38b67bb3209e370366" +checksum = "60a4b4ca8473c25d1e760c83c2a49d953197556f82f6feb636004d3b6d6cc4a7" dependencies = [ "cairo-lang-utils", "indoc", @@ -1062,9 +1053,9 @@ dependencies = [ [[package]] name = "cairo-lang-eq-solver" -version = "2.7.0" +version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaa8ac24c97770739f5a78d630b8515273c8b9f4aff34e1f88b988fac50340de" +checksum = "a0cd844e568f51e39729e8ac18bd27ada2e2b6dc9138f8c81adad48456480681" dependencies = [ "cairo-lang-utils", "good_lp", @@ -1072,9 +1063,9 @@ dependencies = [ [[package]] name = "cairo-lang-sierra" -version = "2.7.0" +version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "918fb0611203fb8cdd1fcdb434f395a59e0ebb0db64b11a0e15bfbfb03552821" +checksum = "891488c1a3184ce91679f5bdb63015a1d24769a48bd07e5d51a1779d0031dfbe" dependencies = [ "anyhow", "cairo-lang-utils", @@ -1087,22 +1078,21 @@ dependencies = [ "num-bigint", "num-integer", "num-traits 0.2.19", - "once_cell", "regex", - "salsa", + "rust-analyzer-salsa", "serde", "serde_json", "sha3", "smol_str", - "starknet-types-core", + "starknet-types-core 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "thiserror", ] [[package]] name = "cairo-lang-sierra-ap-change" -version = "2.7.0" +version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fa1834ec729e89fcbd00df03f2a64a18515fcf07eb18dfef39afe020a10955d" +checksum = "ea7752cd48c86b2cde8603b753a6df4da086dacd16a73d288854d5f040b51171" dependencies = [ "cairo-lang-eq-solver", "cairo-lang-sierra", @@ -1116,9 +1106,9 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-gas" -version = "2.7.0" +version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b00927d39f910dd5ae1047cef9b46b2ee11617d33d290f875bc00dfc7e3d992" +checksum = "340892a09c9421414b2ac45b03c705f16e2bd737e4559dfd98ee1d20718dec9e" dependencies = [ "cairo-lang-eq-solver", "cairo-lang-sierra", @@ -1132,9 +1122,9 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-to-casm" -version = "2.7.0" +version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67bd155770abf91d4290a31b0c0a1fb393ecee85eb0af40c16893b4601eff4d6" +checksum = "1c22ff7e8113a46a907f82f191096c96935cc48247e3079971ddf536ccc2f4f8" dependencies = [ "assert_matches", "cairo-lang-casm", @@ -1147,15 +1137,15 @@ dependencies = [ "itertools 0.12.1", "num-bigint", "num-traits 0.2.19", - "starknet-types-core", + "starknet-types-core 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "thiserror", ] [[package]] name = "cairo-lang-sierra-type-size" -version = "2.7.0" +version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbae9458999da692c272501678b6cfec358a6bcadb54921bf35d21afdcd91251" +checksum = "5bf41941776e7410a8853a8e2a116292fc24d219df1989a92ffe5ab0e98037eb" dependencies = [ "cairo-lang-sierra", "cairo-lang-utils", @@ -1163,9 +1153,9 @@ dependencies = [ [[package]] name = "cairo-lang-starknet-classes" -version = "2.7.0" +version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa17b313f46fcf7ff4de32b86c250eaf584d1e2c8e37ed16db155b221721e735" +checksum = "482b8f9d7f8cc7140f1260ee71f3308a66d15bd228a06281067ca3f8f4410db2" dependencies = [ "cairo-lang-casm", "cairo-lang-sierra", @@ -1176,23 +1166,22 @@ dependencies = [ "num-bigint", "num-integer", "num-traits 0.2.19", - "once_cell", "serde", "serde_json", "sha3", "smol_str", - "starknet-types-core", + "starknet-types-core 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "thiserror", ] [[package]] name = "cairo-lang-utils" -version = "2.7.0" +version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bd5c8c127b9362a12ffb9dede38e792c81b4ded5a98b448baec157b745f47d1" +checksum = "73104609a7d865e4cd1de9cbf4e750683d076b6d0233bf81be511df274a26916" dependencies = [ "hashbrown 0.14.5", - "indexmap 2.2.6", + "indexmap 2.5.0", "itertools 0.12.1", "num-bigint", "num-traits 0.2.19", @@ -1208,9 +1197,12 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.0.95" +version = "1.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d32a725bc159af97c3e629873bb9f88fb8cf8a4867175f76dc987815ea07c83b" +checksum = "2d74707dde2ba56f86ae90effb3b43ddd369504387e718014de010cec7959800" +dependencies = [ + "shlex", +] [[package]] name = "cfg-if" @@ -1228,7 +1220,7 @@ dependencies = [ "iana-time-zone", "num-traits 0.2.19", "serde", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -1282,9 +1274,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.4" +version = "4.5.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0" +checksum = "3e5a21b8495e732f1b3c364c9949b201ca7bae518c502c80256c96ad79eaf6ac" dependencies = [ "clap_builder", "clap_derive", @@ -1292,26 +1284,26 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.2" +version = "4.5.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" +checksum = "8cf2dd12af7a047ad9d6da2b6b249759a22a7abc0f474c1dae1777afa4b21a73" dependencies = [ "anstream", "anstyle", - "clap_lex 0.7.0", - "strsim 0.11.1", + "clap_lex 0.7.2", + "strsim", ] [[package]] name = "clap_derive" -version = "4.5.4" +version = "4.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "528131438037fd55894f62d6e9f068b8f45ac57ffa77517819645d10aed04f64" +checksum = "501d359d5f3dcaf6ecdeee48833ae73ec6e42723a1e52419c79abf9507eec0a0" dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.77", ] [[package]] @@ -1325,15 +1317,15 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.7.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" +checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" [[package]] name = "colorchoice" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" +checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" [[package]] name = "const-fnv1a-hash" @@ -1343,9 +1335,9 @@ checksum = "32b13ea120a812beba79e34316b3942a857c86ec1593cb34f27bb28272ce2cca" [[package]] name = "const-hex" -version = "1.11.3" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ba00838774b4ab0233e355d26710fbfc8327a05c017f6dc4873f876d1f79f78" +checksum = "94fb8a24a26d37e1ffd45343323dc9fe6654ceea44c12f2fcb3d7ac29e610bc6" dependencies = [ "cfg-if", "cpufeatures", @@ -1387,15 +1379,15 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpufeatures" -version = "0.2.12" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" dependencies = [ "libc", ] @@ -1480,8 +1472,8 @@ dependencies = [ "bitflags 1.3.2", "crossterm_winapi", "libc", - "mio", - "parking_lot 0.12.2", + "mio 0.8.11", + "parking_lot", "signal-hook", "signal-hook-mio", "winapi", @@ -1535,9 +1527,9 @@ dependencies = [ [[package]] name = "darling" -version = "0.20.8" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54e36fcd13ed84ffdfda6f5be89b31287cbb80c439841fe69e04841435464391" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" dependencies = [ "darling_core", "darling_macro", @@ -1545,27 +1537,27 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.8" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c2cf1c23a687a1feeb728783b993c4e1ad83d99f351801977dd809b48d0a70f" +checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", - "strsim 0.10.0", - "syn 2.0.60", + "strsim", + "syn 2.0.77", ] [[package]] name = "darling_macro" -version = "0.20.8" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 2.0.60", + "syn 2.0.77", ] [[package]] @@ -1578,7 +1570,7 @@ dependencies = [ "hashbrown 0.14.5", "lock_api", "once_cell", - "parking_lot_core 0.9.10", + "parking_lot_core", ] [[package]] @@ -1620,15 +1612,15 @@ dependencies = [ [[package]] name = "derive_more" -version = "0.99.17" +version = "0.99.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" dependencies = [ "convert_case 0.4.0", "proc-macro2", "quote", - "rustc_version 0.4.0", - "syn 1.0.109", + "rustc_version 0.4.1", + "syn 2.0.77", ] [[package]] @@ -1687,9 +1679,9 @@ checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f" [[package]] name = "dunce" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" [[package]] name = "dyn-clone" @@ -1713,9 +1705,9 @@ dependencies = [ [[package]] name = "either" -version = "1.11.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "elliptic-curve" @@ -1762,9 +1754,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ "libc", "windows-sys 0.52.0", @@ -1795,19 +1787,14 @@ dependencies = [ [[package]] name = "eth-trie-proofs" version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffad0513a634350b4859934c3367cd171b4ed57c6b5c64d443e30bf278f1f8d0" +source = "git+https://github.com/HerodotusDev/trie-proofs.git#1412def6df010e3c9bca7bc1bae8798740398e5a" dependencies = [ "alloy", "alloy-primitives", "alloy-rlp", - "clap 4.5.4", "eth_trie", "ethereum-types", "reqwest 0.11.27", - "serde", - "serde_json", - "serde_with 3.8.1", "thiserror", "tokio", "url", @@ -1823,7 +1810,7 @@ dependencies = [ "hashbrown 0.14.5", "keccak-hash", "log", - "parking_lot 0.12.2", + "parking_lot", "rlp", ] @@ -1856,9 +1843,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" +checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" [[package]] name = "fastrlp" @@ -1901,9 +1888,9 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.0.30" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" +checksum = "324a1be68054ef05ad64b861cc9eaf1d623d2d8cb25b4bf2cb9cdd902b4bf253" dependencies = [ "crc32fast", "miniz_oxide", @@ -2001,7 +1988,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.77", ] [[package]] @@ -2071,9 +2058,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94b22e06ecb0110981051723910cbf0b5f5e09a2062dd7663334ee79a9d1286c" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "js-sys", @@ -2084,9 +2071,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.1" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +checksum = "32085ea23f3234fc7846555e85283ba4de91e21016dc0455a16286d87a292d64" [[package]] name = "glob" @@ -2127,7 +2114,7 @@ dependencies = [ "futures-sink", "futures-util", "http 0.2.12", - "indexmap 2.2.6", + "indexmap 2.5.0", "slab", "tokio", "tokio-util", @@ -2179,10 +2166,11 @@ dependencies = [ "reqwest 0.11.27", "serde", "serde_json", - "serde_with 2.3.3", + "serde_with", + "sn-trie-proofs", "starknet", "starknet-crypto", - "starknet-types-core", + "starknet-types-core 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "tempfile", "thiserror", "tokio", @@ -2195,7 +2183,7 @@ version = "0.4.0" dependencies = [ "alloy", "anyhow", - "clap 4.5.4", + "clap 4.5.17", "dotenv", "hdp", "inquire", @@ -2209,12 +2197,9 @@ dependencies = [ [[package]] name = "heck" -version = "0.3.3" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" -dependencies = [ - "unicode-segmentation", -] +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "heck" @@ -2296,9 +2281,9 @@ dependencies = [ [[package]] name = "http-body" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" dependencies = [ "bytes", "http 1.1.0", @@ -2313,15 +2298,15 @@ dependencies = [ "bytes", "futures-util", "http 1.1.0", - "http-body 1.0.0", + "http-body 1.0.1", "pin-project-lite", ] [[package]] name = "httparse" -version = "1.8.0" +version = "1.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" +checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" [[package]] name = "httpdate" @@ -2331,9 +2316,9 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hyper" -version = "0.14.28" +version = "0.14.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" +checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" dependencies = [ "bytes", "futures-channel", @@ -2355,15 +2340,15 @@ dependencies = [ [[package]] name = "hyper" -version = "1.3.1" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe575dd17d0862a9a33781c8c4696a55c320909004a67a00fb286ba8b1bc496d" +checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" dependencies = [ "bytes", "futures-channel", "futures-util", "http 1.1.0", - "http-body 1.0.0", + "http-body 1.0.1", "httparse", "itoa", "pin-project-lite", @@ -2380,7 +2365,7 @@ checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", "http 0.2.12", - "hyper 0.14.28", + "hyper 0.14.30", "rustls 0.21.12", "tokio", "tokio-rustls 0.24.1", @@ -2393,7 +2378,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" dependencies = [ "bytes", - "hyper 0.14.28", + "hyper 0.14.30", "native-tls", "tokio", "tokio-native-tls", @@ -2407,7 +2392,7 @@ checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" dependencies = [ "bytes", "http-body-util", - "hyper 1.3.1", + "hyper 1.4.1", "hyper-util", "native-tls", "tokio", @@ -2417,16 +2402,16 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.5" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b875924a60b96e5d7b9ae7b066540b1dd1cbd90d1828f54c92e02a283351c56" +checksum = "da62f120a8a37763efb0cf8fdf264b884c7b8b9ac8660b900c8661030c00e6ba" dependencies = [ "bytes", "futures-channel", "futures-util", "http 1.1.0", - "http-body 1.0.0", - "hyper 1.3.1", + "http-body 1.0.1", + "hyper 1.4.1", "pin-project-lite", "socket2", "tokio", @@ -2525,9 +2510,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.6" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" dependencies = [ "equivalent", "hashbrown 0.14.5", @@ -2555,7 +2540,7 @@ version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fddf93031af70e75410a2511ec04d49e758ed2f26dad3404a934e0fb45cc12a" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "crossterm", "dyn-clone", "fuzzy-matcher", @@ -2566,20 +2551,11 @@ dependencies = [ "unicode-width", ] -[[package]] -name = "instant" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" -dependencies = [ - "cfg-if", -] - [[package]] name = "interprocess" -version = "2.2.0" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67bafc2f5dbdad79a6d925649758d5472647b416028099f0b829d1b67fdd47d3" +checksum = "d2f4e4a06d42fab3e85ab1b419ad32b09eab58b901d40c57935ff92db3287a13" dependencies = [ "doctest-file", "futures-core", @@ -2592,9 +2568,15 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.9.0" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" +checksum = "187674a687eed5fe42285b40c6291f9a01517d415fad1c3cbc6a9f778af7fcd4" + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" [[package]] name = "itertools" @@ -2640,9 +2622,9 @@ checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "js-sys" -version = "0.3.69" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" dependencies = [ "wasm-bindgen", ] @@ -2686,9 +2668,9 @@ dependencies = [ [[package]] name = "keccak-asm" -version = "0.1.0" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb8515fff80ed850aea4a1595f2e519c003e2a00a82fe168ebf5269196caf444" +checksum = "505d1856a39b200489082f90d897c3f07c455563880bc5952e38eabf731c83b6" dependencies = [ "digest 0.10.7", "sha3-asm", @@ -2718,7 +2700,7 @@ dependencies = [ "petgraph", "pico-args", "regex", - "regex-syntax 0.8.3", + "regex-syntax 0.8.4", "string_cache", "term", "tiny-keccak", @@ -2732,7 +2714,7 @@ version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "507460a910eb7b32ee961886ff48539633b788a36b65692b95f225b844c82553" dependencies = [ - "regex-automata 0.4.6", + "regex-automata 0.4.7", ] [[package]] @@ -2759,15 +2741,15 @@ dependencies = [ [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.154" +version = "0.2.158" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" +checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" [[package]] name = "libm" @@ -2781,15 +2763,15 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "libc", ] [[package]] name = "linux-raw-sys" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "lock_api" @@ -2803,15 +2785,15 @@ dependencies = [ [[package]] name = "log" -version = "0.4.21" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "lru" -version = "0.12.3" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3262e75e648fce39813cb56ac41f3c3e3f65217ebf3844d818d1f9398cfb0dc" +checksum = "37ee39891760e7d94734f6f63fedc29a2e4a152f836120753a72503f09fcf904" dependencies = [ "hashbrown 0.14.5", ] @@ -2836,9 +2818,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.7.2" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "mime" @@ -2858,11 +2840,11 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.7.2" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" +checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" dependencies = [ - "adler", + "adler2", ] [[package]] @@ -2877,13 +2859,24 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "mio" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" +dependencies = [ + "hermit-abi 0.3.9", + "libc", + "wasi", + "windows-sys 0.52.0", +] + [[package]] name = "native-tls" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" dependencies = [ - "lazy_static", "libc", "log", "openssl", @@ -3000,52 +2993,52 @@ dependencies = [ [[package]] name = "num_enum" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845" +checksum = "4e613fc340b2220f734a8595782c551f1250e969d87d3be1ae0579e8d4065179" dependencies = [ "num_enum_derive", ] [[package]] name = "num_enum_derive" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" +checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.77", ] [[package]] name = "object" -version = "0.32.2" +version = "0.36.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +checksum = "084f1a5821ac4c651660a94a7153d27ac9d8a53736203f58b31945ded098070a" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.19.0" +version = "1.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "33ea5043e58958ee56f3e15a90aee535795cd7dfd319846288d93c5b57d85cbe" [[package]] name = "oorandom" -version = "11.1.3" +version = "11.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" +checksum = "b410bbe7e14ab526a0e86877eb47c6996a2bd7746f027ba551028c925390e4e9" [[package]] name = "openssl" -version = "0.10.64" +version = "0.10.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" +checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "cfg-if", "foreign-types", "libc", @@ -3062,7 +3055,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.77", ] [[package]] @@ -3073,9 +3066,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.102" +version = "0.9.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c597637d56fbc83893a35eb0dd04b2b8e7a50c91e64e9493e398b5df4fb45fa2" +checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" dependencies = [ "cc", "libc", @@ -3097,9 +3090,9 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "parity-scale-codec" -version = "3.6.9" +version = "3.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "881331e34fa842a2fb61cc2db9643a8fedc615e47cfcc52597d1af0db9a7e8fe" +checksum = "306800abfa29c7f16596b5970a588435e3d5b3149683d00c12b699cc19f895ee" dependencies = [ "arrayvec", "bitvec", @@ -3111,9 +3104,9 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "3.6.9" +version = "3.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be30eaf4b0a9fba5336683b38de57bb86d179a35862ba6bfcf57625d006bde5b" +checksum = "d830939c76d294956402033aee57a6da7b438f2294eb94864c37b0569053a42c" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -3123,37 +3116,12 @@ dependencies = [ [[package]] name = "parking_lot" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" -dependencies = [ - "instant", - "lock_api", - "parking_lot_core 0.8.6", -] - -[[package]] -name = "parking_lot" -version = "0.12.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e4af0ca4f6caed20e900d564c242b8e5d4903fdacf31d3daf527b66fe6f42fb" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", - "parking_lot_core 0.9.10", -] - -[[package]] -name = "parking_lot_core" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" -dependencies = [ - "cfg-if", - "instant", - "libc", - "redox_syscall 0.2.16", - "smallvec", - "winapi", + "parking_lot_core", ] [[package]] @@ -3164,16 +3132,16 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.1", + "redox_syscall", "smallvec", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] name = "paste" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "pbkdf2" @@ -3190,7 +3158,7 @@ version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e459365e590736a54c3fa561947c84837534b8e9af6fc5bf781307e82658fae" dependencies = [ - "base64 0.22.0", + "base64 0.22.1", "serde", ] @@ -3202,9 +3170,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.9" +version = "2.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "311fb059dee1a7b802f036316d790138c613a4e8b180c822e3925a662e9f0c95" +checksum = "9c73c26c01b8c87956cea613c907c9d6ecffd8d18a2a5908e5de0adfaa185cea" dependencies = [ "memchr", "thiserror", @@ -3218,7 +3186,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset", - "indexmap 2.2.6", + "indexmap 2.5.0", ] [[package]] @@ -3228,7 +3196,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e9567389417feee6ce15dd6527a8a1ecac205ef62c2932bcf3d9f6fc5b78b414" dependencies = [ "futures", - "rustc_version 0.4.0", + "rustc_version 0.4.1", ] [[package]] @@ -3263,7 +3231,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.77", ] [[package]] @@ -3296,9 +3264,9 @@ checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "plotters" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a15b6eccb8484002195a3e44fe65a4ce8e93a625797a063735536fd59cb01cf3" +checksum = "5aeb6f403d7a4911efb1e33402027fc44f29b5bf6def3effcc22d7bb75f2b747" dependencies = [ "num-traits 0.2.19", "plotters-backend", @@ -3309,15 +3277,15 @@ dependencies = [ [[package]] name = "plotters-backend" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "414cec62c6634ae900ea1c56128dfe87cf63e7caece0852ec76aba307cebadb7" +checksum = "df42e13c12958a16b3f7f4386b9ab1f3e7933914ecea48da7139435263a4172a" [[package]] name = "plotters-svg" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81b30686a7d9c3e010b84284bdd26a29f2138574f52f5eb6f794fc0ad924e705" +checksum = "51bae2ac328883f7acdfea3d66a7c35751187f870bc81f94563733a154d7a670" dependencies = [ "plotters-backend", ] @@ -3330,9 +3298,12 @@ checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "ppv-lite86" -version = "0.2.17" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] [[package]] name = "precomputed-hash" @@ -3364,9 +3335,9 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "2.0.0" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8366a6159044a37876a2b9817124296703c586a5c92e2c53751fa06d8d43e8" +checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" dependencies = [ "toml_edit", ] @@ -3397,28 +3368,28 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.81" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1597b0c024618f09a9c3b8655b7e430397a36d23fdafec26d6965e9eec3eba" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] [[package]] name = "proptest" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31b476131c3c86cb68032fdc5cb6d5a1045e3e42d96b69fa599fd77701e1f5bf" +checksum = "b4c2511913b88df1637da85cc8d96ec8e43a3f8bb8ccb71ee1ac240d6f3df58d" dependencies = [ "bit-set", "bit-vec", - "bitflags 2.5.0", + "bitflags 2.6.0", "lazy_static", "num-traits 0.2.19", "rand", "rand_chacha", "rand_xorshift", - "regex-syntax 0.8.3", + "regex-syntax 0.8.4", "rusty-fork", "tempfile", "unarray", @@ -3432,9 +3403,9 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quote" -version = "1.0.36" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] @@ -3518,27 +3489,18 @@ checksum = "d3edd4d5d42c92f0a659926464d4cce56b562761267ecf0f469d85b7de384175" [[package]] name = "redox_syscall" -version = "0.2.16" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +checksum = "0884ad60e090bf1345b93da0a5de8923c93884cd03f40dfcfddd3b4bee661853" dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_syscall" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" -dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", ] [[package]] name = "redox_users" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ "getrandom", "libredox", @@ -3547,14 +3509,14 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.4" +version = "1.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" +checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.6", - "regex-syntax 0.8.3", + "regex-automata 0.4.7", + "regex-syntax 0.8.4", ] [[package]] @@ -3568,13 +3530,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.6" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.3", + "regex-syntax 0.8.4", ] [[package]] @@ -3585,9 +3547,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "reqwest" @@ -3603,7 +3565,7 @@ dependencies = [ "h2", "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.28", + "hyper 0.14.30", "hyper-rustls", "hyper-tls 0.5.0", "ipnet", @@ -3630,23 +3592,23 @@ dependencies = [ "wasm-bindgen-futures", "web-sys", "webpki-roots 0.25.4", - "winreg 0.50.0", + "winreg", ] [[package]] name = "reqwest" -version = "0.12.5" +version = "0.12.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7d6d2a27d57148378eb5e111173f4276ad26340ecc5c49a4a2152167a2d6a37" +checksum = "f8f4955649ef5c38cc7f9e8aa41761d48fb9677197daea9984dc54f56aad5e63" dependencies = [ - "base64 0.22.0", + "base64 0.22.1", "bytes", "futures-core", "futures-util", "http 1.1.0", - "http-body 1.0.0", + "http-body 1.0.1", "http-body-util", - "hyper 1.3.1", + "hyper 1.4.1", "hyper-tls 0.6.0", "hyper-util", "ipnet", @@ -3657,7 +3619,7 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls-pemfile 2.1.2", + "rustls-pemfile 2.1.3", "serde", "serde_json", "serde_urlencoded", @@ -3669,7 +3631,7 @@ dependencies = [ "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "winreg 0.52.0", + "windows-registry", ] [[package]] @@ -3737,11 +3699,40 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48fd7bd8a6377e15ad9d42a8ec25371b94ddc67abe7c8b9127bec79bebaaae18" +[[package]] +name = "rust-analyzer-salsa" +version = "0.17.0-pre.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "719825638c59fd26a55412a24561c7c5bcf54364c88b9a7a04ba08a6eafaba8d" +dependencies = [ + "indexmap 2.5.0", + "lock_api", + "oorandom", + "parking_lot", + "rust-analyzer-salsa-macros", + "rustc-hash", + "smallvec", + "tracing", + "triomphe", +] + +[[package]] +name = "rust-analyzer-salsa-macros" +version = "0.17.0-pre.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d96498e9684848c6676c399032ebc37c52da95ecbefa83d71ccc53b9f8a4a8e" +dependencies = [ + "heck 0.4.1", + "proc-macro2", + "quote", + "syn 2.0.77", +] + [[package]] name = "rustc-demangle" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc-hash" @@ -3766,20 +3757,20 @@ dependencies = [ [[package]] name = "rustc_version" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ - "semver 1.0.22", + "semver 1.0.23", ] [[package]] name = "rustix" -version = "0.38.34" +version = "0.38.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "errno", "libc", "linux-raw-sys", @@ -3800,14 +3791,14 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.10" +version = "0.23.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05cff451f60db80f490f3c182b77c35260baace73209e9cdbbe526bfe3a4d402" +checksum = "f2dabaac7466917e566adb06783a81ca48944c6898a1b08b9374106dd671f4c8" dependencies = [ "once_cell", "ring", "rustls-pki-types", - "rustls-webpki 0.102.4", + "rustls-webpki 0.102.8", "subtle", "zeroize", ] @@ -3823,19 +3814,19 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "2.1.2" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d" +checksum = "196fe16b00e106300d3e45ecfcb764fa292a535d7326a29a5875c579c7417425" dependencies = [ - "base64 0.22.0", + "base64 0.22.1", "rustls-pki-types", ] [[package]] name = "rustls-pki-types" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" +checksum = "fc0a2ce646f8655401bb81e7927b812614bd5d91dbc968696be50603510fcaf0" [[package]] name = "rustls-webpki" @@ -3849,9 +3840,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.102.4" +version = "0.102.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff448f7e92e913c4b7d4c6d8e4540a1724b319b4152b8aef6d4cf8339712b33e" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" dependencies = [ "ring", "rustls-pki-types", @@ -3878,38 +3869,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" - -[[package]] -name = "salsa" -version = "0.16.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b84d9f96071f3f3be0dc818eae3327625d8ebc95b58da37d6850724f31d3403" -dependencies = [ - "crossbeam-utils", - "indexmap 1.9.3", - "lock_api", - "log", - "oorandom", - "parking_lot 0.11.2", - "rustc-hash", - "salsa-macros", - "smallvec", -] - -[[package]] -name = "salsa-macros" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd3904a4ba0a9d0211816177fd34b04c7095443f8cdacd11175064fe541c8fe2" -dependencies = [ - "heck 0.3.3", - "proc-macro2", - "quote", - "syn 1.0.109", -] +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "salsa20" @@ -3931,11 +3893,11 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" +checksum = "e9aaafd5a2b6e3d657ff009d82fbd630b6bd54dd4eb06f21693925cdf80f9b8b" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -3960,7 +3922,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.60", + "syn 2.0.77", ] [[package]] @@ -4007,11 +3969,11 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.10.0" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "770452e37cad93e0a50d5abc3990d2bc351c36d0328f86cefec2f2fb206eaef6" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.6.0", "core-foundation", "core-foundation-sys", "libc", @@ -4020,9 +3982,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.10.0" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41f3cc463c0ef97e11c3461a9d3787412d30e8e7eb907c79180c4a57bf7c04ef" +checksum = "75da29fe9b9b08fe9d6b22b5b4bcbc75d8db3aa31e639aa56bb62e9d46bfceaf" dependencies = [ "core-foundation-sys", "libc", @@ -4039,9 +4001,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.22" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "semver-parser" @@ -4060,22 +4022,22 @@ checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" [[package]] name = "serde" -version = "1.0.204" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12" +checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.204" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" +checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.77", ] [[package]] @@ -4086,16 +4048,17 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.77", ] [[package]] name = "serde_json" -version = "1.0.116" +version = "1.0.128" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e17db7126d17feb94eb3fad46bf1a96b034e8aacbc2e775fe81505f8b0b2813" +checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" dependencies = [ "itoa", + "memchr", "ryu", "serde", ] @@ -4135,25 +4098,7 @@ dependencies = [ "indexmap 1.9.3", "serde", "serde_json", - "serde_with_macros 2.3.3", - "time", -] - -[[package]] -name = "serde_with" -version = "3.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ad483d2ab0149d5a5ebcd9972a3852711e0153d863bf5a5d0391d28883c4a20" -dependencies = [ - "base64 0.22.0", - "chrono", - "hex", - "indexmap 1.9.3", - "indexmap 2.2.6", - "serde", - "serde_derive", - "serde_json", - "serde_with_macros 3.8.1", + "serde_with_macros", "time", ] @@ -4166,19 +4111,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.60", -] - -[[package]] -name = "serde_with_macros" -version = "3.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65569b702f41443e8bc8bbb1c5779bd0450bbe723b56198980e80ec45780bce2" -dependencies = [ - "darling", - "proc-macro2", - "quote", - "syn 2.0.60", + "syn 2.0.77", ] [[package]] @@ -4215,9 +4148,9 @@ dependencies = [ [[package]] name = "sha3-asm" -version = "0.1.0" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bac61da6b35ad76b195eb4771210f947734321a8d81d7738e1580d953bc7a15e" +checksum = "c28efc5e327c837aa837c59eae585fc250715ef939ac32881bcc11677cd02d46" dependencies = [ "cc", "cfg-if", @@ -4232,6 +4165,12 @@ dependencies = [ "lazy_static", ] +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + [[package]] name = "signal-hook" version = "0.3.17" @@ -4244,12 +4183,12 @@ dependencies = [ [[package]] name = "signal-hook-mio" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29ad2e15f37ec9a6cc544097b78a1ec90001e9f71b81338ca39f430adaca99af" +checksum = "34db1a06d485c9142248b7a054f034b349b212551f3dfd19c94d45a754a217cd" dependencies = [ "libc", - "mio", + "mio 0.8.11", "signal-hook", ] @@ -4314,6 +4253,32 @@ dependencies = [ "serde", ] +[[package]] +name = "sn-merkle-trie" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a46c1daa6d9bef421896da0fd2d17c80c02c93a966ca832c8f607b106d443ae0" +dependencies = [ + "anyhow", + "bitvec", + "starknet-types-core 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "sn-trie-proofs" +version = "0.1.0" +source = "git+https://github.com/HerodotusDev/trie-proofs.git#1412def6df010e3c9bca7bc1bae8798740398e5a" +dependencies = [ + "bitflags 2.6.0", + "reqwest 0.11.27", + "serde_json", + "sn-merkle-trie", + "starknet-types-core 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "starknet-types-rpc", + "thiserror", + "tokio", +] + [[package]] name = "socket2" version = "0.5.7" @@ -4351,17 +4316,22 @@ dependencies = [ "num-traits 0.1.43", ] +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + [[package]] name = "starknet" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20b9a7b7bfd87287af85854f7458b8170ba6aa59c39113436532b7ff3d2fcbd8" +checksum = "1e633a772f59214c296d5037c95c36b72792c9360323818da2b625c7b4ec4b49" dependencies = [ "starknet-accounts", "starknet-contract", "starknet-core", "starknet-crypto", - "starknet-ff", "starknet-macros", "starknet-providers", "starknet-signers", @@ -4369,13 +4339,14 @@ dependencies = [ [[package]] name = "starknet-accounts" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2095d7584608ae1707bd1cf2889368ab3734d9f54e4fcef4765cba1f3b3f7618" +checksum = "eee8a6b588a22c7e79f5d8d4e33413387db63a8beb98be8610138541794cc0a5" dependencies = [ "async-trait", "auto_impl", "starknet-core", + "starknet-crypto", "starknet-providers", "starknet-signers", "thiserror", @@ -4383,13 +4354,13 @@ dependencies = [ [[package]] name = "starknet-contract" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb3b73d437b4d62241612d13fce612602de6684c149cccf696e76a20757e2156" +checksum = "a5f91344f1e0b81873b6dc235c50ae4d084c6ea4dd4a1e3e27ad895803adb610" dependencies = [ "serde", "serde_json", - "serde_with 2.3.3", + "serde_with", "starknet-accounts", "starknet-core", "starknet-providers", @@ -4398,27 +4369,28 @@ dependencies = [ [[package]] name = "starknet-core" -version = "0.10.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ed286d637e34fb8ae1cd2f9615120ec8ff38d1cffd311ed7fdd497cdd2bd01f" +checksum = "d506e02a4083290d13b427dfe437fd95aa8b56315c455bb2f9cdeca76620d457" dependencies = [ "base64 0.21.7", + "crypto-bigint", "flate2", "hex", "serde", "serde_json", "serde_json_pythonic", - "serde_with 2.3.3", + "serde_with", "sha3", "starknet-crypto", - "starknet-ff", + "starknet-types-core 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "starknet-crypto" -version = "0.6.2" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e2c30c01e8eb0fc913c4ee3cf676389fffc1d1182bfe5bb9670e4e72e968064" +checksum = "ff2a821ad8d98c6c3e4d0e5097f3fe6e2ed120ada9d32be87cd1330c7923a2f0" dependencies = [ "crypto-bigint", "hex", @@ -4430,70 +4402,56 @@ dependencies = [ "sha2", "starknet-crypto-codegen", "starknet-curve", - "starknet-ff", + "starknet-types-core 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "zeroize", ] [[package]] name = "starknet-crypto-codegen" -version = "0.3.3" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbc159a1934c7be9761c237333a57febe060ace2bc9e3b337a59a37af206d19f" +checksum = "2e179dedc3fa6da064e56811d3e05d446aa2f7459e4eb0e3e49378a337235437" dependencies = [ "starknet-curve", - "starknet-ff", - "syn 2.0.60", + "starknet-types-core 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 2.0.77", ] [[package]] name = "starknet-curve" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1c383518bb312751e4be80f53e8644034aa99a0afb29d7ac41b89a997db875b" -dependencies = [ - "starknet-ff", -] - -[[package]] -name = "starknet-ff" -version = "0.3.7" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7abf1b44ec5b18d87c1ae5f54590ca9d0699ef4dd5b2ffa66fc97f24613ec585" +checksum = "56935b306dcf0b8f14bb2a1257164b8478bb8be4801dfae0923f5b266d1b457c" dependencies = [ - "ark-ff 0.4.2", - "bigdecimal", - "crypto-bigint", - "getrandom", - "hex", - "num-bigint", - "serde", + "starknet-types-core 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "starknet-macros" -version = "0.1.7" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95d549d3078bdbe775d0deaa8ddb57a19942989ce7c1f2dfd60beeb322bb4945" +checksum = "f4fe4f8d615329410578cbedcdbaa4a36c7f28f68c3f3ac56006cfbdaeaa2b41" dependencies = [ "starknet-core", - "syn 2.0.60", + "syn 2.0.77", ] [[package]] name = "starknet-providers" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6abf40ffcbe3b887b4d5cfc8ab73170c816b4aa78d1d4ad59abd3fb3b0f53cd" +checksum = "59c85e0a0f4563ae95dfeae14ea0f0c70610efc0ec2462505c64eff5765e7b97" dependencies = [ "async-trait", "auto_impl", "ethereum-types", "flate2", + "getrandom", "log", "reqwest 0.11.27", "serde", "serde_json", - "serde_with 2.3.3", + "serde_with", "starknet-core", "thiserror", "url", @@ -4501,14 +4459,15 @@ dependencies = [ [[package]] name = "starknet-signers" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e9a2bd4fd66090003c3b7f0d76476e5b63cd44f6a49ede2442673f4427d5a40" +checksum = "c17da2139119dbe3aacf1d5d4338798a5c489d17f424916ceb9d2efd83554f87" dependencies = [ "async-trait", "auto_impl", "crypto-bigint", "eth-keystore", + "getrandom", "rand", "starknet-core", "starknet-crypto", @@ -4530,6 +4489,28 @@ dependencies = [ "serde", ] +[[package]] +name = "starknet-types-core" +version = "0.1.5" +source = "git+https://github.com/starknet-io/types-rs#ffcf7e65983df3cb53d7a228849a073034cba161" +dependencies = [ + "lambdaworks-crypto", + "lambdaworks-math", + "num-bigint", + "num-integer", + "num-traits 0.2.19", + "serde", +] + +[[package]] +name = "starknet-types-rpc" +version = "0.7.1" +source = "git+https://github.com/starknet-io/types-rs#ffcf7e65983df3cb53d7a228849a073034cba161" +dependencies = [ + "serde", + "starknet-types-core 0.1.5 (git+https://github.com/starknet-io/types-rs)", +] + [[package]] name = "static_assertions" version = "1.1.0" @@ -4544,17 +4525,11 @@ checksum = "f91138e76242f575eb1d3b38b4f1362f10d3a43f47d182a5b359af488a02293b" dependencies = [ "new_debug_unreachable", "once_cell", - "parking_lot 0.12.2", + "parking_lot", "phf_shared", "precomputed-hash", ] -[[package]] -name = "strsim" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" - [[package]] name = "strsim" version = "0.11.1" @@ -4580,14 +4555,14 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.60", + "syn 2.0.77", ] [[package]] name = "subtle" -version = "2.5.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" @@ -4602,9 +4577,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.60" +version = "2.0.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "909518bc7b1c9b779f1bbf07f2929d35af9f0f37e47c6e9ef7f9dddc1e1821f3" +checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" dependencies = [ "proc-macro2", "quote", @@ -4613,14 +4588,14 @@ dependencies = [ [[package]] name = "syn-solidity" -version = "0.7.6" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d71e19bca02c807c9faa67b5a47673ff231b6e7449b251695188522f1dc44b2" +checksum = "c837dc8852cb7074e46b444afb81783140dab12c58867b49fb3898fbafedf7ea" dependencies = [ "paste", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.77", ] [[package]] @@ -4634,6 +4609,9 @@ name = "sync_wrapper" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" +dependencies = [ + "futures-core", +] [[package]] name = "system-configuration" @@ -4664,14 +4642,15 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.10.1" +version = "3.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" +checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" dependencies = [ "cfg-if", "fastrand", + "once_cell", "rustix", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -4708,7 +4687,7 @@ checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.77", ] [[package]] @@ -4782,9 +4761,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.6.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" dependencies = [ "tinyvec_macros", ] @@ -4797,32 +4776,31 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.37.0" +version = "1.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" +checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" dependencies = [ "backtrace", "bytes", "libc", - "mio", - "num_cpus", - "parking_lot 0.12.2", + "mio 1.0.2", + "parking_lot", "pin-project-lite", "signal-hook-registry", "socket2", "tokio-macros", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "tokio-macros" -version = "2.2.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.77", ] [[package]] @@ -4851,16 +4829,16 @@ version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ - "rustls 0.23.10", + "rustls 0.23.13", "rustls-pki-types", "tokio", ] [[package]] name = "tokio-stream" -version = "0.1.15" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" +checksum = "4f4e6ce100d0eb49a2734f8c0812bcd324cf357d21810932c5df6b96ef2b86f1" dependencies = [ "futures-core", "pin-project-lite", @@ -4876,43 +4854,42 @@ checksum = "c6989540ced10490aaf14e6bad2e3d33728a2813310a0c71d1574304c49631cd" dependencies = [ "futures-util", "log", - "rustls 0.23.10", + "rustls 0.23.13", "rustls-pki-types", "tokio", "tokio-rustls 0.26.0", "tungstenite", - "webpki-roots 0.26.3", + "webpki-roots 0.26.5", ] [[package]] name = "tokio-util" -version = "0.7.10" +version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" dependencies = [ "bytes", "futures-core", "futures-sink", "pin-project-lite", "tokio", - "tracing", ] [[package]] name = "toml_datetime" -version = "0.6.5" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" [[package]] name = "toml_edit" -version = "0.20.7" +version = "0.22.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" +checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d" dependencies = [ - "indexmap 2.2.6", + "indexmap 2.5.0", "toml_datetime", - "winnow 0.5.40", + "winnow", ] [[package]] @@ -4933,15 +4910,15 @@ dependencies = [ [[package]] name = "tower-layer" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" [[package]] name = "tower-service" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" @@ -4963,7 +4940,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.77", ] [[package]] @@ -5005,6 +4982,16 @@ dependencies = [ "tracing-log", ] +[[package]] +name = "triomphe" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6631e42e10b40c0690bf92f404ebcfe6e1fdb480391d15f17cc8e96eeed5369" +dependencies = [ + "serde", + "stable_deref_trait", +] + [[package]] name = "try-lock" version = "0.2.5" @@ -5024,7 +5011,7 @@ dependencies = [ "httparse", "log", "rand", - "rustls 0.23.10", + "rustls 0.23.13", "rustls-pki-types", "sha1", "thiserror", @@ -5069,9 +5056,9 @@ checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" [[package]] name = "unicode-normalization" @@ -5084,21 +5071,21 @@ dependencies = [ [[package]] name = "unicode-segmentation" -version = "1.11.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" +checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" [[package]] name = "unicode-width" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68f5e5f3158ecfd4b8ff6fe086db7c8467a2dfdac97fe420f2b7c4aa97af66d6" +checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" [[package]] name = "unicode-xid" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" +checksum = "229730647fbc343e3a80e463c1db7f78f3855d3f3739bee0dda773c9a037c90a" [[package]] name = "untrusted" @@ -5108,9 +5095,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.0" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" dependencies = [ "form_urlencoded", "idna", @@ -5125,9 +5112,9 @@ checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" [[package]] name = "utf8parse" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" @@ -5153,9 +5140,9 @@ checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "version_check" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "wait-timeout" @@ -5193,34 +5180,35 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" dependencies = [ "cfg-if", + "once_cell", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.77", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.42" +version = "0.4.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" +checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed" dependencies = [ "cfg-if", "js-sys", @@ -5230,9 +5218,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -5240,28 +5228,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.77", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" +checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" [[package]] name = "web-sys" -version = "0.3.69" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" +checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" dependencies = [ "js-sys", "wasm-bindgen", @@ -5275,9 +5263,9 @@ checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" [[package]] name = "webpki-roots" -version = "0.26.3" +version = "0.26.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd7c23921eeb1713a4e851530e9b9756e4fb0e89978582942612524cf09f01cd" +checksum = "0bd24728e5af82c6c4ec1b66ac4844bdf8156257fccda846ec58b42cd0cdbe6a" dependencies = [ "rustls-pki-types", ] @@ -5306,11 +5294,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -5325,7 +5313,37 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.5", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-registry" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" +dependencies = [ + "windows-result", + "windows-strings", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-result" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-strings" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" +dependencies = [ + "windows-result", + "windows-targets 0.52.6", ] [[package]] @@ -5343,7 +5361,16 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.5", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", ] [[package]] @@ -5363,18 +5390,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] @@ -5385,9 +5412,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" @@ -5397,9 +5424,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" @@ -5409,15 +5436,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" [[package]] name = "windows_i686_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" @@ -5427,9 +5454,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" @@ -5439,9 +5466,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" @@ -5451,9 +5478,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" @@ -5463,24 +5490,15 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" - -[[package]] -name = "winnow" -version = "0.5.40" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" -dependencies = [ - "memchr", -] +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.6.7" +version = "0.6.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14b9415ee827af173ebb3f15f9083df5a122eb93572ec28741fb153356ea2578" +checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" dependencies = [ "memchr", ] @@ -5495,16 +5513,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "winreg" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5" -dependencies = [ - "cfg-if", - "windows-sys 0.48.0", -] - [[package]] name = "ws_stream_wasm" version = "0.7.4" @@ -5516,7 +5524,7 @@ dependencies = [ "js-sys", "log", "pharos", - "rustc_version 0.4.0", + "rustc_version 0.4.1", "send_wrapper", "thiserror", "wasm-bindgen", @@ -5535,29 +5543,30 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.7.32" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ + "byteorder", "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.32" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.77", ] [[package]] name = "zeroize" -version = "1.7.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" dependencies = [ "zeroize_derive", ] @@ -5570,5 +5579,5 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.77", ] diff --git a/Cargo.toml b/Cargo.toml index 1bf76b87..cc851d51 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -35,13 +35,15 @@ tracing = "0.1" reqwest = { version = "0.11", features = ["json"] } rand = "0.8.4" regex = "1" -starknet = "0.10.0" -starknet-crypto = "0.6.1" -starknet-types-core = "0.1.0" +starknet = "0.11.0" +starknet-crypto = "0.7.1" +starknet-types-core = "0.1.5" cairo-lang-starknet-classes = "2.7.0" cairo-vm = "1.0.0-rc6" futures = "0.3.30" lazy_static = "1.4.0" thiserror = "1.0" -eth-trie-proofs = "0.1.1" +eth-trie-proofs = { version = "0.1.1", git = "https://github.com/HerodotusDev/trie-proofs.git" } +sn-trie-proofs = { version = "0.1.0", git = "https://github.com/HerodotusDev/trie-proofs.git" } + itertools = "0.10" diff --git a/hdp/Cargo.toml b/hdp/Cargo.toml index a4baafff..7989f621 100644 --- a/hdp/Cargo.toml +++ b/hdp/Cargo.toml @@ -34,6 +34,7 @@ reqwest = { workspace = true } lazy_static = { workspace = true } eth-trie-proofs = { workspace = true } itertools = { workspace = true } +sn-trie-proofs = { workspace = true } [features] default = [] diff --git a/hdp/src/cairo_runner/dry_run.rs b/hdp/src/cairo_runner/dry_run.rs index 646bb4e8..65991901 100644 --- a/hdp/src/cairo_runner/dry_run.rs +++ b/hdp/src/cairo_runner/dry_run.rs @@ -7,7 +7,7 @@ use crate::provider::key::{ use serde::{Deserialize, Serialize}; use serde_with::serde_as; use starknet::core::serde::unsigned_field_element::UfeHex; -use starknet_crypto::FieldElement; +use starknet_crypto::Felt; use std::fs; use std::path::{Path, PathBuf}; use std::process::{Command, Stdio}; @@ -25,7 +25,7 @@ pub struct DryRunnedModule { pub fetch_keys: Vec, pub result: Uint256, #[serde_as(as = "UfeHex")] - pub program_hash: FieldElement, + pub program_hash: Felt, } fn deserialize_fetch_keys<'de, D>(deserializer: D) -> Result, D::Error> @@ -173,7 +173,8 @@ mod tests { assert_eq!(result[0].result, Uint256::ZERO); assert_eq!( result[0].program_hash, - felt!("0x04df21eb479ae4416fbdc00abab6fab43bff0b8083be4d1fd8602c8fbfbd2274") + Felt::from_hex("0x04df21eb479ae4416fbdc00abab6fab43bff0b8083be4d1fd8602c8fbfbd2274") + .unwrap() ); } diff --git a/hdp/src/preprocessor/module_registry.rs b/hdp/src/preprocessor/module_registry.rs index 038fe9be..71237544 100644 --- a/hdp/src/preprocessor/module_registry.rs +++ b/hdp/src/preprocessor/module_registry.rs @@ -13,7 +13,7 @@ use crate::{ }, }; use reqwest::Client; -use starknet_crypto::FieldElement; +use starknet_types_core::felt::Felt; use std::{path::PathBuf, str::FromStr}; use thiserror::Error; use tracing::info; @@ -65,8 +65,7 @@ impl ModuleRegistry { module_inputs: Vec, ) -> Result { let program_hash = program_hash.map(|program_hash| { - FieldElement::from_hex_be(&program_hash) - .expect("program hash cannot be converted to FieldElement") + Felt::from_hex(&program_hash).expect("program hash cannot be converted to FieldElement") }); let module_inputs: Result, _> = module_inputs .into_iter() @@ -82,7 +81,7 @@ impl ModuleRegistry { pub async fn get_extended_module_from_class_source( &self, - program_hash: Option, + program_hash: Option, local_class_path: Option, module_inputs: Vec, ) -> Result { @@ -105,8 +104,7 @@ impl ModuleRegistry { }; let program_hash = casm.compiled_class_hash(); - let converted_hash = FieldElement::from_bytes_be(&program_hash.to_bytes_be()) - .expect("program hash cannot be converted to FieldElement"); + let converted_hash = Felt::from_bytes_be(&program_hash.to_bytes_be()); info!("program Hash: {:#?}", converted_hash); let module = Module { @@ -141,7 +139,7 @@ impl ModuleRegistry { async fn get_module_class_from_program_hash( &self, - program_hash: FieldElement, + program_hash: Felt, ) -> Result { let program_hash_hex = format!("{:#x}", program_hash); @@ -182,13 +180,12 @@ mod tests { use super::*; - fn init() -> (ModuleRegistry, FieldElement) { + fn init() -> (ModuleRegistry, Felt) { let module_registry = ModuleRegistry::new(); // This is test contract class hash - let program_hash = FieldElement::from_hex_be( - "0x64041a339b1edd10de83cf031cfa938645450f971d2527c90d4c2ce68d7d412", - ) - .unwrap(); + let program_hash = + Felt::from_hex("0x64041a339b1edd10de83cf031cfa938645450f971d2527c90d4c2ce68d7d412") + .unwrap(); (module_registry, program_hash) } @@ -214,10 +211,8 @@ mod tests { assert_eq!( extended_modules.task.program_hash, - FieldElement::from_hex_be( - "0x64041a339b1edd10de83cf031cfa938645450f971d2527c90d4c2ce68d7d412" - ) - .unwrap() + Felt::from_hex("0x64041a339b1edd10de83cf031cfa938645450f971d2527c90d4c2ce68d7d412") + .unwrap() ); assert_eq!(extended_modules.task.inputs, vec![]); } diff --git a/hdp/src/primitives/processed_types/cairo_format/account.rs b/hdp/src/primitives/processed_types/cairo_format/account.rs index 125119e9..5c8f4827 100644 --- a/hdp/src/primitives/processed_types/cairo_format/account.rs +++ b/hdp/src/primitives/processed_types/cairo_format/account.rs @@ -4,7 +4,7 @@ use serde::{Deserialize, Serialize}; use serde_with::serde_as; use starknet::core::serde::unsigned_field_element::UfeHex; -use starknet_crypto::FieldElement; +use starknet_types_core::felt::Felt; use crate::primitives::processed_types::account::ProcessedAccount as BaseProcessedAccount; @@ -33,7 +33,7 @@ impl AsCairoFormat for BaseProcessedAccount { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Eq, Hash)] pub struct ProcessedAccount { #[serde_as(as = "Vec")] - pub address: Vec, + pub address: Vec, pub account_key: String, pub proofs: Vec, } diff --git a/hdp/src/primitives/processed_types/cairo_format/datalake_compute.rs b/hdp/src/primitives/processed_types/cairo_format/datalake_compute.rs index b711be25..b85e479b 100644 --- a/hdp/src/primitives/processed_types/cairo_format/datalake_compute.rs +++ b/hdp/src/primitives/processed_types/cairo_format/datalake_compute.rs @@ -4,7 +4,7 @@ use super::{felt_vec_unit::FieldElementVectorUnit, traits::AsCairoFormat}; use serde::{Deserialize, Serialize}; use serde_with::serde_as; use starknet::core::serde::unsigned_field_element::UfeHex; -use starknet_crypto::FieldElement; +use starknet_types_core::felt::Felt; impl AsCairoFormat for BaseProcessedDatalakeCompute { type Output = ProcessedDatalakeCompute; @@ -28,10 +28,10 @@ impl AsCairoFormat for BaseProcessedDatalakeCompute { pub struct ProcessedDatalakeCompute { pub task_bytes_len: u64, #[serde_as(as = "Vec")] - pub encoded_task: Vec, + pub encoded_task: Vec, pub datalake_bytes_len: u64, #[serde_as(as = "Vec")] - pub encoded_datalake: Vec, + pub encoded_datalake: Vec, pub datalake_type: u8, pub property_type: u8, } diff --git a/hdp/src/primitives/processed_types/cairo_format/felt_vec_unit.rs b/hdp/src/primitives/processed_types/cairo_format/felt_vec_unit.rs index 6a19a72b..0c4902e7 100644 --- a/hdp/src/primitives/processed_types/cairo_format/felt_vec_unit.rs +++ b/hdp/src/primitives/processed_types/cairo_format/felt_vec_unit.rs @@ -1,14 +1,14 @@ use serde::Serialize; use serde_with::serde_as; use starknet::core::serde::unsigned_field_element::UfeHex; -use starknet_crypto::FieldElement; +use starknet_types_core::felt::Felt; #[serde_as] #[derive(Serialize, Debug)] pub struct FieldElementVectorUnit { /// Chunked vector of field elements #[serde_as(as = "Vec")] - pub felts: Vec, + pub felts: Vec, /// Length of the original byte array before chunking into field elements pub bytes_len: u64, } @@ -17,7 +17,7 @@ impl FieldElementVectorUnit { /// Converts a byte slice into a `FieldElementVectorUnit`. /// /// This function takes a slice of bytes and converts it into a `FieldElementVectorUnit`, - /// which consists of a vector of `FieldElement`s and the length of the original byte slice. + /// which consists of a vector of [`Felt`]s and the length of the original byte slice. /// /// # Panics /// @@ -34,8 +34,7 @@ impl FieldElementVectorUnit { let len = chunk.len(); arr[..len].copy_from_slice(chunk); let le_int = u64::from_le_bytes(arr); - FieldElement::from_dec_str(&le_int.to_string()) - .expect("Invalid to convert FieldElement") + Felt::from_dec_str(&le_int.to_string()).expect("Invalid to convert FieldElement") }) .collect(); @@ -62,7 +61,7 @@ mod tests { let result = FieldElementVectorUnit::from_bytes(&bytes); assert_eq!(result.bytes_len, 1); assert_eq!(result.felts.len(), 1); - assert_eq!(result.felts[0], FieldElement::from_hex_be("0x1").unwrap()); + assert_eq!(result.felts[0], Felt::from_hex("0x1").unwrap()); } #[test] @@ -71,10 +70,7 @@ mod tests { let result = FieldElementVectorUnit::from_bytes(&bytes); assert_eq!(result.bytes_len, 8); assert_eq!(result.felts.len(), 1); - assert_eq!( - result.felts[0], - FieldElement::from_hex_be("efcdab9078563412").unwrap() - ); + assert_eq!(result.felts[0], Felt::from_hex("efcdab9078563412").unwrap()); } #[test] @@ -83,13 +79,7 @@ mod tests { let result = FieldElementVectorUnit::from_bytes(&bytes); assert_eq!(result.bytes_len, 16); assert_eq!(result.felts.len(), 2); - assert_eq!( - result.felts[0], - FieldElement::from_hex_be("efcdab9078563412").unwrap() - ); - assert_eq!( - result.felts[1], - FieldElement::from_hex_be("8877665544332211").unwrap() - ); + assert_eq!(result.felts[0], Felt::from_hex("efcdab9078563412").unwrap()); + assert_eq!(result.felts[1], Felt::from_hex("8877665544332211").unwrap()); } } diff --git a/hdp/src/primitives/processed_types/cairo_format/header.rs b/hdp/src/primitives/processed_types/cairo_format/header.rs index 663ad126..395e8e5b 100644 --- a/hdp/src/primitives/processed_types/cairo_format/header.rs +++ b/hdp/src/primitives/processed_types/cairo_format/header.rs @@ -1,7 +1,7 @@ use serde::{Deserialize, Serialize}; use serde_with::serde_as; use starknet::core::serde::unsigned_field_element::UfeHex; -use starknet_crypto::FieldElement; +use starknet_types_core::felt::Felt; use crate::primitives::processed_types::header::{ ProcessedHeader as BaseProcessedHeader, ProcessedHeaderProof as BasedProcessedHeaderProof, @@ -31,7 +31,7 @@ impl AsCairoFormat for BaseProcessedHeader { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Eq, Hash)] pub struct ProcessedHeader { #[serde_as(as = "Vec")] - pub rlp: Vec, + pub rlp: Vec, /// rlp_bytes_len is the byte( 8 bit ) length from rlp string pub rlp_bytes_len: u64, pub proof: BasedProcessedHeaderProof, diff --git a/hdp/src/primitives/processed_types/cairo_format/module.rs b/hdp/src/primitives/processed_types/cairo_format/module.rs index ace62357..b0c1df9a 100644 --- a/hdp/src/primitives/processed_types/cairo_format/module.rs +++ b/hdp/src/primitives/processed_types/cairo_format/module.rs @@ -5,7 +5,7 @@ use cairo_lang_starknet_classes::casm_contract_class::CasmContractClass; use serde::{Deserialize, Serialize}; use serde_with::serde_as; use starknet::core::serde::unsigned_field_element::UfeHex; -use starknet_crypto::FieldElement; +use starknet_types_core::felt::Felt; use super::{AsCairoFormat, FieldElementVectorUnit}; @@ -53,7 +53,7 @@ impl DryRunProcessedModule { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct ProcessedModule { #[serde_as(as = "Vec")] - pub encoded_task: Vec, + pub encoded_task: Vec, pub task_bytes_len: u64, pub inputs: Vec, /// Detail class code of the module. @@ -63,7 +63,7 @@ pub struct ProcessedModule { impl ProcessedModule { pub fn new( - encoded_task: Vec, + encoded_task: Vec, task_bytes_len: u64, inputs: Vec, module_class: CasmContractClass, diff --git a/hdp/src/primitives/processed_types/cairo_format/mpt.rs b/hdp/src/primitives/processed_types/cairo_format/mpt.rs index 707f4112..93fcc4f5 100644 --- a/hdp/src/primitives/processed_types/cairo_format/mpt.rs +++ b/hdp/src/primitives/processed_types/cairo_format/mpt.rs @@ -4,7 +4,7 @@ use super::{felt_vec_unit::FieldElementVectorUnit, traits::AsCairoFormat}; use serde::{Deserialize, Serialize}; use serde_with::serde_as; use starknet::core::serde::unsigned_field_element::UfeHex; -use starknet_crypto::FieldElement; +use starknet_types_core::felt::Felt; impl AsCairoFormat for BaseProcessedMPTProof { type Output = ProcessedMPTProof; @@ -17,8 +17,7 @@ impl AsCairoFormat for BaseProcessedMPTProof { .collect(); let proof_bytes_len = proof_felts.iter().map(|f| f.bytes_len).collect(); - let proof_result: Vec> = - proof_felts.iter().map(|f| f.felts.clone()).collect(); + let proof_result: Vec> = proof_felts.iter().map(|f| f.felts.clone()).collect(); ProcessedMPTProof { block_number: self.block_number, proof_bytes_len, @@ -34,5 +33,5 @@ pub struct ProcessedMPTProof { /// proof_bytes_len is the byte( 8 bit ) length from each proof string pub proof_bytes_len: Vec, #[serde_as(as = "Vec>")] - pub proof: Vec>, + pub proof: Vec>, } diff --git a/hdp/src/primitives/processed_types/cairo_format/receipt.rs b/hdp/src/primitives/processed_types/cairo_format/receipt.rs index dba8fd5d..b09ebd59 100644 --- a/hdp/src/primitives/processed_types/cairo_format/receipt.rs +++ b/hdp/src/primitives/processed_types/cairo_format/receipt.rs @@ -5,7 +5,7 @@ use crate::primitives::processed_types::receipt::ProcessedReceipt as BaseProcess use serde::{Deserialize, Serialize}; use serde_with::serde_as; use starknet::core::serde::unsigned_field_element::UfeHex; -use starknet_crypto::FieldElement; +use starknet_types_core::felt::Felt; impl AsCairoFormat for BaseProcessedReceipt { type Output = ProcessedReceipt; @@ -19,8 +19,7 @@ impl AsCairoFormat for BaseProcessedReceipt { .collect(); let proof_bytes_len = proof_felts.iter().map(|f| f.bytes_len).collect(); - let proof_result: Vec> = - proof_felts.iter().map(|f| f.felts.clone()).collect(); + let proof_result: Vec> = proof_felts.iter().map(|f| f.felts.clone()).collect(); ProcessedReceipt { key, block_number: self.block_number, @@ -39,7 +38,7 @@ pub struct ProcessedReceipt { /// proof_bytes_len is the byte( 8 bit ) length from each proof string pub proof_bytes_len: Vec, #[serde_as(as = "Vec>")] - pub proof: Vec>, + pub proof: Vec>, } #[cfg(test)] diff --git a/hdp/src/primitives/processed_types/cairo_format/storage.rs b/hdp/src/primitives/processed_types/cairo_format/storage.rs index 6817b80b..b370434b 100644 --- a/hdp/src/primitives/processed_types/cairo_format/storage.rs +++ b/hdp/src/primitives/processed_types/cairo_format/storage.rs @@ -4,7 +4,7 @@ use alloy::primitives::StorageKey; use serde::{Deserialize, Serialize}; use serde_with::serde_as; use starknet::core::serde::unsigned_field_element::UfeHex; -use starknet_crypto::FieldElement; +use starknet_types_core::felt::Felt; use crate::primitives::processed_types::storage::ProcessedStorage as BaseProcessedStorage; @@ -36,10 +36,10 @@ impl AsCairoFormat for BaseProcessedStorage { pub struct ProcessedStorage { // chunked address #[serde_as(as = "Vec")] - pub address: Vec, + pub address: Vec, // chunked storage slot #[serde_as(as = "Vec")] - pub slot: Vec, + pub slot: Vec, pub storage_key: StorageKey, pub proofs: Vec, } diff --git a/hdp/src/primitives/processed_types/cairo_format/transaction.rs b/hdp/src/primitives/processed_types/cairo_format/transaction.rs index 2a32578b..80bec172 100644 --- a/hdp/src/primitives/processed_types/cairo_format/transaction.rs +++ b/hdp/src/primitives/processed_types/cairo_format/transaction.rs @@ -5,7 +5,7 @@ use crate::primitives::processed_types::transaction::ProcessedTransaction as Bas use serde::{Deserialize, Serialize}; use serde_with::serde_as; use starknet::core::serde::unsigned_field_element::UfeHex; -use starknet_crypto::FieldElement; +use starknet_types_core::felt::Felt; impl AsCairoFormat for BaseProcessedTransaction { type Output = ProcessedTransaction; @@ -19,8 +19,7 @@ impl AsCairoFormat for BaseProcessedTransaction { .collect(); let proof_bytes_len = proof_felts.iter().map(|f| f.bytes_len).collect(); - let proof_result: Vec> = - proof_felts.iter().map(|f| f.felts.clone()).collect(); + let proof_result: Vec> = proof_felts.iter().map(|f| f.felts.clone()).collect(); ProcessedTransaction { key, block_number: self.block_number, @@ -38,7 +37,7 @@ pub struct ProcessedTransaction { /// proof_bytes_len is the byte( 8 bit ) length from each proof string pub proof_bytes_len: Vec, #[serde_as(as = "Vec>")] - pub proof: Vec>, + pub proof: Vec>, } #[cfg(test)] diff --git a/hdp/src/primitives/processed_types/uint256.rs b/hdp/src/primitives/processed_types/uint256.rs index 3099417e..2fde866a 100644 --- a/hdp/src/primitives/processed_types/uint256.rs +++ b/hdp/src/primitives/processed_types/uint256.rs @@ -1,27 +1,26 @@ //! This module contains the `Uint256` type, which is a 256-bit unsigned integer. //! This is compatible with Cairo `uint256` type. +use crate::primitives::utils::bytes_to_hex_string; use alloy::primitives::{hex::FromHex, B256, U256}; use anyhow::Result; use core::fmt::Display; use serde::{Deserialize, Serialize}; use serde_with::serde_as; use starknet::core::serde::unsigned_field_element::UfeHex; -use starknet_crypto::FieldElement; +use starknet_types_core::felt::Felt; use std::str::FromStr; -use crate::primitives::utils::bytes_to_hex_string; - /// [`Uint256`] represents a 256-bit unsigned integer. -/// It is implemented as a struct with two [`FieldElement`] values: `high` and `low`. -/// Each [`FieldElement`] represents 128 bits of the 256-bit integer. +/// It is implemented as a struct with two [`Felt`] values: `high` and `low`. +/// Each [`Felt`] represents 128 bits of the 256-bit integer. #[serde_as] #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Eq, Hash)] pub struct Uint256 { #[serde_as(as = "UfeHex")] - pub low: FieldElement, // Represents the least significant 128 bits + pub low: Felt, // Represents the least significant 128 bits #[serde_as(as = "UfeHex")] - pub high: FieldElement, // Represents the most significant 128 bits + pub high: Felt, // Represents the most significant 128 bits } impl Default for Uint256 { @@ -34,8 +33,8 @@ impl Default for Uint256 { impl Uint256 { /// Constant representing zero as a `Uint256`. pub const ZERO: Self = Self { - high: FieldElement::ZERO, - low: FieldElement::ZERO, + high: Felt::ZERO, + low: Felt::ZERO, }; /// Creates a `Uint256` from two byte slices representing the high and low parts. @@ -48,8 +47,8 @@ impl Uint256 { /// A `Result` containing the new `Uint256` or an error if conversion fails. pub fn from_bytes_tuple(high: &[u8], low: &[u8]) -> Result { Ok(Self { - high: FieldElement::from_byte_slice_be(high)?, - low: FieldElement::from_byte_slice_be(low)?, + high: Felt::from_bytes_be_slice(high), + low: Felt::from_bytes_be_slice(low), }) } @@ -63,20 +62,20 @@ impl Uint256 { /// A `Result` containing the new `Uint256` or an error if conversion fails. pub fn from_hex_tuple(high: &str, low: &str) -> Result { Ok(Self { - high: FieldElement::from_hex_be(high)?, - low: FieldElement::from_hex_be(low)?, + high: Felt::from_hex(high)?, + low: Felt::from_hex(low)?, }) } - /// Creates a `Uint256` from two [`FieldElement`]s representing the high and low parts. + /// Creates a `Uint256` from two [`Felt`]s representing the high and low parts. /// /// # Arguments - /// * `high` - A `FieldElement` representing the most significant 128 bits - /// * `low` - A `FieldElement` representing the least significant 128 bits + /// * `high` - A `Felt` representing the most significant 128 bits + /// * `low` - A `Felt` representing the least significant 128 bits /// /// # Returns /// A new `Uint256` instance. - pub fn from_field_element_tuple(high: FieldElement, low: FieldElement) -> Self { + pub fn from_field_element_tuple(high: Felt, low: Felt) -> Self { Self { high, low } } @@ -96,8 +95,8 @@ impl Uint256 { let low_part = fix_hex[16..].to_vec(); Ok(Self { - high: FieldElement::from_hex_be(&bytes_to_hex_string(&high_part))?, - low: FieldElement::from_hex_be(&bytes_to_hex_string(&low_part))?, + high: Felt::from_hex(&bytes_to_hex_string(&high_part))?, + low: Felt::from_hex(&bytes_to_hex_string(&low_part))?, }) } @@ -113,8 +112,8 @@ impl Uint256 { let padded_hex = format!("{:0>64}", clean_hex); let (high_part, low_part) = padded_hex.split_at(32); Ok(Self { - high: FieldElement::from_hex_be(&format!("0x{}", high_part))?, - low: FieldElement::from_hex_be(&format!("0x{}", low_part))?, + high: Felt::from_hex(&format!("0x{}", high_part))?, + low: Felt::from_hex(&format!("0x{}", low_part))?, }) } @@ -130,8 +129,8 @@ impl Uint256 { let low_part = bytes[16..].to_vec(); Ok(Self { - high: FieldElement::from_hex_be(&bytes_to_hex_string(&high_part))?, - low: FieldElement::from_hex_be(&bytes_to_hex_string(&low_part))?, + high: Felt::from_hex(&bytes_to_hex_string(&high_part))?, + low: Felt::from_hex(&bytes_to_hex_string(&low_part))?, }) } } diff --git a/hdp/src/primitives/solidity_types/module.rs b/hdp/src/primitives/solidity_types/module.rs index dc54a964..0916e8d0 100644 --- a/hdp/src/primitives/solidity_types/module.rs +++ b/hdp/src/primitives/solidity_types/module.rs @@ -35,7 +35,7 @@ impl Module { #[cfg(test)] mod tests { use alloy::primitives::b256; - use starknet_crypto::FieldElement; + use starknet_crypto::Felt; use crate::primitives::task::module::{ModuleInput, Visibility}; @@ -44,7 +44,7 @@ mod tests { #[test] pub fn module_encode() { let module = Module { - program_hash: FieldElement::from_hex_be( + program_hash: Felt::from_hex( "0x00af1333b8346c1ac941efe380f3122a71c1f7cbad19301543712e74f765bfca", ) .unwrap(), @@ -69,7 +69,7 @@ mod tests { #[test] pub fn module_encode_with_private_input() { let module = Module { - program_hash: FieldElement::from_hex_be( + program_hash: Felt::from_hex( "0x00af1333b8346c1ac941efe380f3122a71c1f7cbad19301543712e74f765bfca", ) .unwrap(), diff --git a/hdp/src/primitives/task/module.rs b/hdp/src/primitives/task/module.rs index a3276b9d..1e96b9ef 100644 --- a/hdp/src/primitives/task/module.rs +++ b/hdp/src/primitives/task/module.rs @@ -5,7 +5,7 @@ use serde::{Deserialize, Serialize}; use serde_with::serde_as; use starknet::core::serde::unsigned_field_element::UfeHex; -use starknet_crypto::FieldElement; +use starknet_types_core::felt::Felt; use std::{path::PathBuf, str::FromStr}; #[serde_as] @@ -14,7 +14,7 @@ use std::{path::PathBuf, str::FromStr}; pub struct Module { /// Note that this program_hash is pure cairo program hash #[serde_as(as = "UfeHex")] - pub program_hash: FieldElement, + pub program_hash: Felt, pub inputs: Vec, pub local_class_path: Option, } @@ -24,15 +24,14 @@ pub struct Module { pub struct ModuleInput { pub visibility: Visibility, #[serde_as(as = "UfeHex")] - pub value: FieldElement, + pub value: Felt, } impl ModuleInput { pub fn new(visibility: Visibility, value: &str) -> Self { Self { visibility, - value: FieldElement::from_hex_be(value) - .expect("invalid hex string value to convert FieldElement"), + value: Felt::from_hex(value).expect("invalid hex string value to convert Felt"), } } } @@ -72,7 +71,7 @@ impl From for ModuleInput { impl Module { pub fn new( - program_hash: FieldElement, + program_hash: Felt, inputs: Vec, local_class_path: Option, ) -> Self { @@ -83,7 +82,7 @@ impl Module { } } - pub fn get_program_hash(&self) -> FieldElement { + pub fn get_program_hash(&self) -> Felt { self.program_hash } @@ -92,7 +91,7 @@ impl Module { } /// Collect all the public inputs - pub fn get_public_inputs(&self) -> Vec { + pub fn get_public_inputs(&self) -> Vec { self.inputs .iter() .filter(|x| x.visibility == Visibility::Public) @@ -112,7 +111,7 @@ mod tests { assert_eq!( module, ModuleInput { - value: FieldElement::from_hex_be("0x123").unwrap(), + value: Felt::from_hex("0x123").unwrap(), visibility: Visibility::Public } ); @@ -122,7 +121,7 @@ mod tests { assert_eq!( module, ModuleInput { - value: FieldElement::from_hex_be("0x1").unwrap(), + value: Felt::from_hex("0x1").unwrap(), visibility: Visibility::Private } ); diff --git a/hdp/src/primitives/utils.rs b/hdp/src/primitives/utils.rs index 63550493..446cf7f8 100644 --- a/hdp/src/primitives/utils.rs +++ b/hdp/src/primitives/utils.rs @@ -1,7 +1,7 @@ use alloy::primitives::hex::{self}; use alloy::primitives::{FixedBytes, B256, U256}; use anyhow::Result; -use starknet_crypto::FieldElement; +use starknet_crypto::Felt; /// Convert a `FixedBytes<32>` which originally encoded from utf8 string into original utf8 string value pub fn fixed_bytes_str_to_utf8_str(input_bytes: FixedBytes<32>) -> Result { @@ -46,8 +46,8 @@ pub fn tx_index_to_tx_key(tx_index: u64) -> String { format!("0x{}", hex::encode(binding)) } -/// Convert a `FieldElement` into a `FixedBytes<32>` -pub fn felt_to_bytes32(felt: FieldElement) -> FixedBytes<32> { +/// Convert a [`Felt`] into a [`FixedBytes<32>` +pub fn felt_to_bytes32(felt: Felt) -> FixedBytes<32> { let felt_bytes = felt.to_bytes_be(); B256::from(felt_bytes) } @@ -60,7 +60,6 @@ pub fn hex_string_to_uint(hex_string: &str) -> u64 { #[cfg(test)] mod tests { - use std::str::FromStr; use super::*; use alloy::primitives::{hex::FromHex, FixedBytes}; @@ -141,10 +140,9 @@ mod tests { #[test] fn test_felt_to_bytes32() { - let felt = FieldElement::from_str( - "0x034d4ff54bc5c6cfee6719bfaa94ffa374071e8d656b74823681a955e9033dd9", - ) - .unwrap(); + let felt = + Felt::from_hex("0x034d4ff54bc5c6cfee6719bfaa94ffa374071e8d656b74823681a955e9033dd9") + .unwrap(); let bytes32 = felt_to_bytes32(felt); assert_eq!(bytes32, felt.to_bytes_be()); } From aca40fdb168480581d8eb09544738b744e1ce795 Mon Sep 17 00:00:00 2001 From: Pia Date: Tue, 1 Oct 2024 12:06:40 -0700 Subject: [PATCH 29/29] chore: env, cli --- .env.example | 8 +- batch.json | 41 +++++++++ cli/src/cli.rs | 2 +- cli/src/commands/run.rs | 4 +- hdp/src/hdp_run.rs | 52 +++++------ hdp/src/provider/config.rs | 6 +- hdp/src/provider/evm/provider.rs | 4 +- hdp/src/provider/starknet/provider.rs | 2 +- input.json | 121 ++++++++++++++++++++++++++ request.json | 43 +++------ 10 files changed, 213 insertions(+), 70 deletions(-) create mode 100644 batch.json create mode 100644 input.json diff --git a/.env.example b/.env.example index cf06a8d3..a46ffb1c 100644 --- a/.env.example +++ b/.env.example @@ -1,9 +1,9 @@ -# Note that RPC_URL_{CHAIN_ID} is required for fetch data -RPC_URL_ETHEREUM_SEPOLIA=https://goerli.infura.io/v3/your-infura-api-key +# Note that PROVIDER_URL_{CHAIN_ID} is required for fetch data +PROVIDER_URL_ETHEREUM_SEPOLIA=https://goerli.infura.io/v3/your-infura-api-key # this value is optional -RPC_CHUNK_SIZE_ETHEREUM_SEPOLIA=2000 +PROVIDER_CHUNK_SIZE_ETHEREUM_SEPOLIA=2000 -RPC_URL_STARKNET_SEPOLIA=# if it's starknet make sure to use pathfinder +PROVIDER_URL_STARKNET_SEPOLIA=# if it's starknet make sure to use pathfinder # Optional DRY_RUN_CAIRO_PATH= # path for dry run cairo diff --git a/batch.json b/batch.json new file mode 100644 index 00000000..0f6e15f4 --- /dev/null +++ b/batch.json @@ -0,0 +1,41 @@ +{ + "raw_results": [ + "0x000000000000000000000000000000000000000000000000000012309ce54000" + ], + "results_commitments": [ + "0xfe22879bf0cec62207a65426fd87f413f75880825b5bdc3e57cb343e9ca42c99" + ], + "tasks_commitments": [ + "0xa9420109bac8cb6b5e8e1e92120dc4d15abc6915024ed2e8d8e0c427d91e1e91" + ], + "task_inclusion_proofs": [ + [] + ], + "results_inclusion_proofs": [ + [] + ], + "results_root": "0x6b2b1f8a44a9a263aaab7dc8456d03ec2365c535f6e34d249992dcf10c2c9009", + "tasks_root": "0x914cb49c66560929b7c2d89cb61a01af234eb6317bd8fcfa3215979cd8479484", + "mmr_metas": [ + { + "id": 27, + "root": "0x492627ffa5084ec078f4d461408dfaa50b504a022c5471452d598da0040c066", + "size": 13024091, + "peaks": [ + "0x262c4c9b1cb2a036924aecf563dc9952e5f8b41004310adde86f22abb793eb1", + "0x10b39aed56c8f244a1df559c944ada6f12b7238f8c06a2c243ba4276b8059b0", + "0x46f45f218ea3aec481f350cda528a6f9f926a2dd53dae302e2cb610e5f152c7", + "0x1d52a06e6d02569893a1d842c00bb67c044be541c614e88613d7fc7187e18c1", + "0x770ebf618a589c17e3dc05bda7121acbedc0b48cd25f2943dc43f395f8bf0db", + "0x7263e878f7deafdc49b47da57f8594d477e572d3ac2bec27bb73860a35b1899", + "0x7b9e99f008949f9ee33d2965708ac6773a57965514df6383d55de104a39ab8c", + "0x28f6ccdcd38f6be6c437d100fcd62604c3293e31342a777dc37c712869ab08c", + "0x13d87197fe5d6f646a57dc918dcbef210737020dca9b89537fd8718ac69da3e", + "0x7eef4b790b56858c0232b494034d4c8699112d88f358209f71f02d5e93a7084", + "0x25cd2f0b579c902c41ac26df96ed5b21e16a3127dce2b471973dc86eb4c099f", + "0x5fdedfd0123b7461d5b3162fe82f7f3172c42fda6209415367870086f7c7918", + "0x7c0a415d5a6c4c90fd2dde1b340c3be305a72aa3b758dd26b8d7b4a78b53681" + ] + } + ] +} \ No newline at end of file diff --git a/cli/src/cli.rs b/cli/src/cli.rs index 3ee0a053..bd63c234 100644 --- a/cli/src/cli.rs +++ b/cli/src/cli.rs @@ -176,7 +176,7 @@ pub async fn entry_run(args: RunArgs) -> Result<()> { args.dry_run_cairo_file, args.sound_run_cairo_file, args.program_input_file, - args.cairo_format, + args.not_cairo_format, None, args.batch_proof_file, args.cairo_pie_file, diff --git a/cli/src/commands/run.rs b/cli/src/commands/run.rs index 43ba9356..a3a2ca3e 100644 --- a/cli/src/commands/run.rs +++ b/cli/src/commands/run.rs @@ -21,8 +21,8 @@ pub struct RunArgs { /// Set this boolean to true to generate cairo format program_input_file /// /// By default, program_input_file is generated in cairo format. If you dont want, set this to false. - #[arg(long, default_value_t = true)] - pub cairo_format: bool, + #[arg(long, default_value_t = false)] + pub not_cairo_format: bool, /// Path to save batch proof file after pre-processing. /// diff --git a/hdp/src/hdp_run.rs b/hdp/src/hdp_run.rs index 897359aa..1489e6de 100644 --- a/hdp/src/hdp_run.rs +++ b/hdp/src/hdp_run.rs @@ -19,7 +19,7 @@ pub struct HdpRunConfig { pub dry_run_program_path: PathBuf, pub sound_run_program_path: PathBuf, pub program_input_file: PathBuf, - pub is_cairo_format: bool, + pub is_not_cairo_format: bool, pub batch_proof_file: Option, pub cairo_pie_file: Option, pub save_fetch_keys_file: Option, @@ -33,7 +33,7 @@ impl Default for HdpRunConfig { dry_run_program_path: DEFAULT_DRY_CAIRO_RUN_CAIRO_FILE.into(), sound_run_program_path: DEFAULT_SOUND_CAIRO_RUN_CAIRO_FILE.into(), program_input_file: "program_input.json".into(), - is_cairo_format: false, + is_not_cairo_format: false, cairo_pie_file: None, batch_proof_file: None, save_fetch_keys_file: None, @@ -46,23 +46,23 @@ impl HdpRunConfig { cli_dry_run_cairo_file: Option, cli_sound_run_cairo_file: Option, program_input_file: PathBuf, - cli_is_cairo_format: bool, + cli_is_not_cairo_format: bool, cli_save_fetch_keys_file: Option, batch_proof_file: Option, cli_cairo_pie_file: Option, ) -> Self { let mut provider_config = HashMap::new(); - // Iterate through environment variables to find RPC_URL and RPC_CHUNK_SIZE configurations + // Iterate through environment variables to find PROVIDER_URL and PROVIDER_CHUNK_SIZE configurations for (key, value) in env::vars() { - if let Some(stripped_chain_id) = key.strip_prefix("RPC_URL_") { + if let Some(stripped_chain_id) = key.strip_prefix("PROVIDER_URL_") { let chain_id: ChainId = stripped_chain_id .parse() - .expect("Invalid chain ID in RPC_URL env var"); - let rpc_url: Url = value.parse().expect("Invalid URL in RPC_URL env var"); + .expect("Invalid chain ID in PROVIDER_URL env var"); + let provider_url: Url = value.parse().expect("Invalid URL in PROVIDER_URL env var"); - let chunk_size_key = format!("RPC_CHUNK_SIZE_{}", chain_id); - let rpc_chunk_size: u64 = env::var(&chunk_size_key) + let chunk_size_key = format!("PROVIDER_CHUNK_SIZE_{}", chain_id); + let provider_chunk_size: u64 = env::var(&chunk_size_key) .unwrap_or_else(|_| "40".to_string()) .parse() .unwrap_or_else(|_| panic!("{} must be a number", chunk_size_key)); @@ -70,9 +70,9 @@ impl HdpRunConfig { provider_config.insert( chain_id, ProviderConfig { - rpc_url, + provider_url, chain_id, - max_requests: rpc_chunk_size, + max_requests: provider_chunk_size, }, ); } @@ -98,7 +98,7 @@ impl HdpRunConfig { dry_run_program_path: dry_run_cairo_path, sound_run_program_path: sound_run_cairo_path, program_input_file, - is_cairo_format: cli_is_cairo_format, + is_not_cairo_format: cli_is_not_cairo_format, save_fetch_keys_file, batch_proof_file, cairo_pie_file: cli_cairo_pie_file, @@ -125,10 +125,10 @@ pub async fn run(hdp_run_config: &HdpRunConfig, tasks: Vec) -> Res let preprocessor = PreProcessor::new_with_config(compiler_config); let preprocessor_result = preprocessor.process(tasks).await?; - let input_string = match hdp_run_config.is_cairo_format { - true => serde_json::to_string_pretty(&preprocessor_result.as_cairo_format()) + let input_string = match hdp_run_config.is_not_cairo_format { + false => serde_json::to_string_pretty(&preprocessor_result.as_cairo_format()) .map_err(|e| anyhow::anyhow!("Failed to serialize preprocessor result: {}", e))?, - false => serde_json::to_string_pretty(&preprocessor_result) + true => serde_json::to_string_pretty(&preprocessor_result) .map_err(|e| anyhow::anyhow!("Failed to serialize preprocessor result: {}", e))?, }; @@ -186,10 +186,10 @@ mod tests { #[test] fn test_hdp_run_config_init_with_env() { // Set up environment variables - env::set_var("RPC_URL_ETHEREUM_MAINNET", "https://example.com/rpc1"); - env::set_var("RPC_CHUNK_SIZE_ETHEREUM_MAINNET", "50"); - env::set_var("RPC_URL_STARKNET_MAINNET", "https://example.com/rpc2"); - env::set_var("RPC_CHUNK_SIZE_STARKNET_MAINNET", "60"); + env::set_var("PROVIDER_URL_ETHEREUM_MAINNET", "https://example.com/rpc1"); + env::set_var("PROVIDER_CHUNK_SIZE_ETHEREUM_MAINNET", "50"); + env::set_var("PROVIDER_URL_STARKNET_MAINNET", "https://example.com/rpc2"); + env::set_var("PROVIDER_CHUNK_SIZE_STARKNET_MAINNET", "60"); env::set_var("DRY_RUN_CAIRO_PATH", "/path/to/dry_run.cairo"); env::set_var("SOUND_RUN_CAIRO_PATH", "/path/to/sound_run.cairo"); env::set_var("SAVE_FETCH_KEYS_FILE", "/path/to/save_fetch_keys.json"); @@ -219,7 +219,7 @@ mod tests { .get(&ChainId::EthereumMainnet) .unwrap(); assert_eq!( - provider_config_1.rpc_url.to_string(), + provider_config_1.provider_url.to_string(), "https://example.com/rpc1" ); assert_eq!(provider_config_1.max_requests, 50); @@ -229,7 +229,7 @@ mod tests { .get(&ChainId::StarknetMainnet) .unwrap(); assert_eq!( - provider_config_2.rpc_url.to_string(), + provider_config_2.provider_url.to_string(), "https://example.com/rpc2" ); assert_eq!(provider_config_2.max_requests, 60); @@ -244,7 +244,7 @@ mod tests { PathBuf::from("/path/to/sound_run.cairo") ); assert_eq!(config.program_input_file, PathBuf::from("input.json")); - assert!(!config.is_cairo_format); + assert!(!config.is_not_cairo_format); assert_eq!( config.save_fetch_keys_file, Some(PathBuf::from("/path/to/save_fetch_keys.json")) @@ -253,10 +253,10 @@ mod tests { assert_eq!(config.cairo_pie_file, None); // Clean up environment variables - env::remove_var("RPC_URL_1"); - env::remove_var("RPC_CHUNK_SIZE_1"); - env::remove_var("RPC_URL_2"); - env::remove_var("RPC_CHUNK_SIZE_2"); + env::remove_var("PROVIDER_URL_1"); + env::remove_var("PROVIDER_CHUNK_SIZE_1"); + env::remove_var("PROVIDER_URL_2"); + env::remove_var("PROVIDER_CHUNK_SIZE_2"); env::remove_var("DRY_RUN_CAIRO_PATH"); env::remove_var("SOUND_RUN_CAIRO_PATH"); env::remove_var("SAVE_FETCH_KEYS_FILE"); diff --git a/hdp/src/provider/config.rs b/hdp/src/provider/config.rs index cd2bac0e..e76a1988 100644 --- a/hdp/src/provider/config.rs +++ b/hdp/src/provider/config.rs @@ -5,8 +5,8 @@ use crate::primitives::ChainId; /// EVM provider configuration #[derive(Clone, Debug)] pub struct ProviderConfig { - /// RPC url - pub rpc_url: Url, + /// provider url + pub provider_url: Url, /// Chain id pub chain_id: ChainId, /// Max number of requests to send in parallel @@ -27,7 +27,7 @@ const TEST_RPC_URL: &str = "https://eth-sepolia.g.alchemy.com/v2/xar76cftwEtqTBW impl Default for ProviderConfig { fn default() -> Self { Self { - rpc_url: TEST_RPC_URL.parse().unwrap(), + provider_url: TEST_RPC_URL.parse().unwrap(), chain_id: ChainId::EthereumSepolia, max_requests: TEST_MAX_REQUESTS, } diff --git a/hdp/src/provider/evm/provider.rs b/hdp/src/provider/evm/provider.rs index 385221b8..e8827ecb 100644 --- a/hdp/src/provider/evm/provider.rs +++ b/hdp/src/provider/evm/provider.rs @@ -62,13 +62,13 @@ impl Default for EvmProvider { impl EvmProvider { pub fn new(config: &ProviderConfig) -> Self { - let rpc_provider = RpcProvider::new(config.rpc_url.clone(), config.max_requests); + let rpc_provider = RpcProvider::new(config.provider_url.clone(), config.max_requests); let header_provider = Indexer::new(config.chain_id); Self { rpc_provider, header_provider, - tx_provider_url: config.rpc_url.clone(), + tx_provider_url: config.provider_url.clone(), } } diff --git a/hdp/src/provider/starknet/provider.rs b/hdp/src/provider/starknet/provider.rs index 7b03d600..d9fbdf45 100644 --- a/hdp/src/provider/starknet/provider.rs +++ b/hdp/src/provider/starknet/provider.rs @@ -29,7 +29,7 @@ impl Default for StarknetProvider { impl StarknetProvider { pub fn new(config: &ProviderConfig) -> Self { - let rpc_provider = RpcProvider::new(config.rpc_url.to_owned(), config.max_requests); + let rpc_provider = RpcProvider::new(config.provider_url.to_owned(), config.max_requests); let indexer = Indexer::new(config.chain_id); Self { rpc_provider, diff --git a/input.json b/input.json new file mode 100644 index 00000000..d2908917 --- /dev/null +++ b/input.json @@ -0,0 +1,121 @@ +{ + "cairo_run_output_path": "cairo_run_output.json", + "tasks_root": "0x914cb49c66560929b7c2d89cb61a01af234eb6317bd8fcfa3215979cd8479484", + "results_root": "0x6b2b1f8a44a9a263aaab7dc8456d03ec2365c535f6e34d249992dcf10c2c9009", + "proofs": [ + { + "chain_id": 11155111, + "mmr_with_headers": [ + { + "mmr_meta": { + "id": 27, + "root": "0x492627ffa5084ec078f4d461408dfaa50b504a022c5471452d598da0040c066", + "size": 13024091, + "peaks": [ + "0x262c4c9b1cb2a036924aecf563dc9952e5f8b41004310adde86f22abb793eb1", + "0x10b39aed56c8f244a1df559c944ada6f12b7238f8c06a2c243ba4276b8059b0", + "0x46f45f218ea3aec481f350cda528a6f9f926a2dd53dae302e2cb610e5f152c7", + "0x1d52a06e6d02569893a1d842c00bb67c044be541c614e88613d7fc7187e18c1", + "0x770ebf618a589c17e3dc05bda7121acbedc0b48cd25f2943dc43f395f8bf0db", + "0x7263e878f7deafdc49b47da57f8594d477e572d3ac2bec27bb73860a35b1899", + "0x7b9e99f008949f9ee33d2965708ac6773a57965514df6383d55de104a39ab8c", + "0x28f6ccdcd38f6be6c437d100fcd62604c3293e31342a777dc37c712869ab08c", + "0x13d87197fe5d6f646a57dc918dcbef210737020dca9b89537fd8718ac69da3e", + "0x7eef4b790b56858c0232b494034d4c8699112d88f358209f71f02d5e93a7084", + "0x25cd2f0b579c902c41ac26df96ed5b21e16a3127dce2b471973dc86eb4c099f", + "0x5fdedfd0123b7461d5b3162fe82f7f3172c42fda6209415367870086f7c7918", + "0x7c0a415d5a6c4c90fd2dde1b340c3be305a72aa3b758dd26b8d7b4a78b53681" + ] + }, + "headers": [ + { + "rlp": "f90264a0d0dbb039df7728af964ecc414930adaf57c762df78e7818c5e29bdaf98bc30a6a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000006916a87b82333f4245046623b23794c65ca0fe5710ac36eae31f8fd741ec4646295805efde7d5af87f75b6c9f3b478264c03a02351a6bd671aa027fb78d3bfb0e154fe86a39b64050eb9260fae4ae4e9f39488a04432f18e1b2ff54ce5296d462ae0586a71641906412c7e600780953edd1e8c48b901008804404e86016c08119966222d18870c08157b050006544441c05a76c6e28418045100622128069e4936248c041c089a1001130e2a26990416997904927c6491d162d2c30c2f0b08421e806a2438c885562f2b033806657b78228a48802072a3ab2400c2a6212152054c0675708adb824c8800c6511a76e40268a87d00300b64aa46c9949b614428ec20b4d7572247b012914ea7682c14fc030bbcb825c4e881620a04b7ea04ce56480682102200452c00d826a7a04a8d5a49a10036170b4096e12ed52304215a1090210d95ac1654140f600315a14a500e32059106d86162a112123280c0b0200a82062042a0842317040880f06b742256602012b3197d502c808356152c8401c9c38084013ca856846611559099d883010d0d846765746888676f312e32322e30856c696e7578a0a03574c090365f7581fd16fd2144c0de59d64c03bcbfc761ad3cb0e8c567cb438800000000000000008308e316a0c6d2ec3bda594dc497c3092ca167e4449c1b6747a076c8849bcd351add59e68e830600008405240000a07625dff7a19154e26778df000ae2e3de826d28a60f749e453e3ded6e367eeed4", + "proof": { + "leaf_idx": 610913, + "mmr_path": [ + "0x67bb6da1531c91c2b51b54b9bcb0fe93321ceecadacd47cdc45805138aa0c0f", + "0x18415c3a306222178570cab74cd5e8db1a935dfb86e839202392a1c7dee60c9", + "0x6c5135cd9037d88377e346ca8882e6876bc7b5945fa931e16f5eb3946ead75c", + "0x7d7300fdfc4c65dc059dae89bdfd6e731b5fc062180f15b45febd1255854b36", + "0x252be25930f8949bb4fd8b43e0266ed3a28b41a6c0d3e81867ee0c89ee4ac7d", + "0x52010174d874a9c7eba65a4ea897880ddd088d31293707a39602cd2d3f706f4", + "0x7eb952b3bd5405896ee1deb4949358d7552e79048fc10d53aba5ee648bd56f7", + "0x0f5476cde3c3e21ed03cc5d11b18b30fa7d2c7559bb0fb2ccdb83221eaee608", + "0x1d7cf65ee48d755009128bb883ea61807f7575452cd4dcf4082711518dac515", + "0x6f92dd6c8b9be832f6aef1211e932d8171c813c97d005383e5b82135721d5b7", + "0x42784e988bfd6911b429213d5b33ea9bdc345ac7659dc77f7e0d034b22237ce", + "0x24fc37f1e0a37d80b67d170b4e3448a0acee5ce2aa7fc43f694946173974854", + "0x4878d7b06f8232c5967ec8e922391b3f35c673a30242d3713f64dc47fe7e938", + "0x31fa2b3c9cd30abaea46699f13d0aaf206e757cfc8ac4bd1712df615a6a4d3b", + "0x5fabc7c3150eab1aab7351dcd43da933b60d054f7cbcf53695793e9ffe72c6e", + "0x742a60a5320bd43a962089f6e070f4a34ef848a2b7ae6fab2508942de5e3d8f", + "0x0b9dbeee6951197b79802d726e108d2e456ac0ccb7100ebe4c11a8e1dedc738", + "0x611e7980af5de71d4221bf6f49c40e9decdcc6ca953f06d23479202cc83b1c6", + "0x773c94cdebd60f0647c690c7379e603dacb0dc712ad8551c0445cef9f1811cd", + "0x59bbae3d1cfd74546dfe68c264341cee9f95c3b3b61eeacead3bd4cb3ae232a", + "0x546455f57f4ee848d3952148e3b94700f387ee2c36730bfeda09379ce8fa509", + "0x08808a106dc9e09c29afd24be7cee31edd9f0d27ce0a3469839ef3d09ddfb43" + ] + } + } + ] + } + ], + "accounts": [ + { + "address": "0x75cec1db9dceb703200eaa6595f66885c962b920", + "account_key": "0x962f445fc8476432660877b666f653759ea69189b60d2f4a7008e70555746ad1", + "proofs": [ + { + "block_number": 5641516, + "proof": [ + "0xf90211a0dcbd475dd9c177f568ddcdc319c6397b522f9f0477f02c6f5d40f9a676d72817a00bd4f5aa23dff4b6bc82a30b7f06e299a4190e5dc145de56ebccf7b392187a09a0d61af80cd5cb39dc63864ca43eece1e0c75f3921a897e76d9749aebc53c3df8aa0864c73b1fcb6c20c7a3dc987b995a197d3970a60776b69fe86d2e8e47ea94c34a07a968065710e1a0487b9ba027fe8b4e75c48f808fa4df0e8b2e790d68af1c7a1a0415df25f69223af7620a8ae632dd96f0a266de38c7669450ccc1266e6d9f28e1a0169b43699e8685d580bf8544569306755efd3faf8ee9c573d8fc3b765716dff2a04fbb7e84242d6ebc993d1722bd4da3c8f7933c2197dc7e004029d5ecac5472dea00598724879d324152dba334b881e3ec51ab434b0f5160e501f27e41eb081a9faa0b80e76258879b1cc1553ca8fecaa7156a4bbeeae3a46e48af60f16c78b08dcc4a0cc4d6c7a08755dc1a1deeed0705ab80e722b5c26f49484052021c9afcc9f0c8da0e16df8444c1c2b049779688485f147f62074c3f74b3af089c4eda8dd71e45b77a0f3963f892598d2d4c58dc1b26ecc22670f9d6456e36682e63c10f28a6d17c19ea08e0108cf433e3125ac5e6a175171a410f4f16f3fec51752a27b6f0d32d00027fa06142d171f73708046ddc01d7a1303d875ade53e4b354a314ef031bfb2d35374ca093fb99dbe11b40160a862e9c654f6374f6e5c9e24685488a262df35175c83a8780", + "0xf90211a085874b8d020224e2ef3bd88570ab5c06d45decde1754f26c8d4d8008e0ccd113a003db289fe33b3b8d8c26b21562e42c050d680960ec99ef5bb315c1d636fa46eca013df832fe4094fa9df8f7a13beb8babb9874ec04c11cf0d170ad2b55869314e4a027760fd8d42862a7c2709031af97c6b34b7ad73af02bf7e0e8573da746e5d672a0e5e42a2564de948a79a3584e601c523f2a8d2f63fab6285d58a76ada5b7a94caa0b280c353d94aa1b0a94da9a2c27766cfe15dbf0299aaa0647e24dabd80e42f81a0ed48ca0484a3345f1e84d2f8a7a0d1e8549ff231ff6bffd9a46d6c0d0ab3683ca0635a725706435ff7c28ac67e918a077147acc3a8272989e2f565c00cfe49900aa09813dfd235a1906b75234a4ea7c0a2537bdc6297ece7628f10b92df4f38fccf0a09a1fec84542b2b2ea02e9f664a30b970043ff2ce93db423bc8e671db2acc5942a0e6459861abcab3d672bacfbcd0038cbaf48c2db6ff6168ebc5f32a024ae9414ea0e5da62361bea1124afcfc1908b58ba4171a2ecb9041500df3564eadfae0865c0a01d0ec6d9747a31adac893f02d7dd9e4d4de50423a758a5d0e9005d3c5a4f4e5aa04fbeca911091ce452276d951fa5d75d202c3c39bd8cad76100d40cc192382e4aa0ed06eb4338923d982930fd9ef71f51124e281f3db032094bee2e171ea5c95c69a02574cb976bb8877c1d22451852f470c0561a30ccb0a9f0b4de060d943f25a77a80", + "0xf90211a0084de79b5e883c52b17995d2e0acc42672f5c655d6af15eefa49383cfeff7f4fa0445910a988ca4f62953b07a03032d4018c686160c48bbcd8b4a90dd69fbde0cda05577225cb64372d7e288773beab518921e402946977279f6ea43f0cc01b134cba0280baa1097cec29878b9f6e3ddd7b6e941d66aa1ae68188e377530f2816a87c2a0c4ff1b28e2f879ec95e217d623e1e7e9a862540306b1702e1b90df84e72c8af9a0c82365017d560783befa31d24472e2239ee9f07c2c96e531e3b71d29834dd87ba08c6c2ce740933f17d0e50730c4a90ce1c44127c0c95fa2668a8177a4cb636130a03c39ea857e88d2038809d04bdd720599f88d713a0749e6fc4aae0c868e4db3a0a028249731b03a575f0676c649411a88cf93684e2990fa3ba3f922df5937fd0239a0d730b73f1924349103f07d7675f031799894108625ad258ab906359f1b45f071a0c9272cb00358e0272f80667ae90348ec7a655df30692e5410ff3cdfdd0c74f04a015b2a43f4ec90d5870821683cf4a2cdc935e6061cc6465ae459682715f9fdea9a09bd6271ddf98dbb976d85e8fdf0c8fef73377a4cb0e312f7a6e17227d0614040a0c772ab406ca4b22d2d25d9fc2e8969b02d1699cafdcacf8a1a44ddb0505019e8a061683a17e7cb9118d7d9083260df11b5d2b4a05986c5b0423a4940bf58c6c2bfa0368010c59a191f3867c91195be126b12cd3a264ae66b3ff235b827c42bc5a37f80", + "0xf90211a030d16cf8968685e1fe09ecb3512a4693214b06516219522769f5a3bd61b37be0a023ef708630714cf8f1e3f3976be52a5466e4a98499a53ff82601b58ec5757063a0ac9c8d3c1e7a5161fef97bea92515a17ac26e44fd2378921482c106756a800ada0db27b9f7fc9979b2668c32c5c0248198417a4149310f872cd056b4872e59318ca042457bb6d51d099607184742c05e63595f2560f1e19074e2d85057c30a5eef90a09cce0b54c3a682f7fb3f8cff6c8f3ec26db4dc374ef5fd2e264dd1a65e18d75da009cf5dceddf7fdb5e1b9bbd2f98403e7383039d7e3bc1647a92e8d9da54670aca0b876e4ec048c5a62c713da59da80a5b0c5fcb1c2fb42fc27a50ba29f2c44d0bca0660498eab6d6f8af7f5c787083dbcff9c11a680ad7b95c5911ba3eac220fb85da0ce4da32c4c975b5a8c9525457de86141de21c5a10c87f50ac8e7f789f0f7610ba0c6c553a41dc8e0efb4b2861c5629badf4024e783f3e86c64027dacd8a6b81939a0754ff70bc9d39995034b21918c09e82622e1d5454e23f1d536c9da249e251c49a0f70fdd04323bbe0c3b54e8d1bf1cd3486f07806592e3fb709e0d09b3b6215a60a07a15f0c9006c2c39c0104e3bbc6638b46ec97cb247273b305a6cb4e1571406f4a0f245157f960b827c6e16e1cb0a8dc0ec52c308317d5745bbd526ab1132eb7675a09a6fb7cc3bcabe9d69b07b9d642e14fa28e5b0880c0a93687bdebe1e9adbc65a80", + "0xf90211a0bab0d0089f9b71981ee144eab1eb87260863d7c0e8860fc50baa123cd57e1076a0b32055007377e4ebece59e67dd1bdef2fab8090fe602e426a17b989b24cee030a097213247b21d1775d0e0a9fceb5cd8bf089b565e0b12aeb87c4cf5ea3b9ef647a0fb10491ba8d4b7f3ab3aef2d239e47d05f905989ba886914de453260cca87a25a0fed0c810a8f3bb9060ceaa1e0e3b60bd2cac8aa3925f257821ffd1a6c045d019a02d579a264ff31036f717769ed3f6ee42710abba3ef9c6208fff18e906f941baaa086f017b4aa106b297a4c2ff4d7d2df9b59ab2ec7542b954df44948b3a85e710aa06d8d9c4bea4ba3b6b10dddc3394b4862067b96fc6dfd17828813a5d7472ee55da03b3bcad80eebdb117e2959dedb15f20cbae17bd7c8a2efbd7faba34bc1e0d142a076f365c75ad50cdf2a3576be0650168face12d535126685fece5d2940587d82ba028d9e77aa5602c1751028395ebed9c7f23febd2336acbe30c18b7d30b9449746a0dc0ab69dba2c48c9e72774ecab8bc336cf24ae1114545620ebd497d873d29ab9a0a34fa0b0b9ed3180b42db497dd324bfbd11f76e019a5404b82f94262572c199da01c8267bd384ec055d22e28973cb5e1a6602ad4eb1c6bb2e6012cd3239710fc16a04dbfb0a097f406c15ab7947441fb164796a12932b4d88676fd1b2cd7b1d95bc2a0fa35a1f36a579056bed3cf33830d34938d92199a27b487c3cd6c7206234a0f4480", + "0xf901d1a06d6223af2401971b5d3667a3a58a872ea759e76582fb375e4f2de0e420df275ea0f158252d20b99f3aa36e5b97c87644eaabc50f582e769ea41cf18f7ae3602227a0a4faeacc33284fdd0eafce32e0776543e3ac349de68dfcb7abcc40b0ae82df5fa0245f6fda91c1d0dd6036c8799a9338cbf85cbbca8a3a45f35a27bb076d10cb65a080d306d21c5efccfa655b98f48b2811000fe6f60a9aebd8fdcbde7589c748e96a077499f3ba879737a73d6628cbe5d5b8ad598430031ca879cdcb3a2509d3f7d5fa0c91ebaef1a0e560845ba673efd813a313e8b9e870524adc4aa4cb6ce4eb47358a078db9a4d7a85f223a7e7b0b4e22c8f0b0c1e976d6197f0ab565b16d7d2143852a02aaaa42933c19eec648bef646eda705a1e84cffbe4ecd62a31862aee16e05241a06e516cdf1f81d33ffae52ca5bf785219501710b5302738b2c405127406ef3c94a0c8ed1799c413fefe7f902fd41911193db6378456ac10eb218c8f7a137b7b50b4a0e412c32035edec4058b02f8137c18a403f5d0274e1ca1f0beff3257f61788af8a0be49c166207007fd651f379fdd6a16bea5854e57e6fcf0109551e5d7f28f883680a017f79411b196fbea4295e681196191c969174d02a467bfd6699ef4c3c6d4fb2a8080", + "0xf8518080808080a01922ad14def89076bde0011d514a50cae7632d617136bb83c1b2fcbed3383c7380808080808080a0e81a4320e846af94db949f1a5298f425864e8eecbe8b72342b0aea33c0ea6e3c808080", + "0xf86c9d3fc8476432660877b666f653759ea69189b60d2f4a7008e70555746ad1b84cf84a018612309ce54000a069bbf0407f9d5438512c6218768a9581f377fa5dc119ea1409b917b75c242e1ca0eab3448e22d0f75e09ed849b2e87ac6739db4104db4eaeeffcc66cfa819755fd" + ] + } + ] + } + ], + "storages": [ + { + "address": "0x75cec1db9dceb703200eaa6595f66885c962b920", + "slot": "0x0000000000000000000000000000000000000000000000000000000000000001", + "storage_key": "0xb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6", + "proofs": [ + { + "block_number": 5641516, + "proof": [ + "0xf8918080a0b7a7c859e6ddbad6c18adb60b9f48842e652021b4f8b875894b8b879568629f880a0e7f9c6d331c7d110c992550a7baa3e051adc1e26a53d928dbd517a313d221863808080808080a0e40cf9c20b1e8e4aaf3201dd3cb84ab06d2bac34e8dc3e918626e5c44c4f0707808080a0c01a2f302bfc71151daac60eeb4c1b73470845d4fe219e71644752abaafb02ab80", + "0xe9a0310e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6878612309ce54000" + ] + } + ] + } + ], + "transactions": [], + "transaction_receipts": [] + } + ], + "tasks": [ + { + "type": "datalake_compute", + "context": { + "encoded_task": "0xa53ae67b29c59c71fea2ff536bf46d09c07f40f2d9fe4365aba6342bb222c5a0000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "task_commitment": "0xa9420109bac8cb6b5e8e1e92120dc4d15abc6915024ed2e8d8e0c427d91e1e91", + "compiled_result": "0x12309ce54000", + "result_commitment": "0xfe22879bf0cec62207a65426fd87f413f75880825b5bdc3e57cb343e9ca42c99", + "task_proof": [], + "result_proof": [], + "encoded_datalake": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000aa36a7000000000000000000000000000000000000000000000000000000000056152c000000000000000000000000000000000000000000000000000000000056152c000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000350375cec1db9dceb703200eaa6595f66885c962b92000000000000000000000000000000000000000000000000000000000000000010000000000000000000000", + "datalake_type": 0, + "property_type": 3 + } + } + ] +} \ No newline at end of file diff --git a/request.json b/request.json index b64846a0..f15f46a8 100644 --- a/request.json +++ b/request.json @@ -1,43 +1,24 @@ { + "id": "bq_01J8F5S491GZKFPJ3GP0FR1V10", + "clientId": "01J178YH1TZG8HB88H9BHD7X1H", + "taskHashes": [ + "0xc99705277aa57d3284fdc76c135a76d9c3289bb3ea5a411526af719f7baba6cc" + ], + "complexity": 12771, "destinationChainId": "ETHEREUM_SEPOLIA", "tasks": [ { + "id": "0xc99705277aa57d3284fdc76c135a76d9c3289bb3ea5a411526af719f7baba6cc", + "datalakeId": "0xdad5db5401deec72457d0e88ac68089ae075ad57e3e41d1328850fe4ac5d2c1c", + "complexity": 12771, "type": "DatalakeCompute", "datalake": { "type": "BlockSampled", "chainId": "ETHEREUM_SEPOLIA", - "blockRangeStart": 6375109, - "blockRangeEnd": 6375109, + "blockRangeStart": 5641516, + "blockRangeEnd": 5641516, "increment": 1, - "sampledProperty": "storage.0xaFE8A72C86d5895DD6616daB26d4b736Cf22472f.0x0000000000000000000000000000000000000000000000000000000000000010" - }, - "compute": { - "aggregateFnId": "avg" - } - }, - { - "type": "DatalakeCompute", - "datalake": { - "type": "BlockSampled", - "chainId": "ETHEREUM_MAINNET", - "blockRangeStart": 100, - "blockRangeEnd": 110, - "increment": 1, - "sampledProperty": "header.number" - }, - "compute": { - "aggregateFnId": "avg" - } - }, - { - "type": "DatalakeCompute", - "datalake": { - "type": "BlockSampled", - "chainId": "ETHEREUM_SEPOLIA", - "blockRangeStart": 6375109, - "blockRangeEnd": 6375111, - "increment": 1, - "sampledProperty": "storage.0xaFE8A72C86d5895DD6616daB26d4b736Cf22472f.0x0000000000000000000000000000000000000000000000000000000000000010" + "sampledProperty": "storage.0x75cec1db9dceb703200eaa6595f66885c962b920.0x0000000000000000000000000000000000000000000000000000000000000001" }, "compute": { "aggregateFnId": "sum"