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

build: backport changes for Node and Miner v1.32.0-rc2 #12776

Merged
merged 9 commits into from
Dec 13, 2024
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ For certain node operators, such as full archival nodes or systems that need to

- The miner actor builtin `QAPowerForWeight` no longer accepts the unused "dealWeight" parameter, the function signature now only takes 3 arguments: sectorSize, sectorDuration, verifiedWeight. ([filecoin-project/lotus#12445](https://github.com/filecoin-project/lotus/pull/12445))
- Fix checkpointed tipsets being expanded ([filecoin-project/lotus#12747](https://github.com/filecoin-project/lotus/pull/12747))
- Remove IPNI advertisement relay over pubsub via Lotus node as it now has been deprecated. ([filecoin-project/lotus#12768](https://github.com/filecoin-project/lotus/pull/12768)

## Bug Fixes

Expand Down
4 changes: 2 additions & 2 deletions build/buildconstants/params_calibnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ const UpgradeWaffleHeight = 1779094
// 2024-10-23T13:30:00Z
const UpgradeTuktukHeight = 2078794

// 2024-12-16T23:00:00Z
const UpgradeTeepHeight = 2235454
// Canceled - See update in: https://github.com/filecoin-project/community/discussions/74#discussioncomment-11549619
const UpgradeTeepHeight = 9999999999

// FIP-0081: for the power actor state for pledge calculations.
// UpgradeTuktukPowerRampDurationEpochs ends up in the power actor state after
Expand Down
11 changes: 0 additions & 11 deletions build/params_shared_funcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,6 @@ import (

func BlocksTopic(netName dtypes.NetworkName) string { return "/fil/blocks/" + string(netName) }
func MessagesTopic(netName dtypes.NetworkName) string { return "/fil/msgs/" + string(netName) }
func IndexerIngestTopic(netName dtypes.NetworkName) string {

nn := string(netName)
// The network name testnetnet is here for historical reasons.
// Going forward we aim to use the name `mainnet` where possible.
if nn == "testnetnet" {
nn = "mainnet"
}

return "/indexer/ingest/" + nn
}
func DhtProtocolName(netName dtypes.NetworkName) protocol.ID {
return protocol.ID("/fil/kad/" + string(netName))
}
Expand Down
5 changes: 4 additions & 1 deletion chain/actors/builtin/power/actor.go.template
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,10 @@ type State interface {
MinerPower(address.Address) (Claim, bool, error)
MinerNominalPowerMeetsConsensusMinimum(address.Address) (bool, error)
ListAllMiners() ([]address.Address, error)
ForEachClaim(func(miner address.Address, claim Claim) error) error
// ForEachClaim iterates over claims in the power actor.
// If onlyEligible is true, it applies the MinerNominalPowerMeetsConsensusMinimum check
// before returning the actor.
ForEachClaim(cb func(miner address.Address, claim Claim) error, onlyEligible bool) error
ClaimsChanged(State) (bool, error)

// Testing or genesis setup only
Expand Down
5 changes: 4 additions & 1 deletion chain/actors/builtin/power/power.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,10 @@ type State interface {
MinerPower(address.Address) (Claim, bool, error)
MinerNominalPowerMeetsConsensusMinimum(address.Address) (bool, error)
ListAllMiners() ([]address.Address, error)
ForEachClaim(func(miner address.Address, claim Claim) error) error
// ForEachClaim iterates over claims in the power actor.
// If onlyEligible is true, it applies the MinerNominalPowerMeetsConsensusMinimum check
// before returning the actor.
ForEachClaim(cb func(miner address.Address, claim Claim) error, onlyEligible bool) error
ClaimsChanged(State) (bool, error)

// Testing or genesis setup only
Expand Down
28 changes: 23 additions & 5 deletions chain/actors/builtin/power/state.go.template
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ func (s *state{{.v}}) ListAllMiners() ([]address.Address, error) {
return miners, nil
}

func (s *state{{.v}}) ForEachClaim(cb func(miner address.Address, claim Claim) error) error {
func (s *state{{.v}}) ForEachClaim(cb func(miner address.Address, claim Claim) error, onlyEligible bool) error {
claims, err := s.claims()
if err != nil {
return err
Expand All @@ -159,10 +159,28 @@ func (s *state{{.v}}) ForEachClaim(cb func(miner address.Address, claim Claim) e
if err != nil {
return err
}
return cb(a, Claim{
RawBytePower: claim.RawBytePower,
QualityAdjPower: claim.QualityAdjPower,
})
if !onlyEligible {
return cb(a, Claim{
RawBytePower: claim.RawBytePower,
QualityAdjPower: claim.QualityAdjPower,
})
}
{{if (ge .v 8)}}
eligible, err := s.State.ClaimMeetsConsensusMinimums(&claim)
{{else}}
//slow path
eligible, err := s.State.MinerNominalPowerMeetsConsensusMinimum(s.store, a)
{{end}}
if err != nil {
return fmt.Errorf("checking consensus minimums: %w", err)
}
if eligible {
return cb(a, Claim{
RawBytePower: claim.RawBytePower,
QualityAdjPower: claim.QualityAdjPower,
})
}
return nil
})
}

Expand Down
26 changes: 21 additions & 5 deletions chain/actors/builtin/power/v0.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 20 additions & 5 deletions chain/actors/builtin/power/v10.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 20 additions & 5 deletions chain/actors/builtin/power/v11.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 20 additions & 5 deletions chain/actors/builtin/power/v12.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 20 additions & 5 deletions chain/actors/builtin/power/v13.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 20 additions & 5 deletions chain/actors/builtin/power/v14.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 20 additions & 5 deletions chain/actors/builtin/power/v15.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading