2d57bfe273
* Use local GST Use local GST * Import actors and define upgrade heights Creatin a mock actor-bundle and define upgrade heights * Generate adapters Updates gen/inlinegen-data.json, and runs make actors-gen * Add schedule and migration Add schedule and migration * Add upgrade and network version fields/params Add upgrade and network version fields/params * Run make gen / make docsgen-cli Run make gen / make docsgen-cli * Update filecoin-ffi Update filecoin-ffi to the v1.28.0-dev tag, which supports the nv23 skeleton. * Update GST to v0.14.0-dev Update GST to v0.14.0-dev, which includes the nv23 skeleton * Add support for actor version 14 in actor registry Add support for actor version 14 in actor registry
47 lines
1.2 KiB
Go
47 lines
1.2 KiB
Go
package kit
|
|
|
|
import (
|
|
"github.com/filecoin-project/go-state-types/abi"
|
|
"github.com/filecoin-project/go-state-types/network"
|
|
|
|
"github.com/filecoin-project/lotus/chain/consensus/filcns"
|
|
"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 LatestActorsAt(upgradeHeight abi.ChainEpoch) EnsembleOpt {
|
|
/* 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 */
|
|
return UpgradeSchedule(stmgr.Upgrade{
|
|
Network: network.Version22,
|
|
Height: -1,
|
|
}, stmgr.Upgrade{
|
|
Network: network.Version23,
|
|
Height: upgradeHeight,
|
|
Migration: filcns.UpgradeActorsV14,
|
|
})
|
|
/* inline-gen end */
|
|
}
|