Skip to content

Commit

Permalink
Disable Etna by default on local networks (#3364)
Browse files Browse the repository at this point in the history
Co-authored-by: Ceyhun Onur <[email protected]>
  • Loading branch information
michaelkaplan13 and ceyonur authored Sep 11, 2024
1 parent 878a6ce commit 99d2b9a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 17 deletions.
4 changes: 2 additions & 2 deletions snow/snowtest/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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,
Expand Down
14 changes: 0 additions & 14 deletions tests/upgrade/upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,15 @@
package upgrade

import (
"encoding/base64"
"encoding/json"
"flag"
"fmt"
"testing"

"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) {
Expand Down Expand Up @@ -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))
Expand Down
4 changes: 3 additions & 1 deletion upgrade/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 99d2b9a

Please sign in to comment.