Skip to content
Open
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
8 changes: 8 additions & 0 deletions crates/op-rbuilder/src/args/op.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,14 @@ pub struct FlashblocksArgs {
)]
pub flashblocks_calculate_state_root: bool,

/// Should we calculate state root for each flashblock
#[arg(
long = "flashblocks.enable-continuous-building",
default_value = "true",
env = "FLASHBLOCKS_ENABLE_CONTINUOUS_BUILDING"
)]
pub flashblocks_enable_continuous_building: bool,

/// Flashblocks number contract address
///
/// This is the address of the contract that will be used to increment the flashblock number.
Expand Down
12 changes: 7 additions & 5 deletions crates/op-rbuilder/src/builders/context.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
use alloy_consensus::{Eip658Value, Transaction, conditional::BlockConditionalAttributes};
use alloy_consensus::{
Eip658Value, Transaction, conditional::BlockConditionalAttributes, transaction::TxHashRef,
};
use alloy_eips::Typed2718;
use alloy_evm::Database;
use alloy_op_evm::block::receipt_builder::OpReceiptBuilder;
Expand Down Expand Up @@ -326,10 +328,11 @@ impl<ExtraCtx: Debug + Default> OpPayloadBuilderCtx<ExtraCtx> {
Ok(info)
}

/// Executes the given best transactions and updates the execution info.
/// Simulates the given best transactions.
/// The simulation updates the execution info and commit changes to the db
///
/// Returns `Ok(Some(())` if the job was cancelled.
pub(super) fn execute_best_transactions<E: Debug + Default>(
pub(super) fn simulate_best_transactions<E: Debug + Default>(
&self,
info: &mut ExecutionInfo<E>,
db: &mut State<impl Database>,
Expand Down Expand Up @@ -375,8 +378,7 @@ impl<ExtraCtx: Debug + Default> OpPayloadBuilderCtx<ExtraCtx> {
// Note that we need to use the Option to signal whether the transaction comes from a bundle,
// otherwise, we would exclude all transactions that are not in the reverted hashes.
let is_bundle_tx = reverted_hashes.is_some();
let exclude_reverting_txs =
is_bundle_tx && !reverted_hashes.unwrap().contains(&tx_hash);
let exclude_reverting_txs = is_bundle_tx && !reverted_hashes.unwrap().contains(tx_hash);

let log_txn = |result: TxnExecutionResult| {
debug!(
Expand Down
7 changes: 7 additions & 0 deletions crates/op-rbuilder/src/builders/flashblocks/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ pub struct FlashblocksConfig {
/// Should we calculate state root for each flashblock
pub calculate_state_root: bool,

/// Whether to enable continuous flashblock building or not
pub enable_continuous_building: bool,

/// The address of the flashblocks number contract.
///
/// If set a builder tx will be added to the start of every flashblock instead of the regular builder tx.
Expand Down Expand Up @@ -63,6 +66,7 @@ impl Default for FlashblocksConfig {
leeway_time: Duration::from_millis(50),
fixed: false,
calculate_state_root: true,
enable_continuous_building: true,
flashblocks_number_contract_address: None,
p2p_enabled: false,
p2p_port: 9009,
Expand Down Expand Up @@ -90,6 +94,8 @@ impl TryFrom<OpRbuilderArgs> for FlashblocksConfig {

let calculate_state_root = args.flashblocks.flashblocks_calculate_state_root;

let enable_continuous_building = args.flashblocks.flashblocks_enable_continuous_building;

let flashblocks_number_contract_address =
args.flashblocks.flashblocks_number_contract_address;

Expand All @@ -99,6 +105,7 @@ impl TryFrom<OpRbuilderArgs> for FlashblocksConfig {
leeway_time,
fixed,
calculate_state_root,
enable_continuous_building,
flashblocks_number_contract_address,
p2p_enabled: args.flashblocks.p2p.p2p_enabled,
p2p_port: args.flashblocks.p2p.p2p_port,
Expand Down
Loading
Loading