From fa67d386cc424844755576dc03a88da53c90980a Mon Sep 17 00:00:00 2001 From: Ratan Kaliani Date: Mon, 27 Jan 2025 14:00:43 -0800 Subject: [PATCH 1/4] feat: fix compilation --- bin/host/src/interop/fetcher.rs | 2 +- bin/host/src/interop/local_kv.rs | 2 +- bin/host/src/interop/orchestrator.rs | 9 ++++----- bin/host/src/lib.rs | 5 +++++ bin/host/src/main.rs | 11 ++++------- bin/host/src/single/fetcher.rs | 2 +- bin/host/src/single/local_kv.rs | 2 +- bin/host/src/single/orchestrator.rs | 11 +++++------ 8 files changed, 22 insertions(+), 22 deletions(-) diff --git a/bin/host/src/interop/fetcher.rs b/bin/host/src/interop/fetcher.rs index 4c9462e8a..007759545 100644 --- a/bin/host/src/interop/fetcher.rs +++ b/bin/host/src/interop/fetcher.rs @@ -2,7 +2,7 @@ //! preimages from a remote source serving the super-chain (interop) proof mode. use super::InteropHostCli; -use crate::single::SingleChainFetcher; +use crate::{single::SingleChainFetcher, KeyValueStore}; use alloy_consensus::{Header, Sealed, TxEnvelope, EMPTY_ROOT_HASH}; use alloy_eips::{ eip2718::Encodable2718, diff --git a/bin/host/src/interop/local_kv.rs b/bin/host/src/interop/local_kv.rs index 0e1c7771f..b96c90990 100644 --- a/bin/host/src/interop/local_kv.rs +++ b/bin/host/src/interop/local_kv.rs @@ -2,9 +2,9 @@ //! using the [InteropHostCli] config. use super::InteropHostCli; +use crate::KeyValueStore; use alloy_primitives::{keccak256, B256}; use anyhow::Result; -use kona_host::KeyValueStore; use kona_preimage::PreimageKey; use kona_proof_interop::boot::{ L1_HEAD_KEY, L2_AGREED_PRE_STATE_KEY, L2_CLAIMED_POST_STATE_KEY, L2_CLAIMED_TIMESTAMP_KEY, diff --git a/bin/host/src/interop/orchestrator.rs b/bin/host/src/interop/orchestrator.rs index 15834e057..aeca0121c 100644 --- a/bin/host/src/interop/orchestrator.rs +++ b/bin/host/src/interop/orchestrator.rs @@ -1,15 +1,14 @@ //! [SingleChainHostCli]'s [HostOrchestrator] + [DetachedHostOrchestrator] implementations. use super::{InteropFetcher, InteropHostCli, LocalKeyValueStore}; -use crate::eth::http_provider; +use crate::{ + eth::http_provider, DetachedHostOrchestrator, DiskKeyValueStore, Fetcher, HostOrchestrator, + MemoryKeyValueStore, SharedKeyValueStore, SplitKeyValueStore, +}; use alloy_primitives::map::HashMap; use alloy_provider::{Provider, RootProvider}; use anyhow::{anyhow, Result}; use async_trait::async_trait; -use kona_host::{ - DetachedHostOrchestrator, DiskKeyValueStore, Fetcher, HostOrchestrator, MemoryKeyValueStore, - SharedKeyValueStore, SplitKeyValueStore, -}; use kona_preimage::{HintWriter, NativeChannel, OracleReader}; use kona_providers_alloy::{OnlineBeaconClient, OnlineBlobProvider}; use std::sync::Arc; diff --git a/bin/host/src/lib.rs b/bin/host/src/lib.rs index 1694e0cc3..145063c4e 100644 --- a/bin/host/src/lib.rs +++ b/bin/host/src/lib.rs @@ -19,3 +19,8 @@ pub use preimage::{ mod server; pub use server::PreimageServer; + +pub mod cli; +pub mod eth; +pub mod interop; +pub mod single; diff --git a/bin/host/src/main.rs b/bin/host/src/main.rs index 64f52fe61..f7edfd5bf 100644 --- a/bin/host/src/main.rs +++ b/bin/host/src/main.rs @@ -4,17 +4,14 @@ #![deny(unused_must_use, rust_2018_idioms)] #![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] -use crate::cli::{init_tracing_subscriber, HostCli, HostMode}; use anyhow::Result; use clap::Parser; -use kona_host::DetachedHostOrchestrator; +use kona_host::{ + cli::{init_tracing_subscriber, HostCli, HostMode}, + DetachedHostOrchestrator, +}; use tracing::info; -pub mod cli; -pub mod eth; -pub mod interop; -pub mod single; - #[tokio::main(flavor = "multi_thread")] async fn main() -> Result<()> { let cfg = HostCli::parse(); diff --git a/bin/host/src/single/fetcher.rs b/bin/host/src/single/fetcher.rs index c747448bd..eb2a26890 100644 --- a/bin/host/src/single/fetcher.rs +++ b/bin/host/src/single/fetcher.rs @@ -1,6 +1,7 @@ //! This module contains the [SingleChainFetcher] struct, which is responsible for fetching //! preimages from a remote source serving the single-chain proof mode. +use crate::KeyValueStore; use alloy_consensus::{Header, TxEnvelope, EMPTY_ROOT_HASH}; use alloy_eips::{ eip2718::Encodable2718, @@ -15,7 +16,6 @@ use alloy_rpc_types::{ Transaction, }; use anyhow::{anyhow, Result}; -use kona_host::KeyValueStore; use kona_preimage::{ errors::{PreimageOracleError, PreimageOracleResult}, HintRouter, PreimageFetcher, PreimageKey, PreimageKeyType, diff --git a/bin/host/src/single/local_kv.rs b/bin/host/src/single/local_kv.rs index 05b4e718a..2ac660b8a 100644 --- a/bin/host/src/single/local_kv.rs +++ b/bin/host/src/single/local_kv.rs @@ -2,9 +2,9 @@ //! using the [SingleChainHostCli] config. use super::SingleChainHostCli; +use crate::KeyValueStore; use alloy_primitives::B256; use anyhow::Result; -use kona_host::KeyValueStore; use kona_preimage::PreimageKey; use kona_proof::boot::{ L1_HEAD_KEY, L2_CHAIN_ID_KEY, L2_CLAIM_BLOCK_NUMBER_KEY, L2_CLAIM_KEY, L2_OUTPUT_ROOT_KEY, diff --git a/bin/host/src/single/orchestrator.rs b/bin/host/src/single/orchestrator.rs index 02f8b4fde..683a5d43c 100644 --- a/bin/host/src/single/orchestrator.rs +++ b/bin/host/src/single/orchestrator.rs @@ -1,14 +1,13 @@ //! [SingleChainHostCli]'s [HostOrchestrator] + [DetachedHostOrchestrator] implementations. use super::{LocalKeyValueStore, SingleChainFetcher, SingleChainHostCli}; -use crate::eth::http_provider; -use alloy_provider::RootProvider; +use crate::{ + eth::http_provider, DetachedHostOrchestrator, DiskKeyValueStore, Fetcher, HostOrchestrator, + MemoryKeyValueStore, SharedKeyValueStore, SplitKeyValueStore, +}; +use alloy_provider::{ReqwestProvider, RootProvider}; use anyhow::{anyhow, Result}; use async_trait::async_trait; -use kona_host::{ - DetachedHostOrchestrator, DiskKeyValueStore, Fetcher, HostOrchestrator, MemoryKeyValueStore, - SharedKeyValueStore, SplitKeyValueStore, -}; use kona_preimage::{HintWriter, NativeChannel, OracleReader}; use kona_providers_alloy::{OnlineBeaconClient, OnlineBlobProvider}; use std::sync::Arc; From a6abc7085e849c08b80b49454f85595d243d41b8 Mon Sep 17 00:00:00 2001 From: Ratan Kaliani Date: Mon, 27 Jan 2025 14:05:11 -0800 Subject: [PATCH 2/4] fix --- bin/host/src/interop/orchestrator.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/host/src/interop/orchestrator.rs b/bin/host/src/interop/orchestrator.rs index aeca0121c..eaa2a7e00 100644 --- a/bin/host/src/interop/orchestrator.rs +++ b/bin/host/src/interop/orchestrator.rs @@ -1,4 +1,4 @@ -//! [SingleChainHostCli]'s [HostOrchestrator] + [DetachedHostOrchestrator] implementations. +//! [InteropHostCli]'s [HostOrchestrator] + [DetachedHostOrchestrator] implementations. use super::{InteropFetcher, InteropHostCli, LocalKeyValueStore}; use crate::{ From 1e98abc7fffb78c8cde7e49edb630cce5426f246 Mon Sep 17 00:00:00 2001 From: Ratan Kaliani Date: Wed, 29 Jan 2025 16:26:05 -0800 Subject: [PATCH 3/4] remove --- crates/proof-sdk/proof/src/boot.rs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/crates/proof-sdk/proof/src/boot.rs b/crates/proof-sdk/proof/src/boot.rs index d58aff649..c0b81aa28 100644 --- a/crates/proof-sdk/proof/src/boot.rs +++ b/crates/proof-sdk/proof/src/boot.rs @@ -71,19 +71,16 @@ impl BootInfo { .get_exact(PreimageKey::new_local(L1_HEAD_KEY.to()), l1_head.as_mut()) .await .map_err(OracleProviderError::Preimage)?; - let mut l2_output_root: B256 = B256::ZERO; oracle .get_exact(PreimageKey::new_local(L2_OUTPUT_ROOT_KEY.to()), l2_output_root.as_mut()) .await .map_err(OracleProviderError::Preimage)?; - let mut l2_claim: B256 = B256::ZERO; oracle .get_exact(PreimageKey::new_local(L2_CLAIM_KEY.to()), l2_claim.as_mut()) .await .map_err(OracleProviderError::Preimage)?; - let l2_claim_block = u64::from_be_bytes( oracle .get(PreimageKey::new_local(L2_CLAIM_BLOCK_NUMBER_KEY.to())) @@ -102,7 +99,6 @@ impl BootInfo { .try_into() .map_err(OracleProviderError::SliceConversion)?, ); - // Attempt to load the rollup config from the chain ID. If there is no config for the chain, // fall back to loading the config from the preimage oracle. let rollup_config = if let Some(config) = ROLLUP_CONFIGS.get(&chain_id) { From b91da21b652cb5c74406bfb630d0e6d0f9f52629 Mon Sep 17 00:00:00 2001 From: ratankaliani Date: Fri, 31 Jan 2025 19:41:10 +0000 Subject: [PATCH 4/4] fix: can't use const --- bin/host/src/interop/fetcher.rs | 3 +-- crates/mpt/src/list_walker.rs | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/bin/host/src/interop/fetcher.rs b/bin/host/src/interop/fetcher.rs index 007759545..2faf1acac 100644 --- a/bin/host/src/interop/fetcher.rs +++ b/bin/host/src/interop/fetcher.rs @@ -2,7 +2,7 @@ //! preimages from a remote source serving the super-chain (interop) proof mode. use super::InteropHostCli; -use crate::{single::SingleChainFetcher, KeyValueStore}; +use crate::{single::SingleChainFetcher, KeyValueStore, PreimageServer}; use alloy_consensus::{Header, Sealed, TxEnvelope, EMPTY_ROOT_HASH}; use alloy_eips::{ eip2718::Encodable2718, @@ -19,7 +19,6 @@ use anyhow::{anyhow, Result}; use async_trait::async_trait; use kona_driver::Driver; use kona_executor::TrieDBProvider; -use kona_host::{KeyValueStore, PreimageServer}; use kona_preimage::{ errors::{PreimageOracleError, PreimageOracleResult}, BidirectionalChannel, HintReader, HintRouter, HintWriter, OracleReader, OracleServer, diff --git a/crates/mpt/src/list_walker.rs b/crates/mpt/src/list_walker.rs index 57045532d..702ec8247 100644 --- a/crates/mpt/src/list_walker.rs +++ b/crates/mpt/src/list_walker.rs @@ -77,7 +77,7 @@ where /// Takes the inner list of the [OrderedListWalker], returning it and setting the inner list to /// [None]. - pub const fn take_inner(&mut self) -> Option> { + pub fn take_inner(&mut self) -> Option> { self.inner.take() }