2021-08-06 00:46:05 +00:00
|
|
|
package kit
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/filecoin-project/go-state-types/abi"
|
|
|
|
"github.com/filecoin-project/go-state-types/network"
|
2021-09-02 16:07:23 +00:00
|
|
|
|
|
|
|
"github.com/filecoin-project/lotus/chain/consensus/filcns"
|
2021-08-06 00:46:05 +00:00
|
|
|
"github.com/filecoin-project/lotus/chain/stmgr"
|
|
|
|
)
|
|
|
|
|
|
|
|
func UpgradeSchedule(upgrades ...stmgr.Upgrade) EnsembleOpt {
|
|
|
|
return func(opts *ensembleOpts) error {
|
|
|
|
opts.upgradeSchedule = upgrades
|
|
|
|
return opts.upgradeSchedule.Validate()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// GenesisNetworkVersion sets the network version of genesis.
|
|
|
|
func GenesisNetworkVersion(nv network.Version) EnsembleOpt {
|
|
|
|
return UpgradeSchedule(stmgr.Upgrade{
|
|
|
|
Network: nv,
|
|
|
|
Height: -1,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
func SDRUpgradeAt(calico, persian abi.ChainEpoch) EnsembleOpt {
|
|
|
|
return UpgradeSchedule(stmgr.Upgrade{
|
|
|
|
Network: network.Version6,
|
|
|
|
Height: -1,
|
|
|
|
}, stmgr.Upgrade{
|
|
|
|
Network: network.Version7,
|
|
|
|
Height: calico,
|
2022-04-12 07:37:48 +00:00
|
|
|
Migration: filcns.UpgradeCalico,
|
2021-08-06 00:46:05 +00:00
|
|
|
}, stmgr.Upgrade{
|
|
|
|
Network: network.Version8,
|
|
|
|
Height: persian,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
func LatestActorsAt(upgradeHeight abi.ChainEpoch) EnsembleOpt {
|
2023-03-29 16:05:42 +00:00
|
|
|
// TODO: nv19: Re-enable when migration is setup
|
|
|
|
///* inline-gen template
|
|
|
|
// return UpgradeSchedule(stmgr.Upgrade{
|
|
|
|
// Network: network.Version{{add .latestNetworkVersion -1}},
|
|
|
|
// Height: -1,
|
|
|
|
// }, stmgr.Upgrade{
|
|
|
|
// Network: network.Version{{.latestNetworkVersion}},
|
|
|
|
// Height: upgradeHeight,
|
|
|
|
// Migration: filcns.UpgradeActorsV{{.latestActorsVersion}},
|
|
|
|
// })
|
|
|
|
///* inline-gen start */
|
2021-08-06 00:46:05 +00:00
|
|
|
return UpgradeSchedule(stmgr.Upgrade{
|
2022-11-08 05:53:13 +00:00
|
|
|
Network: network.Version17,
|
2021-08-06 00:46:05 +00:00
|
|
|
Height: -1,
|
|
|
|
}, stmgr.Upgrade{
|
2022-11-08 05:53:13 +00:00
|
|
|
Network: network.Version18,
|
2021-08-06 00:46:05 +00:00
|
|
|
Height: upgradeHeight,
|
2022-11-08 05:53:13 +00:00
|
|
|
Migration: filcns.UpgradeActorsV10,
|
2021-08-06 00:46:05 +00:00
|
|
|
})
|
2023-03-29 16:05:42 +00:00
|
|
|
///* inline-gen end */
|
2021-08-06 00:46:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func TurboUpgradeAt(upgradeHeight abi.ChainEpoch) EnsembleOpt {
|
|
|
|
return UpgradeSchedule(stmgr.Upgrade{
|
|
|
|
Network: network.Version11,
|
|
|
|
Height: -1,
|
|
|
|
}, stmgr.Upgrade{
|
|
|
|
Network: network.Version12,
|
|
|
|
Height: upgradeHeight,
|
2022-04-12 07:37:48 +00:00
|
|
|
Migration: filcns.UpgradeActorsV4,
|
2021-08-06 00:46:05 +00:00
|
|
|
})
|
|
|
|
}
|