Skip to content

release: backrun reject observability — info logs + deficit histograms#189

Merged
0xfandom merged 2 commits into
mainfrom
develop
Jun 17, 2026
Merged

release: backrun reject observability — info logs + deficit histograms#189
0xfandom merged 2 commits into
mainfrom
develop

Conversation

@0xfandom

Copy link
Copy Markdown
Collaborator

Summary

Releases two observability PRs already merged to develop:

No schema / proto / breaking changes. Purely additive observability.

Why now

Production funnel shows attempted: 384 → validated: 0 with 75% of rejects in two buckets (negative_after_gas 50%, arb_reverted 25%). Counters tell us which bucket; these PRs tell us why (Loki strings) and by how much (deficit p50/p95).

Test plan

  • cargo build clean across both crates touched (aether-grpc-server, aether-simulator)
  • cargo clippy --lib --no-deps clean on both crates
  • cargo test metrics:: — 4 passed (2 new)
  • cargo test mempool_backrun:: — 9 passed, 1 ignored (live-fork only)
  • mempool.json JSON valid (25 panels total, 3 new)
  • After deploy: Loki query {service="aether-rust"} |= "mempool-backrun: arb leg reverted" returns lines with reason= field
  • After deploy: Grafana mempool dashboard shows samples in the 3 new panels

0xfandom added 2 commits June 17, 2026 20:10
Promote four debug! reject-path log lines to info! so the
ABI-decoded revert string + gas/profit context surface in
docker logs / Loki without RUST_LOG=debug.

- victim_halted: halt opcode + gas
- negative_after_gas: gross, gas_cost, deficit_wei, arb_gas
- arb_reverted: decoded reason, 4-byte selector, full output hex
- arb_halted: halt opcode + gas

Volume at current mempool rate is ~10 lines/min sustained
(50% negative_after_gas + 25% arb_reverted of ~1.2k lifetime
rejects). Each line still routes through the same RejectReason
counter, so dashboards are unchanged.

victim_reverted was already info!; arb_revert / negative-after-gas
were the two biggest blind spots (75% of rejects combined).
Adds three Prom HistogramVec series, all labelled with the same
`reason` set as `aether_mempool_backrun_rejected_total` (plus
`"accepted"` for survivors):

  aether_mempool_backrun_gross_profit_eth{reason}
  aether_mempool_backrun_gas_cost_eth{reason}
  aether_mempool_backrun_deficit_eth{reason}

The reject counter already tells us how many candidates landed in
each of the eight reject buckets. It does not tell us by how much
they missed. With 50% of rejects today being `negative_after_gas`
and 25% `arb_reverted`, the actionable next question is whether
those misses cluster near zero (gas-model tuning win) or span
orders of magnitude (paths fundamentally too thin) — a question
the counter cannot answer.

Buckets are log-scale 1e-7 → 10 ETH, shared across all three
histograms so PromQL can subtract / divide buckets cleanly. Gas
cost is pinned to `params.base_fee` so the histogram matches the
simulator's own `NegativeAfterGas` accounting; the executor's
real-time gas pricing remains a separate Go-side metric.

Deficit observation is gated on `arb_gas_used > 0` so
`rpc_transport` / `sim_timeout` rejects (which never reach the
arb leg) do not skew the deficit histogram toward 0.

Three Grafana panels appended to `mempool.json`:
- p50 / p95 deficit by reason (timeseries)
- negative_after_gas deficit heatmap
- p50 gross profit by reason (timeseries)

`wei_to_eth_f64` helper does a two-stage divide to stay under
the 2^53 f64 mantissa boundary for typical (sub-1 ETH) backrun
samples; covered by `wei_to_eth_f64_handles_typical_range`.
A second test (`backrun_reject_histograms_emit_per_reason_label`)
exercises every reject label + accepted, so a future rename of
`RejectReason::as_str()` cannot silently break the dashboard.
@vercel

vercel Bot commented Jun 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
aether Ready Ready Preview, Comment Jun 17, 2026 2:42pm
aether-63xv Ready Ready Preview, Comment Jun 17, 2026 2:42pm

@0xfandom 0xfandom merged commit f062dd3 into main Jun 17, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant