Skip to content
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

Fluffy and the EVM #1162

Open
kdeme opened this issue Jul 13, 2022 · 5 comments
Open

Fluffy and the EVM #1162

kdeme opened this issue Jul 13, 2022 · 5 comments

Comments

@kdeme
Copy link
Contributor

kdeme commented Jul 13, 2022

While a functional state network in Portal is still far away, we can already investigate how easy it is to link the EVM code to Fluffy.
This task is about investigating how convenient it is to add current EVM functionality to Fluffy.
No input needs to come from the network (there isn't one), it is rather to see of we can just drop in the EVM in Fluffy in its current state.

@kdeme kdeme added the Fluffy label Jul 13, 2022
@mratsim
Copy link
Contributor

mratsim commented Jul 13, 2022

Ideally, fluffy just uses the EVMC API ( https://github.com/status-im/nim-evmc ) so that it's easier to spec alternative Portal Network implementations.

@web3-developer web3-developer self-assigned this Jun 13, 2024
@web3-developer
Copy link
Contributor

This task is no longer required because the current plan is to connect the Fluffy state bridge to a running execution client. This would be required to keep up with the latest state changes for the latest blocks and therefore we don't need to run the EVM inside the Fluffy bridge. We will likely call trace_replayBlockTransactions to get the stateDiffs for each block from the Fluffy bridge in order to collect the state changes.

@web3-developer web3-developer removed their assignment Jul 5, 2024
@kdeme
Copy link
Contributor Author

kdeme commented Jul 5, 2024

While not core functionality of a pure Portal node, when we want to build a light client with full EL JSON-RPC API, we will need the EVM to execute certain txs (e.g. for estimateGas)?

@web3-developer
Copy link
Contributor

Yes, you are right we would need the EVM for the following endpoints which are listed as part of the portal network spec:
eth_call
eth_estimateGas

Thanks for the reminder. I was thinking about the state bridge when closing this task. I'm going to reopen it with the goal of including the Nimbus EVM in Fluffy at some point.

@web3-developer
Copy link
Contributor

web3-developer commented Jul 6, 2024

Ideally we should pull out the Nimbus EVM into a separate library that we can then import into Fluffy either directly or using nim-evmc.

The database layer would need to be swapped out in order to get the data from the portal state network. In order to do this, I believe we should aim to make the Nimbus EVM more modular. I would suggest that we decouple the account ledger and database from the layers above by defining interfaces between them. We could then create another implementation of the state or database layer for the portal network.

For example we could have interfaces:
EVM executor -> state interface -> database interface

In Nimbus we have something like this:
EVM executor -> accounts ledger -> rocksdb

After creating interfaces Fluffy look something like:
EVM executor -> state interface -> portal state network

Revm has a modular architecture which we could get some inspiration from.
See the documentation for the revm state and database layers here:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants