From 572d461d961dc66a91ec6b8e274c9215b0c7ba35 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Thu, 12 Sep 2024 16:06:29 -0700 Subject: [PATCH 1/7] Move FIP-0030 to Final This has since been shipped in the network, but the FIP language makes it sound like native Wasm smart contracts are supported. This patch updates the FIP to make it clear that native Wasm smart contracts were not implemented. --- FIPS/fip-0030.md | 49 ++++++++---------------------------------------- 1 file changed, 8 insertions(+), 41 deletions(-) diff --git a/FIPS/fip-0030.md b/FIPS/fip-0030.md index 8706000fe..d15ef234c 100644 --- a/FIPS/fip-0030.md +++ b/FIPS/fip-0030.md @@ -3,7 +3,7 @@ fip: "0030" title: Introducing the Filecoin Virtual Machine (FVM) authors: Raúl Kripalani (@raulk), Steven Allen (@stebalien) discussions-to: https://github.com/filecoin-project/FIPs/discussions/287 -status: Draft +status: Final type: Technical Core category: Core created: 2022-01-26 @@ -94,7 +94,7 @@ FIP, and will be addressed by subsequent proposals. ## Abstract We specify the Filecoin Virtual Machine (FVM), an IPLD-ready Wasm-based -execution layer capable of running arbitrary user-provided code. The FVM +execution layer capable of running arbitrary code. The FVM replaces the [existing non-programmable execution layer][Specs/Legacy-VM], now termed _Legacy VM_. @@ -284,10 +284,6 @@ The contract consists of: through some governance process, in order to reduce actor bytecode size (e.g. FVM SDKs, IPLD codecs, etc). -Because this contract may change over time, user-deployed actors may specify an -IC version at [`InitActor#InstallActor` time](#actor-deployment). The strategy -for deprecating IC versions over time has not been yet determined. - #### Syscalls Syscalls are functions made available to the actor as Wasm imports, allowing it @@ -354,6 +350,8 @@ This approach has a few practical implications: ##### Native user-defined actors Native user-defined actors are actors written specifically for the FVM runtime. +Such actors will not be deployable for the time-being due to unresolved security +considerations, but they will likely be supported eventually. Users can _technically_ write native user-defined actors in any programming language that compiles to Wasm. However, language-specific overheads (e.g. @@ -438,42 +436,11 @@ pub struct ActorState { #### Actor deployment -The current `InitActor` (`f00`) will be extended with a (`InstallActor`) method -taking a single input parameter: the actor's Wasm bytecode. As mentioned above, -DAG representation format is to be defined. The actor's Wasm bytecode must -specify the version of the Invocation Container the bytecode requires, inside a -reserved exported global. - -The state object of the `InitActor` will be extended with an `ActorRegistry` -HAMT of `CID => ActorSpec`, where `ActorSpec` is: - -```rust -/// A simple actor specification/metadata structure, to be extended with -/// additional metadata in the future. -struct ActorSpec { - /// The version of the invocation container. - version: int, -} -``` +For the time-being, all wasm-based actors are built-in and user's cannot deploy custom +Wasm actors to Filecoin mainnet. New wasm-based actors are deployed during network +upgrades. -The logic of `InitActor#LoadActor` is as follows. - -1. Validate the Wasm bytecode. - - Perform syntax validation and structural validation, [as per standard](https://webassembly.github.io/spec/core/valid/index.html). - - No floating point instructions. -2. Multihash the bytecode and calculate the code CID. -3. Check if the code CID is already registered in the `ActorRegistry`. -4. If yes, charge gas for the above operations and return the existing CID. -5. Insert an entry in the `ActorRegistry`, binding the bytecode CID with the - actor spec. -6. Return the CID, and charge the cost of the above operations, and potentially - a price for rent/storage. - -At this point, the actor can be instantiated many times through the standard -`InitActor#Exec` method. Parameters provided will be passed through to the -actor's constructor (currently identified by `method_number=1`). This includes -byte streams corresponding to deployables for foreign actors (e.g. EVM -bytecode). +Users can deploy custom EVM-based smart contracts using FEVM (see [FIP-0054](https://github.com/filecoin-project/FIPs/blob/master/FRCs/frc-0042.md)). #### Actor message dispatch From f1af220aabaf8785cf79c240f0fc9c64cd471673 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Thu, 12 Sep 2024 16:07:31 -0700 Subject: [PATCH 2/7] Move FIP-0031 to Final --- FIPS/fip-0031.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FIPS/fip-0031.md b/FIPS/fip-0031.md index 1bf4a45f4..074521c99 100644 --- a/FIPS/fip-0031.md +++ b/FIPS/fip-0031.md @@ -3,7 +3,7 @@ fip: "0031" title: Atomic switch to non-programmable FVM authors: Raúl Kripalani (@raulk), Steven Allen (@stebalien) discussions-to: https://github.com/filecoin-project/FIPs/discussions/296 -status: Draft +status: Final type: Technical Core category: Core created: 2022-02-03 From 8adc4cb9647bed87fa1aa2612150b2fa8dd6165d Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Thu, 12 Sep 2024 16:08:04 -0700 Subject: [PATCH 3/7] Move FIP-0032 to Final --- FIPS/fip-0032.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/FIPS/fip-0032.md b/FIPS/fip-0032.md index dc2a6388d..cb69bf2e1 100644 --- a/FIPS/fip-0032.md +++ b/FIPS/fip-0032.md @@ -3,7 +3,7 @@ fip: "0032" title: Gas accounting model adjustment for non-programmable FVM author: Raúl Kripalani (@raulkr), Steven Allen (@stebalien), Jakub Sztandera (@Kubuxu) discussions-to: https://github.com/filecoin-project/FIPs/discussions/316 -status: Draft +status: Final type: Technical category: Core created: 2022-03-08 @@ -626,4 +626,4 @@ Copyright and related rights waived via [FIP-0008]: https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0008.md [FIP-0013]: https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0013.md [FIP-0030]: https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0030.md -[FIP-0031]: https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0031.md \ No newline at end of file +[FIP-0031]: https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0031.md From 03c4c67b4002d67122d345450ac09eef7632003a Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Thu, 12 Sep 2024 16:12:05 -0700 Subject: [PATCH 4/7] Withdraw FIP-0037 This FIP was replaced by FIP-0054 and FIP-0057. --- FIPS/fip-0037.md | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/FIPS/fip-0037.md b/FIPS/fip-0037.md index 737eed1f6..042643ced 100644 --- a/FIPS/fip-0037.md +++ b/FIPS/fip-0037.md @@ -3,7 +3,7 @@ fip: "0037" title: Gas model adjustment for for user programmability author: Raúl Kripalani (@raulk), Steven Allen (@stebalien) discussions-to: https://github.com/filecoin-project/FIPs/discussions/316 -status: Draft +status: Withdrawn type: Technical category: Core created: 2022-03-09 diff --git a/README.md b/README.md index 899e8c22b..2a113bf4a 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ This improvement protocol helps achieve that objective for all members of the Fi | [0034](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0034.md) | Fix pre-commit deposit independent of sector content | FIP | @anorth, @Kubuxu | Final | | [0035](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0035.md) | Support actors as built-in storage market clients | FIP | @anorth | Withdrawn | | [0036](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0036.md) | Introducing a Sector Duration Multiple for Longer Term Sector Commitment | FIP | @AxCortesCubero, @jbenet, @misilva73, @momack2, @tmellan, @vkalghatgi, @zixuanzh | Rejected | -| [0037](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0037.md) | Gas model adjustment for user programmability | FIP | @raulk, @stebalien | Draft | +| [0037](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0037.md) | Gas model adjustment for user programmability | FIP | @raulk, @stebalien | Withdrawn | | [0038](https://github.com/filecoin-project/FIPs/blob/master/FRCs/frc-0038.md) | Indexer Protocol for Filecoin Content Discovery | FRC | @willscott, @gammazero, @honghaoq | Draft | | [0039](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0039.md) | Filecoin Message Replay Protection | FIP | @q9f | Draft | | [0040](https://github.com/filecoin-project/FIPs/blob/master/FRCs/frc-0040.md) | Boost - Filecoin Storage Deals Market Protocol | FRC | @dirkmc, @nonsense, @jacobheun, @brendalee | Draft | From 3b45b1c07a5a608c7a08bbf032f39de4918db3b7 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Thu, 12 Sep 2024 16:13:05 -0700 Subject: [PATCH 5/7] Move FIP-0054 and FIP-0057 to Final These were both implemented as a part of FEVM --- FIPS/fip-0054.md | 2 +- FIPS/fip-0057.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/FIPS/fip-0054.md b/FIPS/fip-0054.md index 91fe1c1fb..5fd8a7be5 100644 --- a/FIPS/fip-0054.md +++ b/FIPS/fip-0054.md @@ -3,7 +3,7 @@ fip: "0054" title: Filecoin EVM runtime (FEVM) author: Raúl Kripalani (@raulk), Steven Allen (@stebalien) discussions-to: https://github.com/filecoin-project/FIPs/discussions/592 -status: Accepted +status: Final type: Technical Core category: Core created: 2022-12-02 diff --git a/FIPS/fip-0057.md b/FIPS/fip-0057.md index 9234cf1c9..0536e4449 100644 --- a/FIPS/fip-0057.md +++ b/FIPS/fip-0057.md @@ -3,7 +3,7 @@ fip: "0057" title: Update gas charging schedule and system limits for FEVM author: Steven Allen (@stebalien), Raúl Kripalani (@raulk), Akosh Farkash (@aakoshh), Jakub Sztandera (@Kubuxu) discussions-to: https://github.com/filecoin-project/FIPs/discussions/588 -status: Accepted +status: Final type: Technical Core category (*only required for Standard Track): Core created: 2022-12-12 From 41b7b05ae24b82555a87d79726607c6eac80289e Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Fri, 13 Sep 2024 01:48:02 +0000 Subject: [PATCH 6/7] fix url Co-authored-by: Adrian Lanzafame --- FIPS/fip-0030.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FIPS/fip-0030.md b/FIPS/fip-0030.md index d15ef234c..a0c827eca 100644 --- a/FIPS/fip-0030.md +++ b/FIPS/fip-0030.md @@ -440,7 +440,7 @@ For the time-being, all wasm-based actors are built-in and user's cannot deploy Wasm actors to Filecoin mainnet. New wasm-based actors are deployed during network upgrades. -Users can deploy custom EVM-based smart contracts using FEVM (see [FIP-0054](https://github.com/filecoin-project/FIPs/blob/master/FRCs/frc-0042.md)). +Users can deploy custom EVM-based smart contracts using FEVM (see [FIP-0054](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0054.md)). #### Actor message dispatch From 863e171b53ae2d91be2e54393813740153c76b71 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Mon, 16 Sep 2024 11:45:56 +0000 Subject: [PATCH 7/7] Apply suggestions from code review Co-authored-by: Jorge M. Soares <547492+jsoares@users.noreply.github.com> --- FIPS/fip-0030.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/FIPS/fip-0030.md b/FIPS/fip-0030.md index a0c827eca..89ecd5bc3 100644 --- a/FIPS/fip-0030.md +++ b/FIPS/fip-0030.md @@ -351,7 +351,7 @@ This approach has a few practical implications: Native user-defined actors are actors written specifically for the FVM runtime. Such actors will not be deployable for the time-being due to unresolved security -considerations, but they will likely be supported eventually. +considerations. Users can _technically_ write native user-defined actors in any programming language that compiles to Wasm. However, language-specific overheads (e.g. @@ -436,8 +436,8 @@ pub struct ActorState { #### Actor deployment -For the time-being, all wasm-based actors are built-in and user's cannot deploy custom -Wasm actors to Filecoin mainnet. New wasm-based actors are deployed during network +For the time-being, all Wasm-based actors are built-in and users cannot deploy custom +Wasm actors to Filecoin mainnet. New Wasm-based actors are deployed during network upgrades. Users can deploy custom EVM-based smart contracts using FEVM (see [FIP-0054](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0054.md)).