Skip to content

Add WatchtowerStateExport endpoint for watchtower clients - #254

Draft
vincenzopalazzo wants to merge 1 commit into
lightningdevkit:mainfrom
vincenzopalazzo:feat/watchtower-export
Draft

Add WatchtowerStateExport endpoint for watchtower clients#254
vincenzopalazzo wants to merge 1 commit into
lightningdevkit:mainfrom
vincenzopalazzo:feat/watchtower-export

Conversation

@vincenzopalazzo

Copy link
Copy Markdown
Member

Summary

  • Adds an opt-in WatchtowerStateExport endpoint ([watchtower] export_enabled, default false) exporting per-channel watchtower state for external clients (e.g. a rust-teos / Eye of Satoshi tower client)
  • Exports: funding outpoint, channel/user IDs, counterparty node id, to_self_delay, and the latest counterparty commitment txids + commitment numbers - the watchtower locator source - via new ldk-node watchtower APIs
  • Justice transaction assembly (to_local output detection, unsigned skeleton with conservative fee, signing via Node::sign_to_local_justice_tx) is marked TODO(justice-tx); the endpoint returns signed=false + empty payload until wired - no fake data
  • Proto messages, gRPC routing, client method, CLI command watchtower-state-export, unit test for the disabled error path
  • Cargo.toml carries a temporary [patch] for ldk-node -> vincenzopalazzo/ldk-node watchtower-apis-16eaa6f (backport of Expose watchtower APIs on Node ldk-node#1031 onto the pinned rev); dropped once the upstream API lands in a release

Test plan

  • cargo check, cargo check --tests, cargo test (102 tests green incl. new export_disabled_returns_error), cargo fmt --check
  • Manual: run with watchtower.export_enabled = true, call watchtower-state-export CLI against a node with channels

DRAFT: depends on lightningdevkit/ldk-node#1031 (also draft) for the upstream API shape.

Adds an opt-in endpoint (config: [watchtower] export_enabled, default false) that exports per-channel watchtower state for external clients such as a rust-teos (Eye of Satoshi) tower client: funding outpoint, channel/user IDs, to_self_delay, and the latest counterparty commitment txids + commitment numbers (the watchtower locator source), via the new ldk-node watchtower APIs.

Justice transaction assembly (to_local output detection, unsigned skeleton with conservative fee, signing via Node::sign_to_local_justice_tx) is marked TODO(justice-tx) and returns signed=false with empty payload until wired.

Includes the endpoint handler, proto messages, gRPC routing, client method, CLI command, and a unit test for the disabled-by-default error path.

Note: Cargo.toml carries a temporary [patch] for ldk-node pointing at vincenzopalazzo/ldk-node watchtower-apis-16eaa6f (backport of lightningdevkit/ldk-node#1031 onto the pinned rev); to be dropped once the upstream API lands in a release.
@ldk-reviews-bot

Copy link
Copy Markdown

👋 Hi! I see this is a draft PR.
I'll wait to assign reviewers until you mark it as ready for review.
Just convert it out of draft status when you're ready for review!

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.

2 participants