Merge pull request #8660 from filecoin-project/fix/issue-8659

[nv16] use network bundle names consistent with the network name
This commit is contained in:
vyzo 2022-05-17 22:13:02 +03:00 committed by GitHub
commit 93417fca7d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 10 deletions

View File

@ -75,7 +75,7 @@ debug: build-devnets
2k: build-devnets
calibnet: GOFLAGS+=-tags=calibnet
calibnet: GOFLAGS+=-ldflags=-X=github.com/filecoin-project/lotus/build.NetworkBundle=calibrationnet
calibnet: GOFLAGS+=-ldflags=-X=github.com/filecoin-project/lotus/build.NetworkBundle=calibnet
calibnet: build-devnets
butterflynet: GOFLAGS+=-tags=butterflynet
@ -83,7 +83,7 @@ butterflynet: GOFLAGS+=-ldflags=-X=github.com/filecoin-project/lotus/build.Netwo
butterflynet: build-devnets
interopnet: GOFLAGS+=-tags=interopnet
interopnet: GOFLAGS+=-ldflags=-X=github.com/filecoin-project/lotus/build.NetworkBundle=caterpillarnet
interopnet: GOFLAGS+=-ldflags=-X=github.com/filecoin-project/lotus/build.NetworkBundle=interopnet
interopnet: build-devnets
lotus: $(BUILD_DEPS)

View File

@ -8,6 +8,21 @@ import (
var NetworkBundle string
func GetNetworkBundle() string {
switch NetworkBundle {
case "devnet":
return "devnet"
case "calibnet", "calibrationnet":
return "calibrationnet"
case "butterflynet":
return "butterflynet"
case "interopnet", "caterpillarnet":
return "caterpillarnet"
default:
return "mainnet"
}
}
//go:embed bundles.toml
var BuiltinActorBundles []byte

View File

@ -72,10 +72,7 @@ func LoadBundle(ctx context.Context, bs blockstore.Blockstore, path string, av a
// utility for blanket loading outside DI
func FetchAndLoadBundles(ctx context.Context, bs blockstore.Blockstore, bar map[actors.Version]build.Bundle) error {
netw := build.NetworkBundle
if netw == "" {
netw = "mainnet"
}
netw := build.GetNetworkBundle()
path := os.Getenv("LOTUS_PATH")
if path == "" {

View File

@ -25,10 +25,7 @@ func LoadBuiltinActors(lc fx.Lifecycle, mctx helpers.MetricsCtx, r repo.LockedRe
// We can't put it as a dep in inputs causes a stack overflow in DI from circular dependency
// So we pass it through ldflags instead
netw := build.NetworkBundle
if netw == "" {
netw = "mainnet"
}
netw := build.GetNetworkBundle()
for av, bd := range build.BuiltinActorReleases {
// first check to see if we know this release