diff --git a/.github/workflows/unit.yml b/.github/workflows/unit.yml index 6c72f5a42e..55bddd542d 100644 --- a/.github/workflows/unit.yml +++ b/.github/workflows/unit.yml @@ -51,7 +51,7 @@ jobs: run: | cargo nextest run \ --locked --features "asm-keccak ${{ matrix.network }} opbnb" \ - --workspace --exclude examples --exclude ef-tests --exclude reth-node-ethereum \ + --workspace --exclude ef-tests --exclude reth-node-ethereum \ --partition hash:${{ matrix.partition }}/3 \ -E "!kind(test)" - if: matrix.network == 'bsc' @@ -59,8 +59,8 @@ jobs: run: | cargo nextest run \ --locked --features "asm-keccak ${{ matrix.network }}" \ - --workspace --exclude examples --exclude exex-rollup --exclude ef-tests --exclude reth-beacon-consensus \ - --exclude reth-blockchain-tree --exclude reth-node-ethereum --exclude reth-rpc-engine-api --exclude example-exex-rollup \ + --workspace --exclude examples --exclude example-exex-rollup --exclude ef-tests --exclude reth-beacon-consensus \ + --exclude reth-blockchain-tree --exclude reth-node-ethereum --exclude reth-rpc-engine-api \ --partition hash:${{ matrix.partition }}/3 \ -E "!kind(test)" diff --git a/Cargo.lock b/Cargo.lock index 627c537fa9..df0498190a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "addr2line" -version = "0.22.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" dependencies = [ "gimli", ] @@ -123,8 +123,7 @@ dependencies = [ [[package]] name = "alloy-consensus" version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a016bfa21193744d4c38b3f3ab845462284d129e5e23c7cc0fafca7e92d9db37" +source = "git+https://github.com/bnb-chain/alloy?rev=bc6c03f365a1054ae89c5c940e0edbbd963d6dd4#bc6c03f365a1054ae89c5c940e0edbbd963d6dd4" dependencies = [ "alloy-eips", "alloy-primitives", @@ -139,9 +138,9 @@ dependencies = [ [[package]] name = "alloy-dyn-abi" -version = "0.7.6" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb6e6436a9530f25010d13653e206fab4c9feddacf21a54de8d7311b275bc56b" +checksum = "8425a283510106b1a6ad25dd4bb648ecde7da3fd2baeb9400a85ad62f51ec90b" dependencies = [ "alloy-json-abi", "alloy-primitives", @@ -152,14 +151,13 @@ dependencies = [ "itoa", "serde", "serde_json", - "winnow 0.6.13", + "winnow 0.6.8", ] [[package]] name = "alloy-eips" version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32d6d8118b83b0489cfb7e6435106948add2b35217f4a5004ef895f613f60299" +source = "git+https://github.com/bnb-chain/alloy?rev=bc6c03f365a1054ae89c5c940e0edbbd963d6dd4#bc6c03f365a1054ae89c5c940e0edbbd963d6dd4" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -176,13 +174,14 @@ dependencies = [ [[package]] name = "alloy-genesis" -version = "0.1.2" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "894f33a7822abb018db56b10ab90398e63273ce1b5a33282afd186c132d764a6" +checksum = "5e10a047066076b32d52b3228e95a4f7793db7a204f648aa1a1ea675085bffd8" dependencies = [ "alloy-primitives", "alloy-serde", "serde", + "serde_json", ] [[package]] @@ -199,9 +198,21 @@ dependencies = [ [[package]] name = "alloy-json-rpc" -version = "0.1.2" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61f0ae6e93b885cc70fe8dae449e7fd629751dbee8f59767eaaa7285333c5727" +checksum = "d06d33b79246313c4103ef9596c721674a926f1ddc8b605aa2bac4d8ba94ee34" +dependencies = [ + "alloy-primitives", + "serde", + "serde_json", + "thiserror", + "tracing", +] + +[[package]] +name = "alloy-json-rpc" +version = "0.1.2" +source = "git+https://github.com/bnb-chain/alloy?rev=bc6c03f365a1054ae89c5c940e0edbbd963d6dd4#bc6c03f365a1054ae89c5c940e0edbbd963d6dd4" dependencies = [ "alloy-primitives", "serde", @@ -213,12 +224,11 @@ dependencies = [ [[package]] name = "alloy-network" version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc122cbee2b8523854cc11d87bcd5773741602c553d2d2d106d82eeb9c16924a" +source = "git+https://github.com/bnb-chain/alloy?rev=bc6c03f365a1054ae89c5c940e0edbbd963d6dd4#bc6c03f365a1054ae89c5c940e0edbbd963d6dd4" dependencies = [ "alloy-consensus", "alloy-eips", - "alloy-json-rpc", + "alloy-json-rpc 0.1.2", "alloy-primitives", "alloy-rpc-types-eth", "alloy-serde", @@ -232,9 +242,9 @@ dependencies = [ [[package]] name = "alloy-node-bindings" -version = "0.1.2" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df0e005ecc1b41f0b3bf90f68df5a446971e7eb34e1ea051da401e7e8eeef8fd" +checksum = "e4890cdebc750890b1cd3b5a61f72df992e262c5bfb5423b2999f0d81449f04e" dependencies = [ "alloy-genesis", "alloy-primitives", @@ -275,14 +285,14 @@ dependencies = [ [[package]] name = "alloy-provider" -version = "0.1.2" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d5af289798fe8783acd0c5f10644d9d26f54a12bc52a083e4f3b31718e9bf92" +checksum = "200b786259a17acf318b9c423afe9669bec24ce9cdf59de153ff9a4009914bb6" dependencies = [ "alloy-chains", "alloy-consensus", "alloy-eips", - "alloy-json-rpc", + "alloy-json-rpc 0.1.1", "alloy-network", "alloy-primitives", "alloy-pubsub", @@ -301,7 +311,7 @@ dependencies = [ "futures-utils-wasm", "lru", "pin-project", - "reqwest 0.12.5", + "reqwest 0.12.4", "serde", "serde_json", "tokio", @@ -311,11 +321,11 @@ dependencies = [ [[package]] name = "alloy-pubsub" -version = "0.1.2" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "702f330b7da123a71465ab9d39616292f8344a2811c28f2cc8d8438a69d79e35" +checksum = "47e6e6c1eab938a18a8e88d430cc9d548edf54c850a550873888285c85428eca" dependencies = [ - "alloy-json-rpc", + "alloy-json-rpc 0.1.1", "alloy-primitives", "alloy-transport", "bimap", @@ -330,9 +340,9 @@ dependencies = [ [[package]] name = "alloy-rlp" -version = "0.3.5" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b155716bab55763c95ba212806cf43d05bcc70e5f35b02bad20cf5ec7fe11fed" +checksum = "8d58d9f5da7b40e9bfff0b7e7816700be4019db97d4b6359fe7f94a9e22e42ac" dependencies = [ "alloy-rlp-derive", "arrayvec", @@ -341,22 +351,22 @@ dependencies = [ [[package]] name = "alloy-rlp-derive" -version = "0.3.5" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8037e03c7f462a063f28daec9fda285a9a89da003c552f8637a80b9c8fd96241" +checksum = "1a047897373be4bbb0224c1afdabca92648dc57a9c9ef6e7b0be3aff7a859c83" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.65", ] [[package]] name = "alloy-rpc-client" -version = "0.1.2" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b40fcb53b2a9d0a78a4968b2eca8805a4b7011b9ee3fdfa2acaf137c5128f36b" +checksum = "328a6a14aba6152ddf6d01bac5e17a70dbe9d6f343bf402b995c30bac63a1fbf" dependencies = [ - "alloy-json-rpc", + "alloy-json-rpc 0.1.1", "alloy-primitives", "alloy-pubsub", "alloy-transport", @@ -364,7 +374,7 @@ dependencies = [ "alloy-transport-ws", "futures", "pin-project", - "reqwest 0.12.5", + "reqwest 0.12.4", "serde", "serde_json", "tokio", @@ -376,9 +386,9 @@ dependencies = [ [[package]] name = "alloy-rpc-types" -version = "0.1.2" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50f2fbe956a3e0f0975c798f488dc6be96b669544df3737e18f4a325b42f4c86" +checksum = "3164e7d8a718a22ede70b2c1d2bb554a8b4bd8e56c07ab630b75c74c06c53752" dependencies = [ "alloy-rpc-types-engine", "alloy-rpc-types-eth", @@ -388,9 +398,9 @@ dependencies = [ [[package]] name = "alloy-rpc-types-admin" -version = "0.1.2" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "334a8c00cde17a48e073031f1534e71a75b529dbf25552178c43c2337632e0ab" +checksum = "b61b27c1a30ee71c751fe8a1b926d897e6795527bba2832f458acd432408df20" dependencies = [ "alloy-genesis", "alloy-primitives", @@ -400,9 +410,9 @@ dependencies = [ [[package]] name = "alloy-rpc-types-anvil" -version = "0.1.2" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d87f724e6170f558b809a520e37bdb34d99123092b78118bff31fb5b21dc2a2e" +checksum = "a21cdf2617cfb0ae95ef462a0144abfef5ff56d25b56915d7a08f8a5a7b92926" dependencies = [ "alloy-primitives", "alloy-serde", @@ -411,9 +421,9 @@ dependencies = [ [[package]] name = "alloy-rpc-types-beacon" -version = "0.1.2" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb383cd3981cee0031aeacbd394c4e726e907f3a0180fe36d5fc76d37c41cd82" +checksum = "36a3c7fd58772e4eadec5f08153573aa0ce8d998bd03f239ca74cd2927022d4c" dependencies = [ "alloy-eips", "alloy-primitives", @@ -445,8 +455,7 @@ dependencies = [ [[package]] name = "alloy-rpc-types-eth" version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "083f443a83b9313373817236a8f4bea09cca862618e9177d822aee579640a5d6" +source = "git+https://github.com/bnb-chain/alloy?rev=bc6c03f365a1054ae89c5c940e0edbbd963d6dd4#bc6c03f365a1054ae89c5c940e0edbbd963d6dd4" dependencies = [ "alloy-consensus", "alloy-eips", @@ -466,23 +475,22 @@ dependencies = [ [[package]] name = "alloy-rpc-types-trace" -version = "0.1.2" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c7a838f9a34aae7022c6cb53ecf21bc0a5a30c82f8d9eb0afed701ab5fd88de" +checksum = "a39c52613dc4d9995ff284b496158594ae63f9bfc58b5ef04e48ec5da2e3d747" dependencies = [ "alloy-primitives", "alloy-rpc-types-eth", "alloy-serde", "serde", "serde_json", - "thiserror", ] [[package]] name = "alloy-rpc-types-txpool" -version = "0.1.2" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1572267dbc660843d87c02994029d1654c2c32867e186b266d1c03644b43af97" +checksum = "4aeb7995e8859f3931b6199e13a533c9fde89affa900addb7218db2f15f9687d" dependencies = [ "alloy-primitives", "alloy-rpc-types-eth", @@ -493,8 +501,7 @@ dependencies = [ [[package]] name = "alloy-serde" version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d94da1c0c4e27cc344b05626fe22a89dc6b8b531b9475f3b7691dbf6913e4109" +source = "git+https://github.com/bnb-chain/alloy?rev=bc6c03f365a1054ae89c5c940e0edbbd963d6dd4#bc6c03f365a1054ae89c5c940e0edbbd963d6dd4" dependencies = [ "alloy-primitives", "arbitrary", @@ -507,8 +514,7 @@ dependencies = [ [[package]] name = "alloy-signer" version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58d876be3afd8b78979540084ff63995292a26aa527ad0d44276405780aa0ffd" +source = "git+https://github.com/bnb-chain/alloy?rev=bc6c03f365a1054ae89c5c940e0edbbd963d6dd4#bc6c03f365a1054ae89c5c940e0edbbd963d6dd4" dependencies = [ "alloy-primitives", "async-trait", @@ -521,8 +527,7 @@ dependencies = [ [[package]] name = "alloy-signer-local" version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d40a37dc216c269b8a7244047cb1c18a9c69f7a0332ab2c4c2aa4cbb1a31468b" +source = "git+https://github.com/bnb-chain/alloy?rev=bc6c03f365a1054ae89c5c940e0edbbd963d6dd4#bc6c03f365a1054ae89c5c940e0edbbd963d6dd4" dependencies = [ "alloy-consensus", "alloy-network", @@ -547,7 +552,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.65", ] [[package]] @@ -564,7 +569,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.65", "syn-solidity", "tiny-keccak", ] @@ -582,7 +587,7 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.68", + "syn 2.0.65", "syn-solidity", ] @@ -592,7 +597,7 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baa2fbd22d353d8685bd9fee11ba2d8b5c3b1d11e56adb3265fcf1f32bfdf404" dependencies = [ - "winnow 0.6.13", + "winnow 0.6.8", ] [[package]] @@ -610,11 +615,11 @@ dependencies = [ [[package]] name = "alloy-transport" -version = "0.1.2" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "245af9541f0a0dbd5258669c80dfe3af118164cacec978a520041fc130550deb" +checksum = "b3628d81530263fe837a09cd527022f5728202a669973f04270942f4d390b5f5" dependencies = [ - "alloy-json-rpc", + "alloy-json-rpc 0.1.1", "base64 0.22.1", "futures-util", "futures-utils-wasm", @@ -628,13 +633,13 @@ dependencies = [ [[package]] name = "alloy-transport-http" -version = "0.1.2" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5619c017e1fdaa1db87f9182f4f0ed97c53d674957f4902fba655e972d359c6c" +checksum = "2f35d34e7a51503c9ff267404a5850bd58f991b7ab524b892f364901e3576376" dependencies = [ - "alloy-json-rpc", + "alloy-json-rpc 0.1.1", "alloy-transport", - "reqwest 0.12.5", + "reqwest 0.12.4", "serde_json", "tower", "tracing", @@ -643,11 +648,11 @@ dependencies = [ [[package]] name = "alloy-transport-ipc" -version = "0.1.2" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "173cefa110afac7a53cf2e75519327761f2344d305eea2993f3af1b2c1fc1c44" +checksum = "a7d2f106151a583f7d258fe8cc846c5196da90a9f502d4b3516c56d63e1f25a2" dependencies = [ - "alloy-json-rpc", + "alloy-json-rpc 0.1.1", "alloy-pubsub", "alloy-transport", "bytes 1.6.0", @@ -662,9 +667,9 @@ dependencies = [ [[package]] name = "alloy-transport-ws" -version = "0.1.2" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c0aff8af5be5e58856c5cdd1e46db2c67c7ecd3a652d9100b4822c96c899947" +checksum = "20a80da44d3709c4ceaf47745ad820eae8f121404b9ffd8e285522ac4eb06681" dependencies = [ "alloy-pubsub", "alloy-transport", @@ -760,9 +765,9 @@ dependencies = [ [[package]] name = "anstyle-query" -version = "1.1.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad186efb764318d35165f1758e7dcef3b10628e26d41a44bc5550652e6804391" +checksum = "a64c907d4e79225ac72e2a354c9ce84d50ebb4586dee56c82b3ee73004f537f5" dependencies = [ "windows-sys 0.52.0", ] @@ -794,7 +799,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.65", ] [[package]] @@ -1021,9 +1026,9 @@ dependencies = [ [[package]] name = "async-compression" -version = "0.4.11" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd066d0b4ef8ecb03a55319dc13aa6910616d0f44008a045bb1835af830abff5" +checksum = "9c90a406b4495d129f00461241616194cb8a032c8d1c53c657f0961d5f8e0498" dependencies = [ "brotli", "flate2", @@ -1068,7 +1073,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.65", ] [[package]] @@ -1079,7 +1084,7 @@ checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.65", ] [[package]] @@ -1117,7 +1122,7 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.65", ] [[package]] @@ -1140,9 +1145,9 @@ dependencies = [ [[package]] name = "backtrace" -version = "0.3.73" +version = "0.3.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" +checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" dependencies = [ "addr2line", "cc", @@ -1238,7 +1243,7 @@ dependencies = [ "regex", "rustc-hash 1.1.0", "shlex", - "syn 2.0.68", + "syn 2.0.65", "which", ] @@ -1281,9 +1286,9 @@ dependencies = [ [[package]] name = "bitm" -version = "0.4.2" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b06e8e5bec3490b9f6f3adbb78aa4f53e8396fd9994e8a62a346b44ea7c15f35" +checksum = "31b9ea263f0faf826a1c9de0e8bf8f32f5986c05f5e3abcf6bcde74616009586" dependencies = [ "dyn_size_of", ] @@ -1490,7 +1495,7 @@ checksum = "6be9c93793b60dac381af475b98634d4b451e28336e72218cad9a20176218dbc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.65", "synstructure 0.13.1", ] @@ -1541,9 +1546,9 @@ dependencies = [ [[package]] name = "brotli-decompressor" -version = "4.0.1" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a45bd2e4095a8b518033b128020dd4a55aab1c0a381ba4404a472630f4bc362" +checksum = "e6221fe77a248b9117d431ad93761222e1cf8ff282d9d1d5d9f53d6299a1cf76" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -1590,22 +1595,22 @@ checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" [[package]] name = "bytemuck" -version = "1.16.1" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b236fc92302c97ed75b38da1f4917b5cdda4984745740f153a5d3059e48d725e" +checksum = "78834c15cb5d5efe3452d58b1e8ba890dd62d21907f867f383358198e56ebca5" dependencies = [ "bytemuck_derive", ] [[package]] name = "bytemuck_derive" -version = "1.7.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee891b04274a59bd38b412188e24b849617b2e45a0fd8d057deb63e7403761b" +checksum = "4da9a32f3fed317401fa3c862968128267c3106685286e15d5aaa3d7389c2f60" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.65", ] [[package]] @@ -1698,9 +1703,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.100" +version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c891175c3fb232128f48de6590095e59198bbeb8620c310be349bfc3afd12c7b" +checksum = "41c270e7540d725e65ac7f1b212ac8ce349719624d7bcff99f8e2e488e8cf03f" dependencies = [ "jobserver", "libc", @@ -1791,9 +1796,9 @@ dependencies = [ [[package]] name = "clang-sys" -version = "1.8.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +checksum = "67523a3b4be3ce1989d607a828d036249522dd9c1c8de7f4dd2dae43a37369d1" dependencies = [ "glob", "libc", @@ -1802,9 +1807,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.7" +version = "4.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5db83dced34638ad474f39f250d7fea9598bdd239eaced1bdf45d597da0f433f" +checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0" dependencies = [ "clap_builder", "clap_derive", @@ -1812,9 +1817,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.7" +version = "4.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7e204572485eb3fbf28f871612191521df159bc3e15a9f5064c66dba3a8c05f" +checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" dependencies = [ "anstream", "anstyle", @@ -1824,21 +1829,21 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.5" +version = "4.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c780290ccf4fb26629baa7a1081e68ced113f1d3ec302fa5948f1c381ebf06c6" +checksum = "528131438037fd55894f62d6e9f068b8f45ac57ffa77517819645d10aed04f64" dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.65", ] [[package]] name = "clap_lex" -version = "0.7.1" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b82cf0babdbd58558212896d1a4272303a57bdb245c2bf1147185fb45640e70" +checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" [[package]] name = "coins-bip32" @@ -1944,7 +1949,7 @@ dependencies = [ "flex-error", "serde", "serde_json", - "toml 0.8.14", + "toml 0.8.13", "url", ] @@ -2085,7 +2090,7 @@ dependencies = [ "directories", "serde", "thiserror", - "toml 0.8.14", + "toml 0.8.13", ] [[package]] @@ -2446,15 +2451,16 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "4.1.3" +version = "4.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" +checksum = "0a677b8922c94e01bdbb12126b0bc852f00447528dee1782229af9c720c3f348" dependencies = [ "cfg-if", "cpufeatures", "curve25519-dalek-derive", "digest 0.10.7", "fiat-crypto", + "platforms", "rustc_version 0.4.0", "subtle", "zeroize", @@ -2468,7 +2474,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.65", ] [[package]] @@ -2505,7 +2511,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.68", + "syn 2.0.65", ] [[package]] @@ -2516,7 +2522,7 @@ checksum = "733cabb43482b1a1b53eee8583c2b9e8684d592215ea83efd305dd31bc2f0178" dependencies = [ "darling_core", "quote", - "syn 2.0.68", + "syn 2.0.65", ] [[package]] @@ -2631,20 +2637,20 @@ checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.65", ] [[package]] name = "derive_more" -version = "0.99.18" +version = "0.99.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" +checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" dependencies = [ "convert_case 0.4.0", "proc-macro2", "quote", "rustc_version 0.4.0", - "syn 2.0.68", + "syn 1.0.109", ] [[package]] @@ -2761,13 +2767,13 @@ dependencies = [ [[package]] name = "displaydoc" -version = "0.2.5" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.65", ] [[package]] @@ -2879,7 +2885,7 @@ version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4a3daa8e81a3963a60642bcc1f90a670680bd4a77535faa384e9d1c79d620871" dependencies = [ - "curve25519-dalek 4.1.3", + "curve25519-dalek 4.1.2", "ed25519 2.2.3", "rand_core 0.6.4", "serde", @@ -3000,7 +3006,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.65", ] [[package]] @@ -3011,7 +3017,7 @@ checksum = "6fd000fd6988e73bbe993ea3db9b1aa64906ab88766d654973924340c8cddb42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.65", ] [[package]] @@ -3059,9 +3065,9 @@ dependencies = [ [[package]] name = "ethereum_ssz" -version = "0.5.4" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d3627f83d8b87b432a5fad9934b4565260722a141a2c40f371f8080adec9425" +checksum = "e61ffea29f26e8249d35128a82ec8d3bd4fbc80179ea5f5e5e3daafef6a80fcb" dependencies = [ "ethereum-types", "itertools 0.10.5", @@ -3082,7 +3088,7 @@ dependencies = [ "clap", "eyre", "futures-util", - "reqwest 0.12.5", + "reqwest 0.12.4", "reth", "reth-node-ethereum", "serde", @@ -3616,7 +3622,7 @@ dependencies = [ "alloy-rpc-types-eth", "alloy-serde", "chrono", - "reqwest 0.12.5", + "reqwest 0.12.4", "serde", ] @@ -3710,7 +3716,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.65", ] [[package]] @@ -3815,9 +3821,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.29.0" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] name = "glob" @@ -4160,12 +4166,12 @@ dependencies = [ [[package]] name = "http-body-util" -version = "0.1.2" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" +checksum = "0475f8b2ac86659c21b64320d5d653f9efe42acd2a4e560073ec61a155a34f1d" dependencies = [ "bytes 1.6.0", - "futures-util", + "futures-core", "http 1.1.0", "http-body 1.0.0", "pin-project-lite", @@ -4199,9 +4205,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.9.4" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" [[package]] name = "httpdate" @@ -4233,9 +4239,9 @@ dependencies = [ [[package]] name = "hyper" -version = "0.14.29" +version = "0.14.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f361cde2f109281a220d4307746cdfd5ee3f410da58a70377762396775634b33" +checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" dependencies = [ "bytes 1.6.0", "futures-channel", @@ -4284,12 +4290,29 @@ checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", "http 0.2.12", - "hyper 0.14.29", + "hyper 0.14.28", "rustls 0.21.12", "tokio", "tokio-rustls 0.24.1", ] +[[package]] +name = "hyper-rustls" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0bea761b46ae2b24eb4aef630d8d1c398157b6fc29e6350ecf090a0b70c952c" +dependencies = [ + "futures-util", + "http 1.1.0", + "hyper 1.3.1", + "hyper-util", + "rustls 0.22.4", + "rustls-pki-types", + "tokio", + "tokio-rustls 0.25.0", + "tower-service", +] + [[package]] name = "hyper-rustls" version = "0.27.2" @@ -4302,19 +4325,17 @@ dependencies = [ "hyper-util", "log", "rustls 0.23.10", - "rustls-native-certs 0.7.0", "rustls-pki-types", "tokio", "tokio-rustls 0.26.0", "tower-service", - "webpki-roots", ] [[package]] name = "hyper-util" -version = "0.1.5" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b875924a60b96e5d7b9ae7b066540b1dd1cbd90d1828f54c92e02a283351c56" +checksum = "ca38ef113da30126bbff9cd1705f9273e15d45498615d138b0c20279ac7a76aa" dependencies = [ "bytes 1.6.0", "futures-channel", @@ -4353,7 +4374,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.65", ] [[package]] @@ -4450,9 +4471,9 @@ checksum = "545c6c3e8bf9580e2dafee8de6f9ec14826aaf359787789c7724f1f85f47d3dc" [[package]] name = "icu_normalizer" -version = "1.4.3" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accb85c5b2e76f8dade22978b3795ae1e550198c6cfc7e915144e17cd6e2ab56" +checksum = "c183e31ed700f1ecd6b032d104c52fe8b15d028956b73727c97ec176b170e187" dependencies = [ "displaydoc", "icu_collections", @@ -4468,15 +4489,15 @@ dependencies = [ [[package]] name = "icu_normalizer_data" -version = "1.4.1" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3744fecc0df9ce19999cdaf1f9f3a48c253431ce1d67ef499128fe9d0b607ab" +checksum = "22026918a80e6a9a330cb01b60f950e2b4e5284c59528fd0c6150076ef4c8522" [[package]] name = "icu_properties" -version = "1.4.2" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8173ba888885d250016e957b8ebfd5a65cdb690123d8833a19f6833f9c2b579" +checksum = "976e296217453af983efa25f287a4c1da04b9a63bf1ed63719455068e4453eb5" dependencies = [ "displaydoc", "icu_collections", @@ -4489,9 +4510,9 @@ dependencies = [ [[package]] name = "icu_properties_data" -version = "1.4.1" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e70a8b51ee5dd4ff8f20ee9b1dd1bc07afc110886a3747b1fec04cc6e5a15815" +checksum = "f6a86c0e384532b06b6c104814f9c1b13bcd5b64409001c0d05713a1f3529d99" [[package]] name = "icu_provider" @@ -4518,7 +4539,7 @@ checksum = "d2abdd3a62551e8337af119c5899e600ca0c88ec8f23a46c60ba216c803dcf1a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.65", ] [[package]] @@ -4940,7 +4961,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.65", ] [[package]] @@ -5070,11 +5091,11 @@ dependencies = [ [[package]] name = "lazy_static" -version = "1.5.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" dependencies = [ - "spin", + "spin 0.5.2", ] [[package]] @@ -5091,9 +5112,9 @@ checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" [[package]] name = "libloading" -version = "0.8.4" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e310b3a6b5907f99202fcdb4960ff45b93735d7c7d96b760fcff8db2dc0e103d" +checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" dependencies = [ "cfg-if", "windows-targets 0.52.5", @@ -5182,9 +5203,9 @@ dependencies = [ [[package]] name = "libp2p-identity" -version = "0.2.9" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55cca1eb2bc1fd29f099f3daaab7effd01e1a54b7c577d0ed082521034d912e8" +checksum = "999ec70441b2fb35355076726a6bc466c932e9bdc66f6a11c6c0aa17c7ab9be0" dependencies = [ "asn1_der", "bs58", @@ -5325,9 +5346,9 @@ checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "litemap" -version = "0.7.3" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" +checksum = "f9d642685b028806386b2b6e75685faadd3eb65a85fff7df711ce18446a422da" [[package]] name = "lock_api" @@ -5395,9 +5416,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.7.4" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" [[package]] name = "memmap2" @@ -5487,7 +5508,7 @@ dependencies = [ "futures-util", "http-types", "pin-project-lite", - "reqwest 0.12.5", + "reqwest 0.12.4", "serde", "serde_json", "thiserror", @@ -5519,9 +5540,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.4" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" +checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" dependencies = [ "adler", ] @@ -5562,7 +5583,7 @@ dependencies = [ "cfg-if", "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.65", ] [[package]] @@ -5754,7 +5775,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.65", ] [[package]] @@ -5836,7 +5857,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.65", ] [[package]] @@ -5864,9 +5885,9 @@ dependencies = [ [[package]] name = "object" -version = "0.36.0" +version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "576dfe1fc8f9df304abb159d767a29d0476f7750fbf8aa7ad07816004a207434" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ "memchr", ] @@ -6026,7 +6047,7 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.2", + "redox_syscall 0.5.1", "smallvec", "windows-targets 0.52.5", ] @@ -6154,7 +6175,7 @@ dependencies = [ "phf_shared", "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.65", ] [[package]] @@ -6183,7 +6204,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.65", ] [[package]] @@ -6232,6 +6253,12 @@ dependencies = [ "crunchy", ] +[[package]] +name = "platforms" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db23d408679286588f4d4644f965003d056e3dd5abcaaa938116871d7ce2fee7" + [[package]] name = "plotters" version = "0.3.6" @@ -6351,7 +6378,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" dependencies = [ "proc-macro2", - "syn 2.0.68", + "syn 2.0.65", ] [[package]] @@ -6411,9 +6438,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "0b33eb56c327dec362a9e55b3ad14f9d2f0904fb5a5b03b513ab5465399e9f43" dependencies = [ "unicode-ident", ] @@ -6446,9 +6473,9 @@ dependencies = [ [[package]] name = "proptest" -version = "1.5.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4c2511913b88df1637da85cc8d96ec8e43a3f8bb8ccb71ee1ac240d6f3df58d" +checksum = "31b476131c3c86cb68032fdc5cb6d5a1045e3e42d96b69fa599fd77701e1f5bf" dependencies = [ "bit-set", "bit-vec", @@ -6458,7 +6485,7 @@ dependencies = [ "rand 0.8.5", "rand_chacha 0.3.1", "rand_xorshift", - "regex-syntax 0.8.4", + "regex-syntax 0.8.3", "rusty-fork", "tempfile", "unarray", @@ -6552,7 +6579,7 @@ dependencies = [ "itertools 0.12.1", "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.65", ] [[package]] @@ -6613,53 +6640,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "quinn" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4ceeeeabace7857413798eb1ffa1e9c905a9946a57d81fb69b4b71c4d8eb3ad" -dependencies = [ - "bytes 1.6.0", - "pin-project-lite", - "quinn-proto", - "quinn-udp", - "rustc-hash 1.1.0", - "rustls 0.23.10", - "thiserror", - "tokio", - "tracing", -] - -[[package]] -name = "quinn-proto" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddf517c03a109db8100448a4be38d498df8a210a99fe0e1b9eaf39e78c640efe" -dependencies = [ - "bytes 1.6.0", - "rand 0.8.5", - "ring", - "rustc-hash 1.1.0", - "rustls 0.23.10", - "slab", - "thiserror", - "tinyvec", - "tracing", -] - -[[package]] -name = "quinn-udp" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9096629c45860fc7fb143e125eb826b5e721e10be3263160c7d60ca832cf8c46" -dependencies = [ - "libc", - "once_cell", - "socket2 0.5.7", - "tracing", - "windows-sys 0.52.0", -] - [[package]] name = "quote" version = "1.0.36" @@ -6837,9 +6817,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.2" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd" +checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" dependencies = [ "bitflags 2.5.0", ] @@ -6857,14 +6837,14 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.5" +version = "1.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" +checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.7", - "regex-syntax 0.8.4", + "regex-automata 0.4.6", + "regex-syntax 0.8.3", ] [[package]] @@ -6878,13 +6858,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.7" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" +checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.4", + "regex-syntax 0.8.3", ] [[package]] @@ -6895,9 +6875,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.8.4" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" +checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" [[package]] name = "regress" @@ -6923,7 +6903,7 @@ dependencies = [ "h2 0.3.26", "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.29", + "hyper 0.14.28", "hyper-rustls 0.24.2", "ipnet", "js-sys", @@ -6938,7 +6918,7 @@ dependencies = [ "serde", "serde_json", "serde_urlencoded", - "sync_wrapper 0.1.2", + "sync_wrapper", "system-configuration", "tokio", "tokio-rustls 0.24.1", @@ -6952,9 +6932,9 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.12.5" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7d6d2a27d57148378eb5e111173f4276ad26340ecc5c49a4a2152167a2d6a37" +checksum = "566cafdd92868e0939d3fb961bd0dc25fcfaaed179291093b3d43e6b3150ea10" dependencies = [ "base64 0.22.1", "bytes 1.6.0", @@ -6964,7 +6944,7 @@ dependencies = [ "http-body 1.0.0", "http-body-util", "hyper 1.3.1", - "hyper-rustls 0.27.2", + "hyper-rustls 0.26.0", "hyper-util", "ipnet", "js-sys", @@ -6973,17 +6953,16 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "quinn", - "rustls 0.23.10", + "rustls 0.22.4", "rustls-native-certs 0.7.0", "rustls-pemfile 2.1.2", "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", - "sync_wrapper 1.0.1", + "sync_wrapper", "tokio", - "tokio-rustls 0.26.0", + "tokio-rustls 0.25.0", "tokio-util", "tower-service", "url", @@ -7092,7 +7071,7 @@ dependencies = [ "tempfile", "tikv-jemallocator", "tokio", - "toml 0.8.14", + "toml 0.8.13", "tracing", ] @@ -7201,7 +7180,7 @@ version = "1.0.0" dependencies = [ "alloy-consensus", "alloy-eips", - "alloy-json-rpc", + "alloy-json-rpc 0.1.1", "alloy-provider", "alloy-pubsub", "alloy-rpc-client", @@ -7216,7 +7195,7 @@ dependencies = [ "eyre", "futures", "libc", - "reqwest 0.12.5", + "reqwest 0.12.4", "reth-cli-runner", "reth-db", "reth-node-api", @@ -7380,7 +7359,7 @@ dependencies = [ "proc-macro2", "quote", "similar-asserts", - "syn 2.0.68", + "syn 2.0.65", ] [[package]] @@ -7394,7 +7373,7 @@ dependencies = [ "reth-prune-types", "serde", "tempfile", - "toml 0.8.14", + "toml 0.8.13", ] [[package]] @@ -7428,7 +7407,7 @@ dependencies = [ "auto_impl", "eyre", "futures", - "reqwest 0.12.5", + "reqwest 0.12.4", "reth-node-api", "reth-node-core", "reth-rpc-api", @@ -8099,7 +8078,7 @@ dependencies = [ "quote", "regex", "serial_test", - "syn 2.0.68", + "syn 2.0.65", "trybuild", ] @@ -8115,7 +8094,7 @@ name = "reth-net-nat" version = "1.0.0" dependencies = [ "futures-util", - "reqwest 0.12.5", + "reqwest 0.12.4", "reth-tracing", "serde_with", "thiserror", @@ -8472,7 +8451,7 @@ dependencies = [ "eyre", "jsonrpsee", "parking_lot 0.12.3", - "reqwest 0.12.5", + "reqwest 0.12.4", "reth", "reth-auto-seal-consensus", "reth-basic-payload-builder", @@ -8635,7 +8614,7 @@ dependencies = [ "test-fuzz", "thiserror", "thiserror-no-std", - "toml 0.8.14", + "toml 0.8.13", "triehash", "zstd", ] @@ -8756,7 +8735,7 @@ dependencies = [ "serde_json", "test-fuzz", "thiserror", - "toml 0.8.14", + "toml 0.8.13", ] [[package]] @@ -8950,7 +8929,7 @@ dependencies = [ "jsonrpsee", "jsonrpsee-http-client", "pin-project", - "reqwest 0.12.5", + "reqwest 0.12.4", "tempfile", "tokio", "tower", @@ -9301,7 +9280,7 @@ dependencies = [ "serde", "serde_json", "test-fuzz", - "toml 0.8.14", + "toml 0.8.13", ] [[package]] @@ -9448,7 +9427,7 @@ dependencies = [ "cfg-if", "getrandom 0.2.15", "libc", - "spin", + "spin 0.9.8", "untrusted", "windows-sys 0.52.0", ] @@ -9511,9 +9490,9 @@ dependencies = [ [[package]] name = "roaring" -version = "0.10.5" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7699249cc2c7d71939f30868f47e9d7add0bdc030d90ee10bfd16887ff8bb1c8" +checksum = "b26f4c25a604fcb3a1bcd96dd6ba37c93840de95de8198d94c0d571a74a804d1" dependencies = [ "bytemuck", "byteorder", @@ -9646,6 +9625,20 @@ dependencies = [ "sct", ] +[[package]] +name = "rustls" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf4ef73721ac7bcd79b2b315da7779d8fc09718c6b3d2d1b2d94850eb8c18432" +dependencies = [ + "log", + "ring", + "rustls-pki-types", + "rustls-webpki 0.102.4", + "subtle", + "zeroize", +] + [[package]] name = "rustls" version = "0.23.10" @@ -9993,7 +9986,7 @@ checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.65", ] [[package]] @@ -10027,7 +10020,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.65", ] [[package]] @@ -10078,7 +10071,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.65", ] [[package]] @@ -10103,7 +10096,7 @@ checksum = "82fe9db325bcef1fbcde82e078a5cc4efdf787e96b3b9cf45b50b529f2083d67" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.65", ] [[package]] @@ -10365,6 +10358,12 @@ dependencies = [ "sha1", ] +[[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" @@ -10394,7 +10393,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2ff9eaf853dec4c8802325d8b6d3dffa86cc707fd7a1a4cdbf416e13b061787a" dependencies = [ "quote", - "syn 2.0.68", + "syn 2.0.65", ] [[package]] @@ -10440,7 +10439,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.68", + "syn 2.0.65", ] [[package]] @@ -10458,9 +10457,9 @@ dependencies = [ [[package]] name = "subtle" -version = "2.6.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d0208408ba0c3df17ed26eb06992cb1a1268d41b2c0e12e65203fbe3972cee5" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" [[package]] name = "subtle-encoding" @@ -10489,9 +10488,9 @@ dependencies = [ [[package]] name = "symbolic-common" -version = "12.9.2" +version = "12.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71297dc3e250f7dbdf8adb99e235da783d690f5819fdeb4cce39d9cfb0aca9f1" +checksum = "1cccfffbc6bb3bb2d3a26cd2077f4d055f6808d266f9d4d158797a4c60510dfe" dependencies = [ "debugid", "memmap2", @@ -10501,9 +10500,9 @@ dependencies = [ [[package]] name = "symbolic-demangle" -version = "12.9.2" +version = "12.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "424fa2c9bf2c862891b9cfd354a752751a6730fd838a4691e7f6c2c7957b9daf" +checksum = "76a99812da4020a67e76c4eb41f08c87364c14170495ff780f30dd519c221a68" dependencies = [ "cpp_demangle", "rustc-demangle", @@ -10523,9 +10522,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.68" +version = "2.0.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "901fa70d88b9d6c98022e23b4136f9f3e54e4662c3bc1bd1d84a42a9a0f0c1e9" +checksum = "d2863d96a84c6439701d7a38f9de935ec562c8832cc55d1dde0f513b52fad106" dependencies = [ "proc-macro2", "quote", @@ -10541,7 +10540,7 @@ dependencies = [ "paste", "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.65", ] [[package]] @@ -10550,12 +10549,6 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" -[[package]] -name = "sync_wrapper" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" - [[package]] name = "synstructure" version = "0.12.6" @@ -10576,7 +10569,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.65", ] [[package]] @@ -10741,7 +10734,7 @@ dependencies = [ "prettyplease", "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.65", ] [[package]] @@ -10780,7 +10773,7 @@ checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.65", ] [[package]] @@ -10898,9 +10891,9 @@ dependencies = [ [[package]] name = "tinystr" -version = "0.7.6" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +checksum = "83c02bf3c538ab32ba913408224323915f4ef9a6d61c0e85d493f355921c0ece" dependencies = [ "displaydoc", "zerovec", @@ -10933,9 +10926,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.38.0" +version = "1.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a" +checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" dependencies = [ "backtrace", "bytes 1.6.0", @@ -10952,13 +10945,13 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.3.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.65", ] [[package]] @@ -10971,6 +10964,17 @@ dependencies = [ "tokio", ] +[[package]] +name = "tokio-rustls" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f" +dependencies = [ + "rustls 0.22.4", + "rustls-pki-types", + "tokio", +] + [[package]] name = "tokio-rustls" version = "0.26.0" @@ -11036,14 +11040,14 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.14" +version = "0.8.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f49eb2ab21d2f26bd6db7bf383edc527a7ebaee412d17af4d40fdccd442f335" +checksum = "a4e43f8cc456c9704c851ae29c67e17ef65d2c30017c17a9765b89c382dc8bba" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.14", + "toml_edit 0.22.13", ] [[package]] @@ -11068,15 +11072,15 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.14" +version = "0.22.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f21c7aaf97f1bd9ca9d4f9e73b0a6c74bd5afef56f2bc931943a6e1c37e04e38" +checksum = "c127785850e8c20836d49732ae6abfa47616e60bf9d9f57c43c250361a9db96c" dependencies = [ "indexmap 2.2.6", "serde", "serde_spanned", "toml_datetime", - "winnow 0.6.13", + "winnow 0.6.8", ] [[package]] @@ -11175,7 +11179,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.65", ] [[package]] @@ -11336,7 +11340,7 @@ dependencies = [ "serde_derive", "serde_json", "termcolor", - "toml 0.8.14", + "toml 0.8.13", ] [[package]] @@ -11438,9 +11442,9 @@ dependencies = [ [[package]] name = "unicode-width" -version = "0.1.13" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" +checksum = "68f5e5f3158ecfd4b8ff6fe086db7c8467a2dfdac97fe420f2b7c4aa97af66d6" [[package]] name = "unicode-xid" @@ -11478,9 +11482,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.2" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" dependencies = [ "form_urlencoded", "idna 0.5.0", @@ -11508,15 +11512,15 @@ 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.9.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ea73390fe27785838dcbf75b91b1d84799e28f1ce71e6f372a5dc2200c80de5" +checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" dependencies = [ "getrandom 0.2.15", ] @@ -11626,7 +11630,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.65", "wasm-bindgen-shared", ] @@ -11660,7 +11664,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.65", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -11696,9 +11700,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.26.3" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd7c23921eeb1713a4e851530e9b9756e4fb0e89978582942612524cf09f01cd" +checksum = "b3de34ae270483955a94f4b21bdaaeb83d508bb84a01435f393818edb0012009" dependencies = [ "rustls-pki-types", ] @@ -11801,7 +11805,7 @@ checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.65", ] [[package]] @@ -11812,14 +11816,14 @@ checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.65", ] [[package]] name = "windows-result" -version = "0.1.2" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e383302e8ec8515204254685643de10811af0ed97ea37210dc26fb0032647f8" +checksum = "749f0da9cc72d82e600d8d2e44cadd0b9eedb9038f71a1c58556ac1c5791813b" dependencies = [ "windows-targets 0.52.5", ] @@ -11974,9 +11978,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.6.13" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59b5e5f6c299a3c7890b876a2a587f3115162487e704907d9b6cd29473052ba1" +checksum = "c3c52e9c97a68071b23e836c9380edae937f17b9c4667bd021973efc689f618d" dependencies = [ "memchr", ] @@ -12009,9 +12013,9 @@ checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" [[package]] name = "writeable" -version = "0.5.5" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" +checksum = "dad7bb64b8ef9c0aa27b6da38b452b0ee9fd82beaf276a87dd796fb55cbae14e" [[package]] name = "ws_stream_wasm" @@ -12058,9 +12062,9 @@ dependencies = [ [[package]] name = "yoke" -version = "0.7.4" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c5b1314b079b0930c31e3af543d8ee1757b1951ae1e1565ec704403a7240ca5" +checksum = "65e71b2e4f287f467794c671e2b8f8a5f3716b3c829079a1c44740148eff07e4" dependencies = [ "serde", "stable_deref_trait", @@ -12070,13 +12074,13 @@ dependencies = [ [[package]] name = "yoke-derive" -version = "0.7.4" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" +checksum = "9e6936f0cce458098a201c245a11bef556c6a0181129c7034d10d76d1ec3a2b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.65", "synstructure 0.13.1", ] @@ -12097,35 +12101,35 @@ checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.65", ] [[package]] name = "zerofrom" -version = "0.1.4" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ec111ce797d0e0784a1116d0ddcdbea84322cd79e5d5ad173daeba4f93ab55" +checksum = "655b0814c5c0b19ade497851070c640773304939a6c0fd5f5fb43da0696d05b7" dependencies = [ "zerofrom-derive", ] [[package]] name = "zerofrom-derive" -version = "0.1.4" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" +checksum = "e6a647510471d372f2e6c2e6b7219e44d8c574d24fdc11c610a61455782f18c3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.65", "synstructure 0.13.1", ] [[package]] name = "zeroize" -version = "1.8.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" dependencies = [ "zeroize_derive", ] @@ -12138,14 +12142,14 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.65", ] [[package]] name = "zerovec" -version = "0.10.2" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb2cc8827d6c0994478a15c53f374f46fbd41bea663d809b14744bc42e6b109c" +checksum = "eff4439ae91fb5c72b8abc12f3f2dbf51bd27e6eadb9f8a5bc8898dddb0e27ea" dependencies = [ "yoke", "zerofrom", @@ -12154,13 +12158,13 @@ dependencies = [ [[package]] name = "zerovec-derive" -version = "0.10.2" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97cf56601ee5052b4417d90c8755c6683473c926039908196cf35d99f893ebe7" +checksum = "7b4e5997cbf58990550ef1f0e5124a05e47e1ebd33a84af25739be6031a62c20" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.65", ] [[package]] @@ -12183,9 +12187,9 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "2.0.11+zstd.1.5.6" +version = "2.0.10+zstd.1.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75652c55c0b6f3e6f12eb786fe1bc960396bf05a1eb3bf1f3691c3610ac2e6d4" +checksum = "c253a4914af5bafc8fa8c86ee400827e83cf6ec01195ec1f1ed8441bf00d65aa" dependencies = [ "cc", "pkg-config", diff --git a/Cargo.toml b/Cargo.toml index a633b07fc3..2ab95e462f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -371,8 +371,8 @@ alloy-rpc-types-anvil = { version = "0.1", default-features = false } alloy-rpc-types-beacon = { version = "0.1", default-features = false } alloy-rpc-types-admin = { version = "0.1", default-features = false } alloy-rpc-types-txpool = { version = "0.1", default-features = false } -alloy-serde = { version = "0.1", default-features = false } -alloy-rpc-types-engine = { version = "0.1", default-features = false } +alloy-serde = { version = "=0.1.2", default-features = false } +alloy-rpc-types-engine = { version = "=0.1.2", default-features = false } alloy-rpc-types-eth = { version = "0.1", default-features = false } alloy-rpc-types-trace = { version = "0.1", default-features = false } alloy-genesis = { version = "0.1", default-features = false } @@ -381,9 +381,9 @@ alloy-provider = { version = "0.1", default-features = false, features = [ "reqwest", ] } alloy-eips = { version = "0.1", default-features = false } -alloy-signer = { version = "0.1", default-features = false } -alloy-signer-local = { version = "0.1", default-features = false } -alloy-network = { version = "0.1", default-features = false } +alloy-signer = { version = "=0.1.2", default-features = false } +alloy-signer-local = { version = "=0.1.2", default-features = false } +alloy-network = { version = "=0.1.2", default-features = false } alloy-consensus = { version = "0.1", default-features = false } alloy-transport = { version = "0.1" } alloy-transport-http = { version = "0.1", features = [ @@ -419,7 +419,8 @@ humantime-serde = "1.1" rand = "0.8.5" rustc-hash = "2.0" schnellru = "0.2" -strum = "0.26" +strum = "=0.26.3" +strum_macros = "=0.26.4" rayon = "1.7" itertools = "0.13" parking_lot = "0.12" @@ -511,6 +512,13 @@ revm-interpreter = { git = "https://github.com/bnb-chain/revm", rev = "dfca3edd9 revm-precompile = { git = "https://github.com/bnb-chain/revm", rev = "dfca3edd9732372e19dea88462eaece1e74824f1" } revm-primitives = { git = "https://github.com/bnb-chain/revm", rev = "dfca3edd9732372e19dea88462eaece1e74824f1" } alloy-chains = { git = "https://github.com/bnb-chain/alloy-chains-rs.git", rev = "b7c5379cf47345181f8dce350acafb958f47152a" } +alloy-rpc-types-eth = { git = "https://github.com/bnb-chain/alloy", rev = "bc6c03f365a1054ae89c5c940e0edbbd963d6dd4" } +alloy-consensus = { git = "https://github.com/bnb-chain/alloy", rev = "bc6c03f365a1054ae89c5c940e0edbbd963d6dd4" } +alloy-eips = { git = "https://github.com/bnb-chain/alloy", rev = "bc6c03f365a1054ae89c5c940e0edbbd963d6dd4" } +alloy-network = { git = "https://github.com/bnb-chain/alloy", rev = "bc6c03f365a1054ae89c5c940e0edbbd963d6dd4" } +alloy-serde = { git = "https://github.com/bnb-chain/alloy", rev = "bc6c03f365a1054ae89c5c940e0edbbd963d6dd4" } +alloy-signer = { git = "https://github.com/bnb-chain/alloy", rev = "bc6c03f365a1054ae89c5c940e0edbbd963d6dd4" } +alloy-signer-local = { git = "https://github.com/bnb-chain/alloy", rev = "bc6c03f365a1054ae89c5c940e0edbbd963d6dd4" } [patch."https://github.com/bluealloy/revm"] revm = { git = "https://github.com/bnb-chain/revm", rev = "dfca3edd9732372e19dea88462eaece1e74824f1" } \ No newline at end of file diff --git a/bin/reth/src/commands/db/get.rs b/bin/reth/src/commands/db/get.rs index 699a314718..536ec37fb5 100644 --- a/bin/reth/src/commands/db/get.rs +++ b/bin/reth/src/commands/db/get.rs @@ -1,14 +1,16 @@ use crate::utils::DbTool; use clap::Parser; use reth_db::{ - static_file::{ColumnSelectorOne, ColumnSelectorTwo, HeaderMask, ReceiptMask, TransactionMask}, - tables, RawKey, RawTable, Receipts, TableViewer, Transactions, + static_file::{ + ColumnSelectorOne, ColumnSelectorTwo, HeaderMask, ReceiptMask, SidecarMask, TransactionMask, + }, + tables, RawKey, RawTable, Receipts, Sidecars, TableViewer, Transactions, }; use reth_db_api::{ database::Database, table::{Decompress, DupSort, Table}, }; -use reth_primitives::{BlockHash, Header, StaticFileSegment}; +use reth_primitives::{BlobSidecars, BlockHash, Header, StaticFileSegment}; use reth_provider::StaticFileProviderFactory; use tracing::error; @@ -71,6 +73,10 @@ impl Command { table_key::(&key)?, ::Value>>::MASK, ), + StaticFileSegment::Sidecars => ( + table_key::(&key)?, + >::MASK, + ), }; let content = tool.provider_factory.static_file_provider().find_static_file( @@ -112,6 +118,12 @@ impl Command { )?; println!("{}", serde_json::to_string_pretty(&receipt)?); } + StaticFileSegment::Sidecars => { + let sc = <::Value>::decompress( + content[0].as_slice(), + )?; + println!("{}", serde_json::to_string_pretty(&sc)?); + } } } } diff --git a/crates/blockchain-tree/src/blockchain_tree.rs b/crates/blockchain-tree/src/blockchain_tree.rs index 5d73a1a78e..3fb121404c 100644 --- a/crates/blockchain-tree/src/blockchain_tree.rs +++ b/crates/blockchain-tree/src/blockchain_tree.rs @@ -1625,6 +1625,7 @@ mod tests { body: body.clone().into_iter().map(|tx| tx.into_signed()).collect(), ommers: Vec::new(), withdrawals: Some(Withdrawals::default()), + sidecars: None, requests: None, }, body.iter().map(|tx| tx.signer()).collect(), diff --git a/crates/consensus/auto-seal/src/lib.rs b/crates/consensus/auto-seal/src/lib.rs index 543e70b746..001ea2900c 100644 --- a/crates/consensus/auto-seal/src/lib.rs +++ b/crates/consensus/auto-seal/src/lib.rs @@ -369,6 +369,7 @@ impl StorageInner { body: transactions, ommers: ommers.clone(), withdrawals: withdrawals.clone(), + sidecars: None, requests: requests.clone(), } .with_recovered_senders() diff --git a/crates/consensus/beacon/src/engine/hooks/static_file.rs b/crates/consensus/beacon/src/engine/hooks/static_file.rs index 43c47ef41b..b52812b53a 100644 --- a/crates/consensus/beacon/src/engine/hooks/static_file.rs +++ b/crates/consensus/beacon/src/engine/hooks/static_file.rs @@ -101,6 +101,7 @@ impl StaticFileHook { headers: Some(finalized_block_number), receipts: Some(finalized_block_number), transactions: Some(finalized_block_number), + sidecars: Some(finalized_block_number), })?; // Check if the moving data to static files has been requested. diff --git a/crates/consensus/common/src/validation.rs b/crates/consensus/common/src/validation.rs index 7ef56384fc..a1175c100d 100644 --- a/crates/consensus/common/src/validation.rs +++ b/crates/consensus/common/src/validation.rs @@ -447,6 +447,7 @@ mod tests { body, ommers, withdrawals: None, + sidecars: None, requests: None, }, parent, diff --git a/crates/ethereum-forks/src/hardfork.rs b/crates/ethereum-forks/src/hardfork.rs index e8930490fc..0864e2a909 100644 --- a/crates/ethereum-forks/src/hardfork.rs +++ b/crates/ethereum-forks/src/hardfork.rs @@ -116,7 +116,7 @@ pub enum Hardfork { // ArbOS20Atlas, /// BSC `Haber` hardfork Haber, - /// BSC `Haber` hardfork + /// BSC `HaberFix` hardfork HaberFix, // Upcoming diff --git a/crates/ethereum/evm/src/execute.rs b/crates/ethereum/evm/src/execute.rs index 7276e14f44..39883aaca8 100644 --- a/crates/ethereum/evm/src/execute.rs +++ b/crates/ethereum/evm/src/execute.rs @@ -554,6 +554,7 @@ mod tests { body: vec![], ommers: vec![], withdrawals: None, + sidecars: None, requests: None, }, senders: vec![], @@ -585,6 +586,7 @@ mod tests { body: vec![], ommers: vec![], withdrawals: None, + sidecars: None, requests: None, }, senders: vec![], @@ -651,6 +653,7 @@ mod tests { body: vec![], ommers: vec![], withdrawals: None, + sidecars: None, requests: None, }, senders: vec![], @@ -705,6 +708,7 @@ mod tests { body: vec![], ommers: vec![], withdrawals: None, + sidecars: None, requests: None, }, senders: vec![], @@ -750,6 +754,7 @@ mod tests { body: vec![], ommers: vec![], withdrawals: None, + sidecars: None, requests: None, }, senders: vec![], @@ -777,6 +782,7 @@ mod tests { body: vec![], ommers: vec![], withdrawals: None, + sidecars: None, requests: None, }, senders: vec![], @@ -837,6 +843,7 @@ mod tests { body: vec![], ommers: vec![], withdrawals: None, + sidecars: None, requests: None, }, senders: vec![], @@ -908,6 +915,7 @@ mod tests { body: vec![], ommers: vec![], withdrawals: None, + sidecars: None, requests: None, }, senders: vec![], @@ -959,6 +967,7 @@ mod tests { body: vec![], ommers: vec![], withdrawals: None, + sidecars: None, requests: None, }, senders: vec![], @@ -1017,6 +1026,7 @@ mod tests { body: vec![], ommers: vec![], withdrawals: None, + sidecars: None, requests: None, }, senders: vec![], @@ -1081,6 +1091,7 @@ mod tests { body: vec![], ommers: vec![], withdrawals: None, + sidecars: None, requests: None, }, senders: vec![], @@ -1136,6 +1147,7 @@ mod tests { body: vec![], ommers: vec![], withdrawals: None, + sidecars: None, requests: None, }, senders: vec![], @@ -1175,6 +1187,7 @@ mod tests { body: vec![], ommers: vec![], withdrawals: None, + sidecars: None, requests: None, }, senders: vec![], @@ -1217,6 +1230,7 @@ mod tests { body: vec![], ommers: vec![], withdrawals: None, + sidecars: None, requests: None, }, senders: vec![], @@ -1306,6 +1320,7 @@ mod tests { body: vec![tx], ommers: vec![], withdrawals: None, + sidecars: None, requests: None, } .with_recovered_senders() @@ -1394,6 +1409,7 @@ mod tests { body: vec![tx], ommers: vec![], withdrawals: None, + sidecars: None, requests: None, } .with_recovered_senders() diff --git a/crates/ethereum/payload/src/lib.rs b/crates/ethereum/payload/src/lib.rs index 1e53180d99..4e004d2391 100644 --- a/crates/ethereum/payload/src/lib.rs +++ b/crates/ethereum/payload/src/lib.rs @@ -230,7 +230,8 @@ where requests_root, }; - let block = Block { header, body: vec![], ommers: vec![], withdrawals, requests }; + let block = + Block { header, body: vec![], ommers: vec![], withdrawals, sidecars: None, requests }; let sealed_block = block.seal_slow(); Ok(EthBuiltPayload::new(attributes.payload_id(), sealed_block, U256::ZERO)) @@ -514,7 +515,8 @@ where }; // seal the block - let block = Block { header, body: executed_txs, ommers: vec![], withdrawals, requests }; + let block = + Block { header, body: executed_txs, ommers: vec![], withdrawals, sidecars: None, requests }; let sealed_block = block.seal_slow(); debug!(target: "payload_builder", ?sealed_block, "sealed built block"); diff --git a/crates/evm/src/execute.rs b/crates/evm/src/execute.rs index cea9a63a1b..4f11827c2a 100644 --- a/crates/evm/src/execute.rs +++ b/crates/evm/src/execute.rs @@ -253,6 +253,7 @@ mod tests { body: vec![], ommers: vec![], withdrawals: None, + sidecars: None, requests: None, }; let block = BlockWithSenders::new(block, Default::default()).unwrap(); diff --git a/crates/net/downloaders/src/bodies/test_utils.rs b/crates/net/downloaders/src/bodies/test_utils.rs index b730510e8e..4bc482cadb 100644 --- a/crates/net/downloaders/src/bodies/test_utils.rs +++ b/crates/net/downloaders/src/bodies/test_utils.rs @@ -24,6 +24,7 @@ pub(crate) fn zip_blocks<'a>( body: body.transactions, ommers: body.ommers, withdrawals: body.withdrawals, + sidecars: body.sidecars, requests: body.requests, }) } diff --git a/crates/net/downloaders/src/file_client.rs b/crates/net/downloaders/src/file_client.rs index 9f566598a1..f0315f6f73 100644 --- a/crates/net/downloaders/src/file_client.rs +++ b/crates/net/downloaders/src/file_client.rs @@ -234,7 +234,7 @@ impl FromReader for FileClient { transactions: block.body, ommers: block.ommers, withdrawals: block.withdrawals, - sidecars: None, + sidecars: block.sidecars, requests: block.requests, }, ); diff --git a/crates/net/downloaders/src/test_utils/mod.rs b/crates/net/downloaders/src/test_utils/mod.rs index 905a1d8ed4..04c2b974d4 100644 --- a/crates/net/downloaders/src/test_utils/mod.rs +++ b/crates/net/downloaders/src/test_utils/mod.rs @@ -33,7 +33,7 @@ pub(crate) fn generate_bodies( transactions: block.body, ommers: block.ommers, withdrawals: block.withdrawals, - sidecars: None, + sidecars: block.sidecars, requests: block.requests, }, ) diff --git a/crates/net/network/src/eth_requests.rs b/crates/net/network/src/eth_requests.rs index 2c9e2f4d00..fe54f4a37f 100644 --- a/crates/net/network/src/eth_requests.rs +++ b/crates/net/network/src/eth_requests.rs @@ -167,7 +167,7 @@ where transactions: block.body, ommers: block.ommers, withdrawals: block.withdrawals, - sidecars: None, + sidecars: block.sidecars, requests: block.requests, }; diff --git a/crates/node-core/src/utils.rs b/crates/node-core/src/utils.rs index 8393b50bef..4faf118568 100644 --- a/crates/node-core/src/utils.rs +++ b/crates/node-core/src/utils.rs @@ -120,6 +120,7 @@ where body: block.transactions, ommers: block.ommers, withdrawals: block.withdrawals, + sidecars: block.sidecars, requests: block.requests, }; diff --git a/crates/optimism/evm/src/execute.rs b/crates/optimism/evm/src/execute.rs index bbefdbe678..5f57312c7c 100644 --- a/crates/optimism/evm/src/execute.rs +++ b/crates/optimism/evm/src/execute.rs @@ -589,6 +589,7 @@ mod tests { body: vec![tx, tx_deposit], ommers: vec![], withdrawals: None, + sidecars: None, requests: None, }, senders: vec![addr, addr], @@ -671,6 +672,7 @@ mod tests { body: vec![tx, tx_deposit], ommers: vec![], withdrawals: None, + sidecars: None, requests: None, }, senders: vec![addr, addr], diff --git a/crates/optimism/evm/src/l1.rs b/crates/optimism/evm/src/l1.rs index a750c8f4f0..6f4b456b98 100644 --- a/crates/optimism/evm/src/l1.rs +++ b/crates/optimism/evm/src/l1.rs @@ -285,6 +285,7 @@ mod tests { body: vec![l1_info_tx], ommers: Vec::default(), withdrawals: None, + sidecars: None, requests: None, }; @@ -307,6 +308,7 @@ mod tests { body: vec![l1_info_tx], ommers: Vec::default(), withdrawals: None, + sidecars: None, requests: None, }; diff --git a/crates/optimism/payload/src/builder.rs b/crates/optimism/payload/src/builder.rs index fa17982cb8..1923d53668 100644 --- a/crates/optimism/payload/src/builder.rs +++ b/crates/optimism/payload/src/builder.rs @@ -214,7 +214,14 @@ where requests_root: None, }; - let block = Block { header, body: vec![], ommers: vec![], withdrawals, requests: None }; + let block = Block { + header, + body: vec![], + ommers: vec![], + withdrawals, + sidecars: None, + requests: None, + }; let sealed_block = block.seal_slow(); Ok(OptimismBuiltPayload::new( @@ -573,7 +580,14 @@ where }; // seal the block - let block = Block { header, body: executed_txs, ommers: vec![], withdrawals, requests: None }; + let block = Block { + header, + body: executed_txs, + ommers: vec![], + withdrawals, + sidecars: None, + requests: None, + }; let sealed_block = block.seal_slow(); debug!(target: "payload_builder", ?sealed_block, "sealed built block"); diff --git a/crates/primitives-traits/Cargo.toml b/crates/primitives-traits/Cargo.toml index 0076e15da3..35a15c79d8 100644 --- a/crates/primitives-traits/Cargo.toml +++ b/crates/primitives-traits/Cargo.toml @@ -40,6 +40,7 @@ proptest = { workspace = true, optional = true } proptest-arbitrary-interop = { workspace = true, optional = true } [dev-dependencies] +alloy-primitives = { workspace = true, features = ["rand", "rlp"] } arbitrary = { workspace = true, features = ["derive"] } proptest.workspace = true proptest-arbitrary-interop.workspace = true diff --git a/crates/primitives/src/blob_sidecar.rs b/crates/primitives-traits/src/blob_sidecar.rs similarity index 55% rename from crates/primitives/src/blob_sidecar.rs rename to crates/primitives-traits/src/blob_sidecar.rs index c99ae5be35..c221ccede6 100644 --- a/crates/primitives/src/blob_sidecar.rs +++ b/crates/primitives-traits/src/blob_sidecar.rs @@ -1,14 +1,15 @@ #![allow(missing_docs)] -use alloy_eips::eip4844::{Blob, BlobTransactionSidecar, Bytes48}; +use alloy_eips::eip4844::{Blob, BlobTransactionSidecar, Bytes48, BYTES_PER_BLOB}; use alloy_primitives::B256; use alloy_rlp::{Decodable, Encodable, RlpDecodableWrapper, RlpEncodableWrapper}; -use bytes::BufMut; -use reth_codecs::{derive_arbitrary, Compact}; +use bytes::{Buf, BufMut}; +use derive_more::{Deref, DerefMut, From, IntoIterator}; +use reth_codecs::{derive_arbitrary, main_codec, Compact}; use revm_primitives::U256; use serde::{Deserialize, Serialize}; -use std::ops::{Deref, DerefMut}; +#[main_codec(no_arbitrary)] #[derive_arbitrary] #[derive( Debug, @@ -16,8 +17,10 @@ use std::ops::{Deref, DerefMut}; PartialEq, Eq, Default, - Serialize, - Deserialize, + Deref, + DerefMut, + From, + IntoIterator, RlpEncodableWrapper, RlpDecodableWrapper, )] @@ -40,56 +43,6 @@ impl BlobSidecars { pub fn size(&self) -> usize { self.len() * std::mem::size_of::() } - - /// Get an iterator over the `BlobSidecars`. - pub fn iter(&self) -> std::slice::Iter<'_, BlobSidecar> { - self.0.iter() - } - - /// Get a mutable iterator over the `BlobSidecars`. - pub fn iter_mut(&mut self) -> std::slice::IterMut<'_, BlobSidecar> { - self.0.iter_mut() - } - - /// Convert [Self] into raw vec of `sidecars`. - pub fn into_inner(self) -> Vec { - self.0 - } -} - -impl IntoIterator for BlobSidecars { - type Item = BlobSidecar; - type IntoIter = std::vec::IntoIter; - - fn into_iter(self) -> Self::IntoIter { - self.0.into_iter() - } -} - -impl AsRef<[BlobSidecar]> for BlobSidecars { - fn as_ref(&self) -> &[BlobSidecar] { - &self.0 - } -} - -impl Deref for BlobSidecars { - type Target = Vec; - - fn deref(&self) -> &Self::Target { - &self.0 - } -} - -impl DerefMut for BlobSidecars { - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} - -impl From> for BlobSidecars { - fn from(sidecars: Vec) -> Self { - Self(sidecars) - } } #[derive_arbitrary] @@ -175,31 +128,84 @@ impl Compact for BlobSidecar { where B: BufMut + AsMut<[u8]>, { - let mut size = 0; - size += self.blob_transaction_sidecar.blobs.to_compact(buf); - size += self.blob_transaction_sidecar.commitments.to_compact(buf); - size += self.blob_transaction_sidecar.proofs.to_compact(buf); - size += self.block_number.to_compact(buf); - size += self.block_hash.to_compact(buf); - size += self.tx_index.to_compact(buf); - size += self.tx_hash.to_compact(buf); - size - } + let mut len = 0; + + buf.put_u16(self.blob_transaction_sidecar.blobs.len() as u16); + len += 2; + for item in self.blob_transaction_sidecar.blobs { + len += item.to_compact(buf); + } + + buf.put_u16(self.blob_transaction_sidecar.commitments.len() as u16); + len += 2; + for item in self.blob_transaction_sidecar.commitments { + len += item.to_compact(buf); + } + + buf.put_u16(self.blob_transaction_sidecar.proofs.len() as u16); + len += 2; + for item in self.blob_transaction_sidecar.proofs { + len += item.to_compact(buf); + } + + buf.put_slice(self.block_number.as_le_slice()); + len += 32; - fn from_compact(buf: &[u8], len: usize) -> (Self, &[u8]) { - let (blobs, buf) = Vec::::from_compact(buf, len); - let (commitments, buf) = Vec::::from_compact(buf, len); - let (proofs, buf) = Vec::::from_compact(buf, len); + buf.put_slice(self.block_hash.as_slice()); + len += 32; - let blob_transaction_sidecar = BlobTransactionSidecar { blobs, commitments, proofs }; + buf.put_u64(self.tx_index); + len += 8; - let (block_number, buf) = U256::from_compact(buf, len); - let (block_hash, buf) = B256::from_compact(buf, len); - let (tx_index, buf) = u64::from_compact(buf, len); - let (tx_hash, buf) = B256::from_compact(buf, len); + buf.put_slice(self.tx_hash.as_slice()); + len += 32; - let blob_sidecar = - Self { blob_transaction_sidecar, block_number, block_hash, tx_index, tx_hash }; + len + } + + fn from_compact(mut buf: &[u8], _len: usize) -> (Self, &[u8]) { + let blobs_len = buf.get_u16() as usize; + let mut blobs = Vec::with_capacity(blobs_len); + for _ in 0..blobs_len { + let (item, rest) = Blob::from_compact(buf, BYTES_PER_BLOB); + blobs.push(item); + buf = rest; + } + + let commitments_len = buf.get_u16() as usize; + let mut commitments = Vec::with_capacity(commitments_len); + for _ in 0..commitments_len { + let (item, rest) = Bytes48::from_compact(buf, 48); + commitments.push(item); + buf = rest; + } + + let proofs_len = buf.get_u16() as usize; + let mut proofs = Vec::with_capacity(proofs_len); + for _ in 0..proofs_len { + let (item, rest) = Bytes48::from_compact(buf, 48); + proofs.push(item); + buf = rest; + } + + let block_number = U256::from_le_slice(&buf[..32]); + buf = &buf[32..]; + + let block_hash = B256::from_slice(&buf[..32]); + buf = &buf[32..]; + + let tx_index = buf.get_u64(); + + let tx_hash = B256::from_slice(&buf[..32]); + buf = &buf[32..]; + + let blob_sidecar = Self { + blob_transaction_sidecar: BlobTransactionSidecar { blobs, commitments, proofs }, + block_number, + block_hash, + tx_index, + tx_hash, + }; (blob_sidecar, buf) } @@ -208,16 +214,15 @@ impl Compact for BlobSidecar { #[cfg(test)] mod tests { use super::*; - use crate::U256; use alloy_rlp::Decodable; #[test] - fn rlp_encode_blob_sidecar() { + fn test_blob_sidecar_rlp() { let blob_sidecar = BlobSidecar { blob_transaction_sidecar: BlobTransactionSidecar { blobs: vec![], - commitments: vec![], - proofs: vec![], + commitments: vec![Default::default()], + proofs: vec![Default::default()], }, block_number: U256::from(rand::random::()), block_hash: B256::random(), @@ -231,4 +236,24 @@ mod tests { let decoded = BlobSidecar::decode(&mut encoded.as_slice()).unwrap(); assert_eq!(blob_sidecar, decoded); } + + #[test] + fn test_blob_sidecar_compact() { + let blob_sidecar = BlobSidecar { + blob_transaction_sidecar: BlobTransactionSidecar { + blobs: vec![], + commitments: vec![Default::default()], + proofs: vec![Default::default()], + }, + block_number: U256::from(rand::random::()), + block_hash: B256::random(), + tx_index: rand::random::(), + tx_hash: B256::random(), + }; + + let mut buf = vec![]; + let len = blob_sidecar.clone().to_compact(&mut buf); + let (decoded, _) = BlobSidecar::from_compact(&buf, len); + assert_eq!(blob_sidecar, decoded); + } } diff --git a/crates/primitives-traits/src/lib.rs b/crates/primitives-traits/src/lib.rs index 22d4c86a0f..f0b172b391 100644 --- a/crates/primitives-traits/src/lib.rs +++ b/crates/primitives-traits/src/lib.rs @@ -41,6 +41,10 @@ pub use storage::StorageEntry; /// Common header types pub mod header; + +mod blob_sidecar; +pub use blob_sidecar::{BlobSidecar, BlobSidecars}; + #[cfg(any(test, feature = "arbitrary", feature = "test-utils"))] pub use header::test_utils; pub use header::{Header, HeaderError, SealedHeader}; diff --git a/crates/primitives/src/alloy_compat.rs b/crates/primitives/src/alloy_compat.rs index e53be88442..5005654455 100644 --- a/crates/primitives/src/alloy_compat.rs +++ b/crates/primitives/src/alloy_compat.rs @@ -59,6 +59,7 @@ impl TryFrom for Block { withdrawals: block.withdrawals.map(Into::into), // todo(onbjerg): we don't know if this is added to rpc yet, so for now we leave it as // empty. + sidecars: None, requests: None, }) } diff --git a/crates/primitives/src/block.rs b/crates/primitives/src/block.rs index 7da0616cea..12f64fe75c 100644 --- a/crates/primitives/src/block.rs +++ b/crates/primitives/src/block.rs @@ -45,6 +45,9 @@ pub struct Block { pub ommers: Vec
, /// Block withdrawals. pub withdrawals: Option, + // only for bsc + /// Tx sidecars for the block. + pub sidecars: Option, /// Block requests. pub requests: Option, } @@ -57,6 +60,7 @@ impl Block { body: self.body, ommers: self.ommers, withdrawals: self.withdrawals, + sidecars: self.sidecars, requests: self.requests, } } @@ -70,6 +74,7 @@ impl Block { body: self.body, ommers: self.ommers, withdrawals: self.withdrawals, + sidecars: self.sidecars, requests: self.requests, } } @@ -188,6 +193,7 @@ impl<'a> arbitrary::Arbitrary<'a> for Block { // for now just generate empty requests, see HACK above requests: u.arbitrary()?, withdrawals: u.arbitrary()?, + sidecars: None, }) } } @@ -288,6 +294,9 @@ pub struct SealedBlock { pub ommers: Vec
, /// Block withdrawals. pub withdrawals: Option, + // only for bsc + /// Tx sidecars for the block. + pub sidecars: Option, /// Block requests. pub requests: Option, } @@ -296,8 +305,8 @@ impl SealedBlock { /// Create a new sealed block instance using the sealed header and block body. #[inline] pub fn new(header: SealedHeader, body: BlockBody) -> Self { - let BlockBody { transactions, ommers, withdrawals, requests, .. } = body; - Self { header, body: transactions, ommers, withdrawals, requests } + let BlockBody { transactions, ommers, withdrawals, sidecars, requests } = body; + Self { header, body: transactions, ommers, withdrawals, sidecars, requests } } /// Header hash. @@ -321,7 +330,7 @@ impl SealedBlock { transactions: self.body, ommers: self.ommers, withdrawals: self.withdrawals, - sidecars: None, + sidecars: self.sidecars, requests: self.requests, }, ) @@ -415,6 +424,7 @@ impl SealedBlock { body: self.body, ommers: self.ommers, withdrawals: self.withdrawals, + sidecars: self.sidecars, requests: self.requests, } } @@ -567,6 +577,7 @@ impl BlockBody { body: self.transactions.clone(), ommers: self.ommers.clone(), withdrawals: self.withdrawals.clone(), + sidecars: self.sidecars.clone(), requests: self.requests.clone(), } } @@ -615,7 +626,7 @@ impl From for BlockBody { transactions: block.body, ommers: block.ommers, withdrawals: block.withdrawals, - sidecars: None, + sidecars: block.sidecars, requests: block.requests, } } diff --git a/crates/primitives/src/lib.rs b/crates/primitives/src/lib.rs index b148a6e7a1..562be8dbd2 100644 --- a/crates/primitives/src/lib.rs +++ b/crates/primitives/src/lib.rs @@ -37,7 +37,6 @@ mod receipt; /// Helpers for working with revm pub mod revm; pub use reth_static_file_types as static_file; -mod blob_sidecar; pub mod parlia; pub mod system_contracts; pub mod transaction; @@ -60,8 +59,8 @@ pub use receipt::{ gas_spent_by_transactions, Receipt, ReceiptWithBloom, ReceiptWithBloomRef, Receipts, }; pub use reth_primitives_traits::{ - logs_bloom, Account, Bytecode, GotExpected, GotExpectedBoxed, Log, Request, Requests, - StorageEntry, Withdrawal, Withdrawals, + logs_bloom, Account, BlobSidecar, BlobSidecars, Bytecode, GotExpected, GotExpectedBoxed, Log, + Request, Requests, StorageEntry, Withdrawal, Withdrawals, }; pub use static_file::StaticFileSegment; @@ -82,8 +81,6 @@ pub use transaction::{ LEGACY_TX_TYPE_ID, }; -pub use blob_sidecar::{BlobSidecar, BlobSidecars}; - // Re-exports pub use self::ruint::UintTryTo; pub use alloy_primitives::{ diff --git a/crates/rpc/rpc-api/src/eth.rs b/crates/rpc/rpc-api/src/eth.rs index eb11fde824..01eaa2fb48 100644 --- a/crates/rpc/rpc-api/src/eth.rs +++ b/crates/rpc/rpc-api/src/eth.rs @@ -3,8 +3,8 @@ use jsonrpsee::{core::RpcResult, proc_macros::rpc}; use reth_primitives::{Address, BlockId, BlockNumberOrTag, Bytes, B256, B64, U256, U64}; use reth_rpc_types::{ serde_helpers::JsonStorageKey, state::StateOverride, AccessListWithGasUsed, - AnyTransactionReceipt, BlockOverrides, Bundle, EIP1186AccountProofResponse, EthCallResponse, - FeeHistory, Header, Index, RichBlock, StateContext, SyncStatus, Transaction, + AnyTransactionReceipt, BlockOverrides, BlockSidecar, Bundle, EIP1186AccountProofResponse, + EthCallResponse, FeeHistory, Header, Index, RichBlock, StateContext, SyncStatus, Transaction, TransactionRequest, Work, }; @@ -308,4 +308,12 @@ pub trait EthApi { keys: Vec, block_number: Option, ) -> RpcResult; + + /// Returns the Sidecars of a given block number or hash. + #[method(name = "getBlobSidecars")] + async fn get_blob_sidecars(&self, block_id: BlockId) -> RpcResult>>; + + /// Returns a sidecar of a given blob transaction + #[method(name = "getBlockSidecarByTxHash")] + async fn get_block_sidecar_by_tx_hash(&self, hash: B256) -> RpcResult>; } diff --git a/crates/rpc/rpc-engine-api/tests/it/payload.rs b/crates/rpc/rpc-engine-api/tests/it/payload.rs index 0f2853f1f0..afc66ddb0b 100644 --- a/crates/rpc/rpc-engine-api/tests/it/payload.rs +++ b/crates/rpc/rpc-engine-api/tests/it/payload.rs @@ -25,6 +25,7 @@ fn transform_block Block>(src: SealedBlock, f: F) -> Executi body: transformed.body, ommers: transformed.ommers, withdrawals: transformed.withdrawals, + sidecars: transformed.sidecars, requests: transformed.requests, }) .0 diff --git a/crates/rpc/rpc-types-compat/src/engine/payload.rs b/crates/rpc/rpc-types-compat/src/engine/payload.rs index dacfab0641..575992f143 100644 --- a/crates/rpc/rpc-types-compat/src/engine/payload.rs +++ b/crates/rpc/rpc-types-compat/src/engine/payload.rs @@ -68,6 +68,7 @@ pub fn try_payload_v1_to_block(payload: ExecutionPayloadV1) -> Result EthResult>> { + if block_id.is_pending() { + return Ok(None); + } + + let sidecars = if let Some(block_hash) = self.provider().block_hash_for_id(block_id)? { + self.cache().get_sidecars(block_hash).await? + } else { + None + }; + + // If no block and sidecars found, return None + let Some(sidecars) = sidecars else { + return Ok(None); + }; + + let block_sidecars = sidecars + .into_iter() + .map(|o| BlockSidecar { + blob_sidecar: o.blob_transaction_sidecar, + block_number: o.block_number.to(), + block_hash: o.block_hash, + tx_index: o.tx_index, + tx_hash: o.tx_hash, + }) + .collect(); + + Ok(Some(block_sidecars)) + } + + /// Returns the sidecar for the given transaction hash. + pub(crate) async fn rpc_transaction_sidecar( + &self, + hash: B256, + ) -> EthResult> { + let meta = match self.provider().transaction_by_hash_with_meta(hash)? { + Some((_, meta)) => meta, + None => return Ok(None), + }; + + // If no block and receipts found, return None + let Some(sidecars) = self.cache().get_sidecars(meta.block_hash).await? else { + return Ok(None); + }; + + return if let Some(index) = sidecars.iter().position(|o| o.tx_hash == hash) { + let block_sidecar = BlockSidecar { + blob_sidecar: sidecars[index].blob_transaction_sidecar.clone(), + block_number: sidecars[index].block_number.to(), + block_hash: sidecars[index].block_hash, + tx_index: sidecars[index].tx_index, + tx_hash: sidecars[index].tx_hash, + }; + + Ok(Some(block_sidecar)) + } else { + Ok(None) + } + } } diff --git a/crates/rpc/rpc/src/eth/api/pending_block.rs b/crates/rpc/rpc/src/eth/api/pending_block.rs index 4f9a616dec..02f6d0059a 100644 --- a/crates/rpc/rpc/src/eth/api/pending_block.rs +++ b/crates/rpc/rpc/src/eth/api/pending_block.rs @@ -289,8 +289,12 @@ impl PendingBlockEnv { requests_root, }; + // sidecars should be queried by `eth_getBlobSidecars` + let sidecars = None; + // seal the block - let block = Block { header, body: executed_txs, ommers: vec![], withdrawals, requests }; + let block = + Block { header, body: executed_txs, ommers: vec![], withdrawals, sidecars, requests }; Ok(SealedBlockWithSenders { block: block.seal_slow(), senders }) } } diff --git a/crates/rpc/rpc/src/eth/api/server.rs b/crates/rpc/rpc/src/eth/api/server.rs index f238b4da07..b5d2f2a9e7 100644 --- a/crates/rpc/rpc/src/eth/api/server.rs +++ b/crates/rpc/rpc/src/eth/api/server.rs @@ -22,7 +22,7 @@ use reth_rpc_api::EthApiServer; use reth_rpc_types::{ serde_helpers::JsonStorageKey, state::{EvmOverrides, StateOverride}, - AccessListWithGasUsed, AnyTransactionReceipt, BlockOverrides, Bundle, + AccessListWithGasUsed, AnyTransactionReceipt, BlockOverrides, BlockSidecar, Bundle, EIP1186AccountProofResponse, EthCallResponse, FeeHistory, Header, Index, RichBlock, StateContext, SyncStatus, TransactionRequest, Work, }; @@ -421,6 +421,18 @@ where _ => e.into(), })?) } + + /// Handler for: `eth_getBlobSidecars` + async fn get_blob_sidecars(&self, block_id: BlockId) -> Result>> { + trace!(target: "rpc::eth", ?block_id, "Serving eth_getBlobSidecars"); + Ok(Self::rpc_block_sidecars(self, block_id).await?) + } + + /// Handler for: `eth_getBlockSidecarByTxHash` + async fn get_block_sidecar_by_tx_hash(&self, hash: B256) -> Result> { + trace!(target: "rpc::eth", ?hash, "Serving eth_getBlockSidecarByTxHash"); + Ok(Self::rpc_transaction_sidecar(self, hash).await?) + } } #[cfg(test)] diff --git a/crates/rpc/rpc/src/eth/cache/mod.rs b/crates/rpc/rpc/src/eth/cache/mod.rs index cfbe68311e..cf9ce8232e 100644 --- a/crates/rpc/rpc/src/eth/cache/mod.rs +++ b/crates/rpc/rpc/src/eth/cache/mod.rs @@ -5,8 +5,8 @@ use reth_errors::{ProviderError, ProviderResult}; use reth_evm::ConfigureEvm; use reth_execution_types::Chain; use reth_primitives::{ - Block, BlockHashOrNumber, BlockWithSenders, Receipt, SealedBlock, SealedBlockWithSenders, - TransactionSigned, TransactionSignedEcRecovered, B256, + BlobSidecars, Block, BlockHashOrNumber, BlockWithSenders, Receipt, SealedBlock, + SealedBlockWithSenders, TransactionSigned, TransactionSignedEcRecovered, B256, }; use reth_provider::{ BlockReader, CanonStateNotification, EvmEnvProvider, StateProviderFactory, TransactionVariant, @@ -44,6 +44,9 @@ type BlockWithSendersResponseSender = oneshot::Sender>>>>; +/// The type that can send the response to the requested sidecars of a block. +type SidecarsResponseSender = oneshot::Sender>>; + /// The type that can send the response to a requested env type EnvResponseSender = oneshot::Sender>; @@ -57,6 +60,8 @@ type BlockLruCache = MultiConsumerLruCache< type ReceiptsLruCache = MultiConsumerLruCache>, L, ReceiptsResponseSender>; +type SidecarsLruCache = MultiConsumerLruCache; + type EnvLruCache = MultiConsumerLruCache; @@ -85,6 +90,7 @@ impl EthStateCache { provider, full_block_cache: BlockLruCache::new(max_blocks, "blocks"), receipts_cache: ReceiptsLruCache::new(max_receipts, "receipts"), + sidecars_cache: SidecarsLruCache::new(max_blocks, "sidecars"), evm_env_cache: EnvLruCache::new(max_envs, "evm_env"), action_tx: to_service.clone(), action_rx: UnboundedReceiverStream::new(rx), @@ -250,6 +256,13 @@ impl EthStateCache { Ok(block.zip(receipts)) } + /// Fetches sidecars for the given block hash. + pub async fn get_sidecars(&self, block_hash: B256) -> ProviderResult> { + let (response_tx, rx) = oneshot::channel(); + let _ = self.to_service.send(CacheAction::GetSidecars { block_hash, response_tx }); + rx.await.map_err(|_| ProviderError::CacheServiceUnavailable)? + } + /// Requests the evm env config for the block hash. /// /// Returns an error if the corresponding header (required for populating the envs) was not @@ -287,17 +300,21 @@ pub(crate) struct EthStateCacheService< LimitBlocks = ByLength, LimitReceipts = ByLength, LimitEnvs = ByLength, + LimitSidecars = ByLength, > where LimitBlocks: Limiter, LimitReceipts: Limiter>>, LimitEnvs: Limiter, + LimitSidecars: Limiter, { /// The type used to lookup data from disk provider: Provider, /// The LRU cache for full blocks grouped by their hash. full_block_cache: BlockLruCache, - /// The LRU cache for full blocks grouped by their hash. + /// The LRU cache for receipts grouped by their hash. receipts_cache: ReceiptsLruCache, + /// The LRU cache for receipts grouped by their hash. + sidecars_cache: SidecarsLruCache, /// The LRU cache for revm environments evm_env_cache: EnvLruCache, /// Sender half of the action channel. @@ -496,6 +513,28 @@ where })); } } + CacheAction::GetSidecars { block_hash, response_tx } => { + // check if block is cached + if let Some(sidecars) = this.sidecars_cache.get(&block_hash).cloned() { + let _ = response_tx.send(Ok(Some(sidecars))); + continue + } + + // block is not in the cache, request it if this is the first consumer + if this.sidecars_cache.queue(block_hash, response_tx) { + let provider = this.provider.clone(); + let action_tx = this.action_tx.clone(); + let rate_limiter = this.rate_limiter.clone(); + this.action_task_spawner.spawn_blocking(Box::pin(async move { + // Acquire permit + let _permit = rate_limiter.acquire().await; + let res = provider.sidecars(&block_hash); + + let _ = action_tx + .send(CacheAction::SidecarsResult { block_hash, res }); + })); + } + } CacheAction::GetEnv { block_hash, response_tx } => { // check if env data is cached if let Some(env) = this.evm_env_cache.get(&block_hash).cloned() { @@ -561,6 +600,19 @@ where this.evm_env_cache.insert(block_hash, data); } } + CacheAction::SidecarsResult { block_hash, res } => { + if let Some(queued) = this.sidecars_cache.remove(&block_hash) { + // send the response to queued senders + for tx in queued { + let _ = tx.send(res.clone()); + } + } + + // cache good env data + if let Ok(Some(data)) = res { + this.sidecars_cache.insert(block_hash, data); + } + } CacheAction::CacheNewCanonicalChain { chain_change } => { for block in chain_change.blocks { this.on_new_block(block.hash(), Ok(Some(block.unseal()))); @@ -608,6 +660,8 @@ enum CacheAction { EnvResult { block_hash: B256, res: Box> }, CacheNewCanonicalChain { chain_change: ChainChange }, RemoveReorgedChain { chain_change: ChainChange }, + GetSidecars { block_hash: B256, response_tx: SidecarsResponseSender }, + SidecarsResult { block_hash: B256, res: ProviderResult> }, } struct BlockReceipts { diff --git a/crates/stages/api/src/pipeline/mod.rs b/crates/stages/api/src/pipeline/mod.rs index 67ef53855b..36a0a4cf20 100644 --- a/crates/stages/api/src/pipeline/mod.rs +++ b/crates/stages/api/src/pipeline/mod.rs @@ -253,17 +253,19 @@ where // Copies data from database to static files let lowest_static_file_height = { let provider = self.provider_factory.provider()?; - let stages_checkpoints = [StageId::Headers, StageId::Execution, StageId::Bodies] - .into_iter() - .map(|stage| { - provider.get_stage_checkpoint(stage).map(|c| c.map(|c| c.block_number)) - }) - .collect::, _>>()?; + let stages_checkpoints = + [StageId::Headers, StageId::Execution, StageId::Bodies, StageId::Bodies] + .into_iter() + .map(|stage| { + provider.get_stage_checkpoint(stage).map(|c| c.map(|c| c.block_number)) + }) + .collect::, _>>()?; let targets = static_file_producer.get_static_file_targets(HighestStaticFiles { headers: stages_checkpoints[0], receipts: stages_checkpoints[1], transactions: stages_checkpoints[2], + sidecars: stages_checkpoints[3], })?; static_file_producer.run(targets)?; stages_checkpoints.into_iter().min().expect("exists") diff --git a/crates/stages/stages/src/stages/bodies.rs b/crates/stages/stages/src/stages/bodies.rs index 07dbda48f8..13a53aa40c 100644 --- a/crates/stages/stages/src/stages/bodies.rs +++ b/crates/stages/stages/src/stages/bodies.rs @@ -129,7 +129,7 @@ impl Stage for BodyStage { let mut next_tx_num = tx_block_cursor.last()?.map(|(id, _)| id + 1).unwrap_or_default(); let static_file_provider = provider.static_file_provider(); - let mut static_file_producer = + let mut static_file_producer_tx = static_file_provider.get_writer(from_block, StaticFileSegment::Transactions)?; // Make sure Transactions static file is at the same height. If it's further, this @@ -144,11 +144,11 @@ impl Stage for BodyStage { // stage run. So, our only solution is to unwind the static files and proceed from the // database expected height. Ordering::Greater => { - static_file_producer + static_file_producer_tx .prune_transactions(next_static_file_tx_num - next_tx_num, from_block - 1)?; // Since this is a database <-> static file inconsistency, we commit the change // straight away. - static_file_producer.commit()?; + static_file_producer_tx.commit()?; } // If static files are behind, then there was some corruption or loss of files. This // error will trigger an unwind, that will bring the database to the same height as the @@ -158,6 +158,38 @@ impl Stage for BodyStage { next_static_file_tx_num.saturating_sub(1), static_file_provider, provider, + StaticFileSegment::Transactions, + )?) + } + Ordering::Equal => {} + } + + let mut static_file_producer_sc = + static_file_provider.get_writer(from_block, StaticFileSegment::Sidecars)?; + + // Make sure Sidecars static file is at the same height. If it's further, this + // input execution was interrupted previously and we need to unwind the static file. + let next_static_file_block_num = static_file_provider + .get_highest_static_file_block(StaticFileSegment::Sidecars) + .map(|id| id + 1) + .unwrap_or_default(); + + match next_static_file_block_num.cmp(&from_block) { + Ordering::Greater => { + static_file_producer_sc.prune_sidecars(next_static_file_block_num - from_block)?; + // Since this is a database <-> static file inconsistency, we commit the change + // straight away. + static_file_producer_sc.commit()? + } + // If static files are behind, then there was some corruption or loss of files. This + // error will trigger an unwind, that will bring the database to the same height as the + // static files. + Ordering::Less => { + return Err(missing_static_data_error( + next_static_file_tx_num.saturating_sub(1), + static_file_provider, + provider, + StaticFileSegment::Sidecars, )?) } Ordering::Equal => {} @@ -182,7 +214,7 @@ impl Stage for BodyStage { // Increment block on static file header. if block_number > 0 { - let appended_block_number = static_file_producer + let appended_block_number = static_file_producer_tx .increment_block(StaticFileSegment::Transactions, block_number)?; if appended_block_number != block_number { @@ -205,7 +237,7 @@ impl Stage for BodyStage { // Write transactions for transaction in block.body { - let appended_tx_number = static_file_producer + let appended_tx_number = static_file_producer_tx .append_transaction(next_tx_num, transaction.into())?; if appended_tx_number != next_tx_num { @@ -222,6 +254,14 @@ impl Stage for BodyStage { next_tx_num += 1; } + // Write sidecars + let sidecars = block.sidecars.unwrap_or_default(); + static_file_producer_sc.append_sidecars( + sidecars, + block_number, + block.header.hash(), + )?; + // Write ommers if any if !block.ommers.is_empty() { ommers_cursor @@ -243,7 +283,14 @@ impl Stage for BodyStage { } } } - BlockResponse::Empty(_) => {} + BlockResponse::Empty(header) => { + // Write empty sidecars + static_file_producer_sc.append_sidecars( + Default::default(), + block_number, + header.hash(), + )?; + } }; // insert block meta @@ -313,7 +360,7 @@ impl Stage for BodyStage { rev_walker.delete_current()?; } - let mut static_file_producer = + let mut static_file_producer_tx = static_file_provider.latest_writer(StaticFileSegment::Transactions)?; // Unwind from static files. Get the current last expected transaction from DB, and match it @@ -331,13 +378,39 @@ impl Stage for BodyStage { static_file_tx_num, static_file_provider, provider, + StaticFileSegment::Transactions, )?) } // Unwinds static file - static_file_producer + static_file_producer_tx .prune_transactions(static_file_tx_num.saturating_sub(db_tx_num), input.unwind_to)?; + let mut static_file_producer_sc = + static_file_provider.latest_writer(StaticFileSegment::Sidecars)?; + + // Unwind from static files. Get the current last expected block from DB, and match it + // on static file + let db_block_num = body_cursor.last()?.map(|(block_num, _)| block_num).unwrap_or_default(); + let static_file_block_num: u64 = static_file_provider + .get_highest_static_file_block(StaticFileSegment::Sidecars) + .unwrap_or_default(); + + // If there are more blocks on database, then we are missing static file data and we + // need to unwind further. + if db_block_num > static_file_block_num { + return Err(missing_static_data_error( + static_file_block_num, + static_file_provider, + provider, + StaticFileSegment::Sidecars, + )?) + } + + // Unwinds static file + static_file_producer_sc + .prune_sidecars(static_file_block_num.saturating_sub(db_block_num))?; + Ok(UnwindOutput { checkpoint: StageCheckpoint::new(input.unwind_to) .with_entities_stage_checkpoint(stage_checkpoint(provider)?), @@ -349,6 +422,7 @@ fn missing_static_data_error( last_tx_num: TxNumber, static_file_provider: &StaticFileProvider, provider: &DatabaseProviderRW, + segment: StaticFileSegment, ) -> Result { let mut last_block = static_file_provider .get_highest_static_file_block(StaticFileSegment::Transactions) @@ -370,10 +444,7 @@ fn missing_static_data_error( let missing_block = Box::new(provider.sealed_header(last_block + 1)?.unwrap_or_default()); - Ok(StageError::MissingStaticFileData { - block: missing_block, - segment: StaticFileSegment::Transactions, - }) + Ok(StageError::MissingStaticFileData { block: missing_block, segment }) } // TODO(alexey): ideally, we want to measure Bodies stage progress in bytes, but it's hard to know @@ -665,7 +736,7 @@ mod tests { transactions: block.body.clone(), ommers: block.ommers.clone(), withdrawals: block.withdrawals.clone(), - sidecars: None, + sidecars: block.sidecars.clone(), requests: block.requests.clone(), }, ) @@ -728,23 +799,34 @@ mod tests { // Insert last progress data { let tx = self.db.factory.provider_rw()?.into_tx(); - let mut static_file_producer = static_file_provider + let mut static_file_producer_tx = static_file_provider .get_writer(start, StaticFileSegment::Transactions)?; + let mut static_file_producer_sc = + static_file_provider.get_writer(start, StaticFileSegment::Sidecars)?; let body = StoredBlockBodyIndices { first_tx_num: 0, tx_count: progress.body.len() as u64, }; - static_file_producer.set_block_range(0..=progress.number); + static_file_producer_tx.set_block_range(0..=progress.number); body.tx_num_range().try_for_each(|tx_num| { let transaction = random_signed_tx(&mut rng); - static_file_producer + static_file_producer_tx .append_transaction(tx_num, transaction.into()) .map(|_| ()) })?; + for block_number in 0..=progress.number { + static_file_producer_sc.append_sidecars( + Default::default(), + block_number, + blocks.get(block_number as usize).map(|b| b.header.hash()).unwrap(), + )?; + tx.put::(block_number, Default::default())?; + } + if body.tx_count != 0 { tx.put::( body.last_tx_num(), @@ -761,7 +843,8 @@ mod tests { )?; } - static_file_producer.commit()?; + static_file_producer_tx.commit()?; + static_file_producer_sc.commit()?; tx.commit()?; } } @@ -945,6 +1028,7 @@ mod tests { body: body.transactions, ommers: body.ommers, withdrawals: body.withdrawals, + sidecars: body.sidecars, requests: body.requests, })); } diff --git a/crates/stages/stages/src/stages/finish.rs b/crates/stages/stages/src/stages/finish.rs index 9eb3a6d762..7ce1d246b7 100644 --- a/crates/stages/stages/src/stages/finish.rs +++ b/crates/stages/stages/src/stages/finish.rs @@ -12,6 +12,8 @@ use reth_stages_api::{ #[non_exhaustive] pub struct FinishStage; +impl FinishStage {} + impl Stage for FinishStage { fn id(&self) -> StageId { StageId::Finish diff --git a/crates/stages/stages/src/stages/merkle.rs b/crates/stages/stages/src/stages/merkle.rs index 5a3d31a404..2068cd38f5 100644 --- a/crates/stages/stages/src/stages/merkle.rs +++ b/crates/stages/stages/src/stages/merkle.rs @@ -512,13 +512,14 @@ mod tests { accounts.iter().map(|(addr, acc)| (*addr, (*acc, std::iter::empty()))), )?; - let SealedBlock { header, body, ommers, withdrawals, requests } = random_block( - &mut rng, - stage_progress, - preblocks.last().map(|b| b.hash()), - Some(0), - None, - ); + let SealedBlock { header, body, ommers, withdrawals, sidecars, requests } = + random_block( + &mut rng, + stage_progress, + preblocks.last().map(|b| b.hash()), + Some(0), + None, + ); let mut header = header.unseal(); header.state_root = state_root( @@ -527,8 +528,14 @@ mod tests { .into_iter() .map(|(address, account)| (address, (account, std::iter::empty()))), ); - let sealed_head = - SealedBlock { header: header.seal_slow(), body, ommers, withdrawals, requests }; + let sealed_head = SealedBlock { + header: header.seal_slow(), + body, + ommers, + withdrawals, + sidecars, + requests, + }; let head_hash = sealed_head.hash(); let mut blocks = vec![sealed_head]; diff --git a/crates/stages/stages/src/test_utils/test_db.rs b/crates/stages/stages/src/test_utils/test_db.rs index 8f72b5aab2..b3e053f495 100644 --- a/crates/stages/stages/src/test_utils/test_db.rs +++ b/crates/stages/stages/src/test_utils/test_db.rs @@ -16,7 +16,7 @@ use reth_db_api::{ DatabaseError as DbError, }; use reth_primitives::{ - keccak256, Account, Address, BlockNumber, Receipt, SealedBlock, SealedHeader, + keccak256, Account, Address, BlockHash, BlockNumber, Receipt, SealedBlock, SealedHeader, StaticFileSegment, StorageEntry, TxHash, TxNumber, B256, U256, }; use reth_provider::{ @@ -171,6 +171,32 @@ impl TestStageDB { Ok(()) } + /// Insert sidecars to static file if `writer` exists, otherwise to DB. + /// Always insert empty data. + pub fn insert_sidecars( + writer: Option<&mut StaticFileProviderRWRefMut<'_>>, + tx: &TX, + hash: BlockHash, + block_number: BlockNumber, + ) -> ProviderResult<()> { + if let Some(writer) = writer { + // Backfill: some tests start at a forward block number, but static files require no + // gaps. + let segment_header = writer.user_header(); + if segment_header.block_end().is_none() && segment_header.expected_block_start() == 0 { + for block_number in 0..block_number { + writer.append_sidecars(Default::default(), block_number, B256::ZERO)?; + } + } + + writer.append_sidecars(Default::default(), block_number, hash)?; + } else { + tx.put::(block_number, Default::default())?; + } + + Ok(()) + } + fn insert_headers_inner<'a, I, const TD: bool>(&self, headers: I) -> ProviderResult<()> where I: IntoIterator, @@ -234,14 +260,26 @@ impl TestStageDB { let mut headers_writer = storage_kind .is_static() .then(|| provider.latest_writer(StaticFileSegment::Headers).unwrap()); + let mut sidecars_writer = storage_kind + .is_static() + .then(|| provider.latest_writer(StaticFileSegment::Sidecars).unwrap()); blocks.iter().try_for_each(|block| { + Self::insert_sidecars( + sidecars_writer.as_mut(), + &tx, + block.header.hash(), + block.header.number, + )?; Self::insert_header(headers_writer.as_mut(), &tx, &block.header, U256::ZERO) })?; if let Some(mut writer) = headers_writer { writer.commit()?; } + if let Some(mut writer) = sidecars_writer { + writer.commit()?; + } } { @@ -490,7 +528,7 @@ impl StorageKind { fn tx_offset(&self) -> u64 { if let Self::Database(offset) = self { - return offset.unwrap_or_default() + return offset.unwrap_or_default(); } 0 } diff --git a/crates/static-file/static-file/src/segments/mod.rs b/crates/static-file/static-file/src/segments/mod.rs index 77798dd085..d29e3957d3 100644 --- a/crates/static-file/static-file/src/segments/mod.rs +++ b/crates/static-file/static-file/src/segments/mod.rs @@ -9,6 +9,9 @@ pub use headers::Headers; mod receipts; pub use receipts::Receipts; +mod sidecars; +pub use sidecars::Sidecars; + use alloy_primitives::BlockNumber; use reth_db::{RawKey, RawTable}; use reth_db_api::{cursor::DbCursorRO, database::Database, table::Table, transaction::DbTx}; @@ -62,7 +65,7 @@ pub(crate) fn prepare_jar( prepare_compression: impl Fn() -> ProviderResult>, ) -> ProviderResult> { let tx_range = match segment { - StaticFileSegment::Headers => None, + StaticFileSegment::Headers | StaticFileSegment::Sidecars => None, StaticFileSegment::Receipts | StaticFileSegment::Transactions => { Some(provider.transaction_range_by_block_range(block_range.clone())?.into()) } diff --git a/crates/static-file/static-file/src/segments/sidecars.rs b/crates/static-file/static-file/src/segments/sidecars.rs new file mode 100644 index 0000000000..4b18bddafa --- /dev/null +++ b/crates/static-file/static-file/src/segments/sidecars.rs @@ -0,0 +1,116 @@ +use crate::segments::{dataset_for_compression, prepare_jar, Segment}; +use alloy_primitives::BlockNumber; +use reth_db::{static_file::create_static_file_T1_T2, tables, RawKey, RawTable}; +use reth_db_api::{cursor::DbCursorRO, database::Database, transaction::DbTx}; +use reth_provider::{ + providers::{StaticFileProvider, StaticFileWriter}, + DatabaseProviderRO, +}; +use reth_static_file_types::{SegmentConfig, SegmentHeader, StaticFileSegment}; +use reth_storage_errors::provider::ProviderResult; +use std::{ops::RangeInclusive, path::Path}; + +/// Static File segment responsible for [`StaticFileSegment::Sidecars`] part of data. +#[derive(Debug, Default)] +pub struct Sidecars; + +impl Segment for Sidecars { + fn segment(&self) -> StaticFileSegment { + StaticFileSegment::Sidecars + } + + fn copy_to_static_files( + &self, + provider: DatabaseProviderRO, + static_file_provider: StaticFileProvider, + block_range: RangeInclusive, + ) -> ProviderResult<()> { + let mut static_file_writer = + static_file_provider.get_writer(*block_range.start(), StaticFileSegment::Sidecars)?; + + let mut sidecars_cursor = provider.tx_ref().cursor_read::()?; + let sidecars_walker = sidecars_cursor.walk_range(block_range.clone())?; + + let mut canonical_headers_cursor = + provider.tx_ref().cursor_read::()?; + let canonical_headers_walker = canonical_headers_cursor.walk_range(block_range)?; + + for (sidecar_entry, canonical_header_entry) in sidecars_walker.zip(canonical_headers_walker) + { + let (header_block, sidecar) = sidecar_entry?; + let (canonical_header_block, canonical_header) = canonical_header_entry?; + + debug_assert_eq!(header_block, canonical_header_block); + + let _static_file_block = + static_file_writer.append_sidecars(sidecar, header_block, canonical_header)?; + debug_assert_eq!(_static_file_block, header_block); + } + + Ok(()) + } + + fn create_static_file_file( + &self, + provider: &DatabaseProviderRO, + directory: &Path, + config: SegmentConfig, + block_range: RangeInclusive, + ) -> ProviderResult<()> { + let range_len = block_range.clone().count(); + + let jar = prepare_jar::( + provider, + directory, + StaticFileSegment::Sidecars, + config, + block_range.clone(), + range_len, + || { + Ok([ + dataset_for_compression::( + provider, + &block_range, + range_len, + )?, + dataset_for_compression::( + provider, + &block_range, + range_len, + )?, + ]) + }, + )?; + + // Generate list of hashes for filters & PHF + let mut cursor = provider.tx_ref().cursor_read::>()?; + let hashes = if config.filters.has_filters() { + Some( + cursor + .walk(Some(RawKey::from(*block_range.start())))? + .take(range_len) + .map(|row| row.map(|(_key, value)| value.into_value()).map_err(|e| e.into())), + ) + } else { + None + }; + + create_static_file_T1_T2::< + tables::Sidecars, + tables::CanonicalHeaders, + BlockNumber, + SegmentHeader, + >( + provider.tx_ref(), + block_range, + None, + // We already prepared the dictionary beforehand + None::>>>, + hashes, + range_len, + jar, + )?; + + Ok(()) + } +} diff --git a/crates/static-file/static-file/src/static_file_producer.rs b/crates/static-file/static-file/src/static_file_producer.rs index 44ea3a5c84..1fa26778d3 100644 --- a/crates/static-file/static-file/src/static_file_producer.rs +++ b/crates/static-file/static-file/src/static_file_producer.rs @@ -62,12 +62,16 @@ pub struct StaticFileTargets { headers: Option>, receipts: Option>, transactions: Option>, + sidecars: Option>, } impl StaticFileTargets { /// Returns `true` if any of the targets are [Some]. pub const fn any(&self) -> bool { - self.headers.is_some() || self.receipts.is_some() || self.transactions.is_some() + self.headers.is_some() || + self.receipts.is_some() || + self.transactions.is_some() || + self.sidecars.is_some() } // Returns `true` if all targets are either [`None`] or has beginning of the range equal to the @@ -77,6 +81,7 @@ impl StaticFileTargets { (self.headers.as_ref(), static_files.headers), (self.receipts.as_ref(), static_files.receipts), (self.transactions.as_ref(), static_files.transactions), + (self.sidecars.as_ref(), static_files.sidecars), ] .iter() .all(|(target_block_range, highest_static_fileted_block)| { @@ -135,6 +140,9 @@ impl StaticFileProducerInner { if let Some(block_range) = targets.receipts.clone() { segments.push((Box::new(segments::Receipts), block_range)); } + if let Some(block_range) = targets.sidecars.clone() { + segments.push((Box::new(segments::Sidecars), block_range)); + } segments.par_iter().try_for_each(|(segment, block_range)| -> ProviderResult<()> { debug!(target: "static_file", segment = %segment.segment(), ?block_range, "StaticFileProducer segment"); @@ -200,6 +208,9 @@ impl StaticFileProducerInner { finalized_block_number, ) }), + sidecars: finalized_block_numbers.sidecars.and_then(|finalized_block_number| { + self.get_static_file_target(highest_static_files.sidecars, finalized_block_number) + }), }; trace!( @@ -296,6 +307,7 @@ mod tests { headers: Some(1), receipts: Some(1), transactions: Some(1), + sidecars: Some(1), }) .expect("get static file targets"); assert_eq!( @@ -303,13 +315,19 @@ mod tests { StaticFileTargets { headers: Some(0..=1), receipts: Some(0..=1), - transactions: Some(0..=1) + transactions: Some(0..=1), + sidecars: Some(0..=1) } ); assert_matches!(static_file_producer.run(targets), Ok(_)); assert_eq!( provider_factory.static_file_provider().get_highest_static_files(), - HighestStaticFiles { headers: Some(1), receipts: Some(1), transactions: Some(1) } + HighestStaticFiles { + headers: Some(1), + receipts: Some(1), + transactions: Some(1), + sidecars: Some(1) + } ); let targets = static_file_producer @@ -317,6 +335,7 @@ mod tests { headers: Some(3), receipts: Some(3), transactions: Some(3), + sidecars: Some(3), }) .expect("get static file targets"); assert_eq!( @@ -324,13 +343,19 @@ mod tests { StaticFileTargets { headers: Some(2..=3), receipts: Some(2..=3), - transactions: Some(2..=3) + transactions: Some(2..=3), + sidecars: Some(2..=3) } ); assert_matches!(static_file_producer.run(targets), Ok(_)); assert_eq!( provider_factory.static_file_provider().get_highest_static_files(), - HighestStaticFiles { headers: Some(3), receipts: Some(3), transactions: Some(3) } + HighestStaticFiles { + headers: Some(3), + receipts: Some(3), + transactions: Some(3), + sidecars: Some(3) + } ); let targets = static_file_producer @@ -338,6 +363,7 @@ mod tests { headers: Some(4), receipts: Some(4), transactions: Some(4), + sidecars: Some(4), }) .expect("get static file targets"); assert_eq!( @@ -345,7 +371,8 @@ mod tests { StaticFileTargets { headers: Some(4..=4), receipts: Some(4..=4), - transactions: Some(4..=4) + transactions: Some(4..=4), + sidecars: Some(4..=4) } ); assert_matches!( @@ -354,7 +381,12 @@ mod tests { ); assert_eq!( provider_factory.static_file_provider().get_highest_static_files(), - HighestStaticFiles { headers: Some(3), receipts: Some(3), transactions: Some(3) } + HighestStaticFiles { + headers: Some(3), + receipts: Some(3), + transactions: Some(3), + sidecars: Some(3) + } ); } @@ -382,6 +414,7 @@ mod tests { headers: Some(1), receipts: Some(1), transactions: Some(1), + sidecars: Some(1), }) .expect("get static file targets"); assert_matches!(locked_producer.run(targets.clone()), Ok(_)); diff --git a/crates/static-file/types/src/lib.rs b/crates/static-file/types/src/lib.rs index f78d61f696..a58e3d4841 100644 --- a/crates/static-file/types/src/lib.rs +++ b/crates/static-file/types/src/lib.rs @@ -32,6 +32,9 @@ pub struct HighestStaticFiles { /// Highest static file block of transactions, inclusive. /// If [`None`], no static file is available. pub transactions: Option, + /// Highest static file block of sidecars, inclusive. + /// If [`None`], no static file is available. + pub sidecars: Option, } impl HighestStaticFiles { @@ -41,6 +44,7 @@ impl HighestStaticFiles { StaticFileSegment::Headers => self.headers, StaticFileSegment::Transactions => self.transactions, StaticFileSegment::Receipts => self.receipts, + StaticFileSegment::Sidecars => self.sidecars, } } @@ -50,6 +54,7 @@ impl HighestStaticFiles { StaticFileSegment::Headers => &mut self.headers, StaticFileSegment::Transactions => &mut self.transactions, StaticFileSegment::Receipts => &mut self.receipts, + StaticFileSegment::Sidecars => &mut self.sidecars, } } diff --git a/crates/static-file/types/src/segment.rs b/crates/static-file/types/src/segment.rs index d609f4a98b..ba2b2c98f9 100644 --- a/crates/static-file/types/src/segment.rs +++ b/crates/static-file/types/src/segment.rs @@ -34,6 +34,9 @@ pub enum StaticFileSegment { #[strum(serialize = "receipts")] /// Static File segment responsible for the `Receipts` table. Receipts, + #[strum(serialize = "sidecars")] + /// Static File segment responsible for the `Sidecars` table. + Sidecars, } impl StaticFileSegment { @@ -43,6 +46,7 @@ impl StaticFileSegment { Self::Headers => "headers", Self::Transactions => "transactions", Self::Receipts => "receipts", + Self::Sidecars => "sidecars", } } @@ -57,7 +61,7 @@ impl StaticFileSegment { }; match self { - Self::Headers | Self::Transactions | Self::Receipts => default_config, + Self::Headers | Self::Transactions | Self::Receipts | Self::Sidecars => default_config, } } @@ -66,6 +70,7 @@ impl StaticFileSegment { match self { Self::Headers => 3, Self::Transactions | Self::Receipts => 1, + Self::Sidecars => 2, } } @@ -138,6 +143,11 @@ impl StaticFileSegment { pub const fn is_receipts(&self) -> bool { matches!(self, Self::Receipts) } + + /// Returns `true` if the segment is `StaticFileSegment::Sidecars`. + pub const fn is_sidecars(&self) -> bool { + matches!(self, Self::Sidecars) + } } /// A segment header that contains information common to all segments. Used for storage. @@ -239,7 +249,7 @@ impl SegmentHeader { /// Increments tx end range depending on segment pub fn increment_tx(&mut self) { match self.segment { - StaticFileSegment::Headers => (), + StaticFileSegment::Headers | StaticFileSegment::Sidecars => (), StaticFileSegment::Transactions | StaticFileSegment::Receipts => { if let Some(tx_range) = &mut self.tx_range { tx_range.end += 1; @@ -253,7 +263,7 @@ impl SegmentHeader { /// Removes `num` elements from end of tx or block range. pub fn prune(&mut self, num: u64) { match self.segment { - StaticFileSegment::Headers => { + StaticFileSegment::Headers | StaticFileSegment::Sidecars => { if let Some(range) = &mut self.block_range { if num > range.end { self.block_range = None; @@ -297,7 +307,7 @@ impl SegmentHeader { /// Returns the row offset which depends on whether the segment is block or transaction based. pub fn start(&self) -> Option { match self.segment { - StaticFileSegment::Headers => self.block_start(), + StaticFileSegment::Headers | StaticFileSegment::Sidecars => self.block_start(), StaticFileSegment::Transactions | StaticFileSegment::Receipts => self.tx_start(), } } diff --git a/crates/storage/db-api/src/models/mod.rs b/crates/storage/db-api/src/models/mod.rs index 7f88c70af4..b94e65721d 100644 --- a/crates/storage/db-api/src/models/mod.rs +++ b/crates/storage/db-api/src/models/mod.rs @@ -241,6 +241,8 @@ impl_compression_for_compact!( PruneCheckpoint, ClientVersion, Requests, + BlobSidecar, + BlobSidecars, // Non-DB GenesisAccount ); diff --git a/crates/storage/db-common/src/init.rs b/crates/storage/db-common/src/init.rs index c6b4802b78..1bfe94c019 100644 --- a/crates/storage/db-common/src/init.rs +++ b/crates/storage/db-common/src/init.rs @@ -285,6 +285,10 @@ pub fn insert_genesis_header( let (difficulty, hash) = (header.difficulty, block_hash); let mut writer = static_file_provider.latest_writer(StaticFileSegment::Headers)?; writer.append_header(header, difficulty, hash)?; + + // skip the zero block index + let mut writer = static_file_provider.latest_writer(StaticFileSegment::Sidecars)?; + writer.append_sidecars(Default::default(), 0, B256::ZERO)?; } Ok(Some(_)) => {} Err(e) => return Err(e), diff --git a/crates/storage/db/src/static_file/mask.rs b/crates/storage/db/src/static_file/mask.rs index f5d35a193d..083285e295 100644 --- a/crates/storage/db/src/static_file/mask.rs +++ b/crates/storage/db/src/static_file/mask.rs @@ -31,7 +31,7 @@ macro_rules! add_segments { } }; } -add_segments!(Header, Receipt, Transaction); +add_segments!(Header, Receipt, Transaction, Sidecar); /// Trait for specifying a mask to select one column value. pub trait ColumnSelectorOne { diff --git a/crates/storage/db/src/static_file/masks.rs b/crates/storage/db/src/static_file/masks.rs index f3ce90f0df..40b5406e01 100644 --- a/crates/storage/db/src/static_file/masks.rs +++ b/crates/storage/db/src/static_file/masks.rs @@ -1,4 +1,4 @@ -use super::{ReceiptMask, TransactionMask}; +use super::{ReceiptMask, SidecarMask, TransactionMask}; use crate::{ add_static_file_mask, static_file::mask::{ColumnSelectorOne, ColumnSelectorTwo, HeaderMask}, @@ -6,6 +6,7 @@ use crate::{ }; use reth_db_api::table::Table; use reth_primitives::{BlockHash, Header}; +use reth_primitives_traits::BlobSidecars; // HEADER MASKS add_static_file_mask!(HeaderMask, Header, 0b001); @@ -20,3 +21,8 @@ add_static_file_mask!(ReceiptMask, ::Value, 0b1); // TRANSACTION MASKS add_static_file_mask!(TransactionMask, ::Value, 0b1); add_static_file_mask!(TransactionMask, RawValue<::Value>, 0b1); + +// SIDECARS MASKS +add_static_file_mask!(SidecarMask, BlobSidecars, 0b01); +add_static_file_mask!(SidecarMask, BlockHash, 0b10); +add_static_file_mask!(SidecarMask, BlobSidecars, BlockHash, 0b11); diff --git a/crates/storage/db/src/tables/mod.rs b/crates/storage/db/src/tables/mod.rs index 991b77b35a..b7559fb94c 100644 --- a/crates/storage/db/src/tables/mod.rs +++ b/crates/storage/db/src/tables/mod.rs @@ -35,7 +35,7 @@ use reth_primitives::{ parlia::Snapshot, Account, Address, BlockHash, BlockNumber, Bytecode, Header, Receipt, Requests, StorageEntry, TransactionSignedNoHash, TxHash, TxNumber, B256, }; -use reth_primitives_traits::IntegerList; +use reth_primitives_traits::{BlobSidecars, IntegerList}; use reth_prune_types::{PruneCheckpoint, PruneSegment}; use reth_stages_types::StageCheckpoint; use reth_trie_common::{StorageTrieEntry, StoredBranchNode, StoredNibbles, StoredNibblesSubKey}; @@ -309,6 +309,9 @@ tables! { /// Canonical only Stores transaction receipts. table Receipts; + /// Canonical only Stores block sidecars. + table Sidecars; + /// Stores all smart contract bytecodes. /// There will be multiple accounts that have same bytecode /// So we would need to introduce reference counter. diff --git a/crates/storage/provider/src/providers/database/mod.rs b/crates/storage/provider/src/providers/database/mod.rs index cfd4b627a9..dac523454e 100644 --- a/crates/storage/provider/src/providers/database/mod.rs +++ b/crates/storage/provider/src/providers/database/mod.rs @@ -14,13 +14,14 @@ use reth_db_api::{database::Database, models::StoredBlockBodyIndices}; use reth_errors::{RethError, RethResult}; use reth_evm::ConfigureEvmEnv; use reth_primitives::{ - parlia::Snapshot, Address, Block, BlockHash, BlockHashOrNumber, BlockNumber, BlockWithSenders, - Header, Receipt, SealedBlock, SealedBlockWithSenders, SealedHeader, StaticFileSegment, - TransactionMeta, TransactionSigned, TransactionSignedNoHash, TxHash, TxNumber, Withdrawal, - Withdrawals, B256, U256, + parlia::Snapshot, Address, BlobSidecars, Block, BlockHash, BlockHashOrNumber, BlockNumber, + BlockWithSenders, Header, Receipt, SealedBlock, SealedBlockWithSenders, SealedHeader, + StaticFileSegment, TransactionMeta, TransactionSigned, TransactionSignedNoHash, TxHash, + TxNumber, Withdrawal, Withdrawals, B256, U256, }; use reth_prune_types::{PruneCheckpoint, PruneSegment}; use reth_stages_types::{StageCheckpoint, StageId}; +use reth_storage_api::SidecarsProvider; use reth_storage_errors::provider::ProviderResult; use revm::primitives::{BlockEnv, CfgEnvWithHandlerCfg}; use std::{ @@ -470,6 +471,24 @@ impl WithdrawalsProvider for ProviderFactory { } } +impl SidecarsProvider for ProviderFactory +where + DB: Database, +{ + fn sidecars(&self, block_hash: &BlockHash) -> ProviderResult> { + self.provider()?.sidecars(block_hash) + } + + fn sidecars_by_number(&self, num: BlockNumber) -> ProviderResult> { + self.static_file_provider.get_with_static_file_or_database( + StaticFileSegment::Sidecars, + num, + |static_file| static_file.sidecars_by_number(num), + || self.provider()?.sidecars_by_number(num), + ) + } +} + impl RequestsProvider for ProviderFactory where DB: Database, diff --git a/crates/storage/provider/src/providers/database/provider.rs b/crates/storage/provider/src/providers/database/provider.rs index f7011d4e47..e3e9a496c6 100644 --- a/crates/storage/provider/src/providers/database/provider.rs +++ b/crates/storage/provider/src/providers/database/provider.rs @@ -9,9 +9,9 @@ use crate::{ Chain, EvmEnvProvider, FinalizedBlockReader, FinalizedBlockWriter, HashingWriter, HeaderProvider, HeaderSyncGap, HeaderSyncGapProvider, HistoricalStateProvider, HistoryWriter, LatestStateProvider, OriginalValuesKnown, ParliaSnapshotReader, ProviderError, - PruneCheckpointReader, PruneCheckpointWriter, RequestsProvider, StageCheckpointReader, - StateProviderBox, StateWriter, StatsReader, StorageReader, TransactionVariant, - TransactionsProvider, TransactionsProviderExt, WithdrawalsProvider, + PruneCheckpointReader, PruneCheckpointWriter, RequestsProvider, SidecarsProvider, + StageCheckpointReader, StateProviderBox, StateWriter, StatsReader, StorageReader, + TransactionVariant, TransactionsProvider, TransactionsProviderExt, WithdrawalsProvider, }; use itertools::{izip, Itertools}; use reth_chainspec::{ChainInfo, ChainSpec}; @@ -35,11 +35,11 @@ use reth_primitives::{ keccak256, parlia::Snapshot, revm::{config::revm_spec, env::fill_block_env}, - Account, Address, Block, BlockHash, BlockHashOrNumber, BlockNumber, BlockWithSenders, - GotExpected, Head, Header, Receipt, Requests, SealedBlock, SealedBlockWithSenders, - SealedHeader, StaticFileSegment, StorageEntry, TransactionMeta, TransactionSigned, - TransactionSignedEcRecovered, TransactionSignedNoHash, TxHash, TxNumber, Withdrawal, - Withdrawals, B256, U256, + Account, Address, BlobSidecars, Block, BlockHash, BlockHashOrNumber, BlockNumber, + BlockWithSenders, GotExpected, Head, Header, Receipt, Requests, SealedBlock, + SealedBlockWithSenders, SealedHeader, StaticFileSegment, StorageEntry, TransactionMeta, + TransactionSigned, TransactionSignedEcRecovered, TransactionSignedNoHash, TxHash, TxNumber, + Withdrawal, Withdrawals, B256, U256, }; use reth_prune_types::{PruneCheckpoint, PruneLimiter, PruneModes, PruneSegment}; use reth_stages_types::{StageCheckpoint, StageId}; @@ -384,6 +384,7 @@ impl DatabaseProvider { Range, Vec
, Option, + Option, Option, ) -> ProviderResult, { @@ -441,7 +442,16 @@ impl DatabaseProvider { .unwrap_or_default() }; - if let Ok(b) = assemble_block(header, tx_range, ommers, withdrawals, requests) { + let sidecars = + if self.chain_spec.is_cancun_active_at_timestamp(header_ref.timestamp) { + self.static_file_provider.sidecars(&header_ref.hash_slow())? + } else { + None + }; + + if let Ok(b) = + assemble_block(header, tx_range, ommers, withdrawals, sidecars, requests) + { blocks.push(b); } } @@ -475,6 +485,7 @@ impl DatabaseProvider { Vec, Vec
, Option, + Option, Option, Vec
, ) -> ProviderResult, @@ -482,40 +493,43 @@ impl DatabaseProvider { let mut tx_cursor = self.tx.cursor_read::()?; let mut senders_cursor = self.tx.cursor_read::()?; - self.block_range(range, headers_range, |header, tx_range, ommers, withdrawals, requests| { - let (body, senders) = if tx_range.is_empty() { - (Vec::new(), Vec::new()) - } else { - let body = self - .transactions_by_tx_range_with_cursor(tx_range.clone(), &mut tx_cursor)? - .into_iter() - .map(Into::into) - .collect::>(); - // fetch senders from the senders table - let known_senders = - senders_cursor + self.block_range( + range, + headers_range, + |header, tx_range, ommers, withdrawals, sidecars, requests| { + let (body, senders) = if tx_range.is_empty() { + (Vec::new(), Vec::new()) + } else { + let body = self + .transactions_by_tx_range_with_cursor(tx_range.clone(), &mut tx_cursor)? + .into_iter() + .map(Into::into) + .collect::>(); + // fetch senders from the senders table + let known_senders = senders_cursor .walk_range(tx_range.clone())? .collect::, _>>()?; - let mut senders = Vec::with_capacity(body.len()); - for (tx_num, tx) in tx_range.zip(body.iter()) { - match known_senders.get(&tx_num) { - None => { - // recover the sender from the transaction if not found - let sender = tx - .recover_signer_unchecked() - .ok_or_else(|| ProviderError::SenderRecoveryError)?; - senders.push(sender); + let mut senders = Vec::with_capacity(body.len()); + for (tx_num, tx) in tx_range.zip(body.iter()) { + match known_senders.get(&tx_num) { + None => { + // recover the sender from the transaction if not found + let sender = tx + .recover_signer_unchecked() + .ok_or_else(|| ProviderError::SenderRecoveryError)?; + senders.push(sender); + } + Some(sender) => senders.push(*sender), } - Some(sender) => senders.push(*sender), } - } - (body, senders) - }; + (body, senders) + }; - assemble_block(header, body, ommers, withdrawals, requests, senders) - }) + assemble_block(header, body, ommers, withdrawals, sidecars, requests, senders) + }, + ) } } @@ -968,8 +982,15 @@ impl DatabaseProvider { requests = None; } + // sidecars can be missing + let sidecars = if self.chain_spec.is_cancun_active_at_timestamp(header.timestamp) { + self.static_file_provider.sidecars(&header.hash())? + } else { + None + }; + blocks.push(SealedBlockWithSenders { - block: SealedBlock { header, body, ommers, withdrawals, requests }, + block: SealedBlock { header, body, ommers, withdrawals, sidecars, requests }, senders, }) } @@ -1502,7 +1523,16 @@ impl BlockReader for DatabaseProvider { None => return Ok(None), }; - return Ok(Some(Block { header, body: transactions, ommers, withdrawals, requests })) + let sidecars = self.sidecars(&self.block_hash(number)?.unwrap_or_default())?; + + return Ok(Some(Block { + header, + body: transactions, + ommers, + withdrawals, + sidecars, + requests, + })) } } @@ -1589,7 +1619,9 @@ impl BlockReader for DatabaseProvider { }) .collect(); - Block { header, body, ommers, withdrawals, requests } + let sidecars = self.sidecars(&self.block_hash(block_number)?.unwrap_or_default())?; + + Block { header, body, ommers, withdrawals, sidecars, requests } // Note: we're using unchecked here because we know the block contains valid txs wrt to // its height and can ignore the s value check so pre EIP-2 txs are allowed .try_with_senders_unchecked(senders) @@ -1602,7 +1634,7 @@ impl BlockReader for DatabaseProvider { self.block_range( range, |range| self.headers_range(range), - |header, tx_range, ommers, withdrawals, requests| { + |header, tx_range, ommers, withdrawals, sidecars, requests| { let body = if tx_range.is_empty() { Vec::new() } else { @@ -1611,7 +1643,7 @@ impl BlockReader for DatabaseProvider { .map(Into::into) .collect() }; - Ok(Block { header, body, ommers, withdrawals, requests }) + Ok(Block { header, body, ommers, withdrawals, sidecars, requests }) }, ) } @@ -1623,8 +1655,8 @@ impl BlockReader for DatabaseProvider { self.block_with_senders_range( range, |range| self.headers_range(range), - |header, body, ommers, withdrawals, requests, senders| { - Block { header, body, ommers, withdrawals, requests } + |header, body, ommers, withdrawals, sidecars, requests, senders| { + Block { header, body, ommers, withdrawals, sidecars, requests } .try_with_senders_unchecked(senders) .map_err(|_| ProviderError::SenderRecoveryError) }, @@ -1638,9 +1670,9 @@ impl BlockReader for DatabaseProvider { self.block_with_senders_range( range, |range| self.sealed_headers_range(range), - |header, body, ommers, withdrawals, requests, senders| { + |header, body, ommers, withdrawals, sidecars, requests, senders| { SealedBlockWithSenders::new( - SealedBlock { header, body, ommers, withdrawals, requests }, + SealedBlock { header, body, ommers, withdrawals, sidecars, requests }, senders, ) .ok_or(ProviderError::SenderRecoveryError) @@ -1949,6 +1981,25 @@ impl WithdrawalsProvider for DatabaseProvider { } } +impl SidecarsProvider for DatabaseProvider { + fn sidecars(&self, block_hash: &BlockHash) -> ProviderResult> { + if let Some(num) = self.block_number(*block_hash)? { + Ok(self.sidecars_by_number(num)?) + } else { + Ok(None) + } + } + + fn sidecars_by_number(&self, num: BlockNumber) -> ProviderResult> { + self.static_file_provider.get_with_static_file_or_database( + StaticFileSegment::Sidecars, + num, + |static_file| static_file.sidecars_by_number(num), + || Ok(self.tx.get::(num)?), + ) + } +} + impl RequestsProvider for DatabaseProvider { fn requests_by_block( &self, diff --git a/crates/storage/provider/src/providers/mod.rs b/crates/storage/provider/src/providers/mod.rs index 3fdc1717cd..1a0643b006 100644 --- a/crates/storage/provider/src/providers/mod.rs +++ b/crates/storage/provider/src/providers/mod.rs @@ -19,8 +19,8 @@ use reth_db_api::{ }; use reth_evm::ConfigureEvmEnv; use reth_primitives::{ - parlia::Snapshot, Account, Address, Block, BlockHash, BlockHashOrNumber, BlockId, BlockNumHash, - BlockNumber, BlockNumberOrTag, BlockWithSenders, Header, Receipt, SealedBlock, + parlia::Snapshot, Account, Address, BlobSidecars, Block, BlockHash, BlockHashOrNumber, BlockId, + BlockNumHash, BlockNumber, BlockNumberOrTag, BlockWithSenders, Header, Receipt, SealedBlock, SealedBlockWithSenders, SealedHeader, TransactionMeta, TransactionSigned, TransactionSignedNoHash, TxHash, TxNumber, Withdrawal, Withdrawals, B256, U256, }; @@ -60,6 +60,7 @@ use chain_info::ChainInfoTracker; mod consistent_view; use alloy_rpc_types_engine::ForkchoiceState; pub use consistent_view::{ConsistentDbView, ConsistentViewError}; +use reth_storage_api::SidecarsProvider; /// The main type for interacting with the blockchain. /// @@ -482,6 +483,19 @@ where } } +impl SidecarsProvider for BlockchainProvider +where + DB: Database, +{ + fn sidecars(&self, block_hash: &BlockHash) -> ProviderResult> { + self.database.sidecars(block_hash) + } + + fn sidecars_by_number(&self, num: BlockNumber) -> ProviderResult> { + self.database.sidecars_by_number(num) + } +} + impl RequestsProvider for BlockchainProvider where DB: Database, diff --git a/crates/storage/provider/src/providers/static_file/jar.rs b/crates/storage/provider/src/providers/static_file/jar.rs index 5e20572e3d..56a1113bf0 100644 --- a/crates/storage/provider/src/providers/static_file/jar.rs +++ b/crates/storage/provider/src/providers/static_file/jar.rs @@ -7,12 +7,16 @@ use crate::{ TransactionsProvider, }; use reth_chainspec::ChainInfo; -use reth_db::static_file::{HeaderMask, ReceiptMask, StaticFileCursor, TransactionMask}; +use reth_db::static_file::{ + HeaderMask, ReceiptMask, SidecarMask, StaticFileCursor, TransactionMask, +}; use reth_db_api::models::CompactU256; use reth_primitives::{ - Address, BlockHash, BlockHashOrNumber, BlockNumber, Header, Receipt, SealedHeader, - TransactionMeta, TransactionSigned, TransactionSignedNoHash, TxHash, TxNumber, B256, U256, + Address, BlobSidecars, BlockHash, BlockHashOrNumber, BlockNumber, Header, Receipt, + SealedHeader, TransactionMeta, TransactionSigned, TransactionSignedNoHash, TxHash, TxNumber, + B256, U256, }; +use reth_storage_api::SidecarsProvider; use reth_storage_errors::provider::{ProviderError, ProviderResult}; use std::{ ops::{Deref, RangeBounds}, @@ -325,3 +329,17 @@ impl<'a> ReceiptProvider for StaticFileJarProvider<'a> { Ok(receipts) } } + +impl<'a> SidecarsProvider for StaticFileJarProvider<'a> { + fn sidecars(&self, block_hash: &BlockHash) -> ProviderResult> { + Ok(self + .cursor()? + .get_two::>(block_hash.into())? + .filter(|(_, hash)| hash == block_hash) + .map(|(sc, _)| sc)) + } + + fn sidecars_by_number(&self, num: BlockNumber) -> ProviderResult> { + self.cursor()?.get_one::>(num.into()) + } +} diff --git a/crates/storage/provider/src/providers/static_file/manager.rs b/crates/storage/provider/src/providers/static_file/manager.rs index 39e588c7f5..6806bf7b95 100644 --- a/crates/storage/provider/src/providers/static_file/manager.rs +++ b/crates/storage/provider/src/providers/static_file/manager.rs @@ -12,7 +12,9 @@ use parking_lot::RwLock; use reth_chainspec::ChainInfo; use reth_db::{ lockfile::StorageLock, - static_file::{iter_static_files, HeaderMask, ReceiptMask, StaticFileCursor, TransactionMask}, + static_file::{ + iter_static_files, HeaderMask, ReceiptMask, SidecarMask, StaticFileCursor, TransactionMask, + }, tables, }; use reth_db_api::{ @@ -25,12 +27,13 @@ use reth_nippy_jar::NippyJar; use reth_primitives::{ keccak256, static_file::{find_fixed_range, HighestStaticFiles, SegmentHeader, SegmentRangeInclusive}, - Address, Block, BlockHash, BlockHashOrNumber, BlockNumber, BlockWithSenders, Header, Receipt, - SealedBlock, SealedBlockWithSenders, SealedHeader, StaticFileSegment, TransactionMeta, - TransactionSigned, TransactionSignedNoHash, TxHash, TxNumber, Withdrawal, Withdrawals, B256, - U256, + Address, BlobSidecars, Block, BlockHash, BlockHashOrNumber, BlockNumber, BlockWithSenders, + Header, Receipt, SealedBlock, SealedBlockWithSenders, SealedHeader, StaticFileSegment, + TransactionMeta, TransactionSigned, TransactionSignedNoHash, TxHash, TxNumber, Withdrawal, + Withdrawals, B256, U256, }; use reth_stages_types::{PipelineTarget, StageId}; +use reth_storage_api::SidecarsProvider; use reth_storage_errors::provider::{ProviderError, ProviderResult}; use std::{ collections::{hash_map::Entry, BTreeMap, HashMap}, @@ -631,6 +634,12 @@ impl StaticFileProvider { highest_tx, highest_block, )?, + StaticFileSegment::Sidecars => self.ensure_invariants::<_, tables::Sidecars>( + provider, + segment, + highest_block, + highest_block, + )?, } { update_unwind_target(unwind); } @@ -689,7 +698,7 @@ impl StaticFileProvider { let checkpoint_block_number = provider .get_stage_checkpoint(match segment { StaticFileSegment::Headers => StageId::Headers, - StaticFileSegment::Transactions => StageId::Bodies, + StaticFileSegment::Transactions | StaticFileSegment::Sidecars => StageId::Bodies, StaticFileSegment::Receipts => StageId::Execution, })? .unwrap_or_default() @@ -721,6 +730,8 @@ impl StaticFileProvider { let mut writer = self.latest_writer(segment)?; if segment.is_headers() { writer.prune_headers(highest_static_file_block - checkpoint_block_number)?; + } else if segment.is_sidecars() { + writer.prune_sidecars(highest_static_file_block - checkpoint_block_number)?; } else if let Some(block) = provider.block_body_indices(checkpoint_block_number)? { let number = highest_static_file_entry - block.last_tx_num(); if segment.is_receipts() { @@ -754,6 +765,7 @@ impl StaticFileProvider { headers: self.get_highest_static_file_block(StaticFileSegment::Headers), receipts: self.get_highest_static_file_block(StaticFileSegment::Receipts), transactions: self.get_highest_static_file_block(StaticFileSegment::Transactions), + sidecars: self.get_highest_static_file_block(StaticFileSegment::Sidecars), } } @@ -800,7 +812,9 @@ impl StaticFileProvider { StaticFileSegment::Headers => { self.get_segment_provider_from_block(segment, start, None) } - StaticFileSegment::Transactions | StaticFileSegment::Receipts => { + StaticFileSegment::Transactions | + StaticFileSegment::Receipts | + StaticFileSegment::Sidecars => { self.get_segment_provider_from_transaction(segment, start, None) } }; @@ -870,7 +884,9 @@ impl StaticFileProvider { StaticFileSegment::Headers => { self.get_segment_provider_from_block(segment, start, None) } - StaticFileSegment::Transactions | StaticFileSegment::Receipts => { + StaticFileSegment::Transactions | + StaticFileSegment::Receipts | + StaticFileSegment::Sidecars => { self.get_segment_provider_from_transaction(segment, start, None) } }; @@ -914,7 +930,9 @@ impl StaticFileProvider { { // If there is, check the maximum block or transaction number of the segment. let static_file_upper_bound = match segment { - StaticFileSegment::Headers => self.get_highest_static_file_block(segment), + StaticFileSegment::Headers | StaticFileSegment::Sidecars => { + self.get_highest_static_file_block(segment) + } StaticFileSegment::Transactions | StaticFileSegment::Receipts => { self.get_highest_static_file_tx(segment) } @@ -957,9 +975,9 @@ impl StaticFileProvider { // If there is, check the maximum block or transaction number of the segment. if let Some(static_file_upper_bound) = match segment { StaticFileSegment::Headers => self.get_highest_static_file_block(segment), - StaticFileSegment::Transactions | StaticFileSegment::Receipts => { - self.get_highest_static_file_tx(segment) - } + StaticFileSegment::Transactions | + StaticFileSegment::Receipts | + StaticFileSegment::Sidecars => self.get_highest_static_file_tx(segment), } { if block_or_tx_range.start <= static_file_upper_bound { let end = block_or_tx_range.end.min(static_file_upper_bound + 1); @@ -1493,6 +1511,34 @@ impl WithdrawalsProvider for StaticFileProvider { } } +impl SidecarsProvider for StaticFileProvider { + fn sidecars(&self, block_hash: &BlockHash) -> ProviderResult> { + self.find_static_file(StaticFileSegment::Sidecars, |jar_provider| { + Ok(jar_provider + .cursor()? + .get_two::>(block_hash.into())? + .and_then(|(sc, hash)| { + if &hash == block_hash { + return Some(sc) + } + None + })) + }) + } + + fn sidecars_by_number(&self, num: BlockNumber) -> ProviderResult> { + self.get_segment_provider_from_block(StaticFileSegment::Sidecars, num, None) + .and_then(|provider| provider.sidecars_by_number(num)) + .or_else(|err| { + if let ProviderError::MissingStaticFileBlock(_, _) = err { + Ok(None) + } else { + Err(err) + } + }) + } +} + impl RequestsProvider for StaticFileProvider { fn requests_by_block( &self, diff --git a/crates/storage/provider/src/providers/static_file/mod.rs b/crates/storage/provider/src/providers/static_file/mod.rs index 5c2057b3b5..14f747a4f5 100644 --- a/crates/storage/provider/src/providers/static_file/mod.rs +++ b/crates/storage/provider/src/providers/static_file/mod.rs @@ -60,14 +60,18 @@ mod tests { use crate::{test_utils::create_test_provider_factory, HeaderProvider}; use rand::seq::SliceRandom; use reth_db::{ - static_file::create_static_file_T1_T2_T3, CanonicalHeaders, HeaderNumbers, - HeaderTerminalDifficulties, Headers, RawTable, + static_file::{create_static_file_T1_T2, create_static_file_T1_T2_T3}, + CanonicalHeaders, HeaderNumbers, HeaderTerminalDifficulties, Headers, RawTable, Sidecars, }; use reth_db_api::{ cursor::DbCursorRO, transaction::{DbTx, DbTxMut}, }; - use reth_primitives::{static_file::find_fixed_range, BlockNumber, B256, U256}; + use reth_primitives::{ + static_file::find_fixed_range, BlobSidecar, BlobSidecars, BlobTransactionSidecar, + BlockNumber, B256, U256, + }; + use reth_storage_api::SidecarsProvider; use reth_testing_utils::generators::{self, random_header_range}; #[test] @@ -167,9 +171,13 @@ mod tests { let header_hash = header.hash(); let header = header.unseal(); + let tmp = jar_provider.header_by_number(1u64).unwrap().unwrap(); + println!("{:?}", tmp.number); + // Compare Header assert_eq!(header, db_provider.header(&header_hash).unwrap().unwrap()); assert_eq!(header, jar_provider.header(&header_hash).unwrap().unwrap()); + assert_eq!(header, jar_provider.header_by_number(header.number).unwrap().unwrap()); // Compare HeaderTerminalDifficulties assert_eq!( @@ -179,4 +187,108 @@ mod tests { } } } + + #[test] + fn test_sidecars() { + // Ranges + let row_count = 100u64; + let range = 0..=(row_count - 1); + let segment_header = SegmentHeader::new( + range.clone().into(), + Some(range.clone().into()), + Some(range.clone().into()), + StaticFileSegment::Sidecars, + ); + + // Data sources + let factory = create_test_provider_factory(); + let static_files_path = tempfile::tempdir().unwrap(); + let static_file = static_files_path + .path() + .join(StaticFileSegment::Sidecars.filename(&find_fixed_range(*range.end()))); + + // Setup data + let mut provider_rw = factory.provider_rw().unwrap(); + let tx = provider_rw.tx_mut(); + let mut sidecars_set = Vec::with_capacity(100); + for i in 0..100 { + let sidecars = BlobSidecars::new(vec![BlobSidecar { + blob_transaction_sidecar: BlobTransactionSidecar { + blobs: vec![], + commitments: vec![Default::default()], + proofs: vec![Default::default()], + }, + block_number: U256::from(i), + block_hash: B256::random(), + tx_index: rand::random::(), + tx_hash: B256::random(), + }]); + let block_number = sidecars[0].block_number.to(); + let block_hash = sidecars[0].block_hash; + + tx.put::(block_number, block_hash).unwrap(); + tx.put::(block_hash, block_number).unwrap(); + tx.put::(block_number, sidecars.clone()).unwrap(); + + sidecars_set.push(sidecars); + } + provider_rw.commit().unwrap(); + + // Create StaticFile + { + let with_compression = true; + let with_filter = true; + + let mut nippy_jar = NippyJar::new(2, static_file.as_path(), segment_header); + + if with_compression { + nippy_jar = nippy_jar.with_zstd(false, 0); + } + + if with_filter { + nippy_jar = nippy_jar.with_cuckoo_filter(row_count as usize + 10).with_fmph(); + } + + let provider = factory.provider().unwrap(); + let tx = provider.tx_ref(); + + // Hacky type inference. TODO fix + let mut none_vec = Some(vec![vec![vec![0u8]].into_iter()]); + let _ = none_vec.take(); + + // Generate list of hashes for filters & PHF + let mut cursor = tx.cursor_read::>().unwrap(); + let hashes = cursor + .walk(None) + .unwrap() + .map(|row| row.map(|(_key, value)| value.into_value()).map_err(|e| e.into())); + + create_static_file_T1_T2::( + tx, + range, + None, + none_vec, + Some(hashes), + row_count as usize, + nippy_jar, + ) + .unwrap(); + } + + // Use providers to query sidecars data and compare if it matches + { + let db_provider = factory.provider().unwrap(); + let manager = + StaticFileProvider::read_write(static_files_path.path()).unwrap().with_filters(); + let jar_provider = manager + .get_segment_provider_from_block(StaticFileSegment::Sidecars, 0, Some(&static_file)) + .unwrap(); + + for i in 0..100 { + let hash = sidecars_set[i][0].block_hash; + assert_eq!(sidecars_set[i], db_provider.sidecars(&hash).unwrap().unwrap()); + assert_eq!(sidecars_set[i], jar_provider.sidecars(&hash).unwrap().unwrap()); + } + } + } } diff --git a/crates/storage/provider/src/providers/static_file/writer.rs b/crates/storage/provider/src/providers/static_file/writer.rs index 304429a015..a1385580fe 100644 --- a/crates/storage/provider/src/providers/static_file/writer.rs +++ b/crates/storage/provider/src/providers/static_file/writer.rs @@ -9,8 +9,8 @@ use reth_db_api::models::CompactU256; use reth_nippy_jar::{ConsistencyFailStrategy, NippyJar, NippyJarError, NippyJarWriter}; use reth_primitives::{ static_file::{find_fixed_range, SegmentHeader, SegmentRangeInclusive}, - BlockHash, BlockNumber, Header, Receipt, StaticFileSegment, TransactionSignedNoHash, TxNumber, - U256, + BlobSidecars, BlockHash, BlockNumber, Header, Receipt, StaticFileSegment, + TransactionSignedNoHash, TxNumber, U256, }; use reth_storage_errors::provider::{ProviderError, ProviderResult}; use std::{ @@ -145,7 +145,9 @@ impl StaticFileProviderRW { })?; // If we have lost rows (in this run or previous), we need to update the [SegmentHeader]. - let expected_rows = if self.user_header().segment().is_headers() { + let expected_rows = if self.user_header().segment().is_headers() || + self.user_header().segment().is_sidecars() + { self.user_header().block_len().unwrap_or_default() } else { self.user_header().tx_len().unwrap_or_default() @@ -178,6 +180,7 @@ impl StaticFileProviderRW { StaticFileSegment::Receipts => { self.prune_receipt_data(to_delete, last_block_number.expect("should exist"))? } + StaticFileSegment::Sidecars => self.prune_sidecars_data(to_delete)?, } } @@ -348,7 +351,7 @@ impl StaticFileProviderRW { let mut remaining_rows = num_rows; while remaining_rows > 0 { let len = match segment { - StaticFileSegment::Headers => { + StaticFileSegment::Headers | StaticFileSegment::Sidecars => { self.writer.user_header().block_len().unwrap_or_default() } StaticFileSegment::Transactions | StaticFileSegment::Receipts => { @@ -493,6 +496,39 @@ impl StaticFileProviderRW { Ok(block_number) } + /// Appends sidecars to static file. + /// + /// It **CALLS** `increment_block()` since the number of sidecars is equal to the number of + /// blocks. + /// + /// Returns the current [`BlockNumber`] as seen in the static file. + pub fn append_sidecars( + &mut self, + sidecars: BlobSidecars, + block_number: BlockNumber, + hash: BlockHash, + ) -> ProviderResult { + let start = Instant::now(); + self.ensure_no_queued_prune()?; + + debug_assert!(self.writer.user_header().segment() == StaticFileSegment::Sidecars); + + let block_number = self.increment_block(StaticFileSegment::Sidecars, block_number)?; + + self.append_column(sidecars)?; + self.append_column(hash)?; + + if let Some(metrics) = &self.metrics { + metrics.record_segment_operation( + StaticFileSegment::Sidecars, + StaticFileProviderOperation::Append, + Some(start.elapsed()), + ); + } + + Ok(block_number) + } + /// Appends transaction to static file. /// /// It **DOES NOT CALL** `increment_block()`, it should be handled elsewhere. There might be @@ -615,6 +651,12 @@ impl StaticFileProviderRW { self.queue_prune(to_delete, None) } + /// Adds an instruction to prune `to_delete` sidecars during commit. + pub fn prune_sidecars(&mut self, to_delete: u64) -> ProviderResult<()> { + debug_assert_eq!(self.writer.user_header().segment(), StaticFileSegment::Sidecars); + self.queue_prune(to_delete, None) + } + /// Adds an instruction to prune `to_delete` elements during commit. /// /// Note: `last_block` refers to the block the unwinds ends at if dealing with transaction-based @@ -707,6 +749,26 @@ impl StaticFileProviderRW { Ok(()) } + /// Prunes the last `to_delete` sidecars from the data file. + fn prune_sidecars_data(&mut self, to_delete: u64) -> ProviderResult<()> { + let start = Instant::now(); + + let segment = StaticFileSegment::Sidecars; + debug_assert!(self.writer.user_header().segment() == segment); + + self.truncate(segment, to_delete, None)?; + + if let Some(metrics) = &self.metrics { + metrics.record_segment_operation( + StaticFileSegment::Sidecars, + StaticFileProviderOperation::Prune, + Some(start.elapsed()), + ); + } + + Ok(()) + } + fn reader(&self) -> StaticFileProvider { Self::upgrade_provider_to_strong_reference(&self.reader) } diff --git a/crates/storage/provider/src/test_utils/blocks.rs b/crates/storage/provider/src/test_utils/blocks.rs index 2a0f900a5e..f534bf9faf 100644 --- a/crates/storage/provider/src/test_utils/blocks.rs +++ b/crates/storage/provider/src/test_utils/blocks.rs @@ -5,9 +5,9 @@ use alloy_rlp::Decodable; use reth_db::tables; use reth_db_api::{database::Database, models::StoredBlockBodyIndices}; use reth_primitives::{ - alloy_primitives, b256, hex_literal::hex, Account, Address, BlockNumber, Bytes, Header, - Receipt, Requests, SealedBlock, SealedBlockWithSenders, TxType, Withdrawal, Withdrawals, B256, - U256, + alloy_primitives, b256, hex_literal::hex, Account, Address, BlobSidecars, BlockNumber, Bytes, + Header, Receipt, Requests, SealedBlock, SealedBlockWithSenders, TxType, Withdrawal, + Withdrawals, B256, U256, }; use reth_trie::root::{state_root_unhashed, storage_root_unhashed}; use revm::{ @@ -108,6 +108,7 @@ pub fn genesis() -> SealedBlock { body: vec![], ommers: vec![], withdrawals: Some(Withdrawals::default()), + sidecars: Some(BlobSidecars::default()), requests: Some(Requests::default()), } } diff --git a/crates/storage/provider/src/test_utils/mock.rs b/crates/storage/provider/src/test_utils/mock.rs index 974982121a..ff1b098904 100644 --- a/crates/storage/provider/src/test_utils/mock.rs +++ b/crates/storage/provider/src/test_utils/mock.rs @@ -10,11 +10,13 @@ use reth_chainspec::{ChainInfo, ChainSpec}; use reth_db_api::models::{AccountBeforeTx, StoredBlockBodyIndices}; use reth_evm::ConfigureEvmEnv; use reth_primitives::{ - keccak256, Account, Address, Block, BlockHash, BlockHashOrNumber, BlockId, BlockNumber, - BlockWithSenders, Bytecode, Bytes, Header, Receipt, SealedBlock, SealedBlockWithSenders, - SealedHeader, StorageKey, StorageValue, TransactionMeta, TransactionSigned, - TransactionSignedNoHash, TxHash, TxNumber, Withdrawal, Withdrawals, B256, U256, + keccak256, Account, Address, BlobSidecars, Block, BlockHash, BlockHashOrNumber, BlockId, + BlockNumber, BlockWithSenders, Bytecode, Bytes, Header, Receipt, SealedBlock, + SealedBlockWithSenders, SealedHeader, StorageKey, StorageValue, TransactionMeta, + TransactionSigned, TransactionSignedNoHash, TxHash, TxNumber, Withdrawal, Withdrawals, B256, + U256, }; +use reth_storage_api::SidecarsProvider; use reth_storage_errors::provider::{ProviderError, ProviderResult}; use reth_trie::{updates::TrieUpdates, AccountProof}; use revm::{ @@ -686,6 +688,16 @@ impl WithdrawalsProvider for MockEthProvider { } } +impl SidecarsProvider for MockEthProvider { + fn sidecars(&self, _block_hash: &BlockHash) -> ProviderResult> { + Ok(None) + } + + fn sidecars_by_number(&self, _num: BlockNumber) -> ProviderResult> { + Ok(None) + } +} + impl RequestsProvider for MockEthProvider { fn requests_by_block( &self, diff --git a/crates/storage/provider/src/test_utils/noop.rs b/crates/storage/provider/src/test_utils/noop.rs index f029e7b570..3620aace8e 100644 --- a/crates/storage/provider/src/test_utils/noop.rs +++ b/crates/storage/provider/src/test_utils/noop.rs @@ -10,13 +10,14 @@ use reth_chainspec::{ChainInfo, ChainSpec, MAINNET}; use reth_db_api::models::{AccountBeforeTx, StoredBlockBodyIndices}; use reth_evm::ConfigureEvmEnv; use reth_primitives::{ - parlia::Snapshot, Account, Address, Block, BlockHash, BlockHashOrNumber, BlockId, BlockNumber, - BlockWithSenders, Bytecode, Header, Receipt, SealedBlock, SealedBlockWithSenders, SealedHeader, - StorageKey, StorageValue, TransactionMeta, TransactionSigned, TransactionSignedNoHash, TxHash, - TxNumber, Withdrawal, Withdrawals, B256, U256, + parlia::Snapshot, Account, Address, BlobSidecars, Block, BlockHash, BlockHashOrNumber, BlockId, + BlockNumber, BlockWithSenders, Bytecode, Header, Receipt, SealedBlock, SealedBlockWithSenders, + SealedHeader, StorageKey, StorageValue, TransactionMeta, TransactionSigned, + TransactionSignedNoHash, TxHash, TxNumber, Withdrawal, Withdrawals, B256, U256, }; use reth_prune_types::{PruneCheckpoint, PruneSegment}; use reth_stages_types::{StageCheckpoint, StageId}; +use reth_storage_api::SidecarsProvider; use reth_storage_errors::provider::ProviderResult; use reth_trie::{updates::TrieUpdates, AccountProof}; use revm::{ @@ -455,6 +456,16 @@ impl WithdrawalsProvider for NoopProvider { } } +impl SidecarsProvider for NoopProvider { + fn sidecars(&self, _block_hash: &BlockHash) -> ProviderResult> { + Ok(None) + } + + fn sidecars_by_number(&self, _num: BlockNumber) -> ProviderResult> { + Ok(None) + } +} + impl RequestsProvider for NoopProvider { fn requests_by_block( &self, diff --git a/crates/storage/storage-api/src/block.rs b/crates/storage/storage-api/src/block.rs index 42ab05f225..0f1c77f632 100644 --- a/crates/storage/storage-api/src/block.rs +++ b/crates/storage/storage-api/src/block.rs @@ -1,6 +1,7 @@ use crate::{ BlockIdReader, BlockNumReader, HeaderProvider, ReceiptProvider, ReceiptProviderIdExt, - RequestsProvider, TransactionVariant, TransactionsProvider, WithdrawalsProvider, + RequestsProvider, SidecarsProvider, TransactionVariant, TransactionsProvider, + WithdrawalsProvider, }; use reth_db_api::models::StoredBlockBodyIndices; use reth_primitives::{ @@ -53,6 +54,7 @@ pub trait BlockReader: + ReceiptProvider + RequestsProvider + WithdrawalsProvider + + SidecarsProvider + Send + Sync { diff --git a/crates/storage/storage-api/src/lib.rs b/crates/storage/storage-api/src/lib.rs index c5663bc2a3..c6af2271c4 100644 --- a/crates/storage/storage-api/src/lib.rs +++ b/crates/storage/storage-api/src/lib.rs @@ -51,3 +51,6 @@ pub use trie::*; mod withdrawals; pub use withdrawals::*; + +mod sidecars; +pub use sidecars::*; diff --git a/crates/storage/storage-api/src/requests.rs b/crates/storage/storage-api/src/requests.rs index c8b13dc05d..7f3b3c95e5 100644 --- a/crates/storage/storage-api/src/requests.rs +++ b/crates/storage/storage-api/src/requests.rs @@ -4,7 +4,7 @@ use reth_storage_errors::provider::ProviderResult; /// Client trait for fetching EIP-7685 [Requests] for blocks. #[auto_impl::auto_impl(&, Arc)] pub trait RequestsProvider: Send + Sync { - /// Get withdrawals by block id. + /// Get requests by block id. fn requests_by_block( &self, id: BlockHashOrNumber, diff --git a/crates/storage/storage-api/src/sidecars.rs b/crates/storage/storage-api/src/sidecars.rs new file mode 100644 index 0000000000..ffc1064593 --- /dev/null +++ b/crates/storage/storage-api/src/sidecars.rs @@ -0,0 +1,16 @@ +use reth_primitives::{BlobSidecars, BlockHash, BlockNumber}; +use reth_storage_errors::provider::ProviderResult; + +/// Client trait for fetching [BlobSidecars] for blocks. +#[auto_impl::auto_impl(&, Arc)] +pub trait SidecarsProvider: Send + Sync { + /// Get sidecars by block hash + /// + /// Returns `None` if the sidecars is not found. + fn sidecars(&self, block_hash: &BlockHash) -> ProviderResult>; + + /// Get sidecar by block number. + /// + /// Returns `None` if the sidecars is not found. + fn sidecars_by_number(&self, num: BlockNumber) -> ProviderResult>; +} diff --git a/testing/testing-utils/src/generators.rs b/testing/testing-utils/src/generators.rs index 4ef65043f6..73715d0cb7 100644 --- a/testing/testing-utils/src/generators.rs +++ b/testing/testing-utils/src/generators.rs @@ -164,6 +164,7 @@ pub fn random_block( body: transactions, ommers, withdrawals: None, + sidecars: None, requests: None, } }