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
10 changes: 10 additions & 0 deletions crates/rbuilder-operator/src/clickhouse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ pub struct BlockRow {
pub delayed_payment_values: Vec<U256>,

pub delayed_payment_addresses: Vec<String>,
pub sent_to_relay_at: i64,
pub tx_hashes: Vec<String>,
}

impl ClickhouseRowExt for BlockRow {
Expand Down Expand Up @@ -218,6 +220,7 @@ impl BidObserver for BuiltBlocksWriter {
builder_name: String,
best_bid_value: U256,
_relays: &RelaySet,
sent_to_relay_at: OffsetDateTime,
) {
let slot = slot_data.slot();
let block_number = slot_data.block();
Expand Down Expand Up @@ -254,6 +257,11 @@ impl BidObserver for BuiltBlocksWriter {
.iter()
.map(|address| address.to_string().to_lowercase())
.collect();
let tx_hashes = built_block_trace
.included_orders
.iter()
.flat_map(|res| res.tx_infos.iter().map(|info| info.tx.hash().to_string()))
.collect();
let block_row = BlockRow {
block_number,
profit: format_ether(submit_trace.value),
Expand Down Expand Up @@ -285,6 +293,8 @@ impl BidObserver for BuiltBlocksWriter {
delayed_payment_sources,
delayed_payment_values,
delayed_payment_addresses,
sent_to_relay_at: offset_date_to_clickhouse_timestamp(sent_to_relay_at),
tx_hashes,
};
if let Err(err) = blocks_tx.try_send(block_row) {
error!(?err, "Failed to send block to clickhouse");
Expand Down
4 changes: 4 additions & 0 deletions crates/rbuilder-operator/src/flashbots_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ use rbuilder::{
use rbuilder_config::EnvOrValue;
use serde::Deserialize;
use serde_with::serde_as;
use time::OffsetDateTime;
use tokio_util::sync::CancellationToken;
use tracing::{error, warn};
use url::Url;
Expand Down Expand Up @@ -454,6 +455,7 @@ impl BidObserver for RbuilderOperatorBidObserver {
builder_name: String,
best_bid_value: U256,
relays: &RelaySet,
sent_to_relay_at: OffsetDateTime,
) {
if let Some(p) = self.block_processor.as_ref() {
p.block_submitted(
Expand All @@ -463,6 +465,7 @@ impl BidObserver for RbuilderOperatorBidObserver {
builder_name.clone(),
best_bid_value,
relays,
sent_to_relay_at,
)
}
if let Some(p) = self.tbv_pusher.as_ref() {
Expand All @@ -473,6 +476,7 @@ impl BidObserver for RbuilderOperatorBidObserver {
builder_name,
best_bid_value,
relays,
sent_to_relay_at,
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use rbuilder::{
};
use redis::RedisError;
use std::sync::Arc;
use time::OffsetDateTime;
use tokio_util::sync::CancellationToken;

use super::{
Expand Down Expand Up @@ -80,6 +81,7 @@ impl BidObserver for BestTrueValueObserver {
builder_name: String,
_best_bid_value: alloy_primitives::U256,
_relays: &RelaySet,
_sent_to_relay_at: OffsetDateTime,
) {
let block_info = BuiltBlockInfo::new(
slot_data.block(),
Expand Down
1 change: 1 addition & 0 deletions crates/rbuilder/src/building/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,7 @@ pub struct ExecutionResult {
pub inplace_sim: SimValue,
pub space_used: BlockSpace,
pub order: Order,
/// Landed txs execution info.
pub tx_infos: Vec<TransactionExecutionInfo>,
/// Patch to get the executed OrderIds for merged sbundles (see: [`BundleOk::original_order_ids`],[`ShareBundleMerger`] )
/// Fully dropped orders (TxRevertBehavior::AllowedExcluded allows it!) are not included.
Expand Down
1 change: 1 addition & 0 deletions crates/rbuilder/src/building/order_commit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ pub struct DelayedKickback {
pub struct BundleOk {
pub space_used: BlockSpace,
pub cumulative_space_used: BlockSpace,
/// Landed txs execution info.
pub tx_infos: Vec<TransactionExecutionInfo>,
/// nonces_updates has a set of deduplicated final nonces of the txs in the order
pub nonces_updated: Vec<(Address, u64)>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ use crate::{
#[automock]
pub trait BidObserver: std::fmt::Debug {
/// This should NOT block since it's executed in the submitting thread.
#[allow(clippy::too_many_arguments)]
fn block_submitted(
&self,
slot_data: &MevBoostSlotData,
Expand All @@ -33,6 +34,7 @@ pub trait BidObserver: std::fmt::Debug {
builder_name: String,
best_bid_value: U256,
relays: &RelaySet,
sent_to_relay_at: OffsetDateTime,
);
}

Expand All @@ -48,6 +50,7 @@ impl BidObserver for NullBidObserver {
_builder_name: String,
_best_bid_value: U256,
_relays: &RelaySet,
_sent_to_relay_at: OffsetDateTime,
) {
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ async fn run_submit_to_relays_job(
};

mark_submission_start_time(block.trace.orders_sealed_at);
let sent_to_relay_at = OffsetDateTime::now_utc();
submit_block_to_relays(
request.clone(),
&bid_metadata,
Expand All @@ -286,6 +287,7 @@ async fn run_submit_to_relays_job(
builder_name,
bid_metadata.value.top_competitor_bid.unwrap_or_default(),
&relay_set,
sent_to_relay_at,
);
});
}
Expand Down
Loading