diff --git a/api/docgen/docgen.go b/api/docgen/docgen.go index cd1f03337..a41fe3638 100644 --- a/api/docgen/docgen.go +++ b/api/docgen/docgen.go @@ -137,7 +137,7 @@ func init() { addExample(&textSelExample) addExample(&apiSelExample) addExample(network.ReachabilityPublic) - addExample(build.NewestNetworkVersion) + addExample(build.TestNetworkVersion) addExample(map[string]int{"name": 42}) addExample(map[string]time.Time{"name": time.Unix(1615243938, 0).UTC()}) addExample(&types.ExecutionTrace{ diff --git a/build/params_shared_vals.go b/build/params_shared_vals.go index a77feb9d8..4c36b703d 100644 --- a/build/params_shared_vals.go +++ b/build/params_shared_vals.go @@ -26,14 +26,14 @@ const UnixfsLinksPerLevel = 1024 const AllowableClockDriftSecs = uint64(1) -// TODO: This is still terrible...What's the impact of updating this before mainnet actually upgrades +// Used by tests and some obscure tooling /* inline-gen template -const NewestNetworkVersion = network.Version{{.latestNetworkVersion}} +const TestNetworkVersion = network.Version{{.latestNetworkVersion}} /* inline-gen start */ -const NewestNetworkVersion = network.Version17 +const TestNetworkVersion = network.Version17 /* inline-gen end */ diff --git a/chain/messagepool/messagepool_test.go b/chain/messagepool/messagepool_test.go index 7751f7978..5822a68b7 100644 --- a/chain/messagepool/messagepool_test.go +++ b/chain/messagepool/messagepool_test.go @@ -15,9 +15,11 @@ import ( "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/go-state-types/crypto" + "github.com/filecoin-project/go-state-types/network" builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin" "github.com/filecoin-project/lotus/api" + "github.com/filecoin-project/lotus/build" "github.com/filecoin-project/lotus/chain/consensus/filcns" "github.com/filecoin-project/lotus/chain/messagepool/gasguess" "github.com/filecoin-project/lotus/chain/types" @@ -166,6 +168,10 @@ func (tma *testMpoolAPI) StateAccountKeyAtFinality(ctx context.Context, addr add return addr, nil } +func (tma *testMpoolAPI) StateNetworkVersion(ctx context.Context, h abi.ChainEpoch) network.Version { + return build.TestNetworkVersion +} + func (tma *testMpoolAPI) MessagesForBlock(ctx context.Context, h *types.BlockHeader) ([]*types.Message, []*types.SignedMessage, error) { return nil, tma.bmsgs[h.Cid()], nil } diff --git a/chain/messagepool/provider.go b/chain/messagepool/provider.go index f1232ef81..50a1bf30f 100644 --- a/chain/messagepool/provider.go +++ b/chain/messagepool/provider.go @@ -4,15 +4,13 @@ import ( "context" "time" - "github.com/filecoin-project/go-state-types/abi" - - "github.com/filecoin-project/go-state-types/network" - "github.com/ipfs/go-cid" pubsub "github.com/libp2p/go-libp2p-pubsub" "golang.org/x/xerrors" "github.com/filecoin-project/go-address" + "github.com/filecoin-project/go-state-types/abi" + "github.com/filecoin-project/go-state-types/network" "github.com/filecoin-project/lotus/chain/messagesigner" "github.com/filecoin-project/lotus/chain/stmgr" diff --git a/chain/state/statetree_test.go b/chain/state/statetree_test.go index e15fed489..9a221751a 100644 --- a/chain/state/statetree_test.go +++ b/chain/state/statetree_test.go @@ -48,7 +48,7 @@ func BenchmarkStateTreeSet(b *testing.B) { func BenchmarkStateTreeSetFlush(b *testing.B) { //stm: @CHAIN_STATETREE_SET_ACTOR_001 cst := cbor.NewMemCborStore() - sv, err := VersionForNetwork(build.NewestNetworkVersion) + sv, err := VersionForNetwork(build.TestNetworkVersion) if err != nil { b.Fatal(err) } @@ -85,7 +85,7 @@ func TestResolveCache(t *testing.T) { //stm: @CHAIN_STATETREE_SET_ACTOR_001, @CHAIN_STATETREE_GET_ACTOR_001, @CHAIN_STATETREE_VERSION_FOR_NETWORK_001 //stm: @CHAIN_STATETREE_SNAPSHOT_001, @CHAIN_STATETREE_SNAPSHOT_CLEAR_001 cst := cbor.NewMemCborStore() - sv, err := VersionForNetwork(build.NewestNetworkVersion) + sv, err := VersionForNetwork(build.TestNetworkVersion) if err != nil { t.Fatal(err) } @@ -189,7 +189,7 @@ func BenchmarkStateTree10kGetActor(b *testing.B) { //stm: @CHAIN_STATETREE_SET_ACTOR_001, @CHAIN_STATETREE_GET_ACTOR_001, @CHAIN_STATETREE_VERSION_FOR_NETWORK_001 //stm: @CHAIN_STATETREE_FLUSH_001 cst := cbor.NewMemCborStore() - sv, err := VersionForNetwork(build.NewestNetworkVersion) + sv, err := VersionForNetwork(build.TestNetworkVersion) if err != nil { b.Fatal(err) } @@ -237,7 +237,7 @@ func BenchmarkStateTree10kGetActor(b *testing.B) { func TestSetCache(t *testing.T) { //stm: @CHAIN_STATETREE_SET_ACTOR_001, @CHAIN_STATETREE_GET_ACTOR_001, @CHAIN_STATETREE_VERSION_FOR_NETWORK_001 cst := cbor.NewMemCborStore() - sv, err := VersionForNetwork(build.NewestNetworkVersion) + sv, err := VersionForNetwork(build.TestNetworkVersion) if err != nil { t.Fatal(err) } @@ -282,7 +282,7 @@ func TestSnapshots(t *testing.T) { ctx := context.Background() cst := cbor.NewMemCborStore() - sv, err := VersionForNetwork(build.NewestNetworkVersion) + sv, err := VersionForNetwork(build.TestNetworkVersion) if err != nil { t.Fatal(err) } diff --git a/cmd/lotus-bench/main.go b/cmd/lotus-bench/main.go index 46c008d8f..d7b9b0409 100644 --- a/cmd/lotus-bench/main.go +++ b/cmd/lotus-bench/main.go @@ -816,7 +816,7 @@ func bps(sectorSize abi.SectorSize, sectorNum int, d time.Duration) string { } func spt(ssize abi.SectorSize) abi.RegisteredSealProof { - spt, err := miner.SealProofTypeFromSectorSize(ssize, build.NewestNetworkVersion) + spt, err := miner.SealProofTypeFromSectorSize(ssize, build.TestNetworkVersion) if err != nil { panic(err) } diff --git a/cmd/lotus-seed/genesis.go b/cmd/lotus-seed/genesis.go index df2a91ad9..1ab6a465a 100644 --- a/cmd/lotus-seed/genesis.go +++ b/cmd/lotus-seed/genesis.go @@ -539,7 +539,7 @@ var genesisSetActorVersionCmd = &cli.Command{ } nv := network.Version(cctx.Int("network-version")) - if nv > build.NewestNetworkVersion { + if nv > build.TestNetworkVersion { return xerrors.Errorf("invalid network version: %d", nv) } diff --git a/itests/kit/ensemble_opts.go b/itests/kit/ensemble_opts.go index 61a54550e..d264da2bb 100644 --- a/itests/kit/ensemble_opts.go +++ b/itests/kit/ensemble_opts.go @@ -30,7 +30,7 @@ var DefaultEnsembleOpts = ensembleOpts{ pastOffset: 10000000 * time.Second, // time sufficiently in the past to trigger catch-up mining. upgradeSchedule: stmgr.UpgradeSchedule{{ Height: -1, - Network: build.NewestNetworkVersion, + Network: build.TestNetworkVersion, }}, } diff --git a/paychmgr/mock_test.go b/paychmgr/mock_test.go index d1325ad31..739bae25a 100644 --- a/paychmgr/mock_test.go +++ b/paychmgr/mock_test.go @@ -250,5 +250,5 @@ func (pchapi *mockPaychAPI) addSigningKey(key []byte) { } func (pchapi *mockPaychAPI) StateNetworkVersion(ctx context.Context, tsk types.TipSetKey) (network.Version, error) { - return build.NewestNetworkVersion, nil + return build.TestNetworkVersion, nil } diff --git a/storage/pipeline/precommit_policy_test.go b/storage/pipeline/precommit_policy_test.go index b81086362..9f23e58d6 100644 --- a/storage/pipeline/precommit_policy_test.go +++ b/storage/pipeline/precommit_policy_test.go @@ -44,7 +44,7 @@ func fakeConfigGetter(stub *fakeConfigStub) dtypes.GetSealingConfigFunc { } func (f *fakeChain) StateNetworkVersion(ctx context.Context, tsk types.TipSetKey) (network.Version, error) { - return build.NewestNetworkVersion, nil + return build.TestNetworkVersion, nil } func (f *fakeChain) ChainHead(ctx context.Context) (*types.TipSet, error) { diff --git a/storage/wdpost/wdpost_run_test.go b/storage/wdpost/wdpost_run_test.go index cb110cc0d..7011b9a62 100644 --- a/storage/wdpost/wdpost_run_test.go +++ b/storage/wdpost/wdpost_run_test.go @@ -53,7 +53,7 @@ func (m *mockStorageMinerAPI) StateMinerInfo(ctx context.Context, a address.Addr } func (m *mockStorageMinerAPI) StateNetworkVersion(ctx context.Context, key types.TipSetKey) (network.Version, error) { - return build.NewestNetworkVersion, nil + return build.TestNetworkVersion, nil } func (m *mockStorageMinerAPI) StateGetRandomnessFromTickets(ctx context.Context, personalization crypto.DomainSeparationTag, randEpoch abi.ChainEpoch, entropy []byte, tsk types.TipSetKey) (abi.Randomness, error) {