Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature]: testnet4 support #8966

Open
Impa10r opened this issue Aug 1, 2024 · 22 comments
Open

[feature]: testnet4 support #8966

Impa10r opened this issue Aug 1, 2024 · 22 comments
Labels
enhancement Improvements to existing features / behaviour

Comments

@Impa10r
Copy link

Impa10r commented Aug 1, 2024

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: btcsuite/btcd#2187

@Impa10r Impa10r added the enhancement Improvements to existing features / behaviour label Aug 1, 2024
@feelancer21
Copy link
Contributor

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.

@Roasbeef
Copy link
Member

Roasbeef commented Aug 1, 2024

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).

@Impa10r
Copy link
Author

Impa10r commented Aug 1, 2024

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.

@Roasbeef
Copy link
Member

Roasbeef commented Aug 2, 2024

One can already build Bitcoin Core from bitcoin/bitcoin#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.

@Impa10r
Copy link
Author

Impa10r commented Aug 2, 2024

Thanks. Forking and upgrading both lnd and btcd sounds too much work ).

@melvincarvalho
Copy link

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

@melvincarvalho
Copy link

There is also an active BIP discussion: bitcoin/bips#1601 (comment)

@melvincarvalho
Copy link

BIP-94 (Testnet4) is now merged

https://github.com/bitcoin/bips/blob/master/bip-0094.mediawiki

@Impa10r
Copy link
Author

Impa10r commented Aug 3, 2024

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

@melvincarvalho
Copy link

testnet4 is now merged into bitcoin master. It is anticipated that testnet3 will be deprecated and removed in future versions.

bitcoin/bitcoin#29775

@Roasbeef
Copy link
Member

Roasbeef commented Aug 9, 2024

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.

@Impa10r Impa10r closed this as completed Aug 10, 2024
@Roasbeef Roasbeef changed the title [feature]: Any ETA on testnet4 support? [feature]: testnet4 support Aug 12, 2024
@Roasbeef
Copy link
Member

Not completed, will keep this open to track integration.

@Roasbeef Roasbeef reopened this Aug 12, 2024
@MegalithicBTC
Copy link

MegalithicBTC commented Sep 10, 2024

Just wanted to nudge this. I can see two classes of developers who might have differing perspectives on this issue.

  1. 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:
    image

  2. 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.

@MegalithicBTC
Copy link

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.....

image

@twofaktor
Copy link
Contributor

twofaktor commented Oct 5, 2024

@MegalithicBTC
Copy link

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

@Impa10r
Copy link
Author

Impa10r commented Oct 30, 2024

@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.

@allenwillan
Copy link

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.

@p2pskins
Copy link

Please support testnet4

@MegalithicBTC
Copy link

MegalithicBTC commented Nov 12, 2024

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.

@p2pskins
Copy link

p2pskins commented Nov 12, 2024

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.

@Roasbeef
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvements to existing features / behaviour
Projects
None yet
Development

No branches or pull requests

8 participants