diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 7a01200a4..728b25818 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -5,6 +5,7 @@ on: branches: - main pull_request: + workflow_call: jobs: lint: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 35b95e93f..54d72faca 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,6 +4,8 @@ on: push: tags: - "*" + branches: + - acp-77 jobs: # First confirm that the linting and unit tests pass at this commit prior to creating release artifacts. @@ -59,14 +61,24 @@ jobs: - name: Set up QEMU uses: docker/setup-qemu-action@v3 + + - name: Build Docker Image with acp77-latest tag + if: github.ref == 'refs/heads/acp-77' # special case for acp-77 branch + run: | + docker buildx build --pull --push --platform=linux/amd64,linux/arm64 \ + -t avaplatform/avalanche-cli:acp77-latest \ + -f ./Dockerfile . + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + TELEMETRY_TOKEN: ${{ secrets.POSTHOG_PROD_TOKEN }} - name: Run GoReleaser + if: github.ref != 'refs/heads/acp-77' # skip for acp-77 branch uses: goreleaser/goreleaser-action@v2 with: distribution: goreleaser version: latest args: release --clean - workdir: ./avalanche-cli/ env: # https://docs.github.com/en/actions/security-guides/automatic-token-authentication#about-the-github_token-secret GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index b5f2ca39f..d91dd4082 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -5,6 +5,7 @@ on: branches: - main pull_request: + workflow_call: jobs: unit_test: diff --git a/.gitignore b/.gitignore index c9c7415c3..e14603067 100644 --- a/.gitignore +++ b/.gitignore @@ -51,3 +51,5 @@ pkg/contract/contracts/remappings.txt pkg/contract/contracts/lib/ pkg/contract/contracts/cache/ pkg/contract/contracts/out/ + +osxcross/ diff --git a/Dockerfile b/Dockerfile index 4d3347c71..415ef9f6a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # ============= Compilation Stage ================ -FROM golang:1.20-bullseye AS builder +FROM golang:1.22.7-bullseye AS builder WORKDIR /build # Copy and download avalanche dependencies using go mod diff --git a/VERSION b/VERSION index 5849151fd..73c8b4f99 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.7.5 \ No newline at end of file +1.7.7 \ No newline at end of file diff --git a/assets/bootstrapSnapshot.PreDurango12.tar.gz b/assets/bootstrapSnapshot.PreDurango12.tar.gz new file mode 100644 index 000000000..96828d384 Binary files /dev/null and b/assets/bootstrapSnapshot.PreDurango12.tar.gz differ diff --git a/assets/bootstrapSnapshot.tar.gz b/assets/bootstrapSnapshot.tar.gz index 96828d384..73e696457 100644 Binary files a/assets/bootstrapSnapshot.tar.gz and b/assets/bootstrapSnapshot.tar.gz differ diff --git a/assets/bootstrapSnapshotSingleNode.PreDurango12.tar.gz b/assets/bootstrapSnapshotSingleNode.PreDurango12.tar.gz new file mode 100644 index 000000000..7f1bf263d Binary files /dev/null and b/assets/bootstrapSnapshotSingleNode.PreDurango12.tar.gz differ diff --git a/assets/bootstrapSnapshotSingleNode.tar.gz b/assets/bootstrapSnapshotSingleNode.tar.gz index 7f1bf263d..c5f62c442 100644 Binary files a/assets/bootstrapSnapshotSingleNode.tar.gz and b/assets/bootstrapSnapshotSingleNode.tar.gz differ diff --git a/assets/sha256sum.PreDurango12.txt b/assets/sha256sum.PreDurango12.txt new file mode 100644 index 000000000..c7b43e179 --- /dev/null +++ b/assets/sha256sum.PreDurango12.txt @@ -0,0 +1 @@ +811e73be1ad9b56f05a14ca6d239ee50bc3882fa10fdb2f78d41b02fb81ac6fe assets/bootstrapSnapshot.PreDurango12.tar.gz diff --git a/assets/sha256sum.txt b/assets/sha256sum.txt index 803a08b41..aeaa16da9 100644 --- a/assets/sha256sum.txt +++ b/assets/sha256sum.txt @@ -1 +1 @@ -811e73be1ad9b56f05a14ca6d239ee50bc3882fa10fdb2f78d41b02fb81ac6fe assets/bootstrapSnapshot.tar.gz +26b07c304da467d3a28ebc936f5b44c5f27f65b0a626da81fabe9154a821ec24 assets/bootstrapSnapshot.tar.gz diff --git a/assets/sha256sumSingleNode.PreDurango12.txt b/assets/sha256sumSingleNode.PreDurango12.txt new file mode 100644 index 000000000..53938219f --- /dev/null +++ b/assets/sha256sumSingleNode.PreDurango12.txt @@ -0,0 +1 @@ +53ef0b4c6ef6bd54e07bd065d58164bd464cd46576d36230731c93d3cc254df9 assets/bootstrapSnapshotSingleNode.PreDurango12.tar.gz diff --git a/assets/sha256sumSingleNode.txt b/assets/sha256sumSingleNode.txt index 6f15edbed..43fc7c813 100644 --- a/assets/sha256sumSingleNode.txt +++ b/assets/sha256sumSingleNode.txt @@ -1 +1 @@ -53ef0b4c6ef6bd54e07bd065d58164bd464cd46576d36230731c93d3cc254df9 assets/bootstrapSnapshotSingleNode.tar.gz +ec7332442743b1943e298d7301b8962948ae104edb78f70b5cad30376b60557c assets/bootstrapSnapshotSingleNode.tar.gz diff --git a/cmd/blockchaincmd/create.go b/cmd/blockchaincmd/create.go index 251ee4848..0194de2a0 100644 --- a/cmd/blockchaincmd/create.go +++ b/cmd/blockchaincmd/create.go @@ -362,9 +362,7 @@ func createBlockchainConfig(cmd *cobra.Command, args []string) error { // subnet-evm check based on genesis // covers both subnet-evm vms and custom vms - if hasSubnetEVMGenesis, rawErr, err := app.HasSubnetEVMGenesis(blockchainName); rawErr != nil { - return rawErr - } else if err != nil { + if hasSubnetEVMGenesis, _, err := app.HasSubnetEVMGenesis(blockchainName); err != nil { return err } else if hasSubnetEVMGenesis && createFlags.enableDebugging { if err := SetBlockchainConf( @@ -379,6 +377,7 @@ func createBlockchainConfig(cmd *cobra.Command, args []string) error { if err = app.CreateSidecar(sc); err != nil { return err } + if vmType == models.SubnetEvm { err = sendMetrics(cmd, vmType.RepoName(), blockchainName) if err != nil { diff --git a/cmd/interchaincmd/tokentransferrercmd/deploy.go b/cmd/interchaincmd/tokentransferrercmd/deploy.go index 33b56095a..cded2f221 100644 --- a/cmd/interchaincmd/tokentransferrercmd/deploy.go +++ b/cmd/interchaincmd/tokentransferrercmd/deploy.go @@ -9,10 +9,12 @@ import ( "time" cmdflags "github.com/ava-labs/avalanche-cli/cmd/flags" + "github.com/ava-labs/avalanche-cli/pkg/application" "github.com/ava-labs/avalanche-cli/pkg/cobrautils" "github.com/ava-labs/avalanche-cli/pkg/constants" "github.com/ava-labs/avalanche-cli/pkg/contract" "github.com/ava-labs/avalanche-cli/pkg/ictt" + "github.com/ava-labs/avalanche-cli/pkg/models" "github.com/ava-labs/avalanche-cli/pkg/networkoptions" "github.com/ava-labs/avalanche-cli/pkg/precompiles" "github.com/ava-labs/avalanche-cli/pkg/prompts" @@ -101,6 +103,43 @@ func deploy(_ *cobra.Command, args []string) error { return CallDeploy(args, deployFlags) } +func getHomeKeyAndAddress(app *application.Avalanche, network models.Network, homeFlags HomeFlags) (string, string, error) { + // First check if there is a genesis key able to be used. + genesisAddress, genesisPrivateKey, err := contract.GetEVMSubnetPrefundedKey( + app, + network, + homeFlags.chainFlags, + ) + if err != nil { + return "", "", err + } + + // Propmt for the key to be used. + // Note that this key must have enough funds to cover gas cost on the + // home chain, and also enough of the token on the home chain to collateralize + // the remote chain if it is a native token remote. + homeKey, err := prompts.PromptPrivateKey( + app.Prompt, + "pay for home deployment fees, and collateralization (if necessary)", + app.GetKeyDir(), + app.GetKey, + genesisAddress, + genesisPrivateKey, + ) + if err != nil { + return "", "", err + } + + // Calculate the address for the key. + pk, err := crypto.HexToECDSA(homeKey) + if err != nil { + return "", "", err + } + homeKeyAddress := crypto.PubkeyToAddress(pk.PublicKey).Hex() + + return homeKey, homeKeyAddress, nil +} + func CallDeploy(_ []string, flags DeployFlags) error { if !ictt.FoundryIsInstalled() { if err := ictt.InstallFoundry(); err != nil { @@ -304,41 +343,11 @@ func CallDeploy(_ []string, flags DeployFlags) error { } } - var ( - homeKey string - homeKeyAddress string - ) - if flags.homeFlags.homeAddress == "" { - genesisAddress, genesisPrivateKey, err := contract.GetEVMSubnetPrefundedKey( - app, - network, - flags.homeFlags.chainFlags, - ) - if err != nil { - return err - } - homeKey, err = flags.homeFlags.privateKeyFlags.GetPrivateKey(app, genesisPrivateKey) - if err != nil { - return err - } - if homeKey == "" { - homeKey, err = prompts.PromptPrivateKey( - app.Prompt, - "pay for home deploy fees", - app.GetKeyDir(), - app.GetKey, - genesisAddress, - genesisPrivateKey, - ) - if err != nil { - return err - } - } - pk, err := crypto.HexToECDSA(homeKey) - if err != nil { - return err - } - homeKeyAddress = crypto.PubkeyToAddress(pk.PublicKey).Hex() + // Get the key to be used to deploy the token home contract and collateralize the remote + // in the case that it is a native token remote. + homeKey, homeKeyAddress, err := getHomeKeyAndAddress(app, network, flags.homeFlags) + if err != nil { + return err } // Home Contract Validations @@ -483,7 +492,6 @@ func CallDeploy(_ []string, flags DeployFlags) error { if err := ictt.BuildContracts(app); err != nil { return err } - ux.Logger.PrintToUser("") // Home Deploy icttSrcDir, err := ictt.RepoDir(app) @@ -667,8 +675,10 @@ func CallDeploy(_ []string, flags DeployFlags) error { return err } } + ux.Logger.PrintToUser("Remote Deployed to %s", remoteRPCEndpoint) + ux.Logger.PrintToUser("Remote Address: %s", remoteAddress) - if err := ictt.RegisterERC20Remote( + if err := ictt.RegisterRemote( remoteRPCEndpoint, remoteKey, remoteAddress, @@ -679,6 +689,7 @@ func CallDeploy(_ []string, flags DeployFlags) error { checkInterval := 100 * time.Millisecond checkTimeout := 10 * time.Second t0 := time.Now() + var collateralNeeded *big.Int for { registeredRemote, err := ictt.TokenHomeGetRegisteredRemote( homeRPCEndpoint, @@ -690,6 +701,7 @@ func CallDeploy(_ []string, flags DeployFlags) error { return err } if registeredRemote.Registered { + collateralNeeded = registeredRemote.CollateralNeeded break } elapsed := time.Since(t0) @@ -699,19 +711,21 @@ func CallDeploy(_ []string, flags DeployFlags) error { time.Sleep(checkInterval) } - if flags.remoteFlags.native { + // Collateralize the remote contract on the home contract if necessary + if collateralNeeded.Cmp(big.NewInt(0)) != 0 { err = ictt.TokenHomeAddCollateral( homeRPCEndpoint, homeAddress, homeKey, remoteBlockchainID, remoteAddress, - remoteSupply, + collateralNeeded, ) if err != nil { return err } + // Check that the remote is collateralized on the home contract now. registeredRemote, err := ictt.TokenHomeGetRegisteredRemote( homeRPCEndpoint, homeAddress, @@ -724,7 +738,10 @@ func CallDeploy(_ []string, flags DeployFlags) error { if registeredRemote.CollateralNeeded.Cmp(big.NewInt(0)) != 0 { return fmt.Errorf("failure setting collateral in home endpoint: remaining collateral=%d", registeredRemote.CollateralNeeded) } + } + if flags.remoteFlags.native { + ux.Logger.PrintToUser("Enabling native token remote contract to mint native tokens") if err := precompiles.SetEnabled( remoteRPCEndpoint, precompiles.NativeMinterPrecompile, @@ -734,6 +751,7 @@ func CallDeploy(_ []string, flags DeployFlags) error { return err } + // Send a single token unit to report that the remote is collateralized. err = ictt.Send( homeRPCEndpoint, homeAddress, @@ -785,8 +803,5 @@ func CallDeploy(_ []string, flags DeployFlags) error { } } - ux.Logger.PrintToUser("Remote Deployed to %s", remoteRPCEndpoint) - ux.Logger.PrintToUser("Remote Address: %s", remoteAddress) - return nil } diff --git a/cmd/keycmd/list.go b/cmd/keycmd/list.go index 568878e1b..7170e7f2d 100644 --- a/cmd/keycmd/list.go +++ b/cmd/keycmd/list.go @@ -558,28 +558,44 @@ func getEvmBasedChainAddrInfo( if err != nil { return addressInfos, err } + + // Ignore contract address access errors as those may depend on network tokenSymbol, err := token.Symbol(nil) - if err == nil { - // just ignore contract address access errors as those may depend on network - balance, err := token.BalanceOf(nil, common.HexToAddress(cChainAddr)) - if err != nil { - return addressInfos, err - } - formattedBalance, err := formatCChainBalance(balance) - if err != nil { - return addressInfos, err - } - info := addressInfo{ - kind: kind, - name: name, - chain: chainName, - token: fmt.Sprintf("%s (%s.)", tokenSymbol, tokenAddress[:6]), - address: cChainAddr, - balance: formattedBalance, - network: network.Name(), - } - addressInfos = append(addressInfos, info) + if err != nil { + continue + } + + // Get the raw balance for the given token. + balance, err := token.BalanceOf(nil, common.HexToAddress(cChainAddr)) + if err != nil { + return addressInfos, err + } + + // Get the decimal count for the token to format the balance. + // Note: decimals() is not officially part of the IERC20 interface, but is a common extension. + decimals, err := token.Decimals(nil) + if err != nil { + return addressInfos, err + } + + // Format the balance to a human-readable string. + var formattedBalance string + if useGwei { + formattedBalance = fmt.Sprintf("%d", balance) + } else { + formattedBalance = utils.FormatAmount(balance, decimals) + } + + info := addressInfo{ + kind: kind, + name: name, + chain: chainName, + token: fmt.Sprintf("%s (%s.)", tokenSymbol, tokenAddress[:6]), + address: cChainAddr, + balance: formattedBalance, + network: network.Name(), } + addressInfos = append(addressInfos, info) } } return addressInfos, nil diff --git a/cmd/keycmd/transfer.go b/cmd/keycmd/transfer.go index 0f7eeccc7..f28c596a4 100644 --- a/cmd/keycmd/transfer.go +++ b/cmd/keycmd/transfer.go @@ -28,6 +28,7 @@ import ( avmtxs "github.com/ava-labs/avalanchego/vms/avm/txs" "github.com/ava-labs/avalanchego/vms/components/avax" "github.com/ava-labs/avalanchego/vms/platformvm/txs" + avagofee "github.com/ava-labs/avalanchego/vms/platformvm/txs/fee" "github.com/ava-labs/avalanchego/vms/secp256k1fx" "github.com/ava-labs/avalanchego/wallet/subnet/primary" "github.com/ava-labs/avalanchego/wallet/subnet/primary/common" @@ -426,9 +427,9 @@ func transferF(*cobra.Command, []string) error { var useLedger bool goalStr := "" if send { - goalStr = " for the sender address" + goalStr = "as the sender address" } else { - goalStr = " for the destination address" + goalStr = "as the destination address" } useLedger, keyName, err = prompts.GetKeyOrLedger(app.Prompt, goalStr, app.GetKeyDir(), true) if err != nil { @@ -598,6 +599,20 @@ func transferF(*cobra.Command, []string) error { return fmt.Errorf("error signing tx: %w", err) } + pContext := wallet.P().Builder().Context() + var pFeeCalculator avagofee.Calculator + if pContext.GasPrice != 0 { + pFeeCalculator = avagofee.NewDynamicCalculator(pContext.ComplexityWeights, pContext.GasPrice) + } else { + pFeeCalculator = avagofee.NewStaticCalculator(pContext.StaticFeeConfig) + } + txFee, err := pFeeCalculator.CalculateFee(unsignedTx) + if err != nil { + return err + } + ux.Logger.PrintToUser("") + ux.Logger.PrintToUser("Paid fee: %.9f", float64(txFee)/float64(units.Avax)) + ctx, cancel := utils.GetAPIContext() defer cancel() err = wallet.P().IssueTx( diff --git a/cmd/nodecmd/create_devnet.go b/cmd/nodecmd/create_devnet.go index 8b592f7aa..889d0eb40 100644 --- a/cmd/nodecmd/create_devnet.go +++ b/cmd/nodecmd/create_devnet.go @@ -22,6 +22,8 @@ import ( "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" "github.com/ava-labs/avalanchego/utils/formatting" "github.com/ava-labs/avalanchego/utils/logging" @@ -41,7 +43,7 @@ const ( func generateCustomCchainGenesis() ([]byte, error) { cChainGenesisMap := map[string]interface{}{} - cChainGenesisMap["config"] = coreth_params.AvalancheLocalChainConfig + cChainGenesisMap["config"] = coreth_params.GetChainConfig(avago_upgrade.GetConfig(avago_constants.LocalID), coreth_params.AvalancheLocalChainID) cChainGenesisMap["nonce"] = hexa0Str cChainGenesisMap["timestamp"] = hexa0Str cChainGenesisMap["extraData"] = "0x00" diff --git a/go.mod b/go.mod index 666da684e..667b4b4d2 100644 --- a/go.mod +++ b/go.mod @@ -1,20 +1,20 @@ module github.com/ava-labs/avalanche-cli -go 1.22.7 +go 1.22.8 require ( github.com/ava-labs/apm v1.0.0 - github.com/ava-labs/avalanche-network-runner v1.8.3-0.20240815175406-50423422fb5b - github.com/ava-labs/avalanchego v1.11.11-0.20240815211142-ce78e7f1799f + github.com/ava-labs/avalanche-network-runner v1.8.4-0.20241003175856-6b1bcdf33e7a + github.com/ava-labs/avalanchego v1.11.13-0.20241016194412-e5ca05301169 github.com/ava-labs/awm-relayer v1.3.0 - github.com/ava-labs/coreth v0.13.8-fixed-genesis-upgrade.0.20240813194342-7635a96aa180 + github.com/ava-labs/coreth v0.13.8 github.com/ava-labs/subnet-evm v0.6.9-0.20240815191823-9f3608326298 - github.com/aws/aws-sdk-go-v2 v1.30.3 + github.com/aws/aws-sdk-go-v2 v1.32.2 github.com/aws/aws-sdk-go-v2/config v1.27.26 - github.com/aws/aws-sdk-go-v2/service/ec2 v1.162.0 + github.com/aws/aws-sdk-go-v2/service/ec2 v1.182.0 github.com/chelnak/ysmrr v0.4.0 github.com/docker/docker v27.1.1+incompatible - github.com/ethereum/go-ethereum v1.13.8 + github.com/ethereum/go-ethereum v1.13.14 github.com/fatih/color v1.17.0 github.com/go-git/go-git/v5 v5.12.0 github.com/jedib0t/go-pretty/v6 v6.5.9 @@ -38,7 +38,7 @@ require ( go.uber.org/zap v1.27.0 golang.org/x/crypto v0.26.0 golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 - golang.org/x/mod v0.20.0 + golang.org/x/mod v0.21.0 golang.org/x/net v0.28.0 golang.org/x/oauth2 v0.21.0 golang.org/x/sync v0.8.0 @@ -62,27 +62,27 @@ require ( github.com/ProtonMail/go-crypto v1.0.0 // indirect github.com/VictoriaMetrics/fastcache v1.12.1 // indirect github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be // indirect - github.com/ava-labs/ledger-avalanche/go v0.0.0-20240610153809-9c955cc90a95 // indirect + github.com/ava-labs/ledger-avalanche/go v0.0.0-20241009183145-e6f90a8a1a60 // indirect github.com/ava-labs/teleporter v1.0.0 // indirect github.com/aws/aws-sdk-go-v2/credentials v1.17.26 // indirect github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.11 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.15 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.15 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.21 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.21 // indirect github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.3 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.17 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.0 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.2 // indirect github.com/aws/aws-sdk-go-v2/service/kms v1.31.0 // indirect github.com/aws/aws-sdk-go-v2/service/sso v1.22.3 // indirect github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.4 // indirect github.com/aws/aws-sdk-go-v2/service/sts v1.30.3 // indirect - github.com/aws/smithy-go v1.20.3 // indirect + github.com/aws/smithy-go v1.22.0 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bits-and-blooms/bitset v1.10.0 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect github.com/btcsuite/btcd/btcutil v1.1.3 // indirect github.com/cavaliergopher/grab/v3 v3.0.1 // indirect github.com/cenkalti/backoff/v4 v4.2.1 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/chzyer/readline v1.5.1 // indirect github.com/cloudflare/circl v1.3.7 // indirect github.com/cockroachdb/errors v1.9.1 // indirect @@ -105,7 +105,7 @@ require ( github.com/emirpasic/gods v1.18.1 // indirect github.com/ethereum/c-kzg-4844 v0.4.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 // indirect + github.com/fjl/memsize v0.0.2 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 // indirect github.com/gballet/go-verkle v0.1.1-0.20231031103413-a67434b50f46 // indirect @@ -116,7 +116,7 @@ require ( github.com/go-git/go-billy/v5 v5.5.0 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect - github.com/go-ole/go-ole v1.2.6 // indirect + github.com/go-ole/go-ole v1.3.0 // indirect github.com/go-sourcemap/sourcemap v2.1.3+incompatible // indirect github.com/go-task/slim-sprig/v3 v3.0.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect @@ -134,13 +134,13 @@ require ( github.com/googleapis/gax-go/v2 v2.12.4 // indirect github.com/gorilla/mux v1.8.0 // indirect github.com/gorilla/rpc v1.2.0 // indirect - github.com/gorilla/websocket v1.4.2 // indirect + github.com/gorilla/websocket v1.5.0 // indirect github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0 // indirect github.com/hashicorp/go-bexpr v0.1.10 // indirect github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect github.com/hashicorp/hcl v1.0.0 // indirect - github.com/holiman/billy v0.0.0-20230718173358-1c7e68d277a7 // indirect + github.com/holiman/billy v0.0.0-20240216141850-2abb0c79d3c4 // indirect github.com/holiman/bloomfilter/v2 v2.0.3 // indirect github.com/holiman/uint256 v1.2.4 // indirect github.com/huin/goupnp v1.3.0 // indirect @@ -148,7 +148,6 @@ require ( github.com/jackpal/gateway v1.0.6 // indirect github.com/jackpal/go-nat-pmp v1.0.2 // indirect github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect - github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/juju/fslock v0.0.0-20160525022230-4d5c94c67b4b // indirect github.com/kevinburke/ssh_config v1.2.0 // indirect github.com/klauspost/compress v1.17.2 // indirect @@ -176,7 +175,7 @@ require ( github.com/prometheus/common v0.48.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/rivo/uniseg v0.2.0 // indirect - github.com/rogpeppe/go-internal v1.11.0 // indirect + github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/rs/cors v1.7.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect @@ -201,7 +200,7 @@ require ( github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect github.com/yusufpapurcu/wmi v1.2.2 // indirect github.com/zondax/hid v0.9.2 // indirect - github.com/zondax/ledger-go v0.14.3 // indirect + github.com/zondax/ledger-go v1.0.0 // indirect go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect go.opentelemetry.io/otel v1.24.0 // indirect @@ -219,9 +218,9 @@ require ( golang.org/x/time v0.5.0 // indirect golang.org/x/tools v0.24.0 // indirect gonum.org/v1/gonum v0.11.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 // indirect - google.golang.org/grpc v1.64.1 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240604185151-ef581f913117 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240827150818-7e3bb234dfed // indirect + google.golang.org/grpc v1.66.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect diff --git a/go.sum b/go.sum index 6c6254a15..43e34cdc9 100644 --- a/go.sum +++ b/go.sum @@ -83,23 +83,23 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPd github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= 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.3-0.20240815175406-50423422fb5b h1:9DEFDbJFdkMxzfjwUm1KbyzqYlhn8QDYrW9pYmFVNdA= -github.com/ava-labs/avalanche-network-runner v1.8.3-0.20240815175406-50423422fb5b/go.mod h1:X4ly6Ebq6vzsj9q9G9W00YftOrS7ZT2jLi9cxLqT4eQ= -github.com/ava-labs/avalanchego v1.11.11-0.20240815211142-ce78e7f1799f h1:fLWva3zOGwhZAnLq+nhiTs1Q24dL1nPvF4qVZZ6IGFg= -github.com/ava-labs/avalanchego v1.11.11-0.20240815211142-ce78e7f1799f/go.mod h1:UkyrRDXK2E15Lq2abyae2Pt+JsWvgsg1pe0/AtoMyAM= +github.com/ava-labs/avalanche-network-runner v1.8.4-0.20241003175856-6b1bcdf33e7a h1:xd2RUTW9w34+V6yI7zWfByHZ8y5CeXhvHK+nAJ9FCbI= +github.com/ava-labs/avalanche-network-runner v1.8.4-0.20241003175856-6b1bcdf33e7a/go.mod h1:l4QzFnujbyyyeq6oBQ4F6sw9TrTQCjD2V4vUd7ZBCCo= +github.com/ava-labs/avalanchego v1.11.13-0.20241016194412-e5ca05301169 h1:v09QsEUbm5fjPgDWEJZzSFU7T4b0SPiKyZq5DvR8rSU= +github.com/ava-labs/avalanchego v1.11.13-0.20241016194412-e5ca05301169/go.mod h1:YlinMYWE4yXu4bA5Vdzn1WcQ+z5qjrpxeBYwWAPdrvA= github.com/ava-labs/awm-relayer v1.3.0 h1:aI90Daoq7bs9SnfZpyjXajj7YLcdZoFgEkyCd52fOHE= github.com/ava-labs/awm-relayer v1.3.0/go.mod h1:UI1Tm0jfFIpO1S2hpE5WGzJCDpLHLldhsE1bWn2FjEE= -github.com/ava-labs/coreth v0.13.8-fixed-genesis-upgrade.0.20240813194342-7635a96aa180 h1:6aIHp7wbyGVYdhHVQUbG7BEcbCMEQ5SYopPPJyipyvk= -github.com/ava-labs/coreth v0.13.8-fixed-genesis-upgrade.0.20240813194342-7635a96aa180/go.mod h1:/wNBVq7J7wlC2Kbov7kk6LV5xZvau7VF9zwTVOeyAjY= -github.com/ava-labs/ledger-avalanche/go v0.0.0-20240610153809-9c955cc90a95 h1:dOVbtdnZL++pENdTCNZ1nu41eYDQkTML4sWebDnnq8c= -github.com/ava-labs/ledger-avalanche/go v0.0.0-20240610153809-9c955cc90a95/go.mod h1:pJxaT9bUgeRNVmNRgtCHb7sFDIRKy7CzTQVi8gGNT6g= +github.com/ava-labs/coreth v0.13.8 h1:f14X3KgwHl9LwzfxlN6S4bbn5VA2rhEsNnHaRLSTo/8= +github.com/ava-labs/coreth v0.13.8/go.mod h1:t3BSv/eQv0AlDPMfEDCMMoD/jq1RkUsbFzQAFg5qBcE= +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.6.9-0.20240815191823-9f3608326298 h1:g7JdXUEZ5Hk3sKhJPoZattE4obRaF7qapHREnB4O+Rg= github.com/ava-labs/subnet-evm v0.6.9-0.20240815191823-9f3608326298/go.mod h1:QfIzh7YxKj97jbendOHQbaAxM7SMj5MWdV13o1VLn70= github.com/ava-labs/teleporter v1.0.0 h1:io209qZh3SDpwLre0oStMzOFRcPvOrmMQuLq5OFvzJo= github.com/ava-labs/teleporter v1.0.0/go.mod h1:4Wyz/5sZDHMaaLegh2ULyrAOWnyaBk6upTmbwSrVSMs= github.com/aws/aws-sdk-go-v2 v1.2.0/go.mod h1:zEQs02YRBw1DjK0PoJv3ygDYOFTre1ejlJWl8FwAuQo= -github.com/aws/aws-sdk-go-v2 v1.30.3 h1:jUeBtG0Ih+ZIFH0F4UkmL9w3cSpaMv9tYYDbzILP8dY= -github.com/aws/aws-sdk-go-v2 v1.30.3/go.mod h1:nIQjQVp5sfpQcTc9mPSr1B0PaWK5ByX9MOoDadSN4lc= +github.com/aws/aws-sdk-go-v2 v1.32.2 h1:AkNLZEyYMLnx/Q/mSKkcMqwNFXMAvFto9bNsHqcTduI= +github.com/aws/aws-sdk-go-v2 v1.32.2/go.mod h1:2SK5n0a2karNTv5tbP1SjsX0uhttou00v/HpXKM1ZUo= github.com/aws/aws-sdk-go-v2/config v1.1.1/go.mod h1:0XsVy9lBI/BCXm+2Tuvt39YmdHwS5unDQmxZOYe8F5Y= github.com/aws/aws-sdk-go-v2/config v1.27.26 h1:T1kAefbKuNum/AbShMsZEro6eRkeOT8YILfE9wyjAYQ= github.com/aws/aws-sdk-go-v2/config v1.27.26/go.mod h1:ivWHkAWFrw/nxty5Fku7soTIVdqZaZ7dw+tc5iGW3GA= @@ -109,19 +109,19 @@ github.com/aws/aws-sdk-go-v2/credentials v1.17.26/go.mod h1:3vAM49zkIa3q8WT6o9Ve github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.0.2/go.mod h1:3hGg3PpiEjHnrkrlasTfxFqUsZ2GCk/fMUn4CbKgSkM= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.11 h1:KreluoV8FZDEtI6Co2xuNk/UqI9iwMrOx/87PBNIKqw= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.11/go.mod h1:SeSUYBLsMYFoRvHE0Tjvn7kbxaUhl75CJi1sbfhMxkU= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.15 h1:SoNJ4RlFEQEbtDcCEt+QG56MY4fm4W8rYirAmq+/DdU= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.15/go.mod h1:U9ke74k1n2bf+RIgoX1SXFed1HLs51OgUSs+Ph0KJP8= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.15 h1:C6WHdGnTDIYETAm5iErQUiVNsclNx9qbJVPIt03B6bI= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.15/go.mod h1:ZQLZqhcu+JhSrA9/NXRm8SkDvsycE+JkV3WGY41e+IM= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.21 h1:UAsR3xA31QGf79WzpG/ixT9FZvQlh5HY1NRqSHBNOCk= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.21/go.mod h1:JNr43NFf5L9YaG3eKTm7HQzls9J+A9YYcGI5Quh1r2Y= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.21 h1:6jZVETqmYCadGFvrYEQfC5fAQmlo80CeL5psbno6r0s= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.21/go.mod h1:1SR0GbLlnN3QUmYaflZNiH1ql+1qrSiB2vwcJ+4UM60= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 h1:hT8rVHwugYE2lEfdFE0QWVo81lF7jMrYJVDWI+f+VxU= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0/go.mod h1:8tu/lYfQfFe6IGnaOdrpVgEL2IrrDOf6/m9RQum4NkY= -github.com/aws/aws-sdk-go-v2/service/ec2 v1.162.0 h1:A1YMX7uMzXhfIEL9zc5049oQgSaH4ZeXx/sOth0dk/I= -github.com/aws/aws-sdk-go-v2/service/ec2 v1.162.0/go.mod h1:iJ2sQeUTkjNp3nL7kE/Bav0xXYhtiRCRP5ZXk4jFhCQ= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.3 h1:dT3MqvGhSoaIhRseqw2I0yH81l7wiR2vjs57O51EAm8= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.3/go.mod h1:GlAeCkHwugxdHaueRr4nhPuY+WW+gR8UjlcqzPr1SPI= +github.com/aws/aws-sdk-go-v2/service/ec2 v1.182.0 h1:LaeziEhHZ/SJZYBK223QVzl3ucHvA9IP4tQMcxGrc9I= +github.com/aws/aws-sdk-go-v2/service/ec2 v1.182.0/go.mod h1:kYXaB4FzyhEJjvrJ84oPnMElLiEAjGxxUunVW2tBSng= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.0 h1:TToQNkvGguu209puTojY/ozlqy2d/SFNcoLIqTFi42g= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.0/go.mod h1:0jp+ltwkf+SwG2fm/PKo8t4y8pJSgOCO4D8Lz3k0aHQ= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.0.2/go.mod h1:45MfaXZ0cNbeuT0KQ1XJylq8A6+OpVV2E5kvY/Kq+u8= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.17 h1:HGErhhrxZlQ044RiM+WdoZxp0p+EGM62y3L6pwA4olE= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.17/go.mod h1:RkZEx4l0EHYDJpWppMJ3nD9wZJAa8/0lq9aVC+r2UII= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.2 h1:s7NA1SOw8q/5c0wr8477yOPp0z+uBaXBnLE0XYb0POA= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.2/go.mod h1:fnjjWyAW/Pj5HYOxl9LJqWtEwS7W2qgcRLWP+uWbss0= github.com/aws/aws-sdk-go-v2/service/kms v1.31.0 h1:yl7wcqbisxPzknJVfWTLnK83McUvXba+pz2+tPbIUmQ= github.com/aws/aws-sdk-go-v2/service/kms v1.31.0/go.mod h1:2snWQJQUKsbN66vAawJuOGX7dr37pfOq9hb0tZDGIqQ= github.com/aws/aws-sdk-go-v2/service/route53 v1.1.1/go.mod h1:rLiOUrPLW/Er5kRcQ7NkwbjlijluLsrIbu/iyl35RO4= @@ -134,8 +134,8 @@ github.com/aws/aws-sdk-go-v2/service/sts v1.1.1/go.mod h1:Wi0EBZwiz/K44YliU0EKxq github.com/aws/aws-sdk-go-v2/service/sts v1.30.3 h1:ZsDKRLXGWHk8WdtyYMoGNO7bTudrvuKpDKgMVRlepGE= github.com/aws/aws-sdk-go-v2/service/sts v1.30.3/go.mod h1:zwySh8fpFyXp9yOr/KVzxOl8SRqgf/IDw5aUt9UKFcQ= github.com/aws/smithy-go v1.1.0/go.mod h1:EzMw8dbp/YJL4A5/sbhGddag+NPT7q084agLbB9LgIw= -github.com/aws/smithy-go v1.20.3 h1:ryHwveWzPV5BIof6fyDvor6V3iUL7nTfiTKXHiW05nE= -github.com/aws/smithy-go v1.20.3/go.mod h1:krry+ya/rV9RDcV/Q16kpu6ypI4K2czasz0NC3qS14E= +github.com/aws/smithy-go v1.22.0 h1:uunKnWlcoL3zO7q+gG2Pk53joueEOsnNB28QdMsmiMM= +github.com/aws/smithy-go v1.22.0/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg= github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= @@ -180,8 +180,9 @@ github.com/cespare/cp v0.1.0 h1:SE+dxFebS7Iik5LK0tsi1k9ZCxEaFX4AjQmoyA+1dJk= github.com/cespare/cp v0.1.0/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chelnak/ysmrr v0.4.0 h1:WMvLGPlBK0kb6wHf5z9FfNvpM6sB9765jy2ajYc1Sfs= github.com/chelnak/ysmrr v0.4.0/go.mod h1:8vCna4PJsPCb6eevtoG7Tljzfx3twpsO203Qj2gafLM= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= @@ -292,8 +293,8 @@ github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHj github.com/ethereum/c-kzg-4844 v0.4.0 h1:3MS1s4JtA868KpJxroZoepdV0ZKBp3u/O5HcZ7R3nlY= github.com/ethereum/c-kzg-4844 v0.4.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0= github.com/ethereum/go-ethereum v1.10.3/go.mod h1:99onQmSd1GRGOziyGldI41YQb7EESX3Q4H41IfJgIQQ= -github.com/ethereum/go-ethereum v1.13.8 h1:1od+thJel3tM52ZUNQwvpYOeRHlbkVFZ5S8fhi0Lgsg= -github.com/ethereum/go-ethereum v1.13.8/go.mod h1:sc48XYQxCzH3fG9BcrXCOOgQk2JfZzNAmIKnceogzsA= +github.com/ethereum/go-ethereum v1.13.14 h1:EwiY3FZP94derMCIam1iW4HFVrSgIcpsu0HwTQtm6CQ= +github.com/ethereum/go-ethereum v1.13.14/go.mod h1:TN8ZiHrdJwSe8Cb6x+p0hs5CxhJZPbqB7hHkaUXcmIU= github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4= @@ -301,8 +302,9 @@ github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLg github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 h1:FtmdgXiUlNeRsoNMFlKLDt+S+6hbjVMEW6RGQ7aUf7c= github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= +github.com/fjl/memsize v0.0.2 h1:27txuSD9or+NZlnOWdKUxeBzTAUkWCVh+4Gf2dWFOzA= +github.com/fjl/memsize v0.0.2/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= @@ -353,8 +355,9 @@ github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab/go.mod h1:/P9AEU963A2AYjv4d1V5eVL1CQbEJq6aCNHDDjibzu8= github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= -github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= +github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= github.com/go-sourcemap/sourcemap v2.1.2+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= github.com/go-sourcemap/sourcemap v2.1.3+incompatible h1:W1iEw64niKVGogNgBN3ePyLFfuisuzeidWPMPWmECqU= github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= @@ -386,8 +389,8 @@ github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/geo v0.0.0-20190916061304-5b978397cfec/go.mod h1:QZ0nwyI2jOfgRAoBvP+ab5aRr7c9x7lhGEJrKvBwjWI= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.2.0 h1:uCdmnmatrKCgMBlM4rMuJZWOkPDqdbZPnrMXDY4gI68= -github.com/golang/glog v1.2.0/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= +github.com/golang/glog v1.2.1 h1:OptwRhECazUx5ix5TTWC3EZhsZEHWcYWY4FQHTIubm4= +github.com/golang/glog v1.2.1/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -471,8 +474,9 @@ github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB7 github.com/gorilla/rpc v1.2.0 h1:WvvdC2lNeT1SP32zrIce5l0ECBfbAlmrmSBsuc57wfk= github.com/gorilla/rpc v1.2.0/go.mod h1:V4h9r+4sF5HnzqbwIez0fKSpANP0zlYd3qR7p36jkTQ= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= +github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/graph-gophers/graphql-go v0.0.0-20201113091052-beb923fada29/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= @@ -487,8 +491,8 @@ github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuW github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/holiman/billy v0.0.0-20230718173358-1c7e68d277a7 h1:3JQNjnMRil1yD0IfZKHF9GxxWKDJGj8I0IqOUol//sw= -github.com/holiman/billy v0.0.0-20230718173358-1c7e68d277a7/go.mod h1:5GuXa7vkL8u9FkFuWdVvfR5ix8hRB7DbOAaYULamFpc= +github.com/holiman/billy v0.0.0-20240216141850-2abb0c79d3c4 h1:X4egAf/gcS1zATw6wn4Ej8vjuVGxeHdan+bRb2ebyv4= +github.com/holiman/billy v0.0.0-20240216141850-2abb0c79d3c4/go.mod h1:5GuXa7vkL8u9FkFuWdVvfR5ix8hRB7DbOAaYULamFpc= github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao= github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA= github.com/holiman/uint256 v1.1.1/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw= @@ -532,9 +536,7 @@ github.com/jedib0t/go-pretty/v6 v6.5.9/go.mod h1:zbn98qrYlh95FIhwwsbIip0LYpwSG8S github.com/jedisct1/go-minisign v0.0.0-20190909160543-45766022959e/go.mod h1:G1CVv03EnqU1wYL2dFwXxW2An0az9JTl/ZsqXQeBlkU= github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= -github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= @@ -751,8 +753,8 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/rs/cors v1.7.0 h1:+88SsELBHx5r+hZ8TCkggzSstaWNbDvThkVK8H6f9ik= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= @@ -886,8 +888,8 @@ github.com/yusufpapurcu/wmi v1.2.2 h1:KBNDSne4vP5mbSWnJbO+51IMOXJB67QiYCSBrubbPR github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= github.com/zondax/hid v0.9.2 h1:WCJFnEDMiqGF64nlZz28E9qLVZ0KSJ7xpc5DLEyma2U= github.com/zondax/hid v0.9.2/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= -github.com/zondax/ledger-go v0.14.3 h1:wEpJt2CEcBJ428md/5MgSLsXLBos98sBOyxNmCjfUCw= -github.com/zondax/ledger-go v0.14.3/go.mod h1:IKKaoxupuB43g4NxeQmbLXv7T9AlQyie1UpHb342ycI= +github.com/zondax/ledger-go v1.0.0 h1:BvNoksIyRqyQTW78rIZP9A44WwAminKiomQa7jXp9EI= +github.com/zondax/ledger-go v1.0.0/go.mod h1:HpgkgFh3Jkwi9iYLDATdyRxc8CxqxcywsFj6QerWzvo= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= @@ -979,8 +981,8 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0= -golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.21.0 h1:vvrHzRwRfVKSiLrG+d4FMl/Qi4ukBCE6kZlTUkDYRT0= +golang.org/x/mod v0.21.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1214,10 +1216,10 @@ google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvx google.golang.org/genproto v0.0.0-20200108215221-bd8f9a0ef82f/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157 h1:7whR9kGa5LUwFtpLm2ArCEejtnxlGeLbAyjFY8sGNFw= -google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157/go.mod h1:99sLkeliLXfdj2J75X3Ho+rrVCaJze0uwN7zDDkjPVU= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 h1:1GBuWVLM/KMVUv1t1En5Gs+gFZCNd360GGb4sSxtrhU= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= +google.golang.org/genproto/googleapis/api v0.0.0-20240604185151-ef581f913117 h1:+rdxYoE3E5htTEWIe15GlN6IfvbURM//Jt0mmkmm6ZU= +google.golang.org/genproto/googleapis/api v0.0.0-20240604185151-ef581f913117/go.mod h1:OimBR/bc1wPO9iV4NC2bpyjy3VnAwZh5EBPQdtaE5oo= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240827150818-7e3bb234dfed h1:J6izYgfBXAI3xTKLgxzTmUltdYaLsuBxFCgDHWJ/eXg= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240827150818-7e3bb234dfed/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= @@ -1228,8 +1230,8 @@ google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8 google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.64.1 h1:LKtvyfbX3UGVPFcGqJ9ItpVWW6oN/2XqTxfAnwRRXiA= -google.golang.org/grpc v1.64.1/go.mod h1:hiQF4LFZelK2WKaP6W0L92zGHtiQdZxk8CrSdvyjeP0= +google.golang.org/grpc v1.66.0 h1:DibZuoBznOxbDQxRINckZcUvnCEvrW9pcWIE2yF9r1c= +google.golang.org/grpc v1.66.0/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/internal/mocks/binary_checker.go b/internal/mocks/binary_checker.go index 885860e52..ec21488b8 100644 --- a/internal/mocks/binary_checker.go +++ b/internal/mocks/binary_checker.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.42.1. DO NOT EDIT. +// Code generated by mockery v2.43.2. DO NOT EDIT. package mocks diff --git a/internal/mocks/downloader.go b/internal/mocks/downloader.go index c119d797a..1a1f45c9a 100644 --- a/internal/mocks/downloader.go +++ b/internal/mocks/downloader.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.42.1. DO NOT EDIT. +// Code generated by mockery v2.43.2. DO NOT EDIT. package mocks diff --git a/internal/mocks/info.go b/internal/mocks/info.go index da4f831cb..efd1b3bdb 100644 --- a/internal/mocks/info.go +++ b/internal/mocks/info.go @@ -432,14 +432,14 @@ func (_m *InfoClient) Upgrades(_a0 context.Context, _a1 ...rpc.Option) (*upgrade return r0, r1 } -// Uptime provides a mock function with given fields: _a0, _a1, _a2 -func (_m *InfoClient) Uptime(_a0 context.Context, _a1 ids.ID, _a2 ...rpc.Option) (*info.UptimeResponse, error) { - _va := make([]interface{}, len(_a2)) - for _i := range _a2 { - _va[_i] = _a2[_i] +// Uptime provides a mock function with given fields: _a0, _a1 +func (_m *InfoClient) Uptime(_a0 context.Context, _a1 ...rpc.Option) (*info.UptimeResponse, error) { + _va := make([]interface{}, len(_a1)) + for _i := range _a1 { + _va[_i] = _a1[_i] } var _ca []interface{} - _ca = append(_ca, _a0, _a1) + _ca = append(_ca, _a0) _ca = append(_ca, _va...) ret := _m.Called(_ca...) @@ -449,19 +449,19 @@ func (_m *InfoClient) Uptime(_a0 context.Context, _a1 ids.ID, _a2 ...rpc.Option) var r0 *info.UptimeResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, ids.ID, ...rpc.Option) (*info.UptimeResponse, error)); ok { - return rf(_a0, _a1, _a2...) + if rf, ok := ret.Get(0).(func(context.Context, ...rpc.Option) (*info.UptimeResponse, error)); ok { + return rf(_a0, _a1...) } - if rf, ok := ret.Get(0).(func(context.Context, ids.ID, ...rpc.Option) *info.UptimeResponse); ok { - r0 = rf(_a0, _a1, _a2...) + if rf, ok := ret.Get(0).(func(context.Context, ...rpc.Option) *info.UptimeResponse); ok { + r0 = rf(_a0, _a1...) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*info.UptimeResponse) } } - if rf, ok := ret.Get(1).(func(context.Context, ids.ID, ...rpc.Option) error); ok { - r1 = rf(_a0, _a1, _a2...) + if rf, ok := ret.Get(1).(func(context.Context, ...rpc.Option) error); ok { + r1 = rf(_a0, _a1...) } else { r1 = ret.Error(1) } diff --git a/internal/mocks/installer.go b/internal/mocks/installer.go index 323ff8645..5fa59ad64 100644 --- a/internal/mocks/installer.go +++ b/internal/mocks/installer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.42.1. DO NOT EDIT. +// Code generated by mockery v2.43.2. DO NOT EDIT. package mocks diff --git a/internal/mocks/network.go b/internal/mocks/network.go index 0a09ba3ed..56ce44811 100644 --- a/internal/mocks/network.go +++ b/internal/mocks/network.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.42.1. DO NOT EDIT. +// Code generated by mockery v2.43.2. DO NOT EDIT. package mocks diff --git a/internal/mocks/pclient.go b/internal/mocks/pclient.go index 281484347..070de1d96 100644 --- a/internal/mocks/pclient.go +++ b/internal/mocks/pclient.go @@ -7,7 +7,7 @@ import ( api "github.com/ava-labs/avalanchego/api" - fee "github.com/ava-labs/avalanchego/vms/components/fee" + gas "github.com/ava-labs/avalanchego/vms/components/gas" ids "github.com/ava-labs/avalanchego/ids" @@ -386,7 +386,7 @@ func (_m *PClient) GetCurrentValidators(ctx context.Context, subnetID ids.ID, no } // GetFeeConfig provides a mock function with given fields: ctx, options -func (_m *PClient) GetFeeConfig(ctx context.Context, options ...rpc.Option) (*fee.Config, error) { +func (_m *PClient) GetFeeConfig(ctx context.Context, options ...rpc.Option) (*gas.Config, error) { _va := make([]interface{}, len(options)) for _i := range options { _va[_i] = options[_i] @@ -400,16 +400,16 @@ func (_m *PClient) GetFeeConfig(ctx context.Context, options ...rpc.Option) (*fe panic("no return value specified for GetFeeConfig") } - var r0 *fee.Config + var r0 *gas.Config var r1 error - if rf, ok := ret.Get(0).(func(context.Context, ...rpc.Option) (*fee.Config, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, ...rpc.Option) (*gas.Config, error)); ok { return rf(ctx, options...) } - if rf, ok := ret.Get(0).(func(context.Context, ...rpc.Option) *fee.Config); ok { + if rf, ok := ret.Get(0).(func(context.Context, ...rpc.Option) *gas.Config); ok { r0 = rf(ctx, options...) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*fee.Config) + r0 = ret.Get(0).(*gas.Config) } } @@ -423,7 +423,7 @@ func (_m *PClient) GetFeeConfig(ctx context.Context, options ...rpc.Option) (*fe } // GetFeeState provides a mock function with given fields: ctx, options -func (_m *PClient) GetFeeState(ctx context.Context, options ...rpc.Option) (fee.State, fee.GasPrice, time.Time, error) { +func (_m *PClient) GetFeeState(ctx context.Context, options ...rpc.Option) (gas.State, gas.Price, time.Time, error) { _va := make([]interface{}, len(options)) for _i := range options { _va[_i] = options[_i] @@ -437,23 +437,23 @@ func (_m *PClient) GetFeeState(ctx context.Context, options ...rpc.Option) (fee. panic("no return value specified for GetFeeState") } - var r0 fee.State - var r1 fee.GasPrice + var r0 gas.State + var r1 gas.Price var r2 time.Time var r3 error - if rf, ok := ret.Get(0).(func(context.Context, ...rpc.Option) (fee.State, fee.GasPrice, time.Time, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, ...rpc.Option) (gas.State, gas.Price, time.Time, error)); ok { return rf(ctx, options...) } - if rf, ok := ret.Get(0).(func(context.Context, ...rpc.Option) fee.State); ok { + if rf, ok := ret.Get(0).(func(context.Context, ...rpc.Option) gas.State); ok { r0 = rf(ctx, options...) } else { - r0 = ret.Get(0).(fee.State) + r0 = ret.Get(0).(gas.State) } - if rf, ok := ret.Get(1).(func(context.Context, ...rpc.Option) fee.GasPrice); ok { + if rf, ok := ret.Get(1).(func(context.Context, ...rpc.Option) gas.Price); ok { r1 = rf(ctx, options...) } else { - r1 = ret.Get(1).(fee.GasPrice) + r1 = ret.Get(1).(gas.Price) } if rf, ok := ret.Get(2).(func(context.Context, ...rpc.Option) time.Time); ok { diff --git a/internal/mocks/plugin_binary_downloader.go b/internal/mocks/plugin_binary_downloader.go index 465ebf69e..1972dbd49 100644 --- a/internal/mocks/plugin_binary_downloader.go +++ b/internal/mocks/plugin_binary_downloader.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.42.1. DO NOT EDIT. +// Code generated by mockery v2.43.2. DO NOT EDIT. package mocks diff --git a/internal/mocks/process_checker.go b/internal/mocks/process_checker.go index 39602919b..2398cd337 100644 --- a/internal/mocks/process_checker.go +++ b/internal/mocks/process_checker.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.42.1. DO NOT EDIT. +// Code generated by mockery v2.43.2. DO NOT EDIT. package mocks diff --git a/internal/mocks/prompter.go b/internal/mocks/prompter.go index 0d38e7b05..ce4923a2d 100644 --- a/internal/mocks/prompter.go +++ b/internal/mocks/prompter.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.42.1. DO NOT EDIT. +// Code generated by mockery v2.26.1. DO NOT EDIT. package mocks @@ -28,10 +28,6 @@ type Prompter struct { func (_m *Prompter) CaptureAddress(promptStr string) (common.Address, error) { ret := _m.Called(promptStr) - if len(ret) == 0 { - panic("no return value specified for CaptureAddress") - } - var r0 common.Address var r1 error if rf, ok := ret.Get(0).(func(string) (common.Address, error)); ok { @@ -58,10 +54,6 @@ func (_m *Prompter) CaptureAddress(promptStr string) (common.Address, error) { func (_m *Prompter) CaptureAddresses(promptStr string) ([]common.Address, error) { ret := _m.Called(promptStr) - if len(ret) == 0 { - panic("no return value specified for CaptureList") - } - var r0 []common.Address var r1 error if rf, ok := ret.Get(0).(func(string) ([]common.Address, error)); ok { @@ -70,7 +62,9 @@ func (_m *Prompter) CaptureAddresses(promptStr string) ([]common.Address, error) if rf, ok := ret.Get(0).(func(string) []common.Address); ok { r0 = rf(promptStr) } else { - r0 = ret.Get(0).([]common.Address) + if ret.Get(0) != nil { + r0 = ret.Get(0).([]common.Address) + } } if rf, ok := ret.Get(1).(func(string) error); ok { @@ -86,10 +80,6 @@ func (_m *Prompter) CaptureAddresses(promptStr string) ([]common.Address, error) func (_m *Prompter) CaptureDate(promptStr string) (time.Time, error) { ret := _m.Called(promptStr) - if len(ret) == 0 { - panic("no return value specified for CaptureDate") - } - var r0 time.Time var r1 error if rf, ok := ret.Get(0).(func(string) (time.Time, error)); ok { @@ -114,10 +104,6 @@ func (_m *Prompter) CaptureDate(promptStr string) (time.Time, error) { func (_m *Prompter) CaptureEmail(promptStr string) (string, error) { ret := _m.Called(promptStr) - if len(ret) == 0 { - panic("no return value specified for CaptureEmail") - } - var r0 string var r1 error if rf, ok := ret.Get(0).(func(string) (string, error)); ok { @@ -142,10 +128,6 @@ func (_m *Prompter) CaptureEmail(promptStr string) (string, error) { func (_m *Prompter) CaptureExistingFilepath(promptStr string) (string, error) { ret := _m.Called(promptStr) - if len(ret) == 0 { - panic("no return value specified for CaptureExistingFilepath") - } - var r0 string var r1 error if rf, ok := ret.Get(0).(func(string) (string, error)); ok { @@ -170,10 +152,6 @@ func (_m *Prompter) CaptureExistingFilepath(promptStr string) (string, error) { func (_m *Prompter) CaptureFloat(promptStr string, validator func(float64) error) (float64, error) { ret := _m.Called(promptStr, validator) - if len(ret) == 0 { - panic("no return value specified for CaptureFloat") - } - var r0 float64 var r1 error if rf, ok := ret.Get(0).(func(string, func(float64) error) (float64, error)); ok { @@ -198,10 +176,6 @@ func (_m *Prompter) CaptureFloat(promptStr string, validator func(float64) error func (_m *Prompter) CaptureFujiDuration(promptStr string) (time.Duration, error) { ret := _m.Called(promptStr) - if len(ret) == 0 { - panic("no return value specified for CaptureFujiDuration") - } - var r0 time.Duration var r1 error if rf, ok := ret.Get(0).(func(string) (time.Duration, error)); ok { @@ -226,10 +200,6 @@ func (_m *Prompter) CaptureFujiDuration(promptStr string) (time.Duration, error) func (_m *Prompter) CaptureFutureDate(promptStr string, minDate time.Time) (time.Time, error) { ret := _m.Called(promptStr, minDate) - if len(ret) == 0 { - panic("no return value specified for CaptureFutureDate") - } - var r0 time.Time var r1 error if rf, ok := ret.Get(0).(func(string, time.Time) (time.Time, error)); ok { @@ -254,10 +224,6 @@ func (_m *Prompter) CaptureFutureDate(promptStr string, minDate time.Time) (time func (_m *Prompter) CaptureGitURL(promptStr string) (*url.URL, error) { ret := _m.Called(promptStr) - if len(ret) == 0 { - panic("no return value specified for CaptureGitURL") - } - var r0 *url.URL var r1 error if rf, ok := ret.Get(0).(func(string) (*url.URL, error)); ok { @@ -284,10 +250,6 @@ func (_m *Prompter) CaptureGitURL(promptStr string) (*url.URL, error) { func (_m *Prompter) CaptureID(promptStr string) (ids.ID, error) { ret := _m.Called(promptStr) - if len(ret) == 0 { - panic("no return value specified for CaptureID") - } - var r0 ids.ID var r1 error if rf, ok := ret.Get(0).(func(string) (ids.ID, error)); ok { @@ -314,10 +276,6 @@ func (_m *Prompter) CaptureID(promptStr string) (ids.ID, error) { func (_m *Prompter) CaptureIndex(promptStr string, options []interface{}) (int, error) { ret := _m.Called(promptStr, options) - if len(ret) == 0 { - panic("no return value specified for CaptureIndex") - } - var r0 int var r1 error if rf, ok := ret.Get(0).(func(string, []interface{}) (int, error)); ok { @@ -342,10 +300,6 @@ func (_m *Prompter) CaptureIndex(promptStr string, options []interface{}) (int, func (_m *Prompter) CaptureInt(promptStr string) (int, error) { ret := _m.Called(promptStr) - if len(ret) == 0 { - panic("no return value specified for CaptureInt") - } - var r0 int var r1 error if rf, ok := ret.Get(0).(func(string) (int, error)); ok { @@ -370,10 +324,6 @@ func (_m *Prompter) CaptureInt(promptStr string) (int, error) { func (_m *Prompter) CaptureList(promptStr string, options []string) (string, error) { ret := _m.Called(promptStr, options) - if len(ret) == 0 { - panic("no return value specified for CaptureList") - } - var r0 string var r1 error if rf, ok := ret.Get(0).(func(string, []string) (string, error)); ok { @@ -398,10 +348,6 @@ func (_m *Prompter) CaptureList(promptStr string, options []string) (string, err func (_m *Prompter) CaptureListWithSize(promptStr string, options []string, size int) (string, error) { ret := _m.Called(promptStr, options, size) - if len(ret) == 0 { - panic("no return value specified for CaptureListWithSize") - } - var r0 string var r1 error if rf, ok := ret.Get(0).(func(string, []string, int) (string, error)); ok { @@ -426,10 +372,6 @@ func (_m *Prompter) CaptureListWithSize(promptStr string, options []string, size func (_m *Prompter) CaptureMainnetDuration(promptStr string) (time.Duration, error) { ret := _m.Called(promptStr) - if len(ret) == 0 { - panic("no return value specified for CaptureMainnetDuration") - } - var r0 time.Duration var r1 error if rf, ok := ret.Get(0).(func(string) (time.Duration, error)); ok { @@ -454,10 +396,6 @@ func (_m *Prompter) CaptureMainnetDuration(promptStr string) (time.Duration, err func (_m *Prompter) CaptureNewFilepath(promptStr string) (string, error) { ret := _m.Called(promptStr) - if len(ret) == 0 { - panic("no return value specified for CaptureNewFilepath") - } - var r0 string var r1 error if rf, ok := ret.Get(0).(func(string) (string, error)); ok { @@ -482,10 +420,6 @@ func (_m *Prompter) CaptureNewFilepath(promptStr string) (string, error) { func (_m *Prompter) CaptureNoYes(promptStr string) (bool, error) { ret := _m.Called(promptStr) - if len(ret) == 0 { - panic("no return value specified for CaptureNoYes") - } - var r0 bool var r1 error if rf, ok := ret.Get(0).(func(string) (bool, error)); ok { @@ -510,10 +444,6 @@ func (_m *Prompter) CaptureNoYes(promptStr string) (bool, error) { func (_m *Prompter) CaptureNodeID(promptStr string) (ids.NodeID, error) { ret := _m.Called(promptStr) - if len(ret) == 0 { - panic("no return value specified for CaptureNodeID") - } - var r0 ids.NodeID var r1 error if rf, ok := ret.Get(0).(func(string) (ids.NodeID, error)); ok { @@ -540,10 +470,6 @@ func (_m *Prompter) CaptureNodeID(promptStr string) (ids.NodeID, error) { func (_m *Prompter) CapturePChainAddress(promptStr string, network models.Network) (string, error) { ret := _m.Called(promptStr, network) - if len(ret) == 0 { - panic("no return value specified for CapturePChainAddress") - } - var r0 string var r1 error if rf, ok := ret.Get(0).(func(string, models.Network) (string, error)); ok { @@ -568,10 +494,6 @@ func (_m *Prompter) CapturePChainAddress(promptStr string, network models.Networ func (_m *Prompter) CapturePositiveBigInt(promptStr string) (*big.Int, error) { ret := _m.Called(promptStr) - if len(ret) == 0 { - panic("no return value specified for CapturePositiveBigInt") - } - var r0 *big.Int var r1 error if rf, ok := ret.Get(0).(func(string) (*big.Int, error)); ok { @@ -598,10 +520,6 @@ func (_m *Prompter) CapturePositiveBigInt(promptStr string) (*big.Int, error) { func (_m *Prompter) CapturePositiveInt(promptStr string, comparators []prompts.Comparator) (int, error) { ret := _m.Called(promptStr, comparators) - if len(ret) == 0 { - panic("no return value specified for CapturePositiveInt") - } - var r0 int var r1 error if rf, ok := ret.Get(0).(func(string, []prompts.Comparator) (int, error)); ok { @@ -626,10 +544,6 @@ func (_m *Prompter) CapturePositiveInt(promptStr string, comparators []prompts.C func (_m *Prompter) CaptureRepoBranch(promptStr string, repo string) (string, error) { ret := _m.Called(promptStr, repo) - if len(ret) == 0 { - panic("no return value specified for CaptureRepoBranch") - } - var r0 string var r1 error if rf, ok := ret.Get(0).(func(string, string) (string, error)); ok { @@ -654,10 +568,6 @@ func (_m *Prompter) CaptureRepoBranch(promptStr string, repo string) (string, er func (_m *Prompter) CaptureRepoFile(promptStr string, repo string, branch string) (string, error) { ret := _m.Called(promptStr, repo, branch) - if len(ret) == 0 { - panic("no return value specified for CaptureRepoFile") - } - var r0 string var r1 error if rf, ok := ret.Get(0).(func(string, string, string) (string, error)); ok { @@ -682,10 +592,6 @@ func (_m *Prompter) CaptureRepoFile(promptStr string, repo string, branch string func (_m *Prompter) CaptureString(promptStr string) (string, error) { ret := _m.Called(promptStr) - if len(ret) == 0 { - panic("no return value specified for CaptureString") - } - var r0 string var r1 error if rf, ok := ret.Get(0).(func(string) (string, error)); ok { @@ -710,10 +616,6 @@ func (_m *Prompter) CaptureString(promptStr string) (string, error) { func (_m *Prompter) CaptureStringAllowEmpty(promptStr string) (string, error) { ret := _m.Called(promptStr) - if len(ret) == 0 { - panic("no return value specified for CaptureStringAllowEmpty") - } - var r0 string var r1 error if rf, ok := ret.Get(0).(func(string) (string, error)); ok { @@ -738,10 +640,6 @@ func (_m *Prompter) CaptureStringAllowEmpty(promptStr string) (string, error) { func (_m *Prompter) CaptureURL(promptStr string, validateConnection bool) (string, error) { ret := _m.Called(promptStr, validateConnection) - if len(ret) == 0 { - panic("no return value specified for CaptureURL") - } - var r0 string var r1 error if rf, ok := ret.Get(0).(func(string, bool) (string, error)); ok { @@ -766,10 +664,6 @@ func (_m *Prompter) CaptureURL(promptStr string, validateConnection bool) (strin func (_m *Prompter) CaptureUint32(promptStr string) (uint32, error) { ret := _m.Called(promptStr) - if len(ret) == 0 { - panic("no return value specified for CaptureUint32") - } - var r0 uint32 var r1 error if rf, ok := ret.Get(0).(func(string) (uint32, error)); ok { @@ -794,10 +688,6 @@ func (_m *Prompter) CaptureUint32(promptStr string) (uint32, error) { func (_m *Prompter) CaptureUint64(promptStr string) (uint64, error) { ret := _m.Called(promptStr) - if len(ret) == 0 { - panic("no return value specified for CaptureUint64") - } - var r0 uint64 var r1 error if rf, ok := ret.Get(0).(func(string) (uint64, error)); ok { @@ -822,10 +712,6 @@ func (_m *Prompter) CaptureUint64(promptStr string) (uint64, error) { func (_m *Prompter) CaptureUint64Compare(promptStr string, comparators []prompts.Comparator) (uint64, error) { ret := _m.Called(promptStr, comparators) - if len(ret) == 0 { - panic("no return value specified for CaptureUint64Compare") - } - var r0 uint64 var r1 error if rf, ok := ret.Get(0).(func(string, []prompts.Comparator) (uint64, error)); ok { @@ -850,10 +736,6 @@ func (_m *Prompter) CaptureUint64Compare(promptStr string, comparators []prompts func (_m *Prompter) CaptureValidatedString(promptStr string, validator func(string) error) (string, error) { ret := _m.Called(promptStr, validator) - if len(ret) == 0 { - panic("no return value specified for CaptureValidatedString") - } - var r0 string var r1 error if rf, ok := ret.Get(0).(func(string, func(string) error) (string, error)); ok { @@ -878,10 +760,6 @@ func (_m *Prompter) CaptureValidatedString(promptStr string, validator func(stri func (_m *Prompter) CaptureVersion(promptStr string) (string, error) { ret := _m.Called(promptStr) - if len(ret) == 0 { - panic("no return value specified for CaptureVersion") - } - var r0 string var r1 error if rf, ok := ret.Get(0).(func(string) (string, error)); ok { @@ -906,10 +784,6 @@ func (_m *Prompter) CaptureVersion(promptStr string) (string, error) { func (_m *Prompter) CaptureWeight(promptStr string) (uint64, error) { ret := _m.Called(promptStr) - if len(ret) == 0 { - panic("no return value specified for CaptureWeight") - } - var r0 uint64 var r1 error if rf, ok := ret.Get(0).(func(string) (uint64, error)); ok { @@ -934,10 +808,6 @@ func (_m *Prompter) CaptureWeight(promptStr string) (uint64, error) { func (_m *Prompter) CaptureXChainAddress(promptStr string, network models.Network) (string, error) { ret := _m.Called(promptStr, network) - if len(ret) == 0 { - panic("no return value specified for CaptureXChainAddress") - } - var r0 string var r1 error if rf, ok := ret.Get(0).(func(string, models.Network) (string, error)); ok { @@ -962,10 +832,6 @@ func (_m *Prompter) CaptureXChainAddress(promptStr string, network models.Networ func (_m *Prompter) CaptureYesNo(promptStr string) (bool, error) { ret := _m.Called(promptStr) - if len(ret) == 0 { - panic("no return value specified for CaptureYesNo") - } - var r0 bool var r1 error if rf, ok := ret.Get(0).(func(string) (bool, error)); ok { @@ -990,10 +856,6 @@ func (_m *Prompter) CaptureYesNo(promptStr string) (bool, error) { func (_m *Prompter) ChooseKeyOrLedger(goal string) (bool, error) { ret := _m.Called(goal) - if len(ret) == 0 { - panic("no return value specified for ChooseKeyOrLedger") - } - var r0 bool var r1 error if rf, ok := ret.Get(0).(func(string) (bool, error)); ok { @@ -1014,12 +876,13 @@ func (_m *Prompter) ChooseKeyOrLedger(goal string) (bool, error) { return r0, r1 } -// NewPrompter creates a new instance of Prompter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewPrompter(t interface { +type mockConstructorTestingTNewPrompter interface { mock.TestingT Cleanup(func()) -}) *Prompter { +} + +// NewPrompter creates a new instance of Prompter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewPrompter(t mockConstructorTestingTNewPrompter) *Prompter { mock := &Prompter{} mock.Mock.Test(t) diff --git a/internal/mocks/publisher.go b/internal/mocks/publisher.go index 743dbe573..45d6028a6 100644 --- a/internal/mocks/publisher.go +++ b/internal/mocks/publisher.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.42.1. DO NOT EDIT. +// Code generated by mockery v2.43.2. DO NOT EDIT. package mocks diff --git a/pkg/constants/constants.go b/pkg/constants/constants.go index df572b316..904daecd6 100644 --- a/pkg/constants/constants.go +++ b/pkg/constants/constants.go @@ -98,6 +98,7 @@ const ( Cortina17Version = "v1.10.17" Durango11Version = "v1.11.11" + Durango12Version = "v1.11.12" BootstrapSnapshotRawBranch = "https://github.com/ava-labs/avalanche-cli/raw/main/" @@ -135,6 +136,16 @@ const ( BootstrapSnapshotSingleNodePreDurango11URL = BootstrapSnapshotRawBranch + BootstrapSnapshotSingleNodePreDurango11LocalPath BootstrapSnapshotSingleNodePreDurango11SHA256URL = BootstrapSnapshotRawBranch + AssetsDir + "sha256sumSingleNode.PreDurango11.txt" + BootstrapSnapshotPreDurango12ArchiveName = "bootstrapSnapshot.PreDurango12.tar.gz" + BootstrapSnapshotPreDurango12LocalPath = AssetsDir + BootstrapSnapshotPreDurango12ArchiveName + BootstrapSnapshotPreDurango12URL = BootstrapSnapshotRawBranch + BootstrapSnapshotPreDurango12LocalPath + BootstrapSnapshotPreDurango12SHA256URL = BootstrapSnapshotRawBranch + AssetsDir + "sha256sum.PreDurango12.txt" + + BootstrapSnapshotSingleNodePreDurango12ArchiveName = "bootstrapSnapshotSingleNode.PreDurango12.tar.gz" + BootstrapSnapshotSingleNodePreDurango12LocalPath = AssetsDir + BootstrapSnapshotSingleNodePreDurango12ArchiveName + BootstrapSnapshotSingleNodePreDurango12URL = BootstrapSnapshotRawBranch + BootstrapSnapshotSingleNodePreDurango12LocalPath + BootstrapSnapshotSingleNodePreDurango12SHA256URL = BootstrapSnapshotRawBranch + AssetsDir + "sha256sumSingleNode.PreDurango12.txt" + ExtraLocalNetworkDataFilename = "extra-local-network-data.json" CliInstallationURL = "https://raw.githubusercontent.com/ava-labs/avalanche-cli/main/scripts/install.sh" diff --git a/pkg/docker/image.go b/pkg/docker/image.go index c5627be1f..105346083 100644 --- a/pkg/docker/image.go +++ b/pkg/docker/image.go @@ -5,10 +5,13 @@ package docker import ( "fmt" + "os" + "path/filepath" "strings" "github.com/ava-labs/avalanche-cli/pkg/constants" "github.com/ava-labs/avalanche-cli/pkg/models" + "github.com/ava-labs/avalanche-cli/pkg/utils" "github.com/ava-labs/avalanche-cli/pkg/ux" ) @@ -38,10 +41,34 @@ func parseDockerImageListOutput(output []byte) []string { return strings.Split(string(output), "\n") } +func parseRemoteGoModFile(path string, host *models.Host) (string, error) { + goMod := filepath.Join(path, "go.mod") + // download and parse go.mod + tmpFile, err := os.CreateTemp("", "go-mod-*.txt") + if err != nil { + return "", err + } + defer os.Remove(tmpFile.Name()) + if err := host.Download(goMod, tmpFile.Name(), constants.SSHFileOpsTimeout); err != nil { + return "", err + } + return utils.ReadGoVersion(tmpFile.Name()) +} + // BuildDockerImage builds a docker image on a remote host. func BuildDockerImage(host *models.Host, image string, path string, dockerfile string) error { - _, err := host.Command(fmt.Sprintf("cd %s && docker build -q --build-arg GO_VERSION=%s -t %s -f %s .", path, constants.BuildEnvGolangVersion, image, dockerfile), nil, constants.SSHLongRunningScriptTimeout) - return err + goVersion, err := parseRemoteGoModFile(path, host) + if err != nil { + // fall back to default + ux.Logger.Info("failed to read go version from go.mod: %s. falling back to default", err) + goVersion = constants.BuildEnvGolangVersion + } + cmd := fmt.Sprintf("cd %s && docker build -q --build-arg GO_VERSION=%s -t %s -f %s .", path, goVersion, image, dockerfile) + _, err = host.Command(cmd, nil, constants.SSHLongRunningScriptTimeout) + if err != nil { + return fmt.Errorf("failed to build docker image %s: %w", image, err) + } + return nil } // BuildDockerImageFromGitRepo builds a docker image from a git repo on a remote host. @@ -59,7 +86,7 @@ func BuildDockerImageFromGitRepo(host *models.Host, image string, gitRepo string } }() // clone the repo and checkout commit - if _, err := host.Command(fmt.Sprintf("git clone %s %s && cd %s && git checkout %s ", gitRepo, tmpDir, tmpDir, commit), nil, constants.SSHLongRunningScriptTimeout); err != nil { + if _, err := host.Command(fmt.Sprintf("git clone %s %s && cd %s && git checkout %s", gitRepo, tmpDir, tmpDir, commit), nil, constants.SSHLongRunningScriptTimeout); err != nil { return err } // build the image diff --git a/pkg/evm/evm.go b/pkg/evm/evm.go index 92ade8440..2982c0279 100644 --- a/pkg/evm/evm.go +++ b/pkg/evm/evm.go @@ -6,6 +6,8 @@ import ( "crypto/ecdsa" "fmt" "math/big" + "net/url" + "strings" "time" "github.com/ava-labs/avalanche-cli/pkg/utils" @@ -259,15 +261,80 @@ func SendTransaction( return err } +func FindOutScheme(rpcURL string) (ethclient.Client, string, error) { + if b, err := HasScheme(rpcURL); err != nil { + return nil, "", err + } else if b { + return nil, "", fmt.Errorf("url does have scheme") + } + notDeterminedErr := fmt.Errorf("url %s has no scheme and protocol could not be determined", rpcURL) + // let's start with ws it always give same error for http/https/wss + scheme := "ws://" + ctx, cancel := utils.GetAPILargeContext() + defer cancel() + client, err := ethclient.DialContext(ctx, scheme+rpcURL) + if err == nil { + return client, scheme, nil + } else if !strings.Contains(err.Error(), "websocket: bad handshake") { + return nil, "", notDeterminedErr + } + // wss give specific errors for http/http + scheme = "wss://" + client, err = ethclient.DialContext(ctx, scheme+rpcURL) + if err == nil { + return client, scheme, nil + } else if !strings.Contains(err.Error(), "websocket: bad handshake") && // may be https + !strings.Contains(err.Error(), "first record does not look like a TLS handshake") { // may be http + return nil, "", notDeterminedErr + } + // https/http discrimination based on sending a specific query + scheme = "https://" + client, err = ethclient.DialContext(ctx, scheme+rpcURL) + if err == nil { + _, err = client.ChainID(ctx) + switch { + case err == nil: + return client, scheme, nil + case strings.Contains(err.Error(), "server gave HTTP response to HTTPS client"): + scheme = "http://" + client, err = ethclient.DialContext(ctx, scheme+rpcURL) + if err == nil { + return client, scheme, nil + } + } + } + return nil, "", notDeterminedErr +} + +func HasScheme(rpcURL string) (bool, error) { + if parsedURL, err := url.Parse(rpcURL); err != nil { + if !strings.Contains(err.Error(), "first path segment in URL cannot contain colon") { + return false, err + } + return false, nil + } else if parsedURL.Scheme == "" { + return false, nil + } + return true, nil +} + func GetClient(rpcURL string) (ethclient.Client, error) { var ( client ethclient.Client err error ) + hasScheme, err := HasScheme(rpcURL) + if err != nil { + return nil, err + } for i := 0; i < repeatsOnFailure; i++ { ctx, cancel := utils.GetAPILargeContext() defer cancel() - client, err = ethclient.DialContext(ctx, rpcURL) + if hasScheme { + client, err = ethclient.DialContext(ctx, rpcURL) + } else { + client, _, err = FindOutScheme(rpcURL) + } if err == nil { break } diff --git a/pkg/ictt/deploy.go b/pkg/ictt/deploy.go index 93433d444..657de44fd 100644 --- a/pkg/ictt/deploy.go +++ b/pkg/ictt/deploy.go @@ -10,6 +10,7 @@ import ( "github.com/ava-labs/avalanche-cli/pkg/contract" "github.com/ava-labs/avalanche-cli/pkg/utils" + "github.com/ava-labs/avalanche-cli/pkg/ux" "github.com/ethereum/go-ethereum/common" ) @@ -26,11 +27,12 @@ type TokenRemoteSettings struct { TokenHomeDecimals uint8 } -func RegisterERC20Remote( +func RegisterRemote( rpcURL string, privateKey string, remoteAddress common.Address, ) error { + ux.Logger.PrintToUser("Registering remote contract with home contract") feeInfo := TeleporterFeeInfo{ Amount: big.NewInt(0), } diff --git a/pkg/ictt/operate.go b/pkg/ictt/operate.go index 6b173e8b5..02689dc85 100644 --- a/pkg/ictt/operate.go +++ b/pkg/ictt/operate.go @@ -8,6 +8,7 @@ import ( "math/big" "github.com/ava-labs/avalanche-cli/pkg/contract" + "github.com/ava-labs/avalanche-cli/pkg/ux" "github.com/ava-labs/avalanchego/ids" "github.com/ethereum/go-ethereum/common" ) @@ -458,6 +459,7 @@ func TokenHomeAddCollateral( remoteAddress common.Address, amount *big.Int, ) error { + ux.Logger.PrintToUser("Collateralizing remote contract on the home chain") endpointKind, err := GetEndpointKind( rpcURL, homeAddress, diff --git a/pkg/prompts/prompts.go b/pkg/prompts/prompts.go index b19254d86..d1b2983a5 100644 --- a/pkg/prompts/prompts.go +++ b/pkg/prompts/prompts.go @@ -758,7 +758,7 @@ func (prompter *realPrompter) ChooseKeyOrLedger(goal string) (bool, error) { ledgerOption = "Use ledger" ) option, err := prompter.CaptureList( - fmt.Sprintf("Which key source should be used to %s?", goal), + fmt.Sprintf("Which key should be used %s?", goal), []string{keyOption, ledgerOption}, ) if err != nil { @@ -871,7 +871,7 @@ func CaptureKeyName(prompt Prompter, goal string, keyDir string, includeEwoq boo if size > 10 { size = 10 } - keyName, err := prompt.CaptureListWithSize(fmt.Sprintf("Which stored key should be used to %s?", goal), keyNames, size) + keyName, err := prompt.CaptureListWithSize(fmt.Sprintf("Which stored key should be used %s?", goal), keyNames, size) if err != nil { return "", err } diff --git a/pkg/subnet/local.go b/pkg/subnet/local.go index cd6efa2af..6dbbf5d33 100644 --- a/pkg/subnet/local.go +++ b/pkg/subnet/local.go @@ -669,7 +669,12 @@ func (d *LocalDeployer) removeInstalledPlugin( return d.binaryDownloader.RemoveVM(vmID.String()) } -func getSnapshotLocs(isSingleNode bool, isPreCortina17 bool, isPreDurango11 bool) (string, string, string, string) { +func getSnapshotLocs( + isSingleNode bool, + isPreCortina17 bool, + isPreDurango11 bool, + isPreDurango12 bool, +) (string, string, string, string) { bootstrapSnapshotArchiveName := "" url := "" shaSumURL := "" @@ -686,6 +691,11 @@ func getSnapshotLocs(isSingleNode bool, isPreCortina17 bool, isPreDurango11 bool url = constants.BootstrapSnapshotSingleNodePreDurango11URL shaSumURL = constants.BootstrapSnapshotSingleNodePreDurango11SHA256URL pathInShaSum = constants.BootstrapSnapshotSingleNodePreDurango11LocalPath + case isPreDurango12: + bootstrapSnapshotArchiveName = constants.BootstrapSnapshotSingleNodePreDurango12ArchiveName + url = constants.BootstrapSnapshotSingleNodePreDurango12URL + shaSumURL = constants.BootstrapSnapshotSingleNodePreDurango12SHA256URL + pathInShaSum = constants.BootstrapSnapshotSingleNodePreDurango12LocalPath default: bootstrapSnapshotArchiveName = constants.BootstrapSnapshotSingleNodeArchiveName url = constants.BootstrapSnapshotSingleNodeURL @@ -704,6 +714,11 @@ func getSnapshotLocs(isSingleNode bool, isPreCortina17 bool, isPreDurango11 bool url = constants.BootstrapSnapshotPreDurango11URL shaSumURL = constants.BootstrapSnapshotPreDurango11SHA256URL pathInShaSum = constants.BootstrapSnapshotPreDurango11LocalPath + case isPreDurango12: + bootstrapSnapshotArchiveName = constants.BootstrapSnapshotPreDurango12ArchiveName + url = constants.BootstrapSnapshotPreDurango12URL + shaSumURL = constants.BootstrapSnapshotPreDurango12SHA256URL + pathInShaSum = constants.BootstrapSnapshotPreDurango12LocalPath default: bootstrapSnapshotArchiveName = constants.BootstrapSnapshotArchiveName url = constants.BootstrapSnapshotURL @@ -714,8 +729,13 @@ func getSnapshotLocs(isSingleNode bool, isPreCortina17 bool, isPreDurango11 bool return bootstrapSnapshotArchiveName, url, shaSumURL, pathInShaSum } -func getExpectedDefaultSnapshotSHA256Sum(isSingleNode bool, isPreCortina17 bool, isPreDurango11 bool) (string, error) { - _, _, url, path := getSnapshotLocs(isSingleNode, isPreCortina17, isPreDurango11) +func getExpectedDefaultSnapshotSHA256Sum( + isSingleNode bool, + isPreCortina17 bool, + isPreDurango11 bool, + isPreDurango12 bool, +) (string, error) { + _, _, url, path := getSnapshotLocs(isSingleNode, isPreCortina17, isPreDurango11, isPreDurango12) resp, err := http.Get(url) if err != nil { return "", fmt.Errorf("failed downloading sha256 sums: %w", err) @@ -741,12 +761,14 @@ func SetDefaultSnapshot(snapshotsDir string, resetCurrentSnapshot bool, avagoVer var ( isPreCortina17 bool isPreDurango11 bool + isPreDurango12 bool ) if avagoVersion != "" { isPreCortina17 = semver.Compare(avagoVersion, constants.Cortina17Version) < 0 isPreDurango11 = semver.Compare(avagoVersion, constants.Durango11Version) < 0 + isPreDurango12 = semver.Compare(avagoVersion, constants.Durango12Version) < 0 } - bootstrapSnapshotArchiveName, url, _, _ := getSnapshotLocs(isSingleNode, isPreCortina17, isPreDurango11) + bootstrapSnapshotArchiveName, url, _, _ := getSnapshotLocs(isSingleNode, isPreCortina17, isPreDurango11, isPreDurango12) currentBootstrapNamePath := filepath.Join(snapshotsDir, constants.CurrentBootstrapNamePath) exists, err := storage.FileExists(currentBootstrapNamePath) if err != nil { @@ -781,7 +803,7 @@ func SetDefaultSnapshot(snapshotsDir string, resetCurrentSnapshot bool, avagoVer if err != nil { return false, err } - expectedSum, err := getExpectedDefaultSnapshotSHA256Sum(isSingleNode, isPreCortina17, isPreDurango11) + expectedSum, err := getExpectedDefaultSnapshotSHA256Sum(isSingleNode, isPreCortina17, isPreDurango11, isPreDurango12) if err != nil { ux.Logger.PrintToUser("Warning: failure verifying that the local snapshot is the latest one: %s", err) } else if gotSum != expectedSum { diff --git a/pkg/utils/file.go b/pkg/utils/file.go index 3898b3d00..c276f71bd 100644 --- a/pkg/utils/file.go +++ b/pkg/utils/file.go @@ -8,6 +8,7 @@ import ( "path/filepath" "github.com/ava-labs/avalanche-cli/pkg/constants" + "golang.org/x/mod/modfile" ) func NonEmptyDirectory(dirName string) (bool, error) { @@ -127,3 +128,19 @@ func GetRemoteComposeServicePath(serviceName string, dirs ...string) string { servicePrefix := filepath.Join(constants.CloudNodeCLIConfigBasePath, "services", serviceName) return filepath.Join(append([]string{servicePrefix}, dirs...)...) } + +// ReadGoVersion reads the Go version from the go.mod file +func ReadGoVersion(filePath string) (string, error) { + data, err := os.ReadFile(filePath) + if err != nil { + return "", err + } + modFile, err := modfile.Parse(filePath, data, nil) + if err != nil { + return "", err + } + if modFile.Go != nil { + return modFile.Go.Version, nil + } + return "", fmt.Errorf("go version not found in %s", filePath) +} diff --git a/pkg/utils/file_test.go b/pkg/utils/file_test.go index de9c42ccb..f500cd82d 100644 --- a/pkg/utils/file_test.go +++ b/pkg/utils/file_test.go @@ -44,3 +44,57 @@ func TestExpandHome(t *testing.T) { t.Errorf("ExpandHome failed for empty path: expected %s, got %s", expectedEmptyPath, expandedEmptyPath) } } + +// createTempGoMod creates a temporary go.mod file with the provided content. +func createTempGoMod(t *testing.T, content string) string { + t.Helper() + file, err := os.CreateTemp("", "go.mod") + if err != nil { + t.Fatal(err) + } + + if _, err := file.Write([]byte(content)); err != nil { + t.Fatal(err) + } + + if err := file.Close(); err != nil { + t.Fatal(err) + } + + return file.Name() +} + +// TestReadGoVersion tests all scenarios in one function using sub-tests. +func TestReadGoVersion(t *testing.T) { + t.Run("Success", func(t *testing.T) { + tempFile := createTempGoMod(t, "module example.com/test\n\ngo 1.23\n") + defer os.Remove(tempFile) // Clean up the temp file + + version, err := ReadGoVersion(tempFile) + if err != nil { + t.Fatalf("expected no error, got %v", err) + } + + expectedVersion := "1.23" + if version != expectedVersion { + t.Errorf("expected version %s, got %s", expectedVersion, version) + } + }) + + t.Run("NoVersion", func(t *testing.T) { + tempFile := createTempGoMod(t, "module example.com/test\n") + defer os.Remove(tempFile) + + _, err := ReadGoVersion(tempFile) + if err == nil { + t.Fatalf("expected an error, but got none") + } + }) + + t.Run("InvalidFile", func(t *testing.T) { + _, err := ReadGoVersion("nonexistent-go.mod") + if err == nil { + t.Fatalf("expected an error for nonexistent file, but got none") + } + }) +} diff --git a/tests/e2e/testcases/key/suite.go b/tests/e2e/testcases/key/suite.go index a13cd4c95..4b954336f 100644 --- a/tests/e2e/testcases/key/suite.go +++ b/tests/e2e/testcases/key/suite.go @@ -11,7 +11,6 @@ import ( "github.com/ava-labs/avalanche-cli/pkg/constants" "github.com/ava-labs/avalanche-cli/tests/e2e/commands" "github.com/ava-labs/avalanche-cli/tests/e2e/utils" - "github.com/ava-labs/avalanchego/genesis" "github.com/ava-labs/avalanchego/utils/units" ginkgo "github.com/onsi/ginkgo/v2" "github.com/onsi/gomega" @@ -269,7 +268,6 @@ var _ = ginkgo.Describe("[Key]", func() { amount := 0.2 amountStr := fmt.Sprintf("%.2f", amount) - feeNAvax := genesis.LocalParams.TxFeeConfig.StaticFeeConfig.TxFee * 1 amountNAvax := uint64(amount * float64(units.Avax)) // send/receive without recovery @@ -287,13 +285,16 @@ var _ = ginkgo.Describe("[Key]", func() { } gomega.Expect(err).Should(gomega.BeNil()) + feeNAvax, err := utils.GetKeyTransferFee(output) + gomega.Expect(err).Should(gomega.BeNil()) + output, err = commands.ListKeys("local", true, true) gomega.Expect(err).Should(gomega.BeNil()) _, keyBalance2, err := utils.ParseAddrBalanceFromKeyListOutput(output, keyName) gomega.Expect(err).Should(gomega.BeNil()) _, ewoqKeyBalance2, err := utils.ParseAddrBalanceFromKeyListOutput(output, ewoqKeyName) gomega.Expect(err).Should(gomega.BeNil()) - gomega.Expect(ewoqKeyBalance1 - ewoqKeyBalance2).Should(gomega.Equal(feeNAvax + amountNAvax)) + gomega.Expect(feeNAvax + amountNAvax).Should(gomega.Equal(ewoqKeyBalance1 - ewoqKeyBalance2)) gomega.Expect(keyBalance2 - keyBalance1).Should(gomega.Equal(amountNAvax)) output, err = commands.ListKeys("local", true, true) diff --git a/tests/e2e/testcases/packageman/suite.go b/tests/e2e/testcases/packageman/suite.go index 7812a12c9..cdb302911 100644 --- a/tests/e2e/testcases/packageman/suite.go +++ b/tests/e2e/testcases/packageman/suite.go @@ -113,6 +113,7 @@ var _ = ginkgo.Describe("[Package Management]", ginkgo.Ordered, func() { }) ginkgo.It("can deploy with multiple avalanchego versions", func() { + ginkgo.Skip("skipped until two consecutive avago version with dynamic fees are available") // check avago install precondition gomega.Expect(utils.CheckAvalancheGoExists(binaryToVersion[utils.MultiAvago1Key])).Should(gomega.BeFalse()) gomega.Expect(utils.CheckAvalancheGoExists(binaryToVersion[utils.MultiAvago2Key])).Should(gomega.BeFalse()) diff --git a/tests/e2e/testcases/subnet/local/suite.go b/tests/e2e/testcases/subnet/local/suite.go index 235629127..6c4e445d7 100644 --- a/tests/e2e/testcases/subnet/local/suite.go +++ b/tests/e2e/testcases/subnet/local/suite.go @@ -326,7 +326,7 @@ var _ = ginkgo.Describe("[Subnet Compatibility]", func() { }) ginkgo.It("can deploy a subnet-evm with old version", func() { - subnetEVMVersion := "v0.6.6" + subnetEVMVersion := "v0.6.9" commands.CreateSubnetEvmConfigWithVersion(subnetName, utils.SubnetEvmGenesisPath, subnetEVMVersion) deployOutput := commands.DeploySubnetLocally(subnetName) @@ -349,8 +349,8 @@ var _ = ginkgo.Describe("[Subnet Compatibility]", func() { ginkgo.It("can't deploy conflicting vm versions", func() { // TODO: These shouldn't be hardcoded either - subnetEVMVersion1 := "v0.6.6" - subnetEVMVersion2 := "v0.6.2" + subnetEVMVersion1 := "v0.6.9" + subnetEVMVersion2 := "v0.6.8" commands.CreateSubnetEvmConfigWithVersion(subnetName, utils.SubnetEvmGenesisPath, subnetEVMVersion1) commands.CreateSubnetEvmConfigWithVersion(secondSubnetName, utils.SubnetEvmGenesis2Path, subnetEVMVersion2) diff --git a/tests/e2e/testcases/upgrade/suite.go b/tests/e2e/testcases/upgrade/suite.go index 52bebc2a4..fa6fe0f2a 100644 --- a/tests/e2e/testcases/upgrade/suite.go +++ b/tests/e2e/testcases/upgrade/suite.go @@ -31,11 +31,11 @@ const ( subnetName = "e2eSubnetTest" secondSubnetName = "e2eSecondSubnetTest" - subnetEVMVersion1 = "v0.6.5" - subnetEVMVersion2 = "v0.6.6" + subnetEVMVersion1 = "v0.6.9" + subnetEVMVersion2 = "v0.6.10" - avagoRPC1Version = "v1.11.4" - avagoRPC2Version = "v1.11.5" + avagoRPC1Version = "v1.11.11" + avagoRPC2Version = "v1.11.11" controlKeys = "P-custom18jma8ppw3nhx5r4ap8clazz0dps7rv5u9xde7p" keyName = "ewoq" diff --git a/tests/e2e/utils/helpers.go b/tests/e2e/utils/helpers.go index f08c6786a..9f3ac0126 100644 --- a/tests/e2e/utils/helpers.go +++ b/tests/e2e/utils/helpers.go @@ -20,6 +20,9 @@ import ( "strings" "time" + "github.com/ava-labs/avalanchego/genesis" + "github.com/ava-labs/avalanchego/utils/units" + "github.com/ava-labs/avalanche-cli/pkg/binutils" "github.com/ava-labs/avalanche-cli/pkg/constants" "github.com/ava-labs/avalanche-cli/pkg/key" @@ -1043,3 +1046,23 @@ func ExecCommand(cmdName string, args []string, showStdout bool, errorIsExpected return stdout + string(stderr) } + +func GetKeyTransferFee(output string) (uint64, error) { + feeNAvax := genesis.LocalParams.TxFeeConfig.StaticFeeConfig.TxFee * 1 + for _, line := range strings.Split(output, "\n") { + if strings.Contains(line, "Paid fee") { + lineFields := strings.Fields(line) + if len(lineFields) < 3 { + return 0, fmt.Errorf("incorrect format for fee output of key transfer: %s", line) + } + feeAvaxStr := lineFields[2] + feeAvax, err := strconv.ParseFloat(feeAvaxStr, 64) + if err != nil { + return 0, err + } + feeAvax *= float64(units.Avax) + feeNAvax = uint64(feeAvax) + } + } + return feeNAvax, nil +}