Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Disable Etna by default on local networks #3364

Merged
merged 4 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading