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
4 changes: 4 additions & 0 deletions crates/ingress-rpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,10 @@ pub struct Config {
/// TTL for bundle cache in seconds
#[arg(long, env = "TIPS_INGRESS_BUNDLE_CACHE_TTL", default_value = "20")]
pub bundle_cache_ttl: u64,

/// Enable sending to builder
#[arg(long, env = "TIPS_INGRESS_SEND_TO_BUILDER", default_value = "false")]
pub send_to_builder: bool,
}

pub fn connect_ingress_to_builder(
Expand Down
3 changes: 3 additions & 0 deletions crates/ingress-rpc/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,7 @@ pub struct Metrics {

#[metric(describe = "Total raw transactions forwarded to additional endpoint")]
pub raw_tx_forwards_total: Counter,

#[metric(describe = "Number of bundles that exceeded the metering time")]
pub bundles_exceeded_metering_time: Counter,
}
8 changes: 7 additions & 1 deletion crates/ingress-rpc/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ pub struct IngressService<Q: MessageQueue, M: Mempool> {
max_backrun_txs: usize,
max_backrun_gas_limit: u64,
bundle_cache: Cache<B256, ()>,
send_to_builder: bool,
}

impl<Q: MessageQueue, M: Mempool> IngressService<Q, M> {
Expand Down Expand Up @@ -142,6 +143,7 @@ impl<Q: MessageQueue, M: Mempool> IngressService<Q, M> {
max_backrun_txs: config.max_backrun_txs,
max_backrun_gas_limit: config.max_backrun_gas_limit,
bundle_cache,
send_to_builder: config.send_to_builder,
}
}
}
Expand Down Expand Up @@ -334,7 +336,9 @@ impl<Q: MessageQueue + 'static, M: Mempool + 'static> IngressApiServer for Ingre

if let Some(meter_info) = meter_bundle_response.as_ref() {
self.metrics.successful_simulations.increment(1);
_ = self.builder_tx.send(meter_info.clone());
if self.send_to_builder {
_ = self.builder_tx.send(meter_info.clone());
}
} else {
self.metrics.failed_simulations.increment(1);
}
Expand Down Expand Up @@ -531,6 +535,7 @@ impl<Q: MessageQueue, M: Mempool> IngressService<Q, M> {
// that we know will take longer than the block time to execute
let total_execution_time = (res.total_execution_time_us / 1_000) as u64;
if total_execution_time > self.block_time_milliseconds {
self.metrics.bundles_exceeded_metering_time.increment(1);
return Err(
EthApiError::InvalidParams("Bundle simulation took too long".into()).into_rpc_err(),
);
Expand Down Expand Up @@ -646,6 +651,7 @@ mod tests {
max_backrun_txs: 5,
max_backrun_gas_limit: 5000000,
bundle_cache_ttl: 20,
send_to_builder: false,
}
}

Expand Down
22 changes: 13 additions & 9 deletions ui/src/app/bundles/[uuid]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ function TransactionDetails({
<ExplorerLink
type="address"
value={tx.signer}
className="font-mono"
className="font-mono text-gray-900"
>
{tx.signer}
</ExplorerLink>
Expand All @@ -255,7 +255,7 @@ function TransactionDetails({
<ExplorerLink
type="address"
value={tx.to}
className="font-mono"
className="font-mono text-gray-900"
>
{tx.to}
</ExplorerLink>
Expand All @@ -269,23 +269,25 @@ function TransactionDetails({
<div className="border-t border-gray-100 px-5 py-3 bg-gray-50/50 grid grid-cols-4 gap-4 text-xs">
<div>
<span className="text-gray-500">Nonce</span>
<span className="ml-2 font-medium">{parseInt(tx.nonce, 16)}</span>
<span className="ml-2 font-medium text-gray-900">
{parseInt(tx.nonce, 16)}
</span>
</div>
<div>
<span className="text-gray-500">Max Fee</span>
<span className="ml-2 font-medium">
<span className="ml-2 font-medium text-gray-900">
{formatGasPrice(tx.maxFeePerGas)}
</span>
</div>
<div>
<span className="text-gray-500">Priority Fee</span>
<span className="ml-2 font-medium">
<span className="ml-2 font-medium text-gray-900">
{formatGasPrice(tx.maxPriorityFeePerGas)}
</span>
</div>
<div>
<span className="text-gray-500">Type</span>
<span className="ml-2 font-medium">
<span className="ml-2 font-medium text-gray-900">
{tx.type === "0x2" ? "EIP-1559" : tx.type}
</span>
</div>
Expand Down Expand Up @@ -330,17 +332,19 @@ function SimulationCard({ meter }: { meter: MeterBundleResponse }) {
<div className="border-t border-gray-100 px-5 py-3 bg-gray-50/50 grid grid-cols-3 gap-4 text-xs">
<div>
<span className="text-gray-500">State Block</span>
<span className="ml-2 font-medium">#{meter.stateBlockNumber}</span>
<span className="ml-2 font-medium text-gray-900">
#{meter.stateBlockNumber}
</span>
</div>
<div>
<span className="text-gray-500">Gas Fees</span>
<span className="ml-2 font-medium">
<span className="ml-2 font-medium text-gray-900">
{formatHexValue(meter.gasFees)}
</span>
</div>
<div>
<span className="text-gray-500">ETH to Coinbase</span>
<span className="ml-2 font-medium">
<span className="ml-2 font-medium text-gray-900">
{formatHexValue(meter.ethSentToCoinbase)}
</span>
</div>
Expand Down