Open
Conversation
29f47f3 to
264aa7f
Compare
a30cbfb to
1e7bdbc
Compare
b5e980f to
67d47c2
Compare
95285b0 to
4b2d345
Compare
cba29a3 to
db1fe83
Compare
…send DRY up the repeated pattern of building a temporary drain transaction to estimate fees. Both send_all_to_address (AllRetainingReserve) and the upcoming open_channel_with_all / splice_in_with_all need this logic, so extract it into shared helpers.
Adds open_channel_with_all which uses get_max_drain_amount to determine the largest funding amount after accounting for on-chain fees and anchor reserves
Adds splice_in_with_all which uses get_max_drain_amount with a shared input to determine the largest splice-in amount after accounting for on-chain fees and anchor reserves.
DRY up the anchor reserve calculation that was duplicated between Node::new_channel_anchor_reserve_sats and the OpenChannelRequest handler in event.rs.
…-all Add ability to open channel / splice with all on-chain funds
Use user-provided fee rate for bumping transaction and return an error if it is too low, otherwise use system estimated fee rate and retry mechanism. Also switches the RBF test to use `random_chain_source`, and removes unnecessary sleep-based waits.
…dcast-fee-bumping-follow-up Minor follow-ups to lightningdevkit#628
At lightningdevkit/vss-server#79 we added a new, trivial, VSS authentication scheme that ensures client isolation without much else. This is great for testing, and we expect some to do new-account-rate-limiting via other means, so might well become a common default. Here we add support to it in ldk-node.
Added an expected_event function to better handle various events in the same block of code instead of duplicating the code for event listening. This improves the code readability and clarity.
When we added the trivial sigs-based authentication scheme in VSS, we made it the default if no other authentication scheme was configured and default features are enabled. This broke our integration tests as we were expecting no authentication to be required in such a case. Here we fix this by switching to the new sigs-based auth scheme, removing `store_id`s to demonstrate client isolation while we're at it. Sadly, because we don't currently have a test framework for LNURL-auth-based VSS, and because VSS no longer defaults to no-auth, the upgrade-from-0.6 test has to be moved to a separate CI job which runs VSS server with the noop auth.
For now VSS Server rejects empty `store_id`s, though we intend to change that in lightningdevkit/vss-server#95, until that lands we have to use non-empty `store_id`s.
…ment Add the `bolt12_invoice: Option<PaidBolt12Invoice>` field to the `PaymentSuccessful` event, enabling users to obtain proof of payment for BOLT12 transactions. For non-uniffi builds, import `PaidBolt12Invoice` directly from `lightning::events` rather than re-exporting through `types.rs`. For uniffi builds, use the custom `ffi::PaidBolt12Invoice` wrapper that handles Arc-wrapping for enum variants. The proof-of-payment assertion is integrated into the existing `simple_bolt12_send_receive` test rather than a separate test. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…igs-auth Add support for the simple "sigs-based auth" VSS scheme
…inding_python_test Refactoring binding python test
…lt12-pop [RFC] event: expose BOLT12 invoice in PaymentSuccessful for proof of payment
Introduces TierStore, a KVStore implementation that manages data across three storage layers: - Primary: Main data store for critical node data - Ephemeral: Secondary store for non-critical, easily-rebuildable data (e.g., network graph) with fast local access - Backup: Tertiary store for disaster recovery with async/lazy operations to avoid blocking primary store - Unit tests for TierStore core functionality
Adds TierStoreConfig and two configuration methods to NodeBuilder: - set_backup_store: Configure backup store for disaster recovery - set_ephemeral_store: Configure ephemeral store for non-critical data Modifies build_with_store to wrap the provided store in a TierStore, as the primary store, applying any configured ephemeral and backup stores. Note: Temporal dead code allowance will be removed in test commit.
Introduce FFI-safe abstractions and builder APIs to allow foreign language targets to configure custom backup and ephemeral stores when constructing nodes with a custom store. Major changes include: - Addition of FfiDynStoreTrait, an FFI-safe equivalent of DynStoreTrait, working around uniffi's lack of support for Pin<Box<T>> - Addition of FfiDynStore, a concrete wrapper for foreign language store implementations - Provision of FfiDynStoreTrait implementation for DynStoreWrapper to bridge native Rust stores to FFI layer (useful in testing) - Extension of ArcedNodeBuilder with methods for configuring backup and ephemeral stores - Exposure of build_with_store so foreign targets can build nodes with custom store implementations - Addition of build_node_with_store test helper to abstract uniffi-gated store wrapping at build_with_store call sites
- Add Rust integration test verifying correct routing to storage tiers - Add Python in-memory KV store and FFI test for tiered storage
Introduce FfiDynStoreInner with per-key write version locks that ensure write ordering and skip stale versions in both sync and async code paths. Test changes: - Unify tier store test helpers to use TestSyncStore for all tiers, replacing mixed SqliteStore/FilesystemStore/TestStore usage that caused test hangs due to TestStore's async write blocking - Split build_node_with_store into cfg-gated versions for uniffi vs non-uniffi feature flags
These were created to test that our backup store does not impact the primary store writes but the boilerplate appears too much for the functionality being tested.
- Restrict `TierStoreInner` visibility from `pub` to `pub(crate)` - Primary store can be either local or remote - Extract repeated ephemeral key matching into a standalone `is_ephemerally_cached_key` helper to DRY up `read_internal`, `write_internal`, and `remove_internal` - Replace `KVStoreSync::list` with async `KVStore::list` in `list_internal` to avoid blocking the async runtime
db1fe83 to
35f9ec2
Compare
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.
What this PR does:
We introduce
TierStore, aKVStoreimplementation that manages data acrossthree distinct storage layers.
The layers are:
(e.g., network graph). This tier aims to improve latency by leveraging a
local
KVStoredesigned for fast/local access.asynchronously/lazily to avoid blocking primary store operations.
We also permit the configuration of
Nodewith these stores allowingcallers to set exponential back-off parameters, as well as backup and ephemeral
stores, and to build the
Nodewith TierStore's primary store. These configurationoptions also extend to our foreign interface, allowing bindings target to build the
Node with their own
ffi::KVStoreimplementations.A sample Python implementation is added and tested.
Additionally, we add comprehensive testing for
TierStoreby introducingTierStorecore functionality.Nodebuilt with tiered storage.ffi::KVStoreimplementations.Concerns
It is worth considering the way retry logic is handled, especially because of nested
retries.
TierStorecomes with a basic one by default but there areKVStoreimplementationsthat come with them baked-in (e.g.
VssStore), and thus would have no need forthe wrapper-store's own logic.