Skip to content

fix: spawn_blocking for fvm calls#7184

Open
hanabi1224 wants to merge 1 commit into
mainfrom
hm/spawn-blocking-for-fvm-calls
Open

fix: spawn_blocking for fvm calls#7184
hanabi1224 wants to merge 1 commit into
mainfrom
hm/spawn-blocking-for-fvm-calls

Conversation

@hanabi1224

@hanabi1224 hanabi1224 commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Summary of changes

Fvm calls are expensive and could exhaust tokio worker threads. Call them with spawn_blocking instead. Also update fn namings to end with _blocking when they're sync ones and invoking fvm.

Changes introduced in this pull request:

Reference issue to close (if applicable)

Closes

Other information and links

Change checklist

  • I have performed a self-review of my own code,
  • I have made corresponding changes to the documentation. All new code adheres to the team's documentation standards,
  • I have added tests that prove my fix is effective or that my feature works (if possible),
  • I have made sure the CHANGELOG is up-to-date. All user-facing changes should be reflected in this document.

Outside contributions

  • I have read and agree to the CONTRIBUTING document.
  • I have read and agree to the AI Policy document. I understand that failure to comply with the guidelines will lead to rejection of the pull request.

Summary by CodeRabbit

Release Notes

  • Refactor

    • Converted state validation and execution operations to use blocking-first architecture for improved CPU-bound performance
    • Restructured chain lookback computation to separate synchronous and asynchronous execution paths
    • Updated gas estimation to use shared ownership patterns for message collections
  • Bug Fixes

    • Enhanced error handling for async task failures with proper error context conversion

@hanabi1224 hanabi1224 added the RPC requires calibnet RPC checks to run on CI label Jun 17, 2026
@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 30740ff5-9676-40e3-93ad-8fadbd8c91c7

📥 Commits

Reviewing files that changed from the base of the PR and between d590f15 and 5bec774.

📒 Files selected for processing (18)
  • src/chain/store/chain_store.rs
  • src/chain/store/errors.rs
  • src/chain_sync/tipset_syncer.rs
  • src/daemon/mod.rs
  • src/fil_cns/validation.rs
  • src/interpreter/externs.rs
  • src/rpc/methods/eth.rs
  • src/rpc/methods/gas.rs
  • src/rpc/methods/miner.rs
  • src/state_manager/execution.rs
  • src/state_manager/message_simulation.rs
  • src/state_manager/mining.rs
  • src/state_manager/mod.rs
  • src/state_manager/state_computation.rs
  • src/tool/offline_server/server.rs
  • src/tool/subcommands/api_cmd/api_compare_tests.rs
  • src/tool/subcommands/archive_cmd.rs
  • src/tool/subcommands/snapshot_cmd.rs
 __________________________________
< Pulling the bugs out of the hat. >
 ----------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch hm/spawn-blocking-for-fvm-calls
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch hm/spawn-blocking-for-fvm-calls

Comment @coderabbitai help to get the list of available commands and usage tips.

@hanabi1224 hanabi1224 marked this pull request as ready for review June 17, 2026 14:17
@hanabi1224 hanabi1224 requested a review from a team as a code owner June 17, 2026 14:17
@hanabi1224 hanabi1224 requested review from LesnyRumcajs, akaladarshi and sudo-shashank and removed request for a team June 17, 2026 14:17
@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Caution

Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted.

Error details
{}

@codecov

codecov Bot commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 59.18367% with 60 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.38%. Comparing base (d590f15) to head (5bec774).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/rpc/methods/eth.rs 0.00% 13 Missing ⚠️
src/chain/store/chain_store.rs 57.69% 10 Missing and 1 partial ⚠️
src/state_manager/message_simulation.rs 77.27% 4 Missing and 6 partials ⚠️
src/state_manager/execution.rs 68.42% 5 Missing and 1 partial ⚠️
src/daemon/mod.rs 0.00% 4 Missing ⚠️
src/rpc/methods/miner.rs 0.00% 4 Missing ⚠️
src/chain/store/errors.rs 0.00% 3 Missing ⚠️
src/state_manager/state_computation.rs 66.66% 2 Missing and 1 partial ⚠️
src/tool/subcommands/snapshot_cmd.rs 0.00% 2 Missing ⚠️
src/interpreter/externs.rs 0.00% 1 Missing ⚠️
... and 3 more
Additional details and impacted files
Files with missing lines Coverage Δ
src/chain_sync/tipset_syncer.rs 63.27% <100.00%> (+0.24%) ⬆️
src/fil_cns/validation.rs 78.89% <100.00%> (+0.13%) ⬆️
src/rpc/methods/gas.rs 86.11% <100.00%> (+0.03%) ⬆️
src/state_manager/mod.rs 65.15% <ø> (ø)
src/interpreter/externs.rs 39.81% <0.00%> (ø)
src/state_manager/mining.rs 71.18% <80.00%> (+0.24%) ⬆️
src/tool/offline_server/server.rs 27.23% <0.00%> (ø)
src/tool/subcommands/archive_cmd.rs 29.66% <0.00%> (ø)
src/tool/subcommands/snapshot_cmd.rs 0.00% <0.00%> (ø)
src/chain/store/errors.rs 12.50% <0.00%> (-1.79%) ⬇️
... and 7 more

... and 6 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d590f15...5bec774. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

RPC requires calibnet RPC checks to run on CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant