don't store dev bundle release keys in the datastore

This is a nicety for development, so that we always load a development bundle to avoid having
to give them distinct names etc. Just call you release "dev" or "dev.xxx..." and put the bundle
in `.lotus/builtin-actors/v8/dev/builting-actors-${network}.{car,sha256sum}` and it will be
unconditionally loaded.
This commit is contained in:
vyzo 2022-05-16 15:11:10 +03:00
parent 56d30d3e0c
commit b4be759b2c

View File

@ -2,6 +2,7 @@ package modules
import (
"fmt"
"strings"
"sync"
"go.uber.org/fx"
@ -71,6 +72,11 @@ func LoadBuiltinActors(lc fx.Lifecycle, mctx helpers.MetricsCtx, r repo.LockedRe
return result, err
}
if rel == "dev" || strings.HasPrefix(rel, "dev.") {
// don't store the release key so that we always load development bundles
continue
}
// add the release key with the manifest to avoid reloading it in next restart.
if err := ds.Put(ctx, key, mfCid.Bytes()); err != nil {
return result, xerrors.Errorf("error storing manifest CID for builtin-actors vrsion %d to the datastore: %w", av, err)