Skip to content

multi: Use Lightning Labs mainnet mempool endpoint - #1166

Merged
sputn1ck merged 1 commit into
mainfrom
kon/use-mainnet-mempool-endpoint
Aug 20, 2026
Merged

multi: Use Lightning Labs mainnet mempool endpoint#1166
sputn1ck merged 1 commit into
mainfrom
kon/use-mainnet-mempool-endpoint

Conversation

@sputn1ck

Copy link
Copy Markdown
Member

Summary

  • route the lwwallet mainnet Esplora default through mempool.staging.lightningcluster.com
  • use the same mainnet instance for recommended-fee estimates
  • align configuration examples and operator documentation with the new defaults

Testing

  • make lint-changed-local
  • make unit pkg=chainfees case=TestDefaultMempoolSpaceURL
  • make unit pkg=lwwallet case=TestDefaultEsploraURL
  • make unit pkg=waved case=TestMempoolSpaceFeeAccessorsAreNilSafe
  • make unit pkg=waved case=TestConfigValidateWalletDefaults
  • live probes of /api/blocks/tip/height and /api/v1/fees/recommended

Route lwwallet chain data and optional fee estimation through the
Lightning Labs-operated mainnet mempool instance. Keep examples and
operator documentation aligned with the new defaults.
@sputn1ck
sputn1ck marked this pull request as ready for review August 20, 2026 11:49
Copilot AI lite review requested due to automatic review settings August 20, 2026 11:49
@sputn1ck

Copy link
Copy Markdown
Member Author

/gateway review

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR updates Wavelength’s default mainnet Esplora and mempool.space fee-estimation endpoints to use a Lightning Labs-operated mempool instance, and aligns tests and operator documentation with the new defaults.

Changes:

  • Switch mainnet defaults from public mempool.space to mempool.staging.lightningcluster.com for lwwallet Esplora and recommended-fee estimates.
  • Update tests to assert the new defaults/URLs.
  • Refresh configuration and documentation references to reflect the new default endpoints.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
waved/config_mempoolspace_fee_test.go Updates nil-safe accessor test to use the new mainnet fee URL.
sample-waved.conf Adjusts operator-facing config comments for the mempool.space fee URL default behavior.
lwwallet/esplora.go Updates EsploraClient documentation to reference the new default constant.
lwwallet/defaults.go Changes DefaultEsploraURLMainnet to the Lightning Labs-operated mempool instance.
lwwallet/defaults_test.go Updates test doc comment to no longer claim mainnet uses public mempool.space.
lwwallet/config.go Adjusts config field docs to reference DefaultEsploraURLMainnet.
docs/signet.md Updates the documented mainnet lwwallet Esplora default URL.
chainfees/mempoolspace.go Switches mainnet recommended-fee default to Lightning Labs-operated mempool instance.
chainfees/mempoolspace_test.go Updates URL used in scheme-validation test to match the new mainnet default.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread sample-waved.conf
Comment on lines 226 to +228
# Override the network-default recommended-fee endpoint. Must be an absolute
# https URL. Empty uses the per-network default: public mempool.space on
# mainnet, Lightning Labs-operated mempool instances on testnet3, testnet4,
# and signet.
# https URL. Empty uses a Lightning Labs-operated mempool instance for the
# configured network.

@lightninglabs-gateway lightninglabs-gateway Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Gateway review — 4 findings

🔴 0 Blocker · 🟠 1 Major · 🟡 2 Minor · 🔵 1 Nit

Summary

The PR repoints the mainnet lwwallet Esplora default and the mainnet
recommended-fee default at a Lightning Labs-operated instance, so all four
supported networks now resolve to first-party infrastructure instead of
mixing in the public mempool.space host on mainnet, and updates the two
docs that enumerated the old default. The Go changes are mechanical: two
string constants plus doc-comment rewording, with the test literals swapped
to match.

The substantive question is the hostname itself. mempool.staging.lightningcluster.com
is a staging name, and on mainnet it becomes the default source for every
piece of chain data the lwwallet backend consumes — tip height, blocks,
headers, transactions, address UTXOs, fee estimates, and transaction
broadcast (lwwallet/esplora.go) — plus the fee endpoint for the lnd
backend's optional provider. None of the other three network defaults carry
a staging label; they use the same mempool-<net>.testnet.lightningcluster.com
production shape. That asymmetry is the one thing worth resolving before this
lands.

The doc updates are otherwise consistent with the code, with one
overclaiming sentence in sample-waved.conf.

Bot commands
  • /gateway re-review — re-run after pushing changes (maintainers)
  • /gateway dismiss <id> — silence a finding (maintainers)
  • /gateway explain <id> — elaborate on a finding (anyone)

Comment thread lwwallet/defaults.go
DefaultEsploraURLMainnet = "https://mempool.space/api"
// DefaultEsploraURLMainnet is the Esplora-compatible REST API for
// mainnet, backed by a Lightning Labs-operated mempool instance.
DefaultEsploraURLMainnet = "https://mempool.staging." +

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟠 F1 (Major) — Mainnet default points at a staging endpoint · lwwallet/defaults.go:13

The mainnet default for all lwwallet chain access is now a host explicitly named staging. If that instance is a staging deployment in the usual sense — lower capacity, no production SLA, redeployed at will — then every mainnet waved instance that leaves wallet.esploraurl empty loses tip polling, UTXO discovery, and transaction broadcast whenever it is cycled, and this is the network where real funds are at stake.

Why this matters

The same host lands in chainfees/mempoolspace.go:37 for the mainnet recommended-fee endpoint, so a staging outage degrades both chain data and fee estimation on mainnet simultaneously. Note the naming asymmetry against the other defaults in this same const block: testnet3, testnet4, and signet all use mempool-<net>.testnet.lightningcluster.com, a production-shaped name, while mainnet alone gets a staging subdomain. readme states mainnet operation is gated behind --allow-mainnet and that the project is under active development, which lowers the blast radius today but does not make a staging host the right value to bake in as the mainnet default. Either point mainnet at the production name, or, if mempool.staging.… is in fact the durable production endpoint that merely carries a legacy label, say so in the constant's doc comment so the next reader does not have to guess. I cannot tell from the diff or the loaded context which of the two it is.

Comment thread sample-waved.conf
# mainnet, Lightning Labs-operated mempool instances on testnet3, testnet4,
# and signet.
# https URL. Empty uses a Lightning Labs-operated mempool instance for the
# configured network.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 F2 (Minor) — Config comment claims a default for networks that have none · sample-waved.conf:228

The new text — "Empty uses a Lightning Labs-operated mempool instance for the configured network" — reads as though every network has a default, but DefaultMempoolSpaceURL (chainfees/mempoolspace.go) returns unsupported mempool.space network %q for regtest and simnet, so an empty URL there fails estimator construction rather than resolving to anything. The text this replaces enumerated the networks explicitly and did not have that gap; keeping the enumeration preserves the information the operator needs.

Suggested change
# configured network.
# configured network on mainnet, testnet3, testnet4, and signet.

{
name: "https ok",
url: "https://mempool.space/api/v1/fees/recommended",
url: mempoolSpaceMainnetURL,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 F3 (Minor) — Only positive https case in the validator test now tracks the constant · chainfees/mempoolspace_test.go:232

TestMempoolSpaceEstimatorRejectsInsecureURL's "https ok" row was the table's only fixed positive case for the https-accept path in validateMempoolSpaceURL; binding it to mempoolSpaceMainnetURL means the case's input now moves whenever the default moves, and the row's name stops describing what it pins. Keep the literal https:// case and add a separate row asserting the mainnet default also validates — that covers both the validator and the constant, instead of trading one for the other.

func TestMempoolSpaceFeeAccessorsAreNilSafe(t *testing.T) {
t.Parallel()

const mainnetURL = "https://mempool.staging.lightningcluster.com/" +

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 F4 (Nit) — Test duplicates the production mainnet URL it does not assert on · waved/config_mempoolspace_fee_test.go:26

TestMempoolSpaceFeeAccessorsAreNilSafe only checks that MempoolSpaceFeeURL() round-trips whatever was set, so the value is arbitrary; hardcoding a copy of the real mainnet endpoint (which the waved package cannot reference, since the chainfees constant is unexported) creates a literal that will silently drift from production without any test noticing. An obviously-synthetic URL makes the test's indifference to the value explicit.

@lightninglabs-gateway

lightninglabs-gateway Bot commented Aug 20, 2026

Copy link
Copy Markdown

🤖 gateway audit metadata for this PR — auto-generated, please don't edit.

@GeorgeTsagk

GeorgeTsagk commented Aug 20, 2026

Copy link
Copy Markdown
Member

With this I'm not hitting that many any rate limits. Two open questions:
a) Will we be able to sustain the load, when lots of users use this and/or griefers find out?
b) Why not add a federation of explorers, which enables the fallback option in case you get rate limited or the service goes down?

@sputn1ck sputn1ck added the backport-v0.1.x-branch Backport this merged PR to v0.1.x-branch label Aug 20, 2026
@sputn1ck
sputn1ck merged commit 6d7d971 into main Aug 20, 2026
35 of 36 checks passed
@github-actions

Copy link
Copy Markdown

Successfully created backport PR for v0.1.x-branch:

sputn1ck added a commit that referenced this pull request Aug 20, 2026
…ranch

[v0.1.x-branch] Backport #1166: multi: Use Lightning Labs mainnet mempool endpoint
@whiteyhat

Copy link
Copy Markdown

Great work 💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-v0.1.x-branch Backport this merged PR to v0.1.x-branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants