Skip to content

Account for LiquidityManager persistence - #650

Merged
tnull merged 1 commit into
lightningdevkit:mainfrom
tnull:2025-09-liq-persistence
Oct 8, 2025
Merged

Account for LiquidityManager persistence#650
tnull merged 1 commit into
lightningdevkit:mainfrom
tnull:2025-09-liq-persistence

Conversation

@tnull

@tnulltnull commented Sep 25, 2025

Copy link
Copy Markdown
Collaborator

Based on #633.

We recently implemented persistence for the lightning-liquidity service
state. Here we make corresponding changes in LDK Node to have our
service state persisted.

@tnulltnull added this to the 0.7 milestone Sep 25, 2025
@ldk-reviews-bot

ldk-reviews-bot commented Sep 25, 2025

Copy link
Copy Markdown

👋 I see @jkczyz was un-assigned.
If you'd like another reviewer assignment, please click here.

@tnull
tnull marked this pull request as draft September 25, 2025 14:27
@tnull
tnull removed the request for review from jkczyzSeptember 25, 2025 14:28
@tnull
tnullforce-pushed the 2025-09-liq-persistence branch from dad5932 to 53d4f0aCompareSeptember 30, 2025 08:12
@tnull
tnull changed the base branch from develop to mainOctober 7, 2025 08:52
@tnull

tnull commented Oct 7, 2025

Copy link
Copy Markdown
CollaboratorAuthor

We decided to make the develop behavior (tracking more-recent LDK main) the default behavior. With #655 we merged develop into main and now deleted the develop branch. Hence the base branch is changed to main here, too.

We recently implemented persistence for the `lightning-liquidity` service
state. Here we make corresponding changes in LDK Node to have our
service state persisted.
@tnull
tnullforce-pushed the 2025-09-liq-persistence branch from 53d4f0a to a404a94CompareOctober 8, 2025 08:51
@tnull

tnull commented Oct 8, 2025

Copy link
Copy Markdown
CollaboratorAuthor

Ready for review now that #633 landed.

@tnull
tnull marked this pull request as ready for review October 8, 2025 08:53
@tnull
tnull requested review from joostjager and removed request for jkczyzOctober 8, 2025 08:54
Comment threadsrc/liquidity.rs
liquidity_client_config,
)
.await
.map_err(|_| BuildError::ReadFailed)?,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reading data in new, isn't that an undesirable pattern?

Copy link
Copy Markdown
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe, yes. We did it over at lightningdevkit/rust-lightning#4059 since the individual service states are persisted under different locations and the LiquidityManager is the singular interface on which you can decide which services to enable. So allowing an API that allows to enable some services but not reading all the service states seemed complicated and error-prone (i.e., worse than reading them all in new.

Comment threadsrc/builder.rs

let liquidity_source = Arc::new(liquidity_source_builder.build());
let liquidity_source = runtime
.block_on(async move { liquidity_source_builder.build().await.map(Arc::new) })?;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming this is temporary until async building?

Copy link
Copy Markdown
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we'll remove this when we move building to Node::start and make it async.

@tnull
tnull merged commit e4bb615 into lightningdevkit:mainOct 8, 2025
14 of 15 checks passed
Sign up for freeto 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.

3 participants

@tnull@ldk-reviews-bot@joostjager