Skip to content
Closed
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
217 changes: 111 additions & 106 deletions rust/Cargo.lock

Large diffs are not rendered by default.

146 changes: 73 additions & 73 deletions rust/Cargo.toml

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions rust/deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ registries = []

[sources]
allow-git = [
"https://github.com/ethereum-optimism/reth-core",
"https://github.com/paradigmxyz/reth",
# Maintenance fork carrying patches not yet included in the selected upstream release.
"https://github.com/ethereum-optimism/reth",
Expand Down
1 change: 1 addition & 0 deletions rust/op-reth/crates/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ alloy-rpc-types-admin.workspace = true
alloy-signer-local.workspace = true
futures.workspace = true
jsonrpsee.workspace = true
rstest.workspace = true
metrics-util = { workspace = true, features = ["debugging"] }
# Fatal-signal handler in tests/it/crash_backtrace.rs.
libc.workspace = true
Expand Down
329 changes: 293 additions & 36 deletions rust/op-reth/crates/node/tests/it/debug_trace_post_exec.rs

Large diffs are not rendered by default.

26 changes: 4 additions & 22 deletions rust/op-reth/crates/node/tests/it/invalid_post_exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,45 +6,27 @@
//! [SDM-M1]: https://github.com/ethereum-optimism/protocol-team/issues/371

use alloy_consensus::{Sealable, proofs::calculate_transaction_root};
use alloy_genesis::Genesis;
use alloy_primitives::B64;
use alloy_rpc_types_engine::{PayloadStatus, PayloadStatusEnum, PayloadValidationError};
use op_alloy_consensus::{
PostExecPayloadValidationError, SDMGasEntry, build_post_exec_tx, encode_jovian_extra_data,
};
use op_alloy_consensus::{PostExecPayloadValidationError, SDMGasEntry, build_post_exec_tx};
use op_alloy_rpc_types_engine::{OpExecutionData, OpExecutionPayload};
use reth_chainspec::BaseFeeParams;
use reth_e2e_test_utils::{NodeHelperType, setup_engine_with_connection, wallet::Wallet};
use reth_optimism_chainspec::OpChainSpecBuilder;
use reth_optimism_node::{
OpBuiltPayload, OpNode,
payload::OpExecData,
utils::{advance_chain, optimism_payload_attributes, setup},
utils::{advance_chain, setup},
};
use reth_optimism_primitives::OpTransactionSigned;
use std::sync::Arc;
use tokio::sync::Mutex;

/// Creates Lagoon-active nodes without changing the shared Ecotone fixture.
async fn setup_lagoon(num_nodes: usize) -> eyre::Result<(Vec<NodeHelperType<OpNode>>, Wallet)> {
let mut genesis: Genesis = serde_json::from_str(include_str!("../assets/genesis.json"))?;
// Lagoon is active at genesis, so the first child's base fee uses Jovian extra data.
genesis.extra_data = encode_jovian_extra_data(B64::ZERO, BaseFeeParams::optimism(), 0)?;
genesis.base_fee_per_gas = Some(1_000_000_000);
let chain_spec = Arc::new(
OpChainSpecBuilder::optimism_sepolia().genesis(genesis).lagoon_activated().build(),
);
setup_engine_with_connection(
num_nodes,
chain_spec,
crate::lagoon::chain_spec()?,
false,
Default::default(),
|timestamp| {
let mut attributes = optimism_payload_attributes(timestamp);
attributes.0.eip_1559_params = Some(B64::ZERO);
attributes.0.min_base_fee = Some(0);
attributes
},
crate::lagoon::payload_attributes,
// The buffered-child test must learn the parent only through its explicit newPayload.
false,
)
Expand Down
27 changes: 27 additions & 0 deletions rust/op-reth/crates/node/tests/it/lagoon.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
//! Lagoon-at-genesis fixtures shared by the SDM integration tests.

use alloy_genesis::Genesis;
use alloy_primitives::B64;
use op_alloy_consensus::encode_jovian_extra_data;
use reth_chainspec::BaseFeeParams;
use reth_optimism_chainspec::{OpChainSpec, OpChainSpecBuilder};
use reth_optimism_node::utils::optimism_payload_attributes;
use reth_optimism_payload_builder::OpPayloadAttrs;
use std::sync::Arc;

/// Builds a Lagoon-at-genesis spec that funds the e2e test wallet.
pub(crate) fn chain_spec() -> eyre::Result<Arc<OpChainSpec>> {
let mut genesis: Genesis = serde_json::from_str(include_str!("../assets/genesis.json"))?;
// Lagoon is active at genesis, so the first child's base fee uses Jovian extra data.
genesis.extra_data = encode_jovian_extra_data(B64::ZERO, BaseFeeParams::optimism(), 0)?;
genesis.base_fee_per_gas = Some(1_000_000_000);
Ok(Arc::new(OpChainSpecBuilder::optimism_sepolia().genesis(genesis).lagoon_activated().build()))
}

/// Payload attributes carrying the Jovian fields a Lagoon block requires.
pub(crate) const fn payload_attributes(timestamp: u64) -> OpPayloadAttrs {
let mut attributes = optimism_payload_attributes(timestamp);
attributes.0.eip_1559_params = Some(B64::ZERO);
attributes.0.min_base_fee = Some(0);
attributes
}
4 changes: 4 additions & 0 deletions rust/op-reth/crates/node/tests/it/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,14 @@ mod debug_trace_post_exec;

mod invalid_post_exec;

mod lagoon;

mod estimate_gas_7825;

mod p2p_version;

mod derived_attributes;

const fn main() {}

mod rpc_replay_settlement;
Loading
Loading