2372 Commits

Author SHA1 Message Date
stubbsta
11241d4c4d
Improve test 'should fetch history correctly' for root cache 2026-06-03 14:18:06 +02:00
stubbsta
8fac7cd840
Merge branch 'master' into chore/retrieve-roots-current 2026-06-03 13:46:33 +02:00
NagyZoltanPeter
64a0ed7d96
Add helper nimble task to ease nph formatting on branch/pr's changed nim files -> nimble nphchanges (#3926) 2026-06-02 18:25:51 +02:00
NagyZoltanPeter
b593d16d11
tools: add sync-nimble-lock.sh to cross-check waku.nimble pins into nimble.lock (#3924)
Adds a portable (macOS bash 3.2 / Linux) helper that detects git-URL pinned
`requires` in waku.nimble which changed vs a git base ref (default HEAD) and
updates ONLY those nimble.lock entries — version, vcsRevision and the sha1
checksum — leaving every other entry byte-for-byte untouched.

It does not run `nimble lock` (which rewrites the whole file). The sha1 is
computed directly, reproducing nimble's algorithm from
src/nimblepkg/checksums.nim (git ls-files -> sort -> SHA1 over path +
symlink-target/file-bytes). Resolves tags to commits via git rev-parse and
guards against invalid commit hashes (e.g. a stray leading character).

Dry-run by default (exit 1 on drift); --apply writes; --base REF to compare
against another ref. Requires git + python3; nimble not required.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-02 18:25:21 +02:00
Ivan FB
8b0e21fada
enhance reliable channel segment states (#3919) 2026-06-02 14:16:13 +02:00
stubbsta
1142bcc1a8
set acceptablerootwindowsize and root poll delay 2026-06-01 10:34:40 +02:00
stubbsta
3649e859f5
Merge branch 'master' into chore/retrieve-roots-current 2026-06-01 09:11:45 +02:00
Ivan FB
5bc1ad63a7
ci: pass -d:disableMarchNative to avoid secp256k1 build failures (#3916) 2026-05-29 22:28:15 +02:00
Ivan FB
c5b24e21da
better pending segments management (#3914)
Co-authored-by: NagyZoltanPeter <113987313+NagyZoltanPeter@users.noreply.github.com>
2026-05-29 22:24:46 +02:00
Darshan
bb23ee64af
feat: fetch prebuilt zerokit rln, fall back to source build (#3915) 2026-05-29 23:53:38 +05:30
stubbsta
49700a6302
set rpc poll delay to 30s 2026-05-29 14:49:14 +02:00
stubbsta
ce41227488
set root polling to 15s 2026-05-29 10:55:10 +02:00
stubbsta
396acf4fa4
Merge branch 'master' into chore/retrieve-roots-current 2026-05-29 09:04:31 +02:00
Ivan FB
2447ce9e73
disable js-waku from ci (#3917) 2026-05-29 08:11:41 +02:00
stubbsta
ed412023f0
simplify updateRecentRoots 2026-05-28 15:41:42 +02:00
stubbsta
19751db182
Use updateRecentRoots to track root changes 2026-05-28 15:18:14 +02:00
stubbsta
02fc4d4889
improve recents roots retrieval and logs 2026-05-28 13:32:46 +02:00
stubbsta
3ba630daad
add default params to sendEthCallWithParams 2026-05-28 10:57:27 +02:00
stubbsta
9e227fe402
Merge branch 'master' into chore/retrieve-roots-current 2026-05-28 10:38:09 +02:00
stubbsta
1ff2533765
set rpcDelay for root tracking to 10s 2026-05-28 09:14:06 +02:00
Ivan FB
74057c6622
start basic reliable channel folder (#3886) nightly 2026-05-27 23:05:20 +02:00
Darshan
5e262badf7
chore: fixing daily ci (#3878) 2026-05-27 23:58:30 +05:30
stubbsta
9f95a90e4a
Fix 5s delay trackRootChanges 2026-05-27 15:33:27 +02:00
stubbsta
7238376fcf
start trackRootChanges call loop immediately 2026-05-27 14:57:24 +02:00
Tanya S
8b53e64379
Remove makefile target update (#3897)
* Remove makefile target update

* fix: set execute permission on install_nimble.sh

* improve install_nim script

* skip second nim install on Windows

* fix path check in install-nim

* Makefile workfile reordering
2026-05-27 10:40:54 +02:00
Ivan FB
79dda63758
Recover wakucanary in nix output (#3892) 2026-05-26 16:22:10 +02:00
Fabiana Cecin
4b80c7762d
Point CLAUDE.md to (updated) AGENTS.md
* Point CLAUDE.md to (updated) AGENTS.md
* add cluster id, shard id, autosharding
* add in-flight testing section

Co-authored-by: NagyZoltanPeter <113987313+NagyZoltanPeter@users.noreply.github.com>
2026-05-25 18:22:04 -03:00
stubbsta
82e597d1c2
linting 2026-05-25 11:04:44 +02:00
stubbsta
c907c29cda
debug spam log 2026-05-25 10:30:59 +02:00
stubbsta
1d6b7ea566
Decrease AcceptableRootWindowSize for testing 2026-05-25 08:56:02 +02:00
stubbsta
28a7e040cb
add pr re-add gauge for proof-generation-duration-seconds 2026-05-22 15:50:25 +02:00
Igor Sirotin
c738c7b65e
fix: accept port 0 in JSON config (ephemeral port support) (#3895)
* chore: pin confutils to merged upstream commit

status-im/nim-confutils#146 is merged; move the confutils pin from the
PR fork back to status-im/nim-confutils master (36f3115). Content is
identical to the fork commit, so nimble sha1 and nix sha256 are unchanged.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-22 14:32:54 +01:00
stubbsta
5c0b1c1adb
add test for updated merkle roots window 2026-05-22 15:05:56 +02:00
stubbsta
692a000983
merge fixes 2026-05-22 14:36:16 +02:00
stubbsta
c52ccac37b
more merging fixes 2026-05-22 14:22:09 +02:00
stubbsta
b3fe624b18
fix merging 2026-05-22 14:12:08 +02:00
stubbsta
49976f451d
big merge 2026-05-22 13:51:59 +02:00
Darshan
67eebe3a02
ci: add daily rln simulator e2e workflow (#3885) 2026-05-22 17:15:31 +05:30
Tanya S
04ef12ccf3
Update and Improve READMEs (#3894)
* Update READMEs for new nimble build system

* Move recommended nim versions out of prerequisites
2026-05-22 13:23:58 +02:00
Igor Sirotin
bdd562ecc6
feat(nix): expose cargoHash-corrected librln as packages.rln (#3902)
PR #3899 fixes zerokit v2.0.2's stale cargoHash, but only via an internal
`let` binding consumed by liblogosdelivery. Downstream consumers (e.g.
logos-delivery-module) that need librln still pull zerokit's rln package
directly and hit the stale hash.

Expose that corrected derivation as `packages.<system>.rln` so consumers can
bundle the exact same librln this build links, instead of overriding the
cargoHash themselves.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-22 11:51:52 +01:00
5ff734aa56
chore: simplify zerokit cargoHash fix (#3899)
Replacing the whole package is unnecessary. Just hash can be fixed.

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2026-05-21 21:46:10 +01:00
Igor Sirotin
29a77dcf4d
feat: add logos.test fleet preset (#3900)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 18:29:33 +01:00
Darshan
eb1891dc0e
feat: migrate to zerokit v2.0.2 (#3868) 2026-05-21 17:31:03 +05:30
Igor Sirotin
c6e448a0ba
fix: real getNodeInfo Version in Nix/lgpm builds (#3889)
* fix(node-info): real Version + new Commit in Nix/lgpm builds

getNodeInfo Version returned "n/a" on Nix-built libs (and lgpm
releases built from the flake) because nix/default.nix never passed
-d:git_version. A flake sandbox has no .git, so git describe is
impossible; derive the semver from waku.nimble's version field plus
the flake short commit, and expose the full commit SHA via a new
Commit node info id.

- waku_state_info: add Commit to NodeInfoId + dispatch git_commit
- waku_node: add git_commit {.strdefine.} (default "n/a")
- node start logs ("Starting Waku node" / "Running nwaku node") now
  print commit = git_commit alongside version
- Makefile: inject -d:git_commit (full SHA), mirrors docker label
- nix/default.nix: accept gitVersion/gitCommit, pass as nim defines
- flake.nix: gitVersion = <nimble version>-g<shortRev>, gitCommit = rev
- CI version-check (PR only): ancestor-aware `git describe --tags
  --abbrev=0` vs PR HEAD, base-version compare, so waku.nimble is kept
  current early and a new tag never breaks in-flight PRs
- release-assets.yml: gate build/upload on a verify-version job
  asserting tag base == waku.nimble (RC tags allowed), so a mismatched
  tag publishes no artifacts
- docs: prepare_release.md explains the bump-before-tag requirement

Refs: status-im/infra-logos#4
Closes: logos-messaging/logos-delivery#3884

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs: simplify

* chore: update version in waku.nimble

* fix(node-info): remove Commit node info field

Drop the newly added Commit (full SHA) node info id and its
git_commit compile-time define plumbing across Makefile, flake.nix
and nix/default.nix; revert the start/run log lines to version only.
The PR now solely fixes the getNodeInfo Version regression.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore(nix): align git_version format closer to Makefile

Adds the `v` prefix and uses a 6-char SHA so Nix-built nodes report
e.g. `v0.38.1-g52e980`, matching the shape of `git describe --abbrev=6
--always --tags` aside from the unreachable commit-count segment (tag
metadata isn't exposed through the flake input protocol).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-20 21:57:14 +01:00
Igor Sirotin
e7142110a3
feat(node-info): expose MixPubKey as node info item (#3893)
Adds NodeInfoId.MyMixPubKey, returning the node's mix public key as
0x-prefixed hex via the existing debug API. Returns an empty string
when the mix protocol is not mounted.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-20 21:53:08 +01:00
NagyZoltanPeter
42e0aa43d1
feat: persistency (#3880)
* persistency: per-job SQLite-backed storage layer (singleton, brokered)

Adds a backend-neutral CRUD library at waku/persistency/, plus the
nim-brokers dependency swap that enables it.

Architecture (ports-and-adapters):
  * Persistency: process-wide singleton, one root directory.
  * Job: one tenant, one DB file, one worker thread, one BrokerContext.
  * Backend: SQLite via waku/common/databases/db_sqlite. Uniform schema
    kv(category BLOB, key BLOB, payload BLOB) PRIMARY KEY (category, key)
    WITHOUT ROWID, WAL mode.
  * Writes are fire-and-forget via EventBroker(mt) PersistEvent.
  * Reads are async via five RequestBroker(mt) shapes (KvGet, KvExists,
    KvScan, KvCount, KvDelete). Reads return Result[T, PersistencyError].
  * One storage thread per job; tenants isolated by BrokerContext.

Public surface (waku/persistency/persistency.nim):
  Persistency.instance(rootDir) / Persistency.instance() / Persistency.reset()
  p.openJob(id) / p.closeJob(id) / p.dropJob(id) / p.close()
  p.job(id) / p[id] / p.hasJob(id)
  Writes (Job form & string-id form, fire-and-forget):
    persist / persistPut / persistDelete / persistEncoded
  Reads (Job form & string-id form, async Result):
    get / exists / scan / scanPrefix / count / deleteAcked

Key & payload encoding (keys.nim, payload.nim):
  * encodePart family + variadic key(...) / payload(...) macros +
    single-value toKey / toPayload.
  * Primitives: string and openArray[byte] are 2-byte BE length + bytes;
    int{8..64} are sign-flipped 8-byte BE; uint{16..64} are 8-byte BE;
    bool/byte/char are 1 byte; enums are int64(ord(v)).
  * Generic encodePart[T: tuple | object] recurses through fields() so
    any composite Nim type is encodable without ceremony.
  * Stable across Nim/C compiler upgrades: no sizeof, no memcpy, no
    cast on pointers, no host-endianness dependency.
  * `rawKey(bytes)` + `persistPut(..., openArray[byte])` let callers
    bypass the built-in encoder with their own format (CBOR, protobuf...).

Lifecycle:
  * Persistency.new is private; Persistency.instance is the only public
    constructor. Same rootDir is idempotent; conflicting rootDir is
    peInvalidArgument. Persistency.reset for test/restart paths.
  * openJob opens-or-creates the per-job SQLite file; an existing file
    is reused with its data preserved.
  * Teardown integration: Persistency.instance registers a Teardown
    MultiRequestBroker provider that closes all jobs and clears the
    singleton slot when Waku.stop() issues Teardown.request.

Internal layering:
  types.nim          pure value types (Key, KeyRange, KvRow, TxOp,
                     PersistencyError)
  keys.nim           encodePart primitives + key(...) macro
  payload.nim        toPayload + payload(...) macro
  schema.nim         CREATE TABLE + connection pragmas + user_version
  backend_sqlite.nim KvBackend, applyOps (single source of write SQL),
                     getOne/existsOne/deleteOne, scanRange (asc/desc,
                     half-open ranges, open-ended stop), countRange
  backend_comm.nim   EventBroker(mt) PersistEvent + 5 RequestBroker(mt)
                     declarations; encodeErr/decodeErr boundary helpers
  backend_thread.nim startStorageThread / stopStorageThread (shared
                     allocShared0 arg, cstring dbPath, atomic
                     ready/shutdown flags); per-thread provider
                     registration
  persistency.nim    Persistency + Job types, singleton state, public
                     facade
  ../requests/lifecycle_requests.nim
                     Teardown MultiRequestBroker

Tests (69 cases, all passing):
  test_keys.nim          sort-order invariants (length-prefix strings,
                         sign-flipped ints, composite tuples, prefix
                         range)
  test_backend.nim       round-trip / replace / delete-return-value /
                         batched atomicity / asc-desc-half-open-open-
                         ended scans / category isolation / batch
                         txDelete
  test_lifecycle.nim     open-or-create rootDir / non-dir collision /
                         reopen across sessions / idempotent openJob /
                         two-tenant parallel isolation / closeJob joins
                         worker / dropJob removes file / acked delete
  test_facade.nim        put-then-get / atomic batch / scanPrefix
                         asc/desc / deleteAcked hit-miss /
                         fire-and-forget delete / two-tenant facade
                         isolation
  test_encoding.nim      tuple/named-tuple/object keys, embedded Key,
                         enum encoding, field-major composite sort,
                         payload struct encoding, end-to-end struct
                         round-trip through SQLite
  test_string_lookup.nim peJobNotFound semantics / hasJob / subscript /
                         persistPut+get via id / reads short-circuit /
                         writes drop+warn / persistEncoded via id /
                         scan parity Job-ref vs id
  test_singleton.nim     idempotent same-rootDir / different-rootDir
                         rejection / no-arg instance lifecycle / reset
                         retargets / reset idempotence / Teardown.request
                         end-to-end

Prerequisite delivered in the same series: replace the in-tree broker
implementation with the external nim-brokers package; update all
broker call-sites (waku_filter_v2, waku_relay, waku_rln_relay,
delivery_service, peer_manager, requests/*, factory/*, api tests, etc.)
to the new package API; chat2 made to compile again.

Note: SDS adapter (Phase 5 of the design) is deferred -- nim-sds is
still developed side-by-side and the persistency layer is intentionally
SDS-agnostic.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* persistency: pin nim-brokers by URL+commit (workaround for stale registry)

The bare `brokers >= 2.0.1` form cannot resolve on machines where the
local nimble SAT solver enumerates only the registry-recorded 0.1.0 for
brokers. The nim-lang/packages entry for `brokers` carries no per-tag
metadata (only the URL), so until that registry entry is refreshed the
SAT solver clamps the available-versions list to 0.1.0 and rejects the
>= 2.0.1 constraint -- even though pkgs2 and pkgcache both have v2.0.1
cloned locally.

Pinning by URL+commit bypasses the registry path entirely. Inline
comment in waku.nimble documents the situation and the path back to
the bare form once nim-lang/packages is updated.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* persistency: nph format pass

Run `nph` on all 57 Nim files touched by this PR. Pure formatting:
17 files re-styled, no semantic change. Suite still 69/69.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* Fix build, add local-storage-path config, lazy init of Persistency from Waku start

* fix: fix nix deps

* fixes for nix build, regenerate deps

* reverting accidental dependency changes

* Fixing deps

* Apply suggestions from code review

Co-authored-by: Ivan FB <128452529+Ivansete-status@users.noreply.github.com>

* persistency tests: migrate to suite / asyncTest / await

Match the in-tree test convention (procSuite -> suite, sync test +
waitFor -> asyncTest + await):

- procSuite "X": -> suite "X":
- For tests doing async work: test -> asyncTest, waitFor -> await.
- Poll helpers (proc waitFor(t: Job, ...) in test_lifecycle.nim,
  proc waitUntilExists(...) in test_facade.nim and
  test_string_lookup.nim) -> Future[bool] {.async.}, internal
  `waitFor X` -> `await X`, internal `sleep(N)` ->
  `await sleepAsync(chronos.milliseconds(N))`.
- Renamed test_lifecycle.nim's helper proc from `waitFor(t: Job, ...)`
  -> `pollExists(t: Job, ...)`; the previous name shadowed
  chronos.waitFor in the chronos macro expansion.
- `chronos.milliseconds(N)` explicitly qualified because `std/times`
  also exports `milliseconds` (returning TimeInterval, not Duration).
- `check await x` -> `let okN = await x; check okN` to dodge chronos's
  "yield in expr not lowered" with await-as-macro-argument.
- `(await x).foo()` -> `let awN = await x; ... awN.foo() ...` for the
  same reason.

waku/persistency/persistency.nim: nph also pulled the proc signatures
across multiple lines; restored explicit `Future[void] {.async.}`
return types after the colon (an intermediate nph pass had elided them).

Suite: 71 / 71 OK against the new async write surface.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* use idiomatic valueOr instead of ifs

* Reworked persistency shutdown, remove not necessary teardown mechanism

* Use const for DefaultStoragePath

* format to follow coding guidelines - no use of result and explicit returns - no functional change

---------

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Co-authored-by: Ivan FB <128452529+Ivansete-status@users.noreply.github.com>
2026-05-16 00:09:07 +02:00
Ivan FB
34c197c5cd
avoid keeping delivery tasks in propagated state when check store is disabled (#3843) 2026-05-15 17:39:38 +02:00
Fabiana Cecin
cb35b59f95
stop recv_service from delivering messages on unsubscribed topics for store-recovered messages (#3874)
* fix/harden recv_service so it won't deliver messages on unsubscribed content topics
* fix SubscrptionManager's subscribed-content-topics iterator
* fix broken store-message-receive test
* misc cleanups
2026-05-13 12:09:56 -03:00
Ivan FB
f23983f488
ensure peers are retrieved in random order from peer store (#3860) 2026-05-13 15:29:11 +02:00
Ivan FB
3c98aa7fac
Merge pull request #3875 from logos-messaging/update_master_from_v0.38 2026-05-13 13:01:52 +02:00