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

Refactor integration tests to use abstract VM trait #1236

Closed
4 tasks done
anorth opened this issue Mar 2, 2023 · 1 comment
Closed
4 tasks done

Refactor integration tests to use abstract VM trait #1236

anorth opened this issue Mar 2, 2023 · 1 comment
Assignees
Labels

Comments

@anorth
Copy link
Member

anorth commented Mar 2, 2023

The built-in actors have a collection of integration tests that run against a fake FM (test_vm.VM). This fake VM executes the Rust code natively, rather than a WASM build of it, and is thus invaluable for introspection and debugging. These integration tests are a critical part of built-in actor development, and so do belong in this repo.

One downside of the fake VM approach is that it can't replicate the gas consumption of execution. Gas consumption is an important part of the actors' behaviour, and in the past we have been unable to quantify it during development due to lack of tooling (filecoin-project/ref-fvm#1080). As such tooling emerges (e.g. https://github.com/anorth/fvm-workbench) it would be beneficial to be able to use it to track gas impacts of changes to built-in actors. A worthy target, which this issue enables, would be to regularly run all our existing integration tests on a real FVM and thus understand and monitor the gas impacts of changes. We can do this if we refactor them a little to execute in terms of an abstract VM (which could be either the fake VM or a real FVM).

  • Extract a trait from the fake VM including the core message execution methods, as well as state inspection
  • Refactor integration tests to be in the form of a method that takes an initialised VM (with genesis state) as a parameter, plus a top level #[test] entry point that instantiates the fake VM
  • Refactor and align the extracted trait to match the API from https://github.com/anorth/fvm-workbench (or another API we can align on)
  • Implement test runners that execute the same tests on the WASM build with a real FVM (this might happen in another repo, to avoid dependency on the FVM implementation from here)

Possible subsequent things we can do:

I think this would resolve #678, with "write an integration test" being the general path to benchmarking something, and the machinery all set up to instrument, profile, and track that.

Tasks

  1. alexytsu
  2. alexytsu
  3. alexytsu
  4. alexytsu
@anorth
Copy link
Member Author

anorth commented Mar 3, 2023

Do #554 first

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

No branches or pull requests

2 participants