Upgrade submodules (#30)

* Update submodules

* Fix secureManager signature as part of libp2p upgrade
This commit is contained in:
Oskar Thorén 2020-06-15 11:05:37 +08:00 committed by GitHub
parent 37d8720d52
commit a8a1e39052
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 33 additions and 17 deletions

View File

@ -13,17 +13,27 @@ import
libp2p/protocols/pubsub/[pubsub, gossipsub],
../../waku/protocol/v2/waku_protocol
when libp2p_secure == "noise":
import libp2p/protocols/secure/noise
else:
import libp2p/protocols/secure/secio
import
libp2p/protocols/secure/noise,
libp2p/protocols/secure/secio
export
switch, peer, peerinfo, connection, multiaddress, crypto
type
SecureProtocol* {.pure.} = enum
Noise,
Secio
proc newStandardSwitch*(privKey = none(PrivateKey),
address = MultiAddress.init("/ip4/127.0.0.1/tcp/0").tryGet(),
triggerSelf = false,
secureManagers: openarray[SecureProtocol] = [
# NOTE below relates to Eth2
# TODO investigate why we're getting fewer peers on public testnets with noise
SecureProtocol.Secio,
SecureProtocol.Noise, # array cos order matters
],
verifySignature = libp2p_pubsub_verify,
sign = libp2p_pubsub_sign,
transportFlags: set[ServerFlags] = {}): Switch =
@ -38,15 +48,21 @@ proc newStandardSwitch*(privKey = none(PrivateKey),
transports = @[Transport(TcpTransport.init(transportFlags))]
muxers = {MplexCodec: mplexProvider}.toTable
identify = newIdentify(peerInfo)
when libp2p_secure == "noise":
let secureManagers = {NoiseCodec: newNoise(seckey).Secure}.toTable
else:
let secureManagers = {SecioCodec: newSecio(seckey).Secure}.toTable
var
secureManagerInstances: seq[Secure]
for sec in secureManagers:
case sec
of SecureProtocol.Noise:
secureManagerInstances &= newNoise(seckey).Secure
of SecureProtocol.Secio:
secureManagerInstances &= newSecio(seckey).Secure
let pubSub = PubSub newPubSub(WakuSub, peerInfo, triggerSelf)
result = newSwitch(peerInfo,
transports,
identify,
muxers,
secureManagers = secureManagers,
secureManagers = secureManagerInstances,
pubSub = some(pubSub))

2
vendor/nim-chronos vendored

@ -1 +1 @@
Subproject commit bce0f878d16bea14395dc8944ff8dbdeffe33496
Subproject commit bedd1ded5edc3bfb6877f7025ca4b21f62492ffe

@ -1 +1 @@
Subproject commit 6e5d570490989c753d4645ba9173ef9358d302bb
Subproject commit 26667818be48d428892b26be9535c1f0a98d1510

2
vendor/nim-eth vendored

@ -1 +1 @@
Subproject commit be9a87848e068d68aa8fa1a7bfa07d7c7271eba7
Subproject commit 4d0a7a46ba38947b8daecb1b5ae817c82c8e16c5

@ -1 +1 @@
Subproject commit 81c24860e2622a15e05c81d15e3d1cc02c460870
Subproject commit 5df69fc6961e58205189cd92ae2477769fa8c4c0

2
vendor/nim-json-rpc vendored

@ -1 +1 @@
Subproject commit ecf49a06329f49f1993008b0ee08e3f3e13cc422
Subproject commit 8c1a8ef8d9fd1705d4e8640b4c30df2caee76881

@ -1 +1 @@
Subproject commit 8d4c31f7c2f56e17ec3325ec054fe15ccf4e89d4
Subproject commit c478b7bbbab6ee298a25c29c7357783d94aaecaa

2
vendor/nim-libp2p vendored

@ -1 +1 @@
Subproject commit 6affcda9378593f96e9d2b75f9d9ac5e6e33c526
Subproject commit 85b56d0b3a53611feaddd9247dd55bb43dc27103

@ -1 +1 @@
Subproject commit 34a884e1cfa8f4f542db7777085f2024b398eea5
Subproject commit 46b6f78806026b37e4710eabf8bd047969d2d23c