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(fip0081): initialPledge calculation & ramp, plus migration tests #12526

Merged
merged 3 commits into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@ -13,6 +13,7 @@ Add `EthGetBlockReceipts` RPC method to retrieve transaction receipts for a spec
* [Checkpoint TipSets finalized by F3](https://github.com/filecoin-project/lotus/pull/12460): Once a decision is made by F3, the TipSet is check-pointed in `ChainStore`. As part of this change, any missing TipSets are asynchronously synced as required by the `ChainStore` checkpointing mechanism.
* Add an environment variable, `F3_INITIAL_POWERTABLE_CID` to allow specifying the initial power table used by F3 ([filecoin-project/lotus#12502](https://github.com/filecoin-project/lotus/pull/12502)). This may be used to help a lotus node re-sync the F3 chain when syncing from a snapshot after the F3 upgrade epoch. The precise CID to use here won't be known until the F3 is officially "live".
* Added `StateMinerInitialPledgeForSector` RPC method and deprecated existing `StateMinerInitialPledgeCollateral` method. Since ProveCommitSectors3 and ProveReplicaUpdates3, sector onboarding no longer includes an explicit notion of "deals", and precommit messages no longer contain deal information. This makes the existing `StateMinerInitialPledgeCollateral` unable to properly calculate pledge requirements with only the precommit. `StateMinerInitialPledgeForSector` is a new simplified calculator that simply takes duration, sector size, and verified size and estimates pledge based on current network conditions. Please note that the `StateMinerInitialPledgeCollateral` method will be removed entirely in the next non-patch release. ([filecoin-project/lotus#12384](https://github.com/filecoin-project/lotus/pull/12384)
* Implement [FIP-0081](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0081.md) and its migration for NV24. Initial pledge collateral will now be calculated using a 70% / 30% split between "simple" and "baseline" in the initial consensus pledge contribution to collateral calculation. The change in this calculation will begin at NV24 activation and ramp up from the current split of 100% / 0% to the eventual 70% / 30% over the course of a year so as to minimise impact on existing operations. ([filecoin-project/lotus#12526](https://github.com/filecoin-project/lotus/pull/12526)

## Improvements

Expand Down
Binary file modified build/actors/v15.tar.zst
Binary file not shown.
5 changes: 5 additions & 0 deletions build/buildconstants/params_2k.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ var UpgradeWaffleHeight = abi.ChainEpoch(-26)

var UpgradeTuktukHeight = abi.ChainEpoch(200)

// FIP-0081: for the power actor state for pledge calculations.
// UpgradeTuktukPowerRampDurationEpochs ends up in the power actor state after
// Tuktuk migration. along with a RampStartEpoch matching the upgrade height.
var UpgradeTuktukPowerRampDurationEpochs uint64 = 200

// This fix upgrade only ran on calibrationnet
const UpgradeWatermelonFixHeight = -100

Expand Down
7 changes: 7 additions & 0 deletions build/buildconstants/params_butterfly.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import (
"github.com/filecoin-project/go-state-types/abi"
"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/builtin"
)

var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
Expand Down Expand Up @@ -58,6 +60,11 @@ const UpgradeWaffleHeight = -27
// ??????
const UpgradeTuktukHeight = 999999999999999

// FIP-0081: for the power actor state for pledge calculations.
// UpgradeTuktukPowerRampDurationEpochs ends up in the power actor state after
// Tuktuk migration. along with a RampStartEpoch matching the upgrade height.
var UpgradeTuktukPowerRampDurationEpochs = uint64(builtin.EpochsInYear)

// This fix upgrade only ran on calibrationnet
const UpgradeWatermelonFixHeight = -100

Expand Down
10 changes: 10 additions & 0 deletions build/buildconstants/params_calibnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import (
"github.com/filecoin-project/go-state-types/abi"
"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/builtin"
)

var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
Expand Down Expand Up @@ -100,6 +102,14 @@ const UpgradeWaffleHeight = 1779094
// ??????
const UpgradeTuktukHeight = 999999999999999

// FIP-0081: for the power actor state for pledge calculations.
// UpgradeTuktukPowerRampDurationEpochs ends up in the power actor state after
// Tuktuk migration. along with a RampStartEpoch matching the upgrade height.
//
// For calibrationnet, we set this to 3 days so we can observe and confirm the
// ramp behavior before mainnet upgrade.
rvagg marked this conversation as resolved.
Show resolved Hide resolved
var UpgradeTuktukPowerRampDurationEpochs = uint64(builtin.EpochsInDay * 3)

var SupportedProofTypes = []abi.RegisteredSealProof{
abi.RegisteredSealProof_StackedDrg32GiBV1,
abi.RegisteredSealProof_StackedDrg64GiBV1,
Expand Down
7 changes: 7 additions & 0 deletions build/buildconstants/params_interop.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import (
"github.com/filecoin-project/go-state-types/abi"
"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/builtin"
)

var NetworkBundle = "caterpillarnet"
Expand Down Expand Up @@ -56,6 +58,11 @@ var UpgradeWaffleHeight = abi.ChainEpoch(-27)

const UpgradeTuktukHeight = 50

// FIP-0081: for the power actor state for pledge calculations.
// UpgradeTuktukPowerRampDurationEpochs ends up in the power actor state after
// Tuktuk migration. along with a RampStartEpoch matching the upgrade height.
var UpgradeTuktukPowerRampDurationEpochs = uint64(builtin.EpochsInYear)

// This fix upgrade only ran on calibrationnet
const UpgradeWatermelonFixHeight = -1

Expand Down
9 changes: 8 additions & 1 deletion build/buildconstants/params_mainnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import (
"github.com/filecoin-project/go-state-types/abi"
"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/builtin"
)

var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
Expand Down Expand Up @@ -110,6 +112,11 @@ const UpgradeWaffleHeight abi.ChainEpoch = 4154640
// ??????
var UpgradeTuktukHeight = abi.ChainEpoch(9999999999)

// FIP-0081: for the power actor state for pledge calculations.
// UpgradeTuktukPowerRampDurationEpochs ends up in the power actor state after
// Tuktuk migration. along with a RampStartEpoch matching the upgrade height.
var UpgradeTuktukPowerRampDurationEpochs = uint64(builtin.EpochsInYear)

// This fix upgrade only ran on calibrationnet
const UpgradeWatermelonFixHeight abi.ChainEpoch = -1

Expand Down Expand Up @@ -174,7 +181,7 @@ var WhitelistedBlock = cid.MustParse("bafy2bzaceapyg2uyzk7vueh3xccxkuwbz3nxewjyg
var F3ManifestServerID = MustParseID("12D3KooWENMwUF9YxvQxar7uBWJtZkA6amvK4xWmKXfSiHUo2Qq7")

// The initial F3 power table CID.
var F3InitialPowerTableCID cid.Cid = cid.Undef
var F3InitialPowerTableCID = cid.Undef

const F3Enabled = true
const F3BootstrapEpoch abi.ChainEpoch = -1
Expand Down
2 changes: 2 additions & 0 deletions build/buildconstants/params_testground.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ var (
UpgradeWaffleHeight abi.ChainEpoch = -29
UpgradeTuktukHeight abi.ChainEpoch = -30

UpgradeTuktukPowerRampDurationEpochs uint64 = 0

DrandSchedule = map[abi.ChainEpoch]DrandEnum{
0: DrandMainnet,
UpgradePhoenixHeight: DrandQuicknet,
Expand Down
Loading
Loading