feat: prepare offline receive integration - #766
Draft
coreyphillips wants to merge 4 commits into
Draft
coreyphillips wants to merge 4 commits into
coreyphillips wants to merge 4 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related to synonymdev/ldk-node#117.
This PR prepares Receive Offline for a native FFOR provider. A user can select it for a supported positive amount within ready inbound liquidity. The current production provider remains unavailable, so the checkbox stays hidden until native integration and end-to-end validation are complete.
Description
Out of Scope
Design
N/A - no design available.
Preview
N/A - the option remains hidden with the current runtime provider.
QA Notes
Manual Tests
Automated Checks
Native provider (September 23 update)
LdkOfflineReceiveProviderimplementsOfflineReceiveProvidingover the ldk-node offline receive API through the smallOfflineReceiveNodeClientprotocol, andLdkNodeOfflineReceiveClientadapts the generatedOfflineReceivePaymentobject onto it. The adapter compiles only under theOFFLINE_RECEIVE_LOCAL_LDKcompilation condition (Configs/OfflineReceiveLocalLdk.xcconfig), because the committedsynonymdev/ldk-nodepin stays at 0.7.0-rc.66, and the provider is selected only by the developer toggle in Dev settings; otherwiseUnavailableOfflineReceiveProviderremains and the checkbox never appears. The provider pollsstatusuntilready(bolt11), accepts the invoice only when its amount equals the request exactly and its payee is our own node id, persists the request identity as(requestId, amountSats, description)inUserDefaultsso a Ready invoice is recovered withstatus(requestId:)after process death without a secondprepare, keeps the identity on timeout so a retry resumes the same request, and clears it on terminal states.OfflineReceiveSettingsderives the node configuration from the trusted Blocktank peer and the developer overrides, andLightningServiceappliessetOfflineReceiveConfigwhen configured. Development defaults are documented as such inDocs/OfflineReceive.md.Verification: in the default configuration (rc.66, unavailable provider bound) the affected suites pass on the iOS simulator with 52 tests across
LdkOfflineReceiveProviderTests,OfflineReceiveRegistrationTests,OfflineReceiveSessionTestsandWalletViewModelReceiveTests. The local-binding build withOFFLINE_RECEIVE_LOCAL_LDKagainst the generated framework was not completed in this checkpoint, so the adapter file's compilation against the real API is unverified. No device or end-to-end settlement test is claimed for the app.This PR remains a draft. The committed Node dependency remains 0.7.0-rc.66 and the live provider stays unavailable without the local binding and the developer toggle.