Skip to content

Conversation

@martinsaposnic
Copy link
Contributor

Summary

  • Add sync_rgs(do_full_sync: bool) NAPI method for manual RGS sync
  • Perform full RGS sync before BOLT12 payments to get node announcements with addresses/features needed for onion message routing
  • Update ldk-node to include sync_rgs support

Context

BOLT12 payments require onion message routing to introduction nodes in blinded paths. LDK's DefaultMessageRouter.find_path() needs node announcement data (addresses/features) to route these messages. RGS v2 includes this data, so a full RGS sync before BOLT12 payments ensures the router has the necessary information.

Test plan

  • Test BOLT12 payment to Phoenix wallet

- Add sync_rgs(do_full_sync: bool) NAPI method for manual RGS sync
- Perform full RGS sync before BOLT12 payments to get node announcements
  with addresses/features needed for onion message routing
- Update ldk-node to include sync_rgs support
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bbc9312df1

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

src/lib.rs Outdated
Comment on lines 416 to 418
tokio::task::block_in_place(|| {
tokio::runtime::Handle::current().block_on(async {
self

Choose a reason for hiding this comment

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

P1 Badge Avoid Tokio handle without runtime in sync_rgs

sync_rgs calls tokio::task::block_in_place and Handle::current().block_on(...), which panics if the caller is not already inside a Tokio runtime. N-API methods like this are invoked from the Node.js thread, which typically has no Tokio runtime, so calling syncRgs() from JS will crash the process instead of returning a Result. Consider creating a runtime (as you do for LNURL) or routing the call onto an existing runtime so the method is safe to call from JS.

Useful? React with 👍 / 👎.

@martinsaposnic
Copy link
Contributor Author

@codex review

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. What shall we delve into next?

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@martinsaposnic martinsaposnic merged commit e51f6e2 into main Jan 9, 2026
11 checks passed
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.

4 participants