11 Commits

Author SHA1 Message Date
Ivan FB
7725beb5e5
start using nim-ffi 0.1.4 (#74) 2026-06-03 09:46:52 +02:00
NagyZoltanPeter
35a33adc98
feat: make Persistence interface async (#69)
* feat: make Persistence interface async

The 14 Persistence proc fields now return Future[...] with
{.async: (raises: []), gcsafe.}, allowing real I/O backends (SQLite,
encrypted file, network) to suspend rather than block the Chronos event
loop the manager runs on.

Propagates through:
- ReliabilityManager.lock: system.Lock -> chronos.AsyncLock. Acquired
  across awaits cleanly; matches the single-threaded Chronos worker the
  FFI uses. Multi-OS-thread use is now explicitly the caller's
  responsibility.
- sds_utils + sds.nim public API procs (wrapOutgoingMessage,
  unwrapReceivedMessage, markDependenciesMet, setCallbacks,
  resetReliabilityManager, cleanup, ensureChannel, removeChannel, the
  getter snapshots, etc.) are now async.
- FFI request handlers in library/sds_thread/... await the new API.
- Tests converted via an asyncTest template that wraps each test body
  in an async proc; setup/teardown use waitFor for their single async
  call (ensureChannel / cleanup).

Lock scope is preserved exactly: the same call sites that held the
kernel Lock today hold AsyncLock now -- no new locking added.

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

* refactor: drop asyncSpawn, add asyncSetup/asyncTeardown

Three asyncSpawn usages removed:

- sds.nim startPeriodicTasks: stored the periodic-task futures on
  ReliabilityManager (new field `periodicTasks: seq[FutureBase]`) so
  cleanup can cancel them on shutdown instead of leaking the loops
  against a cleared manager.
- library/sds_thread/sds_thread.nim: fireSync moved BEFORE processing,
  then `await SdsThreadRequest.process(...)` instead of asyncSpawn'ing
  it. Aligns the worker with the SP-channel + lock assumption that
  there are no concurrent requests; caller throughput is unchanged
  because the caller only waits for receipt (fireSync), not processing.
- tests TestBus repair callback: replaced asyncSpawn(deliverExcept...)
  with an explicit pending-delivery queue drained by `bus.drain()`.
  Integration tests no longer rely on `sleepAsync(10ms)` to let
  spawned deliveries finish — they await drain instead.

Tests also pick up an asyncSetup/asyncTeardown pair (tests/async_unittest.nim)
so suite fixtures can `await` directly. All `waitFor` in setup/teardown
blocks is gone; only the top-level asyncTest wrapper still uses waitFor
(once, to drive the async proc to completion).

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

* Correctly propagate error hidden by new async move

* Correctly handle future cancellation exceptions, +some housekeeping

* Apply suggestion from @Ivansete-status

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

* Stylistics, async default implication addressed, nph style run

* Remove leaking CancelledFuture from public facing + as a consequence it is tuneled into handling CatchableError everywhere

---------

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Co-authored-by: Ivan FB <128452529+Ivansete-status@users.noreply.github.com>
2026-05-25 22:30:15 +02:00
Darshan
2e9a7683f0
fix: require participantId on newReliabilityManager (#67) 2026-05-10 13:24:42 +05:30
Darshan
9d08f5995b
feat: Implementation of SDS-Repair (#60) 2026-05-01 18:35:38 +05:30
Ivan FB
0dea35d364
feat: refactor to support building with Nimble (#52)
Changes include:

- Removing all submodules from vendor folder.
- Updating sds.nimble with required depndencies.
- Generating a nimble.lock file using Nimble.
- Updated Nim code to reference depndencies correctly.
- Added nix/deps.nix fixed output derivation that calls Nimble.
- Updated nixpkgs to use 25.11 commit which provides Nimbe 0.20.1.
- Disabled Nix Android builds on MacOS due to Nimble segfault.

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2026-02-11 16:32:02 +01:00
shash256
9f7ae0c7df
feat: support retrieval hints for efficient message retrieval from store nodes (#18)
* feat: updates for retrieval hint

* use HistoryEntry for deps

* chore: rearrange helper funcs

* chore: address review comments

* fix: simplify with mapIt
2026-01-29 09:52:40 +00:00
Ivan Folgueira Bande
191928adc6
rm UNWRAP_MESSAGE failed error 2025-12-09 11:45:35 +01:00
Akhil
569607b616
fix: add channelID to SdsUnwrapResponse (#17) 2025-07-24 17:08:30 +05:30
Akhil
4e10d77218
feat: libsds - support for multiple channels per RM (#15) 2025-07-17 14:13:21 +05:30
gabrielmer
8312df7b53
fix: libsds received signal (#16) 2025-07-15 17:43:00 +02:00
Akhil
074eafe895
feat: extensive set of initial features. 2025-05-29 12:18:53 +01:00