ref-fvm icon indicating copy to clipboard operation
ref-fvm copied to clipboard

Create a Solidity/EVM smart contract benchmark suite

Open raulk opened this issue 2 years ago • 5 comments

We have several parallel streams that are benchmarking and optimizing the FEVM runtime from various vantage points:

  • @rllola is benchmarking CBOR serde from inside Solidity to eventually implement a Solidity library that enables easy interaction with built-in actors
  • @aakoshh is benchmarking storage reads and writes to replace the IPLD HAMT with an IPLD data structure better suited to EVM's map entry granularity: https://github.com/filecoin-project/ref-fvm/issues/859
  • @vyzo is generally optimizing the EVM interpreter, moved by the discoveries of @rllola

We are all producing Solidity and EVM contracts for benchmarking purposes, so I'd like to propose that we collect them in a benchmarking suite in a dedicated new repo.

raulk avatar Sep 09 '22 14:09 raulk

@maciejwitowski would love to hear your thoughts?

raulk avatar Sep 09 '22 14:09 raulk

I think collecting these contracts is definitely a great idea. Not sure about a dedicated repo though. If these are inputs for the FVM testing, why not keep them in ref-fvm as we keep other kinds of tests? We could add them to a dedicated top-level folder.

maciejwitowski avatar Sep 09 '22 15:09 maciejwitowski

Ref-fvm is agnostic to Ethereum, Solidity etc. It shouldn't be here. We can include it in builtin-actors EVM actor module.

maciejwitowski avatar Sep 12 '22 16:09 maciejwitowski

So I'm having second thoughts about this. We not only want to include benchmarks, but also test contracts for users to play with and deploy.

For example, I now have a fully operational (sans logs) ERC-20 token contract that is slighly modified from OpenZeppelin's ERC20.

This is not a benchmark, but it's example/demo code. Therefore, no longer limited to builtin-actors dev audience.

Furthermore, we'll also need build scripts to compile the Solidity into EVM, and form the initCode to construct an actor.

For these reasons, I'm tempted to put these contracts in the already existing (but barely used) repo: https://github.com/filecoin-project/fvm-example-actors/

raulk avatar Sep 13 '22 09:09 raulk

Ok, it seems the number of actors-related things we want to gather will be growing quickly. Looks like a separate repo is a good idea. I get 404 on https://github.com/filecoin-project/fvm-example-actors/ however. We can either open this one to public or create a new one, ideally more generic eg fvm-actors-resources.

maciejwitowski avatar Sep 13 '22 12:09 maciejwitowski

Repo was created. It's not used a lot but it's an ongoing effort. Closing this one for clarity of the work left. Please reopen if needed.

maciejwitowski avatar Oct 07 '22 12:10 maciejwitowski