From 13d9b52f4a048927e102df3daa17b0cadce29f67 Mon Sep 17 00:00:00 2001 From: Fabiana Cecin Date: Thu, 6 Aug 2026 22:43:51 -0300 Subject: [PATCH] fix(ci): misc CI fixes (#4107) --- .github/workflows/ci-daily.yml | 14 ++++++ .github/workflows/ci-rln-simulator.yml | 5 +- .github/workflows/ci.yml | 4 +- .github/workflows/pre-release.yml | 22 +++++++++ .github/workflows/release-assets.yml | 68 +++++++------------------- AGENTS.md | 3 +- logos_delivery.nimble | 4 +- tests/simulator/rln-e2e-test.py | 4 ++ 8 files changed, 69 insertions(+), 55 deletions(-) diff --git a/.github/workflows/ci-daily.yml b/.github/workflows/ci-daily.yml index dea30ab7e..b88e16eab 100644 --- a/.github/workflows/ci-daily.yml +++ b/.github/workflows/ci-daily.yml @@ -10,6 +10,8 @@ env: MAKEFLAGS: "-j${NPROC}" NIMFLAGS: "--parallelBuild:${NPROC} --colors:off -d:chronicles_colors:none -d:disableMarchNative" NIM_PARAMS: "-d:disableMarchNative" + NIM_VERSION: '2.2.4' + NIMBLE_VERSION: '0.22.3' jobs: build: @@ -25,6 +27,18 @@ jobs: - name: Checkout code uses: actions/checkout@v4 + # macos images ship no nim/nimble; make dies at "nimble: No such file or directory". + - name: Install Nim ${{ env.NIM_VERSION }} + uses: jiro4989/setup-nim-action@v2 + with: + nim-version: ${{ env.NIM_VERSION }} + repo-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Install Nimble ${{ env.NIMBLE_VERSION }} + run: | + cd /tmp && nimble install "nimble@${{ env.NIMBLE_VERSION }}" -y + echo "$HOME/.nimble/bin" >> $GITHUB_PATH + - name: Get submodules hash id: submodules run: | diff --git a/.github/workflows/ci-rln-simulator.yml b/.github/workflows/ci-rln-simulator.yml index c49ae1815..831a8a7db 100644 --- a/.github/workflows/ci-rln-simulator.yml +++ b/.github/workflows/ci-rln-simulator.yml @@ -161,6 +161,9 @@ jobs: - name: Write simulator .env working-directory: ${{ runner.temp }}/logos-delivery-simulator run: | + # Deploy the contract revision this repo vendors, so they can't drift. + CONTRACT_COMMIT=$(git -C "$GITHUB_WORKSPACE" rev-parse HEAD:vendor/waku-rlnv2-contract) + echo "contract commit (from vendor/waku-rlnv2-contract): $CONTRACT_COMMIT" cat > .env <> $GITHUB_PATH + - name: prep variables id: vars run: | @@ -100,6 +114,10 @@ jobs: js-waku-node: needs: build-docker-image uses: logos-messaging/logos-delivery-js/.github/workflows/test-node.yml@master + permissions: + contents: read + actions: read + checks: write with: nim_wakunode_image: ${{ needs.build-docker-image.outputs.image }} test_type: node @@ -108,6 +126,10 @@ jobs: js-waku-node-optional: needs: build-docker-image uses: logos-messaging/logos-delivery-js/.github/workflows/test-node.yml@master + permissions: + contents: read + actions: read + checks: write with: nim_wakunode_image: ${{ needs.build-docker-image.outputs.image }} test_type: node-optional diff --git a/.github/workflows/release-assets.yml b/.github/workflows/release-assets.yml index 11c0a80fd..a0d54b14b 100644 --- a/.github/workflows/release-assets.yml +++ b/.github/workflows/release-assets.yml @@ -9,6 +9,8 @@ on: env: NPROC: 2 + NIM_VERSION: '2.2.4' + NIMBLE_VERSION: '0.22.3' jobs: # Release gate: the pushed tag MUST exactly match logos_delivery.nimble's version, @@ -54,7 +56,18 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 + + - name: Install Nim ${{ env.NIM_VERSION }} + uses: jiro4989/setup-nim-action@v2 + with: + nim-version: ${{ env.NIM_VERSION }} + repo-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Install Nimble ${{ env.NIMBLE_VERSION }} + run: | + cd /tmp && nimble install "nimble@${{ env.NIMBLE_VERSION }}" -y + echo "$HOME/.nimble/bin" >> $GITHUB_PATH - name: Get submodules hash id: submodules @@ -74,6 +87,9 @@ jobs: run: | # Use full tag, e.g., v0.37.0 echo "version=${GITHUB_REF_NAME}" >> $GITHUB_OUTPUT + # Same strip as verify-version's TAG_VERSION; dpkg rejects a version + # that does not start with a digit. + echo "deb_version=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT - name: Prep variables id: vars @@ -83,16 +99,6 @@ jobs: NWAKU_ARTIFACT_NAME=$(echo "waku-${{matrix.arch}}-${{runner.os}}.tar.gz" | tr "[:upper:]" "[:lower:]") echo "waku=${NWAKU_ARTIFACT_NAME}" >> $GITHUB_OUTPUT - if [[ "${{ runner.os }}" == "Linux" ]]; then - LIBWAKU_ARTIFACT_NAME=$(echo "libwaku-${VERSION}-${{matrix.arch}}-${{runner.os}}-linux.deb" | tr "[:upper:]" "[:lower:]") - fi - - if [[ "${{ runner.os }}" == "macOS" ]]; then - LIBWAKU_ARTIFACT_NAME=$(echo "libwaku-${VERSION}-${{matrix.arch}}-macos.tar.gz" | tr "[:upper:]" "[:lower:]") - fi - - 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 @@ -119,38 +125,9 @@ jobs: make -j${NPROC} NIMFLAGS="--parallelBuild:${NPROC} -d:disableMarchNative --os:${OS} --cpu:${{matrix.arch}}" POSTGRES=1 CI=false logosdeliverynode tar -cvzf ${{steps.vars.outputs.waku}} ./build/ - 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}}" 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: | - 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/libwaku.so pkg/usr/local/lib/ - cp build/libwaku.a pkg/usr/local/lib/ - cp library/libwaku.h pkg/usr/local/include/ - - echo "Package: waku" >> 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: Waku Team " >> pkg/DEBIAN/control - echo "Description: Waku library" >> pkg/DEBIAN/control - - dpkg-deb --build pkg ${{steps.vars.outputs.libwaku}} - fi - - if [[ "${{ runner.os }}" == "macOS" ]]; then - 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 }} @@ -164,7 +141,7 @@ jobs: cp library/liblogosdelivery_kernel.h pkg/usr/local/include/ echo "Package: logosdelivery" >> pkg/DEBIAN/control - echo "Version: ${VERSION}" >> pkg/DEBIAN/control + echo "Version: ${{ steps.version.outputs.deb_version }}" >> pkg/DEBIAN/control echo "Priority: optional" >> pkg/DEBIAN/control echo "Section: libs" >> pkg/DEBIAN/control echo "Architecture: ${{matrix.arch}}" >> pkg/DEBIAN/control @@ -175,7 +152,7 @@ jobs: fi if [[ "${{ runner.os }}" == "macOS" ]]; then - tar -cvzf ${{steps.vars.outputs.liblogosdelivery}} ./build/liblogosdelivery.dylib ./build/liblogosdelivery.a ./liblogosdelivery/liblogosdelivery.h + tar -cvzf ${{steps.vars.outputs.liblogosdelivery}} ./build/liblogosdelivery.dylib ./build/liblogosdelivery.a ./library/liblogosdelivery.h ./library/liblogosdelivery_kernel.h fi - name: Upload waku artifact @@ -185,13 +162,6 @@ jobs: path: ${{ steps.vars.outputs.waku }} if-no-files-found: error - - name: Upload libwaku artifact - uses: actions/upload-artifact@v4.4.0 - with: - 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: diff --git a/AGENTS.md b/AGENTS.md index 6deaa4055..8a291436b 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -101,8 +101,7 @@ Note: The build uses `--mm:refc` memory management (passed automatically by the make wakunode2 # Build main node binary make test # Run all tests make testcommon # Run common tests only -make libwaku # Build the legacy C library (libwaku) -make liblogosdelivery. # Build actual C FFI library +make liblogosdelivery # Build the C FFI library make chat2 # Build chat example make install-nph # Install git hook for auto-formatting ``` diff --git a/logos_delivery.nimble b/logos_delivery.nimble index 403c4131a..72babe751 100644 --- a/logos_delivery.nimble +++ b/logos_delivery.nimble @@ -17,7 +17,7 @@ const RequiredNimbleVersion = "0.22.3" ### Dependencies requires "nim >= 2.2.4", - "chronos >= 4.2.0", + "chronos >= 4.2.0 & < 4.4.0", "taskpools", # Logging & Configuration "chronicles", @@ -112,7 +112,7 @@ proc buildLibrary(lib_name: string, srcDir = "./", params = "", `type` = "static if `type` == "static": exec "nim c" & " --out:build/" & lib_name & - " --threads:on --app:staticlib --opt:speed --noMain --mm:refc --header -d:metrics --nimMainPrefix:" & mainPrefix & " --skipParentCfg:on -d:discv5_protocol_id=d5waku " & + " --threads:on --app:staticlib --opt:speed --noMain --mm:refc --header -d:metrics --nimMainPrefix:" & mainPrefix & " --skipParentCfg:off -d:discv5_protocol_id=d5waku " & getMyCPU() & getNimParams() & srcDir & "/" & srcFile else: # -Bsymbolic binds the library's references to its own symbols at link diff --git a/tests/simulator/rln-e2e-test.py b/tests/simulator/rln-e2e-test.py index 4248ee1f6..d8376fe2b 100755 --- a/tests/simulator/rln-e2e-test.py +++ b/tests/simulator/rln-e2e-test.py @@ -364,6 +364,10 @@ def main() -> int: print("\nABORTING — fleet never reached a publishable state.") return _summarize(results) + # A publish into an empty gossipsub mesh is dropped but still returns 200, + # so WARMUP can pass before the sender has peers. Let the mesh settle. + time.sleep(10) + run(scenario_propagation, nodes[0], nodes[1:]) # Rate limit: per-node burst, asserts exactly msg_limit then 500. # Requires epoch_sec large enough that the burst can't straddle an epoch.