diff --git a/fixtures/networks/butterfly.go b/fixtures/networks/butterfly.go index 1582dd645b..2f664615f4 100644 --- a/fixtures/networks/butterfly.go +++ b/fixtures/networks/butterfly.go @@ -31,34 +31,35 @@ func ButterflySnapNet() *NetworkConf { MinVerifiedDealSize: 1 << 20, PreCommitChallengeDelay: abi.ChainEpoch(150), ForkUpgradeParam: &config.ForkUpgradeConfig{ - BreezeGasTampingDuration: 120, - UpgradeBreezeHeight: -1, - UpgradeSmokeHeight: -2, - UpgradeIgnitionHeight: -3, - UpgradeRefuelHeight: -4, - UpgradeAssemblyHeight: -5, - UpgradeTapeHeight: -6, - UpgradeLiftoffHeight: -7, - UpgradeKumquatHeight: -8, - UpgradeCalicoHeight: -9, - UpgradePersianHeight: -10, - UpgradeOrangeHeight: -11, - UpgradeClausHeight: -12, - UpgradeTrustHeight: -13, - UpgradeNorwegianHeight: -14, - UpgradeTurboHeight: -15, - UpgradeHyperdriveHeight: -16, - UpgradeChocolateHeight: -17, - UpgradeOhSnapHeight: -18, - UpgradeSkyrHeight: -19, - UpgradeSharkHeight: -20, - UpgradeHyggeHeight: -21, - UpgradeLightningHeight: -22, - UpgradeThunderHeight: -23, - UpgradeWatermelonHeight: -24, - UpgradeWatermelonFixHeight: -100, // This fix upgrade only ran on calibrationnet - UpgradeWatermelonFix2Height: -101, // This fix upgrade only ran on calibrationnet - UpgradeDragonHeight: 5760, + BreezeGasTampingDuration: 120, + UpgradeBreezeHeight: -1, + UpgradeSmokeHeight: -2, + UpgradeIgnitionHeight: -3, + UpgradeRefuelHeight: -4, + UpgradeAssemblyHeight: -5, + UpgradeTapeHeight: -6, + UpgradeLiftoffHeight: -7, + UpgradeKumquatHeight: -8, + UpgradeCalicoHeight: -9, + UpgradePersianHeight: -10, + UpgradeOrangeHeight: -11, + UpgradeClausHeight: -12, + UpgradeTrustHeight: -13, + UpgradeNorwegianHeight: -14, + UpgradeTurboHeight: -15, + UpgradeHyperdriveHeight: -16, + UpgradeChocolateHeight: -17, + UpgradeOhSnapHeight: -18, + UpgradeSkyrHeight: -19, + UpgradeSharkHeight: -20, + UpgradeHyggeHeight: -21, + UpgradeLightningHeight: -22, + UpgradeThunderHeight: -23, + UpgradeWatermelonHeight: -24, + UpgradeWatermelonFixHeight: -100, // This fix upgrade only ran on calibrationnet + UpgradeWatermelonFix2Height: -101, // This fix upgrade only ran on calibrationnet + UpgradeDragonHeight: 5760, + UpgradeCalibrationDragonFixHeight: -102, // This fix upgrade only ran on calibrationnet }, DrandSchedule: map[abi.ChainEpoch]config.DrandEnum{0: 1}, AddressNetwork: address.Testnet, diff --git a/fixtures/networks/calibration.go b/fixtures/networks/calibration.go index e77dd432e4..6cc6c04dea 100644 --- a/fixtures/networks/calibration.go +++ b/fixtures/networks/calibration.go @@ -38,34 +38,35 @@ func Calibration() *NetworkConf { MinVerifiedDealSize: 1 << 20, PreCommitChallengeDelay: abi.ChainEpoch(150), ForkUpgradeParam: &config.ForkUpgradeConfig{ - BreezeGasTampingDuration: 120, - UpgradeBreezeHeight: -1, - UpgradeSmokeHeight: -2, - UpgradeIgnitionHeight: -3, - UpgradeRefuelHeight: -4, - UpgradeAssemblyHeight: 30, - UpgradeTapeHeight: 60, - UpgradeLiftoffHeight: -5, - UpgradeKumquatHeight: 90, - UpgradeCalicoHeight: 120, - UpgradePersianHeight: 120 + (builtin2.EpochsInHour * 1), - UpgradeClausHeight: 270, - UpgradeOrangeHeight: 300, - UpgradeTrustHeight: 330, - UpgradeNorwegianHeight: 360, - UpgradeTurboHeight: 390, - UpgradeHyperdriveHeight: 420, - UpgradeChocolateHeight: 450, - UpgradeOhSnapHeight: 480, - UpgradeSkyrHeight: 510, - UpgradeSharkHeight: 16800, - UpgradeHyggeHeight: 322354, // 2023-02-21T16:30:00Z - UpgradeLightningHeight: 489094, // 2023-04-20T14:00:00Z - UpgradeThunderHeight: 489094 + 3120, // 2023-04-21T16:00:00Z - UpgradeWatermelonHeight: 1013134, // 2023-10-19T13:00:00Z - UpgradeWatermelonFixHeight: 1070494, // 2023-11-07T13:00:00Z - UpgradeWatermelonFix2Height: 1108174, // 2023-11-21T13:00:00Z - UpgradeDragonHeight: 1427974, // 2024-03-11T14:00:00Z + BreezeGasTampingDuration: 120, + UpgradeBreezeHeight: -1, + UpgradeSmokeHeight: -2, + UpgradeIgnitionHeight: -3, + UpgradeRefuelHeight: -4, + UpgradeAssemblyHeight: 30, + UpgradeTapeHeight: 60, + UpgradeLiftoffHeight: -5, + UpgradeKumquatHeight: 90, + UpgradeCalicoHeight: 120, + UpgradePersianHeight: 120 + (builtin2.EpochsInHour * 1), + UpgradeClausHeight: 270, + UpgradeOrangeHeight: 300, + UpgradeTrustHeight: 330, + UpgradeNorwegianHeight: 360, + UpgradeTurboHeight: 390, + UpgradeHyperdriveHeight: 420, + UpgradeChocolateHeight: 450, + UpgradeOhSnapHeight: 480, + UpgradeSkyrHeight: 510, + UpgradeSharkHeight: 16800, + UpgradeHyggeHeight: 322354, // 2023-02-21T16:30:00Z + UpgradeLightningHeight: 489094, // 2023-04-20T14:00:00Z + UpgradeThunderHeight: 489094 + 3120, // 2023-04-21T16:00:00Z + UpgradeWatermelonHeight: 1013134, // 2023-10-19T13:00:00Z + UpgradeWatermelonFixHeight: 1070494, // 2023-11-07T13:00:00Z + UpgradeWatermelonFix2Height: 1108174, // 2023-11-21T13:00:00Z + UpgradeDragonHeight: 1427974, // 2024-03-11T14:00:00Z + UpgradeCalibrationDragonFixHeight: 1493854, // 2024-04-03T11:00:00Z }, DrandSchedule: map[abi.ChainEpoch]config.DrandEnum{0: 1}, AddressNetwork: address.Testnet, diff --git a/fixtures/networks/forcenet.go b/fixtures/networks/forcenet.go index e7a8f6edb2..4f9352d756 100644 --- a/fixtures/networks/forcenet.go +++ b/fixtures/networks/forcenet.go @@ -40,27 +40,28 @@ func ForceNet() *NetworkConf { // Miners, clients, developers, custodians all need time to prepare. // We still have upgrades and state changes to do, but can happen after signaling timing here. - UpgradeAssemblyHeight: -7, // critical: the network can bootstrap from v1 only - UpgradeKumquatHeight: -8, - UpgradeCalicoHeight: -9, - UpgradePersianHeight: -10, - UpgradeOrangeHeight: -11, - UpgradeClausHeight: -12, - UpgradeTrustHeight: -13, - UpgradeNorwegianHeight: -14, - UpgradeTurboHeight: -15, - UpgradeHyperdriveHeight: -16, - UpgradeChocolateHeight: -17, - UpgradeOhSnapHeight: -18, - UpgradeSkyrHeight: -19, - UpgradeSharkHeight: -20, - UpgradeHyggeHeight: -21, - UpgradeLightningHeight: -22, - UpgradeThunderHeight: -23, - UpgradeWatermelonHeight: -24, - UpgradeWatermelonFixHeight: -100, // This fix upgrade only ran on calibrationnet - UpgradeWatermelonFix2Height: -101, // This fix upgrade only ran on calibrationnet - UpgradeDragonHeight: 20, + UpgradeAssemblyHeight: -7, // critical: the network can bootstrap from v1 only + UpgradeKumquatHeight: -8, + UpgradeCalicoHeight: -9, + UpgradePersianHeight: -10, + UpgradeOrangeHeight: -11, + UpgradeClausHeight: -12, + UpgradeTrustHeight: -13, + UpgradeNorwegianHeight: -14, + UpgradeTurboHeight: -15, + UpgradeHyperdriveHeight: -16, + UpgradeChocolateHeight: -17, + UpgradeOhSnapHeight: -18, + UpgradeSkyrHeight: -19, + UpgradeSharkHeight: -20, + UpgradeHyggeHeight: -21, + UpgradeLightningHeight: -22, + UpgradeThunderHeight: -23, + UpgradeWatermelonHeight: -24, + UpgradeWatermelonFixHeight: -100, // This fix upgrade only ran on calibrationnet + UpgradeWatermelonFix2Height: -101, // This fix upgrade only ran on calibrationnet + UpgradeDragonHeight: 20, + UpgradeCalibrationDragonFixHeight: -102, // This fix upgrade only ran on calibrationnet }, DrandSchedule: map[abi.ChainEpoch]config.DrandEnum{0: config.DrandMainnet}, AddressNetwork: address.Testnet, diff --git a/fixtures/networks/integrationtestnet.go b/fixtures/networks/integrationtestnet.go index 669002bc51..2f64705ea3 100644 --- a/fixtures/networks/integrationtestnet.go +++ b/fixtures/networks/integrationtestnet.go @@ -26,34 +26,35 @@ func IntegrationNet() *NetworkConf { MinVerifiedDealSize: 1 << 20, PreCommitChallengeDelay: abi.ChainEpoch(150), ForkUpgradeParam: &config.ForkUpgradeConfig{ - BreezeGasTampingDuration: 120, - UpgradeBreezeHeight: 41280, - UpgradeSmokeHeight: 51000, - UpgradeIgnitionHeight: 94000, - UpgradeRefuelHeight: 130800, - UpgradeAssemblyHeight: 138720, - UpgradeTapeHeight: 140760, - UpgradeLiftoffHeight: 148888, - UpgradeKumquatHeight: 170000, - UpgradeCalicoHeight: 265200, - UpgradePersianHeight: 265200 + (120 * 60), - UpgradeOrangeHeight: 336458, - UpgradeClausHeight: 343200, - UpgradeTrustHeight: 550321, - UpgradeNorwegianHeight: 665280, - UpgradeTurboHeight: 712320, - UpgradeHyperdriveHeight: 892800, - UpgradeChocolateHeight: 1231620, - UpgradeOhSnapHeight: 1594680, - UpgradeSkyrHeight: 1960320, - UpgradeSharkHeight: 2383680, - UpgradeHyggeHeight: 2683348, - UpgradeLightningHeight: 2809800, - UpgradeThunderHeight: 2809800 + 2880*21, - UpgradeWatermelonHeight: 3431940, - UpgradeWatermelonFixHeight: -100, // This fix upgrade only ran on calibrationnet - UpgradeWatermelonFix2Height: -101, // This fix upgrade only ran on calibrationnet - UpgradeDragonHeight: 9999999999999, + BreezeGasTampingDuration: 120, + UpgradeBreezeHeight: 41280, + UpgradeSmokeHeight: 51000, + UpgradeIgnitionHeight: 94000, + UpgradeRefuelHeight: 130800, + UpgradeAssemblyHeight: 138720, + UpgradeTapeHeight: 140760, + UpgradeLiftoffHeight: 148888, + UpgradeKumquatHeight: 170000, + UpgradeCalicoHeight: 265200, + UpgradePersianHeight: 265200 + (120 * 60), + UpgradeOrangeHeight: 336458, + UpgradeClausHeight: 343200, + UpgradeTrustHeight: 550321, + UpgradeNorwegianHeight: 665280, + UpgradeTurboHeight: 712320, + UpgradeHyperdriveHeight: 892800, + UpgradeChocolateHeight: 1231620, + UpgradeOhSnapHeight: 1594680, + UpgradeSkyrHeight: 1960320, + UpgradeSharkHeight: 2383680, + UpgradeHyggeHeight: 2683348, + UpgradeLightningHeight: 2809800, + UpgradeThunderHeight: 2809800 + 2880*21, + UpgradeWatermelonHeight: 3431940, + UpgradeWatermelonFixHeight: -100, // This fix upgrade only ran on calibrationnet + UpgradeWatermelonFix2Height: -101, // This fix upgrade only ran on calibrationnet + UpgradeDragonHeight: 9999999999999, + UpgradeCalibrationDragonFixHeight: -102, // This fix upgrade only ran on calibrationnet }, DrandSchedule: map[abi.ChainEpoch]config.DrandEnum{0: 5, 51000: 1}, AddressNetwork: address.Testnet, diff --git a/fixtures/networks/interopnet.go b/fixtures/networks/interopnet.go index 1208195edc..01f9cf22c3 100644 --- a/fixtures/networks/interopnet.go +++ b/fixtures/networks/interopnet.go @@ -31,34 +31,35 @@ func InteropNet() *NetworkConf { MinVerifiedDealSize: 256, PreCommitChallengeDelay: abi.ChainEpoch(10), ForkUpgradeParam: &config.ForkUpgradeConfig{ - BreezeGasTampingDuration: 0, - UpgradeBreezeHeight: -1, - UpgradeSmokeHeight: -2, - UpgradeIgnitionHeight: -3, - UpgradeRefuelHeight: -4, - UpgradeAssemblyHeight: -5, - UpgradeTapeHeight: -6, - UpgradeLiftoffHeight: -7, - UpgradeKumquatHeight: -8, - UpgradeCalicoHeight: -9, - UpgradePersianHeight: -10, - UpgradeOrangeHeight: -11, - UpgradeClausHeight: -12, - UpgradeTrustHeight: -13, - UpgradeNorwegianHeight: -14, - UpgradeTurboHeight: -15, - UpgradeHyperdriveHeight: -16, - UpgradeChocolateHeight: -17, - UpgradeOhSnapHeight: -18, - UpgradeSkyrHeight: -19, - UpgradeSharkHeight: -20, - UpgradeHyggeHeight: -21, - UpgradeLightningHeight: -22, - UpgradeThunderHeight: -23, - UpgradeWatermelonHeight: -24, - UpgradeWatermelonFixHeight: -100, // This fix upgrade only ran on calibrationnet - UpgradeWatermelonFix2Height: -101, // This fix upgrade only ran on calibrationnet - UpgradeDragonHeight: 50, + BreezeGasTampingDuration: 0, + UpgradeBreezeHeight: -1, + UpgradeSmokeHeight: -2, + UpgradeIgnitionHeight: -3, + UpgradeRefuelHeight: -4, + UpgradeAssemblyHeight: -5, + UpgradeTapeHeight: -6, + UpgradeLiftoffHeight: -7, + UpgradeKumquatHeight: -8, + UpgradeCalicoHeight: -9, + UpgradePersianHeight: -10, + UpgradeOrangeHeight: -11, + UpgradeClausHeight: -12, + UpgradeTrustHeight: -13, + UpgradeNorwegianHeight: -14, + UpgradeTurboHeight: -15, + UpgradeHyperdriveHeight: -16, + UpgradeChocolateHeight: -17, + UpgradeOhSnapHeight: -18, + UpgradeSkyrHeight: -19, + UpgradeSharkHeight: -20, + UpgradeHyggeHeight: -21, + UpgradeLightningHeight: -22, + UpgradeThunderHeight: -23, + UpgradeWatermelonHeight: -24, + UpgradeWatermelonFixHeight: -100, // This fix upgrade only ran on calibrationnet + UpgradeWatermelonFix2Height: -101, // This fix upgrade only ran on calibrationnet + UpgradeDragonHeight: 50, + UpgradeCalibrationDragonFixHeight: -102, // This fix upgrade only ran on calibrationnet }, DrandSchedule: map[abi.ChainEpoch]config.DrandEnum{0: 1}, AddressNetwork: address.Testnet, diff --git a/fixtures/networks/mainnet.go b/fixtures/networks/mainnet.go index 3f66517249..3969ac2280 100644 --- a/fixtures/networks/mainnet.go +++ b/fixtures/networks/mainnet.go @@ -51,26 +51,27 @@ func Mainnet() *NetworkConf { // This signals our tentative epoch for mainnet launch. Can make it later, but not earlier. // Miners, clients, developers, custodians all need time to prepare. // We still have upgrades and state changes to do, but can happen after signaling timing here. - UpgradeKumquatHeight: 170000, - UpgradeCalicoHeight: 265200, - UpgradePersianHeight: 265200 + (builtin2.EpochsInHour * 60), - UpgradeOrangeHeight: 336458, - UpgradeClausHeight: 343200, // 2020-12-22T02:00:00Z - UpgradeTrustHeight: 550321, // 2021-03-04T00:00:30Z - UpgradeNorwegianHeight: 665280, // 2021-04-12T22:00:00Z - UpgradeTurboHeight: 712320, // 2021-04-29T06:00:00Z - UpgradeHyperdriveHeight: 892800, // 2021-06-30T22:00:00Z - UpgradeChocolateHeight: 1231620, - UpgradeOhSnapHeight: 1594680, // 2022-03-01T15:00:00Z - UpgradeSkyrHeight: 1960320, // 2022-07-06T14:00:00Z - UpgradeSharkHeight: 2383680, // 2022-11-30T14:00:00Z - UpgradeHyggeHeight: 2683348, // 2023-03-14T15:14:00Z - UpgradeLightningHeight: 2809800, // 2023-04-27T13:00:00Z - UpgradeThunderHeight: 2809800 + 2880*21, // 2023-05-18T13:00:00Z - UpgradeWatermelonHeight: 3469380, // 2023-12-12T13:30:00Z - UpgradeWatermelonFixHeight: -100, // This fix upgrade only ran on calibrationnet - UpgradeWatermelonFix2Height: -101, // This fix upgrade only ran on calibrationnet - UpgradeDragonHeight: 3817920, // 2024-04-11T14:00:00Z + UpgradeKumquatHeight: 170000, + UpgradeCalicoHeight: 265200, + UpgradePersianHeight: 265200 + (builtin2.EpochsInHour * 60), + UpgradeOrangeHeight: 336458, + UpgradeClausHeight: 343200, // 2020-12-22T02:00:00Z + UpgradeTrustHeight: 550321, // 2021-03-04T00:00:30Z + UpgradeNorwegianHeight: 665280, // 2021-04-12T22:00:00Z + UpgradeTurboHeight: 712320, // 2021-04-29T06:00:00Z + UpgradeHyperdriveHeight: 892800, // 2021-06-30T22:00:00Z + UpgradeChocolateHeight: 1231620, + UpgradeOhSnapHeight: 1594680, // 2022-03-01T15:00:00Z + UpgradeSkyrHeight: 1960320, // 2022-07-06T14:00:00Z + UpgradeSharkHeight: 2383680, // 2022-11-30T14:00:00Z + UpgradeHyggeHeight: 2683348, // 2023-03-14T15:14:00Z + UpgradeLightningHeight: 2809800, // 2023-04-27T13:00:00Z + UpgradeThunderHeight: 2809800 + 2880*21, // 2023-05-18T13:00:00Z + UpgradeWatermelonHeight: 3469380, // 2023-12-12T13:30:00Z + UpgradeWatermelonFixHeight: -100, // This fix upgrade only ran on calibrationnet + UpgradeWatermelonFix2Height: -101, // This fix upgrade only ran on calibrationnet + UpgradeDragonHeight: 3817920, // 2024-04-11T14:00:00Z + UpgradeCalibrationDragonFixHeight: -102, // This fix upgrade only ran on calibrationnet }, DrandSchedule: map[abi.ChainEpoch]config.DrandEnum{0: 5, 51000: 1}, AddressNetwork: address.Mainnet, diff --git a/fixtures/networks/net_2k.go b/fixtures/networks/net_2k.go index 17fdff960f..423031733d 100644 --- a/fixtures/networks/net_2k.go +++ b/fixtures/networks/net_2k.go @@ -27,34 +27,35 @@ func Net2k() *NetworkConf { MinVerifiedDealSize: 256, PreCommitChallengeDelay: abi.ChainEpoch(10), ForkUpgradeParam: &config.ForkUpgradeConfig{ - BreezeGasTampingDuration: 0, - UpgradeBreezeHeight: -1, - UpgradeSmokeHeight: -2, - UpgradeIgnitionHeight: -3, - UpgradeRefuelHeight: -4, - UpgradeTapeHeight: -5, - UpgradeAssemblyHeight: -6, - UpgradeLiftoffHeight: -7, - UpgradeKumquatHeight: -8, - UpgradeCalicoHeight: -9, - UpgradePersianHeight: -10, - UpgradeOrangeHeight: -11, - UpgradeClausHeight: -12, - UpgradeTrustHeight: -13, - UpgradeNorwegianHeight: -14, - UpgradeTurboHeight: -15, - UpgradeHyperdriveHeight: -16, - UpgradeChocolateHeight: -17, - UpgradeOhSnapHeight: -18, - UpgradeSkyrHeight: -19, - UpgradeSharkHeight: -20, - UpgradeHyggeHeight: -21, - UpgradeLightningHeight: -22, - UpgradeThunderHeight: -23, - UpgradeWatermelonHeight: -24, - UpgradeWatermelonFixHeight: -100, // This fix upgrade only ran on calibrationnet - UpgradeWatermelonFix2Height: -101, // This fix upgrade only ran on calibrationnet - UpgradeDragonHeight: 20, + BreezeGasTampingDuration: 0, + UpgradeBreezeHeight: -1, + UpgradeSmokeHeight: -2, + UpgradeIgnitionHeight: -3, + UpgradeRefuelHeight: -4, + UpgradeTapeHeight: -5, + UpgradeAssemblyHeight: -6, + UpgradeLiftoffHeight: -7, + UpgradeKumquatHeight: -8, + UpgradeCalicoHeight: -9, + UpgradePersianHeight: -10, + UpgradeOrangeHeight: -11, + UpgradeClausHeight: -12, + UpgradeTrustHeight: -13, + UpgradeNorwegianHeight: -14, + UpgradeTurboHeight: -15, + UpgradeHyperdriveHeight: -16, + UpgradeChocolateHeight: -17, + UpgradeOhSnapHeight: -18, + UpgradeSkyrHeight: -19, + UpgradeSharkHeight: -20, + UpgradeHyggeHeight: -21, + UpgradeLightningHeight: -22, + UpgradeThunderHeight: -23, + UpgradeWatermelonHeight: -24, + UpgradeWatermelonFixHeight: -100, // This fix upgrade only ran on calibrationnet + UpgradeWatermelonFix2Height: -101, // This fix upgrade only ran on calibrationnet + UpgradeDragonHeight: 20, + UpgradeCalibrationDragonFixHeight: -102, // This fix upgrade only ran on calibrationnet }, DrandSchedule: map[abi.ChainEpoch]config.DrandEnum{0: 1}, AddressNetwork: address.Testnet, diff --git a/pkg/config/config.go b/pkg/config/config.go index af19570801..15c69f9bd5 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -310,36 +310,37 @@ type NetworkParamsConfig struct { // ForkUpgradeConfig record upgrade parameters type ForkUpgradeConfig struct { - UpgradeSmokeHeight abi.ChainEpoch `json:"upgradeSmokeHeight"` - UpgradeBreezeHeight abi.ChainEpoch `json:"upgradeBreezeHeight"` - UpgradeIgnitionHeight abi.ChainEpoch `json:"upgradeIgnitionHeight"` - UpgradeLiftoffHeight abi.ChainEpoch `json:"upgradeLiftoffHeight"` - UpgradeAssemblyHeight abi.ChainEpoch `json:"upgradeActorsV2Height"` - UpgradeRefuelHeight abi.ChainEpoch `json:"upgradeRefuelHeight"` - UpgradeTapeHeight abi.ChainEpoch `json:"upgradeTapeHeight"` - UpgradeKumquatHeight abi.ChainEpoch `json:"upgradeKumquatHeight"` - UpgradePriceListOopsHeight abi.ChainEpoch `json:"upgradePriceListOopsHeight"` - BreezeGasTampingDuration abi.ChainEpoch `json:"breezeGasTampingDuration"` - UpgradeCalicoHeight abi.ChainEpoch `json:"upgradeCalicoHeight"` - UpgradePersianHeight abi.ChainEpoch `json:"upgradePersianHeight"` - UpgradeOrangeHeight abi.ChainEpoch `json:"upgradeOrangeHeight"` - UpgradeClausHeight abi.ChainEpoch `json:"upgradeClausHeight"` - UpgradeTrustHeight abi.ChainEpoch `json:"upgradeActorsV3Height"` - UpgradeNorwegianHeight abi.ChainEpoch `json:"upgradeNorwegianHeight"` - UpgradeTurboHeight abi.ChainEpoch `json:"upgradeActorsV4Height"` - UpgradeHyperdriveHeight abi.ChainEpoch `json:"upgradeHyperdriveHeight"` - UpgradeChocolateHeight abi.ChainEpoch `json:"upgradeChocolateHeight"` - UpgradeOhSnapHeight abi.ChainEpoch `json:"upgradeOhSnapHeight"` - UpgradeSkyrHeight abi.ChainEpoch `json:"upgradeSkyrHeight"` - UpgradeSharkHeight abi.ChainEpoch `json:"upgradeSharkHeight"` - UpgradeHyggeHeight abi.ChainEpoch `json:"upgradeHyggeHeight"` - UpgradeLightningHeight abi.ChainEpoch `json:"upgradeLightningHeight"` - UpgradeThunderHeight abi.ChainEpoch `json:"upgradeThunderHeight"` - UpgradeWatermelonHeight abi.ChainEpoch `json:"upgradeWatermelonHeight"` - UpgradeWatermelonFixHeight abi.ChainEpoch `json:"upgradeWatermelonFixHeight"` - UpgradeWatermelonFix2Height abi.ChainEpoch `json:"upgradeWatermelonFix2Height"` - UpgradeDragonHeight abi.ChainEpoch `json:"upgradeDragonHeight"` - UpgradePhoenixHeight abi.ChainEpoch `json:"upgradePhoenixHeight"` + UpgradeSmokeHeight abi.ChainEpoch `json:"upgradeSmokeHeight"` + UpgradeBreezeHeight abi.ChainEpoch `json:"upgradeBreezeHeight"` + UpgradeIgnitionHeight abi.ChainEpoch `json:"upgradeIgnitionHeight"` + UpgradeLiftoffHeight abi.ChainEpoch `json:"upgradeLiftoffHeight"` + UpgradeAssemblyHeight abi.ChainEpoch `json:"upgradeActorsV2Height"` + UpgradeRefuelHeight abi.ChainEpoch `json:"upgradeRefuelHeight"` + UpgradeTapeHeight abi.ChainEpoch `json:"upgradeTapeHeight"` + UpgradeKumquatHeight abi.ChainEpoch `json:"upgradeKumquatHeight"` + UpgradePriceListOopsHeight abi.ChainEpoch `json:"upgradePriceListOopsHeight"` + BreezeGasTampingDuration abi.ChainEpoch `json:"breezeGasTampingDuration"` + UpgradeCalicoHeight abi.ChainEpoch `json:"upgradeCalicoHeight"` + UpgradePersianHeight abi.ChainEpoch `json:"upgradePersianHeight"` + UpgradeOrangeHeight abi.ChainEpoch `json:"upgradeOrangeHeight"` + UpgradeClausHeight abi.ChainEpoch `json:"upgradeClausHeight"` + UpgradeTrustHeight abi.ChainEpoch `json:"upgradeActorsV3Height"` + UpgradeNorwegianHeight abi.ChainEpoch `json:"upgradeNorwegianHeight"` + UpgradeTurboHeight abi.ChainEpoch `json:"upgradeActorsV4Height"` + UpgradeHyperdriveHeight abi.ChainEpoch `json:"upgradeHyperdriveHeight"` + UpgradeChocolateHeight abi.ChainEpoch `json:"upgradeChocolateHeight"` + UpgradeOhSnapHeight abi.ChainEpoch `json:"upgradeOhSnapHeight"` + UpgradeSkyrHeight abi.ChainEpoch `json:"upgradeSkyrHeight"` + UpgradeSharkHeight abi.ChainEpoch `json:"upgradeSharkHeight"` + UpgradeHyggeHeight abi.ChainEpoch `json:"upgradeHyggeHeight"` + UpgradeLightningHeight abi.ChainEpoch `json:"upgradeLightningHeight"` + UpgradeThunderHeight abi.ChainEpoch `json:"upgradeThunderHeight"` + UpgradeWatermelonHeight abi.ChainEpoch `json:"upgradeWatermelonHeight"` + UpgradeWatermelonFixHeight abi.ChainEpoch `json:"upgradeWatermelonFixHeight"` + UpgradeWatermelonFix2Height abi.ChainEpoch `json:"upgradeWatermelonFix2Height"` + UpgradeDragonHeight abi.ChainEpoch `json:"upgradeDragonHeight"` + UpgradePhoenixHeight abi.ChainEpoch `json:"upgradePhoenixHeight"` + UpgradeCalibrationDragonFixHeight abi.ChainEpoch `json:"upgradeCalibrationDragonFixHeight"` } func IsNearUpgrade(epoch, upgradeEpoch abi.ChainEpoch) bool { @@ -378,6 +379,8 @@ var DefaultForkUpgradeParam = &ForkUpgradeConfig{ UpgradeWatermelonFix2Height: -2, UpgradeDragonHeight: 3817920, UpgradePhoenixHeight: 3817920 + 120, + // This fix upgrade only ran on calibrationnet + UpgradeCalibrationDragonFixHeight: -3, } func newDefaultNetworkParamsConfig() *NetworkParamsConfig { diff --git a/pkg/fork/fork.go b/pkg/fork/fork.go index 9f57bbf840..25945fe315 100644 --- a/pkg/fork/fork.go +++ b/pkg/fork/fork.go @@ -53,6 +53,8 @@ import ( init11 "github.com/filecoin-project/go-state-types/builtin/v11/init" system11 "github.com/filecoin-project/go-state-types/builtin/v11/system" + init12 "github.com/filecoin-project/go-state-types/builtin/v12/init" + system12 "github.com/filecoin-project/go-state-types/builtin/v12/system" builtin0 "github.com/filecoin-project/specs-actors/actors/builtin" miner0 "github.com/filecoin-project/specs-actors/actors/builtin/miner" multisig0 "github.com/filecoin-project/specs-actors/actors/builtin/multisig" @@ -425,6 +427,11 @@ func DefaultUpgradeSchedule(cf *ChainFork, upgradeHeight *config.ForkUpgradeConf }}, Expensive: true, }, + { + Height: upgradeHeight.UpgradeCalibrationDragonFixHeight, + Network: network.Version22, + Migration: cf.upgradeActorsV13VerifregFix(calibnetv13BuggyVerifregCID1, calibnetv13CorrectManifestCID1), + }, } for _, u := range updates { @@ -2729,6 +2736,13 @@ var ( calibnetv12BuggyManifestCID1 = cid.MustParse("bafy2bzacedrunxfqta5skb7q7x32lnp4efz2oq7fn226ffm7fu5iqs62jkmvs") calibnetv12BuggyManifestCID2 = cid.MustParse("bafy2bzacebl4w5ptfvuw6746w7ev562idkbf5ppq72e6zub22435ws2rukzru") calibnetv12CorrectManifestCID1 = cid.MustParse("bafy2bzacednzb3pkrfnbfhmoqtb3bc6dgvxszpqklf3qcc7qzcage4ewzxsca") + + calibnetv13BuggyVerifregCID1 = cid.MustParse("bafk2bzacednskl3bykz5qpo54z2j2p4q44t5of4ktd6vs6ymmg2zebsbxazkm") + + calibnetv13BuggyBundleSuffix1 = "calibrationnet-13-rc3" + + calibnetv13BuggyManifestCID1 = cid.MustParse("bafy2bzacea4firkyvt2zzdwqjrws5pyeluaesh6uaid246tommayr4337xpmi") + calibnetv13CorrectManifestCID1 = cid.MustParse("bafy2bzacect4ktyujrwp6mjlsitnpvuw2pbuppz6w52sfljyo4agjevzm75qs") ) func (c *ChainFork) upgradeActorsV12Common( @@ -2849,7 +2863,7 @@ func (c *ChainFork) PreUpgradeActorsV13(ctx context.Context, } nv := c.GetNetworkVersion(ctx, epoch) - lbts, lbRoot, err := c.cr.GetLookbackTipSetForRound(ctx, ts, epoch, nv) + _, lbRoot, err := c.cr.GetLookbackTipSetForRound(ctx, ts, epoch, nv) if err != nil { return fmt.Errorf("error getting lookback ts for premigration: %w", err) } @@ -2860,7 +2874,7 @@ func (c *ChainFork) PreUpgradeActorsV13(ctx context.Context, UpgradeEpoch: c.forkUpgrade.UpgradeDragonHeight, } - _, err = c.upgradeActorsV13Common(ctx, cache, lbRoot, epoch, lbts, config) + _, err = c.upgradeActorsV13Common(ctx, cache, lbRoot, epoch, config) return err } @@ -2882,7 +2896,7 @@ func (c *ChainFork) UpgradeActorsV13(ctx context.Context, ProgressLogPeriod: 10 * time.Second, UpgradeEpoch: c.forkUpgrade.UpgradeDragonHeight, } - newRoot, err := c.upgradeActorsV13Common(ctx, cache, root, epoch, ts, config) + newRoot, err := c.upgradeActorsV13Common(ctx, cache, root, epoch, config) if err != nil { return cid.Undef, fmt.Errorf("migrating actors v11 state: %w", err) } @@ -2893,7 +2907,6 @@ func (c *ChainFork) upgradeActorsV13Common(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, - ts *types.TipSet, config migration.Config, ) (cid.Cid, error) { writeStore := blockstoreutil.NewAutobatch(ctx, c.bs, units.GiB/4) @@ -2917,16 +2930,56 @@ func (c *ChainFork) upgradeActorsV13Common(ctx context.Context, ) } - manifest, ok := actors.GetManifest(actorstypes.Version13) - if !ok { - return cid.Undef, fmt.Errorf("no manifest CID for v13 upgrade") + // check whether or not this is a calibnet upgrade + // we do this because calibnet upgraded to a "wrong" actors bundle, which was then corrected + // we thus upgrade to calibrationnet-buggy in this upgrade + actorsIn, err := vmstate.LoadState(ctx, adtStore, root) + if err != nil { + return cid.Undef, fmt.Errorf("loading state tree: %w", err) + } + + initActor, found, err := actorsIn.GetActor(ctx, builtin.InitActorAddr) + if err != nil { + return cid.Undef, fmt.Errorf("failed to get system actor: %w", err) + } + if !found { + return cid.Undef, fmt.Errorf("failed to find system actor") + } + + var initState init12.State + if err := adtStore.Get(ctx, initActor.Head, &initState); err != nil { + return cid.Undef, fmt.Errorf("failed to get system actor state: %w", err) + } + + var manifestCid cid.Cid + if initState.NetworkName == "calibrationnet" { + embedded, ok := actors.GetEmbeddedBuiltinActorsBundle(actorstypes.Version13, calibnetv13BuggyBundleSuffix1) + if !ok { + return cid.Undef, fmt.Errorf("didn't find buggy calibrationnet bundle") + } + + var err error + manifestCid, err = actors.LoadBundle(ctx, writeStore, bytes.NewReader(embedded)) + if err != nil { + return cid.Undef, fmt.Errorf("failed to load buggy calibnet bundle: %w", err) + } + + if manifestCid != calibnetv13BuggyManifestCID1 { + return cid.Undef, fmt.Errorf("didn't find expected buggy calibnet bundle manifest: %s != %s", manifestCid, calibnetv13BuggyManifestCID1) + } + } else { + ok := false + manifestCid, ok = actors.GetManifest(actorstypes.Version13) + if !ok { + return cid.Undef, fmt.Errorf("no manifest CID for v13 upgrade") + } } // Perform the migration - newHamtRoot, err := nv22.MigrateStateTree(ctx, adtStore, manifest, stateRoot.Actors, epoch, config, + newHamtRoot, err := nv22.MigrateStateTree(ctx, adtStore, manifestCid, stateRoot.Actors, epoch, config, migrationLogger{}, cache) if err != nil { - return cid.Undef, fmt.Errorf("upgrading to actors v11: %w", err) + return cid.Undef, fmt.Errorf("upgrading to actors v13: %w", err) } // Persist the result. @@ -3114,6 +3167,169 @@ func (c *ChainFork) buildUpgradeActorsV12MinerFix(oldBuggyMinerCID, newManifestC } } +// //////////////////// +func (c *ChainFork) upgradeActorsV13VerifregFix(oldBuggyVerifregCID, newManifestCID cid.Cid) func(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet) (cid.Cid, error) { + return func(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet) (cid.Cid, error) { + stateStore := c.bs + adtStore := adt.WrapStore(ctx, cbor.NewCborStore(stateStore)) + + // ensure that the manifest is loaded in the blockstore + + // this loads the "correct" bundle for UpgradeCalibrationDragonFixHeight + if err := actors.LoadBundles(ctx, stateStore, actorstypes.Version13); err != nil { + return cid.Undef, fmt.Errorf("failed to load manifest bundle: %w", err) + } + + // this loads the buggy bundle, for UpgradeDragonHeight + embedded, ok := actors.GetEmbeddedBuiltinActorsBundle(actorstypes.Version13, calibnetv13BuggyBundleSuffix1) + if !ok { + return cid.Undef, fmt.Errorf("didn't find buggy calibrationnet bundle") + } + + _, err := actors.LoadBundle(ctx, stateStore, bytes.NewReader(embedded)) + if err != nil { + return cid.Undef, fmt.Errorf("failed to load buggy calibnet bundle: %w", err) + } + + // now confirm we have the one we're migrating to + if haveManifest, err := stateStore.Has(ctx, newManifestCID); err != nil { + return cid.Undef, fmt.Errorf("blockstore error when loading manifest %s: %w", newManifestCID, err) + } else if !haveManifest { + return cid.Undef, fmt.Errorf("missing new manifest %s in blockstore", newManifestCID) + } + + // Load input state tree + actorsIn, err := vmstate.LoadState(ctx, adtStore, root) + if err != nil { + return cid.Undef, fmt.Errorf("loading state tree: %w", err) + } + + // load old manifest data + systemActor, found, err := actorsIn.GetActor(ctx, builtin.SystemActorAddr) + if err != nil { + return cid.Undef, fmt.Errorf("failed to get system actor: %w", err) + } + if !found { + return cid.Undef, fmt.Errorf("failed to find system actor") + } + + var systemState system12.State + if err := adtStore.Get(ctx, systemActor.Head, &systemState); err != nil { + return cid.Undef, fmt.Errorf("failed to get system actor state: %w", err) + } + + var oldManifestData manifest.ManifestData + if err := adtStore.Get(ctx, systemState.BuiltinActors, &oldManifestData); err != nil { + return cid.Undef, fmt.Errorf("failed to get old manifest data: %w", err) + } + + // load new manifest + var newManifest manifest.Manifest + if err := adtStore.Get(ctx, newManifestCID, &newManifest); err != nil { + return cid.Undef, fmt.Errorf("error reading actor manifest: %w", err) + } + + if err := newManifest.Load(ctx, adtStore); err != nil { + return cid.Undef, fmt.Errorf("error loading actor manifest: %w", err) + } + + // build the CID mapping + codeMapping := make(map[cid.Cid]cid.Cid, len(oldManifestData.Entries)) + for _, oldEntry := range oldManifestData.Entries { + newCID, ok := newManifest.Get(oldEntry.Name) + if !ok { + return cid.Undef, fmt.Errorf("missing manifest entry for %s", oldEntry.Name) + } + + // Note: we expect newCID to be the same as oldEntry.Code for all actors except the verifreg actor + codeMapping[oldEntry.Code] = newCID + } + + // Create empty actorsOut + + actorsOut, err := vmstate.NewState(adtStore, actorsIn.Version()) + if err != nil { + return cid.Undef, fmt.Errorf("failed to create new tree: %w", err) + } + + // Perform the migration + err = actorsIn.ForEach(func(a address.Address, actor *types.Actor) error { + newCid, ok := codeMapping[actor.Code] + if !ok { + return fmt.Errorf("didn't find mapping for %s", actor.Code) + } + + return actorsOut.SetActor(ctx, a, &types.Actor{ + Code: newCid, + Head: actor.Head, + Nonce: actor.Nonce, + Balance: actor.Balance, + Address: actor.Address, + }) + }) + if err != nil { + return cid.Undef, fmt.Errorf("failed to perform migration: %w", err) + } + + systemState.BuiltinActors = newManifest.Data + newSystemHead, err := adtStore.Put(ctx, &systemState) + if err != nil { + return cid.Undef, fmt.Errorf("failed to put new system state: %w", err) + } + + systemActor.Head = newSystemHead + if err = actorsOut.SetActor(ctx, builtin.SystemActorAddr, systemActor); err != nil { + return cid.Undef, fmt.Errorf("failed to put new system actor: %w", err) + } + + // Sanity checking + + err = actorsIn.ForEach(func(a address.Address, inActor *types.Actor) error { + outActor, found, err := actorsOut.GetActor(ctx, a) + if err != nil { + return fmt.Errorf("failed to get actor in outTree: %w", err) + } + if !found { + return fmt.Errorf("actor %s not found in outTree", a) + } + + if inActor.Nonce != outActor.Nonce { + return fmt.Errorf("mismatched nonce for actor %s", a) + } + + if !inActor.Balance.Equals(outActor.Balance) { + return fmt.Errorf("mismatched balance for actor %s: %d != %d", a, inActor.Balance, outActor.Balance) + } + + if inActor.Address != outActor.Address && inActor.Address.String() != outActor.Address.String() { + return fmt.Errorf("mismatched address for actor %s: %s != %s", a, inActor.Address, outActor.Address) + } + + if inActor.Head != outActor.Head && a != builtin.SystemActorAddr { + return fmt.Errorf("mismatched head for actor %s", a) + } + + // Actor Codes are only expected to change for the verifreg actor + if inActor.Code != oldBuggyVerifregCID && inActor.Code != outActor.Code { + return fmt.Errorf("unexpected change in code for actor %s", a) + } + + return nil + }) + if err != nil { + return cid.Undef, fmt.Errorf("failed to sanity check migration: %w", err) + } + + // Persist the result. + newRoot, err := actorsOut.Flush(ctx) + if err != nil { + return cid.Undef, fmt.Errorf("failed to persist new state root: %w", err) + } + + return newRoot, nil + } +} + func (c *ChainFork) GetForkUpgrade() *config.ForkUpgradeConfig { return c.forkUpgrade } diff --git a/venus-shared/actors/builtin-actors-code/v13.tar.zst b/venus-shared/actors/builtin-actors-code/v13.tar.zst index 1b852decec..12f6215f0e 100644 Binary files a/venus-shared/actors/builtin-actors-code/v13.tar.zst and b/venus-shared/actors/builtin-actors-code/v13.tar.zst differ diff --git a/venus-shared/actors/builtin_actors.go b/venus-shared/actors/builtin_actors.go index 79ca50e6ca..3b6083f891 100644 --- a/venus-shared/actors/builtin_actors.go +++ b/venus-shared/actors/builtin_actors.go @@ -129,6 +129,7 @@ func loadManifests(netw string) error { if NetworkBundle == "calibrationnet" { AddActorMeta("storageminer", cid.MustParse("bafk2bzacecnh2ouohmonvebq7uughh4h3ppmg4cjsk74dzxlbbtlcij4xbzxq"), actorstypes.Version12) AddActorMeta("storageminer", cid.MustParse("bafk2bzaced7emkbbnrewv5uvrokxpf5tlm4jslu2jsv77ofw2yqdglg657uie"), actorstypes.Version12) + AddActorMeta("verifiedregistry", cid.MustParse("bafk2bzacednskl3bykz5qpo54z2j2p4q44t5of4ktd6vs6ymmg2zebsbxazkm"), actorstypes.Version13) } return nil @@ -227,7 +228,8 @@ func readEmbeddedBuiltinActorsMetadata(bundle string) ([]*BuiltinActorsMetadata, // The following manifest cids existed temporarily on the calibnet testnet // We include them in our builtin bundle, but intentionally omit from metadata if root == cid.MustParse("bafy2bzacedrunxfqta5skb7q7x32lnp4efz2oq7fn226ffm7fu5iqs62jkmvs") || - root == cid.MustParse("bafy2bzacebl4w5ptfvuw6746w7ev562idkbf5ppq72e6zub22435ws2rukzru") { + root == cid.MustParse("bafy2bzacebl4w5ptfvuw6746w7ev562idkbf5ppq72e6zub22435ws2rukzru") || + root == cid.MustParse("bafy2bzacea4firkyvt2zzdwqjrws5pyeluaesh6uaid246tommayr4337xpmi") { continue } bundles = append(bundles, &BuiltinActorsMetadata{ diff --git a/venus-shared/actors/builtin_actors_gen.go b/venus-shared/actors/builtin_actors_gen.go index def4dd5647..280fb1dcdc 100644 --- a/venus-shared/actors/builtin_actors_gen.go +++ b/venus-shared/actors/builtin_actors_gen.go @@ -249,7 +249,7 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet Network: "calibrationnet", Version: 13, - ManifestCid: mustParseCid("bafy2bzacea4firkyvt2zzdwqjrws5pyeluaesh6uaid246tommayr4337xpmi"), + ManifestCid: mustParseCid("bafy2bzacect4ktyujrwp6mjlsitnpvuw2pbuppz6w52sfljyo4agjevzm75qs"), Actors: map[string]cid.Cid{ "account": mustParseCid("bafk2bzaceb3j36ri5y5mfklgp5emlvrms6g4733ss2j3l7jismrxq6ng3tcc6"), "cron": mustParseCid("bafk2bzaceaz6rocamdxehgpwcbku6wlapwpgzyyvkrploj66mlqptsulf52bs"), @@ -266,7 +266,7 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet "storageminer": mustParseCid("bafk2bzaceckzw3v7wqliyggvjvihz4wywchnnsie4frfvkm3fm5znb64mofri"), "storagepower": mustParseCid("bafk2bzacea7t4wynzjajl442mpdqbnh3wusjusqtnzgpvefvweh4n2tgzgqhu"), "system": mustParseCid("bafk2bzacedjnrb5glewazsxpcx6rwiuhl4kwrfcqolyprn6rrjtlzmthlhdq6"), - "verifiedregistry": mustParseCid("bafk2bzacednskl3bykz5qpo54z2j2p4q44t5of4ktd6vs6ymmg2zebsbxazkm"), + "verifiedregistry": mustParseCid("bafk2bzacebj2zdquagzy2xxn7up574oemg3w7ed3fe4aujkyhgdwj57voesn2"), }, }, { Network: "caterpillarnet",