Skip to content

Commit

Permalink
Merge branch 'master' into chore-add-logger-observers
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielmer authored Jun 13, 2024
2 parents 4ef77c1 + 15d578a commit dbe4134
Show file tree
Hide file tree
Showing 11 changed files with 113 additions and 52 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,15 @@ jobs:

- name: Run tests
run: |
if [ ${{ runner.os }} == "Linux" ]; then
sudo docker run --rm -d -e POSTGRES_PASSWORD=test123 -p 5432:5432 postgres:15.4-alpine3.18
fi
postgres_enabled=0
if [ ${{ runner.os }} == "Linux" ]; then
sudo docker run --rm -d -e POSTGRES_PASSWORD=test123 -p 5432:5432 postgres:15.4-alpine3.18
postgres_enabled=1
fi
export MAKEFLAGS="-j1"
export NIMFLAGS="--colors:off -d:chronicles_colors:none"
make RLN_V${{matrix.rln_version}}=true V=1 LOG_LEVEL=DEBUG QUICK_AND_DIRTY_COMPILER=1 POSTGRES=$postgres_enabled test testwakunode2
build-docker-image:
Expand Down
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
## v0.28.1 (2024-05-29)

This patch release fixes the following bug:
- Store node does not retrieve messages because the meta field is missing in queries.

### Bug Fix

- Commit that fixes the bug [8b42f199](https://github.com/waku-org/nwaku/commit/8b42f199baf4e00794c4cec4d8601c3f6c330a20)

This is a patch release that is fully backwards-compatible with release `v0.28.0`.

It supports the same [libp2p protocols](https://docs.libp2p.io/concepts/protocols/):
| Protocol | Spec status | Protocol id |
| ---: | :---: | :--- |
| [`11/WAKU2-RELAY`](https://github.com/vacp2p/rfc-index/blob/main/waku/standards/core/11/relay.md) | `stable` | `/vac/waku/relay/2.0.0` |
| [`12/WAKU2-FILTER`](https://github.com/vacp2p/rfc-index/blob/main/waku/standards/core/12/filter.md) | `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://github.com/vacp2p/rfc-index/blob/main/waku/standards/core/13/store.md) | `draft` | `/vac/waku/store/2.0.0-beta4` |
| [`19/WAKU2-LIGHTPUSH`](https://github.com/vacp2p/rfc-index/blob/main/waku/standards/core/19/lightpush.md) | `draft` | `/vac/waku/lightpush/2.0.0-beta1` |
| [`66/WAKU2-METADATA`](https://github.com/waku-org/specs/blob/master/standards/core/metadata.md) | `raw` | `/vac/waku/metadata/1.0.0` |


## v0.28.0 (2024-05-22)

## What's Changed
Expand Down
7 changes: 4 additions & 3 deletions tests/waku_rln_relay/test_rln_group_manager_onchain.nim
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ else:
{.push raises: [].}

import
std/[options, os, osproc, sequtils, deques, streams, strutils, tempfiles],
std/[options, os, osproc, sequtils, deques, streams, strutils, tempfiles, strformat],
stew/[results, byteutils],
testutils/unittests,
chronos,
Expand Down Expand Up @@ -119,10 +119,11 @@ proc createEthAccount(): Future[(keys.PrivateKey, Address)] {.async.} =
tx.to = some(acc)
tx.gasPrice = some(gasPrice)

# Send 10 eth to acc
# Send 1000 eth to acc
discard await web3.send(tx)
let balance = await web3.provider.eth_getBalance(acc, "latest")
assert(balance == ethToWei(1000.u256))
assert balance == ethToWei(1000.u256),
fmt"Balance is {balance} but expected {ethToWei(1000.u256)}"

return (pk, acc)

Expand Down
3 changes: 2 additions & 1 deletion tests/wakunode_rest/test_rest_admin.nim
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,10 @@ suite "Waku v2 Rest API - Admin":
await allFutures(node1.start(), node2.start(), node3.start())
await allFutures(node1.mountRelay(), node2.mountRelay(), node3.mountRelay())

let restPort = Port(58011)
var restPort = Port(0)
let restAddress = parseIpAddress("127.0.0.1")
restServer = WakuRestServerRef.init(restAddress, restPort).tryGet()
restPort = restServer.httpServer.address.port # update with bound port for client use

installAdminApiHandlers(restServer.router, node1)

Expand Down
17 changes: 10 additions & 7 deletions tests/wakunode_rest/test_rest_cors.nim
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ proc testWakuNode(): WakuNode =
privkey = crypto.PrivateKey.random(Secp256k1, rng[]).tryGet()
bindIp = parseIpAddress("0.0.0.0")
extIp = parseIpAddress("127.0.0.1")
port = Port(58000)
port = Port(0)

newTestWakuNode(privkey, bindIp, port, some(extIp), some(port))

Expand Down Expand Up @@ -86,8 +86,7 @@ proc checkResponse(
expectedOrigin.isSome() and
response.headers.contains("Access-Control-Allow-Origin") and
response.headers.getLastString("Access-Control-Allow-Origin") ==
expectedOrigin.get() and
response.headers.contains("Access-Control-Allow-Headers") and
expectedOrigin.get() and response.headers.contains("Access-Control-Allow-Headers") and
response.headers.getLastString("Access-Control-Allow-Headers") == "Content-Type"
)
):
Expand All @@ -106,7 +105,7 @@ suite "Waku v2 REST API CORS Handling":
await node.start()
await node.mountRelay()

let restPort = Port(58001)
var restPort = Port(0)
let restAddress = parseIpAddress("0.0.0.0")
let restServer = WakuRestServerRef
.init(
Expand All @@ -116,6 +115,7 @@ suite "Waku v2 REST API CORS Handling":
some("test.net:1234,https://localhost:*,http://127.0.0.1:?8,?waku*.net:*80*"),
)
.tryGet()
restPort = restServer.httpServer.address.port # update with bound port for client use

installDebugApiHandlers(restServer.router, node)
restServer.start()
Expand Down Expand Up @@ -158,7 +158,7 @@ suite "Waku v2 REST API CORS Handling":
await node.start()
await node.mountRelay()

let restPort = Port(58001)
var restPort = Port(0)
let restAddress = parseIpAddress("0.0.0.0")
let restServer = WakuRestServerRef
.init(
Expand All @@ -168,6 +168,7 @@ suite "Waku v2 REST API CORS Handling":
some("test.net:1234,https://localhost:*,http://127.0.0.1:?8,?waku*.net:*80*"),
)
.tryGet()
restPort = restServer.httpServer.address.port # update with bound port for client use

installDebugApiHandlers(restServer.router, node)
restServer.start()
Expand Down Expand Up @@ -213,10 +214,11 @@ suite "Waku v2 REST API CORS Handling":
await node.start()
await node.mountRelay()

let restPort = Port(58001)
var restPort = Port(0)
let restAddress = parseIpAddress("0.0.0.0")
let restServer =
WakuRestServerRef.init(restAddress, restPort, allowedOrigin = some("*")).tryGet()
restPort = restServer.httpServer.address.port # update with bound port for client use

installDebugApiHandlers(restServer.router, node)
restServer.start()
Expand Down Expand Up @@ -259,7 +261,7 @@ suite "Waku v2 REST API CORS Handling":
await node.start()
await node.mountRelay()

let restPort = Port(58001)
var restPort = Port(0)
let restAddress = parseIpAddress("0.0.0.0")
let restServer = WakuRestServerRef
.init(
Expand All @@ -269,6 +271,7 @@ suite "Waku v2 REST API CORS Handling":
some("test.net:1234,https://localhost:*,http://127.0.0.1:?8,?waku*.net:*80*"),
)
.tryGet()
restPort = restServer.httpServer.address.port # update with bound port for client use

installDebugApiHandlers(restServer.router, node)
restServer.start()
Expand Down
8 changes: 5 additions & 3 deletions tests/wakunode_rest/test_rest_debug.nim
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ proc testWakuNode(): WakuNode =
privkey = crypto.PrivateKey.random(Secp256k1, rng[]).tryGet()
bindIp = parseIpAddress("0.0.0.0")
extIp = parseIpAddress("127.0.0.1")
port = Port(58000)
port = Port(0)

newTestWakuNode(privkey, bindIp, port, some(extIp), some(port))

Expand All @@ -37,9 +37,10 @@ suite "Waku v2 REST API - Debug":
await node.start()
await node.mountRelay()

let restPort = Port(58001)
var restPort = Port(0)
let restAddress = parseIpAddress("0.0.0.0")
let restServer = WakuRestServerRef.init(restAddress, restPort).tryGet()
restPort = restServer.httpServer.address.port # update with bound port for client use

installDebugApiHandlers(restServer.router, node)
restServer.start()
Expand All @@ -65,9 +66,10 @@ suite "Waku v2 REST API - Debug":
await node.start()
await node.mountRelay()

let restPort = Port(58002)
var restPort = Port(0)
let restAddress = parseIpAddress("0.0.0.0")
let restServer = WakuRestServerRef.init(restAddress, restPort).tryGet()
restPort = restServer.httpServer.address.port # update with bound port for client use

installDebugApiHandlers(restServer.router, node)
restServer.start()
Expand Down
8 changes: 6 additions & 2 deletions tests/wakunode_rest/test_rest_filter.nim
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,17 @@ proc init(T: type RestFilterTest): Future[T] {.async.} =
testSetup.serviceNode.peerInfo.toRemotePeerInfo(), WakuFilterSubscribeCodec
)

let restPort = Port(58011)
var restPort = Port(0)
let restAddress = parseIpAddress("127.0.0.1")
testSetup.restServer = WakuRestServerRef.init(restAddress, restPort).tryGet()
restPort = testSetup.restServer.httpServer.address.port
# update with bound port for client use

let restPort2 = Port(58012)
var restPort2 = Port(0)
testSetup.restServerForService =
WakuRestServerRef.init(restAddress, restPort2).tryGet()
restPort2 = testSetup.restServerForService.httpServer.address.port
# update with bound port for client use

# through this one we will see if messages are pushed according to our content topic sub
testSetup.messageCache = MessageCache.init()
Expand Down
3 changes: 2 additions & 1 deletion tests/wakunode_rest/test_rest_health.nim
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,10 @@ suite "Waku v2 REST API - health":

healthMonitor.setOverallHealth(HealthStatus.INITIALIZING)

let restPort = Port(58001)
var restPort = Port(0)
let restAddress = parseIpAddress("0.0.0.0")
let restServer = WakuRestServerRef.init(restAddress, restPort).tryGet()
restPort = restServer.httpServer.address.port # update with bound port for client use

installHealthApiHandler(restServer.router, healthMonitor)
restServer.start()
Expand Down
4 changes: 3 additions & 1 deletion tests/wakunode_rest/test_rest_lightpush.nim
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,11 @@ proc init(
testSetup.serviceNode.peerInfo.toRemotePeerInfo(), WakuLightPushCodec
)

let restPort = Port(58011)
var restPort = Port(0)
let restAddress = parseIpAddress("127.0.0.1")
testSetup.restServer = WakuRestServerRef.init(restAddress, restPort).tryGet()
restPort = testSetup.restServer.httpServer.address.port
# update with bound port for client use

installLightPushRequestHandler(testSetup.restServer.router, testSetup.pushNode)

Expand Down
28 changes: 18 additions & 10 deletions tests/wakunode_rest/test_rest_store.nim
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,10 @@ procSuite "Waku Rest API - Store v3":
await node.start()
await node.mountRelay()

let restPort = Port(58011)
var restPort = Port(0)
let restAddress = parseIpAddress("0.0.0.0")
let restServer = WakuRestServerRef.init(restAddress, restPort).tryGet()
restPort = restServer.httpServer.address.port # update with bound port for client use

installStoreApiHandlers(restServer.router, node)
restServer.start()
Expand Down Expand Up @@ -170,9 +171,10 @@ procSuite "Waku Rest API - Store v3":
await node.start()
await node.mountRelay()

let restPort = Port(58011)
var restPort = Port(0)
let restAddress = parseIpAddress("0.0.0.0")
let restServer = WakuRestServerRef.init(restAddress, restPort).tryGet()
restPort = restServer.httpServer.address.port # update with bound port for client use

installStoreApiHandlers(restServer.router, node)
restServer.start()
Expand Down Expand Up @@ -239,9 +241,10 @@ procSuite "Waku Rest API - Store v3":
let node = testWakuNode()
await node.start()

let restPort = Port(58012)
var restPort = Port(0)
let restAddress = parseIpAddress("0.0.0.0")
let restServer = WakuRestServerRef.init(restAddress, restPort).tryGet()
restPort = restServer.httpServer.address.port # update with bound port for client use

installStoreApiHandlers(restServer.router, node)
restServer.start()
Expand Down Expand Up @@ -334,9 +337,10 @@ procSuite "Waku Rest API - Store v3":
await node.start()
await node.mountRelay()

let restPort = Port(58013)
var restPort = Port(0)
let restAddress = parseIpAddress("0.0.0.0")
let restServer = WakuRestServerRef.init(restAddress, restPort).tryGet()
restPort = restServer.httpServer.address.port # update with bound port for client use

installStoreApiHandlers(restServer.router, node)
restServer.start()
Expand Down Expand Up @@ -406,9 +410,10 @@ procSuite "Waku Rest API - Store v3":
await node.start()
await node.mountRelay()

let restPort = Port(58014)
var restPort = Port(0)
let restAddress = parseIpAddress("0.0.0.0")
let restServer = WakuRestServerRef.init(restAddress, restPort).tryGet()
restPort = restServer.httpServer.address.port # update with bound port for client use

installStoreApiHandlers(restServer.router, node)
restServer.start()
Expand Down Expand Up @@ -494,9 +499,10 @@ procSuite "Waku Rest API - Store v3":
await node.start()
await node.mountRelay()

let restPort = Port(58015)
var restPort = Port(0)
let restAddress = parseIpAddress("0.0.0.0")
let restServer = WakuRestServerRef.init(restAddress, restPort).tryGet()
restPort = restServer.httpServer.address.port # update with bound port for client use

installStoreApiHandlers(restServer.router, node)
restServer.start()
Expand Down Expand Up @@ -549,9 +555,10 @@ procSuite "Waku Rest API - Store v3":
await node.start()
await node.mountRelay()

let restPort = Port(58016)
var restPort = Port(0)
let restAddress = parseIpAddress("0.0.0.0")
let restServer = WakuRestServerRef.init(restAddress, restPort).tryGet()
restPort = restServer.httpServer.address.port # update with bound port for client use

installStoreApiHandlers(restServer.router, node)
restServer.start()
Expand Down Expand Up @@ -617,9 +624,10 @@ procSuite "Waku Rest API - Store v3":
let node = testWakuNode()
await node.start()

let restPort = Port(58017)
var restPort = Port(0)
let restAddress = parseIpAddress("0.0.0.0")
let restServer = WakuRestServerRef.init(restAddress, restPort).tryGet()
restPort = restServer.httpServer.address.port # update with bound port for client use

installStoreApiHandlers(restServer.router, node)
restServer.start()
Expand Down Expand Up @@ -680,7 +688,6 @@ procSuite "Waku Rest API - Store v3":
var restPort = Port(0)
let restAddress = parseIpAddress("0.0.0.0")
let restServer = WakuRestServerRef.init(restAddress, restPort).tryGet()

restPort = restServer.httpServer.address.port # update with bound port for client use

installStoreApiHandlers(restServer.router, node)
Expand Down Expand Up @@ -726,9 +733,10 @@ procSuite "Waku Rest API - Store v3":
let node = testWakuNode()
await node.start()

let restPort = Port(58018)
var restPort = Port(0)
let restAddress = parseIpAddress("0.0.0.0")
let restServer = WakuRestServerRef.init(restAddress, restPort).tryGet()
restPort = restServer.httpServer.address.port # update with bound port for client use

installStoreApiHandlers(restServer.router, node)
restServer.start()
Expand Down
Loading

0 comments on commit dbe4134

Please sign in to comment.