Skip to content

LSP support - #1623

Open
chenyukang wants to merge 133 commits into
nervosnetwork:developfrom
chenyukang:lsp-support
Open

chenyukang wants to merge 133 commits into
nervosnetwork:developfrom
chenyukang:lsp-support

Conversation

@chenyukang

@chenyukang chenyukang commented Aug 10, 2026 •

Copy link
Copy Markdown
Collaborator

To resolve #1571
Implementation of #1625

@chenyukang chenyukang changed the title [WI]: LSP support [WIP]: LSP support Aug 11, 2026
Derive local commitment points and public nonces on demand instead of publishing and persisting every signing round. Drop legacy local caches on restore while preserving pending requests and idempotency receipts. Keep external signer validation and material history unchanged.

Cover bounded local material state, restart with legacy caches, pending signature and receipt restoration, and unchanged external material requirements.
Problem:
a7a4307 made a ChannelReady public channel reply to every received
AnnouncementSignatures with its own cached signatures. Reestablishment
already proactively replays those signatures, so two ready peers keep
replying to one another. Each duplicate also rebuilds/broadcasts the
channel announcement and update. The resulting ingress flood trips peer
admission limits and disconnects an otherwise recovered session, making
legacy recovery, repeated restarts, MPP retries and list_peers tests fail.

Fix:
Treat AnnouncementSignatures as an idempotent no-op once a public channel
is ChannelReady, before mutating announcement state or broadcasting gossip.
Keep the public-channel check and the AwaitingChannelReady path, as well
as proactive cached-signature replay during funding/reestablishment. This
still lets a ready peer recover the other side's missing announcement,
without responding to that peer's replay indefinitely. No wire-format,
persisted-schema or admission-limit changes are needed.

Regression coverage:
- Replay signatures repeatedly into a ready public channel and assert no
  outgoing messages, no gossip broadcasts and no persisted-state changes.
- Reestablish asymmetric Ready/AwaitingChannelReady peers after a lost
  announcement; check cached replay restores readiness and then stops.
- Strengthen external announcement-signing restart coverage to check both
  peers recover and the exact cached remote signature is restored.

Both new regression tests fail on the unmodified implementation. The
focused 40-test run, including all five previously failing tests, passes
with this fix.

Validation:
- make test: default storage 1552 passed / 9 skipped; SQLite 1550 passed /
  9 skipped; fiber-types 27 passed.
- make clippy: all features/targets, SQLite, fiber-types and wasm32 pass.
- cargo fmt --all -- --check, changed-file typos and git diff --check pass.
The public-channel restart fixture checked get_channel_signing_status for
SignChannelAnnouncement, then called try_sign_pending, which queried the
status a second time. If the first response was NoSignatureRequired and
the announcement request arrived before the second query, the helper
signed the very request the test meant to leave pending. The channel
became ready, so setup waited for a consumed checkpoint until its 30s
timeout. CI run 35158563757 shows this exact sequence.

Pass the already-observed ChannelSigningStatus into the signing helper.
The public setup now checks and acts on one snapshot; the unconstrained
recovery/private-channel callers still query once before signing. Do not
change production code, RPCs, timeout budgets or retry counts.

Add a deterministic regression that presents a stale idle snapshot while
a real announcement signature is pending. Assert that the signer store,
complete signing request and absent local announcement signature remain
unchanged, then explicitly sign the observed request and recover both
peers. The regression fails with the old re-query behavior.

Validation with CI trace logging and RUST_TEST_THREADS=2:
- All 19 external signer restart tests pass with default storage and
  SQLite.
- Repeat the signer restart, tenant restart and new announcement snapshot
  tests 20 times each: all 60 executions pass without timeout.
- Nextest reports intermittent non-failing leaky-test warnings in default
  storage runs; SQLite reports none. These warnings are not suppressed.
- make clippy passes, including SQLite and wasm32; fmt, changed-file typos
  and git diff --check also pass.
@chenyukang
chenyukang marked this pull request as ready for review September 17, 2026 02:13
jjyr added 10 commits September 17, 2026 18:03
Add a tenant-specific opening RPC with durable retry state and frozen verification context while preserving the general external-funding RPC contract.

Have the SDK persist opening intent, verify wallet funding and channel context, and install the commitment baseline automatically. Remove standalone binding flows and update the agent, Bruno scenarios, documentation, and regression tests.
Authorize inbound invoices and verify recovery before releasing preimages in E2E drivers. Allow tenant settle_invoice calls with namespace isolation coverage and require SDK signature and revocation evidence.

Keep nonce reuse advisory in signing policy while preserving nonce correctness and semantic validation.
@chenyukang chenyukang changed the title [WIP]: LSP support LSP support Oct 9, 2026
Replace signer status polling with tenant-authenticated SSE and business-layer signing notifications. Add bounded stream lifetimes, heartbeats, connection limits, session takeover, and reconnect recovery.

Update the signer driver, full-payment-hash fixtures, documentation, and focused coverage.
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.

Running fiber on Android mobile: 24/7 availability and watchtower delegation

3 participants