2020-10-13 22:00:01 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/filecoin-project/go-state-types/abi"
|
|
|
|
|
|
|
|
"github.com/filecoin-project/lotus/build"
|
|
|
|
)
|
|
|
|
|
|
|
|
// ProtocolCodenames is a table that summarises the protocol codenames that
|
|
|
|
// will be set on extracted vectors, depending on the original execution height.
|
|
|
|
//
|
|
|
|
// Implementers rely on these names to filter the vectors they can run through
|
|
|
|
// their implementations, based on their support level
|
|
|
|
var ProtocolCodenames = []struct {
|
|
|
|
firstEpoch abi.ChainEpoch
|
|
|
|
name string
|
|
|
|
}{
|
|
|
|
{0, "genesis"},
|
|
|
|
{build.UpgradeBreezeHeight + 1, "breeze"},
|
|
|
|
{build.UpgradeSmokeHeight + 1, "smoke"},
|
|
|
|
{build.UpgradeIgnitionHeight + 1, "ignition"},
|
|
|
|
{build.UpgradeRefuelHeight + 1, "refuel"},
|
2021-05-06 05:44:11 +00:00
|
|
|
{build.UpgradeAssemblyHeight + 1, "actorsv2"},
|
2020-10-13 22:00:01 +00:00
|
|
|
{build.UpgradeTapeHeight + 1, "tape"},
|
|
|
|
{build.UpgradeLiftoffHeight + 1, "liftoff"},
|
2020-10-17 00:35:46 +00:00
|
|
|
{build.UpgradeKumquatHeight + 1, "postliftoff"},
|
2020-10-13 22:00:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// GetProtocolCodename gets the protocol codename associated with a height.
|
|
|
|
func GetProtocolCodename(height abi.ChainEpoch) string {
|
|
|
|
for i, v := range ProtocolCodenames {
|
|
|
|
if height < v.firstEpoch {
|
|
|
|
// found the cutoff, return previous.
|
|
|
|
return ProtocolCodenames[i-1].name
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return ProtocolCodenames[len(ProtocolCodenames)-1].name
|
|
|
|
}
|