build

package
v1.14.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 25, 2022 License: Apache-2.0, MIT Imports: 32 Imported by: 174

Documentation

Index

Constants

View Source
const (
	BuildDefault      = 0
	BuildMainnet      = 0x1
	Build2k           = 0x2
	BuildDebug        = 0x3
	BuildCalibnet     = 0x4
	BuildInteropnet   = 0x5
	BuildButterflynet = 0x7
)
View Source
const AddressMainnetEnvVar = "_mainnet_"
View Source
const AllowableClockDriftSecs = uint64(1)
View Source
const BadBlockCacheSize = 1 << 15

Sync

View Source
const BaseFeeMaxChangeDenom = 8 // 12.5%
View Source
const BlockGasLimit = 10_000_000_000
View Source
const BlockGasTarget = BlockGasLimit / 2
View Source
const BlockMessageLimit = 10000

TODO: If this is gonna stay, it should move to specs-actors

View Source
const BlsSignatureCacheSize = 40000

assuming 4000 messages per round, this lets us not lose any messages across a 10 block reorg.

View Source
const BootstrapPeerThreshold = 4

BootstrapPeerThreshold is the minimum number peers we need to track for a sync worker to start

View Source
const BootstrappersFile = "mainnet.pi"
View Source
const BreezeGasTampingDuration = 120
View Source
const BuildVersion = "1.14.2"

BuildVersion is the local build version

View Source
const FilAllocStorageMining = uint64(1_100_000_000)
View Source
const FilBase = uint64(2_000_000_000)
View Source
const FilReserved = uint64(300_000_000)
View Source
const FilecoinPrecision = uint64(1_000_000_000_000_000_000)
View Source
const Finality = policy.ChainFinality

Epochs

View Source
const ForkLengthThreshold = Finality

Epochs

View Source
const GenesisFile = "mainnet.car"
View Source
const GenesisNetworkVersion = network.Version0
View Source
const InitialBaseFee = 100e6
View Source
const MessageConfidence = uint64(5)
View Source
const MinimumBaseFee = 100
View Source
const NewestNetworkVersion = network.Version15
View Source
const PackingEfficiencyDenom = 5
View Source
const PackingEfficiencyNum = 4
View Source
const PropagationDelaySecs = uint64(6)
View Source
const SealRandomnessLookback = policy.SealRandomnessLookback

Epochs TODO: unused

View Source
const TicketRandomnessLookback = abi.ChainEpoch(1)

Epochs

View Source
const UnixfsChunkSize uint64 = 1 << 20
View Source
const UnixfsLinksPerLevel = 1024
View Source
const UpgradeAssemblyHeight = 138720
View Source
const UpgradeBreezeHeight = 41280
View Source
const UpgradeCalicoHeight = 265200
View Source
const UpgradeChocolateHeight = 1231620

2021-10-26T13:30:00Z

View Source
const UpgradeHyperdriveHeight = 892800

2021-06-30T22:00:00Z

View Source
const UpgradeIgnitionHeight = 94000
View Source
const UpgradeKumquatHeight = 170000
View Source
const UpgradeLiftoffHeight = 148888

This signals our tentative epoch for mainnet launch. Can make it later, but not earlier. Miners, clients, developers, custodians all need time to prepare. We still have upgrades and state changes to do, but can happen after signaling timing here.

View Source
const UpgradeNorwegianHeight = 665280

2021-04-12T22:00:00Z

View Source
const UpgradeOrangeHeight = 336458
View Source
const UpgradePersianHeight = UpgradeCalicoHeight + (builtin2.EpochsInHour * 60)
View Source
const UpgradeRefuelHeight = 130800
View Source
const UpgradeSmokeHeight = 51000
View Source
const UpgradeTapeHeight = 140760
View Source
const UpgradeTrustHeight = 550321

2021-03-04T00:00:30Z

View Source
const UpgradeTurboHeight = 712320

2021-04-29T06:00:00Z

View Source
const VerifSigCacheSize = 32000

Size of signature verification cache 32k keeps the cache around 10MB in size, max

View Source
const WRatioDen = uint64(2)
View Source
const WRatioNum = int64(1)

constants for Weight calculation The ratio of weight contributed by short-term vs long-term factors in a given round

Variables

View Source
var (
	DefaultFDLimit uint64 = 16 << 10
	MinerFDLimit   uint64 = 100_000
)

Blocks (e)

View Source
var BuildType int
View Source
var Clock = clock.New()

Clock is the global clock for the system. In standard builds, we use a real-time clock, which maps to the `time` package.

Tests that need control of time can replace this variable with clock.NewMock(). Always use real time for socket/stream deadlines.

View Source
var CurrentCommit string
View Source
var Devnet = true
View Source
var DisableBuiltinAssets = false

DisableBuiltinAssets disables the resolution of go.rice boxes that store built-in assets, such as proof parameters, bootstrap peers, genesis blocks, etc.

When this value is set to true, it is expected that the user will provide any such configurations through the Lotus API itself.

This is useful when you're using Lotus as a library, such as to orchestrate test scenarios, or for other purposes where you don't need to use the defaults shipped with the binary.

For this flag to be effective, it must be enabled _before_ instantiating Lotus.

View Source
var DrandConfigs = map[DrandEnum]dtypes.DrandConfig{
	DrandMainnet: {
		Servers: []string{
			"https://api.drand.sh",
			"https://api2.drand.sh",
			"https://api3.drand.sh",
			"https://drand.cloudflare.com",
		},
		Relays: []string{
			"/dnsaddr/api.drand.sh/",
			"/dnsaddr/api2.drand.sh/",
			"/dnsaddr/api3.drand.sh/",
		},
		ChainInfoJSON: `{"public_key":"868f005eb8e6e4ca0a47c8a77ceaa5309a47978a7c71bc5cce96366b5d7a569937c529eeda66c7293784a9402801af31","period":30,"genesis_time":1595431050,"hash":"8990e7a9aaed2ffed73dbd7092123d6f289930540d7651336225dc172e51b2ce","groupHash":"176f93498eac9ca337150b46d21dd58673ea4e3581185f869672e59fa4cb390a"}`,
	},
	DrandTestnet: {
		Servers: []string{
			"https://pl-eu.testnet.drand.sh",
			"https://pl-us.testnet.drand.sh",
			"https://pl-sin.testnet.drand.sh",
		},
		Relays: []string{
			"/dnsaddr/pl-eu.testnet.drand.sh/",
			"/dnsaddr/pl-us.testnet.drand.sh/",
			"/dnsaddr/pl-sin.testnet.drand.sh/",
		},
		ChainInfoJSON: `{"public_key":"922a2e93828ff83345bae533f5172669a26c02dc76d6bf59c80892e12ab1455c229211886f35bb56af6d5bea981024df","period":25,"genesis_time":1590445175,"hash":"84b2234fb34e835dccd048255d7ad3194b81af7d978c3bf157e3469592ae4e02","groupHash":"4dd408e5fdff9323c76a9b6f087ba8fdc5a6da907bd9217d9d10f2287d081957"}`,
	},
	DrandDevnet: {
		Servers: []string{
			"https://dev1.drand.sh",
			"https://dev2.drand.sh",
		},
		Relays: []string{
			"/dnsaddr/dev1.drand.sh/",
			"/dnsaddr/dev2.drand.sh/",
		},
		ChainInfoJSON: `{"public_key":"8cda589f88914aa728fd183f383980b35789ce81b274e5daee1f338b77d02566ef4d3fb0098af1f844f10f9c803c1827","period":25,"genesis_time":1595348225,"hash":"e73b7dc3c4f6a236378220c0dd6aa110eb16eed26c11259606e07ee122838d4f","groupHash":"567d4785122a5a3e75a9bc9911d7ea807dd85ff76b78dc4ff06b075712898607"}`,
	},
	DrandIncentinet: {
		ChainInfoJSON: `{"public_key":"8cad0c72c606ab27d36ee06de1d5b2db1faf92e447025ca37575ab3a8aac2eaae83192f846fc9e158bc738423753d000","period":30,"genesis_time":1595873820,"hash":"80c8b872c714f4c00fdd3daa465d5514049f457f01f85a4caf68cdcd394ba039","groupHash":"d9406aaed487f7af71851b4399448e311f2328923d454e971536c05398ce2d9b"}`,
	},
}
View Source
var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
	0:                  DrandIncentinet,
	UpgradeSmokeHeight: DrandMainnet,
}
View Source
var InitialFilReserved *big.Int
View Source
var InitialRewardBalance *big.Int
View Source
var InsecurePoStValidation = false
View Source
var MinDealDuration, MaxDealDuration = policy.DealDurationBounds(0)

Actor consts TODO: pieceSize unused from actors

View Source
var PanicReportJournalTail = defaultJournalTail

PanicReportJournalTail is the number of lines captured from the end of the lotus journal to be included in the panic report.

View Source
var PanicReportingPath = "panic-reports"

PanicReportingPath is the name of the subdir created within the repoPath path provided to GeneratePanicReport

View Source
var UpgradeClausHeight = abi.ChainEpoch(343200)

2020-12-22T02:00:00Z

View Source
var UpgradeOhSnapHeight = abi.ChainEpoch(1594680)

2022-03-01T15:00:00Z

View Source
var WhitelistedBlock = MustParseCid("bafy2bzaceapyg2uyzk7vueh3xccxkuwbz3nxewjyguoxvhx77malc2lzn2ybi")

we skip checks on message validity in this block to sidestep the zero-bls signature

View Source
var ZeroAddress = MustParseAddress("f3yaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaby2smx7a")

the 'f' prefix doesn't matter

Functions

func BlocksTopic added in v0.3.0

func BlocksTopic(netName dtypes.NetworkName) string

func BuildTypeString added in v1.13.0

func BuildTypeString() string

func BuiltinBootstrap

func BuiltinBootstrap() ([]peer.AddrInfo, error)

func DhtProtocolName added in v0.3.0

func DhtProtocolName(netName dtypes.NetworkName) protocol.ID

func DrandConfigSchedule added in v0.7.0

func DrandConfigSchedule() dtypes.DrandSchedule

func GeneratePanicReport added in v1.13.0

func GeneratePanicReport(persistPath, repoPath, label string)

GeneratePanicReport produces a timestamped dump of the application state for inspection and debugging purposes. Call this function from any place where a panic or severe error needs to be examined. `persistPath` is the path where the reports should be saved. `repoPath` is the path where the journal should be read from. `label` is an optional string to include next to the report timestamp.

func IsNearUpgrade added in v1.4.0

func IsNearUpgrade(epoch, upgradeEpoch abi.ChainEpoch) bool

func MaybeGenesis

func MaybeGenesis() []byte

func MessagesTopic added in v0.3.0

func MessagesTopic(netName dtypes.NetworkName) string

func MustParseAddress added in v1.2.0

func MustParseAddress(addr string) address.Address

func MustParseCid added in v1.9.0

func MustParseCid(c string) cid.Cid

func OpenRPCDiscoverJSON_Full added in v1.9.0

func OpenRPCDiscoverJSON_Full() apitypes.OpenRPCDocument

func OpenRPCDiscoverJSON_Miner added in v1.9.0

func OpenRPCDiscoverJSON_Miner() apitypes.OpenRPCDocument

func OpenRPCDiscoverJSON_Worker added in v1.9.0

func OpenRPCDiscoverJSON_Worker() apitypes.OpenRPCDocument

func ParametersJSON added in v0.3.1

func ParametersJSON() []byte

func SetAddressNetwork added in v0.8.1

func SetAddressNetwork(n address.Network)

func SrsJSON added in v1.10.0

func SrsJSON() []byte

func UserVersion added in v0.1.1

func UserVersion() string

Types

type DrandEnum added in v0.5.0

type DrandEnum int
const (
	DrandMainnet DrandEnum = iota + 1
	DrandTestnet
	DrandDevnet
	DrandLocalnet
	DrandIncentinet
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL