From cdd7f26fb3249b47e3df215dc020ea9a8ad039d3 Mon Sep 17 00:00:00 2001 From: Geoff Stuart Date: Tue, 18 Oct 2022 12:45:37 -0400 Subject: [PATCH] Allow setting local bundles for Debug FVM for av 9+ --- chain/vm/fvm.go | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/chain/vm/fvm.go b/chain/vm/fvm.go index 10e6724ed..ff8102bb6 100644 --- a/chain/vm/fvm.go +++ b/chain/vm/fvm.go @@ -39,7 +39,6 @@ import ( var _ Interface = (*FVM)(nil) var _ ffi_cgo.Externs = (*FvmExtern)(nil) -var debugBundleV8path = os.Getenv("LOTUS_FVM_DEBUG_BUNDLE_V8") type FvmExtern struct { Rand @@ -418,12 +417,10 @@ func NewDebugFVM(ctx context.Context, opts *VMOpts) (*FVM, error) { return nil, xerrors.Errorf("error determining actors version for network version %d: %w", opts.NetworkVersion, err) } - switch av { - case actorstypes.Version8: - if debugBundleV8path != "" { - if err := createMapping(debugBundleV8path); err != nil { - log.Errorf("failed to create v8 debug mapping") - } + debugBundlePath := os.Getenv(fmt.Sprintf("LOTUS_FVM_DEBUG_BUNDLE_V%d", av)) + if debugBundlePath != "" { + if err := createMapping(debugBundlePath); err != nil { + log.Errorf("failed to create v%d debug mapping", av) } }