diff --git a/go.mod b/go.mod index 337c06ae..98160ed4 100644 --- a/go.mod +++ b/go.mod @@ -4,9 +4,9 @@ go 1.22.10 require ( github.com/alexliesenfeld/health v0.8.0 - github.com/ava-labs/avalanchego v1.12.1-0.20241210035517-714dfa0c3942 + github.com/ava-labs/avalanchego v1.12.1-0.20241210172525-c7ebd8fbae88 github.com/ava-labs/coreth v0.13.9-rc.1 - github.com/ava-labs/icm-contracts v1.0.9-0.20241210131047-74f89f0f9331 + github.com/ava-labs/icm-contracts v1.0.9-0.20241210181701-a4bd5c92b056 github.com/ava-labs/subnet-evm v0.6.13-0.20241205165027-6c98da796f35 github.com/aws/aws-sdk-go-v2 v1.32.6 github.com/aws/aws-sdk-go-v2/config v1.28.6 @@ -34,7 +34,6 @@ require ( github.com/DataDog/zstd v1.5.2 // indirect github.com/NYTimes/gziphandler v1.1.1 // indirect github.com/VictoriaMetrics/fastcache v1.12.1 // indirect - github.com/ava-labs/awm-relayer v1.4.1-0.20241122202209-75359d908260 // 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 diff --git a/go.sum b/go.sum index ce790534..292d076c 100644 --- a/go.sum +++ b/go.sum @@ -60,16 +60,12 @@ github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= -github.com/ava-labs/avalanchego v1.12.1-0.20241210035517-714dfa0c3942 h1:eDSWDIaaMHNEAorxQqnA88S39zlgmQ26OKgWn5AaDJ0= -github.com/ava-labs/avalanchego v1.12.1-0.20241210035517-714dfa0c3942/go.mod h1:yhD5dpZyStIVbxQ550EDi5w5SL7DQ/xGE6TIxosb7U0= -github.com/ava-labs/awm-relayer v1.4.1-0.20241122202209-75359d908260 h1:VRNzoY1xvXHphcXXmuXMrUFp5Gm/eiipVJMmNV+UN9c= -github.com/ava-labs/awm-relayer v1.4.1-0.20241122202209-75359d908260/go.mod h1:/hrQpd8P3BfShbRoDE1vD1WZXBchu7r8CQPTEb5tWOQ= +github.com/ava-labs/avalanchego v1.12.1-0.20241210172525-c7ebd8fbae88 h1:tZdtOPFNblKZx+FmJOhqEfxUUscvPhcLHKGZO3BtQ6A= +github.com/ava-labs/avalanchego v1.12.1-0.20241210172525-c7ebd8fbae88/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-contracts v1.0.8 h1:xS2B23WRBnG4MGSmEiy9Wp6781/wtprct9HEHrHcAic= -github.com/ava-labs/icm-contracts v1.0.8/go.mod h1:DRu0hfN9uDyxfL0tgJBVq9OM3uc+t53KiyRov9n+OG4= -github.com/ava-labs/icm-contracts v1.0.9-0.20241210131047-74f89f0f9331 h1:Mcml40d0O2ebfVgd7wFN6X3YIAOw3j5TrR7onHP1EpY= -github.com/ava-labs/icm-contracts v1.0.9-0.20241210131047-74f89f0f9331/go.mod h1:qYbpPBuMoWW8btWiuFPFS1uZtc2wRcUOP42DKT4M/oQ= +github.com/ava-labs/icm-contracts v1.0.9-0.20241210181701-a4bd5c92b056 h1:VJDtg5UW4SWBeEMtv6qdWgEohdZxEp3jGDAllH6f8eI= +github.com/ava-labs/icm-contracts v1.0.9-0.20241210181701-a4bd5c92b056/go.mod h1:b6Hr01e5LWPua+nuZrSjjCyqfEhgFFdjBmKoJMoWTZo= github.com/ava-labs/subnet-evm v0.6.13-0.20241205165027-6c98da796f35 h1:CbXWon0fwGDEDCCiChx2VeIIwO3UML9+8OUTyNwPsxA= github.com/ava-labs/subnet-evm v0.6.13-0.20241205165027-6c98da796f35/go.mod h1:SfAF4jjYPkezKWShPY/T31WQdD/UHrDyqy0kxA0LE0w= github.com/aws/aws-sdk-go-v2 v1.32.6 h1:7BokKRgRPuGmKkFMhEg/jSul+tB9VvXhcViILtfG8b4= diff --git a/peers/app_request_network.go b/peers/app_request_network.go index bead289c..cdaabeb5 100644 --- a/peers/app_request_network.go +++ b/peers/app_request_network.go @@ -141,6 +141,8 @@ func NewNetwork( ) return nil, err } + testNetworkConfig.AllowPrivateIPs = cfg.GetAllowPrivateIPs() + testNetwork, err := network.NewTestNetwork(logger, networkMetrics, testNetworkConfig, handler) if err != nil { logger.Error( diff --git a/peers/config.go b/peers/config.go index f997b3fa..d9dc0103 100644 --- a/peers/config.go +++ b/peers/config.go @@ -9,4 +9,5 @@ import "github.com/ava-labs/icm-services/config" type Config interface { GetInfoAPI() *config.APIConfig GetPChainAPI() *config.APIConfig + GetAllowPrivateIPs() bool } diff --git a/relayer/config/config.go b/relayer/config/config.go index db299d7b..1e88d761 100644 --- a/relayer/config/config.go +++ b/relayer/config/config.go @@ -65,6 +65,7 @@ type Config struct { DeciderURL string `mapstructure:"decider-url" json:"decider-url"` SignatureCacheSize uint64 `mapstructure:"signature-cache-size" json:"signature-cache-size"` ManuallyTrackedPeers []*basecfg.PeerConfig `mapstructure:"manually-tracked-peers" json:"manually-tracked-peers"` + AllowPrivateIPs bool `mapstructure:"allow-private-ips" json:"allow-private-ips"` // mapstructure doesn't handle time.Time out of the box so handle it manually EtnaTime time.Time `json:"etna-time"` @@ -255,3 +256,7 @@ func (c *Config) GetPChainAPI() *basecfg.APIConfig { func (c *Config) GetInfoAPI() *basecfg.APIConfig { return c.InfoAPI } + +func (c *Config) GetAllowPrivateIPs() bool { + return c.AllowPrivateIPs +} diff --git a/signature-aggregator/config/config.go b/signature-aggregator/config/config.go index 9dd8525a..ebf2413f 100644 --- a/signature-aggregator/config/config.go +++ b/signature-aggregator/config/config.go @@ -35,6 +35,7 @@ type Config struct { APIPort uint16 `mapstructure:"api-port" json:"api-port"` MetricsPort uint16 `mapstructure:"metrics-port" json:"metrics-port"` SignatureCacheSize uint64 `mapstructure:"signature-cache-size" json:"signature-cache-size"` + AllowPrivateIPs bool `mapstructure:"allow-private-ips" json:"allow-private-ips"` // mapstructure doesn't support time.Time out of the box so handle it manually EtnaTime time.Time `json:"etna-time"` @@ -67,3 +68,7 @@ func (c *Config) GetPChainAPI() *basecfg.APIConfig { func (c *Config) GetInfoAPI() *basecfg.APIConfig { return c.InfoAPI } + +func (c *Config) GetAllowPrivateIPs() bool { + return c.AllowPrivateIPs +} diff --git a/tests/utils/utils.go b/tests/utils/utils.go index c37a8feb..9f438695 100644 --- a/tests/utils/utils.go +++ b/tests/utils/utils.go @@ -208,6 +208,7 @@ func CreateDefaultRelayerConfig( APIPort: 8080, DeciderURL: "localhost:50051", SignatureCacheSize: (1024 * 1024), + AllowPrivateIPs: true, } } @@ -238,6 +239,7 @@ func CreateDefaultSignatureAggregatorConfig( APIPort: 8080, MetricsPort: 8081, SignatureCacheSize: (1024 * 1024), + AllowPrivateIPs: true, } }