filecoin-project / builtin-actors

The Filecoin built-in actors
Other
83 stars 79 forks source link

Seed TestVM with predictable testing values at construction #1348

Open alexytsu opened 1 year ago

alexytsu commented 1 year ago

Currently constants such as TEST_VM_RAND_ARRAY and TEST_FAUCET_ADDR are used as static consts in the TestVM's stack. These are also duplicated and used in the fil_actors_integration_tests crate to make assertions during test execution.

They should be deduplicated a possible solution is to reference GensisSpec usage https://github.com/filecoin-project/builtin-actors/pull/1345#discussion_r1280036734

anorth commented 1 year ago

Related: #1371

anorth commented 1 year ago

This is part of a general need to inject/configure all externally-provided values into the VM. E.g. the circulating supply is a value provided to the VM by its host (Lotus). Follow a pattern like Primitives to bring all similar values under control of the test author.

anorth commented 1 year ago

The ref FVM has

I think there could have been just a single concept here, but let's just follow the same design which will make the integration easier.