Skip to content

Commit fa12cf3

Browse files
authored
Massive share bundle code removal (#830)
## πŸ“ Summary Share bundles have been deprecated. ## πŸ’‘ Motivation and Context I don't like to maintain dead code, it smells bad. ## βœ… I have completed the following steps: * [X] Run `make lint` * [X] Run `make test` * [ ] Added tests (if applicable) * [X] Started looking for a new job in case this PR fails.
1 parent 7d47eb8 commit fa12cf3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+132
-3555
lines changed

β€Žcrates/rbuilder-operator/src/clickhouse.rsβ€Ž

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ pub struct BlockRow {
6565

6666
pub used_bundle_hashes: Vec<String>,
6767
pub used_bundle_uuids: Vec<String>,
68-
pub used_sbundles_hashes: Vec<String>,
6968
pub delayed_payment_sources: Vec<String>,
7069

7170
#[serde(with = "vec_u256")]
@@ -180,33 +179,6 @@ fn offset_date_to_clickhouse_timestamp(date: OffsetDateTime) -> i64 {
180179
(date.unix_timestamp_nanos() / 1000) as i64
181180
}
182181

183-
fn get_used_sbundles_hashes(built_block_trace: &BuiltBlockTrace) -> Vec<String> {
184-
built_block_trace
185-
.included_orders
186-
.iter()
187-
.flat_map(|exec_result| {
188-
if let Order::ShareBundle(sbundle) = &exec_result.order {
189-
// don't like having special cases (merged vs not merged), can we improve this?
190-
if sbundle.is_merged_order() {
191-
exec_result
192-
.original_order_ids
193-
.iter()
194-
.map(|id| id.to_string())
195-
.collect()
196-
} else if exec_result.tx_infos.is_empty() {
197-
// non merged empty execution sbundle
198-
vec![]
199-
} else {
200-
// non merged non empty execution sbundle
201-
vec![exec_result.order.id().to_string()]
202-
}
203-
} else {
204-
Vec::new()
205-
}
206-
})
207-
.collect()
208-
}
209-
210182
const MEV_VIRTUAL_BLOCKER_SOURCE: &str = "mev_blocker";
211183
const MEV_VIRTUAL_ADDRESS: Address = Address::ZERO;
212184

@@ -282,7 +254,6 @@ impl BidObserver for BuiltBlocksWriter {
282254
used_bundle_uuids.push(bundle.uuid.to_string());
283255
}
284256
}
285-
let used_sbundles_hashes = get_used_sbundles_hashes(&built_block_trace);
286257
let (delayed_payment_sources, delayed_payment_values, delayed_payment_addresses) =
287258
get_delayed_payments(&built_block_trace);
288259
let delayed_payment_addresses = delayed_payment_addresses
@@ -352,7 +323,6 @@ impl BidObserver for BuiltBlocksWriter {
352323
block_value: Some(submit_trace.value),
353324
used_bundle_hashes,
354325
used_bundle_uuids,
355-
used_sbundles_hashes,
356326
delayed_payment_sources,
357327
delayed_payment_values,
358328
delayed_payment_addresses,

β€Žcrates/rbuilder-primitives/src/fmt.rsβ€Ž

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,12 @@
11
use std::fmt::Write;
22

3-
use super::{Order, ShareBundleBody, ShareBundleInner, ShareBundleTx, SimValue, SimulatedOrder};
3+
use super::{Order, SimValue, SimulatedOrder};
44

55
/// Writes indent spaces
66
pub fn write_indent<Buffer: Write>(indent: usize, buf: &mut Buffer) -> std::fmt::Result {
77
buf.write_str(&format!("{: <1$}", "", indent))
88
}
99

10-
pub fn write_share_bundle_tx<Buffer: Write>(
11-
indent: usize,
12-
buf: &mut Buffer,
13-
tx: &ShareBundleTx,
14-
) -> std::fmt::Result {
15-
write_indent(indent, buf)?;
16-
buf.write_str(&format!(
17-
"TX {} Rev {:?} val {}\n",
18-
tx.tx.hash(),
19-
tx.revert_behavior,
20-
tx.tx.value()
21-
))
22-
}
23-
24-
pub fn write_share_bundle_inner<Buffer: Write>(
25-
indent: usize,
26-
buf: &mut Buffer,
27-
inner: &ShareBundleInner,
28-
) -> std::fmt::Result {
29-
write_indent(indent, buf)?;
30-
buf.write_str(&format!("Inner can skip {} \n", inner.can_skip))?;
31-
for item in &inner.body {
32-
match item {
33-
ShareBundleBody::Tx(tx) => write_share_bundle_tx(indent + 1, buf, tx)?,
34-
ShareBundleBody::Bundle(sb) => write_share_bundle_inner(indent + 1, buf, sb)?,
35-
}
36-
}
37-
Ok(())
38-
}
39-
4010
pub fn write_order<Buffer: Write>(
4111
indent: usize,
4212
buf: &mut Buffer,
@@ -50,10 +20,6 @@ pub fn write_order<Buffer: Write>(
5020
tx.tx_with_blobs.hash(),
5121
tx.tx_with_blobs.value()
5222
)),
53-
Order::ShareBundle(sb) => {
54-
buf.write_str(&format!("ShB {:?}\n", sb.hash))?;
55-
write_share_bundle_inner(indent + 1, buf, &sb.inner_bundle)
56-
}
5723
}
5824
}
5925

0 commit comments

Comments
Β (0)