Walletwasabi: Don't use Bitcoin Core when incompatible version is detected.

Created on 2 Feb 2020  路  5Comments  路  Source: zkSNACKs/WalletWasabi

This would allow us to fail to use breaking Core versions.

https://github.com/zkSNACKs/WalletWasabi/issues/3037#issuecomment-581153303

featurenhancement

Most helpful comment

Additionally, here's a trick I use to look for changed APIs between releases so that I can document them; I think this could also help you identify breaking changes.

## On the old version of Bitcoin Core
bitcoin-cli help | grep '^[a-z]' | cut -f1 -d' ' | xargs -i bitcoin-cli help '{}' > old-rpc-docs.txt

## On the new version of Bitcoin Core (or master, or whatever)
bitcoin-cli help | grep '^[a-z]' | cut -f1 -d' ' | xargs -i bitcoin-cli help '{}' > new-rpc-docs.txt

diff -u old-rpc-docs.txt new-rpc-docs.txt | colordiff | less -R

This tells you about any differences in the built-in RPC documentation, and that documentation should always be updated to reflect changes in the RPC behavior in the same PR that makes the behavior change (though sometimes this is missed; if so, it's a bug).

All 5 comments

$ bitcoin-cli getnetworkinfo | jq .version
190001

Additionally, here's a trick I use to look for changed APIs between releases so that I can document them; I think this could also help you identify breaking changes.

## On the old version of Bitcoin Core
bitcoin-cli help | grep '^[a-z]' | cut -f1 -d' ' | xargs -i bitcoin-cli help '{}' > old-rpc-docs.txt

## On the new version of Bitcoin Core (or master, or whatever)
bitcoin-cli help | grep '^[a-z]' | cut -f1 -d' ' | xargs -i bitcoin-cli help '{}' > new-rpc-docs.txt

diff -u old-rpc-docs.txt new-rpc-docs.txt | colordiff | less -R

This tells you about any differences in the built-in RPC documentation, and that documentation should always be updated to reflect changes in the RPC behavior in the same PR that makes the behavior change (though sometimes this is missed; if so, it's a bug).

Thank you, this is great!

New specification of the issue.

  • [ ] Write RPC tests for getnetworkinfo's version. (And implement it if NBitcoin doesn't have it.) @jmacato can you do this? It would be beneficial for you to start learning about non-UI things, too. It's easy btw, if you want we can do it in a pair programming manner.
  • [ ] Block RPC if Core isn't compatible. - This will be me.

@nopara73 I'd like to take a shot at this after #3024 :D

@jmacato, NBitcoin RPCClient class contains a ScanRPCCapabilitiesAsync method that makes a couple of rpc calls against the Bitcoin node in order to learn what that node supports and what it does not. ScanRPCCapabilitiesAsync method returns a RPCCapabilities instances which contains the Version property so:

c# var capabilities = await global.BitcoinCoreNode.RpcClient.ScanRPCCapabilitiesAsync(); var nodeVersion= capabilities.Version;

Was this page helpful?
0 / 5 - 0 ratings

Related issues

yahiheb picture yahiheb  路  3Comments

yahiheb picture yahiheb  路  3Comments

yahiheb picture yahiheb  路  3Comments

MaxHillebrand picture MaxHillebrand  路  3Comments

UkolovaOlga picture UkolovaOlga  路  3Comments