Commit Graph

22143 Commits

Author SHA1 Message Date
fanquake
0fe885f5de Merge #16383: rpcwallet: default include_watchonly to true for watchonly wallets
72eaab073bc747425fe551777154b13a6c4c37c9 tests: functional watch-only wallet tests (William Casarin)
72ffbdc5799c1707ecad674d701b43fb80b031d0 doc: add release note for include_watchonly default changes (William Casarin)
003a3c73c0450aa18ac2ab2ca47def2b8c53a7df rpcwallet: document include_watchonly default for watchonly wallets (William Casarin)
a50d9e6c0b8e8144d3deec58ec2e3449ba081151 rpcwallet: default include_watchonly to true for watchonly wallets (William Casarin)

Pull request description:

  Right now it's a bit annoying to deal with watchonly wallets, many rpc commands have an `include_watchonly` argument that needs to be explicitly set.

  Wallets created with `createwallet` can have a `disable_private_keys` parameter, for those wallets we already know that they are watchonly, so there's no reason to have to explicitly ask for it for every command. Instead we check this wallet flag when the `include_watchonly` parameter isn't set.

ACKs for top commit:
  achow101:
    Code review ACK 72eaab073bc747425fe551777154b13a6c4c37c9
  Sjors:
    ACK 72eaab073bc747425fe551777154b13a6c4c37c9
  promag:
    ACK 72eaab073bc747425fe551777154b13a6c4c37c9, code review only, didn't look closely to the test.
  kallewoof:
    ACK 72eaab073bc747425fe551777154b13a6c4c37c9
  fanquake:
    ACK 72eaab073bc747425fe551777154b13a6c4c37c9 - I've looked over the changes, they make sense to me. Compiled and ran the tests etc.

Tree-SHA512: d3646b55e97f386594d7efc994f0712f3888475c6a5dc7f131ac9f8c49bf5d4677182b88f42b34152abe1ad101ecadd152b4c20e9d3c1267190db36f77ab8bd7
2022-08-14 20:18:21 +07:00
PastaPastaPasta
8773a21b30
chore: enable DIP0024 hard fork on mainnet (#4968) 2022-08-13 23:25:53 +03:00
UdjinM6
efd96178e4
translations: Add final v18 updates for ar, de and zh_CN (#4962)
NOTE: these files were made by running `./contrib/devtools/update-translations.py` on v18.x branch
2022-08-13 11:32:00 -05:00
PastaPastaPasta
a78cccd355
chore: bump ChainTxData for mainnet and testnet (#4961)
mainnet
```
getchaintxstats
{
  "time": 1660074878,
  "txcount": 43702293,
  "window_final_block_hash": "0000000000000002ee5a0d2caa3f78cd630ece1a12ce74f7a8146eb6689b1b66",
  "window_final_block_height": 1718597,
  "window_block_count": 17280,
  "window_tx_count": 476084,
  "window_interval": 2724994,
  "txrate": 0.174710109453452
}
```

testnet
```
> dash-cli getblockhash 771537
0000028ce7bc90ddaa75703bbe576b8821e470b4b98bbe13be81eb79546e111f
> dash-cli getchaintxstats 17280 0000028ce7bc90ddaa75703bbe576b8821e470b4b98bbe13be81eb79546e111f
{
  "time": 1659215338,
  "txcount": 5579961,
  "window_final_block_hash": "0000028ce7bc90ddaa75703bbe576b8821e470b4b98bbe13be81eb79546e111f",
  "window_final_block_height": 771537,
  "window_block_count": 17280,
  "window_tx_count": 43514,
  "window_interval": 2428572,
  "txrate": 0.01791752519587642
}
```
2022-08-13 11:31:52 -05:00
PastaPastaPasta
28e1d46cbb
chore: bump nMinimumChainWork, defaultAssumeValid and m_assumed_blockchain_size for mainnet and testnet (#4960)
* chore: bump nMinimumChainWork and defaultAssumeValid for mainnet and testnet

* chore: bump m_assumed_blockchain_size for mainnet and testnet
2022-08-13 11:31:43 -05:00
Konstantin Akimov
713c851bbe
Update hard coded seeds for v18.0.0-rc12 (#4953)
Mainnet: 1716101
    Testnet: 774784
2022-08-13 11:31:34 -05:00
UdjinM6
3ac0b4884a
fix(llmq): Drop quorum members cache on undo (#4964)
This should help with v18 migration for nodes that failed to update in time. Still have to invalidate/reconsider the pre-fork quorum cycle start block to recalculate quorum members but it's better than having to reindex the whole chain.
2022-08-13 11:10:32 -05:00
MarcoFalke
2bf8c1107b Merge #16301: Use CWallet::Import* functions in all import* RPCs
40ad2f6a58228c72c655e3061a19a63640419378 Have importwallet use ImportPrivKeys and ImportScripts (Andrew Chow)
78941da5baf6244c7c54e86cf8ce3e09ce60c239 Optionally allow ImportScripts to set script creation timestamp (Andrew Chow)
94bf156f391759420465b2ff8c44f5f150246c7f Have importaddress use ImportScripts and ImportScriptPubKeys (Andrew Chow)
a00d1e5ec5eb019f8bbeb060a2b09e341d360fe5 Have importpubkey use CWallet's ImportScriptPubKeys and ImportPubKeys functions (Andrew Chow)
c6a827424711333f6f66cf5f9d79e0e6884769de Have importprivkey use CWallet's ImportPrivKeys, ImportScripts, and ImportScriptPubKeys (Andrew Chow)
fae7a5befd0b8746d84a6fde575e5b4ea46cb3c4 Log when an import is being skipped because we already have it (Andrew Chow)
ab28e31c9563bd2cd1e4a088ffd2479517dc83f2 Change ImportScriptPubKeys' internal to apply_label (Andrew Chow)

Pull request description:

  #15741 introduced `ImportPrivKeys`, `ImportPubKeys`, `ImportScripts`, and `ImportScriptPubKeys` in `CWallet` which are used by `importmulti`. This PR changes the remaining `import*` RPCs (`importaddress`, `importprivkey`, `importpubkey`, and `importwallet`) to use these functions as well instead of directly adding the imported items to the wallet.

ACKs for top commit:
  MarcoFalke:
    ACK 40ad2f6a58228c72c655e3061a19a63640419378 (checked that behavior changes are mentioned in the commit body)
  ryanofsky:
    utACK 40ad2f6a58228c72c655e3061a19a63640419378. Only change since last review is a tweaked commit message (mentioning label update in importpubkey commit)
  Sjors:
    ACK 40ad2f6a5. Those extra tests also pass.

Tree-SHA512: 910e3bbe20b6f8809a47b7293775db234125615d886c7fd99c194f4cdf00c765eb1e24b1799260f1213b98c88f9bbe696796f36087c182925e567d44e9194c98
2022-08-13 22:51:28 +07:00
Wladimir J. van der Laan
0cc9cec56c Merge #16237: Have the wallet give out destinations instead of keys
8e7f930828a9f8f9be1c90ff45e3fdfef1980eaf Add GetNewChangeDestination for getting new change Destinations (Andrew Chow)
33d13edd2bda0af90660e275ea4fa96ca9896f2a Replace CReserveKey with ReserveDestinatoin (Andrew Chow)
172213be5b174243dc501c1103ad5fe2fee67a16 Add GetNewDestination to CWallet to fetch new destinations (Andrew Chow)

Pull request description:

  The wallet should give out destinations instead of keys. It should be the one that handles the conversion from key to destination and the setting of the label, not the caller. In order to do this, two new member functions are introduced `GetNewDestination()` and `GetNewChangeDestination()`. Additionally, `CReserveKey` is changed to be `ReserveDestination` and represents destinations whose keys can be returned to the keypool.

ACKs for top commit:
  instagibbs:
    re-utACK 8e7f930828
  sipa:
    ACK 8e7f930828a9f8f9be1c90ff45e3fdfef1980eaf. Concept ACK as this gives a much cleaner abstraction to work with, and light code review ACK.
  laanwj:
    ACK 8e7f930828a9f8f9be1c90ff45e3fdfef1980eaf

Tree-SHA512: 5be7051409232b71e0ef2c1fd1a3e76964ed2f5b14d47d06edc2ad3b3687abd0be2803a1adc45c0433aa2c3bed172e14f8a7e9f4a23bff70f86260b5a0497500
2022-08-12 19:37:15 +07:00
MarcoFalke
2b69a426c1 Merge #17300: LegacyScriptPubKeyMan code cleanups
53fe0b70adeffe4cb94e6fa18a9abbdf674a2cd0 Fix missing strFailReason in CreateTransaction (Russell Yanofsky)
4b28a05f080de8acefaaa74f1204829995611d9e Fix misplaced AssertLockHeld (Russell Yanofsky)
2632b1f12466f970b667b42f462a6503df88e128 doc: Clarify WalletStorage / Wallet relation (Russell Yanofsky)
628d11b2ba0f1ba715c2358373e603a56d9f69ff Add back mistakenly removed AssertLockHeld (Russell Yanofsky)
52cf68f7ffa1dd3a6850606a75c32b77b1308c4b Refactor: Add GetLegacyScriptPubKeyMan helper (Russell Yanofsky)

Pull request description:

  This PR implements suggested code cleanups from https://github.com/bitcoin/bitcoin/pull/17260 review comments

ACKs for top commit:
  Sjors:
    ACK 53fe0b70adeffe4cb94e6fa18a9abbdf674a2cd0
  achow101:
    ACK 53fe0b70adeffe4cb94e6fa18a9abbdf674a2cd0
  MarcoFalke:
    ACK 53fe0b70adeffe4cb94e6fa18a9abbdf674a2cd0

Tree-SHA512: a577b96cb21a9aa7185d7d900e4db0665c302adcd12097957b9d8e838a8548c7de8f901bcb83e7c46d231b841221345c9264f5e29ed069f3d9236896430f959b
2022-08-12 16:38:02 +07:00
Konstantin Akimov
fe7815cb73 Clean up conflict resolving artefacts after backport #17260
Removed enum OutputType
Removed unexisting method GetNewChangeDestination
2022-08-12 16:38:02 +07:00
PastaPastaPasta
f83d857e36
Merge pull request #4478 from kittywhiskers/undashify
revert #3036, #2911, #1879, #1432: revert dashification of filenames
2022-08-11 12:34:55 -04:00
UdjinM6
7072ab491d
fix: make linter happy (4926+4952 follow-up) (#4965) 2022-08-11 11:18:49 +03:00
PastaPastaPasta
afbc817220
refactor/chore: update cppcheck to 2.8 with needed refactoring (#4926)
* refactor/chore: update cppcheck to 2.8 with needed refactoring

* use probably invalid index for default

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>

* trivial: rename skContributions -> m_sk_contributions and skContributions2 -> skContributions

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2022-08-11 02:05:44 +03:00
Konstantin Akimov
137c4fc84c
Update hard coded seeds for v18.0.0-rc12 (#4953)
Mainnet: 1716101
    Testnet: 774784
2022-08-11 01:57:13 +03:00
UdjinM6
5dd027bb55
doc: Update man pages for v18 (#4963) 2022-08-11 01:56:34 +03:00
UdjinM6
b30d50d835
translations: Add final v18 updates for ar, de and zh_CN (#4962)
NOTE: these files were made by running `./contrib/devtools/update-translations.py` on v18.x branch
2022-08-11 01:56:17 +03:00
PastaPastaPasta
91047566a8
chore: bump ChainTxData for mainnet and testnet (#4961)
mainnet
```
getchaintxstats
{
  "time": 1660074878,
  "txcount": 43702293,
  "window_final_block_hash": "0000000000000002ee5a0d2caa3f78cd630ece1a12ce74f7a8146eb6689b1b66",
  "window_final_block_height": 1718597,
  "window_block_count": 17280,
  "window_tx_count": 476084,
  "window_interval": 2724994,
  "txrate": 0.174710109453452
}
```

testnet
```
> dash-cli getblockhash 771537
0000028ce7bc90ddaa75703bbe576b8821e470b4b98bbe13be81eb79546e111f
> dash-cli getchaintxstats 17280 0000028ce7bc90ddaa75703bbe576b8821e470b4b98bbe13be81eb79546e111f
{
  "time": 1659215338,
  "txcount": 5579961,
  "window_final_block_hash": "0000028ce7bc90ddaa75703bbe576b8821e470b4b98bbe13be81eb79546e111f",
  "window_final_block_height": 771537,
  "window_block_count": 17280,
  "window_tx_count": 43514,
  "window_interval": 2428572,
  "txrate": 0.01791752519587642
}
```
2022-08-11 01:55:59 +03:00
PastaPastaPasta
8a4b9c66a9
chore: bump nMinimumChainWork, defaultAssumeValid and m_assumed_blockchain_size for mainnet and testnet (#4960)
* chore: bump nMinimumChainWork and defaultAssumeValid for mainnet and testnet

* chore: bump m_assumed_blockchain_size for mainnet and testnet
2022-08-11 01:55:33 +03:00
Kittywhiskers Van Gogh
fc18536053 trivial: revert dashification of header guards 2022-08-09 14:16:29 +05:30
Kittywhiskers Van Gogh
887b4324d3 trivial: revert dashification of source and header filenames 2022-08-09 14:16:29 +05:30
Kittywhiskers Van Gogh
f02085e988 revert dash#1432: Rename consensus source library and API
It's a shared library, so we should keep its name and API 
distinguishable from Bitcoin's and avoid pkgconfig confusion

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2022-08-09 14:16:28 +05:30
Kittywhiskers Van Gogh
c587212f8c partial revert dash#2911: s/dash-config/bitcoin-config/g 2022-08-09 14:16:28 +05:30
Kittywhiskers Van Gogh
ece4e1ee87 partial revert dash#3036: s/libbitcoin/libdash/g 2022-08-09 14:16:28 +05:30
UdjinM6
d47af2c4bf
feat/fix: ScanQuorums improvements (#4945)
* feat: Revive quorum scan caching

* refactor: split quorumsCacheCs mutex into two

* fix: Avoid extra work in quorum scanning

Non-rotation quorums do not become rotation ones (anymore), use `useRotation` to pick the right method only. This brings CPU load for `d-isman` thread (while being idle) from ~5% down to ~1% on testnet for me.

* apply suggestions
2022-08-08 19:09:21 +03:00
UdjinM6
63d9c6abf7
fix: 4946 follow-up (#4957) 2022-08-08 19:06:10 +03:00
Konstantin Akimov
ae051bb6e0
Merge #17260: Split some CWallet functions into new LegacyScriptPubKeyMan (#4938)
* Move wallet enums to walletutil.h

* MOVEONLY: Move key handling code out of wallet to keyman file

Start moving wallet and ismine code to scriptpubkeyman.h, scriptpubkeyman.cpp

The easiest way to review this commit is to run:

   git log -p -n1 --color-moved=dimmed_zebra

And check that everything is a move (other than includes and copyrights comments).

This commit is move-only and doesn't change code or affect behavior.

* Refactor: Split up CWallet and LegacyScriptPubKeyMan and classes

This moves CWallet members and methods dealing with keys to a new
LegacyScriptPubKeyMan class, and updates calling code to reference the new
class instead of CWallet.

Most of the changes are simple text replacements and variable substitutions
easily verified with:

    git log -p -n1 -U0 --word-diff-regex=.

The only nontrivial chunk of code added is the new LegacyScriptPubKeyMan class
declaration, but this code isn't new and is just selectively copied and moved
from the previous CWallet class declaration. This can be verified with:

    git log -p -n1 --color-moved=dimmed_zebra src/wallet/scriptpubkeyman.h src/wallet/wallet.h

or

    git diff HEAD~1:src/wallet/wallet.h HEAD:src/wallet/scriptpubkeyman.h

This commit does not change behavior.

* Renamed classes in scriptpubkeyman

* Fixes for conflicts, compilation and linkage errors due to previous commits

* Reordered methods in scriptpubkeyman to make further backports easier

* Reordered methods in scriptpubkeyman to make further backports easier (part II)

* Remove HDChain copy from SigningProvider class

* fixes/suggestions

Co-authored-by: Andrew Chow <achow101-github@achow101.com>
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2022-08-08 11:05:21 -05:00
UdjinM6
8882a7377e
feat: Avoid starting useless DKG threads on regular non-watching nodes (#4946)
* refactor: Initialize masternode mode related variables and objects earlier

* feat: Avoid starting useless DKG threads on regular nodes
2022-08-06 11:50:11 +03:00
UdjinM6
bdfa322f1f
fix: Restore caching in CalcCbTxMerkleRootMNList (#4951) 2022-08-06 11:45:02 +03:00
UdjinM6
abcc14b51e
feat: Implement caching in CalcCbTxMerkleRootQuorums (#4952) 2022-08-06 11:44:21 +03:00
Konstantin Akimov
7b9f0acbdd
fix: resolve some memory leaks (#4939)
- In wallet/rpcdump memory the leak would happen, if wallet is not correct JSON
 - In BLS the leak would happen, if object hasn't been pushed in queue by some reason. Need to remove temporary object also
2022-08-05 12:13:42 -05:00
UdjinM6
0835e4c307
fix(rpc): Fix off-by-1 in protx diff (#4950) 2022-08-05 11:35:46 +03:00
Kittywhiskers Van Gogh
bb7d6aed99
refactor(llmq): substitute memberless class llmq::CLLMQUtils with namespace llmq::utils (#4931)
* refactor(llmq): substitute memberless class llmq::CLLMQUtils with namespace llmq::utils

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>

* chore: mark functions internal to `llmq::utils` as `static`

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2022-08-02 12:14:25 -05:00
UdjinM6
c1a7a591c1
Merge pull request #4944 from PastaPastaPasta/18/rc12
[18.x] backport: rc12 backport and bump
2022-07-29 19:52:37 +03:00
pasta
ec4f9fd9b6
chore: bump to rc12 2022-07-29 11:06:21 -05:00
Odysseas Gabrielides
3ca5f25a38
Merge pull request #4942 from UdjinM6/fix_cqmbqr
fix(llmq): Calculate quorum members while not debugging llmq
2022-07-29 11:05:56 -05:00
Odysseas Gabrielides
7588c5a441
Merge pull request #4942 from UdjinM6/fix_cqmbqr
fix(llmq): Calculate quorum members while not debugging llmq
2022-07-28 13:43:02 +03:00
UdjinM6
39bf079f54
fix(llmq): Calculate quorum members while not debugging llmq
¯\_(ツ)_/¯
2022-07-27 23:34:29 +03:00
Konstantin Akimov
a6e9e50845
Merge bitcoin/bitcoin#23315: [22.x] build: explicitly disable libsecp256k1 openssl based tests (#4941)
e959b46aa933856e7636557f4ec6fce0efbc76aa build: explicitly disable libsecp256k1 openssl based tests (fanquake)

Pull request description:

  Backport of #23314

  These tests are failing when run against OpenSSL 3, and have been
  removed upstream, bitcoin-core/secp256k1#983, so
  disabled them for now to avoid `make check` failures.

  Note that this will also remove warning output from our build, due to
  the use of deprecated OpenSSL API functions. See #23048.

Top commit has no ACKs.

Tree-SHA512: ab3213dc82e7a64a005ce237710009bb447dee2702c4c02245e70df62063a00add73c4e80e9c619ce57345d4a2808fd4dc08e2e02a319b0f3d9285b8b0056599

Co-authored-by: MarcoFalke <falke.marco@gmail.com>
2022-07-27 21:25:14 +03:00
UdjinM6
b504b97a81
Merge pull request #4940 from PastaPastaPasta/backport-rc10
[v18.x] rc10 backports
2022-07-26 23:45:39 +03:00
pasta
d238549dd0
chore: bump rc to 11 2022-07-26 15:32:10 -05:00
Odysseas Gabrielides
b5ae437ca7
fix!: Fix on QuorumDataRequests and refactoring (#4937)
* qdata typo fixes and refactoring

* code style fix

* Add LOCK2 back

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2022-07-26 15:31:54 -05:00
Odysseas Gabrielides
6041e25722
fix!: Fix on QuorumDataRequests and refactoring (#4937)
* qdata typo fixes and refactoring

* code style fix

* Add LOCK2 back

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2022-07-26 15:31:03 -05:00
UdjinM6
1fa81c6a04
Merge pull request #4936 from PastaPastaPasta/v18.x-rc10
[V18.x] backport: rc10 backports
2022-07-26 02:48:10 +03:00
pasta
cd56e5002b
chore: bump rc to 10 2022-07-25 17:08:53 -05:00
Odysseas Gabrielides
71c0bbeaf2
Store QuorumDataRequests per {ProTx, quorumHash, llmqType} (#4935) 2022-07-25 17:08:30 -05:00
UdjinM6
b9dbd6da02
fix(dkg/net): Drop outdated connections to nodes that became masternodes recently (#4934)
* feat: switch nTimeFirstMessageReceived from microseconds to seconds

Was acting more like a bool until now, so nothing should change really. Align it with nTimeConnected.

* fix(dkg/net): Drop outdated connections to nodes that became masternodes recently

Such nodes won't be seen as masternodes by RelayInvToParticipants otherwise so no contributions will be sent to them when they are picked as relay members which in its turn may result in other nodes PoSe-punishing us.
2022-07-25 17:08:22 -05:00
UdjinM6
f7427d9c13
fix: Handle quorum watch connections correctly (#4933)
We add them via EnsureQuorumConnections+ThreadOpenMasternodeConnections so they are clearly masternode connections and they are dropped regularly which is annoying. But also, we don't want every masternode connection to be a qwatch one, we want only the ones we added via that algo.
2022-07-25 17:08:10 -05:00
UdjinM6
0ca9fc087c
fix(llmq): use keepOldConnections (#4932)
We must scan/cache keepOldConnections quorums or we won't be able to process sig shares signed in the 8 blocks window (signig offset) once new quorum(s) are mined.
2022-07-25 17:07:34 -05:00
UdjinM6
8a1a86b063
fix/test: Count MN connections properly, add more tests for getnetworkinfo (#4928)
* fix: Count MN connections properly

* tests: check extended connections info returned via getnetworkinfo
2022-07-25 17:07:25 -05:00