Skip to content

Commit d1d617c

Browse files
committed
fix: resolve rebase conflicts against main after base-execution-primitives flatten and crate renames
- Replace base-execution-primitives with base-alloy-consensus throughout - Replace base-alloy-rpc-types with base-common-rpc-types (post-rename) - Rename BaseBlockExecutionCtx/Factory/Executor to Op* to match commit intent - Replace OpBlock with BaseBlock (current main alias for Block<OpTxEnvelope>) - Replace OpAttributesWithParent with AttributesWithParent (base_protocol) - Remove base-execution-primitives from Cargo.toml deps across workspace
1 parent a77a8d8 commit d1d617c

28 files changed

Lines changed: 132 additions & 184 deletions

File tree

Cargo.lock

Lines changed: 50 additions & 84 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

actions/harness/src/l2.rs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ use alloy_signer::SignerSync;
1212
use alloy_signer_local::PrivateKeySigner;
1313
use alloy_trie::{EMPTY_ROOT_HASH, TrieAccount, root::state_root_unhashed};
1414
use base_alloy_chains::BaseUpgrade;
15-
use base_alloy_consensus::{EIP1559ParamError, OpBlock, OpTxEnvelope};
15+
use base_alloy_consensus::{BaseBlock, EIP1559ParamError, OpTxEnvelope};
1616
use base_alloy_rpc_types_engine::{OpExecutionPayload, OpNetworkPayloadEnvelope, PayloadHash};
1717
use base_consensus_genesis::{RollupConfig, SystemConfig};
1818
use base_evm::{OpEvmConfig, OpTransaction};
1919
use base_execution_chainspec::OpChainSpecBuilder;
20-
use base_protocol::{BlockInfo, L1BlockInfoTx, L2BlockInfo, OpAttributesWithParent};
20+
use base_protocol::{AttributesWithParent, BlockInfo, L1BlockInfoTx, L2BlockInfo};
2121
use reth_evm::{ConfigureEvm, Evm as _, FromRecoveredTx};
2222
use revm::{
2323
DatabaseCommit,
@@ -140,13 +140,13 @@ pub enum L2SequencerError {
140140
Evm(String),
141141
}
142142

143-
/// A pre-built queue of [`OpBlock`]s for the batcher to drain.
143+
/// A pre-built queue of [`BaseBlock`]s for the batcher to drain.
144144
///
145145
/// Tests push fully-formed blocks into the source, which the batcher
146146
/// consumes one at a time via [`L2BlockProvider::next_block`].
147147
#[derive(Debug, Default)]
148148
pub struct ActionL2Source {
149-
blocks: VecDeque<OpBlock>,
149+
blocks: VecDeque<BaseBlock>,
150150
}
151151

152152
impl ActionL2Source {
@@ -156,7 +156,7 @@ impl ActionL2Source {
156156
}
157157

158158
/// Push a block to the back of the queue.
159-
pub fn push(&mut self, block: OpBlock) {
159+
pub fn push(&mut self, block: BaseBlock) {
160160
self.blocks.push_back(block);
161161
}
162162

@@ -172,7 +172,7 @@ impl ActionL2Source {
172172
}
173173

174174
impl L2BlockProvider for ActionL2Source {
175-
fn next_block(&mut self) -> Option<OpBlock> {
175+
fn next_block(&mut self) -> Option<BaseBlock> {
176176
self.blocks.pop_front()
177177
}
178178
}
@@ -240,7 +240,7 @@ impl SharedBlockHashRegistry {
240240
}
241241
}
242242

243-
/// Builds real [`OpBlock`]s for use in action tests.
243+
/// Builds real [`BaseBlock`]s for use in action tests.
244244
///
245245
/// Each block contains:
246246
/// - A correct L1-info deposit transaction (type `0x7E`) as the first
@@ -373,7 +373,7 @@ impl L2Sequencer {
373373
/// validation.
374374
///
375375
/// [`set_supervised_p2p`]: L2Sequencer::set_supervised_p2p
376-
pub fn broadcast_unsafe_block(&self, block: &OpBlock) {
376+
pub fn broadcast_unsafe_block(&self, block: &BaseBlock) {
377377
let Some(p2p) = &self.supervised_p2p else { return };
378378
let block_hash = block.header.hash_slow();
379379
let (execution_payload, _) = OpExecutionPayload::from_block_unchecked(block_hash, block);
@@ -397,12 +397,12 @@ impl L2Sequencer {
397397
/// Panics if the block cannot be built (e.g. missing L1 block data).
398398
///
399399
/// [`build_next_block`]: L2Sequencer::build_next_block
400-
pub fn build_empty_block(&mut self) -> OpBlock {
400+
pub fn build_empty_block(&mut self) -> BaseBlock {
401401
self.build_next_block_with_transactions(vec![])
402402
}
403403

404404
/// Build the next L2 block with a single transaction.
405-
pub fn build_next_block_with_single_transaction(&mut self) -> OpBlock {
405+
pub fn build_next_block_with_single_transaction(&mut self) -> BaseBlock {
406406
let tx = {
407407
let mut account = self.test_account.lock().expect("test account lock poisoned");
408408
account.create_eip1559_tx(self.rollup_config.l2_chain_id.id())
@@ -412,7 +412,7 @@ impl L2Sequencer {
412412

413413
/// Build the next L2 block and advance the internal head.
414414
///
415-
/// Returns a fully-formed [`OpBlock`] containing the L1-info deposit and
415+
/// Returns a fully-formed [`BaseBlock`] containing the L1-info deposit and
416416
/// any configured user transactions, with a real state root and block hash.
417417
///
418418
/// # Panics
@@ -425,7 +425,7 @@ impl L2Sequencer {
425425
pub fn build_next_block_with_transactions(
426426
&mut self,
427427
transactions: Vec<OpTxEnvelope>,
428-
) -> OpBlock {
428+
) -> BaseBlock {
429429
self.try_build_next_block_with_transactions(transactions)
430430
.unwrap_or_else(|e| panic!("L2Sequencer::build_next_block failed: {e}"))
431431
}
@@ -439,7 +439,7 @@ impl L2Sequencer {
439439
pub fn try_build_next_block_with_transactions(
440440
&mut self,
441441
transactions: Vec<OpTxEnvelope>,
442-
) -> Result<OpBlock, L2SequencerError> {
442+
) -> Result<BaseBlock, L2SequencerError> {
443443
let mut transactions = transactions;
444444
let next_number = self.head.block_info.number + 1;
445445
let next_timestamp = self.head.block_info.timestamp + self.rollup_config.block_time;
@@ -508,7 +508,7 @@ impl L2Sequencer {
508508

509509
let block_hash = header.hash_slow();
510510

511-
let block = OpBlock {
511+
let block = BaseBlock {
512512
header,
513513
body: alloy_consensus::BlockBody { transactions, ommers: vec![], withdrawals: None },
514514
};
@@ -578,7 +578,7 @@ pub fn compute_state_root(db: &InMemoryDB) -> B256 {
578578
}
579579

580580
impl L2BlockProvider for L2Sequencer {
581-
fn next_block(&mut self) -> Option<OpBlock> {
581+
fn next_block(&mut self) -> Option<BaseBlock> {
582582
Some(self.build_next_block_with_single_transaction())
583583
}
584584
}
@@ -641,7 +641,7 @@ impl StatefulL2Executor {
641641
/// mirror the sequencer's block-by-block execution.
642642
pub fn execute_attrs(
643643
&mut self,
644-
attrs: &OpAttributesWithParent,
644+
attrs: &AttributesWithParent,
645645
block_number: u64,
646646
parent_hash: B256,
647647
) -> Result<B256, L2SequencerError> {

crates/builder/core/src/execution.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@ use ExecutionMeteringLimitExceeded::{
88
BlockStateRootGas, FlashblockExecutionTime, TransactionExecutionTime,
99
};
1010
use alloy_primitives::{Address, U256};
11-
use base_alloy_consensus::OpReceipt;
11+
use base_alloy_consensus::{OpReceipt, OpTransactionSigned};
1212
use base_evm::OpTransactionError;
13-
use base_execution_primitives::OpTransactionSigned;
1413
use derive_more::Display;
1514
use thiserror::Error;
1615

crates/builder/core/src/flashblocks/context.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,10 @@ use alloy_primitives::{B256, BlockHash, Bytes, U256};
1111
use alloy_rpc_types_eth::Withdrawals;
1212
use base_access_lists::FBALBuilderDb;
1313
use base_alloy_chains::BaseUpgrades;
14-
use base_alloy_consensus::{OpDepositReceipt, OpReceipt, OpTxType};
14+
use base_alloy_consensus::{OpDepositReceipt, OpReceipt, OpTransactionSigned, OpTxType};
1515
use base_evm::{L1BlockInfo, OpEvmConfig, OpNextBlockEnvAttributes, OpReceiptBuilder, OpSpecId};
1616
use base_execution_chainspec::OpChainSpec;
1717
use base_execution_payload_builder::{OpPayloadBuilderAttributes, error::OpPayloadBuilderError};
18-
use base_execution_primitives::OpTransactionSigned;
1918
use base_txpool::{
2019
BundleTransaction, TimestampedTransaction, estimated_da_size::DataAvailabilitySized,
2120
};

crates/client/metering/src/block.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use std::{sync::Arc, time::Instant};
44

55
use alloy_consensus::{BlockHeader, Header, transaction::SignerRecoverable};
66
use alloy_primitives::B256;
7-
use base_alloy_consensus::OpBlock;
7+
use base_alloy_consensus::BaseBlock;
88
use base_evm::{OpEvmConfig, OpNextBlockEnvAttributes};
99
use base_execution_chainspec::OpChainSpec;
1010
use eyre::{Result as EyreResult, eyre};
@@ -37,7 +37,7 @@ use crate::types::{MeterBlockResponse, MeterBlockTransactions};
3737
pub fn meter_block<P>(
3838
provider: P,
3939
chain_spec: Arc<OpChainSpec>,
40-
block: &OpBlock,
40+
block: &BaseBlock,
4141
) -> EyreResult<MeterBlockResponse>
4242
where
4343
P: StateProviderFactory + HeaderProvider<Header = Header>,
@@ -137,7 +137,7 @@ where
137137
mod tests {
138138
use alloy_consensus::TxEip1559;
139139
use alloy_primitives::{Address, Signature};
140-
use base_execution_primitives::{OpBlockBody, OpTransactionSigned};
140+
use base_alloy_consensus::{BaseBlockBody, OpTransactionSigned};
141141
use base_node_runner::test_utils::{Account, TestHarness};
142142
use reth_primitives_traits::Block as _;
143143
use reth_transaction_pool::test_utils::TransactionBuilder;
@@ -147,7 +147,7 @@ mod tests {
147147
fn create_block_with_transactions(
148148
harness: &TestHarness,
149149
transactions: Vec<OpTransactionSigned>,
150-
) -> OpBlock {
150+
) -> BaseBlock {
151151
let latest = harness.latest_block();
152152
let header = Header {
153153
parent_hash: latest.hash(),
@@ -161,9 +161,9 @@ mod tests {
161161
..Default::default()
162162
};
163163

164-
let body = OpBlockBody { transactions, ommers: vec![], withdrawals: None };
164+
let body = BaseBlockBody { transactions, ommers: vec![], withdrawals: None };
165165

166-
OpBlock::new(header, body)
166+
BaseBlock::new(header, body)
167167
}
168168

169169
#[tokio::test]
@@ -384,8 +384,8 @@ mod tests {
384384
..Default::default()
385385
};
386386

387-
let body = OpBlockBody { transactions: vec![], ommers: vec![], withdrawals: None };
388-
let block = OpBlock::new(header, body);
387+
let body = BaseBlockBody { transactions: vec![], ommers: vec![], withdrawals: None };
388+
let block = BaseBlock::new(header, body);
389389

390390
let result = meter_block(harness.blockchain_provider(), harness.chain_spec(), &block);
391391

crates/execution/cli/src/app.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ where
7575

7676
let components = |spec: Arc<OpChainSpec>| {
7777
(
78-
BaseExecutorProvider::optimism(Arc::clone(&spec)),
78+
OpExecutorProvider::optimism(Arc::clone(&spec)),
7979
Arc::new(OpBeaconConsensus::new(spec)),
8080
)
8181
};

crates/execution/engine-tree/src/cached_execution.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ impl<TxResult> CachedExecutionProvider<TxResult> for NoopCachedExecutionProvider
111111
/// Executor that fetches cached execution results for transactions.
112112
#[derive(Debug)]
113113
pub struct CachedExecutor<E, C> {
114-
executor: BaseBlockExecutor<E, OpRethReceiptBuilder, Arc<OpChainSpec>>,
114+
executor: OpBlockExecutor<E, OpRethReceiptBuilder, Arc<OpChainSpec>>,
115115
cached_execution_provider: C,
116116
txs: Vec<B256>,
117117
position_by_hash: HashMap<B256, usize>,
@@ -122,7 +122,7 @@ pub struct CachedExecutor<E, C> {
122122
impl<E, C> CachedExecutor<E, C> {
123123
/// Creates a new [`CachedExecutor`].
124124
pub fn new(
125-
executor: BaseBlockExecutor<E, OpRethReceiptBuilder, Arc<OpChainSpec>>,
125+
executor: OpBlockExecutor<E, OpRethReceiptBuilder, Arc<OpChainSpec>>,
126126
cached_execution_provider: C,
127127
txs: Vec<B256>,
128128
parent_block_hash: B256,

0 commit comments

Comments
 (0)