lnd
lnd copied to clipboard
[feature]: testnet4 support
Is your feature request related to a problem? Please describe.
I'd like to switch my app development to testnet4. LND gives error when I create or unlock a wallet:
error creating wallet config: unable to create partial chain control: unknown network with genesis hash 00000000da84f2bafbbc53dee25a72ae507ff4914b867c565be350b0da8bf043
Describe the solution you'd like LND should start supporting testnet4.
Describe alternatives you've considered testnet3 is nearing EOL and is not compatible with liquidtestnet4
Additional context btcd guys are working on this: https://github.com/btcsuite/btcd/issues/2187
I think we need parallel support for testnet3 and 4. There is currently only a network effect on testnet3. But I can understand if people prefer to start new nodes on testnet4.
See the btcd issue linked there. FWIW, testnet4 hasn't really "officially" launched yet, as it isn't included yet in an final release of any Bitcoin full node daemon (I'm not sure if it'll be in bitcoind 28 as the PR doesn't appear to have any milestone assigned for the 28 release). It also includes new consensus rules that don't exist on mainnet, and will only exist on testnet4, so there may be some extra time tacked on to the end of development to make sure everything is compatible (eg: the BIP doesn't yet have test vectors for these items).
Sure, I understand and appreciate all these issues. Testnet is for developing and testing out new things with no risk of funds loss. It does not have to be perfect. One can already build Bitcoin Core from this PR to run with testnet4.
The reason we need LND to support it is because Liquid is nearing release of Elements Core v23.2.2 that will have discounted vSize for confidential transactions. PeerSwap users will greatly benefit from this, but the necessary development requires testnet4/liquidtestnet4.
One can already build Bitcoin Core from https://github.com/bitcoin/bitcoin/pull/29775 to run with testnet4.
Yep, I linked the PR in my comment above. My main point is that: that isn't released yet, so we can't consider any of the params or even the new consensus changes final. It also doesn't appear that it'll be a part of Bitcoind 28, as the feature freeze is in a week or so. If it's a part of Bitcoind 29, then that puts the actual release date sometime in 2025 IIUC.
If you urgently need support, then depending on your available resources, you should be able to put together a temporary branch with the functionality.
Testnet is for developing and testing out new things with no risk of funds loss. It does not have to be perfect.
That btcd issues links to a partial version, but it doesn't have the new consensus rules, so it risks forking off of testnet4.
Assuming the btcd PR is finalized in short order, the soonest it would land in lnd is ~November, as it would be coupled with lnd v0.19.
Thanks. Forking and upgrading both lnd and btcd sounds too much work ).
I've been observing testnet4 for quite some time, and so far it is working very well. Testnet3 which is on block 2.8 million is an interesting experiment but at times unusable. There are also a lack of faucets. I've collected resources on testnet4. I hope it gets merged into 28, but bitcoin devs need something that just works for the next 5+ years or so. I believe testnet4 will be the de-facto way of testing ideas on bitcoin. Would be great if lnd joins the party sooner, rather than later.
https://github.com/testnet4/awesome-testnet4
There is also an active BIP discussion: https://github.com/bitcoin/bips/pull/1601#issuecomment-2263490441
BIP-94 (Testnet4) is now merged
https://github.com/bitcoin/bips/blob/master/bip-0094.mediawiki
To whom it may concern, I forked LND/btcd/btcwallet with "naive" support for Testnet4. It has no DNS seeds, but I opened a channel to another node and paid an invoice. This is all I need for my purposes. I used lnd master, which shows 0.18.0-beta. Set bitcoin.testnet4=true in lnd.conf.
https://github.com/Impa10r/lnd
testnet4 is now merged into bitcoin master. It is anticipated that testnet3 will be deprecated and removed in future versions.
https://github.com/bitcoin/bitcoin/pull/29775
I think we'll wait a bit longer for the dust to settle re testnet4 (eg: potential param changes, reexamining difficult adjustment fixes). Until then, testnet3 still works and pretty much every production test environment for Bitcoin infrastructure still uses it.
Testnet4 also isn't very useful for testing LN until there're a few hundred channels active on the new test network.
Not completed, will keep this open to track integration.
Just wanted to nudge this. I can see two classes of developers who might have differing perspectives on this issue.
-
Developers active for 4+ years, who have a big stash of testnet coins, and who might have a lot of existing scripts & code which is built around Testnet3.... and who CAN afford testing with testnet fees that look like this:
-
New developers, who currently CAN NOT work on development with LND, due to the impossibility of getting Testnet3 coins.
In our case, we're developing software which uses LND, and we'd like other users and developers to be able to work with it, and although someone graciously sent us some Testnet3 coins to work with, we can't really open our software to other developers and users until they could try it with Testnet4.
One of the biggest challenges with Testnet3 is dealing with the block storms. When developing software for use with LND, trying to diagnose if an issue you are having is because of these block storms is ..... very challenging.... It must be really challenging or downright impossible right now if you are new developer trying to build with LND.....
Testnet4 and Bitcoin Core v28 released
https://github.com/bitcoin/bitcoin/releases/tag/v28.0
https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-28.0.md#testnet4bip94-support
I think I've identified that, during a testnet3 blockstorm, LND won't open channels, which I guess makes sense, because it's not fully synced to the chain. I get the error:
2024-10-05 17:18:14.797 [DBG] FNDG: Failing funding flow for pending_id=9e6a35528e4fba8b489b048fcdd50c584136a93f33437559f9f0ce835215313d: Synchronizing blockchain
@Roasbeef Hi. Giving it a nudge as Testnet4 is now supported by Bitcoin Core 28.0. And testnet3 is now totally unusable with 4000 s/vb fees and no faucets.
I want to throw my hat in the request as well. Currently conducting research for my PhD and am struggling to utilize testnet3 and acquire enough coin to do anything.
Being able to begin populating the testnet4 LN would be hugely advantageous, considering that there exist functioning faucets for it.
Please support testnet4
Adding my nudge here. LND is open-source software, but serious development work is now to some extent closed to new developers unless they are willing to risk real funds on mainnet or find a way to get a big stash of testnet3 coins. On our end we wasted many hours with testnet3 and have now given up and just lowered our expectations about what we can and cannot test.
Adding my nudge here. LND is open-source software, but serious development work is now to some extent closed to new developers unless they are willing to risk real funds on mainnet or find a way to get a big stash of testnet3 coins. On our end we wasted many hours with testnet3 and have now given up and just lowered our expectations about what we can and cannot test.
agreed, https://faucet.lightning.community/ is down, htlc.me is down, and all bitcoin faucets give between 10-20k sats, which is not enough to even pay trx fees, let alone open a channel. There is no way to do any development work on testnet without begging other devs for testnet3 coins.
There are two active PRs working on adding testnet4 support to btcd:
- https://github.com/btcsuite/btcd/pull/2274
- https://github.com/btcsuite/btcd/pull/2275
So far none of them have added the new difficulty adjustment algorithm specific to testnet4, which will be where the bulk of testing+review will be spent, as there're no test vectors for it.
We'll likely focus review on which ever adds it first.
Adding support for this feature, testnet3 is completely unusable now, signet extremely hard to get coins and very limited wallet support. Infrastructure providers need this to give reliable sandboxes to their clients. Happy to help with testing on this one.
There are two active PRs working on adding testnet4 support to
btcd:So far none of them have added the new difficulty adjustment algorithm specific to testnet4, which will be where the bulk of testing+review will be spent, as there're no test vectors for it.
We'll likely focus review on which ever adds it first.
Hello. Btcd has merged support for testnet4
Hello. Btcd has merged support for testnet4
Does this mean everything is finally ready to start working on LND support for testnet4? It's taking a long time; it's difficult to test things in Lightning without a test network...
It's taking a long time;
You're welcome to test and review the two PRs that are required to get this into lnd:
- https://github.com/btcsuite/btcwallet/pull/994
- https://github.com/lightninglabs/neutrino/pull/311
It's taking a long time;
You're welcome to test and review the two PRs that are required to get this into
lnd:
don't know how to test them in isolation from lnd 😕
don't know how to test them in isolation from lnd 😕
Here you go: https://github.com/lightningnetwork/lnd/pull/9620
It's taking a long time; it's difficult to test things in Lightning without a test network...
Testnet3 is still alive and active: https://mempool.space/testnet.
Testnet4 is a thing as well, but seems to not be mining any transactions lately: https://mempool.space/testnet4