Skip to content

fix: release peer lock before persistence - #101

Merged
ovitrif merged 4 commits into
fix/94-sigabrt-runtime-dropfrom
ovi/fix-99-release-peer-lock
Jul 31, 2026
Merged

fix: release peer lock before persistence#101
ovitrif merged 4 commits into
fix/94-sigabrt-runtime-dropfrom
ovi/fix-99-release-peer-lock

Conversation

@ovitrif

@ovitrif ovitrif commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Fixes #99

Related to synonymdev/bitkit-android#986.
Addresses the Node.listPeers ANR tracked in synonymdev/bitkit-android#1036.

Summary

  • Backport Fully switch to async KVStore persistence lightningdevkit/ldk-node#919's async KVStore peer-persistence design.
  • Serialize peer mutations with a Tokio mutex, encode each snapshot under the peer RwLock, and release that lock before awaiting persistence.
  • Preserve fork address updates, RGS recovery exclusion ordering, and retryable add, address-update, and removal failures.
  • Make explicit disconnect succeed only after durable peer removal; persistence failures keep the peer connected and remain retryable.
  • Bridge synchronous node APIs at the runtime boundary while async event and recovery paths await persistence directly.
  • Prepare Rust and mobile binding artifacts as 0.7.0-rc.62.

Validation

  • Local verification: cargo fmt --check, git diff --check, and cargo test --features uniffi --lib (94 passed).
  • Binding verification: ./bindgen.sh completed for JVM Kotlin, Python, Swift, and Android; JVM Gradle, Swift framework assembly, Android three-ABI build-ID, 16 KiB alignment, debug-symbol, stripped-library, and AAR checks passed.
  • Swift archive verification: SHA-256 40907bc5d61d85492a9f22722c1009791255ed0da40577765f49d486ebb41e9c matches Package.swift and the uploaded release asset.

QA Notes

  • Originally stacked on fix: prevent electrum runtime self-drop #100 at 080b5f2.
  • Synchronous peer reads remain available while async persistence is pending.
  • Failed persistence restores the previous in-memory state so the mutation can be retried.
  • Explicit disconnect returns a peer-removal persistence failure and keeps the live peer connected.

Release

@ovitrif ovitrif self-assigned this Jul 28, 2026
@ovitrif
ovitrif requested a review from coreyphillips July 28, 2026 21:29
@ovitrif ovitrif linked an issue Jul 28, 2026 that may be closed by this pull request
ovitrif added 2 commits July 29, 2026 14:38
Backport lightningdevkit/ldk-node@d49b681 while preserving fork address updates and retryable persistence failures.
@ovitrif
ovitrif force-pushed the ovi/fix-99-release-peer-lock branch from 85ac71a to b3bd780 Compare July 29, 2026 13:02
@ovitrif
ovitrif marked this pull request as ready for review July 29, 2026 13:11
chatgpt-codex-connector[bot]

This comment was marked as resolved.

@ovitrif
ovitrif merged commit 60c4c4d into fix/94-sigabrt-runtime-drop Jul 31, 2026
2 checks passed
@ovitrif
ovitrif deleted the ovi/fix-99-release-peer-lock branch July 31, 2026 17:41
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.

fix: release peer lock before persistence

2 participants