You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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:
Record gas costs in GitHub so that we can detect and track changes in CI
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.
The content you are editing has changed. Please copy your edits and refresh the page.
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).
#[test]
entry point that instantiates the fake VMPossible 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
VM
trait #1297The text was updated successfully, but these errors were encountered: