Skip to content
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
4 changes: 3 additions & 1 deletion crates/op-rbuilder/src/builders/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,9 @@ impl OpPayloadBuilderCtx {
let tx_hash = tx.tx_hash();

// exclude reverting transaction if:
// - the transaction comes from a bundle and the hash **is not** in reverted hashes
// - the transaction comes from a bundle (is_some) and the hash **is not** in reverted hashes
// 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 exclude_reverting_txs =
reverted_hashes.is_some() && !reverted_hashes.unwrap().contains(&tx_hash);

Expand Down
4 changes: 2 additions & 2 deletions crates/op-rbuilder/src/primitives/bundle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ pub struct Bundle {
#[serde(rename = "txs")]
pub transactions: Vec<Bytes>,

#[serde(rename = "reverting_tx_hashes")]
pub reverting_hashes: Vec<B256>,
#[serde(rename = "revertingTxHashes")]
pub reverting_hashes: Option<Vec<B256>>,

#[serde(
default,
Expand Down
2 changes: 1 addition & 1 deletion crates/op-rbuilder/src/revert_protection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ where
let mut pool_transaction: FBPooledTransaction =
OpPooledTransaction::from_pooled(recovered).into();

pool_transaction.set_reverted_hashes(bundle.reverting_hashes.clone());
pool_transaction.set_reverted_hashes(bundle.reverting_hashes.clone().unwrap_or_default());
pool_transaction.set_conditional(bundle.conditional());

let hash = self
Expand Down
4 changes: 2 additions & 2 deletions crates/op-rbuilder/src/tests/framework/txs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,9 @@ impl TransactionBuilder {
let bundle = Bundle {
transactions: vec![transaction_encoded.into()],
reverting_hashes: if with_reverted_hash {
vec![txn_hash]
Some(vec![txn_hash.into()])
} else {
vec![]
None
},
block_number_max: bundle_opts.block_number_max,
block_number_min: bundle_opts.block_number_min,
Expand Down
Loading