diff --git a/fluffy/conf.nim b/fluffy/conf.nim index 99a2279a2..f16df7e6e 100644 --- a/fluffy/conf.nim +++ b/fluffy/conf.nim @@ -29,8 +29,8 @@ proc defaultDataDir*(): string = getHomeDir() / dataDir const - defaultListenAddress* = (static ValidIpAddress.init("0.0.0.0")) - defaultAdminListenAddress* = (static ValidIpAddress.init("127.0.0.1")) + defaultListenAddress* = (static parseIpAddress("0.0.0.0")) + defaultAdminListenAddress* = (static parseIpAddress("127.0.0.1")) defaultProxyAddress* = (static "http://127.0.0.1:8546") defaultClientConfig* = getHttpClientConfig(defaultProxyAddress) @@ -80,7 +80,7 @@ type defaultValue: defaultListenAddress defaultValueDesc: $defaultListenAddressDesc desc: "Listening address for the Discovery v5 traffic" - name: "listen-address" .}: ValidIpAddress + name: "listen-address" .}: IpAddress portalNetwork* {. desc: @@ -150,7 +150,7 @@ type defaultValue: defaultAdminListenAddress defaultValueDesc: $defaultAdminListenAddressDesc desc: "Listening address of the metrics server" - name: "metrics-address" .}: ValidIpAddress + name: "metrics-address" .}: IpAddress metricsPort* {. defaultValue: 8008 @@ -171,7 +171,7 @@ type desc: "Listening address of the RPC server" defaultValue: defaultAdminListenAddress defaultValueDesc: $defaultAdminListenAddressDesc - name: "rpc-address" .}: ValidIpAddress + name: "rpc-address" .}: IpAddress # it makes little sense to have default value here in final release, but until then # it would be troublesome to add some fake uri param every time diff --git a/fluffy/tests/test_helpers.nim b/fluffy/tests/test_helpers.nim index fef2126eb..65f50418c 100644 --- a/fluffy/tests/test_helpers.nim +++ b/fluffy/tests/test_helpers.nim @@ -1,5 +1,5 @@ # Nimbus - Portal Network -# Copyright (c) 2021 Status Research & Development GmbH +# Copyright (c) 2021-2023 Status Research & Development GmbH # Licensed and distributed under either of # * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT). # * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0). @@ -13,7 +13,7 @@ import ../network/history/[accumulator, history_content] proc localAddress*(port: int): Address = - Address(ip: ValidIpAddress.init("127.0.0.1"), port: Port(port)) + Address(ip: parseIpAddress("127.0.0.1"), port: Port(port)) proc initDiscoveryNode*( rng: ref HmacDrbgContext, diff --git a/fluffy/tools/beacon_lc_bridge/beacon_lc_bridge_conf.nim b/fluffy/tools/beacon_lc_bridge/beacon_lc_bridge_conf.nim index 53522d24b..d6c382336 100644 --- a/fluffy/tools/beacon_lc_bridge/beacon_lc_bridge_conf.nim +++ b/fluffy/tools/beacon_lc_bridge/beacon_lc_bridge_conf.nim @@ -113,7 +113,7 @@ type BeaconBridgeConf* = object desc: "Listening address for the Ethereum LibP2P and Discovery v5 traffic" defaultValue: defaultListenAddress defaultValueDesc: $defaultListenAddressDesc - name: "listen-address" .}: ValidIpAddress + name: "listen-address" .}: IpAddress tcpPort* {. desc: "Listening TCP port for Ethereum LibP2P traffic" diff --git a/fluffy/tools/portalcli.nim b/fluffy/tools/portalcli.nim index 6fedfd395..f2e19895d 100644 --- a/fluffy/tools/portalcli.nim +++ b/fluffy/tools/portalcli.nim @@ -1,5 +1,5 @@ # Nimbus - Portal Network -# Copyright (c) 2021 Status Research & Development GmbH +# Copyright (c) 2021-2023 Status Research & Development GmbH # Licensed and distributed under either of # * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT). # * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0). @@ -19,8 +19,8 @@ import ../network/history/[history_content, history_network] const - defaultListenAddress* = (static ValidIpAddress.init("0.0.0.0")) - defaultAdminListenAddress* = (static ValidIpAddress.init("127.0.0.1")) + defaultListenAddress* = (static parseIpAddress("0.0.0.0")) + defaultAdminListenAddress* = (static parseIpAddress("127.0.0.1")) defaultListenAddressDesc = $defaultListenAddress defaultAdminListenAddressDesc = $defaultAdminListenAddress @@ -51,7 +51,7 @@ type defaultValue: defaultListenAddress defaultValueDesc: $defaultListenAddressDesc desc: "Listening address for the Discovery v5 traffic" - name: "listen-address" }: ValidIpAddress + name: "listen-address" }: IpAddress # Note: This will add bootstrap nodes for both Discovery v5 network and each # enabled Portal network. No distinction is made on bootstrap nodes per @@ -94,7 +94,7 @@ type defaultValue: defaultAdminListenAddress defaultValueDesc: $defaultAdminListenAddressDesc desc: "Listening address of the metrics server" - name: "metrics-address" .}: ValidIpAddress + name: "metrics-address" .}: IpAddress metricsPort* {. defaultValue: 8008 diff --git a/fluffy/tools/utp_testing/utp_test_app.nim b/fluffy/tools/utp_testing/utp_test_app.nim index f619ec11b..8f961c4ca 100644 --- a/fluffy/tools/utp_testing/utp_test_app.nim +++ b/fluffy/tools/utp_testing/utp_test_app.nim @@ -20,7 +20,7 @@ import ../../rpc/rpc_discovery_api const - defaultListenAddress* = (static ValidIpAddress.init("127.0.0.1")) + defaultListenAddress* = (static parseIpAddress("127.0.0.1")) type AppConf* = object rpcPort* {. @@ -36,12 +36,12 @@ type AppConf* = object udpListenAddress* {. defaultValue: defaultListenAddress desc: "UDP listening address" - name: "udp-listen-address" .}: ValidIpAddress + name: "udp-listen-address" .}: IpAddress rpcListenAddress* {. defaultValue: defaultListenAddress desc: "RPC listening address" - name: "rpc-listen-address" .}: ValidIpAddress + name: "rpc-listen-address" .}: IpAddress proc `%`*(value: enr.Record): JsonNode = newJString(value.toURI()) diff --git a/nimbus/config.nim b/nimbus/config.nim index d85c650bc..9eda9c7b8 100644 --- a/nimbus/config.nim +++ b/nimbus/config.nim @@ -1,4 +1,4 @@ -# Copyright (c) 2018-2022 Status Research & Development GmbH +# Copyright (c) 2018-2023 Status Research & Development GmbH # Licensed under either of # * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE)) # * MIT license ([LICENSE-MIT](LICENSE-MIT)) @@ -92,8 +92,8 @@ const defaultEthGraphqlPort = 8547 defaultEngineApiPort = 8550 defaultEngineApiWsPort = 8551 - defaultListenAddress = (static ValidIpAddress.init("0.0.0.0")) - defaultAdminListenAddress = (static ValidIpAddress.init("127.0.0.1")) + defaultListenAddress = (static parseIpAddress("0.0.0.0")) + defaultAdminListenAddress = (static parseIpAddress("127.0.0.1")) defaultListenAddressDesc = $defaultListenAddress & ", meaning all network interfaces" defaultAdminListenAddressDesc = $defaultAdminListenAddress & ", meaning local host only" logLevelDesc = getLogLevels() @@ -316,7 +316,7 @@ type desc: "Listening IP address for Ethereum P2P and Discovery traffic" defaultValue: defaultListenAddress defaultValueDesc: $defaultListenAddressDesc - name: "listen-address" }: ValidIpAddress + name: "listen-address" }: IpAddress tcpPort* {. desc: "Ethereum P2P network listening TCP port" @@ -395,7 +395,7 @@ type desc: "Listening IP address of the JSON-RPC server" defaultValue: defaultAdminListenAddress defaultValueDesc: $defaultAdminListenAddressDesc - name: "rpc-address" }: ValidIpAddress + name: "rpc-address" }: IpAddress rpcApi {. desc: "Enable specific set of RPC API (available: eth, debug)" @@ -418,7 +418,7 @@ type desc: "Listening IP address of the Websocket JSON-RPC server" defaultValue: defaultAdminListenAddress defaultValueDesc: $defaultAdminListenAddressDesc - name: "ws-address" }: ValidIpAddress + name: "ws-address" }: IpAddress wsApi {. desc: "Enable specific set of Websocket RPC API (available: eth, debug)" @@ -441,7 +441,7 @@ type desc: "Listening address for the Engine API" defaultValue: defaultAdminListenAddress defaultValueDesc: $defaultAdminListenAddressDesc - name: "engine-api-address" .}: ValidIpAddress + name: "engine-api-address" .}: IpAddress engineApiWsEnabled* {. desc: "Enable the WebSocket Engine API" @@ -458,7 +458,7 @@ type desc: "Listening address for the WebSocket Engine API" defaultValue: defaultAdminListenAddress defaultValueDesc: $defaultAdminListenAddressDesc - name: "engine-api-ws-address" .}: ValidIpAddress + name: "engine-api-ws-address" .}: IpAddress terminalTotalDifficulty* {. desc: "The terminal total difficulty of the eth2 merge transition block." & @@ -495,7 +495,7 @@ type desc: "Listening IP address of the GraphQL HTTP server" defaultValue: defaultAdminListenAddress defaultValueDesc: $defaultAdminListenAddressDesc - name: "graphql-address" }: ValidIpAddress + name: "graphql-address" }: IpAddress metricsEnabled* {. desc: "Enable the built-in metrics HTTP server" @@ -512,7 +512,7 @@ type desc: "Listening IP address of the built-in metrics HTTP server" defaultValue: defaultAdminListenAddress defaultValueDesc: $defaultAdminListenAddressDesc - name: "metrics-address" }: ValidIpAddress + name: "metrics-address" }: IpAddress statelessModeDataSourceUrl* {. desc: "URL of the node to use as a data source for on-demand data fetching via the JSON-RPC API" diff --git a/nimbus_verified_proxy/nimbus_verified_proxy.nim b/nimbus_verified_proxy/nimbus_verified_proxy.nim index cecdfb188..bac3a5ab9 100644 --- a/nimbus_verified_proxy/nimbus_verified_proxy.nim +++ b/nimbus_verified_proxy/nimbus_verified_proxy.nim @@ -32,8 +32,6 @@ func getConfiguredChainId(networkMetadata: Eth2NetworkMetadata): Quantity = net = networkMetadata.eth1Network.get() chainId = case net of mainnet: 1.Quantity - of ropsten: 3.Quantity - of rinkeby: 4.Quantity of goerli: 5.Quantity of sepolia: 11155111.Quantity of holesky: 17000.Quantity diff --git a/nimbus_verified_proxy/nimbus_verified_proxy_conf.nim b/nimbus_verified_proxy/nimbus_verified_proxy_conf.nim index edaabf3fe..e2c485566 100644 --- a/nimbus_verified_proxy/nimbus_verified_proxy_conf.nim +++ b/nimbus_verified_proxy/nimbus_verified_proxy_conf.nim @@ -87,7 +87,7 @@ type VerifiedProxyConf* = object desc: "Listening address of the JSON-RPC server" defaultValue: defaultAdminListenAddress defaultValueDesc: $defaultAdminListenAddressDesc - name: "rpc-address" .}: ValidIpAddress + name: "rpc-address" .}: IpAddress rpcPort* {. desc: "Listening port of the JSON-RPC server" @@ -109,7 +109,7 @@ type VerifiedProxyConf* = object desc: "Listening address for the Ethereum LibP2P and Discovery v5 traffic" defaultValue: defaultListenAddress defaultValueDesc: $defaultListenAddressDesc - name: "listen-address" .}: ValidIpAddress + name: "listen-address" .}: IpAddress tcpPort* {. desc: "Listening TCP port for Ethereum LibP2P traffic" diff --git a/vendor/nim-confutils b/vendor/nim-confutils index 674c9e4c8..7568f1b7c 160000 --- a/vendor/nim-confutils +++ b/vendor/nim-confutils @@ -1 +1 @@ -Subproject commit 674c9e4c8e0cad2b7193cc9a59c12d39a397750f +Subproject commit 7568f1b7c3142d8e87c1f3dd42924238926affbe diff --git a/vendor/nim-eth b/vendor/nim-eth index 700360fde..ca4898e24 160000 --- a/vendor/nim-eth +++ b/vendor/nim-eth @@ -1 +1 @@ -Subproject commit 700360fde2cf91c0c6d66af42851ee21c947e23a +Subproject commit ca4898e24a4ffb61759d57469f208b542123a092 diff --git a/vendor/nimbus-eth2 b/vendor/nimbus-eth2 index 9fd52ebe9..c7952ff77 160000 --- a/vendor/nimbus-eth2 +++ b/vendor/nimbus-eth2 @@ -1 +1 @@ -Subproject commit 9fd52ebe9f9f23f378c71260d26827fc98af3ae8 +Subproject commit c7952ff7780fde117a8998fa799e93a8f2d78c32