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

Fix "Bitcoin Knots doesn't work" issue #9714

Merged
merged 3 commits into from
Dec 8, 2022

Conversation

nopara73
Copy link
Contributor

@nopara73 nopara73 commented Dec 8, 2022

This PR disables wallet for Bitcoin Knots when starting it. The reasons are the following:

  1. We don't need it.
  2. It probably makes startup faster.
  3. It makes Knots work on my machine.

Let me elaborate on point (3):

I recently changed computers and noticed Wasabi Wallet cannot start Bitcoin Knots. It fails with the following message:

2022-12-08 11:14:49.945 [22] ERROR	Global.StartLocalBitcoinNodeAsync (272)	WalletWasabi.BitcoinCore.Processes.BitcoindException: Failed to start daemon, location: 'C:\Users\user\Desktop\WalletWasabi\WalletWasabi.Fluent.Desktop\bin\Debug\net7.0\Microservices\Binaries\win64\bitcoind.exe -regtest=0 -testnet=0 -datadir="C:\Users\user\AppData\Roaming\Bitcoin" -printtoconsole=0'
 ---> System.Net.Http.HttpRequestException: No connection could be made because the target machine actively refused it. (127.0.0.1:8332)
 ---> System.Net.Sockets.SocketException (10061): No connection could be made because the target machine actively refused it.
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
   at System.Net.Sockets.Socket.<ConnectAsync>g__WaitForConnectWithCancellation|281_0(AwaitableSocketAsyncEventArgs saea, ValueTask connectTask, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.AddHttp11ConnectionAsync(QueueItem queueItem)
   at System.Threading.Tasks.TaskCompletionSourceWithCancellation`1.WaitWithCancellationAsync(CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.HttpConnectionWaiter`1.WaitForConnectionAsync(Boolean async, CancellationToken requestCancellationToken)
   at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
   at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
   at NBitcoin.RPC.RPCClient.SendCommandAsync(RPCRequest request, CancellationToken cancellationToken)
   at NBitcoin.RPC.RPCClient.UptimeAsync(CancellationToken cancellationToken)
   at WalletWasabi.BitcoinCore.Rpc.RpcClientBase.UptimeAsync(CancellationToken cancellationToken) in WalletWasabi\BitcoinCore\Rpc\RpcClientBase.cs:line 131
   at WalletWasabi.BitcoinCore.Processes.BitcoindRpcProcessBridge.StartAsync(CancellationToken cancel) in WalletWasabi\BitcoinCore\Processes\BitcoindRpcProcessBridge.cs:line 71
   --- End of inner exception stack trace ---
   at WalletWasabi.BitcoinCore.Processes.BitcoindRpcProcessBridge.StartAsync(CancellationToken cancel) in WalletWasabi\BitcoinCore\Processes\BitcoindRpcProcessBridge.cs:line 91
   at WalletWasabi.BitcoinCore.CoreNode.CreateAsync(CoreNodeParams coreNodeParams, CancellationToken cancel) in WalletWasabi\BitcoinCore\CoreNode.cs:line 242
   at WalletWasabi.Fluent.Global.StartLocalBitcoinNodeAsync(CancellationToken cancel) in WalletWasabi.Fluent\Global.cs:line 247

So I checked Bitcoin Knots' logs and found this to be the reason why it fails to start:

2022-12-08T10:14:46Z Error: Unknown address type 'bech32m'

My theory is that Wasabi ships older Knots version (LTS) than what I have installed on my computer (I won't check it, don't even ask. A good programmer maximizes work not done.)
So figured if that's the case, then I should just disable the wallet and it should work. And it did. We should do this anyway as elaborated in (1) and (2).

This change should make Wasabi's full node more robust against future Bitcoin Core changes.

@pull-request-size pull-request-size bot added size/S and removed size/XS labels Dec 8, 2022
Copy link
Collaborator

@kiminuo kiminuo left a comment

Choose a reason for hiding this comment

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

utACK

@lontivero lontivero merged commit 2d56ce0 into WalletWasabi:master Dec 8, 2022
Copy link
Collaborator

@molnard molnard left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants