Skip to content

feat: add UniFFI endpoint and background driver - #47

Merged
deepso7 merged 12 commits into
mainfrom
feat/ffi
Jul 29, 2026
Merged

feat: add UniFFI endpoint and background driver#47
deepso7 merged 12 commits into
mainfrom
feat/ffi

Conversation

@deepso7

@deepso7 deepso7 commented Jul 29, 2026

Copy link
Copy Markdown
Owner

Summary

  • add a UniFFI-facing endpoint wrapper with validated configuration, lifecycle management, commands, queries, and typed events
  • add the interruptible background driver with bounded event carry, cancellation filtering, keepalive, overflow accounting, and panic isolation
  • add direct-loopback and relay-backed integration coverage, including ordering, load, shutdown, listener panic, and callback/query handoff regressions
  • document native ownership, lifecycle, address semantics, discovery constraints, queue bounds, and host-wrapper responsibilities
  • pin the Android BoringSSL allocator-hook fix pending an upstream crates.io release

Verification

  • just test
  • just clippy
  • just check-nostd
  • just docs
  • cargo +1.88 check --workspace --all-targets
  • just fuzz 30
  • iOS physical-device runtime spike
  • Android physical-device runtime spike
  • direct loopback and relay-backed FFI integration tests

Notes


Summary by cubic

Adds a UniFFI-based minip2p-ffi endpoint and an interruptible background driver to embed minip2p safely in mobile apps. Includes validated config, lifecycle controls, typed events, hardened pubsub deduplication, and stabilized end-to-end tests over loopback and relay.

  • New Features

    • New crate minip2p-ffi exposing a UniFFI endpoint for React Native, Swift, and Kotlin, plus identity and relay-address helpers.
    • Validated construction; commands and queries; typed events for swarm, NAT, pubsub, and signed discovery.
    • Background driver with bounded event carry, cancellation filtering, keepalive, overflow accounting, and panic isolation; start/stop with bounded waits and listener callbacks.
    • Integration tests for direct loopback and relay paths, covering ordering, load, shutdown, and listener-panic cases; stabilized loopback CI timing; README on lifecycle and ownership.
    • Hardened pubsub dedup so unsigned messages cannot suppress later signed messages; added Floodsub and Gossipsub tests.
  • Dependencies

    • Added uniffi pinned to =0.31.0 to match host tooling.
    • Temporarily patched boring and boring-sys to a git revision to fix the Android allocator hook; remove after the upstream crates.io release.

Written for commit d735d96. Summary will update on new commits.

Review in cubic

@cursor

cursor Bot commented Jul 29, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@deepso7
deepso7 merged commit 1badcfc into main Jul 29, 2026
5 checks passed
@deepso7
deepso7 deleted the feat/ffi branch July 29, 2026 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant