Skip to content

Commit

Permalink
Merge pull request #8716 from filecoin-project/fix/makefile-flags
Browse files Browse the repository at this point in the history
build: set NetworkBundle in params file
  • Loading branch information
jennijuju authored May 24, 2022
2 parents c07c87c + 496799f commit 2c3df5f
Show file tree
Hide file tree
Showing 10 changed files with 8 additions and 24 deletions.
5 changes: 0 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -68,23 +68,18 @@ build-devnets: build lotus-seed lotus-shed lotus-wallet lotus-gateway lotus-foun
.PHONY: build-devnets

debug: GOFLAGS+=-tags=debug
debug: GOFLAGS+=-ldflags=-X=github.com/filecoin-project/lotus/build.NetworkBundle=devnet
debug: build-devnets

2k: GOFLAGS+=-tags=2k
2k: GOFLAGS+=-ldflags=-X=github.com/filecoin-project/lotus/build.NetworkBundle=devnet
2k: build-devnets

calibnet: GOFLAGS+=-tags=calibnet
calibnet: GOFLAGS+=-ldflags=-X=github.com/filecoin-project/lotus/build.NetworkBundle=calibnet
calibnet: build-devnets

butterflynet: GOFLAGS+=-tags=butterflynet
butterflynet: GOFLAGS+=-ldflags=-X=github.com/filecoin-project/lotus/build.NetworkBundle=butterflynet
butterflynet: build-devnets

interopnet: GOFLAGS+=-tags=interopnet
interopnet: GOFLAGS+=-ldflags=-X=github.com/filecoin-project/lotus/build.NetworkBundle=interopnet
interopnet: build-devnets

lotus: $(BUILD_DEPS)
Expand Down
17 changes: 0 additions & 17 deletions build/bundle.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,6 @@ import (
"github.com/filecoin-project/lotus/chain/actors"
)

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

Expand Down
1 change: 1 addition & 0 deletions build/params_2k.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (

const BootstrappersFile = ""
const GenesisFile = ""
const NetworkBundle = "devnet"

const GenesisNetworkVersion = network.Version15

Expand Down
1 change: 1 addition & 0 deletions build/params_butterfly.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ var DrandSchedule = map[abi.ChainEpoch]DrandEnum{

const GenesisNetworkVersion = network.Version14

const NetworkBundle = "butterflynet"
const BootstrappersFile = "butterflynet.pi"
const GenesisFile = "butterflynet.car"

Expand Down
1 change: 1 addition & 0 deletions build/params_calibnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ var DrandSchedule = map[abi.ChainEpoch]DrandEnum{

const GenesisNetworkVersion = network.Version0

const NetworkBundle = "calibrationnet"
const BootstrappersFile = "calibnet.pi"
const GenesisFile = "calibnet.car"

Expand Down
1 change: 1 addition & 0 deletions build/params_interop.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"github.com/ipfs/go-cid"
)

const NetworkBundle = "caterpillarnet"
const BootstrappersFile = "interopnet.pi"
const GenesisFile = "interopnet.car"

Expand Down
1 change: 1 addition & 0 deletions build/params_mainnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
UpgradeSmokeHeight: DrandMainnet,
}

const NetworkBundle = "mainnet"
const GenesisNetworkVersion = network.Version0

const BootstrappersFile = "mainnet.pi"
Expand Down
1 change: 1 addition & 0 deletions build/params_testground.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ var (
}

GenesisNetworkVersion = network.Version0
NetworkBundle = "devnet"

NewestNetworkVersion = network.Version15
ActorUpgradeNetworkVersion = network.Version15
Expand Down
2 changes: 1 addition & 1 deletion node/bundle/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +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.GetNetworkBundle()
netw := build.NetworkBundle

path := os.Getenv("LOTUS_PATH")
if path == "" {
Expand Down
2 changes: 1 addition & 1 deletion node/modules/builtin_actors.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +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.GetNetworkBundle()
netw := build.NetworkBundle

for av, bd := range build.BuiltinActorReleases {
// first check to see if we know this release
Expand Down

0 comments on commit 2c3df5f

Please # to comment.