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

fix: Add dummy system tx in op dev mode #14062

Merged
merged 3 commits into from
Jan 30, 2025
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 change: 1 addition & 0 deletions Cargo.lock

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

2 changes: 2 additions & 0 deletions crates/engine/local/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,13 @@ eyre.workspace = true
tracing.workspace = true

op-alloy-rpc-types-engine = { workspace = true, optional = true }
reth-optimism-chainspec = { workspace = true, optional = true }

[lints]
workspace = true

[features]
op = [
"dep:op-alloy-rpc-types-engine",
"dep:reth-optimism-chainspec",
]
6 changes: 5 additions & 1 deletion crates/engine/local/src/payload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ where
fn build(&self, timestamp: u64) -> op_alloy_rpc_types_engine::OpPayloadAttributes {
op_alloy_rpc_types_engine::OpPayloadAttributes {
payload_attributes: self.build(timestamp),
transactions: None,
// Add dummy system transaction
transactions: Some(vec![
reth_optimism_chainspec::constants::TX_SET_L1_BLOCK_OP_MAINNET_BLOCK_124665056
.into(),
]),
no_tx_pool: None,
gas_limit: None,
eip_1559_params: None,
Expand Down
10 changes: 10 additions & 0 deletions crates/optimism/chainspec/src/constants.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
//! OP stack variation of chain spec constants.

use alloy_primitives::hex;

//------------------------------- BASE MAINNET -------------------------------//

/// Max gas limit on Base: <https://basescan.org/block/17208876>
Expand All @@ -9,3 +11,11 @@ pub const BASE_MAINNET_MAX_GAS_LIMIT: u64 = 105_000_000;

/// Max gas limit on Base Sepolia: <https://sepolia.basescan.org/block/12506483>
pub const BASE_SEPOLIA_MAX_GAS_LIMIT: u64 = 45_000_000;

//----------------------------------- DEV ------------------------------------//

/// Dummy system transaction for dev mode
/// OP Mainnet transaction at index 0 in block 124665056.
///
/// <https://optimistic.etherscan.io/tx/0x312e290cf36df704a2217b015d6455396830b0ce678b860ebfcc30f41403d7b1>
pub const TX_SET_L1_BLOCK_OP_MAINNET_BLOCK_124665056: [u8; 251] = hex!("7ef8f8a0683079df94aa5b9cf86687d739a60a9b4f0835e520ec4d664e2e415dca17a6df94deaddeaddeaddeaddeaddeaddeaddeaddead00019442000000000000000000000000000000000000158080830f424080b8a4440a5e200000146b000f79c500000000000000040000000066d052e700000000013ad8a3000000000000000000000000000000000000000000000000000000003ef1278700000000000000000000000000000000000000000000000000000000000000012fdf87b89884a61e74b322bbcf60386f543bfae7827725efaaf0ab1de2294a590000000000000000000000006887246668a3b87f54deb3b94ba47a6f63f32985");
Copy link
Collaborator

Choose a reason for hiding this comment

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

this should probably solve the rpc issues that @Quertyy faced

I consider this a nice short term fix, we can make this a bit smarter in followups,
e.g. actually crafting a system tx.

but before we can do this we need to solve a few other things that I'll scope now

Loading