Skip to content

Commit 942f401

Browse files
authoredMar 21, 2025
Log less on BUNDLE_HASHES_HEADER (#512)
## 📝 Summary We were logging too much info. We switched to loging only bundles and capping to 150. ## ✅ I have completed the following steps: * [X] Run `make lint` * [X] Run `make test` * [ ] Added tests (if applicable)
1 parent e296417 commit 942f401

File tree

1 file changed

+22
-9
lines changed
  • crates/rbuilder/src/mev_boost

1 file changed

+22
-9
lines changed
 

‎crates/rbuilder/src/mev_boost/mod.rs

+22-9
Original file line numberDiff line numberDiff line change
@@ -532,15 +532,28 @@ impl RelayClient {
532532
builder = builder.header(TOP_BID_HEADER, top_competitor_bid.to_string());
533533
}
534534
if !submission_with_metadata.metadata.order_ids.is_empty() {
535-
builder = builder.header(
536-
BUNDLE_HASHES_HEADER,
537-
submission_with_metadata
538-
.metadata
539-
.order_ids
540-
.iter()
541-
.map(|id| id.to_string())
542-
.join(","),
543-
);
535+
const MAX_BUNDLE_IDS: usize = 150;
536+
let bundle_ids: Vec<_> = submission_with_metadata
537+
.metadata
538+
.order_ids
539+
.iter()
540+
.filter_map(|or| match or {
541+
crate::primitives::OrderId::Tx(_fixed_bytes) => None,
542+
crate::primitives::OrderId::Bundle(uuid) => Some(uuid),
543+
crate::primitives::OrderId::ShareBundle(_fixed_bytes) => None,
544+
})
545+
.collect();
546+
let total_bundles = bundle_ids.len();
547+
let mut bundle_ids = bundle_ids
548+
.iter()
549+
.take(MAX_BUNDLE_IDS)
550+
.map(|uuid| format!("{:?}", uuid));
551+
let bundle_ids = if total_bundles > MAX_BUNDLE_IDS {
552+
bundle_ids.join(",") + ",CAPPED"
553+
} else {
554+
bundle_ids.join(",")
555+
};
556+
builder = builder.header(BUNDLE_HASHES_HEADER, bundle_ids);
544557
}
545558
}
546559

0 commit comments

Comments
 (0)