← Back to Pull requests

feat(l1): add full-sync throughput regression watch #7114

Open
unknown opened this pull request with 529 lines diff across 6 files
View on GitHub
unknown unknown commented on Aug 05, 2026 18:16 UTC
Author

Motivation

We have no continuous signal for execution throughput on real mainnet blocks. The per-PR CI benchmark runs a synthetic dense-ERC20 import, and multisync validates snap sync completion — so a change that lands on main and slows mainnet full sync stays invisible until someone runs a manual benchmark. We did that manually for #7008/#7023 and it cost days of setup each time.

Implements the design in #7111. Sibling manual A/B tool is #7112; both are meant to share the leg primitive added here.

Description

tooling/sync/fullsync_bench.py keeps a node a fixed distance behind head and, per cycle per network:

restore base → run M blocks           (MEASURE; resulting state discarded)
restore base → advance to head − GAP  (becomes the new base)

The base creeps forward at chain rate, so the node never ages and there is no anchor or reference commit to maintain. M is fixed and independent of the base's movement, so consecutive measurements overlap heavily — that overlap is what keeps day-to-day workload variation small enough for the series to be meaningful.

The advance targets head − GAP rather than a fixed block count, so it self-calibrates to each network's real block production and absorbs missed slots (relevant on testnets).

run_leg is deliberately pure — it never decides what happens to the resulting state, never assumes a particular ref, and never rotates anything. That is what lets #7112 reuse it unchanged.

Reuses multisync's per-network service pairs via a compose override (--syncmode full, mem_limit, published beacon APIs) rather than duplicating them, and its Slack webhook conventions.

Scope of this PR

Observe-only. It measures, records one JSON per leg, and posts a Slack summary with the delta against the trailing median. Alerting and step detection are deliberately not here: the real day-to-day σ is unknown, and thresholds should be derived from 2–3 weeks of collected data rather than guessed. Multi-network config is in place; the default is mainnet only.

Testing

The metric extraction is split into fullsync_metrics.py precisely so it can be tested without a node, a box or Docker — it is also the part most likely to be silently wrong. make fullsync-bench-test runs 7 tests against real log lines captured from the #7008/#7023 runs, covering: batch throughput mean/samples, the (unified pipeline) wording variant, blocks/s, gas-normalised phase timings, phase lines with no preceding block header (a truncated log must not skew the ratio), state-regeneration timing, and — importantly — that a run with no batches yields None rather than 0 Ggas/s, so a dead run is reported invalid instead of as a catastrophic regression.

The orchestration itself needs a box with a synced node and cannot be exercised in CI; make fullsync-bench-once is the intended first real run.

Operational invariants encoded in the code

These come from the manual benchmarking, not from preference:

  • graceful docker stop -t 300 only — repeated abrupt stops previously left the canonical head ahead of any durably-flushed state, after which the node could not regenerate and needed a full re-sync

  • the stop condition reads eth_blockNumber, never eth_syncing.currentBlock, which goes stale during catch-up and once let a leg overshoot its target badly

  • base rotation is health-gated: a new base is promoted only after the node demonstrably restarts on it with state available, otherwise the previous generation is kept

  • hardlink (rsync --link-dest) base generations, so rollback costs deltas rather than full copies

  • a box-wide lockfile: networks run serially, because concurrent legs contend and both results are junk
  • Follow-ups (not in this PR)

  • alerting + step detection, once the bootstrap period gives real thresholds

  • the manual A/B tool (#7112) on top of this primitive

  • per-network choice of primary metric — Ggas/s is likely wrong for light testnet blocks, where blocks/s or the phase timings may carry the signal
  • Checklist

  • Updated STORE_SCHEMA_VERSION (crates/storage/lib.rs) if the PR includes breaking changes to the Store requiring a re-sync. — N/A: tooling only, no client code touched.
  • Diff: 529 lines (+396 / -133) across 6 files Reviewer: ElFantasma Review duration: 106326m
    All Vouch review confidence checks passed
    Residual risk 0.30 = Change Risk (0.55) × (1 − Review Confidence (0.45)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.55 · 529 lines diff across 6 files
    0.55
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    44%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.375
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #7114"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 44.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 54.9% (MEDIUM) · Higher = larger blast radius
    54.9%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 44.7% · Lower = rushed or shallow review
    44.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 30.3% · Safe to merge
    30.3%