From 534b32ee33980542bbdf16154b95db8c5d47fbf9 Mon Sep 17 00:00:00 2001 From: clabby Date: Thu, 7 Nov 2024 11:19:54 -0500 Subject: [PATCH] Revert "chore: bump alloy deps (#788)" (#791) This reverts commit 7c5567b3125c44bffa73e83defaf87dd2369accb. --- Cargo.lock | 537 +++++------------- Cargo.toml | 30 +- bin/client/src/l1/blob_provider.rs | 4 +- bin/host/Cargo.toml | 1 + bin/host/src/fetcher/mod.rs | 15 +- crates/derive-alloy/src/alloy_providers.rs | 3 +- crates/derive-alloy/src/beacon_client.rs | 4 +- crates/derive-alloy/src/blob_provider.rs | 20 +- crates/derive-alloy/src/test_utils.rs | 2 +- crates/derive/Cargo.toml | 4 + crates/derive/src/sources/blob_hash.rs | 45 ++ crates/derive/src/sources/blobs.rs | 15 +- crates/derive/src/sources/calldata.rs | 2 +- crates/derive/src/sources/mod.rs | 3 + crates/derive/src/test_utils/blob_provider.rs | 4 +- crates/derive/src/traits/data_sources.rs | 4 +- crates/mpt/src/test_util.rs | 5 +- 17 files changed, 256 insertions(+), 442 deletions(-) create mode 100644 crates/derive/src/sources/blob_hash.rs diff --git a/Cargo.lock b/Cargo.lock index e53788578..e679e0e61 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -53,9 +53,9 @@ checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] name = "alloy-chains" -version = "0.1.47" +version = "0.1.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18c5c520273946ecf715c0010b4e3503d7eba9893cd9ce6b7fff5654c4a3c470" +checksum = "c660915971620592abe2c292c859957eb60e73a60c0eba34a6793eea60512cff" dependencies = [ "alloy-primitives", "num_enum", @@ -64,9 +64,9 @@ dependencies = [ [[package]] name = "alloy-consensus" -version = "0.6.1" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54bba85233b8cd6bad2dccba685af6836bfcb539202731091eb40c474ba6fa12" +checksum = "41ed961a48297c732a5d97ee321aa8bb5009ecadbcb077d8bec90cb54e651629" dependencies = [ "alloy-eips", "alloy-primitives", @@ -75,7 +75,6 @@ dependencies = [ "auto_impl", "c-kzg", "derive_more", - "k256", "serde", ] @@ -104,9 +103,9 @@ dependencies = [ [[package]] name = "alloy-eip7702" -version = "0.4.0" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69fb9fd842fdf10a524bbf2c4de6942ad869c1c8c3d128a1b09e67ed5f7cedbd" +checksum = "64ffc577390ce50234e02d841214b3dc0bea6aaaae8e04bbf3cb82e9a45da9eb" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -117,12 +116,12 @@ dependencies = [ [[package]] name = "alloy-eips" -version = "0.6.1" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "655929ddc3cd1af9f7f8a3a401e40eb67113edd0aa308d7071ec7375a74d1cc6" +checksum = "b69e06cf9c37be824b9d26d6d101114fdde6af0c87de2828b414c05c4b3daa71" dependencies = [ "alloy-eip2930", - "alloy-eip7702 0.4.0", + "alloy-eip7702 0.3.2", "alloy-primitives", "alloy-rlp", "alloy-serde", @@ -135,9 +134,9 @@ dependencies = [ [[package]] name = "alloy-genesis" -version = "0.6.1" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ff9ecd6f59d42894fbe1c5bab069b6a37980d95b2a94ac7db656a7c594aa42" +checksum = "dde15e14944a88bd6a57d325e9a49b75558746fe16aaccc79713ae50a6a9574c" dependencies = [ "alloy-primitives", "alloy-serde", @@ -146,9 +145,9 @@ dependencies = [ [[package]] name = "alloy-json-rpc" -version = "0.6.1" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cb5c84eddbcdc61f310778fda03d925a6a321f642a988b1ee71f6ec32c5f21d" +checksum = "af5979e0d5a7bf9c7eb79749121e8256e59021af611322aee56e77e20776b4b3" dependencies = [ "alloy-primitives", "alloy-sol-types", @@ -160,9 +159,9 @@ dependencies = [ [[package]] name = "alloy-network" -version = "0.6.1" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7f7b36f32cd9d6a1eff3a969fcb131e3d8190b7c38177645b5e6262a9da68e4" +checksum = "204237129086ce5dc17a58025e93739b01b45313841f98fa339eb1d780511e57" dependencies = [ "alloy-consensus", "alloy-eips", @@ -176,16 +175,14 @@ dependencies = [ "async-trait", "auto_impl", "futures-utils-wasm", - "serde", - "serde_json", "thiserror", ] [[package]] name = "alloy-network-primitives" -version = "0.6.1" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b14a13d3869e3a1c011165136d489b5f57fee0329964b7bfebc8d55e38572c02" +checksum = "514f70ee2a953db21631cd817b13a1571474ec77ddc03d47616d5e8203489fde" dependencies = [ "alloy-consensus", "alloy-eips", @@ -196,9 +193,9 @@ dependencies = [ [[package]] name = "alloy-node-bindings" -version = "0.6.1" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "906d513e181a203783b3eea1821bb42d188f5c99a370e69e9ddf44bc4fb4b568" +checksum = "27444ea67d360508753022807cdd0b49a95c878924c9c5f8f32668b7d7768245" dependencies = [ "alloy-genesis", "alloy-primitives", @@ -213,9 +210,9 @@ dependencies = [ [[package]] name = "alloy-primitives" -version = "0.8.11" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd58d377699e6cfeab52c4a9d28bdc4ef37e2bd235ff2db525071fe37a2e9af5" +checksum = "8edae627382349b56cd6a7a2106f4fd69b243a9233e560c55c2e03cabb7e1d3c" dependencies = [ "alloy-rlp", "arbitrary", @@ -225,7 +222,7 @@ dependencies = [ "derive_arbitrary", "derive_more", "foldhash", - "hashbrown 0.15.1", + "hashbrown 0.15.0", "hex-literal", "indexmap 2.6.0", "itoa", @@ -244,9 +241,9 @@ dependencies = [ [[package]] name = "alloy-provider" -version = "0.6.1" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8a0398d7fe6a4141739bfaf57ad8db15d76a65fd8c7df859773fc65ac24ba2f" +checksum = "4814d141ede360bb6cd1b4b064f1aab9de391e7c4d0d4d50ac89ea4bc1e25fbd" dependencies = [ "alloy-chains", "alloy-consensus", @@ -298,14 +295,14 @@ checksum = "2b09cae092c27b6f1bde952653a22708691802e57bfef4a2973b80bea21efd3f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.85", ] [[package]] name = "alloy-rpc-client" -version = "0.6.1" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db566ff5b504fc16f2e6943b103d26a243438e74c8515efcd2e10c82101fafae" +checksum = "7fc2bd1e7403463a5f2c61e955bcc9d3072b63aa177442b0f9aa6a6d22a941e3" dependencies = [ "alloy-json-rpc", "alloy-primitives", @@ -326,9 +323,9 @@ dependencies = [ [[package]] name = "alloy-rpc-types" -version = "0.6.1" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de0f4f019359bd1ae409993ba063d213ba1e1ff6c2a39ba178f480a0ceb4c5f9" +checksum = "eea9bf1abdd506f985a53533f5ac01296bcd6102c5e139bbc5d40bc468d2c916" dependencies = [ "alloy-primitives", "alloy-rpc-types-eth", @@ -338,9 +335,9 @@ dependencies = [ [[package]] name = "alloy-rpc-types-beacon" -version = "0.6.1" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "277f84f4b36534b48278e6581c267202b6186a32ce472e7e0d0a6c27a7cddce0" +checksum = "45357a642081c8ce235c0ad990c4e9279f5f18a723545076b38cfcc05cc25234" dependencies = [ "alloy-eips", "alloy-primitives", @@ -352,9 +349,9 @@ dependencies = [ [[package]] name = "alloy-rpc-types-engine" -version = "0.6.1" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c5a591c9b2a58d5168867083d4c81a78089d6a90669b57b125800c07ee1dd6d" +checksum = "886d22d41992287a235af2f3af4299b5ced2bcafb81eb835572ad35747476946" dependencies = [ "alloy-consensus", "alloy-eips", @@ -368,9 +365,9 @@ dependencies = [ [[package]] name = "alloy-rpc-types-eth" -version = "0.6.1" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87af056add05e5cf6994424725354d02d1587098831b59748365c79fd3896d2c" +checksum = "00b034779a4850b4b03f5be5ea674a1cf7d746b2da762b34d1860ab45e48ca27" dependencies = [ "alloy-consensus", "alloy-eips", @@ -387,9 +384,9 @@ dependencies = [ [[package]] name = "alloy-serde" -version = "0.6.1" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed60ee9deecc68565aa74d810129c45009fad7ec4317b99859f45f8608fa4fb4" +checksum = "028e72eaa9703e4882344983cfe7636ce06d8cce104a78ea62fd19b46659efc4" dependencies = [ "alloy-primitives", "serde", @@ -398,9 +395,9 @@ dependencies = [ [[package]] name = "alloy-signer" -version = "0.6.1" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e31bfec8f78014a8c9ebc1d6ddcc951f8aa598fd0d061e0971a3a5f90bcabfdc" +checksum = "592c185d7100258c041afac51877660c7bf6213447999787197db4842f0e938e" dependencies = [ "alloy-primitives", "async-trait", @@ -412,23 +409,23 @@ dependencies = [ [[package]] name = "alloy-sol-macro" -version = "0.8.11" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a1b42ac8f45e2f49f4bcdd72cbfde0bb148f5481d403774ffa546e48b83efc1" +checksum = "841eabaa4710f719fddbc24c95d386eae313f07e6da4babc25830ee37945be0c" dependencies = [ "alloy-sol-macro-expander", "alloy-sol-macro-input", "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.85", ] [[package]] name = "alloy-sol-macro-expander" -version = "0.8.11" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06318f1778e57f36333e850aa71bd1bb5e560c10279e236622faae0470c50412" +checksum = "6672337f19d837b9f7073c45853aeb528ed9f7dd6a4154ce683e9e5cb7794014" dependencies = [ "alloy-sol-macro-input", "const-hex", @@ -437,31 +434,31 @@ dependencies = [ "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.85", "syn-solidity", "tiny-keccak", ] [[package]] name = "alloy-sol-macro-input" -version = "0.8.11" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaebb9b0ad61a41345a22c9279975c0cdd231b97947b10d7aad1cf0a7181e4a5" +checksum = "0dff37dd20bfb118b777c96eda83b2067f4226d2644c5cfa00187b3bc01770ba" dependencies = [ "const-hex", "dunce", "heck", "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.85", "syn-solidity", ] [[package]] name = "alloy-sol-types" -version = "0.8.11" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "374d7fb042d68ddfe79ccb23359de3007f6d4d53c13f703b64fb0db422132111" +checksum = "aa828bb1b9a6dc52208fbb18084fb9ce2c30facc2bfda6a5d922349b4990354f" dependencies = [ "alloy-primitives", "alloy-sol-macro", @@ -470,9 +467,9 @@ dependencies = [ [[package]] name = "alloy-transport" -version = "0.6.1" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6102fe2d5d812e0ad9da1997f534cf79a37e930f8bf8c9cd3fd30f817ccdf6da" +checksum = "be77579633ebbc1266ae6fd7694f75c408beb1aeb6865d0b18f22893c265a061" dependencies = [ "alloy-json-rpc", "base64", @@ -490,9 +487,9 @@ dependencies = [ [[package]] name = "alloy-transport-http" -version = "0.6.1" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02d15dcba0b43725f293ce5d3383b50d112a4f4eb15f197ff791b266335ac18b" +checksum = "91fd1a5d0827939847983b46f2f79510361f901dc82f8e3c38ac7397af142c6e" dependencies = [ "alloy-json-rpc", "alloy-transport", @@ -542,9 +539,9 @@ checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" [[package]] name = "anstream" -version = "0.6.18" +version = "0.6.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" +checksum = "23a1e53f0f5d86382dafe1cf314783b2044280f406e7e1506368220ad11b1338" dependencies = [ "anstyle", "anstyle-parse", @@ -557,9 +554,9 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.10" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" +checksum = "8365de52b16c035ff4fcafe0092ba9390540e3e352870ac09933bebcaa2c8c56" [[package]] name = "anstyle-parse" @@ -591,15 +588,15 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.93" +version = "1.0.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c95c10ba0b00a02636238b814946408b1322d5ac4760326e6fb8ec956d85775" +checksum = "c042108f3ed77fd83760a5fd79b53be043192bb3b9dba91d8c574c0ada7850c8" [[package]] name = "arbitrary" -version = "1.4.1" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dde20b3d026af13f561bdd0f15edf01fc734f0dafcedbaf42bba506a9517f223" +checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110" [[package]] name = "ark-ff" @@ -753,7 +750,7 @@ checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.85", ] [[package]] @@ -764,7 +761,7 @@ checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.85", ] [[package]] @@ -791,7 +788,7 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.85", ] [[package]] @@ -850,7 +847,7 @@ dependencies = [ "regex", "rustc-hash 1.1.0", "shlex", - "syn 2.0.87", + "syn 2.0.85", ] [[package]] @@ -964,7 +961,7 @@ checksum = "523363cbe1df49b68215efdf500b103ac3b0fb4836aed6d15689a076eadb8fff" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.85", ] [[package]] @@ -1022,9 +1019,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.1.36" +version = "1.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baee610e9452a8f6f0a1b6194ec09ff9e2d85dea54432acdae41aa0761c95d70" +checksum = "c2e7962b54006dcfcc61cb72735f4d89bb97061dd6a7ed882ec6b8ee53714c6f" dependencies = [ "jobserver", "libc", @@ -1128,7 +1125,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.85", ] [[package]] @@ -1326,7 +1323,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.87", + "syn 2.0.85", ] [[package]] @@ -1337,7 +1334,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 2.0.87", + "syn 2.0.85", ] [[package]] @@ -1396,13 +1393,13 @@ dependencies = [ [[package]] name = "derive_arbitrary" -version = "1.4.1" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30542c1ad912e0e3d22a1935c290e12e8a29d704a420177a31faad4a601a0800" +checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.85", ] [[package]] @@ -1423,7 +1420,7 @@ dependencies = [ "convert_case", "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.85", "unicode-xid", ] @@ -1448,17 +1445,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "displaydoc" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.87", -] - [[package]] name = "dunce" version = "1.0.5" @@ -1527,7 +1513,7 @@ checksum = "2f9ed6b3789237c8a0c1c505af1c7eb2c560df6186f01b098c3a1064ea532f38" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.85", ] [[package]] @@ -1695,7 +1681,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.85", ] [[package]] @@ -1828,9 +1814,9 @@ checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" [[package]] name = "hashbrown" -version = "0.15.1" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a9bfc1af68b1726ea47d3d5109de126281def866b33970e10fbab11b5dafab3" +checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" dependencies = [ "allocator-api2", "equivalent", @@ -2015,124 +2001,6 @@ dependencies = [ "cc", ] -[[package]] -name = "icu_collections" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" -dependencies = [ - "displaydoc", - "yoke", - "zerofrom", - "zerovec", -] - -[[package]] -name = "icu_locid" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" -dependencies = [ - "displaydoc", - "litemap", - "tinystr", - "writeable", - "zerovec", -] - -[[package]] -name = "icu_locid_transform" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" -dependencies = [ - "displaydoc", - "icu_locid", - "icu_locid_transform_data", - "icu_provider", - "tinystr", - "zerovec", -] - -[[package]] -name = "icu_locid_transform_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" - -[[package]] -name = "icu_normalizer" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" -dependencies = [ - "displaydoc", - "icu_collections", - "icu_normalizer_data", - "icu_properties", - "icu_provider", - "smallvec", - "utf16_iter", - "utf8_iter", - "write16", - "zerovec", -] - -[[package]] -name = "icu_normalizer_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" - -[[package]] -name = "icu_properties" -version = "1.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" -dependencies = [ - "displaydoc", - "icu_collections", - "icu_locid_transform", - "icu_properties_data", - "icu_provider", - "tinystr", - "zerovec", -] - -[[package]] -name = "icu_properties_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" - -[[package]] -name = "icu_provider" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" -dependencies = [ - "displaydoc", - "icu_locid", - "icu_provider_macros", - "stable_deref_trait", - "tinystr", - "writeable", - "yoke", - "zerofrom", - "zerovec", -] - -[[package]] -name = "icu_provider_macros" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.87", -] - [[package]] name = "ident_case" version = "1.0.1" @@ -2141,23 +2009,12 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" -dependencies = [ - "idna_adapter", - "smallvec", - "utf8_iter", -] - -[[package]] -name = "idna_adapter" -version = "1.2.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ - "icu_normalizer", - "icu_properties", + "unicode-bidi", + "unicode-normalization", ] [[package]] @@ -2199,7 +2056,7 @@ checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ "arbitrary", "equivalent", - "hashbrown 0.15.1", + "hashbrown 0.15.0", "serde", ] @@ -2376,7 +2233,7 @@ dependencies = [ "kona-common", "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.85", ] [[package]] @@ -2398,6 +2255,7 @@ dependencies = [ "op-alloy-protocol", "op-alloy-rpc-types-engine", "proptest", + "serde", "serde_json", "spin", "tokio", @@ -2477,6 +2335,7 @@ dependencies = [ "futures", "kona-client", "kona-common", + "kona-derive", "kona-derive-alloy", "kona-mpt", "kona-preimage", @@ -2609,12 +2468,6 @@ version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" -[[package]] -name = "litemap" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" - [[package]] name = "lock_api" version = "0.4.12" @@ -2637,7 +2490,7 @@ version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" dependencies = [ - "hashbrown 0.15.1", + "hashbrown 0.15.0", ] [[package]] @@ -2705,7 +2558,7 @@ checksum = "1bb5c1d8184f13f7d0ccbeeca0def2f9a181bce2624302793005f5ca8aa62e5e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.85", ] [[package]] @@ -2884,7 +2737,7 @@ checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.85", ] [[package]] @@ -2921,9 +2774,9 @@ checksum = "b410bbe7e14ab526a0e86877eb47c6996a2bd7746f027ba551028c925390e4e9" [[package]] name = "op-alloy-consensus" -version = "0.6.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "007f0238e76e4636334a75e974ff4d09116e0a63707b84f0d2c0b41f60299e96" +checksum = "f26c3b35b7b3e36d15e0563eebffe13c1d9ca16b7aaffcb6a64354633547e16b" dependencies = [ "alloy-consensus", "alloy-eips", @@ -2937,9 +2790,9 @@ dependencies = [ [[package]] name = "op-alloy-genesis" -version = "0.6.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b8114629ffbf423e9edcc787eb49263830e654e1f986a8bf3a08a700b08e778" +checksum = "ccacc2efed3d60d98ea581bddb885df1c6c62a592e55de049cfefd94116112cd" dependencies = [ "alloy-consensus", "alloy-eips", @@ -2951,9 +2804,9 @@ dependencies = [ [[package]] name = "op-alloy-protocol" -version = "0.6.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1092172b6f90251460684a11a895e57c595fcaa2c08e4dccd0817c937d722ba9" +checksum = "f5f8e6ec6b91c6aaeb20860b455a52fd8e300acfe5d534e96e9073a24f853e74" dependencies = [ "alloy-consensus", "alloy-eips", @@ -2971,11 +2824,10 @@ dependencies = [ [[package]] name = "op-alloy-rpc-types-engine" -version = "0.6.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67199bd318ace45e60a27614d5c8174f58f5ed7522cffb45fd4d188675dd0d47" +checksum = "4b52ee59c86537cff83e8c7f2a6aa287a94f3608bb40c06d442aafd0c2e807a4" dependencies = [ - "alloy-eips", "alloy-primitives", "alloy-rpc-types-engine", "alloy-serde", @@ -3007,7 +2859,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.85", ] [[package]] @@ -3145,7 +2997,7 @@ checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.85", ] [[package]] @@ -3289,7 +3141,7 @@ dependencies = [ "proc-macro-error-attr2", "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.85", ] [[package]] @@ -3329,7 +3181,7 @@ checksum = "6ff7ff745a347b87471d859a377a9a404361e7efc2a971d73424a6d183c0fc77" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.85", ] [[package]] @@ -3349,7 +3201,7 @@ checksum = "ca414edb151b4c8d125c12566ab0d74dc9cdba36fb80eb7b848c15f495fd32d1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.85", ] [[package]] @@ -3676,7 +3528,7 @@ checksum = "09cb82b74b4810f07e460852c32f522e979787691b0b7b7439fe473e49d49b2f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.85", ] [[package]] @@ -3774,9 +3626,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.39" +version = "0.38.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "375116bee2be9ed569afe2154ea6a99dfdffd257f533f187498c2a8f5feaf4ee" +checksum = "aa260229e6538e52293eeb577aabd09945a09d6d9cc0fc550ed7529056c2e32a" dependencies = [ "bitflags 2.6.0", "errno", @@ -3980,7 +3832,7 @@ checksum = "de523f781f095e28fa605cdce0f8307e451cc0fd14e2eb4cd2e98a355b147766" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.85", ] [[package]] @@ -4004,7 +3856,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.85", ] [[package]] @@ -4046,7 +3898,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.85", ] [[package]] @@ -4219,7 +4071,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.87", + "syn 2.0.85", ] [[package]] @@ -4277,9 +4129,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.87" +version = "2.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" +checksum = "5023162dfcd14ef8f32034d8bcd4cc5ddc61ef7a247c024a33e24e1f24d21b56" dependencies = [ "proc-macro2", "quote", @@ -4288,14 +4140,14 @@ dependencies = [ [[package]] name = "syn-solidity" -version = "0.8.11" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edf42e81491fb8871b74df3d222c64ae8cbc1269ea509fa768a3ed3e1b0ac8cb" +checksum = "16320d4a2021ba1a32470b3759676114a918885e9800e68ad60f2c67969fba62" dependencies = [ "paste", "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.85", ] [[package]] @@ -4313,17 +4165,6 @@ dependencies = [ "futures-core", ] -[[package]] -name = "synstructure" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.87", -] - [[package]] name = "system-configuration" version = "0.6.1" @@ -4366,22 +4207,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.68" +version = "1.0.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02dd99dc800bbb97186339685293e1cc5d9df1f8fae2d0aecd9ff1c77efea892" +checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.68" +version = "1.0.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7c61ec9a6f64d2793d8a45faba21efbe3ced62a886d44c36a009b2b519b4c7e" +checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.85", ] [[package]] @@ -4443,16 +4284,6 @@ dependencies = [ "crunchy", ] -[[package]] -name = "tinystr" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" -dependencies = [ - "displaydoc", - "zerovec", -] - [[package]] name = "tinytemplate" version = "1.2.1" @@ -4504,7 +4335,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.85", ] [[package]] @@ -4615,7 +4446,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.85", ] [[package]] @@ -4689,12 +4520,27 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" +[[package]] +name = "unicode-bidi" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ab17db44d7388991a428b2ee655ce0c212e862eff1768a455c58f9aad6e7893" + [[package]] name = "unicode-ident" version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" +[[package]] +name = "unicode-normalization" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" +dependencies = [ + "tinyvec", +] + [[package]] name = "unicode-segmentation" version = "1.12.0" @@ -4721,27 +4567,15 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.3" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d157f1b96d14500ffdc1f10ba712e780825526c03d9a49b4d0324b0d9113ada" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" dependencies = [ "form_urlencoded", "idna", "percent-encoding", ] -[[package]] -name = "utf16_iter" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" - -[[package]] -name = "utf8_iter" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" - [[package]] name = "utf8parse" version = "0.2.2" @@ -4828,7 +4662,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.85", "wasm-bindgen-shared", ] @@ -4862,7 +4696,7 @@ checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.85", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4875,9 +4709,9 @@ checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" [[package]] name = "wasmtimer" -version = "0.4.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb4f099acbc1043cc752b91615b24b02d7f6fcd975bd781fed9f50b3c3e15bf7" +checksum = "c7ed9d8b15c7fb594d72bfb4b5a276f3d2029333cd93a932f376f5937f6f80ee" dependencies = [ "futures", "js-sys", @@ -5058,18 +4892,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "write16" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" - -[[package]] -name = "writeable" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" - [[package]] name = "wyz" version = "0.5.1" @@ -5079,30 +4901,6 @@ dependencies = [ "tap", ] -[[package]] -name = "yoke" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c5b1314b079b0930c31e3af543d8ee1757b1951ae1e1565ec704403a7240ca5" -dependencies = [ - "serde", - "stable_deref_trait", - "yoke-derive", - "zerofrom", -] - -[[package]] -name = "yoke-derive" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.87", - "synstructure", -] - [[package]] name = "zerocopy" version = "0.7.35" @@ -5121,28 +4919,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", -] - -[[package]] -name = "zerofrom" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ec111ce797d0e0784a1116d0ddcdbea84322cd79e5d5ad173daeba4f93ab55" -dependencies = [ - "zerofrom-derive", -] - -[[package]] -name = "zerofrom-derive" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.87", - "synstructure", + "syn 2.0.85", ] [[package]] @@ -5162,27 +4939,5 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", -] - -[[package]] -name = "zerovec" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" -dependencies = [ - "yoke", - "zerofrom", - "zerovec-derive", -] - -[[package]] -name = "zerovec-derive" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.87", + "syn 2.0.85", ] diff --git a/Cargo.toml b/Cargo.toml index 9dd3448ce..9bfd2b639 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -67,24 +67,24 @@ kona-derive-alloy = { path = "crates/derive-alloy", version = "0.0.3", default-f # Alloy alloy-rlp = { version = "0.3.9", default-features = false } alloy-trie = { version = "0.7.2", default-features = false } -alloy-eips = { version = "0.6.1", default-features = false } -alloy-serde = { version = "0.6.1", default-features = false } -alloy-provider = { version = "0.6.1", default-features = false } +alloy-eips = { version = "0.5.4", default-features = false } +alloy-serde = { version = "0.5.4", default-features = false } +alloy-provider = { version = "0.5.4", default-features = false } alloy-primitives = { version = "0.8", default-features = false } -alloy-consensus = { version = "0.6.1", default-features = false } -alloy-transport = { version = "0.6.1", default-features = false } -alloy-rpc-types = { version = "0.6.1", default-features = false } -alloy-rpc-client = { version = "0.6.1", default-features = false } -alloy-node-bindings = { version = "0.6.1", default-features = false } -alloy-transport-http = { version = "0.6.1", default-features = false } -alloy-rpc-types-engine = { version = "0.6.1", default-features = false } -alloy-rpc-types-beacon = { version = "0.6.1", default-features = false } +alloy-consensus = { version = "0.5.4", default-features = false } +alloy-transport = { version = "0.5.4", default-features = false } +alloy-rpc-types = { version = "0.5.4", default-features = false } +alloy-rpc-client = { version = "0.5.4", default-features = false } +alloy-node-bindings = { version = "0.5.4", default-features = false } +alloy-transport-http = { version = "0.5.4", default-features = false } +alloy-rpc-types-engine = { version = "0.5.4", default-features = false } +alloy-rpc-types-beacon = { version = "0.5.4", default-features = false } # OP Alloy -op-alloy-genesis = { version = "0.6.1", default-features = false } -op-alloy-protocol = { version = "0.6.1", default-features = false } -op-alloy-consensus = { version = "0.6.1", default-features = false } -op-alloy-rpc-types-engine = { version = "0.6.1", default-features = false } +op-alloy-genesis = { version = "0.5.2", default-features = false } +op-alloy-protocol = { version = "0.5.2", default-features = false } +op-alloy-consensus = { version = "0.5.2", default-features = false } +op-alloy-rpc-types-engine = { version = "0.5.2", default-features = false } # General lru = "0.12.4" diff --git a/bin/client/src/l1/blob_provider.rs b/bin/client/src/l1/blob_provider.rs index 0bc80281f..31698d1bb 100644 --- a/bin/client/src/l1/blob_provider.rs +++ b/bin/client/src/l1/blob_provider.rs @@ -3,10 +3,10 @@ use crate::{errors::OracleProviderError, HintType}; use alloc::{boxed::Box, sync::Arc, vec::Vec}; use alloy_consensus::Blob; -use alloy_eips::eip4844::{IndexedBlobHash, FIELD_ELEMENTS_PER_BLOB}; +use alloy_eips::eip4844::FIELD_ELEMENTS_PER_BLOB; use alloy_primitives::keccak256; use async_trait::async_trait; -use kona_derive::traits::BlobProvider; +use kona_derive::{sources::IndexedBlobHash, traits::BlobProvider}; use kona_preimage::{CommsClient, PreimageKey, PreimageKeyType}; use op_alloy_protocol::BlockInfo; diff --git a/bin/host/Cargo.toml b/bin/host/Cargo.toml index fa49876fc..39c357665 100644 --- a/bin/host/Cargo.toml +++ b/bin/host/Cargo.toml @@ -15,6 +15,7 @@ workspace = true # Workspace kona-mpt.workspace = true kona-client.workspace = true +kona-derive.workspace = true kona-common.workspace = true kona-preimage.workspace = true kona-derive-alloy.workspace = true diff --git a/bin/host/src/fetcher/mod.rs b/bin/host/src/fetcher/mod.rs index 44fb707c5..497a5b32e 100644 --- a/bin/host/src/fetcher/mod.rs +++ b/bin/host/src/fetcher/mod.rs @@ -3,11 +3,7 @@ use crate::{kv::KeyValueStore, util}; use alloy_consensus::{Header, TxEnvelope, EMPTY_ROOT_HASH}; -use alloy_eips::{ - eip2718::Encodable2718, - eip4844::{IndexedBlobHash, FIELD_ELEMENTS_PER_BLOB}, - BlockId, -}; +use alloy_eips::{eip2718::Encodable2718, eip4844::FIELD_ELEMENTS_PER_BLOB, BlockId}; use alloy_primitives::{address, keccak256, Address, Bytes, B256}; use alloy_provider::{Provider, ReqwestProvider}; use alloy_rlp::{Decodable, EMPTY_STRING_CODE}; @@ -16,6 +12,7 @@ use alloy_rpc_types::{ }; use anyhow::{anyhow, Result}; use kona_client::HintType; +use kona_derive::sources::IndexedBlobHash; use kona_derive_alloy::{OnlineBeaconClient, OnlineBlobProvider}; use kona_preimage::{PreimageKey, PreimageKeyType}; use op_alloy_protocol::BlockInfo; @@ -185,7 +182,7 @@ where let timestamp = u64::from_be_bytes(timestamp_data_bytes); let partial_block_ref = BlockInfo { timestamp, ..Default::default() }; - let indexed_hash = IndexedBlobHash { index, hash }; + let indexed_hash = IndexedBlobHash { index: index as usize, hash }; // Fetch the blob sidecar from the blob provider. let mut sidecars = self @@ -519,7 +516,11 @@ where let encoded_transactions = transactions .into_iter() .map(|tx| { - let envelope = TxEnvelope::from(tx); + let envelope: TxEnvelope = tx.try_into().map_err(|e| { + anyhow!( + "Failed to convert RPC transaction into consensus envelope: {e}" + ) + })?; Ok::<_, anyhow::Error>(envelope.encoded_2718()) }) diff --git a/crates/derive-alloy/src/alloy_providers.rs b/crates/derive-alloy/src/alloy_providers.rs index 85f479014..73bb7bf49 100644 --- a/crates/derive-alloy/src/alloy_providers.rs +++ b/crates/derive-alloy/src/alloy_providers.rs @@ -150,8 +150,7 @@ impl ChainProvider for AlloyChainProvider { .raw_request("debug_getRawBlock".into(), [hash]) .await .map_err(AlloyProviderError::Rpc)?; - let block: Block = - Block::decode(&mut raw_block.as_ref()).map_err(AlloyProviderError::Rlp)?; + let block = Block::decode(&mut raw_block.as_ref()).map_err(AlloyProviderError::Rlp)?; let block_info = BlockInfo { hash: block.header.hash_slow(), diff --git a/crates/derive-alloy/src/beacon_client.rs b/crates/derive-alloy/src/beacon_client.rs index 9f6b84748..0447b9290 100644 --- a/crates/derive-alloy/src/beacon_client.rs +++ b/crates/derive-alloy/src/beacon_client.rs @@ -1,8 +1,8 @@ //! Contains an online implementation of the `BeaconClient` trait. -use alloy_eips::eip4844::IndexedBlobHash; use alloy_rpc_types_beacon::sidecar::{BeaconBlobBundle, BlobData}; use async_trait::async_trait; +use kona_derive::sources::IndexedBlobHash; use reqwest::Client; /// The config spec engine api method. @@ -128,7 +128,7 @@ impl BeaconClient for OnlineBeaconClient { let mut sidecars = Vec::with_capacity(hashes.len()); hashes.iter().for_each(|hash| { if let Some(sidecar) = - raw_response.data.iter().find(|sidecar| sidecar.index == hash.index) + raw_response.data.iter().find(|sidecar| sidecar.index == hash.index as u64) { sidecars.push(sidecar.clone()); } diff --git a/crates/derive-alloy/src/blob_provider.rs b/crates/derive-alloy/src/blob_provider.rs index 196b2343b..777830f92 100644 --- a/crates/derive-alloy/src/blob_provider.rs +++ b/crates/derive-alloy/src/blob_provider.rs @@ -1,10 +1,10 @@ //! Contains an online implementation of the `BlobProvider` trait. use crate::{BeaconClient, OnlineBeaconClient}; -use alloy_eips::eip4844::{Blob, BlobTransactionSidecarItem, IndexedBlobHash}; +use alloy_eips::eip4844::{Blob, BlobTransactionSidecarItem}; use alloy_rpc_types_beacon::sidecar::BlobData; use async_trait::async_trait; -use kona_derive::{errors::BlobProviderError, traits::BlobProvider}; +use kona_derive::{errors::BlobProviderError, sources::IndexedBlobHash, traits::BlobProvider}; use op_alloy_protocol::BlockInfo; use tracing::warn; @@ -103,7 +103,7 @@ impl OnlineBlobProvider { let sidecars = self.fetch_sidecars(slot, blob_hashes).await?; // Filter blob sidecars that match the indicies in the specified list. - let blob_hash_indicies = blob_hashes.iter().map(|b| b.index).collect::>(); + let blob_hash_indicies = blob_hashes.iter().map(|b| b.index as u64).collect::>(); let filtered = sidecars .into_iter() .filter(|s| blob_hash_indicies.contains(&s.index)) @@ -156,7 +156,10 @@ where let hash = blob_hashes .get(i) .ok_or(BlobProviderError::Backend("Missing blob hash".to_string()))?; - match sidecar.verify_blob(&IndexedBlobHash { hash: hash.hash, index: hash.index }) { + match sidecar.verify_blob(&alloy_eips::eip1898::NumHash { + hash: hash.hash, + number: hash.index as u64, + }) { Ok(_) => Ok(sidecar.blob), Err(e) => Err(BlobProviderError::Backend(e.to_string())), } @@ -247,7 +250,7 @@ impl OnlineBlobProviderWithFallback>(); + let blob_hash_indicies = blob_hashes.iter().map(|b| b.index as u64).collect::>(); let filtered = sidecars .into_iter() .filter(|s| blob_hash_indicies.contains(&s.index)) @@ -309,9 +312,10 @@ where let hash = blob_hashes.get(i).ok_or(BlobProviderError::Backend( "fallback: failed to get blob hash".to_string(), ))?; - match sidecar - .verify_blob(&IndexedBlobHash { hash: hash.hash, index: hash.index }) - { + match sidecar.verify_blob(&alloy_eips::eip1898::NumHash { + hash: hash.hash, + number: hash.index as u64, + }) { Ok(_) => Ok(sidecar.blob), Err(e) => Err(BlobProviderError::Backend(e.to_string())), } diff --git a/crates/derive-alloy/src/test_utils.rs b/crates/derive-alloy/src/test_utils.rs index 988324c2a..43c3e6d42 100644 --- a/crates/derive-alloy/src/test_utils.rs +++ b/crates/derive-alloy/src/test_utils.rs @@ -1,13 +1,13 @@ //! Test Utilities for Online Providers use crate::{APIConfigResponse, APIGenesisResponse}; -use alloy_eips::eip4844::IndexedBlobHash; use alloy_node_bindings::{Anvil, AnvilInstance}; use alloy_provider::{network::Ethereum, ReqwestProvider}; use alloy_rpc_client::RpcClient; use alloy_rpc_types_beacon::sidecar::{BeaconBlobBundle, BlobData}; use alloy_transport_http::Http; use async_trait::async_trait; +use kona_derive::sources::IndexedBlobHash; use reqwest::Client; /// Spawns an Anvil instance and returns a provider and the instance. diff --git a/crates/derive/Cargo.toml b/crates/derive/Cargo.toml index 6599df15a..48df76873 100644 --- a/crates/derive/Cargo.toml +++ b/crates/derive/Cargo.toml @@ -33,6 +33,9 @@ async-trait.workspace = true alloc-no-stdlib.workspace = true derive_more = { workspace = true, features = ["full"] } +# `serde` feature dependencies +serde = { workspace = true, optional = true, features = ["derive"] } + # `test-utils` feature dependencies spin = { workspace = true, optional = true } tracing-subscriber = { workspace = true, optional = true, features = ["fmt"] } @@ -48,6 +51,7 @@ alloy-primitives = { workspace = true, features = ["rlp", "k256", "map", "arbitr [features] default = ["serde"] serde = [ + "dep:serde", "alloy-primitives/serde", "alloy-consensus/serde", "op-alloy-consensus/serde", diff --git a/crates/derive/src/sources/blob_hash.rs b/crates/derive/src/sources/blob_hash.rs new file mode 100644 index 000000000..18008936b --- /dev/null +++ b/crates/derive/src/sources/blob_hash.rs @@ -0,0 +1,45 @@ +//! Contains the `BlobHash` type and related types. + +use alloy_primitives::B256; + +/// A Blob hash +#[derive(Default, Clone, Debug)] +#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] +pub struct IndexedBlobHash { + /// The index of the blob + pub index: usize, + /// The hash of the blob + pub hash: B256, +} + +impl PartialEq for IndexedBlobHash { + fn eq(&self, other: &Self) -> bool { + self.index == other.index && self.hash == other.hash + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_indexed_blob_hash() { + let hash = B256::from([1; 32]); + let indexed_blob_hash = IndexedBlobHash { index: 1, hash }; + + assert_eq!(indexed_blob_hash.index, 1); + assert_eq!(indexed_blob_hash.hash, hash); + } + + #[test] + #[cfg(feature = "serde")] + fn test_indexed_blob_hash_serde_roundtrip() { + let hash = B256::from([1; 32]); + let indexed_blob_hash = IndexedBlobHash { index: 1, hash }; + + let serialized = serde_json::to_string(&indexed_blob_hash).unwrap(); + let deserialized: IndexedBlobHash = serde_json::from_str(&serialized).unwrap(); + + assert_eq!(indexed_blob_hash, deserialized); + } +} diff --git a/crates/derive/src/sources/blobs.rs b/crates/derive/src/sources/blobs.rs index 18a7558e5..46d778fca 100644 --- a/crates/derive/src/sources/blobs.rs +++ b/crates/derive/src/sources/blobs.rs @@ -2,13 +2,12 @@ use crate::{ errors::{BlobProviderError, PipelineError}, - sources::BlobData, + sources::{BlobData, IndexedBlobHash}, traits::{BlobProvider, ChainProvider, DataAvailabilityProvider}, types::PipelineResult, }; use alloc::{boxed::Box, string::ToString, vec::Vec}; use alloy_consensus::{Transaction, TxEip4844Variant, TxEnvelope, TxType}; -use alloy_eips::eip4844::IndexedBlobHash; use alloy_primitives::{Address, Bytes}; use async_trait::async_trait; use op_alloy_protocol::BlockInfo; @@ -58,7 +57,7 @@ where } fn extract_blob_data(&self, txs: Vec) -> (Vec, Vec) { - let mut index: u64 = 0; + let mut number: u64 = 0; let mut data = Vec::new(); let mut hashes = Vec::new(); for tx in txs { @@ -80,11 +79,11 @@ where let Some(to) = tx_kind else { continue }; if to != self.batcher_address { - index += blob_hashes.map_or(0, |h| h.len() as u64); + number += blob_hashes.map_or(0, |h| h.len() as u64); continue; } if tx.recover_signer().unwrap_or_default() != self.signer { - index += blob_hashes.map_or(0, |h| h.len() as u64); + number += blob_hashes.map_or(0, |h| h.len() as u64); continue; } if tx.tx_type() != TxType::Eip4844 { @@ -107,11 +106,11 @@ where } else { continue; }; - for hash in blob_hashes { - let indexed = IndexedBlobHash { hash, index }; + for blob in blob_hashes { + let indexed = IndexedBlobHash { hash: blob, index: number as usize }; hashes.push(indexed); data.push(BlobData::default()); - index += 1; + number += 1; } } (data, hashes) diff --git a/crates/derive/src/sources/calldata.rs b/crates/derive/src/sources/calldata.rs index 7c0a32cd1..d937d576c 100644 --- a/crates/derive/src/sources/calldata.rs +++ b/crates/derive/src/sources/calldata.rs @@ -92,7 +92,7 @@ mod tests { use crate::{errors::PipelineErrorKind, test_utils::TestChainProvider}; use alloc::{vec, vec::Vec}; use alloy_consensus::{Signed, TxEip2930, TxEip4844, TxEip4844Variant, TxLegacy}; - use alloy_primitives::{address, Address, PrimitiveSignature as Signature, TxKind}; + use alloy_primitives::{address, Address, Signature, TxKind}; pub(crate) fn test_legacy_tx(to: Address) -> TxEnvelope { let sig = Signature::test_signature(); diff --git a/crates/derive/src/sources/mod.rs b/crates/derive/src/sources/mod.rs index e0c9772d3..7ddd4b33a 100644 --- a/crates/derive/src/sources/mod.rs +++ b/crates/derive/src/sources/mod.rs @@ -7,6 +7,9 @@ //! [DataAvailabilityProvider]: crate::traits::DataAvailabilityProvider //! [BlockInfo]: op_alloy_protocol::BlockInfo +mod blob_hash; +pub use blob_hash::IndexedBlobHash; + mod blob_data; pub use blob_data::BlobData; diff --git a/crates/derive/src/test_utils/blob_provider.rs b/crates/derive/src/test_utils/blob_provider.rs index f5c2e19db..b8cfe74fa 100644 --- a/crates/derive/src/test_utils/blob_provider.rs +++ b/crates/derive/src/test_utils/blob_provider.rs @@ -1,8 +1,8 @@ //! An implementation of the [BlobProvider] trait for tests. -use crate::{errors::BlobProviderError, traits::BlobProvider}; +use crate::{errors::BlobProviderError, sources::IndexedBlobHash, traits::BlobProvider}; use alloc::{boxed::Box, vec::Vec}; -use alloy_eips::eip4844::{Blob, IndexedBlobHash}; +use alloy_eips::eip4844::Blob; use alloy_primitives::{map::HashMap, B256}; use async_trait::async_trait; use op_alloy_protocol::BlockInfo; diff --git a/crates/derive/src/traits/data_sources.rs b/crates/derive/src/traits/data_sources.rs index 18e51bf99..027e42186 100644 --- a/crates/derive/src/traits/data_sources.rs +++ b/crates/derive/src/traits/data_sources.rs @@ -1,9 +1,9 @@ //! Contains traits that describe the functionality of various data sources used in the derivation //! pipeline's stages. -use crate::{errors::PipelineErrorKind, types::PipelineResult}; +use crate::{errors::PipelineErrorKind, sources::IndexedBlobHash, types::PipelineResult}; use alloc::{boxed::Box, fmt::Debug, string::ToString, vec::Vec}; -use alloy_eips::eip4844::{Blob, IndexedBlobHash}; +use alloy_eips::eip4844::Blob; use alloy_primitives::Bytes; use async_trait::async_trait; use core::fmt::Display; diff --git a/crates/mpt/src/test_util.rs b/crates/mpt/src/test_util.rs index afb1e6d5a..5eba3ba82 100644 --- a/crates/mpt/src/test_util.rs +++ b/crates/mpt/src/test_util.rs @@ -96,7 +96,10 @@ pub(crate) async fn get_live_derivable_transactions_list( let BlockTransactions::Full(txs) = block.transactions else { anyhow::bail!("Did not fetch full block"); }; - let consensus_txs = txs.into_iter().map(TxEnvelope::from).collect::>(); + let consensus_txs = txs + .into_iter() + .map(|tx| TxEnvelope::try_from(tx).map_err(anyhow::Error::from)) + .collect::>>()?; // Compute the derivable list let mut list = ordered_trie_with_encoder(consensus_txs.as_ref(), |rlp: &TxEnvelope, buf| {