diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index b05c128..e3bcd5e 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/cryo/blob/master/CONTRIBUTING.md +Contributors guide: https://github.com/paradigmxyz/flood/blob/master/CONTRIBUTING.md The contributors guide includes instructions for running ruff and building the documentation. diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index df716ab..e524aee 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -2,53 +2,63 @@ 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 - - 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 - clippy: runs-on: ubuntu-latest - timeout-minutes: 30 + steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable + - 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: clippy + components: rustfmt, clippy - uses: Swatinem/rust-cache@v2 with: cache-on-failure: true - - run: cargo clippy --workspace --all-targets --all-features - env: - RUSTFLAGS: -Dwarnings + + - name: cargo clippy + uses: actions-rs/clippy-check@v1 + with: + args: --all --all-features + token: ${{ secrets.GITHUB_TOKEN }} fmt: runs-on: ubuntu-latest - timeout-minutes: 30 steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@nightly + - name: Checkout sources + uses: actions/checkout@v2 + + - name: Install toolchain + uses: actions-rs/toolchain@v1 with: - components: rustfmt - - run: cargo fmt --all --check + 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 + diff --git a/.gitignore b/.gitignore index f20260e..72e2430 100644 --- a/.gitignore +++ b/.gitignore @@ -7,7 +7,6 @@ target *.parquet_tmp *.json *.json_tmp -*.env *._tmp TODO.md graveyard diff --git a/Cargo.lock b/Cargo.lock index c48c4cd..d1232dc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,27 +1,48 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 4 +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", +] [[package]] name = "addr2line" -version = "0.24.2" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" dependencies = [ "gimli", ] [[package]] -name = "adler2" -version = "2.0.0" +name = "adler" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "aes" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac1f845298e95f983ff1944b728ae08b8cebab80d684f0a832ed0fc74dfa27e2" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] [[package]] name = "ahash" -version = "0.8.11" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" dependencies = [ "cfg-if", "getrandom", @@ -32,9 +53,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.1.3" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" dependencies = [ "memchr", ] @@ -56,615 +77,9 @@ dependencies = [ [[package]] name = "allocator-api2" -version = "0.2.20" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -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", -] +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" [[package]] name = "android-tzdata" @@ -698,26 +113,26 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.10" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" +checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" [[package]] name = "anstyle-parse" -version = "0.2.6" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" +checksum = "317b9a89c1868f5ea6ff1d9539a69f45dffc21ce321ac1fd1160dfa48c8e2140" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.1.2" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" +checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.48.0", ] [[package]] @@ -732,137 +147,13 @@ dependencies = [ [[package]] name = "argminmax" -version = "0.6.2" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52424b59d69d69d5056d508b260553afd91c57e21849579cd1f50ee8b8b88eaa" +checksum = "202108b46429b765ef483f8a24d5c46f48c14acfdacc086dd4ab6dddf6bcdbd2" 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" @@ -871,15 +162,34 @@ checksum = "bf7d0a018de4f6aa429b9d33d69edf69072b1c5b1cb8d3e4a5f7ef898fc3eb76" [[package]] name = "arrayvec" -version = "0.7.6" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" +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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8824ecca2e851cec16968d54a01dd372ef8f95b244fb84b84e70128be347c3c6" +dependencies = [ + "term", +] [[package]] name = "async-stream" -version = "0.3.6" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b5a71a6f37880a80d1d7f19efd781e4b5de42c88f0722cc13bcb6cc2cfe8476" +checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51" dependencies = [ "async-stream-impl", "futures-core", @@ -888,24 +198,24 @@ dependencies = [ [[package]] name = "async-stream-impl" -version = "0.3.6" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" +checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.38", ] [[package]] name = "async-trait" -version = "0.1.83" +version = "0.1.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" +checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.38", ] [[package]] @@ -916,7 +226,7 @@ checksum = "b6d7b9decdf35d8908a7e3ef02f64c5e9b1695e230154c0e8de3969142d9b94c" dependencies = [ "futures", "pharos", - "rustc_version 0.4.1", + "rustc_version", ] [[package]] @@ -936,34 +246,35 @@ checksum = "9ae037714f313c1353189ead58ef9eec30a8e8dc101b2622d461418fd59e28a9" [[package]] name = "auto_impl" -version = "1.2.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" +checksum = "fee3da8ef1276b0bee5dd1c7258010d8fffd31801447323115a25560e1327b89" dependencies = [ + "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.89", + "syn 1.0.109", ] [[package]] name = "autocfg" -version = "1.4.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "backtrace" -version = "0.3.74" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" dependencies = [ "addr2line", + "cc", "cfg-if", "libc", "miniz_oxide", "object", "rustc-demangle", - "windows-targets 0.52.6", ] [[package]] @@ -974,15 +285,15 @@ checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" [[package]] name = "base64" -version = "0.21.7" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.22.1" +version = "0.21.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" +checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" [[package]] name = "base64ct" @@ -991,10 +302,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" [[package]] -name = "bimap" -version = "0.6.3" +name = "bech32" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "230c5f1ca6a325a32553f8640d31ac9b49f2411e901e427570154868b46da4f7" +checksum = "d86b93f97252c47b41663388e6d155714a9d0c398b99f1005cbc5f978b29f445" [[package]] name = "bit-set" @@ -1013,9 +324,15 @@ checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" [[package]] name = "bitflags" -version = "2.6.0" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" [[package]] name = "bitvec" @@ -1038,23 +355,11 @@ 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" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d640d25bc63c50fb1f0b545ffd80207d2e10a4c965530809b40ba3386825c391" +checksum = "516074a47ef4bce09577a3b379392300159ce5b1ba2e501ff1c819950066100f" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -1072,10 +377,20 @@ dependencies = [ ] [[package]] -name = "bumpalo" -version = "3.16.0" +name = "bs58" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +checksum = "f5353f36341f7451062466f0b755b96ac3a9547e4d7f6b70d603fc721a7d7896" +dependencies = [ + "sha2", + "tinyvec", +] + +[[package]] +name = "bumpalo" +version = "3.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" [[package]] name = "byte-slice-cast" @@ -1085,22 +400,22 @@ checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" [[package]] name = "bytemuck" -version = "1.20.0" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b37c88a63ffd85d15b406896cc343916d7cf57838a847b3a6f2ca5d39a5695a" +checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6" dependencies = [ "bytemuck_derive", ] [[package]] name = "bytemuck_derive" -version = "1.8.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcfcc3cd946cb52f0bbfdbbcfa2f4e24f75ebb6c0e1002f7c25904fada18b9ec" +checksum = "965ab7eb5f8f97d2a083c799f3a1b994fc397b2fe2da5d1da1626ce15a39f2b1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.38", ] [[package]] @@ -1111,37 +426,74 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.8.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" dependencies = [ "serde", ] [[package]] -name = "c-kzg" -version = "1.0.3" +name = "bzip2" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0307f72feab3300336fb803a57134159f6e20139af1357f36c54cb90d8e8928" +checksum = "bdb116a6ef3f6c3698828873ad02c3014b3c85cadb88496095628e3ef1e347f8" dependencies = [ - "blst", - "cc", - "glob", - "hex", + "bzip2-sys", "libc", - "once_cell", +] + +[[package]] +name = "bzip2-sys" +version = "0.1.11+1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" +dependencies = [ + "cc", + "libc", + "pkg-config", +] + +[[package]] +name = "camino" +version = "1.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" +dependencies = [ "serde", ] +[[package]] +name = "cargo-platform" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12024c4645c97566567129c204f65d5815a8c9aecf30fcbe682b2fe034996d36" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo_metadata" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7daec1a2a2129eeba1644b220b4647ec537b0b5d4bfd6876fcc5a540056b592" +dependencies = [ + "camino", + "cargo-platform", + "semver", + "serde", + "serde_json", + "thiserror", +] + [[package]] name = "cc" -version = "1.2.1" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd9de9f2205d5ef3fd67e685b0df337994ddd4495e2a28d185500d0e1edfea47" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" dependencies = [ "jobserver", "libc", - "shlex", ] [[package]] @@ -1152,9 +504,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.38" +version = "0.4.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" +checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" dependencies = [ "android-tzdata", "iana-time-zone", @@ -1162,29 +514,17 @@ dependencies = [ "num-traits", "serde", "wasm-bindgen", - "windows-targets 0.52.6", + "windows-targets 0.48.5", ] [[package]] -name = "chrono-tz" -version = "0.8.6" +name = "cipher" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d59ae0466b83e838b81a54256c39d5d7c20b9d7daa10510a242d9b75abd5936e" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" 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", + "crypto-common", + "inout", ] [[package]] @@ -1216,10 +556,10 @@ version = "4.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd1cd2cebdb1ec98182edb745382a2b65d6bc254782de26316e4366d83d39988" dependencies = [ - "heck 0.4.1", + "heck", "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.38", ] [[package]] @@ -1229,72 +569,125 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98979652585ac7c8d6267e363229b6a26bc4bf469c69e96442f85830ebc89f45" [[package]] -name = "color-print" -version = "0.3.7" +name = "coins-bip32" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3aa954171903797d5623e047d9ab69d91b493657917bdfb8c2c80ecaf9cdb6f4" +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.5", + "bech32", + "bs58", + "digest", + "generic-array", + "hex", + "ripemd", + "serde", + "serde_derive", + "sha2", + "sha3", + "thiserror", +] + +[[package]] +name = "color-print" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a858372ff14bab9b1b30ea504f2a4bc534582aee3e42ba2d41d2a7baba63d5d" dependencies = [ "color-print-proc-macro", ] [[package]] name = "color-print-proc-macro" -version = "0.3.7" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "692186b5ebe54007e45a59aea47ece9eb4108e141326c304cdc91699a7118a22" +checksum = "57e37866456a721d0a404439a1adae37a31be4e0055590d053dfe6981e05003f" dependencies = [ "nom", "proc-macro2", "quote", - "syn 2.0.89", + "syn 1.0.109", ] [[package]] name = "colorchoice" -version = "1.0.3" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" +checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[package]] name = "colored" -version = "2.1.0" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" +checksum = "2674ec482fbc38012cf31e6c42ba0177b431a0cb6f15fe40efa5aab1bda516f6" dependencies = [ + "is-terminal", "lazy_static", "windows-sys 0.48.0", ] [[package]] name = "comfy-table" -version = "7.1.3" +version = "7.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24f165e7b643266ea80cb858aed492ad9280e3e05ce24d4a99d7d7b889b6a4d9" +checksum = "7c64043d6c7b7a4c58e39e7efccfdea7b93d885a795d0c054a69dbbf4dd52686" dependencies = [ "crossterm", "strum", - "strum_macros 0.26.4", - "unicode-width 0.2.0", + "strum_macros", + "unicode-width", ] [[package]] name = "console" -version = "0.15.8" +version = "0.15.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb" +checksum = "c926e00cc70edefdc64d3a5ff31cc65bb97a3460097762bd23afb4d8145fccf8" dependencies = [ "encode_unicode", "lazy_static", "libc", - "unicode-width 0.1.14", - "windows-sys 0.52.0", + "unicode-width", + "windows-sys 0.45.0", ] [[package]] name = "const-hex" -version = "1.13.2" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "487981fa1af147182687064d0a2c336586d337a606595ced9ffb0c685c250c73" +checksum = "a5104de16b218eddf8e34ffe2f86f74bfa4e61e95a1b89732fccf6325efd0557" dependencies = [ "cfg-if", "cpufeatures", @@ -1305,15 +698,21 @@ dependencies = [ [[package]] name = "const-oid" -version = "0.9.6" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" +checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" + +[[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" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" dependencies = [ "core-foundation-sys", "libc", @@ -1321,81 +720,91 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.7" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" +checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" [[package]] name = "cpufeatures" -version = "0.2.16" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16b80225097f2e5ae4e7179dd2266824648f3e2f49d9134d584b76389d31c4c3" +checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0" dependencies = [ "libc", ] [[package]] name = "crc32fast" -version = "1.4.2" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" dependencies = [ "cfg-if", ] [[package]] name = "crossbeam-channel" -version = "0.5.13" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" +checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" dependencies = [ + "cfg-if", "crossbeam-utils", ] [[package]] name = "crossbeam-deque" -version = "0.8.5" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" dependencies = [ + "cfg-if", "crossbeam-epoch", "crossbeam-utils", ] [[package]] name = "crossbeam-epoch" -version = "0.9.18" +version = "0.9.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" dependencies = [ + "autocfg", + "cfg-if", "crossbeam-utils", + "memoffset", + "scopeguard", ] [[package]] name = "crossbeam-queue" -version = "0.3.11" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" +checksum = "d1cfb3ea8a53f37c40dea2c7bedcbd88bdfae54f5e2175d6ecaff1c988353add" dependencies = [ + "cfg-if", "crossbeam-utils", ] [[package]] name = "crossbeam-utils" -version = "0.8.20" +version = "0.8.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" +checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" +dependencies = [ + "cfg-if", +] [[package]] name = "crossterm" -version = "0.28.1" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "829d955a0bb380ef178a640b91779e3987da38c9aea133b20614cfed8cdea9c6" +checksum = "f476fe445d41c9e991fd07515a6f463074b782242ccf4a5b7b1d1012e70824df" dependencies = [ - "bitflags", + "bitflags 2.4.1", "crossterm_winapi", + "libc", "parking_lot", - "rustix", "winapi", ] @@ -1418,12 +827,12 @@ checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" name = "cryo_cli" version = "0.3.2" dependencies = [ - "alloy", "anstyle", "clap_cryo", "color-print", "colored", "cryo_freeze", + "ethers", "eyre", "governor", "hex", @@ -1439,16 +848,18 @@ dependencies = [ name = "cryo_freeze" version = "0.3.2" dependencies = [ - "alloy", "async-trait", "chrono", "colored", "cryo_to_df", + "ethers", + "ethers-core", "futures", "governor", - "heck 0.4.1", - "indexmap", + "heck", + "indexmap 2.1.0", "indicatif", + "lazy_static", "mesc", "polars", "prefix-hex", @@ -1458,7 +869,6 @@ dependencies = [ "thiserror", "thousands", "tokio", - "url", ] [[package]] @@ -1479,7 +889,7 @@ dependencies = [ name = "cryo_to_df" version = "0.3.2" dependencies = [ - "indexmap", + "indexmap 2.1.0", "proc-macro2", "quote", "syn 1.0.109", @@ -1487,9 +897,9 @@ dependencies = [ [[package]] name = "crypto-bigint" -version = "0.5.5" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" +checksum = "740fe28e594155f10cfc383984cbefd529d7396050557148f79cb0f621204124" dependencies = [ "generic-array", "rand_core", @@ -1507,6 +917,15 @@ 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" @@ -1514,21 +933,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" dependencies = [ "cfg-if", - "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", + "hashbrown 0.14.2", "lock_api", "once_cell", "parking_lot_core", @@ -1536,25 +941,34 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.6.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" +checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" [[package]] name = "der" -version = "0.7.9" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" +checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" dependencies = [ "const-oid", "zeroize", ] [[package]] -name = "derivative" -version = "2.2.0" +name = "deranged" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +checksum = "0f32d04922c60427da6f9fef14d042d9edddef64cb9d4ce0d64d0685fbeb1fd3" +dependencies = [ + "powerfmt", +] + +[[package]] +name = "derive_more" +version = "0.99.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" dependencies = [ "proc-macro2", "quote", @@ -1562,34 +976,10 @@ dependencies = [ ] [[package]] -name = "derive_more" -version = "1.0.0" +name = "diff" +version = "0.1.13" 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", -] +checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" [[package]] name = "digest" @@ -1604,42 +994,67 @@ dependencies = [ ] [[package]] -name = "displaydoc" -version = "0.2.5" +name = "dirs" +version = "5.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.89", + "dirs-sys", ] [[package]] -name = "doctest-file" -version = "1.0.0" +name = "dirs-next" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aac81fa3e28d21450aa4d2ac065992ba96a1d7303efbce51a95f4fd175b67562" +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", +] [[package]] name = "dunce" -version = "1.0.5" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" +checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" [[package]] name = "dyn-clone" -version = "1.0.17" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" +checksum = "23d2f3407d9a573d666de4b5bdf10569d73ca9478087346697dcbae6244bfbcd" [[package]] name = "ecdsa" -version = "0.16.9" +version = "0.16.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" +checksum = "a4b1e0c257a9e9f25f90ff76d7a68360ed497ee519c8e428d1825ef0000799d4" dependencies = [ "der", - "digest 0.10.7", + "digest", "elliptic-curve", "rfc6979", "signature", @@ -1648,19 +1063,19 @@ dependencies = [ [[package]] name = "either" -version = "1.13.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] name = "elliptic-curve" -version = "0.13.8" +version = "0.13.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +checksum = "d97ca172ae9dc9f9b779a6e3a65d308f2af74e5b8c921299075bdb4a0370e914" dependencies = [ "base16ct", "crypto-bigint", - "digest 0.10.7", + "digest", "ff", "generic-array", "group", @@ -1671,6 +1086,15 @@ 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" @@ -1678,15 +1102,42 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" [[package]] -name = "enum_dispatch" -version = "0.3.13" +name = "encoding_rs" +version = "0.8.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa18ce2bc66555b3218614519ac839ddb759a7d6720732f979ef8d13be147ecd" +checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "enr" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe81b5c06ecfdbc71dd845216f225f53b62a10cb8a16c946836a3467f701d05b" +dependencies = [ + "base64 0.21.5", + "bytes", + "hex", + "k256", + "log", + "rand", + "rlp", + "serde", + "sha3", + "zeroize", +] + +[[package]] +name = "enum_dispatch" +version = "0.3.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f33313078bb8d4d05a2733a94ac4c2d8a0df9a2b84424ebf4f33bfc224a890e" dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.38", ] [[package]] @@ -1697,12 +1148,331 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.9" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +checksum = "ac3e13f66a2f95e32a39eaa81f6b95d42878ca0e1db0c7543723dfe12557e860" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.48.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", +] + +[[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.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ad13497f6e0a24292fc7b408e30d22fe9dc262da1f40d7b542c3a44e7fc0476" +dependencies = [ + "ethers-addressbook", + "ethers-contract", + "ethers-core", + "ethers-etherscan", + "ethers-middleware", + "ethers-providers", + "ethers-signers", + "ethers-solc", +] + +[[package]] +name = "ethers-addressbook" +version = "2.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6e9e8acd0ed348403cc73a670c24daba3226c40b98dc1a41903766b3ab6240a" +dependencies = [ + "ethers-core", + "once_cell", + "serde", + "serde_json", +] + +[[package]] +name = "ethers-contract" +version = "2.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d79269278125006bb0552349c03593ffa9702112ca88bc7046cc669f148fb47c" +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.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce95a43c939b2e4e2f3191c5ad4a1f279780b8a39139c9905b43a7433531e2ab" +dependencies = [ + "Inflector", + "const-hex", + "dunce", + "ethers-core", + "ethers-etherscan", + "eyre", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "reqwest", + "serde", + "serde_json", + "syn 2.0.38", + "toml", + "walkdir", +] + +[[package]] +name = "ethers-contract-derive" +version = "2.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9ce44906fc871b3ee8c69a695ca7ec7f70e50cb379c9b9cb5e532269e492f6" +dependencies = [ + "Inflector", + "const-hex", + "ethers-contract-abigen", + "ethers-core", + "proc-macro2", + "quote", + "serde_json", + "syn 2.0.38", +] + +[[package]] +name = "ethers-core" +version = "2.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0a17f0708692024db9956b31d7a20163607d2745953f5ae8125ab368ba280ad" +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.38", + "tempfile", + "thiserror", + "tiny-keccak", + "unicode-xid", +] + +[[package]] +name = "ethers-etherscan" +version = "2.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e53451ea4a8128fbce33966da71132cf9e1040dcfd2a2084fd7733ada7b2045" +dependencies = [ + "ethers-core", + "reqwest", + "semver", + "serde", + "serde_json", + "thiserror", + "tracing", +] + +[[package]] +name = "ethers-middleware" +version = "2.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "473f1ccd0c793871bbc248729fa8df7e6d2981d6226e4343e3bbaa9281074d5d" +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.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6838fa110e57d572336178b7c79e94ff88ef976306852d8cb87d9e5b1fc7c0b5" +dependencies = [ + "async-trait", + "auto_impl", + "base64 0.21.5", + "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.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ea44bec930f12292866166f9ddbea6aa76304850e4d8dcd66dc492b43d00ff1" +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.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de34e484e7ae3cab99fbfd013d6c5dc7f9013676a4e0e414d8b12e1213e8b3ba" +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]] @@ -1713,9 +1483,9 @@ checksum = "b90ca2580b73ab6a1f724b76ca11ab632df820fd6040c336200d2c1df7b3c82c" [[package]] name = "eyre" -version = "0.6.12" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cd915d99f24784cdc19fd37ef22b97e3ff0ae756c7e492e9fbfe897d61e2aec" +checksum = "4c2b6b5a29c02cdc822728b7d7b8ae1bab3e3b05d44522770ddd49722eeac7eb" dependencies = [ "indenter", "once_cell", @@ -1735,20 +1505,9 @@ checksum = "95765f67b4b18863968b4a1bd5bb576f732b29a4a28c7cd84c09fa3e2875f33c" [[package]] name = "fastrand" -version = "2.2.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -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", -] +checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" [[package]] name = "ff" @@ -1773,10 +1532,16 @@ dependencies = [ ] [[package]] -name = "flate2" -version = "1.0.35" +name = "fixedbitset" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + +[[package]] +name = "flate2" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" dependencies = [ "crc32fast", "miniz_oxide", @@ -1797,27 +1562,6 @@ 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" @@ -1826,13 +1570,23 @@ checksum = "ee1b05cbd864bcaecbd3455d6d967862d446e4ebfc3c2e5e5b9841e53cba6673" [[package]] name = "form_urlencoded" -version = "1.2.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" 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" @@ -1841,9 +1595,9 @@ checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] name = "futures" -version = "0.3.31" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" +checksum = "da0290714b38af9b4a7b094b8a37086d1b4e61f2df9122c3cad2577669145335" dependencies = [ "futures-channel", "futures-core", @@ -1856,9 +1610,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.31" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" +checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" dependencies = [ "futures-core", "futures-sink", @@ -1866,15 +1620,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.31" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" +checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" [[package]] name = "futures-executor" -version = "0.3.31" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" +checksum = "0f4fb8693db0cf099eadcca0efe2a5a22e4550f98ed16aba6c48700da29597bc" dependencies = [ "futures-core", "futures-task", @@ -1883,44 +1637,58 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.31" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" +checksum = "8bf34a163b5c4c52d0478a4d757da8fb65cabef42ba90515efee0f6f9fa45aaa" + +[[package]] +name = "futures-locks" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45ec6fe3675af967e67c5536c0b9d44e34e6c52f86bedc4ea49c5317b8e94d06" +dependencies = [ + "futures-channel", + "futures-task", +] [[package]] name = "futures-macro" -version = "0.3.31" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" +checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.38", ] [[package]] name = "futures-sink" -version = "0.3.31" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" +checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" [[package]] name = "futures-task" -version = "0.3.31" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" +checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" [[package]] name = "futures-timer" -version = "3.0.3" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" +checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" +dependencies = [ + "gloo-timers", + "send_wrapper 0.4.0", +] [[package]] name = "futures-util" -version = "0.3.31" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" +checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" dependencies = [ "futures-channel", "futures-core", @@ -1935,10 +1703,13 @@ dependencies = [ ] [[package]] -name = "futures-utils-wasm" -version = "0.1.0" +name = "fxhash" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42012b0f064e01aa58b545fe3727f90f7dd4020f4a3ea735b50344965f5a57e9" +checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" +dependencies = [ + "byteorder", +] [[package]] name = "generic-array" @@ -1953,9 +1724,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.15" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" dependencies = [ "cfg-if", "js-sys", @@ -1966,9 +1737,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.31.1" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" +checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" [[package]] name = "glob" @@ -1977,23 +1748,33 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] -name = "governor" -version = "0.6.3" +name = "gloo-timers" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68a7f542ee6b35af73b06abc0dad1c1bae89964e4e253bc4b587b91c9637867b" +checksum = "9b995a66bb87bebce9a0f4a95aed01daca4872c050bfcb21653361c03bc35e5c" +dependencies = [ + "futures-channel", + "futures-core", + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "governor" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "821239e5672ff23e2a7060901fa622950bbd80b649cdaadd78d1c1767ed14eb4" dependencies = [ "cfg-if", - "dashmap 5.5.3", + "dashmap", "futures", "futures-timer", "no-std-compat", "nonzero_ext", "parking_lot", - "portable-atomic", "quanta", "rand", "smallvec", - "spinning_top", ] [[package]] @@ -2008,26 +1789,54 @@ dependencies = [ ] [[package]] -name = "halfbrown" -version = "0.2.5" +name = "h2" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8588661a8607108a5ca69cab034063441a0413a0b041c13618a7dd348021ef6f" +checksum = "91fc23aa11be92976ef4729127f1a74adf36d8436f7816b185d18df956790833" dependencies = [ - "hashbrown 0.14.5", + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap 1.9.3", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "halfbrown" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5681137554ddff44396e5f149892c769d45301dd9aa19c51602a89ee214cb0ec" +dependencies = [ + "hashbrown 0.13.2", "serde", ] +[[package]] +name = "hashbrown" +version = "0.12.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.5" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156" dependencies = [ "ahash", "allocator-api2", @@ -2035,15 +1844,12 @@ dependencies = [ ] [[package]] -name = "hashbrown" -version = "0.15.2" +name = "hashers" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" +checksum = "b2bca93b15ea5a746f220e56587f71e73c6165eab783df9e26590069953e3c30" dependencies = [ - "allocator-api2", - "equivalent", - "foldhash", - "serde", + "fxhash", ] [[package]] @@ -2052,38 +1858,17 @@ 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" +version = "0.3.3" 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" +checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" [[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" @@ -2091,23 +1876,23 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ - "digest 0.10.7", + "digest", ] [[package]] name = "home" -version = "0.5.9" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.48.0", ] [[package]] name = "http" -version = "1.1.0" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" +checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" dependencies = [ "bytes", "fnv", @@ -2116,99 +1901,77 @@ dependencies = [ [[package]] name = "http-body" -version = "1.0.1" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" 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.9.5" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hyper" -version = "1.5.1" +version = "0.14.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97818827ef4f364230e16705d4706e2897df2bb60617d6ca15d598025a3c481f" +checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" dependencies = [ "bytes", "futures-channel", + "futures-core", "futures-util", + "h2", "http", "http-body", "httparse", + "httpdate", "itoa", "pin-project-lite", - "smallvec", + "socket2 0.4.10", "tokio", + "tower-service", + "tracing", "want", ] [[package]] -name = "hyper-tls" -version = "0.6.0" +name = "hyper-rustls" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" +checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" 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", + "rustls", "tokio", - "tower-service", - "tracing", + "tokio-rustls", ] [[package]] name = "iana-time-zone" -version = "0.1.61" +version = "0.1.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" +checksum = "8326b86b6cff230b97d0d312a6c40a60726df3332e721f72a1b035f451663b20" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "windows-core", + "windows-core 0.51.1", ] [[package]] @@ -2220,143 +1983,14 @@ dependencies = [ "cc", ] -[[package]] -name = "icu_collections" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" -dependencies = [ - "displaydoc", - "yoke", - "zerofrom", - "zerovec", -] - -[[package]] -name = "icu_locid" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" -dependencies = [ - "displaydoc", - "litemap", - "tinystr", - "writeable", - "zerovec", -] - -[[package]] -name = "icu_locid_transform" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" -dependencies = [ - "displaydoc", - "icu_locid", - "icu_locid_transform_data", - "icu_provider", - "tinystr", - "zerovec", -] - -[[package]] -name = "icu_locid_transform_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" - -[[package]] -name = "icu_normalizer" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" -dependencies = [ - "displaydoc", - "icu_collections", - "icu_normalizer_data", - "icu_properties", - "icu_provider", - "smallvec", - "utf16_iter", - "utf8_iter", - "write16", - "zerovec", -] - -[[package]] -name = "icu_normalizer_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" - -[[package]] -name = "icu_properties" -version = "1.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" -dependencies = [ - "displaydoc", - "icu_collections", - "icu_locid_transform", - "icu_properties_data", - "icu_provider", - "tinystr", - "zerovec", -] - -[[package]] -name = "icu_properties_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" - -[[package]] -name = "icu_provider" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" -dependencies = [ - "displaydoc", - "icu_locid", - "icu_provider_macros", - "stable_deref_trait", - "tinystr", - "writeable", - "yoke", - "zerofrom", - "zerovec", -] - -[[package]] -name = "icu_provider_macros" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.89", -] - [[package]] name = "idna" -version = "1.0.3" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" 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", + "unicode-bidi", + "unicode-normalization", ] [[package]] @@ -2369,14 +2003,32 @@ dependencies = [ ] [[package]] -name = "impl-trait-for-tuples" -version = "0.2.3" +name = "impl-rlp" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0eb5a3343abf848c0984fe4604b2b105da9539376e24fc0a3b0007411ae4fd9" +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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 1.0.109", ] [[package]] @@ -2387,64 +2039,76 @@ checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" [[package]] name = "indexmap" -version = "2.6.0" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" +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" dependencies = [ "equivalent", - "hashbrown 0.15.2", - "serde", + "hashbrown 0.14.2", ] [[package]] name = "indicatif" -version = "0.17.9" +version = "0.17.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf675b85ed934d3c67b5c5469701eec7db22689d0a2139d856e0925fa28b281" +checksum = "fb28741c9db9a713d93deb3bb9515c20788cef5815265bee4980e87bde7e0f25" dependencies = [ "console", + "instant", "number_prefix", "portable-atomic", - "unicode-width 0.2.0", - "web-time", + "unicode-width", ] [[package]] name = "indoc" -version = "2.0.5" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5" +checksum = "1e186cfbae8084e513daff4240b4797e342f988cecda4fb6c939150f96315fd8" [[package]] -name = "interprocess" -version = "2.2.2" +name = "inout" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "894148491d817cb36b6f778017b8ac46b17408d522dd90f539d677ea938362eb" +checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" dependencies = [ - "doctest-file", - "futures-core", - "libc", - "recvmsg", - "tokio", - "widestring", - "windows-sys 0.52.0", + "generic-array", +] + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", ] [[package]] name = "ipnet" -version = "2.10.1" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" +checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] name = "is-terminal" -version = "0.4.13" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "261f68e344040fbd0edea105bef17c66edf46f984ddb1115b775ce31be948f4b" +checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" dependencies = [ - "hermit-abi 0.4.0", - "libc", - "windows-sys 0.52.0", + "hermit-abi", + "rustix", + "windows-sys 0.48.0", ] [[package]] @@ -2458,97 +2122,113 @@ dependencies = [ [[package]] name = "itertools" -version = "0.13.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" dependencies = [ "either", ] [[package]] name = "itoa" -version = "1.0.14" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" - -[[package]] -name = "itoap" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9028f49264629065d057f340a86acb84867925865f73bbf8d47b4d149a7e88b8" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "jobserver" -version = "0.1.32" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" +checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d" dependencies = [ "libc", ] [[package]] name = "js-sys" -version = "0.3.72" +version = "0.3.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" +checksum = "54c0c35952f67de54bb584e9fd912b3023117cbafc0a77d8f3dee1fb5f572fe8" dependencies = [ "wasm-bindgen", ] [[package]] -name = "jsonpath_lib_polars_vendor" -version = "0.0.1" +name = "jsonwebtoken" +version = "8.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4bd9354947622f7471ff713eacaabdb683ccb13bba4edccaab9860abf480b7d" +checksum = "6971da4d9c3aa03c3d8f3ff0f4155b534aad021292003895a469716b2a230378" dependencies = [ - "log", + "base64 0.21.5", + "pem", + "ring 0.16.20", "serde", "serde_json", + "simple_asn1", ] [[package]] name = "k256" -version = "0.13.4" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6e3919bbaa2945715f0bb6d3934a173d1e9a59ac23767fbaaef277265a7411b" +checksum = "cadb76004ed8e97623117f3df85b17aaa6626ab0b0831e6573f104df16cd1bcc" dependencies = [ "cfg-if", "ecdsa", "elliptic-curve", "once_cell", "sha2", + "signature", ] [[package]] name = "keccak" -version = "0.1.5" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" +checksum = "8f6d5ed8676d904364de097082f4e7d240b571b67989ced0240f08b7f966f940" dependencies = [ "cpufeatures", ] [[package]] -name = "keccak-asm" -version = "0.1.4" +name = "lalrpop" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "505d1856a39b200489082f90d897c3f07c455563880bc5952e38eabf731c83b6" +checksum = "da4081d44f4611b66c6dd725e6de3169f9f63905421e8626fcb86b6a898998b8" dependencies = [ - "digest 0.10.7", - "sha3-asm", + "ascii-canvas", + "bit-set", + "diff", + "ena", + "is-terminal", + "itertools 0.10.5", + "lalrpop-util", + "petgraph", + "regex", + "regex-syntax 0.7.5", + "string_cache", + "term", + "tiny-keccak", + "unicode-xid", ] [[package]] -name = "lazy_static" -version = "1.5.0" +name = "lalrpop-util" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +checksum = "3f35c735096c0293d313e8f2a641627472b83d01b937177fe76e5e2708d31e0d" + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "lexical-core" -version = "1.0.2" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0431c65b318a590c1de6b8fd6e72798c92291d27762d94c9e6c37ed7a73d8458" +checksum = "2cde5de06e8d4c2faabc400238f9ae1c74d5412d03a7bd067645ccbc47070e46" dependencies = [ "lexical-parse-float", "lexical-parse-integer", @@ -2559,9 +2239,9 @@ dependencies = [ [[package]] name = "lexical-parse-float" -version = "1.0.2" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb17a4bdb9b418051aa59d41d65b1c9be5affab314a872e5ad7f06231fb3b4e0" +checksum = "683b3a5ebd0130b8fb52ba0bdc718cc56815b6a097e28ae5a6997d0ad17dc05f" dependencies = [ "lexical-parse-integer", "lexical-util", @@ -2570,9 +2250,9 @@ dependencies = [ [[package]] name = "lexical-parse-integer" -version = "1.0.2" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5df98f4a4ab53bf8b175b363a34c7af608fe31f93cc1fb1bf07130622ca4ef61" +checksum = "6d0994485ed0c312f6d965766754ea177d07f9c00c9b82a5ee62ed5b47945ee9" dependencies = [ "lexical-util", "static_assertions", @@ -2580,18 +2260,18 @@ dependencies = [ [[package]] name = "lexical-util" -version = "1.0.3" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85314db53332e5c192b6bca611fb10c114a80d1b831ddac0af1e9be1b9232ca0" +checksum = "5255b9ff16ff898710eb9eb63cb39248ea8a5bb036bea8085b1a767ff6c4e3fc" dependencies = [ "static_assertions", ] [[package]] name = "lexical-write-float" -version = "1.0.2" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e7c3ad4e37db81c1cbe7cf34610340adc09c322871972f74877a712abc6c809" +checksum = "accabaa1c4581f05a3923d1b4cfd124c329352288b7b9da09e766b0668116862" dependencies = [ "lexical-util", "lexical-write-integer", @@ -2600,9 +2280,9 @@ dependencies = [ [[package]] name = "lexical-write-integer" -version = "1.0.2" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb89e9f6958b83258afa3deed90b5de9ef68eef090ad5086c791cd2345610162" +checksum = "e1b6f3d1f4422866b68192d62f77bc5c700bee84f3069f2469d7bc8c77852446" dependencies = [ "lexical-util", "static_assertions", @@ -2610,33 +2290,27 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.165" +version = "0.2.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb4d3d38eab6c5239a362fa8bae48c03baf980a6e7079f063942d563ef3533e" +checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" [[package]] name = "libm" -version = "0.2.11" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" +checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" [[package]] name = "linux-raw-sys" -version = "0.4.14" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" - -[[package]] -name = "litemap" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" +checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f" [[package]] name = "lock_api" -version = "0.4.12" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" dependencies = [ "autocfg", "scopeguard", @@ -2644,43 +2318,54 @@ dependencies = [ [[package]] name = "log" -version = "0.4.22" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -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", -] +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "lz4" -version = "1.28.0" +version = "1.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d1febb2b4a79ddd1980eede06a8f7902197960aa0383ffcfdd62fe723036725" +checksum = "7e9e2dd86df36ce760a60f6ff6ad526f7ba1f14ba0356f8254fb6905e6494df1" dependencies = [ + "libc", "lz4-sys", ] [[package]] name = "lz4-sys" -version = "1.11.1+lz4-1.10.0" +version = "1.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bd8c0d6c6ed0cd30b3652886bb8711dc4bb01d637a68105a3d5158039b418e6" +checksum = "57d27b317e207b10f69f5e75494119e391a96f48861ae870d1da6edac98ca900" dependencies = [ "cc", "libc", ] [[package]] -name = "memchr" -version = "2.7.4" +name = "mach2" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +checksum = "6d0d1830bcd151a6fc4aea1369af235b36c1528fe976b8ff678683c9995eade8" +dependencies = [ + "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.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" [[package]] name = "memmap2" @@ -2693,22 +2378,21 @@ dependencies = [ [[package]] name = "memoffset" -version = "0.9.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" +checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" dependencies = [ "autocfg", ] [[package]] name = "mesc" -version = "0.1.4" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4effaaca264c057c870afd19cf7137ef000ca64fc7292d5a0634ce5ebbb6e27" +checksum = "fc216c0f54636dcc09d9f6ec664f24927f423976f1c9a2f28b34df8bc71d14be" dependencies = [ "serde", "serde_json", - "thiserror", ] [[package]] @@ -2725,30 +2409,29 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.8.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" dependencies = [ - "adler2", + "adler", ] [[package]] name = "mio" -version = "1.0.2" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" +checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0" dependencies = [ - "hermit-abi 0.3.9", "libc", "wasi", - "windows-sys 0.52.0", + "windows-sys 0.48.0", ] [[package]] name = "multiversion" -version = "0.7.4" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4851161a11d3ad0bf9402d90ffc3967bf231768bfd7aeb61755ad06dbf1a142" +checksum = "b2c7b9d7fe61760ce5ea19532ead98541f6b4c495d87247aff9826445cf6872a" dependencies = [ "multiversion-macros", "target-features", @@ -2756,9 +2439,9 @@ dependencies = [ [[package]] name = "multiversion-macros" -version = "0.7.4" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79a74ddee9e0c27d2578323c13905793e91622148f138ba29738f9dddb835e90" +checksum = "26a83d8500ed06d68877e9de1dde76c1dbb83885dcdbda4ef44ccbc3fbda2ac8" dependencies = [ "proc-macro2", "quote", @@ -2767,21 +2450,10 @@ dependencies = [ ] [[package]] -name = "native-tls" -version = "0.2.12" +name = "new_debug_unreachable" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] +checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" [[package]] name = "no-std-compat" @@ -2825,28 +2497,30 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.6" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" dependencies = [ + "autocfg", "num-integer", "num-traits", ] [[package]] name = "num-integer" -version = "0.1.46" +version = "0.1.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" dependencies = [ + "autocfg", "num-traits", ] [[package]] name = "num-traits" -version = "0.2.19" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" dependencies = [ "autocfg", "libm", @@ -2858,28 +2532,29 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.3.9", + "hermit-abi", "libc", ] [[package]] name = "num_enum" -version = "0.7.3" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e613fc340b2220f734a8595782c551f1250e969d87d3be1ae0579e8d4065179" +checksum = "683751d591e6d81200c39fb0d1032608b77724f34114db54f571ff1317b337c0" dependencies = [ "num_enum_derive", ] [[package]] name = "num_enum_derive" -version = "0.7.3" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" +checksum = "6c11e44798ad209ccdd91fc192f0526a369a01234f7373e1b141c96d7cee4f0e" dependencies = [ + "proc-macro-crate 2.0.0", "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.38", ] [[package]] @@ -2890,95 +2565,81 @@ checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" [[package]] name = "object" -version = "0.36.5" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" +checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.20.2" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] -name = "openssl" -version = "0.10.68" +name = "open-fastrlp" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6174bc48f102d208783c2c84bf931bb75927a617866870de8a4ea85597f871f5" +checksum = "786393f80485445794f6043fd3138854dd109cc6c4bd1a6383db304c9ce9b9ce" dependencies = [ - "bitflags", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", + "arrayvec", + "auto_impl", + "bytes", + "ethereum-types", + "open-fastrlp-derive", ] [[package]] -name = "openssl-macros" +name = "open-fastrlp-derive" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +checksum = "003b2be5c6c53c1cfeb0a238b8a1c3915cd410feb684457a36c10038f764bb1c" dependencies = [ + "bytes", "proc-macro2", "quote", - "syn 2.0.89", + "syn 1.0.109", ] [[package]] -name = "openssl-probe" -version = "0.1.5" +name = "option-ext" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -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", -] +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" [[package]] name = "parity-scale-codec" -version = "3.7.0" +version = "3.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8be4817d39f3272f69c59fe05d0535ae6456c2dc2fa1ba02910296c7e0a5c590" +checksum = "0dec8a8073036902368c2cdc0387e85ff9a37054d7e7c98e592145e0c92cd4fb" dependencies = [ "arrayvec", "bitvec", "byte-slice-cast", "impl-trait-for-tuples", "parity-scale-codec-derive", - "rustversion", "serde", ] [[package]] name = "parity-scale-codec-derive" -version = "3.7.0" +version = "3.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8781a75c6205af67215f382092b6e0a4ff3734798523e69073d4bcd294ec767b" +checksum = "312270ee71e1cd70289dacf597cab7b207aa107d2f28191c2ae45b2ece18a260" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", - "syn 2.0.89", + "syn 1.0.109", ] [[package]] name = "parking_lot" -version = "0.12.3" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ "lock_api", "parking_lot_core", @@ -2986,15 +2647,15 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.10" +version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" dependencies = [ "cfg-if", "libc", - "redox_syscall", + "redox_syscall 0.4.1", "smallvec", - "windows-targets 0.52.6", + "windows-targets 0.48.5", ] [[package]] @@ -3008,35 +2669,67 @@ dependencies = [ ] [[package]] -name = "parse-zoneinfo" -version = "0.3.1" +name = "password-hash" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f2a05b18d44e2957b88f96ba460715e295bc1d7510468a2f3d3b44535d26c24" +checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700" dependencies = [ - "regex", + "base64ct", + "rand_core", + "subtle", ] [[package]] -name = "paste" -version = "1.0.15" +name = "path-slash" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +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", +] [[package]] name = "percent-encoding" -version = "2.3.1" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] -name = "pest" -version = "2.7.14" +name = "petgraph" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "879952a81a83930934cbf1786752d6dedc3b1f29e8f8fb2ad1d0a36f377cf442" +checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" dependencies = [ - "memchr", - "thiserror", - "ucd-trie", + "fixedbitset", + "indexmap 2.1.0", ] [[package]] @@ -3046,7 +2739,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e9567389417feee6ce15dd6527a8a1ecac205ef62c2932bcf3d9f6fc5b78b414" dependencies = [ "futures", - "rustc_version 0.4.1", + "rustc_version", ] [[package]] @@ -3055,17 +2748,8 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" dependencies = [ - "phf_shared", -] - -[[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", + "phf_macros", + "phf_shared 0.11.2", ] [[package]] @@ -3074,10 +2758,32 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" dependencies = [ - "phf_shared", + "phf_shared 0.11.2", "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.38", +] + +[[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" @@ -3089,29 +2795,29 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.1.7" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be57f64e946e500c8ee36ef6331845d40a93055567ec57e8fae13efd33759b95" +checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.7" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" +checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.38", ] [[package]] name = "pin-project-lite" -version = "0.2.15" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] name = "pin-utils" @@ -3131,9 +2837,9 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.31" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" +checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" [[package]] name = "planus" @@ -3146,36 +2852,31 @@ dependencies = [ [[package]] name = "polars" -version = "0.38.3" +version = "0.36.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f01006048a264047d6cba081fed8e11adbd69c15956f9e53185a9ac4a541853c" +checksum = "938048fcda6a8e2ace6eb168bee1b415a92423ce51e418b853bf08fc40349b6b" 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.38.3" +version = "0.36.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25197f40d71f82b2f79bb394f03e555d3cc1ce4db1dd052c28318721c71e96ad" +checksum = "ce68a02f698ff7787c261aea1b4c040a8fe183a8fb200e2436d7f35d95a1b86f" dependencies = [ "ahash", - "atoi", + "arrow-format", "atoi_simd", "bytemuck", "chrono", - "chrono-tz", "dyn-clone", "either", "ethnum", @@ -3183,13 +2884,11 @@ dependencies = [ "foreign_vec", "futures", "getrandom", - "hashbrown 0.14.5", + "hashbrown 0.14.2", "itoa", - "itoap", "lz4", "multiversion", "num-traits", - "polars-arrow-format", "polars-error", "polars-utils", "ryu", @@ -3197,50 +2896,36 @@ dependencies = [ "streaming-iterator", "strength_reduce", "version_check", - "zstd", -] - -[[package]] -name = "polars-arrow-format" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19b0ef2474af9396b19025b189d96e992311e6a47f90c53cd998b36c4c64b84c" -dependencies = [ - "planus", - "serde", + "zstd 0.13.0", ] [[package]] name = "polars-compute" -version = "0.38.3" +version = "0.36.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c354515f73cdbbad03c2bf723fcd68e6825943b3ec503055abc8a8cb08ce46bb" +checksum = "b14fbc5f141b29b656a4cec4802632e5bff10bf801c6809c6bbfbd4078a044dd" dependencies = [ "bytemuck", - "either", "num-traits", "polars-arrow", - "polars-error", "polars-utils", - "strength_reduce", "version_check", ] [[package]] name = "polars-core" -version = "0.38.3" +version = "0.36.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f20d3c227186f74aa3c228c64ef72f5a15617322fed30b4323eaf53b25f8e7b" +checksum = "d0f5efe734b6cbe5f97ea769be8360df5324fade396f1f3f5ad7fe9360ca4a23" dependencies = [ "ahash", - "bitflags", + "bitflags 2.4.1", "bytemuck", "chrono", - "chrono-tz", "comfy-table", "either", - "hashbrown 0.14.5", - "indexmap", + "hashbrown 0.14.2", + "indexmap 2.1.0", "num-traits", "once_cell", "polars-arrow", @@ -3260,11 +2945,11 @@ dependencies = [ [[package]] name = "polars-error" -version = "0.38.3" +version = "0.36.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d66dd0ce51f8bd620eb8bd376502fe68a2b1a446d5433ecd2e75270b0755ce76" +checksum = "6396de788f99ebfc9968e7b6f523e23000506cde4ba6dfc62ae4ce949002a886" dependencies = [ - "polars-arrow-format", + "arrow-format", "regex", "simdutf8", "thiserror", @@ -3272,9 +2957,9 @@ dependencies = [ [[package]] name = "polars-io" -version = "0.38.3" +version = "0.36.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b40bef2edcdc58394792c4d779465144283a09ff1836324e7b72df7978a6e992" +checksum = "7d0458efe8946f4718fd352f230c0db5a37926bd0d2bd25af79dc24746abaaea" dependencies = [ "ahash", "async-trait", @@ -3310,15 +2995,15 @@ dependencies = [ [[package]] name = "polars-json" -version = "0.38.3" +version = "0.36.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef86aca08f10ddc939fe95aabb44e1d2582dcb08b55d4dadb93353ce42adc248" +checksum = "ea47d46b7a98fa683ef235ad48b783abf61734828e754096cfbdc77404fff9b3" dependencies = [ "ahash", "chrono", "fallible-streaming-iterator", - "hashbrown 0.14.5", - "indexmap", + "hashbrown 0.14.2", + "indexmap 2.1.0", "itoa", "num-traits", "polars-arrow", @@ -3331,12 +3016,12 @@ dependencies = [ [[package]] name = "polars-lazy" -version = "0.38.3" +version = "0.36.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c27df26a19d3092298d31d47614ad84dc330c106e38aa8cd53727cd91c07cf56" +checksum = "9d7105b40905bb38e8fc4a7fd736594b7491baa12fad3ac492969ca221a1b5d5" dependencies = [ "ahash", - "bitflags", + "bitflags 2.4.1", "glob", "once_cell", "polars-arrow", @@ -3355,46 +3040,40 @@ dependencies = [ [[package]] name = "polars-ops" -version = "0.38.3" +version = "0.36.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f8a51c3bdc9e7c34196ff6f5c3cb17da134e5aafb1756aaf24b76c7118e63dc" +checksum = "2e09afc456ab11e75e5dcb43e00a01c71f3a46a2781e450054acb6bb096ca78e" dependencies = [ "ahash", "argminmax", - "base64 0.21.7", + "base64 0.21.5", "bytemuck", - "chrono", - "chrono-tz", "either", - "hashbrown 0.14.5", + "hashbrown 0.14.2", "hex", - "indexmap", - "jsonpath_lib_polars_vendor", + "indexmap 2.1.0", "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.38.3" +version = "0.36.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8824ee00fbbe83d69553f2711014c50361238d210ed81a7a297695b7db97d42" +checksum = "7ba24d67b1f64ab85143033dd46fa090b13c0f74acdf91b0780c16aecf005e3d" dependencies = [ "ahash", "async-stream", - "base64 0.21.7", + "base64 0.21.5", "brotli", "ethnum", "flate2", @@ -3409,19 +3088,19 @@ dependencies = [ "simdutf8", "snap", "streaming-decompression", - "zstd", + "zstd 0.13.0", ] [[package]] name = "polars-pipe" -version = "0.38.3" +version = "0.36.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c5e2c1f14e81d60cfa9afe4e611a9bad9631a2cb7cd19b7c0094d0dc32f0231" +checksum = "d9b7ead073cc3917027d77b59861a9f071db47125de9314f8907db1a0a3e4100" dependencies = [ "crossbeam-channel", "crossbeam-queue", "enum_dispatch", - "hashbrown 0.14.5", + "hashbrown 0.14.2", "num-traits", "polars-arrow", "polars-compute", @@ -3433,19 +3112,17 @@ dependencies = [ "polars-utils", "rayon", "smartstring", - "uuid", "version_check", ] [[package]] name = "polars-plan" -version = "0.38.3" +version = "0.36.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff48362bd1b078bbbec7e7ba9ec01fea58fee2887db22a8e3deaf78f322fa3c4" +checksum = "384a175624d050c31c473ee11df9d7af5d729ae626375e522158cfb3d150acd0" dependencies = [ "ahash", "bytemuck", - "chrono-tz", "once_cell", "percent-encoding", "polars-arrow", @@ -3459,17 +3136,16 @@ dependencies = [ "rayon", "regex", "smartstring", - "strum_macros 0.25.3", + "strum_macros", "version_check", ] [[package]] name = "polars-row" -version = "0.38.3" +version = "0.36.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63029da56ff6a720b190490bbc7b6263f9b72d1134311b1f381fc8d306d37770" +checksum = "32322f7acbb83db3e9c7697dc821be73d06238da89c817dcc8bc1549a5e9c72f" dependencies = [ - "bytemuck", "polars-arrow", "polars-error", "polars-utils", @@ -3477,11 +3153,10 @@ dependencies = [ [[package]] name = "polars-sql" -version = "0.38.3" +version = "0.36.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3652c362959f608d1297196b973d1e3acb508a9562b886ac39bf7606b841052b" +checksum = "9f0b4c6ddffdfd0453e84bc3918572c633014d661d166654399cf93752aa95b5" dependencies = [ - "hex", "polars-arrow", "polars-core", "polars-error", @@ -3495,13 +3170,12 @@ dependencies = [ [[package]] name = "polars-time" -version = "0.38.3" +version = "0.36.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86eb74ea6ddfe675aa5c3f33c00dadbe2b85f0e8e3887b85db1fd5a3397267fd" +checksum = "dee2649fc96bd1b6584e0e4a4b3ca7d22ed3d117a990e63ad438ecb26f7544d0" dependencies = [ "atoi", "chrono", - "chrono-tz", "now", "once_cell", "polars-arrow", @@ -3515,18 +3189,17 @@ dependencies = [ [[package]] name = "polars-utils" -version = "0.38.3" +version = "0.36.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "694656a7d2b0cd8f07660dbc8d0fb7a81066ff57a452264907531d805c1e58c4" +checksum = "b174ca4a77ad47d7b91a0460aaae65bbf874c8bfbaaa5308675dadef3976bbda" dependencies = [ "ahash", "bytemuck", - "hashbrown 0.14.5", - "indexmap", + "hashbrown 0.14.2", + "indexmap 2.1.0", "num-traits", "once_cell", "polars-error", - "raw-cpuid", "rayon", "smartstring", "sysinfo", @@ -3535,18 +3208,27 @@ dependencies = [ [[package]] name = "portable-atomic" -version = "1.10.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "280dc24453071f1b63954171985a0b0d30058d287960968b9b2aca264c8d4ee6" +checksum = "3bccab0e7fd7cc19f820a1c8c91720af652d0c88dc9664dd72aef2614f04af3b" + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "ppv-lite86" -version = "0.2.20" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" -dependencies = [ - "zerocopy", -] +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "precomputed-hash" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" [[package]] name = "prefix-hex" @@ -3557,6 +3239,16 @@ dependencies = [ "hex", ] +[[package]] +name = "prettyplease" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d" +dependencies = [ + "proc-macro2", + "syn 2.0.38", +] + [[package]] name = "primitive-types" version = "0.12.2" @@ -3565,81 +3257,91 @@ checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" dependencies = [ "fixed-hash", "impl-codec", + "impl-rlp", + "impl-serde", + "scale-info", "uint", ] [[package]] name = "proc-macro-crate" -version = "3.2.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" +checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" dependencies = [ - "toml_edit", + "once_cell", + "toml_edit 0.19.15", ] [[package]] -name = "proc-macro-error-attr2" +name = "proc-macro-crate" version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" +checksum = "7e8366a6159044a37876a2b9817124296703c586a5c92e2c53751fa06d8d43e8" dependencies = [ - "proc-macro2", - "quote", + "toml_edit 0.20.7", ] [[package]] -name = "proc-macro-error2" -version = "2.0.1" +name = "proc-macro-error" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" dependencies = [ - "proc-macro-error-attr2", + "proc-macro-error-attr", "proc-macro2", "quote", - "syn 2.0.89", + "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", ] [[package]] name = "proc-macro2" -version = "1.0.92" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" +checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" dependencies = [ "unicode-ident", ] [[package]] name = "proptest" -version = "1.5.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4c2511913b88df1637da85cc8d96ec8e43a3f8bb8ccb71ee1ac240d6f3df58d" +checksum = "7c003ac8c77cb07bb74f5f198bce836a689bcd5a42574612bf14d17bfd08c20e" dependencies = [ - "bit-set", - "bit-vec", - "bitflags", + "bitflags 2.4.1", "lazy_static", "num-traits", "rand", "rand_chacha", "rand_xorshift", - "regex-syntax", - "rusty-fork", - "tempfile", + "regex-syntax 0.7.5", "unarray", ] [[package]] name = "pyo3" -version = "0.20.3" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53bdbb96d49157e65d45cc287af5f32ffadd5f4761438b527b055fb0d4bb8233" +checksum = "04e8453b658fe480c3e70c8ed4e3d3ec33eb74988bd186561b0cc66b85c3bc4b" dependencies = [ "cfg-if", "indoc", "libc", "memoffset", "parking_lot", - "portable-atomic", "pyo3-build-config", "pyo3-ffi", "pyo3-macros", @@ -3661,9 +3363,9 @@ dependencies = [ [[package]] name = "pyo3-build-config" -version = "0.20.3" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "deaa5745de3f5231ce10517a1f5dd97d53e5a2fd77aa6b5842292085831d48d7" +checksum = "a96fe70b176a89cff78f2fa7b3c930081e163d5379b4dcdf993e3ae29ca662e5" dependencies = [ "once_cell", "target-lexicon", @@ -3671,9 +3373,9 @@ dependencies = [ [[package]] name = "pyo3-ffi" -version = "0.20.3" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b42531d03e08d4ef1f6e85a2ed422eb678b8cd62b762e53891c05faf0d4afa" +checksum = "214929900fd25e6604661ed9cf349727c8920d47deff196c4e28165a6ef2a96b" dependencies = [ "libc", "pyo3-build-config", @@ -3681,34 +3383,33 @@ dependencies = [ [[package]] name = "pyo3-macros" -version = "0.20.3" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7305c720fa01b8055ec95e484a6eca7a83c841267f0dd5280f0c8b8551d2c158" +checksum = "dac53072f717aa1bfa4db832b39de8c875b7c7af4f4a6fe93cdbf9264cf8383b" dependencies = [ "proc-macro2", "pyo3-macros-backend", "quote", - "syn 2.0.89", + "syn 2.0.38", ] [[package]] name = "pyo3-macros-backend" -version = "0.20.3" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c7e9b68bb9c3149c5b0cade5d07f953d6d125eb4337723c4ccdb665f1f96185" +checksum = "7774b5a8282bd4f25f803b1f0d945120be959a36c72e08e7cd031c792fdfd424" dependencies = [ - "heck 0.4.1", + "heck", "proc-macro2", - "pyo3-build-config", "quote", - "syn 2.0.89", + "syn 2.0.38", ] [[package]] name = "pyo3-polars" -version = "0.12.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6ab8ad08494161085fb0d2d9de82c7fde7398da1778ee7e7a5a596ff4201f5b" +checksum = "b1e983cb07cf665ea6e645ae9263c358062580f23a9aee41618a5706d4a7cc21" dependencies = [ "polars", "polars-core", @@ -3718,12 +3419,13 @@ dependencies = [ [[package]] name = "quanta" -version = "0.12.3" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5167a477619228a0b284fac2674e3c388cba90631d7b7de620e6f1fcd08da5" +checksum = "a17e662a7a8291a865152364c20c7abc5e60486ab2001e8ec10b24862de0b9ab" dependencies = [ "crossbeam-utils", "libc", + "mach2", "once_cell", "raw-cpuid", "wasi", @@ -3731,17 +3433,11 @@ dependencies = [ "winapi", ] -[[package]] -name = "quick-error" -version = "1.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" - [[package]] name = "quote" -version = "1.0.37" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -3761,7 +3457,6 @@ dependencies = [ "libc", "rand_chacha", "rand_core", - "serde", ] [[package]] @@ -3804,18 +3499,18 @@ dependencies = [ [[package]] name = "raw-cpuid" -version = "11.2.0" +version = "10.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ab240315c661615f2ee9f0f2cd32d5a7343a84d5ebcccb99d46e6637565e7b0" +checksum = "6c297679cb867470fa8c9f67dbba74a78d78e3e98d7cf2b08d6d71540f797332" dependencies = [ - "bitflags", + "bitflags 1.3.2", ] [[package]] name = "rayon" -version = "1.10.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" +checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1" dependencies = [ "either", "rayon-core", @@ -3823,115 +3518,136 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.12.1" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed" dependencies = [ "crossbeam-deque", "crossbeam-utils", ] [[package]] -name = "recvmsg" -version = "1.0.0" +name = "redox_syscall" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3edd4d5d42c92f0a659926464d4cce56b562761267ecf0f469d85b7de384175" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags 1.3.2", +] [[package]] name = "redox_syscall" -version = "0.5.7" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" dependencies = [ - "bitflags", + "bitflags 1.3.2", +] + +[[package]] +name = "redox_users" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +dependencies = [ + "getrandom", + "redox_syscall 0.2.16", + "thiserror", ] [[package]] name = "ref-cast" -version = "1.0.23" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccf0a6f84d5f1d581da8b41b47ec8600871962f2a528115b542b362d4b744931" +checksum = "acde58d073e9c79da00f2b5b84eed919c8326832648a5b109b3fce1bb1175280" dependencies = [ "ref-cast-impl", ] [[package]] name = "ref-cast-impl" -version = "1.0.23" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcc303e793d3734489387d205e9b186fac9c6cfacedd98cbb2e8a5943595f3e6" +checksum = "7f7473c2cfcf90008193dd0e3e16599455cb601a9fce322b5bb55de799664925" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.38", ] [[package]] name = "regex" -version = "1.11.1" +version = "1.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" dependencies = [ "aho-corasick", "memchr", "regex-automata", - "regex-syntax", + "regex-syntax 0.8.2", ] [[package]] name = "regex-automata" -version = "0.4.9" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" dependencies = [ "aho-corasick", "memchr", - "regex-syntax", + "regex-syntax 0.8.2", ] [[package]] name = "regex-syntax" -version = "0.8.5" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" +checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" + +[[package]] +name = "regex-syntax" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "reqwest" -version = "0.12.9" +version = "0.11.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a77c62af46e79de0a562e1a9849205ffcb7fc1238876e9bd743357570e04046f" +checksum = "046cd98826c46c2ac8ddecae268eb5c2e58628688a5fc7a2643704a73faba95b" dependencies = [ - "base64 0.22.1", + "base64 0.21.5", "bytes", + "encoding_rs", "futures-core", "futures-util", + "h2", "http", "http-body", - "http-body-util", "hyper", - "hyper-tls", - "hyper-util", + "hyper-rustls", "ipnet", "js-sys", "log", "mime", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", + "rustls", "rustls-pemfile", "serde", "serde_json", "serde_urlencoded", - "sync_wrapper 1.0.2", + "system-configuration", "tokio", - "tokio-native-tls", + "tokio-rustls", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "windows-registry", + "webpki-roots", + "winreg", ] [[package]] @@ -3946,17 +3662,40 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.8" +version = "0.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +dependencies = [ + "cc", + "libc", + "once_cell", + "spin 0.5.2", + "untrusted 0.7.1", + "web-sys", + "winapi", +] + +[[package]] +name = "ring" +version = "0.17.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb0205304757e5d899b9c2e448b867ffd03ae7f988002e47cd24954391394d0b" dependencies = [ "cc", - "cfg-if", "getrandom", "libc", - "spin", - "untrusted", - "windows-sys 0.52.0", + "spin 0.9.8", + "untrusted 0.9.0", + "windows-sys 0.48.0", +] + +[[package]] +name = "ripemd" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd124222d17ad93a644ed9d011a40f4fb64aa54275c08cc216524a9ea82fb09f" +dependencies = [ + "digest", ] [[package]] @@ -3966,50 +3705,26 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bb919243f34364b6bd2fc10ef797edbfa75f33c252e7998527479c6d6b47e1ec" dependencies = [ "bytes", + "rlp-derive", "rustc-hex", ] [[package]] -name = "ruint" -version = "1.12.3" +name = "rlp-derive" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c3cc4c2511671f327125da14133d0c5c5d137f006a1017a16f557bc85b16286" +checksum = "e33d7b2abe0c340d8797fe2907d3f20d3b5ea5908683618bfe80df7f621f672a" dependencies = [ - "alloy-rlp", - "ark-ff 0.3.0", - "ark-ff 0.4.2", - "bytes", - "fastrlp", - "num-bigint", - "num-traits", - "parity-scale-codec", - "primitive-types", - "proptest", - "rand", - "rlp", - "ruint-macro", - "serde", - "valuable", - "zeroize", + "proc-macro2", + "quote", + "syn 1.0.109", ] -[[package]] -name = "ruint-macro" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48fd7bd8a6377e15ad9d42a8ec25371b94ddc67abe7c8b9127bec79bebaaae18" - [[package]] name = "rustc-demangle" -version = "0.1.24" +version = "0.1.23" 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" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" [[package]] name = "rustc-hex" @@ -4019,117 +3734,109 @@ checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" [[package]] name = "rustc_version" -version = "0.3.3" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "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", + "semver", ] [[package]] name = "rustix" -version = "0.38.41" +version = "0.38.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7f649912bc1495e167a6edee79151c84b1bad49748cb4f1f1167f459f6224f6" +checksum = "2b426b0506e5d50a7d8dafcf2e81471400deb602392c7dd110815afb4eaf02a3" dependencies = [ - "bitflags", + "bitflags 2.4.1", "errno", "libc", "linux-raw-sys", - "windows-sys 0.52.0", + "windows-sys 0.48.0", ] [[package]] name = "rustls" -version = "0.23.18" +version = "0.21.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c9cc1d47e243d655ace55ed38201c19ae02c148ae56412ab8750e8f0166ab7f" +checksum = "446e14c5cda4f3f30fe71863c34ec70f5ac79d6087097ad0bb433e1be5edf04c" dependencies = [ - "once_cell", - "ring", - "rustls-pki-types", + "log", + "ring 0.17.5", "rustls-webpki", - "subtle", - "zeroize", + "sct", ] [[package]] name = "rustls-pemfile" -version = "2.2.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" +checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" dependencies = [ - "rustls-pki-types", + "base64 0.21.5", ] -[[package]] -name = "rustls-pki-types" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16f1201b3c9a7ee8039bcadc17b7e605e2945b27eee7631788c1bd2b0643674b" - [[package]] name = "rustls-webpki" -version = "0.102.8" +version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ - "ring", - "rustls-pki-types", - "untrusted", + "ring 0.17.5", + "untrusted 0.9.0", ] [[package]] name = "rustversion" -version = "1.0.18" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -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", -] +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" [[package]] name = "ryu" -version = "1.0.18" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" [[package]] -name = "schannel" -version = "0.1.27" +name = "salsa20" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" +checksum = "97a22f5af31f73a954c10289c93e8a50cc23d971e80ee446f1f6f7137a088213" dependencies = [ - "windows-sys 0.59.0", + "cipher", ] [[package]] -name = "schnellru" -version = "0.2.3" +name = "same-file" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9a8ef13a93c54d20580de1e5c413e624e53121d42fc7e2c11d10ef7f8b02367" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "scale-info" +version = "2.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f7d66a1128282b7ef025a8ead62a4a9fcf017382ec53b8ffbf4d7bf77bd3c60" dependencies = [ - "ahash", "cfg-if", - "hashbrown 0.13.2", + "derive_more", + "parity-scale-codec", + "scale-info-derive", +] + +[[package]] +name = "scale-info-derive" +version = "2.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abf2c68b89cafb3b8d918dd07b42be0da66ff202cf1155c5739a4e0c1ea0dc19" +dependencies = [ + "proc-macro-crate 1.3.1", + "proc-macro2", + "quote", + "syn 1.0.109", ] [[package]] @@ -4138,6 +3845,28 @@ 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.5", + "untrusted 0.9.0", +] + [[package]] name = "sec1" version = "0.7.3" @@ -4152,52 +3881,20 @@ dependencies = [ "zeroize", ] -[[package]] -name = "security-framework" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" -dependencies = [ - "bitflags", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa39c7303dc58b5543c94d22c1766b0d31f2ee58306363ea622b10bbc075eaa2" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "semver" -version = "0.11.0" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" +checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" dependencies = [ - "semver-parser", + "serde", ] [[package]] -name = "semver" -version = "1.0.23" +name = "send_wrapper" +version = "0.4.0" 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", -] +checksum = "f638d531eccd6e23b980caf34876660d38e265409d8e99b397ab71eb3612fad0" [[package]] name = "send_wrapper" @@ -4213,37 +3910,44 @@ checksum = "a3f0bf26fd526d2a95683cd0f87bf103b8539e2ca1ef48ce002d67aad59aa0b4" [[package]] name = "serde" -version = "1.0.215" +version = "1.0.191" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f" +checksum = "a834c4821019838224821468552240d4d95d14e751986442c816572d39a080c9" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.215" +version = "1.0.191" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" +checksum = "46fa52d5646bce91b680189fe5b1c049d2ea38dabb4e2e7c8d00ca12cfbfbcfd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.38", ] [[package]] name = "serde_json" -version = "1.0.133" +version = "1.0.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377" +checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" dependencies = [ - "indexmap", "itoa", - "memchr", "ryu", "serde", ] +[[package]] +name = "serde_spanned" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12022b835073e5b11e90a14f86838ceb1c8fb0325b72416845c487ac0fa95e80" +dependencies = [ + "serde", +] + [[package]] name = "serde_urlencoded" version = "0.7.1" @@ -4264,7 +3968,7 @@ checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ "cfg-if", "cpufeatures", - "digest 0.10.7", + "digest", ] [[package]] @@ -4275,7 +3979,7 @@ checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if", "cpufeatures", - "digest 0.10.7", + "digest", ] [[package]] @@ -4284,41 +3988,25 @@ version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" dependencies = [ - "digest 0.10.7", + "digest", "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" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +checksum = "5e1788eed21689f9cf370582dfc467ef36ed9c707f073528ddafa8d83e3b8500" dependencies = [ - "digest 0.10.7", + "digest", "rand_core", ] [[package]] name = "simd-json" -version = "0.13.11" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0228a564470f81724e30996bbc2b171713b37b15254a6440c7e2d5449b95691" +checksum = "e5a3720326b20bf5b95b72dbbd133caae7e0dcf71eae8f6e6656e71a7e5c9aaa" dependencies = [ "ahash", "getrandom", @@ -4334,9 +4022,21 @@ dependencies = [ [[package]] name = "simdutf8" -version = "0.1.5" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" +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", +] [[package]] name = "siphasher" @@ -4355,9 +4055,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.13.2" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" [[package]] name = "smartstring" @@ -4372,40 +4072,61 @@ dependencies = [ [[package]] name = "snap" -version = "1.1.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b6b67fb9a61334225b5b790716f609cd58395f895b3fe8b328786812a40bc3b" +checksum = "5e9f0ab6ef7eb7353d9119c170a436d1bf248eea575ac42d19d12f4e34130831" [[package]] name = "socket2" -version = "0.5.7" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" +checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" dependencies = [ "libc", - "windows-sys 0.52.0", + "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", +] + +[[package]] +name = "solang-parser" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cb9fa2fa2fa6837be8a2495486ff92e3ffe68a99b6eeba288e139efdd842457" +dependencies = [ + "itertools 0.11.0", + "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" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" -[[package]] -name = "spinning_top" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d96d2d1d716fb500937168cc09353ffdc7a012be8475ac7308e1bdf0e3923300" -dependencies = [ - "lock_api", -] - [[package]] name = "spki" -version = "0.7.3" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" +checksum = "9d1e996ef02c474957d681f1b05213dfb0abab947b446a62d37770b23500184a" dependencies = [ "base64ct", "der", @@ -4420,12 +4141,6 @@ 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" @@ -4453,6 +4168,19 @@ 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" @@ -4461,11 +4189,11 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "strum" -version = "0.26.3" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" +checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" dependencies = [ - "strum_macros 0.26.4", + "strum_macros", ] [[package]] @@ -4474,31 +4202,38 @@ version = "0.25.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0" dependencies = [ - "heck 0.4.1", + "heck", "proc-macro2", "quote", "rustversion", - "syn 2.0.89", -] - -[[package]] -name = "strum_macros" -version = "0.26.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" -dependencies = [ - "heck 0.5.0", - "proc-macro2", - "quote", - "rustversion", - "syn 2.0.89", + "syn 2.0.38", ] [[package]] name = "subtle" -version = "2.6.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" + +[[package]] +name = "svm-rs" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0cc95be7cc2c384a2f57cac56548d2178650905ebe5725bc8970ccc25529060" +dependencies = [ + "dirs", + "fs2", + "hex", + "once_cell", + "reqwest", + "semver", + "serde", + "serde_json", + "sha2", + "thiserror", + "url", + "zip", +] [[package]] name = "syn" @@ -4513,58 +4248,20 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.89" +version = "2.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d46482f1c1c87acd84dea20c1bf5ebff4c757009ed6bf19cfd36fb10e92c4e" +checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" 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" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" - -[[package]] -name = "sync_wrapper" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -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" +version = "0.30.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a5b4ddaee55fb2bea2bf0e5000747e5f5c0de765e5a5ff87f4cd106439f4bb3" +checksum = "1fb4f3438c8f6389c864e61221cbc97e9bca98b4daf39a5beb7bea660f528bb2" dependencies = [ "cfg-if", "core-foundation-sys", @@ -4574,6 +4271,27 @@ 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" @@ -4582,47 +4300,58 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "target-features" -version = "0.1.6" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1bbb9f3c5c463a01705937a24fdabc5047929ac764b2d5b9cf681c1f5041ed5" +checksum = "cfb5fa503293557c5158bd215fdc225695e567a77e453f5d4452a50a193969bd" [[package]] name = "target-lexicon" -version = "0.12.16" +version = "0.12.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" +checksum = "14c39fd04924ca3a864207c66fc2cd7d22d7c016007f9ce846cbb9326331930a" [[package]] name = "tempfile" -version = "3.14.0" +version = "3.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c" +checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5" dependencies = [ "cfg-if", "fastrand", - "once_cell", + "redox_syscall 0.4.1", "rustix", - "windows-sys 0.59.0", + "windows-sys 0.48.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", ] [[package]] name = "thiserror" -version = "1.0.69" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.69" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.38", ] [[package]] @@ -4632,12 +4361,32 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3bf63baf9f5039dadc247375c29eb13706706cfde997d0330d05aa63a77d8820" [[package]] -name = "threadpool" -version = "1.8.1" +name = "time" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d050e60b33d41c19108b32cea32164033a9013fe3b46cbd4457559bfbf77afaa" +checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5" dependencies = [ - "num_cpus", + "deranged", + "itoa", + "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.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" +dependencies = [ + "time-core", ] [[package]] @@ -4650,85 +4399,67 @@ dependencies = [ ] [[package]] -name = "tinystr" -version = "0.7.6" +name = "tinyvec" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" dependencies = [ - "displaydoc", - "zerovec", + "tinyvec_macros", ] [[package]] -name = "tokio" -version = "1.41.1" +name = "tinyvec_macros" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22cfb5bee7a6a52939ca9224d6ac897bb669134078daa8735560897f69de4d33" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f38200e3ef7995e5ef13baec2f432a6da0aa9ac495b2c0e8f3b7eec2c92d653" dependencies = [ "backtrace", "bytes", "libc", "mio", + "num_cpus", "pin-project-lite", - "socket2", + "socket2 0.5.5", "tokio-macros", - "windows-sys 0.52.0", + "windows-sys 0.48.0", ] [[package]] name = "tokio-macros" -version = "2.4.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" +checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", -] - -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", + "syn 2.0.38", ] [[package]] name = "tokio-rustls" -version = "0.26.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" 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" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edc5f74e248dc973e0dbb7b74c7e0d6fcc301c694ff50049504004ef4d0cdcd9" +checksum = "212d5dcb2a1ce06d81107c3d0ffa3121fe974b73f068c8282cb1c32328113b6c" dependencies = [ "futures-util", "log", "rustls", - "rustls-pki-types", "tokio", "tokio-rustls", "tungstenite", @@ -4737,59 +4468,68 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.12" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" +checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" dependencies = [ "bytes", "futures-core", "futures-sink", "pin-project-lite", "tokio", + "tracing", +] + +[[package]] +name = "toml" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd79e69d3b627db300ff956027cc6c3798cef26d22526befdfcd12feeb6d2257" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit 0.19.15", ] [[package]] name = "toml_datetime" -version = "0.6.8" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +dependencies = [ + "serde", +] [[package]] name = "toml_edit" -version = "0.22.22" +version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap", + "indexmap 2.1.0", + "serde", + "serde_spanned", "toml_datetime", "winnow", ] [[package]] -name = "tower" -version = "0.5.1" +name = "toml_edit" +version = "0.20.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2873938d487c3cfb9aed7546dc9f2711d867c9f90c46b889989a2cb84eba6b4f" +checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" dependencies = [ - "futures-core", - "futures-util", - "pin-project-lite", - "sync_wrapper 0.1.2", - "tower-layer", - "tower-service", + "indexmap 2.1.0", + "toml_datetime", + "winnow", ] -[[package]] -name = "tower-layer" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" - [[package]] name = "tower-service" -version = "0.3.3" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" @@ -4810,29 +4550,39 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.38", ] [[package]] name = "tracing-core" -version = "0.1.33" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", ] [[package]] -name = "try-lock" +name = "tracing-futures" version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" +checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" +dependencies = [ + "pin-project", + "tracing", +] + +[[package]] +name = "try-lock" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" [[package]] name = "tungstenite" -version = "0.24.0" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18e5b8366ee7a95b16d32197d0b2604b43a0be89dc5fac9f8e96ccafbaedda8a" +checksum = "9e3dac10fd62eaf6617d3a904ae222845979aec67c615d1c842b4002c7666fb9" dependencies = [ "byteorder", "bytes", @@ -4842,9 +4592,9 @@ dependencies = [ "log", "rand", "rustls", - "rustls-pki-types", "sha1", "thiserror", + "url", "utf-8", ] @@ -4854,12 +4604,6 @@ 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" @@ -4879,43 +4623,37 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" [[package]] -name = "unicode-ident" -version = "1.0.14" +name = "unicode-bidi" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" +checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] -name = "unicode-reverse" -version = "1.0.9" +name = "unicode-ident" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b6f4888ebc23094adfb574fdca9fdc891826287a6397d2cd28802ffd6f20c76" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" dependencies = [ - "unicode-segmentation", + "tinyvec", ] -[[package]] -name = "unicode-segmentation" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" - [[package]] name = "unicode-width" -version = "0.1.14" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" - -[[package]] -name = "unicode-width" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd" +checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" [[package]] name = "unicode-xid" -version = "0.2.6" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" [[package]] name = "unindent" @@ -4923,6 +4661,12 @@ 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" @@ -4931,9 +4675,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.4" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" +checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" dependencies = [ "form_urlencoded", "idna", @@ -4946,44 +4690,27 @@ 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.2" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] name = "uuid" -version = "1.11.0" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" +checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" dependencies = [ "getrandom", + "serde", ] -[[package]] -name = "valuable" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" - [[package]] name = "value-trait" -version = "0.8.1" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dad8db98c1e677797df21ba03fca7d3bf9bec3ca38db930954e4fe6e1ea27eb4" +checksum = "ea87257cfcbedcb9444eda79c59fdfea71217e6305afee8ee33f500375c2ac97" dependencies = [ "float-cmp", "halfbrown", @@ -4991,25 +4718,20 @@ dependencies = [ "ryu", ] -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "version_check" -version = "0.9.5" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] -name = "wait-timeout" -version = "0.2.0" +name = "walkdir" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6" +checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" dependencies = [ - "libc", + "same-file", + "winapi-util", ] [[package]] @@ -5029,35 +4751,34 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.95" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" +checksum = "7daec296f25a1bae309c0cd5c29c4b260e510e6d813c286b19eaadf409d40fce" dependencies = [ "cfg-if", - "once_cell", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.95" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" +checksum = "e397f4664c0e4e428e8313a469aaa58310d302159845980fd23b0f22a847f217" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.38", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.45" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc7ec4f8827a71586374db3e87abdb5a2bb3a15afed140221307c3ec06b1f63b" +checksum = "9afec9963e3d0994cac82455b2b3502b81a7f40f9a0d32181f7528d9f4b43e02" dependencies = [ "cfg-if", "js-sys", @@ -5067,9 +4788,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.95" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" +checksum = "5961017b3b08ad5f3fe39f1e79877f8ee7c23c5e5fd5eb80de95abc41f1f16b2" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -5077,52 +4798,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.95" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" +checksum = "c5353b8dab669f5e10f5bd76df26a9360c748f054f862ff5f3f8aae0c7fb3907" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.38", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.95" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -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", -] +checksum = "0d046c5d029ba91a1ed14da14dca44b68bf2f124cfbaf741c54151fdb3e0750b" [[package]] name = "web-sys" -version = "0.3.72" +version = "0.3.65" source = "registry+https://github.com/rust-lang/crates.io-index" -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" +checksum = "5db499c5f66323272151db0e666cd34f78617522fb0c1604d31a27c50c206a85" dependencies = [ "js-sys", "wasm-bindgen", @@ -5130,18 +4827,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.26.7" +version = "0.25.2" source = "registry+https://github.com/rust-lang/crates.io-index" -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" +checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc" [[package]] name = "winapi" @@ -5159,6 +4847,15 @@ 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" @@ -5171,8 +4868,17 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" dependencies = [ - "windows-core", - "windows-targets 0.52.6", + "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", ] [[package]] @@ -5181,37 +4887,16 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.6", + "windows-targets 0.52.0", ] [[package]] -name = "windows-registry" -version = "0.2.0" +name = "windows-sys" +version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" 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", + "windows-targets 0.42.2", ] [[package]] @@ -5224,21 +4909,18 @@ dependencies = [ ] [[package]] -name = "windows-sys" -version = "0.52.0" +name = "windows-targets" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" dependencies = [ - "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", + "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", ] [[package]] @@ -5258,20 +4940,25 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.6" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" dependencies = [ - "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.6", - "windows_x86_64_gnu 0.52.6", - "windows_x86_64_gnullvm 0.52.6", - "windows_x86_64_msvc 0.52.6", + "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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + [[package]] name = "windows_aarch64_gnullvm" version = "0.48.5" @@ -5280,9 +4967,15 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.6" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" [[package]] name = "windows_aarch64_msvc" @@ -5292,9 +4985,15 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.6" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" [[package]] name = "windows_i686_gnu" @@ -5304,15 +5003,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.6" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" [[package]] -name = "windows_i686_gnullvm" -version = "0.52.6" +name = "windows_i686_msvc" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" [[package]] name = "windows_i686_msvc" @@ -5322,9 +5021,15 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.6" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" [[package]] name = "windows_x86_64_gnu" @@ -5334,9 +5039,15 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.6" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" [[package]] name = "windows_x86_64_gnullvm" @@ -5346,9 +5057,15 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.6" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" [[package]] name = "windows_x86_64_msvc" @@ -5358,30 +5075,28 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.6" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "winnow" -version = "0.6.20" +version = "0.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" +checksum = "176b6138793677221d420fd2f0aeeced263f197688b36484660da767bca2fa32" dependencies = [ "memchr", ] [[package]] -name = "write16" -version = "1.0.0" +name = "winreg" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" - -[[package]] -name = "writeable" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" +dependencies = [ + "cfg-if", + "windows-sys 0.48.0", +] [[package]] name = "ws_stream_wasm" @@ -5394,8 +5109,8 @@ dependencies = [ "js-sys", "log", "pharos", - "rustc_version 0.4.1", - "send_wrapper", + "rustc_version", + "send_wrapper 0.6.0", "thiserror", "wasm-bindgen", "wasm-bindgen-futures", @@ -5413,141 +5128,104 @@ dependencies = [ [[package]] name = "xxhash-rust" -version = "0.8.12" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a5cbf750400958819fb6178eaa83bee5cd9c29a26a40cc241df8c70fdd46984" +checksum = "9828b178da53440fa9c766a3d2f73f7cf5d0ac1fe3980c1e5018d899fd19e07b" [[package]] -name = "yoke" -version = "0.7.5" +name = "yansi" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" -dependencies = [ - "serde", - "stable_deref_trait", - "yoke-derive", - "zerofrom", -] - -[[package]] -name = "yoke-derive" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.89", - "synstructure", -] +checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" [[package]] name = "zerocopy" -version = "0.7.35" +version = "0.7.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +checksum = "686b7e407015242119c33dab17b8f61ba6843534de936d94368856528eae4dcc" dependencies = [ - "byteorder", "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.35" +version = "0.7.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +checksum = "020f3dfe25dfc38dfea49ce62d5d45ecdd7f0d8a724fa63eb36b6eba4ec76806" dependencies = [ "proc-macro2", "quote", - "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", + "syn 2.0.38", ] [[package]] name = "zeroize" -version = "1.8.1" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" -dependencies = [ - "zeroize_derive", -] +checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" [[package]] -name = "zeroize_derive" -version = "1.4.2" +name = "zip" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" dependencies = [ - "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", + "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", ] [[package]] name = "zstd" -version = "0.13.2" +version = "0.11.2+zstd.1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcf2b778a664581e31e389454a7072dab1647606d44f7feea22cd5abb9c9f3f9" +checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" dependencies = [ - "zstd-safe", + "zstd-safe 5.0.2+zstd.1.5.2", +] + +[[package]] +name = "zstd" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bffb3309596d527cfcba7dfc6ed6052f1d39dfbd7c867aa2e865e4a449c10110" +dependencies = [ + "zstd-safe 7.0.0", ] [[package]] name = "zstd-safe" -version = "7.2.1" +version = "5.0.2+zstd.1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54a3ab4db68cea366acc5c897c7b4d4d1b8994a9cd6e6f841f8964566a419059" +checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db" +dependencies = [ + "libc", + "zstd-sys", +] + +[[package]] +name = "zstd-safe" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43747c7422e2924c11144d5229878b98180ef8b06cca4ab5af37afc8a8d8ea3e" dependencies = [ "zstd-sys", ] [[package]] name = "zstd-sys" -version = "2.0.13+zstd.1.5.6" +version = "2.0.9+zstd.1.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38ff0f21cfee8f97d94cef41359e0c89aa6113028ab0291aa8ca0038995a95aa" +checksum = "9e16efa8a874a0481a574084d34cc26fdb3b99627480f785888deb6386506656" dependencies = [ "cc", "pkg-config", diff --git a/Cargo.toml b/Cargo.toml index d473642..bde3b13 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,6 +10,7 @@ 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/"] @@ -18,15 +19,6 @@ 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"] } @@ -37,6 +29,8 @@ 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" @@ -45,8 +39,8 @@ heck = "0.4.1" indexmap = "2.1.0" indicatif = "0.17.7" lazy_static = "1.4.0" -mesc = "0.1.4" -polars = { version = "0.38.3", features = [ +mesc = "0.1.0" +polars = { version = "0.36.2", features = [ "parquet", "string_encoding", "polars-lazy", @@ -59,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.12.0" +pyo3-polars = "0.10.0" rand = "0.8.5" regex = "1.10.2" serde = { version = "1.0.191", features = ["derive"] } diff --git a/README.md b/README.md index f819001..61e2320 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. [Documentation](#documentation) +5. [Documenation](#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 Installation +### Python Instalation `cryo` can also be installed as a python package: @@ -166,7 +166,7 @@ Options: Content Options: -b, --blocks ... Block numbers, see syntax below - --timestamps ... Timestamp numbers in unix, overridden by blocks + --timestamps ... Timestamp numbers in unix, overriden 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) @@ -296,7 +296,6 @@ cryo datasets - erc20_metadata - erc20_supplies - erc20_transfers -- erc20_approvals - erc721_metadata - erc721_transfers - eth_calls diff --git a/crates/cli/Cargo.toml b/crates/cli/Cargo.toml index 9e430b1..7eb4fcc 100644 --- a/crates/cli/Cargo.toml +++ b/crates/cli/Cargo.toml @@ -4,6 +4,7 @@ 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] @@ -17,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 238db4e..49eff61 100644 --- a/crates/cli/src/args.rs +++ b/crates/cli/src/args.rs @@ -106,10 +106,6 @@ 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/lib.rs b/crates/cli/src/lib.rs index 516f23d..8fcebe2 100644 --- a/crates/cli/src/lib.rs +++ b/crates/cli/src/lib.rs @@ -1,4 +1,4 @@ -//! utilities for parsing user inputs to run cryo +//! utilties 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 a9e75df..38e69ee 100644 --- a/crates/cli/src/parse/blocks.rs +++ b/crates/cli/src/parse/blocks.rs @@ -168,7 +168,6 @@ async fn parse_block_inputs( } } -#[derive(Clone, Debug)] enum RangePosition { First, Last, @@ -323,31 +322,32 @@ async fn parse_block_number( source: Arc, ) -> Result { match (block_ref, range_position) { - ("latest", _) => source.get_block_number().await.map_err(|_e| { + ("latest", _) => source.get_block_number().await.map(|n| n.as_u64()).map_err(|_e| { ParseError::ParseError("Error retrieving latest block number".to_string()) }), ("", RangePosition::First) => Ok(0), - ("", RangePosition::Last) => source - .get_block_number() - .await - .map_err(|_e| ParseError::ParseError("Error retrieving last block number".to_string())), + ("", 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::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]; s.parse::() - .map(|n| (1e9 * n).round() as u64) + .map(|n| (1e9 * n) 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).round() as u64) + .map(|n| (1e6 * n) 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).round() as u64) + .map(|n| (1e3 * n) as u64) .map_err(|_e| ParseError::ParseError("Error parsing block ref".to_string())) } _ => block_ref @@ -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, + Ok(result) => result.as_u64(), Err(_e) => { return Err(ParseError::ParseError("reorg buffer parse error".to_string())) } @@ -387,34 +387,24 @@ 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)>, - mock_ipc_path: PathBuf, - ) { - let ipc = IpcConnect::new(mock_ipc_path); - let provider = ProviderBuilder::new().on_ipc(ipc).await.unwrap().boxed(); + async fn block_token_test_helper(tests: Vec<(BlockTokenTest<'_>, bool)>) { + let (provider, mock) = Provider::mocked(); let source = Source { - provider, + provider: provider.into(), semaphore: Arc::new(None), rate_limiter: Arc::new(None), chain_id: 1, @@ -426,7 +416,8 @@ mod tests { let source = Arc::new(source); for (test, res) in tests { match test { - BlockTokenTest::WithMock((token, expected, _latest)) => { + BlockTokenTest::WithMock((token, expected, latest)) => { + mock.push(U64::from(latest)).unwrap(); assert_eq!( block_token_test_executor(token, expected, source.clone()).await, res @@ -467,20 +458,15 @@ 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)>, - mock_ipc_path: PathBuf, - ) { - let ipc = IpcConnect::new(mock_ipc_path); - let provider = ProviderBuilder::new().on_ipc(ipc).await.unwrap().boxed(); + async fn block_input_test_helper(tests: Vec<(BlockInputTest<'_>, bool)>) { + let (provider, mock) = Provider::mocked(); let source = Arc::new(Source { - provider, + provider: provider.into(), chain_id: 1, rpc_url: "".to_string(), inner_request_size: 1, @@ -491,7 +477,8 @@ mod tests { }); for (test, res) in tests { match test { - BlockInputTest::WithMock((inputs, expected, _latest)) => { + BlockInputTest::WithMock((inputs, expected, latest)) => { + mock.push(U64::from(latest)).unwrap(); assert_eq!( block_input_test_executor(inputs, expected, source.clone()).await, res @@ -544,20 +531,15 @@ 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)>, - mock_ipc_path: PathBuf, - ) { - let provider = - ProviderBuilder::new().on_ipc(IpcConnect::new(mock_ipc_path)).await.unwrap().boxed(); + async fn block_number_test_helper(tests: Vec<(BlockNumberTest<'_>, bool)>) { + let (provider, mock) = Provider::mocked(); let source = Source { - provider, + provider: provider.into(), semaphore: Arc::new(None), rate_limiter: Arc::new(None), chain_id: 1, @@ -569,7 +551,8 @@ mod tests { let source = Arc::new(source); for (test, res) in tests { match test { - BlockNumberTest::WithMock((block_ref, range_position, expected, _latest)) => { + BlockNumberTest::WithMock((block_ref, range_position, expected, latest)) => { + mock.push(U64::from(latest)).unwrap(); assert_eq!( block_number_test_executor( block_ref, @@ -621,18 +604,7 @@ mod tests { // Number type (BlockTokenTest::WithoutMock((r"1", BlockChunk::Numbers(vec![1]))), true), /* Single block */ ]; - 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; + block_token_test_helper(tests).await; } #[tokio::test] @@ -676,16 +648,7 @@ mod tests { true, ), // Multi input complex ]; - 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; + block_input_test_helper(tests).await; } #[tokio::test] @@ -693,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), /* Latest block */ + (BlockNumberTest::WithMock((r"latest", RangePosition::None, 12, 12)), true), /* Lastest 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 @@ -703,15 +666,6 @@ mod tests { (BlockNumberTest::WithoutMock((r"1m", RangePosition::None, 1000000)), true), // m (BlockNumberTest::WithoutMock((r"1k", RangePosition::None, 1000)), true), // k ]; - 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; + block_number_test_helper(tests).await; } } diff --git a/crates/cli/src/parse/file_output.rs b/crates/cli/src/parse/file_output.rs index db6430b..e5d0417 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.div_ceil(n_row_groups)), + (_, Some(n_row_groups), Some(cs)) => Some((cs + n_row_groups - 1) / n_row_groups), _ => None, } } diff --git a/crates/cli/src/parse/parse_utils.rs b/crates/cli/src/parse/parse_utils.rs index d445df4..04f4698 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: &str) -> Result, ParseError> { +pub(crate) fn hex_string_to_binary(hex_string: &String) -> 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 0816435..bada931 100644 --- a/crates/cli/src/parse/partitions.rs +++ b/crates/cli/src/parse/partitions.rs @@ -8,6 +8,7 @@ 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 6b62515..c8e1a60 100644 --- a/crates/cli/src/parse/source.rs +++ b/crates/cli/src/parse/source.rs @@ -1,12 +1,8 @@ use std::env; use crate::args::Args; -use alloy::{ - providers::{Provider, ProviderBuilder, RootProvider}, - rpc::client::{BuiltInConnectionString, ClientBuilder, RpcClient}, - transports::{layers::RetryBackoffLayer, BoxTransport}, -}; -use cryo_freeze::{ParseError, Source, SourceLabels}; +use cryo_freeze::{sources::ProviderWrapper, ParseError, Source, SourceLabels}; +use ethers::prelude::*; use governor::{Quota, RateLimiter}; use polars::prelude::*; use std::num::NonZeroU32; @@ -14,20 +10,31 @@ use std::num::NonZeroU32; pub(crate) async fn parse_source(args: &Args) -> Result { // parse network info let rpc_url = parse_rpc_url(args)?; - 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 (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 rate_limiter = match args.requests_per_second { Some(rate_limit) => match (NonZeroU32::new(1), NonZeroU32::new(rate_limit)) { (Some(one), Some(value)) => { @@ -59,7 +66,7 @@ pub(crate) async fn parse_source(args: &Args) -> Result { rpc_url, provider, labels: SourceLabels { - max_concurrent_requests: args.max_concurrent_requests, + max_concurrent_requests: args.requests_per_second.map(|x| x as u64), 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), @@ -73,16 +80,10 @@ 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"))?, }; - match endpoint { - Ok(endpoint) => endpoint.map(|endpoint| endpoint.url), - Err(e) => { - eprintln!("Could not load MESC data: {}", e); - None - } - } + endpoint.map(|endpoint| endpoint.url) } else { None }; diff --git a/crates/cli/src/parse/timestamps.rs b/crates/cli/src/parse/timestamps.rs index 35b54ab..e6e26b4 100644 --- a/crates/cli/src/parse/timestamps.rs +++ b/crates/cli/src/parse/timestamps.rs @@ -1,4 +1,3 @@ -use alloy::rpc::types::BlockTransactionsKind; use cryo_freeze::{BlockChunk, ParseError, Source}; use polars::prelude::*; @@ -278,7 +277,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, BlockTransactionsKind::Hashes) + .get_block(mid) .await .map_err(|_e| ParseError::ParseError("Error fetching block for timestamp".to_string()))? .unwrap(); @@ -286,15 +285,15 @@ async fn timestamp_to_block_number(timestamp: u64, source: Arc) -> Resul while l <= r { mid = (l + r) / 2; block = source - .get_block(mid, BlockTransactionsKind::Hashes) + .get_block(mid) .await .map_err(|_e| ParseError::ParseError("Error fetching block for timestamp".to_string()))? .unwrap(); #[allow(clippy::comparison_chain)] - if block.header.timestamp == timestamp { + if block.timestamp == timestamp.into() { return Ok(mid); - } else if block.header.timestamp < timestamp { + } else if block.timestamp < timestamp.into() { l = mid + 1; } else { r = mid - 1; @@ -302,7 +301,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.header.timestamp > timestamp { + if mid > 0 && block.timestamp > ethers::types::U256::from(timestamp) { Ok(mid - 1) } else { Ok(mid) @@ -312,27 +311,23 @@ 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, BlockTransactionsKind::Hashes) + .get_block(latest_block_number) .await .map_err(|_e| ParseError::ParseError("Error fetching latest block".to_string()))? .unwrap(); - Ok(latest_block.header.timestamp) + Ok(latest_block.timestamp.as_u64()) } #[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()) { @@ -341,27 +336,19 @@ mod tests { }; let max_retry = 5; let initial_backoff = 500; - let compute_units_per_second = 50; let max_concurrent_requests = 100; - 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 provider = + Provider::>::new_client(&rpc_url, max_retry, initial_backoff) + .map_err(|_e| ParseError::ParseError("could not connect to provider".to_string())) + .unwrap(); + 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: provider.into(), semaphore: Arc::new(Some(semaphore)), rate_limiter: Arc::new(rate_limiter), chain_id: 1, @@ -386,12 +373,8 @@ 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, BlockTransactionsKind::Hashes) - .await - .unwrap() - .unwrap(); - let latest_timestamp = latest_block.header.timestamp; + let latest_block = source.get_block(latest_block_number).await.unwrap().unwrap(); + let latest_timestamp = latest_block.timestamp.as_u64(); assert_eq!( timestamp_to_block_number(latest_timestamp, source).await.unwrap(), diff --git a/crates/cli/src/remember.rs b/crates/cli/src/remember.rs index aa9ca1f..5dd0879 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 Result, CollectError> { - if is_help_command(&args) { - return handle_help_subcommands(args); + // handle subcommands + if args.datatype.first() == Some(&"help".to_string()) { + return handle_help_subcommands(args).await } - let cryo_dir = build_cryo_directory(std::path::Path::new(&args.output_dir)); + let cryo_dir: std::path::PathBuf = args.output_dir.clone().into(); + let cryo_dir = cryo_dir.join(".cryo"); - let args = - if args.datatype.is_empty() { load_or_remember_command(args, &cryo_dir)? } else { args }; + // 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) + } else { + args + }; + // remember current command if args.remember { - println!("remembering this command for future use\n"); + println!("remembering this command for future use"); + println!(); 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::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::Path, -) -> Result { - 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"); - } - 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) = parse::parse_args(&args).await?; + let (query, source, sink, env) = match parse::parse_args(&args).await { + Ok(opts) => opts, + Err(e) => return Err(e.into()), + }; let source = Arc::new(source); - let env = ExecutionEnv { t_start_parse, ..env }.set_start_time(); - + let env = ExecutionEnv { t_start_parse, ..env }; + let env = env.set_start_time(); cryo_freeze::freeze(&query, &source, &sink, &env).await } -/// 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 +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" { + 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] @@ -113,62 +77,24 @@ 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); -} - -/// 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())); + ); + 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("missing schema for datatype")) + } } } - - 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()); - } + Ok(None) } diff --git a/crates/freeze/Cargo.toml b/crates/freeze/Cargo.toml index 55701e8..9c8e5e1 100644 --- a/crates/freeze/Cargo.toml +++ b/crates/freeze/Cargo.toml @@ -5,21 +5,24 @@ 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 [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 } @@ -29,4 +32,3 @@ 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 c360010..4e76b61 100644 --- a/crates/freeze/src/datasets/address_appearances.rs +++ b/crates/freeze/src/datasets/address_appearances.rs @@ -1,13 +1,5 @@ use crate::*; -use alloy::{ - primitives::{Address, TxHash}, - rpc::types::{ - eth::{Block, Log}, - trace::parity::{Action, LocalizedTransactionTrace, TraceOutput}, - BlockTransactionsKind, Filter, FilterBlockOption, - }, - sol_types::SolEvent, -}; +use ethers::prelude::*; use polars::prelude::*; use std::collections::HashMap; @@ -42,7 +34,7 @@ impl Dataset for AddressAppearances { } } -type BlockLogsTraces = (Block, Vec, Vec); +type BlockLogsTraces = (Block, Vec, Vec); #[async_trait::async_trait] impl CollectByBlock for AddressAppearances { @@ -50,18 +42,17 @@ 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()?, BlockTransactionsKind::Hashes).await?; + let block = source.get_block(request.block_number()?).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.into()), - to_block: Some(block_number.into()), + from_block: Some(block_number), + to_block: Some(block_number), }, ..Default::default() }; let logs = source.get_logs(&filter).await?; - let traces = source.trace_block(request.block_number()?).await?; + let traces = source.trace_block(request.block_number()?.into()).await?; Ok((block, logs, traces)) } @@ -78,15 +69,16 @@ 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_by_hash(tx_hash).await?.ok_or_else(|| { + let tx_data = source.get_transaction(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()))?; + .ok_or_else(|| CollectError::CollectError("block not found".to_string()))? + .as_u64(); let block = source - .get_block(block_number, BlockTransactionsKind::Hashes) + .get_block(block_number) .await? .ok_or(CollectError::CollectError("could not get block".to_string()))?; @@ -95,9 +87,7 @@ impl CollectByTransaction for AddressAppearances { .get_transaction_receipt(tx_hash) .await? .ok_or(CollectError::CollectError("could not get tx receipt".to_string()))? - .inner - .logs() - .to_vec(); + .logs; // traces let traces = source.trace_transaction(request.ethers_transaction_hash()?).await?; @@ -112,11 +102,11 @@ impl CollectByTransaction for AddressAppearances { } fn name(log: &Log) -> Option<&'static str> { - let event = log.topic0().unwrap(); - if event == *ERC20::Transfer::SIGNATURE_HASH { - if log.data().data.len() > 0 { + let event = log.topics[0]; + if event == *EVENT_ERC20_TRANSFER { + if log.data.len() > 0 { Some("erc20_transfer") - } else if log.topics().len() == 4 { + } else if log.topics.len() == 4 { Some("erc721_transfer") } else { None @@ -129,26 +119,26 @@ fn name(log: &Log) -> Option<&'static str> { impl AddressAppearances { fn process_first_transaction( &mut self, - block_author: Address, - trace: &LocalizedTransactionTrace, + block_author: H160, + trace: &Trace, schema: &Table, - tx_hash: TxHash, - logs_by_tx: &HashMap>, + tx_hash: H256, + logs_by_tx: &HashMap>, ) { - let block_number = trace.block_number.unwrap() as u32; - let block_hash = trace.block_hash.unwrap().to_vec(); + let block_number = trace.block_number as u32; + let block_hash = trace.block_hash.as_bytes().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][12..32]); + from.copy_from_slice(&log.topics[1].to_fixed_bytes()[12..32]); let name = &(name.to_string() + "_from"); self.process_address( - Address::from_slice(&from), + H160(from), name, block_number, &block_hash, @@ -157,10 +147,10 @@ impl AddressAppearances { ); let mut to: [u8; 20] = [0; 20]; - to.copy_from_slice(&log.topics()[1][12..32]); + to.copy_from_slice(&log.topics[1].to_fixed_bytes()[12..32]); let name = &(name.to_string() + "_to"); self.process_address( - Address::from_slice(&to), + H160(to), name, block_number, &block_hash, @@ -172,7 +162,7 @@ impl AddressAppearances { } } - match &trace.trace.action { + match &trace.action { Action::Call(action) => { self.process_address( action.from, @@ -204,7 +194,7 @@ impl AddressAppearances { _ => {} } - if let Some(TraceOutput::Create(result)) = &trace.trace.result { + if let Some(Res::Create(result)) = &trace.result { self.process_address( result.address, "tx_to", @@ -216,15 +206,10 @@ impl AddressAppearances { } } - 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 { + 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 { Action::Call(action) => { self.process_address( action.from, @@ -253,7 +238,7 @@ impl AddressAppearances { schema, ); } - Action::Selfdestruct(action) => { + Action::Suicide(action) => { self.process_address( action.address, "suicide", @@ -283,7 +268,7 @@ impl AddressAppearances { } } - if let Some(TraceOutput::Create(result)) = &trace.trace.result { + if let Some(Res::Create(result)) = &trace.result { self.process_address( result.address, "create", @@ -297,19 +282,19 @@ impl AddressAppearances { fn process_address( &mut self, - address: Address, + address: H160, relationship: &str, block_number: u32, block_hash: &[u8], - transaction_hash: TxHash, + transaction_hash: H256, schema: &Table, ) { self.n_rows += 1; - store!(schema, self, address, address.to_vec()); + store!(schema, self, address, address.as_bytes().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.to_vec()); + store!(schema, self, transaction_hash, transaction_hash.as_bytes().to_vec()); } } @@ -319,16 +304,19 @@ 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) = (block.header.number, block.header.beneficiary); + let (_block_number, block_author) = match (block.number, block.author) { + (Some(number), Some(author)) => (number.as_u64(), author), + _ => return Ok(()), + }; - let mut current_tx_hash = TxHash::ZERO; + let mut current_tx_hash = H256([0; 32]); 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 595f0d3..231a707 100644 --- a/crates/freeze/src/datasets/balance_diffs.rs +++ b/crates/freeze/src/datasets/balance_diffs.rs @@ -1,8 +1,5 @@ use crate::*; -use alloy::{ - primitives::{Address, U256}, - rpc::types::trace::parity::{ChangedType, Delta, TraceResults}, -}; +use ethers::prelude::*; use polars::prelude::*; /// columns for transactions @@ -22,7 +19,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 { @@ -32,10 +29,7 @@ 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"); - 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)) + source.trace_block_state_diffs(request.block_number()? as u32, include_txs).await } fn transform(response: Self::Response, columns: &mut Self, query: &Arc) -> R<()> { @@ -64,7 +58,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(state_diffs) = &trace.state_diff { + if let Some(ethers::types::StateDiff(state_diffs)) = &trace.state_diff { for (addr, diff) in state_diffs.iter() { process_balance_diff(addr, &diff.balance, block_number, tx, index, columns, schema); } @@ -74,8 +68,8 @@ pub(crate) fn process_balance_diffs( } pub(crate) fn process_balance_diff( - addr: &Address, - diff: &Delta, + addr: &H160, + diff: &Diff, block_number: &Option, transaction_hash: &Option>, transaction_index: usize, @@ -83,16 +77,16 @@ pub(crate) fn process_balance_diff( schema: &Table, ) { let (from, to) = match diff { - Delta::Unchanged => return, - Delta::Added(value) => (U256::ZERO, *value), - Delta::Removed(value) => (*value, U256::ZERO), - Delta::Changed(ChangedType { from, to }) => (*from, *to), + Diff::Same => return, + Diff::Born(value) => (U256::zero(), *value), + Diff::Died(value) => (*value, U256::zero()), + Diff::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.to_vec()); + store!(schema, columns, address, addr.as_bytes().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 6f9ba0a..a812862 100644 --- a/crates/freeze/src/datasets/balance_reads.rs +++ b/crates/freeze/src/datasets/balance_reads.rs @@ -1,8 +1,5 @@ use crate::*; -use alloy::{ - primitives::{Address, U256}, - rpc::types::trace::geth::AccountState, -}; +use ethers::prelude::*; use polars::prelude::*; use std::collections::BTreeMap; @@ -22,7 +19,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 { @@ -73,7 +70,7 @@ pub(crate) fn process_balance_reads( } pub(crate) fn process_balance_read( - addr: &Address, + addr: &H160, account_state: &AccountState, block_number: &Option, transaction_hash: &Option>, @@ -86,7 +83,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.to_vec()); + store!(schema, columns, address, addr.as_bytes().to_vec()); store!(schema, columns, balance, *balance); } } diff --git a/crates/freeze/src/datasets/balances.rs b/crates/freeze/src/datasets/balances.rs index 5b0583a..4a2d36a 100644 --- a/crates/freeze/src/datasets/balances.rs +++ b/crates/freeze/src/datasets/balances.rs @@ -1,5 +1,5 @@ use crate::*; -use alloy::primitives::{Address, U256}; +use ethers::prelude::*; use polars::prelude::*; /// columns for balances @@ -37,8 +37,7 @@ 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(Address::from_slice(&address), block_number.into()).await?; + let balance = source.get_balance(H160::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 d259a79..b23d823 100644 --- a/crates/freeze/src/datasets/blocks.rs +++ b/crates/freeze/src/datasets/blocks.rs @@ -1,8 +1,5 @@ use crate::*; -use alloy::{ - primitives::U256, - rpc::types::{Block, BlockTransactionsKind}, -}; +use ethers::prelude::*; use polars::prelude::*; /// columns for transactions @@ -12,24 +9,18 @@ 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>>, + size: Vec>, base_fee_per_gas: Vec>, - withdrawals_root: Vec>>, chain_id: Vec, } @@ -51,11 +42,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()?, BlockTransactionsKind::Hashes) + .get_block(request.block_number()?) .await? .ok_or(CollectError::CollectError("block not found".to_string()))?; Ok(block) @@ -69,18 +60,15 @@ 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_by_hash(request.ethers_transaction_hash()?) + .get_transaction(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"))?, - BlockTransactionsKind::Hashes, - ) + .get_block_by_hash(transaction.block_hash.ok_or(err("no block block_hash found"))?) .await? .ok_or(CollectError::CollectError("block not found".to_string()))?; Ok(block) @@ -96,30 +84,19 @@ 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, 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 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()); - 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())); + 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, 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, 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, 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())); Ok(()) } diff --git a/crates/freeze/src/datasets/code_diffs.rs b/crates/freeze/src/datasets/code_diffs.rs index f8893b3..2d2a262 100644 --- a/crates/freeze/src/datasets/code_diffs.rs +++ b/crates/freeze/src/datasets/code_diffs.rs @@ -1,8 +1,5 @@ use crate::*; -use alloy::{ - primitives::{Address, Bytes}, - rpc::types::trace::parity::{ChangedType, Delta, TraceResults}, -}; +use ethers::prelude::*; use polars::prelude::*; /// columns for transactions @@ -22,7 +19,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 { @@ -31,10 +28,7 @@ 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"); - 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)) + source.trace_block_state_diffs(request.block_number()? as u32, include_txs).await } fn transform(response: Self::Response, columns: &mut Self, query: &Arc) -> R<()> { @@ -63,7 +57,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(state_diffs) = &trace.state_diff { + if let Some(ethers::types::StateDiff(state_diffs)) = &trace.state_diff { for (addr, diff) in state_diffs.iter() { process_code_diff(addr, &diff.code, block_number, tx, index, columns, schema); } @@ -73,8 +67,8 @@ pub(crate) fn process_code_diffs( } pub(crate) fn process_code_diff( - addr: &Address, - diff: &Delta, + addr: &H160, + diff: &Diff, block_number: &Option, transaction_hash: &Option>, transaction_index: usize, @@ -83,21 +77,21 @@ pub(crate) fn process_code_diff( ) { // this code will skip self-destructs and EOAs let (from, to) = match diff { - Delta::Unchanged => return, - Delta::Added(value) => { + Diff::Same => return, + Diff::Born(value) => { if value.is_empty() { return }; (Vec::new(), value.to_vec()) } - Delta::Removed(value) => (value.to_vec(), Vec::new()), - Delta::Changed(ChangedType { from, to }) => (from.to_vec(), to.to_vec()), + Diff::Died(value) => (value.to_vec(), Vec::new()), + Diff::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.to_vec()); + store!(schema, columns, address, addr.as_bytes().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 1127e5c..0b0aca3 100644 --- a/crates/freeze/src/datasets/code_reads.rs +++ b/crates/freeze/src/datasets/code_reads.rs @@ -1,5 +1,5 @@ use crate::*; -use alloy::{primitives::Address, rpc::types::trace::geth::AccountState}; +use ethers::prelude::*; 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: &Address, + addr: &H160, 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.to_vec()); - store!(schema, columns, code, code.to_vec()); + store!(schema, columns, contract_address, addr.as_bytes().to_vec()); + store!(schema, columns, code, code.as_bytes().to_vec()); } } diff --git a/crates/freeze/src/datasets/codes.rs b/crates/freeze/src/datasets/codes.rs index 16bc5dc..1b1b6bf 100644 --- a/crates/freeze/src/datasets/codes.rs +++ b/crates/freeze/src/datasets/codes.rs @@ -1,5 +1,5 @@ use crate::*; -use alloy::primitives::Address; +use ethers::prelude::*; 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(Address::from_slice(&address), block_number.into()).await?; + let output = source.get_code(H160::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 7df089a..9c682dc 100644 --- a/crates/freeze/src/datasets/contracts.rs +++ b/crates/freeze/src/datasets/contracts.rs @@ -1,9 +1,7 @@ use super::traces; use crate::*; -use alloy::{ - primitives::{keccak256, Address}, - rpc::types::trace::parity::{Action, LocalizedTransactionTrace, TraceOutput}, -}; +use ethers::prelude::*; +use ethers_core::utils::keccak256; use polars::prelude::*; /// columns for transactions @@ -36,7 +34,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 @@ -51,7 +49,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 @@ -66,40 +64,39 @@ impl CollectByTransaction for Contracts { /// process block into columns pub(crate) fn process_contracts( - traces: &[LocalizedTransactionTrace], + traces: &[Trace], columns: &mut Contracts, schemas: &Schemas, ) -> R<()> { let schema = schemas.get(&Datatype::Contracts).ok_or(err("schema not provided"))?; - let mut deployer = Address::ZERO; + let mut deployer = H160([0; 20]); let mut create_index = 0; for trace in traces.iter() { - if trace.trace.trace_address.is_empty() { - deployer = match &trace.trace.action { + if trace.trace_address.is_empty() { + deployer = match &trace.action { Action::Call(call) => call.from, Action::Create(create) => create.from, - Action::Selfdestruct(suicide) => suicide.refund_address, + Action::Suicide(suicide) => suicide.refund_address, Action::Reward(reward) => reward.author, }; }; - if let (Action::Create(create), Some(TraceOutput::Create(result))) = - (&trace.trace.action, &trace.trace.result) + if let (Action::Create(create), Some(Res::Create(result))) = (&trace.action, &trace.result) { columns.n_rows += 1; - 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, block_number, trace.block_number as u32); + store!(schema, columns, block_hash, trace.block_hash.as_bytes().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.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, 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, init_code, create.init.to_vec()); store!(schema, columns, code, result.code.to_vec()); - 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, 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); } diff --git a/crates/freeze/src/datasets/erc20_approvals.rs b/crates/freeze/src/datasets/erc20_approvals.rs deleted file mode 100644 index acba313..0000000 --- a/crates/freeze/src/datasets/erc20_approvals.rs +++ /dev/null @@ -1,126 +0,0 @@ -use crate::*; -use alloy::{ - primitives::{B256, U256}, - rpc::types::{Filter, Log, Topic}, - sol_types::SolEvent, -}; -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: [Topic; 4] = Default::default(); - topics[0] = ERC20::Approval::SIGNATURE_HASH.into(); - if let Some(from_address) = &request.from_address { - let v = B256::from_slice(from_address); - topics[1] = v.into(); - } - if let Some(to_address) = &request.to_address { - 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().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().data.len() == 32 && - log.topics()[0] == ERC20::Approval::SIGNATURE_HASH -} - -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.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 70fd4f8..a4cf593 100644 --- a/crates/freeze/src/datasets/erc20_balances.rs +++ b/crates/freeze/src/datasets/erc20_balances.rs @@ -1,5 +1,5 @@ use crate::*; -use alloy::{primitives::U256, sol_types::SolCall}; +use ethers::prelude::*; 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 = ERC20::balanceOfCall::SELECTOR; - let mut call_data = signature.clone().to_vec(); + let signature = FUNCTION_ERC20_BALANCE_OF.clone(); + let mut call_data = signature.clone(); 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| U256::from_be_slice(x.as_ref())); + let balance = balance.map(|x| x.to_vec().as_slice().into()); 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 ec254c9..cc6f154 100644 --- a/crates/freeze/src/datasets/erc20_metadata.rs +++ b/crates/freeze/src/datasets/erc20_metadata.rs @@ -1,5 +1,4 @@ use crate::*; -use alloy::sol_types::SolCall; use polars::prelude::*; /// columns for transactions @@ -48,7 +47,7 @@ impl CollectByBlock for Erc20Metadata { let address = request.ethers_address()?; // name - let call_data = ERC20::nameCall::SELECTOR.to_vec(); + let call_data = FUNCTION_ERC20_NAME.clone(); 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)) @@ -57,7 +56,7 @@ impl CollectByBlock for Erc20Metadata { }; // symbol - let call_data = ERC20::symbolCall::SELECTOR.to_vec(); + let call_data = FUNCTION_ERC20_SYMBOL.clone(); 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)) @@ -66,7 +65,7 @@ impl CollectByBlock for Erc20Metadata { }; // decimals - let call_data = ERC20::decimalsCall::SELECTOR.to_vec(); + let call_data = FUNCTION_ERC20_DECIMALS.clone(); 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 d02f1ca..4d46366 100644 --- a/crates/freeze/src/datasets/erc20_supplies.rs +++ b/crates/freeze/src/datasets/erc20_supplies.rs @@ -1,5 +1,5 @@ use crate::*; -use alloy::{primitives::U256, sol_types::SolCall}; +use ethers::prelude::*; 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 = ERC20::totalSupplyCall::SELECTOR.to_vec(); + let signature: Vec = FUNCTION_ERC20_TOTAL_SUPPLY.clone(); 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| U256::from_be_slice(x.as_ref())); + let output = output.map(|x| x.to_vec().as_slice().into()); 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 6881266..be23086 100644 --- a/crates/freeze/src/datasets/erc20_transfers.rs +++ b/crates/freeze/src/datasets/erc20_transfers.rs @@ -1,9 +1,5 @@ use crate::*; -use alloy::{ - primitives::{B256, U256}, - rpc::types::{Filter, Log, Topic}, - sol_types::SolEvent, -}; +use ethers::prelude::*; use polars::prelude::*; /// columns for transactions @@ -58,23 +54,21 @@ impl CollectByBlock for Erc20Transfers { type Response = Vec; async fn extract(request: Params, source: Arc, _: Arc) -> R { - let mut topics: [Topic; 4] = Default::default(); - topics[0] = ERC20::Transfer::SIGNATURE_HASH.into(); + let mut topics = [Some(ValueOrArray::Value(Some(*EVENT_ERC20_TRANSFER))), None, None, None]; if let Some(from_address) = &request.from_address { - let v = B256::from_slice(from_address); - topics[1] = v.into(); + 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 v = B256::from_slice(to_address); - topics[2] = v.into(); + 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().data.len() == 32) - .collect()) + 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<()> { @@ -99,9 +93,7 @@ impl CollectByTransaction for Erc20Transfers { } fn is_erc20_transfer(log: &Log) -> bool { - log.topics().len() == 3 && - log.data().data.len() == 32 && - log.topics()[0] == ERC20::Approval::SIGNATURE_HASH + log.topics.len() == 3 && log.data.len() == 32 && log.topics[0] == *EVENT_ERC20_TRANSFER } /// process block into columns @@ -111,20 +103,15 @@ 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.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()) - ); + 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/erc721_metadata.rs b/crates/freeze/src/datasets/erc721_metadata.rs index 734f2d7..16dbf55 100644 --- a/crates/freeze/src/datasets/erc721_metadata.rs +++ b/crates/freeze/src/datasets/erc721_metadata.rs @@ -1,6 +1,5 @@ use super::erc20_metadata::remove_control_characters; use crate::*; -use alloy::sol_types::SolCall; use polars::prelude::*; /// columns for transactions @@ -38,7 +37,7 @@ impl CollectByBlock for Erc721Metadata { let address = request.ethers_address()?; // name - let call_data = ERC721::nameCall::SELECTOR.to_vec(); + let call_data = FUNCTION_ERC20_NAME.clone(); 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)) @@ -47,7 +46,7 @@ impl CollectByBlock for Erc721Metadata { }; // symbol - let call_data = ERC721::symbolCall::SELECTOR.to_vec(); + let call_data = FUNCTION_ERC20_SYMBOL.clone(); 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 065dc17..e6c3fc2 100644 --- a/crates/freeze/src/datasets/erc721_transfers.rs +++ b/crates/freeze/src/datasets/erc721_transfers.rs @@ -1,9 +1,5 @@ use crate::*; -use alloy::{ - primitives::{B256, U256}, - rpc::types::{Filter, Log, Topic}, - sol_types::SolEvent, -}; +use ethers::prelude::*; use polars::prelude::*; /// columns for transactions @@ -58,20 +54,22 @@ impl CollectByBlock for Erc721Transfers { type Response = Vec; async fn extract(request: Params, source: Arc, _: Arc) -> R { - let mut topics: [Topic; 4] = Default::default(); - topics[0] = ERC721::Transfer::SIGNATURE_HASH.into(); + let mut topics = + [Some(ValueOrArray::Value(Some(*EVENT_ERC721_TRANSFER))), None, None, None]; if let Some(from_address) = &request.from_address { - let v = B256::from_slice(from_address); - topics[1] = v.into(); - }; + 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 v = B256::from_slice(to_address); - topics[2] = v.into(); - }; + 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() == 4 && x.data().data.len() == 0).collect()) + Ok(logs.into_iter().filter(|x| x.topics.len() == 4 && x.data.len() == 0).collect()) } fn transform(response: Self::Response, columns: &mut Self, query: &Arc) -> R<()> { @@ -96,9 +94,7 @@ impl CollectByTransaction for Erc721Transfers { } fn is_erc721_transfer(log: &Log) -> bool { - log.topics().len() == 4 && - log.data().data.len() == 0 && - log.topics()[0] == ERC721::Transfer::SIGNATURE_HASH + log.topics.len() == 4 && log.data.len() == 0 && log.topics[0] == *EVENT_ERC721_TRANSFER } /// process block into columns @@ -112,15 +108,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.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()); + 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()); } } Ok(()) diff --git a/crates/freeze/src/datasets/eth_calls.rs b/crates/freeze/src/datasets/eth_calls.rs index 203528f..4a58be3 100644 --- a/crates/freeze/src/datasets/eth_calls.rs +++ b/crates/freeze/src/datasets/eth_calls.rs @@ -1,8 +1,5 @@ use crate::*; -use alloy::{ - primitives::{keccak256, TxKind}, - rpc::types::{TransactionInput, TransactionRequest}, -}; +use ethers::prelude::*; use polars::prelude::*; /// columns for transactions @@ -50,12 +47,12 @@ impl CollectByBlock for EthCalls { async fn extract(request: Params, source: Arc, _: Arc) -> R { let transaction = TransactionRequest { - to: Some(TxKind::Call(request.ethers_contract()?)), - input: TransactionInput::new(request.call_data()?.into()), + to: Some(request.ethers_contract()?.into()), + data: Some(request.call_data()?.into()), ..Default::default() }; let number = request.block_number()?; - let output = source.call(transaction, number).await.ok().map(|x| x.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)) } @@ -76,7 +73,12 @@ 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, keccak256(call_data).to_vec()); + store!(schema, columns, call_data_hash, ethers_core::utils::keccak256(call_data).into()); store!(schema, columns, output_data, output_data.clone()); - store!(schema, columns, output_data_hash, output_data.map(|data| keccak256(data).to_vec())); + store!( + schema, + columns, + output_data_hash, + output_data.map(|data| ethers_core::utils::keccak256(data).into()) + ); } diff --git a/crates/freeze/src/datasets/geth_balance_diffs.rs b/crates/freeze/src/datasets/geth_balance_diffs.rs index a719715..ef87240 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 alloy::primitives::U256; +use ethers::prelude::*; 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 db5df39..a0dc80c 100644 --- a/crates/freeze/src/datasets/geth_calls.rs +++ b/crates/freeze/src/datasets/geth_calls.rs @@ -1,5 +1,5 @@ use crate::*; -use alloy::{primitives::U256, rpc::types::trace::geth::CallFrame}; +use ethers::prelude::*; 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.to_vec()); - store!(schema, columns, to_address, trace.to.map(|x| x.to_vec())); + 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, value, trace.value); store!(schema, columns, gas, trace.gas); store!(schema, columns, gas_used, trace.gas_used); @@ -101,11 +101,21 @@ fn process_trace( trace_address.iter().map(|&n| n.to_string()).collect::>().join(" ") ); - 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)? + 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)? + } } 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 47a86b0..027e32b 100644 --- a/crates/freeze/src/datasets/geth_nonce_diffs.rs +++ b/crates/freeze/src/datasets/geth_nonce_diffs.rs @@ -1,4 +1,5 @@ use crate::*; +use ethers::prelude::*; use polars::prelude::*; /// columns for transactions @@ -10,8 +11,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 95f519b..1f71831 100644 --- a/crates/freeze/src/datasets/geth_opcodes.rs +++ b/crates/freeze/src/datasets/geth_opcodes.rs @@ -1,7 +1,5 @@ use crate::*; -use alloy::rpc::types::trace::geth::{ - DefaultFrame, GethDebugTracingOptions, GethDefaultTracingOptions, -}; +use ethers::prelude::*; use polars::prelude::*; /// columns for geth traces @@ -42,21 +40,13 @@ 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 { - // 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 { + 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 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 @@ -73,15 +63,14 @@ impl CollectByTransaction for GethOpcodes { async fn extract(request: Params, source: Arc, query: Arc) -> R { let schema = query.schemas.get_schema(&Datatype::GethOpcodes)?; - let include_block_number = schema.has_column("block_number"); - let config = GethDefaultTracingOptions { + 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 options = GethDebugTracingOptions { config, ..Default::default() }; + let include_block_number = schema.has_column("block_number"); 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 01313f6..666d7c9 100644 --- a/crates/freeze/src/datasets/logs.rs +++ b/crates/freeze/src/datasets/logs.rs @@ -1,8 +1,5 @@ use crate::*; -use alloy::{ - dyn_abi::{DynSolType, DynSolValue, EventExt}, - rpc::types::Log, -}; +use ethers::prelude::*; use polars::prelude::*; /// columns for transactions @@ -21,8 +18,7 @@ pub struct Logs { topic2: Vec>>, topic3: Vec>>, data: Vec>, - n_data_bytes: Vec, - event_cols: indexmap::IndexMap>, + event_cols: indexmap::IndexMap>, chain_id: Vec, } @@ -45,7 +41,6 @@ impl Dataset for Logs { "topic2", "topic3", "data", - "n_data_bytes", // "event_cols", "chain_id", ]) @@ -94,37 +89,17 @@ 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, - // 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), + let decode_keys = match &schema.log_decoder { + None => None, Some(decoder) => { - let indexed: Vec = decoder + let keys = decoder .event .inputs .clone() .into_iter() - .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)) + .map(|i| i.name) + .collect::>(); + Some(keys) } }; @@ -133,29 +108,13 @@ 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(indexed_keys), Some(body_keys)) = - (&schema.log_decoder, &indexed_keys, &body_keys) - { - match decoder.event.decode_log(&log.inner.data, true) { + if let (Some(decoder), Some(decode_keys)) = (&schema.log_decoder, &decode_keys) { + match decoder.event.parse_log(log.clone().into()) { Ok(log) => { - // 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); + for param in log.params { + if decode_keys.contains(param.name.as_str()) { + columns.event_cols.entry(param.name).or_default().push(param.value); + } } } Err(_) => continue, @@ -163,19 +122,21 @@ 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.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); + 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()); // topics for i in 0..4 { - let topic = - if i < log.topics().len() { Some(log.topics()[i].to_vec()) } else { None }; + let topic = if i < log.topics.len() { + Some(log.topics[i].as_bytes().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/mod.rs b/crates/freeze/src/datasets/mod.rs index b7dd607..4c168ae 100644 --- a/crates/freeze/src/datasets/mod.rs +++ b/crates/freeze/src/datasets/mod.rs @@ -16,8 +16,6 @@ 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 @@ -82,7 +80,6 @@ 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/datasets/native_transfers.rs b/crates/freeze/src/datasets/native_transfers.rs index a8f2704..c8fde7e 100644 --- a/crates/freeze/src/datasets/native_transfers.rs +++ b/crates/freeze/src/datasets/native_transfers.rs @@ -1,8 +1,5 @@ use crate::*; -use alloy::{ - primitives::U256, - rpc::types::trace::parity::{Action, LocalizedTransactionTrace, TraceOutput}, -}; +use ethers::prelude::*; use polars::prelude::*; /// columns for transactions @@ -30,10 +27,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()?).await?; + let traces = source.trace_block(request.block_number()?.into()).await?; Ok(filter_traces_by_from_to_addresses(traces, &request.from_address, &request.to_address)) } @@ -46,7 +43,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?; @@ -62,43 +59,48 @@ impl CollectByTransaction for NativeTransfers { /// process block into columns pub(crate) fn process_native_transfers( - traces: &[LocalizedTransactionTrace], + traces: &[Trace], 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.unwrap_or(0) as u32); + store!(schema, columns, block_number, trace.block_number as u32); store!(schema, columns, transaction_index, trace.transaction_position.map(|x| x as u32)); - store!(schema, columns, block_hash, trace.block_hash.unwrap().to_vec()); + store!(schema, columns, block_hash, trace.block_hash.as_bytes().to_vec()); store!(schema, columns, transfer_index, transfer_index as u32); - store!(schema, columns, transaction_hash, trace.transaction_hash.map(|x| x.to_vec())); + store!( + schema, + columns, + transaction_hash, + trace.transaction_hash.map(|x| x.as_bytes().to_vec()) + ); - match &trace.trace.action { + match &trace.action { Action::Call(action) => { - store!(schema, columns, from_address, action.from.to_vec()); - store!(schema, columns, to_address, action.to.to_vec()); + 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, value, action.value); } Action::Create(action) => { - 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, 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, to_address, vec![0; 32]), } store!(schema, columns, value, action.value); } - Action::Selfdestruct(action) => { - store!(schema, columns, from_address, action.address.to_vec()); - store!(schema, columns, to_address, action.refund_address.to_vec()); + 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()); store!(schema, columns, value, action.balance); } Action::Reward(action) => { store!(schema, columns, from_address, vec![0; 20]); - store!(schema, columns, to_address, action.author.to_vec()); + store!(schema, columns, to_address, action.author.as_bytes().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 c17e7f7..ac863f2 100644 --- a/crates/freeze/src/datasets/nonce_diffs.rs +++ b/crates/freeze/src/datasets/nonce_diffs.rs @@ -1,8 +1,5 @@ use crate::*; -use alloy::{ - primitives::{Address, U64}, - rpc::types::trace::parity::{ChangedType, Delta, TraceResults}, -}; +use ethers::prelude::*; use polars::prelude::*; /// columns for transactions @@ -22,7 +19,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 { @@ -31,9 +28,7 @@ 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"); - 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())) + source.trace_block_state_diffs(request.block_number()? as u32, include_txs).await } fn transform(response: Self::Response, columns: &mut Self, query: &Arc) -> R<()> { @@ -62,7 +57,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(state_diffs) = &trace.state_diff { + if let Some(ethers::types::StateDiff(state_diffs)) = &trace.state_diff { for (addr, diff) in state_diffs.iter() { process_nonce_diff(addr, &diff.nonce, block_number, tx, index, columns, schema); } @@ -72,8 +67,8 @@ pub(crate) fn process_nonce_diffs( } pub(crate) fn process_nonce_diff( - addr: &Address, - diff: &Delta, + addr: &H160, + diff: &Diff, block_number: &Option, transaction_hash: &Option>, transaction_index: usize, @@ -81,16 +76,16 @@ pub(crate) fn process_nonce_diff( schema: &Table, ) { let (from, to) = match diff { - Delta::Unchanged => return, - Delta::Added(value) => (U64::ZERO, *value), - Delta::Removed(value) => (*value, U64::ZERO), - Delta::Changed(ChangedType { from, to }) => (*from, *to), + Diff::Same => return, + Diff::Born(value) => (U256::zero(), *value), + Diff::Died(value) => (*value, U256::zero()), + Diff::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.to_vec()); - store!(schema, columns, from_value, from.wrapping_to::()); - store!(schema, columns, to_value, to.wrapping_to::()); + 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()); } diff --git a/crates/freeze/src/datasets/nonce_reads.rs b/crates/freeze/src/datasets/nonce_reads.rs index 052c2eb..fdc8d89 100644 --- a/crates/freeze/src/datasets/nonce_reads.rs +++ b/crates/freeze/src/datasets/nonce_reads.rs @@ -1,5 +1,5 @@ use crate::*; -use alloy::{primitives::Address, rpc::types::trace::geth::AccountState}; +use ethers::prelude::*; 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: &Address, + addr: &H160, 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.to_vec()); - store!(schema, columns, nonce, *nonce); + store!(schema, columns, address, addr.as_bytes().to_vec()); + store!(schema, columns, nonce, nonce.as_u64()); } } diff --git a/crates/freeze/src/datasets/nonces.rs b/crates/freeze/src/datasets/nonces.rs index e44c904..2948d1b 100644 --- a/crates/freeze/src/datasets/nonces.rs +++ b/crates/freeze/src/datasets/nonces.rs @@ -1,5 +1,5 @@ use crate::*; -use alloy::primitives::Address; +use ethers::prelude::*; use polars::prelude::*; /// columns for balances @@ -37,10 +37,9 @@ 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(Address::from_slice(&address), block_number.into()) - .await?; - Ok((block_number, None, address, output)) + let output = + source.get_transaction_count(H160::from_slice(&address), block_number.into()).await?; + Ok((block_number, None, address, output.as_u64())) } 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 14f292a..1641e44 100644 --- a/crates/freeze/src/datasets/slots.rs +++ b/crates/freeze/src/datasets/slots.rs @@ -1,5 +1,5 @@ use crate::*; -use alloy::primitives::{Address, U256}; +use ethers::prelude::*; use polars::prelude::*; /// columns for balances @@ -49,12 +49,12 @@ impl CollectByBlock for Slots { let slot = request.slot()?; let output = source .get_storage_at( - Address::from_slice(&address), - U256::from_be_slice(&slot), + H160::from_slice(&address), + H256::from_slice(&slot), block_number.into(), ) .await?; - Ok((block_number, None, address, slot, output.to_vec_u8())) + Ok((block_number, None, address, slot, output.as_bytes().to_vec())) } 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 b4ebfff..3f1cb18 100644 --- a/crates/freeze/src/datasets/storage_diffs.rs +++ b/crates/freeze/src/datasets/storage_diffs.rs @@ -1,8 +1,5 @@ use crate::*; -use alloy::{ - primitives::{Address, B256}, - rpc::types::trace::parity::{ChangedType, Delta, TraceResults}, -}; +use ethers::prelude::*; use polars::prelude::*; /// columns for transactions @@ -27,7 +24,7 @@ impl Dataset for StorageDiffs { } } -type BlockTxsTraces = (Option, Vec>>, Vec); +type BlockTxsTraces = (Option, Vec>>, Vec); #[async_trait::async_trait] impl CollectByBlock for StorageDiffs { @@ -36,10 +33,7 @@ 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"); - 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)) + source.trace_block_state_diffs(request.block_number()? as u32, include_txs).await } fn transform(response: Self::Response, columns: &mut Self, query: &Arc) -> R<()> { @@ -68,7 +62,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(state_diffs) = &trace.state_diff { + if let Some(ethers::types::StateDiff(state_diffs)) = &trace.state_diff { for (addr, diff) in state_diffs.iter() { process_storage_diff(addr, &diff.storage, block_number, tx, index, columns, schema); } @@ -78,8 +72,8 @@ pub(crate) fn process_storage_diffs( } pub(crate) fn process_storage_diff( - addr: &Address, - diff: &std::collections::BTreeMap>, + addr: &H160, + diff: &std::collections::BTreeMap>, block_number: &Option, transaction_hash: &Option>, transaction_index: usize, @@ -88,18 +82,18 @@ pub(crate) fn process_storage_diff( ) { for (s, sub_diff) in diff.iter() { let (from, to) = match sub_diff { - Delta::Unchanged => continue, - Delta::Added(value) => (B256::ZERO, *value), - Delta::Removed(value) => (*value, B256::ZERO), - Delta::Changed(ChangedType { from, to }) => (*from, *to), + Diff::Same => continue, + Diff::Born(value) => (H256::zero(), *value), + Diff::Died(value) => (*value, H256::zero()), + Diff::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.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()); + 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()); } } diff --git a/crates/freeze/src/datasets/storage_reads.rs b/crates/freeze/src/datasets/storage_reads.rs index d276956..874919a 100644 --- a/crates/freeze/src/datasets/storage_reads.rs +++ b/crates/freeze/src/datasets/storage_reads.rs @@ -1,5 +1,5 @@ use crate::*; -use alloy::{primitives::Address, rpc::types::trace::geth::AccountState}; +use ethers::prelude::*; 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: &Address, + addr: &H160, account_state: &AccountState, block_number: &Option, transaction_hash: &Option>, @@ -83,13 +83,15 @@ pub(crate) fn process_storage_read( columns: &mut StorageReads, schema: &Table, ) { - 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()); + 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()); + } } } diff --git a/crates/freeze/src/datasets/trace_calls.rs b/crates/freeze/src/datasets/trace_calls.rs index c77f4ad..5af951e 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 alloy::rpc::types::trace::parity::{Action, TraceOutput, TraceType, TransactionTrace}; +use ethers::prelude::*; use polars::prelude::*; /// columns for transactions @@ -58,7 +58,8 @@ impl CollectByBlock for TraceCalls { Some(request.ethers_block_number()?), ) .await? - .trace; + .trace + .ok_or(CollectError::CollectError("traces missing".to_string()))?; Ok((request.block_number()? as u32, request.contract()?, request.call_data()?, traces)) } @@ -84,7 +85,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.kind())); + store!(schema, columns, action_type, traces::action_type_to_string(&trace.action_type)); store!( schema, columns, @@ -103,10 +104,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.to_vec())); - store!(schema, columns, action_to, Some(action.to.to_vec())); + 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_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, @@ -118,18 +119,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.to_vec())); + store!(schema, columns, action_from, Some(action.from.as_bytes().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::Selfdestruct(action) => { - store!(schema, columns, action_from, Some(action.address.to_vec())); - store!(schema, columns, action_to, Some(action.refund_address.to_vec())); + 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())); store!(schema, columns, action_value, action.balance.to_string()); store!(schema, columns, action_gas, None); store!(schema, columns, action_input, None); @@ -138,7 +139,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.to_vec())); + store!(schema, columns, action_from, Some(action.author.as_bytes().to_vec())); store!(schema, columns, action_to, None); store!(schema, columns, action_value, action.value.to_string()); store!(schema, columns, action_gas, None); @@ -155,21 +156,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(TraceOutput::Call(result)) => { - store!(schema, columns, result_gas_used, Some(result.gas_used as u32)); + Some(Res::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(TraceOutput::Create(result)) => { - store!(schema, columns, result_gas_used, Some(result.gas_used as u32)); + Some(Res::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.to_vec())); + store!(schema, columns, result_address, Some(result.address.as_bytes().to_vec())); } - None => { + Some(Res::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 5bde18f..2ce7dd4 100644 --- a/crates/freeze/src/datasets/traces.rs +++ b/crates/freeze/src/datasets/traces.rs @@ -1,10 +1,5 @@ use crate::*; -use alloy::{ - primitives::Address, - rpc::types::trace::parity::{ - Action, ActionType, CallType, LocalizedTransactionTrace, RewardType, TraceOutput, - }, -}; +use ethers::prelude::*; use polars::prelude::*; /// columns for transactions @@ -44,10 +39,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()?).await?; + let traces = source.trace_block(request.block_number()?.into()).await?; Ok(filter_traces_by_from_to_addresses(traces, &request.from_address, &request.to_address)) } @@ -60,7 +55,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?; @@ -75,73 +70,66 @@ 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.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) - }; + 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) + }; // 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.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) - }; + 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) + }; traces.into_iter().filter(from_filter).filter(to_filter).collect() } /// process block into columns -pub(crate) fn process_traces( - traces: &[LocalizedTransactionTrace], - columns: &mut Traces, - schemas: &Schemas, -) -> R<()> { +pub(crate) fn process_traces(traces: &[Trace], 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.trace.action, columns, schema); - process_result(&trace.trace.result, columns, schema); - store!(schema, columns, action_type, action_type_to_string(&trace.trace.action.kind())); + process_action(&trace.action, columns, schema); + process_result(&trace.result, columns, schema); + store!(schema, columns, action_type, action_type_to_string(&trace.action_type)); store!( schema, columns, trace_address, - trace - .trace - .trace_address - .iter() - .map(|n| n.to_string()) - .collect::>() - .join("_") + trace.trace_address.iter().map(|n| n.to_string()).collect::>().join("_") ); - store!(schema, columns, subtraces, trace.trace.subtraces as u32); + store!(schema, columns, subtraces, 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.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()); + 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()); } Ok(()) } @@ -149,10 +137,10 @@ pub(crate) fn process_traces( fn process_action(action: &Action, columns: &mut Traces, schema: &Table) { match action { Action::Call(action) => { - store!(schema, columns, action_from, Some(action.from.to_vec())); - store!(schema, columns, action_to, Some(action.to.to_vec())); + 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_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, @@ -164,18 +152,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.to_vec())); + store!(schema, columns, action_from, Some(action.from.as_bytes().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::Selfdestruct(action) => { - store!(schema, columns, action_from, Some(action.address.to_vec())); - store!(schema, columns, action_to, Some(action.refund_address.to_vec())); + 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())); store!(schema, columns, action_value, action.balance.to_string()); store!(schema, columns, action_gas, None); store!(schema, columns, action_input, None); @@ -184,7 +172,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.to_vec())); + store!(schema, columns, action_from, Some(action.author.as_bytes().to_vec())); store!(schema, columns, action_to, None); store!(schema, columns, action_value, action.value.to_string()); store!(schema, columns, action_gas, None); @@ -201,21 +189,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(TraceOutput::Call(result)) => { - store!(schema, columns, result_gas_used, Some(result.gas_used as u32)); + Some(Res::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(TraceOutput::Create(result)) => { - store!(schema, columns, result_gas_used, Some(result.gas_used as u32)); + Some(Res::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.to_vec())); + store!(schema, columns, result_address, Some(result.address.as_bytes().to_vec())); } - None => { + Some(Res::None) | None => { store!(schema, columns, result_gas_used, None); store!(schema, columns, result_output, None); store!(schema, columns, result_code, None); @@ -228,9 +216,8 @@ pub(crate) fn reward_type_to_string(reward_type: &RewardType) -> String { match reward_type { RewardType::Block => "reward".to_string(), RewardType::Uncle => "uncle".to_string(), - // below arms not exist in alloy - // RewardType::EmptyStep => "empty_step".to_string(), - // RewardType::External => "external".to_string(), + RewardType::EmptyStep => "empty_step".to_string(), + RewardType::External => "external".to_string(), } } @@ -239,7 +226,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::Selfdestruct => "suicide".to_string(), + ActionType::Suicide => "suicide".to_string(), } } @@ -250,27 +237,24 @@ 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.trace_address.is_empty() { + if 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.trace_address.len() >= e_address.len() && - trace.trace.trace_address[0..e_address.len()] == e_address[..] + if trace.trace_address.len() >= e_address.len() && + trace.trace_address[0..e_address.len()] == e_address[..] { continue } else { @@ -279,8 +263,8 @@ pub(crate) fn filter_failed_traces( } // check if current trace is start of an error - match trace.trace.error { - Some(_) => error_address = Some(trace.trace.trace_address), + match trace.error { + Some(_) => error_address = Some(trace.trace_address), None => filtered.push(trace), } } diff --git a/crates/freeze/src/datasets/transactions.rs b/crates/freeze/src/datasets/transactions.rs index a2c7ac0..54f3b8b 100644 --- a/crates/freeze/src/datasets/transactions.rs +++ b/crates/freeze/src/datasets/transactions.rs @@ -1,11 +1,5 @@ use crate::*; -use alloy::{ - consensus::Transaction as ConsensusTransaction, - primitives::{Address, TxKind, U256}, - rpc::types::{ - Block, BlockTransactions, BlockTransactionsKind, Transaction, TransactionReceipt, - }, -}; +use ethers::prelude::*; use polars::prelude::*; /// columns for transactions @@ -24,7 +18,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, @@ -35,9 +29,6 @@ pub struct Transactions { block_hash: Vec>, chain_id: Vec, timestamp: Vec, - r: Vec>, - s: Vec>, - v: Vec, } #[async_trait::async_trait] @@ -80,11 +71,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(request.block_number()?, BlockTransactionsKind::Full) + .get_block_with_txs(request.block_number()?) .await? .ok_or(CollectError::CollectError("block not found".to_string()))?; let schema = query.schemas.get_schema(&Datatype::Transactions)?; @@ -93,30 +84,19 @@ 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 == Address::from_slice(from_address)) + Box::new(move |tx| tx.from.as_bytes() == 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| match tx.inner.kind() { - TxKind::Create => false, - TxKind::Call(address) => address == Address::from_slice(to_address), - }) + Box::new(move |tx| tx.to.as_ref().map_or(false, |x| x.as_bytes() == to_address)) } else { Box::new(|_| true) }; - let transactions: Vec = block - .transactions - .clone() - .as_transactions() - .unwrap() - .iter() - .filter(|&x| from_filter(x)) - .filter(|&x| to_filter(x)) - .cloned() - .collect(); + let transactions = + block.transactions.clone().into_iter().filter(from_filter).filter(to_filter).collect(); // 2. collect receipts if necessary // if transactions are filtered fetch by set of transaction hashes, else fetch all receipts @@ -125,7 +105,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(BlockTransactions::Full(transactions.clone())).await? + source.get_tx_receipts(&transactions).await? } else { source.get_tx_receipts_in_block(&block).await? }; @@ -142,15 +122,13 @@ 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, columns, schema, exclude_failed, - block.header.timestamp as u32, - gas_price, + block.timestamp.as_u32(), )?; } Ok(()) @@ -159,13 +137,13 @@ impl CollectByBlock for Transactions { #[async_trait::async_trait] impl CollectByTransaction for Transactions { - type Response = (TransactionAndReceipt, Block, bool, u32); + type Response = (TransactionAndReceipt, bool, u32); async fn extract(request: Params, source: Arc, query: Arc) -> R { let tx_hash = request.ethers_transaction_hash()?; let schema = query.schemas.get_schema(&Datatype::Transactions)?; let transaction = source - .get_transaction_by_hash(tx_hash) + .get_transaction(tx_hash) .await? .ok_or(CollectError::CollectError("transaction not found".to_string()))?; let receipt = if schema.has_column("gas_used") { @@ -179,28 +157,19 @@ impl CollectByTransaction for Transactions { .ok_or(CollectError::CollectError("no block number for tx".to_string()))?; let block = source - .get_block(block_number, BlockTransactionsKind::Hashes) + .get_block(block_number.as_u64()) .await? .ok_or(CollectError::CollectError("block not found".to_string()))?; - let timestamp = block.header.timestamp as u32; + let timestamp = block.timestamp.as_u32(); - Ok(((transaction, receipt), block, query.exclude_failed, timestamp)) + Ok(((transaction, receipt), 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), block, exclude_failed, timestamp) = response; - let gas_price = get_gas_price(&block, &transaction); - process_transaction( - transaction, - receipt, - columns, - schema, - exclude_failed, - timestamp, - gas_price, - )?; + let ((transaction, receipt), exclude_failed, timestamp) = response; + process_transaction(transaction, receipt, columns, schema, exclude_failed, timestamp)?; Ok(()) } } @@ -212,7 +181,6 @@ 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)?; @@ -225,90 +193,51 @@ 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); - 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, 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, 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.inner.input().len() as u32; - let n_input_zero_bytes = tx.inner.input().iter().filter(|&&x| x == 0).count() as u32; + 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); } - // 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.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, get_max_fee_per_gas(&tx)); + 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())); store!( schema, columns, max_priority_fee_per_gas, - tx.inner.max_priority_fee_per_gas().map(|value| value as u64) + tx.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().to_vec()); - - 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()); + store!(schema, columns, block_hash, tx.block_hash.unwrap_or_default().as_bytes().to_vec()); 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()) + if let Some(status) = receipt.as_ref().and_then(|x| x.status) { + Ok(status.as_u64() == 1) } else if let (Some(1), Some(true)) = - (tx.inner.chain_id(), tx.block_number.map(|x| x < 4370000)) + (tx.chain_id.map(|x| x.as_u64()), tx.block_number.map(|x| x.as_u64() < 4370000)) { - if let Some(r) = receipt { - Ok(r.gas_used == 0) + if let Some(gas_used) = receipt.as_ref().and_then(|x| x.gas_used.map(|x| x.as_u64())) { + Ok(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 1ede0df..b06b465 100644 --- a/crates/freeze/src/datasets/vm_traces.rs +++ b/crates/freeze/src/datasets/vm_traces.rs @@ -1,5 +1,5 @@ use crate::*; -use alloy::rpc::types::trace::parity::{TraceResults, VmTrace}; +use ethers::prelude::*; 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,13 +39,10 @@ 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 { - 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)) + source.trace_block_vm_traces(request.block_number()? as u32).await } fn transform(response: Self::Response, columns: &mut Self, query: &Arc) -> R<()> { @@ -55,7 +52,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 @@ -67,7 +64,7 @@ impl CollectByTransaction for VmTraces { } fn process_vm_traces( - response: (Option, Option>, Vec), + response: (Option, Option>, Vec), columns: &mut VmTraces, schemas: &Schemas, ) -> R<()> { @@ -82,7 +79,7 @@ fn process_vm_traces( } fn add_ops( - vm_trace: VmTrace, + vm_trace: VMTrace, schema: &Table, columns: &mut VmTraces, number: Option, @@ -123,7 +120,12 @@ fn add_ops( store!(schema, columns, storage_key, None); store!(schema, columns, storage_val, None); } - store!(schema, columns, op, opcode.op); + 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), + } + }; if let Some(sub) = opcode.sub { add_ops(sub, schema, columns, number, tx_hash.clone(), tx_pos) diff --git a/crates/freeze/src/freeze.rs b/crates/freeze/src/freeze.rs index f80bc62..38841ff 100644 --- a/crates/freeze/src/freeze.rs +++ b/crates/freeze/src/freeze.rs @@ -157,7 +157,7 @@ async fn freeze_partitions( completed.push(partition) } Ok((partition, Err(e))) => errored.push((Some(partition), e)), - Err(e) => errored.push((None, err(format!("error joining chunks: {:?}", e).as_str()))), + Err(_e) => errored.push((None, err("error joining chunks"))), } } diff --git a/crates/freeze/src/multi_datasets/blocks_and_transactions.rs b/crates/freeze/src/multi_datasets/blocks_and_transactions.rs index 169aeed..1201259 100644 --- a/crates/freeze/src/multi_datasets/blocks_and_transactions.rs +++ b/crates/freeze/src/multi_datasets/blocks_and_transactions.rs @@ -46,15 +46,19 @@ impl CollectByTransaction for BlocksAndTransactions { ); async fn extract(request: Params, source: Arc, query: Arc) -> R { - let ((tx, receipt), block, exclude_failed, timestamp) = + let ((tx, receipt), exclude_failed, timestamp) = ::extract(request, source.clone(), query).await?; - Ok((block.clone(), ((tx, receipt), block, exclude_failed, timestamp))) + let block_number = tx.block_number.ok_or(err("no block number for tx"))?.as_u64(); + let block = source + .get_block(block_number) + .await? + .ok_or(CollectError::CollectError("block not found".to_string()))?; + Ok((block, ((tx, receipt), 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 gas_price = transactions::get_gas_price(&block, &tx); + let (block, ((tx, receipt), exclude_failed, timestamp)) = response; let schema = query.schemas.get_schema(&Datatype::Blocks)?; blocks::process_block(block, blocks, schema)?; let schema = query.schemas.get_schema(&Datatype::Transactions)?; @@ -65,7 +69,6 @@ impl CollectByTransaction for BlocksAndTransactions { schema, exclude_failed, timestamp, - gas_price, )?; Ok(()) } diff --git a/crates/freeze/src/multi_datasets/call_trace_derivatives.rs b/crates/freeze/src/multi_datasets/call_trace_derivatives.rs index 53ad5c6..90148f2 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 alloy::rpc::types::trace::parity::LocalizedTransactionTrace; +use ethers::prelude::*; 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()?).await + source.trace_block(request.block_number()?.into()).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 bd2f16c..fc1c04a 100644 --- a/crates/freeze/src/multi_datasets/geth_state_diffs.rs +++ b/crates/freeze/src/multi_datasets/geth_state_diffs.rs @@ -1,8 +1,5 @@ use crate::*; -use alloy::{ - primitives::{Address, Bytes, B256, U256}, - rpc::types::trace::geth::{AccountState, DiffMode}, -}; +use ethers::prelude::*; use polars::prelude::*; use std::collections::{BTreeMap, HashMap, HashSet}; @@ -49,7 +46,7 @@ impl ToDataFrames for GethStateDiffs { } } -type BlockTxsTraces = (Option, Vec>>, Vec); +type BlockTxsTraces = (Option, Vec>>, Vec); #[async_trait::async_trait] impl CollectByBlock for GethStateDiffs { @@ -149,34 +146,34 @@ pub(crate) fn process_geth_diffs( } fn add_balances( - address: &Address, + address: &H160, 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.to_vec()); + store!(schema, columns, address, address.as_bytes().to_vec()); store!(schema, columns, from_value, from_value); store!(schema, columns, to_value, to_value); Ok(()) } fn add_codes( - address: &Address, - pre: &Option, - post: &Option, + address: &H160, + pre: &Option, + post: &Option, columns: &mut GethCodeDiffs, schema: &Table, index: &(Option, u32, Option>), ) -> R<()> { - let blank = Bytes::new(); + let blank = String::new(); let (from_value, to_value) = match (pre, post) { (Some(pre), Some(post)) => (pre, post), (Some(pre), None) => (pre, &blank), @@ -188,40 +185,57 @@ 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.to_vec()); - store!(schema, columns, from_value, from_value.to_vec()); - store!(schema, columns, to_value, to_value.to_vec()); + 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); Ok(()) } fn add_nonces( - address: &Address, - pre: Option, - post: Option, + address: &H160, + pre: Option, + post: Option, columns: &mut GethNonceDiffs, schema: &Table, index: &(Option, u32, Option>), ) -> R<()> { - let (from_value, to_value) = parse_pre_post(pre, post, 0_u64); + 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.to_vec()); + store!(schema, columns, address, address.as_bytes().to_vec()); store!(schema, columns, from_value, from_value); store!(schema, columns, to_value, to_value); Ok(()) } fn add_storages( - address: &Address, - pre: &BTreeMap, - post: &BTreeMap, + address: &H160, + pre: &Option>, + post: &Option>, 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() @@ -230,7 +244,7 @@ fn add_storages( .collect::>() .into_iter() .collect(); - let blank = B256::ZERO; + let blank = H256::zero(); for slot in slots.into_iter() { let (from, to) = match (pre.get(&slot), post.get(&slot)) { (Some(pre), Some(post)) => (pre, post), @@ -242,22 +256,19 @@ 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.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()); + 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()); } Ok(()) } -fn parse_pre_post(pre: Option, post: Option, new: T) -> (T, T) -where - T: Copy + Clone, -{ +fn parse_pre_post(pre: Option, post: Option, new: fn() -> T) -> (T, T) { 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 2806fee..31cff4f 100644 --- a/crates/freeze/src/multi_datasets/state_diffs.rs +++ b/crates/freeze/src/multi_datasets/state_diffs.rs @@ -1,5 +1,4 @@ use crate::*; -use alloy::rpc::types::trace::parity::TraceResults; use polars::prelude::*; use std::collections::HashMap; @@ -12,7 +11,7 @@ pub struct StateDiffs( storage_diffs::StorageDiffs, ); -type BlockTxsTraces = (Option, Vec>>, Vec); +type BlockTxsTraces = (Option, Vec>>, Vec); impl ToDataFrames for StateDiffs { fn create_dfs( @@ -36,10 +35,7 @@ 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")); - 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)) + source.trace_block_state_diffs(request.block_number()? as u32, include_txs).await } 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 0fa8ae4..9f92264 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 alloy::{primitives::Address, rpc::types::trace::geth::AccountState}; +use ethers::prelude::*; 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( @@ -22,18 +22,10 @@ impl ToDataFrames for StateReads { ) -> R> { let StateReads(balances, codes, nonces, storages) = self; let mut output = HashMap::new(); - 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)?); - } + 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)?); Ok(output) } } @@ -43,18 +35,9 @@ impl CollectByBlock for StateReads { type Response = BlockTxsTraces; async fn extract(request: Params, source: Arc, query: Arc) -> R { - 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, - }; + let schema = + query.schemas.get(&Datatype::StorageReads).ok_or(err("schema not provided"))?; + let include_txs = schema.has_column("transaction_hash"); source.geth_debug_trace_block_prestate(request.block_number()? as u32, include_txs).await } @@ -68,18 +51,9 @@ impl CollectByTransaction for StateReads { type Response = BlockTxsTraces; async fn extract(request: Params, source: Arc, query: Arc) -> R { - 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 schema = + query.schemas.get(&Datatype::StorageReads).ok_or(err("schema not provided"))?; + let include_block_number = schema.has_column("block_number"); let tx = request.transaction_hash()?; source.geth_debug_trace_transaction_prestate(tx, include_block_number).await } @@ -95,17 +69,9 @@ fn process_state_reads( schemas: &HashMap, ) -> R<()> { let StateReads(balances, codes, nonces, storages) = columns; - 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)?; - } + 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)?; Ok(()) } diff --git a/crates/freeze/src/types/chunks/number_chunk.rs b/crates/freeze/src/types/chunks/number_chunk.rs index bb68d1f..b557e4c 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 alloy::rpc::types::FilterBlockOption; +use ethers::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.div_ceil(chunk_size) * chunk_size; + let start = ((start + chunk_size - 1) / 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 6404c87..4d248c6 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.div_ceil(*n_chunks); + let chunk_size = (total_blocks + n_chunks - 1) / n_chunks; self.subchunk_by_size(&chunk_size) } } diff --git a/crates/freeze/src/types/columns.rs b/crates/freeze/src/types/columns.rs index 8d8baa6..5270616 100644 --- a/crates/freeze/src/types/columns.rs +++ b/crates/freeze/src/types/columns.rs @@ -52,7 +52,10 @@ pub trait ColumnData: Default + crate::Dataset { /// input arg aliases fn base_arg_aliases() -> HashMap { - Self::arg_aliases().unwrap_or_default() + match Self::arg_aliases() { + Some(x) => x, + None => HashMap::new(), + } } } diff --git a/crates/freeze/src/types/conversions.rs b/crates/freeze/src/types/conversions.rs index 536ee3a..ce8d39f 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 alloy::primitives::{Bytes, I256, U256}; +use ethers::prelude::*; use prefix_hex; /// convert Bytes to u32 @@ -21,7 +21,11 @@ pub trait ToVecU8 { impl ToVecU8 for U256 { fn to_vec_u8(&self) -> Vec { - self.to_be_bytes_vec() + let mut vec = Vec::new(); + for &number in self.0.iter().rev() { + vec.extend_from_slice(&number.to_be_bytes()); + } + vec } } @@ -41,7 +45,9 @@ impl ToVecU8 for Vec { fn to_vec_u8(&self) -> Vec { let mut vec = Vec::new(); for value in self { - vec.extend_from_slice(&value.to_be_bytes_vec()) + for &number in value.0.iter().rev() { + vec.extend_from_slice(&number.to_be_bytes()); + } } vec } diff --git a/crates/freeze/src/types/dataframes/creation.rs b/crates/freeze/src/types/dataframes/creation.rs index 860d5b4..b4dd01d 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.wrapping_to::()).collect(); + let converted: Vec = $value.iter().map(|v| v.as_u32()).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.wrapping_to::()).collect(); + let converted: Vec = $value.iter().map(|v| v.as_u64()).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.wrapping_to::())).collect(); + $value.iter().map(|v| v.map(|x| x.as_u32())).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.wrapping_to::())).collect(); + $value.iter().map(|v| v.map(|x| x.as_u64())).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 9e47689..ea3a353 100644 --- a/crates/freeze/src/types/dataframes/u256s.rs +++ b/crates/freeze/src/types/dataframes/u256s.rs @@ -1,5 +1,5 @@ use crate::*; -use alloy::primitives::{I256, U256}; +use ethers::prelude::*; 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.wrapping_to::()).collect(); + let converted: Vec = self.iter().map(|v| v.as_u32()).collect(); Ok(Series::new(name, converted)) } U256Type::U64 => { - let converted: Vec = self.iter().map(|v| v.wrapping_to::()).collect(); + let converted: Vec = self.iter().map(|v| v.as_u64()).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.wrapping_to::())).collect(); + self.iter().map(|v| v.map(|x| x.as_u32())).collect(); Ok(Series::new(name, converted)) } U256Type::U64 => { let converted: Vec> = - self.iter().map(|v| v.map(|x| x.wrapping_to::())).collect(); + self.iter().map(|v| v.map(|x| x.as_u64())).collect(); Ok(Series::new(name, converted)) } U256Type::Decimal128 => { diff --git a/crates/freeze/src/types/datatypes/scalar.rs b/crates/freeze/src/types/datatypes/scalar.rs index 6f86bd8..c4078c0 100644 --- a/crates/freeze/src/types/datatypes/scalar.rs +++ b/crates/freeze/src/types/datatypes/scalar.rs @@ -16,7 +16,6 @@ define_datatypes!( Erc20Metadata, Erc20Supplies, Erc20Transfers, - Erc20Approvals, Erc721Metadata, Erc721Transfers, EthCalls, diff --git a/crates/freeze/src/types/decoders/log_decoder.rs b/crates/freeze/src/types/decoders/log_decoder.rs index b107b60..5f7c87a 100644 --- a/crates/freeze/src/types/decoders/log_decoder.rs +++ b/crates/freeze/src/types/decoders/log_decoder.rs @@ -1,12 +1,8 @@ use crate::{err, CollectError, ColumnEncoding, ToU256Series, U256Type}; -use alloy::{ - dyn_abi::{DynSolValue, EventExt}, - hex::ToHexExt, - json_abi::Event, - primitives::{I256, U256}, - rpc::types::Log, -}; +use ethers::prelude::*; +use ethers_core::abi::{AbiEncode, EventParam, HumanReadableParser, ParamType, RawLog, Token}; use polars::prelude::*; +use std::collections::HashSet; /// container for log decoding context #[derive(Clone, Debug, PartialEq)] @@ -15,7 +11,7 @@ pub struct LogDecoder { /// uint256 amount) pub raw: String, /// decoded abi type of event signature string - pub event: Event, + pub event: abi::Event, } impl LogDecoder { @@ -23,7 +19,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 Event::parse(&event_signature) { + match HumanReadableParser::parse_event(event_signature.as_str()) { 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); @@ -41,35 +37,19 @@ 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 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(); + 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::>(); for log in logs { - 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); + 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); + } } } Err(e) => eprintln!("error parsing log: {:?}", e), @@ -82,7 +62,7 @@ impl LogDecoder { pub fn make_series( &self, name: String, - data: Vec, + data: Vec, chunk_len: usize, u256_types: &[U256Type], column_encoding: &ColumnEncoding, @@ -90,6 +70,7 @@ 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![]; @@ -98,39 +79,68 @@ 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 { - DynSolValue::Address(a) => match column_encoding { - ColumnEncoding::Binary => bytes.push(a.to_vec()), + Token::Address(a) => match column_encoding { + ColumnEncoding::Binary => bytes.push(a.to_fixed_bytes().into()), ColumnEncoding::Hex => hexes.push(format!("{:?}", a)), }, - 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 { + Token::FixedBytes(b) => match column_encoding { ColumnEncoding::Binary => bytes.push(b), ColumnEncoding::Hex => hexes.push(b.encode_hex()), }, - DynSolValue::Uint(i, size) => { - if size <= 64 { - uints.push(i.wrapping_to::()) - } else { - u256s.push(i) + 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::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(_) => {} + Token::Bool(b) => bools.push(b), + Token::String(s) => strings.push(s), + Token::Array(_) | Token::FixedArray(_) => {} + Token::Tuple(_) => {} } } let mixed_length_err = format!("could not parse column {}, mixed type", name); @@ -163,6 +173,8 @@ 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 fe3bae2..ebd9071 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] RpcError), + ProviderError(#[source] ProviderError), /// 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] RpcError), + ProviderError(#[source] ProviderError), /// Parse int error #[error("Parsing error")] @@ -105,10 +105,6 @@ 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/execution.rs b/crates/freeze/src/types/execution.rs index 0bbe4a7..a8285d2 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() + ExecutionEnvBuilder { ..Default::default() } } /// dry run diff --git a/crates/freeze/src/types/files.rs b/crates/freeze/src/types/files.rs index bfbca16..4dccac0 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 use for output files + /// File format to used for output files pub format: FileFormat, /// Number of rows per parquet row group pub row_group_size: Option, @@ -51,9 +51,7 @@ impl FileOutput { }; for meta_datatype in meta_datatypes.iter() { for datatype in meta_datatype.datatypes().into_iter() { - if query.schemas.contains_key(&datatype) { - paths.insert(datatype, self.get_path(query, partition, datatype)?); - } + paths.insert(datatype, self.get_path(query, partition, datatype)?); } } Ok(paths) diff --git a/crates/freeze/src/types/mod.rs b/crates/freeze/src/types/mod.rs index b0e163d..d4eb84c 100644 --- a/crates/freeze/src/types/mod.rs +++ b/crates/freeze/src/types/mod.rs @@ -1,4 +1,5 @@ /// type specifications for cryo_freeze crate + /// type specifications for chunk types pub mod chunks; /// conversion operations @@ -35,7 +36,6 @@ 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 fc58f5b..2832b4c 100644 --- a/crates/freeze/src/types/rpc_params.rs +++ b/crates/freeze/src/types/rpc_params.rs @@ -1,8 +1,5 @@ use crate::{err, CollectError}; -use alloy::{ - primitives::{Address, BlockNumber, B256}, - rpc::types::{Filter, FilterBlockOption}, -}; +use ethers::prelude::*; /// represents parameters for a single rpc call #[derive(Default, Clone, Debug)] @@ -77,22 +74,22 @@ impl Params { /// ethers block number pub fn ethers_block_number(&self) -> Result { - self.block_number() + Ok(self.block_number()?.into()) } /// ethers transaction - pub fn ethers_transaction_hash(&self) -> Result { - Ok(B256::from_slice(&self.transaction_hash()?)) + pub fn ethers_transaction_hash(&self) -> Result { + Ok(H256::from_slice(&self.transaction_hash()?)) } /// ethers address - pub fn ethers_address(&self) -> Result { - Ok(Address::from_slice(&self.address()?)) + pub fn ethers_address(&self) -> Result { + Ok(H160::from_slice(&self.address()?)) } /// ethers contract - pub fn ethers_contract(&self) -> Result { - Ok(Address::from_slice(&self.contract()?)) + pub fn ethers_contract(&self) -> Result { + Ok(H160::from_slice(&self.contract()?)) } /// log filter @@ -100,33 +97,16 @@ 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(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())); - } + 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)))), + ], + }; Ok(filter) } } diff --git a/crates/freeze/src/types/schemas.rs b/crates/freeze/src/types/schemas.rs index 54201ee..6584c4e 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; -/// functions for Schemas +/// funcitons for Schemas pub trait SchemaFunctions { /// get schema fn get_schema(&self, datatype: &Datatype) -> Result<&Table, CollectError>; @@ -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!(21, table.columns().len()); + assert_eq!(15, 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!(21, table.columns().len()); + assert_eq!(15, table.columns().len()); assert!(table.columns().contains(&"block_hash")); assert!(table.columns().contains(&"transactions_root")); } diff --git a/crates/freeze/src/types/signatures.rs b/crates/freeze/src/types/signatures.rs index fb74358..d5f9dfb 100644 --- a/crates/freeze/src/types/signatures.rs +++ b/crates/freeze/src/types/signatures.rs @@ -1,26 +1,31 @@ -use alloy::sol; +use ethers::prelude::*; -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); +lazy_static::lazy_static! { - 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); - } + /// 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_ERC721_TRANSFER + pub static ref EVENT_ERC721_TRANSFER: H256 = H256( + prefix_hex::decode("0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef") + .expect("Decoding failed"), + ); } diff --git a/crates/freeze/src/types/sources.rs b/crates/freeze/src/types/sources.rs index 04b5c69..4c5107b 100644 --- a/crates/freeze/src/types/sources.rs +++ b/crates/freeze/src/types/sources.rs @@ -1,29 +1,6 @@ use std::sync::Arc; -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 ethers::prelude::*; use governor::{ clock::DefaultClock, middleware::NoOpMiddleware, @@ -43,7 +20,7 @@ pub type RateLimiter = governor::RateLimiter, + pub provider: ProviderWrapper, /// chain_id of network pub chain_id: u64, /// number of blocks per log request @@ -60,6 +37,56 @@ 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` @@ -67,32 +94,32 @@ impl Source { &self, block: &Block, ) -> Result> { - let block_number = block.header.number; - if let Ok(Some(receipts)) = self.get_block_receipts(block_number).await { + 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 { return Ok(receipts); } - self.get_tx_receipts(block.transactions.clone()).await + self.get_tx_receipts(&block.transactions).await } /// Returns all receipts for vector of transactions using `eth_getTransactionReceipt` pub async fn get_tx_receipts( &self, - transactions: BlockTransactions, + transactions: &Vec, ) -> Result> { let mut tasks = Vec::new(); - for tx in transactions.as_transactions().unwrap() { - let tx_hash = *tx.inner.tx_hash(); + for tx in transactions { + let tx_hash = tx.hash; let source = self.clone(); - 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())) - } + 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())) } - }); + } + }); tasks.push(task); } let mut receipts = Vec::new(); @@ -117,21 +144,31 @@ const DEFAULT_MAX_CONCURRENT_REQUESTS: u64 = 100; impl Source { /// initialize source pub async fn init(rpc_url: Option) -> Result { - 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 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 chain_id = provider - .get_chain_id() + .get_chainid() .await - .map_err(|_| CollectError::RPCError("could not get chain_id".to_string()))?; + .map_err(|_| CollectError::RPCError("could not get chain_id".to_string()))? + .as_u64(); let rate_limiter = None; let semaphore = None; - let provider = ProviderBuilder::new().on_http(parsed_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 source = Source { - provider: provider.boxed(), + provider: ProviderWrapper::RetryClientHttp(Arc::new(provider)), chain_id, inner_request_size: DEFAULT_INNER_REQUEST_SIZE, max_concurrent_chunks: Some(DEFAULT_MAX_CONCURRENT_CHUNKS), @@ -214,7 +251,7 @@ pub struct SourceLabels { #[derive(Debug)] pub struct Fetcher

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

, + pub provider: Provider

, /// semaphore for controlling concurrency pub semaphore: Option, /// rate limiter for controlling request rate @@ -228,18 +265,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(self.provider.get_logs(filter).await) + Self::map_err(source_provider!(self, 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: BlockNumberOrTag, + block: BlockNumber, trace_types: Vec, - ) -> Result> { + ) -> Result> { let _permit = self.permit_request().await; Self::map_err( - self.provider.trace_replay_block_transactions(block.into(), &trace_types).await, + source_provider!(self, trace_replay_block_transactions(block, trace_types)).await, ) } @@ -248,28 +285,24 @@ 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( - BlockNumberOrTag::Number(block as u64), - vec![TraceType::StateDiff], + block.into(), + vec![ethers::types::TraceType::StateDiff], ) .await?; // get transactions let txs = if include_transaction_hashes { - let transactions = self - .get_block(block as u64, BlockTransactionsKind::Hashes) + self.get_block(block as u64) .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())), - } + .transactions + .iter() + .map(|tx| Some(tx.0.to_vec())) + .collect() } else { vec![None; result.len()] }; @@ -281,12 +314,9 @@ 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( - BlockNumberOrTag::Number(block as u64), - vec![TraceType::VmTrace], - ) + .trace_replay_block_transactions(block.into(), vec![ethers::types::TraceType::VmTrace]) .await; Ok((Some(block), None, result?)) } @@ -296,20 +326,20 @@ impl Source { &self, tx_hash: TxHash, trace_types: Vec, - ) -> Result { + ) -> Result { let _permit = self.permit_request().await; - Self::map_err(self.provider.trace_replay_transaction(tx_hash, &trace_types).await) + Self::map_err(source_provider!(self, 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( - B256::from_slice(&transaction_hash), - vec![TraceType::StateDiff], + H256::from_slice(&transaction_hash), + vec![ethers::types::TraceType::StateDiff], ) .await; Ok((None, vec![Some(transaction_hash)], vec![result?])) @@ -319,17 +349,20 @@ 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(B256::from_slice(&transaction_hash), vec![TraceType::VmTrace]) + .trace_replay_transaction( + H256::from_slice(&transaction_hash), + vec![ethers::types::TraceType::VmTrace], + ) .await; Ok((None, Some(transaction_hash), vec![result?])) } /// Gets the transaction with transaction_hash - pub async fn get_transaction_by_hash(&self, tx_hash: TxHash) -> Result> { + pub async fn get_transaction(&self, tx_hash: TxHash) -> Result> { let _permit = self.permit_request().await; - Self::map_err(self.provider.get_transaction_by_hash(tx_hash).await) + Self::map_err(source_provider!(self, get_transaction(tx_hash)).await) } /// Gets the transaction receipt with transaction_hash @@ -338,57 +371,48 @@ impl Source { tx_hash: TxHash, ) -> Result> { let _permit = self.permit_request().await; - Self::map_err(self.provider.get_transaction_receipt(tx_hash).await) + Self::map_err(source_provider!(self, get_transaction_receipt(tx_hash)).await) } /// Gets the block at `block_num` (transaction hashes only) - pub async fn get_block( - &self, - block_num: u64, - kind: BlockTransactionsKind, - ) -> Result> { + pub async fn get_block(&self, block_num: u64) -> Result>> { let _permit = self.permit_request().await; - Self::map_err(self.provider.get_block(block_num.into(), kind).await) + Self::map_err(source_provider!(self, get_block(block_num)).await) } - /// Gets the block with `block_hash` (transaction hashes only) - pub async fn get_block_by_hash( - &self, - block_hash: B256, - kind: BlockTransactionsKind, - ) -> Result> { + /// Gets the block at `block_num` (transaction hashes only) + pub async fn get_block_by_hash(&self, block_hash: H256) -> Result>> { let _permit = self.permit_request().await; - Self::map_err(self.provider.get_block(block_hash.into(), kind).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) } /// 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(self.provider.get_block_receipts(block_num.into()).await) + Self::map_err(source_provider!(self, get_block_receipts(block_num)).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(self.provider.trace_block(block_num.into()).await) + Self::map_err(source_provider!(self, trace_block(block_num)).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; - Self::map_err(self.provider.trace_transaction(tx_hash).await) + source_provider!(self, trace_transaction(tx_hash)) + .await + .map_err(CollectError::ProviderError) } /// Deprecated @@ -398,7 +422,10 @@ impl Source { block_number: BlockNumber, ) -> Result { let _permit = self.permit_request().await; - Self::map_err(self.provider.call(&transaction).block(block_number.into()).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) } /// Returns traces for given call data @@ -407,121 +434,116 @@ impl Source { transaction: TransactionRequest, trace_type: Vec, block_number: Option, - ) -> Result { + ) -> Result { let _permit = self.permit_request().await; - 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) + source_provider!(self, trace_call(transaction, trace_type, block_number)) + .await + .map_err(CollectError::ProviderError) } /// Get nonce of address pub async fn get_transaction_count( &self, - address: Address, + address: H160, block_number: BlockNumber, - ) -> Result { + ) -> Result { let _permit = self.permit_request().await; - Self::map_err( - self.provider.get_transaction_count(address).block_id(block_number.into()).await, - ) + source_provider!(self, get_transaction_count(address, Some(block_number.into()))) + .await + .map_err(CollectError::ProviderError) } /// Get code at address - pub async fn get_balance(&self, address: Address, block_number: BlockNumber) -> Result { + pub async fn get_balance(&self, address: H160, block_number: BlockNumber) -> Result { let _permit = self.permit_request().await; - Self::map_err(self.provider.get_balance(address).block_id(block_number.into()).await) + source_provider!(self, get_balance(address, Some(block_number.into()))) + .await + .map_err(CollectError::ProviderError) } /// Get code at address - pub async fn get_code(&self, address: Address, block_number: BlockNumber) -> Result { + pub async fn get_code(&self, address: H160, block_number: BlockNumber) -> Result { let _permit = self.permit_request().await; - Self::map_err(self.provider.get_code_at(address).block_id(block_number.into()).await) + source_provider!(self, get_code(address, Some(block_number.into()))) + .await + .map_err(CollectError::ProviderError) } /// Get stored data at given location pub async fn get_storage_at( &self, - address: Address, - slot: U256, + address: H160, + slot: H256, block_number: BlockNumber, - ) -> Result { + ) -> Result { let _permit = self.permit_request().await; - Self::map_err( - self.provider.get_storage_at(address, slot).block_id(block_number.into()).await, - ) + source_provider!(self, get_storage_at(address, slot, Some(block_number.into()))) + .await + .map_err(CollectError::ProviderError) } /// Get the block number - pub async fn get_block_number(&self) -> Result { - Self::map_err(self.provider.get_block_number().await) + pub async fn get_block_number(&self) -> Result { + Self::map_err(source_provider!(self, 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_by_hash(B256::from_slice(&transaction_hash)).await?; + let block = self.get_transaction(H256::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(B256::from_slice(&transaction_hash)) + .get_transaction_receipt(H256::from_slice(&transaction_hash)) .await? .ok_or(CollectError::CollectError("transaction receipt not found".to_string()))? - .inner - .logs() - .to_vec()) + .logs) } /// Return output data of a contract call pub async fn call2( &self, - address: Address, + address: H160, call_data: Vec, block_number: BlockNumber, ) -> Result { let transaction = TransactionRequest { to: Some(address.into()), - input: TransactionInput::new(call_data.into()), + data: Some(call_data.into()), ..Default::default() }; let _permit = self.permit_request().await; - Self::map_err(self.provider.call(&transaction).block(block_number.into()).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) } /// Return output data of a contract call pub async fn trace_call2( &self, - address: Address, + address: H160, call_data: Vec, trace_type: Vec, block_number: Option, - ) -> Result { + ) -> Result { let transaction = TransactionRequest { to: Some(address.into()), - input: TransactionInput::new(call_data.into()), + data: Some(call_data.into()), ..Default::default() }; let _permit = self.permit_request().await; - 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) - } + source_provider!(self, trace_call(transaction, trace_type, block_number)) + .await + .map_err(CollectError::ProviderError) } /// get geth debug block traces @@ -530,28 +552,19 @@ 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; - Self::map_err( - self.provider - .debug_trace_block_by_number( - BlockNumberOrTag::Number(block_number.into()), - options, - ) - .await, - )? + source_provider!(self, debug_trace_block_by_number(Some(block_number.into()), options)) + .await + .map_err(CollectError::ProviderError)? }; let txs = if include_transaction_hashes { - 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(), + match self.get_block(block_number as u64).await? { + Some(block) => { + block.transactions.iter().map(|x| Some(x.as_bytes().to_vec())).collect() + } None => { return Err(CollectError::CollectError( "could not get block for txs".to_string(), @@ -580,21 +593,8 @@ impl Source { let mut calls = Vec::new(); for trace in traces.into_iter() { match trace { - 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 - ))) - } + GethTrace::Unknown(value) => calls.push(value), + _ => return Err(CollectError::CollectError("invalid trace result".to_string())), } } Ok((block, txs, calls)) @@ -613,21 +613,8 @@ impl Source { let mut calls = Vec::new(); for trace in traces.into_iter() { match trace { - 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 - ))); - } + GethTrace::Known(GethTraceFrame::Default(frame)) => calls.push(frame), + _ => return Err(CollectError::CollectError("invalid trace result".to_string())), } } Ok((block, txs, calls)) @@ -647,27 +634,11 @@ 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::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::FourByteTracer(FourByteFrame(frame))) => { + calls.push(frame) } + GethTrace::Known(GethTraceFrame::NoopTracer(_)) => {} + _ => return Err(CollectError::CollectError("invalid trace result".to_string())), } } Ok((block, txs, calls)) @@ -678,7 +649,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) = @@ -687,25 +658,10 @@ 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())), - 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 - ))); - } + GethTrace::Known(GethTraceFrame::PreStateTracer(PreStateFrame::Default( + PreStateMode(frame), + ))) => calls.push(frame), + _ => return Err(CollectError::CollectError("invalid trace result".to_string())), } } Ok((block, txs, calls)) @@ -718,37 +674,22 @@ 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::default() - .with_tracer(tracer) - .with_call_config(CallConfig::default()); + let config = GethDebugTracerConfig::BuiltInTracer( + GethDebugBuiltInTracerConfig::CallTracer(CallConfig { ..Default::default() }), + ); + let options = GethDebugTracingOptions { + tracer: Some(tracer), + tracer_config: Some(config), + ..Default::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 { - 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 - ))); - } + GethTrace::Known(GethTraceFrame::CallTracer(call_frame)) => calls.push(call_frame), + _ => return Err(CollectError::CollectError("invalid trace result".to_string())), } } Ok((block, txs, calls)) @@ -761,41 +702,30 @@ 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::default() - .with_prestate_config(PreStateConfig { - diff_mode: Some(true), - disable_code: None, - disable_storage: None, - }) - .with_tracer(tracer); + let config = GethDebugTracerConfig::BuiltInTracer( + GethDebugBuiltInTracerConfig::PreStateTracer(PreStateConfig { diff_mode: Some(true) }), + ); + let options = GethDebugTracingOptions { + tracer: Some(tracer), + tracer_config: Some(config), + ..Default::default() + }; 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 { - 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 - ))); + 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())); } } } @@ -809,20 +739,19 @@ impl Source { options: GethDebugTracingOptions, include_block_number: bool, ) -> Result<(Option, Vec>>, Vec)> { - let ethers_tx = B256::from_slice(&transaction_hash); + let ethers_tx = H256::from_slice(&transaction_hash); let trace = { let _permit = self.permit_request().await; - self.provider - .debug_trace_transaction(ethers_tx, options) + source_provider!(self, 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_by_hash(ethers_tx).await? { - Some(tx) => tx.block_number.map(|x| x as u32), + match self.get_transaction(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(), @@ -852,7 +781,7 @@ impl Source { let mut calls = Vec::new(); for trace in traces.into_iter() { match trace { - GethTrace::JS(value) => calls.push(value), + GethTrace::Unknown(value) => calls.push(value), _ => return Err(CollectError::CollectError("invalid trace result".to_string())), } } @@ -873,7 +802,7 @@ impl Source { let mut calls = Vec::new(); for trace in traces.into_iter() { match trace { - GethTrace::Default(frame) => calls.push(frame), + GethTrace::Known(GethTraceFrame::Default(frame)) => calls.push(frame), _ => return Err(CollectError::CollectError("invalid trace result".to_string())), } } @@ -895,7 +824,9 @@ impl Source { let mut calls = Vec::new(); for trace in traces.into_iter() { match trace { - GethTrace::FourByteTracer(frame) => calls.push(frame.0), + GethTrace::Known(GethTraceFrame::FourByteTracer(FourByteFrame(frame))) => { + calls.push(frame) + } _ => return Err(CollectError::CollectError("invalid trace result".to_string())), } } @@ -907,7 +838,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 @@ -917,7 +848,9 @@ impl Source { let mut calls = Vec::new(); for trace in traces.into_iter() { match trace { - GethTrace::PreStateTracer(PreStateFrame::Default(frame)) => calls.push(frame.0), + GethTrace::Known(GethTraceFrame::PreStateTracer(PreStateFrame::Default( + PreStateMode(frame), + ))) => calls.push(frame), _ => return Err(CollectError::CollectError("invalid trace result".to_string())), } } @@ -931,12 +864,14 @@ 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::default() - .with_tracer(tracer) - .with_call_config(CallConfig::default()); + let config = GethDebugTracerConfig::BuiltInTracer( + GethDebugBuiltInTracerConfig::CallTracer(CallConfig { ..Default::default() }), + ); + 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_block_number) .await?; @@ -944,9 +879,7 @@ 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::CallTracer(frame) => calls.push(frame), + GethTrace::Known(GethTraceFrame::CallTracer(call_frame)) => calls.push(call_frame), _ => return Err(CollectError::CollectError("invalid trace result".to_string())), } } @@ -960,12 +893,14 @@ 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::default().with_tracer(tracer).with_prestate_config( - PreStateConfig { diff_mode: Some(true), disable_code: None, disable_storage: None }, + let config = GethDebugTracerConfig::BuiltInTracer( + GethDebugBuiltInTracerConfig::PreStateTracer(PreStateConfig { diff_mode: Some(true) }), ); + 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?; @@ -973,10 +908,9 @@ 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::PreStateTracer(PreStateFrame::Diff(diff)) => diffs.push(diff), + GethTrace::Known(GethTraceFrame::PreStateTracer(PreStateFrame::Diff(diff))) => { + diffs.push(diff) + } _ => return Err(CollectError::CollectError("invalid trace result".to_string())), } } @@ -996,7 +930,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) } } @@ -1004,10 +938,12 @@ impl Source { use crate::err; use std::collections::BTreeMap; -fn parse_geth_diff_object(map: serde_json::Map) -> Result { - let pre: BTreeMap = serde_json::from_value(map["pre"].clone()) +fn parse_geth_diff_object( + map: ethers::utils::__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/freeze/src/types/summaries.rs b/crates/freeze/src/types/summaries.rs index f760c1d..b1180ea 100644 --- a/crates/freeze/src/types/summaries.rs +++ b/crates/freeze/src/types/summaries.rs @@ -5,8 +5,9 @@ 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, err, ChunkData, ChunkStats, CollectError, ColumnType, + Datatype, Dim, ExecutionEnv, FileOutput, MetaDatatype, MultiDatatype, Partition, Query, Source, + Table, }; use std::path::PathBuf; @@ -362,6 +363,8 @@ fn print_schemas( println!(); println!(); print_schema(datatype, &schema.clone()) + } else { + return Err(err("missing schema for datatype")) } } } diff --git a/crates/python/Cargo.toml b/crates/python/Cargo.toml index 580f49e..6b968d7 100644 --- a/crates/python/Cargo.toml +++ b/crates/python/Cargo.toml @@ -5,6 +5,7 @@ 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/python/python/cryo/__init__.py b/crates/python/python/cryo/__init__.py index ef43519..ac472a4 100644 --- a/crates/python/python/cryo/__init__.py +++ b/crates/python/python/cryo/__init__.py @@ -2,15 +2,9 @@ # ruff: noqa: F401 -from ._cryo_rust import __version__ # type: ignore +from ._cryo_rust import __version__ from ._freeze import async_freeze from ._freeze import freeze from ._collect import async_collect from ._collect import collect -__all__ = [ - 'async_collect', - 'async_freeze', - 'collect', - 'freeze', -] diff --git a/crates/python/python/cryo/_args.py b/crates/python/python/cryo/_args.py index 67f359f..01ef0e8 100644 --- a/crates/python/python/cryo/_args.py +++ b/crates/python/python/cryo/_args.py @@ -12,6 +12,7 @@ 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: """ @@ -36,7 +37,7 @@ def parse_cli_args( else: raise Exception('unknown file_format') - kwargs['no_verbose'] = not kwargs.get('verbose', True) + kwargs['no_verbose'] = not verbose return kwargs diff --git a/crates/python/python/cryo/_collect.py b/crates/python/python/cryo/_collect.py index 78c3300..55d7488 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, Literal, TypeVar + from typing import Any import pandas as pd import polars as pl @@ -11,43 +11,6 @@ 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( @@ -82,42 +45,6 @@ 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', @@ -131,14 +58,11 @@ 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 - result: T = future.result() # type: ignore + return future.result() # type: ignore except RuntimeError: - result = asyncio.run(coroutine) - - return result + return asyncio.run(coroutine) diff --git a/crates/python/python/cryo/_spec.py b/crates/python/python/cryo/_spec.py index 97c98d8..11af8ae 100644 --- a/crates/python/python/cryo/_spec.py +++ b/crates/python/python/cryo/_spec.py @@ -47,33 +47,11 @@ if typing.TYPE_CHECKING: n_row_groups: int | None no_stats: bool compression: str | 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] + contract: str | bytes | None + topic0: str | bytes | None + topic1: str | bytes | None + topic2: str | bytes | None + topic3: 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 deleted file mode 100644 index e69de29..0000000 diff --git a/crates/python/python/cryo_test/README.md b/crates/python/python/cryo_test/README.md deleted file mode 100644 index 1fce65c..0000000 --- a/crates/python/python/cryo_test/README.md +++ /dev/null @@ -1,35 +0,0 @@ - -# 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 deleted file mode 100644 index d68cdf3..0000000 --- a/crates/python/python/cryo_test/cryo_test/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -"""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 deleted file mode 100644 index 6c49d97..0000000 --- a/crates/python/python/cryo_test/cryo_test/__main__.py +++ /dev/null @@ -1,7 +0,0 @@ -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 deleted file mode 100644 index b4ffdd2..0000000 --- a/crates/python/python/cryo_test/cryo_test/cli/__init__.py +++ /dev/null @@ -1,10 +0,0 @@ -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 deleted file mode 100644 index 2d9e436..0000000 --- a/crates/python/python/cryo_test/cryo_test/cli/cli_classes.py +++ /dev/null @@ -1,97 +0,0 @@ -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 deleted file mode 100644 index 6e26d4b..0000000 --- a/crates/python/python/cryo_test/cryo_test/cli/cli_run.py +++ /dev/null @@ -1,212 +0,0 @@ -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 deleted file mode 100644 index b24a71a..0000000 --- a/crates/python/python/cryo_test/cryo_test/cli/cli_summary.py +++ /dev/null @@ -1,92 +0,0 @@ -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 deleted file mode 100644 index f863f73..0000000 --- a/crates/python/python/cryo_test/cryo_test/cli/cli_utils.py +++ /dev/null @@ -1,62 +0,0 @@ -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 deleted file mode 100644 index b21d09e..0000000 --- a/crates/python/python/cryo_test/cryo_test/commands/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index b7468c8..0000000 --- a/crates/python/python/cryo_test/cryo_test/commands/command_generation.py +++ /dev/null @@ -1,201 +0,0 @@ -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', - include_columns=['all'], - **{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', - '--include-columns all', - '--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 deleted file mode 100644 index 8404bb5..0000000 --- a/crates/python/python/cryo_test/cryo_test/commands/command_parsing.py +++ /dev/null @@ -1,57 +0,0 @@ -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 deleted file mode 100644 index 66526b8..0000000 --- a/crates/python/python/cryo_test/cryo_test/commands/command_types.py +++ /dev/null @@ -1,25 +0,0 @@ -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 deleted file mode 100644 index 5c10b1e..0000000 --- a/crates/python/python/cryo_test/cryo_test/comparison.py +++ /dev/null @@ -1,257 +0,0 @@ -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 deleted file mode 100644 index c7fb794..0000000 --- a/crates/python/python/cryo_test/cryo_test/defaults.py +++ /dev/null @@ -1,94 +0,0 @@ -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 deleted file mode 100644 index 56aadaf..0000000 --- a/crates/python/python/cryo_test/cryo_test/files/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -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 deleted file mode 100644 index 87bca0f..0000000 --- a/crates/python/python/cryo_test/cryo_test/files/file_io.py +++ /dev/null @@ -1,53 +0,0 @@ -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 deleted file mode 100644 index 6e4c70d..0000000 --- a/crates/python/python/cryo_test/cryo_test/files/file_paths.py +++ /dev/null @@ -1,146 +0,0 @@ -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 deleted file mode 100644 index 862a805..0000000 --- a/crates/python/python/cryo_test/cryo_test/polars_utils.py +++ /dev/null @@ -1,171 +0,0 @@ -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 deleted file mode 100644 index ba2aacd..0000000 --- a/crates/python/python/cryo_test/cryo_test/scripts.py +++ /dev/null @@ -1,43 +0,0 @@ -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 deleted file mode 100755 index db115c2..0000000 --- a/crates/python/python/cryo_test/examples/ethers_vs_alloy/build_cryo +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/env bash - -set -e - -# 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 main - - # build cryo - cargo install \ - --path crates/cli \ - --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" -fi - -if [ "$BUILD_ETHERS" = true ]; then - echo "building cryo ethers" - - # go to repo - cd ~/repos/cryo - - # check out build - git checkout eba6192298e40add4d35d1587511d875f6d770e4 - - # build cryo - cargo install \ - --path crates/cli \ - --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" -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 deleted file mode 100755 index 1fafd53..0000000 --- a/crates/python/python/cryo_test/examples/ethers_vs_alloy/compare_alloy_to_ethers +++ /dev/null @@ -1,10 +0,0 @@ -#!/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 deleted file mode 100644 index c4d2e48..0000000 --- a/crates/python/python/cryo_test/pyproject.toml +++ /dev/null @@ -1,70 +0,0 @@ -[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" diff --git a/crates/python/rust/collect_adapter.rs b/crates/python/rust/collect_adapter.rs index d17fa26..0f8e467 100644 --- a/crates/python/rust/collect_adapter.rs +++ b/crates/python/rust/collect_adapter.rs @@ -31,7 +31,6 @@ 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, @@ -93,7 +92,6 @@ 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, @@ -159,7 +157,6 @@ 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 f40317a..5b7616e 100644 --- a/crates/python/rust/freeze_adapter.rs +++ b/crates/python/rust/freeze_adapter.rs @@ -28,7 +28,6 @@ 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, @@ -90,7 +89,6 @@ 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, @@ -151,7 +149,6 @@ pub fn _freeze( chunk_order, max_retries, initial_backoff, - compute_units_per_second, dry, chunk_size, n_chunks, diff --git a/crates/to_df/Cargo.toml b/crates/to_df/Cargo.toml index b28efdc..19058dc 100644 --- a/crates/to_df/Cargo.toml +++ b/crates/to_df/Cargo.toml @@ -4,6 +4,7 @@ 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] diff --git a/crates/to_df/src/lib.rs b/crates/to_df/src/lib.rs index 6ab9332..97f10c2 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(); - let ty = DynSolType::parse(¶m.ty).unwrap(); - match ty { - DynSolType::Address => { + match param.kind { + ParamType::Address => { match schema.binary_type { ColumnEncoding::Binary => cols.push(Series::new(name, Vec::>::new())), ColumnEncoding::Hex => cols.push(Series::new(name, Vec::::new())), } }, - DynSolType::Bytes => { + ParamType::Bytes => { match schema.binary_type { ColumnEncoding::Binary => cols.push(Series::new(name, Vec::>::new())), ColumnEncoding::Hex => cols.push(Series::new(name, Vec::::new())), } }, - DynSolType::Int(bits) => { + ParamType::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) } }, - DynSolType::Uint(bits) => { + ParamType::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) } }, - 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")), + 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")), _ => (), } } diff --git a/examples/erc20_balances.sh b/examples/erc20_balances.sh index 70c426e..da8ba89 100755 --- a/examples/erc20_balances.sh +++ b/examples/erc20_balances.sh @@ -5,11 +5,12 @@ # ERC20 = USDC, USDT export ERC20="0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48 0xdac17f958d2ee523a2206206994597c13d831ec7" -# WALLET = Maker PSM, Arbitrum Bridge +# 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 $ERC20 --address $WALLETS \ No newline at end of file +cryo erc20_balances --blocks $BLOCKS --contract $ERC20 --address $WALLET + diff --git a/examples/uniswap.sh b/examples/uniswap.sh index 275f4d5..7c698e4 100755 --- a/examples/uniswap.sh +++ b/examples/uniswap.sh @@ -4,9 +4,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-running the script does not re-collect data - +# - interuptable: 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 cryo logs \