From 5ccd9c324fb3777c2c1a779a728c178a29539ef2 Mon Sep 17 00:00:00 2001 From: Stephen Buttolph Date: Mon, 12 Feb 2024 17:49:41 -0500 Subject: [PATCH] signal ACPs scheduled by the node --- config/config.go | 8 ++++++++ utils/constants/acps.go | 37 +++++++++++++++++++++++++------------ 2 files changed, 33 insertions(+), 12 deletions(-) diff --git a/config/config.go b/config/config.go index 8e85947f022..ed202465b2d 100644 --- a/config/config.go +++ b/config/config.go @@ -94,6 +94,7 @@ var ( } errConflictingACPOpinion = errors.New("supporting and objecting to the same ACP") + errConflictingImplicitACPOpinion = errors.New("objecting to enabled ACP") errSybilProtectionDisabledStakerWeights = errors.New("sybil protection disabled weights must be positive") errSybilProtectionDisabledOnPublicNetwork = errors.New("sybil protection disabled on public network") errAuthPasswordTooWeak = errors.New("API auth password is not strong enough") @@ -379,6 +380,13 @@ func getNetworkConfig( if supportedACPs.Overlaps(objectedACPs) { return network.Config{}, errConflictingACPOpinion } + if constants.ScheduledACPs.Overlaps(objectedACPs) { + return network.Config{}, errConflictingImplicitACPOpinion + } + + // Because this node version has scheduled these ACPs, we should notify + // peers that we support these upgrades. + supportedACPs.Union(constants.ScheduledACPs) config := network.Config{ ThrottlerConfig: network.ThrottlerConfig{ diff --git a/utils/constants/acps.go b/utils/constants/acps.go index db849bfbcd1..5392b21865a 100644 --- a/utils/constants/acps.go +++ b/utils/constants/acps.go @@ -5,16 +5,29 @@ package constants import "github.com/ava-labs/avalanchego/utils/set" -// CurrentACPs is the set of ACPs that are currently, at the time of release, -// marked as implementable and not activated. -// -// See: https://github.com/orgs/avalanche-foundation/projects/1 -var CurrentACPs = set.Of[uint32]( - 23, // https://github.com/avalanche-foundation/ACPs/blob/main/ACPs/23-p-chain-native-transfers.md - 24, // https://github.com/avalanche-foundation/ACPs/blob/main/ACPs/24-shanghai-eips.md - 25, // https://github.com/avalanche-foundation/ACPs/blob/main/ACPs/25-vm-application-errors.md - 30, // https://github.com/avalanche-foundation/ACPs/blob/main/ACPs/30-avalanche-warp-x-evm.md - 31, // https://github.com/avalanche-foundation/ACPs/blob/main/ACPs/31-enable-subnet-ownership-transfer.md - 41, // https://github.com/avalanche-foundation/ACPs/blob/main/ACPs/41-remove-pending-stakers.md - 62, // https://github.com/avalanche-foundation/ACPs/blob/main/ACPs/62-disable-addvalidatortx-and-adddelegatortx.md +var ( + // CurrentACPs is the set of ACPs that are currently, at the time of + // release, marked as implementable and not activated. + // + // See: https://github.com/orgs/avalanche-foundation/projects/1 + CurrentACPs = set.Of[uint32]( + 23, // https://github.com/avalanche-foundation/ACPs/blob/main/ACPs/23-p-chain-native-transfers.md + 24, // https://github.com/avalanche-foundation/ACPs/blob/main/ACPs/24-shanghai-eips.md + 25, // https://github.com/avalanche-foundation/ACPs/blob/main/ACPs/25-vm-application-errors.md + 30, // https://github.com/avalanche-foundation/ACPs/blob/main/ACPs/30-avalanche-warp-x-evm.md + 31, // https://github.com/avalanche-foundation/ACPs/blob/main/ACPs/31-enable-subnet-ownership-transfer.md + 41, // https://github.com/avalanche-foundation/ACPs/blob/main/ACPs/41-remove-pending-stakers.md + 62, // https://github.com/avalanche-foundation/ACPs/blob/main/ACPs/62-disable-addvalidatortx-and-adddelegatortx.md + ) + + // ScheduledACPs are the ACPs incuded into the next upgrade. + ScheduledACPs = set.Of[uint32]( + 23, // https://github.com/avalanche-foundation/ACPs/blob/main/ACPs/23-p-chain-native-transfers.md + 24, // https://github.com/avalanche-foundation/ACPs/blob/main/ACPs/24-shanghai-eips.md + 25, // https://github.com/avalanche-foundation/ACPs/blob/main/ACPs/25-vm-application-errors.md + 30, // https://github.com/avalanche-foundation/ACPs/blob/main/ACPs/30-avalanche-warp-x-evm.md + 31, // https://github.com/avalanche-foundation/ACPs/blob/main/ACPs/31-enable-subnet-ownership-transfer.md + 41, // https://github.com/avalanche-foundation/ACPs/blob/main/ACPs/41-remove-pending-stakers.md + 62, // https://github.com/avalanche-foundation/ACPs/blob/main/ACPs/62-disable-addvalidatortx-and-adddelegatortx.md + ) )