From 820ccc6e1012ba6d5dfeef27f8bf4d126c2e7940 Mon Sep 17 00:00:00 2001 From: NagyZoltanPeter <113987313+NagyZoltanPeter@users.noreply.github.com> Date: Thu, 23 Apr 2026 18:24:55 +0200 Subject: [PATCH 1/3] Add ci support for liblogosdeliery, build and artifacts (#3746) --- .github/workflows/ci.yml | 1 + .github/workflows/release-assets.yml | 48 +++++++++++++++++++++++++++- 2 files changed, 48 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b45853e21..52d20157a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,6 +36,7 @@ jobs: - 'waku.nimble' - 'Makefile' - 'library/**' + - 'liblogosdelivery/**' v2: - 'waku/**' - 'apps/**' diff --git a/.github/workflows/release-assets.yml b/.github/workflows/release-assets.yml index 50e3c4c3d..274eb564c 100644 --- a/.github/workflows/release-assets.yml +++ b/.github/workflows/release-assets.yml @@ -4,7 +4,7 @@ on: push: tags: - 'v*' # "e.g. v0.4" - + workflow_dispatch: env: @@ -65,6 +65,16 @@ jobs: echo "libwaku=${LIBWAKU_ARTIFACT_NAME}" >> $GITHUB_OUTPUT + if [[ "${{ runner.os }}" == "Linux" ]]; then + LIBLOGOSDELIVERY_ARTIFACT_NAME=$(echo "liblogosdelivery-${VERSION}-${{matrix.arch}}-${{runner.os}}-linux.deb" | tr "[:upper:]" "[:lower:]") + fi + + if [[ "${{ runner.os }}" == "macOS" ]]; then + LIBLOGOSDELIVERY_ARTIFACT_NAME=$(echo "liblogosdelivery-${VERSION}-${{matrix.arch}}-macos.tar.gz" | tr "[:upper:]" "[:lower:]") + fi + + echo "liblogosdelivery=${LIBLOGOSDELIVERY_ARTIFACT_NAME}" >> $GITHUB_OUTPUT + - name: Install build dependencies run: | if [[ "${{ runner.os }}" == "Linux" ]]; then @@ -83,6 +93,9 @@ jobs: make -j${NPROC} NIMFLAGS="--parallelBuild:${NPROC} -d:disableMarchNative --os:${OS} --cpu:${{matrix.arch}} -d:postgres" CI=false libwaku make -j${NPROC} NIMFLAGS="--parallelBuild:${NPROC} -d:disableMarchNative --os:${OS} --cpu:${{matrix.arch}} -d:postgres" CI=false STATIC=1 libwaku + make -j${NPROC} NIMFLAGS="--parallelBuild:${NPROC} -d:disableMarchNative --os:${OS} --cpu:${{matrix.arch}} -d:postgres" CI=false liblogosdelivery + make -j${NPROC} NIMFLAGS="--parallelBuild:${NPROC} -d:disableMarchNative --os:${OS} --cpu:${{matrix.arch}} -d:postgres" CI=false STATIC=1 liblogosdelivery + - name: Create distributable libwaku package run: | VERSION=${{ steps.version.outputs.version }} @@ -109,6 +122,32 @@ jobs: tar -cvzf ${{steps.vars.outputs.libwaku}} ./build/libwaku.dylib ./build/libwaku.a ./library/libwaku.h fi + - name: Create distributable liblogosdelivery package + run: | + VERSION=${{ steps.version.outputs.version }} + + if [[ "${{ runner.os }}" == "Linux" ]]; then + rm -rf pkg + mkdir -p pkg/DEBIAN pkg/usr/local/lib pkg/usr/local/include + cp build/liblogosdelivery.so pkg/usr/local/lib/ + cp build/liblogosdelivery.a pkg/usr/local/lib/ + cp liblogosdelivery/liblogosdelivery.h pkg/usr/local/include/ + + echo "Package: logosdelivery" >> pkg/DEBIAN/control + echo "Version: ${VERSION}" >> pkg/DEBIAN/control + echo "Priority: optional" >> pkg/DEBIAN/control + echo "Section: libs" >> pkg/DEBIAN/control + echo "Architecture: ${{matrix.arch}}" >> pkg/DEBIAN/control + echo "Maintainer: Logos Messaging Team" >> pkg/DEBIAN/control + echo "Description: Logos Delivery library" >> pkg/DEBIAN/control + + dpkg-deb --build pkg ${{steps.vars.outputs.liblogosdelivery}} + fi + + if [[ "${{ runner.os }}" == "macOS" ]]; then + tar -cvzf ${{steps.vars.outputs.liblogosdelivery}} ./build/liblogosdelivery.dylib ./build/liblogosdelivery.a ./liblogosdelivery/liblogosdelivery.h + fi + - name: Upload waku artifact uses: actions/upload-artifact@v4.4.0 with: @@ -122,3 +161,10 @@ jobs: name: libwaku-${{ steps.version.outputs.version }}-${{ matrix.arch }}-${{ runner.os }} path: ${{ steps.vars.outputs.libwaku }} if-no-files-found: error + + - name: Upload liblogosdelivery artifact + uses: actions/upload-artifact@v4.4.0 + with: + name: liblogosdelivery-${{ steps.version.outputs.version }}-${{ matrix.arch }}-${{ runner.os }} + path: ${{ steps.vars.outputs.liblogosdelivery }} + if-no-files-found: error From ff98d853138c3f07c8c5074aa7a9d5ab6cf316b8 Mon Sep 17 00:00:00 2001 From: Fabiana Cecin Date: Thu, 23 Apr 2026 16:02:34 -0300 Subject: [PATCH 2/3] fix: relay validator registration and sync filter (#3823) * reuse stored validator in relay * fix skip check in store sync * increase sync tolerance in test (matches similar test) --- tests/waku_store_sync/test_protocol.nim | 2 +- waku/waku_relay/protocol.nim | 2 +- waku/waku_store_sync/reconciliation.nim | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/waku_store_sync/test_protocol.nim b/tests/waku_store_sync/test_protocol.nim index d1f5a102a..3ffa7ad4a 100644 --- a/tests/waku_store_sync/test_protocol.nim +++ b/tests/waku_store_sync/test_protocol.nim @@ -372,7 +372,7 @@ suite "Waku Sync: reconciliation": const msgCount = 400_000 diffCount = 100_000 - tol = 1000 + tol = 10_000 var diffMsgHashes: HashSet[WakuMessageHash] var missingIdx: HashSet[int] diff --git a/waku/waku_relay/protocol.nim b/waku/waku_relay/protocol.nim index b19173d36..e7b2c99cb 100644 --- a/waku/waku_relay/protocol.nim +++ b/waku/waku_relay/protocol.nim @@ -618,7 +618,7 @@ proc subscribe*(w: WakuRelay, pubsubTopic: PubsubTopic, handler: WakuRelayHandle # Otherwise this might lead to unintended behaviour. if not w.topicValidator.hasKey(pubSubTopic): let newValidator = w.generateOrderedValidator() - procCall GossipSub(w).addValidator(pubSubTopic, w.generateOrderedValidator()) + procCall GossipSub(w).addValidator(pubSubTopic, newValidator) w.topicValidator[pubSubTopic] = newValidator # set this topic parameters for scoring diff --git a/waku/waku_store_sync/reconciliation.nim b/waku/waku_store_sync/reconciliation.nim index 9dd308255..b18251fff 100644 --- a/waku/waku_store_sync/reconciliation.nim +++ b/waku/waku_store_sync/reconciliation.nim @@ -145,7 +145,7 @@ proc preProcessPayload( # convert to skip range before processing for i in 0 ..< payload.ranges.len: let rangeType = payload.ranges[i][1] - if rangeType != RangeType.Skip: + if rangeType == RangeType.Skip: continue let upperBound = payload.ranges[i][0].b.time From 324048430bf1b84ffa0376041b79ce46f3df96de Mon Sep 17 00:00:00 2001 From: Darshan <35736874+darshankabariya@users.noreply.github.com> Date: Sat, 25 Apr 2026 00:03:46 +0530 Subject: [PATCH 3/3] fix: restore -d:postgres in nimble task and propagate NIMFLAGS (#3830) --- .github/workflows/container-image.yml | 2 +- .github/workflows/pre-release.yml | 4 ++-- .github/workflows/release-assets.yml | 10 +++++----- Dockerfile | 3 ++- ci/Jenkinsfile.release | 6 ++++-- 5 files changed, 14 insertions(+), 11 deletions(-) diff --git a/.github/workflows/container-image.yml b/.github/workflows/container-image.yml index 0783c1f66..0ff427d87 100644 --- a/.github/workflows/container-image.yml +++ b/.github/workflows/container-image.yml @@ -83,7 +83,7 @@ jobs: id: build if: ${{ steps.secrets.outcome == 'success' }} run: | - make -j${NPROC} V=1 NIMFLAGS="-d:disableMarchNative -d:postgres -d:chronicles_colors:none" wakunode2 + make -j${NPROC} V=1 POSTGRES=1 NIMFLAGS="-d:disableMarchNative -d:chronicles_colors:none" wakunode2 SHORT_REF=$(git rev-parse --short HEAD) diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index e3c8bb575..52a50adc8 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -66,8 +66,8 @@ jobs: make V=1 CI=false NIMFLAGS="-d:disableMarchNative --os:${OS} --cpu:${{matrix.arch}}" \ update - make V=1 CI=false\ - NIMFLAGS="-d:disableMarchNative --os:${OS} --cpu:${{matrix.arch}} -d:postgres" \ + make V=1 CI=false POSTGRES=1\ + NIMFLAGS="-d:disableMarchNative --os:${OS} --cpu:${{matrix.arch}}" \ wakunode2\ chat2\ tools diff --git a/.github/workflows/release-assets.yml b/.github/workflows/release-assets.yml index 274eb564c..fc1f819d9 100644 --- a/.github/workflows/release-assets.yml +++ b/.github/workflows/release-assets.yml @@ -86,15 +86,15 @@ jobs: OS=$([[ "${{runner.os}}" == "macOS" ]] && echo "macosx" || echo "linux") make -j${NPROC} NIMFLAGS="--parallelBuild:${NPROC} -d:disableMarchNative --os:${OS} --cpu:${{matrix.arch}}" V=1 update - make -j${NPROC} NIMFLAGS="--parallelBuild:${NPROC} -d:disableMarchNative --os:${OS} --cpu:${{matrix.arch}} -d:postgres" CI=false wakunode2 + make -j${NPROC} NIMFLAGS="--parallelBuild:${NPROC} -d:disableMarchNative --os:${OS} --cpu:${{matrix.arch}}" POSTGRES=1 CI=false wakunode2 make -j${NPROC} NIMFLAGS="--parallelBuild:${NPROC} -d:disableMarchNative --os:${OS} --cpu:${{matrix.arch}}" CI=false chat2 tar -cvzf ${{steps.vars.outputs.waku}} ./build/ - make -j${NPROC} NIMFLAGS="--parallelBuild:${NPROC} -d:disableMarchNative --os:${OS} --cpu:${{matrix.arch}} -d:postgres" CI=false libwaku - make -j${NPROC} NIMFLAGS="--parallelBuild:${NPROC} -d:disableMarchNative --os:${OS} --cpu:${{matrix.arch}} -d:postgres" CI=false STATIC=1 libwaku + make -j${NPROC} NIMFLAGS="--parallelBuild:${NPROC} -d:disableMarchNative --os:${OS} --cpu:${{matrix.arch}}" POSTGRES=1 CI=false libwaku + make -j${NPROC} NIMFLAGS="--parallelBuild:${NPROC} -d:disableMarchNative --os:${OS} --cpu:${{matrix.arch}}" POSTGRES=1 CI=false STATIC=1 libwaku - make -j${NPROC} NIMFLAGS="--parallelBuild:${NPROC} -d:disableMarchNative --os:${OS} --cpu:${{matrix.arch}} -d:postgres" CI=false liblogosdelivery - make -j${NPROC} NIMFLAGS="--parallelBuild:${NPROC} -d:disableMarchNative --os:${OS} --cpu:${{matrix.arch}} -d:postgres" CI=false STATIC=1 liblogosdelivery + make -j${NPROC} NIMFLAGS="--parallelBuild:${NPROC} -d:disableMarchNative --os:${OS} --cpu:${{matrix.arch}}" POSTGRES=1 CI=false liblogosdelivery + make -j${NPROC} NIMFLAGS="--parallelBuild:${NPROC} -d:disableMarchNative --os:${OS} --cpu:${{matrix.arch}}" POSTGRES=1 CI=false STATIC=1 liblogosdelivery - name: Create distributable libwaku package run: | diff --git a/Dockerfile b/Dockerfile index 412d0977a..05525774b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,6 +5,7 @@ ARG NIMFLAGS ARG MAKE_TARGET=wakunode2 ARG NIM_COMMIT ARG HEAPTRACK_BUILD=0 +ARG POSTGRES=0 # Get build tools and required header files RUN apk add --no-cache bash git build-base openssl-dev linux-headers curl jq libbsd-dev @@ -26,7 +27,7 @@ RUN if [ "$HEAPTRACK_BUILD" = "1" ]; then \ RUN make -j$(nproc) deps QUICK_AND_DIRTY_COMPILER=1 ${NIM_COMMIT} # Build the final node binary -RUN make -j$(nproc) ${NIM_COMMIT} $MAKE_TARGET NIMFLAGS="${NIMFLAGS}" +RUN make -j$(nproc) ${NIM_COMMIT} $MAKE_TARGET NIMFLAGS="${NIMFLAGS}" POSTGRES=${POSTGRES} # PRODUCTION IMAGE ------------------------------------------------------------- diff --git a/ci/Jenkinsfile.release b/ci/Jenkinsfile.release index 570a37d5f..d8237f009 100644 --- a/ci/Jenkinsfile.release +++ b/ci/Jenkinsfile.release @@ -85,7 +85,8 @@ pipeline { "--label=commit='${git.commit()}' " + "--label=version='${git.describe('--tags')}' " + "--build-arg=MAKE_TARGET='${params.MAKE_TARGET}' " + - "--build-arg=NIMFLAGS='${params.NIMFLAGS} -d:postgres -d:heaptracker ' " + + "--build-arg=NIMFLAGS='${params.NIMFLAGS} -d:heaptracker ' " + + "--build-arg=POSTGRES='1' " + "--build-arg=LOG_LEVEL='${params.LOWEST_LOG_LEVEL_ALLOWED}' " + "--build-arg=DEBUG='${params.DEBUG ? "1" : "0"} ' " + "--build-arg=NIM_COMMIT='NIM_COMMIT=heaptrack_support_v2.0.12' " + @@ -98,7 +99,8 @@ pipeline { "--label=commit='${git.commit()}' " + "--label=version='${git.describe('--tags')}' " + "--build-arg=MAKE_TARGET='${params.MAKE_TARGET}' " + - "--build-arg=NIMFLAGS='${params.NIMFLAGS} -d:postgres ' " + + "--build-arg=NIMFLAGS='${params.NIMFLAGS}' " + + "--build-arg=POSTGRES='1' " + "--build-arg=LOG_LEVEL='${params.LOWEST_LOG_LEVEL_ALLOWED}' " + "--build-arg=DEBUG='${params.DEBUG ? "1" : "0"} ' " + "--target='prod' ."