Skip to content

Commit

Permalink
Merge branch 'master' into graceful-retry-onchain-group-manager
Browse files Browse the repository at this point in the history
  • Loading branch information
rymnc authored Dec 6, 2023
2 parents fadd174 + 103d398 commit d67f70d
Show file tree
Hide file tree
Showing 48 changed files with 1,037 additions and 692 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@
/LICENSE*
/tests
/metrics
/nimcache
librln*
**/vendor/*
27 changes: 27 additions & 0 deletions .github/ISSUE_TEMPLATE/prepare_release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: Prepare release
about: Execute tasks for the creation and publishing of a new release
title: 'Prepare release 0.0.0'
labels: release
assignees: ''

---

<!--
Add appropriate release number to title!
For detailed info on the release process refer to https://github.com/waku-org/nwaku/blob/master/docs/contributors/release-process.md
-->

### Items to complete
- [ ] create release branch
- [ ] assign release candidate tag
- [ ] validate release candidate
- [ ] generate and edit releases notes
- [ ] open PR and merge release notes to master
- [ ] cherry-pick release notes to the release branch
- [ ] assign release tag to the cherry-picked release notes commit
- [ ] create GitHub release
- [ ] deploy the release to DockerHub
- [ ] deploy release to `wakuv2.prod` fleet
- [ ] announce the release
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# BUILD NIM APP ----------------------------------------------------------------

# alpine:edge supports building rust binaries, alpine:3.16 doesn't for some reason
FROM alpine@sha256:880fafbab5a7602db21ac37f0d17088a29a9a48f98d581f01ce17312c22ccbb5 AS nim-build
FROM alpine@sha256:3e44438281baf26907675b99c9a4a421c4d4a57c954120327e703aa8329086bd AS nim-build

ARG NIMFLAGS
ARG MAKE_TARGET=wakunode2
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ After successfully building the project, you may bring the bundled runtime into
```bash
source env.sh
```
If everything went well, your should see your prompt suffixed with `[Nimbus env]$`. Now you can run `nim` commands as usual.
If everything went well, you should see your prompt suffixed with `[Nimbus env]$`. Now you can run `nim` commands as usual.

### Waku Protocol Test Suite

Expand Down
4 changes: 2 additions & 2 deletions apps/chat2bridge/chat2bridge.nim
Original file line number Diff line number Diff line change
Expand Up @@ -229,11 +229,11 @@ when isMainModule:

# Install enabled API handlers:
if conf.relay:
let cache = MessageCache[string].init(capacity=30)
let cache = MessageCache.init(capacity=30)
installRelayApiHandlers(node, rpcServer, cache)

if conf.filter:
let messageCache = filter_api.MessageCache.init(capacity=30)
let messageCache = MessageCache.init(capacity=30)
installFilterApiHandlers(node, rpcServer, messageCache)

if conf.store:
Expand Down
4 changes: 2 additions & 2 deletions apps/networkmonitor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ Metrics are divided into two categories:

The following metrics are available. See `http://localhost:8008/metrics`

* `peer_type_as_per_enr`: Number of peers supporting each capability according the the ENR (Relay, Store, Lightpush, Filter)
* `peer_type_as_per_enr`: Number of peers supporting each capability according to the ENR (Relay, Store, Lightpush, Filter)
* `peer_type_as_per_protocol`: Number of peers supporting each protocol, after a successful connection)
* `peer_user_agents`: List of useragents found in the network and their count

Other relevant metrics reused from `nim-eth`:

* `routing_table_nodes`: Inherited from nim-eth, number of nodes in the routing table
* `discovery_message_requests_outgoing_total`: Inherited from nim-eth, number of outging discovery requests, useful to know if the node is actiely looking for new peers
* `discovery_message_requests_outgoing_total`: Inherited from nim-eth, number of outgoing discovery requests, useful to know if the node is actively looking for new peers

### Custom Metrics

Expand Down
2 changes: 1 addition & 1 deletion apps/networkmonitor/networkmonitor_metrics.nim
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ logScope:
#discovery_message_requests_outgoing_total{response="no_response"}

declarePublicGauge networkmonitor_peer_type_as_per_enr,
"Number of peers supporting each capability according the the ENR",
"Number of peers supporting each capability according to the ENR",
labels = ["capability"]

declarePublicGauge networkmonitor_peer_type_as_per_protocol,
Expand Down
24 changes: 11 additions & 13 deletions apps/wakunode2/app.nim
Original file line number Diff line number Diff line change
Expand Up @@ -687,18 +687,17 @@ proc startRestServer(app: App, address: ValidIpAddress, port: Port, conf: WakuNo

## Relay REST API
if conf.relay:
let cache = MessageCache[string].init(capacity=conf.restRelayCacheCapacity)
let cache = MessageCache.init(int(conf.restRelayCacheCapacity))

let handler = messageCacheHandler(cache)
let autoHandler = autoMessageCacheHandler(cache)

for pubsubTopic in conf.pubsubTopics:
cache.subscribe(pubsubTopic)
cache.pubsubSubscribe(pubsubTopic)
app.node.subscribe((kind: PubsubSub, topic: pubsubTopic), some(handler))

for contentTopic in conf.contentTopics:
cache.subscribe(contentTopic)
app.node.subscribe((kind: ContentSub, topic: contentTopic), some(autoHandler))
cache.contentSubscribe(contentTopic)
app.node.subscribe((kind: ContentSub, topic: contentTopic), some(handler))

installRelayApiHandlers(server.router, app.node, cache)
else:
Expand All @@ -709,10 +708,10 @@ proc startRestServer(app: App, address: ValidIpAddress, port: Port, conf: WakuNo
app.node.wakuFilterClient != nil and
app.node.wakuFilterClientLegacy != nil:

let legacyFilterCache = rest_legacy_filter_api.MessageCache.init()
let legacyFilterCache = MessageCache.init()
rest_legacy_filter_api.installLegacyFilterRestApiHandlers(server.router, app.node, legacyFilterCache)

let filterCache = rest_filter_api.MessageCache.init()
let filterCache = MessageCache.init()

let filterDiscoHandler =
if app.wakuDiscv5.isSome():
Expand Down Expand Up @@ -765,23 +764,22 @@ proc startRpcServer(app: App, address: ValidIpAddress, port: Port, conf: WakuNod
installDebugApiHandlers(app.node, server)

if conf.relay:
let cache = MessageCache[string].init(capacity=30)
let cache = MessageCache.init(capacity=50)

let handler = messageCacheHandler(cache)
let autoHandler = autoMessageCacheHandler(cache)

for pubsubTopic in conf.pubsubTopics:
cache.subscribe(pubsubTopic)
cache.pubsubSubscribe(pubsubTopic)
app.node.subscribe((kind: PubsubSub, topic: pubsubTopic), some(handler))

for contentTopic in conf.contentTopics:
cache.subscribe(contentTopic)
app.node.subscribe((kind: ContentSub, topic: contentTopic), some(autoHandler))
cache.contentSubscribe(contentTopic)
app.node.subscribe((kind: ContentSub, topic: contentTopic), some(handler))

installRelayApiHandlers(app.node, server, cache)

if conf.filternode != "":
let filterMessageCache = rpc_filter_api.MessageCache.init(capacity=30)
let filterMessageCache = MessageCache.init(capacity=50)
installFilterApiHandlers(app.node, server, filterMessageCache)

installStoreApiHandlers(app.node, server)
Expand Down
13 changes: 9 additions & 4 deletions ci/Jenkinsfile.release
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,17 @@ pipeline {
string(
name: 'IMAGE_NAME',
description: 'Name of Docker image to push.',
defaultValue: params.IMAGE_NAME ?: 'wakuorg/nwaku',
defaultValue: params.IMAGE_NAME ?: 'waku-org/nwaku',
)
string(
name: 'DOCKER_CRED',
description: 'Name of Docker Hub credential.',
defaultValue: params.DOCKER_CRED ?: 'dockerhub-vacorgbot-api-token',
description: 'Name of Docker Registry credential.',
defaultValue: params.DOCKER_CRED ?: 'harbor-wakuorg-robot',
)
string(
name: 'DOCKER_REGISTRY_URL',
description: 'URL of the Docker Registry',
defaultValue: params.DOCKER_REGISTRY_URL ?: 'https://harbor.status.im'
)
string(
name: 'NIMFLAGS',
Expand Down Expand Up @@ -80,7 +85,7 @@ pipeline {
when { expression { params.IMAGE_TAG != '' } }
steps { script {
withDockerRegistry([
credentialsId: params.DOCKER_CRED, url: ""
credentialsId: params.DOCKER_CRED, url: params.DOCKER_REGISTRY_URL
]) {
image.push()
/* If Git ref is a tag push it as Docker tag too. */
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorial/chat2.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ It optionally connects to a [fleet of nodes](fleets.status.im) to provide end-to
Each fleet is a publicly accessible network of Waku v2 peers, providing a bootstrap connection point for new peers, historical message storage, etc.
The Waku team is currently using this application on the _production_ fleet for internal testing.
For more information on the available fleets, see [`Connecting to a Waku v2 fleet`](#connecting-to-a-waku-v2-fleet).
If you want try our protocols, or join the dogfooding fun, follow the instructions below.
If you want to try our protocols, or join the dogfooding fun, follow the instructions below.

## Preparation

Expand Down
8 changes: 3 additions & 5 deletions tests/common/test_sqlite_migrations.nim
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,18 @@ import
stew/results,
testutils/unittests
import
../../waku/common/databases/db_sqlite {.all.}
../../waku/common/databases/db_sqlite {.all.},
../waku_archive/archive_utils


proc newTestDatabase(): SqliteDatabase =
SqliteDatabase.new(":memory:").tryGet()

template sourceDir: string = currentSourcePath.rsplit(DirSep, 1)[0]


suite "SQLite - migrations":

test "set and get user version":
## Given
let database = newTestDatabase()
let database = newSqliteDatabase()

## When
let setRes = database.setUserVersion(5)
Expand Down
2 changes: 0 additions & 2 deletions tests/node/test_wakunode_filter.nim
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ import
testutils
]

let FUTURE_TIMEOUT = 1.seconds

suite "Waku Filter - End to End":
var client {.threadvar.}: WakuNode
var clientPeerId {.threadvar.}: PeerId
Expand Down
Loading

0 comments on commit d67f70d

Please sign in to comment.