Skip to content

Conversation

zees-dev
Copy link
Contributor

@zees-dev zees-dev commented Aug 26, 2025

Description

This PR fundamentally refactors the forc-node plugin architecture by embedding the Fuel Core node directly as an in-process library rather than spawning it as a subprocess.
This architectural change modernizes the forc-node plugin and lays the groundwork for advanced local development features.

🔄 Changes Overview

Core Architectural Changes

  • In-Process Execution: Fuel Core now runs within the same process as the plugin, eliminating subprocess management overhead
  • Direct Integration: Replaced subprocess spawning with direct library calls to fuel-core
  • Unified Logging: Consolidated logging and error handling across all execution modes
  • Improved Configuration: Enhanced configuration display and management for better debugging

Dependency Updates

  • Added direct fuel-core dependencies
  • Added fuel-core-chain-config for configuration management
  • Integrated tracing and tracing-subscriber for improved logging
  • Updated Cargo.lock with necessary transitive dependencies

💡 Motivation

Current Limitations

  • Subprocess management adds complexity and potential failure points
  • Limited ability to extend node functionality
  • Difficult to implement advanced features like state forking (planned feature)

Benefits of This Change

  1. Performance: Eliminates IPC overhead and reduces startup time
  2. Reliability: Direct function calls are more reliable than subprocess communication
  3. Extensibility: Easier to add advanced features in future PRs

Checklist

  • I have linked to any relevant issues.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation where relevant (API docs, the reference, and the Sway book).
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added (or requested a maintainer to add) the necessary Breaking* or New Feature labels where relevant.
  • I have done my best to ensure that my PR adheres to the Fuel Labs Code Review Standards.
  • I have requested a review from the relevant team or maintainers.

@zees-dev zees-dev self-assigned this Aug 26, 2025
@zees-dev zees-dev requested review from a team as code owners August 26, 2025 04:37
@zees-dev zees-dev added forc forc-client Everything related to the `forc-client` crate. forc-node Everything related to forc-node, bootstrapping a fuel-core node labels Aug 26, 2025
@zees-dev zees-dev force-pushed the refactor/forc-node-as-lib branch from 95c5f96 to 3f3401b Compare September 2, 2025 23:51
@JoshuaBatty JoshuaBatty requested a review from a team September 3, 2025 23:50
@zees-dev zees-dev enabled auto-merge (squash) September 4, 2025 05:00
@zees-dev zees-dev merged commit 1f9880f into master Sep 4, 2025
39 checks passed
@zees-dev zees-dev deleted the refactor/forc-node-as-lib branch September 4, 2025 05:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
forc forc-client Everything related to the `forc-client` crate. forc-node Everything related to forc-node, bootstrapping a fuel-core node
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants