fix(rpc): serve StateReplay from the tipset trace cache + semaphore#7405
Conversation
WalkthroughState replay now uses shared tipset execution traces and a configurable semaphore to bound concurrent blocking replays. Tests, snapshots, documentation, changelog entries, and the Forest dictionary are updated accordingly. ChangesState replay execution
Dictionary metadata
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant RPCMethod
participant StateManager
participant TipsetTraceCache
RPCMethod->>StateManager: request replay for tipset and message CID
StateManager->>TipsetTraceCache: fetch execution trace
TipsetTraceCache-->>StateManager: return traced invocations
StateManager->>StateManager: select matching ApiInvocResult
StateManager-->>RPCMethod: return replay result
Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
✨ Simplify code
Comment |
9fcdcfd to
44a5bba
Compare
44a5bba to
3a67ddb
Compare
3a67ddb to
7e8d4fd
Compare
7e8d4fd to
ced4c0c
Compare
ced4c0c to
53dc99f
Compare
ef1a535 to
0bd3c05
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files
... and 17 files with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/docs/users/reference/env_variables.md`:
- Line 24: Update the FOREST_RPC_REPLAY_CONCURRENCY documentation to clarify
that a full tipset VM execution occurs only when the requested replay is not
already available in trace_cache; avoid implying that every request performs a
full execution.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: b67832ec-5469-4292-9d64-7b619763d969
📒 Files selected for processing (8)
.config/forest.dicCHANGELOG.mddocs/docs/users/reference/env_variables.mdsrc/state_manager/execution.rssrc/state_manager/mod.rssrc/state_manager/tests.rssrc/state_manager/utils.rssrc/tool/subcommands/api_cmd/test_snapshots.txt
🔗 Linked repositories identified
CodeRabbit considers these linked repositories for cross-repo context during reviews:
filecoin-project/lotus(manual)
🚧 Files skipped from review as they are similar to previous changes (6)
- .config/forest.dic
- src/tool/subcommands/api_cmd/test_snapshots.txt
- CHANGELOG.md
- src/state_manager/tests.rs
- src/state_manager/mod.rs
- src/state_manager/execution.rs
Summary of changes
Changes introduced in this pull request:
Note that this cache is shared with some other methods so we're even less likely here to have a miss.
Reference issue to close (if applicable)
Closes
Other information and links
Change checklist
Outside contributions
Summary by CodeRabbit
FOREST_RPC_REPLAY_CONCURRENCYto set the default replay concurrency (half the available CPUs, minimum 1)."failed to replay"error when the requested message isn’t present.FOREST_RPC_REPLAY_CONCURRENCYin the environment variables reference.