Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: api: Clean API for Miners #12112

Merged
merged 30 commits into from
Jul 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
156dda9
proofparams alternate
snadrus Jun 19, 2024
f6d4075
createminer
snadrus Jun 19, 2024
b10c5ff
const factored from /build and types updated to use it
snadrus Jun 20, 2024
f4cf250
buildconstants for more places
snadrus Jun 20, 2024
08f126c
deprecate msg
snadrus Jun 20, 2024
36772b5
itest cleanup
snadrus Jun 20, 2024
66c9252
alerting interface
snadrus Jun 20, 2024
883469a
house cleaning
snadrus Jun 20, 2024
856ea4b
rm policy and drand from buildconstants
snadrus Jun 20, 2024
8d8894a
clean up curio further
snadrus Jun 20, 2024
35602b4
Merge branch 'master' into curioAvoidBuildFolder
snadrus Jun 20, 2024
ee8226e
aussie waffle
snadrus Jun 20, 2024
f1a6572
pr fixes
snadrus Jun 21, 2024
fc36dcc
fix lints
snadrus Jun 21, 2024
7a1cc4d
little fixes
snadrus Jun 24, 2024
ca58e1a
Merge branch 'master' into curioAvoidBuildFolder
snadrus Jul 11, 2024
3b0fecd
oops this got updated
snadrus Jul 11, 2024
12ba6f2
unbreak test builds
snadrus Jul 11, 2024
2217b86
test fixes
snadrus Jul 11, 2024
795a865
comments - cleanups
snadrus Jul 12, 2024
81387ca
itests fix alerting
snadrus Jul 12, 2024
7272177
rm obsolete alertinginterface
snadrus Jul 12, 2024
7639a07
spelling oops
snadrus Jul 12, 2024
d0eb1dc
Merge branch 'master' into curioAvoidBuildFolder
snadrus Jul 12, 2024
320c31f
changelog
snadrus Jul 12, 2024
86b9797
tests need buildconstants port
snadrus Jul 12, 2024
20947d2
Fully migrate BlockGasTarget
snadrus Jul 12, 2024
21ca683
ulimit should not depend on build
snadrus Jul 12, 2024
bec5965
complete the simplest deprecations
snadrus Jul 12, 2024
3d830f0
bringing back versions
snadrus Jul 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- https://github.com/filecoin-project/lotus/pull/12203: Fix slice modification bug in ETH Tx Events Bloom Filter
- https://github.com/filecoin-project/lotus/pull/12221: Fix a nil reference panic in the ETH Trace API
- https://github.com/filecoin-project/lotus/pull/12112: Moved consts from build/ to build/buildconstants/ for ligher curio deps.

## ☢️ Upgrade Warnings ☢️

Expand Down
12 changes: 12 additions & 0 deletions build/buildconstants/drand.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package buildconstants

type DrandEnum int

const (
DrandMainnet DrandEnum = iota + 1
DrandTestnet
DrandDevnet
DrandLocalnet
DrandIncentinet
DrandQuicknet
)
6 changes: 6 additions & 0 deletions build/buildconstants/limits.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package buildconstants

var (
DefaultFDLimit uint64 = 16 << 10
MinerFDLimit uint64 = 100_000
)
25 changes: 25 additions & 0 deletions build/buildconstants/params.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package buildconstants

import "github.com/filecoin-project/go-state-types/network"

var BuildType int

const (
BuildDefault = 0
BuildMainnet = 0x1
Build2k = 0x2
BuildDebug = 0x3
BuildCalibnet = 0x4
BuildInteropnet = 0x5
BuildButterflynet = 0x7
)

var Devnet = true

// Used by tests and some obscure tooling
/* inline-gen template
const TestNetworkVersion = network.Version{{.latestNetworkVersion}}
/* inline-gen start */
const TestNetworkVersion = network.Version23

/* inline-gen end */
13 changes: 2 additions & 11 deletions build/params_2k.go → build/buildconstants/params_2k.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//go:build debug || 2k
// +build debug 2k

package build
package buildconstants

import (
"os"
Expand All @@ -10,17 +10,13 @@ import (
"github.com/ipfs/go-cid"

"github.com/filecoin-project/go-state-types/abi"
actorstypes "github.com/filecoin-project/go-state-types/actors"
"github.com/filecoin-project/go-state-types/network"

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

const BootstrappersFile = ""
const GenesisFile = ""

var NetworkBundle = "devnet"
var BundleOverrides map[actorstypes.Version]string
var ActorDebugging = true

var GenesisNetworkVersion = network.Version22
Expand Down Expand Up @@ -95,11 +91,6 @@ var MinVerifiedDealSize = abi.NewStoragePower(256)
var PreCommitChallengeDelay = abi.ChainEpoch(10)

func init() {
policy.SetSupportedProofTypes(SupportedProofTypes...)
policy.SetConsensusMinerMinPower(ConsensusMinerMinPower)
policy.SetMinVerifiedDealSize(MinVerifiedDealSize)
policy.SetPreCommitChallengeDelay(PreCommitChallengeDelay)
snadrus marked this conversation as resolved.
Show resolved Hide resolved

getGenesisNetworkVersion := func(ev string, def network.Version) network.Version {
hs, found := os.LookupEnv(ev)
if found {
Expand Down Expand Up @@ -189,6 +180,6 @@ const Eip155ChainId = 31415926

var WhitelistedBlock = cid.Undef

const f3Enabled = true
const F3Enabled = true
const ManifestServerID = "12D3KooWHcNBkqXEBrsjoveQvj6zDF3vK5S9tAfqyYaQF1LGSJwG"
const F3BootstrapEpoch abi.ChainEpoch = 100
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
//go:build butterflynet
// +build butterflynet

package build
package buildconstants

import (
"github.com/ipfs/go-cid"

"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
actorstypes "github.com/filecoin-project/go-state-types/actors"
"github.com/filecoin-project/go-state-types/network"
builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin"

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

var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
Expand All @@ -22,7 +19,6 @@ var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
const GenesisNetworkVersion = network.Version22

var NetworkBundle = "butterflynet"
var BundleOverrides map[actorstypes.Version]string
var ActorDebugging = false

const BootstrappersFile = "butterflynet.pi"
Expand Down Expand Up @@ -79,11 +75,6 @@ var MinVerifiedDealSize = abi.NewStoragePower(1 << 20)
var PreCommitChallengeDelay = abi.ChainEpoch(150)

func init() {
policy.SetSupportedProofTypes(SupportedProofTypes...)
policy.SetConsensusMinerMinPower(ConsensusMinerMinPower)
policy.SetMinVerifiedDealSize(MinVerifiedDealSize)
policy.SetPreCommitChallengeDelay(PreCommitChallengeDelay)

SetAddressNetwork(address.Testnet)

Devnet = true
Expand All @@ -106,6 +97,6 @@ const Eip155ChainId = 3141592

var WhitelistedBlock = cid.Undef

const f3Enabled = true
const F3Enabled = true
const ManifestServerID = "12D3KooWJr9jy4ngtJNR7JC1xgLFra3DjEtyxskRYWvBK9TC3Yn6"
const F3BootstrapEpoch abi.ChainEpoch = 200
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//go:build calibnet
// +build calibnet

package build
package buildconstants

import (
"os"
Expand All @@ -11,11 +11,8 @@ import (

"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
actorstypes "github.com/filecoin-project/go-state-types/actors"
"github.com/filecoin-project/go-state-types/network"
builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin"

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

var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
Expand All @@ -26,7 +23,6 @@ var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
const GenesisNetworkVersion = network.Version0

var NetworkBundle = "calibrationnet"
var BundleOverrides map[actorstypes.Version]string
var ActorDebugging = false

const BootstrappersFile = "calibnet.pi"
Expand Down Expand Up @@ -110,11 +106,6 @@ var MinVerifiedDealSize = abi.NewStoragePower(1 << 20)
var PreCommitChallengeDelay = abi.ChainEpoch(150)

func init() {
policy.SetSupportedProofTypes(SupportedProofTypes...)
policy.SetConsensusMinerMinPower(ConsensusMinerMinPower)
policy.SetMinVerifiedDealSize(MinVerifiedDealSize)
policy.SetPreCommitChallengeDelay(PreCommitChallengeDelay)

SetAddressNetwork(address.Testnet)

Devnet = true
Expand Down Expand Up @@ -152,6 +143,6 @@ const Eip155ChainId = 314159

var WhitelistedBlock = cid.Undef

const f3Enabled = true
const F3Enabled = true
const ManifestServerID = "12D3KooWS9vD9uwm8u2uPyJV32QBAhKAmPYwmziAgr3Xzk2FU1Mr"
const F3BootstrapEpoch abi.ChainEpoch = UpgradeWaffleHeight + 100
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//go:build debug
// +build debug

package build
package buildconstants

func init() {
InsecurePoStValidation = true
Expand Down
16 changes: 5 additions & 11 deletions build/params_interop.go → build/buildconstants/params_interop.go
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
//go:build interopnet
// +build interopnet

package build
package buildconstants

import (
"os"
"strconv"

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

"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
actorstypes "github.com/filecoin-project/go-state-types/actors"
"github.com/filecoin-project/go-state-types/network"
builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin"

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

var log = logging.Logger("buildconstants")

var NetworkBundle = "caterpillarnet"
var BundleOverrides map[actorstypes.Version]string
var ActorDebugging = false

const BootstrappersFile = "interopnet.pi"
Expand Down Expand Up @@ -82,11 +81,6 @@ var MinVerifiedDealSize = abi.NewStoragePower(256)
var PreCommitChallengeDelay = abi.ChainEpoch(10)

func init() {
policy.SetSupportedProofTypes(SupportedProofTypes...)
policy.SetConsensusMinerMinPower(ConsensusMinerMinPower)
policy.SetMinVerifiedDealSize(MinVerifiedDealSize)
policy.SetPreCommitChallengeDelay(PreCommitChallengeDelay)

getUpgradeHeight := func(ev string, def abi.ChainEpoch) abi.ChainEpoch {
hs, found := os.LookupEnv(ev)
if found {
Expand Down Expand Up @@ -145,6 +139,6 @@ const Eip155ChainId = 3141592

var WhitelistedBlock = cid.Undef

const f3Enabled = true
const F3Enabled = true
const ManifestServerID = "12D3KooWQJ2rdVnG4okDUB6yHQhAjNutGNemcM7XzqC9Eo4z9Jce"
const F3BootstrapEpoch abi.ChainEpoch = 1000
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//go:build !debug && !2k && !testground && !calibnet && !butterflynet && !interopnet
// +build !debug,!2k,!testground,!calibnet,!butterflynet,!interopnet

package build
package buildconstants

import (
"math"
Expand All @@ -10,7 +10,6 @@ import (

"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
actorstypes "github.com/filecoin-project/go-state-types/actors"
"github.com/filecoin-project/go-state-types/network"
builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin"
)
Expand All @@ -23,8 +22,7 @@ var DrandSchedule = map[abi.ChainEpoch]DrandEnum{

var NetworkBundle = "mainnet"

// NOTE: DO NOT change this unless you REALLY know what you're doing. This is consensus critical.
var BundleOverrides map[actorstypes.Version]string
ZenGround0 marked this conversation as resolved.
Show resolved Hide resolved
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 Expand Up @@ -169,6 +167,6 @@ const Eip155ChainId = 314
// WhitelistedBlock skips checks on message validity in this block to sidestep the zero-bls signature
var WhitelistedBlock = MustParseCid("bafy2bzaceapyg2uyzk7vueh3xccxkuwbz3nxewjyguoxvhx77malc2lzn2ybi")

const f3Enabled = false
const F3Enabled = false
const ManifestServerID = "12D3KooWENMwUF9YxvQxar7uBWJtZkA6amvK4xWmKXfSiHUo2Qq7"
const F3BootstrapEpoch abi.ChainEpoch = -1
Loading