diff --git a/snow/snowtest/context.go b/snow/snowtest/context.go index 734c120e556d..edeefe89c8ec 100644 --- a/snow/snowtest/context.go +++ b/snow/snowtest/context.go @@ -15,7 +15,7 @@ import ( "github.com/ava-labs/avalanchego/ids" "github.com/ava-labs/avalanchego/snow" "github.com/ava-labs/avalanchego/snow/validators/validatorstest" - "github.com/ava-labs/avalanchego/upgrade" + "github.com/ava-labs/avalanchego/upgrade/upgradetest" "github.com/ava-labs/avalanchego/utils/constants" "github.com/ava-labs/avalanchego/utils/crypto/bls" "github.com/ava-labs/avalanchego/utils/logging" @@ -84,7 +84,7 @@ func Context(tb testing.TB, chainID ids.ID) *snow.Context { ChainID: chainID, NodeID: ids.EmptyNodeID, PublicKey: publicKey, - NetworkUpgrades: upgrade.Default, + NetworkUpgrades: upgradetest.GetConfig(upgradetest.Latest), XChainID: XChainID, CChainID: CChainID, diff --git a/tests/upgrade/upgrade_test.go b/tests/upgrade/upgrade_test.go index 48bcc8b57c9d..4c0d8fbe79fd 100644 --- a/tests/upgrade/upgrade_test.go +++ b/tests/upgrade/upgrade_test.go @@ -4,8 +4,6 @@ package upgrade import ( - "encoding/base64" - "encoding/json" "flag" "fmt" "testing" @@ -13,10 +11,8 @@ import ( "github.com/onsi/ginkgo/v2" "github.com/stretchr/testify/require" - "github.com/ava-labs/avalanchego/config" "github.com/ava-labs/avalanchego/tests/fixture/e2e" "github.com/ava-labs/avalanchego/tests/fixture/tmpnet" - "github.com/ava-labs/avalanchego/upgrade/upgradetest" ) func TestUpgrade(t *testing.T) { @@ -55,16 +51,6 @@ var _ = ginkgo.Describe("[Upgrade]", func() { require.NoError(err) network.Genesis = genesis - // Configure network upgrade flag - latestUnscheduled := upgradetest.GetConfig(upgradetest.Latest - 1) - upgradeJSON, err := json.Marshal(latestUnscheduled) - require.NoError(err) - upgradeBase64 := base64.StdEncoding.EncodeToString(upgradeJSON) - if network.DefaultFlags == nil { - network.DefaultFlags = tmpnet.FlagsMap{} - } - network.DefaultFlags[config.UpgradeFileContentKey] = upgradeBase64 - e2e.StartNetwork(tc, network, avalancheGoExecPath, "" /* pluginDir */, 0 /* shutdownDelay */, false /* reuseNetwork */) tc.By(fmt.Sprintf("restarting all nodes with %q binary", avalancheGoExecPathToUpgradeTo)) diff --git a/upgrade/upgrade.go b/upgrade/upgrade.go index fc1f55359a48..21e404ffb3f4 100644 --- a/upgrade/upgrade.go +++ b/upgrade/upgrade.go @@ -70,7 +70,9 @@ var ( CortinaTime: InitiallyActiveTime, CortinaXChainStopVertexID: ids.Empty, DurangoTime: InitiallyActiveTime, - EtnaTime: InitiallyActiveTime, + // Etna is left unactivated by default on local networks. It can be configured to + // activate by overriding the activation time in the upgrade file. + EtnaTime: UnscheduledActivationTime, } ErrInvalidUpgradeTimes = errors.New("invalid upgrade configuration")