diff --git a/CHANGELOG.md b/CHANGELOG.md index 7942cbaeb7b..c5f4d04ec20 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,10 +20,16 @@ - chore: upgrade to a minimum Golang version of `1.23.6` ([filecoin-project/lotus#12910](https://github.com/filecoin-project/lotus/pull/12910) - feat: add a `LOTUS_DISABLE_F3_ACTIVATION` enviroment variable allowing disabling F3 activation for a specific contract address or epoch ([filecoin-project/lotus#12920](https://github.com/filecoin-project/lotus/pull/12920)). The `LOTUS_DISABLE_F3` env-var has been renamed to `LOTUS_DISABLE_F3_SUBSYSTEM` to distinguish it from the other F3-related environment variables: `LOTUS_DISABLE_F3_PASSIVE_TESTING` and `LOTUS_DISABLE_F3_ACTIVATION`. - feat: add `GenesisTimestamp` field to `StateGetNetworkParams` response ([filecoin-project/lotus#12925](https://github.com/filecoin-project/lotus/pull/12925)) -- chore: upgrade drand client +- chore: upgrade drand client. ([filecoin-project/lotus#12830](https://github.com/filecoin-project/lotus/pull/12830)) - chore: upgrade go-state-types with big.Int{} change that means an empty big.Int is now treated as zero for all operations ([filecoin-project/lotus#12936](https://github.com/filecoin-project/lotus/pull/12936)) - feat: expose `ChainGetMessagesInTipset` in the Lotus Gateway API ([filecoin-project/lotus#12947](https://github.com/filecoin-project/lotus/pull/12947)) - feat: add `Agent` to the `Filecoin.Version` response ([#12904](https://github.com/filecoin-project/lotus/issues/12904)) that will be used to identify the node type. +- feat!: [FIP-0100](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0100.md) and [FIP-0098](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0098.md) implementation ([filecoin-project/lotus#12942](https://github.com/filecoin-project/lotus/pull/12942)) + - Adds a scheduled nv26 "Tock" upgrade exactly 90 days after nv25 to signal the end of the sector extensions grace period for FIP-0100 + - Deadlines on the public API now have a `DailyFee` field + - `DealIDs` has now been removed from the public API's `SectorOnChainInfo` (was deprecated in FIP-0079) + - Removed `--only-cc` from `spcli sectors extend` command + - Change circulating supply calculation for calibnet, butterflynet and 2k for nv25 upgrade; see ([filecoin-project/lotus#12938](https://github.com/filecoin-project/lotus/pull/12938)) for more information # UNRELEASED v.1.32.0 diff --git a/api/api_full.go b/api/api_full.go index a8c43ac0d87..855a6b8111e 100644 --- a/api/api_full.go +++ b/api/api_full.go @@ -1398,6 +1398,7 @@ const ( type Deadline struct { PostSubmissions bitfield.BitField DisputableProofCount uint64 + DailyFee abi.TokenAmount } type Partition struct { diff --git a/api/mocks/mock_full.go b/api/mocks/mock_full.go index 7ad4415fd25..725b3d08756 100644 --- a/api/mocks/mock_full.go +++ b/api/mocks/mock_full.go @@ -28,7 +28,7 @@ import ( auth "github.com/filecoin-project/go-jsonrpc/auth" abi "github.com/filecoin-project/go-state-types/abi" big "github.com/filecoin-project/go-state-types/big" - miner "github.com/filecoin-project/go-state-types/builtin/v13/miner" + miner "github.com/filecoin-project/go-state-types/builtin/v16/miner" paych "github.com/filecoin-project/go-state-types/builtin/v8/paych" miner0 "github.com/filecoin-project/go-state-types/builtin/v9/miner" verifreg "github.com/filecoin-project/go-state-types/builtin/v9/verifreg" diff --git a/api/types.go b/api/types.go index d4d34f718b0..6943d127e35 100644 --- a/api/types.go +++ b/api/types.go @@ -194,6 +194,7 @@ type ForkUpgradeParams struct { UpgradeWaffleHeight abi.ChainEpoch UpgradeTuktukHeight abi.ChainEpoch UpgradeTeepHeight abi.ChainEpoch + UpgradeTockHeight abi.ChainEpoch } // ChainExportConfig holds configuration for chain ranged exports. diff --git a/api/v0api/v0mocks/mock_full.go b/api/v0api/v0mocks/mock_full.go index 092d93b67bf..b2a4125675a 100644 --- a/api/v0api/v0mocks/mock_full.go +++ b/api/v0api/v0mocks/mock_full.go @@ -23,7 +23,7 @@ import ( auth "github.com/filecoin-project/go-jsonrpc/auth" abi "github.com/filecoin-project/go-state-types/abi" big "github.com/filecoin-project/go-state-types/big" - miner "github.com/filecoin-project/go-state-types/builtin/v13/miner" + miner "github.com/filecoin-project/go-state-types/builtin/v16/miner" paych "github.com/filecoin-project/go-state-types/builtin/v8/paych" miner0 "github.com/filecoin-project/go-state-types/builtin/v9/miner" verifreg "github.com/filecoin-project/go-state-types/builtin/v9/verifreg" diff --git a/build/actors/v16.tar.zst b/build/actors/v16.tar.zst index bb764108bdb..dc13b8938ee 100644 Binary files a/build/actors/v16.tar.zst and b/build/actors/v16.tar.zst differ diff --git a/build/buildconstants/params_2k.go b/build/buildconstants/params_2k.go index 8679aada4ca..7b0614007dd 100644 --- a/build/buildconstants/params_2k.go +++ b/build/buildconstants/params_2k.go @@ -65,29 +65,33 @@ var UpgradeThunderHeight = abi.ChainEpoch(-23) var UpgradeWatermelonHeight = abi.ChainEpoch(-24) +// This fix upgrade only ran on calibrationnet +const UpgradeWatermelonFixHeight = -100 + +// This fix upgrade only ran on calibrationnet +const UpgradeWatermelonFix2Height = -101 + var UpgradeDragonHeight = abi.ChainEpoch(-24) +// This fix upgrade only ran on calibrationnet +const UpgradeCalibrationDragonFixHeight = -102 + var UpgradePhoenixHeight = abi.ChainEpoch(-25) var UpgradeWaffleHeight = abi.ChainEpoch(-26) var UpgradeTuktukHeight = abi.ChainEpoch(-27) -var UpgradeTeepHeight = 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 +var UpgradeTeepHeight = abi.ChainEpoch(200) -// This fix upgrade only ran on calibrationnet -const UpgradeWatermelonFix2Height = -101 +var UpgradeTeepInitialFilReserved = wholeFIL(1_400_000_000) // FIP-0100: 300M -> 1.4B FIL -// This fix upgrade only ran on calibrationnet -const UpgradeCalibrationDragonFixHeight = -102 +var UpgradeTockHeight = abi.ChainEpoch(300) var DrandSchedule = map[abi.ChainEpoch]DrandEnum{ 0: DrandQuicknet, @@ -166,6 +170,7 @@ func init() { UpgradePhoenixHeight = getUpgradeHeight("LOTUS_PHOENIX_HEIGHT", UpgradePhoenixHeight) UpgradeTuktukHeight = getUpgradeHeight("LOTUS_TUKTUK_HEIGHT", UpgradeTuktukHeight) UpgradeTeepHeight = getUpgradeHeight("LOTUS_TEEP_HEIGHT", UpgradeTeepHeight) + UpgradeTockHeight = getUpgradeHeight("LOTUS_TOCK_HEIGHT", UpgradeTockHeight) DrandSchedule = map[abi.ChainEpoch]DrandEnum{ 0: DrandQuicknet, diff --git a/build/buildconstants/params_butterfly.go b/build/buildconstants/params_butterfly.go index 7d26b28faca..363a1b525e6 100644 --- a/build/buildconstants/params_butterfly.go +++ b/build/buildconstants/params_butterfly.go @@ -53,27 +53,32 @@ const UpgradeHyggeHeight = -21 const UpgradeLightningHeight = -22 const UpgradeThunderHeight = -23 const UpgradeWatermelonHeight = -24 + +// This fix upgrade only ran on calibrationnet +const UpgradeWatermelonFixHeight = -100 + +// This fix upgrade only ran on calibrationnet +const UpgradeWatermelonFix2Height = -101 const UpgradeDragonHeight = -25 + +// This fix upgrade only ran on calibrationnet +const UpgradeCalibrationDragonFixHeight = -102 const UpgradePhoenixHeight = -26 const UpgradeWaffleHeight = -27 const UpgradeTuktukHeight = -28 -// ?????? -const UpgradeTeepHeight = 100 - // 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 +// ?????? +const UpgradeTeepHeight = 100 -// This fix upgrade only ran on calibrationnet -const UpgradeWatermelonFix2Height = -101 +var UpgradeTeepInitialFilReserved = wholeFIL(1_600_000_000) // FIP-0100: 300M -> 1.6B FIL -// This fix upgrade only ran on calibrationnet -const UpgradeCalibrationDragonFixHeight = -102 +// ?????? +const UpgradeTockHeight = 200 var ConsensusMinerMinPower = abi.NewStoragePower(2 << 30) var PreCommitChallengeDelay = abi.ChainEpoch(150) diff --git a/build/buildconstants/params_calibnet.go b/build/buildconstants/params_calibnet.go index 7d0d638fe16..92b0156f11d 100644 --- a/build/buildconstants/params_calibnet.go +++ b/build/buildconstants/params_calibnet.go @@ -30,80 +30,77 @@ var ActorDebugging = false const BootstrappersFile = "calibnet.pi" const GenesisFile = "calibnet.car.zst" -const UpgradeBreezeHeight = -1 +const UpgradeBreezeHeight abi.ChainEpoch = -1 const BreezeGasTampingDuration = 120 -const UpgradeSmokeHeight = -2 +const UpgradeSmokeHeight abi.ChainEpoch = -2 -const UpgradeIgnitionHeight = -3 -const UpgradeRefuelHeight = -4 +const UpgradeIgnitionHeight abi.ChainEpoch = -3 +const UpgradeRefuelHeight abi.ChainEpoch = -4 var UpgradeAssemblyHeight = abi.ChainEpoch(30) -const UpgradeTapeHeight = 60 +const UpgradeTapeHeight abi.ChainEpoch = 60 -const UpgradeLiftoffHeight = -5 +const UpgradeLiftoffHeight abi.ChainEpoch = -5 -const UpgradeKumquatHeight = 90 +const UpgradeKumquatHeight abi.ChainEpoch = 90 -const UpgradeCalicoHeight = 120 -const UpgradePersianHeight = UpgradeCalicoHeight + (builtin2.EpochsInHour * 1) +const UpgradeCalicoHeight abi.ChainEpoch = 120 +const UpgradePersianHeight abi.ChainEpoch = UpgradeCalicoHeight + (builtin2.EpochsInHour * 1) -const UpgradeClausHeight = 270 +const UpgradeClausHeight abi.ChainEpoch = 270 -const UpgradeOrangeHeight = 300 +const UpgradeOrangeHeight abi.ChainEpoch = 300 -const UpgradeTrustHeight = 330 +const UpgradeTrustHeight abi.ChainEpoch = 330 -const UpgradeNorwegianHeight = 360 +const UpgradeNorwegianHeight abi.ChainEpoch = 360 -const UpgradeTurboHeight = 390 +const UpgradeTurboHeight abi.ChainEpoch = 390 -const UpgradeHyperdriveHeight = 420 +const UpgradeHyperdriveHeight abi.ChainEpoch = 420 -const UpgradeChocolateHeight = 450 +const UpgradeChocolateHeight abi.ChainEpoch = 450 -const UpgradeOhSnapHeight = 480 +const UpgradeOhSnapHeight abi.ChainEpoch = 480 -const UpgradeSkyrHeight = 510 +const UpgradeSkyrHeight abi.ChainEpoch = 510 -const UpgradeSharkHeight = 16800 // 6 days after genesis +const UpgradeSharkHeight abi.ChainEpoch = 16800 // 6 days after genesis // 2023-02-21T16:30:00Z -const UpgradeHyggeHeight = 322354 +const UpgradeHyggeHeight abi.ChainEpoch = 322354 // 2023-04-20T14:00:00Z -const UpgradeLightningHeight = 489094 +const UpgradeLightningHeight abi.ChainEpoch = 489094 // 2023-04-21T16:00:00Z -const UpgradeThunderHeight = UpgradeLightningHeight + 3120 +const UpgradeThunderHeight abi.ChainEpoch = UpgradeLightningHeight + 3120 // 2023-10-19T13:00:00Z -const UpgradeWatermelonHeight = 1013134 +const UpgradeWatermelonHeight abi.ChainEpoch = 1013134 // 2023-11-07T13:00:00Z -const UpgradeWatermelonFixHeight = 1070494 +const UpgradeWatermelonFixHeight abi.ChainEpoch = 1070494 // 2023-11-21T13:00:00Z -const UpgradeWatermelonFix2Height = 1108174 +const UpgradeWatermelonFix2Height abi.ChainEpoch = 1108174 // 2024-03-11T14:00:00Z -const UpgradeDragonHeight = 1427974 +const UpgradeDragonHeight abi.ChainEpoch = 1427974 // This epoch, 120 epochs after the "rest" of the nv22 upgrade, is when we switch to Drand quicknet -const UpgradePhoenixHeight = UpgradeDragonHeight + 120 +const UpgradePhoenixHeight abi.ChainEpoch = UpgradeDragonHeight + 120 // 2024-04-03T11:00:00Z -const UpgradeCalibrationDragonFixHeight = 1493854 +const UpgradeCalibrationDragonFixHeight abi.ChainEpoch = 1493854 // 2024-07-11T12:00:00Z -const UpgradeWaffleHeight = 1779094 +const UpgradeWaffleHeight abi.ChainEpoch = 1779094 // 2024-10-23T13:30:00Z -const UpgradeTuktukHeight = 2078794 - -// 2025-03-25T23:00:00Z -const UpgradeTeepHeight = 2520574 +const UpgradeTuktukHeight abi.ChainEpoch = 2078794 // FIP-0081: for the power actor state for pledge calculations. // UpgradeTuktukPowerRampDurationEpochs ends up in the power actor state after @@ -113,6 +110,15 @@ const UpgradeTeepHeight = 2520574 // ramp behavior before mainnet upgrade. var UpgradeTuktukPowerRampDurationEpochs = uint64(builtin.EpochsInDay * 3) +// 2025-03-25T23:00:00Z +const UpgradeTeepHeight abi.ChainEpoch = 2520574 + +var UpgradeTeepInitialFilReserved = wholeFIL(1_200_000_000) // FIP-0100: 300M -> 1.2B FIL + +// This epoch, 7 days after Teep is the completion of FIP-0100 where actors will start applying +// the new daily fee to pre-Teep sectors being extended. This is 90 days on mainnet. +var UpgradeTockHeight abi.ChainEpoch = UpgradeTeepHeight + builtin.EpochsInDay*7 + var ConsensusMinerMinPower = abi.NewStoragePower(32 << 30) var PreCommitChallengeDelay = abi.ChainEpoch(150) diff --git a/build/buildconstants/params_interop.go b/build/buildconstants/params_interop.go index 1f00426535a..648ee50d2f6 100644 --- a/build/buildconstants/params_interop.go +++ b/build/buildconstants/params_interop.go @@ -52,26 +52,32 @@ var UpgradeHyggeHeight = abi.ChainEpoch(-21) var UpgradeLightningHeight = abi.ChainEpoch(-22) var UpgradeThunderHeight = abi.ChainEpoch(-23) var UpgradeWatermelonHeight = abi.ChainEpoch(-24) + +// This fix upgrade only ran on calibrationnet +const UpgradeWatermelonFixHeight abi.ChainEpoch = -1 + +// This fix upgrade only ran on calibrationnet +const UpgradeWatermelonFix2Height abi.ChainEpoch = -2 + var UpgradeDragonHeight = abi.ChainEpoch(-25) + +// This fix upgrade only ran on calibrationnet +const UpgradeCalibrationDragonFixHeight abi.ChainEpoch = -3 + var UpgradePhoenixHeight = abi.ChainEpoch(-26) var UpgradeWaffleHeight = abi.ChainEpoch(-27) var UpgradeTuktukHeight = abi.ChainEpoch(-28) -const UpgradeTeepHeight = 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 +const UpgradeTeepHeight abi.ChainEpoch = 50 -// This fix upgrade only ran on calibrationnet -const UpgradeWatermelonFix2Height = -2 +var UpgradeTeepInitialFilReserved = InitialFilReserved // FIP-0100: no change for interop -// This fix upgrade only ran on calibrationnet -const UpgradeCalibrationDragonFixHeight = -3 +const UpgradeTockHeight abi.ChainEpoch = 100 var DrandSchedule = map[abi.ChainEpoch]DrandEnum{ 0: DrandQuicknet, diff --git a/build/buildconstants/params_mainnet.go b/build/buildconstants/params_mainnet.go index 5dba1cdffa7..3433b0a6c89 100644 --- a/build/buildconstants/params_mainnet.go +++ b/build/buildconstants/params_mainnet.go @@ -43,7 +43,7 @@ const UpgradeSmokeHeight abi.ChainEpoch = 51000 const UpgradeIgnitionHeight abi.ChainEpoch = 94000 const UpgradeRefuelHeight abi.ChainEpoch = 130800 -const UpgradeAssemblyHeight abi.ChainEpoch = 138720 +var UpgradeAssemblyHeight abi.ChainEpoch = 138720 const UpgradeTapeHeight abi.ChainEpoch = 140760 @@ -99,9 +99,18 @@ const UpgradeThunderHeight abi.ChainEpoch = UpgradeLightningHeight + 2880*21 // 2023-12-12T13:30:00Z const UpgradeWatermelonHeight abi.ChainEpoch = 3469380 +// This fix upgrade only ran on calibrationnet +const UpgradeWatermelonFixHeight abi.ChainEpoch = -1 + +// This fix upgrade only ran on calibrationnet +const UpgradeWatermelonFix2Height abi.ChainEpoch = -2 + // 2024-04-24T14:00:00Z const UpgradeDragonHeight abi.ChainEpoch = 3855360 +// This fix upgrade only ran on calibrationnet +const UpgradeCalibrationDragonFixHeight abi.ChainEpoch = -3 + // This epoch, 120 epochs after the "rest" of the nv22 upgrade, is when we switch to Drand quicknet // 2024-04-11T15:00:00Z const UpgradePhoenixHeight abi.ChainEpoch = UpgradeDragonHeight + 120 @@ -113,22 +122,19 @@ const UpgradeWaffleHeight abi.ChainEpoch = 4154640 // var because of TestMigrationNV24 in itests/migration_test.go to test the FIP-0081 pledge ramp var UpgradeTuktukHeight abi.ChainEpoch = 4461240 -// ?????? -var UpgradeTeepHeight = 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 +// ?????? +var UpgradeTeepHeight = abi.ChainEpoch(9999999999) -// This fix upgrade only ran on calibrationnet -const UpgradeWatermelonFix2Height abi.ChainEpoch = -2 +// This epoch, 90 days after Teep is the completion of FIP-0100 where actors will start applying +// the new daily fee to pre-Teep sectors being extended. +var UpgradeTockHeight = UpgradeTeepHeight + builtin.EpochsInDay*90 -// This fix upgrade only ran on calibrationnet -const UpgradeCalibrationDragonFixHeight abi.ChainEpoch = -3 +var UpgradeTeepInitialFilReserved = InitialFilReserved // FIP-0100: no change for mainnet var ConsensusMinerMinPower = abi.NewStoragePower(10 << 40) var PreCommitChallengeDelay = abi.ChainEpoch(150) diff --git a/build/buildconstants/params_shared_vals.go b/build/buildconstants/params_shared_vals.go index d6b150cc3dd..901d6142195 100644 --- a/build/buildconstants/params_shared_vals.go +++ b/build/buildconstants/params_shared_vals.go @@ -4,7 +4,6 @@ package buildconstants import ( - "math/big" "os" "github.com/ipfs/go-cid" @@ -59,21 +58,12 @@ const AddressMainnetEnvVar = "_mainnet_" var ZeroAddress = MustParseAddress("f3yaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaby2smx7a") const FilBase = uint64(2_000_000_000) -const FilAllocStorageMining = uint64(1_100_000_000) - const FilecoinPrecision = uint64(1_000_000_000_000_000_000) -const FilReserved = uint64(300_000_000) -var InitialRewardBalance *big.Int -var InitialFilReserved *big.Int +var InitialRewardBalance = wholeFIL(1_100_000_000) +var InitialFilReserved = wholeFIL(300_000_000) func init() { - InitialRewardBalance = big.NewInt(int64(FilAllocStorageMining)) - InitialRewardBalance = InitialRewardBalance.Mul(InitialRewardBalance, big.NewInt(int64(FilecoinPrecision))) - - InitialFilReserved = big.NewInt(int64(FilReserved)) - InitialFilReserved = InitialFilReserved.Mul(InitialFilReserved, big.NewInt(int64(FilecoinPrecision))) - if os.Getenv("LOTUS_ADDRESS_TYPE") == AddressMainnetEnvVar { SetAddressNetwork(address.Mainnet) } diff --git a/build/buildconstants/params_testground.go b/build/buildconstants/params_testground.go index e7dab38f444..a29fd614ee2 100644 --- a/build/buildconstants/params_testground.go +++ b/build/buildconstants/params_testground.go @@ -73,39 +73,40 @@ var ( UpgradeBreezeHeight abi.ChainEpoch = -1 BreezeGasTampingDuration abi.ChainEpoch = 0 - UpgradeSmokeHeight abi.ChainEpoch = -1 - UpgradeIgnitionHeight abi.ChainEpoch = -2 - UpgradeRefuelHeight abi.ChainEpoch = -3 - UpgradeTapeHeight abi.ChainEpoch = -4 - UpgradeAssemblyHeight abi.ChainEpoch = 10 - UpgradeLiftoffHeight abi.ChainEpoch = -5 - UpgradeKumquatHeight abi.ChainEpoch = -6 - UpgradeCalicoHeight abi.ChainEpoch = -8 - UpgradePersianHeight abi.ChainEpoch = -9 - UpgradeOrangeHeight abi.ChainEpoch = -10 - UpgradeClausHeight abi.ChainEpoch = -11 - UpgradeTrustHeight abi.ChainEpoch = -12 - UpgradeNorwegianHeight abi.ChainEpoch = -13 - UpgradeTurboHeight abi.ChainEpoch = -14 - UpgradeHyperdriveHeight abi.ChainEpoch = -15 - UpgradeChocolateHeight abi.ChainEpoch = -16 - UpgradeOhSnapHeight abi.ChainEpoch = -17 - UpgradeSkyrHeight abi.ChainEpoch = -18 - UpgradeSharkHeight abi.ChainEpoch = -19 - UpgradeHyggeHeight abi.ChainEpoch = -20 - UpgradeLightningHeight abi.ChainEpoch = -21 - UpgradeThunderHeight abi.ChainEpoch = -22 - UpgradeWatermelonHeight abi.ChainEpoch = -23 - UpgradeWatermelonFixHeight abi.ChainEpoch = -24 - UpgradeWatermelonFix2Height abi.ChainEpoch = -25 - UpgradeDragonHeight abi.ChainEpoch = -26 - UpgradePhoenixHeight abi.ChainEpoch = -27 - UpgradeCalibrationDragonFixHeight abi.ChainEpoch = -28 - UpgradeWaffleHeight abi.ChainEpoch = -29 - UpgradeTuktukHeight abi.ChainEpoch = -30 - UpgradeTeepHeight abi.ChainEpoch = -31 - - UpgradeTuktukPowerRampDurationEpochs uint64 = 0 + UpgradeSmokeHeight abi.ChainEpoch = -1 + UpgradeIgnitionHeight abi.ChainEpoch = -2 + UpgradeRefuelHeight abi.ChainEpoch = -3 + UpgradeTapeHeight abi.ChainEpoch = -4 + UpgradeAssemblyHeight abi.ChainEpoch = 10 + UpgradeLiftoffHeight abi.ChainEpoch = -5 + UpgradeKumquatHeight abi.ChainEpoch = -6 + UpgradeCalicoHeight abi.ChainEpoch = -8 + UpgradePersianHeight abi.ChainEpoch = -9 + UpgradeOrangeHeight abi.ChainEpoch = -10 + UpgradeClausHeight abi.ChainEpoch = -11 + UpgradeTrustHeight abi.ChainEpoch = -12 + UpgradeNorwegianHeight abi.ChainEpoch = -13 + UpgradeTurboHeight abi.ChainEpoch = -14 + UpgradeHyperdriveHeight abi.ChainEpoch = -15 + UpgradeChocolateHeight abi.ChainEpoch = -16 + UpgradeOhSnapHeight abi.ChainEpoch = -17 + UpgradeSkyrHeight abi.ChainEpoch = -18 + UpgradeSharkHeight abi.ChainEpoch = -19 + UpgradeHyggeHeight abi.ChainEpoch = -20 + UpgradeLightningHeight abi.ChainEpoch = -21 + UpgradeThunderHeight abi.ChainEpoch = -22 + UpgradeWatermelonHeight abi.ChainEpoch = -23 + UpgradeWatermelonFixHeight abi.ChainEpoch = -24 + UpgradeWatermelonFix2Height abi.ChainEpoch = -25 + UpgradeDragonHeight abi.ChainEpoch = -26 + UpgradePhoenixHeight abi.ChainEpoch = -27 + UpgradeCalibrationDragonFixHeight abi.ChainEpoch = -28 + UpgradeWaffleHeight abi.ChainEpoch = -29 + UpgradeTuktukHeight abi.ChainEpoch = -30 + UpgradeTuktukPowerRampDurationEpochs uint64 = 0 + UpgradeTeepHeight abi.ChainEpoch = -31 + UpgradeTeepInitialFilReserved *big.Int = wholeFIL(300_000_000) + UpgradeTockHeight abi.ChainEpoch = -32 DrandSchedule = map[abi.ChainEpoch]DrandEnum{ 0: DrandMainnet, diff --git a/build/buildconstants/shared_funcs.go b/build/buildconstants/shared_funcs.go index fba5750ebf3..114452753d6 100644 --- a/build/buildconstants/shared_funcs.go +++ b/build/buildconstants/shared_funcs.go @@ -1,6 +1,8 @@ package buildconstants import ( + "math/big" + logging "github.com/ipfs/go-log/v2" "github.com/libp2p/go-libp2p/core/peer" @@ -40,3 +42,8 @@ func MustParseID(id string) peer.ID { } return p } + +func wholeFIL(whole uint64) *big.Int { + bigWhole := big.NewInt(int64(whole)) + return bigWhole.Mul(bigWhole, big.NewInt(int64(FilecoinPrecision))) +} diff --git a/build/builtin_actors_gen.go b/build/builtin_actors_gen.go index 3d9d673a508..bfe1f29178f 100644 --- a/build/builtin_actors_gen.go +++ b/build/builtin_actors_gen.go @@ -189,25 +189,25 @@ var EmbeddedBuiltinActorsMetadata = []*BuiltinActorsMetadata{{ }, { Network: "butterflynet", Version: 16, - BundleGitTag: "v16.0.0-dev1", - ManifestCid: cid.MustParse("bafy2bzaced3ucmgzcrkvaw6qgqdzl56t3rctlb7i66vrj23dacgeath7jcxne"), - Actors: map[string]cid.Cid{ - "account": cid.MustParse("bafk2bzaceaw5z2sungnovruolbxdc43xbsksx7ajlr2bw7insd55nho3gfbne"), - "cron": cid.MustParse("bafk2bzacec7zpiconapx4veuplh5hk3iumnigsbx7yxhxfz7hirqbf2vpexqa"), - "datacap": cid.MustParse("bafk2bzaceb4owttyigypvl6pguxhqwe45rgfjubgpoitqhiyzumhlwwu6buge"), - "eam": cid.MustParse("bafk2bzaceapofadtnyiulmdc5k3nujthqwyht67xu2pohatqjcexojm34j7ng"), - "ethaccount": cid.MustParse("bafk2bzacebtz62oxftksx4f6efbuh6i5wb5nvuo447uefkbz5lis4rcw7djw2"), - "evm": cid.MustParse("bafk2bzacebdhgopsxunxykgehkbwtj5iyyvbqygi5uuvhtm7m4vsz3vcsp5iw"), - "init": cid.MustParse("bafk2bzaced6b6odw6vt3ak7z7idhatex6gjsxck57wkum2yud6wubhpbwtm5e"), - "multisig": cid.MustParse("bafk2bzacebius3sex65rxav4oo2qbbm6vuv5pcer3shgutqyyxy3vvcgezayg"), - "paymentchannel": cid.MustParse("bafk2bzacebmpquxfvdh2lmgi7huqcln3ey56run7hkrsuhi6lgcwekbozhxac"), + BundleGitTag: "v16.0.0-rc3", + ManifestCid: cid.MustParse("bafy2bzacedn2h6huw7v2elmmdmpv4phdv4wjwgct7kcrrtdgz7jkjdm6uwa6k"), + Actors: map[string]cid.Cid{ + "account": cid.MustParse("bafk2bzacebtd4bl5htqzhnueqwchxjocw35bjfk4u34h33tkhl7l3ll7jjzp6"), + "cron": cid.MustParse("bafk2bzacebuwt5zc2njcsm2fghlrnz3bfvu7s6hepl6leoql3w7zwxtfz5sx4"), + "datacap": cid.MustParse("bafk2bzacearpj5e5mgj7wbqknzbr67z464mscraxa2r434i4vf2q5pfxli67y"), + "eam": cid.MustParse("bafk2bzaceak462ytr36seexcpydhsxywzm3sz3loechzuuuifvtie72zgggkm"), + "ethaccount": cid.MustParse("bafk2bzacecosm2oq5ymatrxkhfv722fawci6bfe5x2hz4gkzu7ewakc5cqfsi"), + "evm": cid.MustParse("bafk2bzacebqxdknf6fbuqnop7jacz4rtarsji4xp6x4o46sabkdauckekpzvs"), + "init": cid.MustParse("bafk2bzaceanzpajkcik5k4xt7nisqiazme2saivwl5um2que2g7jekr6feygm"), + "multisig": cid.MustParse("bafk2bzaceayq4iq5l324rlxhrluetxr2rhkw653ple52qdqcc3pxnxgqfobky"), + "paymentchannel": cid.MustParse("bafk2bzaceaifoxdlegtehjeow4sve6zuvvd6yqhwpwaim65hexv2gu7dt32ru"), "placeholder": cid.MustParse("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"), - "reward": cid.MustParse("bafk2bzaceagmmgu3wt7fozbp3uhd6aepdl6c2ykt7xbpbldh2lvmmvvmt56gw"), - "storagemarket": cid.MustParse("bafk2bzaceblznz3yqthmh2jbrknljiqu3kdfr7x7j2wn62abnszs4ziettqmm"), - "storageminer": cid.MustParse("bafk2bzaceca27d33cwxwwbhbmijt453wkc3dvrnfkrdsuznol4cq33z3oqxbk"), - "storagepower": cid.MustParse("bafk2bzacebnq5klygudstkq5tx6y7xusn2frygtotahiagmda3zy6rvzmyqme"), - "system": cid.MustParse("bafk2bzacea5dls7jx2bhbhdkwl2c3qgyv22ldbeoc2me5z7qe5kbutf7tjeow"), - "verifiedregistry": cid.MustParse("bafk2bzacecqbljsk5utms7pe4g3uy7zvrpwmwgop4spx6pjrpi4tjx663gkq2"), + "reward": cid.MustParse("bafk2bzacecj4o5ea74dksbshkqf4yd2e4wipcnn6es5h4ltvdnmod3wrj7pei"), + "storagemarket": cid.MustParse("bafk2bzacedjnmezgiaszypr2pvwrzuzijv6hoegdcz47yq3ym6rcguqw6altm"), + "storageminer": cid.MustParse("bafk2bzacebervdatmrxkhke2z7vsmbw4bdcvimxfrvo75lchiobtuyhvklrq6"), + "storagepower": cid.MustParse("bafk2bzacecq27y2fgtst57klr5g22nn6i25icey7uq6ofhouupmidkcoh34xa"), + "system": cid.MustParse("bafk2bzaceb2l6ttyv3hnjexdzqaoo7nxsec3dtbo5h5yxdzz44ugq2onxofdu"), + "verifiedregistry": cid.MustParse("bafk2bzacedhrjtvtmygawmtfukkufpw5ju7wasxnfktxloc77gz3nj6mh45b2"), }, }, { Network: "calibrationnet", @@ -387,25 +387,25 @@ var EmbeddedBuiltinActorsMetadata = []*BuiltinActorsMetadata{{ }, { Network: "calibrationnet", Version: 16, - BundleGitTag: "v16.0.0-dev1", - ManifestCid: cid.MustParse("bafy2bzacedyuehqrepafsb55cm5pbbagu554rr24myh5hlgidpfzsp7m6k5ci"), - Actors: map[string]cid.Cid{ - "account": cid.MustParse("bafk2bzacecppofh4oryxw4h32k2wsh7wsranplxzzdmxlvt3ji4dczfbk772i"), - "cron": cid.MustParse("bafk2bzacebovrwtd77bivvfx3dechd7sxmkz4xvquksuhthuyrbfprnog6ygq"), - "datacap": cid.MustParse("bafk2bzacea3zugtto5midza37z3rkmpbgwjkidkislyl72lgizklj5meiqlw4"), - "eam": cid.MustParse("bafk2bzacebfafdslh6vjgjupv5runnatcgyqffxo7fxaahlwfmdsbglbxedfi"), - "ethaccount": cid.MustParse("bafk2bzacedj3wxhx6gam7dxksl2tlzgd5h7eaoeeyzvl32noimnneolnicbhe"), - "evm": cid.MustParse("bafk2bzacebiisokxcsafd7zzrrdt7e2ilatwfmnfbccna7cm2ayjc4snwipeu"), - "init": cid.MustParse("bafk2bzacebw5em2nwbyethwv47dstvnhgxciqbr3duhqvpsvgzl7gkohvlsi2"), - "multisig": cid.MustParse("bafk2bzaceavw4okqdej7hylut6ilaabo4ocurfyo3ufwxqlj4zgsnzvnkxnee"), - "paymentchannel": cid.MustParse("bafk2bzaceapxleybdulu7ny5esksz2paveq6kj3hy2uv7akfqx6wipjf77voe"), + BundleGitTag: "v16.0.0-rc3", + ManifestCid: cid.MustParse("bafy2bzacebc7zpsrihpyd2jdcvmegbbk6yhzkifre3hxtoul5wdxxklbwitry"), + Actors: map[string]cid.Cid{ + "account": cid.MustParse("bafk2bzaced4jhgt6peqc3m2lrclj347kjhwt3wjsdxrbt336m5kxcrkyyfg4o"), + "cron": cid.MustParse("bafk2bzacecuvdunhtjo52tpxt4ge3ue7mpejmv3c3loqf6iafu5e2jlybvy5a"), + "datacap": cid.MustParse("bafk2bzacebs5hd67p3x2ohf357xaebz57o3ffeuexndaptn5g3usgatd32icq"), + "eam": cid.MustParse("bafk2bzacedbazvsncva5hfb72jyipsebzlo6sgjbfnf6m4p4xhagzoekzgy34"), + "ethaccount": cid.MustParse("bafk2bzacedepzmyi2sbw7fgblhzhz75oovy6trbsfnxsbsqdh6te5cchgptiq"), + "evm": cid.MustParse("bafk2bzacedomvviwbdddcfm73uaedqeyuiyswdt3plq3v74uvbo2xvrzyphio"), + "init": cid.MustParse("bafk2bzacednq5wfauimq4shz2xynzshatk54odj45gp6fkw77gy25fpmhu5oc"), + "multisig": cid.MustParse("bafk2bzaceb4bfxfccm5v6qnecp7ayalitk2fvu6ezavcrd7lcb4uohrsaeo32"), + "paymentchannel": cid.MustParse("bafk2bzaceaia5ufr2wyzbasrx6vcfeqjsnaqajmlrnp763cesa7pqvddaubyu"), "placeholder": cid.MustParse("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"), - "reward": cid.MustParse("bafk2bzacebdmguorldk4jvdpxmvxiypahqumga7e5b64qbhmjehbxwnsanip4"), - "storagemarket": cid.MustParse("bafk2bzacebvlrsigczseacown6mxy2ewwh3ig3analf4zf5pvh4n2fazzu2go"), - "storageminer": cid.MustParse("bafk2bzaceardbhguonfp2tpatwnd6qces6hrmhpudeddk464vatz7qhg2tpho"), - "storagepower": cid.MustParse("bafk2bzacebyfcf6spszdfjtulyxokruxwddrzywkz76jvad3benv3cs7v52q2"), - "system": cid.MustParse("bafk2bzacec43onu7oy7epjvqruhcreidzyjfxhi2r4r5kefivgwzxouebwwt4"), - "verifiedregistry": cid.MustParse("bafk2bzacebpeww6apu22xgc24rotydriibrh7svyparr3yci3l3xnvwwdq4si"), + "reward": cid.MustParse("bafk2bzacecgorusdavjd42ktijbjh4veu2y6isnlfyys2f5jylnc2c6yll3ju"), + "storagemarket": cid.MustParse("bafk2bzacea63rezmai4qwvzlc3hmcjn4eurkcec7cjqoih6vztnkwjvvlx2we"), + "storageminer": cid.MustParse("bafk2bzaceax4mv3wzp7jfjpsp2lklujzpjtskpn6lsn743a6ljpgzo2qjdncq"), + "storagepower": cid.MustParse("bafk2bzaceddedx24uzsyx6yh63aoabx66caaariopsa5gzn2x6yme7dv5s7cg"), + "system": cid.MustParse("bafk2bzacecfol5vcebbl7dqkat7kt65bgqwqvn7fxnakg7qvpokce6ulemo3k"), + "verifiedregistry": cid.MustParse("bafk2bzacedqpwyprkgwdbcqahgrzuoul42gd3hvgn54fxyqjgtwmmlquycuok"), }, }, { Network: "caterpillarnet", @@ -594,25 +594,25 @@ var EmbeddedBuiltinActorsMetadata = []*BuiltinActorsMetadata{{ }, { Network: "caterpillarnet", Version: 16, - BundleGitTag: "v16.0.0-dev1", - ManifestCid: cid.MustParse("bafy2bzacedqqjqicweamstbiqfllldodwdwqhkl7rcgqs27denzh7z3hwpz3i"), - Actors: map[string]cid.Cid{ - "account": cid.MustParse("bafk2bzaceajwzqsl45wmdum5nmaxiopfjvjt5qdeaxkrlhmwmc4utb4o3lcam"), - "cron": cid.MustParse("bafk2bzacea52btlgmq5a3y6yuav35hmxbfni4n6kisc47ptg2pazawnaxtmxs"), - "datacap": cid.MustParse("bafk2bzacedhbmvomkiz2fnpukuni5byzx66itmzl7ybighcqviv24hwyvnqxy"), - "eam": cid.MustParse("bafk2bzaceav4taadep3gx5347v3yqpwucgxtoopwdr6cmztifnd4jh4da7k26"), - "ethaccount": cid.MustParse("bafk2bzaced3gcp763wpsbk4uuapabx6wvna7zj5f4z5ncneh6izft2qysjqyq"), - "evm": cid.MustParse("bafk2bzacea3gzumpldx37cyhbiy4h3ya2xvzbjsjcwpry4rk3pbzxdj6kieb6"), - "init": cid.MustParse("bafk2bzaceb6ktoltdgictkwdqipl3xxpv4hb26pdmzmlxkni6yur467d6h4bs"), - "multisig": cid.MustParse("bafk2bzaceacficvknw56svvd345dnmt37ixn37aa4v7crp3cvpujvvj5mexg2"), - "paymentchannel": cid.MustParse("bafk2bzaceb25lrqqycu6exgwreyecuucmw3tvazfq74p6skyninxdt2xzwrva"), + BundleGitTag: "v16.0.0-rc3", + ManifestCid: cid.MustParse("bafy2bzacea6y67oqqokphvqdf4rruflrwzxyuquq2fgb34zjnh67nsk53is6k"), + Actors: map[string]cid.Cid{ + "account": cid.MustParse("bafk2bzaceb22mvrw4jzf2c4cypor3nbaap2lzkhpim6ny7rhd5pysazcpwet4"), + "cron": cid.MustParse("bafk2bzacedvsp34iu4vwueh5jcmiwfhulnkudzrlprgcxj5tkp75bphfl7xus"), + "datacap": cid.MustParse("bafk2bzacedwsn6imbcvvbt5rc2oh74psehmbjje74otqkfeacx67lzdaog5bu"), + "eam": cid.MustParse("bafk2bzacecurnymlfgfvelucrsp4rty2zgmurc3csfgyl64inyrebi5kh4vcq"), + "ethaccount": cid.MustParse("bafk2bzaceada6lp3x2zuv5gye5jrfirpmw5boruozkuq2nakjzlt36gmbnvm2"), + "evm": cid.MustParse("bafk2bzacebxvd6iso22ij46dthgycgjpo7d6o3rh5ak4wywmpxewnx3hkosz2"), + "init": cid.MustParse("bafk2bzacebvlmojdxhl3t2tu2bypx4o4bsmth4p2vl2kaerjp7relgvqetk3c"), + "multisig": cid.MustParse("bafk2bzacec7scokqkn4lpjwjxy37ip7iwj64bktznl4p3atz42rislxkjax5e"), + "paymentchannel": cid.MustParse("bafk2bzaceclexkwpiklt2fxa4mnqwhzeq2iwju3lqvaf2n7kqjygucvnsjdeq"), "placeholder": cid.MustParse("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"), - "reward": cid.MustParse("bafk2bzacedsoxtcutavwgcjsvpmnriqgyknrifr7gtqlh7a6cpi7tbb63aza2"), - "storagemarket": cid.MustParse("bafk2bzacebjcyc7m465cu2en2qtmn53swblzpsjykmdi6ukfsfwv4n2qyzsww"), - "storageminer": cid.MustParse("bafk2bzacedfyh3jmd2hlt47za2tkhe2rihfr6mpklg5zb44xywuelyda5nogq"), - "storagepower": cid.MustParse("bafk2bzacedlqxltci4dzwjllqunx2diegsf4budqpph642woh6z6nthxgljuc"), - "system": cid.MustParse("bafk2bzacebrghlk4nlvqpe4qvdg2kdr7hjpqx2yiim6idg2dqrwts4tli7wew"), - "verifiedregistry": cid.MustParse("bafk2bzaceavaeuhy2yyjz5qam4seiwm3dfpsuvnn23q65c47h5caa3xt5rgjs"), + "reward": cid.MustParse("bafk2bzacebdc4f4ryhjlwtijwcy2twpn3kcfznldzjfrqvb7oxmjgiydkkr3q"), + "storagemarket": cid.MustParse("bafk2bzaceavaehtdehujgz7rqy6qzti4znal2znp3dd3upnw5llo3rpyabsc2"), + "storageminer": cid.MustParse("bafk2bzaceblob7ejdvkqotry3udhf4rkouokhxffcmpkrfhkjifehvdjviwaq"), + "storagepower": cid.MustParse("bafk2bzacebgu3ped7tob5el7feur6ukhssmzbtrf3fukpeglncahgrmjhknsk"), + "system": cid.MustParse("bafk2bzaceaignjqeda5wnbc2bjigglioxnyhfbmivel3kplsnd5iskl75jlki"), + "verifiedregistry": cid.MustParse("bafk2bzacebss5xbdgldtmlljluvdjvgjrg6cn3ftqoiwnm65gfjd4o4j2dpx6"), }, }, { Network: "devnet", @@ -792,25 +792,25 @@ var EmbeddedBuiltinActorsMetadata = []*BuiltinActorsMetadata{{ }, { Network: "devnet", Version: 16, - BundleGitTag: "v16.0.0-dev1", - ManifestCid: cid.MustParse("bafy2bzacebdyuvdaovs5lnwfnn2uu5ckvinokhctuym2wt4zradxmb2emh3gu"), - Actors: map[string]cid.Cid{ - "account": cid.MustParse("bafk2bzacealpbfzpfb33rka6rnoaepbona5elxjmw5p45fjop3sd35pecns7o"), - "cron": cid.MustParse("bafk2bzacedpy6vfqq34qzhzpzinrdk3worasime5zmen64qtkgtkg5kqte3yw"), - "datacap": cid.MustParse("bafk2bzacebmhg4qkcgdznshes4h3merddbtjwd6yw2snv4biaqmub5joydk6a"), - "eam": cid.MustParse("bafk2bzaceckp43jqgtb4ekoayk3cy7jajw4r2itas4xuew7pqk5b3ufbbvu7i"), - "ethaccount": cid.MustParse("bafk2bzacebacuiyeqwjpow5tqh6zs3wdexp5lkxtre252m5d2asrunxfgshwk"), - "evm": cid.MustParse("bafk2bzacecgr6ohvx467l4bsx2l2342xbnhd3mme4cnavvufuuomzjqra254g"), - "init": cid.MustParse("bafk2bzacedswii2q6om3az7ugpamedwiylofpgcmly6xlajenlqrorsipu5kw"), - "multisig": cid.MustParse("bafk2bzacebe2shj2fjwvr3epqyqt7ywg23hlb7fulek6dkh3hrrfcl2cqh5ds"), - "paymentchannel": cid.MustParse("bafk2bzaced23mx42bux7adtm3flefrpgom5vkn7rkufpwo7gbbpp3fr6hckna"), + BundleGitTag: "v16.0.0-rc3", + ManifestCid: cid.MustParse("bafy2bzaceafzrqb6adck3o3mbyd33gtp2272f577hidqyo7cszg2ksn5sebh2"), + Actors: map[string]cid.Cid{ + "account": cid.MustParse("bafk2bzacedqy7umr3bmmkrepi3ostdxrlxaln33wecqllsz5eqgdwzb2oqov2"), + "cron": cid.MustParse("bafk2bzacebrbwcwi3jtplab7jajkccgcqzyvpobypfhomf45ujxpgwehipoia"), + "datacap": cid.MustParse("bafk2bzaceccxwbelrowdo47xfgd7ldj7trvh7qvq5xgnhxdnw2zdlml5ahzvc"), + "eam": cid.MustParse("bafk2bzacebjzmdd7vdjfdrrxzzyu34gz4jzropcyzrc7og4lt2mczipwoz3pc"), + "ethaccount": cid.MustParse("bafk2bzaceb7zgpsi6mwc7asrpxyj7zd6rcsuhraekbonodegxhuli2mwdmuw2"), + "evm": cid.MustParse("bafk2bzacea5shmgqycbwuvazd2fika4erfbbyxomsnircps2nqk2o7oxtkvdy"), + "init": cid.MustParse("bafk2bzacedoyhv5wergunblh2ga65rxbwowhtac4vdz7woovkponmmd55f244"), + "multisig": cid.MustParse("bafk2bzacedyid3docv7i2wx4sciua64ndrbfqbk3werhuruehedhj6gj6hvdg"), + "paymentchannel": cid.MustParse("bafk2bzaceab556e24d4qzptdownttepcrgljrfvheykwf2kwxzomk5gip3qka"), "placeholder": cid.MustParse("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"), - "reward": cid.MustParse("bafk2bzacecigv24xqawuvyuxz5lt2qhf46dq2naminkv3xqhouremg6zqmtfg"), - "storagemarket": cid.MustParse("bafk2bzacebtldhghd3jwnozzaoxvz4562aqe2qdzgbc5vjtg4yhbaj2dappco"), - "storageminer": cid.MustParse("bafk2bzacedrc3piyuw44yeu27gquwzaprlf7wxmjpf53kvkbydqe3h6637tg6"), - "storagepower": cid.MustParse("bafk2bzacear7ktjlxbpfkspvlkqo7m7aqhdwvfplvx4l5mbppo2mxwcjf2jkw"), - "system": cid.MustParse("bafk2bzacecnaympyv5m6oqsy6dqznpderjztjlsodx3vipm5zctvkk3esohyw"), - "verifiedregistry": cid.MustParse("bafk2bzacean7z35x3pvlypt53qxz4rnutdycr63xsa7um2bf5b5qhgpkftih6"), + "reward": cid.MustParse("bafk2bzacecusrwhrdsndyokbordb7khms3mjvkohnzxst6a3intb52skg56vw"), + "storagemarket": cid.MustParse("bafk2bzaceciw5btcu55jguj7yfpgd3ecrwlu7hwhdacbug56htiseitbohw6m"), + "storageminer": cid.MustParse("bafk2bzacead3ptx4vq2e7x3q6lm5cpe6lbtp44shxon23xhmahvvfjqbotpny"), + "storagepower": cid.MustParse("bafk2bzacecxjuml3buylyyg6u2k6dy3ek4apqlbwbk4npgosxc2cls7ywosow"), + "system": cid.MustParse("bafk2bzaceaonvsrizf3fvy2tgruqjgymtfvkzejmooui2w2stpi7teibtz4wm"), + "verifiedregistry": cid.MustParse("bafk2bzaceb3qajgx4ichpmgnxjeofv3pg3qwagrsgkimoi6sinjnd6mydiy2o"), }, }, { Network: "hyperspace", @@ -1013,25 +1013,25 @@ var EmbeddedBuiltinActorsMetadata = []*BuiltinActorsMetadata{{ }, { Network: "mainnet", Version: 16, - BundleGitTag: "v16.0.0-dev1", - ManifestCid: cid.MustParse("bafy2bzacec5qnjmoi5ka2qozkkktzwca5i6icodrlpzkk5rr4u2rygfltieze"), - Actors: map[string]cid.Cid{ - "account": cid.MustParse("bafk2bzacecoqf4u4raiqmo4gieinfzxbctadwea5ey3gt6fy6umgjos4uv2wm"), - "cron": cid.MustParse("bafk2bzaced76r6luvpfa3vpzqrffmaof55m2afu3gnptj3ldbfpdfsyenrxoi"), - "datacap": cid.MustParse("bafk2bzacedxwmfej347do4gjidkwqkpbjc6iz3xj4ja6y5nj6mvsvfv4iojv6"), - "eam": cid.MustParse("bafk2bzaced3d4ilqia434l42dib5n2nh444duzdx6ny3equfkr6sa4w5jstt6"), - "ethaccount": cid.MustParse("bafk2bzacebnl5u6326h6t6zn2xqqvxyzj3j5vw2axg5bsuj7bk4qgclpyr3r2"), - "evm": cid.MustParse("bafk2bzaceczkcwusuxv4xz6h74krybegh4idmjwdv3cx7opsegq77mdontuwa"), - "init": cid.MustParse("bafk2bzacea3vbeqljcbzxdkbdh7rcayy64tvn7mihgj5riazw5ocgr57fwgji"), - "multisig": cid.MustParse("bafk2bzaceacef3z3biucyasjuj4j75gpsi4ozebwwoygfpojg4xkqssly7pi6"), - "paymentchannel": cid.MustParse("bafk2bzacebshacfsdlvmqihamcipuksxxwhaxgpibnmb5nvdr76hilo5aodka"), + BundleGitTag: "v16.0.0-rc3", + ManifestCid: cid.MustParse("bafy2bzaceaj3s3rrfbibikplap264uw74qor5yl35mqwokv4lwst4plpwry36"), + Actors: map[string]cid.Cid{ + "account": cid.MustParse("bafk2bzacec5ozi2c34ekahcae7ddflen4drqlbvumxdmos4oemwejnd6fng7i"), + "cron": cid.MustParse("bafk2bzacec5zieykqe2qmrlwesc2f7deez2rsiil5acjbv3u2hurmcexvvig6"), + "datacap": cid.MustParse("bafk2bzaceaelkguldxjrbdxv6wmmsniejzwbpt6ur53xyvrtkv6l5dqmm43fk"), + "eam": cid.MustParse("bafk2bzacebpa6slssjr3ph3yuosghid766ydll3istxrru5dk2patbpfzfbxo"), + "ethaccount": cid.MustParse("bafk2bzacedxv3cxhoqlsq32zv3e3cy7xvi5ftg4x2feas3455uqwx5gvmp2di"), + "evm": cid.MustParse("bafk2bzacednixjutzxqqry6tjitf6tm7afjzcn2c7nlw7wlxe2d6rvjjzlv5k"), + "init": cid.MustParse("bafk2bzacebk4pn7s7cl5ljp3pjfyewgzchybh5khgs66fvk4sjk5z7bae5ebi"), + "multisig": cid.MustParse("bafk2bzaceag6xetwcqs6jn6gad3gnxs2mdc625z7tiitzagyzywdctbrfqwq4"), + "paymentchannel": cid.MustParse("bafk2bzacecze447ktzreixnwomr6f7pk4yy37aqqbg2n5gfkrtxttknxj3etc"), "placeholder": cid.MustParse("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"), - "reward": cid.MustParse("bafk2bzaceakdar6t32u2inwowtrjtcldaulrk7cpbi5undxaoudpq6z5kz5sg"), - "storagemarket": cid.MustParse("bafk2bzacedtxidrhj7dopxfu7lg3c7q275dhqdtlvudm5du5yazx47w2ym7m2"), - "storageminer": cid.MustParse("bafk2bzacedyweom7dmzqipufvlnr63e3bcjmw4o4s75vhk2ui6grb56bemvpi"), - "storagepower": cid.MustParse("bafk2bzacebai2uhmoc7ci37wzie4yjkvxldyyapmetgsysnojdefaacdkhzoa"), - "system": cid.MustParse("bafk2bzaceb32mgt4dsh2my7q5ahsfolmderipv5mjh7ulukikyccgigwmzhmm"), - "verifiedregistry": cid.MustParse("bafk2bzaceddowq4s3qxa7nyehl3fqbr654xbh66lzqpwaucuc4jhdvoeds72m"), + "reward": cid.MustParse("bafk2bzacebfth3o6nb6l6cncbh26tz47y35puzotb6qfekdpfzza5jq3xkktq"), + "storagemarket": cid.MustParse("bafk2bzacecak6aoz2hikbboywrzdrocdi4kg7ygpvr24mfbrizl37wvkpoh62"), + "storageminer": cid.MustParse("bafk2bzaceadh3kotsa6sgmb7hhey2k3a7x7r2cdcuoeuccvbxquncahgqv27a"), + "storagepower": cid.MustParse("bafk2bzacedguasiz7jmqgyasjyv7qki4fkedilv6jxwpllshpe67v2juy6562"), + "system": cid.MustParse("bafk2bzacec2peekriytrgir2hywednfqm7knrzqo4iipdn2cumowaelyjroqe"), + "verifiedregistry": cid.MustParse("bafk2bzaceaprpkxgqzkgozro36f4nxonwqjouazvi2tjsvzixtgd7uyw3pki6"), }, }, { Network: "testing", @@ -1211,25 +1211,25 @@ var EmbeddedBuiltinActorsMetadata = []*BuiltinActorsMetadata{{ }, { Network: "testing", Version: 16, - BundleGitTag: "v16.0.0-dev1", - ManifestCid: cid.MustParse("bafy2bzacebnqlrdxkjwqv5cvfhn2zliyuarrh3pmxjtrhpxoe4ig45ntoksys"), - Actors: map[string]cid.Cid{ - "account": cid.MustParse("bafk2bzaceayo2leixvtge6enn2bb6cn3zpzq66flq24tmapn5dejhz5giyvbm"), - "cron": cid.MustParse("bafk2bzacebdog27oj2wcwzrtx3iushg7lerfa2g36ij4kjjayewtcntrya3ry"), - "datacap": cid.MustParse("bafk2bzacecwhgrubpfbswc5ww2klbb4fegpzrpttz3b23idhij5cdunws6ktg"), - "eam": cid.MustParse("bafk2bzaceamqzyqot6stioffyr4uaof6ldl4qvk3kdrwythdoshxebnitv5fw"), - "ethaccount": cid.MustParse("bafk2bzacebx6gjzqykce6rjscvfi5ve4cssp2vr2sq5mo4pgdv76pnogpp4ns"), - "evm": cid.MustParse("bafk2bzaceazcaj7a3qxer2cmnclwfttpjoaytz6rq6dv4xi4vdvt3n5a5xicg"), - "init": cid.MustParse("bafk2bzacedmklpc2hjsgb4s6gbihofnactg7isj7fyarpqvm3ka2q7vgmmt2o"), - "multisig": cid.MustParse("bafk2bzaceafeksx5kbucsn23zypsqcqzhuhlp7dbo4lgbrttq3c3qhtttbrbi"), - "paymentchannel": cid.MustParse("bafk2bzaceacphrzczhfilynn43zcze3k42rqbswlrj2cytweaie664tqgzapy"), + BundleGitTag: "v16.0.0-rc3", + ManifestCid: cid.MustParse("bafy2bzacea35za4a3ljlupfn2wxdzwz5py6vbu267s5p4p4uvdoqyhhggbbfq"), + Actors: map[string]cid.Cid{ + "account": cid.MustParse("bafk2bzacedzuxjcmialu22l24x6z5x2j3lxsxxruxmhvhpkttkvlkrjulkbyq"), + "cron": cid.MustParse("bafk2bzacebgi4wwp2dr4z4wtyziz4mn7ipglpez2ghxzh76sbapz4isvxfbc4"), + "datacap": cid.MustParse("bafk2bzacechuwtorkaqcmfgztggv5khbx36xyqw5emxibh6qd7si4pdg6i22q"), + "eam": cid.MustParse("bafk2bzaceddukui4pbnrfwcu7zv5acvbhgvclblxiwph2utpndb7qqj3oll5o"), + "ethaccount": cid.MustParse("bafk2bzaceafucqy3me7ellhrd5jla2a5wqo652agx4nb6467po643zgvy5d4w"), + "evm": cid.MustParse("bafk2bzacedmaykyptdfzwkbui6ptoueqsoj3wubtexdeumh7i7qsnlfmreetm"), + "init": cid.MustParse("bafk2bzacecauzck4cmqcbjzsz7jyugig5xcqhuj4lrkbykewkg3pineperxg6"), + "multisig": cid.MustParse("bafk2bzaceakkpute3br5t77lkfh4qi7ezzafrpoen7xngf46zjvfuaok3ffqi"), + "paymentchannel": cid.MustParse("bafk2bzacebwedmnkgpxta4y4pc3fjn5dazcjmlveztmv7gh6czi7zkrx6t4do"), "placeholder": cid.MustParse("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"), - "reward": cid.MustParse("bafk2bzaceah7txfotq2bxwiekiiw2cthwgho5kjagak5u2ovbe3dkewkkonsa"), - "storagemarket": cid.MustParse("bafk2bzacedju7nktksmy5ndapkgrwfmne5qojm45lc2ofzdou7hb6tg2tieg2"), - "storageminer": cid.MustParse("bafk2bzacea76f5hhwd66vjjtpd5t4gwuou54cjm6p2qlvw4de32fgzxhkdvu4"), - "storagepower": cid.MustParse("bafk2bzacedy7ccvrnoartrax62r7fyjqripuhluesw7gmdkkbxiyxjwfwhlay"), - "system": cid.MustParse("bafk2bzacea7a7o25gfrvgzd56kyfew54h7zvkkwwtjo4522bls5ziaey5qvn4"), - "verifiedregistry": cid.MustParse("bafk2bzaceduyj3egxhzaorf3g2tt26ndstjzjvktv5bdp5u7w4kohyyo3divm"), + "reward": cid.MustParse("bafk2bzaceac3ohau7sxi3xotwsi5bzo75lg74nwdmrxmx5rfnmkp7mo26uxsk"), + "storagemarket": cid.MustParse("bafk2bzacebn5ixsfxu36r2dbtvfp4ineu4dnhsvqm4qcpiph4cc6knqqkthto"), + "storageminer": cid.MustParse("bafk2bzacec3alndcdemx26bl3svrbcxtxpdjnmsfuhrawhx5ldd2dlfzzldq4"), + "storagepower": cid.MustParse("bafk2bzaceb4iqnikgmwuqlzzpb3lfl5k4glt32vgfxebu7h4r6zpzmyaxol7i"), + "system": cid.MustParse("bafk2bzaceajnotcpt6sx2afno7fjppp6wzrh4dgu2meeoptcjkorunvshi2hw"), + "verifiedregistry": cid.MustParse("bafk2bzaceazuqbqpozviewg7obtnhlq6tfewjl5vp5wdvkjxdlqbpkvig3zfu"), }, }, { Network: "testing-fake-proofs", @@ -1409,24 +1409,24 @@ var EmbeddedBuiltinActorsMetadata = []*BuiltinActorsMetadata{{ }, { Network: "testing-fake-proofs", Version: 16, - BundleGitTag: "v16.0.0-dev1", - ManifestCid: cid.MustParse("bafy2bzacecmw3pjfiwtdu3aksvihiloaygqdmw2sxsqfdqe23w7z23vmeg6g6"), - Actors: map[string]cid.Cid{ - "account": cid.MustParse("bafk2bzaceayo2leixvtge6enn2bb6cn3zpzq66flq24tmapn5dejhz5giyvbm"), - "cron": cid.MustParse("bafk2bzacebdog27oj2wcwzrtx3iushg7lerfa2g36ij4kjjayewtcntrya3ry"), - "datacap": cid.MustParse("bafk2bzacecwhgrubpfbswc5ww2klbb4fegpzrpttz3b23idhij5cdunws6ktg"), - "eam": cid.MustParse("bafk2bzaceamqzyqot6stioffyr4uaof6ldl4qvk3kdrwythdoshxebnitv5fw"), - "ethaccount": cid.MustParse("bafk2bzacebx6gjzqykce6rjscvfi5ve4cssp2vr2sq5mo4pgdv76pnogpp4ns"), - "evm": cid.MustParse("bafk2bzaceazcaj7a3qxer2cmnclwfttpjoaytz6rq6dv4xi4vdvt3n5a5xicg"), - "init": cid.MustParse("bafk2bzacedmklpc2hjsgb4s6gbihofnactg7isj7fyarpqvm3ka2q7vgmmt2o"), - "multisig": cid.MustParse("bafk2bzacecmwhignsepjxfubhfkhh25ktvpvozbqhtspu77h3ja4xa65ntbtk"), - "paymentchannel": cid.MustParse("bafk2bzaceacphrzczhfilynn43zcze3k42rqbswlrj2cytweaie664tqgzapy"), + BundleGitTag: "v16.0.0-rc3", + ManifestCid: cid.MustParse("bafy2bzacec4tth5r62ny75wt27tyzgzc4nc3zte6cxainlrxs54g7yvmlezs4"), + Actors: map[string]cid.Cid{ + "account": cid.MustParse("bafk2bzacedzuxjcmialu22l24x6z5x2j3lxsxxruxmhvhpkttkvlkrjulkbyq"), + "cron": cid.MustParse("bafk2bzacebgi4wwp2dr4z4wtyziz4mn7ipglpez2ghxzh76sbapz4isvxfbc4"), + "datacap": cid.MustParse("bafk2bzacechuwtorkaqcmfgztggv5khbx36xyqw5emxibh6qd7si4pdg6i22q"), + "eam": cid.MustParse("bafk2bzaceddukui4pbnrfwcu7zv5acvbhgvclblxiwph2utpndb7qqj3oll5o"), + "ethaccount": cid.MustParse("bafk2bzaceafucqy3me7ellhrd5jla2a5wqo652agx4nb6467po643zgvy5d4w"), + "evm": cid.MustParse("bafk2bzacedmaykyptdfzwkbui6ptoueqsoj3wubtexdeumh7i7qsnlfmreetm"), + "init": cid.MustParse("bafk2bzacecauzck4cmqcbjzsz7jyugig5xcqhuj4lrkbykewkg3pineperxg6"), + "multisig": cid.MustParse("bafk2bzaceai472rp5ba3xputcmaoqlleasxifzgjcnmthcnqpmgb24no2tdhk"), + "paymentchannel": cid.MustParse("bafk2bzacebwedmnkgpxta4y4pc3fjn5dazcjmlveztmv7gh6czi7zkrx6t4do"), "placeholder": cid.MustParse("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"), - "reward": cid.MustParse("bafk2bzaceah7txfotq2bxwiekiiw2cthwgho5kjagak5u2ovbe3dkewkkonsa"), - "storagemarket": cid.MustParse("bafk2bzacedju7nktksmy5ndapkgrwfmne5qojm45lc2ofzdou7hb6tg2tieg2"), - "storageminer": cid.MustParse("bafk2bzacebntmeef2evhgtlfut72g5bxoihhq6glucmlnaytxyst7bf3vp6ec"), - "storagepower": cid.MustParse("bafk2bzacedy7ccvrnoartrax62r7fyjqripuhluesw7gmdkkbxiyxjwfwhlay"), - "system": cid.MustParse("bafk2bzacea7a7o25gfrvgzd56kyfew54h7zvkkwwtjo4522bls5ziaey5qvn4"), - "verifiedregistry": cid.MustParse("bafk2bzaceduyj3egxhzaorf3g2tt26ndstjzjvktv5bdp5u7w4kohyyo3divm"), + "reward": cid.MustParse("bafk2bzaceac3ohau7sxi3xotwsi5bzo75lg74nwdmrxmx5rfnmkp7mo26uxsk"), + "storagemarket": cid.MustParse("bafk2bzacebn5ixsfxu36r2dbtvfp4ineu4dnhsvqm4qcpiph4cc6knqqkthto"), + "storageminer": cid.MustParse("bafk2bzaceaajmyyjy6tntcxngtc55nero4a4halejajpmeioub6fyznbqni74"), + "storagepower": cid.MustParse("bafk2bzaceb4iqnikgmwuqlzzpb3lfl5k4glt32vgfxebu7h4r6zpzmyaxol7i"), + "system": cid.MustParse("bafk2bzaceajnotcpt6sx2afno7fjppp6wzrh4dgu2meeoptcjkorunvshi2hw"), + "verifiedregistry": cid.MustParse("bafk2bzaceazuqbqpozviewg7obtnhlq6tfewjl5vp5wdvkjxdlqbpkvig3zfu"), }, }} diff --git a/build/openrpc/full.json b/build/openrpc/full.json index 7719662fed6..e0d300abc1f 100644 --- a/build/openrpc/full.json +++ b/build/openrpc/full.json @@ -20075,7 +20075,8 @@ "UpgradePhoenixHeight": 10101, "UpgradeWaffleHeight": 10101, "UpgradeTuktukHeight": 10101, - "UpgradeTeepHeight": 10101 + "UpgradeTeepHeight": 10101, + "UpgradeTockHeight": 10101 }, "Eip155ChainID": 123, "GenesisTimestamp": 42 @@ -20198,6 +20199,10 @@ "title": "number", "type": "number" }, + "UpgradeTockHeight": { + "title": "number", + "type": "number" + }, "UpgradeTrustHeight": { "title": "number", "type": "number" @@ -21586,9 +21591,6 @@ "SealedCID": { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, - "DealIDs": [ - 5432 - ], "Activation": 10101, "Expiration": 10101, "DealWeight": "0", @@ -21601,7 +21603,8 @@ "SectorKeyCID": { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, - "Flags": 0 + "Flags": 0, + "DailyFee": "0" } ] ], @@ -21613,13 +21616,9 @@ "title": "number", "type": "number" }, - "DealIDs": { - "items": { - "description": "Number is a number", - "title": "number", - "type": "number" - }, - "type": "array" + "DailyFee": { + "additionalProperties": false, + "type": "object" }, "DealWeight": { "additionalProperties": false, @@ -21888,7 +21887,8 @@ 5, 1 ], - "DisputableProofCount": 42 + "DisputableProofCount": 42, + "DailyFee": "0" } ] ], @@ -21896,6 +21896,10 @@ { "additionalProperties": false, "properties": { + "DailyFee": { + "additionalProperties": false, + "type": "object" + }, "DisputableProofCount": { "title": "number", "type": "number" @@ -23259,9 +23263,6 @@ "SealedCID": { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, - "DealIDs": [ - 5432 - ], "Activation": 10101, "Expiration": 10101, "DealWeight": "0", @@ -23274,7 +23275,8 @@ "SectorKeyCID": { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, - "Flags": 0 + "Flags": 0, + "DailyFee": "0" } ] ], @@ -23286,13 +23288,9 @@ "title": "number", "type": "number" }, - "DealIDs": { - "items": { - "description": "Number is a number", - "title": "number", - "type": "number" - }, - "type": "array" + "DailyFee": { + "additionalProperties": false, + "type": "object" }, "DealWeight": { "additionalProperties": false, @@ -24324,9 +24322,6 @@ "SealedCID": { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, - "DealIDs": [ - 5432 - ], "Activation": 10101, "Expiration": 10101, "DealWeight": "0", @@ -24339,7 +24334,8 @@ "SectorKeyCID": { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, - "Flags": 0 + "Flags": 0, + "DailyFee": "0" } ], "additionalProperties": false, @@ -24348,13 +24344,9 @@ "title": "number", "type": "number" }, - "DealIDs": { - "items": { - "description": "Number is a number", - "title": "number", - "type": "number" - }, - "type": "array" + "DailyFee": { + "additionalProperties": false, + "type": "object" }, "DealWeight": { "additionalProperties": false, diff --git a/build/openrpc/gateway.json b/build/openrpc/gateway.json index e044fbd4765..846f9f3119b 100644 --- a/build/openrpc/gateway.json +++ b/build/openrpc/gateway.json @@ -9679,7 +9679,8 @@ "UpgradePhoenixHeight": 10101, "UpgradeWaffleHeight": 10101, "UpgradeTuktukHeight": 10101, - "UpgradeTeepHeight": 10101 + "UpgradeTeepHeight": 10101, + "UpgradeTockHeight": 10101 }, "Eip155ChainID": 123, "GenesisTimestamp": 42 @@ -9802,6 +9803,10 @@ "title": "number", "type": "number" }, + "UpgradeTockHeight": { + "title": "number", + "type": "number" + }, "UpgradeTrustHeight": { "title": "number", "type": "number" @@ -10282,7 +10287,8 @@ 5, 1 ], - "DisputableProofCount": 42 + "DisputableProofCount": 42, + "DailyFee": "0" } ] ], @@ -10290,6 +10296,10 @@ { "additionalProperties": false, "properties": { + "DailyFee": { + "additionalProperties": false, + "type": "object" + }, "DisputableProofCount": { "title": "number", "type": "number" @@ -11707,9 +11717,6 @@ "SealedCID": { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, - "DealIDs": [ - 5432 - ], "Activation": 10101, "Expiration": 10101, "DealWeight": "0", @@ -11722,7 +11729,8 @@ "SectorKeyCID": { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, - "Flags": 0 + "Flags": 0, + "DailyFee": "0" } ], "additionalProperties": false, @@ -11731,13 +11739,9 @@ "title": "number", "type": "number" }, - "DealIDs": { - "items": { - "description": "Number is a number", - "title": "number", - "type": "number" - }, - "type": "array" + "DailyFee": { + "additionalProperties": false, + "type": "object" }, "DealWeight": { "additionalProperties": false, diff --git a/build/params_shared_vals.go b/build/params_shared_vals.go index 370e8fb8dad..d3478d5c693 100644 --- a/build/params_shared_vals.go +++ b/build/params_shared_vals.go @@ -34,11 +34,9 @@ var ZeroAddress = buildconstants.ZeroAddress // Deprecated: Use buildconstants.Z var Devnet = buildconstants.Devnet // Deprecated: Use buildconstants.Devnet instead -var FilBase = buildconstants.FilBase // Deprecated: Use buildconstants.FilBase instead -var FilAllocStorageMining = buildconstants.FilAllocStorageMining // Deprecated: Use buildconstants.FilAllocStorageMining instead +var FilBase = buildconstants.FilBase // Deprecated: Use buildconstants.FilBase instead var FilecoinPrecision = buildconstants.FilecoinPrecision // Deprecated: Use buildconstants.FilecoinPrecision instead -var FilReserved = buildconstants.FilReserved // Deprecated: Use buildconstants.FilReserved instead var InitialRewardBalance = buildconstants.InitialRewardBalance // Deprecated: Use buildconstants.InitialRewardBalance instead var InitialFilReserved = buildconstants.InitialFilReserved // Deprecated: Use buildconstants.InitialFilReserved instead diff --git a/chain/actors/builtin/miner/actor.go.template b/chain/actors/builtin/miner/actor.go.template index de590c93f32..058de451514 100644 --- a/chain/actors/builtin/miner/actor.go.template +++ b/chain/actors/builtin/miner/actor.go.template @@ -17,6 +17,7 @@ import ( "github.com/filecoin-project/lotus/chain/actors/adt" "github.com/filecoin-project/lotus/chain/types" + minertypes16 "github.com/filecoin-project/go-state-types/builtin/v16/miner" minertypes13 "github.com/filecoin-project/go-state-types/builtin/v13/miner" minertypes "github.com/filecoin-project/go-state-types/builtin/v9/miner" "github.com/filecoin-project/go-state-types/manifest" @@ -126,6 +127,7 @@ type Deadline interface { PartitionsChanged(Deadline) (bool, error) DisputableProofCount() (uint64, error) + DailyFee() (abi.TokenAmount, error) } type Partition interface { @@ -153,7 +155,7 @@ type Partition interface { UnprovenSectors() (bitfield.BitField, error) } -type SectorOnChainInfo = minertypes13.SectorOnChainInfo +type SectorOnChainInfo = minertypes16.SectorOnChainInfo func PreferredSealProofTypeFromWindowPoStType(nver network.Version, proof abi.RegisteredPoStProof, configWantSynthetic bool) (abi.RegisteredSealProof, error) { // We added support for the new proofs in network version 7, and removed support for the old @@ -256,7 +258,7 @@ type ProveCommitSectors3Params = minertypes13.ProveCommitSectors3Params type SectorActivationManifest = minertypes13.SectorActivationManifest type ProveReplicaUpdates3Params = minertypes13.ProveReplicaUpdates3Params type SectorUpdateManifest = minertypes13.SectorUpdateManifest -type SectorOnChainInfoFlags = minertypes13.SectorOnChainInfoFlags +type SectorOnChainInfoFlags = minertypes16.SectorOnChainInfoFlags type VerifiedAllocationKey = minertypes13.VerifiedAllocationKey var QAPowerMax = minertypes.QAPowerMax diff --git a/chain/actors/builtin/miner/miner.go b/chain/actors/builtin/miner/miner.go index 62ced8d0554..0fd65e8d399 100644 --- a/chain/actors/builtin/miner/miner.go +++ b/chain/actors/builtin/miner/miner.go @@ -10,6 +10,7 @@ import ( actorstypes "github.com/filecoin-project/go-state-types/actors" "github.com/filecoin-project/go-state-types/big" minertypes13 "github.com/filecoin-project/go-state-types/builtin/v13/miner" + minertypes16 "github.com/filecoin-project/go-state-types/builtin/v16/miner" minertypes "github.com/filecoin-project/go-state-types/builtin/v9/miner" "github.com/filecoin-project/go-state-types/cbor" "github.com/filecoin-project/go-state-types/dline" @@ -210,6 +211,7 @@ type Deadline interface { PartitionsChanged(Deadline) (bool, error) DisputableProofCount() (uint64, error) + DailyFee() (abi.TokenAmount, error) } type Partition interface { @@ -237,7 +239,7 @@ type Partition interface { UnprovenSectors() (bitfield.BitField, error) } -type SectorOnChainInfo = minertypes13.SectorOnChainInfo +type SectorOnChainInfo = minertypes16.SectorOnChainInfo func PreferredSealProofTypeFromWindowPoStType(nver network.Version, proof abi.RegisteredPoStProof, configWantSynthetic bool) (abi.RegisteredSealProof, error) { // We added support for the new proofs in network version 7, and removed support for the old @@ -340,7 +342,7 @@ type ProveCommitSectors3Params = minertypes13.ProveCommitSectors3Params type SectorActivationManifest = minertypes13.SectorActivationManifest type ProveReplicaUpdates3Params = minertypes13.ProveReplicaUpdates3Params type SectorUpdateManifest = minertypes13.SectorUpdateManifest -type SectorOnChainInfoFlags = minertypes13.SectorOnChainInfoFlags +type SectorOnChainInfoFlags = minertypes16.SectorOnChainInfoFlags type VerifiedAllocationKey = minertypes13.VerifiedAllocationKey var QAPowerMax = minertypes.QAPowerMax diff --git a/chain/actors/builtin/miner/state.go.template b/chain/actors/builtin/miner/state.go.template index a940dd9ea53..b80f79d047d 100644 --- a/chain/actors/builtin/miner/state.go.template +++ b/chain/actors/builtin/miner/state.go.template @@ -4,12 +4,10 @@ import ( "fmt" "bytes" "errors" -{{if (le .v 1)}} - "github.com/filecoin-project/go-state-types/big" -{{end}} "github.com/filecoin-project/go-bitfield" rle "github.com/filecoin-project/go-bitfield/rle" "github.com/filecoin-project/go-state-types/abi" + "github.com/filecoin-project/go-state-types/big" "github.com/filecoin-project/go-state-types/dline" "github.com/ipfs/go-cid" cbg "github.com/whyrusleeping/cbor-gen" @@ -552,6 +550,15 @@ func (d *deadline{{.v}}) DisputableProofCount() (uint64, error) { {{end}} } +func (d *deadline{{.v}}) DailyFee() (abi.TokenAmount, error) { +{{- if (ge .v 16)}} + if d.Deadline.DailyFee.Int != nil { + return d.Deadline.DailyFee, nil + } +{{- end}} + return big.Zero(), nil +} + func (p *partition{{.v}}) AllSectors() (bitfield.BitField, error) { return p.Partition.Sectors, nil } @@ -569,26 +576,37 @@ func (p *partition{{.v}}) UnprovenSectors() (bitfield.BitField, error) { } func fromV{{.v}}SectorOnChainInfo(v{{.v}} miner{{.v}}.SectorOnChainInfo) SectorOnChainInfo { +{{- if (ge .v 16)}} + dailyFee := v{{.v}}.DailyFee + if dailyFee.Int == nil { + dailyFee = big.Zero() + } +{{- end}} info := SectorOnChainInfo{ SectorNumber: v{{.v}}.SectorNumber, SealProof: v{{.v}}.SealProof, SealedCID: v{{.v}}.SealedCID, - DealIDs: v{{.v}}.DealIDs, + DeprecatedDealIDs: v{{.v}}.{{if (ge .v 16)}}Deprecated{{end}}DealIDs, Activation: v{{.v}}.Activation, Expiration: v{{.v}}.Expiration, DealWeight: v{{.v}}.DealWeight, VerifiedDealWeight: v{{.v}}.VerifiedDealWeight, InitialPledge: v{{.v}}.InitialPledge, - ExpectedDayReward: v{{.v}}.ExpectedDayReward, - ExpectedStoragePledge: v{{.v}}.ExpectedStoragePledge, - {{if (ge .v 7)}} + ExpectedDayReward: {{ if (lt .v 16)}}&{{end}}v{{.v}}.ExpectedDayReward, + ExpectedStoragePledge: {{ if (lt .v 16)}}&{{end}}v{{.v}}.ExpectedStoragePledge, + {{- if (ge .v 7)}} SectorKeyCID: v{{.v}}.SectorKeyCID, - {{end}} - {{if (ge .v 12)}} + {{- end}} + {{- if (ge .v 12)}} PowerBaseEpoch: v{{.v}}.PowerBaseEpoch, - ReplacedDayReward: v{{.v}}.ReplacedDayReward, + ReplacedDayReward: {{ if (lt .v 16)}}&{{end}}v{{.v}}.ReplacedDayReward, Flags: SectorOnChainInfoFlags(v{{.v}}.Flags), - {{end}} + {{- end}} + {{- if (ge .v 16)}} + DailyFee: dailyFee, + {{- else}} + DailyFee: big.Zero(), + {{- end}} } return info } diff --git a/chain/actors/builtin/miner/v0.go b/chain/actors/builtin/miner/v0.go index 5301ed1cbca..e06326b5455 100644 --- a/chain/actors/builtin/miner/v0.go +++ b/chain/actors/builtin/miner/v0.go @@ -480,6 +480,10 @@ func (d *deadline0) DisputableProofCount() (uint64, error) { } +func (d *deadline0) DailyFee() (abi.TokenAmount, error) { + return big.Zero(), nil +} + func (p *partition0) AllSectors() (bitfield.BitField, error) { return p.Partition.Sectors, nil } @@ -501,14 +505,15 @@ func fromV0SectorOnChainInfo(v0 miner0.SectorOnChainInfo) SectorOnChainInfo { SectorNumber: v0.SectorNumber, SealProof: v0.SealProof, SealedCID: v0.SealedCID, - DealIDs: v0.DealIDs, + DeprecatedDealIDs: v0.DealIDs, Activation: v0.Activation, Expiration: v0.Expiration, DealWeight: v0.DealWeight, VerifiedDealWeight: v0.VerifiedDealWeight, InitialPledge: v0.InitialPledge, - ExpectedDayReward: v0.ExpectedDayReward, - ExpectedStoragePledge: v0.ExpectedStoragePledge, + ExpectedDayReward: &v0.ExpectedDayReward, + ExpectedStoragePledge: &v0.ExpectedStoragePledge, + DailyFee: big.Zero(), } return info } diff --git a/chain/actors/builtin/miner/v10.go b/chain/actors/builtin/miner/v10.go index 53dc90b4560..01517073805 100644 --- a/chain/actors/builtin/miner/v10.go +++ b/chain/actors/builtin/miner/v10.go @@ -13,6 +13,7 @@ import ( rle "github.com/filecoin-project/go-bitfield/rle" "github.com/filecoin-project/go-state-types/abi" actorstypes "github.com/filecoin-project/go-state-types/actors" + "github.com/filecoin-project/go-state-types/big" builtin10 "github.com/filecoin-project/go-state-types/builtin" miner10 "github.com/filecoin-project/go-state-types/builtin/v10/miner" adt10 "github.com/filecoin-project/go-state-types/builtin/v10/util/adt" @@ -514,6 +515,10 @@ func (d *deadline10) DisputableProofCount() (uint64, error) { } +func (d *deadline10) DailyFee() (abi.TokenAmount, error) { + return big.Zero(), nil +} + func (p *partition10) AllSectors() (bitfield.BitField, error) { return p.Partition.Sectors, nil } @@ -535,16 +540,16 @@ func fromV10SectorOnChainInfo(v10 miner10.SectorOnChainInfo) SectorOnChainInfo { SectorNumber: v10.SectorNumber, SealProof: v10.SealProof, SealedCID: v10.SealedCID, - DealIDs: v10.DealIDs, + DeprecatedDealIDs: v10.DealIDs, Activation: v10.Activation, Expiration: v10.Expiration, DealWeight: v10.DealWeight, VerifiedDealWeight: v10.VerifiedDealWeight, InitialPledge: v10.InitialPledge, - ExpectedDayReward: v10.ExpectedDayReward, - ExpectedStoragePledge: v10.ExpectedStoragePledge, - - SectorKeyCID: v10.SectorKeyCID, + ExpectedDayReward: &v10.ExpectedDayReward, + ExpectedStoragePledge: &v10.ExpectedStoragePledge, + SectorKeyCID: v10.SectorKeyCID, + DailyFee: big.Zero(), } return info } diff --git a/chain/actors/builtin/miner/v11.go b/chain/actors/builtin/miner/v11.go index 11a91c26b23..8fd030e535a 100644 --- a/chain/actors/builtin/miner/v11.go +++ b/chain/actors/builtin/miner/v11.go @@ -13,6 +13,7 @@ import ( rle "github.com/filecoin-project/go-bitfield/rle" "github.com/filecoin-project/go-state-types/abi" actorstypes "github.com/filecoin-project/go-state-types/actors" + "github.com/filecoin-project/go-state-types/big" builtin11 "github.com/filecoin-project/go-state-types/builtin" miner11 "github.com/filecoin-project/go-state-types/builtin/v11/miner" adt11 "github.com/filecoin-project/go-state-types/builtin/v11/util/adt" @@ -514,6 +515,10 @@ func (d *deadline11) DisputableProofCount() (uint64, error) { } +func (d *deadline11) DailyFee() (abi.TokenAmount, error) { + return big.Zero(), nil +} + func (p *partition11) AllSectors() (bitfield.BitField, error) { return p.Partition.Sectors, nil } @@ -535,16 +540,16 @@ func fromV11SectorOnChainInfo(v11 miner11.SectorOnChainInfo) SectorOnChainInfo { SectorNumber: v11.SectorNumber, SealProof: v11.SealProof, SealedCID: v11.SealedCID, - DealIDs: v11.DealIDs, + DeprecatedDealIDs: v11.DealIDs, Activation: v11.Activation, Expiration: v11.Expiration, DealWeight: v11.DealWeight, VerifiedDealWeight: v11.VerifiedDealWeight, InitialPledge: v11.InitialPledge, - ExpectedDayReward: v11.ExpectedDayReward, - ExpectedStoragePledge: v11.ExpectedStoragePledge, - - SectorKeyCID: v11.SectorKeyCID, + ExpectedDayReward: &v11.ExpectedDayReward, + ExpectedStoragePledge: &v11.ExpectedStoragePledge, + SectorKeyCID: v11.SectorKeyCID, + DailyFee: big.Zero(), } return info } diff --git a/chain/actors/builtin/miner/v12.go b/chain/actors/builtin/miner/v12.go index a26d78d3204..74675d25b69 100644 --- a/chain/actors/builtin/miner/v12.go +++ b/chain/actors/builtin/miner/v12.go @@ -13,6 +13,7 @@ import ( rle "github.com/filecoin-project/go-bitfield/rle" "github.com/filecoin-project/go-state-types/abi" actorstypes "github.com/filecoin-project/go-state-types/actors" + "github.com/filecoin-project/go-state-types/big" builtin12 "github.com/filecoin-project/go-state-types/builtin" miner12 "github.com/filecoin-project/go-state-types/builtin/v12/miner" adt12 "github.com/filecoin-project/go-state-types/builtin/v12/util/adt" @@ -514,6 +515,10 @@ func (d *deadline12) DisputableProofCount() (uint64, error) { } +func (d *deadline12) DailyFee() (abi.TokenAmount, error) { + return big.Zero(), nil +} + func (p *partition12) AllSectors() (bitfield.BitField, error) { return p.Partition.Sectors, nil } @@ -535,20 +540,19 @@ func fromV12SectorOnChainInfo(v12 miner12.SectorOnChainInfo) SectorOnChainInfo { SectorNumber: v12.SectorNumber, SealProof: v12.SealProof, SealedCID: v12.SealedCID, - DealIDs: v12.DealIDs, + DeprecatedDealIDs: v12.DealIDs, Activation: v12.Activation, Expiration: v12.Expiration, DealWeight: v12.DealWeight, VerifiedDealWeight: v12.VerifiedDealWeight, InitialPledge: v12.InitialPledge, - ExpectedDayReward: v12.ExpectedDayReward, - ExpectedStoragePledge: v12.ExpectedStoragePledge, - - SectorKeyCID: v12.SectorKeyCID, - - PowerBaseEpoch: v12.PowerBaseEpoch, - ReplacedDayReward: v12.ReplacedDayReward, - Flags: SectorOnChainInfoFlags(v12.Flags), + ExpectedDayReward: &v12.ExpectedDayReward, + ExpectedStoragePledge: &v12.ExpectedStoragePledge, + SectorKeyCID: v12.SectorKeyCID, + PowerBaseEpoch: v12.PowerBaseEpoch, + ReplacedDayReward: &v12.ReplacedDayReward, + Flags: SectorOnChainInfoFlags(v12.Flags), + DailyFee: big.Zero(), } return info } diff --git a/chain/actors/builtin/miner/v13.go b/chain/actors/builtin/miner/v13.go index c033a9907c8..baaa3cd6c24 100644 --- a/chain/actors/builtin/miner/v13.go +++ b/chain/actors/builtin/miner/v13.go @@ -13,6 +13,7 @@ import ( rle "github.com/filecoin-project/go-bitfield/rle" "github.com/filecoin-project/go-state-types/abi" actorstypes "github.com/filecoin-project/go-state-types/actors" + "github.com/filecoin-project/go-state-types/big" builtin13 "github.com/filecoin-project/go-state-types/builtin" miner13 "github.com/filecoin-project/go-state-types/builtin/v13/miner" adt13 "github.com/filecoin-project/go-state-types/builtin/v13/util/adt" @@ -514,6 +515,10 @@ func (d *deadline13) DisputableProofCount() (uint64, error) { } +func (d *deadline13) DailyFee() (abi.TokenAmount, error) { + return big.Zero(), nil +} + func (p *partition13) AllSectors() (bitfield.BitField, error) { return p.Partition.Sectors, nil } @@ -535,20 +540,19 @@ func fromV13SectorOnChainInfo(v13 miner13.SectorOnChainInfo) SectorOnChainInfo { SectorNumber: v13.SectorNumber, SealProof: v13.SealProof, SealedCID: v13.SealedCID, - DealIDs: v13.DealIDs, + DeprecatedDealIDs: v13.DealIDs, Activation: v13.Activation, Expiration: v13.Expiration, DealWeight: v13.DealWeight, VerifiedDealWeight: v13.VerifiedDealWeight, InitialPledge: v13.InitialPledge, - ExpectedDayReward: v13.ExpectedDayReward, - ExpectedStoragePledge: v13.ExpectedStoragePledge, - - SectorKeyCID: v13.SectorKeyCID, - - PowerBaseEpoch: v13.PowerBaseEpoch, - ReplacedDayReward: v13.ReplacedDayReward, - Flags: SectorOnChainInfoFlags(v13.Flags), + ExpectedDayReward: &v13.ExpectedDayReward, + ExpectedStoragePledge: &v13.ExpectedStoragePledge, + SectorKeyCID: v13.SectorKeyCID, + PowerBaseEpoch: v13.PowerBaseEpoch, + ReplacedDayReward: &v13.ReplacedDayReward, + Flags: SectorOnChainInfoFlags(v13.Flags), + DailyFee: big.Zero(), } return info } diff --git a/chain/actors/builtin/miner/v14.go b/chain/actors/builtin/miner/v14.go index 3153bead3fd..fc7402b2705 100644 --- a/chain/actors/builtin/miner/v14.go +++ b/chain/actors/builtin/miner/v14.go @@ -13,6 +13,7 @@ import ( rle "github.com/filecoin-project/go-bitfield/rle" "github.com/filecoin-project/go-state-types/abi" actorstypes "github.com/filecoin-project/go-state-types/actors" + "github.com/filecoin-project/go-state-types/big" builtin14 "github.com/filecoin-project/go-state-types/builtin" miner14 "github.com/filecoin-project/go-state-types/builtin/v14/miner" adt14 "github.com/filecoin-project/go-state-types/builtin/v14/util/adt" @@ -514,6 +515,10 @@ func (d *deadline14) DisputableProofCount() (uint64, error) { } +func (d *deadline14) DailyFee() (abi.TokenAmount, error) { + return big.Zero(), nil +} + func (p *partition14) AllSectors() (bitfield.BitField, error) { return p.Partition.Sectors, nil } @@ -535,20 +540,19 @@ func fromV14SectorOnChainInfo(v14 miner14.SectorOnChainInfo) SectorOnChainInfo { SectorNumber: v14.SectorNumber, SealProof: v14.SealProof, SealedCID: v14.SealedCID, - DealIDs: v14.DealIDs, + DeprecatedDealIDs: v14.DealIDs, Activation: v14.Activation, Expiration: v14.Expiration, DealWeight: v14.DealWeight, VerifiedDealWeight: v14.VerifiedDealWeight, InitialPledge: v14.InitialPledge, - ExpectedDayReward: v14.ExpectedDayReward, - ExpectedStoragePledge: v14.ExpectedStoragePledge, - - SectorKeyCID: v14.SectorKeyCID, - - PowerBaseEpoch: v14.PowerBaseEpoch, - ReplacedDayReward: v14.ReplacedDayReward, - Flags: SectorOnChainInfoFlags(v14.Flags), + ExpectedDayReward: &v14.ExpectedDayReward, + ExpectedStoragePledge: &v14.ExpectedStoragePledge, + SectorKeyCID: v14.SectorKeyCID, + PowerBaseEpoch: v14.PowerBaseEpoch, + ReplacedDayReward: &v14.ReplacedDayReward, + Flags: SectorOnChainInfoFlags(v14.Flags), + DailyFee: big.Zero(), } return info } diff --git a/chain/actors/builtin/miner/v15.go b/chain/actors/builtin/miner/v15.go index 3895daac509..a997fe522f7 100644 --- a/chain/actors/builtin/miner/v15.go +++ b/chain/actors/builtin/miner/v15.go @@ -13,6 +13,7 @@ import ( rle "github.com/filecoin-project/go-bitfield/rle" "github.com/filecoin-project/go-state-types/abi" actorstypes "github.com/filecoin-project/go-state-types/actors" + "github.com/filecoin-project/go-state-types/big" builtin15 "github.com/filecoin-project/go-state-types/builtin" miner15 "github.com/filecoin-project/go-state-types/builtin/v15/miner" adt15 "github.com/filecoin-project/go-state-types/builtin/v15/util/adt" @@ -514,6 +515,10 @@ func (d *deadline15) DisputableProofCount() (uint64, error) { } +func (d *deadline15) DailyFee() (abi.TokenAmount, error) { + return big.Zero(), nil +} + func (p *partition15) AllSectors() (bitfield.BitField, error) { return p.Partition.Sectors, nil } @@ -535,20 +540,19 @@ func fromV15SectorOnChainInfo(v15 miner15.SectorOnChainInfo) SectorOnChainInfo { SectorNumber: v15.SectorNumber, SealProof: v15.SealProof, SealedCID: v15.SealedCID, - DealIDs: v15.DealIDs, + DeprecatedDealIDs: v15.DealIDs, Activation: v15.Activation, Expiration: v15.Expiration, DealWeight: v15.DealWeight, VerifiedDealWeight: v15.VerifiedDealWeight, InitialPledge: v15.InitialPledge, - ExpectedDayReward: v15.ExpectedDayReward, - ExpectedStoragePledge: v15.ExpectedStoragePledge, - - SectorKeyCID: v15.SectorKeyCID, - - PowerBaseEpoch: v15.PowerBaseEpoch, - ReplacedDayReward: v15.ReplacedDayReward, - Flags: SectorOnChainInfoFlags(v15.Flags), + ExpectedDayReward: &v15.ExpectedDayReward, + ExpectedStoragePledge: &v15.ExpectedStoragePledge, + SectorKeyCID: v15.SectorKeyCID, + PowerBaseEpoch: v15.PowerBaseEpoch, + ReplacedDayReward: &v15.ReplacedDayReward, + Flags: SectorOnChainInfoFlags(v15.Flags), + DailyFee: big.Zero(), } return info } diff --git a/chain/actors/builtin/miner/v16.go b/chain/actors/builtin/miner/v16.go index f1809c00343..4453332e16e 100644 --- a/chain/actors/builtin/miner/v16.go +++ b/chain/actors/builtin/miner/v16.go @@ -13,6 +13,7 @@ import ( rle "github.com/filecoin-project/go-bitfield/rle" "github.com/filecoin-project/go-state-types/abi" actorstypes "github.com/filecoin-project/go-state-types/actors" + "github.com/filecoin-project/go-state-types/big" builtin16 "github.com/filecoin-project/go-state-types/builtin" miner16 "github.com/filecoin-project/go-state-types/builtin/v16/miner" adt16 "github.com/filecoin-project/go-state-types/builtin/v16/util/adt" @@ -514,6 +515,13 @@ func (d *deadline16) DisputableProofCount() (uint64, error) { } +func (d *deadline16) DailyFee() (abi.TokenAmount, error) { + if d.Deadline.DailyFee.Int != nil { + return d.Deadline.DailyFee, nil + } + return big.Zero(), nil +} + func (p *partition16) AllSectors() (bitfield.BitField, error) { return p.Partition.Sectors, nil } @@ -531,11 +539,15 @@ func (p *partition16) UnprovenSectors() (bitfield.BitField, error) { } func fromV16SectorOnChainInfo(v16 miner16.SectorOnChainInfo) SectorOnChainInfo { + dailyFee := v16.DailyFee + if dailyFee.Int == nil { + dailyFee = big.Zero() + } info := SectorOnChainInfo{ SectorNumber: v16.SectorNumber, SealProof: v16.SealProof, SealedCID: v16.SealedCID, - DealIDs: v16.DealIDs, + DeprecatedDealIDs: v16.DeprecatedDealIDs, Activation: v16.Activation, Expiration: v16.Expiration, DealWeight: v16.DealWeight, @@ -543,12 +555,11 @@ func fromV16SectorOnChainInfo(v16 miner16.SectorOnChainInfo) SectorOnChainInfo { InitialPledge: v16.InitialPledge, ExpectedDayReward: v16.ExpectedDayReward, ExpectedStoragePledge: v16.ExpectedStoragePledge, - - SectorKeyCID: v16.SectorKeyCID, - - PowerBaseEpoch: v16.PowerBaseEpoch, - ReplacedDayReward: v16.ReplacedDayReward, - Flags: SectorOnChainInfoFlags(v16.Flags), + SectorKeyCID: v16.SectorKeyCID, + PowerBaseEpoch: v16.PowerBaseEpoch, + ReplacedDayReward: v16.ReplacedDayReward, + Flags: SectorOnChainInfoFlags(v16.Flags), + DailyFee: dailyFee, } return info } diff --git a/chain/actors/builtin/miner/v2.go b/chain/actors/builtin/miner/v2.go index 5a81ad31f95..bc035c75e75 100644 --- a/chain/actors/builtin/miner/v2.go +++ b/chain/actors/builtin/miner/v2.go @@ -13,6 +13,7 @@ import ( rle "github.com/filecoin-project/go-bitfield/rle" "github.com/filecoin-project/go-state-types/abi" actorstypes "github.com/filecoin-project/go-state-types/actors" + "github.com/filecoin-project/go-state-types/big" "github.com/filecoin-project/go-state-types/dline" "github.com/filecoin-project/go-state-types/manifest" miner2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/miner" @@ -511,6 +512,10 @@ func (d *deadline2) DisputableProofCount() (uint64, error) { } +func (d *deadline2) DailyFee() (abi.TokenAmount, error) { + return big.Zero(), nil +} + func (p *partition2) AllSectors() (bitfield.BitField, error) { return p.Partition.Sectors, nil } @@ -532,14 +537,15 @@ func fromV2SectorOnChainInfo(v2 miner2.SectorOnChainInfo) SectorOnChainInfo { SectorNumber: v2.SectorNumber, SealProof: v2.SealProof, SealedCID: v2.SealedCID, - DealIDs: v2.DealIDs, + DeprecatedDealIDs: v2.DealIDs, Activation: v2.Activation, Expiration: v2.Expiration, DealWeight: v2.DealWeight, VerifiedDealWeight: v2.VerifiedDealWeight, InitialPledge: v2.InitialPledge, - ExpectedDayReward: v2.ExpectedDayReward, - ExpectedStoragePledge: v2.ExpectedStoragePledge, + ExpectedDayReward: &v2.ExpectedDayReward, + ExpectedStoragePledge: &v2.ExpectedStoragePledge, + DailyFee: big.Zero(), } return info } diff --git a/chain/actors/builtin/miner/v3.go b/chain/actors/builtin/miner/v3.go index aa1574cf47d..2fefe01474f 100644 --- a/chain/actors/builtin/miner/v3.go +++ b/chain/actors/builtin/miner/v3.go @@ -13,6 +13,7 @@ import ( rle "github.com/filecoin-project/go-bitfield/rle" "github.com/filecoin-project/go-state-types/abi" actorstypes "github.com/filecoin-project/go-state-types/actors" + "github.com/filecoin-project/go-state-types/big" "github.com/filecoin-project/go-state-types/dline" "github.com/filecoin-project/go-state-types/manifest" builtin3 "github.com/filecoin-project/specs-actors/v3/actors/builtin" @@ -511,6 +512,10 @@ func (d *deadline3) DisputableProofCount() (uint64, error) { } +func (d *deadline3) DailyFee() (abi.TokenAmount, error) { + return big.Zero(), nil +} + func (p *partition3) AllSectors() (bitfield.BitField, error) { return p.Partition.Sectors, nil } @@ -532,14 +537,15 @@ func fromV3SectorOnChainInfo(v3 miner3.SectorOnChainInfo) SectorOnChainInfo { SectorNumber: v3.SectorNumber, SealProof: v3.SealProof, SealedCID: v3.SealedCID, - DealIDs: v3.DealIDs, + DeprecatedDealIDs: v3.DealIDs, Activation: v3.Activation, Expiration: v3.Expiration, DealWeight: v3.DealWeight, VerifiedDealWeight: v3.VerifiedDealWeight, InitialPledge: v3.InitialPledge, - ExpectedDayReward: v3.ExpectedDayReward, - ExpectedStoragePledge: v3.ExpectedStoragePledge, + ExpectedDayReward: &v3.ExpectedDayReward, + ExpectedStoragePledge: &v3.ExpectedStoragePledge, + DailyFee: big.Zero(), } return info } diff --git a/chain/actors/builtin/miner/v4.go b/chain/actors/builtin/miner/v4.go index 1faf30c0982..93a0ce480ad 100644 --- a/chain/actors/builtin/miner/v4.go +++ b/chain/actors/builtin/miner/v4.go @@ -13,6 +13,7 @@ import ( rle "github.com/filecoin-project/go-bitfield/rle" "github.com/filecoin-project/go-state-types/abi" actorstypes "github.com/filecoin-project/go-state-types/actors" + "github.com/filecoin-project/go-state-types/big" "github.com/filecoin-project/go-state-types/dline" "github.com/filecoin-project/go-state-types/manifest" builtin4 "github.com/filecoin-project/specs-actors/v4/actors/builtin" @@ -511,6 +512,10 @@ func (d *deadline4) DisputableProofCount() (uint64, error) { } +func (d *deadline4) DailyFee() (abi.TokenAmount, error) { + return big.Zero(), nil +} + func (p *partition4) AllSectors() (bitfield.BitField, error) { return p.Partition.Sectors, nil } @@ -532,14 +537,15 @@ func fromV4SectorOnChainInfo(v4 miner4.SectorOnChainInfo) SectorOnChainInfo { SectorNumber: v4.SectorNumber, SealProof: v4.SealProof, SealedCID: v4.SealedCID, - DealIDs: v4.DealIDs, + DeprecatedDealIDs: v4.DealIDs, Activation: v4.Activation, Expiration: v4.Expiration, DealWeight: v4.DealWeight, VerifiedDealWeight: v4.VerifiedDealWeight, InitialPledge: v4.InitialPledge, - ExpectedDayReward: v4.ExpectedDayReward, - ExpectedStoragePledge: v4.ExpectedStoragePledge, + ExpectedDayReward: &v4.ExpectedDayReward, + ExpectedStoragePledge: &v4.ExpectedStoragePledge, + DailyFee: big.Zero(), } return info } diff --git a/chain/actors/builtin/miner/v5.go b/chain/actors/builtin/miner/v5.go index be4b5e0b2e9..812233a177c 100644 --- a/chain/actors/builtin/miner/v5.go +++ b/chain/actors/builtin/miner/v5.go @@ -13,6 +13,7 @@ import ( rle "github.com/filecoin-project/go-bitfield/rle" "github.com/filecoin-project/go-state-types/abi" actorstypes "github.com/filecoin-project/go-state-types/actors" + "github.com/filecoin-project/go-state-types/big" "github.com/filecoin-project/go-state-types/dline" "github.com/filecoin-project/go-state-types/manifest" builtin5 "github.com/filecoin-project/specs-actors/v5/actors/builtin" @@ -511,6 +512,10 @@ func (d *deadline5) DisputableProofCount() (uint64, error) { } +func (d *deadline5) DailyFee() (abi.TokenAmount, error) { + return big.Zero(), nil +} + func (p *partition5) AllSectors() (bitfield.BitField, error) { return p.Partition.Sectors, nil } @@ -532,14 +537,15 @@ func fromV5SectorOnChainInfo(v5 miner5.SectorOnChainInfo) SectorOnChainInfo { SectorNumber: v5.SectorNumber, SealProof: v5.SealProof, SealedCID: v5.SealedCID, - DealIDs: v5.DealIDs, + DeprecatedDealIDs: v5.DealIDs, Activation: v5.Activation, Expiration: v5.Expiration, DealWeight: v5.DealWeight, VerifiedDealWeight: v5.VerifiedDealWeight, InitialPledge: v5.InitialPledge, - ExpectedDayReward: v5.ExpectedDayReward, - ExpectedStoragePledge: v5.ExpectedStoragePledge, + ExpectedDayReward: &v5.ExpectedDayReward, + ExpectedStoragePledge: &v5.ExpectedStoragePledge, + DailyFee: big.Zero(), } return info } diff --git a/chain/actors/builtin/miner/v6.go b/chain/actors/builtin/miner/v6.go index fa8c30e4070..25bcbdbf08d 100644 --- a/chain/actors/builtin/miner/v6.go +++ b/chain/actors/builtin/miner/v6.go @@ -13,6 +13,7 @@ import ( rle "github.com/filecoin-project/go-bitfield/rle" "github.com/filecoin-project/go-state-types/abi" actorstypes "github.com/filecoin-project/go-state-types/actors" + "github.com/filecoin-project/go-state-types/big" "github.com/filecoin-project/go-state-types/dline" "github.com/filecoin-project/go-state-types/manifest" builtin6 "github.com/filecoin-project/specs-actors/v6/actors/builtin" @@ -511,6 +512,10 @@ func (d *deadline6) DisputableProofCount() (uint64, error) { } +func (d *deadline6) DailyFee() (abi.TokenAmount, error) { + return big.Zero(), nil +} + func (p *partition6) AllSectors() (bitfield.BitField, error) { return p.Partition.Sectors, nil } @@ -532,14 +537,15 @@ func fromV6SectorOnChainInfo(v6 miner6.SectorOnChainInfo) SectorOnChainInfo { SectorNumber: v6.SectorNumber, SealProof: v6.SealProof, SealedCID: v6.SealedCID, - DealIDs: v6.DealIDs, + DeprecatedDealIDs: v6.DealIDs, Activation: v6.Activation, Expiration: v6.Expiration, DealWeight: v6.DealWeight, VerifiedDealWeight: v6.VerifiedDealWeight, InitialPledge: v6.InitialPledge, - ExpectedDayReward: v6.ExpectedDayReward, - ExpectedStoragePledge: v6.ExpectedStoragePledge, + ExpectedDayReward: &v6.ExpectedDayReward, + ExpectedStoragePledge: &v6.ExpectedStoragePledge, + DailyFee: big.Zero(), } return info } diff --git a/chain/actors/builtin/miner/v7.go b/chain/actors/builtin/miner/v7.go index d6bb0e16eae..f42a0edd1ce 100644 --- a/chain/actors/builtin/miner/v7.go +++ b/chain/actors/builtin/miner/v7.go @@ -13,6 +13,7 @@ import ( rle "github.com/filecoin-project/go-bitfield/rle" "github.com/filecoin-project/go-state-types/abi" actorstypes "github.com/filecoin-project/go-state-types/actors" + "github.com/filecoin-project/go-state-types/big" "github.com/filecoin-project/go-state-types/dline" "github.com/filecoin-project/go-state-types/manifest" builtin7 "github.com/filecoin-project/specs-actors/v7/actors/builtin" @@ -510,6 +511,10 @@ func (d *deadline7) DisputableProofCount() (uint64, error) { } +func (d *deadline7) DailyFee() (abi.TokenAmount, error) { + return big.Zero(), nil +} + func (p *partition7) AllSectors() (bitfield.BitField, error) { return p.Partition.Sectors, nil } @@ -531,16 +536,16 @@ func fromV7SectorOnChainInfo(v7 miner7.SectorOnChainInfo) SectorOnChainInfo { SectorNumber: v7.SectorNumber, SealProof: v7.SealProof, SealedCID: v7.SealedCID, - DealIDs: v7.DealIDs, + DeprecatedDealIDs: v7.DealIDs, Activation: v7.Activation, Expiration: v7.Expiration, DealWeight: v7.DealWeight, VerifiedDealWeight: v7.VerifiedDealWeight, InitialPledge: v7.InitialPledge, - ExpectedDayReward: v7.ExpectedDayReward, - ExpectedStoragePledge: v7.ExpectedStoragePledge, - - SectorKeyCID: v7.SectorKeyCID, + ExpectedDayReward: &v7.ExpectedDayReward, + ExpectedStoragePledge: &v7.ExpectedStoragePledge, + SectorKeyCID: v7.SectorKeyCID, + DailyFee: big.Zero(), } return info } diff --git a/chain/actors/builtin/miner/v8.go b/chain/actors/builtin/miner/v8.go index 06a205e7626..7a44e0f8f15 100644 --- a/chain/actors/builtin/miner/v8.go +++ b/chain/actors/builtin/miner/v8.go @@ -13,6 +13,7 @@ import ( rle "github.com/filecoin-project/go-bitfield/rle" "github.com/filecoin-project/go-state-types/abi" actorstypes "github.com/filecoin-project/go-state-types/actors" + "github.com/filecoin-project/go-state-types/big" builtin8 "github.com/filecoin-project/go-state-types/builtin" miner8 "github.com/filecoin-project/go-state-types/builtin/v8/miner" adt8 "github.com/filecoin-project/go-state-types/builtin/v8/util/adt" @@ -510,6 +511,10 @@ func (d *deadline8) DisputableProofCount() (uint64, error) { } +func (d *deadline8) DailyFee() (abi.TokenAmount, error) { + return big.Zero(), nil +} + func (p *partition8) AllSectors() (bitfield.BitField, error) { return p.Partition.Sectors, nil } @@ -531,16 +536,16 @@ func fromV8SectorOnChainInfo(v8 miner8.SectorOnChainInfo) SectorOnChainInfo { SectorNumber: v8.SectorNumber, SealProof: v8.SealProof, SealedCID: v8.SealedCID, - DealIDs: v8.DealIDs, + DeprecatedDealIDs: v8.DealIDs, Activation: v8.Activation, Expiration: v8.Expiration, DealWeight: v8.DealWeight, VerifiedDealWeight: v8.VerifiedDealWeight, InitialPledge: v8.InitialPledge, - ExpectedDayReward: v8.ExpectedDayReward, - ExpectedStoragePledge: v8.ExpectedStoragePledge, - - SectorKeyCID: v8.SectorKeyCID, + ExpectedDayReward: &v8.ExpectedDayReward, + ExpectedStoragePledge: &v8.ExpectedStoragePledge, + SectorKeyCID: v8.SectorKeyCID, + DailyFee: big.Zero(), } return info } diff --git a/chain/actors/builtin/miner/v9.go b/chain/actors/builtin/miner/v9.go index 6cbbd509ec3..f199e94d674 100644 --- a/chain/actors/builtin/miner/v9.go +++ b/chain/actors/builtin/miner/v9.go @@ -13,6 +13,7 @@ import ( rle "github.com/filecoin-project/go-bitfield/rle" "github.com/filecoin-project/go-state-types/abi" actorstypes "github.com/filecoin-project/go-state-types/actors" + "github.com/filecoin-project/go-state-types/big" builtin9 "github.com/filecoin-project/go-state-types/builtin" miner9 "github.com/filecoin-project/go-state-types/builtin/v9/miner" adt9 "github.com/filecoin-project/go-state-types/builtin/v9/util/adt" @@ -514,6 +515,10 @@ func (d *deadline9) DisputableProofCount() (uint64, error) { } +func (d *deadline9) DailyFee() (abi.TokenAmount, error) { + return big.Zero(), nil +} + func (p *partition9) AllSectors() (bitfield.BitField, error) { return p.Partition.Sectors, nil } @@ -535,16 +540,16 @@ func fromV9SectorOnChainInfo(v9 miner9.SectorOnChainInfo) SectorOnChainInfo { SectorNumber: v9.SectorNumber, SealProof: v9.SealProof, SealedCID: v9.SealedCID, - DealIDs: v9.DealIDs, + DeprecatedDealIDs: v9.DealIDs, Activation: v9.Activation, Expiration: v9.Expiration, DealWeight: v9.DealWeight, VerifiedDealWeight: v9.VerifiedDealWeight, InitialPledge: v9.InitialPledge, - ExpectedDayReward: v9.ExpectedDayReward, - ExpectedStoragePledge: v9.ExpectedStoragePledge, - - SectorKeyCID: v9.SectorKeyCID, + ExpectedDayReward: &v9.ExpectedDayReward, + ExpectedStoragePledge: &v9.ExpectedStoragePledge, + SectorKeyCID: v9.SectorKeyCID, + DailyFee: big.Zero(), } return info } diff --git a/chain/consensus/filcns/upgrades.go b/chain/consensus/filcns/upgrades.go index a93af1f4420..ac0fe1974b8 100644 --- a/chain/consensus/filcns/upgrades.go +++ b/chain/consensus/filcns/upgrades.go @@ -341,6 +341,10 @@ func DefaultUpgradeSchedule() stmgr.UpgradeSchedule { StopWithin: 10, }}, Expensive: true, + }, { + Height: buildconstants.UpgradeTockHeight, + Network: network.Version26, + Migration: nil, }, } diff --git a/chain/events/state/predicates_test.go b/chain/events/state/predicates_test.go index 4975f9983ce..1121530cdc2 100644 --- a/chain/events/state/predicates_test.go +++ b/chain/events/state/predicates_test.go @@ -512,18 +512,26 @@ func createEmptyMinerState(ctx context.Context, t *testing.T, store adt2.Store, func createSectorsAMT(ctx context.Context, t *testing.T, store adt2.Store, sectors []miner.SectorOnChainInfo) cid.Cid { root := adt2.MakeEmptyArray(store) for _, sector := range sectors { + edr := big.Zero() + esp := big.Zero() + if sector.ExpectedDayReward != nil { + edr = *sector.ExpectedDayReward + } + if sector.ExpectedStoragePledge != nil { + esp = *sector.ExpectedStoragePledge + } sector := miner2.SectorOnChainInfo{ SectorNumber: sector.SectorNumber, SealProof: sector.SealProof, SealedCID: sector.SealedCID, - DealIDs: sector.DealIDs, + DealIDs: sector.DeprecatedDealIDs, Activation: sector.Activation, Expiration: sector.Expiration, DealWeight: sector.DealWeight, VerifiedDealWeight: sector.VerifiedDealWeight, InitialPledge: sector.InitialPledge, - ExpectedDayReward: sector.ExpectedDayReward, - ExpectedStoragePledge: sector.ExpectedStoragePledge, + ExpectedDayReward: edr, + ExpectedStoragePledge: esp, ReplacedSectorAge: 0, ReplacedDayReward: big.NewInt(0), } @@ -538,19 +546,21 @@ func createSectorsAMT(ctx context.Context, t *testing.T, store adt2.Store, secto // returns a unique SectorOnChainInfo with each invocation with SectorNumber set to `sectorNo`. func newSectorOnChainInfo(sectorNo abi.SectorNumber, sealed cid.Cid, weight big.Int, activation, expiration abi.ChainEpoch) miner.SectorOnChainInfo { info := newSectorPreCommitInfo(sectorNo, sealed, expiration) + bz := big.Zero() return miner.SectorOnChainInfo{ - SectorNumber: info.SectorNumber, - SealProof: info.SealProof, - SealedCID: info.SealedCID, - DealIDs: info.DealIDs, - Expiration: info.Expiration, + SectorNumber: info.SectorNumber, + SealProof: info.SealProof, + SealedCID: info.SealedCID, + DeprecatedDealIDs: info.DealIDs, + Expiration: info.Expiration, Activation: activation, DealWeight: weight, VerifiedDealWeight: weight, InitialPledge: big.Zero(), - ExpectedDayReward: big.Zero(), - ExpectedStoragePledge: big.Zero(), + ExpectedDayReward: &bz, + ExpectedStoragePledge: &bz, + DailyFee: big.Zero(), } } diff --git a/chain/stmgr/supply.go b/chain/stmgr/supply.go index 2ef50f7082b..220acc77a2c 100644 --- a/chain/stmgr/supply.go +++ b/chain/stmgr/supply.go @@ -252,14 +252,19 @@ func (sm *StateManager) GetFilVested(ctx context.Context, height abi.ChainEpoch) return vf, nil } -func GetFilReserveDisbursed(ctx context.Context, st *state.StateTree) (abi.TokenAmount, error) { +func GetFilReserveDisbursed(ctx context.Context, st *state.StateTree, nv network.Version) (abi.TokenAmount, error) { ract, err := st.GetActor(builtin.ReserveAddress) if err != nil { return big.Zero(), xerrors.Errorf("failed to get reserve actor: %w", err) } + initial := buildconstants.InitialFilReserved + if nv >= network.Version25 { + // See FIP-0100 and https://github.com/filecoin-project/lotus/pull/12938 for why this exists + initial = buildconstants.UpgradeTeepInitialFilReserved + } // If money enters the reserve actor, this could lead to a negative term - return big.Sub(big.NewFromGo(buildconstants.InitialFilReserved), ract.Balance), nil + return big.Sub(big.NewFromGo(initial), ract.Balance), nil } func GetFilMined(ctx context.Context, st *state.StateTree) (abi.TokenAmount, error) { @@ -349,7 +354,7 @@ func (sm *StateManager) GetVMCirculatingSupplyDetailed(ctx context.Context, heig filReserveDisbursed := big.Zero() if height > buildconstants.UpgradeAssemblyHeight { - filReserveDisbursed, err = GetFilReserveDisbursed(ctx, st) + filReserveDisbursed, err = GetFilReserveDisbursed(ctx, st, nv) if err != nil { return api.CirculatingSupply{}, xerrors.Errorf("failed to calculate filReserveDisbursed: %w", err) } diff --git a/cli/spcli/sectors.go b/cli/spcli/sectors.go index 07d076ad441..1ba66a67c90 100644 --- a/cli/spcli/sectors.go +++ b/cli/spcli/sectors.go @@ -607,8 +607,8 @@ func SectorsExtendCmd(getActorAddress ActorAddressGetter) *cli.Command { Usage: "try to extend selected sectors to this epoch, ignoring extension", }, &cli.BoolFlag{ - Name: "only-cc", - Usage: "only extend CC sectors (useful for making sector ready for snap upgrade)", + Name: "only-cc", + Hidden: true, }, &cli.BoolFlag{ Name: "drop-claims", @@ -634,6 +634,10 @@ func SectorsExtendCmd(getActorAddress ActorAddressGetter) *cli.Command { }, }, Action: func(cctx *cli.Context) error { + if cctx.IsSet("only-cc") { + return xerrors.Errorf("only-cc flag has been removed, use --exclude flag instead") + } + mf, err := types.ParseFIL(cctx.String("max-fee")) if err != nil { return err @@ -768,9 +772,6 @@ func SectorsExtendCmd(getActorAddress ActorAddressGetter) *cli.Command { if !found { return xerrors.Errorf("sector %d is not active", id) } - if len(si.DealIDs) > 0 && cctx.Bool("only-cc") { - continue - } sis = append(sis, si) } diff --git a/cli/state.go b/cli/state.go index 967614be893..d55b21fe2dc 100644 --- a/cli/state.go +++ b/cli/state.go @@ -1491,6 +1491,11 @@ var StateSectorCmd = &cli.Command{ return err } + nv, err := api.StateNetworkVersion(ctx, ts.Key()) + if err != nil { + return err + } + si, err := api.StateSectorGetInfo(ctx, maddr, abi.SectorNumber(sid), ts.Key()) if err != nil { return err @@ -1505,7 +1510,6 @@ var StateSectorCmd = &cli.Command{ if si.SectorKeyCID != nil { fmt.Println("SectorKeyCID: ", si.SectorKeyCID) } - fmt.Println("DealIDs: ", si.DealIDs) fmt.Println() fmt.Println("Activation: ", cliutil.EpochTimeTs(ts.Height(), si.Activation, ts)) fmt.Println("Expiration: ", cliutil.EpochTimeTs(ts.Height(), si.Expiration, ts)) @@ -1513,8 +1517,14 @@ var StateSectorCmd = &cli.Command{ fmt.Println("DealWeight: ", si.DealWeight) fmt.Println("VerifiedDealWeight: ", si.VerifiedDealWeight) fmt.Println("InitialPledge: ", types.FIL(si.InitialPledge)) - fmt.Println("ExpectedDayReward: ", types.FIL(si.ExpectedDayReward)) - fmt.Println("ExpectedStoragePledge: ", types.FIL(si.ExpectedStoragePledge)) + if nv < network.Version25 { + if si.ExpectedDayReward != nil { + fmt.Println("ExpectedDayReward: ", types.FIL(*si.ExpectedDayReward)) + } + if si.ExpectedStoragePledge != nil { + fmt.Println("ExpectedStoragePledge: ", types.FIL(*si.ExpectedStoragePledge)) + } + } fmt.Println() sp, err := api.StateSectorPartition(ctx, maddr, abi.SectorNumber(sid), ts.Key()) diff --git a/cmd/lotus-shed/main.go b/cmd/lotus-shed/main.go index 4e1e9173a8a..1beebee723b 100644 --- a/cmd/lotus-shed/main.go +++ b/cmd/lotus-shed/main.go @@ -82,7 +82,6 @@ func main() { fr32Cmd, chainCmd, balancerCmd, - terminationsCmd, migrationsCmd, diffCmd, msigCmd, diff --git a/cmd/lotus-shed/miner.go b/cmd/lotus-shed/miner.go index 1b12bf77ca8..02ecb7289c3 100644 --- a/cmd/lotus-shed/miner.go +++ b/cmd/lotus-shed/miner.go @@ -763,7 +763,7 @@ var minerLockedVestedCmd = &cli.Command{ return err } var locked bool - for _, f := range vf.Funds { + for _, f := range vf { if f.Epoch < staleEpoch { if _, ok := miners[addr]; !ok { miners[addr] = f.Amount @@ -860,7 +860,7 @@ var minerListVestingCmd = &cli.Command{ } _, _ = fmt.Fprintln(cctx.App.Writer, string(jb)) } else { - for _, f := range vf.Funds { + for _, f := range vf { _, _ = fmt.Fprintf(cctx.App.Writer, "Epoch %d: %s\n", f.Epoch, types.FIL(f.Amount)) } } diff --git a/cmd/lotus-shed/sectors.go b/cmd/lotus-shed/sectors.go index faa21f9d94e..892058c1096 100644 --- a/cmd/lotus-shed/sectors.go +++ b/cmd/lotus-shed/sectors.go @@ -683,7 +683,7 @@ var dumpSectorOnChainInfoCmd = &cli.Command{ } _, _ = fmt.Fprintf(cctx.App.Writer, - "Miner,SectorNumber,SealProof,DealIDCount,Activation,Expiration,DealWeight,VerifiedDealWeight,"+ + "Miner,SectorNumber,SealProof,Activation,Expiration,DealWeight,VerifiedDealWeight,"+ "InitialPledge,ExpectedDayReward,ExpectedStoragePledge,PowerBaseEpoch,Flags\n") var count int @@ -706,11 +706,10 @@ var dumpSectorOnChainInfoCmd = &cli.Command{ for _, sector := range soci { _, _ = fmt.Fprintf( cctx.App.Writer, - "%s,%d,%d,%d,%d,%d,%s,%s,%s,%s,%s,%d,%x\n", + "%s,%d,%d,%d,%d,%s,%s,%s,%s,%s,%d,%x\n", maddr, sector.SectorNumber, sector.SealProof, - len(sector.DealIDs), sector.Activation, sector.Expiration, sector.DealWeight, diff --git a/cmd/lotus-shed/terminations.go b/cmd/lotus-shed/terminations.go deleted file mode 100644 index 563c1ba3a77..00000000000 --- a/cmd/lotus-shed/terminations.go +++ /dev/null @@ -1,191 +0,0 @@ -package main - -import ( - "bytes" - "context" - "fmt" - "io" - "strconv" - - "github.com/ipfs/go-cid" - cbor "github.com/ipfs/go-ipld-cbor" - "github.com/urfave/cli/v2" - - "github.com/filecoin-project/go-state-types/abi" - "github.com/filecoin-project/go-state-types/builtin" - miner2 "github.com/filecoin-project/specs-actors/actors/builtin/miner" - - "github.com/filecoin-project/lotus/chain/actors/adt" - lbuiltin "github.com/filecoin-project/lotus/chain/actors/builtin" - "github.com/filecoin-project/lotus/chain/actors/builtin/market" - "github.com/filecoin-project/lotus/chain/actors/builtin/miner" - "github.com/filecoin-project/lotus/chain/consensus/filcns" - "github.com/filecoin-project/lotus/chain/state" - "github.com/filecoin-project/lotus/chain/store" - "github.com/filecoin-project/lotus/chain/types" - lcli "github.com/filecoin-project/lotus/cli" - "github.com/filecoin-project/lotus/node/repo" -) - -var terminationsCmd = &cli.Command{ - Name: "terminations", - Description: "Lists terminated deals from the past 2 days", - ArgsUsage: "[block to look back from] [lookback period (epochs)]", - Flags: []cli.Flag{ - &cli.StringFlag{ - Name: "repo", - Value: "~/.lotus", - }, - }, - Action: func(cctx *cli.Context) error { - ctx := context.TODO() - - if cctx.NArg() != 2 { - return lcli.IncorrectNumArgs(cctx) - } - - blkCid, err := cid.Decode(cctx.Args().First()) - if err != nil { - return fmt.Errorf("failed to parse input: %w", err) - } - - fsrepo, err := repo.NewFS(cctx.String("repo")) - if err != nil { - return err - } - - lkrepo, err := fsrepo.Lock(repo.FullNode) - if err != nil { - return err - } - - defer lkrepo.Close() //nolint:errcheck - - bs, err := lkrepo.Blockstore(ctx, repo.UniversalBlockstore) - if err != nil { - return fmt.Errorf("failed to open blockstore: %w", err) - } - - defer func() { - if c, ok := bs.(io.Closer); ok { - if err := c.Close(); err != nil { - log.Warnf("failed to close blockstore: %s", err) - } - } - }() - - mds, err := lkrepo.Datastore(context.Background(), "/metadata") - if err != nil { - return err - } - - cs := store.NewChainStore(bs, bs, mds, filcns.Weight, nil) - defer cs.Close() //nolint:errcheck - - cst := cbor.NewCborStore(bs) - store := adt.WrapStore(ctx, cst) - - blk, err := cs.GetBlock(ctx, blkCid) - if err != nil { - return err - } - - lbp, err := strconv.Atoi(cctx.Args().Get(1)) - if err != nil { - return fmt.Errorf("failed to parse input: %w", err) - } - - cutoff := blk.Height - abi.ChainEpoch(lbp) - - for blk.Height > cutoff { - pts, err := cs.LoadTipSet(ctx, types.NewTipSetKey(blk.Parents...)) - if err != nil { - return err - } - - blk = pts.Blocks()[0] - - msgs, err := cs.MessagesForTipset(ctx, pts) - if err != nil { - return err - } - - for _, v := range msgs { - msg := v.VMMessage() - if msg.Method != builtin.MethodsMiner.TerminateSectors { - continue - } - - tree, err := state.LoadStateTree(cst, blk.ParentStateRoot) - if err != nil { - return err - } - - minerAct, err := tree.GetActor(msg.To) - if err != nil { - return err - } - - if !lbuiltin.IsStorageMinerActor(minerAct.Code) { - continue - } - - minerSt, err := miner.Load(store, minerAct) - if err != nil { - return err - } - - marketAct, err := tree.GetActor(market.Address) - if err != nil { - return err - } - - marketSt, err := market.Load(store, marketAct) - if err != nil { - return err - } - - proposals, err := marketSt.Proposals() - if err != nil { - return err - } - - var termParams miner2.TerminateSectorsParams - err = termParams.UnmarshalCBOR(bytes.NewBuffer(msg.Params)) - if err != nil { - return err - } - - for _, t := range termParams.Terminations { - tmp := t.Sectors - sectors, err := minerSt.LoadSectors(&tmp) - if err != nil { - return err - } - - for _, sector := range sectors { - for _, deal := range sector.DealIDs { - prop, find, err := proposals.Get(deal) - if err != nil { - return err - } - label, err := prop.Label.ToString() - if err != nil { - labelBs, err := prop.Label.ToBytes() - if err != nil { - return err - } - label = string(labelBs) - } - if find { - fmt.Printf("%s, %d, %d, %s, %s, %s\n", msg.To, sector.SectorNumber, deal, prop.Client, prop.PieceCID, label) - } - } - } - } - } - } - - return nil - }, -} diff --git a/documentation/en/api-v0-methods.md b/documentation/en/api-v0-methods.md index 1d50df65058..8fff5d24bbc 100644 --- a/documentation/en/api-v0-methods.md +++ b/documentation/en/api-v0-methods.md @@ -4483,7 +4483,8 @@ Response: "UpgradePhoenixHeight": 10101, "UpgradeWaffleHeight": 10101, "UpgradeTuktukHeight": 10101, - "UpgradeTeepHeight": 10101 + "UpgradeTeepHeight": 10101, + "UpgradeTockHeight": 10101 }, "Eip155ChainID": 123, "GenesisTimestamp": 42 @@ -4880,9 +4881,6 @@ Response: "SealedCID": { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, - "DealIDs": [ - 5432 - ], "Activation": 10101, "Expiration": 10101, "DealWeight": "0", @@ -4895,7 +4893,8 @@ Response: "SectorKeyCID": { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, - "Flags": 0 + "Flags": 0, + "DailyFee": "0" } ] ``` @@ -4952,7 +4951,8 @@ Response: 5, 1 ], - "DisputableProofCount": 42 + "DisputableProofCount": 42, + "DailyFee": "0" } ] ``` @@ -5360,9 +5360,6 @@ Response: "SealedCID": { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, - "DealIDs": [ - 5432 - ], "Activation": 10101, "Expiration": 10101, "DealWeight": "0", @@ -5375,7 +5372,8 @@ Response: "SectorKeyCID": { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, - "Flags": 0 + "Flags": 0, + "DailyFee": "0" } ] ``` @@ -5787,9 +5785,6 @@ Response: "SealedCID": { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, - "DealIDs": [ - 5432 - ], "Activation": 10101, "Expiration": 10101, "DealWeight": "0", @@ -5802,7 +5797,8 @@ Response: "SectorKeyCID": { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, - "Flags": 0 + "Flags": 0, + "DailyFee": "0" } ``` diff --git a/documentation/en/api-v1-unstable-methods.md b/documentation/en/api-v1-unstable-methods.md index 7773bc73b7a..4eae4a2a280 100644 --- a/documentation/en/api-v1-unstable-methods.md +++ b/documentation/en/api-v1-unstable-methods.md @@ -6864,7 +6864,8 @@ Response: "UpgradePhoenixHeight": 10101, "UpgradeWaffleHeight": 10101, "UpgradeTuktukHeight": 10101, - "UpgradeTeepHeight": 10101 + "UpgradeTeepHeight": 10101, + "UpgradeTockHeight": 10101 }, "Eip155ChainID": 123, "GenesisTimestamp": 42 @@ -7312,9 +7313,6 @@ Response: "SealedCID": { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, - "DealIDs": [ - 5432 - ], "Activation": 10101, "Expiration": 10101, "DealWeight": "0", @@ -7327,7 +7325,8 @@ Response: "SectorKeyCID": { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, - "Flags": 0 + "Flags": 0, + "DailyFee": "0" } ] ``` @@ -7412,7 +7411,8 @@ Response: 5, 1 ], - "DisputableProofCount": 42 + "DisputableProofCount": 42, + "DailyFee": "0" } ] ``` @@ -7861,9 +7861,6 @@ Response: "SealedCID": { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, - "DealIDs": [ - 5432 - ], "Activation": 10101, "Expiration": 10101, "DealWeight": "0", @@ -7876,7 +7873,8 @@ Response: "SectorKeyCID": { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, - "Flags": 0 + "Flags": 0, + "DailyFee": "0" } ] ``` @@ -8242,9 +8240,6 @@ Response: "SealedCID": { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, - "DealIDs": [ - 5432 - ], "Activation": 10101, "Expiration": 10101, "DealWeight": "0", @@ -8257,7 +8252,8 @@ Response: "SectorKeyCID": { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, - "Flags": 0 + "Flags": 0, + "DailyFee": "0" } ``` diff --git a/documentation/en/cli-lotus-miner.md b/documentation/en/cli-lotus-miner.md index 0df22da26f4..21c15e0abe2 100644 --- a/documentation/en/cli-lotus-miner.md +++ b/documentation/en/cli-lotus-miner.md @@ -734,7 +734,6 @@ OPTIONS: --exclude value optionally provide a file containing excluding sectors --extension value try to extend selected sectors by this number of epochs, defaults to 540 days (default: 1555200) --new-expiration value try to extend selected sectors to this epoch, ignoring extension (default: 0) - --only-cc only extend CC sectors (useful for making sector ready for snap upgrade) (default: false) --drop-claims drop claims for sectors that can be extended, but only by dropping some of their verified power claims (default: false) --tolerance value don't try to extend sectors by fewer than this number of epochs, defaults to 7 days (default: 20160) --max-fee value use up to this amount of FIL for one message. pass this flag to avoid message congestion. (default: "0") diff --git a/extern/filecoin-ffi b/extern/filecoin-ffi index 595bf25a404..037aa5ce119 160000 --- a/extern/filecoin-ffi +++ b/extern/filecoin-ffi @@ -1 +1 @@ -Subproject commit 595bf25a404441f6af7bac80a346fa96a858a0b1 +Subproject commit 037aa5ce11958eb2b47799b4cf16922874f6e2e1 diff --git a/go.mod b/go.mod index f6baa58dd3e..d99de6c1e21 100644 --- a/go.mod +++ b/go.mod @@ -51,7 +51,7 @@ require ( github.com/filecoin-project/go-jsonrpc v0.7.0 github.com/filecoin-project/go-padreader v0.0.1 github.com/filecoin-project/go-paramfetch v0.0.4 - github.com/filecoin-project/go-state-types v0.16.0-rc3.0.20250306021323-9c8991feee47 // dependency-check-ignore: unknown + github.com/filecoin-project/go-state-types v0.16.0-rc7 // dependency-check-ignore: unknown github.com/filecoin-project/go-statemachine v1.0.3 github.com/filecoin-project/go-statestore v0.2.0 github.com/filecoin-project/go-storedcounter v0.1.0 @@ -137,7 +137,7 @@ require ( github.com/triplewz/poseidon v0.0.2 github.com/urfave/cli/v2 v2.27.5 github.com/whyrusleeping/bencher v0.0.0-20190829221104-bb6607aa8bba - github.com/whyrusleeping/cbor-gen v0.3.0 + github.com/whyrusleeping/cbor-gen v0.3.1 github.com/whyrusleeping/multiaddr-filter v0.0.0-20160516205228-e903e4adabd7 github.com/xeipuuv/gojsonschema v1.2.0 github.com/xorcare/golden v0.6.1-0.20191112154924-b87f686d7542 // dependency-check-ignore: unknown diff --git a/go.sum b/go.sum index 257fd724206..53a7077625a 100644 --- a/go.sum +++ b/go.sum @@ -305,8 +305,8 @@ github.com/filecoin-project/go-state-types v0.0.0-20200928172055-2df22083d8ab/go github.com/filecoin-project/go-state-types v0.0.0-20201102161440-c8033295a1fc/go.mod h1:ezYnPf0bNkTsDibL/psSz5dy4B5awOJ/E7P2Saeep8g= github.com/filecoin-project/go-state-types v0.1.0/go.mod h1:ezYnPf0bNkTsDibL/psSz5dy4B5awOJ/E7P2Saeep8g= github.com/filecoin-project/go-state-types v0.1.6/go.mod h1:UwGVoMsULoCK+bWjEdd/xLCvLAQFBC7EDT477SKml+Q= -github.com/filecoin-project/go-state-types v0.16.0-rc3.0.20250306021323-9c8991feee47 h1:T4FROWJdLMagJDKLzZqOlJMCw/tMolhFbi8niQB2sfk= -github.com/filecoin-project/go-state-types v0.16.0-rc3.0.20250306021323-9c8991feee47/go.mod h1:1UK6Rsz0oWbzb4IPuyEVuNVRk13JSlnUmmxrzLZjBpg= +github.com/filecoin-project/go-state-types v0.16.0-rc7 h1:ODs527FEqmq/kKj4jXqRVGUx8t8+XLPjR9aP1f+YVus= +github.com/filecoin-project/go-state-types v0.16.0-rc7/go.mod h1:YCESyrqnyu17y0MazbV6Uwma5+BrMvEKEQp5QWeIf9g= github.com/filecoin-project/go-statemachine v1.0.3 h1:N07o6alys+V1tNoSTi4WuuoeNC4erS/6jE74+NsgQuk= github.com/filecoin-project/go-statemachine v1.0.3/go.mod h1:jZdXXiHa61n4NmgWFG4w8tnqgvZVHYbJ3yW7+y8bF54= github.com/filecoin-project/go-statestore v0.1.0/go.mod h1:LFc9hD+fRxPqiHiaqUEZOinUJB4WARkRfNl10O7kTnI= @@ -1317,8 +1317,8 @@ github.com/whyrusleeping/cbor-gen v0.0.0-20200810223238-211df3b9e24c/go.mod h1:f github.com/whyrusleeping/cbor-gen v0.0.0-20200812213548-958ddffe352c/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= github.com/whyrusleeping/cbor-gen v0.0.0-20210118024343-169e9d70c0c2/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= github.com/whyrusleeping/cbor-gen v0.0.0-20210303213153-67a261a1d291/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= -github.com/whyrusleeping/cbor-gen v0.3.0 h1:BR7/2RPYdqzGyHsJvC/lm+g8qTlm4SD9GHA8++CJT8o= -github.com/whyrusleeping/cbor-gen v0.3.0/go.mod h1:pM99HXyEbSQHcosHc0iW7YFmwnscr+t9Te4ibko05so= +github.com/whyrusleeping/cbor-gen v0.3.1 h1:82ioxmhEYut7LBVGhGq8xoRkXPLElVuh5mV67AFfdv0= +github.com/whyrusleeping/cbor-gen v0.3.1/go.mod h1:pM99HXyEbSQHcosHc0iW7YFmwnscr+t9Te4ibko05so= github.com/whyrusleeping/chunker v0.0.0-20181014151217-fe64bd25879f h1:jQa4QT2UP9WYv2nzyawpKMOCl+Z/jW7djv2/J50lj9E= github.com/whyrusleeping/chunker v0.0.0-20181014151217-fe64bd25879f/go.mod h1:p9UJB6dDgdPgMJZs7UjUOdulKyRr9fqkS+6JKAInPy8= github.com/whyrusleeping/go-keyspace v0.0.0-20160322163242-5b898ac5add1 h1:EKhdznlJHPMoKr0XTrX+IlJs1LH3lyx2nfr1dOlZ79k= diff --git a/itests/daily_fees_test.go b/itests/daily_fees_test.go new file mode 100644 index 00000000000..a56187d70ef --- /dev/null +++ b/itests/daily_fees_test.go @@ -0,0 +1,635 @@ +package itests + +import ( + "context" + "sync" + "testing" + "time" + + "github.com/stretchr/testify/require" + + "github.com/filecoin-project/go-address" + "github.com/filecoin-project/go-state-types/abi" + "github.com/filecoin-project/go-state-types/big" + "github.com/filecoin-project/go-state-types/builtin" + miner14 "github.com/filecoin-project/go-state-types/builtin/v14/miner" + verifreg14 "github.com/filecoin-project/go-state-types/builtin/v14/verifreg" + miner15 "github.com/filecoin-project/go-state-types/builtin/v15/miner" + miner16 "github.com/filecoin-project/go-state-types/builtin/v16/miner" + "github.com/filecoin-project/go-state-types/builtin/v8/util/adt" + "github.com/filecoin-project/go-state-types/network" + gstStore "github.com/filecoin-project/go-state-types/store" + + "github.com/filecoin-project/lotus/blockstore" + "github.com/filecoin-project/lotus/build/buildconstants" + "github.com/filecoin-project/lotus/chain/actors/builtin/miner" + "github.com/filecoin-project/lotus/chain/consensus/filcns" + "github.com/filecoin-project/lotus/chain/state" + "github.com/filecoin-project/lotus/chain/stmgr" + "github.com/filecoin-project/lotus/chain/types" + "github.com/filecoin-project/lotus/chain/wallet/key" + "github.com/filecoin-project/lotus/itests/kit" + "github.com/filecoin-project/lotus/lib/must" +) + +func TestDailyFees(t *testing.T) { + /*** Types & consts *****************************************************************************/ + + const defaultSectorSize = abi.SectorSize(2 << 10) // 2KiB + var ( + blocktime = 2 * time.Millisecond + client kit.TestFullNode + genminer kit.TestMiner + // don't upgrade until original sectors are fully proven and power updated + nv25epoch abi.ChainEpoch = builtin.EpochsInDay + 200 // Teep + nv26epoch abi.ChainEpoch = nv25epoch + builtin.EpochsInDay/2 // Tock + feePostWg sync.WaitGroup + ) + // itests start off with a FilReserved of 300M FIL, leading to a circulating supply of 0 initially, + // but we'll also simulate the calibnet bump of the InitialFilReserved to get the circulating + // supply calculation up to ~700M FIL. It has ~300M in it, we need to pretend 700M has been used, + // so 1B - 300M = 700M. + originalUpgradeTeepInitialFilReserved := buildconstants.UpgradeTeepInitialFilReserved + buildconstants.UpgradeTeepInitialFilReserved = types.MustParseFIL("1000000000 FIL").Int + t.Cleanup(func() { + buildconstants.UpgradeTeepInitialFilReserved = originalUpgradeTeepInitialFilReserved + }) + + type sectorInfo struct { + sn abi.SectorNumber + powerMul int64 + feeEpoch abi.ChainEpoch + expectedFee abi.TokenAmount + } + toSectorNumbers := func(si []*sectorInfo) []abi.SectorNumber { + var sns []abi.SectorNumber + for _, s := range si { + sns = append(sns, s.sn) + } + return sns + } + toExpectedQap := func(si []*sectorInfo) uint64 { + var power abi.StoragePower + for _, s := range si { + power = big.Add(power, abi.NewStoragePower(int64(defaultSectorSize)*s.powerMul)) + } + return power.Uint64() + } + toExpectedRbp := func(si []*sectorInfo) uint64 { + return uint64(defaultSectorSize) * uint64(len(si)) + } + + /*** Setup **************************************************************************************/ + + req := require.New(t) + + kit.QuietMiningLogs() + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + initialBigBalance := types.MustParseFIL("100fil").Int64() + sealProofType := must.One(miner.SealProofTypeFromSectorSize(defaultSectorSize, network.Version23, miner.SealProofVariant_Standard)) + rootKey := must.One(key.GenerateKey(types.KTSecp256k1)) + verifierKey := must.One(key.GenerateKey(types.KTSecp256k1)) + verifiedClientKey := must.One(key.GenerateKey(types.KTBLS)) + unverifiedClient := must.One(key.GenerateKey(types.KTBLS)) + piece := abi.PieceInfo{Size: abi.PaddedPieceSize(defaultSectorSize), PieceCID: kit.BogusPieceCid2} + + t.Log("*** Setting up network with genesis miner and clients") + + // Setup and begin mining with a single miner (A) + // Miner A will only be a genesis Miner with power allocated in the genesis block and will not + // onboard any sectors from here on + ens := kit.NewEnsemble(t, + kit.MockProofs(true), + kit.RootVerifier(rootKey, abi.NewTokenAmount(initialBigBalance)), + kit.Account(verifierKey, abi.NewTokenAmount(initialBigBalance)), + kit.Account(verifiedClientKey, abi.NewTokenAmount(initialBigBalance)), + kit.Account(unverifiedClient, abi.NewTokenAmount(initialBigBalance)), + kit.UpgradeSchedule(stmgr.Upgrade{ + Network: network.Version24, + Height: -1, + }, stmgr.Upgrade{ + Network: network.Version25, + Height: nv25epoch, + Migration: filcns.UpgradeActorsV16, + }, stmgr.Upgrade{ + Network: network.Version26, + Height: nv26epoch, + }, + )). + FullNode(&client, kit.SectorSize(defaultSectorSize)). + Miner(&genminer, &client, kit.PresealSectors(5), kit.SectorSize(defaultSectorSize), kit.WithAllSubsystems()). + Start(). + InterconnectAll() + + store := gstStore.WrapBlockStore(ctx, blockstore.NewAPIBlockstore(client)) + + blockMiners := ens.BeginMiningMustPost(blocktime) + req.Len(blockMiners, 1) + blockMiner := blockMiners[0] + + nodeOpts := []kit.NodeOpt{kit.SectorSize(defaultSectorSize), kit.OwnerAddr(client.DefaultKey)} + mminer, ens := ens.UnmanagedMiner(ctx, &client, nodeOpts...) + defer mminer.Stop() + + /*** Utility functions **************************************************************************/ + + // circulatingSupplyBefore gets the circulating supply just before the given tipset key; + // for calculating the fee we need to know the circulating supply that was given to builtin + // actors at the time it was originally calculated, so we need the CS from the tipset before + // the one where the message was executed. + circulatingSupplyBefore := func(tsk types.TipSetKey) abi.TokenAmount { + ts, err := client.ChainGetTipSet(ctx, tsk) + req.NoError(err) + cs, err := client.StateVMCirculatingSupplyInternal(ctx, ts.Parents()) + req.NoError(err) + return cs.FilCirculating + } + + // onboardSectors is a wrapper for OnboardSectors that also collects our fee expectations + onboardSectors := func(sectorBatch *kit.SectorBatch, fees bool, powerMul int64) []*sectorInfo { + sectorNumbers, tsk := mminer.OnboardSectors(sealProofType, sectorBatch) + ts, err := client.ChainGetTipSet(ctx, tsk) + req.NoError(err) + expectedFee := big.Zero() + if fees { + expectedFee = miner16.DailyProofFee(circulatingSupplyBefore(tsk), abi.NewStoragePower(int64(defaultSectorSize)*powerMul)) + } + var sis []*sectorInfo + for _, sn := range sectorNumbers { + sis = append(sis, §orInfo{sn, powerMul, ts.Height(), expectedFee}) + } + return sis + } + + // snapDeal is a wrapper for SnapDeal that also collects our fee expectations + snapDeal := func(sector *sectorInfo, manifest kit.SectorManifest, fees bool, powerMul int64) { + _, tsk := mminer.SnapDeal(sector.sn, manifest) + if fees { + sector.expectedFee = miner16.DailyProofFee(circulatingSupplyBefore(tsk), abi.NewStoragePower(int64(defaultSectorSize)*powerMul)) + } + sector.powerMul = powerMul + ts, err := client.ChainGetTipSet(ctx, tsk) + req.NoError(err) + sector.feeEpoch = ts.Height() + } + + // extendSector is a wrapper for ExtendSectorExpiration that also collects our fee expectations + extendSector := func(sector *sectorInfo, extraDuration abi.ChainEpoch, fees bool) { + soci, err := client.StateSectorGetInfo(ctx, mminer.ActorAddr, sector.sn, types.EmptyTSK) + req.NoError(err) + extensionTsk := mminer.ExtendSectorExpiration(sector.sn, soci.Expiration+extraDuration) + if fees { + sector.expectedFee = miner16.DailyProofFee(circulatingSupplyBefore(extensionTsk), abi.NewStoragePower(int64(defaultSectorSize))) + } + ts, err := client.ChainGetTipSet(ctx, extensionTsk) + req.NoError(err) + sector.feeEpoch = ts.Height() + } + + // checkMiner16Invariants checks the v16 invariants of the miner actor's state + checkMiner16Invariants := func() { + act, err := client.StateGetActor(ctx, mminer.ActorAddr, types.EmptyTSK) + req.NoError(err) + var st miner16.State + req.NoError(store.Get(ctx, act.Head, &st)) + _, msgs := miner16.CheckStateInvariants(&st, store, act.Balance) + req.Len(msgs.Messages(), 0) + } + + // checkDailyFee checks the daily fee for a sector, returning true if the sector is in the v16 + // format and false if it is in the v15 format. It also returns the daily fee. + checkDailyFee := func(sector *sectorInfo) (bool, abi.TokenAmount) { + head, err := client.ChainHead(ctx) + req.NoError(err) + + st, err := state.LoadStateTree(store, head.ParentState()) + req.NoError(err) + + act, err := st.GetActor(mminer.ActorAddr) + req.NoError(err) + + var sectorsArr *adt.Array + { + nv, err := client.StateNetworkVersion(ctx, head.Key()) + req.NoError(err) + switch nv { + case network.Version24: + var miner miner15.State + err = store.Get(ctx, act.Head, &miner) + req.NoError(err) + sectorsArr, err = adt.AsArray(store, miner.Sectors, miner15.SectorsAmtBitwidth) + req.NoError(err) + case network.Version25, network.Version26: + var miner miner16.State + err = store.Get(ctx, act.Head, &miner) + req.NoError(err) + sectorsArr, err = adt.AsArray(store, miner.Sectors, miner16.SectorsAmtBitwidth) + req.NoError(err) + default: + t.Fatalf("unexpected network version: %d", nv) + } + } + + // SectorOnChainInfo has a lazy migration for v16, it could take either a 15 field format or a + // 16 field format with a DailyFee field on the end. We want to determine whether its a 15 or a + // 16 field version by first trying to decode it as a 15 field version. + + dailyFee := big.Zero() + var v16 bool + + var soci15 miner15.SectorOnChainInfo + ok, err := sectorsArr.Get(uint64(sector.sn), &soci15) + if err == nil { + req.True(ok) + } else { + // try for v16 sector format, the unmarshaller can also handle the 15 field variety so we do + // this second + var soci16 miner16.SectorOnChainInfo + ok, err = sectorsArr.Get(uint64(sector.sn), &soci16) + req.NoError(err) + req.True(ok) + req.NotNil(soci16.DailyFee) + req.NotNil(soci16.DailyFee.Int) + dailyFee = soci16.DailyFee + v16 = true + } + + // call the public API and check that it shows what we know + s, err := client.StateSectorGetInfo(ctx, mminer.ActorAddr, sector.sn, head.Key()) + req.NoError(err) + req.NotNil(s.DailyFee) + req.NotNil(s.DailyFee.Int) + req.Equal(0, big.Cmp(dailyFee, s.DailyFee), + "daily fees not equal: expected %s, got %s", dailyFee, s.DailyFee) + + return v16, dailyFee + } + + // checkDailyFeeHasnt checks a sector against its expected fee and asserts it is in v15 format + checkDailyFeeHasnt := func(sector ...*sectorInfo) { + for _, s := range sector { + has, fee := checkDailyFee(s) + req.False(has) + req.Equal(big.Zero(), fee) + } + } + // checkDailyFeeHas checks a sector against its expected fee and asserts it is in v16 format + checkDailyFeeHas := func(sector ...*sectorInfo) { + for _, s := range sector { + has, fee := checkDailyFee(s) + req.True(has) + req.Equal(s.expectedFee, fee, "sector #%d expected fee %s, got %s", s.sn, s.expectedFee, fee) + } + } + + // expectMinerBurn asserts that the miner actor has spent the given amount of funds. + // UnmanagedMiner generously gives a large Value in its message submissions to the miner actor, so + // we need to check the miner's balance to see what it currently is, then find all messages sent + // to the miner actor and sum their values to see how much should be in there. Then the remainder + // is the amount that has been burned. + // + // This is not quite how we expect the daily fee mechanism to work in practice: UnmanagedMiner + // doesn't (currently) win any block rewards, so it has no vesting funds to pull from. So instead, + // our daily fee is extracted from the balance. If we had vesting funds, we would need to check + // that as well. + expectMinerBurn := func(expectBurn abi.TokenAmount) { + ts, err := client.ChainHead(ctx) + req.NoError(err) + + // current balance of the actor + act, err := client.StateGetActor(ctx, mminer.ActorAddr, types.EmptyTSK) + req.NoError(err) + minerBalance := act.Balance + + // hunt through the chain and look for messages sent to our miner and extract their value + totalSend := big.Zero() + parentTs := ts.Parents() + req.NoError(err) + for ts.Height() > 1 { + msgs, err := client.ChainGetMessagesInTipset(ctx, parentTs) + req.NoError(err) + for _, msg := range msgs { + if msg.Message.To == mminer.ActorAddr { + totalSend = big.Add(totalSend, msg.Message.Value) + } + } + ts, err = client.ChainGetTipSet(ctx, parentTs) + req.NoError(err) + parentTs = ts.Parents() + } + + require.Equal( + t, + expectBurn.Int64(), + big.Sub(totalSend, minerBalance).Int64(), + "expected miner to have burned %s, but it's burned %s", expectBurn, big.Sub(totalSend, minerBalance), + ) + } + + // checkFeeRecords checks that the DailyFee values in the miner's Deadlines and the FeeDeduction + // totals in the ExpirationQueues for each partition are consistent with what the public API + // reports for sector locations and their daily fees. + checkFeeRecords := func(expectTotalFees abi.TokenAmount) { + t.Log("*** Check consistency of deadline fee records and expiration queue fee deduction records") + + // deadline DailyFee values should sum up the live sectors in that deadline + sectors, err := client.StateMinerSectors(ctx, mminer.ActorAddr, nil, types.EmptyTSK) + req.NoError(err) + deadlines, err := client.StateMinerDeadlines(ctx, mminer.ActorAddr, types.EmptyTSK) + req.NoError(err) + expectedDeadlineFees := make([]abi.TokenAmount, len(deadlines)) + expectedExpirationQueueFees := make(map[miner.SectorLocation]abi.TokenAmount, len(deadlines)) + var actualTotalFees abi.TokenAmount + for _, sector := range sectors { + loc, err := client.StateSectorPartition(ctx, mminer.ActorAddr, sector.SectorNumber, types.EmptyTSK) + req.NoError(err) + expectedDeadlineFees[loc.Deadline] = big.Add(expectedDeadlineFees[loc.Deadline], sector.DailyFee) + expectedExpirationQueueFees[*loc] = big.Add(expectedExpirationQueueFees[*loc], sector.DailyFee) + actualTotalFees = big.Add(actualTotalFees, sector.DailyFee) + } + + req.Equal(0, big.Cmp(expectTotalFees, actualTotalFees), "expected total fees %s, got %s", expectTotalFees, actualTotalFees) + + // public API has DailyFee on each Deadline + for i, deadline := range deadlines { + fee := expectedDeadlineFees[i] + req.Equal(0, big.Cmp(fee, deadline.DailyFee), "expected %s, got %s for deadline %d", fee, deadline.DailyFee, i) + } + + nv, err := client.StateNetworkVersion(ctx, types.EmptyTSK) + req.NoError(err) + if nv < network.Version25 { + // nothing to see here, we're done + return + } + + // we need to go deeper for the queues + act, err := client.StateGetActor(ctx, mminer.ActorAddr, types.EmptyTSK) + req.NoError(err) + var minerState miner16.State + err = store.Get(ctx, act.Head, &minerState) + req.NoError(err) + dls, err := minerState.LoadDeadlines(store) + req.NoError(err) + var checkedExpirationQueueFees int + + err = dls.ForEach(store, func(dlIdx uint64, dl *miner16.Deadline) error { + // check the daily fee again (sanity check) + fee := expectedDeadlineFees[dlIdx] + req.Equal(0, big.Cmp(fee, dl.DailyFee), "expected %s, got %s for deadline %d", fee, dl.DailyFee, dlIdx) + + // dive into the partitions + partitions, err := dl.PartitionsArray(store) + req.NoError(err) + quant := minerState.QuantSpecForDeadline(dlIdx) + var partition miner16.Partition + err = partitions.ForEach(&partition, func(i int64) error { + expectedFee, ok := expectedExpirationQueueFees[miner.SectorLocation{Deadline: dlIdx, Partition: uint64(i)}] + if ok { + checkedExpirationQueueFees++ + } else { + // we don't have record of a sector in here, there shouldn't be a reason to go deeper but + // just in case ... + expectedFee = big.Zero() + } + var actualFee abi.TokenAmount + + // hunt through the expiration queue and find all the fees that are set to be deducted for + // this deadline+partition + queue, err := miner16.LoadExpirationQueue(store, partition.ExpirationsEpochs, quant, miner16.PartitionExpirationAmtBitwidth) + req.NoError(err) + var expSet miner16.ExpirationSet + err = queue.ForEach(&expSet, func(i int64) error { + actualFee = big.Add(actualFee, expSet.FeeDeduction) + return nil + }) + req.NoError(err) + + req.Equal(0, big.Cmp(expectedFee, actualFee), "expected %s, got %s for deadline %d partition %d expiration fee deduction", expectedFee, actualFee, dlIdx, i) + return nil + }) + req.NoError(err) + + return nil + }) + req.NoError(err) + + req.Equal(len(expectedExpirationQueueFees), checkedExpirationQueueFees, "checked %d expiration queue fees, expected %d", checkedExpirationQueueFees, len(expectedExpirationQueueFees)) + } + + // provingWindowsSince calculates how many proving windows have passed for a sector since the + // specified epoch. + provingWindowsSince := func(sn abi.SectorNumber, sinceEpoch abi.ChainEpoch) uint64 { + sectorLoc, err := client.StateSectorPartition(ctx, mminer.ActorAddr, sn, types.EmptyTSK) + req.NoError(err) + dlInfo, err := client.StateMinerProvingDeadline(ctx, mminer.ActorAddr, types.EmptyTSK) + req.NoError(err) + + windowEndOffset := dlInfo.PeriodStart + dlInfo.WPoStChallengeWindow*abi.ChainEpoch(sectorLoc.Deadline+1) + if windowEndOffset > dlInfo.CurrentEpoch { + windowEndOffset -= dlInfo.WPoStProvingPeriod // rewind a day + } + return uint64((windowEndOffset-sinceEpoch)/dlInfo.WPoStProvingPeriod + 1) + } + + /*** Test proper starts here ********************************************************************/ + + ens.Start() + + expectMinerBurn(big.Zero()) + checkFeeRecords(big.Zero()) + + _, verifiedClientAddresses := kit.SetupVerifiedClients(ctx, t, &client, rootKey, verifierKey, []*key.Key{verifiedClientKey}) + verifiedClientAddr := verifiedClientAddresses[0] + minerId := must.One(address.IDFromAddress(mminer.ActorAddr)) + + var allSectors []*sectorInfo + + t.Log("*** Onboarding sectors before the network upgrade") + + // 4 CC sectors, 2 with shorter expirations so we can mess with extensions + var shortDuration abi.ChainEpoch = miner16.MinSectorExpiration + 100 + ccSectors24 := onboardSectors( + kit.NewSectorBatch().AddEmptySectors(2).AddSector(kit.SectorManifest{Duration: shortDuration}).AddSector(kit.SectorManifest{Duration: shortDuration}), + false, + 1, + ) + allSectors = append(allSectors, ccSectors24...) + + dealSector24 := onboardSectors(kit.NewSectorBatch().AddSectorsWithRandomPieces(1), false, 1) + allSectors = append(allSectors, dealSector24...) + + clientId, allocationId := kit.SetupAllocation(ctx, t, &client, minerId, piece, verifiedClientAddr, 0, 0) + verifiedSector24 := onboardSectors( + kit.NewSectorBatch().AddSector( + kit.SectorWithVerifiedPiece(piece.PieceCID, &miner14.VerifiedAllocationKey{Client: clientId, ID: verifreg14.AllocationId(allocationId)})), + false, + 10, + ) + allSectors = append(allSectors, verifiedSector24...) + + blockMiner.WatchMinerForPost(mminer.ActorAddr) + + t.Log("*** Checking daily fees on sectors onboarded before the network upgrade, before their first PoST") + + // No fees, no fee information at all in these sectors and they are v15 format (sanity check) + checkDailyFeeHasnt(allSectors...) + expectMinerBurn(big.Zero()) + checkFeeRecords(big.Zero()) + + t.Log("*** Waiting for PoST for sectors onboarded before the network upgrade") + + mminer.WaitTillActivatedAndAssertPower(toSectorNumbers(allSectors), toExpectedRbp(allSectors), toExpectedQap(allSectors)) + + t.Log("*** Checking daily fees on sectors onboarded before the network upgrade, after their first PoST") + + // PoST shouldn't have changed anything + checkDailyFeeHasnt(allSectors...) // still all in v15 format with no fees + expectMinerBurn(big.Zero()) + checkFeeRecords(big.Zero()) + + t.Log("*** Upgrading the network to v25 (Teep)") + + client.WaitTillChain(ctx, kit.HeightAtLeast(nv25epoch+5)) + checkMiner16Invariants() + + t.Log("*** Re-checking daily fees on sectors onboarded before the network upgrade") + + // Still no fees, sectors shouldn't have been touched and still in v15 format + checkDailyFeeHasnt(allSectors...) + expectMinerBurn(big.Zero()) + checkFeeRecords(big.Zero()) + + t.Log("*** Snapping deals into sectors after the network upgrade") + + // Snap the first two CC sectors, one with an unverified piece, one with a verified piece, capture + // the CS value at each snap so we can accurately predict the expected daily fee + snapDeal(ccSectors24[0], kit.SectorManifest{Piece: piece.PieceCID}, true, 1) + clientId, allocationId = kit.SetupAllocation(ctx, t, &client, minerId, piece, verifiedClientAddr, 0, 0) + snapDeal( + ccSectors24[1], + kit.SectorManifest{Piece: piece.PieceCID, Verified: &miner14.VerifiedAllocationKey{Client: clientId, ID: verifreg14.AllocationId(allocationId)}}, + true, + 10, + ) + + t.Logf("Snapped sectors %d and %d, now have fees: %v & %v", ccSectors24[0].sn, ccSectors24[1].sn, ccSectors24[0].expectedFee, ccSectors24[1].expectedFee) + + cc24PostCount := mminer.GetPostCount(ccSectors24[0].sn) // should be 1, but just in case + feePostWg.Add(1) + go func() { + mminer.WaitTillPostCount(ccSectors24[0].sn, cc24PostCount+1) + feePostWg.Done() + }() + + checkMiner16Invariants() + + t.Log("*** Checking daily fees on old and snapped sectors") + + // No fees on untouched sectors still, but because we expect all our sectors to be stored in the + // root of the HAMT together and we've modified at least one of them, they would have all been + // rewritten in the new v16 format, so we shouldn't see v15's here anymore. + checkDailyFeeHas(allSectors...) + expectMinerBurn(big.Zero()) // fees are registered, but not yet paid + checkFeeRecords(big.Add(ccSectors24[0].expectedFee, ccSectors24[1].expectedFee)) + + t.Log("*** Extending the expiration of a CC sector after the network upgrade") + + extendSector(ccSectors24[2], 30*builtin.EpochsInDay, false) + + // Check that there's still no fees where there shouldn't be - we haven't crossed the grace period + // for extensions yet + checkDailyFeeHas(allSectors...) + + t.Log("*** Onboarding sectors after the network upgrade") + + ccSectors25 := onboardSectors(kit.NewSectorBatch().AddEmptySectors(2), true, 1) // 2 CC sectors + allSectors = append(allSectors, ccSectors25...) + feePostWg.Add(1) + go func() { + mminer.WaitTillPostCount(ccSectors25[0].sn, 1) // onboarded together, they should PoST together + feePostWg.Done() + }() + + dealSector25 := onboardSectors(kit.NewSectorBatch().AddSectorsWithRandomPieces(1), true, 1) + allSectors = append(allSectors, dealSector25...) + feePostWg.Add(1) + go func() { + mminer.WaitTillPostCount(dealSector25[0].sn, 1) + feePostWg.Done() + }() + + clientId, allocationId = kit.SetupAllocation(ctx, t, &client, minerId, piece, verifiedClientAddr, 0, 0) + verifiedSector25 := onboardSectors( + kit.NewSectorBatch().AddSector( + kit.SectorWithVerifiedPiece(piece.PieceCID, &miner14.VerifiedAllocationKey{Client: clientId, ID: verifreg14.AllocationId(allocationId)})), + true, + 10, + ) + allSectors = append(allSectors, verifiedSector25...) + feePostWg.Add(1) + go func() { + mminer.WaitTillPostCount(verifiedSector25[0].sn, 1) + feePostWg.Done() + }() + + // Before PoST + checkDailyFeeHas(allSectors...) + checkMiner16Invariants() + + t.Log("*** Waiting for PoST for sectors onboarded after the network upgrade") + + mminer.WaitTillActivatedAndAssertPower(toSectorNumbers(allSectors), toExpectedRbp(allSectors), toExpectedQap(allSectors)) + + // After PoST + checkDailyFeeHas(allSectors...) + checkMiner16Invariants() + + t.Log("*** Upgrading the network to v26 (Tock)") + + // Move past the upgrade + client.WaitTillChain(ctx, kit.HeightAtLeast(nv26epoch+5)) + + t.Log("*** Extending the expiration of CC sectors after the Tock (v26) upgrade so they attract fees") + + // Extend the one that's already been extended + extendSector(ccSectors24[2], 30*builtin.EpochsInDay, true) + // Extend the one that hasn't been extended + extendSector(ccSectors24[3], 30*builtin.EpochsInDay, true) + + // Check them again + checkDailyFeeHas(allSectors...) + + // We haven't paid any fees yet, so wait for after the next proving deadline for these sectors + posts := mminer.GetPostCount(ccSectors24[2].sn) + feePostWg.Add(1) + go func() { + mminer.WaitTillPostCount(ccSectors24[2].sn, posts+1) + feePostWg.Done() + }() + + // Wait for all fees to be paid—we need each one to have reached its first deadline and they are + // likely spread out over multiple deadlines + feePostWg.Wait() + head, err := client.ChainHead(ctx) + req.NoError(err) + // Wait one exta deadline to make sure we get to the end of the current deadline where we've done + // a PoST + client.WaitTillChain(ctx, kit.HeightAtLeast(head.Height()+miner.WPoStChallengeWindow()+10)) + + var expectTotalBurn abi.TokenAmount + for _, sector := range allSectors { + paymentsPast := provingWindowsSince(sector.sn, nv25epoch) + expectTotalBurn = big.Add(expectTotalBurn, big.Mul(big.NewInt(int64(paymentsPast)), sector.expectedFee)) + } + + // We've passed our first deadline where fees were payable, both for the snapped nv24 sectors + // and the nv25 sectors + expectMinerBurn(expectTotalBurn) + // With only one fee payment so far for all sectors, the total in the records should be the same + // as the burn + checkFeeRecords(expectTotalBurn) + checkMiner16Invariants() +} diff --git a/itests/direct_data_onboard_test.go b/itests/direct_data_onboard_test.go index 071b441cc0e..bf83e0f1bdf 100644 --- a/itests/direct_data_onboard_test.go +++ b/itests/direct_data_onboard_test.go @@ -21,6 +21,7 @@ import ( "github.com/filecoin-project/go-commp-utils/v2" "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/go-state-types/big" + miner16 "github.com/filecoin-project/go-state-types/builtin/v16/miner" market2 "github.com/filecoin-project/go-state-types/builtin/v9/market" "github.com/filecoin-project/go-state-types/exitcode" "github.com/filecoin-project/go-state-types/network" @@ -252,9 +253,16 @@ func TestOnboardMixedMarketDDO(t *testing.T) { ds, err := client.StateMarketStorageDeal(ctx, dealID, types.EmptyTSK) require.NoError(t, err) - require.NotEqual(t, -1, ds.State.SectorStartEpoch) + // verify that the daily fee was set up correctly + soci, err := client.StateSectorGetInfo(ctx, miner.ActorAddr, si.SectorID, types.EmptyTSK) + require.NoError(t, err) + cs, err := client.StateVMCirculatingSupplyInternal(ctx, types.EmptyTSK) + require.NoError(t, err) + expectedDailyFee := miner16.DailyProofFee(cs.FilCirculating, abi.NewStoragePower(2048)) + require.Equal(t, expectedDailyFee, soci.DailyFee) + { deals, err := client.StateMarketDeals(ctx, types.EmptyTSK) require.NoError(t, err) diff --git a/itests/direct_data_onboard_verified_test.go b/itests/direct_data_onboard_verified_test.go index 53e3b3bade0..48bd0f05296 100644 --- a/itests/direct_data_onboard_verified_test.go +++ b/itests/direct_data_onboard_verified_test.go @@ -25,12 +25,11 @@ import ( "github.com/filecoin-project/go-state-types/big" "github.com/filecoin-project/go-state-types/builtin" verifregtypes13 "github.com/filecoin-project/go-state-types/builtin/v13/verifreg" - datacap2 "github.com/filecoin-project/go-state-types/builtin/v9/datacap" + miner16 "github.com/filecoin-project/go-state-types/builtin/v16/miner" lapi "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/api/v1api" "github.com/filecoin-project/lotus/chain/actors" - "github.com/filecoin-project/lotus/chain/actors/builtin/datacap" minertypes "github.com/filecoin-project/lotus/chain/actors/builtin/miner" "github.com/filecoin-project/lotus/chain/actors/builtin/verifreg" "github.com/filecoin-project/lotus/chain/types" @@ -51,22 +50,15 @@ func TestOnboardRawPieceVerified_WithActorEvents(t *testing.T) { ctx = context.Background() ) - rootKey, err := key.GenerateKey(types.KTSecp256k1) - require.NoError(t, err) - - verifierKey, err := key.GenerateKey(types.KTSecp256k1) - require.NoError(t, err) - - verifiedClientKey, err := key.GenerateKey(types.KTBLS) - require.NoError(t, err) - - bal, err := types.ParseFIL("100fil") - require.NoError(t, err) + initialBigBalance := types.MustParseFIL("100fil").Int64() + rootKey := must.One(key.GenerateKey(types.KTSecp256k1)) + verifierKey := must.One(key.GenerateKey(types.KTSecp256k1)) + verifiedClientKey := must.One(key.GenerateKey(types.KTBLS)) client, miner, ens := kit.EnsembleMinimal(t, kit.ThroughRPC(), - kit.RootVerifier(rootKey, abi.NewTokenAmount(bal.Int64())), - kit.Account(verifierKey, abi.NewTokenAmount(bal.Int64())), - kit.Account(verifiedClientKey, abi.NewTokenAmount(bal.Int64())), + kit.RootVerifier(rootKey, abi.NewTokenAmount(initialBigBalance)), + kit.Account(verifierKey, abi.NewTokenAmount(initialBigBalance)), + kit.Account(verifiedClientKey, abi.NewTokenAmount(initialBigBalance)), ) /* --- Setup subscription channels for ActorEvents --- */ @@ -109,8 +101,8 @@ func TestOnboardRawPieceVerified_WithActorEvents(t *testing.T) { /* --- Setup verified registry and client and allocate datacap to client */ - verifierAddr, verifiedClientAddrses := ddoVerifiedSetupVerifiedClient(ctx, t, client, rootKey, verifierKey, []*key.Key{verifiedClientKey}) - verifiedClientAddr := verifiedClientAddrses[0] + verifierAddr, verifiedClientAddresses := kit.SetupVerifiedClients(ctx, t, client, rootKey, verifierKey, []*key.Key{verifiedClientKey}) + verifiedClientAddr := verifiedClientAddresses[0] /* --- Prepare piece for onboarding --- */ @@ -124,8 +116,15 @@ func TestOnboardRawPieceVerified_WithActorEvents(t *testing.T) { /* --- Allocate datacap for the piece by the verified client --- */ head, err := client.ChainHead(ctx) require.NoError(t, err) + // but first, a detour to an expiring claim so we can observe the events bogusAllocationExpiry := head.Height() + 100 - clientId, allocationId := ddoVerifiedSetupAllocations(ctx, t, client, minerId, dc, verifiedClientAddr, bogusAllocationExpiry, 0) + bogusPiece := abi.PieceInfo{ + Size: dc.Size, + PieceCID: bogusPieceCid, + } + _, _ = kit.SetupAllocation(ctx, t, client, minerId, bogusPiece, verifiedClientAddr, bogusAllocationExpiry, 0) + // actual claim + clientId, allocationId := kit.SetupAllocation(ctx, t, client, minerId, dc, verifiedClientAddr, 0, 0) head, err = client.ChainHead(ctx) require.NoError(t, err) @@ -141,6 +140,19 @@ func TestOnboardRawPieceVerified_WithActorEvents(t *testing.T) { so, si := ddoVerifiedOnboardPiece(ctx, t, miner, clientId, allocationId, dc, pieceData) + /* --- Verify that the daily fee was set up correctly --- */ + + soci, err := client.StateSectorGetInfo(ctx, miner.ActorAddr, si.SectorID, types.EmptyTSK) + require.NoError(t, err) + // get CS @ the activation epoch + activationTs, err := client.ChainGetTipSetByHeight(ctx, soci.Activation, types.EmptyTSK) + require.NoError(t, err) + cs, err := client.StateVMCirculatingSupplyInternal(ctx, activationTs.Key()) + require.NoError(t, err) + qap := abi.NewStoragePower(int64(pieceSize.Padded()) * 10) // 10x power + expectedDailyFee := miner16.DailyProofFee(cs.FilCirculating, qap) + require.Equal(t, expectedDailyFee, soci.DailyFee) + // check that we have one allocation because the real allocation has been claimed by the miner for the piece allocations, err := client.StateGetAllocations(ctx, verifiedClientAddr, types.EmptyTSK) require.NoError(t, err) @@ -416,100 +428,6 @@ func TestOnboardRawPieceVerified_WithActorEvents(t *testing.T) { // speed than the ActorEventHandler is aware of. } -func ddoVerifiedSetupAllocations( - ctx context.Context, - t *testing.T, - node v1api.FullNode, - minerId uint64, - dc abi.PieceInfo, - verifiedClientAddr address.Address, - bogusAllocExpiration abi.ChainEpoch, // zero if we don't want to make one - tmax abi.ChainEpoch, -) (clientID abi.ActorID, allocationID verifregtypes13.AllocationId) { - if tmax == 0 { - tmax = verifreg.MaximumVerifiedAllocationTerm - } - - var requests []verifreg.AllocationRequest - - if bogusAllocExpiration != 0 { - // design this one to expire so we can observe allocation-removed - allocationRequestBogus := verifreg.AllocationRequest{ - Provider: abi.ActorID(minerId), - Data: bogusPieceCid, - Size: dc.Size, - TermMin: verifreg.MinimumVerifiedAllocationTerm, - TermMax: tmax, - Expiration: bogusAllocExpiration, - } - requests = append(requests, allocationRequestBogus) - } - - allocationRequest := verifreg.AllocationRequest{ - Provider: abi.ActorID(minerId), - Data: dc.PieceCID, - Size: dc.Size, - TermMin: verifreg.MinimumVerifiedAllocationTerm, - TermMax: tmax, - Expiration: verifreg.MaximumVerifiedAllocationExpiration, - } - requests = append(requests, allocationRequest) - - allocationRequests := verifreg.AllocationRequests{ - Allocations: requests, - } - - receiverParams, aerr := actors.SerializeParams(&allocationRequests) - require.NoError(t, aerr) - - var amt abi.TokenAmount - amt = big.Mul(big.NewInt(int64(dc.Size)), builtin.TokenPrecision) - if bogusAllocExpiration != 0 { - amt = big.Mul(big.NewInt(int64(dc.Size*2)), builtin.TokenPrecision) - } - - transferParams, aerr := actors.SerializeParams(&datacap2.TransferParams{ - To: builtin.VerifiedRegistryActorAddr, - Amount: amt, - OperatorData: receiverParams, - }) - require.NoError(t, aerr) - - msg := &types.Message{ - To: builtin.DatacapActorAddr, - From: verifiedClientAddr, - Method: datacap.Methods.TransferExported, - Params: transferParams, - Value: big.Zero(), - } - - sm, err := node.MpoolPushMessage(ctx, msg, nil) - require.NoError(t, err) - - res, err := node.StateWaitMsg(ctx, sm.Cid(), 1, lapi.LookbackNoLimit, true) - require.NoError(t, err) - require.EqualValues(t, 0, res.Receipt.ExitCode) - - // check that we have an allocation - allocations, err := node.StateGetAllocations(ctx, verifiedClientAddr, types.EmptyTSK) - require.NoError(t, err) - if bogusAllocExpiration != 0 { - require.Len(t, allocations, 2) // allocation waiting to be claimed - } else { - require.Len(t, allocations, 1) // allocation waiting to be claimed - } - - for key, value := range allocations { - if value.Data == dc.PieceCID { - allocationID = verifregtypes13.AllocationId(key) - clientID = value.Client - break - } - } - require.NotEqual(t, verifreg.AllocationId(0), allocationID) // found it in there - return clientID, allocationID -} - func ddoVerifiedOnboardPiece(ctx context.Context, t *testing.T, miner *kit.TestMiner, clientId abi.ActorID, allocationId verifregtypes13.AllocationId, dc abi.PieceInfo, pieceData []byte) (lapi.SectorOffset, lapi.SectorInfo) { head, err := miner.FullNode.ChainHead(ctx) require.NoError(t, err) @@ -648,71 +566,6 @@ func ddoVerifiedBuildActorEventsFromMessages(ctx context.Context, t *testing.T, return actorEvents } -func ddoVerifiedSetupVerifiedClient(ctx context.Context, t *testing.T, client *kit.TestFullNode, rootKey *key.Key, verifierKey *key.Key, verifiedClientKeys []*key.Key) (verifierAddr address.Address, ret []address.Address) { - // import the root key. - rootAddr, err := client.WalletImport(ctx, &rootKey.KeyInfo) - require.NoError(t, err) - - // import the verifiers' keys. - verifierAddr, err = client.WalletImport(ctx, &verifierKey.KeyInfo) - require.NoError(t, err) - - // import the verified client's key. - for _, k := range verifiedClientKeys { - verifiedClientAddr, err := client.WalletImport(ctx, &k.KeyInfo) - require.NoError(t, err) - ret = append(ret, verifiedClientAddr) - } - - allowance := big.NewInt(100000000000) - params, aerr := actors.SerializeParams(&verifreg.AddVerifierParams{Address: verifierAddr, Allowance: allowance}) - require.NoError(t, aerr) - - msg := &types.Message{ - From: rootAddr, - To: verifreg.Address, - Method: verifreg.Methods.AddVerifier, - Params: params, - Value: big.Zero(), - } - - sm, err := client.MpoolPushMessage(ctx, msg, nil) - require.NoError(t, err, "AddVerifier failed") - - res, err := client.StateWaitMsg(ctx, sm.Cid(), 1, lapi.LookbackNoLimit, true) - require.NoError(t, err) - require.EqualValues(t, 0, res.Receipt.ExitCode) - - verifierAllowance, err := client.StateVerifierStatus(ctx, verifierAddr, types.EmptyTSK) - require.NoError(t, err) - require.Equal(t, allowance, *verifierAllowance) - - // assign datacap to clients - for _, ad := range ret { - initialDatacap := big.NewInt(10000) - - params, aerr = actors.SerializeParams(&verifreg.AddVerifiedClientParams{Address: ad, Allowance: initialDatacap}) - require.NoError(t, aerr) - - msg = &types.Message{ - From: verifierAddr, - To: verifreg.Address, - Method: verifreg.Methods.AddVerifiedClient, - Params: params, - Value: big.Zero(), - } - - sm, err = client.MpoolPushMessage(ctx, msg, nil) - require.NoError(t, err) - - res, err = client.StateWaitMsg(ctx, sm.Cid(), 1, lapi.LookbackNoLimit, true) - require.NoError(t, err) - require.EqualValues(t, 0, res.Receipt.ExitCode) - } - - return -} - func filterEvents(events []*types.ActorEvent, key string) []*types.ActorEvent { keyBytes := must.One(ipld.Encode(basicnode.NewString(key), dagcbor.Encode)) filtered := make([]*types.ActorEvent, 0) @@ -770,30 +623,19 @@ func TestVerifiedDDOExtendClaim(t *testing.T) { ctx = context.Background() ) - rootKey, err := key.GenerateKey(types.KTSecp256k1) - require.NoError(t, err) - - verifierKey, err := key.GenerateKey(types.KTSecp256k1) - require.NoError(t, err) - - verifiedClientKey1, err := key.GenerateKey(types.KTBLS) - require.NoError(t, err) - - verifiedClientKey2, err := key.GenerateKey(types.KTBLS) - require.NoError(t, err) - - unverifiedClient, err := key.GenerateKey(types.KTBLS) - require.NoError(t, err) - - bal, err := types.ParseFIL("100fil") - require.NoError(t, err) + initialBigBalance := types.MustParseFIL("100fil").Int64() + rootKey := must.One(key.GenerateKey(types.KTSecp256k1)) + verifierKey := must.One(key.GenerateKey(types.KTSecp256k1)) + verifiedClientKey1 := must.One(key.GenerateKey(types.KTBLS)) + verifiedClientKey2 := must.One(key.GenerateKey(types.KTBLS)) + unverifiedClient := must.One(key.GenerateKey(types.KTBLS)) client, miner, ens := kit.EnsembleMinimal(t, kit.ThroughRPC(), - kit.RootVerifier(rootKey, abi.NewTokenAmount(bal.Int64())), - kit.Account(verifierKey, abi.NewTokenAmount(bal.Int64())), - kit.Account(verifiedClientKey1, abi.NewTokenAmount(bal.Int64())), - kit.Account(verifiedClientKey2, abi.NewTokenAmount(bal.Int64())), - kit.Account(unverifiedClient, abi.NewTokenAmount(bal.Int64())), + kit.RootVerifier(rootKey, abi.NewTokenAmount(initialBigBalance)), + kit.Account(verifierKey, abi.NewTokenAmount(initialBigBalance)), + kit.Account(verifiedClientKey1, abi.NewTokenAmount(initialBigBalance)), + kit.Account(verifiedClientKey2, abi.NewTokenAmount(initialBigBalance)), + kit.Account(unverifiedClient, abi.NewTokenAmount(initialBigBalance)), ) /* --- Start mining --- */ @@ -805,9 +647,9 @@ func TestVerifiedDDOExtendClaim(t *testing.T) { /* --- Setup verified registry and clients and allocate datacap to client */ - _, verifiedClientAddrses := ddoVerifiedSetupVerifiedClient(ctx, t, client, rootKey, verifierKey, []*key.Key{verifiedClientKey1, verifiedClientKey2}) - verifiedClientAddr1 := verifiedClientAddrses[0] - verifiedClientAddr2 := verifiedClientAddrses[1] + _, verifiedClientAddresses := kit.SetupVerifiedClients(ctx, t, client, rootKey, verifierKey, []*key.Key{verifiedClientKey1, verifiedClientKey2}) + verifiedClientAddr1 := verifiedClientAddresses[0] + verifiedClientAddr2 := verifiedClientAddresses[1] /* --- Prepare piece for onboarding --- */ @@ -819,7 +661,7 @@ func TestVerifiedDDOExtendClaim(t *testing.T) { require.NoError(t, err) /* --- Allocate datacap for the piece by the verified client --- */ - clientId, allocationId := ddoVerifiedSetupAllocations(ctx, t, client, minerId, dc, verifiedClientAddr1, 0, builtin.EpochsInYear*3) + clientId, allocationId := kit.SetupAllocation(ctx, t, client, minerId, dc, verifiedClientAddr1, 0, builtin.EpochsInYear*3) /* --- Onboard the piece --- */ diff --git a/itests/fevm_test.go b/itests/fevm_test.go index 6b31c9eb69e..64b08a10c2c 100644 --- a/itests/fevm_test.go +++ b/itests/fevm_test.go @@ -427,7 +427,7 @@ func TestFEVMTestSendToContract(t *testing.T) { _, _, err = client.EVM().InvokeContractByFuncName(ctx, fromAddr, contractAddr, "destroy()", []byte{}) require.NoError(t, err) - finalBalanceMinimum := types.FromFil(uint64(99_999_999)) // 100 million FIL - 1 FIL for gas upper bounds + finalBalanceMinimum := types.FromFil(uint64(9_999_999)) // 10 million FIL - 1 FIL for gas upper bounds finalBal, err := client.WalletBalance(ctx, client.DefaultKey.Address) require.NoError(t, err) require.Equal(t, true, finalBal.GreaterThan(finalBalanceMinimum)) diff --git a/itests/kit/ensemble.go b/itests/kit/ensemble.go index b42f9b38f5e..ac1e2658c7d 100644 --- a/itests/kit/ensemble.go +++ b/itests/kit/ensemble.go @@ -54,6 +54,7 @@ import ( "github.com/filecoin-project/lotus/cmd/lotus-worker/sealworker" "github.com/filecoin-project/lotus/gateway" "github.com/filecoin-project/lotus/genesis" + "github.com/filecoin-project/lotus/lib/must" lotusminer "github.com/filecoin-project/lotus/miner" "github.com/filecoin-project/lotus/node" "github.com/filecoin-project/lotus/node/config" @@ -158,6 +159,7 @@ func NewEnsemble(t *testing.T, opts ...EnsembleOpt) *Ensemble { } } + usedBalance := big.Zero() // add accounts from ensemble options to genesis. for _, acc := range options.accounts { n.genesis.accounts = append(n.genesis.accounts, genesis.Actor{ @@ -165,7 +167,15 @@ func NewEnsemble(t *testing.T, opts ...EnsembleOpt) *Ensemble { Balance: acc.initialBalance, Meta: (&genesis.AccountMeta{Owner: acc.key.Address}).ActorMeta(), }) + usedBalance = big.Add(usedBalance, acc.initialBalance) } + // Soak up some balance from FilBase so that we leave FilReserved at 300M to match mainnet. + // See https://github.com/filecoin-project/lotus/pull/12932 for context on this. + n.genesis.accounts = append(n.genesis.accounts, genesis.Actor{ + Type: genesis.TAccount, + Balance: big.Sub(big.Int(types.MustParseFIL("400000000 FIL")), usedBalance), + Meta: (&genesis.AccountMeta{Owner: must.One(key.GenerateKey(types.KTSecp256k1)).Address}).ActorMeta(), + }) // Ensure we're using the right actors. This really shouldn't be some global thing, but it's // the best we can do for now. @@ -176,6 +186,7 @@ func NewEnsemble(t *testing.T, opts ...EnsembleOpt) *Ensemble { } buildconstants.EquivocationDelaySecs = 0 + buildconstants.UpgradeAssemblyHeight = -1 // so GetVMCirculatingSupplyDetailed() properly calculates FilReserved return n } diff --git a/itests/kit/evm.go b/itests/kit/evm.go index 14f37ecf3a8..72bcb27b786 100644 --- a/itests/kit/evm.go +++ b/itests/kit/evm.go @@ -425,12 +425,12 @@ func SetupFEVMTest(t *testing.T, opts ...interface{}) (context.Context, context. ens.InterconnectAll().BeginMining(blockTime) ctx, cancel := context.WithTimeout(context.Background(), time.Minute) - // require that the initial balance is 100 million FIL in setup + // require that the initial balance is 10 million FIL in setup // this way other tests can count on this initial wallet balance fromAddr := client.DefaultKey.Address bal, err := client.WalletBalance(ctx, fromAddr) require.NoError(t, err) - originalBalance := types.FromFil(uint64(100_000_000)) // 100 million FIL + originalBalance := types.FromFil(uint64(10_000_000)) // 10 million FIL require.Equal(t, originalBalance, bal) return ctx, cancel, client diff --git a/itests/kit/funds.go b/itests/kit/funds.go index 1918d9125ff..9a92348016f 100644 --- a/itests/kit/funds.go +++ b/itests/kit/funds.go @@ -9,9 +9,17 @@ import ( "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-state-types/abi" + "github.com/filecoin-project/go-state-types/big" + "github.com/filecoin-project/go-state-types/builtin" + verifregtypes13 "github.com/filecoin-project/go-state-types/builtin/v13/verifreg" + datacap2 "github.com/filecoin-project/go-state-types/builtin/v9/datacap" "github.com/filecoin-project/lotus/api" + "github.com/filecoin-project/lotus/chain/actors" + "github.com/filecoin-project/lotus/chain/actors/builtin/datacap" + "github.com/filecoin-project/lotus/chain/actors/builtin/verifreg" "github.com/filecoin-project/lotus/chain/types" + "github.com/filecoin-project/lotus/chain/wallet/key" ) // SendFunds sends funds from the default wallet of the specified sender node @@ -38,3 +46,146 @@ func (f *TestFullNode) WaitMsg(ctx context.Context, msg cid.Cid) { require.EqualValues(f.t, 0, res.Receipt.ExitCode, "message did not successfully execute") } + +// SetupVerifiedClients assumes that rootKey has been set in the ensemble's genesis and that +// verifierKey and verifiedClientKeys exist as accounts. It first sets up the verifier with datacap +// to allocate, and then allocates datacap to each of the verified clients. +// It returns the address of the verifier and the addresses of the verified clients. +func SetupVerifiedClients(ctx context.Context, t *testing.T, client *TestFullNode, rootKey *key.Key, verifierKey *key.Key, verifiedClientKeys []*key.Key) (verifierAddr address.Address, ret []address.Address) { + // import the root key. + rootAddr, err := client.WalletImport(ctx, &rootKey.KeyInfo) + require.NoError(t, err) + + // import the verifiers' keys. + verifierAddr, err = client.WalletImport(ctx, &verifierKey.KeyInfo) + require.NoError(t, err) + + // import the verified client's key. + for _, k := range verifiedClientKeys { + verifiedClientAddr, err := client.WalletImport(ctx, &k.KeyInfo) + require.NoError(t, err) + ret = append(ret, verifiedClientAddr) + } + + allowance := big.NewInt(100000000000) + params, aerr := actors.SerializeParams(&verifreg.AddVerifierParams{Address: verifierAddr, Allowance: allowance}) + require.NoError(t, aerr) + + msg := &types.Message{ + From: rootAddr, + To: verifreg.Address, + Method: verifreg.Methods.AddVerifier, + Params: params, + Value: big.Zero(), + } + + sm, err := client.MpoolPushMessage(ctx, msg, nil) + require.NoError(t, err, "AddVerifier failed") + + res, err := client.StateWaitMsg(ctx, sm.Cid(), 1, api.LookbackNoLimit, true) + require.NoError(t, err) + require.EqualValues(t, 0, res.Receipt.ExitCode) + + verifierAllowance, err := client.StateVerifierStatus(ctx, verifierAddr, types.EmptyTSK) + require.NoError(t, err) + require.Equal(t, allowance, *verifierAllowance) + + // assign datacap to clients + for _, ad := range ret { + initialDatacap := big.NewInt(10000) + + params, aerr = actors.SerializeParams(&verifreg.AddVerifiedClientParams{Address: ad, Allowance: initialDatacap}) + require.NoError(t, aerr) + + msg = &types.Message{ + From: verifierAddr, + To: verifreg.Address, + Method: verifreg.Methods.AddVerifiedClient, + Params: params, + Value: big.Zero(), + } + + sm, err = client.MpoolPushMessage(ctx, msg, nil) + require.NoError(t, err) + + res, err = client.StateWaitMsg(ctx, sm.Cid(), 1, api.LookbackNoLimit, true) + require.NoError(t, err) + require.EqualValues(t, 0, res.Receipt.ExitCode) + } + + return +} + +func SetupAllocation( + ctx context.Context, + t *testing.T, + node api.FullNode, + minerId uint64, + dc abi.PieceInfo, + verifiedClientAddr address.Address, + expiration abi.ChainEpoch, // set to zero if we want to use maximum + termMax abi.ChainEpoch, // set to zero if we want to use maximum +) (clientID abi.ActorID, allocationID verifregtypes13.AllocationId) { + if termMax == 0 { + termMax = verifreg.MaximumVerifiedAllocationTerm + } + if expiration == 0 { + expiration = verifreg.MaximumVerifiedAllocationExpiration + } + + var requests []verifreg.AllocationRequest + + allocationRequest := verifreg.AllocationRequest{ + Provider: abi.ActorID(minerId), + Data: dc.PieceCID, + Size: dc.Size, + TermMin: verifreg.MinimumVerifiedAllocationTerm, + TermMax: termMax, + Expiration: expiration, + } + requests = append(requests, allocationRequest) + + allocationRequests := verifreg.AllocationRequests{ + Allocations: requests, + } + + receiverParams, aerr := actors.SerializeParams(&allocationRequests) + require.NoError(t, aerr) + + transferParams, aerr := actors.SerializeParams(&datacap2.TransferParams{ + To: builtin.VerifiedRegistryActorAddr, + Amount: big.Mul(big.NewInt(int64(dc.Size)), builtin.TokenPrecision), + OperatorData: receiverParams, + }) + require.NoError(t, aerr) + + msg := &types.Message{ + To: builtin.DatacapActorAddr, + From: verifiedClientAddr, + Method: datacap.Methods.TransferExported, + Params: transferParams, + Value: big.Zero(), + } + + sm, err := node.MpoolPushMessage(ctx, msg, nil) + require.NoError(t, err) + + res, err := node.StateWaitMsg(ctx, sm.Cid(), 1, api.LookbackNoLimit, true) + require.NoError(t, err) + require.EqualValues(t, 0, res.Receipt.ExitCode) + + // check that we have an allocation + allocations, err := node.StateGetAllocations(ctx, verifiedClientAddr, types.EmptyTSK) + require.NoError(t, err) + + for key, value := range allocations { + vkey := verifregtypes13.AllocationId(key) + if dc.PieceCID.Equals(value.Data) && vkey >= allocationID { + allocationID = verifregtypes13.AllocationId(key) + clientID = value.Client + } + } + + require.NotEqual(t, verifreg.AllocationId(0), allocationID) // found it in there + return clientID, allocationID +} diff --git a/itests/kit/node_opts.go b/itests/kit/node_opts.go index 0356871c578..9c9a2006587 100644 --- a/itests/kit/node_opts.go +++ b/itests/kit/node_opts.go @@ -81,7 +81,7 @@ var _ connmgr.ConnectionGater = (*loopbackConnGater)(nil) // DefaultNodeOpts are the default options that will be applied to test nodes. var DefaultNodeOpts = nodeOpts{ - balance: big.Mul(big.NewInt(100000000), types.NewInt(buildconstants.FilecoinPrecision)), + balance: big.Mul(big.NewInt(10_000_000), types.NewInt(buildconstants.FilecoinPrecision)), sectors: DefaultPresealsPerBootstrapMiner, sectorSize: abi.SectorSize(2 << 10), // 2KiB. diff --git a/itests/kit/node_unmanaged.go b/itests/kit/node_unmanaged.go index 1771bea3ff2..61e35a5f01f 100644 --- a/itests/kit/node_unmanaged.go +++ b/itests/kit/node_unmanaged.go @@ -21,6 +21,7 @@ import ( ffi "github.com/filecoin-project/filecoin-ffi" "github.com/filecoin-project/go-address" + "github.com/filecoin-project/go-bitfield" "github.com/filecoin-project/go-commp-utils/v2" "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/go-state-types/batch" @@ -38,8 +39,11 @@ import ( "github.com/filecoin-project/lotus/chain/wallet/key" ) -// TODO: this shouldn't be fixed, we should make a new one for each sector/piece -var fixedPieceCid = cid.MustParse("baga6ea4seaqjtovkwk4myyzj56eztkh5pzsk5upksan6f5outesy62bsvl4dsha") +// TODO: make a randomiser for this +var ( + BogusPieceCid1 = cid.MustParse("baga6ea4seaqjtovkwk4myyzj56eztkh5pzsk5upksan6f5outesy62bsvl4dsha") + BogusPieceCid2 = cid.MustParse("baga6ea4seaqlhznlutptgfwhffupyer6txswamerq5fc2jlwf2lys2mm5jtiaeq") +) // 32 bytes of 1's: this value essentially ignored in NI-PoRep proofs, but all zeros is not recommended. // Regardless of what we submit to the chain, actors will replace it with 32 1's anyway but we are @@ -88,9 +92,21 @@ type sectorInfo struct { sealedCid cid.Cid unsealedCid cid.Cid sectorProof []byte - pieces []abi.PieceInfo + pieces []miner14.PieceActivationManifest sealTickets abi.SealRandomness sealRandomnessEpoch abi.ChainEpoch + duration abi.ChainEpoch +} + +func (si sectorInfo) piecesToPieceInfos() []abi.PieceInfo { + pcPieces := make([]abi.PieceInfo, len(si.pieces)) + for i, piece := range si.pieces { + pcPieces[i] = abi.PieceInfo{ + Size: piece.Size, + PieceCID: piece.CID, + } + } + return pcPieces } type windowPost struct { @@ -188,6 +204,67 @@ func WithExpectedExitCodes(exitCodes []exitcode.ExitCode) OnboardOpt { } } +// SectorManifest is (currently) a simplified SectorAllocationManifest, allowing zero or one pieces +// to be built into a sector, where that one piece may be verified. Undefined Piece and nil Verified +// onboards a CC sector. Duration changes the default sector expiration of 300 days past the minimum. +type SectorManifest struct { + Piece cid.Cid + Verified *miner14.VerifiedAllocationKey + Duration abi.ChainEpoch +} + +// SectorBatch is a builder for creating sector manifests +type SectorBatch struct { + manifests []SectorManifest +} + +// NewSectorBatch creates an empty sector batch +func NewSectorBatch() *SectorBatch { + return &SectorBatch{manifests: []SectorManifest{}} +} + +// AddEmptySectors adds the specified number of CC sectors to the batch +func (sb *SectorBatch) AddEmptySectors(count int) *SectorBatch { + for i := 0; i < count; i++ { + sb.manifests = append(sb.manifests, EmptySector()) + } + return sb +} + +// AddSectorsWithRandomPieces adds sectors with random pieces +func (sb *SectorBatch) AddSectorsWithRandomPieces(count int) *SectorBatch { + for i := 0; i < count; i++ { + sb.manifests = append(sb.manifests, SectorWithPiece(BogusPieceCid1)) + } + return sb +} + +// AddSector adds a custom sector manifest +func (sb *SectorBatch) AddSector(manifest SectorManifest) *SectorBatch { + sb.manifests = append(sb.manifests, manifest) + return sb +} + +// EmptySector creates an empty (CC) sector with no pieces +func EmptySector() SectorManifest { + return SectorManifest{} +} + +// SectorWithPiece creates a sector with the specified piece CID +func SectorWithPiece(piece cid.Cid) SectorManifest { + return SectorManifest{ + Piece: piece, + } +} + +// SectorWithVerifiedPiece creates a sector with a verified allocation +func SectorWithVerifiedPiece(piece cid.Cid, key *miner14.VerifiedAllocationKey) SectorManifest { + return SectorManifest{ + Piece: piece, + Verified: key, + } +} + // OnboardSectors onboards the specified number of sectors to the miner using the specified proof // type. If `withPieces` is true and the proof type supports it, the sectors will be onboarded with // pieces, otherwise they will be CC. @@ -196,10 +273,9 @@ func WithExpectedExitCodes(exitCodes []exitcode.ExitCode) OnboardOpt { // process with real proofs. func (tm *TestUnmanagedMiner) OnboardSectors( proofType abi.RegisteredSealProof, - withPieces bool, - count int, + sectorBatch *SectorBatch, opts ...OnboardOpt, -) []abi.SectorNumber { +) ([]abi.SectorNumber, types.TipSetKey) { req := require.New(tm.t) @@ -208,7 +284,7 @@ func (tm *TestUnmanagedMiner) OnboardSectors( req.NoError(o(&options)) } - sectors := make([]sectorInfo, count) + sectors := make([]sectorInfo, len(sectorBatch.manifests)) // Wait for the seal randomness to be available (we can only draw seal randomness from // tipsets that have already achieved finality) @@ -219,21 +295,25 @@ func (tm *TestUnmanagedMiner) OnboardSectors( // For each sector, run PC1, PC2, C1 an C2, preparing for ProveCommit. If the proof needs it we // will also submit a precommit for the sector. - for i := 0; i < count; i++ { - idx := i + for idx, sm := range sectorBatch.manifests { // We hold on to `sector`, adding new properties to it as we go along until we're finished with // this phase, then add it to `sectors` sector := tm.nextSector(proofType) sector.sealRandomnessEpoch = sealRandEpoch + sector.duration = sm.Duration + if sector.duration == 0 { + sector.duration = builtin.EpochsInDay * 300 + } eg.Go(func() error { - if withPieces { + if sm.Piece.Defined() { // Build a sector with non-zero pieces to onboard if tm.mockProofs { - sector.pieces = []abi.PieceInfo{{ - Size: abi.PaddedPieceSize(tm.options.sectorSize), - PieceCID: fixedPieceCid, + sector.pieces = []miner14.PieceActivationManifest{{ + Size: abi.PaddedPieceSize(tm.options.sectorSize), + CID: sm.Piece, + VerifiedAllocationKey: sm.Verified, }} } else { var err error @@ -282,7 +362,7 @@ func (tm *TestUnmanagedMiner) OnboardSectors( } // Submit ProveCommit for all sectors - exitCodes := tm.submitProveCommit(proofType, sectors, options.requireActivationSuccess, options.modifyNIActivationsBeforeSubmit) + exitCodes, tsk := tm.submitProveCommit(proofType, sectors, options.requireActivationSuccess, options.modifyNIActivationsBeforeSubmit) // ProveCommit may have succeeded overall, but some sectors may have failed if RequireActivationSuccess // was set to false. We need to return the exit codes for each sector so the caller can determine @@ -305,12 +385,13 @@ func (tm *TestUnmanagedMiner) OnboardSectors( tm.wdPostLoop() - return onboarded + return onboarded, tsk } // SnapDeal snaps a deal into a sector, generating a new sealed sector and updating the sector's state. // WindowPoSt should continue to operate after this operation if required. -func (tm *TestUnmanagedMiner) SnapDeal(sectorNumber abi.SectorNumber) []abi.PieceInfo { +// The SectorManifest argument (currently) only impacts mock proofs, and is ignored otherwise. +func (tm *TestUnmanagedMiner) SnapDeal(sectorNumber abi.SectorNumber, sm SectorManifest) ([]abi.PieceInfo, types.TipSetKey) { req := require.New(tm.t) tm.log("Snapping a deal into sector %d ...", sectorNumber) @@ -355,7 +436,7 @@ func (tm *TestUnmanagedMiner) SnapDeal(sectorNumber abi.SectorNumber) []abi.Piec } else { pieces = []abi.PieceInfo{{ Size: abi.PaddedPieceSize(tm.options.sectorSize), - PieceCID: cid.MustParse("baga6ea4seaqlhznlutptgfwhffupyer6txswamerq5fc2jlwf2lys2mm5jtiaeq"), + PieceCID: sm.Piece, }} snapProof = []byte{0xde, 0xad, 0xbe, 0xef} newSealedCid = cid.MustParse("bagboea4b5abcatlxechwbp7kjpjguna6r6q7ejrhe6mdp3lf34pmswn27pkkieka") @@ -365,10 +446,14 @@ func (tm *TestUnmanagedMiner) SnapDeal(sectorNumber abi.SectorNumber) []abi.Piec var manifest []miner14.PieceActivationManifest for _, piece := range pieces { - manifest = append(manifest, miner14.PieceActivationManifest{ + pm := miner14.PieceActivationManifest{ CID: piece.PieceCID, Size: piece.Size, - }) + } + if tm.mockProofs { + pm.VerifiedAllocationKey = sm.Verified + } + manifest = append(manifest, pm) } head, err := tm.FullNode.ChainHead(tm.ctx) @@ -398,12 +483,35 @@ func (tm *TestUnmanagedMiner) SnapDeal(sectorNumber abi.SectorNumber) []abi.Piec req.NoError(err) req.True(r.Receipt.ExitCode.IsSuccess()) - si.pieces = pieces + si.pieces = manifest si.sealedCid = newSealedCid si.unsealedCid = newUnsealedCid tm.setCommittedSector(si) - return pieces + return pieces, r.TipSet +} + +func (tm *TestUnmanagedMiner) ExtendSectorExpiration(sectorNumber abi.SectorNumber, expiration abi.ChainEpoch) types.TipSetKey { + req := require.New(tm.t) + + sl, err := tm.FullNode.StateSectorPartition(tm.ctx, tm.ActorAddr, sectorNumber, types.EmptyTSK) + req.NoError(err) + + params := &miner14.ExtendSectorExpiration2Params{ + Extensions: []miner14.ExpirationExtension2{ + { + Deadline: sl.Deadline, + Partition: sl.Partition, + Sectors: bitfield.NewFromSet([]uint64{uint64(sectorNumber)}), + NewExpiration: expiration, + }, + }, + } + r, err := tm.SubmitMessage(params, 1, builtin.MethodsMiner.ExtendSectorExpiration2) + req.NoError(err) + req.True(r.Receipt.ExitCode.IsSuccess()) + + return r.TipSet } func (tm *TestUnmanagedMiner) log(msg string, args ...interface{}) { @@ -487,9 +595,9 @@ func (tm *TestUnmanagedMiner) mkAndSavePiecesToOnboard(sector sectorInfo) (secto } // Create a struct for the piece info - sector.pieces = []abi.PieceInfo{{ - Size: paddedPieceSize, - PieceCID: pieceCIDA, + sector.pieces = []miner14.PieceActivationManifest{{ + Size: paddedPieceSize, + CID: pieceCIDA, }} // Create a temporary file for the sealed sector @@ -654,8 +762,10 @@ func (tm *TestUnmanagedMiner) preCommitSectors( unsealedCid := sector.unsealedCid uc = &unsealedCid } + head, err := tm.FullNode.ChainHead(tm.ctx) + require.NoError(tm.t, err) spci := []miner14.SectorPreCommitInfo{{ - Expiration: 2880 * 300, + Expiration: head.Height() + (30*builtin.EpochsInDay + 10 /* pre_commit_challenge_delay - short */) + sector.duration, SectorNumber: sector.sectorNumber, SealProof: proofType, SealedCID: sealedCid, @@ -679,7 +789,7 @@ func (tm *TestUnmanagedMiner) submitProveCommit( sectors []sectorInfo, requireActivationSuccess bool, modifyNIActivationsBeforeSubmit func([]miner14.SectorNIActivationInfo) []miner14.SectorNIActivationInfo, -) []exitcode.ExitCode { +) ([]exitcode.ExitCode, types.TipSetKey) { req := require.New(tm.t) @@ -702,6 +812,9 @@ func (tm *TestUnmanagedMiner) submitProveCommit( req.NoError(err) actorId := abi.ActorID(actorIdNum) + head, err := tm.FullNode.ChainHead(tm.ctx) + req.NoError(err) + infos := make([]proof.AggregateSealVerifyInfo, len(sectors)) activations := make([]miner14.SectorNIActivationInfo, len(sectors)) for i, sector := range sectors { @@ -721,7 +834,7 @@ func (tm *TestUnmanagedMiner) submitProveCommit( SealedCID: sector.sealedCid, SectorNumber: sector.sectorNumber, SealRandEpoch: sector.sealRandomnessEpoch, - Expiration: 2880 * 300, + Expiration: head.Height() + sector.duration, } } @@ -767,13 +880,7 @@ func (tm *TestUnmanagedMiner) submitProveCommit( for i, sector := range sectors { activations[i] = miner14.SectorActivationManifest{SectorNumber: sector.sectorNumber} if len(sector.pieces) > 0 { - activations[i].Pieces = make([]miner14.PieceActivationManifest, len(sector.pieces)) - for j, piece := range sector.pieces { - activations[i].Pieces[j] = miner14.PieceActivationManifest{ - CID: piece.PieceCID, - Size: piece.Size, - } - } + activations[i].Pieces = sector.pieces } } @@ -819,7 +926,7 @@ func (tm *TestUnmanagedMiner) submitProveCommit( } } - return exitCodes + return exitCodes, msgReturn.TipSet } func (tm *TestUnmanagedMiner) wdPostLoop() { @@ -1229,8 +1336,12 @@ func (tm *TestUnmanagedMiner) waitPreCommitSealRandomness(proofType abi.Register func (tm *TestUnmanagedMiner) generatePreCommit(sector sectorInfo, sealRandEpoch abi.ChainEpoch) (sectorInfo, error) { if tm.mockProofs { sector.sealedCid = cid.MustParse("bagboea4b5abcatlxechwbp7kjpjguna6r6q7ejrhe6mdp3lf34pmswn27pkkiekz") - if len(sector.pieces) > 0 { - sector.unsealedCid = fixedPieceCid + switch len(sector.pieces) { + case 0: + case 1: + sector.unsealedCid = sector.pieces[0].CID + default: + require.FailNow(tm.t, "generatePreCommit: multiple pieces not supported") // yet } return sector, nil } @@ -1269,7 +1380,7 @@ func (tm *TestUnmanagedMiner) generatePreCommit(sector sectorInfo, sealRandEpoch sector.sectorNumber, actorId, sealTickets, - sector.pieces, + sector.piecesToPieceInfos(), ) if err != nil { return sectorInfo{}, fmt.Errorf("failed to run SealPreCommitPhase1 for sector %d: %w", sector.sectorNumber, err) @@ -1362,7 +1473,7 @@ func (tm *TestUnmanagedMiner) generateSectorProof(sector sectorInfo) ([]byte, er actorId, sector.sealTickets, interactiveRandomness, - sector.pieces, + sector.piecesToPieceInfos(), ) if err != nil { return nil, fmt.Errorf("failed to run SealCommitPhase1 for sector %d: %w", sector.sectorNumber, err) @@ -1482,7 +1593,7 @@ func (tm *TestUnmanagedMiner) WaitTillActivatedAndAssertPower(sectors []abi.Sect // wait till sectors are activated for _, sectorNumber := range sectors { - tm.WaitTillPost(sectorNumber) + tm.WaitTillPostCount(sectorNumber, 1) if !tm.mockProofs { // else it would pass, which we don't want // if the sector is in the current or previous deadline, we can't dispute the PoSt @@ -1512,24 +1623,36 @@ func (tm *TestUnmanagedMiner) AssertNoWindowPostError() { } } -func (tm *TestUnmanagedMiner) WaitTillPost(sectorNumber abi.SectorNumber) { +func (tm *TestUnmanagedMiner) GetPostCount(sectorNumber abi.SectorNumber) int { + return tm.GetPostCountSince(0, sectorNumber) +} + +func (tm *TestUnmanagedMiner) GetPostCountSince(epoch abi.ChainEpoch, sectorNumber abi.SectorNumber) int { + tm.postsLk.Lock() + defer tm.postsLk.Unlock() + + var postCount int + for _, post := range tm.posts { + require.NoError(tm.t, post.Error, "expected no error in window post but found one at epoch %d", post.Epoch) + if post.Error == nil { + for _, sn := range post.Posted { + if post.Epoch >= epoch && sn == sectorNumber { + postCount++ + } + } + } + } + return postCount +} + +func (tm *TestUnmanagedMiner) WaitTillPostCount(sectorNumber abi.SectorNumber, count int) { for i := 0; tm.ctx.Err() == nil; i++ { if i%10 == 0 { tm.log("Waiting for sector %d to be posted", sectorNumber) } - tm.postsLk.Lock() - for _, post := range tm.posts { - require.NoError(tm.t, post.Error, "expected no error in window post but found one at epoch %d", post.Epoch) - if post.Error == nil { - for _, sn := range post.Posted { - if sn == sectorNumber { - tm.postsLk.Unlock() - return - } - } - } + if tm.GetPostCount(sectorNumber) >= count { + return } - tm.postsLk.Unlock() select { case <-tm.ctx.Done(): return diff --git a/itests/manual_onboarding_test.go b/itests/manual_onboarding_test.go index c03ddd9b1d7..bc4771ff407 100644 --- a/itests/manual_onboarding_test.go +++ b/itests/manual_onboarding_test.go @@ -87,7 +87,7 @@ func TestManualSectorOnboarding(t *testing.T) { minerC.AssertNoPower() // ---- Miner B onboards a CC sector - bSectors := minerB.OnboardSectors(sealProofType, false, 1) + bSectors, _ := minerB.OnboardSectors(sealProofType, kit.NewSectorBatch().AddEmptySectors(1)) req.Len(bSectors, 1) // Miner B should still not have power as power can only be gained after sector is activated i.e. the first WindowPost is submitted for it minerB.AssertNoPower() @@ -95,7 +95,7 @@ func TestManualSectorOnboarding(t *testing.T) { blockMiner.WatchMinerForPost(minerB.ActorAddr) // --- Miner C onboards sector with data/pieces - cSectors := minerC.OnboardSectors(sealProofType, true, 1) + cSectors, _ := minerC.OnboardSectors(sealProofType, kit.NewSectorBatch().AddSectorsWithRandomPieces(1)) // Miner C should still not have power as power can only be gained after sector is activated i.e. the first WindowPost is submitted for it minerC.AssertNoPower() // Ensure that the block miner checks for and waits for posts during the appropriate proving window from our new miner with a sector @@ -106,7 +106,7 @@ func TestManualSectorOnboarding(t *testing.T) { minerC.WaitTillActivatedAndAssertPower(cSectors, uint64(defaultSectorSize), uint64(defaultSectorSize)) // Miner B has activated the CC sector -> upgrade it with snapdeals - _ = minerB.SnapDeal(bSectors[0]) + _, _ = minerB.SnapDeal(bSectors[0], kit.SectorManifest{Piece: kit.BogusPieceCid2}) }) } } diff --git a/itests/migration_test.go b/itests/migration_test.go index f1454ba42d3..a909837b85d 100644 --- a/itests/migration_test.go +++ b/itests/migration_test.go @@ -909,6 +909,10 @@ func TestMigrationNV24(t *testing.T) { ) buildconstants.UpgradeTuktukPowerRampDurationEpochs = powerRampDurationEpochs buildconstants.UpgradeTuktukHeight = nv24epoch + // Pretend that the reserve account started with 1B FIL, so that when calculating the + // circulating supply we find that the reserve account only has ~300M FIL so there must be ~700M + // FIL in circulation, which is close to current mainnet supply. + buildconstants.InitialFilReserved = types.MustParseFIL("1000000000 FIL").Int // InitialPledgeMaxPerByte is a little too low for an itest environment so gets in the way of // testing the underlying calculation, so we bump it up here so it doesn't interfere. diff --git a/itests/niporep_manual_test.go b/itests/niporep_manual_test.go index a2fa949082a..ac65876da58 100644 --- a/itests/niporep_manual_test.go +++ b/itests/niporep_manual_test.go @@ -274,10 +274,9 @@ func TestManualNISectorOnboarding(t *testing.T) { req.NoError(err) // Onboard CC sectors to this test miner using NI-PoRep - sectors[i] = miner.OnboardSectors( + sectors[i], _ = miner.OnboardSectors( sealProofType, - false, - len(tcMiner.sectorsToOnboard), + kit.NewSectorBatch().AddEmptySectors(len(tcMiner.sectorsToOnboard)), kit.WithExpectedExitCodes(tcMiner.sectorsToOnboard), kit.WithRequireActivationSuccess(tcMiner.allOrNothing), kit.WithModifyNIActivationsBeforeSubmit(func(activations []miner14.SectorNIActivationInfo) []miner14.SectorNIActivationInfo { @@ -337,7 +336,7 @@ func TestManualNISectorOnboarding(t *testing.T) { req.NoError(err) // Snap a deal into the first of the successfully onboarded CC sectors for this miner - snapPieces := miner.SnapDeal(sectors[i][0]) + snapPieces, _ := miner.SnapDeal(sectors[i][0], kit.SectorWithPiece(kit.BogusPieceCid2)) // Check "sector-updated" event happned after snap { @@ -390,7 +389,7 @@ func TestNISectorFailureCases(t *testing.T) { build.Clock.Sleep(time.Second) // We have to onboard a sector first to get the miner enrolled in cron; although we don't need to wait for it to prove - _ = miner.OnboardSectors(sealProofType, false, 1) + _, _ = miner.OnboardSectors(sealProofType, kit.NewSectorBatch().AddEmptySectors(1)) // Utility functions and variables for our failure cases @@ -482,7 +481,7 @@ func TestNISectorFailureCases(t *testing.T) { t.Run("bad SealedCID", func(t *testing.T) { params := mkParams() - params.Sectors[1].SealedCID = cid.MustParse("baga6ea4seaqjtovkwk4myyzj56eztkh5pzsk5upksan6f5outesy62bsvl4dsha") + params.Sectors[1].SealedCID = kit.BogusPieceCid1 submitAndFail(¶ms, "invalid NI commit 1 while requiring activation success", 16) }) diff --git a/itests/splitstore_test.go b/itests/splitstore_test.go index 677ea9de078..caa013be36d 100644 --- a/itests/splitstore_test.go +++ b/itests/splitstore_test.go @@ -16,7 +16,7 @@ import ( "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/go-state-types/big" "github.com/filecoin-project/go-state-types/builtin" - miner8 "github.com/filecoin-project/go-state-types/builtin/v8/miner" + miner16 "github.com/filecoin-project/go-state-types/builtin/v16/miner" "github.com/filecoin-project/go-state-types/exitcode" miner2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/miner" power6 "github.com/filecoin-project/specs-actors/v6/actors/builtin/power" @@ -447,7 +447,7 @@ func (g *Garbager) mInfoCid(ctx context.Context) cid.Cid { require.NoError(g.t, err) raw, err := g.node.ChainReadObj(ctx, act.Head) require.NoError(g.t, err) - var mSt miner8.State + var mSt miner16.State require.NoError(g.t, mSt.UnmarshalCBOR(bytes.NewReader(raw))) // return infoCid diff --git a/itests/supply_test.go b/itests/supply_test.go index 5c603338d51..d0f9904d3f3 100644 --- a/itests/supply_test.go +++ b/itests/supply_test.go @@ -28,7 +28,7 @@ func TestCirciulationSupplyUpgrade(t *testing.T) { ctx := context.Background() // Choosing something divisible by epochs per day to remove error with simple deal duration - lockedClientBalance := big.Mul(abi.NewTokenAmount(11_520_000), abi.NewTokenAmount(1e18)) + lockedClientBalance := big.Mul(abi.NewTokenAmount(8_640_000), abi.NewTokenAmount(1e18)) lockedProviderBalance := big.Mul(abi.NewTokenAmount(1_000_000), abi.NewTokenAmount(1e18)) var height0 abi.ChainEpoch var height1 abi.ChainEpoch diff --git a/node/impl/full/state.go b/node/impl/full/state.go index 23788c4bd02..f3f0df63d2a 100644 --- a/node/impl/full/state.go +++ b/node/impl/full/state.go @@ -240,10 +240,15 @@ func (a *StateAPI) StateMinerDeadlines(ctx context.Context, m address.Address, t if err != nil { return err } + dailyFee, err := dl.DailyFee() + if err != nil { + return err + } out[i] = api.Deadline{ PostSubmissions: ps, DisputableProofCount: l, + DailyFee: dailyFee, } return nil }); err != nil { @@ -2088,6 +2093,7 @@ func (a *StateAPI) StateGetNetworkParams(ctx context.Context) (*api.NetworkParam UpgradeWaffleHeight: buildconstants.UpgradeWaffleHeight, UpgradeTuktukHeight: buildconstants.UpgradeTuktukHeight, UpgradeTeepHeight: buildconstants.UpgradeTeepHeight, + UpgradeTockHeight: buildconstants.UpgradeTockHeight, }, }, nil } diff --git a/storage/pipeline/mocks/mocks.go b/storage/pipeline/mocks/mocks.go index e1d7f8d6e87..c24b9ff4e30 100644 --- a/storage/pipeline/mocks/mocks.go +++ b/storage/pipeline/mocks/mocks.go @@ -16,7 +16,7 @@ import ( bitfield "github.com/filecoin-project/go-bitfield" abi "github.com/filecoin-project/go-state-types/abi" big "github.com/filecoin-project/go-state-types/big" - miner "github.com/filecoin-project/go-state-types/builtin/v13/miner" + miner "github.com/filecoin-project/go-state-types/builtin/v16/miner" miner0 "github.com/filecoin-project/go-state-types/builtin/v9/miner" verifreg "github.com/filecoin-project/go-state-types/builtin/v9/verifreg" crypto "github.com/filecoin-project/go-state-types/crypto"