Skip to content

Commit 162ed58

Browse files
authored
Merge pull request #137 from fluentlabs-xyz/feat/fluentbase-architecture
docs: rewrite system architecture section
2 parents eb15797 + 1164ee2 commit 162ed58

27 files changed

Lines changed: 2494 additions & 122 deletions

docs/contribute.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Contribute
3-
sidebar_position: 10
3+
sidebar_position: 13
44
---
55

66
Welcome Contributors! 🎉
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"label": "Developer Guides",
3-
"position": 5,
3+
"position": 6,
44
"collapsed": true
55
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"label": "Fluentbase SDK",
3-
"position": 4,
3+
"position": 5,
44
"collapsed": true
55
}

docs/gblend/_category_.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"label": "Gblend",
3-
"position": 3,
3+
"position": 4,
44
"collapsed": false
55
}

docs/get-started.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ The main audience for this documentation are smart contract developers deploying
3838
</a>
3939
</td>
4040
<td>
41-
<a href="knowledge-base/fluent-overview">
41+
<a href="system-architecture/overview">
4242
<strong>Study the Tech</strong>
4343
<span>Dive deep into rWasm and blended execution architecture.</span>
4444
</a>
@@ -55,7 +55,7 @@ The main audience for this documentation are smart contract developers deploying
5555
<strong>Developer Guides</strong>
5656
<span>Deploy blended apps in minutes. Rust ↔ Solidity made simple.</span>
5757
</a>
58-
<a href="knowledge-base/fluent-overview">
58+
<a href="system-architecture/overview">
5959
<strong>Study the Tech</strong>
6060
<span>Dive deep into rWasm and blended execution architecture.</span>
6161
</a>

docs/glossary.md

Lines changed: 51 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Glossary
3-
sidebar_position: 8
3+
sidebar_position: 11
44
---
55

66
# Glossary
@@ -11,23 +11,63 @@ Fluent's rWasm (reduced WebAssembly) virtual machine (VM) is a versatile VM that
1111

1212
This allows for atomically composable apps using distinct programming language(s) and standards on a shared state execution environment. Each supported EE compiles to rWasm for execution, which employs a fully compatible Wasm binary representation optimized for zero-knowledge (zk) operations.
1313

14+
## rWasm
15+
16+
rWasm (reduced WebAssembly) is Fluent's execution substrate. It is a simplified, deterministic subset of the Wasm binary format, designed so every program running on Fluent — from ordinary smart contracts to the runtimes that execute other VMs on top of it — can be proven under zero-knowledge without the full complexity of standard Wasm.
17+
18+
Where standard Wasm is optimized for fast execution in browsers and servers, rWasm is optimized for verifiability. Memory semantics are stricter, trap behaviour is deterministic, and engine-metered fuel replaces ad-hoc gas accounting. EVM bytecode runs under rWasm through a delegated runtime; native Wasm contracts map to it directly; future VM integrations follow the same pattern.
19+
20+
For most developers rWasm is invisible — you write Solidity or Rust, deploy, and the runtime router picks the right execution path. It becomes visible at the edges: when querying raw account data for a proof, when reasoning about fuel versus gas, or when auditing the boundary between runtime and host. See [Architecture Overview](system-architecture/overview.md).
21+
1422
## The Fluent L2
1523

1624
The Fluent L2 is an Ethereum-centric zk-rollup for Wasm, EVM, and SVM based apps. It supports real-time composability between apps targeting different VMs, and "blended" apps composed of smart contracts mixed and matched between them. Interaction between the different types of contracts on the L2 happens under the hood and is both atomic and happens in real-time.
1725

1826
## The Fluentbase Framework
1927

20-
The Fluentbase framework is used to deploy smart contracts on Fluent as well as blockchains and verifiable compute environments that compile to rWasm. The frameworks execution layer supports arbitrary compute and the emulation of multiple VM targets.
28+
The Fluentbase framework is used to deploy smart contracts on Fluent as well as blockchains and verifiable compute environments that compile to rWasm. The framework's execution layer supports arbitrary compute and the emulation of multiple VM targets.
2129

2230
Fluentbase is optimized for proving efficiency and integrates with modular components (sequencers, DA layers, etc.) for the deployment of customizable blended execution networks.
2331

32+
## Ownable Account
33+
34+
An ownable account is how Fluent attaches execution logic to an account without storing runtime bytecode inside every account that uses it. Every contract on Fluent lives in an account whose code field is a small wrapper carrying a magic header, an `owner_address` pointing to a delegated runtime, and runtime-specific metadata. When the account is called, REVM loads the executable code from the owner, not from the account itself — while keeping the original account as the storage target.
35+
36+
This separation — account identity is local, execution logic is delegated — is what lets one state machine host EVM, Wasm, and SVM contracts together. A Solidity contract and a Rust contract end up as two ownable accounts pointing at two different delegated runtimes. They share the state trie, can call each other atomically, and the host mediates every privileged operation between them with the same rules.
37+
38+
Ownership is set at deployment time based on the init code's magic prefix, and it cannot change afterwards — the account's execution class is part of its identity. See [Runtime Routing and Ownable Accounts](system-architecture/runtime-routing-and-ownable-accounts.md).
39+
40+
## Delegated Runtime
41+
42+
A delegated runtime is the execution code that an ownable account points at. Each supported VM family has its own: the delegated EVM runtime executes EVM bytecode, the delegated Wasm runtime executes Wasm, the Universal Token runtime implements a shared token surface, and future runtimes (like SVM) plug in the same way.
43+
44+
Delegated runtimes are protocol-owned: their bytecode lives at fixed system addresses, is installed and replaced through a governed upgrade path, and is shared by every account that opts into its execution class. A bug fix or behaviour change in the delegated EVM runtime affects every EVM contract on Fluent at once — which is why runtime upgrades are treated as fork-critical change management.
45+
46+
Delegated runtime addresses are not callable directly as normal contracts; the router blocks that path to keep user flows going through ownable-account semantics. See [Runtime Upgrade](system-architecture/runtime-upgrade.md).
47+
48+
## Interruption Protocol
49+
50+
The interruption protocol is the mechanism through which every privileged operation on Fluent is performed. Runtime code cannot touch shared state directly — when a contract needs to read storage, emit a log, spawn a nested call, or do anything else that affects state outside its own memory, it yields control to the host. The host performs the operation, validates it against protocol rules, and resumes the runtime from the saved execution point.
51+
52+
The handshake has two verbs: `exec` starts or resumes a runtime frame with a fuel budget, and `resume` hands control back after a privileged action. A positive exit code from the runtime is a `call_id` — a handle into a saved resumable context — not a final status. The host uses this protocol to keep consensus-critical rules (ordering, charging, validation) in one place while allowing multiple runtime families to coexist on top.
53+
54+
See [Interruption and Syscalls](system-architecture/interruption-and-syscalls.md) for the full handshake, syscall surfaces, and safety boundaries.
55+
56+
## Fuel
57+
58+
Fuel is Fluent's internal unit of runtime execution accounting. Where gas tracks EVM-visible economics — the same unit wallets quote, explorers display, and transactions pay in ETH — fuel meters the underlying rWasm work: every runtime step, every syscall, every host operation is charged in fuel.
59+
60+
Gas and fuel are linked by a fixed deterministic conversion ratio (`FUEL_DENOM_RATE = 20`: each gas unit buys 20 fuel). At the start of a call the host derives a fuel budget from the remaining gas; when the runtime returns, any consumed or refunded fuel is translated back into gas settlement. Rounding behaviour at the conversion boundary is part of consensus correctness — every node performs it identically.
61+
62+
For most smart contract development, fuel is invisible. It matters if you are writing a gas estimator, building a custom runtime, or auditing privileged charging paths. See [Gas and Fuel](system-architecture/gas-and-fuel.md).
63+
2464
## Virtual Machine (VM)
2565

2666
A virtual machine (VM) in the context of blockchains is a sandbox environment that executes smart contracts. Examples include the Ethereum Virtual Machine (EVM) and the Solana Virtual Machine (SVM).
2767

2868
## Execution Environment (EE)
2969

30-
The execution environment (EE) refers to the entire system where blockchain transactions are processed. It encompasses the state transition function (STF) of a protocol, which includes the virtual machine (VM) and additional protocol-specific checks and balances necessary for the networks operation.
70+
The execution environment (EE) refers to the entire system where blockchain transactions are processed. It encompasses the state transition function (STF) of a protocol, which includes the virtual machine (VM) and additional protocol-specific checks and balances necessary for the network's operation.
3171

3272
These checks may involve gas calculations, nonce verification, and balance updates to ensure the proper execution of transactions.
3373

@@ -41,6 +81,14 @@ This allows developers to leverage the best features and tools from various VMs
4181

4282
Zk-rollups are blockchain-based execution environments that post compressed data to the same onchain data availability network as the one responsible for verifying its cryptographic proofs. Proofs are examined and validated by a "verifier," which cryptographically ensures the integrity of all transactions.
4383

84+
## Preconfirmation
85+
86+
Preconfirmation is the fast-finality step in Fluent's rollup pipeline. After a sequencer commits a batch and publishes its data to L1, a trusted-execution-environment (TEE) verifier — an AWS Nitro enclave whose signing key is cryptographically bound to a specific enclave image via an SP1-verified attestation — signs the batch root. This signed batch reaches the Preconfirmed state on the rollup contract well before the challenge window elapses, giving users a rapid execution attestation they can trust operationally.
87+
88+
Preconfirmation is not the same as finalization. A preconfirmed batch is still challengeable; if a successful challenge proves it wrong, the batch can be reverted. Finalization happens later — either after a delay window without unresolved challenges, or immediately once all block commitments have been cryptographically proven.
89+
90+
This distinction matters for the bridge: L2 → L1 withdrawals from a preconfirmed-but-not-finalized batch enter an optimistic path guarded by a per-token rate cap. Finalized withdrawals are unrestricted. See [Rollup Architecture](system-architecture/rollup-architecture.md).
91+
4492
## Wasm
4593

4694
Wasm (WebAssembly) is a low-level, portable binary format and compilation target for high-level programming languages. General-purpose programming languages, such as Rust, TypeScript, and C++ compile to Wasm.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"label": "Infrastructure",
3-
"position": 6,
3+
"position": 7,
44
"collapsed": true
55
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"label": "Knowledge Base",
3-
"position": 7,
3+
"position": 8,
44
"collapsed": true
55
}

docs/resources.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Resources
3-
sidebar_position: 9
3+
sidebar_position: 12
44
---
55
Awesome Fluent Resources
66
---
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"label": "System Architecture",
3+
"position": 3,
4+
"collapsed": false
5+
}

0 commit comments

Comments
 (0)