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
1,112 changes: 618 additions & 494 deletions Cargo.lock

Large diffs are not rendered by default.

78 changes: 39 additions & 39 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -121,51 +121,51 @@ kona-macros = { path = "crates/utilities/macros", version = "0.1.0", default-fea

# Alloy
alloy-rlp = { version = "0.3.12", default-features = false }
alloy-trie = { version = "0.8.1", default-features = false }
alloy-eips = { version = "1.0.9", default-features = false }
alloy-serde = { version = "1.0.9", default-features = false }
alloy-signer = { version = "1.0.9", default-features = false }
alloy-chains = { version = "0.2.4", default-features = false }
alloy-network = { version = "1.0.9", default-features = false }
alloy-provider = { version = "1.0.9", default-features = false }
alloy-hardforks = { version = "0.2.7", default-features = false }
alloy-sol-types = { version = "1.2.0", default-features = false }
alloy-consensus = { version = "1.0.9", default-features = false }
alloy-transport = { version = "1.0.9", default-features = false }
alloy-rpc-types = { version = "1.0.9", default-features = false }
alloy-rpc-client = { version = "1.0.9", default-features = false }
alloy-primitives = { version = "1.2.0", default-features = false }
alloy-signer-local = { version = "1.0.9", default-features = false }
alloy-node-bindings = { version = "1.0.9", default-features = false }
alloy-rpc-types-eth = { version = "1.0.9", default-features = false }
alloy-transport-http = { version = "1.0.9", default-features = false }
alloy-rpc-types-engine = { version = "1.0.9", default-features = false }
alloy-rpc-types-beacon = { version = "1.0.9", default-features = false }
alloy-network-primitives = { version = "1.0.9", default-features = false }
alloy-trie = { version = "0.9.0", default-features = false }
alloy-eips = { version = "1.0.17", default-features = false }
alloy-serde = { version = "1.0.17", default-features = false }
alloy-signer = { version = "1.0.17", default-features = false }
alloy-chains = { version = "0.2.5", default-features = false }
alloy-network = { version = "1.0.17", default-features = false }
alloy-provider = { version = "1.0.17", default-features = false }
alloy-hardforks = { version = "0.2.11", default-features = false }
alloy-sol-types = { version = "1.2.1", default-features = false }
alloy-consensus = { version = "1.0.17", default-features = false }
alloy-transport = { version = "1.0.17", default-features = false }
alloy-rpc-types = { version = "1.0.17", default-features = false }
alloy-rpc-client = { version = "1.0.17", default-features = false }
alloy-primitives = { version = "1.2.1", default-features = false }
alloy-signer-local = { version = "1.0.17", default-features = false }
alloy-node-bindings = { version = "1.0.17", default-features = false }
alloy-rpc-types-eth = { version = "1.0.17", default-features = false }
alloy-transport-http = { version = "1.0.17", default-features = false }
alloy-rpc-types-engine = { version = "1.0.17", default-features = false }
alloy-rpc-types-beacon = { version = "1.0.17", default-features = false }
alloy-network-primitives = { version = "1.0.17", default-features = false }

# OP Alloy
op-alloy-network = { version = "0.18.1", default-features = false }
alloy-op-hardforks = { version = "0.2.7", default-features = false }
op-alloy-provider = { version = "0.18.1", default-features = false }
op-alloy-consensus = { version = "0.18.1", default-features = false }
op-alloy-rpc-types = { version = "0.18.1", default-features = false }
op-alloy-rpc-jsonrpsee = { version = "0.18.1", default-features = false }
op-alloy-rpc-types-engine = { version = "0.18.1", default-features = false }
op-alloy-network = { version = "0.18.9", default-features = false }
alloy-op-hardforks = { version = "0.2.11", default-features = false }
op-alloy-provider = { version = "0.18.9", default-features = false }
op-alloy-consensus = { version = "0.18.9", default-features = false }
op-alloy-rpc-types = { version = "0.18.9", default-features = false }
op-alloy-rpc-jsonrpsee = { version = "0.18.9", default-features = false }
op-alloy-rpc-types-engine = { version = "0.18.9", default-features = false }

# Execution
revm = { version = "24.0.1", default-features = false }
op-revm = { version = "5.0.1", default-features = false }
alloy-evm = { version = "0.11.0", default-features = false }
alloy-op-evm = { version = "0.11.0", default-features = false }
revm = { version = "27.0", default-features = false }
op-revm = { version = "8.0", default-features = false }
alloy-evm = { version = "0.14", default-features = false }
alloy-op-evm = { version = "0.14", default-features = false }

# Reth (pinned to v1.4.8 for kona-supervisor-storage)
reth-db-api = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
reth-db = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
reth-codecs = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
reth-db-api = { git = "https://github.com/paradigmxyz/reth", tag = "v1.5.0" }
reth-db = { git = "https://github.com/paradigmxyz/reth", tag = "v1.5.0" }
reth-codecs = { git = "https://github.com/paradigmxyz/reth", tag = "v1.5.0" }

# General
url = "2.5.4"
lru = "0.14.0"
lru = "0.16.0"
glob = "0.3.2"
dirs = "6.0.0"
eyre = "0.6.12"
Expand Down Expand Up @@ -205,7 +205,7 @@ buddy_system_allocator = "0.11.0"

rand = { version = "0.9.1", default-features = false }
backon = { version = "1.5.1", default-features = false }
tabled = { version = "0.19.0", default-features = false }
tabled = { version = "0.20.0", default-features = false }
anyhow = { version = "1.0.98", default-features = false }
thiserror = { version = "2.0.12", default-features = false }
derive_more = { version = "2.0.1", default-features = false }
Expand All @@ -220,8 +220,8 @@ brotli = { version = "8.0.1", default-features = false }
# Networking
snap = "1.1.1"
discv5 = "0.9.1"
libp2p = "0.55.0"
libp2p-stream = "0.3.0-alpha"
libp2p = "0.56.0"
libp2p-stream = "0.4.0-alpha"
libp2p-identity = "0.2.11"
openssl = "0.10.73"
ipnet = "2.11.0"
Expand Down
4 changes: 3 additions & 1 deletion bin/client/src/fpvm_evm/factory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
};
use revm::{
Context, Inspector,
context::{Evm as RevmEvm, TxEnv, result::EVMError},
context::{Evm as RevmEvm, FrameStack, TxEnv, result::EVMError},
handler::instructions::EthInstructions,
inspector::NoOpInspector,
};
Expand Down Expand Up @@ -75,6 +75,7 @@
self.hint_writer.clone(),
self.oracle_reader.clone(),
),
frame_stack: FrameStack::new(),
});

OpEvm::new(revm_evm, false)
Expand All @@ -97,6 +98,7 @@
self.hint_writer.clone(),
self.oracle_reader.clone(),
),
frame_stack: FrameStack::new(),

Check warning on line 101 in bin/client/src/fpvm_evm/factory.rs

View check run for this annotation

Codecov / codecov/patch

bin/client/src/fpvm_evm/factory.rs#L101

Added line #L101 was not covered by tests
});

OpEvm::new(revm_evm, true)
Expand Down
26 changes: 0 additions & 26 deletions crates/node/p2p/src/gossip/block_validity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -653,32 +653,6 @@ pub(crate) mod tests {
assert!(matches!(handler.block_valid(&envelope), Err(BlockInvalidError::BlockHash { .. })));
}

#[test]
fn test_block_invalid_base_fee() {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let mut block = v1_valid_block();
block.header.base_fee_per_gas = Some(0);

let v1 = ExecutionPayloadV1::from_block_slow(&block);

let payload = OpExecutionPayload::V1(v1);
let envelope = OpNetworkPayloadEnvelope {
payload,
signature: Signature::test_signature(),
payload_hash: PayloadHash(B256::ZERO),
parent_beacon_block_root: None,
};

let msg = envelope.payload_hash.signature_message(10);
let signer = envelope.signature.recover_address_from_prehash(&msg).unwrap();
let (_, unsafe_signer) = tokio::sync::watch::channel(signer);
let mut handler = BlockHandler::new(
RollupConfig { l2_chain_id: 10, ..Default::default() },
unsafe_signer,
);

assert!(matches!(handler.block_valid(&envelope), Err(BlockInvalidError::InvalidBlock(_))));
}

#[test]
fn test_v2_block() {
let block = v2_valid_block();
Expand Down
4 changes: 2 additions & 2 deletions crates/node/p2p/src/gossip/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@

fn handle_gossip_event(&mut self, event: Event) -> Option<OpNetworkPayloadEnvelope> {
match event {
Event::Gossipsub(e) => return self.handle_gossipsub_event(e),
Event::Gossipsub(e) => return self.handle_gossipsub_event(*e),

Check warning on line 227 in crates/node/p2p/src/gossip/driver.rs

View check run for this annotation

Codecov / codecov/patch

crates/node/p2p/src/gossip/driver.rs#L227

Added line #L227 was not covered by tests
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could just pass in a reference here and change the parameter type, but for the sake of keeping this bump pr lean, this is fine

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see it's boxed

Event::Ping(libp2p::ping::Event { peer, result, .. }) => {
trace!(target: "gossip", ?peer, ?result, "Ping received");

Expand Down Expand Up @@ -256,7 +256,7 @@
}
});
}
Event::Identify(e) => self.handle_identify_event(e),
Event::Identify(e) => self.handle_identify_event(*e),

Check warning on line 259 in crates/node/p2p/src/gossip/driver.rs

View check run for this annotation

Codecov / codecov/patch

crates/node/p2p/src/gossip/driver.rs#L259

Added line #L259 was not covered by tests
// Don't do anything with stream events as this should be unreachable code.
Event::Stream => {
error!(target: "gossip", "Stream events should not be emitted!");
Expand Down
14 changes: 9 additions & 5 deletions crates/node/p2p/src/gossip/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
#[allow(dead_code)]
Ping(ping::Event),
/// Represents a [gossipsub::Event]
Gossipsub(gossipsub::Event),
Gossipsub(Box<gossipsub::Event>),
/// Represents a [identify::Event]
Identify(identify::Event),
Identify(Box<identify::Event>),
/// Stream event
Stream,
}
Expand All @@ -26,14 +26,14 @@
impl From<gossipsub::Event> for Event {
/// Converts [gossipsub::Event] to [Event]
fn from(value: gossipsub::Event) -> Self {
Self::Gossipsub(value)
Self::Gossipsub(Box::new(value))

Check warning on line 29 in crates/node/p2p/src/gossip/event.rs

View check run for this annotation

Codecov / codecov/patch

crates/node/p2p/src/gossip/event.rs#L29

Added line #L29 was not covered by tests
}
}

impl From<identify::Event> for Event {
/// Converts [identify::Event] to [Event]
fn from(value: identify::Event) -> Self {
Self::Identify(value)
Self::Identify(Box::new(value))

Check warning on line 36 in crates/node/p2p/src/gossip/event.rs

View check run for this annotation

Codecov / codecov/patch

crates/node/p2p/src/gossip/event.rs#L36

Added line #L36 was not covered by tests
}
}

Expand Down Expand Up @@ -62,7 +62,11 @@
};
let event = Event::from(gossipsub_event);
match event {
Event::Gossipsub(libp2p::gossipsub::Event::Message { .. }) => {}
Event::Gossipsub(e) => {
if !matches!(*e, libp2p::gossipsub::Event::Message { .. }) {
panic!("Event conversion failed");
}
}
_ => panic!("Event conversion failed"),
}
}
Expand Down
6 changes: 3 additions & 3 deletions crates/proof/executor/src/builder/assemble.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ where
ex_result: &BlockExecutionResult<OpReceiptEnvelope>,
bundle: BundleState,
) -> ExecutorResult<Sealed<Header>> {
let timestamp = block_env.timestamp;
let timestamp = block_env.timestamp.saturating_to::<u64>();

// Compute the roots for the block header.
let state_root = self.trie_db.state_root(&bundle)?;
Expand All @@ -48,7 +48,7 @@ where
.root();
let receipts_root = compute_receipts_root(&ex_result.receipts, self.config, timestamp);
let withdrawals_root = if self.config.is_isthmus_active(timestamp) {
Some(self.message_passer_account(block_env.number)?)
Some(self.message_passer_account(block_env.number.saturating_to::<u64>())?)
} else if self.config.is_canyon_active(timestamp) {
Some(EMPTY_ROOT_HASH)
} else {
Expand Down Expand Up @@ -92,7 +92,7 @@ where
requests_hash,
logs_bloom,
difficulty: U256::ZERO,
number: block_env.number,
number: block_env.number.saturating_to::<u64>(),
gas_limit: attrs.gas_limit.ok_or(ExecutorError::MissingGasLimit)?,
gas_used: ex_result.gas_used,
timestamp,
Expand Down
9 changes: 5 additions & 4 deletions crates/proof/executor/src/builder/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use alloy_evm::{
block::{BlockExecutionResult, BlockExecutor, BlockExecutorFactory},
};
use alloy_op_evm::{OpBlockExecutionCtx, OpBlockExecutorFactory, block::OpAlloyReceiptBuilder};
use core::fmt::Debug;
use kona_genesis::RollupConfig;
use kona_mpt::TrieHinter;
use op_alloy_consensus::{OpReceiptEnvelope, OpTxEnvelope};
Expand Down Expand Up @@ -35,8 +36,8 @@ where

impl<'a, P, H, Evm> StatelessL2Builder<'a, P, H, Evm>
where
P: TrieDBProvider,
H: TrieHinter,
P: TrieDBProvider + Debug,
H: TrieHinter + Debug,
Evm: EvmFactory<Spec = OpSpecId> + 'static,
<Evm as EvmFactory>::Tx: FromTxWithEncoded<OpTxEnvelope> + FromRecoveredTx<OpTxEnvelope>,
{
Expand Down Expand Up @@ -85,8 +86,8 @@ where

info!(
target: "block_builder",
block_number = block_env.number,
block_timestamp = block_env.timestamp,
block_number = %block_env.number,
block_timestamp = %block_env.timestamp,
block_gas_limit = block_env.gas_limit,
transactions = attrs.transactions.as_ref().map_or(0, |txs| txs.len()),
"Beginning block building."
Expand Down
26 changes: 16 additions & 10 deletions crates/proof/executor/src/builder/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@
use alloy_consensus::{BlockHeader, Header};
use alloy_eips::{eip1559::BaseFeeParams, eip7840::BlobParams};
use alloy_evm::{EvmEnv, EvmFactory};
use alloy_primitives::U256;
use kona_genesis::RollupConfig;
use kona_mpt::TrieHinter;
use op_alloy_rpc_types_engine::OpPayloadAttributes;
use op_revm::OpSpecId;
use revm::{
context::{BlockEnv, CfgEnv},
context_interface::block::BlobExcessGasAndPrice,
primitives::eip4844::{
BLOB_BASE_FEE_UPDATE_FRACTION_CANCUN, BLOB_BASE_FEE_UPDATE_FRACTION_PRAGUE,
},
};

impl<P, H, Evm> StatelessL2Builder<'_, P, H, Evm>
Expand Down Expand Up @@ -48,23 +52,25 @@
payload_attrs: &OpPayloadAttributes,
base_fee_params: &BaseFeeParams,
) -> ExecutorResult<BlockEnv> {
let (params, fraction) = if spec_id.is_enabled_in(OpSpecId::ISTHMUS) {
(Some(BlobParams::prague()), BLOB_BASE_FEE_UPDATE_FRACTION_PRAGUE)
} else if spec_id.is_enabled_in(OpSpecId::ECOTONE) {
(Some(BlobParams::cancun()), BLOB_BASE_FEE_UPDATE_FRACTION_CANCUN)
} else {
(None, 0)

Check warning on line 60 in crates/proof/executor/src/builder/env.rs

View check run for this annotation

Codecov / codecov/patch

crates/proof/executor/src/builder/env.rs#L60

Added line #L60 was not covered by tests
};

let blob_excess_gas_and_price = parent_header
.maybe_next_block_excess_blob_gas(if spec_id.is_enabled_in(OpSpecId::ISTHMUS) {
Some(BlobParams::prague())
} else if spec_id.is_enabled_in(OpSpecId::ECOTONE) {
Some(BlobParams::cancun())
} else {
None
})
.maybe_next_block_excess_blob_gas(params)
.or_else(|| spec_id.is_enabled_in(OpSpecId::ECOTONE).then_some(0))
.map(|e| BlobExcessGasAndPrice::new(e, spec_id.is_enabled_in(OpSpecId::ISTHMUS)));
.map(|excess| BlobExcessGasAndPrice::new(excess, fraction));
let next_block_base_fee =
parent_header.next_block_base_fee(*base_fee_params).unwrap_or_default();

Ok(BlockEnv {
number: parent_header.number + 1,
number: U256::from(parent_header.number + 1),
beneficiary: payload_attrs.payload_attributes.suggested_fee_recipient,
timestamp: payload_attrs.payload_attributes.timestamp,
timestamp: U256::from(payload_attrs.payload_attributes.timestamp),
gas_limit: payload_attrs.gas_limit.ok_or(ExecutorError::MissingGasLimit)?,
basefee: next_block_base_fee,
prevrandao: Some(payload_attrs.payload_attributes.prev_randao),
Expand Down
3 changes: 3 additions & 0 deletions crates/proof/mpt/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ pub enum TrieNodeError {
/// Invalid trie node type encountered.
#[error("Invalid trie node type encountered")]
InvalidNodeType,
/// The path was too short to index.
#[error("Path too short")]
PathTooShort,
/// Failed to decode trie node.
#[error("Failed to decode trie node: {0}")]
RLPError(alloy_rlp::Error),
Expand Down
Loading