Skip to content

Commit

Permalink
Rename AWM Relayer to ICM services (#2402)
Browse files Browse the repository at this point in the history
* rename relayer

* fix lint

* lint

* update e2e

* update e2e

* icm relayer (#2405)

* Rename relayer allow private peers (#2409)

* reenable allow private peers param

* update dep

* lint

---------

Co-authored-by: Felipe Madero <[email protected]>
Co-authored-by: arturrez <[email protected]>
  • Loading branch information
3 people authored Dec 9, 2024
1 parent add6614 commit 96a3728
Show file tree
Hide file tree
Showing 28 changed files with 237 additions and 194 deletions.
4 changes: 2 additions & 2 deletions .github/packer/aws-ubuntu-docker.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
}

Expand Down
4 changes: 4 additions & 0 deletions cmd/blockchaincmd/add_validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -466,6 +468,7 @@ func CallAddValidator(
disableOwners,
weight,
extraAggregatorPeers,
aggregatorAllowPrivatePeers,
aggregatorLogLevel,
pos,
delegationFee,
Expand Down Expand Up @@ -497,6 +500,7 @@ func CallAddValidator(
ownerPrivateKey,
validationID,
extraAggregatorPeers,
aggregatorAllowPrivatePeers,
aggregatorLogLevel,
); err != nil {
return err
Expand Down
10 changes: 9 additions & 1 deletion cmd/blockchaincmd/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -1039,6 +1040,7 @@ func deployBlockchain(cmd *cobra.Command, args []string) error {
network,
genesisPrivateKey,
extraAggregatorPeers,
aggregatorAllowPrivatePeers,
logLvl,
validatorManagerSDK.PoSParams{
MinimumStakeAmount: big.NewInt(int64(poSMinimumStakeAmount)),
Expand All @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions cmd/blockchaincmd/remove_validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -261,6 +262,7 @@ func removeValidatorSOV(
ownerPrivateKey,
nodeID,
extraAggregatorPeers,
aggregatorAllowPrivatePeers,
aggregatorLogLevel,
sc.PoS(),
force,
Expand All @@ -284,6 +286,7 @@ func removeValidatorSOV(
ownerPrivateKey,
validationID,
extraAggregatorPeers,
aggregatorAllowPrivatePeers,
aggregatorLogLevel,
); err != nil {
return err
Expand Down
14 changes: 9 additions & 5 deletions cmd/contractcmd/init_validator_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -184,6 +186,7 @@ func initValidatorManager(_ *cobra.Command, args []string) error {
network,
privateKey,
extraAggregatorPeers,
validatorManagerFlags.aggregatorAllowPrivatePeers,
validatorManagerFlags.aggregatorLogLevel,
); err != nil {
return err
Expand All @@ -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)),
Expand Down
55 changes: 25 additions & 30 deletions cmd/keycmd/transfer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -659,7 +657,7 @@ func pToXSend(

func exportFromP(
amount uint64,
wallet primary.Wallet,
wallet *primary.Wallet,
blockchainID ids.ID,
blockchainAlias string,
to secp256k1fx.OutputOwners,
Expand Down Expand Up @@ -706,7 +704,7 @@ func exportFromP(
}

func importIntoX(
wallet primary.Wallet,
wallet *primary.Wallet,
blockchainID ids.ID,
blockchainAlias string,
to secp256k1fx.OutputOwners,
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -793,7 +790,7 @@ func pToCSend(

func importIntoC(
network models.Network,
wallet primary.Wallet,
wallet *primary.Wallet,
blockchainID ids.ID,
blockchainAlias string,
destinationAddrStr string,
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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,
Expand Down Expand Up @@ -952,7 +947,7 @@ func exportFromC(
}

func importIntoP(
wallet primary.Wallet,
wallet *primary.Wallet,
blockchainID ids.ID,
blockchainAlias string,
to secp256k1fx.OutputOwners,
Expand Down
10 changes: 5 additions & 5 deletions cmd/networkcmd/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion cmd/nodecmd/wiz.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
36 changes: 18 additions & 18 deletions go.mod
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
Loading

0 comments on commit 96a3728

Please sign in to comment.