Skip to content

Commit 795c969

Browse files
committed
Disable add permissionless validator/delegator txs before Cortina time
1 parent 7772edd commit 795c969

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

avalanchego/vms/platformvm/txs/executor/staker_tx_verification.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,18 @@ func verifyAddPermissionlessValidatorTx(
462462
}
463463

464464
currentTimestamp := chainState.GetTimestamp()
465+
if constants.IsFlareNetworkID(backend.Ctx.NetworkID) || constants.IsSgbNetworkID(backend.Ctx.NetworkID) {
466+
// Flare does not allow permissionless validator tx before Cortina
467+
if currentTimestamp.Before(backend.Config.CortinaTime) {
468+
return errWrongTxType
469+
}
470+
471+
// Flare does not allow creation of subnets
472+
if tx.Subnet != constants.PrimaryNetworkID {
473+
return errWrongTxType
474+
}
475+
}
476+
465477
// Ensure the proposed validator starts after the current time
466478
startTime := tx.StartTime()
467479
if !currentTimestamp.Before(startTime) {
@@ -643,6 +655,11 @@ func verifyAddPermissionlessDelegatorTx(
643655
}
644656

645657
currentTimestamp := chainState.GetTimestamp()
658+
// Flare does not allow permissionless delegator tx before Cortina
659+
if currentTimestamp.Before(backend.Config.CortinaTime) && (constants.IsFlareNetworkID(backend.Ctx.NetworkID) || constants.IsSgbNetworkID(backend.Ctx.NetworkID)) {
660+
return errWrongTxType
661+
}
662+
646663
// Ensure the proposed validator starts after the current timestamp
647664
startTime := tx.StartTime()
648665
if !currentTimestamp.Before(startTime) {

0 commit comments

Comments
 (0)