fix(f02-mocks): apply complete f02 validation to write queue - #22
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the f02 Reward Actor mock to validate queued write operations using a projected-queue walk that mirrors f02 behavior, with special handling for schedule-wide weight-write slots so weight writes are admitted/settled according to full schedule validation.
Changes:
- Model
SetWeightRecords/StepWeightRecordsas schedule-wide, per-op queue slots (batch as a single pending entry) and adjust cancellation addressing (null-id shape). - Add projected-schedule admission logic: walk pending writes in effective-epoch order, apply to a candidate projection, validate from each write’s effective epoch, and refuse writes that would strand previously-accepted entries.
- Re-check due writes at settle-time and drop (with an event) writes that no longer validate due to intervening cancellations.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| test/mocks/FVMRewardActor.sol | Implements schedule-wide weight batching and projected-queue validation, plus settle-time dropping of invalid due writes. |
| test/mocks/FVMRewardActor.t.sol | Adds/updates tests to cover schedule-wide weight slots, cancellation shape rules, and projected-schedule validation behaviors. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
rvagg
force-pushed
the
rvagg/f02-mock-queue-slots
branch
from
August 10, 2026 10:56
737361a to
d4f2313
Compare
Merged
rvagg
force-pushed
the
rvagg/f02-mock-queue-slots
branch
from
August 10, 2026 11:21
d4f2313 to
1474c8d
Compare
wjmelements
force-pushed
the
rvagg/f02-mock-queue-slots
branch
from
August 10, 2026 15:21
1474c8d to
5b23b77
Compare
wjmelements
approved these changes
Aug 10, 2026
SetWeightRecords and StepWeightRecords key their slot by op alone and hold the whole batch as a single entry, so a second batch is rejected while one is pending even when it names entirely different streams. The three per-stream ops keep (id, op). A batch applies as one unit. CancelPending addresses the weight slots with a null id, and rejects the id/op shape mismatch in both directions.
A queued write walks the pending queue in effective-epoch order, applying each entry to a candidate projection and validating from its own effective epoch. Failing entries drop. The call is refused when the write does not survive its position, or when the walk accepts fewer slots than it did without it. Due writes are checked again at settle, since a cancellation can take away what one depended on, and dropped if they no longer hold. The weight sum is sampled at every breakpoint: clamped linears peak on a kink or at the limit.
wjmelements
force-pushed
the
rvagg/f02-mock-queue-slots
branch
from
August 11, 2026 14:48
5b23b77 to
8309043
Compare
…ture Assisted-by: Claude:claude-sonnet-4-6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is almost a reimplementation of the queue validation logic in f02, so any weight write operation should be validated as if it were hitting the real f02.
In here is:
and, taking it the whole-hog: