Filecoin EVM Runtime (FEVM) #592
Replies: 6 comments 42 replies
-
FEVM interacts with native method numbers in two ways:
Proposal: Restrict FEVM method numbers to 32 bits. Filecoin itself supports 64bit method numbers, but method numbers > 32 bits aren't currently used. If we ever want to restrict these method numbers, now is the time. Motivation:
I have no strong motivation for this, but we do need to make a decision. |
Beta Was this translation helpful? Give feedback.
-
I noticed that some things (like CALL) treat built-in account actors as special. I don't think this is a good idea as it will cripple future account abstraction efforts. With good account abstraction there isn't really a meaning to whether an actor "is an account" – many actors codes will be able to originate messages, and through code upgrades this might even be dynamic. Treating built-in accounts differently will make it difficult for "abstract" accounts to play on the same level ("scare quotes" because I would like to reach a point where there's literally no technical distinction between the built-in account actor and other accounts). I infer from the FIP that the EVM actor is using the What's the reasoning for these decision, and can we change them? |
Beta Was this translation helpful? Give feedback.
-
Related to the above, what's the motivation for the get_actor_type precompile 😱? The main reason we haven't rushed to deprecate these syscalls sooner is that their use is constrained and we can prevent adding more callers. Exposing it here will lock it in forever, along with the need to support its function as built-in actors change, are ejected from built-ins etc. There's usually a different, better way to achieve whatever the goal is behind using that syscall. |
Beta Was this translation helpful? Give feedback.
-
Method 0Currently, EVM contracts accept funds without running code on method 0. Unfortunately, this could turn into a potential footgun if a user sends funds to a smart contract on method-0 (e.g., due to some tooling) and expects that smart contract to run some code to, e.g., credit the user's account. ProposalProvide a way to disable accepting funds on method 0. Specifically:
This proposal will add exactly one byte to every actor state-root (until we have more than 5 flags), so it shouldn't have a large impact. Alternatives
Future UsesIn the future, native actors can use this feature to strictly control the funds they can accept (e.g., to prevent dusting). Furthermore, I expect we'll find additional uses for this bitfield (e.g., to opt into new features/semantics). |
Beta Was this translation helpful? Give feedback.
-
Bare sends and codeContextEVM smart contracts run code on bare value transfers. This code can REVERT to reject the transfer, log an event, query storage. Solidity provides a gas stipend of 2300 when calling Current design
Product impact evaluationOrigin: external transactions from Ethereum walletsEth JSON-RPC always sets Method = InvokeEVM.
Origin: Filecoin wallets and other Filecoin-aware origins (e.g. exchanges)Can specify an arbitrary method number
Origin: internal sends from EVM smart contractsThrough CALL opcodes and call_actor precompiles.
Origin: from built-in actorsCalling into EVM smart contracts or EthAccounts/Placeholders.
Summary of product caveatsToday:
|
Beta Was this translation helpful? Give feedback.
-
What is the timestamp that clients should supply when creating an FVM to execute over a null round? The FIP says it should be the Can we confirm this, and maybe make it explicit in the FIP? |
Beta Was this translation helpful? Give feedback.
-
Original proposer: @Stebalien @raulk
Simple Summary
We introduce a new built-in actor: the Filecoin EVM (FEVM) runtime actor, capable of running EVM smart contracts on top of the Filecoin Virtual Machine.
We also introduce various changes to the Filecoin Virtual Machine and to client implementations, necessary to support the operation of this new actor.
Abstract
The Filecoin EVM (FEVM) runtime built-in actor runs EVM smart contracts compatible with the [Ethereum Paris fork].
It achieves this by embedding a special-purpose EVM interpreter, implementing the integration logic with the Filecoin environment, translating environment-dependent opcodes into their corresponding Filecoin primitives, and mapping all state I/O to the underlying IPLD model.
The EVM interpreter strives for maximal as-is portability. To such avail, it The EVM interpreter supports all required opcodes and Ethereum precompiles to strive for maximal portability.
Functional and technical departures from Ethereum's standard expectations are documented herein.
The FEVM runtime actor motivates some changes in the FVM.
Syscalls are modified, syscalls are added, new environmental data is required, and new exit codes are created.
The concept of a TipsetCID is also introduced formally, and is of required implementation by clients.
This FIP is dependent on [FIP-0048] (f4 address class), [FIP-0049] (Actor events), and [FIP-0055] (Supporting Ethereum Accounts, Addresses, and Transactions).
Change Motivation
A basic requirement to achieve EVM compatibility is to be able to run EVM smart contracts.
Given the inability to deploy user-defined Wasm actors (arriving at a later stage of the FVM roadmap), we introduce this capability by adding a new built-in actor to the network.
This actor is accompanied by FVM and client changes necessary for functional completeness.
Specs
For more technical details, please see https://github.com/filecoin-project/FIPs/pull/569/files.
Feedback & questions are welcomed in this discussion!
Beta Was this translation helpful? Give feedback.
All reactions