Bump nim-eth for Opt changes and make Opt related adjustments (#6369)
This commit is contained in:
parent
cb2c379b37
commit
7a8c1d818a
|
@ -78,7 +78,7 @@ proc loadBootstrapFile*(bootstrapFile: string,
|
||||||
|
|
||||||
proc new*(T: type Eth2DiscoveryProtocol,
|
proc new*(T: type Eth2DiscoveryProtocol,
|
||||||
config: BeaconNodeConf | LightClientConf,
|
config: BeaconNodeConf | LightClientConf,
|
||||||
enrIp: Option[IpAddress], enrTcpPort, enrUdpPort: Option[Port],
|
enrIp: Opt[IpAddress], enrTcpPort, enrUdpPort: Opt[Port],
|
||||||
pk: PrivateKey,
|
pk: PrivateKey,
|
||||||
enrFields: openArray[(string, seq[byte])], rng: ref HmacDrbgContext):
|
enrFields: openArray[(string, seq[byte])], rng: ref HmacDrbgContext):
|
||||||
T =
|
T =
|
||||||
|
|
|
@ -1765,7 +1765,7 @@ proc new(T: type Eth2Node,
|
||||||
enrForkId: ENRForkID, discoveryForkId: ENRForkID,
|
enrForkId: ENRForkID, discoveryForkId: ENRForkID,
|
||||||
forkDigests: ref ForkDigests, getBeaconTime: GetBeaconTimeFn,
|
forkDigests: ref ForkDigests, getBeaconTime: GetBeaconTimeFn,
|
||||||
switch: Switch, pubsub: GossipSub,
|
switch: Switch, pubsub: GossipSub,
|
||||||
ip: Option[IpAddress], tcpPort, udpPort: Option[Port],
|
ip: Opt[IpAddress], tcpPort, udpPort: Opt[Port],
|
||||||
privKey: keys.PrivateKey, discovery: bool,
|
privKey: keys.PrivateKey, discovery: bool,
|
||||||
directPeers: DirectPeers,
|
directPeers: DirectPeers,
|
||||||
rng: ref HmacDrbgContext): T {.raises: [CatchableError].} =
|
rng: ref HmacDrbgContext): T {.raises: [CatchableError].} =
|
||||||
|
|
|
@ -2271,9 +2271,9 @@ proc doRecord(config: BeaconNodeConf, rng: var HmacDrbgContext) {.
|
||||||
let record = enr.Record.init(
|
let record = enr.Record.init(
|
||||||
config.seqNumber,
|
config.seqNumber,
|
||||||
netKeys.seckey.asEthKey,
|
netKeys.seckey.asEthKey,
|
||||||
some(config.ipExt),
|
Opt.some(config.ipExt),
|
||||||
some(config.tcpPortExt),
|
Opt.some(config.tcpPortExt),
|
||||||
some(config.udpPortExt),
|
Opt.some(config.udpPortExt),
|
||||||
fieldPairs).expect("Record within size limits")
|
fieldPairs).expect("Record within size limits")
|
||||||
|
|
||||||
echo record.toURI()
|
echo record.toURI()
|
||||||
|
|
|
@ -379,9 +379,9 @@ proc createEnr(rng: var HmacDrbgContext,
|
||||||
bootstrapEnr = enr.Record.init(
|
bootstrapEnr = enr.Record.init(
|
||||||
1, # sequence number
|
1, # sequence number
|
||||||
networkKeys.seckey.asEthKey,
|
networkKeys.seckey.asEthKey,
|
||||||
some(address),
|
Opt.some(address),
|
||||||
some(port),
|
Opt.some(port),
|
||||||
some(port),
|
Opt.some(port),
|
||||||
[
|
[
|
||||||
toFieldPair(enrForkIdField, forkId),
|
toFieldPair(enrForkIdField, forkId),
|
||||||
toFieldPair(enrAttestationSubnetsField, SSZ.encode(netMetadata.attnets))
|
toFieldPair(enrAttestationSubnetsField, SSZ.encode(netMetadata.attnets))
|
||||||
|
|
|
@ -17,7 +17,7 @@ import
|
||||||
|
|
||||||
proc new(T: type Eth2DiscoveryProtocol,
|
proc new(T: type Eth2DiscoveryProtocol,
|
||||||
pk: keys.PrivateKey,
|
pk: keys.PrivateKey,
|
||||||
enrIp: Option[IpAddress], enrTcpPort, enrUdpPort: Option[Port],
|
enrIp: Opt[IpAddress], enrTcpPort, enrUdpPort: Opt[Port],
|
||||||
bindPort: Port, bindIp: IpAddress,
|
bindPort: Port, bindIp: IpAddress,
|
||||||
enrFields: openArray[(string, seq[byte])] = [],
|
enrFields: openArray[(string, seq[byte])] = [],
|
||||||
rng: ref HmacDrbgContext): T =
|
rng: ref HmacDrbgContext): T =
|
||||||
|
@ -32,7 +32,7 @@ proc generateNode(rng: ref HmacDrbgContext, port: Port,
|
||||||
except ValueError:
|
except ValueError:
|
||||||
raiseAssert "Argument is a valid IP address"
|
raiseAssert "Argument is a valid IP address"
|
||||||
Eth2DiscoveryProtocol.new(keys.PrivateKey.random(rng[]),
|
Eth2DiscoveryProtocol.new(keys.PrivateKey.random(rng[]),
|
||||||
some(ip), some(port), some(port), port, ip, enrFields, rng = rng)
|
Opt.some(ip), Opt.some(port), Opt.some(port), port, ip, enrFields, rng = rng)
|
||||||
|
|
||||||
# TODO: Add tests with a syncnets preference
|
# TODO: Add tests with a syncnets preference
|
||||||
const noSyncnetsPreference = SyncnetBits()
|
const noSyncnetsPreference = SyncnetBits()
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit f169068df6c11a2aeba27584c60e354e19c42e94
|
Subproject commit 26212c881b464ed64cac20442fb45144d3ecd3b3
|
Loading…
Reference in New Issue