Commit Graph

23097 Commits

Author SHA1 Message Date
MarcoFalke
57d5246c2d Merge #16503: Remove p2pEnabled from Chain interface
b7b9f6e4cee262004643e2fe03d56cb47fdbf5c2 Remove p2pEnabled from Chain interface (Antoine Riard)

Pull request description:

  RPC server starts in warmup mode, it can't process yet calls, then follows connection manager initialization and finally RPC server get out of warmup mode. RPC calls shouldn't be able to get P2P disabled errors because once we initialize g_connman it's not unset until shutdown, after RPC server has been stopped.

  @mzumsande comment in #15713 let me thought that `p2pEnabled` was maybe useless, `g_connman` is always initialized before RPC server is getting out of warmup. These checks against P2P state were introduced in 5b446dd5b1.

ACKs for top commit:
  promag:
    ACK b7b9f6e4cee262004643e2fe03d56cb47fdbf5c2
  jnewbery:
    ACK b7b9f6e4cee262004643e2fe03d56cb47fdbf5c2

Tree-SHA512: 4de2b9fc496bf8347ff5cc645848a5a44c8ca7596cd134f17f3088f5f8262d1d88b8e2a052df93e309ec9a81956a808df17a9eb9f10d4f4d693c95d607fe3561
2023-04-04 12:45:27 -05:00
MarcoFalke
7eb273dda1 Merge #16535: test: Explain why -whitelist is used in feature_fee_estimation
fa76285fddac613c518e73b35a7486ad2ab4b992 test: Explain why -whitelist is used in feature_fee_estimation (MarcoFalke)
faff85a69a5eb0fdfd8d9a24bc27d1812e49a152 test: Format feature_fee_estimation with pep8 (MarcoFalke)

Pull request description:

ACKs for top commit:
  practicalswift:
    ACK fa76285fddac613c518e73b35a7486ad2ab4b992 -- diff looks correct
  Sjors:
    ACK fa76285, every bit of clarification helps. It's clear that without `-whitelist` the test becomes extremely slow (it does pass).

Tree-SHA512: 13ec7e4cd0409e7bb76cbcd344e31c0f612c8ce4a1f1ec6ceaedf345f634bc09786ed38d38920c3469b2862c856ee3e5e42534ef90f531bd8dc83c3db3c06417
2023-04-04 12:45:27 -05:00
Wladimir J. van der Laan
15d37f896f Merge #15906: [wallet] Move min_depth and max_depth to coin control
80ba4241a6773590f6b2c18dae758097b5adc02e extract min & max depth onto coin control (Amiti Uttarwar)

Pull request description:

  - Refactor `AvailableCoins` to pull min & max depths from coin control.
  - Add `m_max_depth` to coin control to support this.

  - Addresses issue https://github.com/bitcoin/bitcoin/issues/15823, see thread for further details.

ACKs for top commit:
  laanwj:
    ACK 80ba4241a6773590f6b2c18dae758097b5adc02e

Tree-SHA512: 8f7c0aa90b3bc3667baf6741b1da2829f3919e1df92ae097d86c6b239f0c024eb410d7100e6251ea8fc49d022fb5a1214bf79b0f8b0014945b7784b2311647d1
2023-04-04 12:45:27 -05:00
PastaPastaPasta
389f9591b6
Merge pull request #5235 from kittywhiskers/chainman_prune
backport: merge bitcoin#19905, #19927, #21025, #20749, #21055, partial #19775, #20750, #21270 (prune g_chainman usage)
2023-04-04 12:42:35 -05:00
Kittywhiskers Van Gogh
24a5552918 partial bitcoin#21270: Prune g_chainman usage in validation-adjacent modules
contains:
- a04aac493fd564894166d58ed4cdfd9ad4f561cb
- d0de61b764fc7e9c670b69d8210705da296dd245
- 46b7f29340acb399fbd2378508a204d8d8ee8fca
- 2afcf24408b4453e4418ebfb326b141f6ea8647c
2023-04-04 12:41:45 -05:00
Kittywhiskers Van Gogh
548e8704c5 merge bitcoin#21055: Prune remaining g_chainman usage in validation functions
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2023-04-04 12:41:45 -05:00
Kittywhiskers Van Gogh
30191be0b1 merge bitcoin#20750: Prune g_chainman usage in mempool-related validation functions 2023-04-04 12:41:45 -05:00
Kittywhiskers Van Gogh
228a7fb4a1 merge bitcoin#20972: Annotate CTxMemPool::check to require cs_main 2023-04-04 12:41:45 -05:00
Kittywhiskers Van Gogh
9d55bd8d1c merge bitcoin#20749: Prune g_chainman usage related to ::LookupBlockIndex 2023-04-04 12:41:45 -05:00
Kittywhiskers Van Gogh
3eb89314da fuzz: remove unused variable in script_bitcoin_consensus 2023-04-04 12:41:45 -05:00
Kittywhiskers Van Gogh
431415a679 merge bitcoin#20828: Introduce CallOneOf helper to replace switch-case 2023-04-04 12:41:45 -05:00
Kittywhiskers Van Gogh
b0b80d0c9c partial bitcoin#19775: Activate segwit in TestChain100Setup
excludes:
- fad84b7e14ff92465bc17bfdaf1362bcffe092f6
2023-04-04 12:41:45 -05:00
Kittywhiskers Van Gogh
6648e9f199 merge bitcoin#21025: Guard all chainstates with cs_main 2023-04-04 12:41:45 -05:00
Kittywhiskers Van Gogh
0d7516e2c2 merge bitcoin#19927: Reduce direct g_chainman usage 2023-04-04 12:41:45 -05:00
Kittywhiskers Van Gogh
bce9b6bc97 merge bitcoin#19905: Remove dead CheckForkWarningConditionsOnNewFork 2023-04-04 12:41:45 -05:00
Konstantin Akimov
bd00a6a2e8 merge #16400: refactor: Rewrite AcceptToMemoryPoolWorker() using smaller parts 2023-04-04 12:41:45 -05:00
Konstantin Akimov
ce3e8072a7 merge #13868: Remove unused fScriptChecks parameter from CheckInputs 2023-04-04 12:41:45 -05:00
UdjinM6
15a9783e52
trivial(doc): fix typos in getrawtransaction and decoderawtransaction help texts (#5290)
## Issue being fixed or feature implemented
fix typos in getrawtransaction and decoderawtransaction help texts

## What was done?
tweak field name to match
https://github.com/dashpay/dash/blob/develop/src/core_write.cpp#L192

## How Has This Been Tested?

## Breaking Changes
n/a

## Checklist:
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e
tests
- [ ] I have made corresponding changes to the documentation

**For repository code-owners and collaborators only**
- [x] I have assigned this pull request to a milestone
2023-04-04 11:11:59 -05:00
UdjinM6
79a5b197b0
refactor/fix: replace expired requests with a new one in RequestQuorumData (#5286)
## Issue being fixed or feature implemented
should fix "qdata: Already received" discouraging issue

the root of the issue is that we remove expired requests on
UpdatedBlockTip which is too late sometimes.

## What was done?
replacing expired requests with a new one in RequestQuorumData kind of
does the same (drops the expired request) but without waiting for
UpdatedBlockTip

## How Has This Been Tested?


## Breaking Changes


## Checklist:
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e
tests
- [ ] I have made corresponding changes to the documentation

**For repository code-owners and collaborators only**
- [ ] I have assigned this pull request to a milestone
2023-04-04 11:07:00 -05:00
UdjinM6
383c0778be
Merge branch 'master' into merge_master_18.2.2 2023-04-03 22:05:47 +03:00
PastaPastaPasta
38b42f676a
Merge pull request #5013 from vijaydasmp/bp21_3
backport: merge bitcoin#18952,18817
2023-04-02 17:02:15 -05:00
MarcoFalke
b35557be97 Merge #18952: test: avoid os-dependant path
8a22fd01140bd957036fc00419b147e4268ae9b1 avoided os-dependant path (Ferdinando M. Ametrano)

Pull request description:

  The current code fails on windows because of the forward slashes; using os.path.join solves the problem and it is in general more robust

ACKs for top commit:
  MarcoFalke:
    ACK 8a22fd01140bd957036fc00419b147e4268ae9b1

Tree-SHA512: 813f27aea33f97c8afac52e716a55fc5d7fb69621023aba99d40df7e1d145e0ec8d1eee49ddd403b219bf0e0e168e0e987b05c78eaef611f744d99bf2fc8bc91
2023-04-02 17:00:24 -05:00
MarcoFalke
6947dfbda6 Merge #18817: doc: Document differences in bitcoind and bitcoin-qt locale handling
ca185cf5a14b16d61814d7172284bc8efcd28b69 doc: Document differences in bitcoind and bitcoin-qt locale handling (practicalswift)

Pull request description:

  Document differences in `bitcoind` and `bitcoin-qt` locale handling.

  Since this seems to be the root cause to the locale dependency issues we've seen over the years I thought it was worth documenting :)

  Note that 1.) `QLocale` (used by Qt), 2.) C locale (used by locale-sensitive C standard library functions/POSIX functions and some parts of the C++ standard library such as `std::to_string`) and 3.) C++ locale (used by the C++ input/output library) are three separate things. This comment is about the perhaps surprising interference with the C locale (2) that takes place as part of the Qt initialization.

ACKs for top commit:
  hebasto:
    re-ACK ca185cf5a14b16d61814d7172284bc8efcd28b69

Tree-SHA512: e51c32f3072c506b0029a001d8b108125e1acb4f2b6a48a6be721ddadda9da0ae77a9b39ff33f9d9eebabe2244c1db09e8502e3e7012d7a5d40d98e96da0dc44
2023-04-02 17:00:24 -05:00
UdjinM6
af25e4886c
Merge pull request #5282 from PastaPastaPasta/backport/bump-to-19-rc9
[v19.x] backport: rc9 backports and version bump
2023-03-30 21:36:14 +03:00
pasta
26873b07c5
chore: bump version to rc.9 2023-03-30 11:48:26 -05:00
Konstantin Akimov
cb7c1f8293
fix: add a missing name for key hdaccounts for RPC help for getwalletinfo (#5280)
## Issue being fixed or feature implemented
RPC help has a wrongly generated RPC help output in CLI and online help:
https://dashcore.readme.io/docs/core-api-ref-remote-procedure-calls-wallet#getwalletinfo

New version:
```
...
"hdaccounts" : [                        (json array)
  {                                     (json object)
    "hdaccountindex" : n,               (numeric) the index of the account
    "hdexternalkeyindex" : n,           (numeric) current external childkey index
    "hdinternalkeyindex" : n            (numeric) current internal childkey index
  },
  ...
],
...
```

against old version:
```
...
"" : [                                  (json array)
  {                                     (json object)
    "hdaccountindex" : n,               (numeric) the index of the account
    "hdexternalkeyindex" : n,           (numeric) current external childkey index
    "hdinternalkeyindex" : n            (numeric) current internal childkey index
  },
  ...
],
...
```



## What was done?
Add a missing name `hdaccounts` for that key for `getwalletinfo` RPC


## How Has This Been Tested?
Run a command `help getwalletinfo` for old and for new versions.


## Breaking Changes
No breaking changes. It doesn't change rpc, only change text description
(help).


## Checklist:
- [x] I have performed a self-review of my own code
- [x] I have assigned this pull request to a milestone
2023-03-30 11:45:37 -05:00
PastaPastaPasta
ed71c6d652
fix: add a bias to IsExpired to avoid potential timing issues where nodeA thinks it's been 300 seconds but nodeB only thinks it's been 295 for some reason (#5276)
## Issue being fixed or feature implemented
add a bias to IsExpired to avoid potential timing issues where nodeA thinks it's been 300 seconds but nodeB only thinks it's been 295 for some reason

## What was done?


## How Has This Been Tested?


## Breaking Changes


## Checklist:
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e
tests
- [ ] I have made corresponding changes to the documentation

**For repository code-owners and collaborators only**
- [x] I have assigned this pull request to a milestone
2023-03-30 11:45:25 -05:00
UdjinM6
1352362fc6
fix(test): bump quorum_data_request_expiration_timeout to fix p2p_quorum_data.py (#5281)
## Issue being fixed or feature implemented
fix `p2p_quorum_data.py` test broken by #5276


## What was done?
adjust data request expiration timeout in tests

## How Has This Been Tested?
`./test/functional/test_runner.py p2p_quorum_data.py`

## Breaking Changes
n/a

## Checklist:
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [x] I have added or updated relevant unit/integration/functional/e2e
tests
- [ ] I have made corresponding changes to the documentation

**For repository code-owners and collaborators only**
- [x] I have assigned this pull request to a milestone
2023-03-30 11:45:15 -05:00
UdjinM6
6e00fd0605
fix(test): bump quorum_data_request_expiration_timeout to fix p2p_quorum_data.py (#5281)
## Issue being fixed or feature implemented
fix `p2p_quorum_data.py` test broken by #5276


## What was done?
adjust data request expiration timeout in tests

## How Has This Been Tested?
`./test/functional/test_runner.py p2p_quorum_data.py`

## Breaking Changes
n/a

## Checklist:
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [x] I have added or updated relevant unit/integration/functional/e2e
tests
- [ ] I have made corresponding changes to the documentation

**For repository code-owners and collaborators only**
- [x] I have assigned this pull request to a milestone
2023-03-30 11:45:02 -05:00
Odysseas Gabrielides
8b21e2dbe9
log: Add logs when send qgetdata (#5275)
## Issue being fixed or feature implemented


## What was done?
Added logs with requested parameters (`llmqType`, `quorumHash`,
`proRegTx`) when sending `qgetdata` for better troubleshooting.

## How Has This Been Tested?


## Breaking Changes


## Checklist:
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e
tests
- [ ] I have made corresponding changes to the documentation

**For repository code-owners and collaborators only**
- [x] I have assigned this pull request to a milestone
2023-03-30 11:44:03 -05:00
Odysseas Gabrielides
5bffe3fdae
fix: hpmn adjustements to getprojectedmnpayees (#5274)
## Issue being fixed or feature implemented
`GetProjectedMNPayees` wasn't projecting MN payees correctly.

## What was done?
HPMNs are now added 4 times before sorting the return list.
In addition, the case of last payee being HPMN and having still pending
payments is handled.


## How Has This Been Tested?
Tested on Masternodes / Next Payment tab on Qt client on Testnet.

## Breaking Changes


## Checklist:
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e
tests
- [ ] I have made corresponding changes to the documentation

**For repository code-owners and collaborators only**
- [x] I have assigned this pull request to a milestone
2023-03-30 11:43:54 -05:00
Odysseas Gabrielides
80ebf47618
feat(rpc): Added RPC cleardiscouraged (#5273)
## Issue being fixed or feature implemented


## What was done?
Added RPC `cleardiscouraged` which clears internally the list of
discouraged peers.

Note: Implementation of a `listdiscouraged` RPC is not possible because
the internal data structure used for discouraged peers is a Bloom
filter.

## How Has This Been Tested?

## Breaking Changes


## Checklist:
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e
tests
- [x] I have made corresponding changes to the documentation

**For repository code-owners and collaborators only**
- [x] I have assigned this pull request to a milestone
2023-03-30 11:43:47 -05:00
Odysseas Gabrielides
bcb65a217d
fix(net): Do not punish nodes when Quorum data are missing. (#5272)
## Issue being fixed or feature implemented
Currently, we store internally the nodes that already requested
`QGETDATA` for the same Quorum.
If data for the same Quorum is requested twice from the same `proRegTx`,
then the requester is P2P misbehaved.

## What was done?
Some data like `VerificationVector` and `EncryptedContributions` are not
instantly available.
This PR does not misbehave nodes for requesting data that weren't
available when asked.

## How Has This Been Tested?


## Breaking Changes


## Checklist:
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e
tests
- [ ] I have made corresponding changes to the documentation

**For repository code-owners and collaborators only**
- [x] I have assigned this pull request to a milestone
2023-03-30 11:43:36 -05:00
PastaPastaPasta
38c1ee7509
log: add a log for invalid mnauth (#5271)
## Issue being fixed or feature implemented
We are seeing lots of "invalid mnauth" on testnet.. We should be logging
this anyhow

## What was done?
Add some logging the the mnauth sig isn't valid

## How Has This Been Tested?
make check

## Breaking Changes
None

## Checklist:
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e
tests
- [ ] I have made corresponding changes to the documentation

**For repository code-owners and collaborators only**
- [x] I have assigned this pull request to a milestone
2023-03-30 11:43:25 -05:00
PastaPastaPasta
1a96a98481
fix: add a bias to IsExpired to avoid potential timing issues where nodeA thinks it's been 300 seconds but nodeB only thinks it's been 295 for some reason (#5276)
## Issue being fixed or feature implemented
add a bias to IsExpired to avoid potential timing issues where nodeA thinks it's been 300 seconds but nodeB only thinks it's been 295 for some reason

## What was done?


## How Has This Been Tested?


## Breaking Changes


## Checklist:
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e
tests
- [ ] I have made corresponding changes to the documentation

**For repository code-owners and collaborators only**
- [x] I have assigned this pull request to a milestone
2023-03-30 10:24:44 -05:00
Odysseas Gabrielides
2d89442d89
fix: hpmn adjustements to getprojectedmnpayees (#5274)
## Issue being fixed or feature implemented
`GetProjectedMNPayees` wasn't projecting MN payees correctly.

## What was done?
HPMNs are now added 4 times before sorting the return list.
In addition, the case of last payee being HPMN and having still pending
payments is handled.


## How Has This Been Tested?
Tested on Masternodes / Next Payment tab on Qt client on Testnet.

## Breaking Changes


## Checklist:
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e
tests
- [ ] I have made corresponding changes to the documentation

**For repository code-owners and collaborators only**
- [x] I have assigned this pull request to a milestone
2023-03-30 10:06:47 -05:00
Odysseas Gabrielides
f4b91c08a6
fix(net): Do not punish nodes when Quorum data are missing. (#5272)
## Issue being fixed or feature implemented
Currently, we store internally the nodes that already requested
`QGETDATA` for the same Quorum.
If data for the same Quorum is requested twice from the same `proRegTx`,
then the requester is P2P misbehaved.

## What was done?
Some data like `VerificationVector` and `EncryptedContributions` are not
instantly available.
This PR does not misbehave nodes for requesting data that weren't
available when asked.

## How Has This Been Tested?


## Breaking Changes


## Checklist:
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e
tests
- [ ] I have made corresponding changes to the documentation

**For repository code-owners and collaborators only**
- [x] I have assigned this pull request to a milestone
2023-03-30 10:05:15 -05:00
Konstantin Akimov
08aa10c8cb
fix: add a missing name for key hdaccounts for RPC help for getwalletinfo (#5280)
## Issue being fixed or feature implemented
RPC help has a wrongly generated RPC help output in CLI and online help:
https://dashcore.readme.io/docs/core-api-ref-remote-procedure-calls-wallet#getwalletinfo

New version:
```
...
"hdaccounts" : [                        (json array)
  {                                     (json object)
    "hdaccountindex" : n,               (numeric) the index of the account
    "hdexternalkeyindex" : n,           (numeric) current external childkey index
    "hdinternalkeyindex" : n            (numeric) current internal childkey index
  },
  ...
],
...
```

against old version:
```
...
"" : [                                  (json array)
  {                                     (json object)
    "hdaccountindex" : n,               (numeric) the index of the account
    "hdexternalkeyindex" : n,           (numeric) current external childkey index
    "hdinternalkeyindex" : n            (numeric) current internal childkey index
  },
  ...
],
...
```



## What was done?
Add a missing name `hdaccounts` for that key for `getwalletinfo` RPC


## How Has This Been Tested?
Run a command `help getwalletinfo` for old and for new versions.


## Breaking Changes
No breaking changes. It doesn't change rpc, only change text description
(help).


## Checklist:
- [x] I have performed a self-review of my own code
- [x] I have assigned this pull request to a milestone
2023-03-30 09:49:22 -05:00
UdjinM6
7a850daaec
Merge pull request #5199 from knst/bc-bp-missing-2
backport: bitcoin#14734, #15709, #15718, #16250, #16267, #16325, #16334, #16352, #16464
2023-03-29 21:03:07 +03:00
MeshCollider
211faa9c29 Merge #15709: wallet: Do not add "setting" key as unknown
914923d125f5d17b39b4dc05f666d130e80a68b2 Add setting as known type (Peter Bushnell)

Pull request description:

  When loading old wallets I get "Unknown wallet records" showing up in the log file. The key that is adding to the unknown record count is "setting", this is a known key removed in the 0.6 release of Bitcoin in the commit linked below. The "setting" key is not known to the wallet anymore, like "acentry" which is not added as an unknown record, but the "setting" key was used in previous versions of Bitcoin.

  972060ce0e (diff-8094838580e1bb7a3bb8fc78dcebc733)

ACKs for top commit:
  laanwj:
    ACK 914923d125f5d17b39b4dc05f666d130e80a68b2, this code change is straightforward enough and I don't think it makes sense to warn about this key being present.
  meshcollider:
    ACK 914923d125f5d17b39b4dc05f666d130e80a68b2

Tree-SHA512: 6346690c05cebae2dcd868512322bf5250f6fbd07abb5e747065444185d3f69e19e1a99e3f38d6e34535ffd6979b2297100ba9c7da8e45ca792598eded5ae0d3
2023-03-29 21:01:56 +03:00
MarcoFalke
e246892fd7 Merge #16464: [qa] Ensure we don't generate a too-big block in p2sh sigops test
bf3be5297a746982cf8e83f45d342121e5665f80 [qa] Ensure we don't generate a too-big block in p2sh sigops test (Suhas Daftuar)

Pull request description:

  There's a bug in the loop that is calculating the block size in the p2sh sigops test -- we start with the size of the block when it has no transactions, and then increment by the size of each transaction we add, without regard to the changing size of the encoding for the number of transactions in the block.

  This might be fine if the block construction were deterministic, but the first transaction in the block has an ECDSA signature which can be variable length, so we see intermittent failures of this test when the initial transaction has a 70-byte signature and the block ends up being one byte too big.

  Fix this by double-checking the block size after construction.

ACKs for top commit:
  jonasschnelli:
    utACK bf3be5297a746982cf8e83f45d342121e5665f80
  jnewbery:
    tested ACK bf3be5297a746982cf8e83f45d342121e5665f80

Tree-SHA512: f86385b96f7a6feafa4183727f5f2c9aae8ad70060b574aad13b150f174a17ce9a0040bc51ae7a04bd08f2a5298b983a84b0aed5e86a8440189ebc63b99e64dc
2023-03-29 21:01:56 +03:00
Wladimir J. van der Laan
ddd8e2f45b Merge #16334: test: rpc_users: Also test rpcauth.py with password.
e263a343d4b6a2622df6bb734cd9d51a0d20a663 test: rpc_users: Make variable names more clear. (Carl Dong)
830dc2dd0fccb7f3ec49ff7233a188d92c541e7e test: rpc_users: Also test rpcauth.py with specified password. (Carl Dong)
c73d871799982ca29c29cef90e1a78814cf34019 test: rpc_users: Add function for testing auth params. (Carl Dong)
604e2a997ff26202dd0fa1932d60dc14cc53ac6d test: rpc_users: Add function for auth'd requests. (Carl Dong)

Pull request description:

  Fixes #14758

  First two commits are tidy-ups which I feel are worthwhile as they are very straightforward, cut down the file by 50%, and made the final diff more minimal. Happy to squash after review.

ACKs for top commit:
  laanwj:
    ACK e263a343d4b6a2622df6bb734cd9d51a0d20a663

Tree-SHA512: aa75c48570a87060238932d4c68e17234e158077f6195fb4917367e1ecc565e3cd8dd0ae51f9159ddd3d03742739680391bc1246454302db22d4a608c0633e80
2023-03-29 21:01:56 +03:00
Wladimir J. van der Laan
906dd71de0 Merge #16267: bench: Benchmark blockToJSON
91509ffe247b0eacbf84214c7c9c3f8a0012f2eb bench: Benchmark blockToJSON (Kirill Fomichev)

Pull request description:

  Related:
  - "getblock performance issue on verbosity" https://github.com/bitcoin/bitcoin/issues/15925
  - "refactor: Avoid UniValue copy constructor" #15974

ACKs for top commit:
  laanwj:
    ACK 91509ffe247b0eacbf84214c7c9c3f8a0012f2eb

Tree-SHA512: e70b12cb31921c7527bde334f52f39776da698b6bbdb196079a8b68478c67585a5bd7bed7403f65166bd604f7ed60778c53dc064d743bb8368318a1283d1073e
2023-03-29 21:01:56 +03:00
Wladimir J. van der Laan
4459e60acc Merge #16352: build: prune dbus from depends
e8fabd9253400a7c3fe45b34bc572eb00ff5522d build: prune dbus from depends (fanquake)

Pull request description:

  Since #8210 (59d063d076), we've been passing `-dbus-runtime` when configuring Qt.

  ```
  qtbase-opensource-src-5.9.7 $ ./configure -h | grep -i dbus
    -no-dbus ............. Do not build the Qt D-Bus module
    -dbus-linked ......... Build Qt D-Bus and link to libdbus-1 [auto]
    -dbus-runtime ........ Build Qt D-Bus and dynamically load libdbus-1 [no]
  ```

  This means we don't actually seem to be using the `D-Bus` we build in depends. This was pointed out by theuni at the time, [here](https://github.com/bitcoin/bitcoin/pull/7993#issuecomment-223114395) and [here](https://github.com/bitcoin/bitcoin/pull/8210#issuecomment-226930545), but was never followed up. dongcarl also bought it up as part of #16150.

  I've tested building and running `bitcoin-qt` using depends on Debian. Needs further testing.

ACKs for top commit:
  laanwj:
    code review ACK e8fabd9253400a7c3fe45b34bc572eb00ff5522d

Tree-SHA512: 164e6e52b6f97c04aef42bd185e2a157bc1a42103840f9404c5a795749f45a8c2c35f35873395a3a56398b3cd5955496b90d9c885d929b434c9bc871695abe20
2023-03-29 21:01:56 +03:00
Wladimir J. van der Laan
13ac152c9b Merge #16325: rpc: Clarify that block count means height excl genesis
fab0c820fa4c0c3227eec85c64310a3bf938a149 rpc: Clarify that block count means height excl genesis (MarcoFalke)

Pull request description:

  There is a common misconception that the block count returned by the blockchain rpcs includes the genesis block. See for example the discussion in https://github.com/bitcoin/bitcoin/pull/16292#issuecomment-506303256.

  However, it really returns the height, which is `0` for the genesis block.

  So clarify that and also remove the misleading "longest blockchain" comment.

  Finally, fix the wallet test that incorrectly used this rpc.

ACKs for top commit:
  instagibbs:
    utACK fab0c820fa
  promag:
    ACK fab0c82, sorry for the misconception.

Tree-SHA512: 0d087cbb628d3866352bca6420402f392e6a997e579941701a408a7fca355d84645045661f39b022e4479cc07f85a6cddaa9095b6fd9911b245692482420a5e4
2023-03-29 21:01:56 +03:00
Wladimir J. van der Laan
914946301c Merge #14734: fix an undefined behavior in uint::SetHex
0f459d868d85053f1cc066ea9099793f88cbd655 fix an undefined behavior in uint::SetHex (Kaz Wesley)

Pull request description:

  Decrementing psz beyond the beginning of the string is UB, even though
  the out-of-bounds pointer is never dereferenced.

  I don't think any clang sanitizer covers this, so I don't see any way a test could catch the original behavior.

ACKs for top commit:
  promag:
    utACK 0f459d8.
  l2a5b1:
    utACK 0f459d868d85053f1cc066ea9099793f88cbd655

Tree-SHA512: 388223254ea6e955f643d2ebdf74d15a3d494e9f0597d9f05987ebb708d7a1cc06ce64bd25d447d75b5f5561bdae9630dcf25adb7bd75f7a382298b95d127162
2023-03-29 21:01:56 +03:00
MarcoFalke
57e3060ec8 Merge #16250: signrawtransactionwithkey: report error when missing redeemScript/witnessScript
01174596e69568c434198a86f54cb9ea6740e6c2 signrawtransactionwithkey: report error when missing redeemScript/witnessScript param (Anthony Towns)

Pull request description:

  Adding support for "witnessScript" as an alternative to "redeemScript" when using "signrawtransactionwithkey" meant that the `RPCTypeCheckObj()` call in `SignTransaction` can't error out just because either parameter is missing -- it's only a problem if both are missing, which isn't a state `RPCTypeCheckObj()` tests for. This results in the regression described in #16249. This patch adds some code to test for this case and give a similar error, namely:

      error code: -8
      error message:
      Missing redeemScript/witnessScript

  Fixes: #16249

ACKs for top commit:
  meshcollider:
    utACK 01174596e6
  promag:
    ACK 01174596e. Could also write test without `dict`/`del`:

Tree-SHA512: cf51346b7dea551b7f18f2a93c2a336a293b2535c62c03a5263cd2be8c58cf0cc302891da659c167e88ad1a68a756472c3c07e99f71627c61d32886fc5a3a353
2023-03-29 21:01:56 +03:00
Konstantin Akimov
238e585f9d Merge #15718: docs: Improve netaddress comments
303372c41a8d5c58a46cf9ed595e30e67bd0bc99 docs: Improve netaddress comments (Carl Dong)

Pull request description:

  Improves comments for `netaddress`, making them available to Doxygen.

  I think this is worthwhile because a lot of the code require some context (e.g., A lot of the things that we do to fit hostnames and tor addresses into `CNetAddr` is non-obvious, and documenting it is beneficial).

ACKs for commit 303372:

Tree-SHA512: 2a35784a01ed8ec5fdbe111a540192d31bde16afa96e4be97b0385daf290fc7469a66d7cb8905a70b920fad6a0e7400ca4e5da082d6e4af1d1aaccc0e8297720
2023-03-29 21:01:56 +03:00
PastaPastaPasta
376f78d8aa
format: fix indentation (#5277)
## Issue being fixed or feature implemented
Indentation was wrong

## What was done?


## How Has This Been Tested?


## Breaking Changes


## Checklist:
<!--- Go over all the following points, and put an `x` in all the boxes
that apply. -->
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e
tests
- [ ] I have made corresponding changes to the documentation

**For repository code-owners and collaborators only**
- [x] I have assigned this pull request to a milestone
2023-03-29 11:24:16 -05:00
Odysseas Gabrielides
5456be6780
feat(rpc): Added RPC cleardiscouraged (#5273)
## Issue being fixed or feature implemented


## What was done?
Added RPC `cleardiscouraged` which clears internally the list of
discouraged peers.

Note: Implementation of a `listdiscouraged` RPC is not possible because
the internal data structure used for discouraged peers is a Bloom
filter.

## How Has This Been Tested?

## Breaking Changes


## Checklist:
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e
tests
- [x] I have made corresponding changes to the documentation

**For repository code-owners and collaborators only**
- [x] I have assigned this pull request to a milestone
2023-03-29 11:23:45 -05:00