Skip to content

Commit

Permalink
complete the simplest deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
snadrus committed Jul 12, 2024
1 parent 21ca683 commit bec5965
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 27 deletions.
3 changes: 0 additions & 3 deletions build/buildconstants/params_shared_vals.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ const FilReserved = uint64(300_000_000)
var InitialRewardBalance *big.Int
var InitialFilReserved *big.Int

// TODO: Move other important consts here

func init() {
InitialRewardBalance = big.NewInt(int64(FilAllocStorageMining))
InitialRewardBalance = InitialRewardBalance.Mul(InitialRewardBalance, big.NewInt(int64(FilecoinPrecision)))
Expand All @@ -94,7 +92,6 @@ const VerifSigCacheSize = 32000
// ///////
// Limits

// TODO: If this is gonna stay, it should move to specs-actors
const BlockMessageLimit = 10000

var BlockGasLimit = int64(10_000_000_000)
Expand Down
2 changes: 0 additions & 2 deletions build/parameters.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@ var BlockDelaySecs = buildconstants.BlockDelaySecs // Deprecated: Use buildconst

var PropagationDelaySecs = buildconstants.PropagationDelaySecs // Deprecated: Use buildconstants.PropagationDelaySecs instead

var EquivocationDelaySecs = buildconstants.EquivocationDelaySecs // Deprecated: Use buildconstants.EquivocationDelaySecs instead

const BootstrapPeerThreshold = buildconstants.BootstrapPeerThreshold // Deprecated: Use buildconstants.BootstrapPeerThreshold instead

// ChainId defines the chain ID used in the Ethereum JSON-RPC endpoint.
Expand Down
3 changes: 0 additions & 3 deletions build/params_shared_vals.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ var FilReserved = buildconstants.FilReserved // Deprecated: Use buil
var InitialRewardBalance *big.Int
var InitialFilReserved *big.Int

// TODO: Move other important consts here

func init() {
InitialRewardBalance = big.NewInt(int64(FilAllocStorageMining))
InitialRewardBalance = InitialRewardBalance.Mul(InitialRewardBalance, big.NewInt(int64(FilecoinPrecision)))
Expand All @@ -72,7 +70,6 @@ var VerifSigCacheSize = buildconstants.VerifSigCacheSize // Deprecated: Use buil
// ///////
// Limits

// TODO: If this is gonna stay, it should move to specs-actors
var BlockMessageLimit = buildconstants.BlockMessageLimit // Deprecated: Use buildconstants.BlockMessageLimit instead

var BlockGasLimit = buildconstants.BlockGasLimit // Deprecated: Use buildconstants.BlockGasLimit instead
Expand Down
24 changes: 7 additions & 17 deletions build/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,21 @@ type BuildVersion string
var CurrentCommit string
var BuildType = buildconstants.BuildType // Deprecated: Use buildconstants.BuildType instead

const (
BuildDefault = buildconstants.BuildDefault // Deprecated: Use buildconstants.BuildDefault instead
BuildMainnet = buildconstants.BuildMainnet // Deprecated: Use buildconstants.BuildMainnet instead
Build2k = buildconstants.Build2k // Deprecated: Use buildconstants.Build2k instead
BuildDebug = buildconstants.BuildDebug // Deprecated: Use buildconstants.BuildDebug instead
BuildCalibnet = buildconstants.BuildCalibnet // Deprecated: Use buildconstants.BuildCalibnet instead
BuildInteropnet = buildconstants.BuildInteropnet // Deprecated: Use buildconstants.BuildInteropnet instead
BuildButterflynet = buildconstants.BuildButterflynet // Deprecated: Use buildconstants.BuildButterflynet instead
)

func BuildTypeString() string {
switch BuildType {
case BuildDefault:
case buildconstants.BuildDefault:
return ""
case BuildMainnet:
case buildconstants.BuildMainnet:
return "+mainnet"
case Build2k:
case buildconstants.Build2k:
return "+2k"
case BuildDebug:
case buildconstants.BuildDebug:
return "+debug"
case BuildCalibnet:
case buildconstants.BuildCalibnet:
return "+calibnet"
case BuildInteropnet:
case buildconstants.BuildInteropnet:
return "+interopnet"
case BuildButterflynet:
case buildconstants.BuildButterflynet:
return "+butterflynet"
default:
return "+huh?"
Expand Down
1 change: 0 additions & 1 deletion itests/kit/ensemble.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ func NewEnsemble(t *testing.T, opts ...EnsembleOpt) *Ensemble {
require.NoError(t, build.UseNetworkBundle("testing"))
}

build.EquivocationDelaySecs = 0
buildconstants.EquivocationDelaySecs = 0

return n
Expand Down
3 changes: 2 additions & 1 deletion miner/miner.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/api/v1api"
"github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/lotus/build/buildconstants"
"github.com/filecoin-project/lotus/chain/actors/builtin"
"github.com/filecoin-project/lotus/chain/actors/policy"
"github.com/filecoin-project/lotus/chain/gen"
Expand Down Expand Up @@ -588,7 +589,7 @@ func (m *Miner) mineOne(ctx context.Context, base *MiningBase) (minedBlock *type
// To safeguard against this, we make sure it's been EquivocationDelaySecs since our base was calculated,
// then re-calculate it.
// If the daemon detected equivocated blocks, those blocks will no longer be in the new base.
m.niceSleep(time.Until(base.ComputeTime.Add(time.Duration(build.EquivocationDelaySecs) * time.Second)))
m.niceSleep(time.Until(base.ComputeTime.Add(time.Duration(buildconstants.EquivocationDelaySecs) * time.Second)))
newBase, err := m.GetBestMiningCandidate(ctx)
if err != nil {
err = xerrors.Errorf("failed to refresh best mining candidate: %w", err)
Expand Down

0 comments on commit bec5965

Please sign in to comment.