bitcoin/src
W. J. van der Laan 8346004ac8
Merge bitcoin/bitcoin#23077: Full CJDNS support
420695c193 contrib: recognize CJDNS seeds as such (Vasil Dimov)
f9c28330a0 net: take the first 4 random bits from CJDNS addresses in GetGroup() (Vasil Dimov)
29ff79c0a2 net: relay CJDNS addresses even if we are not connected to CJDNS (Vasil Dimov)
d96f8d304c net: don't skip CJDNS from GetNetworkNames() (Vasil Dimov)
c2d751abba net: take CJDNS into account in CNetAddr::GetReachabilityFrom() (Vasil Dimov)
9b43b3b257 test: extend feature_proxy.py to test CJDNS (Vasil Dimov)
508eb258fd test: remove default argument of feature_proxy.py:node_test() (Vasil Dimov)
6387f397b3 net: recognize CJDNS addresses as such (Vasil Dimov)
e6890fcb44 net: don't skip CJDNS from GetNetworksInfo() (Vasil Dimov)
e9d90d3c11 net: introduce a new config option to enable CJDNS (Vasil Dimov)
78f456c576 net: recognize CJDNS from ParseNetwork() (Vasil Dimov)
de01e312b3 net: use -proxy for connecting to the CJDNS network (Vasil Dimov)
aedd02ef27 net: make it possible to connect to CJDNS addresses (Vasil Dimov)

Pull request description:

  CJDNS overview
  =====

  CJDNS is like a distributed, shared VPN with multiple entry points where every participant can reach any other participant. All participants use addresses from the `fc00::/8` network (reserved IPv6 range). Installation and configuration is done outside of applications, similarly to VPN (either in the host/OS or on the network router).

  Motivation
  =====

  Even without this PR it is possible to connect two Bitcoin Core nodes through CJDNS manually by using e.g. `-addnode` in environments where CJDNS is set up. However, this PR is necessary for address relay to work properly and automatic connections to be made to CJDNS peers. I.e. to make CJDNS a first class citizen network like IPv4, IPv6, Tor and I2P.

  Considerations
  =====

  An address from the `fc00::/8` network, could mean two things:
  1. Part of a local network, as defined in RFC 4193. Like `10.0.0.0/8`. Bitcoin Core could be running on a machine with such address and have peers with those (e.g. in a local network), but those addresses are not relayed to other peers because they are not globally routable on the internet.
  2. Part of the CJDNS network. This is like Tor or I2P - if we have connectivity to that network then we could reach such peers and we do relay them to other peers.

  So, Bitcoin Core needs to be able to tell which one is it when it encounters a bare `fc00::/8` address, e.g. from `-externalip=` or by looking up the machine's own addresses. Thus a new config option is introduced `-cjdnsreacable`:
  * `-cjdnsreacable=0`: it is assumed a `fc00::/8` address is a private IPv6 (1.)
  * `-cjdnsreacable=1`: it is assumed a `fc00::/8` address is a CJDNS one (2.)

  After setting up CJDNS outside of Bitcoin Core, a node operator only needs to enable this option.
  Addresses from P2P relay/gossip don't need that because they are properly tagged as IPv6 or as CJDNS.

  For testing
  =====
  ```
  [fc32:17ea:e415:c3bf:9808:149d:b5a2:c9aa]:8333
  [fc68:7026:cb27:b014:5910:e609:dcdb:22a2]:8333
  [fcb3:dc50:e1ae:7998:7dc0:7fa6:4582:8e46]:8333
  [fcc7:be49:ccd1:dc91:3125:f0da:457d:8ce]:8333
  [fcf2:d9e:3a25:4eef:8f84:251b:1b4d:c596]:8333
  ```

ACKs for top commit:
  dunxen:
    ACK 420695c
  jonatack:
    re-ACK 420695c193 per `git range-diff 23ae793 4fbff39 420695c`
  laanwj:
    Code review ACK 420695c193

Tree-SHA512: 21559886271aa84671d52b120fa3fa5a50fdcf0fcb26e5b32049c56fab0d606438d19dd366a9c8ce612d3894237ae6d552ead3338b326487e3534399b88a317a
2021-11-08 14:44:37 +01:00
..
bench scripted-diff: disable unimplemented ArgsManager BOOL/INT/STRING flags 2021-10-25 10:44:17 -04:00
common scripted-diff: Move bloom to src/common 2021-10-05 11:10:37 +02:00
compat
config
consensus Add comment to COIN constant. 2021-10-16 13:35:57 -07:00
crc32c Update crc32c subtree 2021-09-29 14:10:29 +02:00
crypto Fix K1/K2 use in the comments in ChaCha20-Poly1305 AEAD 2021-10-20 11:54:03 +05:30
index Fix outdated comments referring to ::ChainActive() 2021-10-12 14:36:51 +13:00
init Merge bitcoin/bitcoin#23006: multiprocess: Add new bitcoin-gui, bitcoin-qt, bitcoin-wallet init implementations 2021-10-26 15:54:52 +01:00
interfaces Merge bitcoin/bitcoin#23003: multiprocess: Make interfaces::Chain::isTaprootActive non-const 2021-10-13 07:19:13 +02:00
ipc refactor: Block unsafe fs::path std::string conversion calls 2021-10-05 11:10:47 -04:00
leveldb
logging
node [mempool] delete exists(uint256) function 2021-10-21 16:26:59 +01:00
policy Merge bitcoin/bitcoin#22949: fee: Round up fee calculation to avoid a lower than expected feerate 2021-11-05 00:08:00 +13:00
primitives Make GenTxid boolean constructor private 2021-10-22 12:32:16 +02:00
qt Merge bitcoin/bitcoin#22787: refactor: actual immutable pointing 2021-10-29 10:52:37 +02:00
rpc net: don't skip CJDNS from GetNetworksInfo() 2021-11-03 14:58:49 +01:00
script [MOVEONLY] consensus: move amount.h into consensus 2021-09-30 07:41:57 +08:00
secp256k1
support refactor: remove references to deprecated values under std::allocator 2021-10-20 18:36:40 -04:00
test Merge bitcoin/bitcoin#23077: Full CJDNS support 2021-11-08 14:44:37 +01:00
univalue Update univalue subtree to latest upstream 2021-10-11 20:45:56 +08:00
util scripted-diff: disable unimplemented ArgsManager BOOL/INT/STRING flags 2021-10-25 10:44:17 -04:00
wallet Merge bitcoin/bitcoin#23409: refactor: Take Span in SetSeed 2021-11-08 12:48:25 +01:00
zmq scripted-diff: Rename overloaded int GetArg to GetIntArg 2021-09-27 06:57:20 -04:00
.clang-format
.clang-tidy
Makefile.am Merge bitcoin/bitcoin#23006: multiprocess: Add new bitcoin-gui, bitcoin-qt, bitcoin-wallet init implementations 2021-10-26 15:54:52 +01:00
Makefile.bench.include
Makefile.crc32c.include build: remove support for weak linking getauxval() 2021-09-24 15:40:04 +08:00
Makefile.leveldb.include build: remove build stubs for external leveldb 2021-10-15 01:02:45 +00:00
Makefile.qt.include build: Fix `make apk` if ccache enabled 2021-11-08 07:19:10 +02:00
Makefile.qt_locale.include
Makefile.qttest.include
Makefile.test.include fuzz: Add wallet fuzz test 2021-10-22 12:43:18 +02:00
Makefile.test_fuzz.include
Makefile.test_util.include
Makefile.univalue.include Integrate univalue into our buildsystem 2021-10-11 20:46:25 +08:00
addrdb.cpp refactor: Block unsafe fs::path std::string conversion calls 2021-10-05 11:10:47 -04:00
addrdb.h scripted-diff: Rename CAddrMan to AddrMan 2021-09-28 22:21:10 -04:00
addrman.cpp Merge bitcoin/bitcoin#23380: addrman: Fix AddrMan::Add() return semantics and logging 2021-11-01 10:58:27 +08:00
addrman.h [addrman] Add Add_() inner function, fix Add() return semantics 2021-10-28 14:00:21 +01:00
addrman_impl.h Merge bitcoin/bitcoin#23380: addrman: Fix AddrMan::Add() return semantics and logging 2021-11-01 10:58:27 +08:00
arith_uint256.cpp
arith_uint256.h
attributes.h
banman.cpp
banman.h scripted-diff: Move bloom to src/common 2021-10-05 11:10:37 +02:00
base58.cpp
base58.h
bech32.cpp
bech32.h
bitcoin-cli-res.rc
bitcoin-cli.cpp scripted-diff: disable unimplemented ArgsManager BOOL/INT/STRING flags 2021-10-25 10:44:17 -04:00
bitcoin-tx-res.rc
bitcoin-tx.cpp bitcoin-tx: Reject non-integral and out of range multisig numbers 2021-10-12 12:45:55 +02:00
bitcoin-util-res.rc
bitcoin-util.cpp
bitcoin-wallet-res.rc
bitcoin-wallet.cpp Merge bitcoin/bitcoin#22766: refactor: Clarify and disable unused ArgsManager flags 2021-11-01 11:25:42 +08:00
bitcoind-res.rc
bitcoind.cpp Add syscall sandboxing (seccomp-bpf) 2021-10-01 13:51:10 +00:00
blockencodings.cpp
blockencodings.h
blockfilter.cpp
blockfilter.h
chain.cpp
chain.h Merge bitcoin/bitcoin#13875: [doc] nChainTx needs to become a 64-bit earlier due to SegWit 2021-10-20 15:52:08 +02:00
chainparams.cpp Use absolute FQDN for DNS seed domains 2021-10-14 17:49:52 +05:30
chainparams.h
chainparamsbase.cpp scripted-diff: disable unimplemented ArgsManager BOOL/INT/STRING flags 2021-10-25 10:44:17 -04:00
chainparamsbase.h
chainparamsseeds.h
checkqueue.h Add syscall sandboxing (seccomp-bpf) 2021-10-01 13:51:10 +00:00
clientversion.cpp
clientversion.h
coins.cpp
coins.h
compat.h
compressor.cpp
compressor.h
core_io.h rpc: Add level 3 verbosity to getblock RPC call. 2021-10-05 10:42:34 +02:00
core_memusage.h
core_read.cpp bitcoin-tx: Avoid treating overflow as OP_0 2021-10-11 09:17:28 +02:00
core_write.cpp core_write: Rename calculate_fee to have_undo for clarity 2021-10-05 10:42:34 +02:00
cuckoocache.h
dbwrapper.cpp Merge bitcoin/bitcoin#22937: refactor: Forbid calling unsafe fs::path(std::string) constructor and fs::path::string() method 2021-10-15 10:01:56 +02:00
dbwrapper.h
deploymentinfo.cpp
deploymentinfo.h
deploymentstatus.cpp
deploymentstatus.h
dummywallet.cpp Remove -rescan startup parameter 2021-09-30 12:06:27 +13:00
external_signer.cpp
external_signer.h
flatfile.cpp refactor: Block unsafe fs::path std::string conversion calls 2021-10-05 11:10:47 -04:00
flatfile.h
fs.cpp refactor: include a missing <limits> header in fs.cpp 2021-10-22 04:03:45 +03:00
fs.h refactor: Block unsafe fs::path std::string conversion calls 2021-10-05 11:10:47 -04:00
hash.cpp refactor: use `{Read,Write}BE32` helpers for BIP32 nChild (de)serialization 2021-10-05 23:53:33 +02:00
hash.h
httprpc.cpp
httprpc.h
httpserver.cpp Merge bitcoin/bitcoin#20487: Add syscall sandboxing using seccomp-bpf (Linux secure computing mode) 2021-10-04 22:45:43 +02:00
httpserver.h
i2p.cpp refactor: Block unsafe fs::path std::string conversion calls 2021-10-05 11:10:47 -04:00
i2p.h
indirectmap.h
init.cpp net: introduce a new config option to enable CJDNS 2021-11-03 14:58:48 +01:00
init.h
key.cpp refactor: Take Span in SetSeed 2021-11-01 14:20:56 +01:00
key.h refactor: Take Span in SetSeed 2021-11-01 14:20:56 +01:00
key_io.cpp
key_io.h
logging.cpp blockstorage: use debug log category 2021-10-11 21:45:49 +10:00
logging.h blockstorage: use debug log category 2021-10-11 21:45:49 +10:00
mapport.cpp Add syscall sandboxing (seccomp-bpf) 2021-10-01 13:51:10 +00:00
mapport.h
memusage.h
merkleblock.cpp
merkleblock.h style: Sort 2021-10-05 11:11:18 +02:00
miner.cpp [MOVEONLY] consensus: move amount.h into consensus 2021-09-30 07:41:57 +08:00
miner.h
net.cpp net: recognize CJDNS addresses as such 2021-11-03 14:58:50 +01:00
net.h Merge bitcoin/bitcoin#22735: [net] Don't return an optional from TransportDeserializer::GetMessage() 2021-11-02 13:40:09 +01:00
net_permissions.cpp
net_permissions.h
net_processing.cpp Merge bitcoin/bitcoin#23157: txmempool -/-> validation 1/2: improve performance of check() and remove dependency on validation 2021-10-25 15:21:27 +02:00
net_processing.h scripted-diff: Rename CAddrMan to AddrMan 2021-09-28 22:21:10 -04:00
net_types.cpp
net_types.h
netaddress.cpp net: take the first 4 random bits from CJDNS addresses in GetGroup() 2021-11-03 14:58:54 +01:00
netaddress.h net: relay CJDNS addresses even if we are not connected to CJDNS 2021-11-03 14:58:53 +01:00
netbase.cpp net: don't skip CJDNS from GetNetworkNames() 2021-11-03 14:58:53 +01:00
netbase.h
netmessagemaker.h
noui.cpp
noui.h
outputtype.cpp
outputtype.h
pow.cpp
pow.h
prevector.h
protocol.cpp Make GenTxid boolean constructor private 2021-10-22 12:32:16 +02:00
protocol.h
psbt.cpp
psbt.h
pubkey.cpp refactor: use `{Read,Write}BE32` helpers for BIP32 nChild (de)serialization 2021-10-05 23:53:33 +02:00
pubkey.h
random.cpp
random.h
randomenv.cpp build: remove support for weak linking getauxval() 2021-09-24 15:40:04 +08:00
randomenv.h
rest.cpp Merge bitcoin/bitcoin#22918: rpc: Add level 3 verbosity to getblock RPC call (#21245 modified) 2021-10-19 15:47:53 +02:00
reverse_iterator.h
scheduler.cpp Add syscall sandboxing (seccomp-bpf) 2021-10-01 13:51:10 +00:00
scheduler.h
serialize.h
shutdown.cpp
shutdown.h
signet.cpp
signet.h
span.h
streams.h
sync.cpp log: Avoid broken DEBUG_LOCKORDER log 2021-09-29 18:46:30 +02:00
sync.h
threadinterrupt.cpp
threadinterrupt.h
threadsafety.h
timedata.cpp scripted-diff: Rename overloaded int GetArg to GetIntArg 2021-09-27 06:57:20 -04:00
timedata.h
tinyformat.h
torcontrol.cpp refactor: Block unsafe fs::path std::string conversion calls 2021-10-05 11:10:47 -04:00
torcontrol.h
txdb.cpp scripted-diff: Rename overloaded int GetArg to GetIntArg 2021-09-27 06:57:20 -04:00
txdb.h
txmempool.cpp Merge bitcoin/bitcoin#23211: refactor: move `update_*` structs from txmempool.h to .cpp file 2021-11-03 08:59:03 +01:00
txmempool.h Merge bitcoin/bitcoin#23211: refactor: move `update_*` structs from txmempool.h to .cpp file 2021-11-03 08:59:03 +01:00
txorphanage.cpp
txorphanage.h
txrequest.cpp Make GenTxid boolean constructor private 2021-10-22 12:32:16 +02:00
txrequest.h
uint256.cpp
uint256.h
undo.h
validation.cpp Merge bitcoin/bitcoin#23157: txmempool -/-> validation 1/2: improve performance of check() and remove dependency on validation 2021-10-25 15:21:27 +02:00
validation.h Merge bitcoin/bitcoin#23157: txmempool -/-> validation 1/2: improve performance of check() and remove dependency on validation 2021-10-25 15:21:27 +02:00
validationinterface.cpp
validationinterface.h
version.h
versionbits.cpp
versionbits.h
walletinitinterface.h
warnings.cpp
warnings.h