diff --git a/.github/packer/aws-ubuntu-docker.pkr.hcl b/.github/packer/aws-ubuntu-docker.pkr.hcl index 911547560..65e48a857 100644 --- a/.github/packer/aws-ubuntu-docker.pkr.hcl +++ b/.github/packer/aws-ubuntu-docker.pkr.hcl @@ -130,8 +130,8 @@ build { "docker pull prom/node-exporter:v1.7.0", "docker pull grafana/grafana:10.4.1", "docker pull prom/prometheus:v2.51.2", - "docker pull avaplatform/awm-relayer", - "docker pull golang:1.22.1-bullseye" + "docker pull avaplatform/icm-relayer:v2.0.0-fuji", + "docker pull golang:1.22.8-bullseye" ] } diff --git a/cmd/blockchaincmd/add_validator.go b/cmd/blockchaincmd/add_validator.go index cbcb64533..9b9e937d7 100644 --- a/cmd/blockchaincmd/add_validator.go +++ b/cmd/blockchaincmd/add_validator.go @@ -69,6 +69,7 @@ var ( errMutuallyExclusiveWeightOptions = errors.New("--use-default-validator-params and --weight are mutually exclusive") ErrNotPermissionedSubnet = errors.New("subnet is not permissioned") aggregatorExtraEndpoints []string + aggregatorAllowPrivatePeers bool clusterNameFlagValue string createLocalValidator bool @@ -107,6 +108,7 @@ Testnet or Mainnet.`, cmd.Flags().BoolVar(&partialSync, "partial-sync", true, "set primary network partial sync for new validators") cmd.Flags().StringVar(&nodeEndpoint, "node-endpoint", "", "gather node id/bls from publicly available avalanchego apis on the given endpoint") cmd.Flags().StringSliceVar(&aggregatorExtraEndpoints, "aggregator-extra-endpoints", nil, "endpoints for extra nodes that are needed in signature aggregation") + cmd.Flags().BoolVar(&aggregatorAllowPrivatePeers, "aggregator-allow-private-peers", true, "allow the signature aggregator to connect to peers with private IP") privateKeyFlags.AddToCmd(cmd, "to pay fees for completing the validator's registration (blockchain gas token)") cmd.Flags().StringVar(&rpcURL, "rpc", "", "connect to validator manager at the given rpc endpoint") cmd.Flags().StringVar(&aggregatorLogLevel, "aggregator-log-level", "Off", "log level to use with signature aggregator") @@ -466,6 +468,7 @@ func CallAddValidator( disableOwners, weight, extraAggregatorPeers, + aggregatorAllowPrivatePeers, aggregatorLogLevel, pos, delegationFee, @@ -497,6 +500,7 @@ func CallAddValidator( ownerPrivateKey, validationID, extraAggregatorPeers, + aggregatorAllowPrivatePeers, aggregatorLogLevel, ); err != nil { return err diff --git a/cmd/blockchaincmd/deploy.go b/cmd/blockchaincmd/deploy.go index 63ede2d04..85eff3347 100644 --- a/cmd/blockchaincmd/deploy.go +++ b/cmd/blockchaincmd/deploy.go @@ -190,6 +190,7 @@ so you can take your locally tested Subnet and deploy it on Fuji or Mainnet.`, cmd.Flags().BoolVar(&convertOnly, "convert-only", false, "avoid node track, restart and poa manager setup") cmd.Flags().StringVar(&aggregatorLogLevel, "aggregator-log-level", "Off", "log level to use with signature aggregator") cmd.Flags().StringSliceVar(&aggregatorExtraEndpoints, "aggregator-extra-endpoints", nil, "endpoints for extra nodes that are needed in signature aggregation") + cmd.Flags().BoolVar(&aggregatorAllowPrivatePeers, "aggregator-allow-private-peers", true, "allow the signature aggregator to connect to peers with private IP") cmd.Flags().BoolVar(&useLocalMachine, "use-local-machine", false, "use local machine as a blockchain validator") cmd.Flags().IntVar(&numBootstrapValidators, "num-bootstrap-validators", 0, "(only if --generate-node-id is true) number of bootstrap validators to set up in sovereign L1 validator)") cmd.Flags().IntVar(&numLocalNodes, "num-local-nodes", 0, "number of nodes to be created on local machine") @@ -1039,6 +1040,7 @@ func deployBlockchain(cmd *cobra.Command, args []string) error { network, genesisPrivateKey, extraAggregatorPeers, + aggregatorAllowPrivatePeers, logLvl, validatorManagerSDK.PoSParams{ MinimumStakeAmount: big.NewInt(int64(poSMinimumStakeAmount)), @@ -1055,7 +1057,13 @@ func deployBlockchain(cmd *cobra.Command, args []string) error { ux.Logger.GreenCheckmarkToUser("Proof of Stake Validator Manager contract successfully initialized on blockchain %s", blockchainName) } else { ux.Logger.PrintToUser("Initializing Proof of Authority Validator Manager contract on blockchain %s ...", blockchainName) - if err := subnetSDK.InitializeProofOfAuthority(network, genesisPrivateKey, extraAggregatorPeers, logLvl); err != nil { + if err := subnetSDK.InitializeProofOfAuthority( + network, + genesisPrivateKey, + extraAggregatorPeers, + aggregatorAllowPrivatePeers, + logLvl, + ); err != nil { return err } ux.Logger.GreenCheckmarkToUser("Proof of Authority Validator Manager contract successfully initialized on blockchain %s", blockchainName) diff --git a/cmd/blockchaincmd/remove_validator.go b/cmd/blockchaincmd/remove_validator.go index d3990e2d1..54059861a 100644 --- a/cmd/blockchaincmd/remove_validator.go +++ b/cmd/blockchaincmd/remove_validator.go @@ -58,6 +58,7 @@ these prompts by providing the values with flags.`, cmd.Flags().StringVar(&nodeIDStr, "node-id", "", "node-id of the validator") cmd.Flags().StringVar(&nodeEndpoint, "node-endpoint", "", "remove validator that responds to the given endpoint") cmd.Flags().StringSliceVar(&aggregatorExtraEndpoints, "aggregator-extra-endpoints", nil, "endpoints for extra nodes that are needed in signature aggregation") + cmd.Flags().BoolVar(&aggregatorAllowPrivatePeers, "aggregator-allow-private-peers", true, "allow the signature aggregator to connect to peers with private IP") privateKeyFlags.AddToCmd(cmd, "to pay fees for completing the validator's removal (blockchain gas token)") cmd.Flags().StringVar(&rpcURL, "rpc", "", "connect to validator manager at the given rpc endpoint") cmd.Flags().StringVar(&aggregatorLogLevel, "aggregator-log-level", "Off", "log level to use with signature aggregator") @@ -261,6 +262,7 @@ func removeValidatorSOV( ownerPrivateKey, nodeID, extraAggregatorPeers, + aggregatorAllowPrivatePeers, aggregatorLogLevel, sc.PoS(), force, @@ -284,6 +286,7 @@ func removeValidatorSOV( ownerPrivateKey, validationID, extraAggregatorPeers, + aggregatorAllowPrivatePeers, aggregatorLogLevel, ); err != nil { return err diff --git a/cmd/contractcmd/init_validator_manager.go b/cmd/contractcmd/init_validator_manager.go index 0f6308a8b..936d26b9e 100644 --- a/cmd/contractcmd/init_validator_manager.go +++ b/cmd/contractcmd/init_validator_manager.go @@ -23,11 +23,12 @@ import ( ) type ValidatorManagerFlags struct { - Network networkoptions.NetworkFlags - PrivateKeyFlags contract.PrivateKeyFlags - rpcEndpoint string - aggregatorLogLevel string - aggregatorExtraEndpoints []string + Network networkoptions.NetworkFlags + PrivateKeyFlags contract.PrivateKeyFlags + rpcEndpoint string + aggregatorLogLevel string + aggregatorExtraEndpoints []string + aggregatorAllowPrivatePeers bool } type POSManagerSpecFlags struct { @@ -64,6 +65,7 @@ func newInitValidatorManagerCmd() *cobra.Command { validatorManagerFlags.PrivateKeyFlags.AddToCmd(cmd, "as contract deployer") cmd.Flags().StringVar(&validatorManagerFlags.rpcEndpoint, "rpc", "", "deploy the contract into the given rpc endpoint") cmd.Flags().StringSliceVar(&validatorManagerFlags.aggregatorExtraEndpoints, "aggregator-extra-endpoints", nil, "endpoints for extra nodes that are needed in signature aggregation") + cmd.Flags().BoolVar(&validatorManagerFlags.aggregatorAllowPrivatePeers, "aggregator-allow-private-peers", true, "allow the signature aggregator to connect to peers with private IP") cmd.Flags().StringVar(&validatorManagerFlags.aggregatorLogLevel, "aggregator-log-level", "Off", "log level to use with signature aggregator") cmd.Flags().StringVar(&initPOSManagerFlags.rewardCalculatorAddress, "pos-reward-calculator-address", "", "(PoS only) initialize the ValidatorManager with reward calculator address") @@ -184,6 +186,7 @@ func initValidatorManager(_ *cobra.Command, args []string) error { network, privateKey, extraAggregatorPeers, + validatorManagerFlags.aggregatorAllowPrivatePeers, validatorManagerFlags.aggregatorLogLevel, ); err != nil { return err @@ -199,6 +202,7 @@ func initValidatorManager(_ *cobra.Command, args []string) error { network, privateKey, extraAggregatorPeers, + validatorManagerFlags.aggregatorAllowPrivatePeers, validatorManagerFlags.aggregatorLogLevel, validatorManagerSDK.PoSParams{ MinimumStakeAmount: big.NewInt(int64(initPOSManagerFlags.minimumStakeAmount)), diff --git a/cmd/keycmd/transfer.go b/cmd/keycmd/transfer.go index ed8c8f587..e781edec7 100644 --- a/cmd/keycmd/transfer.go +++ b/cmd/keycmd/transfer.go @@ -547,11 +547,10 @@ func pToPSend( ethKeychain := secp256k1fx.NewKeychain() wallet, err := primary.MakeWallet( context.Background(), - &primary.WalletConfig{ - URI: network.Endpoint, - AVAXKeychain: kc, - EthKeychain: ethKeychain, - }, + network.Endpoint, + kc, + ethKeychain, + primary.WalletConfig{}, ) if err != nil { return err @@ -624,11 +623,10 @@ func pToXSend( ethKeychain := secp256k1fx.NewKeychain() wallet, err := primary.MakeWallet( context.Background(), - &primary.WalletConfig{ - URI: network.Endpoint, - AVAXKeychain: kc, - EthKeychain: ethKeychain, - }, + network.Endpoint, + kc, + ethKeychain, + primary.WalletConfig{}, ) if err != nil { return err @@ -659,7 +657,7 @@ func pToXSend( func exportFromP( amount uint64, - wallet primary.Wallet, + wallet *primary.Wallet, blockchainID ids.ID, blockchainAlias string, to secp256k1fx.OutputOwners, @@ -706,7 +704,7 @@ func exportFromP( } func importIntoX( - wallet primary.Wallet, + wallet *primary.Wallet, blockchainID ids.ID, blockchainAlias string, to secp256k1fx.OutputOwners, @@ -754,11 +752,10 @@ func pToCSend( ethKeychain := secp256k1fx.NewKeychain() wallet, err := primary.MakeWallet( context.Background(), - &primary.WalletConfig{ - URI: network.Endpoint, - AVAXKeychain: kc, - EthKeychain: ethKeychain, - }, + network.Endpoint, + kc, + ethKeychain, + primary.WalletConfig{}, ) if err != nil { return err @@ -793,7 +790,7 @@ func pToCSend( func importIntoC( network models.Network, - wallet primary.Wallet, + wallet *primary.Wallet, blockchainID ids.ID, blockchainAlias string, destinationAddrStr string, @@ -850,11 +847,10 @@ func cToPSend( ethKeychain := sk.KeyChain() wallet, err := primary.MakeWallet( context.Background(), - &primary.WalletConfig{ - URI: network.Endpoint, - AVAXKeychain: kc, - EthKeychain: ethKeychain, - }, + network.Endpoint, + kc, + ethKeychain, + primary.WalletConfig{}, ) if err != nil { return err @@ -877,11 +873,10 @@ func cToPSend( time.Sleep(5 * time.Second) wallet, err = primary.MakeWallet( context.Background(), - &primary.WalletConfig{ - URI: network.Endpoint, - AVAXKeychain: kc, - EthKeychain: ethKeychain, - }, + network.Endpoint, + kc, + ethKeychain, + primary.WalletConfig{}, ) if err != nil { return err @@ -898,7 +893,7 @@ func cToPSend( func exportFromC( network models.Network, amount uint64, - wallet primary.Wallet, + wallet *primary.Wallet, blockchainID ids.ID, blockchainAlias string, to secp256k1fx.OutputOwners, @@ -952,7 +947,7 @@ func exportFromC( } func importIntoP( - wallet primary.Wallet, + wallet *primary.Wallet, blockchainID ids.ID, blockchainAlias string, to secp256k1fx.OutputOwners, diff --git a/cmd/networkcmd/helpers.go b/cmd/networkcmd/helpers.go index 9078872a7..7cb366a9e 100644 --- a/cmd/networkcmd/helpers.go +++ b/cmd/networkcmd/helpers.go @@ -282,11 +282,11 @@ func AddNoSovereignValidators(cli client.Client, subnetID ids.ID) error { } wallet, err := primary.MakeWallet( ctx, - &primary.WalletConfig{ - URI: constants.LocalAPIEndpoint, - AVAXKeychain: k.KeyChain(), - EthKeychain: secp256k1fx.NewKeychain(), - SubnetIDs: []ids.ID{subnetID}, + constants.LocalAPIEndpoint, + k.KeyChain(), + secp256k1fx.NewKeychain(), + primary.WalletConfig{ + SubnetIDs: []ids.ID{subnetID}, }, ) if err != nil { diff --git a/cmd/nodecmd/wiz.go b/cmd/nodecmd/wiz.go index f5316a2e0..0a875d963 100644 --- a/cmd/nodecmd/wiz.go +++ b/cmd/nodecmd/wiz.go @@ -328,7 +328,7 @@ func wiz(cmd *cobra.Command, args []string) error { if err != nil { return err } - // get awm-relayer latest version + // get icm-relayer latest version relayerVersion, err := teleporter.GetLatestRelayerReleaseVersion() if err != nil { return err diff --git a/go.mod b/go.mod index 844557daf..fec59e2b9 100644 --- a/go.mod +++ b/go.mod @@ -1,16 +1,16 @@ module github.com/ava-labs/avalanche-cli -go 1.22.8 +go 1.22.10 require ( github.com/ava-labs/apm v1.0.0 github.com/ava-labs/avalanche-network-runner v1.8.4-0.20241130135139-a0946c5366be - github.com/ava-labs/avalanchego v1.12.0-initial-poc.9.0.20241125192703-8c538e65af03 - github.com/ava-labs/awm-relayer v1.4.1-0.20241126163322-f9c590e20b65 + github.com/ava-labs/avalanchego v1.12.1-0.20241203223023-13e07a1b3a1e github.com/ava-labs/coreth v0.13.9-rc.1 + github.com/ava-labs/icm-services v1.4.1-0.20241206150258-be351e56eea0 github.com/ava-labs/subnet-evm v0.6.12 - github.com/aws/aws-sdk-go-v2 v1.32.5 - github.com/aws/aws-sdk-go-v2/config v1.28.5 + github.com/aws/aws-sdk-go-v2 v1.32.6 + github.com/aws/aws-sdk-go-v2/config v1.28.6 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 @@ -27,7 +27,7 @@ require ( github.com/okteto/remote v0.0.0-20210428052247-99de42c04148 github.com/olekukonko/tablewriter v0.0.5 github.com/onsi/ginkgo/v2 v2.22.0 - github.com/onsi/gomega v1.35.1 + github.com/onsi/gomega v1.36.0 github.com/pborman/ansi v1.0.0 github.com/pingcap/errors v0.11.4 github.com/posthog/posthog-go v1.2.24 @@ -45,7 +45,7 @@ require ( golang.org/x/mod v0.22.0 golang.org/x/net v0.31.0 golang.org/x/oauth2 v0.23.0 - golang.org/x/sync v0.9.0 + golang.org/x/sync v0.10.0 golang.org/x/text v0.20.0 google.golang.org/api v0.184.0 google.golang.org/protobuf v1.35.2 @@ -67,18 +67,18 @@ require ( 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-20241009183145-e6f90a8a1a60 // indirect - github.com/ava-labs/teleporter v1.0.8-0.20241121223552-226937a967e8 // indirect - github.com/aws/aws-sdk-go-v2/credentials v1.17.46 // indirect - github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.20 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.24 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.24 // indirect + github.com/ava-labs/teleporter v1.0.8-0.20241122194201-a6e92843c3b1 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.17.47 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.21 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.25 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.25 // indirect github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 // indirect github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.1 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.5 // indirect - github.com/aws/aws-sdk-go-v2/service/kms v1.37.6 // indirect - github.com/aws/aws-sdk-go-v2/service/sso v1.24.6 // indirect - github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.5 // indirect - github.com/aws/aws-sdk-go-v2/service/sts v1.33.1 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.6 // indirect + github.com/aws/aws-sdk-go-v2/service/kms v1.37.7 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.24.7 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.6 // indirect + github.com/aws/aws-sdk-go-v2/service/sts v1.33.2 // indirect github.com/aws/smithy-go v1.22.1 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bits-and-blooms/bitset v1.10.0 // indirect @@ -223,7 +223,7 @@ require ( gonum.org/v1/gonum v0.11.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect - google.golang.org/grpc v1.68.0 // indirect + google.golang.org/grpc v1.68.1 // 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 578882780..34ab53091 100644 --- a/go.sum +++ b/go.sum @@ -85,34 +85,34 @@ 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.20241130135139-a0946c5366be h1:6KxDYXwG5ErQl4+mHhLhj+j71CzHYJVTRd9onWYs6gE= github.com/ava-labs/avalanche-network-runner v1.8.4-0.20241130135139-a0946c5366be/go.mod h1:TOfc8r6sxs01mi2mWOYsRcJAbf3x3a4x0uxi8gVThso= -github.com/ava-labs/avalanchego v1.12.0-initial-poc.9.0.20241125192703-8c538e65af03 h1:KH4cxo+607h+6+5L57aJEzWqH2R+jQY2DI9fO2NmZgE= -github.com/ava-labs/avalanchego v1.12.0-initial-poc.9.0.20241125192703-8c538e65af03/go.mod h1:yhD5dpZyStIVbxQ550EDi5w5SL7DQ/xGE6TIxosb7U0= -github.com/ava-labs/awm-relayer v1.4.1-0.20241126163322-f9c590e20b65 h1:0/tUtrvRpbamHV26FCIRgBEPyAs6p6xKXZOs8P0EGaY= -github.com/ava-labs/awm-relayer v1.4.1-0.20241126163322-f9c590e20b65/go.mod h1:gW5X5k2CspCKo+1yKVhFLriK2pl80hLjheF1521aIqs= +github.com/ava-labs/avalanchego v1.12.1-0.20241203223023-13e07a1b3a1e h1:pJJYryEedoOobUPuRNUYBwQgsaQXMqBkeMq28lRDpSo= +github.com/ava-labs/avalanchego v1.12.1-0.20241203223023-13e07a1b3a1e/go.mod h1:yhD5dpZyStIVbxQ550EDi5w5SL7DQ/xGE6TIxosb7U0= github.com/ava-labs/coreth v0.13.9-rc.1 h1:qIICpC/OZGYUP37QnLgIqqwGmxnLwLpZaUlqJNI85vU= github.com/ava-labs/coreth v0.13.9-rc.1/go.mod h1:7aMsRIo/3GBE44qWZMjnfqdqfcfZ5yShTTm2LObLaYo= +github.com/ava-labs/icm-services v1.4.1-0.20241206150258-be351e56eea0 h1:tmR+oBO0ODzFDIkur/6tcruo+nLFu6dxXKYvB2XTqIA= +github.com/ava-labs/icm-services v1.4.1-0.20241206150258-be351e56eea0/go.mod h1:insjVlfHLuCnEA2ZFbclnGAanO9EeXkryQO04WBSgE8= 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.12 h1:jL3FmjdFcNfS0qwbehwN6DkAg9y7zexB1riiGBxRsM0= github.com/ava-labs/subnet-evm v0.6.12/go.mod h1:vffwL4UqAh7ibpWjveUuUhamm3a9w75q92bG5vXdX5k= -github.com/ava-labs/teleporter v1.0.8-0.20241121223552-226937a967e8 h1:jsH1wv1GgeztvipQG3di1OTruSHbFAwwP4K6clzTRLE= -github.com/ava-labs/teleporter v1.0.8-0.20241121223552-226937a967e8/go.mod h1:Q4/DDZPLI5f96xDykVXPT85PeJS3IqDPDJDk3UdQOuQ= +github.com/ava-labs/teleporter v1.0.8-0.20241122194201-a6e92843c3b1 h1:y1zjdfGlfTZQoPyUyPjsu9FjDK8w19OWUTpgVzQSh0w= +github.com/ava-labs/teleporter v1.0.8-0.20241122194201-a6e92843c3b1/go.mod h1:45NrpvVlms+xHL/rFZT7VrRJqajT7UUW78lzBe3hAzU= github.com/aws/aws-sdk-go-v2 v1.2.0/go.mod h1:zEQs02YRBw1DjK0PoJv3ygDYOFTre1ejlJWl8FwAuQo= -github.com/aws/aws-sdk-go-v2 v1.32.5 h1:U8vdWJuY7ruAkzaOdD7guwJjD06YSKmnKCJs7s3IkIo= -github.com/aws/aws-sdk-go-v2 v1.32.5/go.mod h1:P5WJBrYqqbWVaOxgH0X/FYYD47/nooaPOZPlQdmiN2U= +github.com/aws/aws-sdk-go-v2 v1.32.6 h1:7BokKRgRPuGmKkFMhEg/jSul+tB9VvXhcViILtfG8b4= +github.com/aws/aws-sdk-go-v2 v1.32.6/go.mod h1:P5WJBrYqqbWVaOxgH0X/FYYD47/nooaPOZPlQdmiN2U= 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.28.5 h1:Za41twdCXbuyyWv9LndXxZZv3QhTG1DinqlFsSuvtI0= -github.com/aws/aws-sdk-go-v2/config v1.28.5/go.mod h1:4VsPbHP8JdcdUDmbTVgNL/8w9SqOkM5jyY8ljIxLO3o= +github.com/aws/aws-sdk-go-v2/config v1.28.6 h1:D89IKtGrs/I3QXOLNTH93NJYtDhm8SYa9Q5CsPShmyo= +github.com/aws/aws-sdk-go-v2/config v1.28.6/go.mod h1:GDzxJ5wyyFSCoLkS+UhGB0dArhb9mI+Co4dHtoTxbko= github.com/aws/aws-sdk-go-v2/credentials v1.1.1/go.mod h1:mM2iIjwl7LULWtS6JCACyInboHirisUUdkBPoTHMOUo= -github.com/aws/aws-sdk-go-v2/credentials v1.17.46 h1:AU7RcriIo2lXjUfHFnFKYsLCwgbz1E7Mm95ieIRDNUg= -github.com/aws/aws-sdk-go-v2/credentials v1.17.46/go.mod h1:1FmYyLGL08KQXQ6mcTlifyFXfJVCNJTVGuQP4m0d/UA= +github.com/aws/aws-sdk-go-v2/credentials v1.17.47 h1:48bA+3/fCdi2yAwVt+3COvmatZ6jUDNkDTIsqDiMUdw= +github.com/aws/aws-sdk-go-v2/credentials v1.17.47/go.mod h1:+KdckOejLW3Ks3b0E3b5rHsr2f9yuORBum0WPnE5o5w= 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.20 h1:sDSXIrlsFSFJtWKLQS4PUWRvrT580rrnuLydJrCQ/yA= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.20/go.mod h1:WZ/c+w0ofps+/OUqMwWgnfrgzZH1DZO1RIkktICsqnY= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.24 h1:4usbeaes3yJnCFC7kfeyhkdkPtoRYPa/hTmCqMpKpLI= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.24/go.mod h1:5CI1JemjVwde8m2WG3cz23qHKPOxbpkq0HaoreEgLIY= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.24 h1:N1zsICrQglfzaBnrfM0Ys00860C+QFwu6u/5+LomP+o= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.24/go.mod h1:dCn9HbJ8+K31i8IQ8EWmWj0EiIk0+vKiHNMxTTYveAg= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.21 h1:AmoU1pziydclFT/xRV+xXE/Vb8fttJCLRPv8oAkprc0= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.21/go.mod h1:AjUdLYe4Tgs6kpH4Bv7uMZo7pottoyHMn4eTcIcneaY= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.25 h1:s/fF4+yDQDoElYhfIVvSNyeCydfbuTKzhxSXDXCPasU= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.25/go.mod h1:IgPfDv5jqFIzQSNbUEMoitNooSMXjRSDkhXv8jiROvU= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.25 h1:ZntTCl5EsYnhN/IygQEUugpdwbhdkom9uHcbCftiGgA= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.25/go.mod h1:DBdPrgeocww+CSl1C8cEV8PN1mHMBhuCDLpXezyvWkE= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 h1:VaRN3TlFdd6KxX1x3ILT5ynH6HvKgqdiXoTxAF4HQcQ= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1/go.mod h1:FbtygfRFze9usAadmnGJNc8KsP346kEe+y2/oyhGAGc= github.com/aws/aws-sdk-go-v2/service/ec2 v1.182.0 h1:LaeziEhHZ/SJZYBK223QVzl3ucHvA9IP4tQMcxGrc9I= @@ -120,19 +120,19 @@ github.com/aws/aws-sdk-go-v2/service/ec2 v1.182.0/go.mod h1:kYXaB4FzyhEJjvrJ84oP github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.1 h1:iXtILhvDxB6kPvEXgsDhGaZCSC6LQET5ZHSdJozeI0Y= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.1/go.mod h1:9nu0fVANtYiAePIBh2/pFUSwtJ402hLnp854CNoDOeE= 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.12.5 h1:wtpJ4zcwrSbwhECWQoI/g6WM9zqCcSpHDJIWSbMLOu4= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.5/go.mod h1:qu/W9HXQbbQ4+1+JcZp0ZNPV31ym537ZJN+fiS7Ti8E= -github.com/aws/aws-sdk-go-v2/service/kms v1.37.6 h1:CZImQdb1QbU9sGgJ9IswhVkxAcjkkD1eQTMA1KHWk+E= -github.com/aws/aws-sdk-go-v2/service/kms v1.37.6/go.mod h1:YJDdlK0zsyxVBxGU48AR/Mi8DMrGdc1E3Yij4fNrONA= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.6 h1:50+XsN70RS7dwJ2CkVNXzj7U2L1HKP8nqTd3XWEXBN4= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.6/go.mod h1:WqgLmwY7so32kG01zD8CPTJWVWM+TzJoOVHwTg4aPug= +github.com/aws/aws-sdk-go-v2/service/kms v1.37.7 h1:dZmNIRtPUvtvUIIDVNpvtnJQ8N8Iqm7SQAxf18htZYw= +github.com/aws/aws-sdk-go-v2/service/kms v1.37.7/go.mod h1:vj8PlfJH9mnGeIzd6uMLPi5VgiqzGG7AZoe1kf1uTXM= github.com/aws/aws-sdk-go-v2/service/route53 v1.1.1/go.mod h1:rLiOUrPLW/Er5kRcQ7NkwbjlijluLsrIbu/iyl35RO4= github.com/aws/aws-sdk-go-v2/service/sso v1.1.1/go.mod h1:SuZJxklHxLAXgLTc1iFXbEWkXs7QRTQpCLGaKIprQW0= -github.com/aws/aws-sdk-go-v2/service/sso v1.24.6 h1:3zu537oLmsPfDMyjnUS2g+F2vITgy5pB74tHI+JBNoM= -github.com/aws/aws-sdk-go-v2/service/sso v1.24.6/go.mod h1:WJSZH2ZvepM6t6jwu4w/Z45Eoi75lPN7DcydSRtJg6Y= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.5 h1:K0OQAsDywb0ltlFrZm0JHPY3yZp/S9OaoLU33S7vPS8= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.5/go.mod h1:ORITg+fyuMoeiQFiVGoqB3OydVTLkClw/ljbblMq6Cc= +github.com/aws/aws-sdk-go-v2/service/sso v1.24.7 h1:rLnYAfXQ3YAccocshIH5mzNNwZBkBo+bP6EhIxak6Hw= +github.com/aws/aws-sdk-go-v2/service/sso v1.24.7/go.mod h1:ZHtuQJ6t9A/+YDuxOLnbryAmITtr8UysSny3qcyvJTc= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.6 h1:JnhTZR3PiYDNKlXy50/pNeix9aGMo6lLpXwJ1mw8MD4= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.6/go.mod h1:URronUEGfXZN1VpdktPSD1EkAL9mfrV+2F4sjH38qOY= github.com/aws/aws-sdk-go-v2/service/sts v1.1.1/go.mod h1:Wi0EBZwiz/K44YliU0EKxqTCJGUfYTWXrrBwkq736bM= -github.com/aws/aws-sdk-go-v2/service/sts v1.33.1 h1:6SZUVRQNvExYlMLbHdlKB48x0fLbc2iVROyaNEwBHbU= -github.com/aws/aws-sdk-go-v2/service/sts v1.33.1/go.mod h1:GqWyYCwLXnlUB1lOAXQyNSPqPLQJvmo8J0DWBzp9mtg= +github.com/aws/aws-sdk-go-v2/service/sts v1.33.2 h1:s4074ZO1Hk8qv65GqNXqDjmkf4HSQqJukaLuuW0TpDA= +github.com/aws/aws-sdk-go-v2/service/sts v1.33.2/go.mod h1:mVggCnIWoM09jP71Wh+ea7+5gAp53q+49wDFs1SW5z8= github.com/aws/smithy-go v1.1.0/go.mod h1:EzMw8dbp/YJL4A5/sbhGddag+NPT7q084agLbB9LgIw= github.com/aws/smithy-go v1.22.1 h1:/HPHZQ0g7f4eUeK6HKglFz8uwVfZKgoI25rb/J+dnro= github.com/aws/smithy-go v1.22.1/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg= @@ -692,8 +692,8 @@ github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7J github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= -github.com/onsi/gomega v1.35.1 h1:Cwbd75ZBPxFSuZ6T+rN/WCb/gOc6YgFBXLlZLhC7Ds4= -github.com/onsi/gomega v1.35.1/go.mod h1:PvZbdDc8J6XJEpDK4HCuRBm8a6Fzp9/DmhC9C7yFlog= +github.com/onsi/gomega v1.36.0 h1:Pb12RlruUtj4XUuPUqeEWc6j5DkVVVA49Uf6YLfC95Y= +github.com/onsi/gomega v1.36.0/go.mod h1:PvZbdDc8J6XJEpDK4HCuRBm8a6Fzp9/DmhC9C7yFlog= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.0.3-0.20180606204148-bd9c31933947/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= @@ -1050,8 +1050,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ= -golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= +golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1239,8 +1239,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.68.0 h1:aHQeeJbo8zAkAa3pRzrVjZlbz6uSfeOXlJNQM0RAbz0= -google.golang.org/grpc v1.68.0/go.mod h1:fmSPC5AsjSBCK54MyHRx48kpOti1/jRfOlwEWywNjWA= +google.golang.org/grpc v1.68.1 h1:oI5oTa11+ng8r8XMMN7jAOmWfPZWbYpCFaMUTACxkM0= +google.golang.org/grpc v1.68.1/go.mod h1:+q1XYFJjShcqn0QZHvCyeR4CXPA+llXIeUIfIe00waw= 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/pkg/docker/templates/awmrelayer.docker-compose.yml b/pkg/docker/templates/awmrelayer.docker-compose.yml index 2b6650c2e..e0aa27cd9 100644 --- a/pkg/docker/templates/awmrelayer.docker-compose.yml +++ b/pkg/docker/templates/awmrelayer.docker-compose.yml @@ -1,11 +1,11 @@ name: avalanche-cli services: - awm-relayer: - image: avaplatform/awm-relayer:{{ .ICMRelayerVersion }} - container_name: awm-relayer + icm-relayer: + image: avaplatform/icm-relayer:{{ .ICMRelayerVersion }} + container_name: icm-relayer restart: unless-stopped user: "1000:1000" # ubuntu user network_mode: "host" volumes: - - /home/ubuntu/.avalanche-cli/services/awm-relayer:/.awm-relayer:rw - command: 'awm-relayer --config-file /.awm-relayer/awm-relayer-config.json' + - /home/ubuntu/.avalanche-cli/services/icm-relayer:/.icm-relayer:rw + command: 'icm-relayer --config-file /.icm-relayer/icm-relayer-config.json' diff --git a/pkg/remoteconfig/avalanche.go b/pkg/remoteconfig/avalanche.go index 777539fe9..a74c1782a 100644 --- a/pkg/remoteconfig/avalanche.go +++ b/pkg/remoteconfig/avalanche.go @@ -123,6 +123,6 @@ func AvalancheFolderToCreate() []string { "/home/ubuntu/.avalanchego/configs/chains/C", "/home/ubuntu/.avalanchego/staking", "/home/ubuntu/.avalanchego/plugins", - "/home/ubuntu/.avalanche-cli/services/awm-relayer", + "/home/ubuntu/.avalanche-cli/services/icm-relayer", } } diff --git a/pkg/ssh/ssh.go b/pkg/ssh/ssh.go index 60260ca2f..8eab79c10 100644 --- a/pkg/ssh/ssh.go +++ b/pkg/ssh/ssh.go @@ -164,17 +164,17 @@ func ComposeSSHSetupICMRelayer(host *models.Host, relayerVersion string) error { if err := docker.ComposeSSHSetupICMRelayer(host, relayerVersion); err != nil { return err } - return docker.StartDockerComposeService(host, utils.GetRemoteComposeFile(), "awm-relayer", constants.SSHLongRunningScriptTimeout) + return docker.StartDockerComposeService(host, utils.GetRemoteComposeFile(), "icm-relayer", constants.SSHLongRunningScriptTimeout) } // RunSSHStartICMRelayerService runs script to start an AWM Relayer Service func RunSSHStartICMRelayerService(host *models.Host) error { - return docker.StartDockerComposeService(host, utils.GetRemoteComposeFile(), "awm-relayer", constants.SSHLongRunningScriptTimeout) + return docker.StartDockerComposeService(host, utils.GetRemoteComposeFile(), "icm-relayer", constants.SSHLongRunningScriptTimeout) } // RunSSHStopICMRelayerService runs script to start an AWM Relayer Service func RunSSHStopICMRelayerService(host *models.Host) error { - return docker.StopDockerComposeService(host, utils.GetRemoteComposeFile(), "awm-relayer", constants.SSHLongRunningScriptTimeout) + return docker.StopDockerComposeService(host, utils.GetRemoteComposeFile(), "icm-relayer", constants.SSHLongRunningScriptTimeout) } // RunSSHUpgradeAvalanchego runs script to upgrade avalanchego diff --git a/pkg/subnet/local.go b/pkg/subnet/local.go index 80d810899..12a080a9b 100644 --- a/pkg/subnet/local.go +++ b/pkg/subnet/local.go @@ -212,11 +212,11 @@ func IssueRemoveSubnetValidatorTx(kc keychain.Keychain, subnetID ids.ID, nodeID api := constants.LocalAPIEndpoint wallet, err := primary.MakeWallet( ctx, - &primary.WalletConfig{ - URI: api, - AVAXKeychain: kc, - EthKeychain: secp256k1fx.NewKeychain(), - SubnetIDs: []ids.ID{subnetID}, + api, + kc, + secp256k1fx.NewKeychain(), + primary.WalletConfig{ + SubnetIDs: []ids.ID{subnetID}, }, ) if err != nil { diff --git a/pkg/subnet/public.go b/pkg/subnet/public.go index 5757b5b62..f3b980985 100644 --- a/pkg/subnet/public.go +++ b/pkg/subnet/public.go @@ -47,7 +47,7 @@ type PublicDeployer struct { kc *keychain.Keychain network models.Network app *application.Avalanche - wallet primary.Wallet + wallet *primary.Wallet } func NewPublicDeployer(app *application.Avalanche, kc *keychain.Keychain, network models.Network) *PublicDeployer { @@ -138,7 +138,7 @@ func (d *PublicDeployer) SetL1ValidatorWeight( func (*PublicDeployer) createSetSubnetValidatorWeightTx( message *warp.Message, - wallet primary.Wallet, + wallet *primary.Wallet, ) (*txs.Tx, error) { unsignedTx, err := wallet.P().Builder().NewSetL1ValidatorWeightTx( message.Bytes(), @@ -184,7 +184,7 @@ func (*PublicDeployer) createRegisterSubnetValidatorTx( balance uint64, pop signer.ProofOfPossession, message *warp.Message, - wallet primary.Wallet, + wallet *primary.Wallet, ) (*txs.Tx, error) { unsignedTx, err := wallet.P().Builder().NewRegisterL1ValidatorTx( balance, @@ -604,17 +604,17 @@ func (d *PublicDeployer) Sign( return nil } -func (d *PublicDeployer) loadWallet(subnetIDs ...ids.ID) (primary.Wallet, error) { +func (d *PublicDeployer) loadWallet(subnetIDs ...ids.ID) (*primary.Wallet, error) { ctx := context.Background() // filter out ids.Empty txs filteredTxs := utils.Filter(subnetIDs, func(e ids.ID) bool { return e != ids.Empty }) wallet, err := primary.MakeWallet( ctx, - &primary.WalletConfig{ - URI: d.network.Endpoint, - AVAXKeychain: d.kc.Keychain, - EthKeychain: secp256k1fx.NewKeychain(), - SubnetIDs: filteredTxs, + d.network.Endpoint, + d.kc.Keychain, + secp256k1fx.NewKeychain(), + primary.WalletConfig{ + SubnetIDs: filteredTxs, }, ) if err != nil { @@ -627,7 +627,7 @@ func (d *PublicDeployer) CleanCacheWallet() { d.wallet = nil } -func (d *PublicDeployer) loadCacheWallet(preloadTxs ...ids.ID) (primary.Wallet, error) { +func (d *PublicDeployer) loadCacheWallet(preloadTxs ...ids.ID) (*primary.Wallet, error) { var err error if d.wallet == nil { d.wallet, err = d.loadWallet(preloadTxs...) @@ -659,7 +659,7 @@ func (d *PublicDeployer) createBlockchainTx( vmID, subnetID ids.ID, genesis []byte, - wallet primary.Wallet, + wallet *primary.Wallet, ) (*txs.Tx, error) { fxIDs := make([]ids.ID, 0) options := d.getMultisigTxOptions(subnetAuthKeys) @@ -694,7 +694,7 @@ func (d *PublicDeployer) createConvertL1Tx( chainID ids.ID, address []byte, validators []*txs.ConvertSubnetToL1Validator, - wallet primary.Wallet, + wallet *primary.Wallet, ) (*txs.Tx, error) { options := d.getMultisigTxOptions(subnetAuthKeys) unsignedTx, err := wallet.P().Builder().NewConvertSubnetToL1Tx( @@ -724,7 +724,7 @@ func (d *PublicDeployer) createTransferSubnetOwnershipTx( subnetID ids.ID, controlKeys []string, threshold uint32, - wallet primary.Wallet, + wallet *primary.Wallet, ) (*txs.Tx, error) { options := d.getMultisigTxOptions(subnetAuthKeys) addrs, err := address.ParseToIDs(controlKeys) @@ -756,7 +756,7 @@ func (d *PublicDeployer) createTransferSubnetOwnershipTx( func (d *PublicDeployer) createAddSubnetValidatorTx( subnetAuthKeys []ids.ShortID, validator *txs.SubnetValidator, - wallet primary.Wallet, + wallet *primary.Wallet, ) (*txs.Tx, error) { options := d.getMultisigTxOptions(subnetAuthKeys) // create tx @@ -776,7 +776,7 @@ func (d *PublicDeployer) createRemoveValidatorTX( subnetAuthKeys []ids.ShortID, nodeID ids.NodeID, subnetID ids.ID, - wallet primary.Wallet, + wallet *primary.Wallet, ) (*txs.Tx, error) { options := d.getMultisigTxOptions(subnetAuthKeys) // create tx @@ -803,7 +803,7 @@ func (d *PublicDeployer) issueAddPermissionlessValidatorTX( assetID ids.ID, startTime uint64, endTime uint64, - wallet primary.Wallet, + wallet *primary.Wallet, delegationFee uint32, popBytes []byte, blsProof *signer.ProofOfPossession, @@ -879,7 +879,7 @@ func (d *PublicDeployer) issueAddPermissionlessValidatorTX( func (*PublicDeployer) signTx( tx *txs.Tx, - wallet primary.Wallet, + wallet *primary.Wallet, ) error { if err := wallet.P().Signer().Sign(context.Background(), tx); err != nil { return fmt.Errorf("error signing tx: %w", err) @@ -887,7 +887,7 @@ func (*PublicDeployer) signTx( return nil } -func (d *PublicDeployer) createSubnetTx(controlKeys []string, threshold uint32, wallet primary.Wallet) (ids.ID, error) { +func (d *PublicDeployer) createSubnetTx(controlKeys []string, threshold uint32, wallet *primary.Wallet) (ids.ID, error) { addrs, err := address.ParseToIDs(controlKeys) if err != nil { return ids.Empty, fmt.Errorf("failure parsing control keys: %w", err) @@ -919,7 +919,7 @@ func (d *PublicDeployer) createSubnetTx(controlKeys []string, threshold uint32, return d.Commit(&tx, true) } -func printFee(kind string, wallet primary.Wallet, unsignedTx txs.UnsignedTx) error { +func printFee(kind string, wallet *primary.Wallet, unsignedTx txs.UnsignedTx) error { if showFees { var pFeeCalculator avagofee.Calculator pContext := wallet.P().Builder().Context() @@ -989,7 +989,7 @@ func GetPublicSubnetValidators(subnetID ids.ID, network models.Network) ([]platf } func IssueXToPExportTx( - wallet primary.Wallet, + wallet *primary.Wallet, usingLedger bool, hasOnlyOneKey bool, assetID ids.ID, @@ -1036,7 +1036,7 @@ func IssueXToPExportTx( } func IssuePFromXImportTx( - wallet primary.Wallet, + wallet *primary.Wallet, usingLedger bool, hasOnlyOneKey bool, owner *secp256k1fx.OutputOwners, diff --git a/pkg/teleporter/relayer.go b/pkg/teleporter/relayer.go index 2aeab5d85..34091d706 100644 --- a/pkg/teleporter/relayer.go +++ b/pkg/teleporter/relayer.go @@ -24,9 +24,9 @@ import ( "github.com/ava-labs/avalanche-cli/pkg/models" "github.com/ava-labs/avalanche-cli/pkg/utils" "github.com/ava-labs/avalanche-cli/pkg/ux" - apiConfig "github.com/ava-labs/awm-relayer/config" - offchainregistry "github.com/ava-labs/awm-relayer/messages/off-chain-registry" - "github.com/ava-labs/awm-relayer/relayer/config" + apiConfig "github.com/ava-labs/icm-services/config" + offchainregistry "github.com/ava-labs/icm-services/messages/off-chain-registry" + "github.com/ava-labs/icm-services/relayer/config" ) const ( diff --git a/pkg/validatormanager/registration.go b/pkg/validatormanager/registration.go index 7a98f80a7..eaa17223a 100644 --- a/pkg/validatormanager/registration.go +++ b/pkg/validatormanager/registration.go @@ -361,6 +361,7 @@ func InitValidatorRegistration( disableOwners warpMessage.PChainOwner, weight uint64, aggregatorExtraPeerEndpoints []info.Peer, + aggregatorAllowPrivatePeers bool, aggregatorLogLevelStr string, initWithPos bool, delegationFee uint16, @@ -455,7 +456,7 @@ func InitValidatorRegistration( network, aggregatorLogLevel, 0, - network.Kind == models.Local, + aggregatorAllowPrivatePeers, aggregatorExtraPeerEndpoints, subnetID, blockchainID, @@ -478,6 +479,7 @@ func FinishValidatorRegistration( privateKey string, validationID ids.ID, aggregatorExtraPeerEndpoints []info.Peer, + aggregatorAllowPrivatePeers bool, aggregatorLogLevelStr string, ) error { subnetID, err := contract.GetSubnetID( @@ -498,7 +500,7 @@ func FinishValidatorRegistration( rpcURL, aggregatorLogLevel, 0, - network.Kind == models.Local, + aggregatorAllowPrivatePeers, aggregatorExtraPeerEndpoints, subnetID, validationID, diff --git a/pkg/validatormanager/removal.go b/pkg/validatormanager/removal.go index 157640948..c0139877d 100644 --- a/pkg/validatormanager/removal.go +++ b/pkg/validatormanager/removal.go @@ -124,6 +124,7 @@ func InitValidatorRemoval( ownerPrivateKey string, nodeID ids.NodeID, aggregatorExtraPeerEndpoints []info.Peer, + aggregatorAllowPrivatePeers bool, aggregatorLogLevelStr string, initWithPos bool, force bool, @@ -178,7 +179,7 @@ func InitValidatorRemoval( network, aggregatorLogLevel, 0, - network.Kind == models.Local, + aggregatorAllowPrivatePeers, aggregatorExtraPeerEndpoints, subnetID, blockchainID, @@ -217,6 +218,7 @@ func FinishValidatorRemoval( privateKey string, validationID ids.ID, aggregatorExtraPeerEndpoints []info.Peer, + aggregatorAllowPrivatePeers bool, aggregatorLogLevelStr string, ) error { managerAddress := common.HexToAddress(validatorManagerSDK.ProxyContractAddress) @@ -237,7 +239,7 @@ func FinishValidatorRemoval( rpcURL, aggregatorLogLevel, 0, - network.Kind == models.Local, + aggregatorAllowPrivatePeers, aggregatorExtraPeerEndpoints, subnetID, validationID, diff --git a/pkg/validatormanager/validatormanager.go b/pkg/validatormanager/validatormanager.go index 8ec129cde..fa9e1e0b5 100644 --- a/pkg/validatormanager/validatormanager.go +++ b/pkg/validatormanager/validatormanager.go @@ -111,13 +111,14 @@ func SetupPoA( network models.Network, privateKey string, aggregatorExtraPeerEndpoints []info.Peer, + aggregatorAllowPrivatePeers bool, aggregatorLogLevelStr string, ) error { aggregatorLogLevel, err := logging.ToLevel(aggregatorLogLevelStr) if err != nil { aggregatorLogLevel = defaultAggregatorLogLevel } - return subnet.InitializeProofOfAuthority(network, privateKey, aggregatorExtraPeerEndpoints, aggregatorLogLevel) + return subnet.InitializeProofOfAuthority(network, privateKey, aggregatorExtraPeerEndpoints, aggregatorAllowPrivatePeers, aggregatorLogLevel) } // setups PoA manager after a successful execution of @@ -130,6 +131,7 @@ func SetupPoS( network models.Network, privateKey string, aggregatorExtraPeerEndpoints []info.Peer, + aggregatorAllowPrivatePeers bool, aggregatorLogLevelStr string, posParams validatorManagerSDK.PoSParams, ) error { @@ -140,6 +142,7 @@ func SetupPoS( return subnet.InitializeProofOfStake(network, privateKey, aggregatorExtraPeerEndpoints, + aggregatorAllowPrivatePeers, aggregatorLogLevel, posParams, ) diff --git a/sdk/blockchain/blockchain.go b/sdk/blockchain/blockchain.go index dc8c8e728..50bede649 100644 --- a/sdk/blockchain/blockchain.go +++ b/sdk/blockchain/blockchain.go @@ -345,6 +345,7 @@ func (c *Subnet) InitializeProofOfAuthority( network models.Network, privateKey string, aggregatorExtraPeerEndpoints []info.Peer, + aggregatorAllowPrivatePeers bool, aggregatorLogLevel logging.Level, ) error { if c.SubnetID == ids.Empty { @@ -393,7 +394,7 @@ func (c *Subnet) InitializeProofOfAuthority( network, aggregatorLogLevel, 0, - network.Kind == models.Local, + aggregatorAllowPrivatePeers, aggregatorExtraPeerEndpoints, c.SubnetID, c.BlockchainID, @@ -424,6 +425,7 @@ func (c *Subnet) InitializeProofOfStake( network models.Network, privateKey string, aggregatorExtraPeerEndpoints []info.Peer, + aggregatorAllowPrivatePeers bool, aggregatorLogLevel logging.Level, posParams validatormanager.PoSParams, ) error { @@ -451,7 +453,7 @@ func (c *Subnet) InitializeProofOfStake( network, aggregatorLogLevel, 0, - network.Kind == models.Local, + aggregatorAllowPrivatePeers, aggregatorExtraPeerEndpoints, c.SubnetID, c.BlockchainID, diff --git a/sdk/blockchain/blockchain_test.go b/sdk/blockchain/blockchain_test.go index 9c42cd5f7..05d0f33b8 100644 --- a/sdk/blockchain/blockchain_test.go +++ b/sdk/blockchain/blockchain_test.go @@ -20,7 +20,6 @@ import ( "github.com/ava-labs/avalanche-cli/sdk/wallet" "github.com/ava-labs/avalanchego/ids" "github.com/ava-labs/avalanchego/utils/formatting/address" - "github.com/ava-labs/avalanchego/vms/secp256k1fx" "github.com/ava-labs/avalanchego/wallet/subnet/primary" "github.com/ava-labs/subnet-evm/core" "github.com/ava-labs/subnet-evm/params" @@ -62,11 +61,10 @@ func TestSubnetDeploy(t *testing.T) { newSubnet.SetSubnetControlParams(controlKeys, uint32(threshold)) wallet, err := wallet.New( context.Background(), - &primary.WalletConfig{ - URI: network.Endpoint, - AVAXKeychain: keychain.Keychain, - EthKeychain: secp256k1fx.NewKeychain(), - SubnetIDs: nil, + network.Endpoint, + keychain.Keychain, + primary.WalletConfig{ + SubnetIDs: nil, }, ) require.NoError(err) @@ -110,11 +108,10 @@ func TestSubnetDeployMultiSig(t *testing.T) { walletA, err := wallet.New( context.Background(), - &primary.WalletConfig{ - URI: network.Endpoint, - AVAXKeychain: keychainA.Keychain, - EthKeychain: secp256k1fx.NewKeychain(), - SubnetIDs: nil, + network.Endpoint, + keychainA.Keychain, + primary.WalletConfig{ + SubnetIDs: nil, }, ) require.NoError(err) @@ -136,11 +133,10 @@ func TestSubnetDeployMultiSig(t *testing.T) { // include subnetID in PChainTxsToFetch when creating second wallet walletB, err := wallet.New( context.Background(), - &primary.WalletConfig{ - URI: network.Endpoint, - AVAXKeychain: keychainB.Keychain, - EthKeychain: secp256k1fx.NewKeychain(), - SubnetIDs: []ids.ID{subnetID}, + network.Endpoint, + keychainB.Keychain, + primary.WalletConfig{ + SubnetIDs: []ids.ID{subnetID}, }, ) require.NoError(err) @@ -179,11 +175,10 @@ func TestSubnetDeployLedger(t *testing.T) { walletA, err := wallet.New( context.Background(), - &primary.WalletConfig{ - URI: network.Endpoint, - AVAXKeychain: keychainA.Keychain, - EthKeychain: secp256k1fx.NewKeychain(), - SubnetIDs: nil, + network.Endpoint, + keychainA.Keychain, + primary.WalletConfig{ + SubnetIDs: nil, }, ) @@ -211,11 +206,10 @@ func TestSubnetDeployLedger(t *testing.T) { walletB, err := wallet.New( context.Background(), - &primary.WalletConfig{ - URI: network.Endpoint, - AVAXKeychain: keychainB.Keychain, - EthKeychain: secp256k1fx.NewKeychain(), - SubnetIDs: []ids.ID{subnetID}, + network.Endpoint, + keychainB.Keychain, + primary.WalletConfig{ + SubnetIDs: []ids.ID{subnetID}, }, ) require.NoError(err) diff --git a/sdk/interchain/signature-aggregator.go b/sdk/interchain/signature-aggregator.go index e9a412b27..ac0f583ec 100644 --- a/sdk/interchain/signature-aggregator.go +++ b/sdk/interchain/signature-aggregator.go @@ -1,4 +1,4 @@ -// Copyright (C) 2024, Ava Labs, Inc. All rights reserved +// // Copyright (C) 2024, Ava Labs, Inc. All rights reserved // See the file LICENSE for licensing terms. package interchain @@ -8,6 +8,9 @@ import ( "os" "time" + "github.com/ava-labs/icm-services/signature-aggregator/aggregator" + "github.com/ava-labs/icm-services/signature-aggregator/metrics" + "github.com/ava-labs/avalanche-cli/pkg/constants" "github.com/ava-labs/avalanche-cli/pkg/models" "github.com/ava-labs/avalanchego/api/info" @@ -16,13 +19,11 @@ import ( avagoconstants "github.com/ava-labs/avalanchego/utils/constants" "github.com/ava-labs/avalanchego/utils/logging" "github.com/ava-labs/avalanchego/vms/platformvm/warp" - apiConfig "github.com/ava-labs/awm-relayer/config" - "github.com/ava-labs/awm-relayer/peers" - "github.com/ava-labs/awm-relayer/signature-aggregator/aggregator" - "github.com/ava-labs/awm-relayer/signature-aggregator/config" - "github.com/ava-labs/awm-relayer/signature-aggregator/metrics" - awmTypes "github.com/ava-labs/awm-relayer/types" - awmUtils "github.com/ava-labs/awm-relayer/utils" + apiConfig "github.com/ava-labs/icm-services/config" + "github.com/ava-labs/icm-services/peers" + "github.com/ava-labs/icm-services/signature-aggregator/config" + awmTypes "github.com/ava-labs/icm-services/types" + awmUtils "github.com/ava-labs/icm-services/utils" "github.com/prometheus/client_golang/prometheus" ) @@ -57,7 +58,6 @@ func createAppRequestNetwork( logLevel, registerer, nil, - allowPrivatePeers, extraPeerEndpoints, &config.Config{ PChainAPI: &apiConfig.APIConfig{ @@ -67,6 +67,7 @@ func createAppRequestNetwork( BaseURL: network.Endpoint, }, }, + allowPrivatePeers, ) if err != nil { return nil, fmt.Errorf("failed to create peer network: %w", err) @@ -114,9 +115,9 @@ func initSignatureAggregator( signatureAggregator, err := aggregator.NewSignatureAggregator( network, logger, + messageCreator, DefaultSignatureCacheSize, metricsInstance, - messageCreator, etnaTime, ) if err != nil { diff --git a/sdk/interchain/signature-aggregator_test.go b/sdk/interchain/signature-aggregator_test.go index 2e28a5745..ef373c8ce 100644 --- a/sdk/interchain/signature-aggregator_test.go +++ b/sdk/interchain/signature-aggregator_test.go @@ -9,7 +9,7 @@ import ( "github.com/ava-labs/avalanchego/ids" "github.com/ava-labs/avalanchego/utils/logging" "github.com/ava-labs/avalanchego/vms/platformvm/warp" - "github.com/ava-labs/awm-relayer/peers/mocks" + "github.com/ava-labs/icm-services/peers/mocks" "github.com/prometheus/client_golang/prometheus" "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" diff --git a/sdk/validatormanager/root.go b/sdk/validatormanager/root.go index a30863bf1..6e8bc5c2b 100644 --- a/sdk/validatormanager/root.go +++ b/sdk/validatormanager/root.go @@ -184,9 +184,9 @@ func GetPChainSubnetConversionWarpMessage( managerAddress common.Address, convertSubnetValidators []*txs.ConvertSubnetToL1Validator, ) (*warp.Message, error) { - validators := []warpMessage.SubnetToL1ConverstionValidatorData{} + validators := []warpMessage.SubnetToL1ConversionValidatorData{} for _, convertSubnetValidator := range convertSubnetValidators { - validators = append(validators, warpMessage.SubnetToL1ConverstionValidatorData{ + validators = append(validators, warpMessage.SubnetToL1ConversionValidatorData{ NodeID: convertSubnetValidator.NodeID[:], BLSPublicKey: convertSubnetValidator.Signer.PublicKey, Weight: convertSubnetValidator.Weight, diff --git a/sdk/wallet/wallet.go b/sdk/wallet/wallet.go index 2037ba16d..f36297233 100644 --- a/sdk/wallet/wallet.go +++ b/sdk/wallet/wallet.go @@ -7,6 +7,7 @@ import ( "github.com/ava-labs/avalanche-cli/sdk/keychain" "github.com/ava-labs/avalanchego/ids" + avagokeychain "github.com/ava-labs/avalanchego/utils/crypto/keychain" "github.com/ava-labs/avalanchego/utils/set" "github.com/ava-labs/avalanchego/vms/secp256k1fx" "github.com/ava-labs/avalanchego/wallet/subnet/primary" @@ -14,21 +15,24 @@ import ( ) type Wallet struct { - primary.Wallet + *primary.Wallet Keychain keychain.Keychain options []common.Option - config *primary.WalletConfig + config primary.WalletConfig } -func New(ctx context.Context, config *primary.WalletConfig) (Wallet, error) { +func New(ctx context.Context, uri string, avaxKeychain avagokeychain.Keychain, config primary.WalletConfig) (Wallet, error) { wallet, err := primary.MakeWallet( ctx, + uri, + avaxKeychain, + nil, config, ) return Wallet{ Wallet: wallet, Keychain: keychain.Keychain{ - Keychain: config.AVAXKeychain, + Keychain: avaxKeychain, }, config: config, }, err diff --git a/tests/e2e/testcases/subnet/sov/etna/suite.go b/tests/e2e/testcases/subnet/sov/etna/suite.go index e8422549c..10bf38863 100644 --- a/tests/e2e/testcases/subnet/sov/etna/suite.go +++ b/tests/e2e/testcases/subnet/sov/etna/suite.go @@ -364,10 +364,6 @@ var _ = ginkgo.Describe("[Etna Subnet SOV]", func() { createEtnaSubnetEvmConfigValidatorManagerFlagKeyname(true, false) }) - ginkgo.It("Test Create Etna POA Subnet Config With P Chain Address for Validator Manager Flag", func() { - createEtnaSubnetEvmConfigValidatorManagerFlagPChain(true, false) - }) - ginkgo.It("Test Create Etna POA Subnet Config Without Proxy Owner Flag", func() { createEtnaSubnetEvmConfigWithoutProxyOwner(true, false) }) @@ -412,3 +408,29 @@ var _ = ginkgo.Describe("[Etna Subnet SOV]", func() { gomega.Expect(err).Should(gomega.BeNil()) }) }) + +var _ = ginkgo.Describe("[Etna Subnet SOV With Errors]", func() { + ginkgo.BeforeEach(func() { + // key + _ = utils.DeleteKey(keyName) + output, err := commands.CreateKeyFromPath(keyName, utils.EwoqKeyPath) + if err != nil { + fmt.Println(output) + utils.PrintStdErr(err) + } + gomega.Expect(err).Should(gomega.BeNil()) + // subnet config + _ = utils.DeleteConfigs(subnetName) + destroyLocalNode() + }) + + ginkgo.AfterEach(func() { + err := utils.DeleteKey(keyName) + gomega.Expect(err).Should(gomega.BeNil()) + commands.CleanNetwork() + }) + + ginkgo.It("Test Create Etna POA Subnet Config With P Chain Address for Validator Manager Flag", func() { + createEtnaSubnetEvmConfigValidatorManagerFlagPChain(true, false) + }) +}) diff --git a/tests/e2e/testcases/validatormanager/suite.go b/tests/e2e/testcases/validatormanager/suite.go index 8555cdfba..c7c39f6e7 100644 --- a/tests/e2e/testcases/validatormanager/suite.go +++ b/tests/e2e/testcases/validatormanager/suite.go @@ -211,7 +211,7 @@ var _ = ginkgo.Describe("[Validator Manager POA Set Up]", ginkgo.Ordered, func() BootstrapValidators: avaGoBootstrapValidators, } - err = subnetSDK.InitializeProofOfAuthority(network, k.PrivKeyHex(), extraAggregatorPeers, logging.Off) + err = subnetSDK.InitializeProofOfAuthority(network, k.PrivKeyHex(), extraAggregatorPeers, true, logging.Off) gomega.Expect(err).Should(gomega.BeNil()) }) }) diff --git a/tests/e2e/utils/helpers.go b/tests/e2e/utils/helpers.go index a31d484d7..dde5a7c76 100644 --- a/tests/e2e/utils/helpers.go +++ b/tests/e2e/utils/helpers.go @@ -836,11 +836,10 @@ func FundLedgerAddress(amount uint64) error { kc := sk.KeyChain() wallet, err := primary.MakeWallet( context.Background(), - &primary.WalletConfig{ - URI: constants.LocalAPIEndpoint, - AVAXKeychain: kc, - EthKeychain: secp256k1fx.NewKeychain(), - }, + constants.LocalAPIEndpoint, + kc, + secp256k1fx.NewKeychain(), + primary.WalletConfig{}, ) if err != nil { return err