feat(v2:replay,exec): implement status cache parsing & state #1642
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
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
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
yewman
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
ExecutionRegistryis 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 theExecutionRegistry.BlockhashQueueViewas parameters; the "blockhashqueue view" is simply a non-transient struct bundling the relevant blockhashqueue state together for thegetBlockRefIfValidForAgemethod. 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).