Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PVM] Add missing pvm config fields #389

Merged
merged 2 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -823,8 +823,10 @@ func (n *Node) initVMs() error {
CortinaTime: version.GetCortinaTime(n.Config.NetworkID),
AthensPhaseTime: version.GetAthensPhaseTime(n.Config.NetworkID),
BerlinPhaseTime: version.GetBerlinPhaseTime(n.Config.NetworkID),
CairoPhaseTime: version.GetCairoPhaseTime(n.Config.NetworkID),
MinPercentConnectedStakeHealthy: n.Config.MinPercentConnectedStakeHealthy,
UseCurrentHeight: n.Config.UseCurrentHeight,
CaminoConfig: n.Config.CaminoConfig,
},
}),
vmRegisterer.Register(context.TODO(), constants.AVMID, &avm.Factory{
Expand Down
33 changes: 23 additions & 10 deletions version/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,12 @@ var (
constants.CaminoID: unreachableFutureTime,
}
CortinaDefaultTime = time.Date(2020, time.December, 5, 5, 0, 0, 0, time.UTC)

CairoPhaseTimes = map[uint32]time.Time{
constants.KopernikusID: unreachableFutureTime,
constants.ColumbusID: unreachableFutureTime,
constants.CaminoID: unreachableFutureTime,
}
)

func init() {
Expand Down Expand Up @@ -256,13 +262,6 @@ func GetApricotPhase5Time(networkID uint32) time.Time {
return ApricotPhase5DefaultTime
}

func GetSunrisePhase0Time(networkID uint32) time.Time {
if upgradeTime, exists := SunrisePhase0Times[networkID]; exists {
return upgradeTime
}
return DefaultUpgradeTime
}

func GetApricotPhase6Time(networkID uint32) time.Time {
if upgradeTime, exists := ApricotPhase6Times[networkID]; exists {
return upgradeTime
Expand All @@ -277,6 +276,20 @@ func GetBanffTime(networkID uint32) time.Time {
return BanffDefaultTime
}

func GetCortinaTime(networkID uint32) time.Time {
if upgradeTime, exists := CortinaTimes[networkID]; exists {
return upgradeTime
}
return CortinaDefaultTime
}

func GetSunrisePhase0Time(networkID uint32) time.Time {
if upgradeTime, exists := SunrisePhase0Times[networkID]; exists {
return upgradeTime
}
return DefaultUpgradeTime
}

func GetAthensPhaseTime(networkID uint32) time.Time {
if upgradeTime, exists := AthensPhaseTimes[networkID]; exists {
return upgradeTime
Expand All @@ -291,11 +304,11 @@ func GetBerlinPhaseTime(networkID uint32) time.Time {
return DefaultUpgradeTime
}

func GetCortinaTime(networkID uint32) time.Time {
if upgradeTime, exists := CortinaTimes[networkID]; exists {
func GetCairoPhaseTime(networkID uint32) time.Time {
if upgradeTime, exists := CairoPhaseTimes[networkID]; exists {
return upgradeTime
}
return CortinaDefaultTime
return DefaultUpgradeTime
}

func GetCompatibility(networkID uint32) Compatibility {
Expand Down
Loading