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

Support custom bundles for testing post nv16

Open vyzo opened this issue 3 years ago • 2 comments

Starting with https://github.com/filecoin-project/filecoin-ffi/pull/258 and https://github.com/filecoin-project/lotus/pull/8429 we have some niceties in lotus, which allows us to pass in a manifest that is different from what is in the state tree for testing (provided the state is identical).

In order to take advantage of it and support frictionless testing of new actor bundles, we will need to add support in fvm for redirecting calls to system-state actor CodeCIDs to the code CIDs defined by the manifest we passed in. We can do this with an environment variable (no changes in consructor etc) that instructs the fvm.

In terms of mechanics, implementation should be straightforward: We already have the system-state builtin actors in the system actor state manifest, and we have the ones under testing passed in the manifest. All we have to do is parse both, and match identical type strings to create the mapping.

One potential difficulty is the gas estimation, which may require running both the old and the new actor, and charge gas according to the old actor. This allows us to also test gas charge changes.

vyzo avatar Apr 06 '22 16:04 vyzo

cc @raulk @Stebalien

vyzo avatar Apr 06 '22 16:04 vyzo

This is now supported in Lotus. However, it's not well documented, so leaving it open for now.

raulk avatar Sep 03 '22 10:09 raulk