diff --git a/crates/ingress-rpc/src/lib.rs b/crates/ingress-rpc/src/lib.rs index 6fd1ad1..ea304c6 100644 --- a/crates/ingress-rpc/src/lib.rs +++ b/crates/ingress-rpc/src/lib.rs @@ -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( diff --git a/crates/ingress-rpc/src/metrics.rs b/crates/ingress-rpc/src/metrics.rs index fb53aa5..a62b3b8 100644 --- a/crates/ingress-rpc/src/metrics.rs +++ b/crates/ingress-rpc/src/metrics.rs @@ -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, } diff --git a/crates/ingress-rpc/src/service.rs b/crates/ingress-rpc/src/service.rs index 4f965e9..1e276a4 100644 --- a/crates/ingress-rpc/src/service.rs +++ b/crates/ingress-rpc/src/service.rs @@ -86,6 +86,7 @@ pub struct IngressService { max_backrun_txs: usize, max_backrun_gas_limit: u64, bundle_cache: Cache, + send_to_builder: bool, } impl IngressService { @@ -142,6 +143,7 @@ impl IngressService { 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, } } } @@ -334,7 +336,9 @@ impl 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); } @@ -531,6 +535,7 @@ impl IngressService { // 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(), ); @@ -646,6 +651,7 @@ mod tests { max_backrun_txs: 5, max_backrun_gas_limit: 5000000, bundle_cache_ttl: 20, + send_to_builder: false, } } diff --git a/ui/src/app/bundles/[uuid]/page.tsx b/ui/src/app/bundles/[uuid]/page.tsx index 135270f..0212106 100644 --- a/ui/src/app/bundles/[uuid]/page.tsx +++ b/ui/src/app/bundles/[uuid]/page.tsx @@ -240,7 +240,7 @@ function TransactionDetails({ {tx.signer} @@ -255,7 +255,7 @@ function TransactionDetails({ {tx.to} @@ -269,23 +269,25 @@ function TransactionDetails({
Nonce - {parseInt(tx.nonce, 16)} + + {parseInt(tx.nonce, 16)} +
Max Fee - + {formatGasPrice(tx.maxFeePerGas)}
Priority Fee - + {formatGasPrice(tx.maxPriorityFeePerGas)}
Type - + {tx.type === "0x2" ? "EIP-1559" : tx.type}
@@ -330,17 +332,19 @@ function SimulationCard({ meter }: { meter: MeterBundleResponse }) {
State Block - #{meter.stateBlockNumber} + + #{meter.stateBlockNumber} +
Gas Fees - + {formatHexValue(meter.gasFees)}
ETH to Coinbase - + {formatHexValue(meter.ethSentToCoinbase)}