Skip to content
Closed
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
5 changes: 3 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# https://golangci-lint.run/usage/configuration/
run:
go: "1.21.7"
go: "1.23.7"
timeout: 10m

issues:
Expand All @@ -19,7 +19,7 @@ linters:
- depguard
- errcheck
- errorlint
- exportloopref
- copyloopvar
- goconst
- gocritic
- gofmt
Expand Down Expand Up @@ -105,6 +105,7 @@ linters-settings:
excludes:
- G107 # https://securego.io/docs/rules/g107.html
- G204
- G115 # TODO: include it again
depguard:
rules:
packages:
Expand Down
6 changes: 5 additions & 1 deletion cmd/blockchaincmd/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,11 @@ func deployBlockchain(cmd *cobra.Command, args []string) error {
}

ux.Logger.PrintToUser("Deploying %s to %s", chains, network.Name())

if network.Kind != models.Fuji {
ux.Logger.PrintToUser("This version of Avalanche-CLI is only meant for Fuji deployments. To deploy in other networks, please use v1.8.8-rc4")
ux.Logger.PrintToUser("curl -sSfL https://raw.githubusercontent.com/ava-labs/avalanche-cli/main/scripts/install.sh | sh -s v1.8.8-rc4")
return nil
}
if network.Kind == models.Fuji && userProvidedAvagoVersion == constants.DefaultAvalancheGoVersion {
latestAvagoVersion, err := app.Downloader.GetLatestReleaseVersion(
constants.AvaLabsOrg,
Expand Down
2 changes: 1 addition & 1 deletion cmd/networkcmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ already running.`,
cmd.Flags().StringVar(
&startFlags.UserProvidedAvagoVersion,
"avalanchego-version",
constants.DefaultAvalancheGoVersion,
constants.FujiAvalancheGoV113,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is for local network, not needed imo since we only need for fuji

"use this version of avalanchego (ex: v1.17.12)",
)
cmd.Flags().StringVar(&startFlags.AvagoBinaryPath, "avalanchego-path", "", "use this avalanchego binary path")
Expand Down
9 changes: 4 additions & 5 deletions cmd/nodecmd/create_devnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
_ "embed"
"encoding/json"
"fmt"
"github.com/ava-labs/avalanchego/utils/crypto/bls/signer/localsigner"
"math/big"
"os"
"path/filepath"
Expand All @@ -15,25 +14,25 @@ import (
"sync"
"time"

"github.com/ava-labs/avalanche-cli/pkg/node"

"golang.org/x/exp/slices"

"github.com/ava-labs/avalanche-cli/pkg/ansible"
"github.com/ava-labs/avalanche-cli/pkg/constants"
"github.com/ava-labs/avalanche-cli/pkg/key"
"github.com/ava-labs/avalanche-cli/pkg/models"
"github.com/ava-labs/avalanche-cli/pkg/node"
"github.com/ava-labs/avalanche-cli/pkg/ssh"
"github.com/ava-labs/avalanche-cli/pkg/utils"
"github.com/ava-labs/avalanche-cli/pkg/ux"
"github.com/ava-labs/avalanchego/config"
avago_upgrade "github.com/ava-labs/avalanchego/upgrade"
avago_constants "github.com/ava-labs/avalanchego/utils/constants"
"github.com/ava-labs/avalanchego/utils/crypto/bls/signer/localsigner"
"github.com/ava-labs/avalanchego/utils/formatting"
"github.com/ava-labs/avalanchego/utils/logging"
"github.com/ava-labs/avalanchego/vms/platformvm/signer"
coreth_params "github.com/ava-labs/coreth/params"

"golang.org/x/exp/maps"
"golang.org/x/exp/slices"
)

// difference between unlock schedule locktime and startime in original genesis
Expand Down
2 changes: 1 addition & 1 deletion cmd/nodecmd/dynamic_ips.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func updatePublicIPs(clusterName string) error {
changed++
}
node.ElasticIP = publicIPMap[node.NodeID]
if err := app.CreateNodeCloudConfigFile(node.NodeID, &node); err != nil { //nolint:gosec
if err := app.CreateNodeCloudConfigFile(node.NodeID, &node); err != nil {
return err
}
}
Expand Down
6 changes: 5 additions & 1 deletion cmd/nodecmd/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,11 @@ func localStartNode(_ *cobra.Command, args []string) error {
if err != nil {
return err
}

if network.Kind != models.Fuji {
ux.Logger.PrintToUser("This version of Avalanche-CLI is only meant for Fuji deployments. To deploy in other networks, please use v1.8.8-rc4")
ux.Logger.PrintToUser("curl -sSfL https://raw.githubusercontent.com/ava-labs/avalanche-cli/main/scripts/install.sh | sh -s v1.8.8-rc4")
return nil
}
// TODO: remove this check for releases above v1.8.7, once v1.13.0-fuji avalanchego is latest release
if network.Kind == models.Fuji && useCustomAvalanchegoVersion == "" {
latestAvagoVersion, err := app.Downloader.GetLatestReleaseVersion(
Expand Down
6 changes: 3 additions & 3 deletions cmd/nodecmd/validate_primary.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,26 @@ package nodecmd
import (
"errors"
"fmt"
"github.com/ava-labs/avalanchego/utils/crypto/bls/signer/localsigner"
"os"
"strconv"
"time"

"github.com/ava-labs/avalanche-cli/pkg/node"

blockchaincmd "github.com/ava-labs/avalanche-cli/cmd/blockchaincmd"
"github.com/ava-labs/avalanche-cli/pkg/ansible"
"github.com/ava-labs/avalanche-cli/pkg/cobrautils"
"github.com/ava-labs/avalanche-cli/pkg/constants"
"github.com/ava-labs/avalanche-cli/pkg/keychain"
"github.com/ava-labs/avalanche-cli/pkg/models"
"github.com/ava-labs/avalanche-cli/pkg/node"
"github.com/ava-labs/avalanche-cli/pkg/subnet"
"github.com/ava-labs/avalanche-cli/pkg/utils"
"github.com/ava-labs/avalanche-cli/pkg/ux"
"github.com/ava-labs/avalanchego/ids"
"github.com/ava-labs/avalanchego/utils/crypto/bls/signer/localsigner"
"github.com/ava-labs/avalanchego/utils/units"
"github.com/ava-labs/avalanchego/vms/platformvm"
"github.com/ava-labs/avalanchego/vms/platformvm/signer"

"github.com/spf13/cobra"
"golang.org/x/exp/maps"
)
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ toolchain go1.23.7
require (
github.com/ava-labs/apm v1.0.0
github.com/ava-labs/avalanche-network-runner v1.8.4-0.20250311204312-28fbf1672296
github.com/ava-labs/avalanchego v1.13.0-fuji
github.com/ava-labs/avalanchego v1.13.0-fuji-rc.2.0.20250313194317-c78027fe41c9
github.com/ava-labs/coreth v0.14.1-rc.2
github.com/ava-labs/icm-services v1.4.1-0.20250307175119-828cacec2577
github.com/ava-labs/icm-services v1.4.1-0.20250313194621-b5eac197b0d8
github.com/ava-labs/subnet-evm v0.7.2
github.com/aws/aws-sdk-go-v2 v1.36.3
github.com/aws/aws-sdk-go-v2/config v1.29.8
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,14 @@ github.com/ava-labs/apm v1.0.0 h1:6FwozH67hEkbWVsOXNZGexBy5KLpNeYucN9zcFUHv+Q=
github.com/ava-labs/apm v1.0.0/go.mod h1:TJL7pTlZNvQatsQPsLUtDHApEwVZ/qS7iSNtRFU83mc=
github.com/ava-labs/avalanche-network-runner v1.8.4-0.20250311204312-28fbf1672296 h1:v9FPfHjJXD9940Hz2y18IcajpIWMt4+9erWgJIo8ycg=
github.com/ava-labs/avalanche-network-runner v1.8.4-0.20250311204312-28fbf1672296/go.mod h1:0AWWjy8EHfaIuMAT3EISQdrzJ0FYFmoz+jIK2uK9F2c=
github.com/ava-labs/avalanchego v1.13.0-fuji h1:Z5yelhBYbaCIvpREy7uJdUe2bmplay1oUzcWR0JrtGs=
github.com/ava-labs/avalanchego v1.13.0-fuji/go.mod h1:SE44nLa4/ciLORNa57iqluR5WzVTz9GEegvO3fQrpqA=
github.com/ava-labs/avalanchego v1.13.0-fuji-rc.2.0.20250313194317-c78027fe41c9 h1:utuytofOcrgNs+I1kWP021T0zmey5OXpm3GE0agDcMo=
github.com/ava-labs/avalanchego v1.13.0-fuji-rc.2.0.20250313194317-c78027fe41c9/go.mod h1:SE44nLa4/ciLORNa57iqluR5WzVTz9GEegvO3fQrpqA=
github.com/ava-labs/coreth v0.14.1-rc.2 h1:GRL7bMeNKhz1aNFEPJ3Rcd2Di/RfW8JOK/I9deAr6+0=
github.com/ava-labs/coreth v0.14.1-rc.2/go.mod h1:gIGr+5WDNX1DrFvUMy53AtTpkxlM/8cNOD/PDIChKfM=
github.com/ava-labs/icm-contracts v1.0.9-0.20250307173936-f6a36b902f4f h1:VdYGud8dYi8OOca2IeTjGI9o0S+sjYO0e/DrWw0p6RA=
github.com/ava-labs/icm-contracts v1.0.9-0.20250307173936-f6a36b902f4f/go.mod h1:tCo57ymvTmFJK7+fqotE8ye70UqqHb0RI0o9/NRuBhM=
github.com/ava-labs/icm-services v1.4.1-0.20250307175119-828cacec2577 h1:w3DBVd9h9/zbO9V3RBfxacv20Rho42xWfDTDiE8yoMQ=
github.com/ava-labs/icm-services v1.4.1-0.20250307175119-828cacec2577/go.mod h1:RvsWSzqNtOdPGhbPZcq3j65gcEvRUx7/quq7FMxxIhU=
github.com/ava-labs/icm-services v1.4.1-0.20250313194621-b5eac197b0d8 h1:MLVvLGWQLsKfj8aoR+uNOdkaNdlS+cfLfUnYDn4y9hU=
github.com/ava-labs/icm-services v1.4.1-0.20250313194621-b5eac197b0d8/go.mod h1:fnOZxkaajnx6bgRzUWJ3B38FrtqBUoUBJA9zMa2pIYc=
github.com/ava-labs/ledger-avalanche/go v0.0.0-20241009183145-e6f90a8a1a60 h1:EL66gtXOAwR/4KYBjOV03LTWgkEXvLePribLlJNu4g0=
github.com/ava-labs/ledger-avalanche/go v0.0.0-20241009183145-e6f90a8a1a60/go.mod h1:/7qKobTfbzBu7eSTVaXMTr56yTYk4j2Px6/8G+idxHo=
github.com/ava-labs/subnet-evm v0.7.2 h1:AxmXT9tmuxmUi+hDqtoS0OVi0zi8fPqPcoQ7yjZ6FZQ=
Expand Down
8 changes: 4 additions & 4 deletions pkg/prompts/prompts.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,19 +63,19 @@ func (comparator *Comparator) Validate(val uint64) error {
switch comparator.Type {
case LessThanEq:
if val > comparator.Value {
return fmt.Errorf(fmt.Sprintf("the value must be smaller than or equal to %s (%d)", comparator.Label, comparator.Value))
return fmt.Errorf("the value must be smaller than or equal to %s (%d)", comparator.Label, comparator.Value)
}
case MoreThan:
if val <= comparator.Value {
return fmt.Errorf(fmt.Sprintf("the value must be bigger than %s (%d)", comparator.Label, comparator.Value))
return fmt.Errorf("the value must be bigger than %s (%d)", comparator.Label, comparator.Value)
}
case MoreThanEq:
if val < comparator.Value {
return fmt.Errorf(fmt.Sprintf("the value must be bigger than or equal to %s (%d)", comparator.Label, comparator.Value))
return fmt.Errorf("the value must be bigger than or equal to %s (%d)", comparator.Label, comparator.Value)
}
case NotEq:
if val == comparator.Value {
return fmt.Errorf(fmt.Sprintf("the value must be different than %s (%d)", comparator.Label, comparator.Value))
return fmt.Errorf("the value must be different than %s (%d)", comparator.Label, comparator.Value)
}
}
return nil
Expand Down
1 change: 0 additions & 1 deletion pkg/utils/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,6 @@ func VMID(vmName string) (ids.ID, error) {
func PointersSlice[T any](input []T) []*T {
output := make([]*T, 0, len(input))
for _, e := range input {
e := e
output = append(output, &e)
}
return output
Expand Down
2 changes: 1 addition & 1 deletion scripts/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ CLI_PATH=$(
cd .. && pwd
)

GOLANGCI_LINT_VERSION=v1.56.2
GOLANGCI_LINT_VERSION=v1.64.5

go install -v github.com/golangci/golangci-lint/cmd/golangci-lint@${GOLANGCI_LINT_VERSION}
golangci-lint run --config=$CLI_PATH/.golangci.yml ./... --timeout 5m
6 changes: 3 additions & 3 deletions tests/e2e/testcases/subnet/non-sov/public/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,9 @@ var _ = ginkgo.Describe("[Public Subnet non SOV]", func() {
txPath,
false,
)
toMatch = "(?s).+Ledger addresses:(?s).+ " + ledger1Addr + "(?s).+Blockchain has been created with ID(?s).+" + //nolint:goconst
toMatch = "(?s).+Ledger addresses:(?s).+ " + ledger1Addr + "(?s).+Blockchain has been created with ID(?s).+" +
"0 of 2 required Blockchain Creation signatures have been signed\\. Saving tx to disk to enable remaining signing\\.(?s).+" +
"Addresses remaining to sign the tx\\s+" + ledger2Addr + "(?s).+" + ledger3Addr + "(?s).+" //nolint:goconst
"Addresses remaining to sign the tx\\s+" + ledger2Addr + "(?s).+" + ledger3Addr + "(?s).+"
matched, err = regexp.MatchString(toMatch, cliutils.RemoveLineCleanChars(s))
gomega.Expect(err).Should(gomega.BeNil())
gomega.Expect(matched).Should(gomega.Equal(true), "no match between command output %q and pattern %q", s, toMatch)
Expand All @@ -295,7 +295,7 @@ var _ = ginkgo.Describe("[Public Subnet non SOV]", func() {
)
toMatch = "(?s).*0 of 2 required signatures have been signed\\.(?s).+" +
"Addresses remaining to sign the tx\\s+" + ledger2Addr + "(?s).+" + ledger3Addr + "(?s).+" +
"(?s).+Error: tx is not fully signed(?s).+" //nolint:goconst
"(?s).+Error: tx is not fully signed(?s).+"
matched, err = regexp.MatchString(toMatch, cliutils.RemoveLineCleanChars(s))
gomega.Expect(err).Should(gomega.BeNil())
gomega.Expect(matched).Should(gomega.Equal(true), "no match between command output %q and pattern %q", s, toMatch)
Expand Down
6 changes: 3 additions & 3 deletions tests/e2e/testcases/subnet/sov/public/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,9 +275,9 @@ var _ = ginkgo.Describe("[Public Subnet SOV]", func() {
txPath,
false,
)
toMatch = "(?s).+Ledger addresses:(?s).+ " + ledger1Addr + "(?s).+Subnet has been created with ID(?s).+" + //nolint:goconst
toMatch = "(?s).+Ledger addresses:(?s).+ " + ledger1Addr + "(?s).+Subnet has been created with ID(?s).+" +
"0 of 2 required Blockchain Creation signatures have been signed\\. Saving tx to disk to enable remaining signing\\.(?s).+" +
"Addresses remaining to sign the tx\\s+" + ledger2Addr + "(?s).+" + ledger3Addr + "(?s).+" //nolint:goconst
"Addresses remaining to sign the tx\\s+" + ledger2Addr + "(?s).+" + ledger3Addr + "(?s).+"
matched, err = regexp.MatchString(toMatch, cliutils.RemoveLineCleanChars(s))
gomega.Expect(err).Should(gomega.BeNil())
gomega.Expect(matched).Should(gomega.Equal(true), "no match between command output %q and pattern %q", s, toMatch)
Expand All @@ -290,7 +290,7 @@ var _ = ginkgo.Describe("[Public Subnet SOV]", func() {
)
toMatch = "(?s).*0 of 2 required signatures have been signed\\.(?s).+" +
"Addresses remaining to sign the tx\\s+" + ledger2Addr + "(?s).+" + ledger3Addr + "(?s).+" +
"(?s).+Error: tx is not fully signed(?s).+" //nolint:goconst
"(?s).+Error: tx is not fully signed(?s).+"
matched, err = regexp.MatchString(toMatch, cliutils.RemoveLineCleanChars(s))
gomega.Expect(err).Should(gomega.BeNil())
gomega.Expect(matched).Should(gomega.Equal(true), "no match between command output %q and pattern %q", s, toMatch)
Expand Down
Loading