Skip to content

Commit

Permalink
Merge pull request #580 from ava-labs/allow-private-peers-v2
Browse files Browse the repository at this point in the history
allow private peers param
  • Loading branch information
cam-schultz authored Dec 10, 2024
2 parents bbccec3 + 5159047 commit d7e0209
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 11 deletions.
5 changes: 2 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
12 changes: 4 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
2 changes: 2 additions & 0 deletions peers/app_request_network.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
1 change: 1 addition & 0 deletions peers/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ import "github.com/ava-labs/icm-services/config"
type Config interface {
GetInfoAPI() *config.APIConfig
GetPChainAPI() *config.APIConfig
GetAllowPrivateIPs() bool
}
5 changes: 5 additions & 0 deletions relayer/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down Expand Up @@ -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
}
5 changes: 5 additions & 0 deletions signature-aggregator/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down Expand Up @@ -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
}
2 changes: 2 additions & 0 deletions tests/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ func CreateDefaultRelayerConfig(
APIPort: 8080,
DeciderURL: "localhost:50051",
SignatureCacheSize: (1024 * 1024),
AllowPrivateIPs: true,
}
}

Expand Down Expand Up @@ -238,6 +239,7 @@ func CreateDefaultSignatureAggregatorConfig(
APIPort: 8080,
MetricsPort: 8081,
SignatureCacheSize: (1024 * 1024),
AllowPrivateIPs: true,
}
}

Expand Down

0 comments on commit d7e0209

Please sign in to comment.