Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log less on BUNDLE_HASHES_HEADER #512

Merged
merged 1 commit into from
Mar 21, 2025
Merged
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
31 changes: 22 additions & 9 deletions crates/rbuilder/src/mev_boost/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -532,15 +532,28 @@ impl RelayClient {
builder = builder.header(TOP_BID_HEADER, top_competitor_bid.to_string());
}
if !submission_with_metadata.metadata.order_ids.is_empty() {
builder = builder.header(
BUNDLE_HASHES_HEADER,
submission_with_metadata
.metadata
.order_ids
.iter()
.map(|id| id.to_string())
.join(","),
);
const MAX_BUNDLE_IDS: usize = 150;
let bundle_ids: Vec<_> = submission_with_metadata
.metadata
.order_ids
.iter()
.filter_map(|or| match or {
crate::primitives::OrderId::Tx(_fixed_bytes) => None,
crate::primitives::OrderId::Bundle(uuid) => Some(uuid),
crate::primitives::OrderId::ShareBundle(_fixed_bytes) => None,
})
.collect();
let total_bundles = bundle_ids.len();
let mut bundle_ids = bundle_ids
.iter()
.take(MAX_BUNDLE_IDS)
.map(|uuid| format!("{:?}", uuid));
let bundle_ids = if total_bundles > MAX_BUNDLE_IDS {
bundle_ids.join(",") + ",CAPPED"
} else {
bundle_ids.join(",")
};
builder = builder.header(BUNDLE_HASHES_HEADER, bundle_ids);
}
}

Expand Down
Loading