Skip to content

Commit 99d2b9a

Browse files
Disable Etna by default on local networks (#3364)
Co-authored-by: Ceyhun Onur <ceyhun.onur@avalabs.org>
1 parent 878a6ce commit 99d2b9a

File tree

3 files changed

+5
-17
lines changed

3 files changed

+5
-17
lines changed

snow/snowtest/context.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
"github.com/ava-labs/avalanchego/ids"
1616
"github.com/ava-labs/avalanchego/snow"
1717
"github.com/ava-labs/avalanchego/snow/validators/validatorstest"
18-
"github.com/ava-labs/avalanchego/upgrade"
18+
"github.com/ava-labs/avalanchego/upgrade/upgradetest"
1919
"github.com/ava-labs/avalanchego/utils/constants"
2020
"github.com/ava-labs/avalanchego/utils/crypto/bls"
2121
"github.com/ava-labs/avalanchego/utils/logging"
@@ -84,7 +84,7 @@ func Context(tb testing.TB, chainID ids.ID) *snow.Context {
8484
ChainID: chainID,
8585
NodeID: ids.EmptyNodeID,
8686
PublicKey: publicKey,
87-
NetworkUpgrades: upgrade.Default,
87+
NetworkUpgrades: upgradetest.GetConfig(upgradetest.Latest),
8888

8989
XChainID: XChainID,
9090
CChainID: CChainID,

tests/upgrade/upgrade_test.go

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,15 @@
44
package upgrade
55

66
import (
7-
"encoding/base64"
8-
"encoding/json"
97
"flag"
108
"fmt"
119
"testing"
1210

1311
"github.com/onsi/ginkgo/v2"
1412
"github.com/stretchr/testify/require"
1513

16-
"github.com/ava-labs/avalanchego/config"
1714
"github.com/ava-labs/avalanchego/tests/fixture/e2e"
1815
"github.com/ava-labs/avalanchego/tests/fixture/tmpnet"
19-
"github.com/ava-labs/avalanchego/upgrade/upgradetest"
2016
)
2117

2218
func TestUpgrade(t *testing.T) {
@@ -55,16 +51,6 @@ var _ = ginkgo.Describe("[Upgrade]", func() {
5551
require.NoError(err)
5652
network.Genesis = genesis
5753

58-
// Configure network upgrade flag
59-
latestUnscheduled := upgradetest.GetConfig(upgradetest.Latest - 1)
60-
upgradeJSON, err := json.Marshal(latestUnscheduled)
61-
require.NoError(err)
62-
upgradeBase64 := base64.StdEncoding.EncodeToString(upgradeJSON)
63-
if network.DefaultFlags == nil {
64-
network.DefaultFlags = tmpnet.FlagsMap{}
65-
}
66-
network.DefaultFlags[config.UpgradeFileContentKey] = upgradeBase64
67-
6854
e2e.StartNetwork(tc, network, avalancheGoExecPath, "" /* pluginDir */, 0 /* shutdownDelay */, false /* reuseNetwork */)
6955

7056
tc.By(fmt.Sprintf("restarting all nodes with %q binary", avalancheGoExecPathToUpgradeTo))

upgrade/upgrade.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@ var (
7070
CortinaTime: InitiallyActiveTime,
7171
CortinaXChainStopVertexID: ids.Empty,
7272
DurangoTime: InitiallyActiveTime,
73-
EtnaTime: InitiallyActiveTime,
73+
// Etna is left unactivated by default on local networks. It can be configured to
74+
// activate by overriding the activation time in the upgrade file.
75+
EtnaTime: UnscheduledActivationTime,
7476
}
7577

7678
ErrInvalidUpgradeTimes = errors.New("invalid upgrade configuration")

0 commit comments

Comments
 (0)