Introduce Rust features - #1061
Open
tnull wants to merge 17 commits into
Open
Conversation
|
👋 Thanks for assigning @benthecarman as a reviewer! |
tnull
force-pushed
the
2026-08-rust-features
branch
from
August 19, 2026 13:40
9b4022f to
7f339e5
Compare
benthecarman
left a comment
Contributor
There was a problem hiding this comment.
Would be good to have CI cover the missed feature configs that claude caught
| feature = "chain-electrum", | ||
| feature = "chain-bitcoind" | ||
| )))] | ||
| compile_error!("at least one chain source feature must be enabled"); |
Contributor
There was a problem hiding this comment.
should do same with db
Collaborator
Author
There was a problem hiding this comment.
We can't do it exactly the same as we also support supplying a custom store via build_with_store, so can't enforce at compile time.
Allow integration runs to constrain randomized chain sources through the LDK_NODE_TEST_CHAIN_SOURCES environment variable. This makes backend-specific feature builds deterministic while preserving all-backend randomization by default. Co-Authored-By: HAL 9000
Let tests with custom node construction reuse the common chain source configuration. Co-Authored-By: HAL 9000
Exercise PostgreSQL-backed nodes with the configured or randomly selected chain backend instead of always using Esplora. Co-Authored-By: HAL 9000
Keep filesystem-specific code together so generic storage utilities can compile without that backend. This commit only relocates the existing migration behavior and tests. Co-Authored-By: HAL 9000
Hide the concrete Bitcoin Core gossip verifier behind the LDK UTXO lookup trait. This lets common gossip types compile independently of the Bitcoin Core backend without changing verification behavior. Co-Authored-By: HAL 9000
Keep human-readable-name resolution beside the unified payment code that consumes it. This commit only relocates the existing resolver and updates its internal import paths. Co-Authored-By: HAL 9000
Define the cfg-selected Builder name next to the implementation it represents. Feature-specific binding exports can now live there without changing the native and lock-wrapped builder APIs. Co-Authored-By: HAL 9000
Keep the native defaults while letting applications select only required chain sources, storage backends, and unified payment support. At least one chain source remains mandatory. PostgreSQL now has a storage-prefixed feature name. Co-Authored-By: HAL 9000
Keep custom UniFFI builds from requiring VSS and unified payment dependencies that they did not enable. Co-Authored-By: HAL 9000
Let wallet and PostgreSQL test targets compile when Esplora or SQLite support is disabled. Co-Authored-By: HAL 9000
Separate backend-specific binding methods into cfg-gated implementation blocks. Method bodies and availability remain unchanged, making later conditional exports easier to review. Co-Authored-By: HAL 9000
Keep binding signatures and documentation next to their Rust implementations. Leave only the UDL object declaration so backend features can add methods without failure stubs. Co-Authored-By: HAL 9000
Build published bindings with uniffi-default and without native default features. Let local builds add backend features through LDK_NODE_EXTRA_FEATURES. Co-Authored-By: HAL 9000
Build and test UniFFI with its lean preset so excluded backends stay excluded. Check all features and test targets to catch incompatible optional dependencies without running the suite twice. Co-Authored-By: HAL 9000
Cover custom UniFFI builds, non-Esplora wallet tests, and PostgreSQL tests without SQLite in CI. Co-Authored-By: HAL 9000
List each chain, storage, payment, and binding feature and explain the unchanged native defaults. Show both lean and custom binding builds so optional backend dependencies can be selected deliberately. Co-Authored-By: HAL 9000
Avoid allocating paths before filesystem operations that only need borrowed paths. Co-Authored-By: HAL 9000
tnull
force-pushed
the
2026-08-rust-features
branch
from
August 20, 2026 11:07
7f339e5 to
3185f51
Compare
Collaborator
Author
|
Rebased to address minor conflicts, let me know if I can squash fixups. |
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.
Closes #900
Previously, we omitted making use of Rust features to dis-/enable specific functionality, with the exception of
uniffiand most recently adding a tentativepostgresfeature.Here we finally change that and allow users to selectively disable and enable specific parts of the code base, hence also reducing their dependency tree.