diff --git a/chain/gen/genesis/genesis.go b/chain/gen/genesis/genesis.go index 6ab101e78..bb3d7d477 100644 --- a/chain/gen/genesis/genesis.go +++ b/chain/gen/genesis/genesis.go @@ -494,9 +494,9 @@ func VerifyPreSealedData(ctx context.Context, cs *store.ChainStore, sys vm.Sysca NetworkVersion: nv, BaseFee: types.NewInt(0), } - vm, err := vm.NewVM(ctx, &vmopt) + vm, err := vm.NewLotusVM(ctx, &vmopt) if err != nil { - return cid.Undef, xerrors.Errorf("failed to create NewVM: %w", err) + return cid.Undef, xerrors.Errorf("failed to create NewLotusVM: %w", err) } for mi, m := range template.Miners { diff --git a/chain/gen/genesis/miners.go b/chain/gen/genesis/miners.go index 274918147..b705c6afe 100644 --- a/chain/gen/genesis/miners.go +++ b/chain/gen/genesis/miners.go @@ -98,9 +98,9 @@ func SetupStorageMiners(ctx context.Context, cs *store.ChainStore, sys vm.Syscal BaseFee: types.NewInt(0), } - vm, err := vm.NewVM(ctx, vmopt) + vm, err := vm.NewLotusVM(ctx, vmopt) if err != nil { - return cid.Undef, xerrors.Errorf("failed to create NewVM: %w", err) + return cid.Undef, xerrors.Errorf("failed to create NewLotusVM: %w", err) } if len(miners) == 0 { diff --git a/chain/stmgr/forks_test.go b/chain/stmgr/forks_test.go index 4fad1e4fc..fbf7b6785 100644 --- a/chain/stmgr/forks_test.go +++ b/chain/stmgr/forks_test.go @@ -167,7 +167,7 @@ func TestForkHeightTriggers(t *testing.T) { inv.Register(nil, testActor{}) sm.SetVMConstructor(func(ctx context.Context, vmopt *vm.VMOpts) (*vm.VM, error) { - nvm, err := vm.NewVM(ctx, vmopt) + nvm, err := vm.NewLotusVM(ctx, vmopt) if err != nil { return nil, err } @@ -282,7 +282,7 @@ func testForkRefuseCall(t *testing.T, nullsBefore, nullsAfter int) { inv.Register(nil, testActor{}) sm.SetVMConstructor(func(ctx context.Context, vmopt *vm.VMOpts) (*vm.VM, error) { - nvm, err := vm.NewVM(ctx, vmopt) + nvm, err := vm.NewLotusVM(ctx, vmopt) if err != nil { return nil, err } @@ -501,7 +501,7 @@ func TestForkPreMigration(t *testing.T) { inv.Register(nil, testActor{}) sm.SetVMConstructor(func(ctx context.Context, vmopt *vm.VMOpts) (*vm.VM, error) { - nvm, err := vm.NewVM(ctx, vmopt) + nvm, err := vm.NewLotusVM(ctx, vmopt) if err != nil { return nil, err } diff --git a/chain/stmgr/stmgr.go b/chain/stmgr/stmgr.go index 45dd52ec8..ed007b756 100644 --- a/chain/stmgr/stmgr.go +++ b/chain/stmgr/stmgr.go @@ -142,7 +142,7 @@ func NewStateManager(cs *store.ChainStore, exec Executor, sys vm.SyscallBuilder, latestVersion: lastVersion, stateMigrations: stateMigrations, expensiveUpgrades: expensiveUpgrades, - newVM: vm.NewVM, + newVM: vm.NewLotusVM, Syscalls: sys, cs: cs, tsExec: exec, diff --git a/chain/vm/vm.go b/chain/vm/vm.go index 3e2b76fe6..ca9855b10 100644 --- a/chain/vm/vm.go +++ b/chain/vm/vm.go @@ -234,7 +234,7 @@ type VMOpts struct { LookbackState LookbackStateGetter } -func NewVM(ctx context.Context, opts *VMOpts) (*VM, error) { +func NewLotusVM(ctx context.Context, opts *VMOpts) (*VM, error) { buf := blockstore.NewBuffered(opts.Bstore) cst := cbor.NewCborStore(buf) state, err := state.LoadStateTree(cst, opts.StateBase) diff --git a/cmd/lotus-sim/simulation/blockbuilder/blockbuilder.go b/cmd/lotus-sim/simulation/blockbuilder/blockbuilder.go index fb822eb6e..7aaaf0ec7 100644 --- a/cmd/lotus-sim/simulation/blockbuilder/blockbuilder.go +++ b/cmd/lotus-sim/simulation/blockbuilder/blockbuilder.go @@ -92,7 +92,7 @@ func NewBlockBuilder(ctx context.Context, logger *zap.SugaredLogger, sm *stmgr.S BaseFee: abi.NewTokenAmount(0), LookbackState: stmgr.LookbackStateGetterForTipset(sm, parentTs), } - bb.vm, err = vm.NewVM(bb.ctx, vmopt) + bb.vm, err = vm.NewLotusVM(bb.ctx, vmopt) if err != nil { return nil, err } diff --git a/conformance/driver.go b/conformance/driver.go index a065d1530..6af4372d2 100644 --- a/conformance/driver.go +++ b/conformance/driver.go @@ -160,7 +160,7 @@ func (d *Driver) ExecuteTipset(bs blockstore.Blockstore, ds ds.Batching, params return big.Zero(), nil } - return vm.NewVM(ctx, vmopt) + return vm.NewLotusVM(ctx, vmopt) }) postcid, receiptsroot, err := tse.ApplyBlocks(context.Background(), @@ -226,7 +226,7 @@ func (d *Driver) ExecuteMessage(bs blockstore.Blockstore, params ExecuteMessageP NetworkVersion: params.NetworkVersion, } - lvm, err := vm.NewVM(context.TODO(), vmOpts) + lvm, err := vm.NewLotusVM(context.TODO(), vmOpts) if err != nil { return nil, cid.Undef, err }