Commit Graph

31320 Commits

Author SHA1 Message Date
John Newbery
dfbd3a6d71 [addrman] [tests] Remove AddrManCorrupted subclass
It's only used to create a corrupted peers.dat file. We can do that directly
in a pure function.
2021-11-09 17:09:50 +00:00
John Newbery
d02098d1f0 [addrman] [tests] Tidy up unused arguments in addrman test functions 2021-11-09 17:09:50 +00:00
John Newbery
7784a9a374 [addrman] [tests] Remove deterministic argument and member from AddrManTest
It's always set to true.
2021-11-09 17:09:50 +00:00
John Newbery
a749fa539a [addrman] Remove AddrMan friends
AddrMan's friends both inherit from AddrMan, so just make the private
member protected and remove the friends.
2021-11-09 17:09:50 +00:00
W. J. van der Laan
e70fb87a4f
Merge bitcoin/bitcoin#23381: validation/refactor: refactoring for package submission
14cd7bf793 [test] call CheckPackage for package sanitization checks (glozow)
6876378365 MOVEONLY: move package unit tests to their own file (glozow)
c9b1439ca9 MOVEONLY: mempool checks to their own functions (glozow)
9e910d8152 scripted-diff: clean up MemPoolAccept aliases (glozow)
fd92b0c398 document workspace members (glozow)
3d3e4598b6 [validation] cache iterators to mempool conflicts (glozow)
36a8441912 [validation/rpc] cache + use vsize calculated in PreChecks (glozow)
8fa2936b34 [validation] re-introduce bool for whether a transaction is RBF (glozow)
cbb3598b5c [validation/refactor] store precomputed txdata in workspace (glozow)
0a79eaba72 [validation] case-based constructors for ATMPArgs (glozow)

Pull request description:

  This contains the refactors and moves within #22674. There are no behavior changes, so it should be simpler to review.

ACKs for top commit:
  ariard:
    Code Review ACK 14cd7bf
  jnewbery:
    Code review ACK 14cd7bf793
  laanwj:
    Code review ACK 14cd7bf793, thanks for adding documentation and clarifying the code
  t-bast:
    Code Review ACK 14cd7bf793

Tree-SHA512: 580ed48b43713a3f9d81cd9b573ef6ac44efe5df2fc7b7b7036c232b52952b04bf5ea92940cf73739f4fbd54ecf980cef58032e8a2efe05229ad0b3c639de8a0
2021-11-09 16:46:23 +01:00
W. J. van der Laan
cb4adbd8ab
Merge bitcoin/bitcoin#22934: Add verification to Sign, SignCompact and SignSchnorr
79fd28cacb Adds verification step to Schnorr and ECDSA signing (amadeuszpawlik)

Pull request description:

  As detailed in #22435, BIP340 defines that during Schnorr signing a verification should be done. This is so that potentially corrupt signage does not leak information about private keys used during the process. This is not followed today as no such verification step is being done. The same is valid for ECDSA signing functions `Sign` and `SignCompact`.
  This PR adds this missing verification step to `SignSchnorr`, `Sign` and `SignCompact`.

ACKs for top commit:
  sipa:
    utACK 79fd28cacb
  laanwj:
    Code review ACK 79fd28cacb
  theStack:
    re-ACK 79fd28cacb

Tree-SHA512: 8fefa26caea577ae8631cc16c4e2f4cc6cfa1c7cf51d45a4a34165636ee290950617a17a19b4237c6f7a841db0e40fd5c36ad12ef43da82507c0e9fb9375ab82
2021-11-09 14:12:41 +01:00
W. J. van der Laan
55dd385524
Merge bitcoin/bitcoin#23414: wallet: Fix comment grammar in bdb.h
bd9c6ade46 wallet: Fixed Grammatical error in bdb.h (zealsham)

Pull request description:

  A comment in bdb.h file in the wallet directory contains a grammatical error that makes the underlying code harder to reason about .
  The comment which says `/** Indicate the a new database user has began using the database. */` should actually be
  `/** indicate that a new database user has began using the database. */`. The former is quite confusing , and leaves you wondering what "the a new database user " is refering to . This pull request thus provides value to the bitcoin codebase by improving readability .

Top commit has no ACKs.

Tree-SHA512: db07cda39f89ac344be3497c884a8c6e4b48276afae18e931a9a8e5732c58eed20645ccd18d6b1212c763f64b1300477c1de26a00b5b3b24e6141ffae3658ca7
2021-11-09 13:50:24 +01:00
zealsham
bd9c6ade46 wallet: Fixed Grammatical error in bdb.h
Wallet: Fixed Grammatical error  in bdb.h
2021-11-09 12:41:37 +01:00
MarcoFalke
94db963de5
Merge bitcoin/bitcoin#23300: test: Implicitly sync after generate*, unless opted out
facc352648 test: Implicitly sync after generate*, unless opted out (MarcoFalke)

Pull request description:

  The most frequent failure in functional tests are intermittent races. Fixing such bugs is cumbersome because it involves:
  * Noticing the failure
  * Fetching and reading the log to determine the test case that failed
  * Adding a `self.sync_all()` where it was forgotten
  * Spamming out a pr and waiting for review, which is already sparse

  Also, writing a linter to catch those is not possible, nor is review effective in finding these bugs prior to merge.

  Fix all future intermittent races caused by a missing sync_block call by calling `sync_all` implicitly after each `generate*`, unless opted out. This ensures that the code is race-free (with regards to blocks) when the tests pass once, instead of our current approach where the code can never be guaranteed to be race-free.

  There are some scripted-diff cleanups (see https://github.com/bitcoin/bitcoin/pull/22567), but they will be submitted in a follow-up to reduce the conflicts in this pull.

ACKs for top commit:
  lsilva01:
    tACK facc352 on Ubuntu 20.04
  brunoerg:
    tACK facc352648 on MacOS 11.6

Tree-SHA512: 046a40a066b4a3bd28a3077bd654fa8887442dd1f0ec6fd11671865809ef02376f126eb667a1320ebd67b6e372c78c00dbf8bd25d86ed86f1d9a25363103ed97
2021-11-09 09:58:51 +01:00
MarcoFalke
49143477e7
Merge bitcoin/bitcoin#23469: doc: Remove Boost build note from build-unix.md
ea360d69e5 doc: remove redundant optionals from build-unix.md (fanquake)
b97185812e doc: remove Boost build note from build-unix.md (fanquake)

Pull request description:

  We don't have build instructions for any other dependency, and in any case, this isn't something we should maintain in our docs. If someone wants to know how to build Boost, or any other dependency, they can look at the relevant website / external build documentation.

ACKs for top commit:
  jarolrod:
    ACK ea360d69e5

Tree-SHA512: c7389b5f051f79c728d8ea0725143affeb2c35b1e3c20d5cd441c6ac540d230698c47bf2c57feb12e7b6bffd2f337c1c83a9cd3a928ce5c479cdbbdf8f61fba4
2021-11-09 09:52:30 +01:00
fanquake
ea360d69e5
doc: remove redundant optionals from build-unix.md
Calling dependencies optional in a list of already optional dependencies
is redundant.
2021-11-09 07:50:43 +08:00
fanquake
b97185812e
doc: remove Boost build note from build-unix.md
We don't do this for any other dependency, and users are better looking
at the actual Boost site/docs. This isn't something we should need to
have in our build docs.
2021-11-09 07:50:38 +08:00
fanquake
c702d1fefd
Merge bitcoin/bitcoin#23466: doc: Suggest keys.openpgp.org as keyserver in SECURITY.md
90f1f849e9 doc: Suggest `keys.openpgp.org` as keyserver in SECURITY.md (Tim Ruffing)

Pull request description:

  `--recv-keys` without a `--keyserver` arg simply failed for me on a fresh Arch Linux installation, so I think it's a good idea to suggest a keyserver. OpenPGP ecosystem is broken in a number of ways, so the right way to approach this issue has some potential for bikeshedding. But the only thing that this PR does is to keep `SECURITY.md` in line with the instructions for builder keys, where there was agreement on switching to `keys.openpgp.org` (#22688).

ACKs for top commit:
  MarcoFalke:
    review ACK 90f1f849e9
  laanwj:
    Review ACK 90f1f849e9
  hebasto:
    ACK 90f1f849e9, agree with arguments above.
  Zero-1729:
    ACK 90f1f849e9

Tree-SHA512: 1ab20c837cd952aa32b57473772cbfd33411a08db6e88b951bce38f76a3c509c0e91d6944ec0ca5eac8d5eb4d98a5489276d55691328f2e2556b2640f8e7c108
2021-11-09 06:40:53 +08:00
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
W. J. van der Laan
aecc08f62e
Merge bitcoin/bitcoin#23409: refactor: Take Span in SetSeed
fa93ef5a8a refactor: Take Span in SetSeed (MarcoFalke)

Pull request description:

  This makes calling code less verbose and less fragile. Also, by adding
  the CKey::data() member function, it is now possible to call HexStr()
  with a CKey object.

ACKs for top commit:
  sipa:
    utACK fa93ef5a8a
  laanwj:
    Code review ACK fa93ef5a8a
  theStack:
    Code-review ACK fa93ef5a8a

Tree-SHA512: 73fb999320719ad4b9ab5544018a7a083d140545c2807ee3582ecf7f441040a30b5157e85790b6b840af82f002a7faf30bd8162ebba5caaf2067391c43dc7e25
2021-11-08 12:48:25 +01:00
Tim Ruffing
90f1f849e9 doc: Suggest keys.openpgp.org as keyserver in SECURITY.md
This is in line with 4c43b7d41d from
PR #22688.
2021-11-08 12:22:04 +01:00
MarcoFalke
c86f546f98
Merge bitcoin/bitcoin#23458: ci: Do not print git log for empty COMMIT_RANGE
095f07744c ci: Do not print `git log` for empty COMMIT_RANGE (Hennadii Stepanov)

Pull request description:

  On master (77a2f5d30c) a CI lint task [log](https://api.cirrus-ci.com/v1/task/4817858858319872/logs/lint.log) exceeds 20K lines.

  This PR fixes this issue.

ACKs for top commit:
  MarcoFalke:
    cr ACK 095f07744c

Tree-SHA512: 89180018aeccf1599cdf218924cbab12dcbae0f6674bb90e13b64e342cdd908a880b885039c23f0d1d03493e55a94fe04abf39481616ae6550c6a759f5ca9a35
2021-11-08 09:32:11 +01:00
MarcoFalke
f075e83b81
Merge bitcoin/bitcoin#23439: test: Open streams_test_tmp file in temporary folder
a04350b86c Open streams_test_tmp file in temporary folder (Martin Leitner-Ankerl)

Pull request description:

  The tests `streams_tests/streams_buffered_file` and `streams_tests/streams_buffered_file_rand`
  did not use a the temporary directory provided by  `BasicTestingSetup`, so it was not possible
  to execute multiple of them in parallel. This fixes that.

  To reproduce, run

  ```sh
  parallel --halt now,fail=1 './src/test/test_bitcoin --run_test=streams_tests/streams_buffered_file_rand' -- ::: {1..1000}
  ```

  This executes the test 1000 times, one job per CPU. It works on that commit but mergebase fails quickly.

ACKs for top commit:
  theStack:
    Tested ACK a04350b86c

Tree-SHA512: 705b127e99a0fdbf33362283cc94036ac3aeff364a5e75b0f0a2490114bbaa44cf310ac13d43c254a4b51b72d4e856e9ee584904ce56b2f496b92d995ac7dc24
2021-11-08 09:28:10 +01:00
fanquake
ed40f37e00
Merge bitcoin/bitcoin#22076: build: Fix make apk if ccache enabled, and enable it on CI
15fb57556e ci: Enable ccache for "ARM64 Android APK" job (Hennadii Stepanov)
7a777ec98c build: Fix `make apk` if ccache enabled (Hennadii Stepanov)

Pull request description:

  On master (456c8d6cd8) `make apk` is broken for Android targets if the build system was configured with `--enable-ccache` explicitly or by default.

  This PR fixes this bug, and enables `ccache` for "ARM64 Android APK" Cirrus CI job.

ACKs for top commit:
  fanquake:
    ACK 15fb57556e

Tree-SHA512: e3c94dccc9f07a712e0e01983462ee607122623b213173c74d17e91024243239de212a35e5db94036bfd0a347e727b133865c26c67d6bd279604416ea971ab94
2021-11-08 15:58:48 +08:00
fanquake
ddc90293c1
Merge bitcoin/bitcoin#23464: doc: remove mention of system univalue from build-unix.md
78e36700a0 doc: remove mention of system univalue (fanquake)

Pull request description:

  Should have been part of #22646.

ACKs for top commit:
  hebasto:
    ACK 78e36700a0

Tree-SHA512: a5d54d73526033825ce4467cc3c57c26064739eef546556975a4c6f1f5bea84004640acd426734f90f98bc7a76ec837d716aa31167f2bdce7ee3887ad92e3152
2021-11-08 15:43:47 +08:00
fanquake
170e2687ba
Merge bitcoin/bitcoin#23446: doc: Mention that BerkeleyDB is for legacy wallet in build-unix
7eb5b25e6e doc: Mention that BerkeleyDB is for legacy wallet in build-unix (W. J. van der Laan)

Pull request description:

  This updates build-unix for the descriptor wallet, and prepares for eventual legacy wallet deprecation.

  - Move 'descriptor wallet' dependencies above legacy wallet deps both for Debian and Fedora.
  - Explicitly mention 'legacy wallet' where referring to the BerkeleyDB wallet. Shorten BerkeleyDB instruction to a single paragraph.

ACKs for top commit:
  lsilva01:
    ACK 7eb5b25
  hebasto:
    ACK 7eb5b25e6e, I have reviewed the code and it looks OK, I agree it can be merged.

Tree-SHA512: 8a0859bfaf170a1c5a8b3e8f873d6b788f3b1cebd8d006569348c5b415d5ebbdfd56a5a294c509114975addb599da8a50c4be618b0545ff402065e948f692ba1
2021-11-08 15:42:23 +08:00
Hennadii Stepanov
15fb57556e
ci: Enable ccache for "ARM64 Android APK" job 2021-11-08 07:19:21 +02:00
Hennadii Stepanov
7a777ec98c
build: Fix make apk if ccache enabled 2021-11-08 07:19:10 +02:00
fanquake
78e36700a0
doc: remove mention of system univalue
Should have been part of #22646.
2021-11-08 10:06:40 +08:00
fanquake
f21ce0bbbe
Merge bitcoin/bitcoin#23450: doc: update SECURITY.md inline with recent changes to bitcoincore.org
e7c0d506d5 doc: update SECURITY.md inline with recent changes to bitcoincore.org (fanquake)

Pull request description:

  See https://github.com/bitcoin-core/bitcoincore.org/pull/809 and https://github.com/bitcoin-core/bitcoincore.org/pull/819 and https://bitcoincore.org/en/contact/.

ACKs for top commit:
  laanwj:
    ACK e7c0d506d5, also checked that fingerprint matches
  kristapsk:
    ACK e7c0d506d5, checked that fingerprint matches.
  Zero-1729:
    ACK e7c0d506d5, fingerprint matches.

Tree-SHA512: 24aeb5c107db55a006b848bfd2c0f644219975acbd21f30749aff6a506832471d43de388100bbb195d48bca6f799e95e6fd2c54e06fc26c1a051bdcfb3db0982
2021-11-08 09:47:33 +08:00
fanquake
12f2b6ac01
Merge bitcoin/bitcoin#23453: Remove the build_msvc/testconsensus project
bb1c84082c Remove the build_msvc/testconsensus project (Aaron Clauson)

Pull request description:

  The testconsensus project is not integral to the Bitcoin Core code. It was originally added as a quick and dirty demo of how to do a consensus check with the msvc build. There are better examples.

  PR #23438 made a change that caused a compiler error with the buildmsvc/testconsensus code. Rather than leave it hanging around to incur potential bitrot, or further PR build failures, it should be removed.

ACKs for top commit:
  hebasto:
    ACK bb1c84082c, tested on Windows 10 Pro (20H2).

Tree-SHA512: d81b99eb09171b66c179961b15f0b2e2e97e5ee7f011f18667e890c90e3d169593ad9aedd05a8616e962212952048827b7159d3c2a2ecb7ac378136b80bf6b23
2021-11-08 09:43:48 +08:00
Hennadii Stepanov
095f07744c
ci: Do not print git log for empty COMMIT_RANGE 2021-11-07 17:04:06 +02:00
Aaron Clauson
bb1c84082c
Remove the build_msvc/testconsensus project
The testconsensus project is not integral to the Bitcoin Core code. It was originally added as a quick and dirty demo of how to do a consensus check with the msvc build. There are better examples.

PR #23438 made a change that caused a compiler error with the buildmsvc/testconsensus code. Rather than leave it hanging around to incur potential bitrot, or furhter PR build failures, it should be removed.
2021-11-06 21:32:34 +00:00
fanquake
e7c0d506d5
doc: update SECURITY.md inline with recent changes to bitcoincore.org
See https://github.com/bitcoin-core/bitcoincore.org/pull/809 and
https://github.com/bitcoin-core/bitcoincore.org/pull/819 and
https://bitcoincore.org/en/contact/.
2021-11-06 18:05:07 +08:00
W. J. van der Laan
7eb5b25e6e doc: Mention that BerkeleyDB is for legacy wallet in build-unix
This updates build-unix for the descriptor wallet, and prepares for
eventual legacy wallet deprecation.

- Move 'descriptor wallet' dependencies above legacy wallet deps both
for Debian and Fedora.
- Explicitly mention 'legacy wallet' where referring to the BerkeleyDB
wallet. Shorten BerkeleyDB instruction to a single paragraph.
2021-11-05 19:27:17 +01:00
MarcoFalke
77a2f5d30c
Merge bitcoin/bitcoin#23334: fuzz: Descriptor wallet
11115169a1 ci: Build fuzz with libsqlite3-dev (MarcoFalke)
fa7c6efca6 fuzz: Add wallet fuzz test (MarcoFalke)
fa59d2ce5b refactor: Use local args instead of global gArgs in CWallet::Create (MarcoFalke)
fadb44606f build: Inline FUZZ_SUITE_LDFLAGS_COMMON (MarcoFalke)

Pull request description:

  Initial sketch to fuzz descriptor wallets. Can be improved in the future.

ACKs for top commit:
  mjdietzx:
    Code review ACK 1111516

Tree-SHA512: b1d2f24504d1ed5f3c6a031210f04c27c13d4e15576c4acbf50ded37ac45f7b7a5c7553e91d81d4a06e9ea73b3d745a552218d3ef3b2932fa5325a8331b0d3fd
2021-11-05 10:29:21 +01:00
glozow
14cd7bf793 [test] call CheckPackage for package sanitization checks
Makes the test more minimal. We're just trying to test that our package
sanitization logic is correct. Now that this code lives in its own
function (rather than inside of AcceptMultipleTransactions), there's no
need to call ProcessNewPackage to test this.
2021-11-04 14:55:12 -04:00
glozow
6876378365 MOVEONLY: move package unit tests to their own file 2021-11-04 14:55:12 -04:00
glozow
c9b1439ca9 MOVEONLY: mempool checks to their own functions
No change in behavior, because package transactions would not be going
through the rbf logic in PreChecks anyway (BIP125 is currently disabled
for package acceptance, see ATMPArgs).

We draw the line here because each individual transaction in package
validation still goes through all PreChecks. For example, checking that
one's own conflicts and dependencies are disjoint (a consensus check)
and individual transaction mempool ancestor/descendant limits.
2021-11-04 14:55:12 -04:00
glozow
9e910d8152 scripted-diff: clean up MemPoolAccept aliases
The aliases are leftover from a previous MOVEONLY refactor - they are
unnecessary and removing them reduces the diff for splitting out mempool
Checks from PreChecks, making RBF variables MemPoolAccept-wide, etc.

-BEGIN VERIFY SCRIPT-

unalias() { sed -i "s:\<$1\>:$2:g" src/validation.cpp; sed -i "/$2 = $2/d" src/validation.cpp; }

unalias nModifiedFees 		  ws.m_modified_fees
unalias nConflictingFees      	  ws.m_conflicting_fees
unalias nConflictingSize          ws.m_conflicting_size
unalias setConflicts 	          ws.m_conflicts
unalias allConflicting		  ws.m_all_conflicting
unalias setAncestors	          ws.m_ancestors

-END VERIFY SCRIPT-
2021-11-04 14:54:03 -04:00
Martin Leitner-Ankerl
a04350b86c
Open streams_test_tmp file in temporary folder
The tests `streams_tests/streams_buffered_file` and `streams_tests/streams_buffered_file_rand`
did not use a the temporary directory provided by  `BasicTestingSetup`, so it was not possible
to execute multiple of them in parallel. This fixes that.

To reproduce, run

```sh
parallel --halt now,fail=1 './src/test/test_bitcoin --run_test=streams_tests/streams_buffered_file_rand' -- ::: {1..1000}
```

This executes the test 1000 times, one job per CPU. It works on that commit but mergebase fails quickly.
2021-11-04 18:47:14 +01:00
glozow
fd92b0c398 document workspace members 2021-11-04 12:38:13 -04:00
glozow
3d3e4598b6 [validation] cache iterators to mempool conflicts 2021-11-04 12:38:11 -04:00
Samuel Dobson
24abd8312e
Merge bitcoin/bitcoin#22949: fee: Round up fee calculation to avoid a lower than expected feerate
80dc829be7 tests: Calculate fees more similarly to CFeeRate::GetFee (Andrew Chow)
ce2cc44afd tests: Test for assertion when feerate is rounded down (Andrew Chow)
0fbaef9676 fees: Always round up fee calculated from a feerate (Andrew Chow)

Pull request description:

  When calculating the fee for a feerate, it is possible that the final calculation will have fractional satoshis. Currently those are ignored via truncation which results in the absolute fee being rounded down. Rounding down is problematic because it results in a feerate that is slightly lower than the feerate represented by the `CFeeRate` object. A slightly lower feerate particularly causes issues for coin selection as it can trigger an assertion error. To avoid potentially underpaying the feerate (and the assertion), always round up the calculated fee.

  A test is added for the assertion, along with a comment explaining what happens.

  It is unlikely that a user can trigger this as it requires a very specific set of rounding errors to occur as well as the transaction not needing any change and being right on the lower bound of the exact match window. However I was able to trigger the assertion while running coin selection simulations, albeit after thousands of transactions and with some weird feerates.

ACKs for top commit:
  ryanofsky:
    Code review ACK 80dc829be7
  promag:
    Tested ACK 80dc829be7.
  lsilva01:
    tACK 80dc829
  meshcollider:
    utACK 80dc829be7

Tree-SHA512: fe26684c60f236cab48ea6a4600c141ce766dbe59504ec77595dcbd7fd0b34559acc617007f4f499c9155d8fda0a336954413410ba862b19c765c0cfac79d642
2021-11-05 00:08:00 +13:00
Vasil Dimov
420695c193
contrib: recognize CJDNS seeds as such
An IPv6 address from fc00::/8 could be either from the CJDNS network or
from a private-unroutable-reserved segment of IPv6. A seed node with
such an address must be from the CJDNS network, otherwise other peers
will not be able to connect to it.
2021-11-03 14:58:55 +01:00
Vasil Dimov
f9c28330a0
net: take the first 4 random bits from CJDNS addresses in GetGroup()
CJDNS addresses start with constant 8 bits, so in order to account for
the first 4 random ones, we must take the first 12. Otherwise the entire
CJDNS network will belong to one group.
2021-11-03 14:58:54 +01:00
Vasil Dimov
29ff79c0a2
net: relay CJDNS addresses even if we are not connected to CJDNS
This will help with propagation, so that multi-homed nodes can learn
CJDNS addresses outside of the CJDNS network.
2021-11-03 14:58:53 +01:00
Vasil Dimov
d96f8d304c
net: don't skip CJDNS from GetNetworkNames() 2021-11-03 14:58:53 +01:00
Vasil Dimov
c2d751abba
net: take CJDNS into account in CNetAddr::GetReachabilityFrom()
This way `GetLocal()` will pick our CJDNS address for a CJDNS peer.
2021-11-03 14:58:52 +01:00
Vasil Dimov
9b43b3b257
test: extend feature_proxy.py to test CJDNS 2021-11-03 14:58:51 +01:00
Vasil Dimov
508eb258fd
test: remove default argument of feature_proxy.py:node_test()
The default bool argument makes it harder to read because the last but
one argument is also bool. Pass all of them as named arguments to
increase readability.

Another bool argument will be added to indicate whether to test CJDNS.

Co-authored-by: Jon Atack <jon@atack.com>
2021-11-03 14:58:50 +01:00
Vasil Dimov
6387f397b3
net: recognize CJDNS addresses as such
In some cases addresses come from an external source as a string or as a
`struct sockaddr_in6`, without a tag to tell whether it is a private
IPv6 or a CJDNS address. In those cases interpret the address as a CJDNS
address instead of an IPv6 address if `-cjdnsreachable` is set and the
seemingly-IPv6-address belongs to `fc00::/8`. Those external sources are:

* `-externalip=`
* `-bind=`
* UPnP
* `getifaddrs(3)` (called through `-discover`)
* `addnode`
* `connect`
* incoming connections (returned by `accept(2)`)
2021-11-03 14:58:50 +01:00
Vasil Dimov
e6890fcb44
net: don't skip CJDNS from GetNetworksInfo() 2021-11-03 14:58:49 +01:00
Vasil Dimov
e9d90d3c11
net: introduce a new config option to enable CJDNS
CJDNS is set up in the host OS, outside of the application. When the
routing is configured properly then connecting to fc00::/8 results in
connecting to the CJDNS network.

Introduce an option so that Bitcoin Core knows whether this is the case.
2021-11-03 14:58:48 +01:00
Vasil Dimov
78f456c576
net: recognize CJDNS from ParseNetwork()
This allows to use "cjdns" as an argument to the `getnodeaddresses` RPC
and to the `-onlynet=` parameter.
2021-11-03 14:41:14 +01:00