Skip to content

Commit

Permalink
signal ACPs scheduled by the node
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenButtolph committed Feb 12, 2024
1 parent 185edaa commit 5ccd9c3
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 12 deletions.
8 changes: 8 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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{
Expand Down
37 changes: 25 additions & 12 deletions utils/constants/acps.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
)

0 comments on commit 5ccd9c3

Please sign in to comment.