Skip to content

Commit 1f9880f

Browse files
zees-devJoshuaBattykayagokalp
authored
refactor: forc-node as lib (#7353)
## 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). - [ ] If my change requires substantial documentation changes, I have [requested support from the DevRel team](https://github.com/FuelLabs/devrel-requests/issues/new/choose) - [ ] 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](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md). - [ ] I have requested a review from the relevant team or maintainers. --------- Co-authored-by: z <zees-dev@users.noreply.github.com> Co-authored-by: Joshua Batty <joshpbatty@gmail.com> Co-authored-by: kaya <20915464+kayagokalp@users.noreply.github.com>
1 parent 6d47ca5 commit 1f9880f

File tree

14 files changed

+3917
-517
lines changed

14 files changed

+3917
-517
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ jobs:
232232
uses: dtolnay/rust-toolchain@master
233233
with:
234234
toolchain: ${{ env.RUST_VERSION }}
235+
targets: wasm32-unknown-unknown
235236
- uses: buildjet/cache@v3
236237
with:
237238
path: |
@@ -339,6 +340,7 @@ jobs:
339340
uses: dtolnay/rust-toolchain@master
340341
with:
341342
toolchain: ${{ env.RUST_VERSION }}
343+
targets: wasm32-unknown-unknown
342344
- uses: Swatinem/rust-cache@v2
343345
with:
344346
cache-provider: "buildjet"
@@ -356,6 +358,7 @@ jobs:
356358
with:
357359
toolchain: ${{ env.RUST_VERSION }}
358360
components: clippy
361+
targets: wasm32-unknown-unknown
359362
- uses: Swatinem/rust-cache@v2
360363
with:
361364
cache-provider: "buildjet"
@@ -745,6 +748,7 @@ jobs:
745748
with:
746749
# `cargo-udeps` requires nightly to run
747750
toolchain: ${{ env.NIGHTLY_RUST_VERSION }}
751+
targets: wasm32-unknown-unknown
748752
- uses: Swatinem/rust-cache@v2
749753
with:
750754
cache-provider: "buildjet"

0 commit comments

Comments
 (0)