Skip to content
This repository was archived by the owner on Jan 16, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
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
246 changes: 143 additions & 103 deletions Cargo.lock

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ async-trait = "0.1.80"
# Ethereum
alloy-primitives = { version = "0.7.6", default-features = false }
alloy-rlp = { version = "0.3.5", default-features = false }
alloy-consensus = { git = "https://github.com/alloy-rs/alloy", rev = "cb95183", default-features = false }
op-alloy-consensus = { git = "https://github.com/alloy-rs/op-alloy", branch = "refcell/re-exports", default-features = false }
alloy-eips = { git = "https://github.com/alloy-rs/alloy", rev = "cb95183", default-features = false }
alloy-consensus = { version = "0.1", default-features = false }
op-alloy-consensus = { git = "https://github.com/alloy-rs/op-alloy", default-features = false }
alloy-eips = { version = "0.1", default-features = false }
revm = { git = "https://github.com/bluealloy/revm", rev = "a832a4e", default-features = false }

[profile.dev]
Expand Down
3 changes: 2 additions & 1 deletion bin/client/src/l2/chain_provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
use crate::{BootInfo, CachingOracle, HintType, HINT_WRITER};
use alloc::{boxed::Box, sync::Arc, vec::Vec};
use alloy_consensus::Header;
use alloy_eips::eip2718::Decodable2718;
use alloy_primitives::{Bytes, B256};
use alloy_rlp::Decodable;
use anyhow::{anyhow, Result};
Expand All @@ -13,7 +14,7 @@ use kona_preimage::{HintWriterClient, PreimageKey, PreimageKeyType, PreimageOrac
use kona_primitives::{
L2BlockInfo, L2ExecutionPayloadEnvelope, OpBlock, RollupConfig, SystemConfig,
};
use op_alloy_consensus::{Decodable2718, OpTxEnvelope};
use op_alloy_consensus::OpTxEnvelope;

/// The oracle-backed L2 chain provider for the client program.
#[derive(Debug, Clone)]
Expand Down
8 changes: 4 additions & 4 deletions bin/host/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ kona-mpt = { path = "../../crates/mpt", version = "0.0.1" }
kona-derive = { path = "../../crates/derive", version = "0.0.1", features = ["online"] }

# external
alloy-provider = { git = "https://github.com/alloy-rs/alloy", rev = "cb95183" }
alloy-transport-http = { git = "https://github.com/alloy-rs/alloy", rev = "cb95183" }
alloy-rpc-client = { git = "https://github.com/alloy-rs/alloy", rev = "cb95183" }
alloy-rpc-types = { git = "https://github.com/alloy-rs/alloy", rev = "cb95183" }
alloy-provider = { version = "0.1" }
alloy-transport-http = { version = "0.1" }
alloy-rpc-client = { version = "0.1" }
alloy-rpc-types = { version = "0.1" }
reqwest = "0.12"
tokio = { version = "1.37.0", features = ["full"] }
futures = "0.3"
Expand Down
21 changes: 10 additions & 11 deletions bin/host/src/fetcher/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

use crate::{kv::KeyValueStore, util};
use alloy_consensus::{Header, TxEnvelope};
use alloy_eips::{eip2718::Encodable2718, eip4844::FIELD_ELEMENTS_PER_BLOB};
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;
use alloy_rpc_types::{Block, BlockTransactions};
use alloy_rpc_types::{Block, BlockNumberOrTag, BlockTransactions, BlockTransactionsKind};
use anyhow::{anyhow, Result};
use kona_client::HintType;
use kona_derive::{
Expand Down Expand Up @@ -130,7 +130,7 @@ where
.map_err(|e| anyhow!("Failed to convert bytes to B256: {e}"))?;
let Block { transactions, .. } = self
.l1_provider
.get_block_by_hash(hash, true)
.get_block_by_hash(hash, BlockTransactionsKind::Full)
.await
.map_err(|e| anyhow!("Failed to fetch block: {e}"))?
.ok_or(anyhow!("Block not found."))?;
Expand Down Expand Up @@ -292,7 +292,7 @@ where
.map_err(|e| anyhow!("Failed to convert bytes to B256: {e}"))?;
let Block { transactions, .. } = self
.l2_provider
.get_block_by_hash(hash, false)
.get_block_by_hash(hash, BlockTransactionsKind::Hashes)
.await
.map_err(|e| anyhow!("Failed to fetch block: {e}"))?
.ok_or(anyhow!("Block not found."))?;
Expand Down Expand Up @@ -374,11 +374,8 @@ where
// Fetch the storage root for the L2 head block.
let l2_to_l1_message_passer = self
.l2_provider
.get_proof(
L2_TO_L1_MESSAGE_PASSER_ADDRESS,
Default::default(),
self.l2_head.into(),
)
.get_proof(L2_TO_L1_MESSAGE_PASSER_ADDRESS, Default::default())
.block_id(BlockId::Hash(self.l2_head.into()))
.await
.map_err(|e| anyhow!("Failed to fetch account proof: {e}"))?;

Expand Down Expand Up @@ -437,7 +434,8 @@ where

let proof_response = self
.l2_provider
.get_proof(address, Default::default(), block_number.into())
.get_proof(address, Default::default())
.block_id(BlockId::Number(BlockNumberOrTag::Number(block_number)))
.await
.map_err(|e| anyhow!("Failed to fetch account proof: {e}"))?;

Expand Down Expand Up @@ -465,7 +463,8 @@ where

let mut proof_response = self
.l2_provider
.get_proof(address, vec![slot], block_number.into())
.get_proof(address, vec![slot])
.block_id(BlockId::Number(BlockNumberOrTag::Number(block_number)))
.await
.map_err(|e| anyhow!("Failed to fetch account proof: {e}"))?;

Expand Down
16 changes: 8 additions & 8 deletions crates/derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,24 +41,24 @@ serde = { version = "1.0.203", default-features = false, features = ["derive"],
# `online` feature dependencies
c-kzg = { version = "1.0.2", default-features = false, optional = true }
sha2 = { version = "0.10.8", default-features = false, optional = true }
alloy-transport = { git = "https://github.com/alloy-rs/alloy", rev = "cb95183", default-features = false, optional = true }
alloy-provider = { git = "https://github.com/alloy-rs/alloy", rev = "cb95183", default-features = false, optional = true }
alloy-transport-http = { git = "https://github.com/alloy-rs/alloy", rev = "cb95183", optional = true }
alloy-rpc-types = { git = "https://github.com/alloy-rs/alloy", rev = "cb95183", default-features = false, optional = true }
alloy-transport = { version = "0.1", default-features = false, optional = true }
alloy-provider = { version = "0.1", default-features = false, optional = true }
alloy-transport-http = { version = "0.1", optional = true }
alloy-rpc-types = { version = "0.1", default-features = false, optional = true }
serde_json = { version = "1.0.94", default-features = false, optional = true }
reqwest = { version = "0.12.4", default-features = false, optional = true }

# `test-utils` feature dependencies
alloy-node-bindings = { git = "https://github.com/alloy-rs/alloy", rev = "cb95183", default-features = false, optional = true }
alloy-node-bindings = { version = "0.1", default-features = false, optional = true }
tracing-subscriber = { version = "0.3.18", optional = true }
alloy-rpc-client = { git = "https://github.com/alloy-rs/alloy", rev = "cb95183", default-features = false, optional = true }
alloy-rpc-client = { version = "0.1", default-features = false, optional = true }

[dev-dependencies]
tokio = { version = "1.38", features = ["full"] }
proptest = "1.4.0"
tracing-subscriber = "0.3.18"
alloy-node-bindings = { git = "https://github.com/alloy-rs/alloy", rev = "cb95183", default-features = false }
alloy-rpc-client = { git = "https://github.com/alloy-rs/alloy", rev = "cb95183", default-features = false }
alloy-node-bindings = { version = "0.1", default-features = false }
alloy-rpc-client = { version = "0.1", default-features = false }
serde_json = { version = "1.0.117", default-features = false }

[features]
Expand Down
2 changes: 1 addition & 1 deletion crates/derive/src/stages/attributes_queue/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ use crate::{
},
};
use alloc::{boxed::Box, fmt::Debug, sync::Arc, vec, vec::Vec};
use alloy_eips::eip2718::Encodable2718;
use alloy_rlp::Encodable;
use async_trait::async_trait;
use op_alloy_consensus::Encodable2718;

/// The [AttributesBuilder] is responsible for preparing [L2PayloadAttributes]
/// that can be used to construct an L2 Block containing only deposits.
Expand Down
6 changes: 3 additions & 3 deletions crates/derive/src/stages/attributes_queue/deposits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use crate::types::RawTransaction;
use alloc::vec::Vec;
use alloy_consensus::Receipt;
use alloy_consensus::{Eip658Value, Receipt};
use alloy_primitives::{Address, B256};
use kona_primitives::{decode_deposit, DEPOSIT_EVENT_ABI_HASH};

Expand All @@ -19,7 +19,7 @@ pub(crate) async fn derive_deposits(
let mut global_index = 0;
let mut res = Vec::new();
for r in receipts.iter() {
if !r.status {
if Eip658Value::Eip658(false) == r.status {
continue;
}
for l in r.logs.iter() {
Expand Down Expand Up @@ -90,7 +90,7 @@ mod tests {
let mut invalid_topic_log = generate_valid_log();
invalid_topic_log.data.topics_mut()[0] = B256::default();
Receipt {
status: true,
status: Eip658Value::Eip658(true),
logs: vec![generate_valid_log(), bad_dest_log, invalid_topic_log],
..Default::default()
}
Expand Down
3 changes: 2 additions & 1 deletion crates/derive/src/stages/l1_traversal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ pub(crate) mod tests {
}

pub(crate) fn new_receipts() -> alloc::vec::Vec<Receipt> {
let mut receipt = Receipt { status: true, ..Receipt::default() };
let mut receipt =
Receipt { status: alloy_consensus::Eip658Value::Eip658(true), ..Receipt::default() };
let bad = Log::new(
Address::from([2; 20]),
vec![CONFIG_UPDATE_TOPIC, B256::default()],
Expand Down
3 changes: 2 additions & 1 deletion crates/derive/src/types/ecotone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@

use crate::types::{RawTransaction, UpgradeDepositSource};
use alloc::{string::String, vec, vec::Vec};
use alloy_eips::eip2718::Encodable2718;
use alloy_primitives::{address, bytes, Address, Bytes, TxKind, U256};
use op_alloy_consensus::{Encodable2718, OpTxEnvelope, TxDeposit};
use op_alloy_consensus::{OpTxEnvelope, TxDeposit};
use spin::Lazy;

/// The UpdgradeTo Function Signature
Expand Down
3 changes: 2 additions & 1 deletion crates/derive/src/types/fjord.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ use crate::types::{
upgrade_to_calldata, RawTransaction, UpgradeDepositSource, GAS_PRICE_ORACLE_ADDRESS,
};
use alloc::{string::String, vec, vec::Vec};
use alloy_eips::eip2718::Encodable2718;
use alloy_primitives::{address, bytes, Address, Bytes, TxKind, U256};
use op_alloy_consensus::{Encodable2718, OpTxEnvelope, TxDeposit};
use op_alloy_consensus::{OpTxEnvelope, TxDeposit};
use spin::Lazy;

/// The L1 Info Depositer Address.
Expand Down
2 changes: 1 addition & 1 deletion crates/executor/src/eip4788.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Contains the logic for executing the pre-block beacon root call.

use alloc::{boxed::Box, vec::Vec};
use alloy_consensus::constants::BEACON_ROOTS_ADDRESS;
use alloy_eips::eip4788::BEACON_ROOTS_ADDRESS;
use alloy_primitives::{Address, Bytes, B256, U256};
use anyhow::{anyhow, Result};
use kona_derive::types::{L2PayloadAttributes, RollupConfig};
Expand Down
4 changes: 3 additions & 1 deletion crates/executor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ extern crate alloc;

use alloc::vec::Vec;
use alloy_consensus::{Header, Sealable, Sealed, EMPTY_OMMER_ROOT_HASH, EMPTY_ROOT_HASH};
use alloy_eips::eip2718::{Decodable2718, Encodable2718};
use alloy_primitives::{address, keccak256, Address, Bytes, TxKind, B256, U256};
use anyhow::{anyhow, Result};
use kona_derive::types::{L2PayloadAttributes, RawTransaction, RollupConfig};
use kona_mpt::{ordered_trie_with_encoder, TrieDB, TrieDBFetcher, TrieDBHinter};
use op_alloy_consensus::{Decodable2718, Encodable2718, OpReceiptEnvelope, OpTxEnvelope};
use op_alloy_consensus::{OpReceiptEnvelope, OpTxEnvelope};
use revm::{
db::{states::bundle_state::BundleRetention, State},
primitives::{
Expand Down Expand Up @@ -267,6 +268,7 @@ where
state_root,
transactions_root,
receipts_root,
requests_root: None,
withdrawals_root,
logs_bloom,
difficulty: U256::ZERO,
Expand Down
4 changes: 2 additions & 2 deletions crates/executor/src/util.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
//! Contains utilities for the L2 executor.

use alloc::vec::Vec;
use alloy_consensus::{Eip658Value, Receipt, ReceiptWithBloom, Transaction};
use alloy_primitives::{Bloom, Log};
use op_alloy_consensus::{
Eip658Value, OpDepositReceipt, OpDepositReceiptWithBloom, OpReceiptEnvelope, OpTxEnvelope,
OpTxType, Receipt, ReceiptWithBloom, Transaction,
OpDepositReceipt, OpDepositReceiptWithBloom, OpReceiptEnvelope, OpTxEnvelope, OpTxType,
};

/// Constructs a [OpReceiptEnvelope] from a [Receipt] fields and [OpTxType].
Expand Down
6 changes: 3 additions & 3 deletions crates/mpt/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ alloy-trie = { version = "0.4.1", default-features = false }
[dev-dependencies]
alloy-consensus.workspace = true
tokio = { version = "1.38.0", features = ["full"] }
alloy-provider = { git = "https://github.com/alloy-rs/alloy", rev = "cb95183" }
alloy-rpc-types = { git = "https://github.com/alloy-rs/alloy", rev = "cb95183" }
alloy-transport-http = { git = "https://github.com/alloy-rs/alloy", rev = "cb95183" }
alloy-provider = { version = "0.1" }
alloy-rpc-types = { version = "0.1" }
alloy-transport-http = { version = "0.1" }
reqwest = "0.12.4"
tracing-subscriber = "0.3.18"
futures = { version = "0.3.30", default-features = false }
14 changes: 5 additions & 9 deletions crates/mpt/src/test_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use alloc::{collections::BTreeMap, vec::Vec};
use alloy_consensus::{Receipt, ReceiptEnvelope, ReceiptWithBloom, TxEnvelope, TxType};
use alloy_primitives::{keccak256, Bytes, Log, B256};
use alloy_provider::{network::eip2718::Encodable2718, Provider, ProviderBuilder};
use alloy_rpc_types::BlockTransactions;
use alloy_rpc_types::{BlockTransactions, BlockTransactionsKind};
use anyhow::{anyhow, Result};
use reqwest::Url;

Expand All @@ -17,13 +17,11 @@ const RPC_URL: &str = "https://docs-demo.quiknode.pro/";
pub(crate) async fn get_live_derivable_receipts_list(
) -> Result<(B256, BTreeMap<B256, Bytes>, Vec<ReceiptEnvelope>)> {
// Initialize the provider.
let provider = ProviderBuilder::new()
.on_http(Url::parse(RPC_URL).expect("invalid rpc url"))
.map_err(|e| anyhow!(e))?;
let provider = ProviderBuilder::new().on_http(Url::parse(RPC_URL).expect("invalid rpc url"));

let block_number = 19005266;
let block = provider
.get_block(block_number.into(), true)
.get_block(block_number.into(), BlockTransactionsKind::Full)
.await
.map_err(|e| anyhow!(e))?
.ok_or(anyhow!("Missing block"))?;
Expand Down Expand Up @@ -82,13 +80,11 @@ pub(crate) async fn get_live_derivable_receipts_list(
pub(crate) async fn get_live_derivable_transactions_list(
) -> Result<(B256, BTreeMap<B256, Bytes>, Vec<TxEnvelope>)> {
// Initialize the provider.
let provider = ProviderBuilder::new()
.on_http(Url::parse(RPC_URL).expect("invalid rpc url"))
.map_err(|e| anyhow!(e))?;
let provider = ProviderBuilder::new().on_http(Url::parse(RPC_URL).expect("invalid rpc url"));

let block_number = 19005266;
let block = provider
.get_block(block_number.into(), true)
.get_block(block_number.into(), BlockTransactionsKind::Full)
.await
.map_err(|e| anyhow!(e))?
.ok_or(anyhow!("Missing block"))?;
Expand Down
4 changes: 2 additions & 2 deletions crates/plasma/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ kona-derive = { path = "../derive", version = "0.0.1" }
serde = { version = "1.0.203", default-features = false, features = ["derive"], optional = true }

# `online` feature dependencies
alloy-transport-http = { git = "https://github.com/alloy-rs/alloy", rev = "cb95183", optional = true }
alloy-provider = { git = "https://github.com/alloy-rs/alloy", rev = "cb95183", default-features = false, optional = true }
alloy-transport-http = { version = "0.1", optional = true }
alloy-provider = { version = "0.1", default-features = false, optional = true }
reqwest = { version = "0.12", default-features = false, optional = true }

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion crates/primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ alloy-eips.workspace = true
op-alloy-consensus.workspace = true

# Superchain Registry
superchain-primitives = { git = "https://github.com/ethereum-optimism/superchain-registry", branch = "main", default-features = false }
superchain-primitives = { version = "0.1", default-features = false }

# Alloy Types
alloy-sol-types = { version = "0.7.6", default-features = false }
Expand Down
3 changes: 2 additions & 1 deletion crates/primitives/src/deposits.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
//! Contains deposit transaction types and helper methods.

use alloc::{string::String, vec::Vec};
use alloy_eips::eip2718::Encodable2718;
use alloy_primitives::{b256, keccak256, Address, Bytes, Log, TxKind, B256, U256, U64};
use alloy_rlp::Encodable;
use core::fmt::Display;
use op_alloy_consensus::{Encodable2718, OpTxEnvelope, TxDeposit};
use op_alloy_consensus::{OpTxEnvelope, TxDeposit};

use crate::RawTransaction;

Expand Down
3 changes: 2 additions & 1 deletion crates/primitives/src/payload.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
//! Contains the execution payload type.

use alloc::vec::Vec;
use alloy_eips::eip2718::{Decodable2718, Encodable2718};
use alloy_primitives::{Address, Bloom, Bytes, B256};
use anyhow::Result;
use op_alloy_consensus::{Decodable2718, Encodable2718, OpTxEnvelope, OpTxType};
use op_alloy_consensus::{OpTxEnvelope, OpTxType};

/// Fixed and variable memory costs for a payload.
/// ~1000 bytes per payload, with some margin for overhead like map data.
Expand Down
6 changes: 3 additions & 3 deletions examples/trusted-sync/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ tokio = { version = "1.37.0", features = ["full"] }
tracing-subscriber = "0.3.18"
clap = { version = "4.5.4", features = ["derive", "env"] }
serde = { version = "1.0.198", features = ["derive"] }
alloy-provider = { git = "https://github.com/alloy-rs/alloy", rev = "cb95183", default-features = false }
alloy-rpc-types = { git = "https://github.com/alloy-rs/alloy", rev = "cb95183", default-features = false }
alloy-transport = { git = "https://github.com/alloy-rs/alloy", rev = "cb95183", default-features = false }
alloy-provider = { version = "0.1", default-features = false }
alloy-rpc-types = { version = "0.1", default-features = false }
alloy-transport = { version = "0.1", default-features = false }
4 changes: 2 additions & 2 deletions examples/trusted-sync/src/validation.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Contains logic to validate derivation pipeline outputs.

use alloy_provider::{Provider, ReqwestProvider};
use alloy_rpc_types::{BlockNumberOrTag, Header};
use alloy_rpc_types::{BlockNumberOrTag, BlockTransactionsKind, Header};
use alloy_transport::TransportResult;
use anyhow::Result;
use kona_derive::types::{
Expand Down Expand Up @@ -45,7 +45,7 @@ impl OnlineValidator {
// Don't hydrate the block so we only get a list of transaction hashes.
let block = self
.provider
.get_block(tag.into(), false)
.get_block(tag.into(), BlockTransactionsKind::Hashes)
.await
.map_err(|e| anyhow::anyhow!(e))?
.ok_or(anyhow::anyhow!("Block not found"))?;
Expand Down