Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: eigenda integration using hokulea crate #2

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
feat: eigenda integration using hokulea crate
samlaf committed Dec 28, 2024
commit a80f5ac075740d404c24cc4c16dc7b7853fe1e74
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"rust-analyzer.linkedProjects": [
"./Cargo.toml",
"./build/risczero/fpvm/Cargo.toml"
]
}
88 changes: 77 additions & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 14 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -63,15 +63,20 @@ kailua-contracts = { path = "crates/contracts" }
kailua-host = { path = "bin/host" }

# Kona
kona-client = { git = "https://github.com/ethereum-optimism/kona", rev = "7a40d87", default-features = false }
kona-derive = { git = "https://github.com/ethereum-optimism/kona", rev = "7a40d87", default-features = false, features = ["serde"] }
kona-driver = { git = "https://github.com/ethereum-optimism/kona", rev = "7a40d87" }
kona-executor = { git = "https://github.com/ethereum-optimism/kona", rev = "7a40d87" }
kona-host = { git = "https://github.com/ethereum-optimism/kona", rev = "7a40d87" }
kona-mpt = { git = "https://github.com/ethereum-optimism/kona", rev = "7a40d87", features = ["serde"] }
kona-preimage = { git = "https://github.com/ethereum-optimism/kona", rev = "7a40d87", features = ["rkyv"] }
kona-proof = { git = "https://github.com/ethereum-optimism/kona", rev = "7a40d87" }
kona-std-fpvm = { git = "https://github.com/ethereum-optimism/kona", rev = "7a40d87" }
kona-client = { git = "https://github.com/anton-rs/kona", rev = "7a40d87", default-features = false }
kona-derive = { git = "https://github.com/anton-rs/kona", rev = "7a40d87", default-features = false }
kona-driver = { git = "https://github.com/anton-rs/kona", rev = "7a40d87", default-features = false }
kona-executor = { git = "https://github.com/anton-rs/kona", rev = "7a40d87", default-features = false }
kona-host = { git = "https://github.com/anton-rs/kona", rev = "7a40d87", default-features = false }
kona-mpt = { git = "https://github.com/anton-rs/kona", rev = "7a40d87", default-features = false }
kona-preimage = { git = "https://github.com/anton-rs/kona", rev = "7a40d87", default-features = false }
kona-proof = { git = "https://github.com/anton-rs/kona", rev = "7a40d87", default-features = false }
kona-std-fpvm = { git = "https://github.com/anton-rs/kona", rev = "7a40d87", default-features = false }

# Hokulea
hokulea-eigenda = { git = "https://github.com/Layr-Labs/hokulea", branch = "kailua-compatible", default-features = false }
hokulea-proof = { git = "https://github.com/Layr-Labs/hokulea", branch = "kailua-compatible", default-features = false }
hokulea-host = { git = "https://github.com/Layr-Labs/hokulea", branch = "kailua-compatible", default-features = false }

# RISC Zero zkVM
bonsai-sdk = { version = "1.2.0", features = ["non_blocking"] }
3 changes: 3 additions & 0 deletions bin/host/Cargo.toml
Original file line number Diff line number Diff line change
@@ -35,6 +35,9 @@ kona-derive.workspace = true
kona-host.workspace = true
kona-preimage.workspace = true

# Hokulea
hokulea-host.workspace = true

# zkVM
bonsai-sdk.workspace = true
boundless-market.workspace = true
42 changes: 33 additions & 9 deletions bin/host/src/lib.rs
Original file line number Diff line number Diff line change
@@ -18,15 +18,17 @@ use alloy::primitives::{keccak256, B256};
use alloy::providers::{Provider, ProviderBuilder, ReqwestProvider};
use alloy_chains::NamedChain;
use alloy_eips::eip4844::IndexedBlobHash;
use anyhow::anyhow;
use anyhow::bail;
use boundless_market::storage::StorageProviderConfig;
use clap::Parser;
use hokulea_host::eigenda_blobs::OnlineEigenDABlobProvider;
use hokulea_host::eigenda_fetcher::FetcherWithEigenDASupport;
use hokulea_host::start_native_preimage_server;
use kailua_client::{parse_b256, BoundlessArgs};
use kailua_common::blobs::BlobFetchRequest;
use kailua_common::precondition::PreconditionValidationData;
use kona_host::fetcher::Fetcher;
use kona_host::kv::SharedKeyValueStore;
use kona_host::start_native_preimage_server;
use kona_preimage::{BidirectionalChannel, HintWriter, OracleReader, PreimageKey, PreimageKeyType};
use op_alloy_genesis::RollupConfig;
use op_alloy_protocol::BlockInfo;
@@ -76,6 +78,17 @@ pub struct KailuaHostCli {
/// Storage provider to use for elf and input
#[clap(flatten)]
pub boundless_storage_config: Option<StorageProviderConfig>,

#[clap(flatten)]
pub eigenda_args: EigenDAArgs,
}

#[derive(Parser, Debug, Clone)]
pub struct EigenDAArgs {
/// URL of the Ethereum RPC endpoint.
#[clap(long, env)]
#[arg(required = false)]
pub eigenda_proxy_address: Option<String>,
}

/// Starts the [PreimageServer] and the client program in separate threads. The client program is
@@ -97,13 +110,24 @@ pub async fn start_server_and_native_client(
let kv_store = args.kona.construct_kv_store();
let fetcher = if !args.kona.is_offline() {
let (l1_provider, blob_provider, l2_provider) = args.kona.create_providers().await?;
Some(Arc::new(RwLock::new(Fetcher::new(
kv_store.clone(),
l1_provider,
blob_provider,
l2_provider,
args.kona.agreed_l2_head_hash,
))))
let eigenda_blob_provider = OnlineEigenDABlobProvider::new_http(
args.eigenda_args
.eigenda_proxy_address
.expect("missing eigenda_proxy_address")
.clone(),
)
.await
.map_err(|e| anyhow!("Failed to load eigenda blob provider configuration: {e}"))?;
Some(Arc::new(RwLock::new(
FetcherWithEigenDASupport::new_from_parts(
kv_store.clone(),
l1_provider,
blob_provider,
eigenda_blob_provider,
l2_provider,
args.kona.agreed_l2_head_hash,
),
)))
} else {
None
};
Loading