From c5ed90175bb1e51dfb374700633ec02a2c4187a9 Mon Sep 17 00:00:00 2001 From: sslivkoff Date: Tue, 2 Jan 2024 18:50:53 -0800 Subject: [PATCH 01/49] add total rows to output (#164) * add total rows to output * format --- crates/freeze/src/freeze.rs | 14 ++++++++++---- crates/freeze/src/types/summaries.rs | 3 +++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/crates/freeze/src/freeze.rs b/crates/freeze/src/freeze.rs index 8fae5ad..38841ff 100644 --- a/crates/freeze/src/freeze.rs +++ b/crates/freeze/src/freeze.rs @@ -149,9 +149,13 @@ async fn freeze_partitions( // aggregate results let mut completed = Vec::new(); let mut errored = Vec::new(); + let mut n_rows = 0; while let Some(result) = futures.next().await { match result { - Ok((partition, Ok(()))) => completed.push(partition), + Ok((partition, Ok(chunk_n_rows))) => { + n_rows += chunk_n_rows; + completed.push(partition) + } Ok((partition, Err(e))) => errored.push((Some(partition), e)), Err(_e) => errored.push((None, err("error joining chunks"))), } @@ -161,10 +165,10 @@ async fn freeze_partitions( bar.finish_and_clear(); } - FreezeSummary { completed, errored, skipped } + FreezeSummary { completed, errored, skipped, n_rows } } -async fn freeze_partition(payload: PartitionPayload) -> Result<(), CollectError> { +async fn freeze_partition(payload: PartitionPayload) -> Result { let (partition, datatype, paths, query, source, sink, env, semaphore) = payload; // acquire chunk semaphore @@ -177,7 +181,9 @@ async fn freeze_partition(payload: PartitionPayload) -> Result<(), CollectError> let dfs = collect_partition(datatype, partition, query, source).await?; // write dataframes to disk + let mut n_rows = 0; for (datatype, mut df) in dfs { + n_rows += df.height() as u64; let path = paths.get(&datatype).ok_or_else(|| { CollectError::CollectError("could not get path for datatype".to_string()) })?; @@ -190,5 +196,5 @@ async fn freeze_partition(payload: PartitionPayload) -> Result<(), CollectError> bar.inc(1); } - Ok(()) + Ok(n_rows) } diff --git a/crates/freeze/src/types/summaries.rs b/crates/freeze/src/types/summaries.rs index bdd5061..b1180ea 100644 --- a/crates/freeze/src/types/summaries.rs +++ b/crates/freeze/src/types/summaries.rs @@ -27,6 +27,8 @@ pub struct FreezeSummary { pub skipped: Vec, /// partitions errored pub errored: Vec<(Option, CollectError)>, + /// rows written + pub n_rows: u64, } /// print all datasets @@ -498,6 +500,7 @@ pub(crate) fn print_cryo_conclusion( total_time, query.datatypes.len() as u64, ); + print_bullet_indent("rows written", freeze_summary.n_rows.separate_with_commas(), 0); } macro_rules! print_dim_speed { From 5a1a3bff49a452e713a0c7107d9ab12c94a2b41a Mon Sep 17 00:00:00 2001 From: sslivkoff Date: Tue, 2 Jan 2024 18:58:02 -0800 Subject: [PATCH 02/49] add MESC (#165) * add MESC * fix timestamp tests --- Cargo.lock | 12 +++++++++ Cargo.toml | 1 + crates/cli/Cargo.toml | 1 + crates/cli/src/args.rs | 4 +-- crates/cli/src/parse/source.rs | 39 +++++++++++++++++++++--------- crates/cli/src/parse/timestamps.rs | 5 +++- crates/freeze/Cargo.toml | 1 + crates/freeze/src/types/errors.rs | 10 ++++++++ 8 files changed, 58 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 59908c8..dd7ebb2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -836,6 +836,7 @@ dependencies = [ "eyre", "governor", "hex", + "mesc", "polars", "rand", "serde", @@ -859,6 +860,7 @@ dependencies = [ "indexmap 2.1.0", "indicatif", "lazy_static", + "mesc", "polars", "prefix-hex", "regex", @@ -2383,6 +2385,16 @@ dependencies = [ "autocfg", ] +[[package]] +name = "mesc" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc216c0f54636dcc09d9f6ec664f24927f423976f1c9a2f28b34df8bc71d14be" +dependencies = [ + "serde", + "serde_json", +] + [[package]] name = "mime" version = "0.3.17" diff --git a/Cargo.toml b/Cargo.toml index 2f5baf4..8949a9f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -35,6 +35,7 @@ heck = "0.4.1" indexmap = "2.1.0" indicatif = "0.17.7" lazy_static = "1.4.0" +mesc = "0.1.0" polars = { version = "0.35.4", features = [ "parquet", "string_encoding", diff --git a/crates/cli/Cargo.toml b/crates/cli/Cargo.toml index 3421947..6506d48 100644 --- a/crates/cli/Cargo.toml +++ b/crates/cli/Cargo.toml @@ -28,6 +28,7 @@ ethers = { workspace = true } eyre = { workspace = true } governor = { workspace = true } hex = { workspace = true } +mesc = { workspace = true } polars = { workspace = true } rand = { workspace = true } serde = { workspace = true } diff --git a/crates/cli/src/args.rs b/crates/cli/src/args.rs index a147845..49eff61 100644 --- a/crates/cli/src/args.rs +++ b/crates/cli/src/args.rs @@ -86,7 +86,7 @@ pub struct Args { #[arg(long, help_heading = "Content Options")] pub exclude_failed: bool, - /// RPC url [default: ETH_RPC_URL env var] + /// RPC url [default: 1. MESC 2. ETH_RPC_URL] #[arg(short, long, help_heading = "Source Options")] pub rpc: Option, @@ -114,7 +114,7 @@ pub struct Args { #[arg(long, value_name = "M", help_heading = "Acquisition Options")] pub max_concurrent_chunks: Option, - /// Chunk collection order (normal, reverse, or random) + /// Chunk collection order (normal, reverse, random) #[arg(long, help_heading = "Acquisition Options")] pub chunk_order: Option, diff --git a/crates/cli/src/parse/source.rs b/crates/cli/src/parse/source.rs index a778037..c8e1a60 100644 --- a/crates/cli/src/parse/source.rs +++ b/crates/cli/src/parse/source.rs @@ -77,18 +77,33 @@ pub(crate) async fn parse_source(args: &Args) -> Result { } pub(crate) fn parse_rpc_url(args: &Args) -> Result { - let mut url = match &args.rpc { - Some(url) => url.clone(), - _ => match env::var("ETH_RPC_URL") { - Ok(url) => url, - Err(_e) => { - println!("must provide --rpc or set ETH_RPC_URL"); - std::process::exit(0); - } - }, + // get MESC url + let mesc_url = if mesc::is_mesc_enabled() { + let endpoint = match &args.rpc { + Some(url) => mesc::get_endpoint_by_query(url, Some("cryo"))?, + None => mesc::get_default_endpoint(Some("cryo"))?, + }; + endpoint.map(|endpoint| endpoint.url) + } else { + None }; + + // use ETH_RPC_URL if no MESC url found + let url = if let Some(url) = mesc_url { + url + } else if let Some(url) = &args.rpc { + url.clone() + } else if let Ok(url) = env::var("ETH_RPC_URL") { + url + } else { + let message = "must provide --rpc or setup MESC or set ETH_RPC_URL"; + return Err(ParseError::ParseError(message.to_string())) + }; + + // prepend http or https if need be if !url.starts_with("http") & !url.starts_with("ws") & !url.ends_with(".ipc") { - url = "http://".to_string() + url.as_str(); - }; - Ok(url) + Ok("http://".to_string() + url.as_str()) + } else { + Ok(url) + } } diff --git a/crates/cli/src/parse/timestamps.rs b/crates/cli/src/parse/timestamps.rs index 926216e..e6e26b4 100644 --- a/crates/cli/src/parse/timestamps.rs +++ b/crates/cli/src/parse/timestamps.rs @@ -330,7 +330,10 @@ mod tests { use ethers::prelude::*; async fn setup_source() -> Source { - let rpc_url = crate::parse::source::parse_rpc_url(&Args::default()).unwrap(); + let rpc_url = match crate::parse::source::parse_rpc_url(&Args::default()) { + Ok(url) => url, + Err(_) => std::process::exit(0), + }; let max_retry = 5; let initial_backoff = 500; let max_concurrent_requests = 100; diff --git a/crates/freeze/Cargo.toml b/crates/freeze/Cargo.toml index b5edde3..ac84529 100644 --- a/crates/freeze/Cargo.toml +++ b/crates/freeze/Cargo.toml @@ -21,6 +21,7 @@ heck = { workspace = true } indexmap = { workspace = true } indicatif = { workspace = true } lazy_static = { workspace = true } +mesc = { workspace = true } polars = { workspace = true } prefix-hex = { workspace = true } regex = { workspace = true } diff --git a/crates/freeze/src/types/errors.rs b/crates/freeze/src/types/errors.rs index f48495c..ebd9071 100644 --- a/crates/freeze/src/types/errors.rs +++ b/crates/freeze/src/types/errors.rs @@ -101,6 +101,16 @@ pub enum ParseError { /// Parse int error #[error("Parsing error")] ParseIntError(#[from] std::num::ParseIntError), + + /// MESC error + #[error("MESC error: {:?}", .0)] + MescError(mesc::MescError), +} + +impl From for ParseError { + fn from(err: mesc::MescError) -> Self { + ParseError::MescError(err) + } } /// Error performing a chunk operation From da6ce5e9b189a6333f9307c83e159121adddde6d Mon Sep 17 00:00:00 2001 From: sslivkoff Date: Mon, 8 Jan 2024 12:19:30 -0800 Subject: [PATCH 03/49] Python updates (#168) * add __version__ to python * update cryo_python to cryo --- README.md | 12 +++++++++--- book/cryo_python/installation.md | 4 ++-- crates/python/pyproject.toml | 2 +- crates/python/python/cryo/__init__.py | 1 + crates/python/rust/lib.rs | 1 + 5 files changed, 14 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 4e8c564..61e2320 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,8 @@ For a more complex example, see the [Uniswap Example](./examples/uniswap.sh). ## Installation +The simplest way to use `cryo` is as a cli tool: + #### Method 1: install from source ```bash @@ -62,16 +64,20 @@ This method requires having rust installed. See [rustup](https://rustup.rs/) for Make sure that `~/.cargo/bin` is on your `PATH`. One way to do this is by adding the line `export PATH="$HOME/.cargo/bin:$PATH"` to your `~/.bashrc` or `~/.profile`. -#### Installing `cryo_python` from pypi +### Python Instalation + +`cryo` can also be installed as a python package: + +#### Installing `cryo` python from pypi (make sure rust is installed first, see [rustup](https://www.rust-lang.org/tools/install)) ```bash pip install maturin -pip install cryo_python +pip install cryo ``` -#### Installing `cryo_python` from source +#### Installing `cryo` python from source ```bash pip install maturin diff --git a/book/cryo_python/installation.md b/book/cryo_python/installation.md index ca9d2b7..bd73f79 100644 --- a/book/cryo_python/installation.md +++ b/book/cryo_python/installation.md @@ -1,7 +1,7 @@ ## Installation -There are two main options for installing `cryo_python`. +There are two main options for installing `cryo`. Installing from pip is faster and does not require rust to be installed. @@ -10,7 +10,7 @@ Installing from source allows using the latest unreleased version of cryo. #### Option 1: Install from pip ``` -pip install cryo_python +pip install cryo ``` #### Option 2: Install from source diff --git a/crates/python/pyproject.toml b/crates/python/pyproject.toml index 5891433..2d2ce6c 100644 --- a/crates/python/pyproject.toml +++ b/crates/python/pyproject.toml @@ -3,7 +3,7 @@ requires = ["maturin>=1.1,<2.0"] build-backend = "maturin" [project] -name = "cryo_python" +name = "cryo" description = "cryo is the easiest way to extract blockchain data to parquet, csv, json, or a python dataframe." requires-python = ">=3.7" classifiers = [ diff --git a/crates/python/python/cryo/__init__.py b/crates/python/python/cryo/__init__.py index f762ca4..ac472a4 100644 --- a/crates/python/python/cryo/__init__.py +++ b/crates/python/python/cryo/__init__.py @@ -2,6 +2,7 @@ # ruff: noqa: F401 +from ._cryo_rust import __version__ from ._freeze import async_freeze from ._freeze import freeze from ._collect import async_collect diff --git a/crates/python/rust/lib.rs b/crates/python/rust/lib.rs index 1fe06a2..6eea1dc 100644 --- a/crates/python/rust/lib.rs +++ b/crates/python/rust/lib.rs @@ -17,5 +17,6 @@ fn cryo_rust(_py: Python, m: &PyModule) -> PyResult<()> { m.add_function(wrap_pyfunction!(sum_as_string, m)?)?; m.add_function(wrap_pyfunction!(freeze_adapter::_freeze, m)?)?; m.add_function(wrap_pyfunction!(collect_adapter::_collect, m)?)?; + m.add("__version__", env!("CARGO_PKG_VERSION"))?; Ok(()) } From fef78eceeeb3b22b8cd0b2198a1fb90f5900926a Mon Sep 17 00:00:00 2001 From: sslivkoff Date: Wed, 10 Jan 2024 20:37:30 -0800 Subject: [PATCH 04/49] add input length columns to txs (#170) --- crates/freeze/src/datasets/transactions.rs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/crates/freeze/src/datasets/transactions.rs b/crates/freeze/src/datasets/transactions.rs index c72c61c..afec6a2 100644 --- a/crates/freeze/src/datasets/transactions.rs +++ b/crates/freeze/src/datasets/transactions.rs @@ -22,9 +22,12 @@ pub struct Transactions { max_priority_fee_per_gas: Vec>, max_fee_per_gas: Vec>, success: Vec, + n_input_bytes: Vec, + n_input_zero_bytes: Vec, + n_input_nonzero_bytes: Vec, + block_hash: Vec>, chain_id: Vec, timestamp: Vec, - block_hash: Vec>, } #[async_trait::async_trait] @@ -50,6 +53,9 @@ impl Dataset for Transactions { "max_priority_fee_per_gas", "max_fee_per_gas", "success", + "n_input_bytes", + "n_input_zero_bytes", + "n_input_nonzero_bytes", "chain_id", ]) } @@ -196,6 +202,16 @@ pub(crate) fn process_transaction( store!(schema, columns, input, tx.input.to_vec()); store!(schema, columns, gas_limit, tx.gas.as_u64()); store!(schema, columns, success, success); + if schema.has_column("n_input_bytes") | + schema.has_column("n_input_zero_bytes") | + schema.has_column("n_input_nonzero_bytes") + { + let n_input_bytes = tx.input.len() as u32; + let n_input_zero_bytes = tx.input.iter().filter(|&&x| x == 0).count() as u32; + store!(schema, columns, n_input_bytes, n_input_bytes); + store!(schema, columns, n_input_zero_bytes, n_input_zero_bytes); + store!(schema, columns, n_input_nonzero_bytes, n_input_bytes - n_input_zero_bytes); + } store!(schema, columns, gas_used, receipt.and_then(|r| r.gas_used.map(|x| x.as_u64()))); store!(schema, columns, gas_price, tx.gas_price.map(|gas_price| gas_price.as_u64())); store!(schema, columns, transaction_type, tx.transaction_type.map(|value| value.as_u32())); From 816abfe445d7c5b50e12ab16fa88c4e3b8d6a803 Mon Sep 17 00:00:00 2001 From: sslivkoff Date: Wed, 10 Jan 2024 20:53:17 -0800 Subject: [PATCH 05/49] Add n rlp bytes column (#171) * add input length columns to txs * add n_rlp_bytes column to txs dataset --- crates/freeze/src/datasets/transactions.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/freeze/src/datasets/transactions.rs b/crates/freeze/src/datasets/transactions.rs index afec6a2..54f3b8b 100644 --- a/crates/freeze/src/datasets/transactions.rs +++ b/crates/freeze/src/datasets/transactions.rs @@ -25,6 +25,7 @@ pub struct Transactions { n_input_bytes: Vec, n_input_zero_bytes: Vec, n_input_nonzero_bytes: Vec, + n_rlp_bytes: Vec, block_hash: Vec>, chain_id: Vec, timestamp: Vec, @@ -212,6 +213,7 @@ pub(crate) fn process_transaction( store!(schema, columns, n_input_zero_bytes, n_input_zero_bytes); store!(schema, columns, n_input_nonzero_bytes, n_input_bytes - n_input_zero_bytes); } + store!(schema, columns, n_rlp_bytes, tx.rlp().len() as u32); store!(schema, columns, gas_used, receipt.and_then(|r| r.gas_used.map(|x| x.as_u64()))); store!(schema, columns, gas_price, tx.gas_price.map(|gas_price| gas_price.as_u64())); store!(schema, columns, transaction_type, tx.transaction_type.map(|value| value.as_u32())); From e6f6e5227e92144f314e4a94cbc957a45607a4f9 Mon Sep 17 00:00:00 2001 From: sslivkoff Date: Wed, 10 Jan 2024 21:37:13 -0800 Subject: [PATCH 06/49] add contract length columns (#172) --- crates/freeze/src/datasets/contracts.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/freeze/src/datasets/contracts.rs b/crates/freeze/src/datasets/contracts.rs index 4ea8a26..9c682dc 100644 --- a/crates/freeze/src/datasets/contracts.rs +++ b/crates/freeze/src/datasets/contracts.rs @@ -19,6 +19,8 @@ pub struct Contracts { init_code: Vec>, code: Vec>, init_code_hash: Vec>, + n_init_code_bytes: Vec, + n_code_bytes: Vec, code_hash: Vec>, chain_id: Vec, } @@ -93,8 +95,10 @@ pub(crate) fn process_contracts( store!(schema, columns, factory, create.from.as_bytes().into()); store!(schema, columns, init_code, create.init.to_vec()); store!(schema, columns, code, result.code.to_vec()); - store!(schema, columns, code_hash, keccak256(create.init.clone()).into()); store!(schema, columns, init_code_hash, keccak256(result.code.clone()).into()); + store!(schema, columns, code_hash, keccak256(create.init.clone()).into()); + store!(schema, columns, n_init_code_bytes, create.init.len() as u32); + store!(schema, columns, n_code_bytes, result.code.len() as u32); } } Ok(()) From 123091a4389089cd0aef2ec331e520d447f3a007 Mon Sep 17 00:00:00 2001 From: sslivkoff Date: Fri, 12 Jan 2024 09:23:26 -0800 Subject: [PATCH 07/49] update erc20 balances example --- examples/erc20_balances.sh | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/examples/erc20_balances.sh b/examples/erc20_balances.sh index 7b44047..97fbdc5 100755 --- a/examples/erc20_balances.sh +++ b/examples/erc20_balances.sh @@ -1,23 +1,16 @@ #!/usr/bin/env bash -# get ERC20 balance of a wallet over some block range +# get ERC20 balances of addresses over some block range -# ERC20 = USDC -export CONTRACT=0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48 +# ERC20 = USDC, USDT +export ERC20s="0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48 0xdac17f958d2ee523a2206206994597c13d831ec7" -# Wallet = Maker PSM -export WALLET=0x0a59649758aa4d66e25f08dd01271e891fe52199 - -# selector for balanceOf(address) -export FUNCTION=0x70a08231 +# Wallet = Maker PSM, Arbitrum Brdige +export WALLETS="0x0a59649758aa4d66e25f08dd01271e891fe52199 0xcee284f754e854890e311e3280b767f80797180d" # block range = 10 blocks between 16,000,000 and 17,000,000 export BLOCKS="16M:17M/10" -cryo eth_calls \ - --label erc20_balances \ - --blocks $BLOCKS \ - --contract $CONTRACT \ - --function $FUNCTION \ - --inputs $(printf '%064s' ${WALLET:2}) +# collect data +cryo erc20_balances --blocks $BLOCKS --contract $CONTRACT --address $WALLET From 9171da6b3234eded9d37cd4d640a313e9dc73fa2 Mon Sep 17 00:00:00 2001 From: sslivkoff Date: Fri, 12 Jan 2024 12:25:39 -0800 Subject: [PATCH 08/49] fix typo in erc20 balances example --- examples/erc20_balances.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/erc20_balances.sh b/examples/erc20_balances.sh index 97fbdc5..da8ba89 100755 --- a/examples/erc20_balances.sh +++ b/examples/erc20_balances.sh @@ -3,14 +3,14 @@ # get ERC20 balances of addresses over some block range # ERC20 = USDC, USDT -export ERC20s="0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48 0xdac17f958d2ee523a2206206994597c13d831ec7" +export ERC20="0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48 0xdac17f958d2ee523a2206206994597c13d831ec7" -# Wallet = Maker PSM, Arbitrum Brdige +# WALLET = Maker PSM, Arbitrum Brdige export WALLETS="0x0a59649758aa4d66e25f08dd01271e891fe52199 0xcee284f754e854890e311e3280b767f80797180d" # block range = 10 blocks between 16,000,000 and 17,000,000 export BLOCKS="16M:17M/10" # collect data -cryo erc20_balances --blocks $BLOCKS --contract $CONTRACT --address $WALLET +cryo erc20_balances --blocks $BLOCKS --contract $ERC20 --address $WALLET From b5a1df816210b9e2da248d57a85e658783852be8 Mon Sep 17 00:00:00 2001 From: sslivkoff Date: Sat, 13 Jan 2024 00:09:20 -0800 Subject: [PATCH 09/49] use none for eth calls reverts (#174) --- crates/freeze/src/datasets/eth_calls.rs | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/crates/freeze/src/datasets/eth_calls.rs b/crates/freeze/src/datasets/eth_calls.rs index 9555975..4a58be3 100644 --- a/crates/freeze/src/datasets/eth_calls.rs +++ b/crates/freeze/src/datasets/eth_calls.rs @@ -11,8 +11,8 @@ pub struct EthCalls { contract_address: Vec>, call_data: Vec>, call_data_hash: Vec>, - output_data: Vec>, - output_data_hash: Vec>, + output_data: Vec>>, + output_data_hash: Vec>>, chain_id: Vec, } @@ -39,7 +39,7 @@ impl Dataset for EthCalls { } } -type EthCallsResponse = (u32, Vec, Vec, Vec); +type EthCallsResponse = (u32, Vec, Vec, Option>); #[async_trait::async_trait] impl CollectByBlock for EthCalls { @@ -52,8 +52,8 @@ impl CollectByBlock for EthCalls { ..Default::default() }; let number = request.block_number()?; - let output = source.call(transaction, number.into()).await?; - Ok((number as u32, request.contract()?, request.call_data()?, output.to_vec())) + let output = source.call(transaction, number.into()).await.ok().map(|x| x.to_vec()); + Ok((number as u32, request.contract()?, request.call_data()?, output)) } fn transform(response: Self::Response, columns: &mut Self, query: &Arc) -> R<()> { @@ -74,6 +74,11 @@ fn process_eth_call(response: EthCallsResponse, columns: &mut EthCalls, schema: store!(schema, columns, contract_address, contract_address); store!(schema, columns, call_data, call_data.clone()); store!(schema, columns, call_data_hash, ethers_core::utils::keccak256(call_data).into()); - store!(schema, columns, output_data, output_data.to_vec()); - store!(schema, columns, output_data_hash, ethers_core::utils::keccak256(output_data).into()); + store!(schema, columns, output_data, output_data.clone()); + store!( + schema, + columns, + output_data_hash, + output_data.map(|data| ethers_core::utils::keccak256(data).into()) + ); } From 8c215dda9ddc8de133245a3421efb26932a8f7d9 Mon Sep 17 00:00:00 2001 From: Fahim Ahmed <68152521+fahimahmedx@users.noreply.github.com> Date: Sat, 13 Jan 2024 18:29:12 -0500 Subject: [PATCH 10/49] update polars to 0.36.2 (#175) --- Cargo.lock | 177 ++++++++++++++++++++++++++++++++++++++++------------- Cargo.toml | 4 +- 2 files changed, 137 insertions(+), 44 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index dd7ebb2..6b109f3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -240,9 +240,9 @@ dependencies = [ [[package]] name = "atoi_simd" -version = "0.15.3" +version = "0.15.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc41b65e01b6851bdcd2d741824e6b310d571396bf3915e31e4792034ee65126" +checksum = "9ae037714f313c1353189ead58ef9eec30a8e8dc101b2622d461418fd59e28a9" [[package]] name = "auto_impl" @@ -1971,7 +1971,7 @@ dependencies = [ "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "windows-core", + "windows-core 0.51.1", ] [[package]] @@ -2290,9 +2290,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.149" +version = "0.2.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" +checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" [[package]] name = "libm" @@ -2852,9 +2852,9 @@ dependencies = [ [[package]] name = "polars" -version = "0.35.4" +version = "0.36.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df8e52f9236eb722da0990a70bbb1216dcc7a77bcb00c63439d2d982823e90d5" +checksum = "938048fcda6a8e2ace6eb168bee1b415a92423ce51e418b853bf08fc40349b6b" dependencies = [ "getrandom", "polars-core", @@ -2868,9 +2868,9 @@ dependencies = [ [[package]] name = "polars-arrow" -version = "0.35.4" +version = "0.36.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd503430a6d9779b07915d858865fe998317ef3cfef8973881f578ac5d4baae7" +checksum = "ce68a02f698ff7787c261aea1b4c040a8fe183a8fb200e2436d7f35d95a1b86f" dependencies = [ "ahash", "arrow-format", @@ -2891,19 +2891,32 @@ dependencies = [ "num-traits", "polars-error", "polars-utils", - "rustc_version", "ryu", "simdutf8", "streaming-iterator", "strength_reduce", + "version_check", "zstd 0.13.0", ] [[package]] -name = "polars-core" -version = "0.35.4" +name = "polars-compute" +version = "0.36.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae73d5b8e55decde670caba1cc82b61f14bfb9a72503198f0997d657a98dcfd6" +checksum = "b14fbc5f141b29b656a4cec4802632e5bff10bf801c6809c6bbfbd4078a044dd" +dependencies = [ + "bytemuck", + "num-traits", + "polars-arrow", + "polars-utils", + "version_check", +] + +[[package]] +name = "polars-core" +version = "0.36.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0f5efe734b6cbe5f97ea769be8360df5324fade396f1f3f5ad7fe9360ca4a23" dependencies = [ "ahash", "bitflags 2.4.1", @@ -2916,6 +2929,7 @@ dependencies = [ "num-traits", "once_cell", "polars-arrow", + "polars-compute", "polars-error", "polars-row", "polars-utils", @@ -2931,9 +2945,9 @@ dependencies = [ [[package]] name = "polars-error" -version = "0.35.4" +version = "0.36.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb0520d68eaa9993ae0c741409d1526beff5b8f48e1d73e4381616f8152cf488" +checksum = "6396de788f99ebfc9968e7b6f523e23000506cde4ba6dfc62ae4ce949002a886" dependencies = [ "arrow-format", "regex", @@ -2943,9 +2957,9 @@ dependencies = [ [[package]] name = "polars-io" -version = "0.35.4" +version = "0.36.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96e10a0745acd6009db64bef0ceb9e23a70b1c27b26a0a6517c91f3e6363bc06" +checksum = "7d0458efe8946f4718fd352f230c0db5a37926bd0d2bd25af79dc24746abaaea" dependencies = [ "ahash", "async-trait", @@ -2981,9 +2995,9 @@ dependencies = [ [[package]] name = "polars-json" -version = "0.35.4" +version = "0.36.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93b9cb83c19daf334c398e56a9361bd79c8ad0718296db2afab08d476bd84559" +checksum = "ea47d46b7a98fa683ef235ad48b783abf61734828e754096cfbdc77404fff9b3" dependencies = [ "ahash", "chrono", @@ -3002,9 +3016,9 @@ dependencies = [ [[package]] name = "polars-lazy" -version = "0.35.4" +version = "0.36.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3555f759705be6dd0d3762d16a0b8787b2dc4da73b57465f3b2bf1a070ba8f20" +checksum = "9d7105b40905bb38e8fc4a7fd736594b7491baa12fad3ac492969ca221a1b5d5" dependencies = [ "ahash", "bitflags 2.4.1", @@ -3026,9 +3040,9 @@ dependencies = [ [[package]] name = "polars-ops" -version = "0.35.4" +version = "0.36.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a7eb218296aaa7f79945f08288ca32ca3cf25fa505649eeee689ec21eebf636" +checksum = "2e09afc456ab11e75e5dcb43e00a01c71f3a46a2781e450054acb6bb096ca78e" dependencies = [ "ahash", "argminmax", @@ -3041,6 +3055,7 @@ dependencies = [ "memchr", "num-traits", "polars-arrow", + "polars-compute", "polars-core", "polars-error", "polars-utils", @@ -3052,9 +3067,9 @@ dependencies = [ [[package]] name = "polars-parquet" -version = "0.35.4" +version = "0.36.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "146010e4b7dd4d2d0e58ddc762f6361f77d7a0385c54471199370c17164f67dd" +checksum = "7ba24d67b1f64ab85143033dd46fa090b13c0f74acdf91b0780c16aecf005e3d" dependencies = [ "ahash", "async-stream", @@ -3078,9 +3093,9 @@ dependencies = [ [[package]] name = "polars-pipe" -version = "0.35.4" +version = "0.36.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66094e7df64c932a9a7bdfe7df0c65efdcb192096e11a6a765a9778f78b4bdec" +checksum = "d9b7ead073cc3917027d77b59861a9f071db47125de9314f8907db1a0a3e4100" dependencies = [ "crossbeam-channel", "crossbeam-queue", @@ -3088,6 +3103,7 @@ dependencies = [ "hashbrown 0.14.2", "num-traits", "polars-arrow", + "polars-compute", "polars-core", "polars-io", "polars-ops", @@ -3101,9 +3117,9 @@ dependencies = [ [[package]] name = "polars-plan" -version = "0.35.4" +version = "0.36.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10e32a0958ef854b132bad7f8369cb3237254635d5e864c99505bc0bc1035fbc" +checksum = "384a175624d050c31c473ee11df9d7af5d729ae626375e522158cfb3d150acd0" dependencies = [ "ahash", "bytemuck", @@ -3112,6 +3128,7 @@ dependencies = [ "polars-arrow", "polars-core", "polars-io", + "polars-json", "polars-ops", "polars-parquet", "polars-time", @@ -3125,9 +3142,9 @@ dependencies = [ [[package]] name = "polars-row" -version = "0.35.4" +version = "0.36.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d135ab81cac2906ba74ea8984c7e6025d081ae5867615bcefb4d84dfdb456dac" +checksum = "32322f7acbb83db3e9c7697dc821be73d06238da89c817dcc8bc1549a5e9c72f" dependencies = [ "polars-arrow", "polars-error", @@ -3136,9 +3153,9 @@ dependencies = [ [[package]] name = "polars-sql" -version = "0.35.4" +version = "0.36.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8dbd7786849a5e3ad1fde188bf38141632f626e3a57319b0bbf7a5f1d75519e" +checksum = "9f0b4c6ddffdfd0453e84bc3918572c633014d661d166654399cf93752aa95b5" dependencies = [ "polars-arrow", "polars-core", @@ -3153,9 +3170,9 @@ dependencies = [ [[package]] name = "polars-time" -version = "0.35.4" +version = "0.36.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aae56f79e9cedd617773c1c8f5ca84a31a8b1d593714959d5f799e7bdd98fe51" +checksum = "dee2649fc96bd1b6584e0e4a4b3ca7d22ed3d117a990e63ad438ecb26f7544d0" dependencies = [ "atoi", "chrono", @@ -3172,9 +3189,9 @@ dependencies = [ [[package]] name = "polars-utils" -version = "0.35.4" +version = "0.36.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da6ce68169fe61d46958c8eab7447360f30f2f23f6e24a0ce703a14b0a3cfbfc" +checksum = "b174ca4a77ad47d7b91a0460aaae65bbf874c8bfbaaa5308675dadef3976bbda" dependencies = [ "ahash", "bytemuck", @@ -3390,9 +3407,9 @@ dependencies = [ [[package]] name = "pyo3-polars" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e37da190c68036cb620bbde9a8933839addfa4b66e9903b9b1dc751b2b00e7d7" +checksum = "b1e983cb07cf665ea6e645ae9263c358062580f23a9aee41618a5706d4a7cc21" dependencies = [ "polars", "polars-core", @@ -4242,16 +4259,16 @@ dependencies = [ [[package]] name = "sysinfo" -version = "0.29.10" +version = "0.30.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a18d114d420ada3a891e6bc8e96a2023402203296a47cdd65083377dad18ba5" +checksum = "1fb4f3438c8f6389c864e61221cbc97e9bca98b4daf39a5beb7bea660f528bb2" dependencies = [ "cfg-if", "core-foundation-sys", "libc", "ntapi", "once_cell", - "winapi", + "windows", ] [[package]] @@ -4845,6 +4862,16 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" +dependencies = [ + "windows-core 0.52.0", + "windows-targets 0.52.0", +] + [[package]] name = "windows-core" version = "0.51.1" @@ -4854,6 +4881,15 @@ dependencies = [ "windows-targets 0.48.5", ] +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets 0.52.0", +] + [[package]] name = "windows-sys" version = "0.45.0" @@ -4902,6 +4938,21 @@ dependencies = [ "windows_x86_64_msvc 0.48.5", ] +[[package]] +name = "windows-targets" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +dependencies = [ + "windows_aarch64_gnullvm 0.52.0", + "windows_aarch64_msvc 0.52.0", + "windows_i686_gnu 0.52.0", + "windows_i686_msvc 0.52.0", + "windows_x86_64_gnu 0.52.0", + "windows_x86_64_gnullvm 0.52.0", + "windows_x86_64_msvc 0.52.0", +] + [[package]] name = "windows_aarch64_gnullvm" version = "0.42.2" @@ -4914,6 +4965,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" + [[package]] name = "windows_aarch64_msvc" version = "0.42.2" @@ -4926,6 +4983,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" + [[package]] name = "windows_i686_gnu" version = "0.42.2" @@ -4938,6 +5001,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" +[[package]] +name = "windows_i686_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" + [[package]] name = "windows_i686_msvc" version = "0.42.2" @@ -4950,6 +5019,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" +[[package]] +name = "windows_i686_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" + [[package]] name = "windows_x86_64_gnu" version = "0.42.2" @@ -4962,6 +5037,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" + [[package]] name = "windows_x86_64_gnullvm" version = "0.42.2" @@ -4974,6 +5055,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" + [[package]] name = "windows_x86_64_msvc" version = "0.42.2" @@ -4986,6 +5073,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" + [[package]] name = "winnow" version = "0.5.18" diff --git a/Cargo.toml b/Cargo.toml index 8949a9f..87f248c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -36,7 +36,7 @@ indexmap = "2.1.0" indicatif = "0.17.7" lazy_static = "1.4.0" mesc = "0.1.0" -polars = { version = "0.35.4", features = [ +polars = { version = "0.36.2", features = [ "parquet", "string_encoding", "polars-lazy", @@ -49,7 +49,7 @@ prefix-hex = "0.7.1" pyo3 = { version = "0.20.0", features = ["extension-module"] } pyo3-build-config = "0.20.0" pyo3-asyncio = { version = "0.20.0", features = ["tokio-runtime"] } -pyo3-polars = "0.9.0" +pyo3-polars = "0.10.0" rand = "0.8.5" regex = "1.10.2" serde = { version = "1.0.191", features = ["derive"] } From 152a635b42742e9c55a7c932997702ce62b54405 Mon Sep 17 00:00:00 2001 From: sslivkoff Date: Sun, 14 Jan 2024 17:55:22 -0800 Subject: [PATCH 11/49] fix crate versioning (#176) --- Cargo.lock | 8 ++++---- Cargo.toml | 6 +++++- crates/cli/Cargo.toml | 3 +-- crates/freeze/Cargo.toml | 8 ++++---- crates/python/Cargo.toml | 5 ++--- 5 files changed, 16 insertions(+), 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6b109f3..d1232dc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -825,7 +825,7 @@ checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] name = "cryo_cli" -version = "0.3.0" +version = "0.3.2" dependencies = [ "anstyle", "clap_cryo", @@ -846,7 +846,7 @@ dependencies = [ [[package]] name = "cryo_freeze" -version = "0.3.0" +version = "0.3.2" dependencies = [ "async-trait", "chrono", @@ -873,7 +873,7 @@ dependencies = [ [[package]] name = "cryo_python" -version = "0.3.0" +version = "0.3.2" dependencies = [ "cryo_cli", "cryo_freeze", @@ -887,7 +887,7 @@ dependencies = [ [[package]] name = "cryo_to_df" -version = "0.3.0" +version = "0.3.2" dependencies = [ "indexmap 2.1.0", "proc-macro2", diff --git a/Cargo.toml b/Cargo.toml index 87f248c..bde3b13 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,7 @@ members = ["crates/cli", "crates/freeze", "crates/to_df", "crates/python"] resolver = "2" [workspace.package] -version = "0.3.0" +version = "0.3.2" edition = "2021" license = "MIT OR Apache-2.0" homepage = "https://github.com/paradigmxyz/cryo" @@ -15,6 +15,10 @@ repository = "https://github.com/paradigmxyz/cryo" exclude = [".github/"] [workspace.dependencies] +cryo_cli = { version = "0.3.2", path = "./crates/cli" } +cryo_freeze = { version = "0.3.2", path = "./crates/freeze" } +cryo_to_df = { version = "0.3.2", path = "./crates/to_df" } + anstyle = "1.0.4" async-trait = "0.1.74" chrono = { version = "0.4.31", features = ["serde"] } diff --git a/crates/cli/Cargo.toml b/crates/cli/Cargo.toml index 6506d48..7eb4fcc 100644 --- a/crates/cli/Cargo.toml +++ b/crates/cli/Cargo.toml @@ -18,12 +18,11 @@ path = "src/main.rs" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -cryo_freeze = { version = "0.3.0", path = "../freeze" } - anstyle = { workspace = true } clap_cryo = { workspace = true } color-print = { workspace = true } colored = { workspace = true } +cryo_freeze = { workspace = true } ethers = { workspace = true } eyre = { workspace = true } governor = { workspace = true } diff --git a/crates/freeze/Cargo.toml b/crates/freeze/Cargo.toml index ac84529..9c8e5e1 100644 --- a/crates/freeze/Cargo.toml +++ b/crates/freeze/Cargo.toml @@ -11,8 +11,10 @@ repository.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -cryo_to_df = { version = "0.3.0", path = "../to_df" } async-trait = { workspace = true } +chrono = { workspace = true } +colored = { workspace = true } +cryo_to_df = { workspace = true } ethers = { workspace = true } ethers-core = { workspace = true } futures = { workspace = true } @@ -28,7 +30,5 @@ regex = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } thiserror = { workspace = true } -tokio = { workspace = true } -chrono = { workspace = true } -colored = { workspace = true } thousands = { workspace = true } +tokio = { workspace = true } diff --git a/crates/python/Cargo.toml b/crates/python/Cargo.toml index f276af7..6b968d7 100644 --- a/crates/python/Cargo.toml +++ b/crates/python/Cargo.toml @@ -15,9 +15,8 @@ path = "rust/lib.rs" crate-type = ["cdylib"] [dependencies] -cryo_cli = { version = "0.3.0", path = "../cli" } -cryo_freeze = { version = "0.3.0", path = "../freeze" } - +cryo_cli = { workspace = true } +cryo_freeze = { workspace = true } polars = { workspace = true } pyo3 = { workspace = true } pyo3-asyncio = { workspace = true } From bc8fb03b61322e00b5dc013e44409938edab8fba Mon Sep 17 00:00:00 2001 From: sslivkoff Date: Sat, 20 Jan 2024 20:11:45 -0800 Subject: [PATCH 12/49] update to latest mesc --- Cargo.lock | 5 +++-- Cargo.toml | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d1232dc..8ba72d3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2387,12 +2387,13 @@ dependencies = [ [[package]] name = "mesc" -version = "0.1.1" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc216c0f54636dcc09d9f6ec664f24927f423976f1c9a2f28b34df8bc71d14be" +checksum = "d4effaaca264c057c870afd19cf7137ef000ca64fc7292d5a0634ce5ebbb6e27" dependencies = [ "serde", "serde_json", + "thiserror", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index bde3b13..4871f8d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -39,7 +39,7 @@ heck = "0.4.1" indexmap = "2.1.0" indicatif = "0.17.7" lazy_static = "1.4.0" -mesc = "0.1.0" +mesc = "0.1.4" polars = { version = "0.36.2", features = [ "parquet", "string_encoding", From 3ea80320098237006bfee609cf34a8dd052f9ed5 Mon Sep 17 00:00:00 2001 From: sslivkoff Date: Sat, 20 Jan 2024 20:11:59 -0800 Subject: [PATCH 13/49] add logs n_data_bytes column --- crates/cli/src/parse/source.rs | 12 +++++++++--- crates/freeze/src/datasets/logs.rs | 3 +++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/crates/cli/src/parse/source.rs b/crates/cli/src/parse/source.rs index c8e1a60..90cff19 100644 --- a/crates/cli/src/parse/source.rs +++ b/crates/cli/src/parse/source.rs @@ -80,10 +80,16 @@ pub(crate) fn parse_rpc_url(args: &Args) -> Result { // get MESC url let mesc_url = if mesc::is_mesc_enabled() { let endpoint = match &args.rpc { - Some(url) => mesc::get_endpoint_by_query(url, Some("cryo"))?, - None => mesc::get_default_endpoint(Some("cryo"))?, + Some(url) => mesc::get_endpoint_by_query(url, Some("cryo")), + None => mesc::get_default_endpoint(Some("cryo")), }; - endpoint.map(|endpoint| endpoint.url) + match endpoint { + Ok(endpoint) => endpoint.map(|endpoint| endpoint.url), + Err(e) => { + eprintln!("Could not load MESC data: {}", e); + None + } + } } else { None }; diff --git a/crates/freeze/src/datasets/logs.rs b/crates/freeze/src/datasets/logs.rs index 666d7c9..ca34c54 100644 --- a/crates/freeze/src/datasets/logs.rs +++ b/crates/freeze/src/datasets/logs.rs @@ -18,6 +18,7 @@ pub struct Logs { topic2: Vec>>, topic3: Vec>>, data: Vec>, + n_data_bytes: Vec, event_cols: indexmap::IndexMap>, chain_id: Vec, } @@ -41,6 +42,7 @@ impl Dataset for Logs { "topic2", "topic3", "data", + "n_data_bytes", // "event_cols", "chain_id", ]) @@ -129,6 +131,7 @@ fn process_logs(logs: Vec, columns: &mut Logs, schema: &Table) -> R<()> { store!(schema, columns, transaction_hash, tx.as_bytes().to_vec()); store!(schema, columns, address, log.address.as_bytes().to_vec()); store!(schema, columns, data, log.data.to_vec()); + store!(schema, columns, n_data_bytes, log.data.len() as u32); // topics for i in 0..4 { From 21503ed02c0d8ce42329e16f42cc26907762b03e Mon Sep 17 00:00:00 2001 From: sslivkoff Date: Sun, 21 Jan 2024 21:30:21 -0800 Subject: [PATCH 14/49] allow collecting partial subsets of state read datasets --- crates/cli/src/run.rs | 2 +- crates/freeze/src/freeze.rs | 2 +- .../freeze/src/multi_datasets/state_reads.rs | 62 ++++++++++++++----- crates/freeze/src/types/summaries.rs | 4 +- 4 files changed, 51 insertions(+), 19 deletions(-) diff --git a/crates/cli/src/run.rs b/crates/cli/src/run.rs index 02d9902..ddb7524 100644 --- a/crates/cli/src/run.rs +++ b/crates/cli/src/run.rs @@ -92,7 +92,7 @@ async fn handle_help_subcommands(args: args::Args) -> Result errored.push((Some(partition), e)), - Err(_e) => errored.push((None, err("error joining chunks"))), + Err(e) => errored.push((None, err(format!("error joining chunks: {:?}", e).as_str()))), } } diff --git a/crates/freeze/src/multi_datasets/state_reads.rs b/crates/freeze/src/multi_datasets/state_reads.rs index 9f92264..aa0508c 100644 --- a/crates/freeze/src/multi_datasets/state_reads.rs +++ b/crates/freeze/src/multi_datasets/state_reads.rs @@ -22,10 +22,18 @@ impl ToDataFrames for StateReads { ) -> R> { let StateReads(balances, codes, nonces, storages) = self; let mut output = HashMap::new(); - output.extend(balances.create_dfs(schemas, chain_id)?); - output.extend(codes.create_dfs(schemas, chain_id)?); - output.extend(nonces.create_dfs(schemas, chain_id)?); - output.extend(storages.create_dfs(schemas, chain_id)?); + if schemas.get(&Datatype::BalanceReads).is_some() { + output.extend(balances.create_dfs(schemas, chain_id)?); + } + if schemas.get(&Datatype::CodeReads).is_some() { + output.extend(codes.create_dfs(schemas, chain_id)?); + } + if schemas.get(&Datatype::NonceReads).is_some() { + output.extend(nonces.create_dfs(schemas, chain_id)?); + } + if schemas.get(&Datatype::StorageReads).is_some() { + output.extend(storages.create_dfs(schemas, chain_id)?); + } Ok(output) } } @@ -35,9 +43,18 @@ impl CollectByBlock for StateReads { type Response = BlockTxsTraces; async fn extract(request: Params, source: Arc, query: Arc) -> R { - let schema = - query.schemas.get(&Datatype::StorageReads).ok_or(err("schema not provided"))?; - let include_txs = schema.has_column("transaction_hash"); + let include_txs = match ( + query.schemas.get(&Datatype::BalanceReads), + query.schemas.get(&Datatype::CodeReads), + query.schemas.get(&Datatype::NonceReads), + query.schemas.get(&Datatype::StorageReads), + ) { + (Some(schema), _, _, _) + | (_, Some(schema), _, _) + | (_, _, Some(schema), _) + | (_, _, _, Some(schema)) => schema.has_column("transaction_hash"), + _ => false, + }; source.geth_debug_trace_block_prestate(request.block_number()? as u32, include_txs).await } @@ -51,9 +68,18 @@ impl CollectByTransaction for StateReads { type Response = BlockTxsTraces; async fn extract(request: Params, source: Arc, query: Arc) -> R { - let schema = - query.schemas.get(&Datatype::StorageReads).ok_or(err("schema not provided"))?; - let include_block_number = schema.has_column("block_number"); + let include_block_number = match ( + query.schemas.get(&Datatype::BalanceReads), + query.schemas.get(&Datatype::CodeReads), + query.schemas.get(&Datatype::NonceReads), + query.schemas.get(&Datatype::StorageReads), + ) { + (Some(schema), _, _, _) + | (_, Some(schema), _, _) + | (_, _, Some(schema), _) + | (_, _, _, Some(schema)) => schema.has_column("block_number"), + _ => false, + }; let tx = request.transaction_hash()?; source.geth_debug_trace_transaction_prestate(tx, include_block_number).await } @@ -69,9 +95,17 @@ fn process_state_reads( schemas: &HashMap, ) -> R<()> { let StateReads(balances, codes, nonces, storages) = columns; - balance_reads::process_balance_reads(&response, balances, schemas)?; - code_reads::process_code_reads(&response, codes, schemas)?; - nonce_reads::process_nonce_reads(&response, nonces, schemas)?; - storage_reads::process_storage_reads(&response, storages, schemas)?; + if schemas.get(&Datatype::BalanceReads).is_some() { + balance_reads::process_balance_reads(&response, balances, schemas)?; + } + if schemas.get(&Datatype::CodeReads).is_some() { + code_reads::process_code_reads(&response, codes, schemas)?; + } + if schemas.get(&Datatype::NonceReads).is_some() { + nonce_reads::process_nonce_reads(&response, nonces, schemas)?; + } + if schemas.get(&Datatype::StorageReads).is_some() { + storage_reads::process_storage_reads(&response, storages, schemas)?; + } Ok(()) } diff --git a/crates/freeze/src/types/summaries.rs b/crates/freeze/src/types/summaries.rs index b1180ea..3c654a1 100644 --- a/crates/freeze/src/types/summaries.rs +++ b/crates/freeze/src/types/summaries.rs @@ -5,7 +5,7 @@ use colored::Colorize; use thousands::Separable; use crate::{ - chunks::chunk_ops::ValueToString, err, ChunkData, ChunkStats, CollectError, ColumnType, + chunks::chunk_ops::ValueToString, ChunkData, ChunkStats, CollectError, ColumnType, Datatype, Dim, ExecutionEnv, FileOutput, MetaDatatype, MultiDatatype, Partition, Query, Source, Table, }; @@ -363,8 +363,6 @@ fn print_schemas( println!(); println!(); print_schema(datatype, &schema.clone()) - } else { - return Err(err("missing schema for datatype")) } } } From 0a36dace52bdafaacf8fc212241605095f5630f2 Mon Sep 17 00:00:00 2001 From: sslivkoff Date: Sun, 21 Jan 2024 21:47:56 -0800 Subject: [PATCH 15/49] make partial collections of multi datasets idempotent --- crates/freeze/src/multi_datasets/state_reads.rs | 16 ++++++++-------- crates/freeze/src/types/files.rs | 4 +++- crates/freeze/src/types/summaries.rs | 5 ++--- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/crates/freeze/src/multi_datasets/state_reads.rs b/crates/freeze/src/multi_datasets/state_reads.rs index aa0508c..f046d7b 100644 --- a/crates/freeze/src/multi_datasets/state_reads.rs +++ b/crates/freeze/src/multi_datasets/state_reads.rs @@ -49,10 +49,10 @@ impl CollectByBlock for StateReads { query.schemas.get(&Datatype::NonceReads), query.schemas.get(&Datatype::StorageReads), ) { - (Some(schema), _, _, _) - | (_, Some(schema), _, _) - | (_, _, Some(schema), _) - | (_, _, _, Some(schema)) => schema.has_column("transaction_hash"), + (Some(schema), _, _, _) | + (_, Some(schema), _, _) | + (_, _, Some(schema), _) | + (_, _, _, Some(schema)) => schema.has_column("transaction_hash"), _ => false, }; source.geth_debug_trace_block_prestate(request.block_number()? as u32, include_txs).await @@ -74,10 +74,10 @@ impl CollectByTransaction for StateReads { query.schemas.get(&Datatype::NonceReads), query.schemas.get(&Datatype::StorageReads), ) { - (Some(schema), _, _, _) - | (_, Some(schema), _, _) - | (_, _, Some(schema), _) - | (_, _, _, Some(schema)) => schema.has_column("block_number"), + (Some(schema), _, _, _) | + (_, Some(schema), _, _) | + (_, _, Some(schema), _) | + (_, _, _, Some(schema)) => schema.has_column("block_number"), _ => false, }; let tx = request.transaction_hash()?; diff --git a/crates/freeze/src/types/files.rs b/crates/freeze/src/types/files.rs index 4dccac0..883bcef 100644 --- a/crates/freeze/src/types/files.rs +++ b/crates/freeze/src/types/files.rs @@ -51,7 +51,9 @@ impl FileOutput { }; for meta_datatype in meta_datatypes.iter() { for datatype in meta_datatype.datatypes().into_iter() { - paths.insert(datatype, self.get_path(query, partition, datatype)?); + if query.schemas.get(&datatype).is_some() { + paths.insert(datatype, self.get_path(query, partition, datatype)?); + } } } Ok(paths) diff --git a/crates/freeze/src/types/summaries.rs b/crates/freeze/src/types/summaries.rs index 3c654a1..f760c1d 100644 --- a/crates/freeze/src/types/summaries.rs +++ b/crates/freeze/src/types/summaries.rs @@ -5,9 +5,8 @@ use colored::Colorize; use thousands::Separable; use crate::{ - chunks::chunk_ops::ValueToString, ChunkData, ChunkStats, CollectError, ColumnType, - Datatype, Dim, ExecutionEnv, FileOutput, MetaDatatype, MultiDatatype, Partition, Query, Source, - Table, + chunks::chunk_ops::ValueToString, ChunkData, ChunkStats, CollectError, ColumnType, Datatype, + Dim, ExecutionEnv, FileOutput, MetaDatatype, MultiDatatype, Partition, Query, Source, Table, }; use std::path::PathBuf; From 34b17eb9d67c4c8b64e1645de5efb5fbad3d37b4 Mon Sep 17 00:00:00 2001 From: sslivkoff Date: Thu, 25 Jan 2024 13:32:33 -0800 Subject: [PATCH 16/49] fix block range rounding edge cases --- crates/cli/src/parse/blocks.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/cli/src/parse/blocks.rs b/crates/cli/src/parse/blocks.rs index 38e69ee..80fe1a6 100644 --- a/crates/cli/src/parse/blocks.rs +++ b/crates/cli/src/parse/blocks.rs @@ -335,19 +335,19 @@ async fn parse_block_number( _ if block_ref.ends_with('B') | block_ref.ends_with('b') => { let s = &block_ref[..block_ref.len() - 1]; s.parse::() - .map(|n| (1e9 * n) as u64) + .map(|n| (1e9 * n).round() as u64) .map_err(|_e| ParseError::ParseError("Error parsing block ref".to_string())) } _ if block_ref.ends_with('M') | block_ref.ends_with('m') => { let s = &block_ref[..block_ref.len() - 1]; s.parse::() - .map(|n| (1e6 * n) as u64) + .map(|n| (1e6 * n).round() as u64) .map_err(|_e| ParseError::ParseError("Error parsing block ref".to_string())) } _ if block_ref.ends_with('K') | block_ref.ends_with('k') => { let s = &block_ref[..block_ref.len() - 1]; s.parse::() - .map(|n| (1e3 * n) as u64) + .map(|n| (1e3 * n).round() as u64) .map_err(|_e| ParseError::ParseError("Error parsing block ref".to_string())) } _ => block_ref From 38099658992882aec1f3a2cb9ecd3150c43a4461 Mon Sep 17 00:00:00 2001 From: caentzminger <112503481+caentzminger@users.noreply.github.com> Date: Sat, 3 Feb 2024 16:08:35 -0600 Subject: [PATCH 17/49] Added six columns to blocks (#179) * Added columns to blocks * update blocks schema length in tests --- crates/freeze/src/datasets/blocks.rs | 12 ++++++++++++ crates/freeze/src/types/schemas.rs | 4 ++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/crates/freeze/src/datasets/blocks.rs b/crates/freeze/src/datasets/blocks.rs index b23d823..5b12e58 100644 --- a/crates/freeze/src/datasets/blocks.rs +++ b/crates/freeze/src/datasets/blocks.rs @@ -9,18 +9,24 @@ pub struct Blocks { n_rows: u64, block_hash: Vec>>, parent_hash: Vec>, + uncles_hash: Vec>, author: Vec>>, state_root: Vec>, transactions_root: Vec>, receipts_root: Vec>, block_number: Vec>, gas_used: Vec, + gas_limit: Vec, extra_data: Vec>, logs_bloom: Vec>>, timestamp: Vec, + difficulty: Vec, total_difficulty: Vec>, size: Vec>, + mix_hash: Vec>>, + nonce: Vec>>, base_fee_per_gas: Vec>, + withdrawals_root: Vec>>, chain_id: Vec, } @@ -86,17 +92,23 @@ pub(crate) fn process_block(block: Block, columns: &mut Blocks, schema: store!(schema, columns, block_hash, block.hash.map(|x| x.0.to_vec())); store!(schema, columns, parent_hash, block.parent_hash.0.to_vec()); + store!(schema, columns, uncles_hash, block.uncles_hash.0.to_vec()); store!(schema, columns, author, block.author.map(|x| x.0.to_vec())); store!(schema, columns, state_root, block.state_root.0.to_vec()); store!(schema, columns, transactions_root, block.transactions_root.0.to_vec()); store!(schema, columns, receipts_root, block.receipts_root.0.to_vec()); store!(schema, columns, block_number, block.number.map(|x| x.as_u32())); store!(schema, columns, gas_used, block.gas_used.as_u64()); + store!(schema, columns, gas_limit, block.gas_limit.as_u64()); store!(schema, columns, extra_data, block.extra_data.to_vec()); store!(schema, columns, logs_bloom, block.logs_bloom.map(|x| x.0.to_vec())); store!(schema, columns, timestamp, block.timestamp.as_u32()); + store!(schema, columns, difficulty, block.difficulty.as_u64()); store!(schema, columns, total_difficulty, block.total_difficulty); store!(schema, columns, base_fee_per_gas, block.base_fee_per_gas.map(|x| x.as_u64())); store!(schema, columns, size, block.size.map(|x| x.as_u32())); + store!(schema, columns, mix_hash, block.mix_hash.map(|x| x.0.to_vec())); + store!(schema, columns, nonce, block.nonce.map(|x| x.0.to_vec())); + store!(schema, columns, withdrawals_root, block.withdrawals_root.map(|x| x.0.to_vec())); Ok(()) } diff --git a/crates/freeze/src/types/schemas.rs b/crates/freeze/src/types/schemas.rs index 6584c4e..52be892 100644 --- a/crates/freeze/src/types/schemas.rs +++ b/crates/freeze/src/types/schemas.rs @@ -257,7 +257,7 @@ mod tests { let table = Datatype::Blocks .table_schema(&get_u256_types(), &ColumnEncoding::Hex, &None, &None, &cols, None, None) .unwrap(); - assert_eq!(15, table.columns().len()); + assert_eq!(21, table.columns().len()); assert!(table.columns().contains(&"block_hash")); assert!(table.columns().contains(&"transactions_root")); } @@ -308,7 +308,7 @@ mod tests { None, ) .unwrap(); - assert_eq!(15, table.columns().len()); + assert_eq!(21, table.columns().len()); assert!(table.columns().contains(&"block_hash")); assert!(table.columns().contains(&"transactions_root")); } From 4d1e74bbd98814941e602f238c94ceb2239de707 Mon Sep 17 00:00:00 2001 From: DaniPopes <57450786+DaniPopes@users.noreply.github.com> Date: Fri, 19 Apr 2024 19:16:49 +0200 Subject: [PATCH 18/49] chore: fix nightly, update CI jobs (#187) * ci: update main job * chore: cargo update --- .github/workflows/build_and_test.yml | 72 +- Cargo.lock | 1321 ++++++++++++-------------- 2 files changed, 653 insertions(+), 740 deletions(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index e524aee..df716ab 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -2,63 +2,53 @@ name: Rust on: push: - branches: [ main ] + branches: [main] pull_request: - branches: [ main ] + branches: [main] env: CARGO_TERM_COLOR: always +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + jobs: build: - runs-on: ubuntu-latest - + timeout-minutes: 30 steps: - - uses: actions/checkout@v3 - - name: Build - run: cargo build --verbose - - name: Run tests - run: cargo test --verbose - - lint: - name: code lint - runs-on: ubuntu-latest - steps: - - name: Checkout sources - uses: actions/checkout@v3 - - name: Install toolchain - uses: dtolnay/rust-toolchain@nightly - with: - components: rustfmt, clippy + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable - uses: Swatinem/rust-cache@v2 with: cache-on-failure: true + - name: Build + run: cargo build --workspace + - name: Run tests + run: cargo test --workspace - - name: cargo clippy - uses: actions-rs/clippy-check@v1 + clippy: + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable with: - args: --all --all-features - token: ${{ secrets.GITHUB_TOKEN }} + components: clippy + - uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true + - run: cargo clippy --workspace --all-targets --all-features + env: + RUSTFLAGS: -Dwarnings fmt: runs-on: ubuntu-latest + timeout-minutes: 30 steps: - - name: Checkout sources - uses: actions/checkout@v2 - - - name: Install toolchain - uses: actions-rs/toolchain@v1 + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@nightly with: - toolchain: nightly - profile: minimal - components: rustfmt, clippy - override: true - - - uses: Swatinem/rust-cache@v1 - with: - cache-on-failure: true - - - name: cargo fmt - run: cargo +nightly fmt --all -- --check - + components: rustfmt + - run: cargo fmt --all --check diff --git a/Cargo.lock b/Cargo.lock index 8ba72d3..2dc2a46 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -29,9 +29,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "aes" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac1f845298e95f983ff1944b728ae08b8cebab80d684f0a832ed0fc74dfa27e2" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" dependencies = [ "cfg-if", "cipher", @@ -40,9 +40,9 @@ dependencies = [ [[package]] name = "ahash" -version = "0.8.6" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", "getrandom", @@ -53,9 +53,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] @@ -77,9 +77,9 @@ dependencies = [ [[package]] name = "allocator-api2" -version = "0.2.16" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] name = "android-tzdata" @@ -113,26 +113,26 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.4" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" +checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" [[package]] name = "anstyle-parse" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317b9a89c1868f5ea6ff1d9539a69f45dffc21ce321ac1fd1160dfa48c8e2140" +checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -147,9 +147,9 @@ dependencies = [ [[package]] name = "argminmax" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "202108b46429b765ef483f8a24d5c46f48c14acfdacc086dd4ab6dddf6bcdbd2" +checksum = "52424b59d69d69d5056d508b260553afd91c57e21849579cd1f50ee8b8b88eaa" dependencies = [ "num-traits", ] @@ -204,18 +204,18 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.60", ] [[package]] name = "async-trait" -version = "0.1.74" +version = "0.1.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" +checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.60", ] [[package]] @@ -246,27 +246,26 @@ checksum = "9ae037714f313c1353189ead58ef9eec30a8e8dc101b2622d461418fd59e28a9" [[package]] name = "auto_impl" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fee3da8ef1276b0bee5dd1c7258010d8fffd31801447323115a25560e1327b89" +checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ - "proc-macro-error", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.60", ] [[package]] name = "autocfg" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" [[package]] name = "backtrace" -version = "0.3.69" +version = "0.3.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" dependencies = [ "addr2line", "cc", @@ -291,9 +290,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.5" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "base64ct" @@ -330,9 +329,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" [[package]] name = "bitvec" @@ -357,9 +356,9 @@ dependencies = [ [[package]] name = "brotli" -version = "3.4.0" +version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "516074a47ef4bce09577a3b379392300159ce5b1ba2e501ff1c819950066100f" +checksum = "d640d25bc63c50fb1f0b545ffd80207d2e10a4c965530809b40ba3386825c391" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -378,9 +377,9 @@ dependencies = [ [[package]] name = "bs58" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5353f36341f7451062466f0b755b96ac3a9547e4d7f6b70d603fc721a7d7896" +checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4" dependencies = [ "sha2", "tinyvec", @@ -388,9 +387,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.14.0" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "byte-slice-cast" @@ -400,22 +399,22 @@ checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" [[package]] name = "bytemuck" -version = "1.14.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6" +checksum = "5d6d68c57235a3a081186990eca2867354726650f42f7516ca50c28d6281fd15" dependencies = [ "bytemuck_derive", ] [[package]] name = "bytemuck_derive" -version = "1.5.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "965ab7eb5f8f97d2a083c799f3a1b994fc397b2fe2da5d1da1626ce15a39f2b1" +checksum = "4da9a32f3fed317401fa3c862968128267c3106685286e15d5aaa3d7389c2f60" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.60", ] [[package]] @@ -426,9 +425,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.5.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" dependencies = [ "serde", ] @@ -465,18 +464,18 @@ dependencies = [ [[package]] name = "cargo-platform" -version = "0.1.4" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12024c4645c97566567129c204f65d5815a8c9aecf30fcbe682b2fe034996d36" +checksum = "24b1f0365a6c6bb4020cd05806fd0d33c44d38046b8bd7f0e40814b9763cabfc" dependencies = [ "serde", ] [[package]] name = "cargo_metadata" -version = "0.17.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7daec1a2a2129eeba1644b220b4647ec537b0b5d4bfd6876fcc5a540056b592" +checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" dependencies = [ "camino", "cargo-platform", @@ -488,9 +487,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.83" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +checksum = "17f6e324229dc011159fcc089755d1e2e216a90d43a7dea6853ca740b84f35e7" dependencies = [ "jobserver", "libc", @@ -504,9 +503,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.31" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ "android-tzdata", "iana-time-zone", @@ -514,7 +513,7 @@ dependencies = [ "num-traits", "serde", "wasm-bindgen", - "windows-targets 0.48.5", + "windows-targets 0.52.5", ] [[package]] @@ -559,7 +558,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.60", ] [[package]] @@ -606,7 +605,7 @@ version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5286a0843c21f8367f7be734f89df9b822e0321d8bcce8d6e735aadff7d74979" dependencies = [ - "base64 0.21.5", + "base64 0.21.7", "bech32", "bs58", "digest", @@ -649,45 +648,44 @@ checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[package]] name = "colored" -version = "2.0.4" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2674ec482fbc38012cf31e6c42ba0177b431a0cb6f15fe40efa5aab1bda516f6" +checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" dependencies = [ - "is-terminal", "lazy_static", "windows-sys 0.48.0", ] [[package]] name = "comfy-table" -version = "7.1.0" +version = "7.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c64043d6c7b7a4c58e39e7efccfdea7b93d885a795d0c054a69dbbf4dd52686" +checksum = "b34115915337defe99b2aff5c2ce6771e5fbc4079f4b506301f5cf394c8452f7" dependencies = [ "crossterm", "strum", - "strum_macros", + "strum_macros 0.26.2", "unicode-width", ] [[package]] name = "console" -version = "0.15.7" +version = "0.15.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c926e00cc70edefdc64d3a5ff31cc65bb97a3460097762bd23afb4d8145fccf8" +checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb" dependencies = [ "encode_unicode", "lazy_static", "libc", "unicode-width", - "windows-sys 0.45.0", + "windows-sys 0.52.0", ] [[package]] name = "const-hex" -version = "1.10.0" +version = "1.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5104de16b218eddf8e34ffe2f86f74bfa4e61e95a1b89732fccf6325efd0557" +checksum = "5ba00838774b4ab0233e355d26710fbfc8327a05c017f6dc4873f876d1f79f78" dependencies = [ "cfg-if", "cpufeatures", @@ -698,9 +696,9 @@ dependencies = [ [[package]] name = "const-oid" -version = "0.9.5" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" [[package]] name = "constant_time_eq" @@ -710,9 +708,9 @@ checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" [[package]] name = "core-foundation" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" dependencies = [ "core-foundation-sys", "libc", @@ -720,80 +718,70 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.4" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "cpufeatures" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" dependencies = [ "libc", ] [[package]] name = "crc32fast" -version = "1.3.2" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" dependencies = [ "cfg-if", ] [[package]] name = "crossbeam-channel" -version = "0.5.8" +version = "0.5.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" +checksum = "ab3db02a9c5b5121e1e42fbdb1aeb65f5e02624cc58c43f2884c6ccac0b82f95" dependencies = [ - "cfg-if", "crossbeam-utils", ] [[package]] name = "crossbeam-deque" -version = "0.8.3" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" dependencies = [ - "cfg-if", "crossbeam-epoch", "crossbeam-utils", ] [[package]] name = "crossbeam-epoch" -version = "0.9.15" +version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" dependencies = [ - "autocfg", - "cfg-if", "crossbeam-utils", - "memoffset", - "scopeguard", ] [[package]] name = "crossbeam-queue" -version = "0.3.8" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1cfb3ea8a53f37c40dea2c7bedcbd88bdfae54f5e2175d6ecaff1c988353add" +checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" dependencies = [ - "cfg-if", "crossbeam-utils", ] [[package]] name = "crossbeam-utils" -version = "0.8.16" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" -dependencies = [ - "cfg-if", -] +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" [[package]] name = "crossterm" @@ -801,7 +789,7 @@ version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f476fe445d41c9e991fd07515a6f463074b782242ccf4a5b7b1d1012e70824df" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.5.0", "crossterm_winapi", "libc", "parking_lot", @@ -857,7 +845,7 @@ dependencies = [ "futures", "governor", "heck", - "indexmap 2.1.0", + "indexmap", "indicatif", "lazy_static", "mesc", @@ -889,7 +877,7 @@ dependencies = [ name = "cryo_to_df" version = "0.3.2" dependencies = [ - "indexmap 2.1.0", + "indexmap", "proc-macro2", "quote", "syn 1.0.109", @@ -897,9 +885,9 @@ dependencies = [ [[package]] name = "crypto-bigint" -version = "0.5.3" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "740fe28e594155f10cfc383984cbefd529d7396050557148f79cb0f621204124" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array", "rand_core", @@ -933,7 +921,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" dependencies = [ "cfg-if", - "hashbrown 0.14.2", + "hashbrown", "lock_api", "once_cell", "parking_lot_core", @@ -941,15 +929,15 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" +checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" [[package]] name = "der" -version = "0.7.8" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" dependencies = [ "const-oid", "zeroize", @@ -957,9 +945,9 @@ dependencies = [ [[package]] name = "deranged" -version = "0.3.9" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f32d04922c60427da6f9fef14d042d9edddef64cb9d4ce0d64d0685fbeb1fd3" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" dependencies = [ "powerfmt", ] @@ -975,12 +963,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "diff" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" - [[package]] name = "digest" version = "0.10.7" @@ -1043,15 +1025,15 @@ checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" [[package]] name = "dyn-clone" -version = "1.0.14" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23d2f3407d9a573d666de4b5bdf10569d73ca9478087346697dcbae6244bfbcd" +checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" [[package]] name = "ecdsa" -version = "0.16.8" +version = "0.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4b1e0c257a9e9f25f90ff76d7a68360ed497ee519c8e428d1825ef0000799d4" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" dependencies = [ "der", "digest", @@ -1063,15 +1045,15 @@ dependencies = [ [[package]] name = "either" -version = "1.9.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" [[package]] name = "elliptic-curve" -version = "0.13.6" +version = "0.13.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d97ca172ae9dc9f9b779a6e3a65d308f2af74e5b8c921299075bdb4a0370e914" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" dependencies = [ "base16ct", "crypto-bigint", @@ -1103,20 +1085,20 @@ checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" [[package]] name = "encoding_rs" -version = "0.8.33" +version = "0.8.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" +checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" dependencies = [ "cfg-if", ] [[package]] name = "enr" -version = "0.9.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe81b5c06ecfdbc71dd845216f225f53b62a10cb8a16c946836a3467f701d05b" +checksum = "2a3d8dc56e02f954cac8eb489772c552c473346fc34f67412bb6244fd647f7e4" dependencies = [ - "base64 0.21.5", + "base64 0.21.7", "bytes", "hex", "k256", @@ -1130,14 +1112,14 @@ dependencies = [ [[package]] name = "enum_dispatch" -version = "0.3.12" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f33313078bb8d4d05a2733a94ac4c2d8a0df9a2b84424ebf4f33bfc224a890e" +checksum = "aa18ce2bc66555b3218614519ac839ddb759a7d6720732f979ef8d13be147ecd" dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.60", ] [[package]] @@ -1148,12 +1130,12 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.5" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3e13f66a2f95e32a39eaa81f6b95d42878ca0e1db0c7543723dfe12557e860" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" dependencies = [ "libc", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -1228,9 +1210,9 @@ dependencies = [ [[package]] name = "ethers" -version = "2.0.10" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad13497f6e0a24292fc7b408e30d22fe9dc262da1f40d7b542c3a44e7fc0476" +checksum = "816841ea989f0c69e459af1cf23a6b0033b19a55424a1ea3a30099becdb8dec0" dependencies = [ "ethers-addressbook", "ethers-contract", @@ -1244,9 +1226,9 @@ dependencies = [ [[package]] name = "ethers-addressbook" -version = "2.0.10" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6e9e8acd0ed348403cc73a670c24daba3226c40b98dc1a41903766b3ab6240a" +checksum = "5495afd16b4faa556c3bba1f21b98b4983e53c1755022377051a975c3b021759" dependencies = [ "ethers-core", "once_cell", @@ -1256,9 +1238,9 @@ dependencies = [ [[package]] name = "ethers-contract" -version = "2.0.10" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d79269278125006bb0552349c03593ffa9702112ca88bc7046cc669f148fb47c" +checksum = "6fceafa3578c836eeb874af87abacfb041f92b4da0a78a5edd042564b8ecdaaa" dependencies = [ "const-hex", "ethers-contract-abigen", @@ -1275,9 +1257,9 @@ dependencies = [ [[package]] name = "ethers-contract-abigen" -version = "2.0.10" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce95a43c939b2e4e2f3191c5ad4a1f279780b8a39139c9905b43a7433531e2ab" +checksum = "04ba01fbc2331a38c429eb95d4a570166781f14290ef9fdb144278a90b5a739b" dependencies = [ "Inflector", "const-hex", @@ -1292,16 +1274,16 @@ dependencies = [ "reqwest", "serde", "serde_json", - "syn 2.0.38", + "syn 2.0.60", "toml", "walkdir", ] [[package]] name = "ethers-contract-derive" -version = "2.0.10" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9ce44906fc871b3ee8c69a695ca7ec7f70e50cb379c9b9cb5e532269e492f6" +checksum = "87689dcabc0051cde10caaade298f9e9093d65f6125c14575db3fd8c669a168f" dependencies = [ "Inflector", "const-hex", @@ -1310,14 +1292,14 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.38", + "syn 2.0.60", ] [[package]] name = "ethers-core" -version = "2.0.10" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0a17f0708692024db9956b31d7a20163607d2745953f5ae8125ab368ba280ad" +checksum = "82d80cc6ad30b14a48ab786523af33b37f28a8623fc06afd55324816ef18fb1f" dependencies = [ "arrayvec", "bytes", @@ -1336,7 +1318,7 @@ dependencies = [ "serde", "serde_json", "strum", - "syn 2.0.38", + "syn 2.0.60", "tempfile", "thiserror", "tiny-keccak", @@ -1345,10 +1327,11 @@ dependencies = [ [[package]] name = "ethers-etherscan" -version = "2.0.10" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e53451ea4a8128fbce33966da71132cf9e1040dcfd2a2084fd7733ada7b2045" +checksum = "e79e5973c26d4baf0ce55520bd732314328cabe53193286671b47144145b9649" dependencies = [ + "chrono", "ethers-core", "reqwest", "semver", @@ -1360,9 +1343,9 @@ dependencies = [ [[package]] name = "ethers-middleware" -version = "2.0.10" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "473f1ccd0c793871bbc248729fa8df7e6d2981d6226e4343e3bbaa9281074d5d" +checksum = "48f9fdf09aec667c099909d91908d5eaf9be1bd0e2500ba4172c1d28bfaa43de" dependencies = [ "async-trait", "auto_impl", @@ -1387,13 +1370,13 @@ dependencies = [ [[package]] name = "ethers-providers" -version = "2.0.10" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6838fa110e57d572336178b7c79e94ff88ef976306852d8cb87d9e5b1fc7c0b5" +checksum = "6434c9a33891f1effc9c75472e12666db2fa5a0fec4b29af6221680a6fe83ab2" dependencies = [ "async-trait", "auto_impl", - "base64 0.21.5", + "base64 0.21.7", "bytes", "const-hex", "enr", @@ -1426,9 +1409,9 @@ dependencies = [ [[package]] name = "ethers-signers" -version = "2.0.10" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ea44bec930f12292866166f9ddbea6aa76304850e4d8dcd66dc492b43d00ff1" +checksum = "228875491c782ad851773b652dd8ecac62cda8571d3bc32a5853644dd26766c2" dependencies = [ "async-trait", "coins-bip32", @@ -1445,9 +1428,9 @@ dependencies = [ [[package]] name = "ethers-solc" -version = "2.0.10" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de34e484e7ae3cab99fbfd013d6c5dc7f9013676a4e0e414d8b12e1213e8b3ba" +checksum = "66244a771d9163282646dbeffe0e6eca4dda4146b6498644e678ac6089b11edd" dependencies = [ "cfg-if", "const-hex", @@ -1483,9 +1466,9 @@ checksum = "b90ca2580b73ab6a1f724b76ca11ab632df820fd6040c336200d2c1df7b3c82c" [[package]] name = "eyre" -version = "0.6.8" +version = "0.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c2b6b5a29c02cdc822728b7d7b8ae1bab3e3b05d44522770ddd49722eeac7eb" +checksum = "7cd915d99f24784cdc19fd37ef22b97e3ff0ae756c7e492e9fbfe897d61e2aec" dependencies = [ "indenter", "once_cell", @@ -1505,9 +1488,9 @@ checksum = "95765f67b4b18863968b4a1bd5bb576f732b29a4a28c7cd84c09fa3e2875f33c" [[package]] name = "fastrand" -version = "2.0.1" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" +checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984" [[package]] name = "ff" @@ -1570,9 +1553,9 @@ checksum = "ee1b05cbd864bcaecbd3455d6d967862d446e4ebfc3c2e5e5b9841e53cba6673" [[package]] name = "form_urlencoded" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ "percent-encoding", ] @@ -1595,9 +1578,9 @@ checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] name = "futures" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0290714b38af9b4a7b094b8a37086d1b4e61f2df9122c3cad2577669145335" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" dependencies = [ "futures-channel", "futures-core", @@ -1610,9 +1593,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" dependencies = [ "futures-core", "futures-sink", @@ -1620,15 +1603,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "futures-executor" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f4fb8693db0cf099eadcca0efe2a5a22e4550f98ed16aba6c48700da29597bc" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" dependencies = [ "futures-core", "futures-task", @@ -1637,9 +1620,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bf34a163b5c4c52d0478a4d757da8fb65cabef42ba90515efee0f6f9fa45aaa" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" [[package]] name = "futures-locks" @@ -1653,32 +1636,32 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.60", ] [[package]] name = "futures-sink" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" [[package]] name = "futures-task" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-timer" -version = "3.0.2" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" +checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" dependencies = [ "gloo-timers", "send_wrapper 0.4.0", @@ -1686,9 +1669,9 @@ dependencies = [ [[package]] name = "futures-util" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ "futures-channel", "futures-core", @@ -1724,9 +1707,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.10" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +checksum = "94b22e06ecb0110981051723910cbf0b5f5e09a2062dd7663334ee79a9d1286c" dependencies = [ "cfg-if", "js-sys", @@ -1737,9 +1720,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.0" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] name = "glob" @@ -1761,9 +1744,9 @@ dependencies = [ [[package]] name = "governor" -version = "0.6.0" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "821239e5672ff23e2a7060901fa622950bbd80b649cdaadd78d1c1767ed14eb4" +checksum = "68a7f542ee6b35af73b06abc0dad1c1bae89964e4e253bc4b587b91c9637867b" dependencies = [ "cfg-if", "dashmap", @@ -1772,9 +1755,11 @@ dependencies = [ "no-std-compat", "nonzero_ext", "parking_lot", + "portable-atomic", "quanta", "rand", "smallvec", + "spinning_top", ] [[package]] @@ -1790,9 +1775,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.21" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91fc23aa11be92976ef4729127f1a74adf36d8436f7816b185d18df956790833" +checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" dependencies = [ "bytes", "fnv", @@ -1800,7 +1785,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap 1.9.3", + "indexmap", "slab", "tokio", "tokio-util", @@ -1809,34 +1794,19 @@ dependencies = [ [[package]] name = "halfbrown" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5681137554ddff44396e5f149892c769d45301dd9aa19c51602a89ee214cb0ec" +checksum = "8588661a8607108a5ca69cab034063441a0413a0b041c13618a7dd348021ef6f" dependencies = [ - "hashbrown 0.13.2", + "hashbrown", "serde", ] [[package]] name = "hashbrown" -version = "0.12.3" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - -[[package]] -name = "hashbrown" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" -dependencies = [ - "ahash", -] - -[[package]] -name = "hashbrown" -version = "0.14.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ "ahash", "allocator-api2", @@ -1860,9 +1830,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.3.3" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "hex" @@ -1881,18 +1851,18 @@ dependencies = [ [[package]] name = "home" -version = "0.5.5" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "http" -version = "0.2.9" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" dependencies = [ "bytes", "fnv", @@ -1901,9 +1871,9 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ "bytes", "http", @@ -1924,9 +1894,9 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hyper" -version = "0.14.27" +version = "0.14.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" +checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" dependencies = [ "bytes", "futures-channel", @@ -1939,7 +1909,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2 0.4.10", + "socket2", "tokio", "tower-service", "tracing", @@ -1962,16 +1932,16 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.58" +version = "0.1.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8326b86b6cff230b97d0d312a6c40a60726df3332e721f72a1b035f451663b20" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "windows-core 0.51.1", + "windows-core", ] [[package]] @@ -1985,9 +1955,9 @@ dependencies = [ [[package]] name = "idna" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -2039,29 +2009,19 @@ checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" [[package]] name = "indexmap" -version = "1.9.3" +version = "2.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", -] - -[[package]] -name = "indexmap" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", - "hashbrown 0.14.2", + "hashbrown", ] [[package]] name = "indicatif" -version = "0.17.7" +version = "0.17.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb28741c9db9a713d93deb3bb9515c20788cef5815265bee4980e87bde7e0f25" +checksum = "763a5a8f45087d6bcea4222e7b72c291a054edf80e4ef6efd2a4979878c7bea3" dependencies = [ "console", "instant", @@ -2072,9 +2032,9 @@ dependencies = [ [[package]] name = "indoc" -version = "2.0.4" +version = "2.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e186cfbae8084e513daff4240b4797e342f988cecda4fb6c939150f96315fd8" +checksum = "b248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5" [[package]] name = "inout" @@ -2102,22 +2062,13 @@ checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] name = "is-terminal" -version = "0.4.9" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" +checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" dependencies = [ "hermit-abi", - "rustix", - "windows-sys 0.48.0", -] - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", + "libc", + "windows-sys 0.52.0", ] [[package]] @@ -2131,24 +2082,24 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.9" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "jobserver" -version = "0.1.27" +version = "0.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d" +checksum = "685a7d121ee3f65ae4fddd72b25a04bb36b6af81bc0828f7d5434c0fe60fa3a2" dependencies = [ "libc", ] [[package]] name = "js-sys" -version = "0.3.65" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54c0c35952f67de54bb584e9fd912b3023117cbafc0a77d8f3dee1fb5f572fe8" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ "wasm-bindgen", ] @@ -2159,7 +2110,7 @@ version = "8.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6971da4d9c3aa03c3d8f3ff0f4155b534aad021292003895a469716b2a230378" dependencies = [ - "base64 0.21.5", + "base64 0.21.7", "pem", "ring 0.16.20", "serde", @@ -2169,9 +2120,9 @@ dependencies = [ [[package]] name = "k256" -version = "0.13.1" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cadb76004ed8e97623117f3df85b17aaa6626ab0b0831e6573f104df16cd1bcc" +checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" dependencies = [ "cfg-if", "ecdsa", @@ -2183,40 +2134,42 @@ dependencies = [ [[package]] name = "keccak" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f6d5ed8676d904364de097082f4e7d240b571b67989ced0240f08b7f966f940" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" dependencies = [ "cpufeatures", ] [[package]] name = "lalrpop" -version = "0.20.0" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da4081d44f4611b66c6dd725e6de3169f9f63905421e8626fcb86b6a898998b8" +checksum = "55cb077ad656299f160924eb2912aa147d7339ea7d69e1b5517326fdcec3c1ca" dependencies = [ "ascii-canvas", "bit-set", - "diff", "ena", - "is-terminal", - "itertools 0.10.5", + "itertools", "lalrpop-util", "petgraph", "regex", - "regex-syntax 0.7.5", + "regex-syntax", "string_cache", "term", "tiny-keccak", "unicode-xid", + "walkdir", ] [[package]] name = "lalrpop-util" -version = "0.20.0" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f35c735096c0293d313e8f2a641627472b83d01b937177fe76e5e2708d31e0d" +checksum = "507460a910eb7b32ee961886ff48539633b788a36b65692b95f225b844c82553" +dependencies = [ + "regex-automata", +] [[package]] name = "lazy_static" @@ -2290,9 +2243,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.152" +version = "0.2.153" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "libm" @@ -2301,10 +2254,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" [[package]] -name = "linux-raw-sys" -version = "0.4.10" +name = "libredox" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags 2.5.0", + "libc", +] + +[[package]] +name = "linux-raw-sys" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" [[package]] name = "lock_api" @@ -2318,9 +2281,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.20" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] name = "lz4" @@ -2342,15 +2305,6 @@ dependencies = [ "libc", ] -[[package]] -name = "mach2" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d0d1830bcd151a6fc4aea1369af235b36c1528fe976b8ff678683c9995eade8" -dependencies = [ - "libc", -] - [[package]] name = "md-5" version = "0.10.6" @@ -2363,9 +2317,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.6.4" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" [[package]] name = "memmap2" @@ -2378,9 +2332,9 @@ dependencies = [ [[package]] name = "memoffset" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" dependencies = [ "autocfg", ] @@ -2410,18 +2364,18 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" dependencies = [ "adler", ] [[package]] name = "mio" -version = "0.8.9" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" dependencies = [ "libc", "wasi", @@ -2430,9 +2384,9 @@ dependencies = [ [[package]] name = "multiversion" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2c7b9d7fe61760ce5ea19532ead98541f6b4c495d87247aff9826445cf6872a" +checksum = "c4851161a11d3ad0bf9402d90ffc3967bf231768bfd7aeb61755ad06dbf1a142" dependencies = [ "multiversion-macros", "target-features", @@ -2440,9 +2394,9 @@ dependencies = [ [[package]] name = "multiversion-macros" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26a83d8500ed06d68877e9de1dde76c1dbb83885dcdbda4ef44ccbc3fbda2ac8" +checksum = "79a74ddee9e0c27d2578323c13905793e91622148f138ba29738f9dddb835e90" dependencies = [ "proc-macro2", "quote", @@ -2452,9 +2406,9 @@ dependencies = [ [[package]] name = "new_debug_unreachable" -version = "1.0.4" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" +checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" [[package]] name = "no-std-compat" @@ -2508,20 +2462,25 @@ dependencies = [ ] [[package]] -name = "num-integer" -version = "0.1.45" +name = "num-conv" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" dependencies = [ - "autocfg", "num-traits", ] [[package]] name = "num-traits" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" dependencies = [ "autocfg", "libm", @@ -2539,23 +2498,23 @@ dependencies = [ [[package]] name = "num_enum" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "683751d591e6d81200c39fb0d1032608b77724f34114db54f571ff1317b337c0" +checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845" dependencies = [ "num_enum_derive", ] [[package]] name = "num_enum_derive" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c11e44798ad209ccdd91fc192f0526a369a01234f7373e1b141c96d7cee4f0e" +checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" dependencies = [ - "proc-macro-crate 2.0.0", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.60", ] [[package]] @@ -2566,18 +2525,18 @@ checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" [[package]] name = "object" -version = "0.32.1" +version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "open-fastrlp" @@ -2612,9 +2571,9 @@ checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" [[package]] name = "parity-scale-codec" -version = "3.6.5" +version = "3.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dec8a8073036902368c2cdc0387e85ff9a37054d7e7c98e592145e0c92cd4fb" +checksum = "881331e34fa842a2fb61cc2db9643a8fedc615e47cfcc52597d1af0db9a7e8fe" dependencies = [ "arrayvec", "bitvec", @@ -2626,11 +2585,11 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "3.6.5" +version = "3.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "312270ee71e1cd70289dacf597cab7b207aa107d2f28191c2ae45b2ece18a260" +checksum = "be30eaf4b0a9fba5336683b38de57bb86d179a35862ba6bfcf57625d006bde5b" dependencies = [ - "proc-macro-crate 1.3.1", + "proc-macro-crate 2.0.0", "proc-macro2", "quote", "syn 1.0.109", @@ -2654,7 +2613,7 @@ checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.4.1", + "redox_syscall", "smallvec", "windows-targets 0.48.5", ] @@ -2719,9 +2678,9 @@ dependencies = [ [[package]] name = "percent-encoding" -version = "2.3.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "petgraph" @@ -2730,7 +2689,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" dependencies = [ "fixedbitset", - "indexmap 2.1.0", + "indexmap", ] [[package]] @@ -2773,7 +2732,7 @@ dependencies = [ "phf_shared 0.11.2", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.60", ] [[package]] @@ -2796,29 +2755,29 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.1.3" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" +checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.3" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" +checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.60", ] [[package]] name = "pin-project-lite" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pin-utils" @@ -2838,9 +2797,9 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.27" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "planus" @@ -2885,7 +2844,7 @@ dependencies = [ "foreign_vec", "futures", "getrandom", - "hashbrown 0.14.2", + "hashbrown", "itoa", "lz4", "multiversion", @@ -2897,7 +2856,7 @@ dependencies = [ "streaming-iterator", "strength_reduce", "version_check", - "zstd 0.13.0", + "zstd 0.13.1", ] [[package]] @@ -2920,13 +2879,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d0f5efe734b6cbe5f97ea769be8360df5324fade396f1f3f5ad7fe9360ca4a23" dependencies = [ "ahash", - "bitflags 2.4.1", + "bitflags 2.5.0", "bytemuck", "chrono", "comfy-table", "either", - "hashbrown 0.14.2", - "indexmap 2.1.0", + "hashbrown", + "indexmap", "num-traits", "once_cell", "polars-arrow", @@ -3003,8 +2962,8 @@ dependencies = [ "ahash", "chrono", "fallible-streaming-iterator", - "hashbrown 0.14.2", - "indexmap 2.1.0", + "hashbrown", + "indexmap", "itoa", "num-traits", "polars-arrow", @@ -3022,7 +2981,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d7105b40905bb38e8fc4a7fd736594b7491baa12fad3ac492969ca221a1b5d5" dependencies = [ "ahash", - "bitflags 2.4.1", + "bitflags 2.5.0", "glob", "once_cell", "polars-arrow", @@ -3047,12 +3006,12 @@ checksum = "2e09afc456ab11e75e5dcb43e00a01c71f3a46a2781e450054acb6bb096ca78e" dependencies = [ "ahash", "argminmax", - "base64 0.21.5", + "base64 0.21.7", "bytemuck", "either", - "hashbrown 0.14.2", + "hashbrown", "hex", - "indexmap 2.1.0", + "indexmap", "memchr", "num-traits", "polars-arrow", @@ -3074,7 +3033,7 @@ checksum = "7ba24d67b1f64ab85143033dd46fa090b13c0f74acdf91b0780c16aecf005e3d" dependencies = [ "ahash", "async-stream", - "base64 0.21.5", + "base64 0.21.7", "brotli", "ethnum", "flate2", @@ -3089,7 +3048,7 @@ dependencies = [ "simdutf8", "snap", "streaming-decompression", - "zstd 0.13.0", + "zstd 0.13.1", ] [[package]] @@ -3101,7 +3060,7 @@ dependencies = [ "crossbeam-channel", "crossbeam-queue", "enum_dispatch", - "hashbrown 0.14.2", + "hashbrown", "num-traits", "polars-arrow", "polars-compute", @@ -3137,7 +3096,7 @@ dependencies = [ "rayon", "regex", "smartstring", - "strum_macros", + "strum_macros 0.25.3", "version_check", ] @@ -3196,8 +3155,8 @@ checksum = "b174ca4a77ad47d7b91a0460aaae65bbf874c8bfbaaa5308675dadef3976bbda" dependencies = [ "ahash", "bytemuck", - "hashbrown 0.14.2", - "indexmap 2.1.0", + "hashbrown", + "indexmap", "num-traits", "once_cell", "polars-error", @@ -3209,9 +3168,9 @@ dependencies = [ [[package]] name = "portable-atomic" -version = "1.5.1" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bccab0e7fd7cc19f820a1c8c91720af652d0c88dc9664dd72aef2614f04af3b" +checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" [[package]] name = "powerfmt" @@ -3242,12 +3201,12 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.15" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d" +checksum = "5ac2cf0f2e4f42b49f5ffd07dae8d746508ef7526c13940e5f524012ae6c6550" dependencies = [ "proc-macro2", - "syn 2.0.38", + "syn 2.0.60", ] [[package]] @@ -3284,65 +3243,51 @@ dependencies = [ ] [[package]] -name = "proc-macro-error" -version = "1.0.4" +name = "proc-macro-crate" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn 1.0.109", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check", + "toml_edit 0.21.1", ] [[package]] name = "proc-macro2" -version = "1.0.69" +version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" +checksum = "3d1597b0c024618f09a9c3b8655b7e430397a36d23fdafec26d6965e9eec3eba" dependencies = [ "unicode-ident", ] [[package]] name = "proptest" -version = "1.3.1" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c003ac8c77cb07bb74f5f198bce836a689bcd5a42574612bf14d17bfd08c20e" +checksum = "31b476131c3c86cb68032fdc5cb6d5a1045e3e42d96b69fa599fd77701e1f5bf" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.5.0", "lazy_static", "num-traits", "rand", "rand_chacha", "rand_xorshift", - "regex-syntax 0.7.5", + "regex-syntax", "unarray", ] [[package]] name = "pyo3" -version = "0.20.0" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04e8453b658fe480c3e70c8ed4e3d3ec33eb74988bd186561b0cc66b85c3bc4b" +checksum = "53bdbb96d49157e65d45cc287af5f32ffadd5f4761438b527b055fb0d4bb8233" dependencies = [ "cfg-if", "indoc", "libc", "memoffset", "parking_lot", + "portable-atomic", "pyo3-build-config", "pyo3-ffi", "pyo3-macros", @@ -3364,9 +3309,9 @@ dependencies = [ [[package]] name = "pyo3-build-config" -version = "0.20.0" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a96fe70b176a89cff78f2fa7b3c930081e163d5379b4dcdf993e3ae29ca662e5" +checksum = "deaa5745de3f5231ce10517a1f5dd97d53e5a2fd77aa6b5842292085831d48d7" dependencies = [ "once_cell", "target-lexicon", @@ -3374,9 +3319,9 @@ dependencies = [ [[package]] name = "pyo3-ffi" -version = "0.20.0" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "214929900fd25e6604661ed9cf349727c8920d47deff196c4e28165a6ef2a96b" +checksum = "62b42531d03e08d4ef1f6e85a2ed422eb678b8cd62b762e53891c05faf0d4afa" dependencies = [ "libc", "pyo3-build-config", @@ -3384,26 +3329,27 @@ dependencies = [ [[package]] name = "pyo3-macros" -version = "0.20.0" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dac53072f717aa1bfa4db832b39de8c875b7c7af4f4a6fe93cdbf9264cf8383b" +checksum = "7305c720fa01b8055ec95e484a6eca7a83c841267f0dd5280f0c8b8551d2c158" dependencies = [ "proc-macro2", "pyo3-macros-backend", "quote", - "syn 2.0.38", + "syn 2.0.60", ] [[package]] name = "pyo3-macros-backend" -version = "0.20.0" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7774b5a8282bd4f25f803b1f0d945120be959a36c72e08e7cd031c792fdfd424" +checksum = "7c7e9b68bb9c3149c5b0cade5d07f953d6d125eb4337723c4ccdb665f1f96185" dependencies = [ "heck", "proc-macro2", + "pyo3-build-config", "quote", - "syn 2.0.38", + "syn 2.0.60", ] [[package]] @@ -3420,13 +3366,12 @@ dependencies = [ [[package]] name = "quanta" -version = "0.11.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a17e662a7a8291a865152364c20c7abc5e60486ab2001e8ec10b24862de0b9ab" +checksum = "8e5167a477619228a0b284fac2674e3c388cba90631d7b7de620e6f1fcd08da5" dependencies = [ "crossbeam-utils", "libc", - "mach2", "once_cell", "raw-cpuid", "wasi", @@ -3436,9 +3381,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.33" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -3500,18 +3445,18 @@ dependencies = [ [[package]] name = "raw-cpuid" -version = "10.7.0" +version = "11.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c297679cb867470fa8c9f67dbba74a78d78e3e98d7cf2b08d6d71540f797332" +checksum = "9d86a7c4638d42c44551f4791a20e687dbb4c3de1f33c43dd71e355cd429def1" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.5.0", ] [[package]] name = "rayon" -version = "1.8.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" dependencies = [ "either", "rayon-core", @@ -3519,23 +3464,14 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.12.0" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" dependencies = [ "crossbeam-deque", "crossbeam-utils", ] -[[package]] -name = "redox_syscall" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" -dependencies = [ - "bitflags 1.3.2", -] - [[package]] name = "redox_syscall" version = "0.4.1" @@ -3547,77 +3483,71 @@ dependencies = [ [[package]] name = "redox_users" -version = "0.4.3" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" dependencies = [ "getrandom", - "redox_syscall 0.2.16", + "libredox", "thiserror", ] [[package]] name = "ref-cast" -version = "1.0.20" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acde58d073e9c79da00f2b5b84eed919c8326832648a5b109b3fce1bb1175280" +checksum = "c4846d4c50d1721b1a3bef8af76924eef20d5e723647333798c1b519b3a9473f" dependencies = [ "ref-cast-impl", ] [[package]] name = "ref-cast-impl" -version = "1.0.20" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f7473c2cfcf90008193dd0e3e16599455cb601a9fce322b5bb55de799664925" +checksum = "5fddb4f8d99b0a2ebafc65a87a69a7b9875e4b1ae1f00db265d300ef7f28bccc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.60", ] [[package]] name = "regex" -version = "1.10.2" +version = "1.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" +checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" dependencies = [ "aho-corasick", "memchr", "regex-automata", - "regex-syntax 0.8.2", + "regex-syntax", ] [[package]] name = "regex-automata" -version = "0.4.3" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" +checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.2", + "regex-syntax", ] [[package]] name = "regex-syntax" -version = "0.7.5" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" - -[[package]] -name = "regex-syntax" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" [[package]] name = "reqwest" -version = "0.11.22" +version = "0.11.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "046cd98826c46c2ac8ddecae268eb5c2e58628688a5fc7a2643704a73faba95b" +checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" dependencies = [ - "base64 0.21.5", + "base64 0.21.7", "bytes", "encoding_rs", "futures-core", @@ -3639,6 +3569,7 @@ dependencies = [ "serde", "serde_json", "serde_urlencoded", + "sync_wrapper", "system-configuration", "tokio", "tokio-rustls", @@ -3678,16 +3609,17 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.5" +version = "0.17.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb0205304757e5d899b9c2e448b867ffd03ae7f988002e47cd24954391394d0b" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", + "cfg-if", "getrandom", "libc", "spin 0.9.8", "untrusted 0.9.0", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -3744,36 +3676,36 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.21" +version = "0.38.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b426b0506e5d50a7d8dafcf2e81471400deb602392c7dd110815afb4eaf02a3" +checksum = "65e04861e65f21776e67888bfbea442b3642beaa0138fdb1dd7a84a52dffdb89" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.5.0", "errno", "libc", "linux-raw-sys", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "rustls" -version = "0.21.8" +version = "0.21.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "446e14c5cda4f3f30fe71863c34ec70f5ac79d6087097ad0bb433e1be5edf04c" +checksum = "7fecbfb7b1444f477b345853b1fce097a2c6fb637b2bfb87e6bc5db0f043fae4" dependencies = [ "log", - "ring 0.17.5", + "ring 0.17.8", "rustls-webpki", "sct", ] [[package]] name = "rustls-pemfile" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" dependencies = [ - "base64 0.21.5", + "base64 0.21.7", ] [[package]] @@ -3782,21 +3714,21 @@ version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ - "ring 0.17.5", + "ring 0.17.8", "untrusted 0.9.0", ] [[package]] name = "rustversion" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" +checksum = "80af6f9131f277a45a3fba6ce8e2258037bb0477a67e610d3c1fe046ab31de47" [[package]] name = "ryu" -version = "1.0.15" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" [[package]] name = "salsa20" @@ -3818,9 +3750,9 @@ dependencies = [ [[package]] name = "scale-info" -version = "2.10.0" +version = "2.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f7d66a1128282b7ef025a8ead62a4a9fcf017382ec53b8ffbf4d7bf77bd3c60" +checksum = "7c453e59a955f81fb62ee5d596b450383d699f152d350e9d23a0db2adb78e4c0" dependencies = [ "cfg-if", "derive_more", @@ -3830,9 +3762,9 @@ dependencies = [ [[package]] name = "scale-info-derive" -version = "2.10.0" +version = "2.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abf2c68b89cafb3b8d918dd07b42be0da66ff202cf1155c5739a4e0c1ea0dc19" +checksum = "18cf6c6447f813ef19eb450e985bcce6705f9ce7660db221b59093d15c79c4b7" dependencies = [ "proc-macro-crate 1.3.1", "proc-macro2", @@ -3864,7 +3796,7 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ - "ring 0.17.5", + "ring 0.17.8", "untrusted 0.9.0", ] @@ -3884,9 +3816,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.20" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" +checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" dependencies = [ "serde", ] @@ -3911,29 +3843,29 @@ checksum = "a3f0bf26fd526d2a95683cd0f87bf103b8539e2ca1ef48ce002d67aad59aa0b4" [[package]] name = "serde" -version = "1.0.191" +version = "1.0.198" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a834c4821019838224821468552240d4d95d14e751986442c816572d39a080c9" +checksum = "9846a40c979031340571da2545a4e5b7c4163bdae79b301d5f86d03979451fcc" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.191" +version = "1.0.198" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46fa52d5646bce91b680189fe5b1c049d2ea38dabb4e2e7c8d00ca12cfbfbcfd" +checksum = "e88edab869b01783ba905e7d0153f9fc1a6505a96e4ad3018011eedb838566d9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.60", ] [[package]] name = "serde_json" -version = "1.0.108" +version = "1.0.116" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" +checksum = "3e17db7126d17feb94eb3fad46bf1a96b034e8aacbc2e775fe81505f8b0b2813" dependencies = [ "itoa", "ryu", @@ -3942,9 +3874,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12022b835073e5b11e90a14f86838ceb1c8fb0325b72416845c487ac0fa95e80" +checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" dependencies = [ "serde", ] @@ -3995,9 +3927,9 @@ dependencies = [ [[package]] name = "signature" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e1788eed21689f9cf370582dfc467ef36ed9c707f073528ddafa8d83e3b8500" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ "digest", "rand_core", @@ -4005,9 +3937,9 @@ dependencies = [ [[package]] name = "simd-json" -version = "0.13.4" +version = "0.13.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5a3720326b20bf5b95b72dbbd133caae7e0dcf71eae8f6e6656e71a7e5c9aaa" +checksum = "570c430b3d902ea083097e853263ae782dfe40857d93db019a12356c8e8143fa" dependencies = [ "ahash", "getrandom", @@ -4056,9 +3988,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.1" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "smartstring" @@ -4073,37 +4005,27 @@ dependencies = [ [[package]] name = "snap" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e9f0ab6ef7eb7353d9119c170a436d1bf248eea575ac42d19d12f4e34130831" +checksum = "1b6b67fb9a61334225b5b790716f609cd58395f895b3fe8b328786812a40bc3b" [[package]] name = "socket2" -version = "0.4.10" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" +checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" dependencies = [ "libc", - "winapi", -] - -[[package]] -name = "socket2" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" -dependencies = [ - "libc", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "solang-parser" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cb9fa2fa2fa6837be8a2495486ff92e3ffe68a99b6eeba288e139efdd842457" +checksum = "c425ce1c59f4b154717592f0bdf4715c3a1d55058883622d3157e1f0908a5b26" dependencies = [ - "itertools 0.11.0", + "itertools", "lalrpop", "lalrpop-util", "phf", @@ -4124,10 +4046,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" [[package]] -name = "spki" -version = "0.7.2" +name = "spinning_top" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d1e996ef02c474957d681f1b05213dfb0abab947b446a62d37770b23500184a" +checksum = "d96d2d1d716fb500937168cc09353ffdc7a012be8475ac7308e1bdf0e3923300" +dependencies = [ + "lock_api", +] + +[[package]] +name = "spki" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" dependencies = [ "base64ct", "der", @@ -4190,11 +4121,11 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "strum" -version = "0.25.0" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" +checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29" dependencies = [ - "strum_macros", + "strum_macros 0.26.2", ] [[package]] @@ -4207,7 +4138,20 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.38", + "syn 2.0.60", +] + +[[package]] +name = "strum_macros" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6cf59daf282c0a494ba14fd21610a0325f9f90ec9d1231dea26bcb1d696c946" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.60", ] [[package]] @@ -4218,9 +4162,9 @@ checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" [[package]] name = "svm-rs" -version = "0.3.2" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0cc95be7cc2c384a2f57cac56548d2178650905ebe5725bc8970ccc25529060" +checksum = "11297baafe5fa0c99d5722458eac6a5e25c01eb1b8e5cd137f54079093daa7a4" dependencies = [ "dirs", "fs2", @@ -4249,9 +4193,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.38" +version = "2.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" +checksum = "909518bc7b1c9b779f1bbf07f2929d35af9f0f37e47c6e9ef7f9dddc1e1821f3" dependencies = [ "proc-macro2", "quote", @@ -4259,10 +4203,16 @@ dependencies = [ ] [[package]] -name = "sysinfo" -version = "0.30.5" +name = "sync_wrapper" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fb4f3438c8f6389c864e61221cbc97e9bca98b4daf39a5beb7bea660f528bb2" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + +[[package]] +name = "sysinfo" +version = "0.30.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87341a165d73787554941cd5ef55ad728011566fe714e987d1b976c15dbc3a83" dependencies = [ "cfg-if", "core-foundation-sys", @@ -4301,27 +4251,26 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "target-features" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfb5fa503293557c5158bd215fdc225695e567a77e453f5d4452a50a193969bd" +checksum = "c1bbb9f3c5c463a01705937a24fdabc5047929ac764b2d5b9cf681c1f5041ed5" [[package]] name = "target-lexicon" -version = "0.12.12" +version = "0.12.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c39fd04924ca3a864207c66fc2cd7d22d7c016007f9ce846cbb9326331930a" +checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" [[package]] name = "tempfile" -version = "3.8.1" +version = "3.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5" +checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ "cfg-if", "fastrand", - "redox_syscall 0.4.1", "rustix", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -4337,22 +4286,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.50" +version = "1.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" +checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.50" +version = "1.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" +checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.60", ] [[package]] @@ -4363,12 +4312,13 @@ checksum = "3bf63baf9f5039dadc247375c29eb13706706cfde997d0330d05aa63a77d8820" [[package]] name = "time" -version = "0.3.30" +version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ "deranged", "itoa", + "num-conv", "powerfmt", "serde", "time-core", @@ -4383,10 +4333,11 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.15" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" dependencies = [ + "num-conv", "time-core", ] @@ -4416,9 +4367,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.33.0" +version = "1.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f38200e3ef7995e5ef13baec2f432a6da0aa9ac495b2c0e8f3b7eec2c92d653" +checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" dependencies = [ "backtrace", "bytes", @@ -4426,20 +4377,20 @@ dependencies = [ "mio", "num_cpus", "pin-project-lite", - "socket2 0.5.5", + "socket2", "tokio-macros", "windows-sys 0.48.0", ] [[package]] name = "tokio-macros" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.60", ] [[package]] @@ -4483,14 +4434,14 @@ dependencies = [ [[package]] name = "toml" -version = "0.7.8" +version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd79e69d3b627db300ff956027cc6c3798cef26d22526befdfcd12feeb6d2257" +checksum = "e9dd1545e8208b4a5af1aa9bbd0b4cf7e9ea08fabc5d0a5c67fcaafa17433aa3" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.19.15", + "toml_edit 0.22.12", ] [[package]] @@ -4508,11 +4459,9 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.1.0", - "serde", - "serde_spanned", + "indexmap", "toml_datetime", - "winnow", + "winnow 0.5.40", ] [[package]] @@ -4521,9 +4470,33 @@ version = "0.20.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" dependencies = [ - "indexmap 2.1.0", + "indexmap", "toml_datetime", - "winnow", + "winnow 0.5.40", +] + +[[package]] +name = "toml_edit" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" +dependencies = [ + "indexmap", + "toml_datetime", + "winnow 0.5.40", +] + +[[package]] +name = "toml_edit" +version = "0.22.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3328d4f68a705b2a4498da1d580585d39a6510f98318a2cec3018a7ec61ddef" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "winnow 0.6.6", ] [[package]] @@ -4551,7 +4524,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.60", ] [[package]] @@ -4575,9 +4548,9 @@ dependencies = [ [[package]] name = "try-lock" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "tungstenite" @@ -4625,9 +4598,9 @@ checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" [[package]] name = "unicode-bidi" -version = "0.3.13" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-ident" @@ -4637,9 +4610,9 @@ checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" dependencies = [ "tinyvec", ] @@ -4676,9 +4649,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" dependencies = [ "form_urlencoded", "idna", @@ -4709,9 +4682,9 @@ dependencies = [ [[package]] name = "value-trait" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea87257cfcbedcb9444eda79c59fdfea71217e6305afee8ee33f500375c2ac97" +checksum = "dad8db98c1e677797df21ba03fca7d3bf9bec3ca38db930954e4fe6e1ea27eb4" dependencies = [ "float-cmp", "halfbrown", @@ -4727,9 +4700,9 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "walkdir" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" dependencies = [ "same-file", "winapi-util", @@ -4752,9 +4725,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.88" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7daec296f25a1bae309c0cd5c29c4b260e510e6d813c286b19eaadf409d40fce" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -4762,24 +4735,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.88" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e397f4664c0e4e428e8313a469aaa58310d302159845980fd23b0f22a847f217" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.60", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.38" +version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9afec9963e3d0994cac82455b2b3502b81a7f40f9a0d32181f7528d9f4b43e02" +checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" dependencies = [ "cfg-if", "js-sys", @@ -4789,9 +4762,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.88" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5961017b3b08ad5f3fe39f1e79877f8ee7c23c5e5fd5eb80de95abc41f1f16b2" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -4799,28 +4772,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.88" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5353b8dab669f5e10f5bd76df26a9360c748f054f862ff5f3f8aae0c7fb3907" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.60", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.88" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d046c5d029ba91a1ed14da14dca44b68bf2f124cfbaf741c54151fdb3e0750b" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "web-sys" -version = "0.3.65" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5db499c5f66323272151db0e666cd34f78617522fb0c1604d31a27c50c206a85" +checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" dependencies = [ "js-sys", "wasm-bindgen", @@ -4828,9 +4801,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.25.2" +version = "0.25.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc" +checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" [[package]] name = "winapi" @@ -4869,17 +4842,8 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" dependencies = [ - "windows-core 0.52.0", - "windows-targets 0.52.0", -] - -[[package]] -name = "windows-core" -version = "0.51.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" -dependencies = [ - "windows-targets 0.48.5", + "windows-core", + "windows-targets 0.52.5", ] [[package]] @@ -4888,16 +4852,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.0", -] - -[[package]] -name = "windows-sys" -version = "0.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" -dependencies = [ - "windows-targets 0.42.2", + "windows-targets 0.52.5", ] [[package]] @@ -4910,18 +4865,12 @@ dependencies = [ ] [[package]] -name = "windows-targets" -version = "0.42.2" +name = "windows-sys" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", + "windows-targets 0.52.5", ] [[package]] @@ -4941,25 +4890,20 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" dependencies = [ - "windows_aarch64_gnullvm 0.52.0", - "windows_aarch64_msvc 0.52.0", - "windows_i686_gnu 0.52.0", - "windows_i686_msvc 0.52.0", - "windows_x86_64_gnu 0.52.0", - "windows_x86_64_gnullvm 0.52.0", - "windows_x86_64_msvc 0.52.0", + "windows_aarch64_gnullvm 0.52.5", + "windows_aarch64_msvc 0.52.5", + "windows_i686_gnu 0.52.5", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.5", + "windows_x86_64_gnu 0.52.5", + "windows_x86_64_gnullvm 0.52.5", + "windows_x86_64_msvc 0.52.5", ] -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" - [[package]] name = "windows_aarch64_gnullvm" version = "0.48.5" @@ -4968,15 +4912,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" +checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" [[package]] name = "windows_aarch64_msvc" @@ -4986,15 +4924,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" - -[[package]] -name = "windows_i686_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" +checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" [[package]] name = "windows_i686_gnu" @@ -5004,15 +4936,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" +checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" [[package]] -name = "windows_i686_msvc" -version = "0.42.2" +name = "windows_i686_gnullvm" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" +checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" [[package]] name = "windows_i686_msvc" @@ -5022,15 +4954,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" +checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" [[package]] name = "windows_x86_64_gnu" @@ -5040,15 +4966,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" +checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" [[package]] name = "windows_x86_64_gnullvm" @@ -5058,15 +4978,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" +checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" [[package]] name = "windows_x86_64_msvc" @@ -5076,15 +4990,24 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" [[package]] name = "winnow" -version = "0.5.18" +version = "0.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "176b6138793677221d420fd2f0aeeced263f197688b36484660da767bca2fa32" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" +dependencies = [ + "memchr", +] + +[[package]] +name = "winnow" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0c976aaaa0e1f90dbb21e9587cdaf1d9679a1cde8875c0d6bd83ab96a208352" dependencies = [ "memchr", ] @@ -5129,9 +5052,9 @@ dependencies = [ [[package]] name = "xxhash-rust" -version = "0.8.7" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9828b178da53440fa9c766a3d2f73f7cf5d0ac1fe3980c1e5018d899fd19e07b" +checksum = "927da81e25be1e1a2901d59b81b37dd2efd1fc9c9345a55007f09bf5a2d3ee03" [[package]] name = "yansi" @@ -5141,29 +5064,29 @@ checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" [[package]] name = "zerocopy" -version = "0.7.21" +version = "0.7.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "686b7e407015242119c33dab17b8f61ba6843534de936d94368856528eae4dcc" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.21" +version = "0.7.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "020f3dfe25dfc38dfea49ce62d5d45ecdd7f0d8a724fa63eb36b6eba4ec76806" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.60", ] [[package]] name = "zeroize" -version = "1.6.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" +checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" [[package]] name = "zip" @@ -5196,11 +5119,11 @@ dependencies = [ [[package]] name = "zstd" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bffb3309596d527cfcba7dfc6ed6052f1d39dfbd7c867aa2e865e4a449c10110" +checksum = "2d789b1514203a1120ad2429eae43a7bd32b90976a7bb8a05f7ec02fa88cc23a" dependencies = [ - "zstd-safe 7.0.0", + "zstd-safe 7.1.0", ] [[package]] @@ -5215,18 +5138,18 @@ dependencies = [ [[package]] name = "zstd-safe" -version = "7.0.0" +version = "7.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43747c7422e2924c11144d5229878b98180ef8b06cca4ab5af37afc8a8d8ea3e" +checksum = "1cd99b45c6bc03a018c8b8a86025678c87e55526064e38f9df301989dce7ec0a" dependencies = [ "zstd-sys", ] [[package]] name = "zstd-sys" -version = "2.0.9+zstd.1.5.5" +version = "2.0.10+zstd.1.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e16efa8a874a0481a574084d34cc26fdb3b99627480f785888deb6386506656" +checksum = "c253a4914af5bafc8fa8c86ee400827e83cf6ec01195ec1f1ed8441bf00d65aa" dependencies = [ "cc", "pkg-config", From 24fc2f772df6b0c612ff3710da2d7f77972b0a48 Mon Sep 17 00:00:00 2001 From: Yadomin Date: Sat, 20 Apr 2024 01:42:04 +0800 Subject: [PATCH 19/49] Add erc20_approvals dataset (#185) --- README.md | 1 + crates/freeze/src/datasets/erc20_approvals.rs | 112 ++++++++++++++++++ crates/freeze/src/datasets/mod.rs | 3 + crates/freeze/src/types/datatypes/scalar.rs | 1 + crates/freeze/src/types/signatures.rs | 6 + 5 files changed, 123 insertions(+) create mode 100644 crates/freeze/src/datasets/erc20_approvals.rs diff --git a/README.md b/README.md index 61e2320..f83f0d6 100644 --- a/README.md +++ b/README.md @@ -296,6 +296,7 @@ cryo datasets - erc20_metadata - erc20_supplies - erc20_transfers +- erc20_approvals - erc721_metadata - erc721_transfers - eth_calls diff --git a/crates/freeze/src/datasets/erc20_approvals.rs b/crates/freeze/src/datasets/erc20_approvals.rs new file mode 100644 index 0000000..f8219f0 --- /dev/null +++ b/crates/freeze/src/datasets/erc20_approvals.rs @@ -0,0 +1,112 @@ +use crate::*; +use ethers::prelude::*; +use polars::prelude::*; + +/// columns for transactions +#[cryo_to_df::to_df(Datatype::Erc20Approvals)] +#[derive(Default)] +pub struct Erc20Approvals { + n_rows: u64, + block_number: Vec, + block_hash: Vec>>, + transaction_index: Vec, + log_index: Vec, + transaction_hash: Vec>, + erc20: Vec>, + from_address: Vec>, + to_address: Vec>, + value: Vec, + chain_id: Vec, +} + +#[async_trait::async_trait] +impl Dataset for Erc20Approvals { + fn default_columns() -> Option> { + Some(vec![ + "block_number", + // "block_hash", + "transaction_index", + "log_index", + "transaction_hash", + "erc20", + "from_address", + "to_address", + "value", + "chain_id", + ]) + } + + fn optional_parameters() -> Vec { + vec![Dim::Address, Dim::Topic0, Dim::Topic1, Dim::Topic2, Dim::FromAddress, Dim::ToAddress] + } + + fn use_block_ranges() -> bool { + true + } + + fn arg_aliases() -> Option> { + Some([(Dim::Contract, Dim::Address)].into_iter().collect()) + } +} + +#[async_trait::async_trait] +impl CollectByBlock for Erc20Approvals { + type Response = Vec; + + async fn extract(request: Params, source: Arc, _: Arc) -> R { + let mut topics = [Some(ValueOrArray::Value(Some(*EVENT_ERC20_TRANSFER))), None, None, None]; + if let Some(from_address) = &request.from_address { + let mut v = vec![0u8; 12]; + v.append(&mut from_address.to_owned()); + topics[1] = Some(ValueOrArray::Value(Some(H256::from_slice(&v[..])))); + } + if let Some(to_address) = &request.to_address { + let mut v = vec![0u8; 12]; + v.append(&mut to_address.to_owned()); + topics[2] = Some(ValueOrArray::Value(Some(H256::from_slice(&v[..])))); + } + let filter = Filter { topics, ..request.ethers_log_filter()? }; + let logs = source.get_logs(&filter).await?; + + Ok(logs.into_iter().filter(|x| x.topics.len() == 3 && x.data.len() == 32).collect()) + } + + fn transform(response: Self::Response, columns: &mut Self, query: &Arc) -> R<()> { + let schema = query.schemas.get_schema(&Datatype::Erc20Approvals)?; + process_erc20_approval(response, columns, schema) + } +} + +#[async_trait::async_trait] +impl CollectByTransaction for Erc20Approvals { + type Response = Vec; + + async fn extract(request: Params, source: Arc, _: Arc) -> R { + let logs = source.get_transaction_logs(request.transaction_hash()?).await?; + Ok(logs.into_iter().filter(is_erc20_approval).collect()) + } +} + +fn is_erc20_approval(log: &Log) -> bool { + log.topics.len() == 3 && log.data.len() == 32 && log.topics[0] == *EVENT_ERC20_APPROVAL +} + +fn process_erc20_approval(logs: Vec, columns: &mut Erc20Approvals, schema: &Table) -> R<()> { + for log in logs.iter() { + if let (Some(bn), Some(tx), Some(ti), Some(li)) = + (log.block_number, log.transaction_hash, log.transaction_index, log.log_index) + { + columns.n_rows += 1; + store!(schema, columns, block_number, bn.as_u32()); + store!(schema, columns, block_hash, log.block_hash.map(|bh| bh.as_bytes().to_vec())); + store!(schema, columns, transaction_index, ti.as_u32()); + store!(schema, columns, log_index, li.as_u32()); + store!(schema, columns, transaction_hash, tx.as_bytes().to_vec()); + store!(schema, columns, erc20, log.address.as_bytes().to_vec()); + store!(schema, columns, from_address, log.topics[1].as_bytes()[12..].to_vec()); + store!(schema, columns, to_address, log.topics[2].as_bytes()[12..].to_vec()); + store!(schema, columns, value, log.data.to_vec().as_slice().into()); + } + } + Ok(()) +} diff --git a/crates/freeze/src/datasets/mod.rs b/crates/freeze/src/datasets/mod.rs index 4c168ae..b7dd607 100644 --- a/crates/freeze/src/datasets/mod.rs +++ b/crates/freeze/src/datasets/mod.rs @@ -16,6 +16,8 @@ pub mod code_reads; pub mod codes; /// contracts pub mod contracts; +/// erc20 approval +pub mod erc20_approvals; /// erc20 balances pub mod erc20_balances; /// erc20 metadata @@ -80,6 +82,7 @@ pub use code_diffs::*; pub use code_reads::*; pub use codes::*; pub use contracts::*; +pub use erc20_approvals::*; pub use erc20_balances::*; pub use erc20_metadata::*; pub use erc20_supplies::*; diff --git a/crates/freeze/src/types/datatypes/scalar.rs b/crates/freeze/src/types/datatypes/scalar.rs index c4078c0..6f86bd8 100644 --- a/crates/freeze/src/types/datatypes/scalar.rs +++ b/crates/freeze/src/types/datatypes/scalar.rs @@ -16,6 +16,7 @@ define_datatypes!( Erc20Metadata, Erc20Supplies, Erc20Transfers, + Erc20Approvals, Erc721Metadata, Erc721Transfers, EthCalls, diff --git a/crates/freeze/src/types/signatures.rs b/crates/freeze/src/types/signatures.rs index d5f9dfb..b41280e 100644 --- a/crates/freeze/src/types/signatures.rs +++ b/crates/freeze/src/types/signatures.rs @@ -23,6 +23,12 @@ lazy_static::lazy_static! { .expect("Decoding failed"), ); + /// event hash of EVENT_ERC20_APPROVAL + pub static ref EVENT_ERC20_APPROVAL: H256 = H256( + prefix_hex::decode("0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925") + .expect("Decoding failed"), + ); + /// event hash of EVENT_ERC721_TRANSFER pub static ref EVENT_ERC721_TRANSFER: H256 = H256( prefix_hex::decode("0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef") From c0bf55ab5207f3ba3878b1c6531cb018557e4c71 Mon Sep 17 00:00:00 2001 From: sslivkoff Date: Mon, 13 May 2024 15:06:59 -0700 Subject: [PATCH 20/49] add r s v columns to txs (#191) --- crates/freeze/src/datasets/transactions.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crates/freeze/src/datasets/transactions.rs b/crates/freeze/src/datasets/transactions.rs index 54f3b8b..cdb933b 100644 --- a/crates/freeze/src/datasets/transactions.rs +++ b/crates/freeze/src/datasets/transactions.rs @@ -29,6 +29,9 @@ pub struct Transactions { block_hash: Vec>, chain_id: Vec, timestamp: Vec, + r: Vec>, + s: Vec>, + v: Vec, } #[async_trait::async_trait] @@ -227,6 +230,10 @@ pub(crate) fn process_transaction( store!(schema, columns, timestamp, timestamp); store!(schema, columns, block_hash, tx.block_hash.unwrap_or_default().as_bytes().to_vec()); + store!(schema, columns, v, tx.v.as_u64()); + store!(schema, columns, r, tx.r.to_vec_u8()); + store!(schema, columns, s, tx.s.to_vec_u8()); + Ok(()) } From aa4674dac18fdc632f3705bdefbd819c7fe74ceb Mon Sep 17 00:00:00 2001 From: sslivkoff Date: Mon, 13 May 2024 16:06:09 -0700 Subject: [PATCH 21/49] fix clippy warning --- crates/freeze/src/types/files.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/freeze/src/types/files.rs b/crates/freeze/src/types/files.rs index 883bcef..5ce520a 100644 --- a/crates/freeze/src/types/files.rs +++ b/crates/freeze/src/types/files.rs @@ -51,7 +51,7 @@ impl FileOutput { }; for meta_datatype in meta_datatypes.iter() { for datatype in meta_datatype.datatypes().into_iter() { - if query.schemas.get(&datatype).is_some() { + if query.schemas.contains_key(&datatype) { paths.insert(datatype, self.get_path(query, partition, datatype)?); } } From c3a2f1df688f85b91448c8d89f2b4e640ce7651c Mon Sep 17 00:00:00 2001 From: sslivkoff Date: Thu, 23 May 2024 09:34:45 -0700 Subject: [PATCH 22/49] add better python annotations (#192) --- crates/python/python/cryo/__init__.py | 2 +- crates/python/python/cryo/_args.py | 3 +- crates/python/python/cryo/_collect.py | 82 ++++++++++++++++++++++++++- crates/python/python/cryo/_spec.py | 32 +++++++++-- crates/python/python/cryo/py.typed | 0 5 files changed, 108 insertions(+), 11 deletions(-) create mode 100644 crates/python/python/cryo/py.typed diff --git a/crates/python/python/cryo/__init__.py b/crates/python/python/cryo/__init__.py index ac472a4..ba06055 100644 --- a/crates/python/python/cryo/__init__.py +++ b/crates/python/python/cryo/__init__.py @@ -2,7 +2,7 @@ # ruff: noqa: F401 -from ._cryo_rust import __version__ +from ._cryo_rust import __version__ # type: ignore from ._freeze import async_freeze from ._freeze import freeze from ._collect import async_collect diff --git a/crates/python/python/cryo/_args.py b/crates/python/python/cryo/_args.py index 01ef0e8..67f359f 100644 --- a/crates/python/python/cryo/_args.py +++ b/crates/python/python/cryo/_args.py @@ -12,7 +12,6 @@ def parse_cli_args( start_block: _spec.BlockReference | None = None, end_block: _spec.BlockReference | None = None, file_format: _spec.FileFormat = 'parquet', - verbose: bool = True, **kwargs: Unpack[_spec.CryoCliArgs], ) -> _spec.CryoCliArgs: """ @@ -37,7 +36,7 @@ def parse_cli_args( else: raise Exception('unknown file_format') - kwargs['no_verbose'] = not verbose + kwargs['no_verbose'] = not kwargs.get('verbose', True) return kwargs diff --git a/crates/python/python/cryo/_collect.py b/crates/python/python/cryo/_collect.py index 55d7488..78c3300 100644 --- a/crates/python/python/cryo/_collect.py +++ b/crates/python/python/cryo/_collect.py @@ -3,7 +3,7 @@ import typing if typing.TYPE_CHECKING: from typing_extensions import Unpack - from typing import Any + from typing import Any, Literal, TypeVar import pandas as pd import polars as pl @@ -11,6 +11,43 @@ if typing.TYPE_CHECKING: ListOfDicts = list[dict[str, Any]] DictOfLists = dict[str, list[Any]] + T = TypeVar('T', pl.DataFrame, pd.DataFrame, ListOfDicts, DictOfLists) + + +@typing.overload +async def async_collect( + datatype: _spec.Datatype, + output_format: Literal['polars'] = 'polars', + **kwargs: Unpack[_spec.CryoCliArgs], +) -> pl.DataFrame: + ... + + +@typing.overload +async def async_collect( + datatype: _spec.Datatype, + output_format: Literal['pandas'], + **kwargs: Unpack[_spec.CryoCliArgs], +) -> pd.DataFrame: + ... + + +@typing.overload +async def async_collect( + datatype: _spec.Datatype, + output_format: Literal['list'], + **kwargs: Unpack[_spec.CryoCliArgs], +) -> ListOfDicts: + ... + + +@typing.overload +async def async_collect( + datatype: _spec.Datatype, + output_format: Literal['dict'], + **kwargs: Unpack[_spec.CryoCliArgs], +) -> DictOfLists: + ... async def async_collect( @@ -45,6 +82,42 @@ async def async_collect( raise Exception('unknown output format') +@typing.overload +def collect( + datatype: _spec.Datatype, + output_format: Literal['polars'] = 'polars', + **kwargs: Unpack[_spec.CryoCliArgs], +) -> pl.DataFrame: + ... + + +@typing.overload +def collect( + datatype: _spec.Datatype, + output_format: Literal['pandas'], + **kwargs: Unpack[_spec.CryoCliArgs], +) -> pd.DataFrame: + ... + + +@typing.overload +def collect( + datatype: _spec.Datatype, + output_format: Literal['list'], + **kwargs: Unpack[_spec.CryoCliArgs], +) -> ListOfDicts: + ... + + +@typing.overload +def collect( + datatype: _spec.Datatype, + output_format: Literal['dict'], + **kwargs: Unpack[_spec.CryoCliArgs], +) -> DictOfLists: + ... + + def collect( datatype: _spec.Datatype, output_format: _spec.PythonOutput = 'polars', @@ -58,11 +131,14 @@ def collect( try: import concurrent.futures + loop = asyncio.new_event_loop() asyncio.set_event_loop(loop) with concurrent.futures.ThreadPoolExecutor() as executor: future = executor.submit(loop.run_until_complete, coroutine) # type: ignore - return future.result() # type: ignore + result: T = future.result() # type: ignore except RuntimeError: - return asyncio.run(coroutine) + result = asyncio.run(coroutine) + + return result diff --git a/crates/python/python/cryo/_spec.py b/crates/python/python/cryo/_spec.py index 11af8ae..97c98d8 100644 --- a/crates/python/python/cryo/_spec.py +++ b/crates/python/python/cryo/_spec.py @@ -47,11 +47,33 @@ if typing.TYPE_CHECKING: n_row_groups: int | None no_stats: bool compression: str | None - contract: str | bytes | None - topic0: str | bytes | None - topic1: str | bytes | None - topic2: str | bytes | None - topic3: str | bytes | None + contract: typing.Sequence[str | bytes | None] + topic0: typing.Sequence[str | bytes | None] + topic1: typing.Sequence[str | bytes | None] + topic2: typing.Sequence[str | bytes | None] + topic3: typing.Sequence[str | bytes | None] inner_request_size: int | None no_verbose: bool + timestamps: typing.Sequence[str] | None + txs: typing.Sequence[str] | None + u256_types: typing.Sequence[str] | None + exclude_failed: bool + chunk_order: str | None + max_retries: int + initial_backoff: int + partition_by: typing.Sequence[str] | None + subdirs: typing.Sequence[str] + label: str | None + report_dir: str | None + no_report: bool + address: typing.Sequence[str] | None + to_address: typing.Sequence[str] | None + from_address: typing.Sequence[str] | None + call_data: typing.Sequence[str] | None + function: typing.Sequence[str] | None + inputs: typing.Sequence[str] | None + slot: typing.Sequence[str] | None + js_tracer: str | None + verbose: bool + event_signature: str | None diff --git a/crates/python/python/cryo/py.typed b/crates/python/python/cryo/py.typed new file mode 100644 index 0000000..e69de29 From efba0a14481160292673bad4e508fa38c32e6c34 Mon Sep 17 00:00:00 2001 From: sslivkoff Date: Sun, 24 Nov 2024 12:11:45 +0000 Subject: [PATCH 23/49] set __all__ in python module --- crates/python/python/cryo/__init__.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/python/python/cryo/__init__.py b/crates/python/python/cryo/__init__.py index ba06055..ef43519 100644 --- a/crates/python/python/cryo/__init__.py +++ b/crates/python/python/cryo/__init__.py @@ -8,3 +8,9 @@ from ._freeze import freeze from ._collect import async_collect from ._collect import collect +__all__ = [ + 'async_collect', + 'async_freeze', + 'collect', + 'freeze', +] From 8e1ff5b5e8a1c7dbc71c4316c85d0c2c8ce9e097 Mon Sep 17 00:00:00 2001 From: minds <0xminds@gmail.com> Date: Sun, 24 Nov 2024 15:13:23 +0300 Subject: [PATCH 24/49] Typo fixed Update uniswap.sh (#207) --- examples/uniswap.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/uniswap.sh b/examples/uniswap.sh index 7c698e4..7629ad0 100755 --- a/examples/uniswap.sh +++ b/examples/uniswap.sh @@ -4,7 +4,7 @@ # This script is # - idempotent: run the script as many times as you want, the data will be fine -# - interuptable: you can interrupt the script whenever you want, the data will be fine +# - interruptible: you can interrupt the script whenever you want, the data will be fine # - incremental: only missing data is collected. re-runing the script does not re-collect data # uniswap v2 pools From c87eed4cb816e0559b020f53760d41172ff03dd9 Mon Sep 17 00:00:00 2001 From: Dmitry <98899785+mdqst@users.noreply.github.com> Date: Sun, 24 Nov 2024 15:14:37 +0300 Subject: [PATCH 25/49] Fix typos Update README.md (#204) Fix typos in "Python Installation" and "Documentation" headings --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f83f0d6..ac69006 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ to discuss cryo, check out [the telegram group](https://t.me/paradigm_data) 2. [Installation](#installation) 3. [Data Schema](#data-schemas) 4. [Code Guide](#code-guide) -5. [Documenation](#documentation) +5. [Documentation](#documentation) 1. [Basics](#cryo-help) 2. [Syntax](#cryo-syntax) 3. [Datasets](#cryo-datasets) @@ -64,7 +64,7 @@ This method requires having rust installed. See [rustup](https://rustup.rs/) for Make sure that `~/.cargo/bin` is on your `PATH`. One way to do this is by adding the line `export PATH="$HOME/.cargo/bin:$PATH"` to your `~/.bashrc` or `~/.profile`. -### Python Instalation +### Python Installation `cryo` can also be installed as a python package: From 1c98a1b354b34ed1562ede349ee7f2a55441b5ac Mon Sep 17 00:00:00 2001 From: advaith Date: Sun, 24 Nov 2024 07:15:29 -0500 Subject: [PATCH 26/49] fix var name (#188) --- examples/erc20_balances.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/erc20_balances.sh b/examples/erc20_balances.sh index da8ba89..841c02f 100755 --- a/examples/erc20_balances.sh +++ b/examples/erc20_balances.sh @@ -12,5 +12,4 @@ export WALLETS="0x0a59649758aa4d66e25f08dd01271e891fe52199 0xcee284f754e854890e3 export BLOCKS="16M:17M/10" # collect data -cryo erc20_balances --blocks $BLOCKS --contract $ERC20 --address $WALLET - +cryo erc20_balances --blocks $BLOCKS --contract $ERC20 --address $WALLETS \ No newline at end of file From 8e6cd9bc7c1834de5dc5dc6a0123a7a50e5c91da Mon Sep 17 00:00:00 2001 From: Snoppy Date: Sun, 24 Nov 2024 20:17:32 +0800 Subject: [PATCH 27/49] chore: fix typos (#190) Signed-off-by: snoppy --- crates/cli/src/lib.rs | 2 +- crates/cli/src/parse/blocks.rs | 2 +- crates/freeze/src/types/schemas.rs | 2 +- examples/erc20_balances.sh | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/cli/src/lib.rs b/crates/cli/src/lib.rs index 8fcebe2..516f23d 100644 --- a/crates/cli/src/lib.rs +++ b/crates/cli/src/lib.rs @@ -1,4 +1,4 @@ -//! utilties for parsing user inputs to run cryo +//! utilities for parsing user inputs to run cryo #![warn(missing_docs, unreachable_pub, unused_crate_dependencies)] #![deny(unused_must_use, rust_2018_idioms)] diff --git a/crates/cli/src/parse/blocks.rs b/crates/cli/src/parse/blocks.rs index 80fe1a6..1f915c5 100644 --- a/crates/cli/src/parse/blocks.rs +++ b/crates/cli/src/parse/blocks.rs @@ -656,7 +656,7 @@ mod tests { // Ranges let tests: Vec<(BlockNumberTest<'_>, bool)> = vec![ (BlockNumberTest::WithoutMock((r"1", RangePosition::None, 1)), true), // Integer - (BlockNumberTest::WithMock((r"latest", RangePosition::None, 12, 12)), true), /* Lastest block */ + (BlockNumberTest::WithMock((r"latest", RangePosition::None, 12, 12)), true), /* Latest block */ (BlockNumberTest::WithoutMock((r"", RangePosition::First, 0)), true), // First block (BlockNumberTest::WithMock((r"", RangePosition::Last, 12, 12)), true), // Last block (BlockNumberTest::WithoutMock((r"1B", RangePosition::None, 1000000000)), true), // B diff --git a/crates/freeze/src/types/schemas.rs b/crates/freeze/src/types/schemas.rs index 52be892..54201ee 100644 --- a/crates/freeze/src/types/schemas.rs +++ b/crates/freeze/src/types/schemas.rs @@ -8,7 +8,7 @@ use thiserror::Error; /// collection of schemas pub type Schemas = HashMap; -/// funcitons for Schemas +/// functions for Schemas pub trait SchemaFunctions { /// get schema fn get_schema(&self, datatype: &Datatype) -> Result<&Table, CollectError>; diff --git a/examples/erc20_balances.sh b/examples/erc20_balances.sh index 841c02f..70c426e 100755 --- a/examples/erc20_balances.sh +++ b/examples/erc20_balances.sh @@ -5,7 +5,7 @@ # ERC20 = USDC, USDT export ERC20="0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48 0xdac17f958d2ee523a2206206994597c13d831ec7" -# WALLET = Maker PSM, Arbitrum Brdige +# WALLET = Maker PSM, Arbitrum Bridge export WALLETS="0x0a59649758aa4d66e25f08dd01271e891fe52199 0xcee284f754e854890e311e3280b767f80797180d" # block range = 10 blocks between 16,000,000 and 17,000,000 From 2a3112ccd4cea0b87ac62a72f55628d2dca526f4 Mon Sep 17 00:00:00 2001 From: sslivkoff Date: Sun, 24 Nov 2024 12:25:29 +0000 Subject: [PATCH 28/49] fix clippy warning --- crates/freeze/src/types/columns.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/crates/freeze/src/types/columns.rs b/crates/freeze/src/types/columns.rs index 5270616..8d8baa6 100644 --- a/crates/freeze/src/types/columns.rs +++ b/crates/freeze/src/types/columns.rs @@ -52,10 +52,7 @@ pub trait ColumnData: Default + crate::Dataset { /// input arg aliases fn base_arg_aliases() -> HashMap { - match Self::arg_aliases() { - Some(x) => x, - None => HashMap::new(), - } + Self::arg_aliases().unwrap_or_default() } } From 8d862f3c17fd70beda92c632dfb7c232fa2be2e2 Mon Sep 17 00:00:00 2001 From: Daria Date: Sun, 24 Nov 2024 13:27:05 +0100 Subject: [PATCH 29/49] fix param name in comment (#199) fixes parameter name in a comment for get_block_by_hash --- crates/freeze/src/types/sources.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/freeze/src/types/sources.rs b/crates/freeze/src/types/sources.rs index 4c5107b..24d63e0 100644 --- a/crates/freeze/src/types/sources.rs +++ b/crates/freeze/src/types/sources.rs @@ -380,7 +380,7 @@ impl Source { Self::map_err(source_provider!(self, get_block(block_num)).await) } - /// Gets the block at `block_num` (transaction hashes only) + /// Gets the block with `block_hash` (transaction hashes only) pub async fn get_block_by_hash(&self, block_hash: H256) -> Result>> { let _permit = self.permit_request().await; Self::map_err(source_provider!(self, get_block(BlockId::Hash(block_hash))).await) From 668b32be5767fda8e610c00ae750d43b3150c55d Mon Sep 17 00:00:00 2001 From: Elias Rad <146735585+nnsW3@users.noreply.github.com> Date: Sun, 24 Nov 2024 14:27:38 +0200 Subject: [PATCH 30/49] Update README.md (#196) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ac69006..f819001 100644 --- a/README.md +++ b/README.md @@ -166,7 +166,7 @@ Options: Content Options: -b, --blocks ... Block numbers, see syntax below - --timestamps ... Timestamp numbers in unix, overriden by blocks + --timestamps ... Timestamp numbers in unix, overridden by blocks -t, --txs ... Transaction hashes, see syntax below -a, --align Align chunk boundaries to regular intervals, e.g. (1000 2000 3000), not (1106 2106 3106) From d500f111f4ad12512ad26524d4d5daf2d0a67fdf Mon Sep 17 00:00:00 2001 From: Donny <130464015+defitricks@users.noreply.github.com> Date: Sun, 24 Nov 2024 14:35:26 +0200 Subject: [PATCH 31/49] Typos Update uniswap.sh (#202) Fix Typos in Script Comments Co-authored-by: sslivkoff --- examples/uniswap.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/uniswap.sh b/examples/uniswap.sh index 7629ad0..275f4d5 100755 --- a/examples/uniswap.sh +++ b/examples/uniswap.sh @@ -5,7 +5,8 @@ # This script is # - idempotent: run the script as many times as you want, the data will be fine # - interruptible: you can interrupt the script whenever you want, the data will be fine -# - incremental: only missing data is collected. re-runing the script does not re-collect data +# - incremental: only missing data is collected. re-running the script does not re-collect data + # uniswap v2 pools cryo logs \ From d3430c63f77009beaf313f0f0617679a96e5e751 Mon Sep 17 00:00:00 2001 From: Zach Wong <101775102+mud2monarch@users.noreply.github.com> Date: Sun, 24 Nov 2024 19:41:55 +0700 Subject: [PATCH 32/49] Report accurate value for max_concurrent_requests (#201) * Ensure output value for max_concurrent_requests is reported accurately Fixes issue #200 * small correction. removing map since it's already an Option * Added test for PR. * Update source.rs * Update Cargo.toml * Update Cargo.lock --------- Co-authored-by: Zach Wong Co-authored-by: sslivkoff --- crates/cli/src/parse/source.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/cli/src/parse/source.rs b/crates/cli/src/parse/source.rs index 90cff19..8688d26 100644 --- a/crates/cli/src/parse/source.rs +++ b/crates/cli/src/parse/source.rs @@ -66,7 +66,7 @@ pub(crate) async fn parse_source(args: &Args) -> Result { rpc_url, provider, labels: SourceLabels { - max_concurrent_requests: args.requests_per_second.map(|x| x as u64), + max_concurrent_requests: args.max_concurrent_requests, max_requests_per_second: args.requests_per_second.map(|x| x as u64), max_retries: Some(args.max_retries), initial_backoff: Some(args.initial_backoff), From dbc6deb8e5c1d12a01513c18fd844ee3590b81d3 Mon Sep 17 00:00:00 2001 From: yulesa <39807934+yulesa@users.noreply.github.com> Date: Sun, 24 Nov 2024 20:34:05 +0700 Subject: [PATCH 33/49] Improved run.rs (#197) * improved run.rs * fix --- .gitignore | 1 + crates/cli/src/run.rs | 195 +++++++++++++++++++++++++++++++----------- 2 files changed, 147 insertions(+), 49 deletions(-) diff --git a/.gitignore b/.gitignore index 72e2430..f20260e 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ target *.parquet_tmp *.json *.json_tmp +*.env *._tmp TODO.md graveyard diff --git a/crates/cli/src/run.rs b/crates/cli/src/run.rs index ddb7524..faf090c 100644 --- a/crates/cli/src/run.rs +++ b/crates/cli/src/run.rs @@ -5,59 +5,110 @@ use colored::Colorize; use cryo_freeze::{err, CollectError, ExecutionEnv, FreezeSummary}; use std::{sync::Arc, time::SystemTime}; -/// run cli +/// Entry point to run the CLI application. pub async fn run(args: args::Args) -> Result, CollectError> { - // handle subcommands - if args.datatype.first() == Some(&"help".to_string()) { - return handle_help_subcommands(args).await + if is_help_command(&args) { + return handle_help_subcommands(args); } - let cryo_dir: std::path::PathBuf = args.output_dir.clone().into(); - let cryo_dir = cryo_dir.join(".cryo"); + let cryo_dir = build_cryo_directory(&args.output_dir.clone().into()); - // remember previous command + let args = if args.datatype.is_empty() { - let remembered = remember::load_remembered_command(cryo_dir.clone())?; - if remembered.cryo_version != cryo_freeze::CRYO_VERSION { - eprintln!("remembered command comes from different cryo version, proceed with caution"); - eprintln!(); - }; - println!( - "{} {} {}", - "remembering previous command:".truecolor(170, 170, 170), - "cryo".bold().white(), - remembered.command.into_iter().skip(1).collect::>().join(" ").white().bold() - ); - println!(); - args.merge_with_precedence(remembered.args) + load_or_remember_command(args, &cryo_dir)? } else { args }; - // remember current command if args.remember { - println!("remembering this command for future use"); - println!(); + println!("remembering this command for future use\n"); remember::save_remembered_command(cryo_dir, &args)?; } // handle regular flow + run_freeze_process(args).await +} + +/// Check if the command is a help command. +fn is_help_command(args: &args::Args) -> bool { + args.datatype.first() == Some(&"help".to_string()) +} + +/// Build the cryo directory path. +fn build_cryo_directory(output_dir: &std::path::PathBuf) -> std::path::PathBuf { + output_dir.join(".cryo") +} + +/// Load a previously remembered command or return the current args. +fn load_or_remember_command( + mut args: args::Args, + cryo_dir: &std::path::PathBuf, +) -> Result { + let remembered = remember::load_remembered_command(cryo_dir.clone())?; + // Warn if the remembered command comes from a different Cryo version. + if remembered.cryo_version != cryo_freeze::CRYO_VERSION { + eprintln!("remembered command comes from a different Cryo version, proceed with caution\n"); + } + print_remembered_command(&remembered.command); + args = args.merge_with_precedence(remembered.args); + Ok(args) +} + + +/// Print the remembered command to the console. +fn print_remembered_command(command: &[String]) { + println!( + "{} {} {}", + "remembering previous command:".truecolor(170, 170, 170), + "cryo".bold().white(), + command + .iter() + .skip(1) + .cloned() + .collect::>() + .join(" ") + .white() + .bold() + ); + println!(); +} + +/// Run the main freezing process with the provided arguments. +async fn run_freeze_process( + args: args::Args, +) -> Result, CollectError> { let t_start_parse = Some(SystemTime::now()); - let (query, source, sink, env) = match parse::parse_args(&args).await { - Ok(opts) => opts, - Err(e) => return Err(e.into()), - }; + let (query, source, sink, env) = parse::parse_args(&args).await?; let source = Arc::new(source); - let env = ExecutionEnv { t_start_parse, ..env }; - let env = env.set_start_time(); + let env = ExecutionEnv {t_start_parse, ..env} + .set_start_time(); + cryo_freeze::freeze(&query, &source, &sink, &env).await } -async fn handle_help_subcommands(args: args::Args) -> Result, CollectError> { - if args.datatype.len() == 1 { - args::Args::parse_from(vec!["cryo", "-h"]); - } else if args.datatype.len() == 2 && args.datatype[1] == "syntax" { +/// Handle help-related subcommands. +fn handle_help_subcommands(args: args::Args) -> Result, CollectError> { + match args.datatype.len() { + // if only "help" is provided, print general help + 1 => print_general_help(), + // if "syntax help" is provided, print syntax help + 2 if args.datatype[1] == "syntax" => print_syntax_help(), + // if "help datasets" is provided, print dataset information + 2 if args.datatype.contains(&"datasets".to_string()) => cryo_freeze::print_all_datasets(), + // if "help " is provided, print detailed help + _ => handle_detailed_help(args)?, + } + Ok(None) +} + +/// Print general help for the CLI tool. +fn print_general_help() { + args::Args::parse_from(vec!["cryo", "-h"]); +} + +/// Print syntax help for block and transaction specification. +fn print_syntax_help() { let content = cstr!( r#"Block specification syntax - can use numbers --blocks 5000 6000 7000 @@ -79,22 +130,68 @@ async fn handle_help_subcommands(args: args::Args) -> Result--txs ./path/to/ethereum__logs*.parquet"# ); println!("{}", content); - } else if args.datatype.len() == 2 && args.datatype.contains(&"datasets".to_string()) { - cryo_freeze::print_all_datasets(); - } else { - let args = args::Args { datatype: args.datatype[1..].to_vec(), ..args }; - let (datatypes, schemas) = super::parse::schemas::parse_schemas(&args)?; - for datatype in datatypes.into_iter() { - if schemas.len() > 1 { - println!(); - println!(); - }; - if let Some(schema) = schemas.get(&datatype) { - cryo_freeze::print_dataset_info(datatype, schema); - } else { - return Err(err(format!("missing schema for datatype: {:?}", datatype).as_str())) - } +} + +/// Handle detailed help by parsing schemas and printing dataset information. +fn handle_detailed_help(args: args::Args) -> Result<(), CollectError> { + let args = args::Args { + datatype: args.datatype[1..].to_vec(), + ..args + }; + let (datatypes, schemas) = super::parse::schemas::parse_schemas(&args)?; + + for datatype in datatypes.into_iter() { + if schemas.len() > 1 { + println!("\n"); + } + if let Some(schema) = schemas.get(&datatype) { + cryo_freeze::print_dataset_info(datatype, schema); + } else { + return Err(err(format!("missing schema for datatype: {:?}", datatype).as_str())); } } - Ok(None) + + Ok(()) } + +#[cfg(test)] +mod tests { + use super::*; + use crate::args::Args; + + #[test] + fn test_handle_help_subcommands_general_help() { + let args = Args { + datatype: vec!["help".to_string()], + ..Default::default() + }; + + let result = handle_help_subcommands(args); + + assert!(result.is_ok()); + } + + #[test] + fn test_handle_help_subcommands_syntax_help() { + let args = Args { + datatype: vec!["help".to_string(), "syntax".to_string()], + ..Default::default() + }; + + let result = handle_help_subcommands(args); + + assert!(result.is_ok()); + } + + #[test] + fn test_handle_help_subcommands_datasets_help() { + let args = Args { + datatype: vec!["help".to_string(), "datasets".to_string()], + ..Default::default() + }; + + let result = handle_help_subcommands(args); + + assert!(result.is_ok()); + } +} \ No newline at end of file From ef34912c25d40f2216561e513ebefac31aed5321 Mon Sep 17 00:00:00 2001 From: sslivkoff Date: Sun, 24 Nov 2024 20:59:43 +0700 Subject: [PATCH 34/49] Update polars version (#208) * update polars to 0.38.3 * update pyo3-polars alongside polars --------- Co-authored-by: TheEdgeOfRage --- Cargo.lock | 202 ++++++++++++++++++++++++++++++++++++++++------------- Cargo.toml | 4 +- 2 files changed, 156 insertions(+), 50 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2dc2a46..d984d69 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -166,16 +166,6 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" -[[package]] -name = "arrow-format" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07884ea216994cdc32a2d5f8274a8bee979cfe90274b83f86f440866ee3132c7" -dependencies = [ - "planus", - "serde", -] - [[package]] name = "ascii-canvas" version = "3.0.0" @@ -516,6 +506,28 @@ dependencies = [ "windows-targets 0.52.5", ] +[[package]] +name = "chrono-tz" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d59ae0466b83e838b81a54256c39d5d7c20b9d7daa10510a242d9b75abd5936e" +dependencies = [ + "chrono", + "chrono-tz-build", + "phf", +] + +[[package]] +name = "chrono-tz-build" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "433e39f13c9a060046954e0592a8d0a4bcb1040125cbf91cb8ee58964cfb350f" +dependencies = [ + "parse-zoneinfo", + "phf", + "phf_codegen", +] + [[package]] name = "cipher" version = "0.4.4" @@ -1157,7 +1169,7 @@ dependencies = [ "sha2", "sha3", "thiserror", - "uuid", + "uuid 0.8.2", ] [[package]] @@ -2086,6 +2098,12 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +[[package]] +name = "itoap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9028f49264629065d057f340a86acb84867925865f73bbf8d47b4d149a7e88b8" + [[package]] name = "jobserver" version = "0.1.30" @@ -2104,6 +2122,17 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "jsonpath_lib_polars_vendor" +version = "0.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4bd9354947622f7471ff713eacaabdb683ccb13bba4edccaab9860abf480b7d" +dependencies = [ + "log", + "serde", + "serde_json", +] + [[package]] name = "jsonwebtoken" version = "8.3.0" @@ -2628,6 +2657,15 @@ dependencies = [ "futures", ] +[[package]] +name = "parse-zoneinfo" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f2a05b18d44e2957b88f96ba460715e295bc1d7510468a2f3d3b44535d26c24" +dependencies = [ + "regex", +] + [[package]] name = "password-hash" version = "0.4.2" @@ -2712,6 +2750,16 @@ dependencies = [ "phf_shared 0.11.2", ] +[[package]] +name = "phf_codegen" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8d39688d359e6b34654d328e262234662d16cc0f60ec8dcbe5e718709342a5a" +dependencies = [ + "phf_generator", + "phf_shared 0.11.2", +] + [[package]] name = "phf_generator" version = "0.11.2" @@ -2812,31 +2860,36 @@ dependencies = [ [[package]] name = "polars" -version = "0.36.2" +version = "0.38.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "938048fcda6a8e2ace6eb168bee1b415a92423ce51e418b853bf08fc40349b6b" +checksum = "f01006048a264047d6cba081fed8e11adbd69c15956f9e53185a9ac4a541853c" dependencies = [ "getrandom", + "polars-arrow", "polars-core", + "polars-error", "polars-io", "polars-lazy", "polars-ops", + "polars-parquet", "polars-sql", "polars-time", + "polars-utils", "version_check", ] [[package]] name = "polars-arrow" -version = "0.36.2" +version = "0.38.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce68a02f698ff7787c261aea1b4c040a8fe183a8fb200e2436d7f35d95a1b86f" +checksum = "25197f40d71f82b2f79bb394f03e555d3cc1ce4db1dd052c28318721c71e96ad" dependencies = [ "ahash", - "arrow-format", + "atoi", "atoi_simd", "bytemuck", "chrono", + "chrono-tz", "dyn-clone", "either", "ethnum", @@ -2846,9 +2899,11 @@ dependencies = [ "getrandom", "hashbrown", "itoa", + "itoap", "lz4", "multiversion", "num-traits", + "polars-arrow-format", "polars-error", "polars-utils", "ryu", @@ -2860,28 +2915,42 @@ dependencies = [ ] [[package]] -name = "polars-compute" -version = "0.36.2" +name = "polars-arrow-format" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b14fbc5f141b29b656a4cec4802632e5bff10bf801c6809c6bbfbd4078a044dd" +checksum = "19b0ef2474af9396b19025b189d96e992311e6a47f90c53cd998b36c4c64b84c" +dependencies = [ + "planus", + "serde", +] + +[[package]] +name = "polars-compute" +version = "0.38.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c354515f73cdbbad03c2bf723fcd68e6825943b3ec503055abc8a8cb08ce46bb" dependencies = [ "bytemuck", + "either", "num-traits", "polars-arrow", + "polars-error", "polars-utils", + "strength_reduce", "version_check", ] [[package]] name = "polars-core" -version = "0.36.2" +version = "0.38.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0f5efe734b6cbe5f97ea769be8360df5324fade396f1f3f5ad7fe9360ca4a23" +checksum = "6f20d3c227186f74aa3c228c64ef72f5a15617322fed30b4323eaf53b25f8e7b" dependencies = [ "ahash", "bitflags 2.5.0", "bytemuck", "chrono", + "chrono-tz", "comfy-table", "either", "hashbrown", @@ -2905,11 +2974,11 @@ dependencies = [ [[package]] name = "polars-error" -version = "0.36.2" +version = "0.38.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6396de788f99ebfc9968e7b6f523e23000506cde4ba6dfc62ae4ce949002a886" +checksum = "d66dd0ce51f8bd620eb8bd376502fe68a2b1a446d5433ecd2e75270b0755ce76" dependencies = [ - "arrow-format", + "polars-arrow-format", "regex", "simdutf8", "thiserror", @@ -2917,9 +2986,9 @@ dependencies = [ [[package]] name = "polars-io" -version = "0.36.2" +version = "0.38.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d0458efe8946f4718fd352f230c0db5a37926bd0d2bd25af79dc24746abaaea" +checksum = "b40bef2edcdc58394792c4d779465144283a09ff1836324e7b72df7978a6e992" dependencies = [ "ahash", "async-trait", @@ -2955,9 +3024,9 @@ dependencies = [ [[package]] name = "polars-json" -version = "0.36.2" +version = "0.38.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea47d46b7a98fa683ef235ad48b783abf61734828e754096cfbdc77404fff9b3" +checksum = "ef86aca08f10ddc939fe95aabb44e1d2582dcb08b55d4dadb93353ce42adc248" dependencies = [ "ahash", "chrono", @@ -2976,9 +3045,9 @@ dependencies = [ [[package]] name = "polars-lazy" -version = "0.36.2" +version = "0.38.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d7105b40905bb38e8fc4a7fd736594b7491baa12fad3ac492969ca221a1b5d5" +checksum = "c27df26a19d3092298d31d47614ad84dc330c106e38aa8cd53727cd91c07cf56" dependencies = [ "ahash", "bitflags 2.5.0", @@ -3000,36 +3069,42 @@ dependencies = [ [[package]] name = "polars-ops" -version = "0.36.2" +version = "0.38.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e09afc456ab11e75e5dcb43e00a01c71f3a46a2781e450054acb6bb096ca78e" +checksum = "7f8a51c3bdc9e7c34196ff6f5c3cb17da134e5aafb1756aaf24b76c7118e63dc" dependencies = [ "ahash", "argminmax", "base64 0.21.7", "bytemuck", + "chrono", + "chrono-tz", "either", "hashbrown", "hex", "indexmap", + "jsonpath_lib_polars_vendor", "memchr", "num-traits", "polars-arrow", "polars-compute", "polars-core", "polars-error", + "polars-json", "polars-utils", "rayon", "regex", + "serde_json", "smartstring", + "unicode-reverse", "version_check", ] [[package]] name = "polars-parquet" -version = "0.36.2" +version = "0.38.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ba24d67b1f64ab85143033dd46fa090b13c0f74acdf91b0780c16aecf005e3d" +checksum = "b8824ee00fbbe83d69553f2711014c50361238d210ed81a7a297695b7db97d42" dependencies = [ "ahash", "async-stream", @@ -3053,9 +3128,9 @@ dependencies = [ [[package]] name = "polars-pipe" -version = "0.36.2" +version = "0.38.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b7ead073cc3917027d77b59861a9f071db47125de9314f8907db1a0a3e4100" +checksum = "0c5e2c1f14e81d60cfa9afe4e611a9bad9631a2cb7cd19b7c0094d0dc32f0231" dependencies = [ "crossbeam-channel", "crossbeam-queue", @@ -3072,17 +3147,19 @@ dependencies = [ "polars-utils", "rayon", "smartstring", + "uuid 1.10.0", "version_check", ] [[package]] name = "polars-plan" -version = "0.36.2" +version = "0.38.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "384a175624d050c31c473ee11df9d7af5d729ae626375e522158cfb3d150acd0" +checksum = "ff48362bd1b078bbbec7e7ba9ec01fea58fee2887db22a8e3deaf78f322fa3c4" dependencies = [ "ahash", "bytemuck", + "chrono-tz", "once_cell", "percent-encoding", "polars-arrow", @@ -3102,10 +3179,11 @@ dependencies = [ [[package]] name = "polars-row" -version = "0.36.2" +version = "0.38.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32322f7acbb83db3e9c7697dc821be73d06238da89c817dcc8bc1549a5e9c72f" +checksum = "63029da56ff6a720b190490bbc7b6263f9b72d1134311b1f381fc8d306d37770" dependencies = [ + "bytemuck", "polars-arrow", "polars-error", "polars-utils", @@ -3113,10 +3191,11 @@ dependencies = [ [[package]] name = "polars-sql" -version = "0.36.2" +version = "0.38.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f0b4c6ddffdfd0453e84bc3918572c633014d661d166654399cf93752aa95b5" +checksum = "3652c362959f608d1297196b973d1e3acb508a9562b886ac39bf7606b841052b" dependencies = [ + "hex", "polars-arrow", "polars-core", "polars-error", @@ -3130,12 +3209,13 @@ dependencies = [ [[package]] name = "polars-time" -version = "0.36.2" +version = "0.38.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee2649fc96bd1b6584e0e4a4b3ca7d22ed3d117a990e63ad438ecb26f7544d0" +checksum = "86eb74ea6ddfe675aa5c3f33c00dadbe2b85f0e8e3887b85db1fd5a3397267fd" dependencies = [ "atoi", "chrono", + "chrono-tz", "now", "once_cell", "polars-arrow", @@ -3149,9 +3229,9 @@ dependencies = [ [[package]] name = "polars-utils" -version = "0.36.2" +version = "0.38.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b174ca4a77ad47d7b91a0460aaae65bbf874c8bfbaaa5308675dadef3976bbda" +checksum = "694656a7d2b0cd8f07660dbc8d0fb7a81066ff57a452264907531d805c1e58c4" dependencies = [ "ahash", "bytemuck", @@ -3160,6 +3240,7 @@ dependencies = [ "num-traits", "once_cell", "polars-error", + "raw-cpuid", "rayon", "smartstring", "sysinfo", @@ -3354,9 +3435,9 @@ dependencies = [ [[package]] name = "pyo3-polars" -version = "0.10.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1e983cb07cf665ea6e645ae9263c358062580f23a9aee41618a5706d4a7cc21" +checksum = "c6ab8ad08494161085fb0d2d9de82c7fde7398da1778ee7e7a5a596ff4201f5b" dependencies = [ "polars", "polars-core", @@ -3867,6 +3948,7 @@ version = "1.0.116" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e17db7126d17feb94eb3fad46bf1a96b034e8aacbc2e775fe81505f8b0b2813" dependencies = [ + "indexmap", "itoa", "ryu", "serde", @@ -4617,6 +4699,21 @@ dependencies = [ "tinyvec", ] +[[package]] +name = "unicode-reverse" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b6f4888ebc23094adfb574fdca9fdc891826287a6397d2cd28802ffd6f20c76" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "unicode-segmentation" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" + [[package]] name = "unicode-width" version = "0.1.11" @@ -4680,6 +4777,15 @@ dependencies = [ "serde", ] +[[package]] +name = "uuid" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" +dependencies = [ + "getrandom", +] + [[package]] name = "value-trait" version = "0.8.1" diff --git a/Cargo.toml b/Cargo.toml index 4871f8d..c27463f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -40,7 +40,7 @@ indexmap = "2.1.0" indicatif = "0.17.7" lazy_static = "1.4.0" mesc = "0.1.4" -polars = { version = "0.36.2", features = [ +polars = { version = "0.38.3", features = [ "parquet", "string_encoding", "polars-lazy", @@ -53,7 +53,7 @@ prefix-hex = "0.7.1" pyo3 = { version = "0.20.0", features = ["extension-module"] } pyo3-build-config = "0.20.0" pyo3-asyncio = { version = "0.20.0", features = ["tokio-runtime"] } -pyo3-polars = "0.10.0" +pyo3-polars = "0.12.0" rand = "0.8.5" regex = "1.10.2" serde = { version = "1.0.191", features = ["derive"] } From eba6192298e40add4d35d1587511d875f6d770e4 Mon Sep 17 00:00:00 2001 From: sslivkoff Date: Sun, 24 Nov 2024 14:12:59 +0000 Subject: [PATCH 35/49] fix clippy warnings + fmt --- crates/cli/src/run.rs | 63 ++++++++++++++----------------------------- 1 file changed, 20 insertions(+), 43 deletions(-) diff --git a/crates/cli/src/run.rs b/crates/cli/src/run.rs index faf090c..7251348 100644 --- a/crates/cli/src/run.rs +++ b/crates/cli/src/run.rs @@ -11,14 +11,10 @@ pub async fn run(args: args::Args) -> Result, CollectError return handle_help_subcommands(args); } - let cryo_dir = build_cryo_directory(&args.output_dir.clone().into()); + let cryo_dir = build_cryo_directory(std::path::Path::new(&args.output_dir)); - - let args = if args.datatype.is_empty() { - load_or_remember_command(args, &cryo_dir)? - } else { - args - }; + let args = + if args.datatype.is_empty() { load_or_remember_command(args, &cryo_dir)? } else { args }; if args.remember { println!("remembering this command for future use\n"); @@ -35,16 +31,16 @@ fn is_help_command(args: &args::Args) -> bool { } /// Build the cryo directory path. -fn build_cryo_directory(output_dir: &std::path::PathBuf) -> std::path::PathBuf { +fn build_cryo_directory(output_dir: &std::path::Path) -> std::path::PathBuf { output_dir.join(".cryo") } /// Load a previously remembered command or return the current args. fn load_or_remember_command( mut args: args::Args, - cryo_dir: &std::path::PathBuf, + cryo_dir: &std::path::Path, ) -> Result { - let remembered = remember::load_remembered_command(cryo_dir.clone())?; + let remembered = remember::load_remembered_command(cryo_dir.to_path_buf())?; // Warn if the remembered command comes from a different Cryo version. if remembered.cryo_version != cryo_freeze::CRYO_VERSION { eprintln!("remembered command comes from a different Cryo version, proceed with caution\n"); @@ -54,35 +50,24 @@ fn load_or_remember_command( Ok(args) } - /// Print the remembered command to the console. fn print_remembered_command(command: &[String]) { println!( "{} {} {}", "remembering previous command:".truecolor(170, 170, 170), "cryo".bold().white(), - command - .iter() - .skip(1) - .cloned() - .collect::>() - .join(" ") - .white() - .bold() + command.iter().skip(1).cloned().collect::>().join(" ").white().bold() ); println!(); } /// Run the main freezing process with the provided arguments. -async fn run_freeze_process( - args: args::Args, -) -> Result, CollectError> { +async fn run_freeze_process(args: args::Args) -> Result, CollectError> { let t_start_parse = Some(SystemTime::now()); let (query, source, sink, env) = parse::parse_args(&args).await?; let source = Arc::new(source); - let env = ExecutionEnv {t_start_parse, ..env} - .set_start_time(); + let env = ExecutionEnv { t_start_parse, ..env }.set_start_time(); cryo_freeze::freeze(&query, &source, &sink, &env).await } @@ -109,8 +94,8 @@ fn print_general_help() { /// Print syntax help for block and transaction specification. fn print_syntax_help() { - let content = cstr!( - r#"Block specification syntax + let content = cstr!( + r#"Block specification syntax - can use numbers --blocks 5000 6000 7000 - can use ranges --blocks 12M:13M 15M:16M - can use a parquet file --blocks ./path/to/file.parquet[:COLUMN_NAME] @@ -128,16 +113,13 @@ fn print_syntax_help() { - can use a parquet file --txs ./path/to/file.parquet[:COLUMN_NAME] (default column name is transaction_hash) - can use multiple parquet files --txs ./path/to/ethereum__logs*.parquet"# - ); - println!("{}", content); + ); + println!("{}", content); } /// Handle detailed help by parsing schemas and printing dataset information. fn handle_detailed_help(args: args::Args) -> Result<(), CollectError> { - let args = args::Args { - datatype: args.datatype[1..].to_vec(), - ..args - }; + let args = args::Args { datatype: args.datatype[1..].to_vec(), ..args }; let (datatypes, schemas) = super::parse::schemas::parse_schemas(&args)?; for datatype in datatypes.into_iter() { @@ -159,24 +141,19 @@ mod tests { use super::*; use crate::args::Args; - #[test] + #[test] fn test_handle_help_subcommands_general_help() { - let args = Args { - datatype: vec!["help".to_string()], - ..Default::default() - }; + let args = Args { datatype: vec!["help".to_string()], ..Default::default() }; let result = handle_help_subcommands(args); assert!(result.is_ok()); } - #[test] + #[test] fn test_handle_help_subcommands_syntax_help() { - let args = Args { - datatype: vec!["help".to_string(), "syntax".to_string()], - ..Default::default() - }; + let args = + Args { datatype: vec!["help".to_string(), "syntax".to_string()], ..Default::default() }; let result = handle_help_subcommands(args); @@ -194,4 +171,4 @@ mod tests { assert!(result.is_ok()); } -} \ No newline at end of file +} From 1abef98660723551bfd0d4fcb9d88a8cfa017d32 Mon Sep 17 00:00:00 2001 From: Yadomin Date: Mon, 6 Jan 2025 12:00:43 +0800 Subject: [PATCH 36/49] migrate: ethers to alloy (#194) * migrate: ethers to alloy * update alloy to 0.6.4 * fix ci * add RetryBackoffLayer * fix missing field * fix calculate * add missing n_rlp_bytes --- Cargo.lock | 3818 +++++++++-------- Cargo.toml | 11 +- crates/cli/Cargo.toml | 2 +- crates/cli/src/args.rs | 4 + crates/cli/src/parse/blocks.rs | 102 +- crates/cli/src/parse/file_output.rs | 2 +- crates/cli/src/parse/parse_utils.rs | 2 +- crates/cli/src/parse/partitions.rs | 1 - crates/cli/src/parse/source.rs | 47 +- crates/cli/src/parse/timestamps.rs | 49 +- crates/freeze/Cargo.toml | 5 +- .../src/datasets/address_appearances.rs | 100 +- crates/freeze/src/datasets/balance_diffs.rs | 28 +- crates/freeze/src/datasets/balance_reads.rs | 11 +- crates/freeze/src/datasets/balances.rs | 5 +- crates/freeze/src/datasets/blocks.rs | 67 +- crates/freeze/src/datasets/code_diffs.rs | 28 +- crates/freeze/src/datasets/code_reads.rs | 10 +- crates/freeze/src/datasets/codes.rs | 4 +- crates/freeze/src/datasets/contracts.rs | 39 +- crates/freeze/src/datasets/erc20_approvals.rs | 52 +- crates/freeze/src/datasets/erc20_balances.rs | 8 +- crates/freeze/src/datasets/erc20_metadata.rs | 7 +- crates/freeze/src/datasets/erc20_supplies.rs | 6 +- crates/freeze/src/datasets/erc20_transfers.rs | 51 +- crates/freeze/src/datasets/erc721_metadata.rs | 5 +- .../freeze/src/datasets/erc721_transfers.rs | 48 +- crates/freeze/src/datasets/eth_calls.rs | 20 +- .../freeze/src/datasets/geth_balance_diffs.rs | 2 +- crates/freeze/src/datasets/geth_calls.rs | 24 +- .../freeze/src/datasets/geth_nonce_diffs.rs | 5 +- crates/freeze/src/datasets/geth_opcodes.rs | 19 +- crates/freeze/src/datasets/logs.rs | 90 +- .../freeze/src/datasets/native_transfers.rs | 46 +- crates/freeze/src/datasets/nonce_diffs.rs | 31 +- crates/freeze/src/datasets/nonce_reads.rs | 10 +- crates/freeze/src/datasets/nonces.rs | 9 +- crates/freeze/src/datasets/slots.rs | 8 +- crates/freeze/src/datasets/storage_diffs.rs | 34 +- crates/freeze/src/datasets/storage_reads.rs | 24 +- crates/freeze/src/datasets/trace_calls.rs | 39 +- crates/freeze/src/datasets/traces.rs | 162 +- crates/freeze/src/datasets/transactions.rs | 107 +- crates/freeze/src/datasets/vm_traces.rs | 24 +- .../multi_datasets/blocks_and_transactions.rs | 5 +- .../multi_datasets/call_trace_derivatives.rs | 10 +- .../src/multi_datasets/geth_state_diffs.rs | 81 +- .../freeze/src/multi_datasets/state_diffs.rs | 8 +- .../freeze/src/multi_datasets/state_reads.rs | 4 +- .../freeze/src/types/chunks/number_chunk.rs | 4 +- crates/freeze/src/types/chunks/subchunks.rs | 2 +- crates/freeze/src/types/conversions.rs | 12 +- .../freeze/src/types/dataframes/creation.rs | 8 +- crates/freeze/src/types/dataframes/u256s.rs | 10 +- .../freeze/src/types/decoders/log_decoder.rs | 134 +- crates/freeze/src/types/errors.rs | 10 +- crates/freeze/src/types/mod.rs | 2 +- crates/freeze/src/types/rpc_params.rs | 56 +- crates/freeze/src/types/signatures.rs | 57 +- crates/freeze/src/types/sources.rs | 578 +-- crates/python/rust/collect_adapter.rs | 3 + crates/python/rust/freeze_adapter.rs | 3 + crates/to_df/src/lib.rs | 26 +- 63 files changed, 3375 insertions(+), 2804 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d984d69..c48c4cd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,42 +1,21 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 - -[[package]] -name = "Inflector" -version = "0.11.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" -dependencies = [ - "lazy_static", - "regex", -] +version = 4 [[package]] name = "addr2line" -version = "0.21.0" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" 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" - -[[package]] -name = "aes" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" -dependencies = [ - "cfg-if", - "cipher", - "cpufeatures", -] +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" [[package]] name = "ahash" @@ -77,9 +56,615 @@ dependencies = [ [[package]] name = "allocator-api2" -version = "0.2.18" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" +checksum = "45862d1c77f2228b9e10bc609d5bc203d86ebc9b87ad8d5d5167a6c9abf739d9" + +[[package]] +name = "alloy" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5b524b8c28a7145d1fe4950f84360b5de3e307601679ff0558ddc20ea229399" +dependencies = [ + "alloy-consensus", + "alloy-contract", + "alloy-core", + "alloy-eips", + "alloy-genesis", + "alloy-network", + "alloy-provider", + "alloy-pubsub", + "alloy-rpc-client", + "alloy-rpc-types", + "alloy-serde", + "alloy-signer", + "alloy-signer-local", + "alloy-transport", + "alloy-transport-http", + "alloy-transport-ipc", + "alloy-transport-ws", +] + +[[package]] +name = "alloy-chains" +version = "0.1.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18c5c520273946ecf715c0010b4e3503d7eba9893cd9ce6b7fff5654c4a3c470" +dependencies = [ + "alloy-primitives", + "num_enum", + "strum", +] + +[[package]] +name = "alloy-consensus" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae09ffd7c29062431dd86061deefe4e3c6f07fa0d674930095f8dcedb0baf02c" +dependencies = [ + "alloy-eips", + "alloy-primitives", + "alloy-rlp", + "alloy-serde", + "auto_impl", + "c-kzg", + "derive_more", + "k256", + "serde", +] + +[[package]] +name = "alloy-contract" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66430a72d5bf5edead101c8c2f0a24bada5ec9f3cf9909b3e08b6d6899b4803e" +dependencies = [ + "alloy-dyn-abi", + "alloy-json-abi", + "alloy-network", + "alloy-network-primitives", + "alloy-primitives", + "alloy-provider", + "alloy-pubsub", + "alloy-rpc-types-eth", + "alloy-sol-types", + "alloy-transport", + "futures", + "futures-util", + "thiserror", +] + +[[package]] +name = "alloy-core" +version = "0.8.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8d22df68fa7d9744be0b1a9be3260e9aa089fbf41903ab182328333061ed186" +dependencies = [ + "alloy-dyn-abi", + "alloy-json-abi", + "alloy-primitives", + "alloy-rlp", + "alloy-sol-types", +] + +[[package]] +name = "alloy-dyn-abi" +version = "0.8.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cf633ae9a1f0c82fdb9e559ed2be1c8e415c3e48fc47e1feaf32c6078ec0cdd" +dependencies = [ + "alloy-json-abi", + "alloy-primitives", + "alloy-sol-type-parser", + "alloy-sol-types", + "const-hex", + "itoa", + "serde", + "serde_json", + "winnow", +] + +[[package]] +name = "alloy-eip2930" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0069cf0642457f87a01a014f6dc29d5d893cd4fd8fddf0c3cdfad1bb3ebafc41" +dependencies = [ + "alloy-primitives", + "alloy-rlp", + "serde", +] + +[[package]] +name = "alloy-eip7702" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f6cee6a35793f3db8a5ffe60e86c695f321d081a567211245f503e8c498fce8" +dependencies = [ + "alloy-primitives", + "alloy-rlp", + "derive_more", + "k256", + "serde", +] + +[[package]] +name = "alloy-eips" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b6aa3961694b30ba53d41006131a2fca3bdab22e4c344e46db2c639e7c2dfdd" +dependencies = [ + "alloy-eip2930", + "alloy-eip7702", + "alloy-primitives", + "alloy-rlp", + "alloy-serde", + "c-kzg", + "derive_more", + "once_cell", + "serde", + "sha2", +] + +[[package]] +name = "alloy-genesis" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e53f7877ded3921d18a0a9556d55bedf84535567198c9edab2aa23106da91855" +dependencies = [ + "alloy-primitives", + "alloy-serde", + "serde", +] + +[[package]] +name = "alloy-json-abi" +version = "0.8.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a500037938085feed8a20dbfc8fce58c599db68c948cfae711147175dee392c" +dependencies = [ + "alloy-primitives", + "alloy-sol-type-parser", + "serde", + "serde_json", +] + +[[package]] +name = "alloy-json-rpc" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3694b7e480728c0b3e228384f223937f14c10caef5a4c766021190fc8f283d35" +dependencies = [ + "alloy-primitives", + "alloy-sol-types", + "serde", + "serde_json", + "thiserror", + "tracing", +] + +[[package]] +name = "alloy-network" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea94b8ceb5c75d7df0a93ba0acc53b55a22b47b532b600a800a87ef04eb5b0b4" +dependencies = [ + "alloy-consensus", + "alloy-eips", + "alloy-json-rpc", + "alloy-network-primitives", + "alloy-primitives", + "alloy-rpc-types-eth", + "alloy-serde", + "alloy-signer", + "alloy-sol-types", + "async-trait", + "auto_impl", + "futures-utils-wasm", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "alloy-network-primitives" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df9f3e281005943944d15ee8491534a1c7b3cbf7a7de26f8c433b842b93eb5f9" +dependencies = [ + "alloy-consensus", + "alloy-eips", + "alloy-primitives", + "alloy-serde", + "serde", +] + +[[package]] +name = "alloy-primitives" +version = "0.8.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3aeeb5825c2fc8c2662167058347cd0cafc3cb15bcb5cdb1758a63c2dca0409e" +dependencies = [ + "alloy-rlp", + "bytes", + "cfg-if", + "const-hex", + "derive_more", + "foldhash", + "hashbrown 0.15.2", + "hex-literal", + "indexmap", + "itoa", + "k256", + "keccak-asm", + "paste", + "proptest", + "rand", + "ruint", + "rustc-hash", + "serde", + "sha3", + "tiny-keccak", +] + +[[package]] +name = "alloy-provider" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40c1f9eede27bf4c13c099e8e64d54efd7ce80ef6ea47478aa75d5d74e2dba3b" +dependencies = [ + "alloy-chains", + "alloy-consensus", + "alloy-eips", + "alloy-json-rpc", + "alloy-network", + "alloy-network-primitives", + "alloy-primitives", + "alloy-pubsub", + "alloy-rpc-client", + "alloy-rpc-types-eth", + "alloy-rpc-types-trace", + "alloy-transport", + "alloy-transport-http", + "alloy-transport-ipc", + "alloy-transport-ws", + "async-stream", + "async-trait", + "auto_impl", + "dashmap 6.1.0", + "futures", + "futures-utils-wasm", + "lru", + "parking_lot", + "pin-project", + "reqwest", + "schnellru", + "serde", + "serde_json", + "thiserror", + "tokio", + "tracing", + "url", + "wasmtimer", +] + +[[package]] +name = "alloy-pubsub" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90f1f34232f77341076541c405482e4ae12f0ee7153d8f9969fc1691201b2247" +dependencies = [ + "alloy-json-rpc", + "alloy-primitives", + "alloy-transport", + "bimap", + "futures", + "serde", + "serde_json", + "tokio", + "tokio-stream", + "tower", + "tracing", +] + +[[package]] +name = "alloy-rlp" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da0822426598f95e45dd1ea32a738dac057529a709ee645fcc516ffa4cbde08f" +dependencies = [ + "alloy-rlp-derive", + "arrayvec", + "bytes", +] + +[[package]] +name = "alloy-rlp-derive" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b09cae092c27b6f1bde952653a22708691802e57bfef4a2973b80bea21efd3f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.89", +] + +[[package]] +name = "alloy-rpc-client" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "374dbe0dc3abdc2c964f36b3d3edf9cdb3db29d16bda34aa123f03d810bec1dd" +dependencies = [ + "alloy-json-rpc", + "alloy-primitives", + "alloy-pubsub", + "alloy-transport", + "alloy-transport-http", + "alloy-transport-ipc", + "alloy-transport-ws", + "futures", + "pin-project", + "reqwest", + "serde", + "serde_json", + "tokio", + "tokio-stream", + "tower", + "tracing", + "url", + "wasmtimer", +] + +[[package]] +name = "alloy-rpc-types" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c74832aa474b670309c20fffc2a869fa141edab7c79ff7963fad0a08de60bae1" +dependencies = [ + "alloy-primitives", + "alloy-rpc-types-engine", + "alloy-rpc-types-eth", + "alloy-rpc-types-trace", + "alloy-serde", + "serde", +] + +[[package]] +name = "alloy-rpc-types-engine" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f56294dce86af23ad6ee8df46cf8b0d292eb5d1ff67dc88a0886051e32b1faf" +dependencies = [ + "alloy-consensus", + "alloy-eips", + "alloy-primitives", + "alloy-rlp", + "alloy-serde", + "derive_more", + "serde", + "strum", +] + +[[package]] +name = "alloy-rpc-types-eth" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8a477281940d82d29315846c7216db45b15e90bcd52309da9f54bcf7ad94a11" +dependencies = [ + "alloy-consensus", + "alloy-eips", + "alloy-network-primitives", + "alloy-primitives", + "alloy-rlp", + "alloy-serde", + "alloy-sol-types", + "derive_more", + "itertools 0.13.0", + "serde", + "serde_json", +] + +[[package]] +name = "alloy-rpc-types-trace" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecd8b4877ef520c138af702097477cdd19504a8e1e4675ba37e92ba40f2d3c6f" +dependencies = [ + "alloy-primitives", + "alloy-rpc-types-eth", + "alloy-serde", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "alloy-serde" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dfa4a7ccf15b2492bb68088692481fd6b2604ccbee1d0d6c44c21427ae4df83" +dependencies = [ + "alloy-primitives", + "serde", + "serde_json", +] + +[[package]] +name = "alloy-signer" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e10aec39d60dc27edcac447302c7803d2371946fb737245320a05b78eb2fafd" +dependencies = [ + "alloy-primitives", + "async-trait", + "auto_impl", + "elliptic-curve", + "k256", + "thiserror", +] + +[[package]] +name = "alloy-signer-local" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8396f6dff60700bc1d215ee03d86ff56de268af96e2bf833a14d0bafcab9882" +dependencies = [ + "alloy-consensus", + "alloy-network", + "alloy-primitives", + "alloy-signer", + "async-trait", + "k256", + "rand", + "thiserror", +] + +[[package]] +name = "alloy-sol-macro" +version = "0.8.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c0279d09463a4695788a3622fd95443625f7be307422deba4b55dd491a9c7a1" +dependencies = [ + "alloy-sol-macro-expander", + "alloy-sol-macro-input", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn 2.0.89", +] + +[[package]] +name = "alloy-sol-macro-expander" +version = "0.8.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4feea540fc8233df2ad1156efd744b2075372f43a8f942a68b3b19c8a00e2c12" +dependencies = [ + "alloy-json-abi", + "alloy-sol-macro-input", + "const-hex", + "heck 0.5.0", + "indexmap", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn 2.0.89", + "syn-solidity", + "tiny-keccak", +] + +[[package]] +name = "alloy-sol-macro-input" +version = "0.8.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a0ad281f3d1b613af814b66977ee698e443d4644a1510962d0241f26e0e53ae" +dependencies = [ + "alloy-json-abi", + "const-hex", + "dunce", + "heck 0.5.0", + "proc-macro2", + "quote", + "serde_json", + "syn 2.0.89", + "syn-solidity", +] + +[[package]] +name = "alloy-sol-type-parser" +version = "0.8.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96eff16c797438add6c37bb335839d015b186c5421ee5626f5559a7bfeb38ef5" +dependencies = [ + "serde", + "winnow", +] + +[[package]] +name = "alloy-sol-types" +version = "0.8.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cff34e0682d6665da243a3e81da96f07a2dd50f7e64073e382b1a141f5a2a2f6" +dependencies = [ + "alloy-json-abi", + "alloy-primitives", + "alloy-sol-macro", + "const-hex", + "serde", +] + +[[package]] +name = "alloy-transport" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f99acddb34000d104961897dbb0240298e8b775a7efffb9fda2a1a3efedd65b3" +dependencies = [ + "alloy-json-rpc", + "base64 0.22.1", + "futures-util", + "futures-utils-wasm", + "serde", + "serde_json", + "thiserror", + "tokio", + "tower", + "tracing", + "url", + "wasmtimer", +] + +[[package]] +name = "alloy-transport-http" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dc013132e34eeadaa0add7e74164c1503988bfba8bae885b32e0918ba85a8a6" +dependencies = [ + "alloy-json-rpc", + "alloy-transport", + "reqwest", + "serde_json", + "tower", + "tracing", + "url", +] + +[[package]] +name = "alloy-transport-ipc" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "063edc0660e81260653cc6a95777c29d54c2543a668aa5da2359fb450d25a1ba" +dependencies = [ + "alloy-json-rpc", + "alloy-pubsub", + "alloy-transport", + "bytes", + "futures", + "interprocess", + "pin-project", + "serde", + "serde_json", + "tempfile", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "alloy-transport-ws" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abd170e600801116d5efe64f74a4fc073dbbb35c807013a7d0a388742aeebba0" +dependencies = [ + "alloy-pubsub", + "alloy-transport", + "futures", + "http", + "rustls", + "serde_json", + "tokio", + "tokio-tungstenite", + "tracing", + "ws_stream_wasm", +] [[package]] name = "android-tzdata" @@ -113,26 +698,26 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.6" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" +checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" [[package]] name = "anstyle-parse" -version = "0.2.3" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" +checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.2" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" +checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -154,6 +739,130 @@ dependencies = [ "num-traits", ] +[[package]] +name = "ark-ff" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b3235cc41ee7a12aaaf2c575a2ad7b46713a8a50bda2fc3b003a04845c05dd6" +dependencies = [ + "ark-ff-asm 0.3.0", + "ark-ff-macros 0.3.0", + "ark-serialize 0.3.0", + "ark-std 0.3.0", + "derivative", + "num-bigint", + "num-traits", + "paste", + "rustc_version 0.3.3", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" +dependencies = [ + "ark-ff-asm 0.4.2", + "ark-ff-macros 0.4.2", + "ark-serialize 0.4.2", + "ark-std 0.4.0", + "derivative", + "digest 0.10.7", + "itertools 0.10.5", + "num-bigint", + "num-traits", + "paste", + "rustc_version 0.4.1", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db02d390bf6643fb404d3d22d31aee1c4bc4459600aef9113833d17e786c6e44" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-asm" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fd794a08ccb318058009eefdf15bcaaaaf6f8161eb3345f907222bac38b20" +dependencies = [ + "num-bigint", + "num-traits", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-serialize" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d6c2b318ee6e10f8c2853e73a83adc0ccb88995aa978d8a3408d492ab2ee671" +dependencies = [ + "ark-std 0.3.0", + "digest 0.9.0", +] + +[[package]] +name = "ark-serialize" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" +dependencies = [ + "ark-std 0.4.0", + "digest 0.10.7", + "num-bigint", +] + +[[package]] +name = "ark-std" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1df2c09229cbc5a028b1d70e00fdb2acee28b1055dfb5ca73eea49c5a25c4e7c" +dependencies = [ + "num-traits", + "rand", +] + +[[package]] +name = "ark-std" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits", + "rand", +] + [[package]] name = "array-init-cursor" version = "0.2.0" @@ -162,24 +871,15 @@ checksum = "bf7d0a018de4f6aa429b9d33d69edf69072b1c5b1cb8d3e4a5f7ef898fc3eb76" [[package]] name = "arrayvec" -version = "0.7.4" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" - -[[package]] -name = "ascii-canvas" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8824ecca2e851cec16968d54a01dd372ef8f95b244fb84b84e70128be347c3c6" -dependencies = [ - "term", -] +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "async-stream" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51" +checksum = "0b5a71a6f37880a80d1d7f19efd781e4b5de42c88f0722cc13bcb6cc2cfe8476" dependencies = [ "async-stream-impl", "futures-core", @@ -188,24 +888,24 @@ dependencies = [ [[package]] name = "async-stream-impl" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" +checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.89", ] [[package]] name = "async-trait" -version = "0.1.80" +version = "0.1.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" +checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.89", ] [[package]] @@ -216,7 +916,7 @@ checksum = "b6d7b9decdf35d8908a7e3ef02f64c5e9b1695e230154c0e8de3969142d9b94c" dependencies = [ "futures", "pharos", - "rustc_version", + "rustc_version 0.4.1", ] [[package]] @@ -242,28 +942,28 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.89", ] [[package]] name = "autocfg" -version = "1.2.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[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]] @@ -272,18 +972,18 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" -[[package]] -name = "base64" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" - [[package]] name = "base64" version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + [[package]] name = "base64ct" version = "1.6.0" @@ -291,10 +991,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" [[package]] -name = "bech32" -version = "0.9.1" +name = "bimap" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d86b93f97252c47b41663388e6d155714a9d0c398b99f1005cbc5f978b29f445" +checksum = "230c5f1ca6a325a32553f8640d31ac9b49f2411e901e427570154868b46da4f7" [[package]] name = "bit-set" @@ -313,15 +1013,9 @@ checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" [[package]] name = "bitflags" -version = "1.3.2" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "bitvec" @@ -344,6 +1038,18 @@ dependencies = [ "generic-array", ] +[[package]] +name = "blst" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4378725facc195f1a538864863f6de233b500a8862747e7f165078a419d5e874" +dependencies = [ + "cc", + "glob", + "threadpool", + "zeroize", +] + [[package]] name = "brotli" version = "3.5.0" @@ -365,16 +1071,6 @@ dependencies = [ "alloc-stdlib", ] -[[package]] -name = "bs58" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4" -dependencies = [ - "sha2", - "tinyvec", -] - [[package]] name = "bumpalo" version = "3.16.0" @@ -389,22 +1085,22 @@ checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" [[package]] name = "bytemuck" -version = "1.15.0" +version = "1.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d6d68c57235a3a081186990eca2867354726650f42f7516ca50c28d6281fd15" +checksum = "8b37c88a63ffd85d15b406896cc343916d7cf57838a847b3a6f2ca5d39a5695a" dependencies = [ "bytemuck_derive", ] [[package]] name = "bytemuck_derive" -version = "1.6.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4da9a32f3fed317401fa3c862968128267c3106685286e15d5aaa3d7389c2f60" +checksum = "bcfcc3cd946cb52f0bbfdbbcfa2f4e24f75ebb6c0e1002f7c25904fada18b9ec" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.89", ] [[package]] @@ -415,74 +1111,37 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.6.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" +checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" dependencies = [ "serde", ] [[package]] -name = "bzip2" -version = "0.4.4" +name = "c-kzg" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdb116a6ef3f6c3698828873ad02c3014b3c85cadb88496095628e3ef1e347f8" -dependencies = [ - "bzip2-sys", - "libc", -] - -[[package]] -name = "bzip2-sys" -version = "0.1.11+1.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" +checksum = "f0307f72feab3300336fb803a57134159f6e20139af1357f36c54cb90d8e8928" dependencies = [ + "blst", "cc", + "glob", + "hex", "libc", - "pkg-config", -] - -[[package]] -name = "camino" -version = "1.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" -dependencies = [ + "once_cell", "serde", ] -[[package]] -name = "cargo-platform" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24b1f0365a6c6bb4020cd05806fd0d33c44d38046b8bd7f0e40814b9763cabfc" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo_metadata" -version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" -dependencies = [ - "camino", - "cargo-platform", - "semver", - "serde", - "serde_json", - "thiserror", -] - [[package]] name = "cc" -version = "1.0.94" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17f6e324229dc011159fcc089755d1e2e216a90d43a7dea6853ca740b84f35e7" +checksum = "fd9de9f2205d5ef3fd67e685b0df337994ddd4495e2a28d185500d0e1edfea47" dependencies = [ "jobserver", "libc", + "shlex", ] [[package]] @@ -503,7 +1162,7 @@ dependencies = [ "num-traits", "serde", "wasm-bindgen", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -528,16 +1187,6 @@ dependencies = [ "phf_codegen", ] -[[package]] -name = "cipher" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" -dependencies = [ - "crypto-common", - "inout", -] - [[package]] name = "clap_builder_cryo" version = "4.3.21-cryo" @@ -567,10 +1216,10 @@ version = "4.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd1cd2cebdb1ec98182edb745382a2b65d6bc254782de26316e4366d83d39988" dependencies = [ - "heck", + "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.89", ] [[package]] @@ -579,84 +1228,32 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98979652585ac7c8d6267e363229b6a26bc4bf469c69e96442f85830ebc89f45" -[[package]] -name = "coins-bip32" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b6be4a5df2098cd811f3194f64ddb96c267606bffd9689ac7b0160097b01ad3" -dependencies = [ - "bs58", - "coins-core", - "digest", - "hmac", - "k256", - "serde", - "sha2", - "thiserror", -] - -[[package]] -name = "coins-bip39" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3db8fba409ce3dc04f7d804074039eb68b960b0829161f8e06c95fea3f122528" -dependencies = [ - "bitvec", - "coins-bip32", - "hmac", - "once_cell", - "pbkdf2 0.12.2", - "rand", - "sha2", - "thiserror", -] - -[[package]] -name = "coins-core" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5286a0843c21f8367f7be734f89df9b822e0321d8bcce8d6e735aadff7d74979" -dependencies = [ - "base64 0.21.7", - "bech32", - "bs58", - "digest", - "generic-array", - "hex", - "ripemd", - "serde", - "serde_derive", - "sha2", - "sha3", - "thiserror", -] - [[package]] name = "color-print" -version = "0.3.5" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a858372ff14bab9b1b30ea504f2a4bc534582aee3e42ba2d41d2a7baba63d5d" +checksum = "3aa954171903797d5623e047d9ab69d91b493657917bdfb8c2c80ecaf9cdb6f4" dependencies = [ "color-print-proc-macro", ] [[package]] name = "color-print-proc-macro" -version = "0.3.5" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57e37866456a721d0a404439a1adae37a31be4e0055590d053dfe6981e05003f" +checksum = "692186b5ebe54007e45a59aea47ece9eb4108e141326c304cdc91699a7118a22" dependencies = [ "nom", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.89", ] [[package]] name = "colorchoice" -version = "1.0.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" +checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" [[package]] name = "colored" @@ -670,14 +1267,14 @@ dependencies = [ [[package]] name = "comfy-table" -version = "7.1.1" +version = "7.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b34115915337defe99b2aff5c2ce6771e5fbc4079f4b506301f5cf394c8452f7" +checksum = "24f165e7b643266ea80cb858aed492ad9280e3e05ce24d4a99d7d7b889b6a4d9" dependencies = [ "crossterm", "strum", - "strum_macros 0.26.2", - "unicode-width", + "strum_macros 0.26.4", + "unicode-width 0.2.0", ] [[package]] @@ -689,15 +1286,15 @@ dependencies = [ "encode_unicode", "lazy_static", "libc", - "unicode-width", + "unicode-width 0.1.14", "windows-sys 0.52.0", ] [[package]] name = "const-hex" -version = "1.11.3" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ba00838774b4ab0233e355d26710fbfc8327a05c017f6dc4873f876d1f79f78" +checksum = "487981fa1af147182687064d0a2c336586d337a606595ced9ffb0c685c250c73" dependencies = [ "cfg-if", "cpufeatures", @@ -712,12 +1309,6 @@ version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" -[[package]] -name = "constant_time_eq" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" - [[package]] name = "core-foundation" version = "0.9.4" @@ -730,33 +1321,33 @@ 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.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +checksum = "16b80225097f2e5ae4e7179dd2266824648f3e2f49d9134d584b76389d31c4c3" dependencies = [ "libc", ] [[package]] name = "crc32fast" -version = "1.4.0" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ "cfg-if", ] [[package]] name = "crossbeam-channel" -version = "0.5.12" +version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab3db02a9c5b5121e1e42fbdb1aeb65f5e02624cc58c43f2884c6ccac0b82f95" +checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" dependencies = [ "crossbeam-utils", ] @@ -791,20 +1382,20 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.19" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "crossterm" -version = "0.27.0" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f476fe445d41c9e991fd07515a6f463074b782242ccf4a5b7b1d1012e70824df" +checksum = "829d955a0bb380ef178a640b91779e3987da38c9aea133b20614cfed8cdea9c6" dependencies = [ - "bitflags 2.5.0", + "bitflags", "crossterm_winapi", - "libc", "parking_lot", + "rustix", "winapi", ] @@ -827,12 +1418,12 @@ checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" name = "cryo_cli" version = "0.3.2" dependencies = [ + "alloy", "anstyle", "clap_cryo", "color-print", "colored", "cryo_freeze", - "ethers", "eyre", "governor", "hex", @@ -848,18 +1439,16 @@ dependencies = [ name = "cryo_freeze" version = "0.3.2" dependencies = [ + "alloy", "async-trait", "chrono", "colored", "cryo_to_df", - "ethers", - "ethers-core", "futures", "governor", - "heck", + "heck 0.4.1", "indexmap", "indicatif", - "lazy_static", "mesc", "polars", "prefix-hex", @@ -869,6 +1458,7 @@ dependencies = [ "thiserror", "thousands", "tokio", + "url", ] [[package]] @@ -917,15 +1507,6 @@ dependencies = [ "typenum", ] -[[package]] -name = "ctr" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" -dependencies = [ - "cipher", -] - [[package]] name = "dashmap" version = "5.5.3" @@ -933,7 +1514,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" dependencies = [ "cfg-if", - "hashbrown", + "hashbrown 0.14.5", + "lock_api", + "once_cell", + "parking_lot_core", +] + +[[package]] +name = "dashmap" +version = "6.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5041cc499144891f3790297212f32a74fb938e5136a14943f338ef9e0ae276cf" +dependencies = [ + "cfg-if", + "crossbeam-utils", + "hashbrown 0.14.5", "lock_api", "once_cell", "parking_lot_core", @@ -941,9 +1536,9 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" +checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" [[package]] name = "der" @@ -956,25 +1551,46 @@ dependencies = [ ] [[package]] -name = "deranged" -version = "0.3.11" +name = "derivative" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" -dependencies = [ - "powerfmt", -] - -[[package]] -name = "derive_more" -version = "0.99.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" dependencies = [ "proc-macro2", "quote", "syn 1.0.109", ] +[[package]] +name = "derive_more" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.89", + "unicode-xid", +] + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array", +] + [[package]] name = "digest" version = "0.10.7" @@ -988,52 +1604,27 @@ dependencies = [ ] [[package]] -name = "dirs" -version = "5.0.1" +name = "displaydoc" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ - "dirs-sys", + "proc-macro2", + "quote", + "syn 2.0.89", ] [[package]] -name = "dirs-next" -version = "2.0.0" +name = "doctest-file" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" -dependencies = [ - "cfg-if", - "dirs-sys-next", -] - -[[package]] -name = "dirs-sys" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" -dependencies = [ - "libc", - "option-ext", - "redox_users", - "windows-sys 0.48.0", -] - -[[package]] -name = "dirs-sys-next" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" -dependencies = [ - "libc", - "redox_users", - "winapi", -] +checksum = "aac81fa3e28d21450aa4d2ac065992ba96a1d7303efbce51a95f4fd175b67562" [[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" @@ -1048,7 +1639,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" dependencies = [ "der", - "digest", + "digest 0.10.7", "elliptic-curve", "rfc6979", "signature", @@ -1057,9 +1648,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" @@ -1069,7 +1660,7 @@ checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" dependencies = [ "base16ct", "crypto-bigint", - "digest", + "digest 0.10.7", "ff", "generic-array", "group", @@ -1080,48 +1671,12 @@ dependencies = [ "zeroize", ] -[[package]] -name = "ena" -version = "0.14.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c533630cf40e9caa44bd91aadc88a75d75a4c3a12b4cfde353cbed41daa1e1f1" -dependencies = [ - "log", -] - [[package]] name = "encode_unicode" version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" -[[package]] -name = "encoding_rs" -version = "0.8.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "enr" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a3d8dc56e02f954cac8eb489772c552c473346fc34f67412bb6244fd647f7e4" -dependencies = [ - "base64 0.21.7", - "bytes", - "hex", - "k256", - "log", - "rand", - "rlp", - "serde", - "sha3", - "zeroize", -] - [[package]] name = "enum_dispatch" version = "0.3.13" @@ -1131,7 +1686,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.89", ] [[package]] @@ -1142,334 +1697,14 @@ 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", ] -[[package]] -name = "eth-keystore" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fda3bf123be441da5260717e0661c25a2fd9cb2b2c1d20bf2e05580047158ab" -dependencies = [ - "aes", - "ctr", - "digest", - "hex", - "hmac", - "pbkdf2 0.11.0", - "rand", - "scrypt", - "serde", - "serde_json", - "sha2", - "sha3", - "thiserror", - "uuid 0.8.2", -] - -[[package]] -name = "ethabi" -version = "18.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7413c5f74cc903ea37386a8965a936cbeb334bd270862fdece542c1b2dcbc898" -dependencies = [ - "ethereum-types", - "hex", - "once_cell", - "regex", - "serde", - "serde_json", - "sha3", - "thiserror", - "uint", -] - -[[package]] -name = "ethbloom" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c22d4b5885b6aa2fe5e8b9329fb8d232bf739e434e6b87347c63bdd00c120f60" -dependencies = [ - "crunchy", - "fixed-hash", - "impl-codec", - "impl-rlp", - "impl-serde", - "scale-info", - "tiny-keccak", -] - -[[package]] -name = "ethereum-types" -version = "0.14.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02d215cbf040552efcbe99a38372fe80ab9d00268e20012b79fcd0f073edd8ee" -dependencies = [ - "ethbloom", - "fixed-hash", - "impl-codec", - "impl-rlp", - "impl-serde", - "primitive-types", - "scale-info", - "uint", -] - -[[package]] -name = "ethers" -version = "2.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "816841ea989f0c69e459af1cf23a6b0033b19a55424a1ea3a30099becdb8dec0" -dependencies = [ - "ethers-addressbook", - "ethers-contract", - "ethers-core", - "ethers-etherscan", - "ethers-middleware", - "ethers-providers", - "ethers-signers", - "ethers-solc", -] - -[[package]] -name = "ethers-addressbook" -version = "2.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5495afd16b4faa556c3bba1f21b98b4983e53c1755022377051a975c3b021759" -dependencies = [ - "ethers-core", - "once_cell", - "serde", - "serde_json", -] - -[[package]] -name = "ethers-contract" -version = "2.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fceafa3578c836eeb874af87abacfb041f92b4da0a78a5edd042564b8ecdaaa" -dependencies = [ - "const-hex", - "ethers-contract-abigen", - "ethers-contract-derive", - "ethers-core", - "ethers-providers", - "futures-util", - "once_cell", - "pin-project", - "serde", - "serde_json", - "thiserror", -] - -[[package]] -name = "ethers-contract-abigen" -version = "2.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04ba01fbc2331a38c429eb95d4a570166781f14290ef9fdb144278a90b5a739b" -dependencies = [ - "Inflector", - "const-hex", - "dunce", - "ethers-core", - "ethers-etherscan", - "eyre", - "prettyplease", - "proc-macro2", - "quote", - "regex", - "reqwest", - "serde", - "serde_json", - "syn 2.0.60", - "toml", - "walkdir", -] - -[[package]] -name = "ethers-contract-derive" -version = "2.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87689dcabc0051cde10caaade298f9e9093d65f6125c14575db3fd8c669a168f" -dependencies = [ - "Inflector", - "const-hex", - "ethers-contract-abigen", - "ethers-core", - "proc-macro2", - "quote", - "serde_json", - "syn 2.0.60", -] - -[[package]] -name = "ethers-core" -version = "2.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82d80cc6ad30b14a48ab786523af33b37f28a8623fc06afd55324816ef18fb1f" -dependencies = [ - "arrayvec", - "bytes", - "cargo_metadata", - "chrono", - "const-hex", - "elliptic-curve", - "ethabi", - "generic-array", - "k256", - "num_enum", - "once_cell", - "open-fastrlp", - "rand", - "rlp", - "serde", - "serde_json", - "strum", - "syn 2.0.60", - "tempfile", - "thiserror", - "tiny-keccak", - "unicode-xid", -] - -[[package]] -name = "ethers-etherscan" -version = "2.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e79e5973c26d4baf0ce55520bd732314328cabe53193286671b47144145b9649" -dependencies = [ - "chrono", - "ethers-core", - "reqwest", - "semver", - "serde", - "serde_json", - "thiserror", - "tracing", -] - -[[package]] -name = "ethers-middleware" -version = "2.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48f9fdf09aec667c099909d91908d5eaf9be1bd0e2500ba4172c1d28bfaa43de" -dependencies = [ - "async-trait", - "auto_impl", - "ethers-contract", - "ethers-core", - "ethers-etherscan", - "ethers-providers", - "ethers-signers", - "futures-channel", - "futures-locks", - "futures-util", - "instant", - "reqwest", - "serde", - "serde_json", - "thiserror", - "tokio", - "tracing", - "tracing-futures", - "url", -] - -[[package]] -name = "ethers-providers" -version = "2.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6434c9a33891f1effc9c75472e12666db2fa5a0fec4b29af6221680a6fe83ab2" -dependencies = [ - "async-trait", - "auto_impl", - "base64 0.21.7", - "bytes", - "const-hex", - "enr", - "ethers-core", - "futures-channel", - "futures-core", - "futures-timer", - "futures-util", - "hashers", - "http", - "instant", - "jsonwebtoken", - "once_cell", - "pin-project", - "reqwest", - "serde", - "serde_json", - "thiserror", - "tokio", - "tokio-tungstenite", - "tracing", - "tracing-futures", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "winapi", - "ws_stream_wasm", -] - -[[package]] -name = "ethers-signers" -version = "2.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "228875491c782ad851773b652dd8ecac62cda8571d3bc32a5853644dd26766c2" -dependencies = [ - "async-trait", - "coins-bip32", - "coins-bip39", - "const-hex", - "elliptic-curve", - "eth-keystore", - "ethers-core", - "rand", - "sha2", - "thiserror", - "tracing", -] - -[[package]] -name = "ethers-solc" -version = "2.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66244a771d9163282646dbeffe0e6eca4dda4146b6498644e678ac6089b11edd" -dependencies = [ - "cfg-if", - "const-hex", - "dirs", - "dunce", - "ethers-core", - "glob", - "home", - "md-5", - "num_cpus", - "once_cell", - "path-slash", - "rayon", - "regex", - "semver", - "serde", - "serde_json", - "solang-parser", - "svm-rs", - "thiserror", - "tiny-keccak", - "tokio", - "tracing", - "walkdir", - "yansi", -] - [[package]] name = "ethnum" version = "1.5.0" @@ -1500,9 +1735,20 @@ checksum = "95765f67b4b18863968b4a1bd5bb576f732b29a4a28c7cd84c09fa3e2875f33c" [[package]] name = "fastrand" -version = "2.0.2" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984" +checksum = "486f806e73c5707928240ddc295403b1b93c96a02038563881c4a2fd84b81ac4" + +[[package]] +name = "fastrlp" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "139834ddba373bbdd213dffe02c8d110508dcf1726c2be27e8d1f7d7e1856418" +dependencies = [ + "arrayvec", + "auto_impl", + "bytes", +] [[package]] name = "ff" @@ -1526,17 +1772,11 @@ dependencies = [ "static_assertions", ] -[[package]] -name = "fixedbitset" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" - [[package]] name = "flate2" -version = "1.0.28" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" dependencies = [ "crc32fast", "miniz_oxide", @@ -1557,6 +1797,27 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foldhash" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f81ec6369c545a7d40e4589b5597581fa1c441fe1cce96dd1de43159910a36a2" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + [[package]] name = "foreign_vec" version = "0.1.0" @@ -1572,16 +1833,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "fs2" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213" -dependencies = [ - "libc", - "winapi", -] - [[package]] name = "funty" version = "2.0.0" @@ -1590,9 +1841,9 @@ checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] name = "futures" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" dependencies = [ "futures-channel", "futures-core", @@ -1605,9 +1856,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ "futures-core", "futures-sink", @@ -1615,15 +1866,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-executor" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" dependencies = [ "futures-core", "futures-task", @@ -1632,58 +1883,44 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" - -[[package]] -name = "futures-locks" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45ec6fe3675af967e67c5536c0b9d44e34e6c52f86bedc4ea49c5317b8e94d06" -dependencies = [ - "futures-channel", - "futures-task", -] +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-macro" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.89", ] [[package]] name = "futures-sink" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" [[package]] name = "futures-task" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" [[package]] name = "futures-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" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ "futures-channel", "futures-core", @@ -1698,13 +1935,10 @@ dependencies = [ ] [[package]] -name = "fxhash" -version = "0.2.1" +name = "futures-utils-wasm" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" -dependencies = [ - "byteorder", -] +checksum = "42012b0f064e01aa58b545fe3727f90f7dd4020f4a3ea735b50344965f5a57e9" [[package]] name = "generic-array" @@ -1719,9 +1953,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", @@ -1732,9 +1966,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.1" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "glob" @@ -1742,18 +1976,6 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" -[[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 = "governor" version = "0.6.3" @@ -1761,7 +1983,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68a7f542ee6b35af73b06abc0dad1c1bae89964e4e253bc4b587b91c9637867b" dependencies = [ "cfg-if", - "dashmap", + "dashmap 5.5.3", "futures", "futures-timer", "no-std-compat", @@ -1785,40 +2007,27 @@ dependencies = [ "subtle", ] -[[package]] -name = "h2" -version = "0.3.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" -dependencies = [ - "bytes", - "fnv", - "futures-core", - "futures-sink", - "futures-util", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - [[package]] name = "halfbrown" version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8588661a8607108a5ca69cab034063441a0413a0b041c13618a7dd348021ef6f" dependencies = [ - "hashbrown", + "hashbrown 0.14.5", "serde", ] [[package]] name = "hashbrown" -version = "0.14.3" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ "ahash", "allocator-api2", @@ -1826,12 +2035,15 @@ dependencies = [ ] [[package]] -name = "hashers" -version = "1.0.1" +name = "hashbrown" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2bca93b15ea5a746f220e56587f71e73c6165eab783df9e26590069953e3c30" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" dependencies = [ - "fxhash", + "allocator-api2", + "equivalent", + "foldhash", + "serde", ] [[package]] @@ -1840,17 +2052,38 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + [[package]] name = "hermit-abi" version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" +[[package]] +name = "hermit-abi" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" + [[package]] name = "hex" version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +dependencies = [ + "serde", +] + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "hmac" @@ -1858,7 +2091,7 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ - "digest", + "digest 0.10.7", ] [[package]] @@ -1872,9 +2105,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.12" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" +checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" dependencies = [ "bytes", "fnv", @@ -1883,70 +2116,92 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.6" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" dependencies = [ "bytes", "http", +] + +[[package]] +name = "http-body-util" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" +dependencies = [ + "bytes", + "futures-util", + "http", + "http-body", "pin-project-lite", ] [[package]] name = "httparse" -version = "1.8.0" +version = "1.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" - -[[package]] -name = "httpdate" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" +checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" [[package]] name = "hyper" -version = "0.14.28" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" +checksum = "97818827ef4f364230e16705d4706e2897df2bb60617d6ca15d598025a3c481f" dependencies = [ "bytes", "futures-channel", - "futures-core", "futures-util", - "h2", "http", "http-body", "httparse", - "httpdate", "itoa", "pin-project-lite", + "smallvec", + "tokio", + "want", +] + +[[package]] +name = "hyper-tls" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" +dependencies = [ + "bytes", + "http-body-util", + "hyper", + "hyper-util", + "native-tls", + "tokio", + "tokio-native-tls", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http", + "http-body", + "hyper", + "pin-project-lite", "socket2", "tokio", "tower-service", "tracing", - "want", -] - -[[package]] -name = "hyper-rustls" -version = "0.24.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" -dependencies = [ - "futures-util", - "http", - "hyper", - "rustls", - "tokio", - "tokio-rustls", ] [[package]] name = "iana-time-zone" -version = "0.1.60" +version = "0.1.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" +checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -1966,13 +2221,142 @@ dependencies = [ ] [[package]] -name = "idna" -version = "0.5.0" +name = "icu_collections" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.89", +] + +[[package]] +name = "idna" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +dependencies = [ + "icu_normalizer", + "icu_properties", ] [[package]] @@ -1984,33 +2368,15 @@ dependencies = [ "parity-scale-codec", ] -[[package]] -name = "impl-rlp" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f28220f89297a075ddc7245cd538076ee98b01f2a9c23a53a4f1105d5a322808" -dependencies = [ - "rlp", -] - -[[package]] -name = "impl-serde" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc88fc67028ae3db0c853baa36269d398d5f45b6982f95549ff5def78c935cd" -dependencies = [ - "serde", -] - [[package]] name = "impl-trait-for-tuples" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" +checksum = "a0eb5a3343abf848c0984fe4604b2b105da9539376e24fc0a3b0007411ae4fd9" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.89", ] [[package]] @@ -2021,25 +2387,26 @@ checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" [[package]] name = "indexmap" -version = "2.2.6" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ "equivalent", - "hashbrown", + "hashbrown 0.15.2", + "serde", ] [[package]] name = "indicatif" -version = "0.17.8" +version = "0.17.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "763a5a8f45087d6bcea4222e7b72c291a054edf80e4ef6efd2a4979878c7bea3" +checksum = "cbf675b85ed934d3c67b5c5469701eec7db22689d0a2139d856e0925fa28b281" dependencies = [ "console", - "instant", "number_prefix", "portable-atomic", - "unicode-width", + "unicode-width 0.2.0", + "web-time", ] [[package]] @@ -2049,54 +2416,60 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5" [[package]] -name = "inout" -version = "0.1.3" +name = "interprocess" +version = "2.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" +checksum = "894148491d817cb36b6f778017b8ac46b17408d522dd90f539d677ea938362eb" dependencies = [ - "generic-array", -] - -[[package]] -name = "instant" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" -dependencies = [ - "cfg-if", + "doctest-file", + "futures-core", + "libc", + "recvmsg", + "tokio", + "widestring", + "windows-sys 0.52.0", ] [[package]] name = "ipnet" -version = "2.9.0" +version = "2.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" +checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" [[package]] name = "is-terminal" -version = "0.4.12" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" +checksum = "261f68e344040fbd0edea105bef17c66edf46f984ddb1115b775ce31be948f4b" dependencies = [ - "hermit-abi", + "hermit-abi 0.4.0", "libc", "windows-sys 0.52.0", ] [[package]] name = "itertools" -version = "0.11.0" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" dependencies = [ "either", ] [[package]] name = "itoa" -version = "1.0.11" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" [[package]] name = "itoap" @@ -2106,18 +2479,18 @@ checksum = "9028f49264629065d057f340a86acb84867925865f73bbf8d47b4d149a7e88b8" [[package]] name = "jobserver" -version = "0.1.30" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "685a7d121ee3f65ae4fddd72b25a04bb36b6af81bc0828f7d5434c0fe60fa3a2" +checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" dependencies = [ "libc", ] [[package]] name = "js-sys" -version = "0.3.69" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" dependencies = [ "wasm-bindgen", ] @@ -2133,32 +2506,17 @@ dependencies = [ "serde_json", ] -[[package]] -name = "jsonwebtoken" -version = "8.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6971da4d9c3aa03c3d8f3ff0f4155b534aad021292003895a469716b2a230378" -dependencies = [ - "base64 0.21.7", - "pem", - "ring 0.16.20", - "serde", - "serde_json", - "simple_asn1", -] - [[package]] name = "k256" -version = "0.13.3" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" +checksum = "f6e3919bbaa2945715f0bb6d3934a173d1e9a59ac23767fbaaef277265a7411b" dependencies = [ "cfg-if", "ecdsa", "elliptic-curve", "once_cell", "sha2", - "signature", ] [[package]] @@ -2171,46 +2529,26 @@ dependencies = [ ] [[package]] -name = "lalrpop" -version = "0.20.2" +name = "keccak-asm" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55cb077ad656299f160924eb2912aa147d7339ea7d69e1b5517326fdcec3c1ca" +checksum = "505d1856a39b200489082f90d897c3f07c455563880bc5952e38eabf731c83b6" dependencies = [ - "ascii-canvas", - "bit-set", - "ena", - "itertools", - "lalrpop-util", - "petgraph", - "regex", - "regex-syntax", - "string_cache", - "term", - "tiny-keccak", - "unicode-xid", - "walkdir", -] - -[[package]] -name = "lalrpop-util" -version = "0.20.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "507460a910eb7b32ee961886ff48539633b788a36b65692b95f225b844c82553" -dependencies = [ - "regex-automata", + "digest 0.10.7", + "sha3-asm", ] [[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 = "lexical-core" -version = "0.8.5" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cde5de06e8d4c2faabc400238f9ae1c74d5412d03a7bd067645ccbc47070e46" +checksum = "0431c65b318a590c1de6b8fd6e72798c92291d27762d94c9e6c37ed7a73d8458" dependencies = [ "lexical-parse-float", "lexical-parse-integer", @@ -2221,9 +2559,9 @@ dependencies = [ [[package]] name = "lexical-parse-float" -version = "0.8.5" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "683b3a5ebd0130b8fb52ba0bdc718cc56815b6a097e28ae5a6997d0ad17dc05f" +checksum = "eb17a4bdb9b418051aa59d41d65b1c9be5affab314a872e5ad7f06231fb3b4e0" dependencies = [ "lexical-parse-integer", "lexical-util", @@ -2232,9 +2570,9 @@ dependencies = [ [[package]] name = "lexical-parse-integer" -version = "0.8.6" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d0994485ed0c312f6d965766754ea177d07f9c00c9b82a5ee62ed5b47945ee9" +checksum = "5df98f4a4ab53bf8b175b363a34c7af608fe31f93cc1fb1bf07130622ca4ef61" dependencies = [ "lexical-util", "static_assertions", @@ -2242,18 +2580,18 @@ dependencies = [ [[package]] name = "lexical-util" -version = "0.8.5" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5255b9ff16ff898710eb9eb63cb39248ea8a5bb036bea8085b1a767ff6c4e3fc" +checksum = "85314db53332e5c192b6bca611fb10c114a80d1b831ddac0af1e9be1b9232ca0" dependencies = [ "static_assertions", ] [[package]] name = "lexical-write-float" -version = "0.8.5" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accabaa1c4581f05a3923d1b4cfd124c329352288b7b9da09e766b0668116862" +checksum = "6e7c3ad4e37db81c1cbe7cf34610340adc09c322871972f74877a712abc6c809" dependencies = [ "lexical-util", "lexical-write-integer", @@ -2262,9 +2600,9 @@ dependencies = [ [[package]] name = "lexical-write-integer" -version = "0.8.5" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1b6f3d1f4422866b68192d62f77bc5c700bee84f3069f2469d7bc8c77852446" +checksum = "eb89e9f6958b83258afa3deed90b5de9ef68eef090ad5086c791cd2345610162" dependencies = [ "lexical-util", "static_assertions", @@ -2272,37 +2610,33 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.153" +version = "0.2.165" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "fcb4d3d38eab6c5239a362fa8bae48c03baf980a6e7079f063942d563ef3533e" [[package]] name = "libm" -version = "0.2.8" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" - -[[package]] -name = "libredox" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" -dependencies = [ - "bitflags 2.5.0", - "libc", -] +checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" [[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 = "litemap" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" [[package]] name = "lock_api" -version = "0.4.11" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ "autocfg", "scopeguard", @@ -2310,45 +2644,43 @@ 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.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" +dependencies = [ + "hashbrown 0.15.2", +] [[package]] name = "lz4" -version = "1.24.0" +version = "1.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e9e2dd86df36ce760a60f6ff6ad526f7ba1f14ba0356f8254fb6905e6494df1" +checksum = "4d1febb2b4a79ddd1980eede06a8f7902197960aa0383ffcfdd62fe723036725" dependencies = [ - "libc", "lz4-sys", ] [[package]] name = "lz4-sys" -version = "1.9.4" +version = "1.11.1+lz4-1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57d27b317e207b10f69f5e75494119e391a96f48861ae870d1da6edac98ca900" +checksum = "6bd8c0d6c6ed0cd30b3652886bb8711dc4bb01d637a68105a3d5158039b418e6" dependencies = [ "cc", "libc", ] -[[package]] -name = "md-5" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" -dependencies = [ - "cfg-if", - "digest", -] - [[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 = "memmap2" @@ -2393,22 +2725,23 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[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]] name = "mio" -version = "0.8.11" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" dependencies = [ + "hermit-abi 0.3.9", "libc", "wasi", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -2434,10 +2767,21 @@ dependencies = [ ] [[package]] -name = "new_debug_unreachable" -version = "1.0.6" +name = "native-tls" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" +checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" +dependencies = [ + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] [[package]] name = "no-std-compat" @@ -2481,21 +2825,14 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.4" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" dependencies = [ - "autocfg", "num-integer", "num-traits", ] -[[package]] -name = "num-conv" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" - [[package]] name = "num-integer" version = "0.1.46" @@ -2507,9 +2844,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", "libm", @@ -2521,29 +2858,28 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi", + "hermit-abi 0.3.9", "libc", ] [[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-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.89", ] [[package]] @@ -2554,81 +2890,95 @@ checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" [[package]] name = "object" -version = "0.32.2" +version = "0.36.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.19.0" +version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] -name = "open-fastrlp" -version = "0.1.4" +name = "openssl" +version = "0.10.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "786393f80485445794f6043fd3138854dd109cc6c4bd1a6383db304c9ce9b9ce" +checksum = "6174bc48f102d208783c2c84bf931bb75927a617866870de8a4ea85597f871f5" dependencies = [ - "arrayvec", - "auto_impl", - "bytes", - "ethereum-types", - "open-fastrlp-derive", + "bitflags", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", ] [[package]] -name = "open-fastrlp-derive" +name = "openssl-macros" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "003b2be5c6c53c1cfeb0a238b8a1c3915cd410feb684457a36c10038f764bb1c" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ - "bytes", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.89", ] [[package]] -name = "option-ext" -version = "0.2.0" +name = "openssl-probe" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "openssl-sys" +version = "0.9.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45abf306cbf99debc8195b66b7346498d7b10c210de50418b5ccd7ceba08c741" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] [[package]] name = "parity-scale-codec" -version = "3.6.9" +version = "3.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "881331e34fa842a2fb61cc2db9643a8fedc615e47cfcc52597d1af0db9a7e8fe" +checksum = "8be4817d39f3272f69c59fe05d0535ae6456c2dc2fa1ba02910296c7e0a5c590" dependencies = [ "arrayvec", "bitvec", "byte-slice-cast", "impl-trait-for-tuples", "parity-scale-codec-derive", + "rustversion", "serde", ] [[package]] name = "parity-scale-codec-derive" -version = "3.6.9" +version = "3.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be30eaf4b0a9fba5336683b38de57bb86d179a35862ba6bfcf57625d006bde5b" +checksum = "8781a75c6205af67215f382092b6e0a4ff3734798523e69073d4bcd294ec767b" dependencies = [ - "proc-macro-crate 2.0.0", + "proc-macro-crate", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.89", ] [[package]] name = "parking_lot" -version = "0.12.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", "parking_lot_core", @@ -2636,15 +2986,15 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.9" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", "redox_syscall", "smallvec", - "windows-targets 0.48.5", + "windows-targets 0.52.6", ] [[package]] @@ -2667,52 +3017,10 @@ dependencies = [ ] [[package]] -name = "password-hash" -version = "0.4.2" +name = "paste" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700" -dependencies = [ - "base64ct", - "rand_core", - "subtle", -] - -[[package]] -name = "path-slash" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e91099d4268b0e11973f036e885d652fb0b21fedcf69738c627f94db6a44f42" - -[[package]] -name = "pbkdf2" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" -dependencies = [ - "digest", - "hmac", - "password-hash", - "sha2", -] - -[[package]] -name = "pbkdf2" -version = "0.12.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" -dependencies = [ - "digest", - "hmac", -] - -[[package]] -name = "pem" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8835c273a76a90455d7344889b0964598e3316e2a79ede8e36f16bdcf2228b8" -dependencies = [ - "base64 0.13.1", -] +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "percent-encoding" @@ -2721,13 +3029,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] -name = "petgraph" -version = "0.6.4" +name = "pest" +version = "2.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" +checksum = "879952a81a83930934cbf1786752d6dedc3b1f29e8f8fb2ad1d0a36f377cf442" dependencies = [ - "fixedbitset", - "indexmap", + "memchr", + "thiserror", + "ucd-trie", ] [[package]] @@ -2737,7 +3046,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e9567389417feee6ce15dd6527a8a1ecac205ef62c2932bcf3d9f6fc5b78b414" dependencies = [ "futures", - "rustc_version", + "rustc_version 0.4.1", ] [[package]] @@ -2746,8 +3055,7 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" dependencies = [ - "phf_macros", - "phf_shared 0.11.2", + "phf_shared", ] [[package]] @@ -2757,7 +3065,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8d39688d359e6b34654d328e262234662d16cc0f60ec8dcbe5e718709342a5a" dependencies = [ "phf_generator", - "phf_shared 0.11.2", + "phf_shared", ] [[package]] @@ -2766,32 +3074,10 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" dependencies = [ - "phf_shared 0.11.2", + "phf_shared", "rand", ] -[[package]] -name = "phf_macros" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b" -dependencies = [ - "phf_generator", - "phf_shared 0.11.2", - "proc-macro2", - "quote", - "syn 2.0.60", -] - -[[package]] -name = "phf_shared" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096" -dependencies = [ - "siphasher", -] - [[package]] name = "phf_shared" version = "0.11.2" @@ -2803,29 +3089,29 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.1.5" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +checksum = "be57f64e946e500c8ee36ef6331845d40a93055567ec57e8fae13efd33759b95" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.5" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.89", ] [[package]] name = "pin-project-lite" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" +checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" [[package]] name = "pin-utils" @@ -2845,9 +3131,9 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "planus" @@ -2897,7 +3183,7 @@ dependencies = [ "foreign_vec", "futures", "getrandom", - "hashbrown", + "hashbrown 0.14.5", "itoa", "itoap", "lz4", @@ -2911,7 +3197,7 @@ dependencies = [ "streaming-iterator", "strength_reduce", "version_check", - "zstd 0.13.1", + "zstd", ] [[package]] @@ -2947,13 +3233,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6f20d3c227186f74aa3c228c64ef72f5a15617322fed30b4323eaf53b25f8e7b" dependencies = [ "ahash", - "bitflags 2.5.0", + "bitflags", "bytemuck", "chrono", "chrono-tz", "comfy-table", "either", - "hashbrown", + "hashbrown 0.14.5", "indexmap", "num-traits", "once_cell", @@ -3031,7 +3317,7 @@ dependencies = [ "ahash", "chrono", "fallible-streaming-iterator", - "hashbrown", + "hashbrown 0.14.5", "indexmap", "itoa", "num-traits", @@ -3050,7 +3336,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c27df26a19d3092298d31d47614ad84dc330c106e38aa8cd53727cd91c07cf56" dependencies = [ "ahash", - "bitflags 2.5.0", + "bitflags", "glob", "once_cell", "polars-arrow", @@ -3080,7 +3366,7 @@ dependencies = [ "chrono", "chrono-tz", "either", - "hashbrown", + "hashbrown 0.14.5", "hex", "indexmap", "jsonpath_lib_polars_vendor", @@ -3123,7 +3409,7 @@ dependencies = [ "simdutf8", "snap", "streaming-decompression", - "zstd 0.13.1", + "zstd", ] [[package]] @@ -3135,7 +3421,7 @@ dependencies = [ "crossbeam-channel", "crossbeam-queue", "enum_dispatch", - "hashbrown", + "hashbrown 0.14.5", "num-traits", "polars-arrow", "polars-compute", @@ -3147,7 +3433,7 @@ dependencies = [ "polars-utils", "rayon", "smartstring", - "uuid 1.10.0", + "uuid", "version_check", ] @@ -3235,7 +3521,7 @@ checksum = "694656a7d2b0cd8f07660dbc8d0fb7a81066ff57a452264907531d805c1e58c4" dependencies = [ "ahash", "bytemuck", - "hashbrown", + "hashbrown 0.14.5", "indexmap", "num-traits", "once_cell", @@ -3249,27 +3535,18 @@ dependencies = [ [[package]] name = "portable-atomic" -version = "1.6.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" - -[[package]] -name = "powerfmt" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" +checksum = "280dc24453071f1b63954171985a0b0d30058d287960968b9b2aca264c8d4ee6" [[package]] name = "ppv-lite86" -version = "0.2.17" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" - -[[package]] -name = "precomputed-hash" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] [[package]] name = "prefix-hex" @@ -3280,16 +3557,6 @@ dependencies = [ "hex", ] -[[package]] -name = "prettyplease" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ac2cf0f2e4f42b49f5ffd07dae8d746508ef7526c13940e5f524012ae6c6550" -dependencies = [ - "proc-macro2", - "syn 2.0.60", -] - [[package]] name = "primitive-types" version = "0.12.2" @@ -3298,62 +3565,66 @@ checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" dependencies = [ "fixed-hash", "impl-codec", - "impl-rlp", - "impl-serde", - "scale-info", "uint", ] [[package]] name = "proc-macro-crate" -version = "1.3.1" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" +checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" dependencies = [ - "once_cell", - "toml_edit 0.19.15", + "toml_edit", ] [[package]] -name = "proc-macro-crate" +name = "proc-macro-error-attr2" version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8366a6159044a37876a2b9817124296703c586a5c92e2c53751fa06d8d43e8" +checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" dependencies = [ - "toml_edit 0.20.7", + "proc-macro2", + "quote", ] [[package]] -name = "proc-macro-crate" -version = "3.1.0" +name = "proc-macro-error2" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" +checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" dependencies = [ - "toml_edit 0.21.1", + "proc-macro-error-attr2", + "proc-macro2", + "quote", + "syn 2.0.89", ] [[package]] name = "proc-macro2" -version = "1.0.81" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1597b0c024618f09a9c3b8655b7e430397a36d23fdafec26d6965e9eec3eba" +checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" 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 = [ - "bitflags 2.5.0", + "bit-set", + "bit-vec", + "bitflags", "lazy_static", "num-traits", "rand", "rand_chacha", "rand_xorshift", "regex-syntax", + "rusty-fork", + "tempfile", "unarray", ] @@ -3417,7 +3688,7 @@ dependencies = [ "proc-macro2", "pyo3-macros-backend", "quote", - "syn 2.0.60", + "syn 2.0.89", ] [[package]] @@ -3426,11 +3697,11 @@ version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c7e9b68bb9c3149c5b0cade5d07f953d6d125eb4337723c4ccdb665f1f96185" dependencies = [ - "heck", + "heck 0.4.1", "proc-macro2", "pyo3-build-config", "quote", - "syn 2.0.60", + "syn 2.0.89", ] [[package]] @@ -3461,10 +3732,16 @@ dependencies = [ ] [[package]] -name = "quote" -version = "1.0.36" +name = "quick-error" +version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" + +[[package]] +name = "quote" +version = "1.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] @@ -3484,6 +3761,7 @@ dependencies = [ "libc", "rand_chacha", "rand_core", + "serde", ] [[package]] @@ -3526,11 +3804,11 @@ dependencies = [ [[package]] name = "raw-cpuid" -version = "11.0.1" +version = "11.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d86a7c4638d42c44551f4791a20e687dbb4c3de1f33c43dd71e355cd429def1" +checksum = "1ab240315c661615f2ee9f0f2cd32d5a7343a84d5ebcccb99d46e6637565e7b0" dependencies = [ - "bitflags 2.5.0", + "bitflags", ] [[package]] @@ -3554,50 +3832,45 @@ dependencies = [ ] [[package]] -name = "redox_syscall" -version = "0.4.1" +name = "recvmsg" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] +checksum = "d3edd4d5d42c92f0a659926464d4cce56b562761267ecf0f469d85b7de384175" [[package]] -name = "redox_users" -version = "0.4.5" +name = "redox_syscall" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" +checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" dependencies = [ - "getrandom", - "libredox", - "thiserror", + "bitflags", ] [[package]] name = "ref-cast" -version = "1.0.22" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4846d4c50d1721b1a3bef8af76924eef20d5e723647333798c1b519b3a9473f" +checksum = "ccf0a6f84d5f1d581da8b41b47ec8600871962f2a528115b542b362d4b744931" dependencies = [ "ref-cast-impl", ] [[package]] name = "ref-cast-impl" -version = "1.0.22" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fddb4f8d99b0a2ebafc65a87a69a7b9875e4b1ae1f00db265d300ef7f28bccc" +checksum = "bcc303e793d3734489387d205e9b186fac9c6cfacedd98cbb2e8a5943595f3e6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.89", ] [[package]] name = "regex" -version = "1.10.4" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", @@ -3607,9 +3880,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.6" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", @@ -3618,49 +3891,47 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.3" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "reqwest" -version = "0.11.27" +version = "0.12.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" +checksum = "a77c62af46e79de0a562e1a9849205ffcb7fc1238876e9bd743357570e04046f" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", "bytes", - "encoding_rs", "futures-core", "futures-util", - "h2", "http", "http-body", + "http-body-util", "hyper", - "hyper-rustls", + "hyper-tls", + "hyper-util", "ipnet", "js-sys", "log", "mime", + "native-tls", "once_cell", "percent-encoding", "pin-project-lite", - "rustls", "rustls-pemfile", "serde", "serde_json", "serde_urlencoded", - "sync_wrapper", - "system-configuration", + "sync_wrapper 1.0.2", "tokio", - "tokio-rustls", + "tokio-native-tls", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "webpki-roots", - "winreg", + "windows-registry", ] [[package]] @@ -3673,21 +3944,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "ring" -version = "0.16.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" -dependencies = [ - "cc", - "libc", - "once_cell", - "spin 0.5.2", - "untrusted 0.7.1", - "web-sys", - "winapi", -] - [[package]] name = "ring" version = "0.17.8" @@ -3698,20 +3954,11 @@ dependencies = [ "cfg-if", "getrandom", "libc", - "spin 0.9.8", - "untrusted 0.9.0", + "spin", + "untrusted", "windows-sys 0.52.0", ] -[[package]] -name = "ripemd" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd124222d17ad93a644ed9d011a40f4fb64aa54275c08cc216524a9ea82fb09f" -dependencies = [ - "digest", -] - [[package]] name = "rlp" version = "0.5.2" @@ -3719,26 +3966,50 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bb919243f34364b6bd2fc10ef797edbfa75f33c252e7998527479c6d6b47e1ec" dependencies = [ "bytes", - "rlp-derive", "rustc-hex", ] [[package]] -name = "rlp-derive" -version = "0.1.0" +name = "ruint" +version = "1.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e33d7b2abe0c340d8797fe2907d3f20d3b5ea5908683618bfe80df7f621f672a" +checksum = "2c3cc4c2511671f327125da14133d0c5c5d137f006a1017a16f557bc85b16286" dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", + "alloy-rlp", + "ark-ff 0.3.0", + "ark-ff 0.4.2", + "bytes", + "fastrlp", + "num-bigint", + "num-traits", + "parity-scale-codec", + "primitive-types", + "proptest", + "rand", + "rlp", + "ruint-macro", + "serde", + "valuable", + "zeroize", ] [[package]] -name = "rustc-demangle" -version = "0.1.23" +name = "ruint-macro" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "48fd7bd8a6377e15ad9d42a8ec25371b94ddc67abe7c8b9127bec79bebaaae18" + +[[package]] +name = "rustc-demangle" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" + +[[package]] +name = "rustc-hash" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustc-hex" @@ -3748,20 +4019,29 @@ checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" [[package]] name = "rustc_version" -version = "0.4.0" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" dependencies = [ - "semver", + "semver 0.11.0", +] + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver 1.0.23", ] [[package]] name = "rustix" -version = "0.38.32" +version = "0.38.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65e04861e65f21776e67888bfbea442b3642beaa0138fdb1dd7a84a52dffdb89" +checksum = "d7f649912bc1495e167a6edee79151c84b1bad49748cb4f1f1167f459f6224f6" dependencies = [ - "bitflags 2.5.0", + "bitflags", "errno", "libc", "linux-raw-sys", @@ -3770,87 +4050,86 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.11" +version = "0.23.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fecbfb7b1444f477b345853b1fce097a2c6fb637b2bfb87e6bc5db0f043fae4" +checksum = "9c9cc1d47e243d655ace55ed38201c19ae02c148ae56412ab8750e8f0166ab7f" dependencies = [ - "log", - "ring 0.17.8", + "once_cell", + "ring", + "rustls-pki-types", "rustls-webpki", - "sct", + "subtle", + "zeroize", ] [[package]] name = "rustls-pemfile" -version = "1.0.4" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" dependencies = [ - "base64 0.21.7", + "rustls-pki-types", ] [[package]] -name = "rustls-webpki" -version = "0.101.7" +name = "rustls-pki-types" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" +checksum = "16f1201b3c9a7ee8039bcadc17b7e605e2945b27eee7631788c1bd2b0643674b" + +[[package]] +name = "rustls-webpki" +version = "0.102.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" dependencies = [ - "ring 0.17.8", - "untrusted 0.9.0", + "ring", + "rustls-pki-types", + "untrusted", ] [[package]] name = "rustversion" -version = "1.0.15" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80af6f9131f277a45a3fba6ce8e2258037bb0477a67e610d3c1fe046ab31de47" +checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" + +[[package]] +name = "rusty-fork" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb3dcc6e454c328bb824492db107ab7c0ae8fcffe4ad210136ef014458c1bc4f" +dependencies = [ + "fnv", + "quick-error", + "tempfile", + "wait-timeout", +] [[package]] name = "ryu" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] -name = "salsa20" -version = "0.10.2" +name = "schannel" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97a22f5af31f73a954c10289c93e8a50cc23d971e80ee446f1f6f7137a088213" +checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" dependencies = [ - "cipher", + "windows-sys 0.59.0", ] [[package]] -name = "same-file" -version = "1.0.6" +name = "schnellru" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "scale-info" -version = "2.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c453e59a955f81fb62ee5d596b450383d699f152d350e9d23a0db2adb78e4c0" +checksum = "c9a8ef13a93c54d20580de1e5c413e624e53121d42fc7e2c11d10ef7f8b02367" dependencies = [ + "ahash", "cfg-if", - "derive_more", - "parity-scale-codec", - "scale-info-derive", -] - -[[package]] -name = "scale-info-derive" -version = "2.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18cf6c6447f813ef19eb450e985bcce6705f9ce7660db221b59093d15c79c4b7" -dependencies = [ - "proc-macro-crate 1.3.1", - "proc-macro2", - "quote", - "syn 1.0.109", + "hashbrown 0.13.2", ] [[package]] @@ -3859,28 +4138,6 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" -[[package]] -name = "scrypt" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f9e24d2b632954ded8ab2ef9fea0a0c769ea56ea98bddbafbad22caeeadf45d" -dependencies = [ - "hmac", - "pbkdf2 0.11.0", - "salsa20", - "sha2", -] - -[[package]] -name = "sct" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" -dependencies = [ - "ring 0.17.8", - "untrusted 0.9.0", -] - [[package]] name = "sec1" version = "0.7.3" @@ -3896,19 +4153,51 @@ dependencies = [ ] [[package]] -name = "semver" -version = "1.0.22" +name = "security-framework" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "serde", + "bitflags", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", ] [[package]] -name = "send_wrapper" -version = "0.4.0" +name = "security-framework-sys" +version = "2.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f638d531eccd6e23b980caf34876660d38e265409d8e99b397ab71eb3612fad0" +checksum = "fa39c7303dc58b5543c94d22c1766b0d31f2ee58306363ea622b10bbc075eaa2" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "semver" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" +dependencies = [ + "semver-parser", +] + +[[package]] +name = "semver" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" + +[[package]] +name = "semver-parser" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9900206b54a3527fdc7b8a938bffd94a568bac4f4aa8113b209df75a09c0dec2" +dependencies = [ + "pest", +] [[package]] name = "send_wrapper" @@ -3924,45 +4213,37 @@ checksum = "a3f0bf26fd526d2a95683cd0f87bf103b8539e2ca1ef48ce002d67aad59aa0b4" [[package]] name = "serde" -version = "1.0.198" +version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9846a40c979031340571da2545a4e5b7c4163bdae79b301d5f86d03979451fcc" +checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.198" +version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e88edab869b01783ba905e7d0153f9fc1a6505a96e4ad3018011eedb838566d9" +checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.89", ] [[package]] name = "serde_json" -version = "1.0.116" +version = "1.0.133" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e17db7126d17feb94eb3fad46bf1a96b034e8aacbc2e775fe81505f8b0b2813" +checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377" dependencies = [ "indexmap", "itoa", + "memchr", "ryu", "serde", ] -[[package]] -name = "serde_spanned" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" -dependencies = [ - "serde", -] - [[package]] name = "serde_urlencoded" version = "0.7.1" @@ -3983,7 +4264,7 @@ checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ "cfg-if", "cpufeatures", - "digest", + "digest 0.10.7", ] [[package]] @@ -3994,7 +4275,7 @@ checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if", "cpufeatures", - "digest", + "digest 0.10.7", ] [[package]] @@ -4003,25 +4284,41 @@ version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" dependencies = [ - "digest", + "digest 0.10.7", "keccak", ] +[[package]] +name = "sha3-asm" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c28efc5e327c837aa837c59eae585fc250715ef939ac32881bcc11677cd02d46" +dependencies = [ + "cc", + "cfg-if", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + [[package]] name = "signature" version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ - "digest", + "digest 0.10.7", "rand_core", ] [[package]] name = "simd-json" -version = "0.13.10" +version = "0.13.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "570c430b3d902ea083097e853263ae782dfe40857d93db019a12356c8e8143fa" +checksum = "a0228a564470f81724e30996bbc2b171713b37b15254a6440c7e2d5449b95691" dependencies = [ "ahash", "getrandom", @@ -4037,21 +4334,9 @@ dependencies = [ [[package]] name = "simdutf8" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" - -[[package]] -name = "simple_asn1" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adc4e5204eb1910f40f9cfa375f6f05b68c3abac4b6fd879c8ff5e7ae8a0a085" -dependencies = [ - "num-bigint", - "num-traits", - "thiserror", - "time", -] +checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" [[package]] name = "siphasher" @@ -4093,34 +4378,14 @@ checksum = "1b6b67fb9a61334225b5b790716f609cd58395f895b3fe8b328786812a40bc3b" [[package]] name = "socket2" -version = "0.5.6" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", "windows-sys 0.52.0", ] -[[package]] -name = "solang-parser" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c425ce1c59f4b154717592f0bdf4715c3a1d55058883622d3157e1f0908a5b26" -dependencies = [ - "itertools", - "lalrpop", - "lalrpop-util", - "phf", - "thiserror", - "unicode-xid", -] - -[[package]] -name = "spin" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" - [[package]] name = "spin" version = "0.9.8" @@ -4155,6 +4420,12 @@ dependencies = [ "log", ] +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + [[package]] name = "static_assertions" version = "1.1.0" @@ -4182,19 +4453,6 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fe895eb47f22e2ddd4dabc02bce419d2e643c8e3b585c78158b349195bc24d82" -[[package]] -name = "string_cache" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f91138e76242f575eb1d3b38b4f1362f10d3a43f47d182a5b359af488a02293b" -dependencies = [ - "new_debug_unreachable", - "once_cell", - "parking_lot", - "phf_shared 0.10.0", - "precomputed-hash", -] - [[package]] name = "strsim" version = "0.10.0" @@ -4203,11 +4461,11 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "strum" -version = "0.26.2" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29" +checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" dependencies = [ - "strum_macros 0.26.2", + "strum_macros 0.26.4", ] [[package]] @@ -4216,51 +4474,31 @@ version = "0.25.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0" dependencies = [ - "heck", + "heck 0.4.1", "proc-macro2", "quote", "rustversion", - "syn 2.0.60", + "syn 2.0.89", ] [[package]] name = "strum_macros" -version = "0.26.2" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6cf59daf282c0a494ba14fd21610a0325f9f90ec9d1231dea26bcb1d696c946" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" dependencies = [ - "heck", + "heck 0.5.0", "proc-macro2", "quote", "rustversion", - "syn 2.0.60", + "syn 2.0.89", ] [[package]] name = "subtle" -version = "2.5.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" - -[[package]] -name = "svm-rs" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11297baafe5fa0c99d5722458eac6a5e25c01eb1b8e5cd137f54079093daa7a4" -dependencies = [ - "dirs", - "fs2", - "hex", - "once_cell", - "reqwest", - "semver", - "serde", - "serde_json", - "sha2", - "thiserror", - "url", - "zip", -] +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" @@ -4275,15 +4513,27 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.60" +version = "2.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "909518bc7b1c9b779f1bbf07f2929d35af9f0f37e47c6e9ef7f9dddc1e1821f3" +checksum = "44d46482f1c1c87acd84dea20c1bf5ebff4c757009ed6bf19cfd36fb10e92c4e" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] +[[package]] +name = "syn-solidity" +version = "0.8.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bdaa7b9e815582ba343a20c66627437cf45f1c6fba7f69772cbfd1358c7e197" +dependencies = [ + "paste", + "proc-macro2", + "quote", + "syn 2.0.89", +] + [[package]] name = "sync_wrapper" version = "0.1.2" @@ -4291,10 +4541,30 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" [[package]] -name = "sysinfo" -version = "0.30.11" +name = "sync_wrapper" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87341a165d73787554941cd5ef55ad728011566fe714e987d1b976c15dbc3a83" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" +dependencies = [ + "futures-core", +] + +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.89", +] + +[[package]] +name = "sysinfo" +version = "0.30.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a5b4ddaee55fb2bea2bf0e5000747e5f5c0de765e5a5ff87f4cd106439f4bb3" dependencies = [ "cfg-if", "core-foundation-sys", @@ -4304,27 +4574,6 @@ dependencies = [ "windows", ] -[[package]] -name = "system-configuration" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" -dependencies = [ - "bitflags 1.3.2", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "tap" version = "1.0.1" @@ -4339,51 +4588,41 @@ checksum = "c1bbb9f3c5c463a01705937a24fdabc5047929ac764b2d5b9cf681c1f5041ed5" [[package]] name = "target-lexicon" -version = "0.12.14" +version = "0.12.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" +checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" [[package]] name = "tempfile" -version = "3.10.1" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" +checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c" dependencies = [ "cfg-if", "fastrand", + "once_cell", "rustix", - "windows-sys 0.52.0", -] - -[[package]] -name = "term" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59df8ac95d96ff9bede18eb7300b0fda5e5d8d90960e76f8e14ae765eedbf1f" -dependencies = [ - "dirs-next", - "rustversion", - "winapi", + "windows-sys 0.59.0", ] [[package]] name = "thiserror" -version = "1.0.58" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.58" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.89", ] [[package]] @@ -4393,34 +4632,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3bf63baf9f5039dadc247375c29eb13706706cfde997d0330d05aa63a77d8820" [[package]] -name = "time" -version = "0.3.36" +name = "threadpool" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" +checksum = "d050e60b33d41c19108b32cea32164033a9013fe3b46cbd4457559bfbf77afaa" dependencies = [ - "deranged", - "itoa", - "num-conv", - "powerfmt", - "serde", - "time-core", - "time-macros", -] - -[[package]] -name = "time-core" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" - -[[package]] -name = "time-macros" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" -dependencies = [ - "num-conv", - "time-core", + "num_cpus", ] [[package]] @@ -4433,67 +4650,85 @@ dependencies = [ ] [[package]] -name = "tinyvec" -version = "1.6.0" +name = "tinystr" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" dependencies = [ - "tinyvec_macros", + "displaydoc", + "zerovec", ] -[[package]] -name = "tinyvec_macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" - [[package]] name = "tokio" -version = "1.37.0" +version = "1.41.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" +checksum = "22cfb5bee7a6a52939ca9224d6ac897bb669134078daa8735560897f69de4d33" dependencies = [ "backtrace", "bytes", "libc", "mio", - "num_cpus", "pin-project-lite", "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.89", ] [[package]] -name = "tokio-rustls" -version = "0.24.1" +name = "tokio-native-tls" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" dependencies = [ - "rustls", + "native-tls", "tokio", ] [[package]] -name = "tokio-tungstenite" -version = "0.20.1" +name = "tokio-rustls" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "212d5dcb2a1ce06d81107c3d0ffa3121fe974b73f068c8282cb1c32328113b6c" +checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" +dependencies = [ + "rustls", + "rustls-pki-types", + "tokio", +] + +[[package]] +name = "tokio-stream" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f4e6ce100d0eb49a2734f8c0812bcd324cf357d21810932c5df6b96ef2b86f1" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", + "tokio-util", +] + +[[package]] +name = "tokio-tungstenite" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edc5f74e248dc973e0dbb7b74c7e0d6fcc301c694ff50049504004ef4d0cdcd9" dependencies = [ "futures-util", "log", "rustls", + "rustls-pki-types", "tokio", "tokio-rustls", "tungstenite", @@ -4502,90 +4737,59 @@ dependencies = [ [[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" -version = "0.8.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9dd1545e8208b4a5af1aa9bbd0b4cf7e9ea08fabc5d0a5c67fcaafa17433aa3" -dependencies = [ - "serde", - "serde_spanned", - "toml_datetime", - "toml_edit 0.22.12", ] [[package]] name = "toml_datetime" -version = "0.6.5" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" -dependencies = [ - "serde", -] +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" [[package]] name = "toml_edit" -version = "0.19.15" +version = "0.22.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" dependencies = [ "indexmap", "toml_datetime", - "winnow 0.5.40", + "winnow", ] [[package]] -name = "toml_edit" -version = "0.20.7" +name = "tower" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" +checksum = "2873938d487c3cfb9aed7546dc9f2711d867c9f90c46b889989a2cb84eba6b4f" dependencies = [ - "indexmap", - "toml_datetime", - "winnow 0.5.40", + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper 0.1.2", + "tower-layer", + "tower-service", ] [[package]] -name = "toml_edit" -version = "0.21.1" +name = "tower-layer" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" -dependencies = [ - "indexmap", - "toml_datetime", - "winnow 0.5.40", -] - -[[package]] -name = "toml_edit" -version = "0.22.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3328d4f68a705b2a4498da1d580585d39a6510f98318a2cec3018a7ec61ddef" -dependencies = [ - "indexmap", - "serde", - "serde_spanned", - "toml_datetime", - "winnow 0.6.6", -] +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" @@ -4606,28 +4810,18 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.89", ] [[package]] name = "tracing-core" -version = "0.1.32" +version = "0.1.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" dependencies = [ "once_cell", ] -[[package]] -name = "tracing-futures" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" -dependencies = [ - "pin-project", - "tracing", -] - [[package]] name = "try-lock" version = "0.2.5" @@ -4636,9 +4830,9 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "tungstenite" -version = "0.20.1" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e3dac10fd62eaf6617d3a904ae222845979aec67c615d1c842b4002c7666fb9" +checksum = "18e5b8366ee7a95b16d32197d0b2604b43a0be89dc5fac9f8e96ccafbaedda8a" dependencies = [ "byteorder", "bytes", @@ -4648,9 +4842,9 @@ dependencies = [ "log", "rand", "rustls", + "rustls-pki-types", "sha1", "thiserror", - "url", "utf-8", ] @@ -4660,6 +4854,12 @@ version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +[[package]] +name = "ucd-trie" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" + [[package]] name = "uint" version = "0.9.5" @@ -4678,26 +4878,11 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" -[[package]] -name = "unicode-bidi" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" - [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unicode-normalization" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" -dependencies = [ - "tinyvec", -] +checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" [[package]] name = "unicode-reverse" @@ -4710,21 +4895,27 @@ 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.11" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" +checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" + +[[package]] +name = "unicode-width" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd" [[package]] name = "unicode-xid" -version = "0.2.4" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" [[package]] name = "unindent" @@ -4732,12 +4923,6 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c7de7d73e1754487cb58364ee906a499937a0dfabd86bcb980fa99ec8c8fa2ce" -[[package]] -name = "untrusted" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" - [[package]] name = "untrusted" version = "0.9.0" @@ -4746,9 +4931,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.0" +version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" dependencies = [ "form_urlencoded", "idna", @@ -4761,30 +4946,38 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + [[package]] name = "utf8parse" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "0.8.2" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" +checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" dependencies = [ "getrandom", - "serde", ] [[package]] -name = "uuid" -version = "1.10.0" +name = "valuable" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" -dependencies = [ - "getrandom", -] +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" [[package]] name = "value-trait" @@ -4799,19 +4992,24 @@ dependencies = [ ] [[package]] -name = "version_check" -version = "0.9.4" +name = "vcpkg" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] -name = "walkdir" -version = "2.5.0" +name = "version_check" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "wait-timeout" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6" dependencies = [ - "same-file", - "winapi-util", + "libc", ] [[package]] @@ -4831,34 +5029,35 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.92" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" dependencies = [ "cfg-if", + "once_cell", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.92" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.89", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.42" +version = "0.4.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" +checksum = "cc7ec4f8827a71586374db3e87abdb5a2bb3a15afed140221307c3ec06b1f63b" dependencies = [ "cfg-if", "js-sys", @@ -4868,9 +5067,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.92" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -4878,28 +5077,52 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.92" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.89", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.92" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" +checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" + +[[package]] +name = "wasmtimer" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0048ad49a55b9deb3953841fa1fc5858f0efbcb7a18868c899a360269fac1b23" +dependencies = [ + "futures", + "js-sys", + "parking_lot", + "pin-utils", + "slab", + "wasm-bindgen", +] [[package]] name = "web-sys" -version = "0.3.69" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" +checksum = "f6488b90108c040df0fe62fa815cbdee25124641df01814dd7282749234c6112" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "web-time" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" dependencies = [ "js-sys", "wasm-bindgen", @@ -4907,9 +5130,18 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.25.4" +version = "0.26.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" +checksum = "5d642ff16b7e79272ae451b7322067cdc17cadf68c23264be9d94a32319efe7e" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "widestring" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7219d36b6eac893fa81e84ebe06485e7dcbb616177469b142df14f1f4deb1311" [[package]] name = "winapi" @@ -4927,15 +5159,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" -[[package]] -name = "winapi-util" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" -dependencies = [ - "winapi", -] - [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" @@ -4949,7 +5172,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" dependencies = [ "windows-core", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -4958,7 +5181,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]] @@ -4976,7 +5229,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]] @@ -4996,18 +5258,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]] @@ -5018,9 +5280,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" @@ -5030,9 +5292,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" @@ -5042,15 +5304,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" @@ -5060,9 +5322,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" @@ -5072,9 +5334,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" @@ -5084,9 +5346,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" @@ -5096,37 +5358,30 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.5.40" +version = "0.6.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" +checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" dependencies = [ "memchr", ] [[package]] -name = "winnow" -version = "0.6.6" +name = "write16" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0c976aaaa0e1f90dbb21e9587cdaf1d9679a1cde8875c0d6bd83ab96a208352" -dependencies = [ - "memchr", -] +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" [[package]] -name = "winreg" -version = "0.50.0" +name = "writeable" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" -dependencies = [ - "cfg-if", - "windows-sys 0.48.0", -] +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" [[package]] name = "ws_stream_wasm" @@ -5139,8 +5394,8 @@ dependencies = [ "js-sys", "log", "pharos", - "rustc_version", - "send_wrapper 0.6.0", + "rustc_version 0.4.1", + "send_wrapper", "thiserror", "wasm-bindgen", "wasm-bindgen-futures", @@ -5158,104 +5413,141 @@ dependencies = [ [[package]] name = "xxhash-rust" -version = "0.8.10" +version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "927da81e25be1e1a2901d59b81b37dd2efd1fc9c9345a55007f09bf5a2d3ee03" +checksum = "6a5cbf750400958819fb6178eaa83bee5cd9c29a26a40cc241df8c70fdd46984" [[package]] -name = "yansi" -version = "0.5.1" +name = "yoke" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.89", + "synstructure", +] [[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.89", +] + +[[package]] +name = "zerofrom" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.89", + "synstructure", ] [[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", +] [[package]] -name = "zip" -version = "0.6.6" +name = "zeroize_derive" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ - "aes", - "byteorder", - "bzip2", - "constant_time_eq", - "crc32fast", - "crossbeam-utils", - "flate2", - "hmac", - "pbkdf2 0.11.0", - "sha1", - "time", - "zstd 0.11.2+zstd.1.5.2", + "proc-macro2", + "quote", + "syn 2.0.89", +] + +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.89", ] [[package]] name = "zstd" -version = "0.11.2+zstd.1.5.2" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" +checksum = "fcf2b778a664581e31e389454a7072dab1647606d44f7feea22cd5abb9c9f3f9" dependencies = [ - "zstd-safe 5.0.2+zstd.1.5.2", -] - -[[package]] -name = "zstd" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d789b1514203a1120ad2429eae43a7bd32b90976a7bb8a05f7ec02fa88cc23a" -dependencies = [ - "zstd-safe 7.1.0", + "zstd-safe", ] [[package]] name = "zstd-safe" -version = "5.0.2+zstd.1.5.2" +version = "7.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db" -dependencies = [ - "libc", - "zstd-sys", -] - -[[package]] -name = "zstd-safe" -version = "7.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd99b45c6bc03a018c8b8a86025678c87e55526064e38f9df301989dce7ec0a" +checksum = "54a3ab4db68cea366acc5c897c7b4d4d1b8994a9cd6e6f841f8964566a419059" dependencies = [ "zstd-sys", ] [[package]] name = "zstd-sys" -version = "2.0.10+zstd.1.5.6" +version = "2.0.13+zstd.1.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c253a4914af5bafc8fa8c86ee400827e83cf6ec01195ec1f1ed8441bf00d65aa" +checksum = "38ff0f21cfee8f97d94cef41359e0c89aa6113028ab0291aa8ca0038995a95aa" dependencies = [ "cc", "pkg-config", diff --git a/Cargo.toml b/Cargo.toml index c27463f..bde9386 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,6 +19,15 @@ cryo_cli = { version = "0.3.2", path = "./crates/cli" } cryo_freeze = { version = "0.3.2", path = "./crates/freeze" } cryo_to_df = { version = "0.3.2", path = "./crates/to_df" } +alloy = { version = "0.6.4", features = [ + "full", + "rpc-types-trace", + "provider-ws", + "provider-ipc", + "provider-debug-api", + "provider-trace-api", + "transport-ipc-mock", +] } anstyle = "1.0.4" async-trait = "0.1.74" chrono = { version = "0.4.31", features = ["serde"] } @@ -29,8 +38,6 @@ clap_cryo = { version = "4.3.21-cryo", features = [ ] } colored = "2.0.4" color-print = "0.3.5" -ethers = { version = "2.0.10", features = ["rustls", "ws", "ipc"] } -ethers-core = "2.0.10" eyre = "0.6.8" futures = "0.3.29" governor = "0.6.0" diff --git a/crates/cli/Cargo.toml b/crates/cli/Cargo.toml index 7eb4fcc..49cb9a0 100644 --- a/crates/cli/Cargo.toml +++ b/crates/cli/Cargo.toml @@ -18,12 +18,12 @@ path = "src/main.rs" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +alloy = { workspace = true } anstyle = { workspace = true } clap_cryo = { workspace = true } color-print = { workspace = true } colored = { workspace = true } cryo_freeze = { workspace = true } -ethers = { workspace = true } eyre = { workspace = true } governor = { workspace = true } hex = { workspace = true } diff --git a/crates/cli/src/args.rs b/crates/cli/src/args.rs index 49eff61..238db4e 100644 --- a/crates/cli/src/args.rs +++ b/crates/cli/src/args.rs @@ -106,6 +106,10 @@ pub struct Args { #[arg(long, default_value_t = 500, value_name = "B", help_heading = "Acquisition Options")] pub initial_backoff: u64, + /// The number of compute units per second for this provider + #[arg(long, default_value_t = 50, value_name = "U", help_heading = "Acquisition Options")] + pub compute_units_per_second: u64, + /// Global number of concurrent requests #[arg(long, value_name = "M", help_heading = "Acquisition Options")] pub max_concurrent_requests: Option, diff --git a/crates/cli/src/parse/blocks.rs b/crates/cli/src/parse/blocks.rs index 1f915c5..a9e75df 100644 --- a/crates/cli/src/parse/blocks.rs +++ b/crates/cli/src/parse/blocks.rs @@ -168,6 +168,7 @@ async fn parse_block_inputs( } } +#[derive(Clone, Debug)] enum RangePosition { First, Last, @@ -322,15 +323,14 @@ async fn parse_block_number( source: Arc, ) -> Result { match (block_ref, range_position) { - ("latest", _) => source.get_block_number().await.map(|n| n.as_u64()).map_err(|_e| { + ("latest", _) => source.get_block_number().await.map_err(|_e| { ParseError::ParseError("Error retrieving latest block number".to_string()) }), ("", RangePosition::First) => Ok(0), - ("", RangePosition::Last) => { - source.get_block_number().await.map(|n| n.as_u64()).map_err(|_e| { - ParseError::ParseError("Error retrieving last block number".to_string()) - }) - } + ("", RangePosition::Last) => source + .get_block_number() + .await + .map_err(|_e| ParseError::ParseError("Error retrieving last block number".to_string())), ("", RangePosition::None) => Err(ParseError::ParseError("invalid input".to_string())), _ if block_ref.ends_with('B') | block_ref.ends_with('b') => { let s = &block_ref[..block_ref.len() - 1]; @@ -366,7 +366,7 @@ async fn apply_reorg_buffer( 0 => Ok(block_chunks), reorg_filter => { let latest_block = match source.get_block_number().await { - Ok(result) => result.as_u64(), + Ok(result) => result, Err(_e) => { return Err(ParseError::ParseError("reorg buffer parse error".to_string())) } @@ -387,24 +387,34 @@ pub(crate) async fn get_latest_block_number(source: Arc) -> Result { WithoutMock((&'a str, BlockChunk)), // Token | Expected WithMock((&'a str, BlockChunk, u64)), // Token | Expected | Mock Block Response } - async fn block_token_test_helper(tests: Vec<(BlockTokenTest<'_>, bool)>) { - let (provider, mock) = Provider::mocked(); + async fn block_token_test_helper( + tests: Vec<(BlockTokenTest<'_>, bool)>, + mock_ipc_path: PathBuf, + ) { + let ipc = IpcConnect::new(mock_ipc_path); + let provider = ProviderBuilder::new().on_ipc(ipc).await.unwrap().boxed(); let source = Source { - provider: provider.into(), + provider, semaphore: Arc::new(None), rate_limiter: Arc::new(None), chain_id: 1, @@ -416,8 +426,7 @@ mod tests { let source = Arc::new(source); for (test, res) in tests { match test { - BlockTokenTest::WithMock((token, expected, latest)) => { - mock.push(U64::from(latest)).unwrap(); + BlockTokenTest::WithMock((token, expected, _latest)) => { assert_eq!( block_token_test_executor(token, expected, source.clone()).await, res @@ -458,15 +467,20 @@ mod tests { } } + #[derive(Clone, Debug)] enum BlockInputTest<'a> { WithoutMock((&'a String, Vec)), // Token | Expected WithMock((&'a String, Vec, u64)), // Token | Expected | Mock Block Response } - async fn block_input_test_helper(tests: Vec<(BlockInputTest<'_>, bool)>) { - let (provider, mock) = Provider::mocked(); + async fn block_input_test_helper( + tests: Vec<(BlockInputTest<'_>, bool)>, + mock_ipc_path: PathBuf, + ) { + let ipc = IpcConnect::new(mock_ipc_path); + let provider = ProviderBuilder::new().on_ipc(ipc).await.unwrap().boxed(); let source = Arc::new(Source { - provider: provider.into(), + provider, chain_id: 1, rpc_url: "".to_string(), inner_request_size: 1, @@ -477,8 +491,7 @@ mod tests { }); for (test, res) in tests { match test { - BlockInputTest::WithMock((inputs, expected, latest)) => { - mock.push(U64::from(latest)).unwrap(); + BlockInputTest::WithMock((inputs, expected, _latest)) => { assert_eq!( block_input_test_executor(inputs, expected, source.clone()).await, res @@ -531,15 +544,20 @@ mod tests { true } + #[derive(Clone, Debug)] enum BlockNumberTest<'a> { WithoutMock((&'a str, RangePosition, u64)), WithMock((&'a str, RangePosition, u64, u64)), } - async fn block_number_test_helper(tests: Vec<(BlockNumberTest<'_>, bool)>) { - let (provider, mock) = Provider::mocked(); + async fn block_number_test_helper( + tests: Vec<(BlockNumberTest<'_>, bool)>, + mock_ipc_path: PathBuf, + ) { + let provider = + ProviderBuilder::new().on_ipc(IpcConnect::new(mock_ipc_path)).await.unwrap().boxed(); let source = Source { - provider: provider.into(), + provider, semaphore: Arc::new(None), rate_limiter: Arc::new(None), chain_id: 1, @@ -551,8 +569,7 @@ mod tests { let source = Arc::new(source); for (test, res) in tests { match test { - BlockNumberTest::WithMock((block_ref, range_position, expected, latest)) => { - mock.push(U64::from(latest)).unwrap(); + BlockNumberTest::WithMock((block_ref, range_position, expected, _latest)) => { assert_eq!( block_number_test_executor( block_ref, @@ -604,7 +621,18 @@ mod tests { // Number type (BlockTokenTest::WithoutMock((r"1", BlockChunk::Numbers(vec![1]))), true), /* Single block */ ]; - block_token_test_helper(tests).await; + let mut mock_server = MockIpcServer::new(); + let mock_ipc_path = mock_server.path().clone(); + for (test, _) in tests.clone().into_iter() { + match test { + BlockTokenTest::WithoutMock(_) => {} + BlockTokenTest::WithMock((_, _, mock_response)) => { + mock_server.add_reply(mock_response) + } + } + } + mock_server.spawn().await; + block_token_test_helper(tests, mock_ipc_path).await; } #[tokio::test] @@ -648,7 +676,16 @@ mod tests { true, ), // Multi input complex ]; - block_input_test_helper(tests).await; + let mut mock_server = MockIpcServer::new(); + let mock_ipc_path = mock_server.path().clone(); + for (test, _) in tests.clone() { + match test { + BlockInputTest::WithMock((_, _, expected)) => mock_server.add_reply(expected), + BlockInputTest::WithoutMock(_) => {} + } + } + mock_server.spawn().await; + block_input_test_helper(tests, mock_ipc_path).await; } #[tokio::test] @@ -666,6 +703,15 @@ mod tests { (BlockNumberTest::WithoutMock((r"1m", RangePosition::None, 1000000)), true), // m (BlockNumberTest::WithoutMock((r"1k", RangePosition::None, 1000)), true), // k ]; - block_number_test_helper(tests).await; + let mut mock_server = MockIpcServer::new(); + let mock_ipc_path = mock_server.path().clone(); + for (test, _) in tests.clone() { + match test { + BlockNumberTest::WithMock((_, _, _, expected)) => mock_server.add_reply(expected), + BlockNumberTest::WithoutMock(_) => {} + } + } + mock_server.spawn().await; + block_number_test_helper(tests, mock_ipc_path).await; } } diff --git a/crates/cli/src/parse/file_output.rs b/crates/cli/src/parse/file_output.rs index e5d0417..db6430b 100644 --- a/crates/cli/src/parse/file_output.rs +++ b/crates/cli/src/parse/file_output.rs @@ -142,7 +142,7 @@ fn parse_row_group_size( ) -> Option { match (row_group_size, n_row_groups, chunk_size) { (Some(row_group_size), _, _) => Some(row_group_size), - (_, Some(n_row_groups), Some(cs)) => Some((cs + n_row_groups - 1) / n_row_groups), + (_, Some(n_row_groups), Some(cs)) => Some(cs.div_ceil(n_row_groups)), _ => None, } } diff --git a/crates/cli/src/parse/parse_utils.rs b/crates/cli/src/parse/parse_utils.rs index 04f4698..d445df4 100644 --- a/crates/cli/src/parse/parse_utils.rs +++ b/crates/cli/src/parse/parse_utils.rs @@ -1,7 +1,7 @@ use cryo_freeze::ParseError; use std::collections::HashMap; -pub(crate) fn hex_string_to_binary(hex_string: &String) -> Result, ParseError> { +pub(crate) fn hex_string_to_binary(hex_string: &str) -> Result, ParseError> { let hex_string = hex_string.strip_prefix("0x").unwrap_or(hex_string); hex::decode(hex_string) .map_err(|_| ParseError::ParseError("could not parse data as hex".to_string())) diff --git a/crates/cli/src/parse/partitions.rs b/crates/cli/src/parse/partitions.rs index bada931..0816435 100644 --- a/crates/cli/src/parse/partitions.rs +++ b/crates/cli/src/parse/partitions.rs @@ -8,7 +8,6 @@ use cryo_freeze::{ AddressChunk, CallDataChunk, Datatype, Dim, ParseError, Partition, PartitionLabels, SlotChunk, Source, Table, TimeDimension, TopicChunk, TransactionChunk, }; -use ethers::prelude::*; use rand::{seq::SliceRandom, thread_rng}; use std::{collections::HashMap, str::FromStr, sync::Arc}; diff --git a/crates/cli/src/parse/source.rs b/crates/cli/src/parse/source.rs index 8688d26..6b62515 100644 --- a/crates/cli/src/parse/source.rs +++ b/crates/cli/src/parse/source.rs @@ -1,8 +1,12 @@ use std::env; use crate::args::Args; -use cryo_freeze::{sources::ProviderWrapper, ParseError, Source, SourceLabels}; -use ethers::prelude::*; +use alloy::{ + providers::{Provider, ProviderBuilder, RootProvider}, + rpc::client::{BuiltInConnectionString, ClientBuilder, RpcClient}, + transports::{layers::RetryBackoffLayer, BoxTransport}, +}; +use cryo_freeze::{ParseError, Source, SourceLabels}; use governor::{Quota, RateLimiter}; use polars::prelude::*; use std::num::NonZeroU32; @@ -10,31 +14,20 @@ use std::num::NonZeroU32; pub(crate) async fn parse_source(args: &Args) -> Result { // parse network info let rpc_url = parse_rpc_url(args)?; - let (provider, chain_id): (ProviderWrapper, u64) = if rpc_url.starts_with("http") { - let provider = Provider::>::new_client( - &rpc_url, - args.max_retries, - args.initial_backoff, - ) - .map_err(|_e| ParseError::ParseError("could not connect to provider".to_string()))?; - let chain_id = provider.get_chainid().await.map_err(ParseError::ProviderError)?.as_u64(); - (provider.into(), chain_id) - } else if rpc_url.starts_with("ws") { - let provider = Provider::::connect(&rpc_url).await.map_err(|_| { - ParseError::ParseError("could not instantiate HTTP Provider".to_string()) - })?; - let chain_id = provider.get_chainid().await.map_err(ParseError::ProviderError)?.as_u64(); - (provider.into(), chain_id) - } else if rpc_url.ends_with(".ipc") { - let provider: Provider = Provider::connect_ipc(&rpc_url).await.map_err(|_| { - ParseError::ParseError("could not instantiate HTTP Provider".to_string()) - })?; - let chain_id = provider.get_chainid().await.map_err(ParseError::ProviderError)?.as_u64(); - (provider.into(), chain_id) - } else { - return Err(ParseError::ParseError(format!("invalid rpc url: {}", rpc_url))); - }; - + let retry_layer = RetryBackoffLayer::new( + args.max_retries, + args.initial_backoff, + args.compute_units_per_second, + ); + let connect: BuiltInConnectionString = rpc_url.parse().map_err(ParseError::ProviderError)?; + let client: RpcClient = ClientBuilder::default() + .layer(retry_layer) + .connect_boxed(connect) + .await + .map_err(ParseError::ProviderError)? + .boxed(); + let provider: RootProvider = ProviderBuilder::default().on_client(client); + let chain_id = provider.get_chain_id().await.map_err(ParseError::ProviderError)?; let rate_limiter = match args.requests_per_second { Some(rate_limit) => match (NonZeroU32::new(1), NonZeroU32::new(rate_limit)) { (Some(one), Some(value)) => { diff --git a/crates/cli/src/parse/timestamps.rs b/crates/cli/src/parse/timestamps.rs index e6e26b4..35b54ab 100644 --- a/crates/cli/src/parse/timestamps.rs +++ b/crates/cli/src/parse/timestamps.rs @@ -1,3 +1,4 @@ +use alloy::rpc::types::BlockTransactionsKind; use cryo_freeze::{BlockChunk, ParseError, Source}; use polars::prelude::*; @@ -277,7 +278,7 @@ async fn timestamp_to_block_number(timestamp: u64, source: Arc) -> Resul let mut r = latest_block_number; let mut mid = (l + r) / 2; let mut block = source - .get_block(mid) + .get_block(mid, BlockTransactionsKind::Hashes) .await .map_err(|_e| ParseError::ParseError("Error fetching block for timestamp".to_string()))? .unwrap(); @@ -285,15 +286,15 @@ async fn timestamp_to_block_number(timestamp: u64, source: Arc) -> Resul while l <= r { mid = (l + r) / 2; block = source - .get_block(mid) + .get_block(mid, BlockTransactionsKind::Hashes) .await .map_err(|_e| ParseError::ParseError("Error fetching block for timestamp".to_string()))? .unwrap(); #[allow(clippy::comparison_chain)] - if block.timestamp == timestamp.into() { + if block.header.timestamp == timestamp { return Ok(mid); - } else if block.timestamp < timestamp.into() { + } else if block.header.timestamp < timestamp { l = mid + 1; } else { r = mid - 1; @@ -301,7 +302,7 @@ async fn timestamp_to_block_number(timestamp: u64, source: Arc) -> Resul } // If timestamp is between two different blocks, return the lower block. - if mid > 0 && block.timestamp > ethers::types::U256::from(timestamp) { + if mid > 0 && block.header.timestamp > timestamp { Ok(mid - 1) } else { Ok(mid) @@ -311,23 +312,27 @@ async fn timestamp_to_block_number(timestamp: u64, source: Arc) -> Resul async fn get_latest_timestamp(source: Arc) -> Result { let latest_block_number = get_latest_block_number(source.clone()).await?; let latest_block = source - .get_block(latest_block_number) + .get_block(latest_block_number, BlockTransactionsKind::Hashes) .await .map_err(|_e| ParseError::ParseError("Error fetching latest block".to_string()))? .unwrap(); - Ok(latest_block.timestamp.as_u64()) + Ok(latest_block.header.timestamp) } #[cfg(test)] mod tests { use std::num::NonZeroU32; + use alloy::{ + providers::ProviderBuilder, + rpc::client::{BuiltInConnectionString, ClientBuilder, RpcClient}, + transports::{layers::RetryBackoffLayer, BoxTransport}, + }; use governor::{Quota, RateLimiter}; use super::*; use cryo_freeze::SourceLabels; - use ethers::prelude::*; async fn setup_source() -> Source { let rpc_url = match crate::parse::source::parse_rpc_url(&Args::default()) { @@ -336,19 +341,27 @@ mod tests { }; let max_retry = 5; let initial_backoff = 500; + let compute_units_per_second = 50; let max_concurrent_requests = 100; - let provider = - Provider::>::new_client(&rpc_url, max_retry, initial_backoff) - .map_err(|_e| ParseError::ParseError("could not connect to provider".to_string())) - .unwrap(); - + let retry_layer = + RetryBackoffLayer::new(max_retry, initial_backoff, compute_units_per_second); + let connect: BuiltInConnectionString = + rpc_url.parse().map_err(ParseError::ProviderError).unwrap(); + let client: RpcClient = ClientBuilder::default() + .layer(retry_layer) + .connect_boxed(connect) + .await + .map_err(ParseError::ProviderError) + .unwrap() + .boxed(); + let provider = ProviderBuilder::default().on_client(client); let quota = Quota::per_second(NonZeroU32::new(15).unwrap()) .allow_burst(NonZeroU32::new(1).unwrap()); let rate_limiter = Some(RateLimiter::direct(quota)); let semaphore = tokio::sync::Semaphore::new(max_concurrent_requests as usize); Source { - provider: provider.into(), + provider, semaphore: Arc::new(Some(semaphore)), rate_limiter: Arc::new(rate_limiter), chain_id: 1, @@ -373,8 +386,12 @@ mod tests { let source = setup_source().await; let source = Arc::new(source); let latest_block_number = get_latest_block_number(source.clone()).await.unwrap(); - let latest_block = source.get_block(latest_block_number).await.unwrap().unwrap(); - let latest_timestamp = latest_block.timestamp.as_u64(); + let latest_block = source + .get_block(latest_block_number, BlockTransactionsKind::Hashes) + .await + .unwrap() + .unwrap(); + let latest_timestamp = latest_block.header.timestamp; assert_eq!( timestamp_to_block_number(latest_timestamp, source).await.unwrap(), diff --git a/crates/freeze/Cargo.toml b/crates/freeze/Cargo.toml index 9c8e5e1..b6df7eb 100644 --- a/crates/freeze/Cargo.toml +++ b/crates/freeze/Cargo.toml @@ -11,18 +11,16 @@ repository.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +alloy = { workspace = true } async-trait = { workspace = true } chrono = { workspace = true } colored = { workspace = true } cryo_to_df = { workspace = true } -ethers = { workspace = true } -ethers-core = { workspace = true } futures = { workspace = true } governor = { workspace = true } heck = { workspace = true } indexmap = { workspace = true } indicatif = { workspace = true } -lazy_static = { workspace = true } mesc = { workspace = true } polars = { workspace = true } prefix-hex = { workspace = true } @@ -32,3 +30,4 @@ serde_json = { workspace = true } thiserror = { workspace = true } thousands = { workspace = true } tokio = { workspace = true } +url = "2.5.2" diff --git a/crates/freeze/src/datasets/address_appearances.rs b/crates/freeze/src/datasets/address_appearances.rs index 4e76b61..c360010 100644 --- a/crates/freeze/src/datasets/address_appearances.rs +++ b/crates/freeze/src/datasets/address_appearances.rs @@ -1,5 +1,13 @@ use crate::*; -use ethers::prelude::*; +use alloy::{ + primitives::{Address, TxHash}, + rpc::types::{ + eth::{Block, Log}, + trace::parity::{Action, LocalizedTransactionTrace, TraceOutput}, + BlockTransactionsKind, Filter, FilterBlockOption, + }, + sol_types::SolEvent, +}; use polars::prelude::*; use std::collections::HashMap; @@ -34,7 +42,7 @@ impl Dataset for AddressAppearances { } } -type BlockLogsTraces = (Block, Vec, Vec); +type BlockLogsTraces = (Block, Vec, Vec); #[async_trait::async_trait] impl CollectByBlock for AddressAppearances { @@ -42,17 +50,18 @@ impl CollectByBlock for AddressAppearances { async fn extract(request: Params, source: Arc, _: Arc) -> R { let block_number = request.ethers_block_number()?; - let block = source.get_block(request.block_number()?).await?; + let block = + source.get_block(request.block_number()?, BlockTransactionsKind::Hashes).await?; let block = block.ok_or(CollectError::CollectError("block not found".to_string()))?; let filter = Filter { block_option: FilterBlockOption::Range { - from_block: Some(block_number), - to_block: Some(block_number), + from_block: Some(block_number.into()), + to_block: Some(block_number.into()), }, ..Default::default() }; let logs = source.get_logs(&filter).await?; - let traces = source.trace_block(request.block_number()?.into()).await?; + let traces = source.trace_block(request.block_number()?).await?; Ok((block, logs, traces)) } @@ -69,16 +78,15 @@ impl CollectByTransaction for AddressAppearances { async fn extract(request: Params, source: Arc, _: Arc) -> R { let tx_hash = request.ethers_transaction_hash()?; - let tx_data = source.get_transaction(tx_hash).await?.ok_or_else(|| { + let tx_data = source.get_transaction_by_hash(tx_hash).await?.ok_or_else(|| { CollectError::CollectError("could not find transaction data".to_string()) })?; let block_number = tx_data .block_number - .ok_or_else(|| CollectError::CollectError("block not found".to_string()))? - .as_u64(); + .ok_or_else(|| CollectError::CollectError("block not found".to_string()))?; let block = source - .get_block(block_number) + .get_block(block_number, BlockTransactionsKind::Hashes) .await? .ok_or(CollectError::CollectError("could not get block".to_string()))?; @@ -87,7 +95,9 @@ impl CollectByTransaction for AddressAppearances { .get_transaction_receipt(tx_hash) .await? .ok_or(CollectError::CollectError("could not get tx receipt".to_string()))? - .logs; + .inner + .logs() + .to_vec(); // traces let traces = source.trace_transaction(request.ethers_transaction_hash()?).await?; @@ -102,11 +112,11 @@ impl CollectByTransaction for AddressAppearances { } fn name(log: &Log) -> Option<&'static str> { - let event = log.topics[0]; - if event == *EVENT_ERC20_TRANSFER { - if log.data.len() > 0 { + let event = log.topic0().unwrap(); + if event == *ERC20::Transfer::SIGNATURE_HASH { + if log.data().data.len() > 0 { Some("erc20_transfer") - } else if log.topics.len() == 4 { + } else if log.topics().len() == 4 { Some("erc721_transfer") } else { None @@ -119,26 +129,26 @@ fn name(log: &Log) -> Option<&'static str> { impl AddressAppearances { fn process_first_transaction( &mut self, - block_author: H160, - trace: &Trace, + block_author: Address, + trace: &LocalizedTransactionTrace, schema: &Table, - tx_hash: H256, - logs_by_tx: &HashMap>, + tx_hash: TxHash, + logs_by_tx: &HashMap>, ) { - let block_number = trace.block_number as u32; - let block_hash = trace.block_hash.as_bytes().to_vec(); + let block_number = trace.block_number.unwrap() as u32; + let block_hash = trace.block_hash.unwrap().to_vec(); self.process_address(block_author, "miner_fee", block_number, &block_hash, tx_hash, schema); if let Some(logs) = logs_by_tx.get(&tx_hash) { for log in logs.iter() { - if log.topics.len() >= 3 { + if log.topics().len() >= 3 { if let Some(name) = name(log) { let mut from: [u8; 20] = [0; 20]; - from.copy_from_slice(&log.topics[1].to_fixed_bytes()[12..32]); + from.copy_from_slice(&log.topics()[1][12..32]); let name = &(name.to_string() + "_from"); self.process_address( - H160(from), + Address::from_slice(&from), name, block_number, &block_hash, @@ -147,10 +157,10 @@ impl AddressAppearances { ); let mut to: [u8; 20] = [0; 20]; - to.copy_from_slice(&log.topics[1].to_fixed_bytes()[12..32]); + to.copy_from_slice(&log.topics()[1][12..32]); let name = &(name.to_string() + "_to"); self.process_address( - H160(to), + Address::from_slice(&to), name, block_number, &block_hash, @@ -162,7 +172,7 @@ impl AddressAppearances { } } - match &trace.action { + match &trace.trace.action { Action::Call(action) => { self.process_address( action.from, @@ -194,7 +204,7 @@ impl AddressAppearances { _ => {} } - if let Some(Res::Create(result)) = &trace.result { + if let Some(TraceOutput::Create(result)) = &trace.trace.result { self.process_address( result.address, "tx_to", @@ -206,10 +216,15 @@ impl AddressAppearances { } } - fn process_trace(&mut self, trace: &Trace, schema: &Table, tx_hash: H256) { - let block_number = trace.block_number as u32; - let block_hash = trace.block_hash.as_bytes().to_vec(); - match &trace.action { + fn process_trace( + &mut self, + trace: &LocalizedTransactionTrace, + schema: &Table, + tx_hash: TxHash, + ) { + let block_number = trace.block_number.unwrap() as u32; + let block_hash = trace.block_hash.unwrap().to_vec(); + match &trace.trace.action { Action::Call(action) => { self.process_address( action.from, @@ -238,7 +253,7 @@ impl AddressAppearances { schema, ); } - Action::Suicide(action) => { + Action::Selfdestruct(action) => { self.process_address( action.address, "suicide", @@ -268,7 +283,7 @@ impl AddressAppearances { } } - if let Some(Res::Create(result)) = &trace.result { + if let Some(TraceOutput::Create(result)) = &trace.trace.result { self.process_address( result.address, "create", @@ -282,19 +297,19 @@ impl AddressAppearances { fn process_address( &mut self, - address: H160, + address: Address, relationship: &str, block_number: u32, block_hash: &[u8], - transaction_hash: H256, + transaction_hash: TxHash, schema: &Table, ) { self.n_rows += 1; - store!(schema, self, address, address.as_bytes().to_vec()); + store!(schema, self, address, address.to_vec()); store!(schema, self, relationship, relationship.to_string()); store!(schema, self, block_number, block_number); store!(schema, self, block_hash, block_hash.to_vec()); - store!(schema, self, transaction_hash, transaction_hash.as_bytes().to_vec()); + store!(schema, self, transaction_hash, transaction_hash.to_vec()); } } @@ -304,19 +319,16 @@ fn process_appearances( schema: &Table, ) -> R<()> { let (block, logs, traces) = traces; - let mut logs_by_tx: HashMap> = HashMap::new(); + let mut logs_by_tx: HashMap> = HashMap::new(); for log in logs.into_iter() { if let Some(tx_hash) = log.transaction_hash { logs_by_tx.entry(tx_hash).or_default().push(log); } } - let (_block_number, block_author) = match (block.number, block.author) { - (Some(number), Some(author)) => (number.as_u64(), author), - _ => return Ok(()), - }; + let (_block_number, block_author) = (block.header.number, block.header.beneficiary); - let mut current_tx_hash = H256([0; 32]); + let mut current_tx_hash = TxHash::ZERO; for trace in traces.iter() { if let (Some(tx_hash), Some(_tx_pos)) = (trace.transaction_hash, trace.transaction_position) { diff --git a/crates/freeze/src/datasets/balance_diffs.rs b/crates/freeze/src/datasets/balance_diffs.rs index 231a707..5104de2 100644 --- a/crates/freeze/src/datasets/balance_diffs.rs +++ b/crates/freeze/src/datasets/balance_diffs.rs @@ -1,5 +1,8 @@ use crate::*; -use ethers::prelude::*; +use alloy::{ + primitives::{Address, U256}, + rpc::types::trace::parity::{ChangedType, Delta, TraceResults}, +}; use polars::prelude::*; /// columns for transactions @@ -19,7 +22,7 @@ pub struct BalanceDiffs { #[async_trait::async_trait] impl Dataset for BalanceDiffs {} -type BlockTxsTraces = (Option, Vec>>, Vec); +type BlockTxsTraces = (Option, Vec>>, Vec); #[async_trait::async_trait] impl CollectByBlock for BalanceDiffs { @@ -29,7 +32,10 @@ impl CollectByBlock for BalanceDiffs { let schema = query.schemas.get(&Datatype::BalanceDiffs).ok_or(err("schema not provided"))?; let include_txs = schema.has_column("transaction_hash"); - source.trace_block_state_diffs(request.block_number()? as u32, include_txs).await + let (bn, txs, traces) = + source.trace_block_state_diffs(request.block_number()? as u32, include_txs).await?; + let trace_resuls = traces.into_iter().map(|t| t.full_trace).collect(); + Ok((bn, txs, trace_resuls)) } fn transform(response: Self::Response, columns: &mut Self, query: &Arc) -> R<()> { @@ -58,7 +64,7 @@ pub(crate) fn process_balance_diffs( let schema = schemas.get(&Datatype::BalanceDiffs).ok_or(err("schema not provided"))?; let (block_number, txs, traces) = response; for (index, (trace, tx)) in traces.iter().zip(txs).enumerate() { - if let Some(ethers::types::StateDiff(state_diffs)) = &trace.state_diff { + if let Some(state_diffs) = &trace.state_diff { for (addr, diff) in state_diffs.iter() { process_balance_diff(addr, &diff.balance, block_number, tx, index, columns, schema); } @@ -68,8 +74,8 @@ pub(crate) fn process_balance_diffs( } pub(crate) fn process_balance_diff( - addr: &H160, - diff: &Diff, + addr: &Address, + diff: &Delta, block_number: &Option, transaction_hash: &Option>, transaction_index: usize, @@ -77,16 +83,16 @@ pub(crate) fn process_balance_diff( schema: &Table, ) { let (from, to) = match diff { - Diff::Same => return, - Diff::Born(value) => (U256::zero(), *value), - Diff::Died(value) => (*value, U256::zero()), - Diff::Changed(ChangedType { from, to }) => (*from, *to), + Delta::Unchanged => return, + Delta::Added(value) => (U256::ZERO, *value), + Delta::Removed(value) => (*value, U256::ZERO), + Delta::Changed(ChangedType { from, to }) => (*from, *to), }; columns.n_rows += 1; store!(schema, columns, block_number, *block_number); store!(schema, columns, transaction_index, Some(transaction_index as u32)); store!(schema, columns, transaction_hash, transaction_hash.clone()); - store!(schema, columns, address, addr.as_bytes().to_vec()); + store!(schema, columns, address, addr.to_vec()); store!(schema, columns, from_value, from); store!(schema, columns, to_value, to); } diff --git a/crates/freeze/src/datasets/balance_reads.rs b/crates/freeze/src/datasets/balance_reads.rs index a812862..6f9ba0a 100644 --- a/crates/freeze/src/datasets/balance_reads.rs +++ b/crates/freeze/src/datasets/balance_reads.rs @@ -1,5 +1,8 @@ use crate::*; -use ethers::prelude::*; +use alloy::{ + primitives::{Address, U256}, + rpc::types::trace::geth::AccountState, +}; use polars::prelude::*; use std::collections::BTreeMap; @@ -19,7 +22,7 @@ pub struct BalanceReads { #[async_trait::async_trait] impl Dataset for BalanceReads {} -type BlockTxsTraces = (Option, Vec>>, Vec>); +type BlockTxsTraces = (Option, Vec>>, Vec>); #[async_trait::async_trait] impl CollectByBlock for BalanceReads { @@ -70,7 +73,7 @@ pub(crate) fn process_balance_reads( } pub(crate) fn process_balance_read( - addr: &H160, + addr: &Address, account_state: &AccountState, block_number: &Option, transaction_hash: &Option>, @@ -83,7 +86,7 @@ pub(crate) fn process_balance_read( store!(schema, columns, block_number, *block_number); store!(schema, columns, transaction_index, Some(transaction_index as u32)); store!(schema, columns, transaction_hash, transaction_hash.clone()); - store!(schema, columns, address, addr.as_bytes().to_vec()); + store!(schema, columns, address, addr.to_vec()); store!(schema, columns, balance, *balance); } } diff --git a/crates/freeze/src/datasets/balances.rs b/crates/freeze/src/datasets/balances.rs index 4a2d36a..5b0583a 100644 --- a/crates/freeze/src/datasets/balances.rs +++ b/crates/freeze/src/datasets/balances.rs @@ -1,5 +1,5 @@ use crate::*; -use ethers::prelude::*; +use alloy::primitives::{Address, U256}; use polars::prelude::*; /// columns for balances @@ -37,7 +37,8 @@ impl CollectByBlock for Balances { async fn extract(request: Params, source: Arc, _: Arc) -> R { let address = request.address()?; let block_number = request.block_number()? as u32; - let balance = source.get_balance(H160::from_slice(&address), block_number.into()).await?; + let balance = + source.get_balance(Address::from_slice(&address), block_number.into()).await?; Ok((block_number, None, address, balance)) } diff --git a/crates/freeze/src/datasets/blocks.rs b/crates/freeze/src/datasets/blocks.rs index 5b12e58..5ee02e7 100644 --- a/crates/freeze/src/datasets/blocks.rs +++ b/crates/freeze/src/datasets/blocks.rs @@ -1,5 +1,8 @@ use crate::*; -use ethers::prelude::*; +use alloy::{ + primitives::U256, + rpc::types::{Block, BlockTransactionsKind}, +}; use polars::prelude::*; /// columns for transactions @@ -14,7 +17,7 @@ pub struct Blocks { state_root: Vec>, transactions_root: Vec>, receipts_root: Vec>, - block_number: Vec>, + block_number: Vec>, gas_used: Vec, gas_limit: Vec, extra_data: Vec>, @@ -22,7 +25,7 @@ pub struct Blocks { timestamp: Vec, difficulty: Vec, total_difficulty: Vec>, - size: Vec>, + size: Vec>, mix_hash: Vec>>, nonce: Vec>>, base_fee_per_gas: Vec>, @@ -48,11 +51,11 @@ impl Dataset for Blocks { #[async_trait::async_trait] impl CollectByBlock for Blocks { - type Response = Block; + type Response = Block; async fn extract(request: Params, source: Arc, _: Arc) -> R { let block = source - .get_block(request.block_number()?) + .get_block(request.block_number()?, BlockTransactionsKind::Hashes) .await? .ok_or(CollectError::CollectError("block not found".to_string()))?; Ok(block) @@ -66,15 +69,18 @@ impl CollectByBlock for Blocks { #[async_trait::async_trait] impl CollectByTransaction for Blocks { - type Response = Block; + type Response = Block; async fn extract(request: Params, source: Arc, _: Arc) -> R { let transaction = source - .get_transaction(request.ethers_transaction_hash()?) + .get_transaction_by_hash(request.ethers_transaction_hash()?) .await? .ok_or(CollectError::CollectError("transaction not found".to_string()))?; let block = source - .get_block_by_hash(transaction.block_hash.ok_or(err("no block block_hash found"))?) + .get_block_by_hash( + transaction.block_hash.ok_or(err("no block block_hash found"))?, + BlockTransactionsKind::Hashes, + ) .await? .ok_or(CollectError::CollectError("block not found".to_string()))?; Ok(block) @@ -90,25 +96,30 @@ impl CollectByTransaction for Blocks { pub(crate) fn process_block(block: Block, columns: &mut Blocks, schema: &Table) -> R<()> { columns.n_rows += 1; - store!(schema, columns, block_hash, block.hash.map(|x| x.0.to_vec())); - store!(schema, columns, parent_hash, block.parent_hash.0.to_vec()); - store!(schema, columns, uncles_hash, block.uncles_hash.0.to_vec()); - store!(schema, columns, author, block.author.map(|x| x.0.to_vec())); - store!(schema, columns, state_root, block.state_root.0.to_vec()); - store!(schema, columns, transactions_root, block.transactions_root.0.to_vec()); - store!(schema, columns, receipts_root, block.receipts_root.0.to_vec()); - store!(schema, columns, block_number, block.number.map(|x| x.as_u32())); - store!(schema, columns, gas_used, block.gas_used.as_u64()); - store!(schema, columns, gas_limit, block.gas_limit.as_u64()); - store!(schema, columns, extra_data, block.extra_data.to_vec()); - store!(schema, columns, logs_bloom, block.logs_bloom.map(|x| x.0.to_vec())); - store!(schema, columns, timestamp, block.timestamp.as_u32()); - store!(schema, columns, difficulty, block.difficulty.as_u64()); - store!(schema, columns, total_difficulty, block.total_difficulty); - store!(schema, columns, base_fee_per_gas, block.base_fee_per_gas.map(|x| x.as_u64())); - store!(schema, columns, size, block.size.map(|x| x.as_u32())); - store!(schema, columns, mix_hash, block.mix_hash.map(|x| x.0.to_vec())); - store!(schema, columns, nonce, block.nonce.map(|x| x.0.to_vec())); - store!(schema, columns, withdrawals_root, block.withdrawals_root.map(|x| x.0.to_vec())); + store!(schema, columns, block_hash, Some(block.header.hash.to_vec())); + store!(schema, columns, parent_hash, block.header.parent_hash.0.to_vec()); + store!( + schema, + columns, + uncles_hash, + block.uncles.into_iter().flat_map(|s| s.to_vec()).collect() + ); + store!(schema, columns, author, Some(block.header.beneficiary.to_vec())); + store!(schema, columns, state_root, block.header.state_root.0.to_vec()); + store!(schema, columns, transactions_root, block.header.transactions_root.0.to_vec()); + store!(schema, columns, receipts_root, block.header.receipts_root.0.to_vec()); + store!(schema, columns, block_number, Some(block.header.number)); + store!(schema, columns, gas_used, block.header.gas_used); + store!(schema, columns, gas_limit, block.header.gas_limit); + store!(schema, columns, extra_data, block.header.extra_data.to_vec()); + store!(schema, columns, logs_bloom, Some(block.header.logs_bloom.to_vec())); + store!(schema, columns, timestamp, block.header.timestamp as u32); + store!(schema, columns, difficulty, block.header.difficulty.wrapping_to::()); + store!(schema, columns, total_difficulty, block.header.total_difficulty); + store!(schema, columns, base_fee_per_gas, block.header.base_fee_per_gas); + store!(schema, columns, size, block.header.size.map(|v| v.wrapping_to::())); + store!(schema, columns, mix_hash, Some(block.header.mix_hash.to_vec())); + store!(schema, columns, nonce, Some(block.header.nonce.0.to_vec())); + store!(schema, columns, withdrawals_root, block.header.withdrawals_root.map(|x| x.0.to_vec())); Ok(()) } diff --git a/crates/freeze/src/datasets/code_diffs.rs b/crates/freeze/src/datasets/code_diffs.rs index 2d2a262..f8893b3 100644 --- a/crates/freeze/src/datasets/code_diffs.rs +++ b/crates/freeze/src/datasets/code_diffs.rs @@ -1,5 +1,8 @@ use crate::*; -use ethers::prelude::*; +use alloy::{ + primitives::{Address, Bytes}, + rpc::types::trace::parity::{ChangedType, Delta, TraceResults}, +}; use polars::prelude::*; /// columns for transactions @@ -19,7 +22,7 @@ pub struct CodeDiffs { #[async_trait::async_trait] impl Dataset for CodeDiffs {} -type BlockTxTraces = (Option, Vec>>, Vec); +type BlockTxTraces = (Option, Vec>>, Vec); #[async_trait::async_trait] impl CollectByBlock for CodeDiffs { @@ -28,7 +31,10 @@ impl CollectByBlock for CodeDiffs { async fn extract(request: Params, source: Arc, query: Arc) -> R { let schema = query.schemas.get(&Datatype::CodeDiffs).ok_or(err("schema not provided"))?; let include_txs = schema.has_column("transaction_hash"); - source.trace_block_state_diffs(request.block_number()? as u32, include_txs).await + let (bn, txs, traces) = + source.trace_block_state_diffs(request.block_number()? as u32, include_txs).await?; + let trace_results = traces.into_iter().map(|t| t.full_trace).collect(); + Ok((bn, txs, trace_results)) } fn transform(response: Self::Response, columns: &mut Self, query: &Arc) -> R<()> { @@ -57,7 +63,7 @@ pub(crate) fn process_code_diffs( let schema = schemas.get(&Datatype::CodeDiffs).ok_or(err("schema not provided"))?; let (block_number, txs, traces) = response; for (index, (trace, tx)) in traces.iter().zip(txs).enumerate() { - if let Some(ethers::types::StateDiff(state_diffs)) = &trace.state_diff { + if let Some(state_diffs) = &trace.state_diff { for (addr, diff) in state_diffs.iter() { process_code_diff(addr, &diff.code, block_number, tx, index, columns, schema); } @@ -67,8 +73,8 @@ pub(crate) fn process_code_diffs( } pub(crate) fn process_code_diff( - addr: &H160, - diff: &Diff, + addr: &Address, + diff: &Delta, block_number: &Option, transaction_hash: &Option>, transaction_index: usize, @@ -77,21 +83,21 @@ pub(crate) fn process_code_diff( ) { // this code will skip self-destructs and EOAs let (from, to) = match diff { - Diff::Same => return, - Diff::Born(value) => { + Delta::Unchanged => return, + Delta::Added(value) => { if value.is_empty() { return }; (Vec::new(), value.to_vec()) } - Diff::Died(value) => (value.to_vec(), Vec::new()), - Diff::Changed(ChangedType { from, to }) => (from.to_vec(), to.to_vec()), + Delta::Removed(value) => (value.to_vec(), Vec::new()), + Delta::Changed(ChangedType { from, to }) => (from.to_vec(), to.to_vec()), }; columns.n_rows += 1; store!(schema, columns, block_number, *block_number); store!(schema, columns, transaction_index, Some(transaction_index as u32)); store!(schema, columns, transaction_hash, transaction_hash.clone()); - store!(schema, columns, address, addr.as_bytes().to_vec()); + store!(schema, columns, address, addr.to_vec()); store!(schema, columns, from_value, from); store!(schema, columns, to_value, to); } diff --git a/crates/freeze/src/datasets/code_reads.rs b/crates/freeze/src/datasets/code_reads.rs index 0b0aca3..1127e5c 100644 --- a/crates/freeze/src/datasets/code_reads.rs +++ b/crates/freeze/src/datasets/code_reads.rs @@ -1,5 +1,5 @@ use crate::*; -use ethers::prelude::*; +use alloy::{primitives::Address, rpc::types::trace::geth::AccountState}; use polars::prelude::*; use std::collections::BTreeMap; @@ -19,7 +19,7 @@ pub struct CodeReads { #[async_trait::async_trait] impl Dataset for CodeReads {} -type BlockTxsTraces = (Option, Vec>>, Vec>); +type BlockTxsTraces = (Option, Vec>>, Vec>); #[async_trait::async_trait] impl CollectByBlock for CodeReads { @@ -68,7 +68,7 @@ pub(crate) fn process_code_reads( } pub(crate) fn process_code_read( - addr: &H160, + addr: &Address, account_state: &AccountState, block_number: &Option, transaction_hash: &Option>, @@ -81,7 +81,7 @@ pub(crate) fn process_code_read( store!(schema, columns, block_number, *block_number); store!(schema, columns, transaction_index, Some(transaction_index as u32)); store!(schema, columns, transaction_hash, transaction_hash.clone()); - store!(schema, columns, contract_address, addr.as_bytes().to_vec()); - store!(schema, columns, code, code.as_bytes().to_vec()); + store!(schema, columns, contract_address, addr.to_vec()); + store!(schema, columns, code, code.to_vec()); } } diff --git a/crates/freeze/src/datasets/codes.rs b/crates/freeze/src/datasets/codes.rs index 1b1b6bf..16bc5dc 100644 --- a/crates/freeze/src/datasets/codes.rs +++ b/crates/freeze/src/datasets/codes.rs @@ -1,5 +1,5 @@ use crate::*; -use ethers::prelude::*; +use alloy::primitives::Address; use polars::prelude::*; /// columns for balances @@ -41,7 +41,7 @@ impl CollectByBlock for Codes { async fn extract(request: Params, source: Arc, _: Arc) -> R { let address = request.address()?; let block_number = request.block_number()? as u32; - let output = source.get_code(H160::from_slice(&address), block_number.into()).await?; + let output = source.get_code(Address::from_slice(&address), block_number.into()).await?; Ok((block_number, None, address, output.to_vec())) } diff --git a/crates/freeze/src/datasets/contracts.rs b/crates/freeze/src/datasets/contracts.rs index 9c682dc..7df089a 100644 --- a/crates/freeze/src/datasets/contracts.rs +++ b/crates/freeze/src/datasets/contracts.rs @@ -1,7 +1,9 @@ use super::traces; use crate::*; -use ethers::prelude::*; -use ethers_core::utils::keccak256; +use alloy::{ + primitives::{keccak256, Address}, + rpc::types::trace::parity::{Action, LocalizedTransactionTrace, TraceOutput}, +}; use polars::prelude::*; /// columns for transactions @@ -34,7 +36,7 @@ impl Dataset for Contracts { #[async_trait::async_trait] impl CollectByBlock for Contracts { - type Response = Vec; + type Response = Vec; async fn extract(request: Params, source: Arc, _: Arc) -> R { source.trace_block(request.ethers_block_number()?).await @@ -49,7 +51,7 @@ impl CollectByBlock for Contracts { #[async_trait::async_trait] impl CollectByTransaction for Contracts { - type Response = Vec; + type Response = Vec; async fn extract(request: Params, source: Arc, _: Arc) -> R { source.trace_transaction(request.ethers_transaction_hash()?).await @@ -64,39 +66,40 @@ impl CollectByTransaction for Contracts { /// process block into columns pub(crate) fn process_contracts( - traces: &[Trace], + traces: &[LocalizedTransactionTrace], columns: &mut Contracts, schemas: &Schemas, ) -> R<()> { let schema = schemas.get(&Datatype::Contracts).ok_or(err("schema not provided"))?; - let mut deployer = H160([0; 20]); + let mut deployer = Address::ZERO; let mut create_index = 0; for trace in traces.iter() { - if trace.trace_address.is_empty() { - deployer = match &trace.action { + if trace.trace.trace_address.is_empty() { + deployer = match &trace.trace.action { Action::Call(call) => call.from, Action::Create(create) => create.from, - Action::Suicide(suicide) => suicide.refund_address, + Action::Selfdestruct(suicide) => suicide.refund_address, Action::Reward(reward) => reward.author, }; }; - if let (Action::Create(create), Some(Res::Create(result))) = (&trace.action, &trace.result) + if let (Action::Create(create), Some(TraceOutput::Create(result))) = + (&trace.trace.action, &trace.trace.result) { columns.n_rows += 1; - store!(schema, columns, block_number, trace.block_number as u32); - store!(schema, columns, block_hash, trace.block_hash.as_bytes().to_vec()); + store!(schema, columns, block_number, trace.block_number.unwrap() as u32); + store!(schema, columns, block_hash, trace.block_hash.unwrap().to_vec()); store!(schema, columns, create_index, create_index); create_index += 1; let tx = trace.transaction_hash; - store!(schema, columns, transaction_hash, tx.map(|x| x.as_bytes().to_vec())); - store!(schema, columns, contract_address, result.address.as_bytes().into()); - store!(schema, columns, deployer, deployer.as_bytes().into()); - store!(schema, columns, factory, create.from.as_bytes().into()); + store!(schema, columns, transaction_hash, tx.map(|x| x.to_vec())); + store!(schema, columns, contract_address, result.address.to_vec()); + store!(schema, columns, deployer, deployer.to_vec()); + store!(schema, columns, factory, create.from.to_vec()); store!(schema, columns, init_code, create.init.to_vec()); store!(schema, columns, code, result.code.to_vec()); - store!(schema, columns, init_code_hash, keccak256(result.code.clone()).into()); - store!(schema, columns, code_hash, keccak256(create.init.clone()).into()); + store!(schema, columns, init_code_hash, keccak256(result.code.clone()).to_vec()); + store!(schema, columns, code_hash, keccak256(create.init.clone()).to_vec()); store!(schema, columns, n_init_code_bytes, create.init.len() as u32); store!(schema, columns, n_code_bytes, result.code.len() as u32); } diff --git a/crates/freeze/src/datasets/erc20_approvals.rs b/crates/freeze/src/datasets/erc20_approvals.rs index f8219f0..acba313 100644 --- a/crates/freeze/src/datasets/erc20_approvals.rs +++ b/crates/freeze/src/datasets/erc20_approvals.rs @@ -1,5 +1,9 @@ use crate::*; -use ethers::prelude::*; +use alloy::{ + primitives::{B256, U256}, + rpc::types::{Filter, Log, Topic}, + sol_types::SolEvent, +}; use polars::prelude::*; /// columns for transactions @@ -54,21 +58,24 @@ impl CollectByBlock for Erc20Approvals { type Response = Vec; async fn extract(request: Params, source: Arc, _: Arc) -> R { - let mut topics = [Some(ValueOrArray::Value(Some(*EVENT_ERC20_TRANSFER))), None, None, None]; + let mut topics: [Topic; 4] = Default::default(); + topics[0] = ERC20::Approval::SIGNATURE_HASH.into(); if let Some(from_address) = &request.from_address { - let mut v = vec![0u8; 12]; - v.append(&mut from_address.to_owned()); - topics[1] = Some(ValueOrArray::Value(Some(H256::from_slice(&v[..])))); + let v = B256::from_slice(from_address); + topics[1] = v.into(); } if let Some(to_address) = &request.to_address { - let mut v = vec![0u8; 12]; - v.append(&mut to_address.to_owned()); - topics[2] = Some(ValueOrArray::Value(Some(H256::from_slice(&v[..])))); + let v = B256::from_slice(to_address); + topics[2] = v.into(); } let filter = Filter { topics, ..request.ethers_log_filter()? }; + let logs = source.get_logs(&filter).await?; - Ok(logs.into_iter().filter(|x| x.topics.len() == 3 && x.data.len() == 32).collect()) + Ok(logs + .into_iter() + .filter(|x| x.topics().len() == 3 && x.data().data.len() == 32) + .collect()) } fn transform(response: Self::Response, columns: &mut Self, query: &Arc) -> R<()> { @@ -88,7 +95,9 @@ impl CollectByTransaction for Erc20Approvals { } fn is_erc20_approval(log: &Log) -> bool { - log.topics.len() == 3 && log.data.len() == 32 && log.topics[0] == *EVENT_ERC20_APPROVAL + log.topics().len() == 3 && + log.data().data.len() == 32 && + log.topics()[0] == ERC20::Approval::SIGNATURE_HASH } fn process_erc20_approval(logs: Vec, columns: &mut Erc20Approvals, schema: &Table) -> R<()> { @@ -97,15 +106,20 @@ fn process_erc20_approval(logs: Vec, columns: &mut Erc20Approvals, schema: (log.block_number, log.transaction_hash, log.transaction_index, log.log_index) { columns.n_rows += 1; - store!(schema, columns, block_number, bn.as_u32()); - store!(schema, columns, block_hash, log.block_hash.map(|bh| bh.as_bytes().to_vec())); - store!(schema, columns, transaction_index, ti.as_u32()); - store!(schema, columns, log_index, li.as_u32()); - store!(schema, columns, transaction_hash, tx.as_bytes().to_vec()); - store!(schema, columns, erc20, log.address.as_bytes().to_vec()); - store!(schema, columns, from_address, log.topics[1].as_bytes()[12..].to_vec()); - store!(schema, columns, to_address, log.topics[2].as_bytes()[12..].to_vec()); - store!(schema, columns, value, log.data.to_vec().as_slice().into()); + store!(schema, columns, block_number, bn as u32); + store!(schema, columns, block_hash, log.block_hash.map(|bh| bh.to_vec())); + store!(schema, columns, transaction_index, ti as u32); + store!(schema, columns, log_index, li as u32); + store!(schema, columns, transaction_hash, tx.to_vec()); + store!(schema, columns, erc20, log.address().to_vec()); + store!(schema, columns, from_address, log.topics()[1][12..].to_vec()); + store!(schema, columns, to_address, log.topics()[2][12..].to_vec()); + store!( + schema, + columns, + value, + U256::from_be_slice(log.data().data.to_vec().as_slice()) + ); } } Ok(()) diff --git a/crates/freeze/src/datasets/erc20_balances.rs b/crates/freeze/src/datasets/erc20_balances.rs index a4cf593..70fd4f8 100644 --- a/crates/freeze/src/datasets/erc20_balances.rs +++ b/crates/freeze/src/datasets/erc20_balances.rs @@ -1,5 +1,5 @@ use crate::*; -use ethers::prelude::*; +use alloy::{primitives::U256, sol_types::SolCall}; use polars::prelude::*; /// columns for transactions @@ -30,14 +30,14 @@ impl CollectByBlock for Erc20Balances { type Response = (u32, Vec, Vec, Option); async fn extract(request: Params, source: Arc, _: Arc) -> R { - let signature = FUNCTION_ERC20_BALANCE_OF.clone(); - let mut call_data = signature.clone(); + let signature = ERC20::balanceOfCall::SELECTOR; + let mut call_data = signature.clone().to_vec(); call_data.extend(vec![0; 12]); call_data.extend(request.address()?); let block_number = request.ethers_block_number()?; let contract = request.ethers_contract()?; let balance = source.call2(contract, call_data, block_number).await.ok(); - let balance = balance.map(|x| x.to_vec().as_slice().into()); + let balance = balance.map(|x| U256::from_be_slice(x.as_ref())); Ok((request.block_number()? as u32, request.contract()?, request.address()?, balance)) } diff --git a/crates/freeze/src/datasets/erc20_metadata.rs b/crates/freeze/src/datasets/erc20_metadata.rs index cc6f154..ec254c9 100644 --- a/crates/freeze/src/datasets/erc20_metadata.rs +++ b/crates/freeze/src/datasets/erc20_metadata.rs @@ -1,4 +1,5 @@ use crate::*; +use alloy::sol_types::SolCall; use polars::prelude::*; /// columns for transactions @@ -47,7 +48,7 @@ impl CollectByBlock for Erc20Metadata { let address = request.ethers_address()?; // name - let call_data = FUNCTION_ERC20_NAME.clone(); + let call_data = ERC20::nameCall::SELECTOR.to_vec(); let name = match source.call2(address, call_data, block_number).await { Ok(output) => { String::from_utf8(output.to_vec()).ok().map(|s| remove_control_characters(&s)) @@ -56,7 +57,7 @@ impl CollectByBlock for Erc20Metadata { }; // symbol - let call_data = FUNCTION_ERC20_SYMBOL.clone(); + let call_data = ERC20::symbolCall::SELECTOR.to_vec(); let symbol = match source.call2(address, call_data, block_number).await { Ok(output) => { String::from_utf8(output.to_vec()).ok().map(|s| remove_control_characters(&s)) @@ -65,7 +66,7 @@ impl CollectByBlock for Erc20Metadata { }; // decimals - let call_data = FUNCTION_ERC20_DECIMALS.clone(); + let call_data = ERC20::decimalsCall::SELECTOR.to_vec(); let decimals = match source.call2(address, call_data, block_number).await { Ok(output) => bytes_to_u32(output).ok(), Err(_) => None, diff --git a/crates/freeze/src/datasets/erc20_supplies.rs b/crates/freeze/src/datasets/erc20_supplies.rs index 4d46366..d02f1ca 100644 --- a/crates/freeze/src/datasets/erc20_supplies.rs +++ b/crates/freeze/src/datasets/erc20_supplies.rs @@ -1,5 +1,5 @@ use crate::*; -use ethers::prelude::*; +use alloy::{primitives::U256, sol_types::SolCall}; use polars::prelude::*; /// columns for transactions @@ -37,13 +37,13 @@ impl CollectByBlock for Erc20Supplies { type Response = (u32, Vec, Option); async fn extract(request: Params, source: Arc, _: Arc) -> R { - let signature: Vec = FUNCTION_ERC20_TOTAL_SUPPLY.clone(); + let signature: Vec = ERC20::totalSupplyCall::SELECTOR.to_vec(); let mut call_data = signature.clone(); call_data.extend(request.address()?); let block_number = request.ethers_block_number()?; let contract = request.ethers_address()?; let output = source.call2(contract, call_data, block_number).await.ok(); - let output = output.map(|x| x.to_vec().as_slice().into()); + let output = output.map(|x| U256::from_be_slice(x.as_ref())); Ok((request.block_number()? as u32, request.address()?, output)) } diff --git a/crates/freeze/src/datasets/erc20_transfers.rs b/crates/freeze/src/datasets/erc20_transfers.rs index be23086..6881266 100644 --- a/crates/freeze/src/datasets/erc20_transfers.rs +++ b/crates/freeze/src/datasets/erc20_transfers.rs @@ -1,5 +1,9 @@ use crate::*; -use ethers::prelude::*; +use alloy::{ + primitives::{B256, U256}, + rpc::types::{Filter, Log, Topic}, + sol_types::SolEvent, +}; use polars::prelude::*; /// columns for transactions @@ -54,21 +58,23 @@ impl CollectByBlock for Erc20Transfers { type Response = Vec; async fn extract(request: Params, source: Arc, _: Arc) -> R { - let mut topics = [Some(ValueOrArray::Value(Some(*EVENT_ERC20_TRANSFER))), None, None, None]; + let mut topics: [Topic; 4] = Default::default(); + topics[0] = ERC20::Transfer::SIGNATURE_HASH.into(); if let Some(from_address) = &request.from_address { - let mut v = vec![0u8; 12]; - v.append(&mut from_address.to_owned()); - topics[1] = Some(ValueOrArray::Value(Some(H256::from_slice(&v[..])))); + let v = B256::from_slice(from_address); + topics[1] = v.into(); } if let Some(to_address) = &request.to_address { - let mut v = vec![0u8; 12]; - v.append(&mut to_address.to_owned()); - topics[2] = Some(ValueOrArray::Value(Some(H256::from_slice(&v[..])))); + let v = B256::from_slice(to_address); + topics[2] = v.into(); } let filter = Filter { topics, ..request.ethers_log_filter()? }; let logs = source.get_logs(&filter).await?; - Ok(logs.into_iter().filter(|x| x.topics.len() == 3 && x.data.len() == 32).collect()) + Ok(logs + .into_iter() + .filter(|x| x.topics().len() == 3 && x.data().data.len() == 32) + .collect()) } fn transform(response: Self::Response, columns: &mut Self, query: &Arc) -> R<()> { @@ -93,7 +99,9 @@ impl CollectByTransaction for Erc20Transfers { } fn is_erc20_transfer(log: &Log) -> bool { - log.topics.len() == 3 && log.data.len() == 32 && log.topics[0] == *EVENT_ERC20_TRANSFER + log.topics().len() == 3 && + log.data().data.len() == 32 && + log.topics()[0] == ERC20::Approval::SIGNATURE_HASH } /// process block into columns @@ -103,15 +111,20 @@ fn process_erc20_transfers(logs: Vec, columns: &mut Erc20Transfers, schema: (log.block_number, log.transaction_hash, log.transaction_index, log.log_index) { columns.n_rows += 1; - store!(schema, columns, block_number, bn.as_u32()); - store!(schema, columns, block_hash, log.block_hash.map(|bh| bh.as_bytes().to_vec())); - store!(schema, columns, transaction_index, ti.as_u32()); - store!(schema, columns, log_index, li.as_u32()); - store!(schema, columns, transaction_hash, tx.as_bytes().to_vec()); - store!(schema, columns, erc20, log.address.as_bytes().to_vec()); - store!(schema, columns, from_address, log.topics[1].as_bytes()[12..].to_vec()); - store!(schema, columns, to_address, log.topics[2].as_bytes()[12..].to_vec()); - store!(schema, columns, value, log.data.to_vec().as_slice().into()); + store!(schema, columns, block_number, bn as u32); + store!(schema, columns, block_hash, log.block_hash.map(|bh| bh.to_vec())); + store!(schema, columns, transaction_index, ti as u32); + store!(schema, columns, log_index, li as u32); + store!(schema, columns, transaction_hash, tx.to_vec()); + store!(schema, columns, erc20, log.address().to_vec()); + store!(schema, columns, from_address, log.topics()[1][12..].to_vec()); + store!(schema, columns, to_address, log.topics()[2][12..].to_vec()); + store!( + schema, + columns, + value, + U256::from_be_slice(log.data().data.to_vec().as_slice()) + ); } } Ok(()) diff --git a/crates/freeze/src/datasets/erc721_metadata.rs b/crates/freeze/src/datasets/erc721_metadata.rs index 16dbf55..734f2d7 100644 --- a/crates/freeze/src/datasets/erc721_metadata.rs +++ b/crates/freeze/src/datasets/erc721_metadata.rs @@ -1,5 +1,6 @@ use super::erc20_metadata::remove_control_characters; use crate::*; +use alloy::sol_types::SolCall; use polars::prelude::*; /// columns for transactions @@ -37,7 +38,7 @@ impl CollectByBlock for Erc721Metadata { let address = request.ethers_address()?; // name - let call_data = FUNCTION_ERC20_NAME.clone(); + let call_data = ERC721::nameCall::SELECTOR.to_vec(); let name = match source.call2(address, call_data, block_number).await { Ok(output) => { String::from_utf8(output.to_vec()).ok().map(|s| remove_control_characters(&s)) @@ -46,7 +47,7 @@ impl CollectByBlock for Erc721Metadata { }; // symbol - let call_data = FUNCTION_ERC20_SYMBOL.clone(); + let call_data = ERC721::symbolCall::SELECTOR.to_vec(); let symbol = match source.call2(address, call_data, block_number).await { Ok(output) => { String::from_utf8(output.to_vec()).ok().map(|s| remove_control_characters(&s)) diff --git a/crates/freeze/src/datasets/erc721_transfers.rs b/crates/freeze/src/datasets/erc721_transfers.rs index e6c3fc2..065dc17 100644 --- a/crates/freeze/src/datasets/erc721_transfers.rs +++ b/crates/freeze/src/datasets/erc721_transfers.rs @@ -1,5 +1,9 @@ use crate::*; -use ethers::prelude::*; +use alloy::{ + primitives::{B256, U256}, + rpc::types::{Filter, Log, Topic}, + sol_types::SolEvent, +}; use polars::prelude::*; /// columns for transactions @@ -54,22 +58,20 @@ impl CollectByBlock for Erc721Transfers { type Response = Vec; async fn extract(request: Params, source: Arc, _: Arc) -> R { - let mut topics = - [Some(ValueOrArray::Value(Some(*EVENT_ERC721_TRANSFER))), None, None, None]; + let mut topics: [Topic; 4] = Default::default(); + topics[0] = ERC721::Transfer::SIGNATURE_HASH.into(); if let Some(from_address) = &request.from_address { - let mut v = vec![0u8; 12]; - v.append(&mut from_address.to_owned()); - topics[1] = Some(ValueOrArray::Value(Some(H256::from_slice(&v[..])))); - } + let v = B256::from_slice(from_address); + topics[1] = v.into(); + }; if let Some(to_address) = &request.to_address { - let mut v = vec![0u8; 12]; - v.append(&mut to_address.to_owned()); - topics[2] = Some(ValueOrArray::Value(Some(H256::from_slice(&v[..])))); - } + let v = B256::from_slice(to_address); + topics[2] = v.into(); + }; let filter = Filter { topics, ..request.ethers_log_filter()? }; let logs = source.get_logs(&filter).await?; - Ok(logs.into_iter().filter(|x| x.topics.len() == 4 && x.data.len() == 0).collect()) + Ok(logs.into_iter().filter(|x| x.topics().len() == 4 && x.data().data.len() == 0).collect()) } fn transform(response: Self::Response, columns: &mut Self, query: &Arc) -> R<()> { @@ -94,7 +96,9 @@ impl CollectByTransaction for Erc721Transfers { } fn is_erc721_transfer(log: &Log) -> bool { - log.topics.len() == 4 && log.data.len() == 0 && log.topics[0] == *EVENT_ERC721_TRANSFER + log.topics().len() == 4 && + log.data().data.len() == 0 && + log.topics()[0] == ERC721::Transfer::SIGNATURE_HASH } /// process block into columns @@ -108,15 +112,15 @@ fn process_erc721_transfers( (log.block_number, log.transaction_hash, log.transaction_index, log.log_index) { columns.n_rows += 1; - store!(schema, columns, block_number, bn.as_u32()); - store!(schema, columns, block_hash, log.block_hash.map(|bh| bh.as_bytes().to_vec())); - store!(schema, columns, transaction_index, ti.as_u32()); - store!(schema, columns, log_index, li.as_u32()); - store!(schema, columns, transaction_hash, tx.as_bytes().to_vec()); - store!(schema, columns, erc20, log.address.as_bytes().to_vec()); - store!(schema, columns, from_address, log.topics[1].as_bytes()[12..].to_vec()); - store!(schema, columns, to_address, log.topics[2].as_bytes()[12..].to_vec()); - store!(schema, columns, token_id, log.topics[3].as_bytes().into()); + store!(schema, columns, block_number, bn as u32); + store!(schema, columns, block_hash, log.block_hash.map(|bh| bh.to_vec())); + store!(schema, columns, transaction_index, ti as u32); + store!(schema, columns, log_index, li as u32); + store!(schema, columns, transaction_hash, tx.to_vec()); + store!(schema, columns, erc20, log.address().to_vec()); + store!(schema, columns, from_address, log.topics()[1][12..].to_vec()); + store!(schema, columns, to_address, log.topics()[2][12..].to_vec()); + store!(schema, columns, token_id, log.topics()[3].into()); } } Ok(()) diff --git a/crates/freeze/src/datasets/eth_calls.rs b/crates/freeze/src/datasets/eth_calls.rs index 4a58be3..203528f 100644 --- a/crates/freeze/src/datasets/eth_calls.rs +++ b/crates/freeze/src/datasets/eth_calls.rs @@ -1,5 +1,8 @@ use crate::*; -use ethers::prelude::*; +use alloy::{ + primitives::{keccak256, TxKind}, + rpc::types::{TransactionInput, TransactionRequest}, +}; use polars::prelude::*; /// columns for transactions @@ -47,12 +50,12 @@ impl CollectByBlock for EthCalls { async fn extract(request: Params, source: Arc, _: Arc) -> R { let transaction = TransactionRequest { - to: Some(request.ethers_contract()?.into()), - data: Some(request.call_data()?.into()), + to: Some(TxKind::Call(request.ethers_contract()?)), + input: TransactionInput::new(request.call_data()?.into()), ..Default::default() }; let number = request.block_number()?; - let output = source.call(transaction, number.into()).await.ok().map(|x| x.to_vec()); + let output = source.call(transaction, number).await.ok().map(|x| x.to_vec()); Ok((number as u32, request.contract()?, request.call_data()?, output)) } @@ -73,12 +76,7 @@ fn process_eth_call(response: EthCallsResponse, columns: &mut EthCalls, schema: store!(schema, columns, block_number, block_number); store!(schema, columns, contract_address, contract_address); store!(schema, columns, call_data, call_data.clone()); - store!(schema, columns, call_data_hash, ethers_core::utils::keccak256(call_data).into()); + store!(schema, columns, call_data_hash, keccak256(call_data).to_vec()); store!(schema, columns, output_data, output_data.clone()); - store!( - schema, - columns, - output_data_hash, - output_data.map(|data| ethers_core::utils::keccak256(data).into()) - ); + store!(schema, columns, output_data_hash, output_data.map(|data| keccak256(data).to_vec())); } diff --git a/crates/freeze/src/datasets/geth_balance_diffs.rs b/crates/freeze/src/datasets/geth_balance_diffs.rs index ef87240..a719715 100644 --- a/crates/freeze/src/datasets/geth_balance_diffs.rs +++ b/crates/freeze/src/datasets/geth_balance_diffs.rs @@ -1,5 +1,5 @@ use crate::*; -use ethers::prelude::*; +use alloy::primitives::U256; use polars::prelude::*; /// columns for transactions diff --git a/crates/freeze/src/datasets/geth_calls.rs b/crates/freeze/src/datasets/geth_calls.rs index a0dc80c..db5df39 100644 --- a/crates/freeze/src/datasets/geth_calls.rs +++ b/crates/freeze/src/datasets/geth_calls.rs @@ -1,5 +1,5 @@ use crate::*; -use ethers::prelude::*; +use alloy::{primitives::U256, rpc::types::trace::geth::CallFrame}; use polars::prelude::*; /// columns for geth traces @@ -83,8 +83,8 @@ fn process_trace( ) -> R<()> { columns.n_rows += 1; store!(schema, columns, typ, trace.typ); - store!(schema, columns, from_address, trace.from.as_bytes().to_vec()); - store!(schema, columns, to_address, noa_to_vec_u8(trace.to)?); + store!(schema, columns, from_address, trace.from.to_vec()); + store!(schema, columns, to_address, trace.to.map(|x| x.to_vec())); store!(schema, columns, value, trace.value); store!(schema, columns, gas, trace.gas); store!(schema, columns, gas_used, trace.gas_used); @@ -101,21 +101,11 @@ fn process_trace( trace_address.iter().map(|&n| n.to_string()).collect::>().join(" ") ); - if let Some(subcalls) = trace.calls { - for (s, subcall) in subcalls.into_iter().enumerate() { - let mut sub_trace_address = trace_address.clone(); - sub_trace_address.push(s as u32); - process_trace(subcall, columns, schema, block_number, tx, tx_index, sub_trace_address)? - } + for (s, subcall) in trace.calls.into_iter().enumerate() { + let mut sub_trace_address = trace_address.clone(); + sub_trace_address.push(s as u32); + process_trace(subcall, columns, schema, block_number, tx, tx_index, sub_trace_address)? } Ok(()) } - -fn noa_to_vec_u8(value: Option) -> R>> { - match value { - Some(NameOrAddress::Address(address)) => Ok(Some(address.as_bytes().to_vec())), - Some(NameOrAddress::Name(_)) => Err(err("block name string not allowed")), - None => Ok(None), - } -} diff --git a/crates/freeze/src/datasets/geth_nonce_diffs.rs b/crates/freeze/src/datasets/geth_nonce_diffs.rs index 027e32b..47a86b0 100644 --- a/crates/freeze/src/datasets/geth_nonce_diffs.rs +++ b/crates/freeze/src/datasets/geth_nonce_diffs.rs @@ -1,5 +1,4 @@ use crate::*; -use ethers::prelude::*; use polars::prelude::*; /// columns for transactions @@ -11,8 +10,8 @@ pub struct GethNonceDiffs { pub(crate) transaction_index: Vec>, pub(crate) transaction_hash: Vec>>, pub(crate) address: Vec>, - pub(crate) from_value: Vec, - pub(crate) to_value: Vec, + pub(crate) from_value: Vec, + pub(crate) to_value: Vec, pub(crate) chain_id: Vec, } diff --git a/crates/freeze/src/datasets/geth_opcodes.rs b/crates/freeze/src/datasets/geth_opcodes.rs index 1f71831..95f519b 100644 --- a/crates/freeze/src/datasets/geth_opcodes.rs +++ b/crates/freeze/src/datasets/geth_opcodes.rs @@ -1,5 +1,7 @@ use crate::*; -use ethers::prelude::*; +use alloy::rpc::types::trace::geth::{ + DefaultFrame, GethDebugTracingOptions, GethDefaultTracingOptions, +}; use polars::prelude::*; /// columns for geth traces @@ -40,13 +42,21 @@ impl CollectByBlock for GethOpcodes { async fn extract(request: Params, source: Arc, query: Arc) -> R { let schema = query.schemas.get_schema(&Datatype::GethOpcodes)?; - let options = GethDebugTracingOptions { + // let options = GethDebugTracingOptions { + // disable_storage: Some(!schema.has_column("storage")), + // disable_stack: Some(!schema.has_column("stack")), + // enable_memory: Some(schema.has_column("memory")), + // enable_return_data: Some(schema.has_column("return_data")), + // ..Default::default() + // }; + let config = GethDefaultTracingOptions { disable_storage: Some(!schema.has_column("storage")), disable_stack: Some(!schema.has_column("stack")), enable_memory: Some(schema.has_column("memory")), enable_return_data: Some(schema.has_column("return_data")), ..Default::default() }; + let options = GethDebugTracingOptions { config, ..Default::default() }; let include_transaction = schema.has_column("block_number"); let block_number = request.block_number()? as u32; source.geth_debug_trace_block_opcodes(block_number, include_transaction, options).await @@ -63,14 +73,15 @@ impl CollectByTransaction for GethOpcodes { async fn extract(request: Params, source: Arc, query: Arc) -> R { let schema = query.schemas.get_schema(&Datatype::GethOpcodes)?; - let options = GethDebugTracingOptions { + let include_block_number = schema.has_column("block_number"); + let config = GethDefaultTracingOptions { disable_storage: Some(!schema.has_column("storage")), disable_stack: Some(!schema.has_column("stack")), enable_memory: Some(schema.has_column("memory")), enable_return_data: Some(schema.has_column("return_data")), ..Default::default() }; - let include_block_number = schema.has_column("block_number"); + let options = GethDebugTracingOptions { config, ..Default::default() }; source .geth_debug_trace_transaction_opcodes( request.transaction_hash()?, diff --git a/crates/freeze/src/datasets/logs.rs b/crates/freeze/src/datasets/logs.rs index ca34c54..01313f6 100644 --- a/crates/freeze/src/datasets/logs.rs +++ b/crates/freeze/src/datasets/logs.rs @@ -1,5 +1,8 @@ use crate::*; -use ethers::prelude::*; +use alloy::{ + dyn_abi::{DynSolType, DynSolValue, EventExt}, + rpc::types::Log, +}; use polars::prelude::*; /// columns for transactions @@ -19,7 +22,7 @@ pub struct Logs { topic3: Vec>>, data: Vec>, n_data_bytes: Vec, - event_cols: indexmap::IndexMap>, + event_cols: indexmap::IndexMap>, chain_id: Vec, } @@ -91,17 +94,37 @@ impl CollectByTransaction for Logs { /// process block into columns fn process_logs(logs: Vec, columns: &mut Logs, schema: &Table) -> R<()> { - let decode_keys = match &schema.log_decoder { - None => None, + // let decode_keys = match &schema.log_decoder { + // None => None, + // Some(decoder) => { + // let keys = decoder + // .event + // .inputs + // .clone() + // .into_iter() + // .map(|i| i.name) + // .collect::>(); + // Some(keys) + // } + // }; + let (indexed_keys, body_keys) = match &schema.log_decoder { + None => (None, None), Some(decoder) => { - let keys = decoder + let indexed: Vec = decoder .event .inputs .clone() .into_iter() - .map(|i| i.name) - .collect::>(); - Some(keys) + .filter_map(|x| if x.indexed { Some(x.name) } else { None }) + .collect(); + let body: Vec = decoder + .event + .inputs + .clone() + .into_iter() + .filter_map(|x| if x.indexed { None } else { Some(x.name) }) + .collect(); + (Some(indexed), Some(body)) } }; @@ -110,13 +133,29 @@ fn process_logs(logs: Vec, columns: &mut Logs, schema: &Table) -> R<()> { (log.block_number, log.transaction_hash, log.transaction_index, log.log_index) { // decode event - if let (Some(decoder), Some(decode_keys)) = (&schema.log_decoder, &decode_keys) { - match decoder.event.parse_log(log.clone().into()) { + if let (Some(decoder), Some(indexed_keys), Some(body_keys)) = + (&schema.log_decoder, &indexed_keys, &body_keys) + { + match decoder.event.decode_log(&log.inner.data, true) { Ok(log) => { - for param in log.params { - if decode_keys.contains(param.name.as_str()) { - columns.event_cols.entry(param.name).or_default().push(param.value); - } + // for param in log.indexed { + // if decode_keys.contains(param.name.as_str()) { + // columns.event_cols.entry(param.name).or_default().push(param. + // value); } + // } + for (idx, indexed_param) in log.indexed.into_iter().enumerate() { + columns + .event_cols + .entry(indexed_keys[idx].clone()) + .or_default() + .push(indexed_param); + } + for (idx, body_param) in log.body.into_iter().enumerate() { + columns + .event_cols + .entry(body_keys[idx].clone()) + .or_default() + .push(body_param); } } Err(_) => continue, @@ -124,22 +163,19 @@ fn process_logs(logs: Vec, columns: &mut Logs, schema: &Table) -> R<()> { }; columns.n_rows += 1; - store!(schema, columns, block_number, bn.as_u32()); - store!(schema, columns, block_hash, log.block_hash.map(|bh| bh.as_bytes().to_vec())); - store!(schema, columns, transaction_index, ti.as_u32()); - store!(schema, columns, log_index, li.as_u32()); - store!(schema, columns, transaction_hash, tx.as_bytes().to_vec()); - store!(schema, columns, address, log.address.as_bytes().to_vec()); - store!(schema, columns, data, log.data.to_vec()); - store!(schema, columns, n_data_bytes, log.data.len() as u32); + store!(schema, columns, block_number, bn as u32); + store!(schema, columns, block_hash, log.block_hash.map(|bh| bh.to_vec())); + store!(schema, columns, transaction_index, ti as u32); + store!(schema, columns, log_index, li as u32); + store!(schema, columns, transaction_hash, tx.to_vec()); + store!(schema, columns, address, log.address().to_vec()); + store!(schema, columns, data, log.data().data.to_vec()); + store!(schema, columns, n_data_bytes, log.data().data.len() as u32); // topics for i in 0..4 { - let topic = if i < log.topics.len() { - Some(log.topics[i].as_bytes().to_vec()) - } else { - None - }; + let topic = + if i < log.topics().len() { Some(log.topics()[i].to_vec()) } else { None }; match i { 0 => store!(schema, columns, topic0, topic), 1 => store!(schema, columns, topic1, topic), diff --git a/crates/freeze/src/datasets/native_transfers.rs b/crates/freeze/src/datasets/native_transfers.rs index c8fde7e..a8f2704 100644 --- a/crates/freeze/src/datasets/native_transfers.rs +++ b/crates/freeze/src/datasets/native_transfers.rs @@ -1,5 +1,8 @@ use crate::*; -use ethers::prelude::*; +use alloy::{ + primitives::U256, + rpc::types::trace::parity::{Action, LocalizedTransactionTrace, TraceOutput}, +}; use polars::prelude::*; /// columns for transactions @@ -27,10 +30,10 @@ impl Dataset for NativeTransfers { #[async_trait::async_trait] impl CollectByBlock for NativeTransfers { - type Response = Vec; + type Response = Vec; async fn extract(request: Params, source: Arc, _: Arc) -> R { - let traces = source.trace_block(request.block_number()?.into()).await?; + let traces = source.trace_block(request.block_number()?).await?; Ok(filter_traces_by_from_to_addresses(traces, &request.from_address, &request.to_address)) } @@ -43,7 +46,7 @@ impl CollectByBlock for NativeTransfers { #[async_trait::async_trait] impl CollectByTransaction for NativeTransfers { - type Response = Vec; + type Response = Vec; async fn extract(request: Params, source: Arc, _: Arc) -> R { let traces = source.trace_transaction(request.ethers_transaction_hash()?).await?; @@ -59,48 +62,43 @@ impl CollectByTransaction for NativeTransfers { /// process block into columns pub(crate) fn process_native_transfers( - traces: &[Trace], + traces: &[LocalizedTransactionTrace], columns: &mut NativeTransfers, schemas: &Schemas, ) -> R<()> { let schema = schemas.get(&Datatype::NativeTransfers).ok_or(err("schema not provided"))?; for (transfer_index, trace) in traces.iter().enumerate() { columns.n_rows += 1; - store!(schema, columns, block_number, trace.block_number as u32); + store!(schema, columns, block_number, trace.block_number.unwrap_or(0) as u32); store!(schema, columns, transaction_index, trace.transaction_position.map(|x| x as u32)); - store!(schema, columns, block_hash, trace.block_hash.as_bytes().to_vec()); + store!(schema, columns, block_hash, trace.block_hash.unwrap().to_vec()); store!(schema, columns, transfer_index, transfer_index as u32); - store!( - schema, - columns, - transaction_hash, - trace.transaction_hash.map(|x| x.as_bytes().to_vec()) - ); + store!(schema, columns, transaction_hash, trace.transaction_hash.map(|x| x.to_vec())); - match &trace.action { + match &trace.trace.action { Action::Call(action) => { - store!(schema, columns, from_address, action.from.as_bytes().to_vec()); - store!(schema, columns, to_address, action.to.as_bytes().to_vec()); + store!(schema, columns, from_address, action.from.to_vec()); + store!(schema, columns, to_address, action.to.to_vec()); store!(schema, columns, value, action.value); } Action::Create(action) => { - store!(schema, columns, from_address, action.from.as_bytes().to_vec()); - match &trace.result.as_ref() { - Some(Res::Create(res)) => { - store!(schema, columns, to_address, res.address.0.into()) + store!(schema, columns, from_address, action.from.to_vec()); + match &trace.trace.result.as_ref() { + Some(TraceOutput::Create(res)) => { + store!(schema, columns, to_address, res.address.0.to_vec()) } _ => store!(schema, columns, to_address, vec![0; 32]), } store!(schema, columns, value, action.value); } - Action::Suicide(action) => { - store!(schema, columns, from_address, action.address.as_bytes().to_vec()); - store!(schema, columns, to_address, action.refund_address.as_bytes().to_vec()); + Action::Selfdestruct(action) => { + store!(schema, columns, from_address, action.address.to_vec()); + store!(schema, columns, to_address, action.refund_address.to_vec()); store!(schema, columns, value, action.balance); } Action::Reward(action) => { store!(schema, columns, from_address, vec![0; 20]); - store!(schema, columns, to_address, action.author.as_bytes().to_vec()); + store!(schema, columns, to_address, action.author.to_vec()); store!(schema, columns, value, action.value); } } diff --git a/crates/freeze/src/datasets/nonce_diffs.rs b/crates/freeze/src/datasets/nonce_diffs.rs index ac863f2..c17e7f7 100644 --- a/crates/freeze/src/datasets/nonce_diffs.rs +++ b/crates/freeze/src/datasets/nonce_diffs.rs @@ -1,5 +1,8 @@ use crate::*; -use ethers::prelude::*; +use alloy::{ + primitives::{Address, U64}, + rpc::types::trace::parity::{ChangedType, Delta, TraceResults}, +}; use polars::prelude::*; /// columns for transactions @@ -19,7 +22,7 @@ pub struct NonceDiffs { #[async_trait::async_trait] impl Dataset for NonceDiffs {} -type BlockTxsTraces = (Option, Vec>>, Vec); +type BlockTxsTraces = (Option, Vec>>, Vec); #[async_trait::async_trait] impl CollectByBlock for NonceDiffs { @@ -28,7 +31,9 @@ impl CollectByBlock for NonceDiffs { async fn extract(request: Params, source: Arc, query: Arc) -> R { let schema = query.schemas.get_schema(&Datatype::NonceDiffs)?; let include_txs = schema.has_column("transaction_hash"); - source.trace_block_state_diffs(request.block_number()? as u32, include_txs).await + let (block_number, txs, traces) = + source.trace_block_state_diffs(request.block_number()? as u32, include_txs).await?; + Ok((block_number, txs, traces.into_iter().map(|t| t.full_trace).collect())) } fn transform(response: Self::Response, columns: &mut Self, query: &Arc) -> R<()> { @@ -57,7 +62,7 @@ pub(crate) fn process_nonce_diffs( let schema = schemas.get(&Datatype::NonceDiffs).ok_or(err("schema not provided"))?; let (block_number, txs, traces) = response; for (index, (trace, tx)) in traces.iter().zip(txs).enumerate() { - if let Some(ethers::types::StateDiff(state_diffs)) = &trace.state_diff { + if let Some(state_diffs) = &trace.state_diff { for (addr, diff) in state_diffs.iter() { process_nonce_diff(addr, &diff.nonce, block_number, tx, index, columns, schema); } @@ -67,8 +72,8 @@ pub(crate) fn process_nonce_diffs( } pub(crate) fn process_nonce_diff( - addr: &H160, - diff: &Diff, + addr: &Address, + diff: &Delta, block_number: &Option, transaction_hash: &Option>, transaction_index: usize, @@ -76,16 +81,16 @@ pub(crate) fn process_nonce_diff( schema: &Table, ) { let (from, to) = match diff { - Diff::Same => return, - Diff::Born(value) => (U256::zero(), *value), - Diff::Died(value) => (*value, U256::zero()), - Diff::Changed(ChangedType { from, to }) => (*from, *to), + Delta::Unchanged => return, + Delta::Added(value) => (U64::ZERO, *value), + Delta::Removed(value) => (*value, U64::ZERO), + Delta::Changed(ChangedType { from, to }) => (*from, *to), }; columns.n_rows += 1; store!(schema, columns, block_number, *block_number); store!(schema, columns, transaction_index, Some(transaction_index as u32)); store!(schema, columns, transaction_hash, transaction_hash.clone()); - store!(schema, columns, address, addr.as_bytes().to_vec()); - store!(schema, columns, from_value, from.as_u64()); - store!(schema, columns, to_value, to.as_u64()); + store!(schema, columns, address, addr.to_vec()); + store!(schema, columns, from_value, from.wrapping_to::()); + store!(schema, columns, to_value, to.wrapping_to::()); } diff --git a/crates/freeze/src/datasets/nonce_reads.rs b/crates/freeze/src/datasets/nonce_reads.rs index fdc8d89..052c2eb 100644 --- a/crates/freeze/src/datasets/nonce_reads.rs +++ b/crates/freeze/src/datasets/nonce_reads.rs @@ -1,5 +1,5 @@ use crate::*; -use ethers::prelude::*; +use alloy::{primitives::Address, rpc::types::trace::geth::AccountState}; use polars::prelude::*; use std::collections::BTreeMap; @@ -19,7 +19,7 @@ pub struct NonceReads { #[async_trait::async_trait] impl Dataset for NonceReads {} -type BlockTxsTraces = (Option, Vec>>, Vec>); +type BlockTxsTraces = (Option, Vec>>, Vec>); #[async_trait::async_trait] impl CollectByBlock for NonceReads { @@ -68,7 +68,7 @@ pub(crate) fn process_nonce_reads( } pub(crate) fn process_nonce_read( - addr: &H160, + addr: &Address, account_state: &AccountState, block_number: &Option, transaction_hash: &Option>, @@ -81,7 +81,7 @@ pub(crate) fn process_nonce_read( store!(schema, columns, block_number, *block_number); store!(schema, columns, transaction_index, Some(transaction_index as u32)); store!(schema, columns, transaction_hash, transaction_hash.clone()); - store!(schema, columns, address, addr.as_bytes().to_vec()); - store!(schema, columns, nonce, nonce.as_u64()); + store!(schema, columns, address, addr.to_vec()); + store!(schema, columns, nonce, *nonce); } } diff --git a/crates/freeze/src/datasets/nonces.rs b/crates/freeze/src/datasets/nonces.rs index 2948d1b..e44c904 100644 --- a/crates/freeze/src/datasets/nonces.rs +++ b/crates/freeze/src/datasets/nonces.rs @@ -1,5 +1,5 @@ use crate::*; -use ethers::prelude::*; +use alloy::primitives::Address; use polars::prelude::*; /// columns for balances @@ -37,9 +37,10 @@ impl CollectByBlock for Nonces { async fn extract(request: Params, source: Arc, _: Arc) -> R { let address = request.address()?; let block_number = request.block_number()? as u32; - let output = - source.get_transaction_count(H160::from_slice(&address), block_number.into()).await?; - Ok((block_number, None, address, output.as_u64())) + let output = source + .get_transaction_count(Address::from_slice(&address), block_number.into()) + .await?; + Ok((block_number, None, address, output)) } fn transform(response: Self::Response, columns: &mut Self, query: &Arc) -> R<()> { diff --git a/crates/freeze/src/datasets/slots.rs b/crates/freeze/src/datasets/slots.rs index 1641e44..14f292a 100644 --- a/crates/freeze/src/datasets/slots.rs +++ b/crates/freeze/src/datasets/slots.rs @@ -1,5 +1,5 @@ use crate::*; -use ethers::prelude::*; +use alloy::primitives::{Address, U256}; use polars::prelude::*; /// columns for balances @@ -49,12 +49,12 @@ impl CollectByBlock for Slots { let slot = request.slot()?; let output = source .get_storage_at( - H160::from_slice(&address), - H256::from_slice(&slot), + Address::from_slice(&address), + U256::from_be_slice(&slot), block_number.into(), ) .await?; - Ok((block_number, None, address, slot, output.as_bytes().to_vec())) + Ok((block_number, None, address, slot, output.to_vec_u8())) } fn transform(response: Self::Response, columns: &mut Self, query: &Arc) -> R<()> { diff --git a/crates/freeze/src/datasets/storage_diffs.rs b/crates/freeze/src/datasets/storage_diffs.rs index 3f1cb18..b4ebfff 100644 --- a/crates/freeze/src/datasets/storage_diffs.rs +++ b/crates/freeze/src/datasets/storage_diffs.rs @@ -1,5 +1,8 @@ use crate::*; -use ethers::prelude::*; +use alloy::{ + primitives::{Address, B256}, + rpc::types::trace::parity::{ChangedType, Delta, TraceResults}, +}; use polars::prelude::*; /// columns for transactions @@ -24,7 +27,7 @@ impl Dataset for StorageDiffs { } } -type BlockTxsTraces = (Option, Vec>>, Vec); +type BlockTxsTraces = (Option, Vec>>, Vec); #[async_trait::async_trait] impl CollectByBlock for StorageDiffs { @@ -33,7 +36,10 @@ impl CollectByBlock for StorageDiffs { async fn extract(request: Params, source: Arc, query: Arc) -> R { let schema = query.schemas.get_schema(&Datatype::StorageDiffs)?; let include_txs = schema.has_column("transaction_hash"); - source.trace_block_state_diffs(request.block_number()? as u32, include_txs).await + let (bn, txs, traces) = + source.trace_block_state_diffs(request.block_number()? as u32, include_txs).await?; + let trace_results: Vec = traces.into_iter().map(|t| t.full_trace).collect(); + Ok((bn, txs, trace_results)) } fn transform(response: Self::Response, columns: &mut Self, query: &Arc) -> R<()> { @@ -62,7 +68,7 @@ pub(crate) fn process_storage_diffs( let schema = schemas.get(&Datatype::StorageDiffs).ok_or(err("schema not provided"))?; let (block_number, txs, traces) = response; for (index, (trace, tx)) in traces.iter().zip(txs).enumerate() { - if let Some(ethers::types::StateDiff(state_diffs)) = &trace.state_diff { + if let Some(state_diffs) = &trace.state_diff { for (addr, diff) in state_diffs.iter() { process_storage_diff(addr, &diff.storage, block_number, tx, index, columns, schema); } @@ -72,8 +78,8 @@ pub(crate) fn process_storage_diffs( } pub(crate) fn process_storage_diff( - addr: &H160, - diff: &std::collections::BTreeMap>, + addr: &Address, + diff: &std::collections::BTreeMap>, block_number: &Option, transaction_hash: &Option>, transaction_index: usize, @@ -82,18 +88,18 @@ pub(crate) fn process_storage_diff( ) { for (s, sub_diff) in diff.iter() { let (from, to) = match sub_diff { - Diff::Same => continue, - Diff::Born(value) => (H256::zero(), *value), - Diff::Died(value) => (*value, H256::zero()), - Diff::Changed(ChangedType { from, to }) => (*from, *to), + Delta::Unchanged => continue, + Delta::Added(value) => (B256::ZERO, *value), + Delta::Removed(value) => (*value, B256::ZERO), + Delta::Changed(ChangedType { from, to }) => (*from, *to), }; columns.n_rows += 1; store!(schema, columns, block_number, *block_number); store!(schema, columns, transaction_index, Some(transaction_index as u32)); store!(schema, columns, transaction_hash, transaction_hash.clone()); - store!(schema, columns, slot, s.as_bytes().to_vec()); - store!(schema, columns, address, addr.as_bytes().to_vec()); - store!(schema, columns, from_value, from.as_bytes().to_vec()); - store!(schema, columns, to_value, to.as_bytes().to_vec()); + store!(schema, columns, slot, s.to_vec()); + store!(schema, columns, address, addr.to_vec()); + store!(schema, columns, from_value, from.to_vec()); + store!(schema, columns, to_value, to.to_vec()); } } diff --git a/crates/freeze/src/datasets/storage_reads.rs b/crates/freeze/src/datasets/storage_reads.rs index 874919a..d276956 100644 --- a/crates/freeze/src/datasets/storage_reads.rs +++ b/crates/freeze/src/datasets/storage_reads.rs @@ -1,5 +1,5 @@ use crate::*; -use ethers::prelude::*; +use alloy::{primitives::Address, rpc::types::trace::geth::AccountState}; use polars::prelude::*; use std::collections::BTreeMap; @@ -24,7 +24,7 @@ impl Dataset for StorageReads { } } -type BlockTxsTraces = (Option, Vec>>, Vec>); +type BlockTxsTraces = (Option, Vec>>, Vec>); #[async_trait::async_trait] impl CollectByBlock for StorageReads { @@ -75,7 +75,7 @@ pub(crate) fn process_storage_reads( } pub(crate) fn process_storage_read( - addr: &H160, + addr: &Address, account_state: &AccountState, block_number: &Option, transaction_hash: &Option>, @@ -83,15 +83,13 @@ pub(crate) fn process_storage_read( columns: &mut StorageReads, schema: &Table, ) { - if let Some(storage) = &account_state.storage { - for (slot, value) in storage.iter() { - columns.n_rows += 1; - store!(schema, columns, block_number, *block_number); - store!(schema, columns, transaction_index, Some(transaction_index as u32)); - store!(schema, columns, transaction_hash, transaction_hash.clone()); - store!(schema, columns, contract_address, addr.as_bytes().to_vec()); - store!(schema, columns, slot, slot.as_bytes().to_vec()); - store!(schema, columns, value, value.as_bytes().to_vec()); - } + for (slot, value) in account_state.storage.iter() { + columns.n_rows += 1; + store!(schema, columns, block_number, *block_number); + store!(schema, columns, transaction_index, Some(transaction_index as u32)); + store!(schema, columns, transaction_hash, transaction_hash.clone()); + store!(schema, columns, contract_address, addr.to_vec()); + store!(schema, columns, slot, slot.to_vec()); + store!(schema, columns, value, value.to_vec()); } } diff --git a/crates/freeze/src/datasets/trace_calls.rs b/crates/freeze/src/datasets/trace_calls.rs index 5af951e..c77f4ad 100644 --- a/crates/freeze/src/datasets/trace_calls.rs +++ b/crates/freeze/src/datasets/trace_calls.rs @@ -1,6 +1,6 @@ use super::traces; use crate::*; -use ethers::prelude::*; +use alloy::rpc::types::trace::parity::{Action, TraceOutput, TraceType, TransactionTrace}; use polars::prelude::*; /// columns for transactions @@ -58,8 +58,7 @@ impl CollectByBlock for TraceCalls { Some(request.ethers_block_number()?), ) .await? - .trace - .ok_or(CollectError::CollectError("traces missing".to_string()))?; + .trace; Ok((request.block_number()? as u32, request.contract()?, request.call_data()?, traces)) } @@ -85,7 +84,7 @@ fn process_transaction_traces( process_action(&trace.action, columns, schema); process_result(&trace.result, columns, schema); - store!(schema, columns, action_type, traces::action_type_to_string(&trace.action_type)); + store!(schema, columns, action_type, traces::action_type_to_string(&trace.action.kind())); store!( schema, columns, @@ -104,10 +103,10 @@ fn process_transaction_traces( fn process_action(action: &Action, columns: &mut TraceCalls, schema: &Table) { match action { Action::Call(action) => { - store!(schema, columns, action_from, Some(action.from.as_bytes().to_vec())); - store!(schema, columns, action_to, Some(action.to.as_bytes().to_vec())); + store!(schema, columns, action_from, Some(action.from.to_vec())); + store!(schema, columns, action_to, Some(action.to.to_vec())); store!(schema, columns, action_value, action.value.to_string()); - store!(schema, columns, action_gas, Some(action.gas.as_u32())); + store!(schema, columns, action_gas, Some(action.gas as u32)); store!(schema, columns, action_input, Some(action.input.to_vec())); store!( schema, @@ -119,18 +118,18 @@ fn process_action(action: &Action, columns: &mut TraceCalls, schema: &Table) { store!(schema, columns, action_reward_type, None); } Action::Create(action) => { - store!(schema, columns, action_from, Some(action.from.as_bytes().to_vec())); + store!(schema, columns, action_from, Some(action.from.to_vec())); store!(schema, columns, action_to, None); store!(schema, columns, action_value, action.value.to_string()); - store!(schema, columns, action_gas, Some(action.gas.as_u32())); + store!(schema, columns, action_gas, Some(action.gas as u32)); store!(schema, columns, action_input, None); store!(schema, columns, action_call_type, None); store!(schema, columns, action_init, Some(action.init.to_vec())); store!(schema, columns, action_reward_type, None); } - Action::Suicide(action) => { - store!(schema, columns, action_from, Some(action.address.as_bytes().to_vec())); - store!(schema, columns, action_to, Some(action.refund_address.as_bytes().to_vec())); + Action::Selfdestruct(action) => { + store!(schema, columns, action_from, Some(action.address.to_vec())); + store!(schema, columns, action_to, Some(action.refund_address.to_vec())); store!(schema, columns, action_value, action.balance.to_string()); store!(schema, columns, action_gas, None); store!(schema, columns, action_input, None); @@ -139,7 +138,7 @@ fn process_action(action: &Action, columns: &mut TraceCalls, schema: &Table) { store!(schema, columns, action_reward_type, None); } Action::Reward(action) => { - store!(schema, columns, action_from, Some(action.author.as_bytes().to_vec())); + store!(schema, columns, action_from, Some(action.author.to_vec())); store!(schema, columns, action_to, None); store!(schema, columns, action_value, action.value.to_string()); store!(schema, columns, action_gas, None); @@ -156,21 +155,21 @@ fn process_action(action: &Action, columns: &mut TraceCalls, schema: &Table) { } } -fn process_result(result: &Option, columns: &mut TraceCalls, schema: &Table) { +fn process_result(result: &Option, columns: &mut TraceCalls, schema: &Table) { match result { - Some(Res::Call(result)) => { - store!(schema, columns, result_gas_used, Some(result.gas_used.as_u32())); + Some(TraceOutput::Call(result)) => { + store!(schema, columns, result_gas_used, Some(result.gas_used as u32)); store!(schema, columns, result_output, Some(result.output.to_vec())); store!(schema, columns, result_code, None); store!(schema, columns, result_address, None); } - Some(Res::Create(result)) => { - store!(schema, columns, result_gas_used, Some(result.gas_used.as_u32())); + Some(TraceOutput::Create(result)) => { + store!(schema, columns, result_gas_used, Some(result.gas_used as u32)); store!(schema, columns, result_output, None); store!(schema, columns, result_code, Some(result.code.to_vec())); - store!(schema, columns, result_address, Some(result.address.as_bytes().to_vec())); + store!(schema, columns, result_address, Some(result.address.to_vec())); } - Some(Res::None) | None => { + None => { store!(schema, columns, result_gas_used, None); store!(schema, columns, result_output, None); store!(schema, columns, result_code, None); diff --git a/crates/freeze/src/datasets/traces.rs b/crates/freeze/src/datasets/traces.rs index 2ce7dd4..5bde18f 100644 --- a/crates/freeze/src/datasets/traces.rs +++ b/crates/freeze/src/datasets/traces.rs @@ -1,5 +1,10 @@ use crate::*; -use ethers::prelude::*; +use alloy::{ + primitives::Address, + rpc::types::trace::parity::{ + Action, ActionType, CallType, LocalizedTransactionTrace, RewardType, TraceOutput, + }, +}; use polars::prelude::*; /// columns for transactions @@ -39,10 +44,10 @@ impl Dataset for Traces { #[async_trait::async_trait] impl CollectByBlock for Traces { - type Response = Vec; + type Response = Vec; async fn extract(request: Params, source: Arc, _: Arc) -> R { - let traces = source.trace_block(request.block_number()?.into()).await?; + let traces = source.trace_block(request.block_number()?).await?; Ok(filter_traces_by_from_to_addresses(traces, &request.from_address, &request.to_address)) } @@ -55,7 +60,7 @@ impl CollectByBlock for Traces { #[async_trait::async_trait] impl CollectByTransaction for Traces { - type Response = Vec; + type Response = Vec; async fn extract(request: Params, source: Arc, _: Arc) -> R { let traces = source.trace_transaction(request.ethers_transaction_hash()?).await?; @@ -70,66 +75,73 @@ impl CollectByTransaction for Traces { } pub(crate) fn filter_traces_by_from_to_addresses( - traces: Vec, + traces: Vec, from_address: &Option>, to_address: &Option>, -) -> Vec { +) -> Vec { // filter by from_address - let from_filter: Box bool + Send> = if let Some(from_address) = from_address { - Box::new(move |trace| { - let from = match &trace.action { - Action::Call(action) => action.from, - Action::Create(action) => action.from, - Action::Suicide(action) => action.address, - _ => return false, - }; - from.as_bytes() == from_address - }) - } else { - Box::new(|_| true) - }; + let from_filter: Box bool + Send> = + if let Some(from_address) = from_address { + Box::new(move |trace| { + let from = match &trace.trace.action { + Action::Call(action) => action.from, + Action::Create(action) => action.from, + Action::Selfdestruct(action) => action.address, + _ => return false, + }; + from == Address::from_slice(from_address) + }) + } else { + Box::new(|_| true) + }; // filter by to_address - let to_filter: Box bool + Send> = if let Some(to_address) = to_address { - Box::new(move |trace| { - let to = match &trace.action { - Action::Call(action) => action.to, - Action::Suicide(action) => action.refund_address, - Action::Reward(action) => action.author, - _ => return false, - }; - to.as_bytes() == to_address - }) - } else { - Box::new(|_| true) - }; + let to_filter: Box bool + Send> = + if let Some(to_address) = to_address { + Box::new(move |trace| { + let to = match &trace.trace.action { + Action::Call(action) => action.to, + Action::Selfdestruct(action) => action.refund_address, + Action::Reward(action) => action.author, + _ => return false, + }; + to == Address::from_slice(to_address) + }) + } else { + Box::new(|_| true) + }; traces.into_iter().filter(from_filter).filter(to_filter).collect() } /// process block into columns -pub(crate) fn process_traces(traces: &[Trace], columns: &mut Traces, schemas: &Schemas) -> R<()> { +pub(crate) fn process_traces( + traces: &[LocalizedTransactionTrace], + columns: &mut Traces, + schemas: &Schemas, +) -> R<()> { let schema = schemas.get(&Datatype::Traces).ok_or(err("schema not provided"))?; for trace in traces.iter() { columns.n_rows += 1; - process_action(&trace.action, columns, schema); - process_result(&trace.result, columns, schema); - store!(schema, columns, action_type, action_type_to_string(&trace.action_type)); + process_action(&trace.trace.action, columns, schema); + process_result(&trace.trace.result, columns, schema); + store!(schema, columns, action_type, action_type_to_string(&trace.trace.action.kind())); store!( schema, columns, trace_address, - trace.trace_address.iter().map(|n| n.to_string()).collect::>().join("_") + trace + .trace + .trace_address + .iter() + .map(|n| n.to_string()) + .collect::>() + .join("_") ); - store!(schema, columns, subtraces, trace.subtraces as u32); + store!(schema, columns, subtraces, trace.trace.subtraces as u32); store!(schema, columns, transaction_index, trace.transaction_position.map(|x| x as u32)); - store!( - schema, - columns, - transaction_hash, - trace.transaction_hash.map(|x| x.as_bytes().to_vec()) - ); - store!(schema, columns, block_number, trace.block_number as u32); - store!(schema, columns, block_hash, trace.block_hash.as_bytes().to_vec()); - store!(schema, columns, error, trace.error.clone()); + store!(schema, columns, transaction_hash, trace.transaction_hash.map(|x| x.to_vec())); + store!(schema, columns, block_number, trace.block_number.unwrap() as u32); + store!(schema, columns, block_hash, trace.block_hash.unwrap().to_vec()); + store!(schema, columns, error, trace.trace.error.clone()); } Ok(()) } @@ -137,10 +149,10 @@ pub(crate) fn process_traces(traces: &[Trace], columns: &mut Traces, schemas: &S fn process_action(action: &Action, columns: &mut Traces, schema: &Table) { match action { Action::Call(action) => { - store!(schema, columns, action_from, Some(action.from.as_bytes().to_vec())); - store!(schema, columns, action_to, Some(action.to.as_bytes().to_vec())); + store!(schema, columns, action_from, Some(action.from.to_vec())); + store!(schema, columns, action_to, Some(action.to.to_vec())); store!(schema, columns, action_value, action.value.to_string()); - store!(schema, columns, action_gas, Some(action.gas.as_u32())); + store!(schema, columns, action_gas, Some(action.gas as u32)); store!(schema, columns, action_input, Some(action.input.to_vec())); store!( schema, @@ -152,18 +164,18 @@ fn process_action(action: &Action, columns: &mut Traces, schema: &Table) { store!(schema, columns, action_reward_type, None); } Action::Create(action) => { - store!(schema, columns, action_from, Some(action.from.as_bytes().to_vec())); + store!(schema, columns, action_from, Some(action.from.to_vec())); store!(schema, columns, action_to, None); store!(schema, columns, action_value, action.value.to_string()); - store!(schema, columns, action_gas, Some(action.gas.as_u32())); + store!(schema, columns, action_gas, Some(action.gas as u32)); store!(schema, columns, action_input, None); store!(schema, columns, action_call_type, None); store!(schema, columns, action_init, Some(action.init.to_vec())); store!(schema, columns, action_reward_type, None); } - Action::Suicide(action) => { - store!(schema, columns, action_from, Some(action.address.as_bytes().to_vec())); - store!(schema, columns, action_to, Some(action.refund_address.as_bytes().to_vec())); + Action::Selfdestruct(action) => { + store!(schema, columns, action_from, Some(action.address.to_vec())); + store!(schema, columns, action_to, Some(action.refund_address.to_vec())); store!(schema, columns, action_value, action.balance.to_string()); store!(schema, columns, action_gas, None); store!(schema, columns, action_input, None); @@ -172,7 +184,7 @@ fn process_action(action: &Action, columns: &mut Traces, schema: &Table) { store!(schema, columns, action_reward_type, None); } Action::Reward(action) => { - store!(schema, columns, action_from, Some(action.author.as_bytes().to_vec())); + store!(schema, columns, action_from, Some(action.author.to_vec())); store!(schema, columns, action_to, None); store!(schema, columns, action_value, action.value.to_string()); store!(schema, columns, action_gas, None); @@ -189,21 +201,21 @@ fn process_action(action: &Action, columns: &mut Traces, schema: &Table) { } } -fn process_result(result: &Option, columns: &mut Traces, schema: &Table) { +fn process_result(result: &Option, columns: &mut Traces, schema: &Table) { match result { - Some(Res::Call(result)) => { - store!(schema, columns, result_gas_used, Some(result.gas_used.as_u32())); + Some(TraceOutput::Call(result)) => { + store!(schema, columns, result_gas_used, Some(result.gas_used as u32)); store!(schema, columns, result_output, Some(result.output.to_vec())); store!(schema, columns, result_code, None); store!(schema, columns, result_address, None); } - Some(Res::Create(result)) => { - store!(schema, columns, result_gas_used, Some(result.gas_used.as_u32())); + Some(TraceOutput::Create(result)) => { + store!(schema, columns, result_gas_used, Some(result.gas_used as u32)); store!(schema, columns, result_output, None); store!(schema, columns, result_code, Some(result.code.to_vec())); - store!(schema, columns, result_address, Some(result.address.as_bytes().to_vec())); + store!(schema, columns, result_address, Some(result.address.to_vec())); } - Some(Res::None) | None => { + None => { store!(schema, columns, result_gas_used, None); store!(schema, columns, result_output, None); store!(schema, columns, result_code, None); @@ -216,8 +228,9 @@ pub(crate) fn reward_type_to_string(reward_type: &RewardType) -> String { match reward_type { RewardType::Block => "reward".to_string(), RewardType::Uncle => "uncle".to_string(), - RewardType::EmptyStep => "empty_step".to_string(), - RewardType::External => "external".to_string(), + // below arms not exist in alloy + // RewardType::EmptyStep => "empty_step".to_string(), + // RewardType::External => "external".to_string(), } } @@ -226,7 +239,7 @@ pub(crate) fn action_type_to_string(action_type: &ActionType) -> String { ActionType::Call => "call".to_string(), ActionType::Create => "create".to_string(), ActionType::Reward => "reward".to_string(), - ActionType::Suicide => "suicide".to_string(), + ActionType::Selfdestruct => "suicide".to_string(), } } @@ -237,24 +250,27 @@ pub(crate) fn action_call_type_to_string(action_call_type: &CallType) -> String CallType::CallCode => "call_code".to_string(), CallType::DelegateCall => "delegate_call".to_string(), CallType::StaticCall => "static_call".to_string(), + CallType::AuthCall => "auth_call".to_string(), } } /// filter out error traces -pub(crate) fn filter_failed_traces(traces: Vec) -> Vec { +pub(crate) fn filter_failed_traces( + traces: Vec, +) -> Vec { let mut error_address: Option> = None; - let mut filtered: Vec = Vec::new(); + let mut filtered: Vec = Vec::new(); for trace in traces.into_iter() { // restart for each transaction - if trace.trace_address.is_empty() { + if trace.trace.trace_address.is_empty() { error_address = None; }; // if in an error, check if next trace is still in error if let Some(ref e_address) = error_address { - if trace.trace_address.len() >= e_address.len() && - trace.trace_address[0..e_address.len()] == e_address[..] + if trace.trace.trace_address.len() >= e_address.len() && + trace.trace.trace_address[0..e_address.len()] == e_address[..] { continue } else { @@ -263,8 +279,8 @@ pub(crate) fn filter_failed_traces(traces: Vec) -> Vec { } // check if current trace is start of an error - match trace.error { - Some(_) => error_address = Some(trace.trace_address), + match trace.trace.error { + Some(_) => error_address = Some(trace.trace.trace_address), None => filtered.push(trace), } } diff --git a/crates/freeze/src/datasets/transactions.rs b/crates/freeze/src/datasets/transactions.rs index cdb933b..0f4f95f 100644 --- a/crates/freeze/src/datasets/transactions.rs +++ b/crates/freeze/src/datasets/transactions.rs @@ -1,5 +1,11 @@ use crate::*; -use ethers::prelude::*; +use alloy::{ + consensus::Transaction as ConsensusTransaction, + primitives::{Address, TxKind, U256}, + rpc::types::{ + Block, BlockTransactions, BlockTransactionsKind, Transaction, TransactionReceipt, + }, +}; use polars::prelude::*; /// columns for transactions @@ -18,7 +24,7 @@ pub struct Transactions { gas_limit: Vec, gas_used: Vec>, gas_price: Vec>, - transaction_type: Vec>, + transaction_type: Vec, max_priority_fee_per_gas: Vec>, max_fee_per_gas: Vec>, success: Vec, @@ -31,7 +37,7 @@ pub struct Transactions { timestamp: Vec, r: Vec>, s: Vec>, - v: Vec, + v: Vec, } #[async_trait::async_trait] @@ -60,6 +66,7 @@ impl Dataset for Transactions { "n_input_bytes", "n_input_zero_bytes", "n_input_nonzero_bytes", + "n_rlp_bytes", "chain_id", ]) } @@ -74,11 +81,11 @@ pub type TransactionAndReceipt = (Transaction, Option); #[async_trait::async_trait] impl CollectByBlock for Transactions { - type Response = (Block, Vec, bool); + type Response = (Block, Vec, bool); async fn extract(request: Params, source: Arc, query: Arc) -> R { let block = source - .get_block_with_txs(request.block_number()?) + .get_block(request.block_number()?, BlockTransactionsKind::Full) .await? .ok_or(CollectError::CollectError("block not found".to_string()))?; let schema = query.schemas.get_schema(&Datatype::Transactions)?; @@ -87,19 +94,30 @@ impl CollectByBlock for Transactions { // filter by from_address let from_filter: Box bool + Send> = if let Some(from_address) = &request.from_address { - Box::new(move |tx| tx.from.as_bytes() == from_address) + Box::new(move |tx| tx.from == Address::from_slice(from_address)) } else { Box::new(|_| true) }; // filter by to_address let to_filter: Box bool + Send> = if let Some(to_address) = &request.to_address { - Box::new(move |tx| tx.to.as_ref().map_or(false, |x| x.as_bytes() == to_address)) + Box::new(move |tx| match tx.inner.kind() { + TxKind::Create => false, + TxKind::Call(address) => address == Address::from_slice(to_address), + }) } else { Box::new(|_| true) }; - let transactions = - block.transactions.clone().into_iter().filter(from_filter).filter(to_filter).collect(); + let transactions: Vec = block + .transactions + .clone() + .as_transactions() + .unwrap() + .iter() + .filter(|&x| from_filter(x)) + .filter(|&x| to_filter(x)) + .cloned() + .collect(); // 2. collect receipts if necessary // if transactions are filtered fetch by set of transaction hashes, else fetch all receipts @@ -108,7 +126,7 @@ impl CollectByBlock for Transactions { if schema.has_column("gas_used") | schema.has_column("success") { // receipts required let receipts = if request.from_address.is_some() || request.to_address.is_some() { - source.get_tx_receipts(&transactions).await? + source.get_tx_receipts(BlockTransactions::Full(transactions.clone())).await? } else { source.get_tx_receipts_in_block(&block).await? }; @@ -131,7 +149,7 @@ impl CollectByBlock for Transactions { columns, schema, exclude_failed, - block.timestamp.as_u32(), + block.header.timestamp as u32, )?; } Ok(()) @@ -146,7 +164,7 @@ impl CollectByTransaction for Transactions { let tx_hash = request.ethers_transaction_hash()?; let schema = query.schemas.get_schema(&Datatype::Transactions)?; let transaction = source - .get_transaction(tx_hash) + .get_transaction_by_hash(tx_hash) .await? .ok_or(CollectError::CollectError("transaction not found".to_string()))?; let receipt = if schema.has_column("gas_used") { @@ -160,11 +178,11 @@ impl CollectByTransaction for Transactions { .ok_or(CollectError::CollectError("no block number for tx".to_string()))?; let block = source - .get_block(block_number.as_u64()) + .get_block(block_number, BlockTransactionsKind::Hashes) .await? .ok_or(CollectError::CollectError("block not found".to_string()))?; - let timestamp = block.timestamp.as_u32(); + let timestamp = block.header.timestamp as u32; Ok(((transaction, receipt), query.exclude_failed, timestamp)) } @@ -196,55 +214,64 @@ pub(crate) fn process_transaction( }; columns.n_rows += 1; - store!(schema, columns, block_number, tx.block_number.map(|x| x.as_u32())); - store!(schema, columns, transaction_index, tx.transaction_index.map(|x| x.as_u64())); - store!(schema, columns, transaction_hash, tx.hash.as_bytes().to_vec()); - store!(schema, columns, from_address, tx.from.as_bytes().to_vec()); - store!(schema, columns, to_address, tx.to.map(|x| x.as_bytes().to_vec())); - store!(schema, columns, nonce, tx.nonce.as_u64()); - store!(schema, columns, value, tx.value); - store!(schema, columns, input, tx.input.to_vec()); - store!(schema, columns, gas_limit, tx.gas.as_u64()); + store!(schema, columns, block_number, tx.block_number.map(|x| x as u32)); + store!(schema, columns, transaction_index, tx.transaction_index); + store!(schema, columns, transaction_hash, tx.inner.tx_hash().to_vec()); + store!(schema, columns, from_address, tx.from.to_vec()); + store!( + schema, + columns, + to_address, + match tx.inner.kind() { + TxKind::Create => None, + TxKind::Call(address) => Some(address.to_vec()), + } + ); + store!(schema, columns, nonce, tx.inner.nonce()); + store!(schema, columns, value, tx.inner.value()); + store!(schema, columns, input, tx.inner.input().to_vec()); + store!(schema, columns, gas_limit, tx.inner.gas_limit()); store!(schema, columns, success, success); if schema.has_column("n_input_bytes") | schema.has_column("n_input_zero_bytes") | schema.has_column("n_input_nonzero_bytes") { - let n_input_bytes = tx.input.len() as u32; - let n_input_zero_bytes = tx.input.iter().filter(|&&x| x == 0).count() as u32; + let n_input_bytes = tx.inner.input().len() as u32; + let n_input_zero_bytes = tx.inner.input().iter().filter(|&&x| x == 0).count() as u32; store!(schema, columns, n_input_bytes, n_input_bytes); store!(schema, columns, n_input_zero_bytes, n_input_zero_bytes); store!(schema, columns, n_input_nonzero_bytes, n_input_bytes - n_input_zero_bytes); } - store!(schema, columns, n_rlp_bytes, tx.rlp().len() as u32); - store!(schema, columns, gas_used, receipt.and_then(|r| r.gas_used.map(|x| x.as_u64()))); - store!(schema, columns, gas_price, tx.gas_price.map(|gas_price| gas_price.as_u64())); - store!(schema, columns, transaction_type, tx.transaction_type.map(|value| value.as_u32())); - store!(schema, columns, max_fee_per_gas, tx.max_fee_per_gas.map(|value| value.as_u64())); + // in alloy eip2718_encoded_length is rlp_encoded_length + store!(schema, columns, n_rlp_bytes, tx.inner.eip2718_encoded_length() as u32); + store!(schema, columns, gas_used, receipt.map(|r| r.gas_used as u64)); + store!(schema, columns, gas_price, tx.inner.gas_price().map(|gas_price| gas_price as u64)); + store!(schema, columns, transaction_type, tx.inner.tx_type() as u32); + store!(schema, columns, max_fee_per_gas, Some(tx.inner.max_fee_per_gas() as u64)); store!( schema, columns, max_priority_fee_per_gas, - tx.max_priority_fee_per_gas.map(|value| value.as_u64()) + tx.inner.max_priority_fee_per_gas().map(|value| value as u64) ); store!(schema, columns, timestamp, timestamp); - store!(schema, columns, block_hash, tx.block_hash.unwrap_or_default().as_bytes().to_vec()); + store!(schema, columns, block_hash, tx.block_hash.unwrap_or_default().to_vec()); - store!(schema, columns, v, tx.v.as_u64()); - store!(schema, columns, r, tx.r.to_vec_u8()); - store!(schema, columns, s, tx.s.to_vec_u8()); + store!(schema, columns, v, tx.inner.signature().v()); + store!(schema, columns, r, tx.inner.signature().r().to_vec_u8()); + store!(schema, columns, s, tx.inner.signature().s().to_vec_u8()); Ok(()) } fn tx_success(tx: &Transaction, receipt: &Option) -> R { - if let Some(status) = receipt.as_ref().and_then(|x| x.status) { - Ok(status.as_u64() == 1) + if let Some(r) = receipt { + Ok(r.status()) } else if let (Some(1), Some(true)) = - (tx.chain_id.map(|x| x.as_u64()), tx.block_number.map(|x| x.as_u64() < 4370000)) + (tx.inner.chain_id(), tx.block_number.map(|x| x < 4370000)) { - if let Some(gas_used) = receipt.as_ref().and_then(|x| x.gas_used.map(|x| x.as_u64())) { - Ok(gas_used == 0) + if let Some(r) = receipt { + Ok(r.gas_used == 0) } else { return Err(err("could not determine status of transaction")) } diff --git a/crates/freeze/src/datasets/vm_traces.rs b/crates/freeze/src/datasets/vm_traces.rs index b06b465..1ede0df 100644 --- a/crates/freeze/src/datasets/vm_traces.rs +++ b/crates/freeze/src/datasets/vm_traces.rs @@ -1,5 +1,5 @@ use crate::*; -use ethers::prelude::*; +use alloy::rpc::types::trace::parity::{TraceResults, VmTrace}; use polars::prelude::*; /// columns for transactions @@ -17,7 +17,7 @@ pub struct VmTraces { mem_data: Vec>>, storage_key: Vec>>, storage_val: Vec>>, - op: Vec, + op: Vec>, n_rows: usize, chain_id: Vec, } @@ -39,10 +39,13 @@ impl Dataset for VmTraces { #[async_trait::async_trait] impl CollectByBlock for VmTraces { - type Response = (Option, Option>, Vec); + type Response = (Option, Option>, Vec); async fn extract(request: Params, source: Arc, _: Arc) -> R { - source.trace_block_vm_traces(request.block_number()? as u32).await + let (bn, txs, traces) = + source.trace_block_vm_traces(request.block_number()? as u32).await?; + let trace_results = traces.into_iter().map(|t| t.full_trace).collect(); + Ok((bn, txs, trace_results)) } fn transform(response: Self::Response, columns: &mut Self, query: &Arc) -> R<()> { @@ -52,7 +55,7 @@ impl CollectByBlock for VmTraces { #[async_trait::async_trait] impl CollectByTransaction for VmTraces { - type Response = (Option, Option>, Vec); + type Response = (Option, Option>, Vec); async fn extract(request: Params, source: Arc, _: Arc) -> R { source.trace_transaction_vm_traces(request.transaction_hash()?).await @@ -64,7 +67,7 @@ impl CollectByTransaction for VmTraces { } fn process_vm_traces( - response: (Option, Option>, Vec), + response: (Option, Option>, Vec), columns: &mut VmTraces, schemas: &Schemas, ) -> R<()> { @@ -79,7 +82,7 @@ fn process_vm_traces( } fn add_ops( - vm_trace: VMTrace, + vm_trace: VmTrace, schema: &Table, columns: &mut VmTraces, number: Option, @@ -120,12 +123,7 @@ fn add_ops( store!(schema, columns, storage_key, None); store!(schema, columns, storage_val, None); } - if schema.has_column("op") { - match opcode.op { - ExecutedInstruction::Known(op) => store!(schema, columns, op, op.to_string()), - ExecutedInstruction::Unknown(op) => store!(schema, columns, op, op), - } - }; + store!(schema, columns, op, opcode.op); if let Some(sub) = opcode.sub { add_ops(sub, schema, columns, number, tx_hash.clone(), tx_pos) diff --git a/crates/freeze/src/multi_datasets/blocks_and_transactions.rs b/crates/freeze/src/multi_datasets/blocks_and_transactions.rs index 1201259..4825e65 100644 --- a/crates/freeze/src/multi_datasets/blocks_and_transactions.rs +++ b/crates/freeze/src/multi_datasets/blocks_and_transactions.rs @@ -1,4 +1,5 @@ use crate::{datasets::transactions, types::collection::*, Datatype, *}; +use alloy::rpc::types::BlockTransactionsKind; use polars::prelude::*; use std::collections::HashMap; @@ -48,9 +49,9 @@ impl CollectByTransaction for BlocksAndTransactions { async fn extract(request: Params, source: Arc, query: Arc) -> R { let ((tx, receipt), exclude_failed, timestamp) = ::extract(request, source.clone(), query).await?; - let block_number = tx.block_number.ok_or(err("no block number for tx"))?.as_u64(); + let block_number = tx.block_number.ok_or(err("no block number for tx"))?; let block = source - .get_block(block_number) + .get_block(block_number, BlockTransactionsKind::Hashes) .await? .ok_or(CollectError::CollectError("block not found".to_string()))?; Ok((block, ((tx, receipt), exclude_failed, timestamp))) diff --git a/crates/freeze/src/multi_datasets/call_trace_derivatives.rs b/crates/freeze/src/multi_datasets/call_trace_derivatives.rs index 90148f2..53ad5c6 100644 --- a/crates/freeze/src/multi_datasets/call_trace_derivatives.rs +++ b/crates/freeze/src/multi_datasets/call_trace_derivatives.rs @@ -1,5 +1,5 @@ use crate::*; -use ethers::prelude::*; +use alloy::rpc::types::trace::parity::LocalizedTransactionTrace; use polars::prelude::*; use std::collections::HashMap; @@ -34,10 +34,10 @@ impl ToDataFrames for CallTraceDerivatives { #[async_trait::async_trait] impl CollectByBlock for CallTraceDerivatives { - type Response = Vec; + type Response = Vec; async fn extract(request: Params, source: Arc, _: Arc) -> R { - source.trace_block(request.block_number()?.into()).await + source.trace_block(request.block_number()?).await } fn transform(response: Self::Response, columns: &mut Self, query: &Arc) -> R<()> { @@ -49,7 +49,7 @@ impl CollectByBlock for CallTraceDerivatives { #[async_trait::async_trait] impl CollectByTransaction for CallTraceDerivatives { - type Response = Vec; + type Response = Vec; async fn extract(request: Params, source: Arc, _: Arc) -> R { source.trace_transaction(request.ethers_transaction_hash()?).await @@ -63,7 +63,7 @@ impl CollectByTransaction for CallTraceDerivatives { } fn process_call_trace_derivatives( - response: Vec, + response: Vec, columns: &mut CallTraceDerivatives, schemas: &HashMap, ) -> R<()> { diff --git a/crates/freeze/src/multi_datasets/geth_state_diffs.rs b/crates/freeze/src/multi_datasets/geth_state_diffs.rs index fc1c04a..bd2f16c 100644 --- a/crates/freeze/src/multi_datasets/geth_state_diffs.rs +++ b/crates/freeze/src/multi_datasets/geth_state_diffs.rs @@ -1,5 +1,8 @@ use crate::*; -use ethers::prelude::*; +use alloy::{ + primitives::{Address, Bytes, B256, U256}, + rpc::types::trace::geth::{AccountState, DiffMode}, +}; use polars::prelude::*; use std::collections::{BTreeMap, HashMap, HashSet}; @@ -46,7 +49,7 @@ impl ToDataFrames for GethStateDiffs { } } -type BlockTxsTraces = (Option, Vec>>, Vec); +type BlockTxsTraces = (Option, Vec>>, Vec); #[async_trait::async_trait] impl CollectByBlock for GethStateDiffs { @@ -146,34 +149,34 @@ pub(crate) fn process_geth_diffs( } fn add_balances( - address: &H160, + address: &Address, pre: Option, post: Option, columns: &mut GethBalanceDiffs, schema: &Table, index: &(Option, u32, Option>), ) -> R<()> { - let (from_value, to_value) = parse_pre_post(pre, post, U256::zero); + let (from_value, to_value) = parse_pre_post(pre, post, U256::ZERO); let (block_number, transaction_index, transaction_hash) = index; columns.n_rows += 1; store!(schema, columns, block_number, *block_number); store!(schema, columns, transaction_index, Some(*transaction_index as u64)); store!(schema, columns, transaction_hash, transaction_hash.clone()); - store!(schema, columns, address, address.as_bytes().to_vec()); + store!(schema, columns, address, address.to_vec()); store!(schema, columns, from_value, from_value); store!(schema, columns, to_value, to_value); Ok(()) } fn add_codes( - address: &H160, - pre: &Option, - post: &Option, + address: &Address, + pre: &Option, + post: &Option, columns: &mut GethCodeDiffs, schema: &Table, index: &(Option, u32, Option>), ) -> R<()> { - let blank = String::new(); + let blank = Bytes::new(); let (from_value, to_value) = match (pre, post) { (Some(pre), Some(post)) => (pre, post), (Some(pre), None) => (pre, &blank), @@ -185,57 +188,40 @@ fn add_codes( store!(schema, columns, block_number, *block_number); store!(schema, columns, transaction_index, Some(*transaction_index as u64)); store!(schema, columns, transaction_hash, transaction_hash.clone()); - store!(schema, columns, address, address.as_bytes().to_vec()); - let from_value = if !from_value.is_empty() { - prefix_hex::decode(from_value).map_err(|_| err("could not decode from code contents"))? - } else { - vec![] - }; - let to_value = if !to_value.is_empty() { - prefix_hex::decode(to_value).map_err(|_| err("could not decode to code contents"))? - } else { - vec![] - }; - store!(schema, columns, from_value, from_value); - store!(schema, columns, to_value, to_value); + store!(schema, columns, address, address.to_vec()); + store!(schema, columns, from_value, from_value.to_vec()); + store!(schema, columns, to_value, to_value.to_vec()); Ok(()) } fn add_nonces( - address: &H160, - pre: Option, - post: Option, + address: &Address, + pre: Option, + post: Option, columns: &mut GethNonceDiffs, schema: &Table, index: &(Option, u32, Option>), ) -> R<()> { - let (from_value, to_value) = parse_pre_post(pre, post, U256::zero); + let (from_value, to_value) = parse_pre_post(pre, post, 0_u64); let (block_number, transaction_index, transaction_hash) = index; columns.n_rows += 1; store!(schema, columns, block_number, *block_number); store!(schema, columns, transaction_index, Some(*transaction_index as u64)); store!(schema, columns, transaction_hash, transaction_hash.clone()); - store!(schema, columns, address, address.as_bytes().to_vec()); + store!(schema, columns, address, address.to_vec()); store!(schema, columns, from_value, from_value); store!(schema, columns, to_value, to_value); Ok(()) } fn add_storages( - address: &H160, - pre: &Option>, - post: &Option>, + address: &Address, + pre: &BTreeMap, + post: &BTreeMap, columns: &mut GethStorageDiffs, schema: &Table, index: &(Option, u32, Option>), ) -> R<()> { - let blank = BTreeMap::new(); - let (pre, post) = match (pre, post) { - (Some(pre), Some(post)) => (pre, post), - (Some(pre), None) => (pre, &blank), - (None, Some(post)) => (&blank, post), - (None, None) => (&blank, &blank), - }; let (block_number, transaction_index, transaction_hash) = index; let slots: Vec<_> = pre .clone() @@ -244,7 +230,7 @@ fn add_storages( .collect::>() .into_iter() .collect(); - let blank = H256::zero(); + let blank = B256::ZERO; for slot in slots.into_iter() { let (from, to) = match (pre.get(&slot), post.get(&slot)) { (Some(pre), Some(post)) => (pre, post), @@ -256,19 +242,22 @@ fn add_storages( store!(schema, columns, block_number, *block_number); store!(schema, columns, transaction_index, Some(*transaction_index as u64)); store!(schema, columns, transaction_hash, transaction_hash.clone()); - store!(schema, columns, address, address.as_bytes().to_vec()); - store!(schema, columns, slot, slot.as_bytes().to_vec()); - store!(schema, columns, from_value, from.as_bytes().to_vec()); - store!(schema, columns, to_value, to.as_bytes().to_vec()); + store!(schema, columns, address, address.to_vec()); + store!(schema, columns, slot, slot.to_vec()); + store!(schema, columns, from_value, from.to_vec()); + store!(schema, columns, to_value, to.to_vec()); } Ok(()) } -fn parse_pre_post(pre: Option, post: Option, new: fn() -> T) -> (T, T) { +fn parse_pre_post(pre: Option, post: Option, new: T) -> (T, T) +where + T: Copy + Clone, +{ match (pre, post) { (Some(pre), Some(post)) => (pre, post), - (Some(pre), None) => (pre, new()), - (None, Some(post)) => (new(), post), - (None, None) => (new(), new()), + (Some(pre), None) => (pre, new), + (None, Some(post)) => (new, post), + (None, None) => (new, new), } } diff --git a/crates/freeze/src/multi_datasets/state_diffs.rs b/crates/freeze/src/multi_datasets/state_diffs.rs index 31cff4f..2806fee 100644 --- a/crates/freeze/src/multi_datasets/state_diffs.rs +++ b/crates/freeze/src/multi_datasets/state_diffs.rs @@ -1,4 +1,5 @@ use crate::*; +use alloy::rpc::types::trace::parity::TraceResults; use polars::prelude::*; use std::collections::HashMap; @@ -11,7 +12,7 @@ pub struct StateDiffs( storage_diffs::StorageDiffs, ); -type BlockTxsTraces = (Option, Vec>>, Vec); +type BlockTxsTraces = (Option, Vec>>, Vec); impl ToDataFrames for StateDiffs { fn create_dfs( @@ -35,7 +36,10 @@ impl CollectByBlock for StateDiffs { async fn extract(request: Params, source: Arc, query: Arc) -> R { let include_txs = query.schemas.values().any(|x| x.has_column("transaction_hash")); - source.trace_block_state_diffs(request.block_number()? as u32, include_txs).await + let (bn, txs, traces) = + source.trace_block_state_diffs(request.block_number()? as u32, include_txs).await?; + let trace_results = traces.into_iter().map(|t| t.full_trace).collect(); + Ok((bn, txs, trace_results)) } fn transform(response: Self::Response, columns: &mut Self, query: &Arc) -> R<()> { diff --git a/crates/freeze/src/multi_datasets/state_reads.rs b/crates/freeze/src/multi_datasets/state_reads.rs index f046d7b..0fa8ae4 100644 --- a/crates/freeze/src/multi_datasets/state_reads.rs +++ b/crates/freeze/src/multi_datasets/state_reads.rs @@ -1,5 +1,5 @@ use crate::*; -use ethers::prelude::*; +use alloy::{primitives::Address, rpc::types::trace::geth::AccountState}; use polars::prelude::*; use std::collections::{BTreeMap, HashMap}; @@ -12,7 +12,7 @@ pub struct StateReads( storage_reads::StorageReads, ); -type BlockTxsTraces = (Option, Vec>>, Vec>); +type BlockTxsTraces = (Option, Vec>>, Vec>); impl ToDataFrames for StateReads { fn create_dfs( diff --git a/crates/freeze/src/types/chunks/number_chunk.rs b/crates/freeze/src/types/chunks/number_chunk.rs index b557e4c..bb68d1f 100644 --- a/crates/freeze/src/types/chunks/number_chunk.rs +++ b/crates/freeze/src/types/chunks/number_chunk.rs @@ -1,6 +1,6 @@ use super::chunk_ops::ChunkData; use crate::ChunkError; -use ethers::types::FilterBlockOption; +use alloy::rpc::types::FilterBlockOption; /// Chunk of blocks #[derive(Debug, Clone)] @@ -77,7 +77,7 @@ impl NumberChunk { match self { NumberChunk::Numbers(numbers) => Some(NumberChunk::Numbers(numbers)), NumberChunk::Range(start, end) => { - let start = ((start + chunk_size - 1) / chunk_size) * chunk_size; + let start = start.div_ceil(chunk_size) * chunk_size; let end = (end / chunk_size) * chunk_size; if end > start { Some(NumberChunk::Range(start, end)) diff --git a/crates/freeze/src/types/chunks/subchunks.rs b/crates/freeze/src/types/chunks/subchunks.rs index 4d248c6..6404c87 100644 --- a/crates/freeze/src/types/chunks/subchunks.rs +++ b/crates/freeze/src/types/chunks/subchunks.rs @@ -27,7 +27,7 @@ impl Subchunk for BlockChunk { fn subchunk_by_count(&self, n_chunks: &u64) -> Vec { let total_blocks = self.size(); - let chunk_size = (total_blocks + n_chunks - 1) / n_chunks; + let chunk_size = total_blocks.div_ceil(*n_chunks); self.subchunk_by_size(&chunk_size) } } diff --git a/crates/freeze/src/types/conversions.rs b/crates/freeze/src/types/conversions.rs index ce8d39f..536ee3a 100644 --- a/crates/freeze/src/types/conversions.rs +++ b/crates/freeze/src/types/conversions.rs @@ -1,6 +1,6 @@ use crate::CollectError; /// conversion operations -use ethers::prelude::*; +use alloy::primitives::{Bytes, I256, U256}; use prefix_hex; /// convert Bytes to u32 @@ -21,11 +21,7 @@ pub trait ToVecU8 { impl ToVecU8 for U256 { fn to_vec_u8(&self) -> Vec { - let mut vec = Vec::new(); - for &number in self.0.iter().rev() { - vec.extend_from_slice(&number.to_be_bytes()); - } - vec + self.to_be_bytes_vec() } } @@ -45,9 +41,7 @@ impl ToVecU8 for Vec { fn to_vec_u8(&self) -> Vec { let mut vec = Vec::new(); for value in self { - for &number in value.0.iter().rev() { - vec.extend_from_slice(&number.to_be_bytes()); - } + vec.extend_from_slice(&value.to_be_bytes_vec()) } vec } diff --git a/crates/freeze/src/types/dataframes/creation.rs b/crates/freeze/src/types/dataframes/creation.rs index b4dd01d..860d5b4 100644 --- a/crates/freeze/src/types/dataframes/creation.rs +++ b/crates/freeze/src/types/dataframes/creation.rs @@ -74,7 +74,7 @@ macro_rules! with_series_u256 { let name = $name.to_string() + U256Type::U32.suffix().as_str(); let name = name.as_str(); - let converted: Vec = $value.iter().map(|v| v.as_u32()).collect(); + let converted: Vec = $value.iter().map(|v| v.wrapping_to::()).collect(); $all_series.push(Series::new(name, converted)); } @@ -83,7 +83,7 @@ macro_rules! with_series_u256 { let name = $name.to_string() + U256Type::U64.suffix().as_str(); let name = name.as_str(); - let converted: Vec = $value.iter().map(|v| v.as_u64()).collect(); + let converted: Vec = $value.iter().map(|v| v.wrapping_to::()).collect(); $all_series.push(Series::new(name, converted)); } @@ -154,7 +154,7 @@ macro_rules! with_series_option_u256 { let name = name.as_str(); let converted: Vec> = - $value.iter().map(|v| v.map(|x| x.as_u32())).collect(); + $value.iter().map(|v| v.map(|x| x.wrapping_to::())).collect(); $all_series.push(Series::new(name, converted)); } @@ -164,7 +164,7 @@ macro_rules! with_series_option_u256 { let name = name.as_str(); let converted: Vec> = - $value.iter().map(|v| v.map(|x| x.as_u64())).collect(); + $value.iter().map(|v| v.map(|x| x.wrapping_to::())).collect(); $all_series.push(Series::new(name, converted)); } diff --git a/crates/freeze/src/types/dataframes/u256s.rs b/crates/freeze/src/types/dataframes/u256s.rs index ea3a353..9e47689 100644 --- a/crates/freeze/src/types/dataframes/u256s.rs +++ b/crates/freeze/src/types/dataframes/u256s.rs @@ -1,5 +1,5 @@ use crate::*; -use ethers::prelude::*; +use alloy::primitives::{I256, U256}; use polars::prelude::*; /// Converts a Vec of U256-like data into a polars Series @@ -46,11 +46,11 @@ impl ToU256Series for Vec { Ok(Series::new(name, converted)) } U256Type::U32 => { - let converted: Vec = self.iter().map(|v| v.as_u32()).collect(); + let converted: Vec = self.iter().map(|v| v.wrapping_to::()).collect(); Ok(Series::new(name, converted)) } U256Type::U64 => { - let converted: Vec = self.iter().map(|v| v.as_u64()).collect(); + let converted: Vec = self.iter().map(|v| v.wrapping_to::()).collect(); Ok(Series::new(name, converted)) } U256Type::Decimal128 => { @@ -100,12 +100,12 @@ impl ToU256Series for Vec> { } U256Type::U32 => { let converted: Vec> = - self.iter().map(|v| v.map(|x| x.as_u32())).collect(); + self.iter().map(|v| v.map(|x| x.wrapping_to::())).collect(); Ok(Series::new(name, converted)) } U256Type::U64 => { let converted: Vec> = - self.iter().map(|v| v.map(|x| x.as_u64())).collect(); + self.iter().map(|v| v.map(|x| x.wrapping_to::())).collect(); Ok(Series::new(name, converted)) } U256Type::Decimal128 => { diff --git a/crates/freeze/src/types/decoders/log_decoder.rs b/crates/freeze/src/types/decoders/log_decoder.rs index 5f7c87a..b107b60 100644 --- a/crates/freeze/src/types/decoders/log_decoder.rs +++ b/crates/freeze/src/types/decoders/log_decoder.rs @@ -1,8 +1,12 @@ use crate::{err, CollectError, ColumnEncoding, ToU256Series, U256Type}; -use ethers::prelude::*; -use ethers_core::abi::{AbiEncode, EventParam, HumanReadableParser, ParamType, RawLog, Token}; +use alloy::{ + dyn_abi::{DynSolValue, EventExt}, + hex::ToHexExt, + json_abi::Event, + primitives::{I256, U256}, + rpc::types::Log, +}; use polars::prelude::*; -use std::collections::HashSet; /// container for log decoding context #[derive(Clone, Debug, PartialEq)] @@ -11,7 +15,7 @@ pub struct LogDecoder { /// uint256 amount) pub raw: String, /// decoded abi type of event signature string - pub event: abi::Event, + pub event: Event, } impl LogDecoder { @@ -19,7 +23,7 @@ impl LogDecoder { /// ex: LogDecoder::new("event Transfer(address indexed from, address indexed to, uint256 /// amount)".to_string()) pub fn new(event_signature: String) -> Result { - match HumanReadableParser::parse_event(event_signature.as_str()) { + match Event::parse(&event_signature) { Ok(event) => Ok(Self { event, raw: event_signature.clone() }), Err(e) => { let err = format!("incorrectly formatted event {} (expect something like event Transfer(address indexed from, address indexed to, uint256 amount) err: {}", event_signature, e); @@ -37,19 +41,35 @@ impl LogDecoder { /// converts from a log type to an abi token type /// this function assumes all logs are of the same type and skips fields if they don't match the /// passed event definition - pub fn parse_log_from_event(&self, logs: Vec) -> indexmap::IndexMap> { - let mut map: indexmap::IndexMap> = indexmap::IndexMap::new(); - let known_keys = - self.event.inputs.clone().into_iter().map(|i| i.name).collect::>(); + pub fn parse_log_from_event( + &self, + logs: Vec, + ) -> indexmap::IndexMap> { + let mut map: indexmap::IndexMap> = indexmap::IndexMap::new(); + let indexed_keys: Vec = self + .event + .inputs + .clone() + .into_iter() + .filter_map(|x| if x.indexed { Some(x.name) } else { None }) + .collect(); + let body_keys: Vec = self + .event + .inputs + .clone() + .into_iter() + .filter_map(|x| if x.indexed { None } else { Some(x.name) }) + .collect(); for log in logs { - match self.event.parse_log(RawLog::from(log)) { - Ok(log) => { - for param in log.params { - if known_keys.contains(param.name.as_str()) { - let tokens = map.entry(param.name).or_default(); - tokens.push(param.value); - } + match self.event.decode_log_parts(log.topics().to_vec(), log.data().data.as_ref(), true) + { + Ok(decoded) => { + for (idx, param) in decoded.indexed.into_iter().enumerate() { + map.entry(indexed_keys[idx].clone()).or_default().push(param); + } + for (idx, param) in decoded.body.into_iter().enumerate() { + map.entry(body_keys[idx].clone()).or_default().push(param); } } Err(e) => eprintln!("error parsing log: {:?}", e), @@ -62,7 +82,7 @@ impl LogDecoder { pub fn make_series( &self, name: String, - data: Vec, + data: Vec, chunk_len: usize, u256_types: &[U256Type], column_encoding: &ColumnEncoding, @@ -70,7 +90,6 @@ impl LogDecoder { // This is a smooth brain way of doing this, but I can't think of a better way right now let mut ints: Vec = vec![]; let mut uints: Vec = vec![]; - let mut str_ints: Vec = vec![]; let mut u256s: Vec = vec![]; let mut i256s: Vec = vec![]; let mut bytes: Vec> = vec![]; @@ -79,68 +98,39 @@ impl LogDecoder { let mut strings: Vec = vec![]; // TODO: support array & tuple types - let param = self - .event - .inputs - .clone() - .into_iter() - .filter(|i| i.name == name) - .collect::>(); - let param = param.first(); - for token in data { match token { - Token::Address(a) => match column_encoding { - ColumnEncoding::Binary => bytes.push(a.to_fixed_bytes().into()), + DynSolValue::Address(a) => match column_encoding { + ColumnEncoding::Binary => bytes.push(a.to_vec()), ColumnEncoding::Hex => hexes.push(format!("{:?}", a)), }, - Token::FixedBytes(b) => match column_encoding { + DynSolValue::FixedBytes(b, _) => match column_encoding { + ColumnEncoding::Binary => bytes.push(b.to_vec()), + ColumnEncoding::Hex => hexes.push(b.encode_hex()), + }, + DynSolValue::Bytes(b) => match column_encoding { ColumnEncoding::Binary => bytes.push(b), ColumnEncoding::Hex => hexes.push(b.encode_hex()), }, - Token::Bytes(b) => match column_encoding { - ColumnEncoding::Binary => bytes.push(b), - ColumnEncoding::Hex => hexes.push(b.encode_hex()), - }, - Token::Uint(i) => match param { - Some(param) => match param.kind.clone() { - ParamType::Uint(size) => { - if size <= 64 { - uints.push(i.as_u64()) - } else { - u256s.push(i) - } - } - _ => str_ints.push(i.to_string()), - }, - None => match i.try_into() { - Ok(i) => ints.push(i), - Err(_) => str_ints.push(i.to_string()), - }, - }, - Token::Int(i) => { - let i = I256::from_raw(i); - match param { - Some(param) => match param.kind.clone() { - ParamType::Int(size) => { - if size <= 64 { - ints.push(i.as_i64()) - } else { - i256s.push(i) - } - } - _ => str_ints.push(i.to_string()), - }, - None => match i.try_into() { - Ok(i) => ints.push(i), - Err(_) => str_ints.push(i.to_string()), - }, + DynSolValue::Uint(i, size) => { + if size <= 64 { + uints.push(i.wrapping_to::()) + } else { + u256s.push(i) } } - Token::Bool(b) => bools.push(b), - Token::String(s) => strings.push(s), - Token::Array(_) | Token::FixedArray(_) => {} - Token::Tuple(_) => {} + DynSolValue::Int(i, size) => { + if size <= 64 { + ints.push(i.unchecked_into()); + } else { + i256s.push(i); + } + } + DynSolValue::Bool(b) => bools.push(b), + DynSolValue::String(s) => strings.push(s), + DynSolValue::Array(_) | DynSolValue::FixedArray(_) => {} + DynSolValue::Tuple(_) => {} + DynSolValue::Function(_) => {} } } let mixed_length_err = format!("could not parse column {}, mixed type", name); @@ -173,8 +163,6 @@ impl LogDecoder { Ok(series_vec) } else if !uints.is_empty() { Ok(vec![Series::new(name.as_str(), uints)]) - } else if !str_ints.is_empty() { - Ok(vec![Series::new(name.as_str(), str_ints)]) } else if !bytes.is_empty() { if bytes.len() != chunk_len { return Err(err(mixed_length_err)) diff --git a/crates/freeze/src/types/errors.rs b/crates/freeze/src/types/errors.rs index ebd9071..fe3bae2 100644 --- a/crates/freeze/src/types/errors.rs +++ b/crates/freeze/src/types/errors.rs @@ -1,5 +1,5 @@ +use alloy::transports::{RpcError, TransportErrorKind}; /// error specifications -use ethers::prelude::*; use polars::prelude::*; use thiserror::Error; @@ -60,7 +60,7 @@ pub enum CollectError { /// Error related to provider operations #[error("Failed to get block: {0}")] - ProviderError(#[source] ProviderError), + ProviderError(#[source] RpcError), /// Error related to tokio task #[error("Task failed: {0}")] @@ -96,7 +96,7 @@ pub enum ParseError { /// Error related to provider operations #[error("Failed to get block: {0}")] - ProviderError(#[source] ProviderError), + ProviderError(#[source] RpcError), /// Parse int error #[error("Parsing error")] @@ -105,6 +105,10 @@ pub enum ParseError { /// MESC error #[error("MESC error: {:?}", .0)] MescError(mesc::MescError), + + /// Parse url error + #[error("Parsing url error: {0}")] + ParseUrlError(url::ParseError), } impl From for ParseError { diff --git a/crates/freeze/src/types/mod.rs b/crates/freeze/src/types/mod.rs index d4eb84c..b0e163d 100644 --- a/crates/freeze/src/types/mod.rs +++ b/crates/freeze/src/types/mod.rs @@ -1,5 +1,4 @@ /// type specifications for cryo_freeze crate - /// type specifications for chunk types pub mod chunks; /// conversion operations @@ -36,6 +35,7 @@ pub use reports::CRYO_VERSION; pub mod dataframes; /// function and event signatures +#[allow(missing_docs)] pub mod signatures; /// error specifications diff --git a/crates/freeze/src/types/rpc_params.rs b/crates/freeze/src/types/rpc_params.rs index 2832b4c..fc58f5b 100644 --- a/crates/freeze/src/types/rpc_params.rs +++ b/crates/freeze/src/types/rpc_params.rs @@ -1,5 +1,8 @@ use crate::{err, CollectError}; -use ethers::prelude::*; +use alloy::{ + primitives::{Address, BlockNumber, B256}, + rpc::types::{Filter, FilterBlockOption}, +}; /// represents parameters for a single rpc call #[derive(Default, Clone, Debug)] @@ -74,22 +77,22 @@ impl Params { /// ethers block number pub fn ethers_block_number(&self) -> Result { - Ok(self.block_number()?.into()) + self.block_number() } /// ethers transaction - pub fn ethers_transaction_hash(&self) -> Result { - Ok(H256::from_slice(&self.transaction_hash()?)) + pub fn ethers_transaction_hash(&self) -> Result { + Ok(B256::from_slice(&self.transaction_hash()?)) } /// ethers address - pub fn ethers_address(&self) -> Result { - Ok(H160::from_slice(&self.address()?)) + pub fn ethers_address(&self) -> Result { + Ok(Address::from_slice(&self.address()?)) } /// ethers contract - pub fn ethers_contract(&self) -> Result { - Ok(H160::from_slice(&self.contract()?)) + pub fn ethers_contract(&self) -> Result { + Ok(Address::from_slice(&self.contract()?)) } /// log filter @@ -97,16 +100,33 @@ impl Params { let (start, end) = self.block_range()?; let block_option = FilterBlockOption::Range { from_block: Some(start.into()), to_block: Some(end.into()) }; - let filter = Filter { - block_option, - address: self.address.clone().map(|x| ValueOrArray::Value(H160::from_slice(&x))), - topics: [ - self.topic0.clone().map(|x| ValueOrArray::Value(Some(H256::from_slice(&x)))), - self.topic1.clone().map(|x| ValueOrArray::Value(Some(H256::from_slice(&x)))), - self.topic2.clone().map(|x| ValueOrArray::Value(Some(H256::from_slice(&x)))), - self.topic3.clone().map(|x| ValueOrArray::Value(Some(H256::from_slice(&x)))), - ], - }; + // let filter = Filter { + // block_option, + // address: self.address.clone().map(|x| ValueOrArray::Value(Address::from_slice(&x))), + // topics: [ + // self.topic0.clone().map(|x| ValueOrArray::Value(Some(B256::from_slice(&x)))), + // self.topic1.clone().map(|x| ValueOrArray::Value(Some(B256::from_slice(&x)))), + // self.topic2.clone().map(|x| ValueOrArray::Value(Some(B256::from_slice(&x)))), + // self.topic3.clone().map(|x| ValueOrArray::Value(Some(B2::from_slice(&x)))), + // ], + // }; + let mut filter = Filter::new(); + filter.block_option = block_option; + if self.address.is_some() { + filter = filter.address(Address::from_slice(&self.address.clone().unwrap())); + } + if self.topic0.is_some() { + filter = filter.event_signature(B256::from_slice(&self.topic0.clone().unwrap())); + } + if self.topic1.is_some() { + filter = filter.topic1(B256::from_slice(&self.topic1.clone().unwrap())); + } + if self.topic2.is_some() { + filter = filter.topic2(B256::from_slice(&self.topic2.clone().unwrap())); + } + if self.topic3.is_some() { + filter = filter.topic3(B256::from_slice(&self.topic3.clone().unwrap())); + } Ok(filter) } } diff --git a/crates/freeze/src/types/signatures.rs b/crates/freeze/src/types/signatures.rs index b41280e..fb74358 100644 --- a/crates/freeze/src/types/signatures.rs +++ b/crates/freeze/src/types/signatures.rs @@ -1,37 +1,26 @@ -use ethers::prelude::*; +use alloy::sol; -lazy_static::lazy_static! { +sol! { + contract ERC20 { + function name() external pure returns (string memory); + function symbol() external pure returns (string memory); + function decimals() external pure returns (uint8); + function totalSupply() external view returns (uint); + function balanceOf(address owner) external view returns (uint); + function allowance(address owner, address spender) external view returns (uint); - /// function signature of FUNCTION_ERC20_NAME - pub static ref FUNCTION_ERC20_NAME: Vec = prefix_hex::decode("0x06fdde03").expect("Decoding failed"); - - /// function signature of FUNCTION_ERC20_SYMBOL - pub static ref FUNCTION_ERC20_SYMBOL: Vec = prefix_hex::decode("0x95d89b41").expect("Decoding failed"); - - /// function signature of FUNCTION_ERC20_DECIMALS - pub static ref FUNCTION_ERC20_DECIMALS: Vec = prefix_hex::decode("0x313ce567").expect("Decoding failed"); - - /// function signature of FUNCTION_ERC20_BALANCE_OF - pub static ref FUNCTION_ERC20_BALANCE_OF: Vec = prefix_hex::decode("0x70a08231").expect("Decoding failed"); - - /// function signature of FUNCTION_ERC20_TOTAL_SUPPLY - pub static ref FUNCTION_ERC20_TOTAL_SUPPLY: Vec = prefix_hex::decode("0x18160ddd").expect("Decoding failed"); - - /// event hash of EVENT_ERC20_TRANSFER - pub static ref EVENT_ERC20_TRANSFER: H256 = H256( - prefix_hex::decode("0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef") - .expect("Decoding failed"), - ); - - /// event hash of EVENT_ERC20_APPROVAL - pub static ref EVENT_ERC20_APPROVAL: H256 = H256( - prefix_hex::decode("0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925") - .expect("Decoding failed"), - ); - - /// event hash of EVENT_ERC721_TRANSFER - pub static ref EVENT_ERC721_TRANSFER: H256 = H256( - prefix_hex::decode("0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef") - .expect("Decoding failed"), - ); + event Approval(address indexed owner, address indexed spender, uint value); + event Transfer(address indexed from, address indexed to, uint value); + } +} + +sol! { + contract ERC721 { + event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); + event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); + event ApprovalForAll(address indexed owner, address indexed operator, bool approved); + function name() external view returns (string memory); + function symbol() external view returns (string memory); + function tokenURI(uint256 tokenId) external view returns (string memory); + } } diff --git a/crates/freeze/src/types/sources.rs b/crates/freeze/src/types/sources.rs index 24d63e0..e718c56 100644 --- a/crates/freeze/src/types/sources.rs +++ b/crates/freeze/src/types/sources.rs @@ -1,6 +1,29 @@ use std::sync::Arc; -use ethers::prelude::*; +use alloy::{ + eips::BlockNumberOrTag, + primitives::{Address, BlockNumber, Bytes, TxHash, B256, U256}, + providers::{ + ext::{DebugApi, TraceApi}, + Provider, ProviderBuilder, RootProvider, + }, + rpc::types::{ + trace::{ + common::TraceResult, + geth::{ + AccountState, CallConfig, CallFrame, DefaultFrame, DiffMode, + GethDebugBuiltInTracerType, GethDebugTracerType, GethDebugTracingOptions, + GethTrace, PreStateConfig, PreStateFrame, + }, + parity::{ + LocalizedTransactionTrace, TraceResults, TraceResultsWithTransactionHash, TraceType, + }, + }, + Block, BlockTransactions, BlockTransactionsKind, Filter, Log, Transaction, + TransactionInput, TransactionReceipt, TransactionRequest, + }, + transports::{http::reqwest::Url, BoxTransport, RpcError, TransportErrorKind}, +}; use governor::{ clock::DefaultClock, middleware::NoOpMiddleware, @@ -20,7 +43,7 @@ pub type RateLimiter = governor::RateLimiter, /// chain_id of network pub chain_id: u64, /// number of blocks per log request @@ -37,56 +60,6 @@ pub struct Source { pub labels: SourceLabels, } -/// A non-generic wrapper over different provider types for use as a trait object -#[derive(Clone, Debug)] -pub enum ProviderWrapper { - /// mock provider - MockProvider(Arc>), - /// http client - RetryClientHttp(Arc>>), - /// websocket client - WsClient(Arc>), - /// ipc client - IpcClient(Arc>), -} - -impl From> for ProviderWrapper { - fn from(value: Provider) -> ProviderWrapper { - ProviderWrapper::MockProvider(Arc::new(value)) - } -} - -impl From>> for ProviderWrapper { - fn from(value: Provider>) -> ProviderWrapper { - ProviderWrapper::RetryClientHttp(Arc::new(value)) - } -} - -impl From> for ProviderWrapper { - fn from(value: Provider) -> ProviderWrapper { - ProviderWrapper::WsClient(Arc::new(value)) - } -} - -impl From> for ProviderWrapper { - fn from(value: Provider) -> ProviderWrapper { - ProviderWrapper::IpcClient(Arc::new(value)) - } -} - -/// extract the provider from a source and run specified method -#[macro_export] -macro_rules! source_provider { - ($source:expr, $method:ident($($arg:expr),*)) => { - match &$source.provider { - ProviderWrapper::MockProvider(provider) => provider.$method($($arg),*), - ProviderWrapper::RetryClientHttp(provider) => provider.$method($($arg),*), - ProviderWrapper::WsClient(provider) => provider.$method($($arg),*), - ProviderWrapper::IpcClient(provider) => provider.$method($($arg),*), - } - }; -} - impl Source { /// Returns all receipts for a block. /// Tries to use `eth_getBlockReceipts` first, and falls back to `eth_getTransactionReceipt` @@ -94,32 +67,32 @@ impl Source { &self, block: &Block, ) -> Result> { - let block_number = - block.number.ok_or(CollectError::CollectError("no block number".to_string()))?.as_u64(); - if let Ok(receipts) = self.get_block_receipts(block_number).await { + let block_number = block.header.number; + if let Ok(Some(receipts)) = self.get_block_receipts(block_number).await { return Ok(receipts); } - self.get_tx_receipts(&block.transactions).await + self.get_tx_receipts(block.transactions.clone()).await } /// Returns all receipts for vector of transactions using `eth_getTransactionReceipt` pub async fn get_tx_receipts( &self, - transactions: &Vec, + transactions: BlockTransactions, ) -> Result> { let mut tasks = Vec::new(); - for tx in transactions { - let tx_hash = tx.hash; + for tx in transactions.as_transactions().unwrap() { + let tx_hash = *tx.inner.tx_hash(); let source = self.clone(); - let task = task::spawn(async move { - match source.get_transaction_receipt(tx_hash).await? { - Some(receipt) => Ok(receipt), - None => { - Err(CollectError::CollectError("could not find tx receipt".to_string())) + let task: task::JoinHandle> = + task::spawn(async move { + match source.get_transaction_receipt(tx_hash).await? { + Some(receipt) => Ok(receipt), + None => { + Err(CollectError::CollectError("could not find tx receipt".to_string())) + } } - } - }); + }); tasks.push(task); } let mut receipts = Vec::new(); @@ -144,31 +117,21 @@ const DEFAULT_MAX_CONCURRENT_REQUESTS: u64 = 100; impl Source { /// initialize source pub async fn init(rpc_url: Option) -> Result { - let rpc_url = parse_rpc_url(rpc_url); - let provider = Provider::>::new_client( - &rpc_url, - DEFAULT_MAX_RETRIES, - DEFAULT_INTIAL_BACKOFF, - ) - .map_err(|_| CollectError::RPCError("could not connect to provider".to_string()))?; + let rpc_url: String = parse_rpc_url(rpc_url); + let parsed_rpc_url: Url = rpc_url.parse().expect("rpc url is not valid"); + let provider = ProviderBuilder::new().on_http(parsed_rpc_url.clone()); let chain_id = provider - .get_chainid() + .get_chain_id() .await - .map_err(|_| CollectError::RPCError("could not get chain_id".to_string()))? - .as_u64(); + .map_err(|_| CollectError::RPCError("could not get chain_id".to_string()))?; let rate_limiter = None; let semaphore = None; - let provider = Provider::>::new_client( - &rpc_url, - DEFAULT_MAX_RETRIES, - DEFAULT_INTIAL_BACKOFF, - ) - .map_err(|_| CollectError::RPCError("could not connect to provider".to_string()))?; + let provider = ProviderBuilder::new().on_http(parsed_rpc_url); let source = Source { - provider: ProviderWrapper::RetryClientHttp(Arc::new(provider)), + provider: provider.boxed(), chain_id, inner_request_size: DEFAULT_INNER_REQUEST_SIZE, max_concurrent_chunks: Some(DEFAULT_MAX_CONCURRENT_CHUNKS), @@ -251,7 +214,7 @@ pub struct SourceLabels { #[derive(Debug)] pub struct Fetcher

{ /// provider data source - pub provider: Provider

, + pub provider: RootProvider

, /// semaphore for controlling concurrency pub semaphore: Option, /// rate limiter for controlling request rate @@ -265,18 +228,18 @@ impl Source { /// Returns an array (possibly empty) of logs that match the filter pub async fn get_logs(&self, filter: &Filter) -> Result> { let _permit = self.permit_request().await; - Self::map_err(source_provider!(self, get_logs(filter)).await) + Self::map_err(self.provider.get_logs(filter).await) } /// Replays all transactions in a block returning the requested traces for each transaction pub async fn trace_replay_block_transactions( &self, - block: BlockNumber, + block: BlockNumberOrTag, trace_types: Vec, - ) -> Result> { + ) -> Result> { let _permit = self.permit_request().await; Self::map_err( - source_provider!(self, trace_replay_block_transactions(block, trace_types)).await, + self.provider.trace_replay_block_transactions(block.into(), &trace_types).await, ) } @@ -285,23 +248,25 @@ impl Source { &self, block: u32, include_transaction_hashes: bool, - ) -> Result<(Option, Vec>>, Vec)> { + ) -> Result<(Option, Vec>>, Vec)> { // get traces let result = self .trace_replay_block_transactions( - block.into(), - vec![ethers::types::TraceType::StateDiff], + BlockNumberOrTag::Number(block as u64), + vec![TraceType::StateDiff], ) .await?; // get transactions let txs = if include_transaction_hashes { - self.get_block(block as u64) + self.get_block(block as u64, BlockTransactionsKind::Hashes) .await? .ok_or(CollectError::CollectError("could not find block".to_string()))? .transactions + .as_transactions() + .unwrap() .iter() - .map(|tx| Some(tx.0.to_vec())) + .map(|tx| Some(tx.inner.tx_hash().to_vec())) .collect() } else { vec![None; result.len()] @@ -314,9 +279,12 @@ impl Source { pub async fn trace_block_vm_traces( &self, block: u32, - ) -> Result<(Option, Option>, Vec)> { + ) -> Result<(Option, Option>, Vec)> { let result = self - .trace_replay_block_transactions(block.into(), vec![ethers::types::TraceType::VmTrace]) + .trace_replay_block_transactions( + BlockNumberOrTag::Number(block as u64), + vec![TraceType::VmTrace], + ) .await; Ok((Some(block), None, result?)) } @@ -326,20 +294,20 @@ impl Source { &self, tx_hash: TxHash, trace_types: Vec, - ) -> Result { + ) -> Result { let _permit = self.permit_request().await; - Self::map_err(source_provider!(self, trace_replay_transaction(tx_hash, trace_types)).await) + Self::map_err(self.provider.trace_replay_transaction(tx_hash, &trace_types).await) } /// Get state diff traces of transaction pub async fn trace_transaction_state_diffs( &self, transaction_hash: Vec, - ) -> Result<(Option, Vec>>, Vec)> { + ) -> Result<(Option, Vec>>, Vec)> { let result = self .trace_replay_transaction( - H256::from_slice(&transaction_hash), - vec![ethers::types::TraceType::StateDiff], + B256::from_slice(&transaction_hash), + vec![TraceType::StateDiff], ) .await; Ok((None, vec![Some(transaction_hash)], vec![result?])) @@ -349,20 +317,17 @@ impl Source { pub async fn trace_transaction_vm_traces( &self, transaction_hash: Vec, - ) -> Result<(Option, Option>, Vec)> { + ) -> Result<(Option, Option>, Vec)> { let result = self - .trace_replay_transaction( - H256::from_slice(&transaction_hash), - vec![ethers::types::TraceType::VmTrace], - ) + .trace_replay_transaction(B256::from_slice(&transaction_hash), vec![TraceType::VmTrace]) .await; Ok((None, Some(transaction_hash), vec![result?])) } /// Gets the transaction with transaction_hash - pub async fn get_transaction(&self, tx_hash: TxHash) -> Result> { + pub async fn get_transaction_by_hash(&self, tx_hash: TxHash) -> Result> { let _permit = self.permit_request().await; - Self::map_err(source_provider!(self, get_transaction(tx_hash)).await) + Self::map_err(self.provider.get_transaction_by_hash(tx_hash).await) } /// Gets the transaction receipt with transaction_hash @@ -371,48 +336,57 @@ impl Source { tx_hash: TxHash, ) -> Result> { let _permit = self.permit_request().await; - Self::map_err(source_provider!(self, get_transaction_receipt(tx_hash)).await) + Self::map_err(self.provider.get_transaction_receipt(tx_hash).await) } /// Gets the block at `block_num` (transaction hashes only) - pub async fn get_block(&self, block_num: u64) -> Result>> { + pub async fn get_block( + &self, + block_num: u64, + kind: BlockTransactionsKind, + ) -> Result> { let _permit = self.permit_request().await; - Self::map_err(source_provider!(self, get_block(block_num)).await) + Self::map_err(self.provider.get_block(block_num.into(), kind).await) } /// Gets the block with `block_hash` (transaction hashes only) - pub async fn get_block_by_hash(&self, block_hash: H256) -> Result>> { + pub async fn get_block_by_hash( + &self, + block_hash: B256, + kind: BlockTransactionsKind, + ) -> Result> { let _permit = self.permit_request().await; - Self::map_err(source_provider!(self, get_block(BlockId::Hash(block_hash))).await) - } - - /// Gets the block at `block_num` (full transactions included) - pub async fn get_block_with_txs(&self, block_num: u64) -> Result>> { - let _permit = self.permit_request().await; - Self::map_err(source_provider!(self, get_block_with_txs(block_num)).await) + Self::map_err(self.provider.get_block(block_hash.into(), kind).await) } /// Returns all receipts for a block. /// Note that this uses the `eth_getBlockReceipts` method which is not supported by all nodes. /// Consider using `FetcherExt::get_tx_receipts_in_block` which takes a block, and falls back to /// `eth_getTransactionReceipt` if `eth_getBlockReceipts` is not supported. - pub async fn get_block_receipts(&self, block_num: u64) -> Result> { + pub async fn get_block_receipts( + &self, + block_num: u64, + ) -> Result>> { let _permit = self.permit_request().await; - Self::map_err(source_provider!(self, get_block_receipts(block_num)).await) + Self::map_err(self.provider.get_block_receipts(block_num.into()).await) } /// Returns traces created at given block - pub async fn trace_block(&self, block_num: BlockNumber) -> Result> { + pub async fn trace_block( + &self, + block_num: BlockNumber, + ) -> Result> { let _permit = self.permit_request().await; - Self::map_err(source_provider!(self, trace_block(block_num)).await) + Self::map_err(self.provider.trace_block(block_num.into()).await) } /// Returns all traces of a given transaction - pub async fn trace_transaction(&self, tx_hash: TxHash) -> Result> { + pub async fn trace_transaction( + &self, + tx_hash: TxHash, + ) -> Result> { let _permit = self.permit_request().await; - source_provider!(self, trace_transaction(tx_hash)) - .await - .map_err(CollectError::ProviderError) + Self::map_err(self.provider.trace_transaction(tx_hash).await) } /// Deprecated @@ -422,10 +396,7 @@ impl Source { block_number: BlockNumber, ) -> Result { let _permit = self.permit_request().await; - let tx: ethers::core::types::transaction::eip2718::TypedTransaction = transaction.into(); - source_provider!(self, call(&tx, Some(block_number.into()))) - .await - .map_err(CollectError::ProviderError) + Self::map_err(self.provider.call(&transaction).block(block_number.into()).await) } /// Returns traces for given call data @@ -434,116 +405,121 @@ impl Source { transaction: TransactionRequest, trace_type: Vec, block_number: Option, - ) -> Result { + ) -> Result { let _permit = self.permit_request().await; - source_provider!(self, trace_call(transaction, trace_type, block_number)) - .await - .map_err(CollectError::ProviderError) + if let Some(bn) = block_number { + return Self::map_err( + self.provider.trace_call(&transaction, &trace_type).block_id(bn.into()).await, + ); + } + Self::map_err(self.provider.trace_call(&transaction, &trace_type).await) } /// Get nonce of address pub async fn get_transaction_count( &self, - address: H160, + address: Address, block_number: BlockNumber, - ) -> Result { + ) -> Result { let _permit = self.permit_request().await; - source_provider!(self, get_transaction_count(address, Some(block_number.into()))) - .await - .map_err(CollectError::ProviderError) + Self::map_err( + self.provider.get_transaction_count(address).block_id(block_number.into()).await, + ) } /// Get code at address - pub async fn get_balance(&self, address: H160, block_number: BlockNumber) -> Result { + pub async fn get_balance(&self, address: Address, block_number: BlockNumber) -> Result { let _permit = self.permit_request().await; - source_provider!(self, get_balance(address, Some(block_number.into()))) - .await - .map_err(CollectError::ProviderError) + Self::map_err(self.provider.get_balance(address).block_id(block_number.into()).await) } /// Get code at address - pub async fn get_code(&self, address: H160, block_number: BlockNumber) -> Result { + pub async fn get_code(&self, address: Address, block_number: BlockNumber) -> Result { let _permit = self.permit_request().await; - source_provider!(self, get_code(address, Some(block_number.into()))) - .await - .map_err(CollectError::ProviderError) + Self::map_err(self.provider.get_code_at(address).block_id(block_number.into()).await) } /// Get stored data at given location pub async fn get_storage_at( &self, - address: H160, - slot: H256, + address: Address, + slot: U256, block_number: BlockNumber, - ) -> Result { + ) -> Result { let _permit = self.permit_request().await; - source_provider!(self, get_storage_at(address, slot, Some(block_number.into()))) - .await - .map_err(CollectError::ProviderError) + Self::map_err( + self.provider.get_storage_at(address, slot).block_id(block_number.into()).await, + ) } /// Get the block number - pub async fn get_block_number(&self) -> Result { - Self::map_err(source_provider!(self, get_block_number()).await) + pub async fn get_block_number(&self) -> Result { + Self::map_err(self.provider.get_block_number().await) } // extra helpers below /// block number of transaction pub async fn get_transaction_block_number(&self, transaction_hash: Vec) -> Result { - let block = self.get_transaction(H256::from_slice(&transaction_hash)).await?; + let block = self.get_transaction_by_hash(B256::from_slice(&transaction_hash)).await?; let block = block.ok_or(CollectError::CollectError("could not get block".to_string()))?; Ok(block .block_number .ok_or(CollectError::CollectError("could not get block number".to_string()))? - .as_u32()) + as u32) } /// block number of transaction pub async fn get_transaction_logs(&self, transaction_hash: Vec) -> Result> { Ok(self - .get_transaction_receipt(H256::from_slice(&transaction_hash)) + .get_transaction_receipt(B256::from_slice(&transaction_hash)) .await? .ok_or(CollectError::CollectError("transaction receipt not found".to_string()))? - .logs) + .inner + .logs() + .to_vec()) } /// Return output data of a contract call pub async fn call2( &self, - address: H160, + address: Address, call_data: Vec, block_number: BlockNumber, ) -> Result { let transaction = TransactionRequest { to: Some(address.into()), - data: Some(call_data.into()), + input: TransactionInput::new(call_data.into()), ..Default::default() }; let _permit = self.permit_request().await; - let tx: ethers::core::types::transaction::eip2718::TypedTransaction = transaction.into(); - source_provider!(self, call(&tx, Some(block_number.into()))) - .await - .map_err(CollectError::ProviderError) + Self::map_err(self.provider.call(&transaction).block(block_number.into()).await) } /// Return output data of a contract call pub async fn trace_call2( &self, - address: H160, + address: Address, call_data: Vec, trace_type: Vec, block_number: Option, - ) -> Result { + ) -> Result { let transaction = TransactionRequest { to: Some(address.into()), - data: Some(call_data.into()), + input: TransactionInput::new(call_data.into()), ..Default::default() }; let _permit = self.permit_request().await; - source_provider!(self, trace_call(transaction, trace_type, block_number)) - .await - .map_err(CollectError::ProviderError) + if block_number.is_some() { + Self::map_err( + self.provider + .trace_call(&transaction, &trace_type) + .block_id(block_number.unwrap().into()) + .await, + ) + } else { + Self::map_err(self.provider.trace_call(&transaction, &trace_type).await) + } } /// get geth debug block traces @@ -552,19 +528,28 @@ impl Source { block_number: u32, options: GethDebugTracingOptions, include_transaction_hashes: bool, - ) -> Result<(Option, Vec>>, Vec)> { + ) -> Result<(Option, Vec>>, Vec>)> { let traces = { let _permit = self.permit_request().await; - source_provider!(self, debug_trace_block_by_number(Some(block_number.into()), options)) - .await - .map_err(CollectError::ProviderError)? + Self::map_err( + self.provider + .debug_trace_block_by_number( + BlockNumberOrTag::Number(block_number.into()), + options, + ) + .await, + )? }; let txs = if include_transaction_hashes { - match self.get_block(block_number as u64).await? { - Some(block) => { - block.transactions.iter().map(|x| Some(x.as_bytes().to_vec())).collect() - } + match self.get_block(block_number as u64, BlockTransactionsKind::Hashes).await? { + Some(block) => block + .transactions + .as_hashes() + .unwrap() + .iter() + .map(|x| Some(x.to_vec())) + .collect(), None => { return Err(CollectError::CollectError( "could not get block for txs".to_string(), @@ -593,8 +578,21 @@ impl Source { let mut calls = Vec::new(); for trace in traces.into_iter() { match trace { - GethTrace::Unknown(value) => calls.push(value), - _ => return Err(CollectError::CollectError("invalid trace result".to_string())), + TraceResult::Success { result, tx_hash } => match result { + GethTrace::JS(value) => calls.push(value), + _ => { + return Err(CollectError::CollectError(format!( + "invalid trace result in tx {:?}", + tx_hash + ))) + } + }, + TraceResult::Error { error, tx_hash } => { + return Err(CollectError::CollectError(format!( + "invalid trace result in tx {:?}: {}", + tx_hash, error + ))) + } } } Ok((block, txs, calls)) @@ -613,8 +611,21 @@ impl Source { let mut calls = Vec::new(); for trace in traces.into_iter() { match trace { - GethTrace::Known(GethTraceFrame::Default(frame)) => calls.push(frame), - _ => return Err(CollectError::CollectError("invalid trace result".to_string())), + TraceResult::Success { result, tx_hash } => match result { + GethTrace::Default(frame) => calls.push(frame), + _ => { + return Err(CollectError::CollectError(format!( + "invalid trace result in tx {:?}", + tx_hash + ))) + } + }, + TraceResult::Error { error, tx_hash } => { + return Err(CollectError::CollectError(format!( + "inalid trace result in tx {:?}: {}", + tx_hash, error + ))); + } } } Ok((block, txs, calls)) @@ -634,11 +645,27 @@ impl Source { let mut calls = Vec::new(); for trace in traces.into_iter() { match trace { - GethTrace::Known(GethTraceFrame::FourByteTracer(FourByteFrame(frame))) => { - calls.push(frame) + // GethTrace::Known(GethTraceFrame::FourByteTracer(FourByteFrame(frame))) => { + // calls.push(frame) + // } + // GethTrace::Known(GethTraceFrame::NoopTracer(_)) => {} + // _ => return Err(CollectError::CollectError("invalid trace result".to_string())), + TraceResult::Success { result, tx_hash } => match result { + GethTrace::FourByteTracer(frame) => calls.push(frame.0), + GethTrace::NoopTracer(_) => {} + _ => { + return Err(CollectError::CollectError(format!( + "invalid trace result in tx {:?}", + tx_hash + ))) + } + }, + TraceResult::Error { error, tx_hash } => { + return Err(CollectError::CollectError(format!( + "invalid trace result in tx {:?}: {}", + tx_hash, error + ))); } - GethTrace::Known(GethTraceFrame::NoopTracer(_)) => {} - _ => return Err(CollectError::CollectError("invalid trace result".to_string())), } } Ok((block, txs, calls)) @@ -649,7 +676,7 @@ impl Source { &self, block_number: u32, include_transaction_hashes: bool, - ) -> Result<(Option, Vec>>, Vec>)> { + ) -> Result<(Option, Vec>>, Vec>)> { let tracer = GethDebugTracerType::BuiltInTracer(GethDebugBuiltInTracerType::PreStateTracer); let options = GethDebugTracingOptions { tracer: Some(tracer), ..Default::default() }; let (block, txs, traces) = @@ -658,10 +685,25 @@ impl Source { let mut calls = Vec::new(); for trace in traces.into_iter() { match trace { - GethTrace::Known(GethTraceFrame::PreStateTracer(PreStateFrame::Default( - PreStateMode(frame), - ))) => calls.push(frame), - _ => return Err(CollectError::CollectError("invalid trace result".to_string())), + // GethTrace::Known(GethTraceFrame::PreStateTracer(PreStateFrame::Default( + // PreStateMode(frame), + // ))) => calls.push(frame), + // _ => return Err(CollectError::CollectError("invalid trace result".to_string())), + TraceResult::Success { result, tx_hash } => match result { + GethTrace::PreStateTracer(PreStateFrame::Default(frame)) => calls.push(frame.0), + _ => { + return Err(CollectError::CollectError(format!( + "invalid trace result in tx {:?}", + tx_hash + ))) + } + }, + TraceResult::Error { error, tx_hash } => { + return Err(CollectError::CollectError(format!( + "invalid trace result in tx {:?}: {}", + tx_hash, error + ))); + } } } Ok((block, txs, calls)) @@ -674,22 +716,37 @@ impl Source { include_transaction_hashes: bool, ) -> Result<(Option, Vec>>, Vec)> { let tracer = GethDebugTracerType::BuiltInTracer(GethDebugBuiltInTracerType::CallTracer); - let config = GethDebugTracerConfig::BuiltInTracer( - GethDebugBuiltInTracerConfig::CallTracer(CallConfig { ..Default::default() }), - ); - let options = GethDebugTracingOptions { - tracer: Some(tracer), - tracer_config: Some(config), - ..Default::default() - }; + // let config = GethDebugTracerConfig::BuiltInTracer( + // GethDebugBuiltInTracerConfig::CallTracer(CallConfig { ..Default::default() }), + // ); + let options = GethDebugTracingOptions::default() + .with_tracer(tracer) + .with_call_config(CallConfig::default()); let (block, txs, traces) = self.geth_debug_trace_block(block_number, options, include_transaction_hashes).await?; let mut calls = Vec::new(); for trace in traces.into_iter() { + // match trace { + // GethTrace::Known(GethTraceFrame::CallTracer(call_frame)) => + // calls.push(call_frame), _ => return + // Err(CollectError::CollectError("invalid trace result".to_string())), } match trace { - GethTrace::Known(GethTraceFrame::CallTracer(call_frame)) => calls.push(call_frame), - _ => return Err(CollectError::CollectError("invalid trace result".to_string())), + TraceResult::Success { result, tx_hash } => match result { + GethTrace::CallTracer(frame) => calls.push(frame), + _ => { + return Err(CollectError::CollectError(format!( + "invalid trace result in tx {:?}", + tx_hash + ))) + } + }, + TraceResult::Error { error, tx_hash } => { + return Err(CollectError::CollectError(format!( + "invalid trace result in tx {:?}: {}", + tx_hash, error + ))); + } } } Ok((block, txs, calls)) @@ -702,30 +759,41 @@ impl Source { include_transaction_hashes: bool, ) -> Result<(Option, Vec>>, Vec)> { let tracer = GethDebugTracerType::BuiltInTracer(GethDebugBuiltInTracerType::PreStateTracer); - let config = GethDebugTracerConfig::BuiltInTracer( - GethDebugBuiltInTracerConfig::PreStateTracer(PreStateConfig { diff_mode: Some(true) }), - ); - let options = GethDebugTracingOptions { - tracer: Some(tracer), - tracer_config: Some(config), - ..Default::default() - }; + // let config = GethDebugTracerConfig::BuiltInTracer( + // GethDebugBuiltInTracerConfig::PreStateTracer(PreStateConfig { diff_mode: Some(true) + // }), + let options = GethDebugTracingOptions::default() + .with_prestate_config(PreStateConfig { + diff_mode: Some(true), + disable_code: None, + disable_storage: None, + }) + .with_tracer(tracer); let (block, txs, traces) = self.geth_debug_trace_block(block_number, options, include_transaction_hashes).await?; let mut diffs = Vec::new(); for trace in traces.into_iter() { match trace { - GethTrace::Known(GethTraceFrame::PreStateTracer(PreStateFrame::Diff(diff))) => { - diffs.push(diff) - } - GethTrace::Unknown(ethers::utils::__serde_json::Value::Object(map)) => { - let diff = parse_geth_diff_object(map)?; - diffs.push(diff) - } - _ => { - println!("{:?}", trace); - return Err(CollectError::CollectError("invalid trace result".to_string())); + TraceResult::Success { result, tx_hash } => match result { + GethTrace::PreStateTracer(PreStateFrame::Diff(diff)) => diffs.push(diff), + GethTrace::JS(serde_json::Value::Object(map)) => { + let diff = parse_geth_diff_object(map)?; + diffs.push(diff); + } + _ => { + println!("{:?}", result); + return Err(CollectError::CollectError(format!( + "invalid trace result in tx {:?}", + tx_hash + ))); + } + }, + TraceResult::Error { error, tx_hash } => { + return Err(CollectError::CollectError(format!( + "invalid trace result in tx {:?}: {}", + tx_hash, error + ))); } } } @@ -739,19 +807,20 @@ impl Source { options: GethDebugTracingOptions, include_block_number: bool, ) -> Result<(Option, Vec>>, Vec)> { - let ethers_tx = H256::from_slice(&transaction_hash); + let ethers_tx = B256::from_slice(&transaction_hash); let trace = { let _permit = self.permit_request().await; - source_provider!(self, debug_trace_transaction(ethers_tx, options)) + self.provider + .debug_trace_transaction(ethers_tx, options) .await .map_err(CollectError::ProviderError)? }; let traces = vec![trace]; let block_number = if include_block_number { - match self.get_transaction(ethers_tx).await? { - Some(tx) => tx.block_number.map(|x| x.as_u32()), + match self.get_transaction_by_hash(ethers_tx).await? { + Some(tx) => tx.block_number.map(|x| x as u32), None => { return Err(CollectError::CollectError( "could not get block for txs".to_string(), @@ -781,7 +850,7 @@ impl Source { let mut calls = Vec::new(); for trace in traces.into_iter() { match trace { - GethTrace::Unknown(value) => calls.push(value), + GethTrace::JS(value) => calls.push(value), _ => return Err(CollectError::CollectError("invalid trace result".to_string())), } } @@ -802,7 +871,7 @@ impl Source { let mut calls = Vec::new(); for trace in traces.into_iter() { match trace { - GethTrace::Known(GethTraceFrame::Default(frame)) => calls.push(frame), + GethTrace::Default(frame) => calls.push(frame), _ => return Err(CollectError::CollectError("invalid trace result".to_string())), } } @@ -824,9 +893,7 @@ impl Source { let mut calls = Vec::new(); for trace in traces.into_iter() { match trace { - GethTrace::Known(GethTraceFrame::FourByteTracer(FourByteFrame(frame))) => { - calls.push(frame) - } + GethTrace::FourByteTracer(frame) => calls.push(frame.0), _ => return Err(CollectError::CollectError("invalid trace result".to_string())), } } @@ -838,7 +905,7 @@ impl Source { &self, transaction_hash: Vec, include_block_number: bool, - ) -> Result<(Option, Vec>>, Vec>)> { + ) -> Result<(Option, Vec>>, Vec>)> { let tracer = GethDebugTracerType::BuiltInTracer(GethDebugBuiltInTracerType::PreStateTracer); let options = GethDebugTracingOptions { tracer: Some(tracer), ..Default::default() }; let (block, txs, traces) = self @@ -848,9 +915,7 @@ impl Source { let mut calls = Vec::new(); for trace in traces.into_iter() { match trace { - GethTrace::Known(GethTraceFrame::PreStateTracer(PreStateFrame::Default( - PreStateMode(frame), - ))) => calls.push(frame), + GethTrace::PreStateTracer(PreStateFrame::Default(frame)) => calls.push(frame.0), _ => return Err(CollectError::CollectError("invalid trace result".to_string())), } } @@ -864,14 +929,12 @@ impl Source { include_block_number: bool, ) -> Result<(Option, Vec>>, Vec)> { let tracer = GethDebugTracerType::BuiltInTracer(GethDebugBuiltInTracerType::CallTracer); - let config = GethDebugTracerConfig::BuiltInTracer( - GethDebugBuiltInTracerConfig::CallTracer(CallConfig { ..Default::default() }), - ); - let options = GethDebugTracingOptions { - tracer: Some(tracer), - tracer_config: Some(config), - ..Default::default() - }; + // let config = GethDebugTracerConfig::BuiltInTracer( + // GethDebugBuiltInTracerConfig::CallTracer(CallConfig { ..Default::default() }), + // ); + let options = GethDebugTracingOptions::default() + .with_tracer(tracer) + .with_call_config(CallConfig::default()); let (block, txs, traces) = self .geth_debug_trace_transaction(transaction_hash, options, include_block_number) .await?; @@ -879,7 +942,9 @@ impl Source { let mut calls = Vec::new(); for trace in traces.into_iter() { match trace { - GethTrace::Known(GethTraceFrame::CallTracer(call_frame)) => calls.push(call_frame), + // GethTrace::Known(GethTraceFrame::CallTracer(call_frame)) => + // calls.push(call_frame), + GethTrace::CallTracer(frame) => calls.push(frame), _ => return Err(CollectError::CollectError("invalid trace result".to_string())), } } @@ -893,14 +958,12 @@ impl Source { include_transaction_hashes: bool, ) -> Result<(Option, Vec>>, Vec)> { let tracer = GethDebugTracerType::BuiltInTracer(GethDebugBuiltInTracerType::PreStateTracer); - let config = GethDebugTracerConfig::BuiltInTracer( - GethDebugBuiltInTracerConfig::PreStateTracer(PreStateConfig { diff_mode: Some(true) }), + // let config = GethDebugTracerConfig::BuiltInTracer( + // GethDebugBuiltInTracerConfig::PreStateTracer(PreStateConfig { diff_mode: Some(true) + // }), ); + let options = GethDebugTracingOptions::default().with_tracer(tracer).with_prestate_config( + PreStateConfig { diff_mode: Some(true), disable_code: None, disable_storage: None }, ); - let options = GethDebugTracingOptions { - tracer: Some(tracer), - tracer_config: Some(config), - ..Default::default() - }; let (block, txs, traces) = self .geth_debug_trace_transaction(transaction_hash, options, include_transaction_hashes) .await?; @@ -908,9 +971,10 @@ impl Source { let mut diffs = Vec::new(); for trace in traces.into_iter() { match trace { - GethTrace::Known(GethTraceFrame::PreStateTracer(PreStateFrame::Diff(diff))) => { - diffs.push(diff) - } + // GethTrace::Known(GethTraceFrame::PreStateTracer(PreStateFrame::Diff(diff))) => { + // diffs.push(diff) + // } + GethTrace::PreStateTracer(PreStateFrame::Diff(diff)) => diffs.push(diff), _ => return Err(CollectError::CollectError("invalid trace result".to_string())), } } @@ -930,7 +994,7 @@ impl Source { permit } - fn map_err(res: ::core::result::Result) -> Result { + fn map_err(res: ::core::result::Result>) -> Result { res.map_err(CollectError::ProviderError) } } @@ -938,12 +1002,10 @@ impl Source { use crate::err; use std::collections::BTreeMap; -fn parse_geth_diff_object( - map: ethers::utils::__serde_json::Map, -) -> Result { - let pre: BTreeMap = serde_json::from_value(map["pre"].clone()) +fn parse_geth_diff_object(map: serde_json::Map) -> Result { + let pre: BTreeMap = serde_json::from_value(map["pre"].clone()) .map_err(|_| err("cannot deserialize pre diff"))?; - let post: BTreeMap = serde_json::from_value(map["post"].clone()) + let post: BTreeMap = serde_json::from_value(map["post"].clone()) .map_err(|_| err("cannot deserialize pre diff"))?; Ok(DiffMode { pre, post }) diff --git a/crates/python/rust/collect_adapter.rs b/crates/python/rust/collect_adapter.rs index 0f8e467..d17fa26 100644 --- a/crates/python/rust/collect_adapter.rs +++ b/crates/python/rust/collect_adapter.rs @@ -31,6 +31,7 @@ use cryo_freeze::collect; chunk_order = None, max_retries = 10, initial_backoff = 500, + compute_units_per_second = 50, dry = false, chunk_size = 1000, n_chunks = None, @@ -92,6 +93,7 @@ pub fn _collect( chunk_order: Option, max_retries: u32, initial_backoff: u64, + compute_units_per_second: u64, dry: bool, chunk_size: u64, n_chunks: Option, @@ -157,6 +159,7 @@ pub fn _collect( chunk_order, max_retries, initial_backoff, + compute_units_per_second, dry, chunk_size, n_chunks, diff --git a/crates/python/rust/freeze_adapter.rs b/crates/python/rust/freeze_adapter.rs index 5b7616e..f40317a 100644 --- a/crates/python/rust/freeze_adapter.rs +++ b/crates/python/rust/freeze_adapter.rs @@ -28,6 +28,7 @@ use cryo_cli::{run, Args}; chunk_order = None, max_retries = 10, initial_backoff = 500, + compute_units_per_second = 50, dry = false, chunk_size = 1000, n_chunks = None, @@ -89,6 +90,7 @@ pub fn _freeze( chunk_order: Option, max_retries: u32, initial_backoff: u64, + compute_units_per_second: u64, dry: bool, chunk_size: u64, n_chunks: Option, @@ -149,6 +151,7 @@ pub fn _freeze( chunk_order, max_retries, initial_backoff, + compute_units_per_second, dry, chunk_size, n_chunks, diff --git a/crates/to_df/src/lib.rs b/crates/to_df/src/lib.rs index 97f10c2..6ab9332 100644 --- a/crates/to_df/src/lib.rs +++ b/crates/to_df/src/lib.rs @@ -98,47 +98,47 @@ pub fn to_df(attrs: TokenStream, input: TokenStream) -> TokenStream { } } - use ethers_core::abi::ParamType; - // Write columns even if there are no values decoded - indicates empty dataframe let chunk_len = self.n_rows; if self.event_cols.is_empty() { for param in decoder.event.inputs.iter() { let name = "event__".to_string() + param.name.as_str(); let name = name.as_str(); - match param.kind { - ParamType::Address => { + let ty = DynSolType::parse(¶m.ty).unwrap(); + match ty { + DynSolType::Address => { match schema.binary_type { ColumnEncoding::Binary => cols.push(Series::new(name, Vec::>::new())), ColumnEncoding::Hex => cols.push(Series::new(name, Vec::::new())), } }, - ParamType::Bytes => { + DynSolType::Bytes => { match schema.binary_type { ColumnEncoding::Binary => cols.push(Series::new(name, Vec::>::new())), ColumnEncoding::Hex => cols.push(Series::new(name, Vec::::new())), } }, - ParamType::Int(bits) => { + DynSolType::Int(bits) => { if bits <= 64 { cols.push(Series::new(name, Vec::::new())) } else { create_empty_u256_columns(&mut cols, name, &u256_types, &schema.binary_type) } }, - ParamType::Uint(bits) => { + DynSolType::Uint(bits) => { if bits <= 64 { cols.push(Series::new(name, Vec::::new())) } else { create_empty_u256_columns(&mut cols, name, &u256_types, &schema.binary_type) } }, - ParamType::Bool => cols.push(Series::new(name, Vec::::new())), - ParamType::String => cols.push(Series::new(name, Vec::::new())), - ParamType::Array(_) => return Err(err("could not generate Array column")), - ParamType::FixedBytes(_) => return Err(err("could not generate FixedBytes column")), - ParamType::FixedArray(_, _) => return Err(err("could not generate FixedArray column")), - ParamType::Tuple(_) => return Err(err("could not generate Tuple column")), + DynSolType::Bool => cols.push(Series::new(name, Vec::::new())), + DynSolType::String => cols.push(Series::new(name, Vec::::new())), + DynSolType::Array(_) => return Err(err("could not generate Array column")), + DynSolType::FixedBytes(_) => return Err(err("could not generate FixedBytes column")), + DynSolType::FixedArray(_, _) => return Err(err("could not generate FixedArray column")), + DynSolType::Tuple(_) => return Err(err("could not generate Tuple column")), + DynSolType::Function => return Err(err("could not generate Function column")), _ => (), } } From 92babbee3c1a8c14c935bb707b90f46f11b4f3ed Mon Sep 17 00:00:00 2001 From: sslivkoff Date: Mon, 6 Jan 2025 04:00:32 +0000 Subject: [PATCH 37/49] tweaks to bring equivalence to ethers cryo --- crates/freeze/src/datasets/blocks.rs | 4 +- crates/freeze/src/datasets/transactions.rs | 51 ++++++++++++++++--- .../multi_datasets/blocks_and_transactions.rs | 14 ++--- crates/freeze/src/types/sources.rs | 13 +++-- 4 files changed, 56 insertions(+), 26 deletions(-) diff --git a/crates/freeze/src/datasets/blocks.rs b/crates/freeze/src/datasets/blocks.rs index 5ee02e7..d259a79 100644 --- a/crates/freeze/src/datasets/blocks.rs +++ b/crates/freeze/src/datasets/blocks.rs @@ -17,7 +17,7 @@ pub struct Blocks { state_root: Vec>, transactions_root: Vec>, receipts_root: Vec>, - block_number: Vec>, + block_number: Vec>, gas_used: Vec, gas_limit: Vec, extra_data: Vec>, @@ -108,7 +108,7 @@ pub(crate) fn process_block(block: Block, columns: &mut Blocks, schema: store!(schema, columns, state_root, block.header.state_root.0.to_vec()); store!(schema, columns, transactions_root, block.header.transactions_root.0.to_vec()); store!(schema, columns, receipts_root, block.header.receipts_root.0.to_vec()); - store!(schema, columns, block_number, Some(block.header.number)); + store!(schema, columns, block_number, Some(block.header.number as u32)); store!(schema, columns, gas_used, block.header.gas_used); store!(schema, columns, gas_limit, block.header.gas_limit); store!(schema, columns, extra_data, block.header.extra_data.to_vec()); diff --git a/crates/freeze/src/datasets/transactions.rs b/crates/freeze/src/datasets/transactions.rs index 0f4f95f..dbb1b28 100644 --- a/crates/freeze/src/datasets/transactions.rs +++ b/crates/freeze/src/datasets/transactions.rs @@ -66,7 +66,6 @@ impl Dataset for Transactions { "n_input_bytes", "n_input_zero_bytes", "n_input_nonzero_bytes", - "n_rlp_bytes", "chain_id", ]) } @@ -143,6 +142,7 @@ impl CollectByBlock for Transactions { let schema = query.schemas.get_schema(&Datatype::Transactions)?; let (block, transactions_with_receipts, exclude_failed) = response; for (tx, receipt) in transactions_with_receipts.into_iter() { + let gas_price = get_gas_price(&block, &tx); process_transaction( tx, receipt, @@ -150,6 +150,7 @@ impl CollectByBlock for Transactions { schema, exclude_failed, block.header.timestamp as u32, + gas_price )?; } Ok(()) @@ -158,7 +159,7 @@ impl CollectByBlock for Transactions { #[async_trait::async_trait] impl CollectByTransaction for Transactions { - type Response = (TransactionAndReceipt, bool, u32); + type Response = (TransactionAndReceipt, Block, bool, u32); async fn extract(request: Params, source: Arc, query: Arc) -> R { let tx_hash = request.ethers_transaction_hash()?; @@ -184,13 +185,22 @@ impl CollectByTransaction for Transactions { let timestamp = block.header.timestamp as u32; - Ok(((transaction, receipt), query.exclude_failed, timestamp)) + Ok(((transaction, receipt), block, query.exclude_failed, timestamp)) } fn transform(response: Self::Response, columns: &mut Self, query: &Arc) -> R<()> { let schema = query.schemas.get_schema(&Datatype::Transactions)?; - let ((transaction, receipt), exclude_failed, timestamp) = response; - process_transaction(transaction, receipt, columns, schema, exclude_failed, timestamp)?; + let ((transaction, receipt), block, exclude_failed, timestamp) = response; + let gas_price = get_gas_price(&block, &transaction); + process_transaction( + transaction, + receipt, + columns, + schema, + exclude_failed, + timestamp, + gas_price + )?; Ok(()) } } @@ -202,6 +212,7 @@ pub(crate) fn process_transaction( schema: &Table, exclude_failed: bool, timestamp: u32, + gas_price: Option, ) -> R<()> { let success = if exclude_failed | schema.has_column("success") { let success = tx_success(&tx, &receipt)?; @@ -244,10 +255,11 @@ pub(crate) fn process_transaction( } // in alloy eip2718_encoded_length is rlp_encoded_length store!(schema, columns, n_rlp_bytes, tx.inner.eip2718_encoded_length() as u32); - store!(schema, columns, gas_used, receipt.map(|r| r.gas_used as u64)); - store!(schema, columns, gas_price, tx.inner.gas_price().map(|gas_price| gas_price as u64)); + store!(schema, columns, gas_used, receipt.as_ref().map(|r| r.gas_used as u64)); + // store!(schema, columns, gas_price, Some(receipt.unwrap().effective_gas_price as u64)); + store!(schema, columns, gas_price, gas_price); store!(schema, columns, transaction_type, tx.inner.tx_type() as u32); - store!(schema, columns, max_fee_per_gas, Some(tx.inner.max_fee_per_gas() as u64)); + store!(schema, columns, max_fee_per_gas, get_max_fee_per_gas(&tx)); store!( schema, columns, @@ -264,6 +276,29 @@ pub(crate) fn process_transaction( Ok(()) } +fn get_max_fee_per_gas(tx: &Transaction) -> Option { + match &tx.inner { + alloy::consensus::TxEnvelope::Legacy(_) => None, + alloy::consensus::TxEnvelope::Eip2930(_) => None, + _ => Some(tx.inner.max_fee_per_gas() as u64), + } +} + +pub(crate) fn get_gas_price(block: &Block, tx: &Transaction) -> Option { + match &tx.inner { + alloy::consensus::TxEnvelope::Legacy(_) => tx.gas_price().map(|gas_price| gas_price as u64), + alloy::consensus::TxEnvelope::Eip2930(_) => tx.gas_price().map(|gas_price| gas_price as u64), + _ => { + let base_fee_per_gas = block.header.inner.base_fee_per_gas.unwrap(); + let priority_fee = std::cmp::min( + tx.inner.max_priority_fee_per_gas().unwrap() as u64, + tx.inner.max_fee_per_gas() as u64 - base_fee_per_gas, + ); + Some(base_fee_per_gas + priority_fee) + } + } +} + fn tx_success(tx: &Transaction, receipt: &Option) -> R { if let Some(r) = receipt { Ok(r.status()) diff --git a/crates/freeze/src/multi_datasets/blocks_and_transactions.rs b/crates/freeze/src/multi_datasets/blocks_and_transactions.rs index 4825e65..708856c 100644 --- a/crates/freeze/src/multi_datasets/blocks_and_transactions.rs +++ b/crates/freeze/src/multi_datasets/blocks_and_transactions.rs @@ -1,5 +1,4 @@ use crate::{datasets::transactions, types::collection::*, Datatype, *}; -use alloy::rpc::types::BlockTransactionsKind; use polars::prelude::*; use std::collections::HashMap; @@ -47,19 +46,15 @@ impl CollectByTransaction for BlocksAndTransactions { ); async fn extract(request: Params, source: Arc, query: Arc) -> R { - let ((tx, receipt), exclude_failed, timestamp) = + let ((tx, receipt), block, exclude_failed, timestamp) = ::extract(request, source.clone(), query).await?; - let block_number = tx.block_number.ok_or(err("no block number for tx"))?; - let block = source - .get_block(block_number, BlockTransactionsKind::Hashes) - .await? - .ok_or(CollectError::CollectError("block not found".to_string()))?; - Ok((block, ((tx, receipt), exclude_failed, timestamp))) + Ok((block.clone(), ((tx, receipt), block, exclude_failed, timestamp))) } fn transform(response: Self::Response, columns: &mut Self, query: &Arc) -> R<()> { let BlocksAndTransactions(blocks, transactions) = columns; - let (block, ((tx, receipt), exclude_failed, timestamp)) = response; + let (block, ((tx, receipt), _, exclude_failed, timestamp)) = response; + let gas_price = transactions::get_gas_price(&block, &tx); let schema = query.schemas.get_schema(&Datatype::Blocks)?; blocks::process_block(block, blocks, schema)?; let schema = query.schemas.get_schema(&Datatype::Transactions)?; @@ -70,6 +65,7 @@ impl CollectByTransaction for BlocksAndTransactions { schema, exclude_failed, timestamp, + gas_price )?; Ok(()) } diff --git a/crates/freeze/src/types/sources.rs b/crates/freeze/src/types/sources.rs index e718c56..5bbcfa6 100644 --- a/crates/freeze/src/types/sources.rs +++ b/crates/freeze/src/types/sources.rs @@ -259,15 +259,14 @@ impl Source { // get transactions let txs = if include_transaction_hashes { - self.get_block(block as u64, BlockTransactionsKind::Hashes) + let transactions = self.get_block(block as u64, BlockTransactionsKind::Hashes) .await? .ok_or(CollectError::CollectError("could not find block".to_string()))? - .transactions - .as_transactions() - .unwrap() - .iter() - .map(|tx| Some(tx.inner.tx_hash().to_vec())) - .collect() + .transactions; + match transactions { + BlockTransactions::Hashes(hashes) => hashes.into_iter().map(|tx| Some(tx.to_vec())).collect(), + _ => return Err(CollectError::CollectError("wrong transaction format".to_string())) + } } else { vec![None; result.len()] }; From cbb214edf0085b7f2e57f50a37bb01f9e959bbde Mon Sep 17 00:00:00 2001 From: sslivkoff Date: Mon, 6 Jan 2025 04:03:50 +0000 Subject: [PATCH 38/49] cargo fmt --- crates/freeze/src/datasets/transactions.rs | 8 +++++--- .../freeze/src/multi_datasets/blocks_and_transactions.rs | 2 +- crates/freeze/src/types/sources.rs | 9 ++++++--- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/crates/freeze/src/datasets/transactions.rs b/crates/freeze/src/datasets/transactions.rs index dbb1b28..a2c7ac0 100644 --- a/crates/freeze/src/datasets/transactions.rs +++ b/crates/freeze/src/datasets/transactions.rs @@ -150,7 +150,7 @@ impl CollectByBlock for Transactions { schema, exclude_failed, block.header.timestamp as u32, - gas_price + gas_price, )?; } Ok(()) @@ -199,7 +199,7 @@ impl CollectByTransaction for Transactions { schema, exclude_failed, timestamp, - gas_price + gas_price, )?; Ok(()) } @@ -287,7 +287,9 @@ fn get_max_fee_per_gas(tx: &Transaction) -> Option { pub(crate) fn get_gas_price(block: &Block, tx: &Transaction) -> Option { match &tx.inner { alloy::consensus::TxEnvelope::Legacy(_) => tx.gas_price().map(|gas_price| gas_price as u64), - alloy::consensus::TxEnvelope::Eip2930(_) => tx.gas_price().map(|gas_price| gas_price as u64), + alloy::consensus::TxEnvelope::Eip2930(_) => { + tx.gas_price().map(|gas_price| gas_price as u64) + } _ => { let base_fee_per_gas = block.header.inner.base_fee_per_gas.unwrap(); let priority_fee = std::cmp::min( diff --git a/crates/freeze/src/multi_datasets/blocks_and_transactions.rs b/crates/freeze/src/multi_datasets/blocks_and_transactions.rs index 708856c..169aeed 100644 --- a/crates/freeze/src/multi_datasets/blocks_and_transactions.rs +++ b/crates/freeze/src/multi_datasets/blocks_and_transactions.rs @@ -65,7 +65,7 @@ impl CollectByTransaction for BlocksAndTransactions { schema, exclude_failed, timestamp, - gas_price + gas_price, )?; Ok(()) } diff --git a/crates/freeze/src/types/sources.rs b/crates/freeze/src/types/sources.rs index 5bbcfa6..04b5c69 100644 --- a/crates/freeze/src/types/sources.rs +++ b/crates/freeze/src/types/sources.rs @@ -259,13 +259,16 @@ impl Source { // get transactions let txs = if include_transaction_hashes { - let transactions = self.get_block(block as u64, BlockTransactionsKind::Hashes) + let transactions = self + .get_block(block as u64, BlockTransactionsKind::Hashes) .await? .ok_or(CollectError::CollectError("could not find block".to_string()))? .transactions; match transactions { - BlockTransactions::Hashes(hashes) => hashes.into_iter().map(|tx| Some(tx.to_vec())).collect(), - _ => return Err(CollectError::CollectError("wrong transaction format".to_string())) + BlockTransactions::Hashes(hashes) => { + hashes.into_iter().map(|tx| Some(tx.to_vec())).collect() + } + _ => return Err(CollectError::CollectError("wrong transaction format".to_string())), } } else { vec![None; result.len()] From 01b1d812364c83d0b2341061708d59b1a7d502ce Mon Sep 17 00:00:00 2001 From: sslivkoff Date: Mon, 6 Jan 2025 04:13:31 +0000 Subject: [PATCH 39/49] add cryo_test testing framework --- crates/python/python/cryo_test/README.md | 35 +++ .../python/cryo_test/cryo_test/__init__.py | 6 + .../python/cryo_test/cryo_test/__main__.py | 7 + .../cryo_test/cryo_test/cli/__init__.py | 10 + .../cryo_test/cryo_test/cli/cli_classes.py | 97 +++++++ .../python/cryo_test/cryo_test/cli/cli_run.py | 212 +++++++++++++++ .../cryo_test/cryo_test/cli/cli_summary.py | 92 +++++++ .../cryo_test/cryo_test/cli/cli_utils.py | 62 +++++ .../cryo_test/cryo_test/commands/__init__.py | 3 + .../cryo_test/commands/command_generation.py | 199 ++++++++++++++ .../cryo_test/commands/command_parsing.py | 57 ++++ .../cryo_test/commands/command_types.py | 25 ++ .../python/cryo_test/cryo_test/comparison.py | 257 ++++++++++++++++++ .../python/cryo_test/cryo_test/defaults.py | 94 +++++++ .../cryo_test/cryo_test/files/__init__.py | 2 + .../cryo_test/cryo_test/files/file_io.py | 53 ++++ .../cryo_test/cryo_test/files/file_paths.py | 146 ++++++++++ .../cryo_test/cryo_test/polars_utils.py | 171 ++++++++++++ .../python/cryo_test/cryo_test/scripts.py | 43 +++ .../examples/ethers_vs_alloy/build_cryo | 77 ++++++ .../ethers_vs_alloy/compare_alloy_to_ethers | 10 + crates/python/python/cryo_test/pyproject.toml | 70 +++++ 22 files changed, 1728 insertions(+) create mode 100644 crates/python/python/cryo_test/README.md create mode 100644 crates/python/python/cryo_test/cryo_test/__init__.py create mode 100644 crates/python/python/cryo_test/cryo_test/__main__.py create mode 100644 crates/python/python/cryo_test/cryo_test/cli/__init__.py create mode 100644 crates/python/python/cryo_test/cryo_test/cli/cli_classes.py create mode 100644 crates/python/python/cryo_test/cryo_test/cli/cli_run.py create mode 100644 crates/python/python/cryo_test/cryo_test/cli/cli_summary.py create mode 100644 crates/python/python/cryo_test/cryo_test/cli/cli_utils.py create mode 100644 crates/python/python/cryo_test/cryo_test/commands/__init__.py create mode 100644 crates/python/python/cryo_test/cryo_test/commands/command_generation.py create mode 100644 crates/python/python/cryo_test/cryo_test/commands/command_parsing.py create mode 100644 crates/python/python/cryo_test/cryo_test/commands/command_types.py create mode 100644 crates/python/python/cryo_test/cryo_test/comparison.py create mode 100644 crates/python/python/cryo_test/cryo_test/defaults.py create mode 100644 crates/python/python/cryo_test/cryo_test/files/__init__.py create mode 100644 crates/python/python/cryo_test/cryo_test/files/file_io.py create mode 100644 crates/python/python/cryo_test/cryo_test/files/file_paths.py create mode 100644 crates/python/python/cryo_test/cryo_test/polars_utils.py create mode 100644 crates/python/python/cryo_test/cryo_test/scripts.py create mode 100755 crates/python/python/cryo_test/examples/ethers_vs_alloy/build_cryo create mode 100755 crates/python/python/cryo_test/examples/ethers_vs_alloy/compare_alloy_to_ethers create mode 100644 crates/python/python/cryo_test/pyproject.toml diff --git a/crates/python/python/cryo_test/README.md b/crates/python/python/cryo_test/README.md new file mode 100644 index 0000000..1fce65c --- /dev/null +++ b/crates/python/python/cryo_test/README.md @@ -0,0 +1,35 @@ + +# cryo test + +utility for performing comparisons between cryo environments + +```bash +cryo_test is a cli tool for comparing cryo outputs across different conditions + +Usage: cryo_test QUERY [OPTIONS] + +This will 1. setup comparison dir, 2. collect data, and 3. compare outputs + +Examples: + cryo_test --rpc source1=https://h1.com source2=https://h2.com (compare rpc's) + cryo_test --executable old=/path/to/cryo1 new=/path/to/cryo2 (compare executables) + cryo_test --python ... (use python) + cryo_test --cli-vs-python ... (compare cli vs python) + +Options: + -h, --help show this help message and exit + -e, --executable, --executables EXECUTABLE [...] + executable(s) to use + --rpc RPC [...] rpc endpoint(s) to use + -d, --datatype, --datatypes DATATYPE [...] + datatype(s) to collect + -p, --python use python for all batches + --cli-vs-python compare cli to python + -r, --rerun rerun previous comparison + --label LABEL name of comparison + -s, --steps {setup,collect,compare} [...] steps to perform {setup, collect, compare} + --dir DIR directory for storing comparison data + -i, --interactive load data in interactive python session + --scan-interactive scan data in interactive python session + --debug, --pdb enter debug mode upon error +``` diff --git a/crates/python/python/cryo_test/cryo_test/__init__.py b/crates/python/python/cryo_test/cryo_test/__init__.py new file mode 100644 index 0000000..d68cdf3 --- /dev/null +++ b/crates/python/python/cryo_test/cryo_test/__init__.py @@ -0,0 +1,6 @@ +"""library for performing comparisons between cryo jobs""" + +from .comparison import perform_comparison + + +__version__ = '0.1.0' diff --git a/crates/python/python/cryo_test/cryo_test/__main__.py b/crates/python/python/cryo_test/cryo_test/__main__.py new file mode 100644 index 0000000..6c49d97 --- /dev/null +++ b/crates/python/python/cryo_test/cryo_test/__main__.py @@ -0,0 +1,7 @@ +from __future__ import annotations + +from . import cli + + +if __name__ == '__main__': + cli.run_cli() diff --git a/crates/python/python/cryo_test/cryo_test/cli/__init__.py b/crates/python/python/cryo_test/cryo_test/cli/__init__.py new file mode 100644 index 0000000..b4ffdd2 --- /dev/null +++ b/crates/python/python/cryo_test/cryo_test/cli/__init__.py @@ -0,0 +1,10 @@ +from __future__ import annotations + +from .cli_classes import * +from .cli_run import * +from .cli_summary import * +from .cli_utils import * + + +if __name__ == '__main__': + run_cli() diff --git a/crates/python/python/cryo_test/cryo_test/cli/cli_classes.py b/crates/python/python/cryo_test/cryo_test/cli/cli_classes.py new file mode 100644 index 0000000..2d9e436 --- /dev/null +++ b/crates/python/python/cryo_test/cryo_test/cli/cli_classes.py @@ -0,0 +1,97 @@ +from __future__ import annotations + +import argparse +import typing + +import rich_argparse + +if typing.TYPE_CHECKING: + import typing_extensions + + +usage_template = """%(prog)s [{prog}]QUERY [OPTIONS][/{prog}]\n\n + +[{help} not bold]This will 1. setup comparison dir, 2. collect data, and 3. compare outputs[/{help} not bold] + +[{groups}]Examples:[/{groups}] + [{prog}]cryo_test --rpc source1=https://h1.com source2=https://h2.com[/{prog}] (compare rpc's) + [{prog}]cryo_test --executable old=/path/to/cryo1 new=/path/to/cryo2[/{prog}] (compare executables) + [{prog}]cryo_test --python ...[/{prog}] (use python) + [{prog}]cryo_test --cli-vs-python ...[/{prog}] (compare cli vs python)""" + + +class CryoTestHelpFormatter(rich_argparse.RichHelpFormatter): + usage_markup = True + + styles = { + 'argparse.prog': 'bold white', + 'argparse.groups': 'bold rgb(0,255,0)', + 'argparse.args': 'bold white', + 'argparse.metavar': 'grey62', + 'argparse.help': 'grey62', + 'argparse.text': 'blue', + 'argparse.syntax': 'blue', + 'argparse.default': 'blue', + } + + def __init__(self, prog: str) -> None: + super().__init__('cryo_test', max_help_position=45) + + def _format_args(self, action, default_metavar): # type: ignore + get_metavar = self._metavar_formatter(action, default_metavar) + if action.nargs == argparse.ZERO_OR_MORE: + return '[%s [%s ...]]' % get_metavar(2) + elif action.nargs == argparse.ONE_OR_MORE: + return '%s [...]' % get_metavar(1) + return super()._format_args(action, default_metavar) + + def format_help(self) -> str: + import rich + + line = '[{prog}]cryo_test[/{prog}] [{help}]is a cli tool for comparing [{prog}]cryo[/{prog}] outputs across different conditions\n' + rich.print(self.format_styles(line)) + + # indent certain arguments for full alignment + raw = super().format_help() + lines = raw.split('\n') + for i, line in enumerate(lines): + if line.startswith(' \x1b[38;2;197;149;242m--'): + lines[i] = ' ' + lines[i].replace(' ', '', 1) + + # indices = [i for i, line in enumerate(lines) if line.startswith(' \x1b[1;37m--')] + # if lines[indices[0]] == '': + # lines = lines[:indices[0]] + ['FUCK'] + lines[indices[0]:] + + # lines = [ + # line + # for line in lines + # if 'Options:' not in line and '--help' not in line + # ] + return '\n'.join(lines).replace('\n\n\n', '\n\n') + + @classmethod + def format_styles(cls, s: str) -> str: + styles = {k.split('.')[1]: v for k, v in cls.styles.items()} + return s.format(**styles) + + +class CryoTestArgParser(argparse.ArgumentParser): + def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: + return super().__init__( + *args, + formatter_class=CryoTestHelpFormatter, # type: ignore + usage=CryoTestHelpFormatter.format_styles(usage_template), + **kwargs, + ) + + def error(self, message: str) -> typing_extensions.NoReturn: + import sys + import rich + + sys.stderr.write(f'Error: {message}\n') + print() + self.print_usage() + print() + line = '[{help}]show all options with[/{help}] [bold white]cryo_test -h[/bold white]' + rich.print(CryoTestHelpFormatter.format_styles(line)) + sys.exit(0) diff --git a/crates/python/python/cryo_test/cryo_test/cli/cli_run.py b/crates/python/python/cryo_test/cryo_test/cli/cli_run.py new file mode 100644 index 0000000..6e26d4b --- /dev/null +++ b/crates/python/python/cryo_test/cryo_test/cli/cli_run.py @@ -0,0 +1,212 @@ +from __future__ import annotations + +import typing + +from .. import commands +from .. import comparison +from .. import files +from . import cli_classes +from . import cli_summary +from . import cli_utils + +if typing.TYPE_CHECKING: + import argparse + + +def run_cli() -> None: + try: + # parse inputs + args = parse_args() + + if set(args.steps) in [ + {'compare'}, + {'collect'}, + {'collect', 'compare'}, + ]: + rerun = True + else: + rerun = args.rerun + + # load commands + if rerun: + if args.dir is not None: + comparison_dir = args.dir + else: + comparison_dir = files.get_most_recent_comparison_dir() + batches = files.load_commands(comparison_dir) + else: + comparison_dir, batches = create_command_batches(args) + files.save_commands(comparison_dir=comparison_dir, batches=batches) + + # summarize + cli_summary.summarize_args(args, comparison_dir, batches) + + # perform comparison + comparison.perform_comparison( + batches=batches, + comparison_dir=comparison_dir, + steps=args.steps, + ) + + # enter interactive session + if args.interactive or args.scan_interactive: + print('entering interactive session') + if args.scan_interactive: + all_data: typing.Any = files.scan_all_data(comparison_dir) + else: + all_data = files.load_all_data(comparison_dir) + cli_utils.open_interactive_session({'data': all_data}) + except Exception as e: + if args.debug: + cli_utils._enter_debugger() + else: + raise e + + +def parse_args() -> argparse.Namespace: + parser = cli_classes.CryoTestArgParser() + # + # specifying batch args + parser.add_argument( + '-e', + '--executable', + '--executables', + nargs='+', + help='executable(s) to use', + ) + parser.add_argument('--rpc', nargs='+', help='rpc endpoint(s) to use') + parser.add_argument( + '-d', + '--datatype', + '--datatypes', + nargs='+', + help='datatype(s) to collect', + ) + parser.add_argument( + '-p', '--python', action='store_true', help='use python for all batches' + ) + parser.add_argument( + '--cli-vs-python', action='store_true', help='compare cli to python' + ) + # + # specifying how to run + parser.add_argument( + '-r', '--rerun', action='store_true', help='rerun previous comparison' + ) + parser.add_argument('--label', help='name of comparison') + parser.add_argument( + '-s', + '--steps', + help='steps to perform {setup, collect, compare}', + nargs='+', + choices=['setup', 'collect', 'compare'], + default=['setup', 'collect', 'compare'], + ) + parser.add_argument('--dir', help='directory for storing comparison data') + parser.add_argument( + '-i', + '--interactive', + action='store_true', + help='load data in interactive python session', + ) + parser.add_argument( + '--scan-interactive', + action='store_true', + help='scan data in interactive python session', + ) + parser.add_argument( + '--debug', + '--pdb', + action='store_true', + help='enter debug mode upon error', + ) + return parser.parse_args() + + +def create_command_batches( + args: argparse.Namespace, +) -> tuple[str, dict[str, dict[str, str]]]: + command_arg_combos: dict[str, list[str]] = {} + common_command_args: commands.PartialCommandArgs = {} + batch_specific_args: dict[str, commands.PartialCommandArgs] = {} + + # determine batch mode (the variables that change across batches) + if args.executable is not None and len(args.executable) > 1: + batch_mode = 'executable' + elif args.rpc is not None and len(args.rpc) > 1: + batch_mode = 'rpc' + else: + batch_mode = 'default' + + # determine comparison dir + comparison_dir = files.create_comparison_dir(args.dir, args.label) + + # determine interface + if args.python: + common_command_args['interface'] = 'python' + + # + if batch_mode == 'default': + batch_specific_args = {'default': {}} + + # arg: executable + if batch_mode == 'executable': + for raw_executable in args.executable: + batch_name, executable = raw_executable.split('=', maxsplit=1) + batch_specific_args[batch_name] = {'executable': executable} + else: + if args.executable is None: + common_command_args['executable'] = 'cryo' + elif len(args.executable) == 1: + common_command_args['executable'] = args.executable[0] + else: + raise Exception() + + # arg: rpc + if batch_mode == 'rpc': + for raw_rpc in args.rpcs: + batch_name, rpc = raw_rpc.split('=', maxsplits=1) + batch_specific_args[batch_name] = {'rpc': rpc} + else: + if args.rpc is None: + pass + elif len(args.rpc) == 1: + common_command_args['rpc'] = args.rpc[0] + else: + raise Exception() + + # arg: datatypes + if args.datatype is not None: + command_arg_combos['datatype'] = args.datatype + + # if cli-vs-python, create cli and python version of each batch + if args.cli_vs_python: + new_batch_specific_args = {} + for batch_name, batch_kwargs in batch_specific_args.items(): + new_batch_specific_args[batch_name + '_cli'] = dict( + batch_kwargs, interface='cli' + ) + new_batch_specific_args[batch_name + '_python'] = dict( + batch_kwargs, interface='python' + ) + + # arg: output_dir + for batch_name in batch_specific_args.keys(): + batch_specific_args[batch_name]['data_root'] = files.get_batch_data_dir( + comparison_dir=comparison_dir, + batch_name=batch_name, + ) + + # generate commands + batches = {} + for batch_name in batch_specific_args.keys(): + kwargs: commands.PartialCommandArgs = dict( + **common_command_args, **batch_specific_args[batch_name] + ) + batches[batch_name] = commands.generate_commands( + common_command_args=kwargs, + command_arg_combos=command_arg_combos, + ) + + return comparison_dir, batches + diff --git a/crates/python/python/cryo_test/cryo_test/cli/cli_summary.py b/crates/python/python/cryo_test/cryo_test/cli/cli_summary.py new file mode 100644 index 0000000..b24a71a --- /dev/null +++ b/crates/python/python/cryo_test/cryo_test/cli/cli_summary.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +import typing + +if typing.TYPE_CHECKING: + import argparse + + +def summarize_args( + args: argparse.Namespace, + comparison_dir: str, + batches: dict[str, dict[str, str]], +) -> None: + print_text_box('cryo test') + print() + print_header('parameters') + print_bullet(key='re-running previous job:', value=args.rerun) + print_bullet(key='directory', value=comparison_dir) + print_bullet(key='steps', value=', '.join(args.steps)) + + # argument: rpc + if args.rpc is not None: + if len(args.rpc) == 1: + print_bullet(key='rpc', value=args.rpc[0]) + else: + print_bullet(key='rpc', value=None) # type: ignore + for rpc in args.rpc: + print_bullet(key=rpc, value=None, indent=4) # type: ignore + else: + print_bullet(key='rpc', value='\[default]') # noqa: W605 + + # argument: executable + if args.executable is not None: + if len(args.executable) == 1: + print_bullet(key='executable', value=args.executable[0]) + else: + print_bullet(key='executable', value=None) # type: ignore + for executable in args.executable: + print_bullet(key=None, value=executable, indent=4) # type: ignore + else: + print_bullet(key='executable', value='\[default]') # noqa: W605 + + # argument: python + if args.cli_vs_python or args.python: + if args.cli_vs_python: + print_bullet(key='interface', value='cli, python') + else: + print_bullet(key='interface', value='python') + else: + print_bullet(key='interactive', value='cli') + + # argument: interactive + if args.interactive or args.scan_interactive: + if args.scan_interactive: + print_bullet(key='interactive', value="yes, scanning LazyFrame's") + else: + print_bullet(key='interactive', value="yes, loading DataFrame's") + else: + print_bullet(key='interactive', value='no') + + print() + print_header('comparing ' + str(len(batches)) + ' cryo contexts') + for batch_name in batches.keys(): + print_bullet(key=None, value=batch_name) # type: ignore + if len(batches) == 0: + print('[none]') + print() + print() + + +def print_text_box(text: str) -> None: + import toolstr + + header_kwargs = {'style': 'rgb(0,255,0)', 'text_style': 'white bold'} + toolstr.print_text_box(text, **header_kwargs) # type: ignore + + +def print_header(text: str) -> None: + import toolstr + + header_kwargs = {'style': 'rgb(0,255,0)', 'text_style': 'white bold'} + toolstr.print_header(text, **header_kwargs) # type: ignore + + +def print_bullet(key: str, value: str, indent: int | None = None) -> None: + import toolstr + + bullet_kwargs = { + 'colon_style': 'rgb(0,255,0)', + 'key_style': 'white bold', + } + toolstr.print_bullet(key=key, value=value, indent=indent, **bullet_kwargs) diff --git a/crates/python/python/cryo_test/cryo_test/cli/cli_utils.py b/crates/python/python/cryo_test/cryo_test/cli/cli_utils.py new file mode 100644 index 0000000..f863f73 --- /dev/null +++ b/crates/python/python/cryo_test/cryo_test/cli/cli_utils.py @@ -0,0 +1,62 @@ +from __future__ import annotations + +import typing + + +def open_interactive_session(variables: dict[str, typing.Any]) -> None: + header = 'data sorted in these variables:' + for key, value in variables.items(): + header += ( + '\n- \033[1m\033[97m' + key + '\033[0m: ' + type(value).__name__ + ) + try: + from IPython.terminal.embed import InteractiveShellEmbed + + ipshell = InteractiveShellEmbed(colors='Linux') # type: ignore + ipshell(header=header, local_ns=variables) + except ImportError: + import code + import sys + + class ExitInteract: + def __call__(self) -> None: + raise SystemExit + + def __repr__(self) -> str: + raise SystemExit + + try: + sys.ps1 = '>>> ' + code.interact( + banner='\n' + header + '\n', + local=dict(variables, exit=ExitInteract()), + ) + except SystemExit: + pass + + +def _enter_debugger() -> None: + """open debugger to most recent exception + + - adapted from https://stackoverflow.com/a/242514 + """ + import sys + import traceback + + # print stacktrace + extype, value, tb = sys.exc_info() + print('[ENTERING DEBUGGER]') + traceback.print_exc() + print() + + try: + import ipdb # type: ignore + import types + + tb = typing.cast(types.TracebackType, tb) + ipdb.post_mortem(tb) + + except ImportError: + import pdb + + pdb.post_mortem(tb) diff --git a/crates/python/python/cryo_test/cryo_test/commands/__init__.py b/crates/python/python/cryo_test/cryo_test/commands/__init__.py new file mode 100644 index 0000000..b21d09e --- /dev/null +++ b/crates/python/python/cryo_test/cryo_test/commands/__init__.py @@ -0,0 +1,3 @@ +from .command_generation import * +from .command_parsing import * +from .command_types import * diff --git a/crates/python/python/cryo_test/cryo_test/commands/command_generation.py b/crates/python/python/cryo_test/cryo_test/commands/command_generation.py new file mode 100644 index 0000000..307a2bd --- /dev/null +++ b/crates/python/python/cryo_test/cryo_test/commands/command_generation.py @@ -0,0 +1,199 @@ +from __future__ import annotations + +import typing + +from .. import defaults +from .. import files +from . import command_types + +if typing.TYPE_CHECKING: + from typing_extensions import Unpack + + +python_command_template = """cryo.freeze( + {datatype}, + {time_dimension}, + output_dir={output_dir}, + rpc={rpc}, + subdirs='datatype', + **{extra_args} +)""" + + +def generate_commands( + command_arg_list: list[command_types.PartialCommandArgs] | None = None, + command_arg_combos: dict[str, list[typing.Any]] | None = None, + common_command_args: command_types.PartialCommandArgs | None = None, +) -> dict[str, str]: + """generate cryo commands""" + import itertools + + # parse default inputs + if command_arg_list is None: + command_arg_list = [{}] + if common_command_args is None: + common_command_args = {} + + missing_keys = { + key + for key in defaults.default_combos.keys() + if key not in common_command_args + and not all(key in item for item in command_arg_list) + and (command_arg_combos is not None and key not in command_arg_combos) + } + if len(missing_keys) > 0: + if command_arg_combos is None: + command_arg_combos = {} + else: + command_arg_combos = dict(command_arg_combos) + for key in missing_keys: + command_arg_combos[key] = defaults.default_combos[key] + + # render all_command_args + if command_arg_combos is not None: + all_command_args: list[command_types.PartialCommandArgs] = [] + for command_arg_set in command_arg_list: + keys = list(command_arg_combos.keys()) + for values in itertools.product(*command_arg_combos.values()): + command_args: command_types.PartialCommandArgs = dict( # type: ignore + command_arg_set, **dict(zip(keys, values)) + ) + all_command_args.append(command_args) + else: + all_command_args = command_arg_list + + # add common kwargs + for args in all_command_args: + for key, value in common_command_args.items(): + if key not in args: + args[key] = value # type: ignore + + # eliminate invalid combinations + all_command_args = [ + command_args + for command_args in all_command_args + if are_command_args_valid(**command_args) + ] + + # generate commands + commands = {} + for command_args in all_command_args: + name = create_command_name(**command_args) + if name in commands: + raise Exception('name collision: ' + str(name)) + commands[name] = generate_command(**command_args) + + return commands + + +def generate_command(**kwargs: Unpack[command_types.CommandArgs]) -> str: + if isinstance(kwargs.get('datatype'), list): + kwargs['datatype'] = tuple(kwargs['datatype']) + interface = kwargs.get('interface', 'cli') + if interface == 'cli': + return generate_cli_command(**kwargs) + elif interface == 'python': + return generate_python_command(**kwargs) + else: + raise Exception('invalid interface') + + +def generate_cli_command( + datatype: str | tuple[str, ...], + time_dimension: str, + data_root: str, + executable: str, + extra_args: list[str] | None = None, + name: str | None = None, + interface: typing.Literal['cli', 'python'] = 'cli', + rpc: str | None = None, +) -> str: + datatype = _datatype_to_tuple(datatype) + if interface != 'cli': + raise Exception('interface must be cli') + if name is None: + name = create_command_name(datatype, time_dimension) + if extra_args is None: + extra_args = [] + pieces = [ + executable, + *datatype, + defaults.time_dimensions[time_dimension], + '--subdirs datatype', + '--output-dir ' + + files.get_command_data_dir( + batch_data_dir=data_root, command_name=name + ), + ' '.join(extra_args), + defaults.datatype_parameters.get(datatype, ''), + ] + if rpc is not None: + pieces.extend(['--rpc', rpc]) + return ' '.join(pieces).strip(' ').replace(' ', ' ') + + +def generate_python_command( + datatype: str | tuple[str, ...], + time_dimension: str, + data_root: str, + executable: str, + extra_args: list[str], + name: str | None = None, + interface: typing.Literal['cli', 'python'] = 'python', + rpc: str | None = None, +) -> str: + datatype = _datatype_to_tuple(datatype) + if interface != 'python': + raise Exception('interface must be python') + if name is None: + name = create_command_name(datatype, time_dimension) + if time_dimension == 'blocks': + value = defaults.time_dimensions['blocks'].split(' ', maxsplit=1)[1:] + time_dimension = 'blocks=' + ' '.join(value) + elif time_dimension == 'transactions': + value = defaults.time_dimensions['transactions'].split(' ', maxsplit=1)[ + 1: + ] + time_dimension = 'transactions=' + ' '.join(value) + else: + raise Exception('invalid time dimension') + return python_command_template.format( + datatype=datatype, + time_dimension=time_dimension, + rpc=rpc, + output_dir=files.get_command_data_dir( + batch_data_dir=data_root, command_name=name + ), + extra_args=extra_args, + ) + + +def create_command_name( + datatype: str | tuple[str, ...], + time_dimension: str, + name: str | None = None, + **kwargs: typing.Any, +) -> str: + datatype = _datatype_to_tuple(datatype) + if name is not None: + return name + else: + return '_and_'.join(datatype) + '_by_' + time_dimension + + +def are_command_args_valid( + datatype: str | tuple[str, ...], time_dimension: str, **kwargs: typing.Any +) -> bool: + datatype = _datatype_to_tuple(datatype) + + if time_dimension == 'transactions' and any( + dt in defaults.not_by_transaction for dt in datatype + ): + return False + return True + + +def _datatype_to_tuple(datatype: str | tuple[str, ...]) -> tuple[str, ...]: + if isinstance(datatype, str): + datatype = (datatype,) + return tuple([d for dt in datatype for d in dt.split(' ')]) diff --git a/crates/python/python/cryo_test/cryo_test/commands/command_parsing.py b/crates/python/python/cryo_test/cryo_test/commands/command_parsing.py new file mode 100644 index 0000000..8404bb5 --- /dev/null +++ b/crates/python/python/cryo_test/cryo_test/commands/command_parsing.py @@ -0,0 +1,57 @@ +from __future__ import annotations + +import typing + +from .. import defaults + + +def get_commands_interface(commands: dict[str, str]) -> str: + interfaces = set( + get_command_interface(command) for command in commands.values() + ) + if len(interfaces) == 1: + return list(interfaces)[0] + else: + raise Exception() + + +def get_command_interface(command: str) -> typing.Literal['cli', 'python']: + if command.startswith('cryo.'): + return 'python' + else: + return 'cli' + + +def get_command_output_dir(command: str) -> str: + interface = get_command_interface(command) + if interface == 'cli': + pre_index = command.index('--output-dir ') + start_index = pre_index + len('--output-dir') + end_index = command.index(' \\', pre_index) + return command[start_index:end_index] + elif interface == 'python': + pre_index = command.index('output_dir=') + start_index = pre_index + len('output_dir=') + end_index = command.index(',', pre_index) + return command[start_index:end_index] + else: + raise Exception('invalid interface') + + +def parse_command_datatypes(command: str) -> list[str]: + interface = get_command_interface(command) + if interface == 'cli': + datatypes = [] + pieces = command.split(' ') + for piece in pieces[1:]: + if piece.startswith('-'): + break + else: + datatypes.append(piece) + return [ + dt + for datatype in datatypes + for dt in defaults.multi_aliases.get(datatype, [datatype]) + ] + else: + raise Exception() diff --git a/crates/python/python/cryo_test/cryo_test/commands/command_types.py b/crates/python/python/cryo_test/cryo_test/commands/command_types.py new file mode 100644 index 0000000..66526b8 --- /dev/null +++ b/crates/python/python/cryo_test/cryo_test/commands/command_types.py @@ -0,0 +1,25 @@ +from __future__ import annotations + +import typing + + +class PartialCommandArgs(typing.TypedDict, total=False): + datatype: str | tuple[str, ...] + time_dimension: str + data_root: str + executable: str + extra_args: list[str] + name: str | None + interface: typing.Literal['cli', 'python'] + rpc: str + + +class CommandArgs(typing.TypedDict): + datatype: str | tuple[str, ...] + time_dimension: str + data_root: str + executable: str + extra_args: list[str] + name: str | None + interface: typing.Literal['cli', 'python'] + rpc: str diff --git a/crates/python/python/cryo_test/cryo_test/comparison.py b/crates/python/python/cryo_test/cryo_test/comparison.py new file mode 100644 index 0000000..5c10b1e --- /dev/null +++ b/crates/python/python/cryo_test/cryo_test/comparison.py @@ -0,0 +1,257 @@ +from __future__ import annotations + +import typing + +from . import cli +from . import commands +from . import files +from . import scripts +from . import polars_utils + +if typing.TYPE_CHECKING: + from typing import Literal, Sequence + + CompareStep = Literal['setup', 'collect', 'compare'] + + +def perform_comparison( + batches: dict[str, dict[str, str]], + comparison_dir: str | None, + steps: Sequence[CompareStep] = ['setup', 'collect', 'compare'], +) -> dict[str, typing.Any]: + import json + import subprocess + import time + + # initialize variables + timing: dict[str, float | None] = { + 't_' + side + '_' + step: None + for side in ['start', 'end'] + for step in ['setup', 'collect', 'compare'] + } + if comparison_dir is None and batches is None: + raise Exception('must specify batches or existing comparison dir') + if comparison_dir is None: + comparison_dir = files.create_comparison_dir() + elif batches is None: + batches_path = files.get_batches_json_path(comparison_dir) + with open(batches_path) as f: + batches = json.load(f) + script_paths = {} + for batch_name, batch_commands in batches.items(): + script_paths[batch_name] = files.get_scripts_path( + comparison_dir=comparison_dir, + batch_name=batch_name, + batch_commands=batch_commands, + ) + + # step: setup collection scripts + if steps is None or 'setup' in steps: + timing['t_start_setup'] = time.time() + cli.print_text_box('\[step: setup]') # noqa: W605 + print('building scripts in ' + files.get_scripts_dir(comparison_dir)) + for batch_name, batch_commands in batches.items(): + scripts.generate_collect_script( + commands=batch_commands, script_path=script_paths[batch_name] + ) + timing['t_end_setup'] = time.time() + + # step: collect output data + if steps is None or 'collect' in steps: + timing['t_start_collect'] = time.time() + print('\n\n') + for batch_name, batch_commands in batches.items(): + cli.print_text_box( + '\[step: collect] collecting data in batch [rgb(50,220,50) bold]' + + batch_name + + '[/rgb(50,220,50) bold]' + ) # noqa: W605 + subprocess.call(script_paths[batch_name]) + timing['t_end_collect'] = time.time() + + # step: compare outputs + if steps is None or 'compare' in steps: + timing['t_start_compare'] = time.time() + cli.print_text_box('\[step: compare] comparing data') # noqa: W605 + _compare_outputs(comparison_dir=comparison_dir, batches=batches) + timing['t_end_compare'] = time.time() + + # save output + output = { + 'comparison_dir': comparison_dir, + 'script_paths': script_paths, + 'timing': timing, + 'steps': steps, + } + _save_comparison_output(output) + + print() + print('...complete') + print() + print('(see data in ' + comparison_dir + ')') + + return output + + +def _compare_outputs( + comparison_dir: str, batches: dict[str, dict[str, str]] +) -> dict[str, dict[str, list[str]]]: + import rich + + # gather command names + command_names = [] # use list not set to preserve order + for batch in batches.values(): + for command_name in batch.keys(): + if command_name not in command_names: + command_names.append(command_name) + if len(batches) == 1: + context_str = 'context' + else: + context_str = 'contexts' + print(len(command_names), 'commands across', len(batches), context_str) + print() + cli.print_header('Data summary') + + # for each command, compare outputs + all_differences: dict[str, dict[str, list[str]]] = {} + for command_name in command_names: + # get datatypes + datatypes = set() + for batch_name, batch in batches.items(): + if command_name in batch: + command = batches[batch_name][command_name] + datatypes.update(commands.parse_command_datatypes(command)) + + # compare results + all_differences[command_name] = {} + for datatype in datatypes: + s = ( + '[rgb(0,255,0)]-[/rgb(0,255,0)] verifying [rgb(0,255,0) bold]' + + command_name + + '[/rgb(0,255,0) bold]' + ) + if len(datatypes) > 1: + s = s + ' (datatype = ' + datatype + ')' + rich.print(s) + + all_differences[command_name][datatype] = _compare_specific( + comparison_dir=comparison_dir, + command_name=command_name, + datatype=datatype, + batches=batches, + ) + + total_differences = sum( + len(datatype_diffs) + for command_diffs in all_differences.values() + for datatype_diffs in command_diffs.values() + ) + print('') + cli.print_header('Total differences: ' + str(total_differences)) + if total_differences == 0: + print('[none]') + else: + i = 1 + for command_name in all_differences.keys(): + for datatype in all_differences[command_name].keys(): + for diff in all_differences[command_name][datatype]: + if diff.startswith('(omitting'): + continue + rich.print( + str(i) + '.', + '\[[rgb(0,255,0) bold]' + + command_name + + '[/rgb(0,255,0) bold]]', + '\[[white bold]' + datatype + '[/white bold]]', + diff, + ) + i += 1 + + return all_differences + + +def _compare_specific( + comparison_dir: str, + command_name: str, + datatype: str, + batches: dict[str, dict[str, str]], +) -> list[str]: + import glob + import rich + + diffs = [] + all_paths = {} + for batch_name, batch in batches.items(): + # get paths + if command_name not in batch: + continue + batch_glob = files.get_command_data_glob( + comparison_dir=comparison_dir, + batch_name=batch_name, + command_name=command_name, + datatype=datatype, + ) + paths = glob.glob(batch_glob) + _print_batch_data_summary(batch_name=batch_name, paths=paths) + if len(paths) == 0: + diffs.append('data missing for ' + batch_name) + else: + all_paths[batch_name] = paths + + # compute differences + diffs += polars_utils.find_df_differences(all_paths) + diffs = [diff[:300] for diff in diffs if not diff.startswith('(omitting')] + if len(diffs) > 0: + for diff in diffs: + rich.print(' [red bold]diff[/red bold]: ' + diff) + else: + rich.print(' [green bold]equal[/green bold]') + + return diffs + + +def _print_batch_data_summary(batch_name: str, paths: list[str]) -> None: + import os + import toolstr + import polars as pl + import rich + + if len(paths) == 1: + file_str = 'file' + else: + file_str = 'files' + + if len(paths) == 0: + summary = '[red bold]DATA MISSING[/red bold])' + else: + n_bytes = sum(os.path.getsize(path) for path in paths) + n_rows = pl.scan_parquet(paths).select(pl.len()).collect()['len'][0] + summary = ( + toolstr.format(n_bytes, 'nbytes') + + ', ' + + toolstr.format(n_rows) + + ' rows)[/white]' + ) + + rich.print( + ' batch [rgb(0,255,0)]=[/rgb(0,255,0)] [white bold]' + + batch_name + + '[/white bold] ' + + '[white](' + + str(len(paths)) + + ' ' + + file_str + + ', ' + + summary + ) + + +def _save_comparison_output(output: dict[str, typing.Any]) -> None: + import json + import os + + comparison_dir = output['comparison_dir'] + run_path = files.get_summary_path(comparison_dir=comparison_dir) + os.makedirs(os.path.dirname(run_path), exist_ok=True) + with open(run_path, 'w') as f: + json.dump(output, f) diff --git a/crates/python/python/cryo_test/cryo_test/defaults.py b/crates/python/python/cryo_test/cryo_test/defaults.py new file mode 100644 index 0000000..c7fb794 --- /dev/null +++ b/crates/python/python/cryo_test/cryo_test/defaults.py @@ -0,0 +1,94 @@ +from __future__ import annotations + + +datatypes = [ + 'address_appearances', + 'balance_diffs', + 'balances', + 'blocks', + 'code_diffs', + 'codes', + 'contracts', + 'erc20_balances', + 'erc20_metadata', + 'erc20_supplies', + 'erc20_transfers', + 'erc721_metadata', + 'erc721_transfers', + 'eth_calls', + 'logs', + 'native_transfers', + 'nonce_diffs', + 'nonces', + 'storage_diffs', + 'slots', + 'trace_calls', + 'traces', + 'transactions', + # 'vm_traces', +] + +multi_datatypes = [ + 'blocks transactions', + 'state_diffs', +] + +multi_aliases = { + 'state_diffs': [ + 'balance_diffs', + 'code_diffs', + 'nonce_diffs', + 'storage_diffs', + ], +} + +datatype_parameters: dict[str | tuple[str, ...], str] = { + ('balances',): '--address 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2', + ('codes',): '--address 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2', + ('nonces',): '--address 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2', + ( + 'erc20_balances', + ): '--contract 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2 --address 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2', + ('erc20_metadata',): '--address 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2', + ( + 'erc20_supplies', + ): '--contract 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2', + ( + 'erc721_metadata', + ): '--contract 0xed5af388653567af2f388e6224dc7c4b3241c544', + ( + 'erc721_transfers', + ): '--contract 0xed5af388653567af2f388e6224dc7c4b3241c544', + ( + 'eth_calls', + ): '--call-data 0x18160ddd --contract 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2', + ( + 'slots', + ): '--address 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2 --slot 0x0000000000000000000000000000000000000000000000000000000000000000', + ( + 'trace_calls', + ): '--call-data 0x18160ddd --contract 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2', +} + +not_by_transaction = [ + 'balances', + 'codes', + 'erc20_balances', + 'erc20_metadata', + 'erc20_supplies', + 'erc721_metadata', + 'eth_calls', + 'nonces', + 'slots', + 'trace_calls', +] + +time_dimensions = { + 'blocks': '-b 18.000M:18.0001M', + 'transactions': '--txs 0xa1935e783e5e7cd320c6e9005a8a7770853d2e46837ac31de1afcfe8b4b7079d', +} + +default_combos: dict[str, list[str]] = { + 'datatype': datatypes + multi_datatypes, + 'time_dimension': ['blocks', 'transactions'], +} diff --git a/crates/python/python/cryo_test/cryo_test/files/__init__.py b/crates/python/python/cryo_test/cryo_test/files/__init__.py new file mode 100644 index 0000000..56aadaf --- /dev/null +++ b/crates/python/python/cryo_test/cryo_test/files/__init__.py @@ -0,0 +1,2 @@ +from .file_io import * +from .file_paths import * diff --git a/crates/python/python/cryo_test/cryo_test/files/file_io.py b/crates/python/python/cryo_test/cryo_test/files/file_io.py new file mode 100644 index 0000000..87bca0f --- /dev/null +++ b/crates/python/python/cryo_test/cryo_test/files/file_io.py @@ -0,0 +1,53 @@ +from __future__ import annotations + +import typing + +from . import file_paths + +if typing.TYPE_CHECKING: + import polars as pl + + T = typing.TypeVar('T') + + +def save_commands( + comparison_dir: str, batches: dict[str, dict[str, str]] +) -> None: + import json + import os + + os.makedirs(comparison_dir, exist_ok=True) + with open(file_paths.get_commands_path(comparison_dir), 'w') as f: + json.dump(batches, f) + + +def load_commands(comparison_dir: str) -> dict[str, dict[str, str]]: + import json + + with open(file_paths.get_commands_path(comparison_dir)) as f: + result: dict[str, dict[str, str]] = json.load(f) + return result + + +def load_all_data(comparison_dir: str) -> dict[str, dict[str, pl.DataFrame]]: + import polars as pl + + return _io_data(comparison_dir, pl.read_parquet) + + +def scan_all_data(comparison_dir: str) -> dict[str, dict[str, pl.LazyFrame]]: + import polars as pl + + return _io_data(comparison_dir, pl.scan_parquet) + + +def _io_data( + comparison_dir: str, f: typing.Callable[[str], T] +) -> dict[str, dict[str, T]]: + batches = load_commands(comparison_dir) + data: dict[str, dict[str, T]] = {} + for batch_name in batches.keys(): + data[batch_name] = {} + for command in batches[batch_name].keys(): + data[batch_name][command] = f(comparison_dir) + return data diff --git a/crates/python/python/cryo_test/cryo_test/files/file_paths.py b/crates/python/python/cryo_test/cryo_test/files/file_paths.py new file mode 100644 index 0000000..6e4c70d --- /dev/null +++ b/crates/python/python/cryo_test/cryo_test/files/file_paths.py @@ -0,0 +1,146 @@ +from __future__ import annotations + +from .. import commands as commands_module + + +def create_comparison_dir( + comparison_dir: str | None = None, label: str | None = None +) -> str: + import datetime + import os + + if comparison_dir is not None: + if label is not None: + pieces = comparison_dir.split('__', maxsplit=1) + if len(pieces) != 2 or pieces[-1] != '__' + label: + raise Exception('comparison_dir does not match label') + return comparison_dir + else: + dir_name = datetime.datetime.now().strftime('%Y-%m-%d_%H-%M-%S') + if label is not None: + dir_name = dir_name + '__' + label + return os.path.join(get_cryo_test_root(), dir_name) + + +def get_most_recent_comparison_dir() -> str: + import os + + test_root = get_cryo_test_root() + jobs = sorted(os.listdir(test_root)) + if len(jobs) == 0: + raise Exception('no previous jobs') + else: + return os.path.join(test_root, jobs[-1]) + + +def get_cryo_test_root() -> str: + import os + import tempfile + + tmp_root = '/tmp' if os.path.exists('/tmp') else tempfile.gettempdir() + return os.path.join(tmp_root, 'cryo_test') + + +def get_commands_path(comparison_dir: str) -> str: + import os + + return os.path.join(comparison_dir, 'commands.json') + + +def get_summary_path(comparison_dir: str) -> str: + import datetime + import os + + timestamp = datetime.datetime.now().strftime('%Y-%m-%d_%H-%M-%S') + return os.path.join(comparison_dir, 'runs', timestamp + '.json') + + +def get_batch_data_dir(comparison_dir: str, batch_name: str) -> str: + import os + + return os.path.join(comparison_dir, 'data', batch_name) + + +def get_command_data_dir( + *, + batch_data_dir: str | None = None, + comparison_dir: str | None = None, + batch_name: str | None = None, + command_name: str, +) -> str: + import os + + if batch_data_dir is None: + if comparison_dir is None or batch_name is None: + raise Exception('specify more arguments') + batch_data_dir = get_batch_data_dir( + comparison_dir=comparison_dir, batch_name=batch_name + ) + + return os.path.join(batch_data_dir, command_name) + + +def get_command_collected_datatypes( + *, + batch_data_dir: str | None = None, + comparison_dir: str | None = None, + batch_name: str | None = None, + command_name: str, +) -> list[str]: + import os + + data_dir = get_command_data_dir( + batch_data_dir=batch_data_dir, + comparison_dir=comparison_dir, + batch_name=batch_name, + command_name=command_name, + ) + return [ + item + for item in os.listdir(data_dir) + if item != '.cryo' + and (len(os.listdir(os.path.join(data_dir, item))) > 0) + ] + + +def get_command_data_glob( + *, + batch_data_dir: str | None = None, + comparison_dir: str | None = None, + batch_name: str | None = None, + command_name: str, + datatype: str, +) -> str: + import os + + command_dir = get_command_data_dir( + batch_data_dir=batch_data_dir, + comparison_dir=comparison_dir, + batch_name=batch_name, + command_name=command_name, + ) + return os.path.join(command_dir, datatype, '*.parquet') + + +def get_scripts_dir(comparison_dir: str) -> str: + import os + + return os.path.join(comparison_dir, 'scripts') + + +def get_scripts_path( + comparison_dir: str, batch_name: str, batch_commands: dict[str, str] +) -> str: + import os + + interface = commands_module.get_commands_interface(batch_commands) + if interface == 'cli': + extension = '.sh' + elif interface == 'python': + extension = '.py' + else: + raise Exception() + + filename = 'collect_' + batch_name + extension + + return os.path.join(get_scripts_dir(comparison_dir), filename) diff --git a/crates/python/python/cryo_test/cryo_test/polars_utils.py b/crates/python/python/cryo_test/cryo_test/polars_utils.py new file mode 100644 index 0000000..862a805 --- /dev/null +++ b/crates/python/python/cryo_test/cryo_test/polars_utils.py @@ -0,0 +1,171 @@ +from __future__ import annotations + +import typing + +if typing.TYPE_CHECKING: + from typing import Mapping, Sequence + import polars as pl + + DataRef = typing.Union[str, list[str], pl.DataFrame, pl.LazyFrame] + + +def find_df_differences( + dfs: Sequence[DataRef] | Mapping[str, DataRef], +) -> list[str]: + """input is list or dict of 1. glob, 2. DataFrame, or 3. LazyFrame""" + differences = find_schema_differences(dfs) + if len(differences) > 0: + differences.append('(omitting row check because schemas not equal)') + else: + differences += find_row_differences(dfs) + return differences + + +def _dfs_to_map( + dfs: Sequence[DataRef] | Mapping[str, DataRef], +) -> Mapping[str, pl.DataFrame]: + if isinstance(dfs, dict): + return {key: _resolve(value) for key, value in dfs.items()} + elif isinstance(dfs, list): + if len(dfs) == 2: + return {'lhs': _resolve(dfs[0]), 'rhs': _resolve(dfs[1])} + elif len(dfs) > 2: + return {'input_' + str(i): _resolve(df) for i, df in enumerate(dfs)} + else: + return {'only': _resolve(df) for df in dfs} + else: + raise Exception() + + +def _resolve(ref: DataRef) -> pl.DataFrame: + import polars as pl + + if isinstance(ref, str): + return pl.read_parquet(ref) + elif isinstance(ref, list) and all(isinstance(item, str) for item in ref): + return pl.read_parquet(ref) + elif isinstance(ref, pl.DataFrame): + return ref + elif isinstance(ref, pl.LazyFrame): + return ref.collect() + else: + raise Exception('cannot resolve DataFrame from type') + + +def find_schema_differences( + dfs: Sequence[DataRef] | Mapping[str, DataRef], +) -> list[str]: + # package inputs + data = _dfs_to_map(dfs) + if len(data) <= 1: + return [] + data_list = list(data.items()) + + # compare all pairs + differences = [] + name, df = data_list[0] + for other_name, other_df in data_list[1:]: + # check missing columns + missing_columns = [] + for column in other_df.schema: + if column not in df.schema: + missing_columns.append(column) + if len(missing_columns) > 0: + difference = ( + other_name + + ' has extra columns compared to ' + + name + + ': ' + + ', '.join(missing_columns) + ) + differences.append(difference) + continue + + # check extra columns + extra_columns = [] + for column in df.schema: + if column not in other_df.schema: + extra_columns.append(column) + if len(extra_columns) > 0: + difference = ( + name + + ' has extra columns compared to ' + + other_name + + ': ' + + ', '.join(extra_columns) + ) + differences.append(difference) + continue + + # check column types + different_types = {} + for column in df.schema.keys(): + if df.schema[column] != other_df.schema[column]: + different_types[column] = { + name: df.schema[column], + other_name: other_df.schema[column], + } + if len(different_types) > 0: + difference = ( + name + + ' and ' + + other_name + + ' have different column types: ' + + str(different_types) + ) + differences.append(difference) + continue + + # check column order + if list(df.schema.keys()) != list(other_df.schema.keys()): + difference = ( + 'columns of ' + + name + + ' and ' + + other_name + + ' are in different order' + ) + differences.append(difference) + continue + + return differences + + +def find_row_differences( + dfs: Sequence[DataRef] | Mapping[str, DataRef], +) -> list[str]: + import polars.testing + + # package inputs + data = _dfs_to_map(dfs) + if len(data) <= 1: + return [] + data_list = list(data.items()) + + # compare all pairs + differences = [] + name, df = data_list[0] + for other_name, other_df in data_list[1:]: + # row count + if len(df) != len(other_df): + difference = ( + name + ' and ' + other_name + ' have different number of rows' + ) + continue + + # row values + try: + polars.testing.assert_frame_equal(df, other_df) + except AssertionError as e: + difference = ( + 'rows of ' + + name + + ' and ' + + other_name + + ' do not match because ' + + e.args[0] + ) + differences.append(difference) + continue + + return differences diff --git a/crates/python/python/cryo_test/cryo_test/scripts.py b/crates/python/python/cryo_test/cryo_test/scripts.py new file mode 100644 index 0000000..ba2aacd --- /dev/null +++ b/crates/python/python/cryo_test/cryo_test/scripts.py @@ -0,0 +1,43 @@ +from __future__ import annotations + +from . import commands as commands_module + + +def generate_collect_script( + commands: dict[str, str], script_path: str | None = None +) -> str: + interface = commands_module.get_commands_interface(commands) + if interface == 'cli': + script = '#!/usr/bin/env bash\n\n' + for name, command in commands.items(): + script += '\n\n# ' + name + '\n' + script += 'echo "collecting ' + name + '"\n' + script += 'echo ""\n' + script += command.replace(' -', ' \\\n -') + '\n' + script += 'echo ""\n' + script += 'echo ""\n' + elif interface == 'python': + script = '#!/usr/bin/env python3\n' + for name, command in commands.items(): + script += '\n\n# ' + name + '\n' + script += "print('collecting ' + name)" + script += command + else: + raise Exception('invalid interface') + + # write to file + if script_path is not None: + _write_script(script, script_path) + + return script + + +def _write_script(script: str, path: str) -> None: + import os + import stat + + os.makedirs(os.path.dirname(path), exist_ok=True) + with open(path, 'w') as f: + f.write(script) + st = os.stat(path) + os.chmod(path, st.st_mode | stat.S_IXUSR) diff --git a/crates/python/python/cryo_test/examples/ethers_vs_alloy/build_cryo b/crates/python/python/cryo_test/examples/ethers_vs_alloy/build_cryo new file mode 100755 index 0000000..21c3d9b --- /dev/null +++ b/crates/python/python/cryo_test/examples/ethers_vs_alloy/build_cryo @@ -0,0 +1,77 @@ +#!/usr/bin/env bash + +# get directory of script +ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + +# make directories +mkdir -p "$ROOT_DIR/bin" +mkdir -p "$ROOT_DIR/build/alloy" +mkdir -p "$ROOT_DIR/build/ethers" + +# parse inputs +BUILD_ALLOY=false +BUILD_ETHERS=false +ANY_FLAG_SET=false +while getopts "ae-:" opt; do + case $opt in + a) BUILD_ALLOY=true; ANY_FLAG_SET=true ;; + e) BUILD_ETHERS=true; ANY_FLAG_SET=true ;; + -) + case "${OPTARG}" in + alloy) BUILD_ALLOY=true; ANY_FLAG_SET=true ;; + ethers) BUILD_ETHERS=true; ANY_FLAG_SET=true ;; + *) echo "Invalid option: --${OPTARG}" >&2 + echo "Usage: $0 [-a|--alloy] [-e|--ethers]" >&2 + exit 1 ;; + esac ;; + *) echo "Usage: $0 [-a|--alloy] [-e|--ethers]" >&2 + exit 1 ;; + esac +done +if [ "$ANY_FLAG_SET" = false ]; then + BUILD_ALLOY=true + BUILD_ETHERS=true +fi +echo "BUILD_ALLOY: $BUILD_ALLOY" +echo "BUILD_ETHERS: $BUILD_ETHERS" + +# build alloy +if [ "$BUILD_ALLOY" = true ]; then + echo "building cryo alloy" + + # go to repo + cd ~/repos/cryo + + # check out build + git checkout feat/alloy + + # build cryo + cargo install \ + --path crates/cli \ + --root "$ROOT_DIR/build/alloy" + + # link to built binary + ln -s "$ROOT_DIR/build/alloy/bin/cryo" "$ROOT_DIR/bin/cryo_alloy" + echo "" + echo "built cryo alloy at: $ROOT_DIR/bin/cryo_alloy" +fi + +if [ "$BUILD_ETHERS" = true ]; then + echo "building cryo ethers" + + # go to repo + cd ~/repos/cryo + + # check out build + git checkout main + + # build cryo + cargo install \ + --path crates/cli \ + --root "$ROOT_DIR/build/ethers" + + # link to built binary + ln -s "$ROOT_DIR/build/ethers/bin/cryo" "$ROOT_DIR/bin/cryo_ethers" + echo "" + echo "built cryo ethers at: $ROOT_DIR/bin/cryo_ethers" +fi diff --git a/crates/python/python/cryo_test/examples/ethers_vs_alloy/compare_alloy_to_ethers b/crates/python/python/cryo_test/examples/ethers_vs_alloy/compare_alloy_to_ethers new file mode 100755 index 0000000..1fafd53 --- /dev/null +++ b/crates/python/python/cryo_test/examples/ethers_vs_alloy/compare_alloy_to_ethers @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + +python3 -m cryo_test \ + --debug \ + --executable \ + cryo_alloy="$ROOT_DIR/bin/cryo_alloy" \ + cryo_ethers="$ROOT_DIR/bin/cryo_ethers" \ + "$@" diff --git a/crates/python/python/cryo_test/pyproject.toml b/crates/python/python/cryo_test/pyproject.toml new file mode 100644 index 0000000..c4d2e48 --- /dev/null +++ b/crates/python/python/cryo_test/pyproject.toml @@ -0,0 +1,70 @@ +[build-system] +requires = ["flit_core >=3.2,<4"] +build-backend = "flit_core.buildapi" + +[project] +name = "cryo_test" +readme = "README.md" +requires-python = ">=3.7" +dynamic = ["version", "description"] +license = {text = "MIT OR Apache-2.0"} +classifiers = [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "Intended Audience :: Financial and Insurance Industry", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: Apache Software License", + "License :: OSI Approved :: MIT License", + "Natural Language :: English", + "Operating System :: MacOS", + "Operating System :: Microsoft :: Windows", + "Operating System :: POSIX :: Linux", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Typing :: Typed", +] +dependencies = [ + "polars >= 1.0", + "rich >= 13.3.3", + "rich-argparse >= 1.5.2", +] + +[project.urls] +Documentation = "https://github.com/paradigmxyz/cryo_test" +Source = "https://github.com/paradigmxyz/cryo_test" + +[tool.flit.module] +name = "cryo_test" + +[project.optional-dependencies] +test = [ + "typing-extensions >=4.9.0", +] + +[project.dev-dependencies] +pytest = "^7.0.0" +pytest-asyncio = "^0.18.3" # Add this line for pytest-asyncio + +[tool.mypy] +python_version = "3.9" +strict = true +implicit_reexport = true +files = ["cryo_test"] + +[tool.pytest.ini_options] +testpaths = [ + "tests", +] + +[project.scripts] +cryo_test = "cryo_test.cli:run_cli" + +[tool.ruff] +line-length = 80 + +[tool.ruff.format] +quote-style = "single" From 13bbf3a6d4658065aa09d4a2d43a8efd39435af0 Mon Sep 17 00:00:00 2001 From: "fuder.eth" <139509124+vtjl10@users.noreply.github.com> Date: Mon, 6 Jan 2025 06:17:31 +0200 Subject: [PATCH 40/49] Update remember.rs (#212) --- crates/cli/src/remember.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/cli/src/remember.rs b/crates/cli/src/remember.rs index 5dd0879..aa9ca1f 100644 --- a/crates/cli/src/remember.rs +++ b/crates/cli/src/remember.rs @@ -46,7 +46,7 @@ pub(crate) fn load_remembered_command(cryo_dir: PathBuf) -> Result Date: Wed, 8 Jan 2025 06:52:48 +0100 Subject: [PATCH 41/49] Fix Documentation Typos and Links (#209) * Update files.rs * Update PULL_REQUEST_TEMPLATE.md --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- crates/freeze/src/types/files.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index e3bcd5e..b05c128 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -4,7 +4,7 @@ the requirements below. Bug fixes and new features should include tests. -Contributors guide: https://github.com/paradigmxyz/flood/blob/master/CONTRIBUTING.md +Contributors guide: https://github.com/paradigmxyz/cryo/blob/master/CONTRIBUTING.md The contributors guide includes instructions for running ruff and building the documentation. diff --git a/crates/freeze/src/types/files.rs b/crates/freeze/src/types/files.rs index 5ce520a..bfbca16 100644 --- a/crates/freeze/src/types/files.rs +++ b/crates/freeze/src/types/files.rs @@ -14,7 +14,7 @@ pub struct FileOutput { pub subdirs: Vec, /// Whether to overwrite existing files or skip them pub overwrite: bool, - /// File format to used for output files + /// File format to use for output files pub format: FileFormat, /// Number of rows per parquet row group pub row_group_size: Option, From 64b5824c9d49d52d1779a7889a830e33271e99fc Mon Sep 17 00:00:00 2001 From: sslivkoff Date: Wed, 8 Jan 2025 05:55:43 +0000 Subject: [PATCH 42/49] fix typo --- crates/freeze/src/datasets/balance_diffs.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/freeze/src/datasets/balance_diffs.rs b/crates/freeze/src/datasets/balance_diffs.rs index 5104de2..595f0d3 100644 --- a/crates/freeze/src/datasets/balance_diffs.rs +++ b/crates/freeze/src/datasets/balance_diffs.rs @@ -34,8 +34,8 @@ impl CollectByBlock for BalanceDiffs { let include_txs = schema.has_column("transaction_hash"); let (bn, txs, traces) = source.trace_block_state_diffs(request.block_number()? as u32, include_txs).await?; - let trace_resuls = traces.into_iter().map(|t| t.full_trace).collect(); - Ok((bn, txs, trace_resuls)) + let trace_results = traces.into_iter().map(|t| t.full_trace).collect(); + Ok((bn, txs, trace_results)) } fn transform(response: Self::Response, columns: &mut Self, query: &Arc) -> R<()> { From 46632b6b3c1073451d67d921f98b919cf6dc6d91 Mon Sep 17 00:00:00 2001 From: planetBoy <140164174+Guayaba221@users.noreply.github.com> Date: Wed, 8 Jan 2025 06:59:30 +0100 Subject: [PATCH 43/49] Update execution.rs (#210) --- crates/freeze/src/types/execution.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/freeze/src/types/execution.rs b/crates/freeze/src/types/execution.rs index a8285d2..6cef484 100644 --- a/crates/freeze/src/types/execution.rs +++ b/crates/freeze/src/types/execution.rs @@ -89,7 +89,7 @@ impl Default for ExecutionEnvBuilder { impl ExecutionEnvBuilder { /// initialize ExecutionEnvBuilder pub fn new() -> Self { - ExecutionEnvBuilder { ..Default::default() } + Self::default() } /// dry run From cac769e1b5a8b03df96c7ce3362e462cf6c26409 Mon Sep 17 00:00:00 2001 From: sslivkoff Date: Wed, 8 Jan 2025 06:33:44 +0000 Subject: [PATCH 44/49] remove trailing space --- crates/freeze/src/types/execution.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/freeze/src/types/execution.rs b/crates/freeze/src/types/execution.rs index 6cef484..0bbe4a7 100644 --- a/crates/freeze/src/types/execution.rs +++ b/crates/freeze/src/types/execution.rs @@ -89,7 +89,7 @@ impl Default for ExecutionEnvBuilder { impl ExecutionEnvBuilder { /// initialize ExecutionEnvBuilder pub fn new() -> Self { - Self::default() + Self::default() } /// dry run From 7823934f05f7bbccef890bd288c8dddd04b34534 Mon Sep 17 00:00:00 2001 From: sslivkoff Date: Wed, 8 Jan 2025 07:14:05 +0000 Subject: [PATCH 45/49] compare all columns in cryo_test --- .../python/cryo_test/cryo_test/commands/command_generation.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/python/python/cryo_test/cryo_test/commands/command_generation.py b/crates/python/python/cryo_test/cryo_test/commands/command_generation.py index 307a2bd..b7468c8 100644 --- a/crates/python/python/cryo_test/cryo_test/commands/command_generation.py +++ b/crates/python/python/cryo_test/cryo_test/commands/command_generation.py @@ -16,6 +16,7 @@ python_command_template = """cryo.freeze( output_dir={output_dir}, rpc={rpc}, subdirs='datatype', + include_columns=['all'], **{extra_args} )""" @@ -120,6 +121,7 @@ def generate_cli_command( *datatype, defaults.time_dimensions[time_dimension], '--subdirs datatype', + '--include-columns all', '--output-dir ' + files.get_command_data_dir( batch_data_dir=data_root, command_name=name From ce490d517c980dc69d81f2d8bbb93429580bd927 Mon Sep 17 00:00:00 2001 From: sslivkoff Date: Wed, 8 Jan 2025 07:14:24 +0000 Subject: [PATCH 46/49] in cryo_test build script exit on error --- .../python/python/cryo_test/examples/ethers_vs_alloy/build_cryo | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/python/python/cryo_test/examples/ethers_vs_alloy/build_cryo b/crates/python/python/cryo_test/examples/ethers_vs_alloy/build_cryo index 21c3d9b..9ee6cad 100755 --- a/crates/python/python/cryo_test/examples/ethers_vs_alloy/build_cryo +++ b/crates/python/python/cryo_test/examples/ethers_vs_alloy/build_cryo @@ -1,5 +1,7 @@ #!/usr/bin/env bash +set -e + # get directory of script ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" From 39f7da1f278fa24ef8e6efc0fbc4811b06790596 Mon Sep 17 00:00:00 2001 From: sslivkoff Date: Wed, 8 Jan 2025 07:26:29 +0000 Subject: [PATCH 47/49] update checkout targets for alloy vs ethers --- .../python/cryo_test/examples/ethers_vs_alloy/build_cryo | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/python/python/cryo_test/examples/ethers_vs_alloy/build_cryo b/crates/python/python/cryo_test/examples/ethers_vs_alloy/build_cryo index 9ee6cad..20cd74c 100755 --- a/crates/python/python/cryo_test/examples/ethers_vs_alloy/build_cryo +++ b/crates/python/python/cryo_test/examples/ethers_vs_alloy/build_cryo @@ -45,7 +45,7 @@ if [ "$BUILD_ALLOY" = true ]; then cd ~/repos/cryo # check out build - git checkout feat/alloy + git checkout main # build cryo cargo install \ @@ -65,7 +65,7 @@ if [ "$BUILD_ETHERS" = true ]; then cd ~/repos/cryo # check out build - git checkout main + git checkout eba6192298e40add4d35d1587511d875f6d770e4 # build cryo cargo install \ From 559b65455d7ef6b03e8e9e96a0e50fd4fe8a9c86 Mon Sep 17 00:00:00 2001 From: sslivkoff Date: Wed, 8 Jan 2025 07:31:10 +0000 Subject: [PATCH 48/49] in cryo_test remove existing symlinks prior to creation --- .../python/python/cryo_test/examples/ethers_vs_alloy/build_cryo | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/python/python/cryo_test/examples/ethers_vs_alloy/build_cryo b/crates/python/python/cryo_test/examples/ethers_vs_alloy/build_cryo index 20cd74c..db115c2 100755 --- a/crates/python/python/cryo_test/examples/ethers_vs_alloy/build_cryo +++ b/crates/python/python/cryo_test/examples/ethers_vs_alloy/build_cryo @@ -53,6 +53,7 @@ if [ "$BUILD_ALLOY" = true ]; then --root "$ROOT_DIR/build/alloy" # link to built binary + rm -f "$ROOT_DIR/bin/cryo_alloy" ln -s "$ROOT_DIR/build/alloy/bin/cryo" "$ROOT_DIR/bin/cryo_alloy" echo "" echo "built cryo alloy at: $ROOT_DIR/bin/cryo_alloy" @@ -73,6 +74,7 @@ if [ "$BUILD_ETHERS" = true ]; then --root "$ROOT_DIR/build/ethers" # link to built binary + rm -f "$ROOT_DIR/bin/cryo_ethers" ln -s "$ROOT_DIR/build/ethers/bin/cryo" "$ROOT_DIR/bin/cryo_ethers" echo "" echo "built cryo ethers at: $ROOT_DIR/bin/cryo_ethers" From 80eedf5355ca7b141d48123126515e6c9dd7d290 Mon Sep 17 00:00:00 2001 From: Derek Cofausper <256792747+decofe@users.noreply.github.com> Date: Sat, 17 Oct 2026 09:11:12 +0200 Subject: [PATCH 49/49] chore: remove redundant package homepages (#264) Co-authored-by: DaniPopes <57450786+DaniPopes@users.noreply.github.com> --- Cargo.toml | 1 - crates/cli/Cargo.toml | 1 - crates/freeze/Cargo.toml | 1 - crates/python/Cargo.toml | 1 - crates/to_df/Cargo.toml | 1 - 5 files changed, 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index bde9386..d473642 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,6 @@ resolver = "2" version = "0.3.2" edition = "2021" license = "MIT OR Apache-2.0" -homepage = "https://github.com/paradigmxyz/cryo" repository = "https://github.com/paradigmxyz/cryo" exclude = [".github/"] diff --git a/crates/cli/Cargo.toml b/crates/cli/Cargo.toml index 49cb9a0..9e430b1 100644 --- a/crates/cli/Cargo.toml +++ b/crates/cli/Cargo.toml @@ -4,7 +4,6 @@ description = "cryo is the easiest way to extract blockchain data to parquet, cs version.workspace = true edition.workspace = true license.workspace = true -homepage.workspace = true repository.workspace = true [lib] diff --git a/crates/freeze/Cargo.toml b/crates/freeze/Cargo.toml index b6df7eb..55701e8 100644 --- a/crates/freeze/Cargo.toml +++ b/crates/freeze/Cargo.toml @@ -5,7 +5,6 @@ description = "cryo is the easiest way to extract blockchain data to parquet, cs version.workspace = true edition.workspace = true license.workspace = true -homepage.workspace = true repository.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/crates/python/Cargo.toml b/crates/python/Cargo.toml index 6b968d7..580f49e 100644 --- a/crates/python/Cargo.toml +++ b/crates/python/Cargo.toml @@ -5,7 +5,6 @@ description = "cryo python is a python library built on top of the rust cryo lib version.workspace = true edition.workspace = true license.workspace = true -homepage.workspace = true repository.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/crates/to_df/Cargo.toml b/crates/to_df/Cargo.toml index 19058dc..b28efdc 100644 --- a/crates/to_df/Cargo.toml +++ b/crates/to_df/Cargo.toml @@ -4,7 +4,6 @@ description = "cryo_to_df is a procedural macro used for defining datasets" version.workspace = true edition.workspace = true license.workspace = true -homepage.workspace = true repository.workspace = true [lib]