-
Notifications
You must be signed in to change notification settings - Fork 166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FIP-0054: Filecoin EVM runtime (FEVM) #569
Conversation
Hi @raulk - is there a timeline for completion of the initial draft? |
FIPS/fip-nnnn-evm-compatibility.md
Outdated
@@ -0,0 +1,1079 @@ | |||
--- | |||
fip: <to be assigned> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0054
I am proactively assigned FIP number to this draft, FIP0054, for nv18 upgrade project management purposes. @filecoin-project/fips-editors |
b3c7516
to
45259e9
Compare
FIPS/fip-nnnn-eam-eeoa.md
Outdated
These addresses begin with `f410` in textual form. | ||
EVM smart contracts deployed through the EAM acquire an `f410` address. | ||
|
||
The **Ethereum Externally Owned Account (EEOA)** actor represents Ethereum identities backed by secp256k1 keys. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i thought we agreed on EthAccount (no more EEOA)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I learnt about the rename recently, and I agree with the motivation. It is already updated, but I think you added this comment before I pushed my latest changes.
FIPS/fip-0054.md
Outdated
// Values are encoded as DAG-CBOR byte strings. | ||
ActorEvent { | ||
entries: [ | ||
(0x03, "topic1", <first topic word>), // when LOG1, LOG2, LOG3, LOG4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the current code all entries have flag 0x02
. Should FIP or code be changed?
FIPS/fip-0054.md
Outdated
/// CID of the EVM bytecode to invoke under self's context. | ||
pub code: Cid, | ||
/// The contract invocation parameters | ||
pub input: Vec<u8>, // encoded as a DAG-CBOR byte string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI there has been a caller
field added to this struct https://github.com/filecoin-project/builtin-actors/blob/next/actors/evm/src/lib.rs#L353
aa10432
to
f99bd54
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I have a big discussion item to raise about the privileged treatment of built-in account actors, and assuming they are similar to Ethereum account actors. I will await resolution of which discussion thread to post this (I'm not sure #244 is appropriate).
FIPS/fip-0054.md
Outdated
|
||
**Calls: `CALL`.** | ||
Performs a call to another actor, behaving differently depending on the target's actor type. | ||
If the target is another EVM smart contract or a non-account Wasm actor, it invokes its `InvokeContract` method (2). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you be more specific about how it is determined whether the target is an EVM smart contract or an account?
- For EVM, I guess you check the code CID. Note that this won't work with user-deployed improved EVM actors in the future
- For "non-account", this distinction will disappear with account abstraction. I strongly suggest not treating "account" actors specially, even now, lest we add friction.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, matching against the actor type for the code CID of the callee (actor::get_builtin_actor_type
and actor::get_actor_code_cid
syscalls).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussion continued in #592 (comment).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will specify how we do it today, but let's continue discussing potential changes in that thread?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll make a pass at fixing these myself, just wanted to get them recorded.
|
||
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should probably comment on why the EVM first.
(and document PUSH0)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looks pretty good to me, left some comments.
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).