Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: status-im/nimbus-eth2
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 378108ae8f8594fcfcc02fcd11dec6efe7b5d03f
Choose a base ref
..
head repository: status-im/nimbus-eth2
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: e7fafaaaec9abe0571b9cce6dc3c089df6e3bdaf
Choose a head ref
Showing with 9 additions and 15 deletions.
  1. +1 −1 beacon_chain/networking/eth2_discovery.nim
  2. +4 −4 beacon_chain/networking/eth2_network.nim
  3. +1 −1 beacon_chain/nimbus_beacon_node.nim
  4. +1 −1 ncli/ncli_testnet.nim
  5. +1 −7 tests/test_discovery.nim
  6. +1 −1 vendor/nim-eth
2 changes: 1 addition & 1 deletion beacon_chain/networking/eth2_discovery.nim
Original file line number Diff line number Diff line change
@@ -79,7 +79,7 @@ proc loadBootstrapFile*(bootstrapFile: string,

proc new*(T: type Eth2DiscoveryProtocol,
config: BeaconNodeConf | LightClientConf,
enrIp: Option[ValidIpAddress], enrTcpPort, enrUdpPort: Option[Port],
enrIp: Option[IpAddress], enrTcpPort, enrUdpPort: Option[Port],
pk: PrivateKey,
enrFields: openArray[(string, seq[byte])], rng: ref HmacDrbgContext):
T =
8 changes: 4 additions & 4 deletions beacon_chain/networking/eth2_network.nim
Original file line number Diff line number Diff line change
@@ -1806,7 +1806,7 @@ proc new(T: type Eth2Node,
enrForkId: ENRForkID, discoveryForkId: ENRForkID,
forkDigests: ref ForkDigests, getBeaconTime: GetBeaconTimeFn,
switch: Switch, pubsub: GossipSub,
ip: Option[ValidIpAddress], tcpPort, udpPort: Option[Port],
ip: Option[IpAddress], tcpPort, udpPort: Option[Port],
privKey: keys.PrivateKey, discovery: bool,
directPeers: DirectPeers,
rng: ref HmacDrbgContext): T {.raises: [CatchableError].} =
@@ -2304,8 +2304,8 @@ proc createEth2Node*(rng: ref HmacDrbgContext,
cfg, getBeaconTime().slotOrZero.epoch, genesis_validators_root)

(extIp, extTcpPort, extUdpPort) = try: setupAddress(
config.nat, ValidIpAddress.init config.listenAddress, config.tcpPort,
config.udpPort, clientId)
config.nat, config.listenAddress, config.tcpPort, config.udpPort,
clientId)
except CatchableError as exc: raise exc
except Exception as exc: raiseAssert exc.msg

@@ -2330,7 +2330,7 @@ proc createEth2Node*(rng: ref HmacDrbgContext,
hostAddress = tcpEndPoint(
ValidIpAddress.init config.listenAddress, config.tcpPort)
announcedAddresses = if extIp.isNone() or extTcpPort.isNone(): @[]
else: @[tcpEndPoint(extIp.get(), extTcpPort.get())]
else: @[tcpEndPoint(ValidIpAddress.init(extIp.get()), extTcpPort.get())]

debug "Initializing networking", hostAddress,
network_public_key = netKeys.pubkey,
2 changes: 1 addition & 1 deletion beacon_chain/nimbus_beacon_node.nim
Original file line number Diff line number Diff line change
@@ -2132,7 +2132,7 @@ proc doRecord(config: BeaconNodeConf, rng: var HmacDrbgContext) {.
let record = enr.Record.init(
config.seqNumber,
netKeys.seckey.asEthKey,
some(ValidIpAddress.init config.ipExt),
some(config.ipExt),
some(config.tcpPortExt),
some(config.udpPortExt),
fieldPairs).expect("Record within size limits")
2 changes: 1 addition & 1 deletion ncli/ncli_testnet.nim
Original file line number Diff line number Diff line change
@@ -377,7 +377,7 @@ proc createEnr(rng: var HmacDrbgContext,
bootstrapEnr = enr.Record.init(
1, # sequence number
networkKeys.seckey.asEthKey,
some(ValidIpAddress.init address),
some(address),
some(port),
some(port),
[
8 changes: 1 addition & 7 deletions tests/test_discovery.nim
Original file line number Diff line number Diff line change
@@ -21,13 +21,7 @@ proc new(T: type Eth2DiscoveryProtocol,
enrFields: openArray[(string, seq[byte])] = [],
rng: ref HmacDrbgContext):
T {.raises: [CatchableError].} =
let optValidIpAddress =
if enrIp.isSome:
some ValidIpAddress.init enrIp.get
else:
none ValidIpAddress

newProtocol(pk, optValidIpAddress, enrTcpPort, enrUdpPort, enrFields,
newProtocol(pk, enrIp, enrTcpPort, enrUdpPort, enrFields,
bindPort = bindPort, bindIp = bindIp, rng = rng)

proc generateNode(rng: ref HmacDrbgContext, port: Port,