From 8c2dfa3e756d82fe2372e5809f0b3e76ef368e72 Mon Sep 17 00:00:00 2001 From: Samuel Laferriere Date: Mon, 16 Dec 2024 16:16:23 -0500 Subject: [PATCH] chore: cleanup crates/modules structure and dependencies (#14) * chore: cleanup crates/modules structure and dependencies * chore: rename hokulea-eigenda-proof -> hokulea-proof --- Cargo.lock | 188 +++++++++++---------------- Cargo.toml | 26 ++-- bin/client/Cargo.toml | 10 +- bin/client/src/lib.rs | 4 +- bin/host/Cargo.toml | 24 ++-- bin/host/src/fetcher/mod.rs | 2 +- bin/host/src/lib.rs | 7 +- crates/eigenda/Cargo.toml | 2 +- crates/eigenda/README.md | 3 + crates/eigenda/src/eigenda_blobs.rs | 23 ++-- crates/eigenda/src/eigenda_data.rs | 2 +- crates/eigenda/src/lib.rs | 13 +- crates/eigenda/src/traits.rs | 4 +- crates/proof/Cargo.toml | 28 +--- crates/proof/src/eigenda_provider.rs | 2 +- crates/proof/src/pipeline.rs | 4 +- justfile | 83 ++---------- 17 files changed, 146 insertions(+), 279 deletions(-) create mode 100644 crates/eigenda/README.md diff --git a/Cargo.lock b/Cargo.lock index bf36576..016edbe 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -73,9 +73,9 @@ dependencies = [ [[package]] name = "alloy-consensus" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ba14856660f31807ebb26ce8f667e814c72694e1077e97ef102e326ad580f3f" +checksum = "a205d0cbb7bfdf9f4fd4b0ec842bc4c5f926e8c14ec3072d3fd75dd363baf1e0" dependencies = [ "alloy-eips", "alloy-primitives", @@ -91,9 +91,9 @@ dependencies = [ [[package]] name = "alloy-consensus-any" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28666307e76441e7af37a2b90cde7391c28112121bea59f4e0d804df8b20057e" +checksum = "993c34090a3f281cb746fd1604520cf21f8407ffbeb006aaa34c0556bffa718e" dependencies = [ "alloy-consensus", "alloy-eips", @@ -141,9 +141,9 @@ dependencies = [ [[package]] name = "alloy-eips" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47e922d558006ba371681d484d12aa73fe673d84884f83747730af7433c0e86d" +checksum = "d1d9907c29ce622946759bf4fd3418166bfeae76c1c544b8081c7be3acd9b4be" dependencies = [ "alloy-eip2930", "alloy-eip7702 0.4.2", @@ -159,9 +159,9 @@ dependencies = [ [[package]] name = "alloy-json-rpc" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9335278f50b0273e0a187680ee742bb6b154a948adf036f448575bacc5ccb315" +checksum = "39a786ce6bc7539dc30cabac6b7875644247c9e7d780e71a9f254d42ebdc013c" dependencies = [ "alloy-primitives", "alloy-sol-types", @@ -173,9 +173,9 @@ dependencies = [ [[package]] name = "alloy-network" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad4e6ad4230df8c4a254c20f8d6a84ab9df151bfca13f463177dbc96571cc1f8" +checksum = "99051f82f77159d5bee06108f33cffee02849e2861fc500bf74213aa2ae8a26e" dependencies = [ "alloy-consensus", "alloy-consensus-any", @@ -198,9 +198,9 @@ dependencies = [ [[package]] name = "alloy-network-primitives" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4df88a2f8020801e0fefce79471d3946d39ca3311802dbbd0ecfdeee5e972e3" +checksum = "d2aff127863f8279921397be8af0ac3f05a8757d5c4c972b491c278518fa07c7" dependencies = [ "alloy-consensus", "alloy-eips", @@ -239,9 +239,9 @@ dependencies = [ [[package]] name = "alloy-provider" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5115c74c037714e1b02a86f742289113afa5d494b5ea58308ba8aa378e739101" +checksum = "0280a4f68e0cefde9449ee989a248230efbe3f95255299d2a7a92009e154629d" dependencies = [ "alloy-chains", "alloy-consensus", @@ -298,9 +298,9 @@ dependencies = [ [[package]] name = "alloy-rpc-client" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c6a0bd0ce5660ac48e4f3bb0c7c5c3a94db287a0be94971599d83928476cbcd" +checksum = "b6fc8b0f68619cfab3a2e15dca7b80ab266f78430bb4353dec546528e04b7449" dependencies = [ "alloy-json-rpc", "alloy-primitives", @@ -321,9 +321,9 @@ dependencies = [ [[package]] name = "alloy-rpc-types" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "374ac12e35bb90ebccd86e7c943ddba9590149a6e35cc4d9cd860d6635fd1018" +checksum = "986f23fe42ac95832901a24b93c20f7ed2b9644394c02b86222801230da60041" dependencies = [ "alloy-primitives", "alloy-rpc-types-debug", @@ -334,9 +334,9 @@ dependencies = [ [[package]] name = "alloy-rpc-types-any" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea98f81bcd759dbfa3601565f9d7a02220d8ef1d294ec955948b90aaafbfd857" +checksum = "57e3aa433d3657b42e98e257ee6fa201f5c853245648a33da8fbb7497a5008bf" dependencies = [ "alloy-consensus-any", "alloy-rpc-types-eth", @@ -345,14 +345,13 @@ dependencies = [ [[package]] name = "alloy-rpc-types-beacon" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e13e94be8f6f5cb735e604f9db436430bf3773fdd41db7221edaa58c07c4c8a" +checksum = "d4612f586da13ac81c75bbbd04f6371bb34d47f0650920fca68636a0b9177bc4" dependencies = [ "alloy-eips", "alloy-primitives", "alloy-rpc-types-engine", - "alloy-serde", "serde", "serde_with", "thiserror", @@ -360,9 +359,9 @@ dependencies = [ [[package]] name = "alloy-rpc-types-debug" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fd14f68a482e67dfba52d404dfff1d3b0d9fc3b4775bd0923f3175d7661c3bd" +checksum = "87cda556c1c69af9222dec46dd3496b622e9a249ef19a7bd0e80e5995a4c81b3" dependencies = [ "alloy-primitives", "serde", @@ -370,9 +369,9 @@ dependencies = [ [[package]] name = "alloy-rpc-types-engine" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ca5898f753ff0d15a0dc955c169523d8fee57e05bb5a38a398b3451b0b988be" +checksum = "30814f8b9ac10219fb77fe42c277a0ffa1c369fbc3961f14d159f51fb221966e" dependencies = [ "alloy-consensus", "alloy-eips", @@ -386,9 +385,9 @@ dependencies = [ [[package]] name = "alloy-rpc-types-eth" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e518b0a7771e00728f18be0708f828b18a1cfc542a7153bef630966a26388e0" +checksum = "0643cc497a71941f526454fe4fecb47e9307d3a7b6c05f70718a0341643bcc79" dependencies = [ "alloy-consensus", "alloy-consensus-any", @@ -406,9 +405,9 @@ dependencies = [ [[package]] name = "alloy-serde" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed3dc8d4a08ffc90c1381d39a4afa2227668259a42c97ab6eecf51cbd82a8761" +checksum = "ea61b049d7ecc66a29f107970dae493d0908e366048f7484a1ca9b02c85f9b2b" dependencies = [ "alloy-primitives", "serde", @@ -417,9 +416,9 @@ dependencies = [ [[package]] name = "alloy-signer" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16188684100f6e0f2a2b949968fe3007749c5be431549064a1bce4e7b3a196a9" +checksum = "93461b0e79c2ddd791fec5f369ab5c2686a33bbb03530144972edf5248f8a2c7" dependencies = [ "alloy-primitives", "async-trait", @@ -489,9 +488,9 @@ dependencies = [ [[package]] name = "alloy-transport" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "628be5b9b75e4f4c4f2a71d985bbaca4f23de356dc83f1625454c505f5eef4df" +checksum = "baf656f983e14812df65b5aee37e7b37535f68a848295e6ed736b2054a405cb7" dependencies = [ "alloy-json-rpc", "base64", @@ -509,9 +508,9 @@ dependencies = [ [[package]] name = "alloy-transport-http" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e24412cf72f79c95cd9b1d9482e3a31f9d94c24b43c4b3b710cc8d4341eaab0" +checksum = "ec938d51a47b7953b1c0fd8ddeb89a29eb113cd4908dfc4e01c7893b252d669f" dependencies = [ "alloy-json-rpc", "alloy-transport", @@ -1323,47 +1322,6 @@ dependencies = [ "spki", ] -[[package]] -name = "eigenda" -version = "0.1.0" -dependencies = [ - "alloy-primitives", - "async-trait", - "kona-derive", - "op-alloy-protocol", - "tracing", -] - -[[package]] -name = "eigenda-proof" -version = "0.1.0" -dependencies = [ - "alloy-consensus", - "alloy-eips", - "alloy-primitives", - "alloy-rlp", - "async-trait", - "eigenda", - "kona-derive", - "kona-driver", - "kona-executor", - "kona-mpt", - "kona-preimage", - "kona-proof", - "lru", - "op-alloy-consensus", - "op-alloy-genesis", - "op-alloy-protocol", - "op-alloy-registry", - "op-alloy-rpc-types-engine", - "serde", - "serde_json", - "spin", - "thiserror", - "tokio", - "tracing", -] - [[package]] name = "either" version = "1.13.0" @@ -1751,19 +1709,23 @@ name = "hokulea-client" version = "0.1.0" dependencies = [ "alloy-consensus", - "alloy-primitives", - "alloy-provider", - "anyhow", - "clap", - "eigenda", - "eigenda-proof", + "hokulea-proof", "kona-client", "kona-driver", "kona-executor", - "kona-host", "kona-preimage", "kona-proof", - "thiserror", + "tracing", +] + +[[package]] +name = "hokulea-eigenda" +version = "0.1.0" +dependencies = [ + "alloy-primitives", + "async-trait", + "kona-derive", + "op-alloy-protocol", "tracing", ] @@ -1776,35 +1738,39 @@ dependencies = [ "alloy-primitives", "alloy-provider", "alloy-rlp", - "alloy-rpc-client", "alloy-rpc-types", - "alloy-rpc-types-beacon", - "alloy-serde", - "alloy-transport-http", "anyhow", "async-trait", "clap", - "eigenda-proof", "hokulea-client", - "kona-client", - "kona-derive", + "hokulea-proof", "kona-host", "kona-mpt", "kona-preimage", - "kona-proof", - "kona-std-fpvm", - "op-alloy-genesis", "op-alloy-protocol", "op-alloy-rpc-types-engine", "proptest", "reqwest", "revm", - "rocksdb", - "serde", "serde_json", "tokio", "tracing", - "tracing-subscriber", +] + +[[package]] +name = "hokulea-proof" +version = "0.1.0" +dependencies = [ + "alloy-primitives", + "async-trait", + "hokulea-eigenda", + "kona-derive", + "kona-driver", + "kona-preimage", + "kona-proof", + "op-alloy-genesis", + "op-alloy-protocol", + "op-alloy-rpc-types-engine", ] [[package]] @@ -1849,9 +1815,9 @@ checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" [[package]] name = "hyper" -version = "1.5.1" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97818827ef4f364230e16705d4706e2897df2bb60617d6ca15d598025a3c481f" +checksum = "256fb8d4bd6413123cc9d91832d78325c48ff41677595be797d90f42969beae0" dependencies = [ "bytes", "futures-channel", @@ -2194,7 +2160,7 @@ dependencies = [ [[package]] name = "kona-client" version = "0.1.0" -source = "git+https://github.com/anton-rs/kona#8f21eff5d48f2a7e72380c15e24a927799dd8175" +source = "git+https://github.com/anton-rs/kona?rev=8f21eff5d48f2a7e72380c15e24a927799dd8175#8f21eff5d48f2a7e72380c15e24a927799dd8175" dependencies = [ "alloy-consensus", "alloy-eips", @@ -2227,7 +2193,7 @@ dependencies = [ [[package]] name = "kona-derive" version = "0.2.0" -source = "git+https://github.com/anton-rs/kona#8f21eff5d48f2a7e72380c15e24a927799dd8175" +source = "git+https://github.com/anton-rs/kona?rev=8f21eff5d48f2a7e72380c15e24a927799dd8175#8f21eff5d48f2a7e72380c15e24a927799dd8175" dependencies = [ "alloy-consensus", "alloy-eips", @@ -2246,7 +2212,7 @@ dependencies = [ [[package]] name = "kona-driver" version = "0.2.0" -source = "git+https://github.com/anton-rs/kona#8f21eff5d48f2a7e72380c15e24a927799dd8175" +source = "git+https://github.com/anton-rs/kona?rev=8f21eff5d48f2a7e72380c15e24a927799dd8175#8f21eff5d48f2a7e72380c15e24a927799dd8175" dependencies = [ "alloy-consensus", "alloy-primitives", @@ -2264,7 +2230,7 @@ dependencies = [ [[package]] name = "kona-executor" version = "0.2.0" -source = "git+https://github.com/anton-rs/kona#8f21eff5d48f2a7e72380c15e24a927799dd8175" +source = "git+https://github.com/anton-rs/kona?rev=8f21eff5d48f2a7e72380c15e24a927799dd8175#8f21eff5d48f2a7e72380c15e24a927799dd8175" dependencies = [ "alloy-consensus", "alloy-eips", @@ -2282,7 +2248,7 @@ dependencies = [ [[package]] name = "kona-host" version = "0.1.0" -source = "git+https://github.com/anton-rs/kona#8f21eff5d48f2a7e72380c15e24a927799dd8175" +source = "git+https://github.com/anton-rs/kona?rev=8f21eff5d48f2a7e72380c15e24a927799dd8175#8f21eff5d48f2a7e72380c15e24a927799dd8175" dependencies = [ "alloy-consensus", "alloy-eips", @@ -2319,7 +2285,7 @@ dependencies = [ [[package]] name = "kona-mpt" version = "0.1.1" -source = "git+https://github.com/anton-rs/kona#8f21eff5d48f2a7e72380c15e24a927799dd8175" +source = "git+https://github.com/anton-rs/kona?rev=8f21eff5d48f2a7e72380c15e24a927799dd8175#8f21eff5d48f2a7e72380c15e24a927799dd8175" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -2330,7 +2296,7 @@ dependencies = [ [[package]] name = "kona-preimage" version = "0.2.0" -source = "git+https://github.com/anton-rs/kona#8f21eff5d48f2a7e72380c15e24a927799dd8175" +source = "git+https://github.com/anton-rs/kona?rev=8f21eff5d48f2a7e72380c15e24a927799dd8175#8f21eff5d48f2a7e72380c15e24a927799dd8175" dependencies = [ "alloy-primitives", "async-channel", @@ -2342,7 +2308,7 @@ dependencies = [ [[package]] name = "kona-proof" version = "0.2.0" -source = "git+https://github.com/anton-rs/kona#8f21eff5d48f2a7e72380c15e24a927799dd8175" +source = "git+https://github.com/anton-rs/kona?rev=8f21eff5d48f2a7e72380c15e24a927799dd8175#8f21eff5d48f2a7e72380c15e24a927799dd8175" dependencies = [ "alloy-consensus", "alloy-eips", @@ -2371,7 +2337,7 @@ dependencies = [ [[package]] name = "kona-std-fpvm" version = "0.1.1" -source = "git+https://github.com/anton-rs/kona#8f21eff5d48f2a7e72380c15e24a927799dd8175" +source = "git+https://github.com/anton-rs/kona?rev=8f21eff5d48f2a7e72380c15e24a927799dd8175#8f21eff5d48f2a7e72380c15e24a927799dd8175" dependencies = [ "async-trait", "cfg-if", @@ -2383,7 +2349,7 @@ dependencies = [ [[package]] name = "kona-std-fpvm-proc" version = "0.1.1" -source = "git+https://github.com/anton-rs/kona#8f21eff5d48f2a7e72380c15e24a927799dd8175" +source = "git+https://github.com/anton-rs/kona?rev=8f21eff5d48f2a7e72380c15e24a927799dd8175#8f21eff5d48f2a7e72380c15e24a927799dd8175" dependencies = [ "anyhow", "cfg-if", diff --git a/Cargo.toml b/Cargo.toml index afb3207..1408458 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,27 +5,27 @@ members = ["bin/*"] [workspace.dependencies] # Workspace hokulea-client = { path = "bin/client", version = "0.1.0", default-features = false } -eigenda = { path = "crates/eigenda", version = "0.1.0", default-features = false } -eigenda-proof = { path = "crates/proof", version = "0.1.0", default-features = false } +hokulea-eigenda = { path = "crates/eigenda", version = "0.1.0", default-features = false } +hokulea-proof = { path = "crates/proof", version = "0.1.0", default-features = false } # Kona # We use git dependencies instead of version dependencies because Kona is moving very fast right now # but publish infrequently (last was 2 weeks ago). We want to make sure to use the latest code # while we're still figuring out how to integrate with it. -kona-mpt = { git = "https://github.com/anton-rs/kona", commit = "f2b634f", default-features = false } -kona-derive = { git = "https://github.com/anton-rs/kona", commit = "f2b634f", default-features = false } -kona-driver = { git = "https://github.com/anton-rs/kona", commit = "f2b634f", default-features = false } -kona-executor = { git = "https://github.com/anton-rs/kona", commit = "f2b634f", default-features = false } -kona-proof = { git = "https://github.com/anton-rs/kona", commit = "f2b634f", default-features = false } -kona-std-fpvm = { git = "https://github.com/anton-rs/kona", commit = "f2b634f", default-features = false } -kona-preimage = { git = "https://github.com/anton-rs/kona", commit = "f2b634f", default-features = false } -kona-std-fpvm-proc = { git = "https://github.com/anton-rs/kona", commit = "f2b634f", default-features = false } +kona-mpt = { git = "https://github.com/anton-rs/kona", rev = "8f21eff5d48f2a7e72380c15e24a927799dd8175", default-features = false } +kona-derive = { git = "https://github.com/anton-rs/kona", rev = "8f21eff5d48f2a7e72380c15e24a927799dd8175", default-features = false } +kona-driver = { git = "https://github.com/anton-rs/kona", rev = "8f21eff5d48f2a7e72380c15e24a927799dd8175", default-features = false } +kona-executor = { git = "https://github.com/anton-rs/kona", rev = "8f21eff5d48f2a7e72380c15e24a927799dd8175", default-features = false } +kona-proof = { git = "https://github.com/anton-rs/kona", rev = "8f21eff5d48f2a7e72380c15e24a927799dd8175", default-features = false } +kona-std-fpvm = { git = "https://github.com/anton-rs/kona", rev = "8f21eff5d48f2a7e72380c15e24a927799dd8175", default-features = false } +kona-preimage = { git = "https://github.com/anton-rs/kona", rev = "8f21eff5d48f2a7e72380c15e24a927799dd8175", default-features = false } +kona-std-fpvm-proc = { git = "https://github.com/anton-rs/kona", rev = "8f21eff5d48f2a7e72380c15e24a927799dd8175", default-features = false } -# These are kona binary crates that aren't even published to crates.io, so we need to use git dependencies. +# These two kona crates aren't published to crates.io, so we need to use git dependencies. # TODO: Given that Hokulea is just meant to be a library crate to extend kona with eigenda understanding, # we prob want to move these to dev-dependencies since we only need them for testing? -kona-client = { git = "https://github.com/anton-rs/kona", commit = "f2b634f", default-features = false } -kona-host = { git = "https://github.com/anton-rs/kona", commit = "f2b634f", default-features = false } +kona-client = { git = "https://github.com/anton-rs/kona", rev = "8f21eff5d48f2a7e72380c15e24a927799dd8175", default-features = false } +kona-host = { git = "https://github.com/anton-rs/kona", rev = "8f21eff5d48f2a7e72380c15e24a927799dd8175", default-features = false } # Alloy diff --git a/bin/client/Cargo.toml b/bin/client/Cargo.toml index e23323c..9f113b0 100644 --- a/bin/client/Cargo.toml +++ b/bin/client/Cargo.toml @@ -4,22 +4,14 @@ version = "0.1.0" edition = "2021" [dependencies] -alloy-primitives.workspace = true -alloy-provider.workspace = true alloy-consensus.workspace = true -anyhow.workspace = true -clap.workspace = true kona-client.workspace = true -kona-host.workspace = true kona-preimage.workspace = true kona-proof.workspace = true kona-driver.workspace = true kona-executor.workspace = true -eigenda.workspace = true -eigenda-proof.workspace = true +hokulea-proof.workspace = true -thiserror.workspace = true tracing.workspace = true - diff --git a/bin/client/src/lib.rs b/bin/client/src/lib.rs index 9f80ef0..bf5d889 100644 --- a/bin/client/src/lib.rs +++ b/bin/client/src/lib.rs @@ -1,6 +1,6 @@ extern crate alloc; use alloy_consensus::{Header, Sealed}; -use eigenda_proof::pipeline::OraclePipeline; +use hokulea_proof::pipeline::OraclePipeline; use kona_client::FaultProofProgramError; use kona_driver::Driver; use kona_preimage::{ @@ -20,7 +20,7 @@ use kona_proof::{ }; use tracing::{error, info}; -use eigenda_proof::eigenda_provider::OracleEigenDAProvider; +use hokulea_proof::eigenda_provider::OracleEigenDAProvider; #[inline] pub async fn run(oracle_client: P, hint_client: H) -> Result<(), FaultProofProgramError> diff --git a/bin/host/Cargo.toml b/bin/host/Cargo.toml index 56ccf3f..5e6b8b7 100644 --- a/bin/host/Cargo.toml +++ b/bin/host/Cargo.toml @@ -6,35 +6,32 @@ edition = "2021" [dependencies] # Workspace kona-mpt.workspace = true -kona-derive.workspace = true -kona-std-fpvm.workspace = true kona-preimage = { workspace = true, features = ["std"] } -kona-proof = { workspace = true, features = ["std"] } -kona-client.workspace = true kona-host.workspace = true -eigenda-proof.workspace = true +hokulea-proof.workspace = true hokulea-client.workspace = true # Alloy alloy-rlp.workspace = true alloy-eips = { workspace = true, features = ["kzg"] } -alloy-serde.workspace = true alloy-provider = { workspace = true, features = ["reqwest"] } alloy-consensus.workspace = true -alloy-rpc-client.workspace = true -alloy-transport-http.workspace = true alloy-rpc-types = { workspace = true, features = ["eth", "debug"] } alloy-primitives = { workspace = true, features = ["serde"] } -alloy-rpc-types-beacon.workspace = true # Op Alloy -op-alloy-genesis = { workspace = true, features = ["std", "serde"] } op-alloy-protocol = { workspace = true, features = ["std", "serde"] } op-alloy-rpc-types-engine = { workspace = true, features = ["serde"] } # Revm -revm = { workspace = true, features = ["std", "c-kzg", "secp256k1", "portable", "blst"] } +revm = { workspace = true, features = [ + "std", + "c-kzg", + "secp256k1", + "portable", + "blst", +] } # General anyhow.workspace = true @@ -43,10 +40,7 @@ reqwest.workspace = true serde_json.workspace = true async-trait.workspace = true tokio = { workspace = true, features = ["full"] } -serde = { workspace = true, features = ["derive"] } -rocksdb = { workspace = true, features = ["snappy"] } clap = { workspace = true, features = ["derive", "env"] } -tracing-subscriber = { workspace = true, features = ["fmt"] } [dev-dependencies] -proptest.workspace = true \ No newline at end of file +proptest.workspace = true diff --git a/bin/host/src/fetcher/mod.rs b/bin/host/src/fetcher/mod.rs index 4b18cda..8993882 100644 --- a/bin/host/src/fetcher/mod.rs +++ b/bin/host/src/fetcher/mod.rs @@ -16,7 +16,7 @@ use alloy_rpc_types::{ Transaction, }; use anyhow::{anyhow, Result}; -use eigenda_proof::hint::{Hint, HintType}; +use hokulea_proof::hint::{Hint, HintType}; use kona_host::{blobs::OnlineBlobProvider, kv::KeyValueStore}; use kona_preimage::{PreimageKey, PreimageKeyType}; use op_alloy_protocol::BlockInfo; diff --git a/bin/host/src/lib.rs b/bin/host/src/lib.rs index bf64ed3..5881630 100644 --- a/bin/host/src/lib.rs +++ b/bin/host/src/lib.rs @@ -8,12 +8,10 @@ pub mod preimage; use server::PreimageServer; -use kona_host::cli::{init_tracing_subscriber, HostCli}; +use kona_host::cli::HostCli; use kona_host::kv; -use kona_client; - use hokulea_client; use crate::eigenda_blobs::OnlineEigenDABlobProvider; @@ -22,7 +20,6 @@ use fetcher::Fetcher; use kona_preimage::{ BidirectionalChannel, HintReader, HintWriter, NativeChannel, OracleReader, OracleServer, }; -use kona_std_fpvm::{FileChannel, FileDescriptor}; use kv::KeyValueStore; use std::sync::Arc; use tokio::{sync::RwLock, task}; @@ -50,7 +47,7 @@ pub async fn start_server_and_native_client(cfg: HostCli) -> Result { ) .await .map_err(|e| anyhow!("Failed to load eigenda blob provider configuration: {e}"))?; - info!(target: "host", "create fetch with eigenda_provider"); + info!(target: "host", "create fetch with eigenda_provider"); Some(Arc::new(RwLock::new(Fetcher::new( kv_store.clone(), l1_provider, diff --git a/crates/eigenda/Cargo.toml b/crates/eigenda/Cargo.toml index 7231363..258342d 100644 --- a/crates/eigenda/Cargo.toml +++ b/crates/eigenda/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "eigenda" +name = "hokulea-eigenda" version = "0.1.0" edition = "2021" diff --git a/crates/eigenda/README.md b/crates/eigenda/README.md new file mode 100644 index 0000000..342576f --- /dev/null +++ b/crates/eigenda/README.md @@ -0,0 +1,3 @@ +# `eigenda` + +This binary contains the client program for executing the Optimism rollup state transition. diff --git a/crates/eigenda/src/eigenda_blobs.rs b/crates/eigenda/src/eigenda_blobs.rs index d7711f5..c8e023e 100644 --- a/crates/eigenda/src/eigenda_blobs.rs +++ b/crates/eigenda/src/eigenda_blobs.rs @@ -1,20 +1,15 @@ //! Blob Data Source -use crate::eigenda::EigenDADataSource; use crate::eigenda_data::EigenDABlobData; use crate::traits::EigenDABlobProvider; -use alloc::{boxed::Box, string::ToString, vec::Vec}; -use alloy_primitives::{Address, Bytes}; -use async_trait::async_trait; +use alloc::vec::Vec; +use alloy_primitives::Bytes; use kona_derive::{ errors::{BlobProviderError, PipelineError}, - traits::{BlobProvider, ChainProvider, DataAvailabilityProvider}, types::PipelineResult, }; -use op_alloy_protocol::{BlockInfo, Frame, DERIVATION_VERSION_0}; - /// A data iterator that reads from a blob. #[derive(Debug, Clone)] pub struct EigenDABlobSource @@ -43,18 +38,18 @@ where } /// Loads blob data into the source if it is not open. - async fn load_blobs(&mut self, altDACommitment: &Bytes) -> Result<(), BlobProviderError> { + async fn load_blobs(&mut self, altda_commitment: &Bytes) -> Result<(), BlobProviderError> { if self.open { return Ok(()); } info!(target: "eigenda-blobsource", "going to fetch through altda fetcher"); // it should use self.altda_fetcher to get the blob - let data = self.altda_fetcher.get_blob(altDACommitment).await; + let data = self.altda_fetcher.get_blob(altda_commitment).await; match data { Ok(data) => { self.open = true; - let mut new_blob = data.clone(); + let new_blob = data.clone(); // new_blob.truncate(data.len()-1); let eigenda_blob = EigenDABlobData { blob: new_blob }; self.data.push(eigenda_blob); @@ -63,7 +58,7 @@ where Ok(()) } - Err(e) => { + Err(_) => { self.open = true; return Ok(()); } @@ -79,9 +74,9 @@ where Ok(self.data.remove(0)) } - pub async fn next(&mut self, altDACommitment: &Bytes) -> PipelineResult { + pub async fn next(&mut self, altda_commitment: &Bytes) -> PipelineResult { info!(target: "eigenda-blobsource", "next"); - self.load_blobs(altDACommitment).await?; + self.load_blobs(altda_commitment).await?; info!(target: "eigenda-blobsource", "next 1"); let next_data = match self.next_data() { Ok(d) => d, @@ -99,7 +94,7 @@ where warn!(target: "blob-source", "Failed to decode blob data, skipping"); panic!() // todo need to add recursion - // self.next(altDACommitment).await + // self.next(altda_commitment).await } } } diff --git a/crates/eigenda/src/eigenda_data.rs b/crates/eigenda/src/eigenda_data.rs index 7978555..754f3a2 100644 --- a/crates/eigenda/src/eigenda_data.rs +++ b/crates/eigenda/src/eigenda_data.rs @@ -1,4 +1,4 @@ -use alloy_primitives::{Address, Bytes}; +use alloy_primitives::Bytes; use kona_derive::errors::BlobDecodingError; diff --git a/crates/eigenda/src/lib.rs b/crates/eigenda/src/lib.rs index 3774818..b62f3f5 100644 --- a/crates/eigenda/src/lib.rs +++ b/crates/eigenda/src/lib.rs @@ -1,3 +1,4 @@ +#![doc = include_str!("../README.md")] #![warn( missing_debug_implementations, missing_docs, @@ -14,10 +15,14 @@ extern crate alloc; #[macro_use] extern crate tracing; -pub mod traits; +mod traits; +pub use traits::EigenDABlobProvider; -pub mod eigenda; +mod eigenda; +pub use eigenda::EigenDADataSource; -pub mod eigenda_blobs; +mod eigenda_blobs; +pub use eigenda_blobs::EigenDABlobSource; -pub mod eigenda_data; +mod eigenda_data; +pub use eigenda_data::EigenDABlobData; diff --git a/crates/eigenda/src/traits.rs b/crates/eigenda/src/traits.rs index ea44048..2fbd23e 100644 --- a/crates/eigenda/src/traits.rs +++ b/crates/eigenda/src/traits.rs @@ -1,8 +1,8 @@ -use alloc::{boxed::Box, fmt::Debug, string::ToString, vec::Vec}; +use alloc::{boxed::Box, string::ToString}; use alloy_primitives::Bytes; use async_trait::async_trait; use core::fmt::Display; -use kona_derive::{errors::PipelineErrorKind, types::PipelineResult}; +use kona_derive::errors::PipelineErrorKind; #[async_trait] pub trait EigenDABlobProvider { diff --git a/crates/proof/Cargo.toml b/crates/proof/Cargo.toml index c5f7389..b03c361 100644 --- a/crates/proof/Cargo.toml +++ b/crates/proof/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "eigenda-proof" +name = "hokulea-proof" description = "Eigenda Proof SDK" version = "0.1.0" edition = "2021" @@ -9,40 +9,16 @@ kona-preimage.workspace = true kona-driver.workspace = true kona-proof.workspace = true kona-derive.workspace = true -eigenda.workspace = true - -kona-mpt.workspace = true -kona-executor.workspace = true -# Alloy - -# Op Alloy - +hokulea-eigenda.workspace = true # Alloy -alloy-rlp.workspace = true -alloy-eips.workspace = true -alloy-consensus.workspace = true alloy-primitives.workspace = true # Op Alloy -op-alloy-registry.workspace = true op-alloy-protocol.workspace = true -op-alloy-consensus.workspace = true op-alloy-rpc-types-engine.workspace = true op-alloy-genesis = { workspace = true, features = ["serde"] } # General -lru.workspace = true -spin.workspace = true -serde.workspace = true -tracing.workspace = true -serde_json.workspace = true async-trait.workspace = true -thiserror.workspace = true - -# `std` feature dependencies -tokio = { workspace = true, features = ["full"], optional = true } - -[features] -std = ["dep:tokio"] \ No newline at end of file diff --git a/crates/proof/src/eigenda_provider.rs b/crates/proof/src/eigenda_provider.rs index 5cda771..14647bd 100644 --- a/crates/proof/src/eigenda_provider.rs +++ b/crates/proof/src/eigenda_provider.rs @@ -2,7 +2,7 @@ use alloc::boxed::Box; use alloc::sync::Arc; use alloy_primitives::{keccak256, Bytes}; use async_trait::async_trait; -use eigenda::traits::EigenDABlobProvider; +use hokulea_eigenda::EigenDABlobProvider; use kona_preimage::{CommsClient, PreimageKey, PreimageKeyType}; use kona_proof::errors::OracleProviderError; diff --git a/crates/proof/src/pipeline.rs b/crates/proof/src/pipeline.rs index 91167cc..67b09e8 100644 --- a/crates/proof/src/pipeline.rs +++ b/crates/proof/src/pipeline.rs @@ -1,9 +1,7 @@ use alloc::{boxed::Box, sync::Arc}; use async_trait::async_trait; use core::fmt::Debug; -use eigenda::eigenda::EigenDADataSource; -use eigenda::eigenda_blobs::EigenDABlobSource; -use eigenda::traits::EigenDABlobProvider; +use hokulea_eigenda::{EigenDABlobProvider, EigenDABlobSource, EigenDADataSource}; use kona_derive::{ attributes::StatefulAttributesBuilder, errors::PipelineErrorKind, diff --git a/justfile b/justfile index 2678f06..684b6ba 100644 --- a/justfile +++ b/justfile @@ -1,6 +1,4 @@ set positional-arguments -alias t := tests -alias la := lint-all alias l := lint-native alias lint := lint-native alias f := fmt-native-fix @@ -11,7 +9,16 @@ alias h := hack default: @just --list +# unused-deps finds unused dependencies in the workspace. +# See https://rustprojectprimer.com/checks/unused.html +# machete runs very fast but is less accurate, on by default. +# udeps is slower (it compiles code) but more accurate, off by default. +unused-deps slow="false": + cargo machete + # cargo +nightly udeps + # Run all tests (excluding online tests) +alias t := tests tests: test test-docs # Test for the native target with all features. By default, excludes online tests. @@ -48,7 +55,8 @@ clean-actions: rm -rf monorepo/ # Lint the workspace for all available targets -lint-all: lint-native lint-cannon lint-asterisc lint-docs +alias la := lint-all +lint-all: lint-native lint-docs # Runs `cargo hack check` against the workspace hack: @@ -66,24 +74,6 @@ fmt-native-check: lint-native: fmt-native-check lint-docs cargo +nightly clippy --workspace --all --all-features --all-targets -- -D warnings -# Lint the workspace (mips arch). Currently, only the `kona-std-fpvm` crate is linted for the `cannon` target, as it is the only crate with architecture-specific code. -lint-cannon: - docker run \ - --rm \ - --platform linux/amd64 \ - -v `pwd`/:/workdir \ - -w="/workdir" \ - ghcr.io/anton-rs/kona/cannon-builder:main cargo +nightly clippy -p kona-std-fpvm --all-features --target /mips-unknown-none.json -Zbuild-std=core,alloc -- -D warnings - -# Lint the workspace (risc-v arch). Currently, only the `kona-std-fpvm` crate is linted for the `asterisc` target, as it is the only crate with architecture-specific code. -lint-asterisc: - docker run \ - --rm \ - --platform linux/amd64 \ - -v `pwd`/:/workdir \ - -w="/workdir" \ - ghcr.io/anton-rs/kona/asterisc-builder:main cargo +nightly clippy -p kona-std-fpvm --all-features --target riscv64gc-unknown-linux-gnu -Zbuild-std=core,alloc -- -D warnings - # Lint the Rust documentation lint-docs: RUSTDOCFLAGS="-D warnings" cargo doc --all --no-deps --document-private-items @@ -93,61 +83,12 @@ test-docs: cargo test --doc --all --locked # Build the workspace for all available targets -build: build-native build-cannon build-asterisc +build: build-native # Build for the native target build-native *args='': cargo build --workspace $@ -# Build for the `cannon` target. Any crates that require the stdlib are excluded from the build for this target. -build-cannon *args='': - docker run \ - --rm \ - --platform linux/amd64 \ - -v `pwd`/:/workdir \ - -w="/workdir" \ - ghcr.io/anton-rs/kona/cannon-builder:main cargo build --workspace -Zbuild-std=core,alloc $@ --exclude kona-host - -# Build for the `asterisc` target. Any crates that require the stdlib are excluded from the build for this target. -build-asterisc *args='': - docker run \ - --rm \ - --platform linux/amd64 \ - -v `pwd`/:/workdir \ - -w="/workdir" \ - ghcr.io/anton-rs/kona/asterisc-builder:main cargo build --workspace -Zbuild-std=core,alloc $@ --exclude kona-host - -# Build the `kona-client` prestate artifacts for the latest release. -build-client-prestate-asterisc-artifacts kona_tag asterisc_tag out='./prestate-artifacts-asterisc': - #!/bin/bash - PATH_TO_REPRO_BUILDER=./build/asterisc/asterisc-repro.dockerfile - OUTPUT_DIR={{out}} - - echo "Building kona-client prestate artifacts for the asterisc target. 🐚 Kona Tag: {{kona_tag}} | 🎇 Asterisc Tag: {{asterisc_tag}}" - docker build \ - -f $PATH_TO_REPRO_BUILDER \ - --output $OUTPUT_DIR \ - --build-arg CLIENT_TAG={{kona_tag}} \ - --build-arg ASTERISC_TAG={{asterisc_tag}} \ - --platform linux/amd64 \ - . - -# Build the `kona-client` prestate artifacts for the latest release, with an image containing the resulting -# binaries. -build-client-prestate-asterisc-image kona_tag asterisc_tag out='./prestate-artifacts-asterisc': - #!/bin/bash - PATH_TO_REPRO_BUILDER=./build/asterisc/asterisc-repro.dockerfile - OUTPUT_DIR={{out}} - - echo "Building kona-client prestate artifacts for the asterisc target. 🐚 Kona Tag: {{kona_tag}} | 🎇 Asterisc Tag: {{asterisc_tag}}" - docker build \ - -f $PATH_TO_REPRO_BUILDER \ - -t kona-fpp-asterisc:latest \ - --build-arg CLIENT_TAG={{kona_tag}} \ - --build-arg ASTERISC_TAG={{asterisc_tag}} \ - --platform linux/amd64 \ - . - # Clones and checks out the monorepo at the commit present in `.monorepo` monorepo: ([ ! -d monorepo ] && git clone https://github.com/ethereum-optimism/monorepo) || exit 0