← Back to Pull requests

feat(v2:replay,exec): implement status cache parsing & state #1642

Open
unknown opened this pull request with 304 lines diff across 3 files
View on GitHub
unknown unknown commented on Jun 30, 2026 08:42 UTC
Author

Intent:
Implement the basic mechanisms to parse the "status cache" from the snapshot, and send it in a simple format to replay for it to initialize our equivalent subset, which we will call the "execution registry", renamed to better reflect its purpose as an actual authoritative data structure, rather than a transparent "caching layer", and to refer to the core data it reflects, which is a registry of transaction execution statuses.

Scope:
The ability for replay to correctly implement the Status Checker API; said API only exists in v1, but when we get around to bridging the code, this change adds a function call that is 1:1 for what implementation of that interface entails.
In agave, the so-called "status cache" also keeps track of the actual Result per transaction, in order to later use it to serialize into a snapshot in a somewhat awkward fashion. We intend RPC to be very separate from the core validator, so we avoid doing this here, instead simply representing whether or not a transaction was actually observed.

Approach:
Parsing: I decided to flatten the results of parsing the status cache into a stream of StatusCacheUpdates; parsing it into its canonical structure would have been wasteful and overly-complex. I do this using an nested iterator style of parser, the hierarchical results of which are then flattened into the aforementioned update structure, and sent to replay over a ring.
Representation: the ExecutionRegistry is a defined-layout, fixed-size data structure, with a list of entry per tracked block. Each entry is a linked list of transaction "key slices" (the first 20 bytes of the associated transaction's hash). Each node is actually a segment of these key slices, as an optimization to keep key slices close together for cache locality during iteration. The nodes are stored in a Shared Pool, also part of the ExecutionRegistry.

  • Status Checker API: a simple free function in the replay API that takes the status cache & a BlockhashQueueView as parameters; the "blockhashqueue view" is simply a non-transient struct bundling the relevant blockhashqueue state together for the getBlockRefIfValidForAge method. At present, lookups are done using some simple linear searches, aided by the sharded structure of the block and transaction relationships, and the locality of memory. It may be valuable to accelerate these lookups.
  • TODO:
    #1740 (associated comment in code).

    Diff: 304 lines (+228 / -76) across 3 files Reviewer: yewman Review duration: 229492m
    All Vouch review confidence checks passed
    Residual risk 0.26 = Change Risk (0.47) × (1 − Review Confidence (0.45)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.47 · 304 lines diff across 3 files
    0.47
    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
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.342
    Real PR Conversation Timeline
    1 comments
    "Review active on #1642"
    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: 47.1% (MEDIUM) · Higher = larger blast radius
    47.1%
    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: 26.1% · Safe to merge
    26.1%
    Repository