From 87b48c94a63437c54596942d3c121f6ff6caa3d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Kripalani?= Date: Thu, 24 Sep 2020 17:58:34 +0100 Subject: [PATCH 1/2] conformance: supply network version to driver. --- conformance/driver.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/conformance/driver.go b/conformance/driver.go index 66b6d0f8a71..f43a8739d04 100644 --- a/conformance/driver.go +++ b/conformance/driver.go @@ -122,6 +122,8 @@ func (d *Driver) ExecuteTipset(bs blockstore.Blockstore, ds ds.Batching, preroot // ExecuteMessage executes a conformance test vector message in a temporary VM. func (d *Driver) ExecuteMessage(bs blockstore.Blockstore, preroot cid.Cid, epoch abi.ChainEpoch, msg *types.Message) (*vm.ApplyRet, cid.Cid, error) { + // dummy state manager; only to reference the GetNetworkVersion method, which does not depend on state. + sm := new(stmgr.StateManager) vmOpts := &vm.VMOpts{ StateBase: preroot, Epoch: epoch, @@ -130,6 +132,7 @@ func (d *Driver) ExecuteMessage(bs blockstore.Blockstore, preroot cid.Cid, epoch Syscalls: mkFakedSigSyscalls(vm.Syscalls(ffiwrapper.ProofVerifier)), // TODO always succeeds; need more flexibility. CircSupplyCalc: nil, BaseFee: BaseFee, + NtwkVersion: sm.GetNtwkVersion, } lvm, err := vm.NewVM(context.TODO(), vmOpts) From 68663060dc19c67d09bc1544527b724b1accbe68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Kripalani?= Date: Thu, 24 Sep 2020 17:58:49 +0100 Subject: [PATCH 2/2] add state.StateTree#Version() accessor. --- chain/state/statetree.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/chain/state/statetree.go b/chain/state/statetree.go index a654d224bb0..fe932bfa114 100644 --- a/chain/state/statetree.go +++ b/chain/state/statetree.go @@ -395,6 +395,11 @@ func (st *StateTree) ForEach(f func(address.Address, *types.Actor) error) error }) } +// Version returns the version of the StateTree data structure in use. +func (st *StateTree) Version() builtin.Version { + return st.version +} + func Diff(oldTree, newTree *StateTree) (map[string]types.Actor, error) { out := map[string]types.Actor{}