Add enr auto update cli option and bump nim-eth (#2278)

This commit is contained in:
Kim De Mey 2021-02-02 09:07:21 +01:00 committed by GitHub
parent 6141286547
commit 73d9c2aa53
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 6 deletions

View File

@ -165,6 +165,13 @@ type
"Must be one of: any, none, upnp, pmp, extip:<IP>"
defaultValue: "any" }: string
enrAutoUpdate* {.
defaultValue: false
desc: "Discovery can automatically update its ENR with the IP address " &
"and UDP port as seen by other nodes it communicates with. " &
"This option allows to enable/disable this functionality"
name: "enr-auto-update" .}: bool
weakSubjectivityCheckpoint* {.
desc: "Weak subjectivity checkpoint in the format block_root:epoch_number"
name: "weak-subjectivity-checkpoint" }: Option[Checkpoint]

View File

@ -93,4 +93,5 @@ proc new*(T: type Eth2DiscoveryProtocol,
loadBootstrapFile(persistentBootstrapFile, bootstrapEnrs)
newProtocol(pk, ip, tcpPort, udpPort, enrFields, bootstrapEnrs,
bindIp = conf.listenAddress, rng = rng)
bindIp = conf.listenAddress, enrAutoUpdate = conf.enrAutoUpdate,
rng = rng)

View File

@ -1560,8 +1560,8 @@ programMain:
1, # sequence number
networkKeys.seckey.asEthKey,
some(config.bootstrapAddress),
config.bootstrapPort,
config.bootstrapPort,
some(config.bootstrapPort),
some(config.bootstrapPort),
[toFieldPair("eth2", SSZ.encode(enrForkIdFromState initialState[])),
toFieldPair("attnets", SSZ.encode(netMetadata.attnets))])
@ -1781,8 +1781,8 @@ programMain:
config.seqNumber,
netKeys.seckey.asEthKey,
some(config.ipExt),
config.tcpPortExt,
config.udpPortExt,
some(config.tcpPortExt),
some(config.udpPortExt),
fieldPairs).expect("Record within size limits")
echo record.toURI()

2
vendor/nim-eth vendored

@ -1 +1 @@
Subproject commit e25500c9f0597e91979a4c714989abd6e01f70d9
Subproject commit 4e58eb48ce1b1a06d28802ad22215de9ff92a916