Skip to content

Commit

Permalink
comments - cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
snadrus committed Jul 12, 2024
1 parent 2217b86 commit 795a865
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 29 deletions.
5 changes: 4 additions & 1 deletion build/buildconstants/params_interop.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
package buildconstants

import (
"log"
"os"
"strconv"

logging "github.com/ipfs/go-log/v2"

"github.com/ipfs/go-cid"

"github.com/filecoin-project/go-address"
Expand All @@ -16,6 +17,8 @@ import (
builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin"
)

var log = logging.Logger("buildconstants")

var NetworkBundle = "caterpillarnet"
var ActorDebugging = false

Expand Down
2 changes: 2 additions & 0 deletions build/buildconstants/params_mainnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ var DrandSchedule = map[abi.ChainEpoch]DrandEnum{

var NetworkBundle = "mainnet"

var MinVerifiedDealSize = abi.NewStoragePower(1 << 20)

// NOTE: DO NOT change this unless you REALLY know what you're doing. This is consensus critical.
const ActorDebugging = false

Expand Down
17 changes: 9 additions & 8 deletions build/params_shared_vals.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"math/big"

"github.com/filecoin-project/lotus/build/buildconstants"
"github.com/filecoin-project/lotus/chain/actors/policy"
)

// /////
Expand All @@ -18,16 +19,14 @@ var UnixfsLinksPerLevel = buildconstants.UnixfsLinksPerLevel // Deprecated: Use
var AllowableClockDriftSecs = buildconstants.AllowableClockDriftSecs // Deprecated: Use buildconstants.AllowableClockDriftSecs instead

// Epochs
var ForkLengthThreshold = Finality // Deprecated: Use Finality instead
const ForkLengthThreshold = Finality // Deprecated: Use Finality instead

// Blocks (e)
var BlocksPerEpoch = buildconstants.BlocksPerEpoch // Deprecated: Use buildconstants.BlocksPerEpoch instead

// Epochs
var MessageConfidence = buildconstants.MessageConfidence // Deprecated: Use buildconstants.MessageConfidence instead

// constants for Weight calculation
// The ratio of weight contributed by short-term vs long-term factors in a given round
var WRatioNum = buildconstants.WRatioNum // Deprecated: Use buildconstants.WRatioNum instead
var WRatioDen = buildconstants.WRatioDen // Deprecated: Use buildconstants.WRatioDen instead

Expand All @@ -39,7 +38,6 @@ var TicketRandomnessLookback = buildconstants.TicketRandomnessLookback // Deprec

// the 'f' prefix doesn't matter
var ZeroAddress = buildconstants.ZeroAddress // Deprecated: Use buildconstants.ZeroAddress instead

// /////
// Devnet settings

Expand Down Expand Up @@ -67,12 +65,8 @@ func init() {
// Sync
var BadBlockCacheSize = buildconstants.BadBlockCacheSize // Deprecated: Use buildconstants.BadBlockCacheSize instead

// assuming 4000 messages per round, this lets us not lose any messages across a
// 10 block reorg.
var BlsSignatureCacheSize = buildconstants.BlsSignatureCacheSize // Deprecated: Use buildconstants.BlsSignatureCacheSize instead

// Size of signature verification cache
// 32k keeps the cache around 10MB in size, max
var VerifSigCacheSize = buildconstants.VerifSigCacheSize // Deprecated: Use buildconstants.VerifSigCacheSize instead

// ///////
Expand All @@ -94,3 +88,10 @@ var MinDealDuration = buildconstants.MinDealDuration // Deprecated: Use buildcon
var MaxDealDuration = buildconstants.MaxDealDuration // Deprecated: Use buildconstants.MaxDealDuration instead

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

func init() {
policy.SetSupportedProofTypes(buildconstants.SupportedProofTypes...)
policy.SetConsensusMinerMinPower(buildconstants.ConsensusMinerMinPower)
policy.SetMinVerifiedDealSize(buildconstants.MinVerifiedDealSize)
policy.SetPreCommitChallengeDelay(buildconstants.PreCommitChallengeDelay)
}
8 changes: 0 additions & 8 deletions build/params_testground_vals.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,9 @@
package build

import (
"github.com/filecoin-project/lotus/build/buildconstants"
"github.com/filecoin-project/lotus/chain/actors/policy"
)

// Actor consts
// TODO: pieceSize unused from actors
var MinDealDuration, MaxDealDuration = policy.DealDurationBounds(0)

func init() {
policy.SetSupportedProofTypes(buildconstants.SupportedProofTypes...)
policy.SetConsensusMinerMinPower(buildconstants.ConsensusMinerMinPower)
policy.SetMinVerifiedDealSize(buildconstants.MinVerifiedDealSize)
policy.SetPreCommitChallengeDelay(buildconstants.PreCommitChallengeDelay)
}
2 changes: 1 addition & 1 deletion build/proof-params/parameters.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package build
package proofparams

import (
_ "embed"
Expand Down
16 changes: 8 additions & 8 deletions build/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ import (
type BuildVersion string

var CurrentCommit string
var BuildType = buildconstants.BuildType
var BuildType = buildconstants.BuildType // Deprecated: Use buildconstants.BuildType instead

const (
BuildDefault = buildconstants.BuildDefault
BuildMainnet = buildconstants.BuildMainnet
Build2k = buildconstants.Build2k
BuildDebug = buildconstants.BuildDebug
BuildCalibnet = buildconstants.BuildCalibnet
BuildInteropnet = buildconstants.BuildInteropnet
BuildButterflynet = buildconstants.BuildButterflynet
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 {
Expand Down
4 changes: 1 addition & 3 deletions itests/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,9 @@ func (ts *apiSuite) testOutOfGasError(t *testing.T) {

// the gas estimator API executes the message with gasLimit = BlockGasLimit
// Lowering it to 2 will cause it to run out of gas, testing the failure case we want
originalLimit := build.BlockGasLimit
build.BlockGasLimit = 2
originalLimit := buildconstants.BlockGasTarget
buildconstants.BlockGasTarget = 2
defer func() {
build.BlockGasLimit = originalLimit
buildconstants.BlockGasTarget = originalLimit
}()

Expand Down

0 comments on commit 795a865

Please sign in to comment.