mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-01-19 22:33:06 +00:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a715f12855 | ||
|
|
47f4c6ff49 | ||
|
|
1482639825 | ||
|
|
502cafb082 | ||
|
|
4ed8504818 | ||
|
|
010a501245 |
44
CHANGELOG.md
44
CHANGELOG.md
@ -1,3 +1,47 @@
|
|||||||
|
## v0.21.2 (2023-11-07)
|
||||||
|
|
||||||
|
This patch release addresses the following issue:
|
||||||
|
- Inability to send RLN messages through the REST API
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- **rest:** fix bug in rest api when sending rln message ([#2169](https://github.com/waku-org/nwaku/issues/2169)) ([33decd7a](https://github.com/waku-org/nwaku/commit/33decd7a))
|
||||||
|
|
||||||
|
This is a patch release that is fully backwards-compatible with release `v0.21.0` and `v0.21.1`.
|
||||||
|
|
||||||
|
It supports the same [libp2p protocols](https://docs.libp2p.io/concepts/protocols/):
|
||||||
|
| Protocol | Spec status | Protocol id |
|
||||||
|
| ---: | :---: | :--- |
|
||||||
|
| [`11/WAKU2-RELAY`](https://rfc.vac.dev/spec/11/) | `stable` | `/vac/waku/relay/2.0.0` |
|
||||||
|
| [`12/WAKU2-FILTER`](https://rfc.vac.dev/spec/12/) | `draft` | `/vac/waku/filter/2.0.0-beta1` <br />`/vac/waku/filter-subscribe/2.0.0-beta1` <br />`/vac/waku/filter-push/2.0.0-beta1` |
|
||||||
|
| [`13/WAKU2-STORE`](https://rfc.vac.dev/spec/13/) | `draft` | `/vac/waku/store/2.0.0-beta4` |
|
||||||
|
| [`19/WAKU2-LIGHTPUSH`](https://rfc.vac.dev/spec/19/) | `draft` | `/vac/waku/lightpush/2.0.0-beta1` |
|
||||||
|
|
||||||
|
The Waku v1 implementation has been removed from this repository and can be found in a separate [Waku Legacy](https://github.com/waku-org/waku-legacy) repository.
|
||||||
|
|
||||||
|
## v0.21.1 (2023-10-26)
|
||||||
|
|
||||||
|
This patch release addresses the following issues:
|
||||||
|
- WSS connections being suddenly terminated under rare conditions
|
||||||
|
- Ability for the user to control announced multiaddresses
|
||||||
|
|
||||||
|
### Changes
|
||||||
|
|
||||||
|
- adding ext-multiaddr-only CLI flag ([#2141](https://github.com/waku-org/nwaku/issues/2141)) ([e2dfc2ed](https://github.com/waku-org/nwaku/commit/e2dfc2ed))
|
||||||
|
- bumping nim-libp2p to include WSS fix ([#2150](https://github.com/waku-org/nwaku/issues/2150)) ([18b5149a](https://github.com/waku-org/nwaku/commit/18b5149a))
|
||||||
|
|
||||||
|
This is a patch release that is fully backwards-compatible with release `v0.21.0`.
|
||||||
|
|
||||||
|
It supports the same [libp2p protocols](https://docs.libp2p.io/concepts/protocols/):
|
||||||
|
| Protocol | Spec status | Protocol id |
|
||||||
|
| ---: | :---: | :--- |
|
||||||
|
| [`11/WAKU2-RELAY`](https://rfc.vac.dev/spec/11/) | `stable` | `/vac/waku/relay/2.0.0` |
|
||||||
|
| [`12/WAKU2-FILTER`](https://rfc.vac.dev/spec/12/) | `draft` | `/vac/waku/filter/2.0.0-beta1` <br />`/vac/waku/filter-subscribe/2.0.0-beta1` <br />`/vac/waku/filter-push/2.0.0-beta1` |
|
||||||
|
| [`13/WAKU2-STORE`](https://rfc.vac.dev/spec/13/) | `draft` | `/vac/waku/store/2.0.0-beta4` |
|
||||||
|
| [`19/WAKU2-LIGHTPUSH`](https://rfc.vac.dev/spec/19/) | `draft` | `/vac/waku/lightpush/2.0.0-beta1` |
|
||||||
|
|
||||||
|
The Waku v1 implementation has been removed from this repository and can be found in a separate [Waku Legacy](https://github.com/waku-org/waku-legacy) repository.
|
||||||
|
|
||||||
## v0.21.0 (2023-10-18)
|
## v0.21.0 (2023-10-18)
|
||||||
|
|
||||||
> Note: This is the last release supporting the `--topic` option. It is being deprecated in favor of a more specific options `--pubsub-topic` & `--content-topic`
|
> Note: This is the last release supporting the `--topic` option. It is being deprecated in favor of a more specific options `--pubsub-topic` & `--content-topic`
|
||||||
|
|||||||
@ -92,6 +92,11 @@ type
|
|||||||
desc: "External multiaddresses to advertise to the network. Argument may be repeated."
|
desc: "External multiaddresses to advertise to the network. Argument may be repeated."
|
||||||
name: "ext-multiaddr" }: seq[string]
|
name: "ext-multiaddr" }: seq[string]
|
||||||
|
|
||||||
|
extMultiAddrsOnly* {.
|
||||||
|
desc: "Only announce external multiaddresses",
|
||||||
|
defaultValue: false,
|
||||||
|
name: "ext-multiaddr-only" }: bool
|
||||||
|
|
||||||
maxConnections* {.
|
maxConnections* {.
|
||||||
desc: "Maximum allowed number of libp2p connections."
|
desc: "Maximum allowed number of libp2p connections."
|
||||||
defaultValue: 50
|
defaultValue: 50
|
||||||
|
|||||||
@ -111,6 +111,7 @@ proc networkConfiguration*(conf: WakuNodeConf,
|
|||||||
extIp = extIp,
|
extIp = extIp,
|
||||||
extPort = extPort,
|
extPort = extPort,
|
||||||
extMultiAddrs = extMultiAddrs,
|
extMultiAddrs = extMultiAddrs,
|
||||||
|
extMultiAddrsOnly = conf.extMultiAddrsOnly,
|
||||||
wsBindPort = Port(uint16(conf.websocketPort) + conf.portsShift),
|
wsBindPort = Port(uint16(conf.websocketPort) + conf.portsShift),
|
||||||
wsEnabled = conf.websocketSupport,
|
wsEnabled = conf.websocketSupport,
|
||||||
wssEnabled = conf.websocketSecureSupport,
|
wssEnabled = conf.websocketSecureSupport,
|
||||||
|
|||||||
@ -338,19 +338,63 @@ suite "Waku NetConfig":
|
|||||||
check:
|
check:
|
||||||
netConfig.enrMultiaddrs.contains(dns4TcpEndPoint(dns4DomainName, extPort))
|
netConfig.enrMultiaddrs.contains(dns4TcpEndPoint(dns4DomainName, extPort))
|
||||||
|
|
||||||
asyncTest "wsHostAddress is not announced if a WS address is provided in extMultiAddrs":
|
asyncTest "wsHostAddress is not announced if a WS/WSS address is provided in extMultiAddrs":
|
||||||
|
|
||||||
|
var
|
||||||
|
conf = defaultTestWakuNodeConf()
|
||||||
|
extAddIp = ValidIpAddress.init("1.2.3.4")
|
||||||
|
extAddPort = Port(1234)
|
||||||
|
wsEnabled = true
|
||||||
|
wssEnabled = false
|
||||||
|
extMultiAddrs = @[(ip4TcpEndPoint(extAddIp, extAddPort) & wsFlag(wssEnabled))]
|
||||||
|
|
||||||
|
var netConfigRes = NetConfig.init(
|
||||||
|
bindIp = conf.listenAddress,
|
||||||
|
bindPort = conf.tcpPort,
|
||||||
|
extMultiAddrs = extMultiAddrs,
|
||||||
|
wsEnabled = wsEnabled
|
||||||
|
)
|
||||||
|
|
||||||
|
assert netConfigRes.isOk(), $netConfigRes.error
|
||||||
|
|
||||||
|
var netConfig = netConfigRes.get()
|
||||||
|
|
||||||
|
check:
|
||||||
|
netConfig.announcedAddresses.len == 2 # Bind address + extAddress
|
||||||
|
netConfig.announcedAddresses[1] == extMultiAddrs[0]
|
||||||
|
|
||||||
|
# Now same test for WSS external address
|
||||||
|
wssEnabled = true
|
||||||
|
extMultiAddrs = @[(ip4TcpEndPoint(extAddIp, extAddPort) & wsFlag(wssEnabled))]
|
||||||
|
|
||||||
|
netConfigRes = NetConfig.init(
|
||||||
|
bindIp = conf.listenAddress,
|
||||||
|
bindPort = conf.tcpPort,
|
||||||
|
extMultiAddrs = extMultiAddrs,
|
||||||
|
wssEnabled = wssEnabled
|
||||||
|
)
|
||||||
|
|
||||||
|
assert netConfigRes.isOk(), $netConfigRes.error
|
||||||
|
|
||||||
|
netConfig = netConfigRes.get()
|
||||||
|
|
||||||
|
check:
|
||||||
|
netConfig.announcedAddresses.len == 2 # Bind address + extAddress
|
||||||
|
netConfig.announcedAddresses[1] == extMultiAddrs[0]
|
||||||
|
|
||||||
|
asyncTest "Only extMultiAddrs are published when enabling extMultiAddrsOnly flag":
|
||||||
|
|
||||||
let
|
let
|
||||||
conf = defaultTestWakuNodeConf()
|
conf = defaultTestWakuNodeConf()
|
||||||
extAddIp = ValidIpAddress.init("1.2.3.4")
|
extAddIp = ValidIpAddress.init("1.2.3.4")
|
||||||
extAddPort = Port(1234)
|
extAddPort = Port(1234)
|
||||||
wssEnabled = false
|
extMultiAddrs = @[ip4TcpEndPoint(extAddIp, extAddPort)]
|
||||||
extMultiAddrs = @[(ip4TcpEndPoint(extAddIp, extAddPort) & wsFlag(wssEnabled))]
|
|
||||||
|
|
||||||
let netConfigRes = NetConfig.init(
|
let netConfigRes = NetConfig.init(
|
||||||
bindIp = conf.listenAddress,
|
bindIp = conf.listenAddress,
|
||||||
bindPort = conf.tcpPort,
|
bindPort = conf.tcpPort,
|
||||||
extMultiAddrs = extMultiAddrs
|
extMultiAddrs = extMultiAddrs,
|
||||||
|
extMultiAddrsOnly = true
|
||||||
)
|
)
|
||||||
|
|
||||||
assert netConfigRes.isOk(), $netConfigRes.error
|
assert netConfigRes.isOk(), $netConfigRes.error
|
||||||
@ -358,6 +402,6 @@ suite "Waku NetConfig":
|
|||||||
let netConfig = netConfigRes.get()
|
let netConfig = netConfigRes.get()
|
||||||
|
|
||||||
check:
|
check:
|
||||||
netConfig.announcedAddresses.len == 2 # Bind address + extAddress
|
netConfig.announcedAddresses.len == 1 # ExtAddress
|
||||||
netConfig.announcedAddresses[1] == extMultiAddrs[0]
|
netConfig.announcedAddresses[0] == extMultiAddrs[0]
|
||||||
|
|
||||||
|
|||||||
2
vendor/nim-libp2p
vendored
2
vendor/nim-libp2p
vendored
@ -1 +1 @@
|
|||||||
Subproject commit b2eac7ecbdb695b0b7033f2069b03a63d28aee2b
|
Subproject commit fc4e9a8bb869428618ee37c6525e670859cfdaf3
|
||||||
@ -75,6 +75,7 @@ proc init*(T: type NetConfig,
|
|||||||
extIp = none(ValidIpAddress),
|
extIp = none(ValidIpAddress),
|
||||||
extPort = none(Port),
|
extPort = none(Port),
|
||||||
extMultiAddrs = newSeq[MultiAddress](),
|
extMultiAddrs = newSeq[MultiAddress](),
|
||||||
|
extMultiAddrsOnly: bool = false,
|
||||||
wsBindPort: Port = Port(8000),
|
wsBindPort: Port = Port(8000),
|
||||||
wsEnabled: bool = false,
|
wsEnabled: bool = false,
|
||||||
wssEnabled: bool = false,
|
wssEnabled: bool = false,
|
||||||
@ -125,21 +126,22 @@ proc init*(T: type NetConfig,
|
|||||||
|
|
||||||
var announcedAddresses = newSeq[MultiAddress]()
|
var announcedAddresses = newSeq[MultiAddress]()
|
||||||
|
|
||||||
if hostExtAddress.isSome():
|
if not extMultiAddrsOnly:
|
||||||
announcedAddresses.add(hostExtAddress.get())
|
if hostExtAddress.isSome():
|
||||||
else:
|
announcedAddresses.add(hostExtAddress.get())
|
||||||
announcedAddresses.add(formatListenAddress(hostAddress)) # We always have at least a bind address for the host
|
else:
|
||||||
|
announcedAddresses.add(formatListenAddress(hostAddress)) # We always have at least a bind address for the host
|
||||||
|
|
||||||
|
if wsExtAddress.isSome():
|
||||||
|
announcedAddresses.add(wsExtAddress.get())
|
||||||
|
elif wsHostAddress.isSome() and not containsWsAddress(extMultiAddrs):
|
||||||
|
# Only publish wsHostAddress if a WS address is not set in extMultiAddrs
|
||||||
|
announcedAddresses.add(wsHostAddress.get())
|
||||||
|
|
||||||
# External multiaddrs that the operator may have configured
|
# External multiaddrs that the operator may have configured
|
||||||
if extMultiAddrs.len > 0:
|
if extMultiAddrs.len > 0:
|
||||||
announcedAddresses.add(extMultiAddrs)
|
announcedAddresses.add(extMultiAddrs)
|
||||||
|
|
||||||
if wsExtAddress.isSome():
|
|
||||||
announcedAddresses.add(wsExtAddress.get())
|
|
||||||
elif wsHostAddress.isSome() and not containsWsAddress(extMultiAddrs):
|
|
||||||
# Only publish wsHostAddress if a WS address is not set in extMultiAddrs
|
|
||||||
announcedAddresses.add(wsHostAddress.get())
|
|
||||||
|
|
||||||
let
|
let
|
||||||
# enrMultiaddrs are just addresses which cannot be represented in ENR, as described in
|
# enrMultiaddrs are just addresses which cannot be represented in ENR, as described in
|
||||||
# https://rfc.vac.dev/spec/31/#many-connection-types
|
# https://rfc.vac.dev/spec/31/#many-connection-types
|
||||||
|
|||||||
@ -175,7 +175,7 @@ proc installRelayApiHandlers*(router: var RestRouter, node: WakuNode, cache: Mes
|
|||||||
|
|
||||||
# if we reach here its either a non-RLN message or a RLN message with a valid proof
|
# if we reach here its either a non-RLN message or a RLN message with a valid proof
|
||||||
debug "Publishing message", pubSubTopic=pubSubTopic, rln=defined(rln)
|
debug "Publishing message", pubSubTopic=pubSubTopic, rln=defined(rln)
|
||||||
if not (waitFor node.publish(some(pubSubTopic), resMessage.value).withTimeout(futTimeout)):
|
if not (waitFor node.publish(some(pubSubTopic), message).withTimeout(futTimeout)):
|
||||||
error "Failed to publish message to topic", pubSubTopic=pubSubTopic
|
error "Failed to publish message to topic", pubSubTopic=pubSubTopic
|
||||||
return RestApiResponse.internalServerError("Failed to publish: timedout")
|
return RestApiResponse.internalServerError("Failed to publish: timedout")
|
||||||
|
|
||||||
@ -309,4 +309,4 @@ proc installRelayApiHandlers*(router: var RestRouter, node: WakuNode, cache: Mes
|
|||||||
error "Failed to publish message to topic", contentTopic=message.contentTopic
|
error "Failed to publish message to topic", contentTopic=message.contentTopic
|
||||||
return RestApiResponse.internalServerError("Failed to publish: timedout")
|
return RestApiResponse.internalServerError("Failed to publish: timedout")
|
||||||
|
|
||||||
return RestApiResponse.ok()
|
return RestApiResponse.ok()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user