Skip to content

Commit a5e2dc7

Browse files
authored
fix: don't filter out regular txs post fusaka (#709)
## 📝 Summary The blob filter activated post fusaka was filtering out non-eip4844 txs. This is because it only keeps transactions with `BlobTransactionSidecarVariant::Eip7594(_)`. But non-eip4844 txs have `BlobTransactionSidecarVariant::Eip4844(_)` by default with 0 blobs, commitments and proofs. Because of this, post Fusaka only blob txs were being packed in the block since other txs were being rejected by this condiction. To fix this, we pass the entire tx to the filter function and only check what type of `BlobTransactionSidecarVariant` if the tx is an eip4844 tx. ## ✅ I have completed the following steps: * [ ] Run `make lint` * [ ] Run `make test` * [ ] Added tests (if applicable)
1 parent 90c792d commit a5e2dc7

File tree

1 file changed

+25
-12
lines changed

1 file changed

+25
-12
lines changed

crates/rbuilder/src/live_builder/order_input/blob_type_order_filter.rs

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
use alloy_eips::eip7594::BlobTransactionSidecarVariant;
1+
use alloy_eips::{eip7594::BlobTransactionSidecarVariant, Typed2718};
22

33
use crate::{
44
live_builder::order_input::replaceable_order_sink::ReplaceableOrderSink,
5-
primitives::{BundleReplacementData, Order, ShareBundleReplacementKey},
5+
primitives::{
6+
BundleReplacementData, Order, ShareBundleReplacementKey,
7+
TransactionSignedEcRecoveredWithBlobs,
8+
},
69
};
710

811
/// Filters out Orders with incorrect blobs (pre/post fusaka).
@@ -25,35 +28,45 @@ impl<FilterFunc> std::fmt::Debug for BlobTypeOrderFilter<FilterFunc> {
2528
/// Filters out EIP-7594 style blobs, supports only EIP-4844 style.
2629
pub fn new_pre_fusaka(
2730
sink: Box<dyn ReplaceableOrderSink>,
28-
) -> BlobTypeOrderFilter<impl Fn(&BlobTransactionSidecarVariant) -> bool + Send + Sync> {
29-
BlobTypeOrderFilter::new(sink, |blob| {
30-
matches!(blob, BlobTransactionSidecarVariant::Eip4844(_))
31+
) -> BlobTypeOrderFilter<impl Fn(&TransactionSignedEcRecoveredWithBlobs) -> bool + Send + Sync> {
32+
BlobTypeOrderFilter::new(sink, |tx| {
33+
if tx.is_eip4844() {
34+
matches!(*tx.blobs_sidecar, BlobTransactionSidecarVariant::Eip4844(_))
35+
} else {
36+
true
37+
}
3138
})
3239
}
3340

3441
/// Filters out EIP-4844 style, supports only EIP-7594 style blobs.
3542
pub fn new_fusaka(
3643
sink: Box<dyn ReplaceableOrderSink>,
37-
) -> BlobTypeOrderFilter<impl Fn(&BlobTransactionSidecarVariant) -> bool + Send + Sync> {
38-
BlobTypeOrderFilter::new(sink, |blob| {
39-
matches!(blob, BlobTransactionSidecarVariant::Eip7594(_))
44+
) -> BlobTypeOrderFilter<impl Fn(&TransactionSignedEcRecoveredWithBlobs) -> bool + Send + Sync> {
45+
BlobTypeOrderFilter::new(sink, |tx| {
46+
if tx.is_eip4844() {
47+
matches!(*tx.blobs_sidecar, BlobTransactionSidecarVariant::Eip7594(_))
48+
} else {
49+
true
50+
}
4051
})
4152
}
4253

43-
impl<FilterFunc: Fn(&BlobTransactionSidecarVariant) -> bool> BlobTypeOrderFilter<FilterFunc> {
54+
impl<FilterFunc: Fn(&TransactionSignedEcRecoveredWithBlobs) -> bool>
55+
BlobTypeOrderFilter<FilterFunc>
56+
{
4457
fn new(sink: Box<dyn ReplaceableOrderSink>, filter_func: FilterFunc) -> Self {
4558
Self { sink, filter_func }
4659
}
4760
}
4861

49-
impl<FilterFunc: Fn(&BlobTransactionSidecarVariant) -> bool + Send + Sync> ReplaceableOrderSink
50-
for BlobTypeOrderFilter<FilterFunc>
62+
impl<FilterFunc: Fn(&TransactionSignedEcRecoveredWithBlobs) -> bool + Send + Sync>
63+
ReplaceableOrderSink for BlobTypeOrderFilter<FilterFunc>
5164
{
5265
fn insert_order(&mut self, order: Order) -> bool {
5366
if order
5467
.list_txs()
5568
.iter()
56-
.all(|(tx, _)| (self.filter_func)(tx.blobs_sidecar.as_ref()))
69+
.all(|(tx, _)| (self.filter_func)(tx))
5770
{
5871
self.sink.insert_order(order)
5972
} else {

0 commit comments

Comments
 (0)