Commit Graph

15661 Commits

Author SHA1 Message Date
Wladimir J. van der Laan
9ea098413a Merge #16908: txmempool: Make entry time type-safe (std::chrono)
faec689bed7a5b66e2a7675853d10205b933cec8 txmempool: Make entry time type-safe (std::chrono) (MarcoFalke)
faaa1f01daba94b021ca77515266a16d27f0364e util: Add count_seconds time helper (MarcoFalke)
1111170f2f0141084b5b4ed565b2f07eba48599a test: mempool entry time is persisted (MarcoFalke)

Pull request description:

  This changes the type of the entry time of txs into the mempool from `int64_t` to `std::chrono::seconds`.

  The benefits:
  * Documents the type for developers
  * Type violations result in compile errors
  * After compilation, the two are equivalent (at no run time cost)

ACKs for top commit:
  ajtowns:
    utACK faec689bed7a5b66e2a7675853d10205b933cec8
  laanwj:
    ACK faec689bed7a5b66e2a7675853d10205b933cec8

Tree-SHA512: d958e058755d1a1d54cef536a8b30a11cc502b7df0d6ecf84a0ab1d38bc8105a67668a99cd5087a444f6de2421238111c5fca133cdf8e2e2273cb12cb6957845
2022-10-03 16:08:31 -04:00
Kittywhiskers Van Gogh
d44c1f7e62 merge bitcoin#20733: inline non-member functions with body in fuzzing headers 2022-10-02 12:05:30 +05:30
Kittywhiskers Van Gogh
c52700f2ef merge bitcoin#20560: Link all targets once 2022-10-02 12:05:30 +05:30
Kittywhiskers Van Gogh
2b90cb728b merge bitcoin#18757: Remove enumeration of expected deserialization exceptions in ProcessMessage(...) fuzzer 2022-10-02 12:05:29 +05:30
Kittywhiskers Van Gogh
d3f8619b6c merge bitcoin#18994: Add fuzzing harnesses for functions in script/ 2022-10-02 12:05:29 +05:30
Kittywhiskers Van Gogh
3e692c8b9d merge bitcoin#18938: Fill fuzzing coverage gaps for functions in consensus/validation.h, primitives/block.h and util/translation.h 2022-10-02 12:05:29 +05:30
Kittywhiskers Van Gogh
82346d1684 merge bitcoin#18519: Extend script fuzz test 2022-10-02 12:05:29 +05:30
Kittywhiskers Van Gogh
b4a7d85b49 merge bitcoin#18155: Add harness which fuzzes EvalScript and VerifyScript using a fuzzed signature checker 2022-10-02 12:05:29 +05:30
Kittywhiskers Van Gogh
8342fd39dd merge bitcoin#17136: Add fuzzing harness for various PSBT related functions 2022-10-02 12:05:28 +05:30
Kittywhiskers Van Gogh
2cb0d0ed44 merge bitcoin#18528: create test_fuzz library from src/test/fuzz/fuzz.cpp 2022-10-02 12:05:13 +05:30
Odysseas Gabrielides
c3fc8acdcb
test: bls scheme basic/legacy tests (#5027)
* test: run bls tests utilizing both legacy and basic scheme

* linter fix

* Added todos for pending basic bls raw data

Co-authored-by: pasta <pasta@dashboost.org>
2022-09-30 10:29:51 -05:00
PastaPastaPasta
4c81f5cfb8
Merge pull request #5017 from kittywhiskers/auxports3
backport: merge bitcoin#15508, #18764, #19264, #19107, #17577, #18783, #15024, #18204, partial #14588, #13932 (auxiliary backports: part 6)
2022-09-29 21:06:02 +02:00
Kittywhiskers Van Gogh
e0bbc59729 merge bitcoin#15938: silence GCC 7 warning "control reaches end of non-void function" (-Wreturn-type) in psbt.cpp 2022-09-24 08:51:05 +05:30
Kittywhiskers Van Gogh
cbf7f596e9 merge bitcoin#18204: improve descriptor cache and cache xpubs 2022-09-24 08:51:05 +05:30
Kittywhiskers Van Gogh
5df05449be merge bitcoin#15024: Allow specific private keys to be derived from descriptor 2022-09-24 08:51:05 +05:30
Kittywhiskers Van Gogh
94bcbf588d merge bitcoin#18783: Add fuzzing harness for MessageSign, MessageVerify and other functions in util/message.h 2022-09-24 08:51:05 +05:30
Kittywhiskers Van Gogh
d155f13c76 merge bitcoin#17577: deduplicate the message sign/verify code 2022-09-24 08:51:05 +05:30
Kittywhiskers Van Gogh
0e58b340e6 merge bitcoin#19107: Move all header verification into the network layer, extend logging 2022-09-24 08:51:05 +05:30
Kittywhiskers Van Gogh
b2d999c3bf merge bitcoin#15508: Refactor analyzepsbt for use outside RPC code 2022-09-24 08:51:04 +05:30
Kittywhiskers Van Gogh
2a3a873524 partial bitcoin#13932: Additional utility RPCs for PSBT
Contains cb40b3abd4514361a024a1e7a1a281da9261261b and 540729ef4bf1b6c6da1ec795e441d2ce56a9a58b

Verbatim for release notes borrowed from https://raw.githubusercontent.com/bitcoin/bitcoin/master/doc/release-notes/release-notes-0.18.0.md
2022-09-24 08:51:04 +05:30
Kittywhiskers Van Gogh
448ad8a198 partial bitcoin#14588: Refactor PSBT signing logic to enforce invariant and fix signing bug
Contains 53e6fffb8f5b10f94708d33d667a67cb91c2d09d, 0f5bda2bd941686620ef0eb90bd7ed973cc7ef73, 65166d4cf828909dc4bc49dd68a58103d015f1fd and 565500508aa5df0011109ebf375ba71b693fc7de
2022-09-24 08:51:04 +05:30
PastaPastaPasta
dd2ae58352
style: rename variable to avoid shadowing (#5020) 2022-09-24 02:45:27 +03:00
UdjinM6
9010b813c7
fix: Flush chainstate (and evodb) cache whenever evodb mem usage is getting too high (#5007)
* fix: Flush chainstate (and evodb) cache whenever evodb mem usage is getting too high

* Bump evodb cache to 64MiB
2022-09-23 18:46:18 +04:00
UdjinM6
3e9d136b3a
Merge bitcoin/bitcoin#25739: Update leveldb subtree (#5005)
f608f25313d2867a6abdfc38abdb86da40924cfc Squashed 'src/leveldb/' changes from 330dd6235f..22f1e4a02f (fanquake)

Pull request description:

  Replaces #25463 (for master).

  Includes:
  - https://github.com/bitcoin-core/leveldb-subtree/pull/32

  Guix Build (arm64):
  ```bash
  ed41ae2555ae3b638b65d870cef385805e621481831ae992e84645f5c234af63  guix-build-bec911e37ac8/output/arm-linux-gnueabihf/SHA256SUMS.part
  7d8237026bfccedee0e56e14d7b89cf2dcb52195b94070dc4b6c3c6970fdc774  guix-build-bec911e37ac8/output/arm-linux-gnueabihf/bitcoin-bec911e37ac8-arm-linux-gnueabihf-debug.tar.gz
  1afeff9d70864be66f7ac48d31d1977c7844e2cc117d3f0438fb2f9c6f6a56a4  guix-build-bec911e37ac8/output/arm-linux-gnueabihf/bitcoin-bec911e37ac8-arm-linux-gnueabihf.tar.gz
  ab2df265897a0142093b582d3c61e2b17a713d93e478b47c7aa2b0a677295007  guix-build-bec911e37ac8/output/arm64-apple-darwin/SHA256SUMS.part
  025a52babdee479800801e951f6fe1fe490e1f5fe8361104eb85e7b0319cdb37  guix-build-bec911e37ac8/output/arm64-apple-darwin/bitcoin-bec911e37ac8-arm64-apple-darwin-unsigned.dmg
  7b2992bf5543891b1e6ef4f48c52fc5febc58cc31ccf4307edd27d4d630aa54a  guix-build-bec911e37ac8/output/arm64-apple-darwin/bitcoin-bec911e37ac8-arm64-apple-darwin-unsigned.tar.gz
  3d93eb009ab6459cdca5fe767795f94ba5e00e5969e44bac19c7a5f344d42030  guix-build-bec911e37ac8/output/arm64-apple-darwin/bitcoin-bec911e37ac8-arm64-apple-darwin.tar.gz
  b8c30c5c561c96bc4e280ececc0dd1cd673bc6194591b848903aa6c54c9d37cf  guix-build-bec911e37ac8/output/dist-archive/bitcoin-bec911e37ac8.tar.gz
  cb2632b9b5ff473e504d3d6244191eb5a852718f8ac8bb1032ba1c65e07d6b3f  guix-build-bec911e37ac8/output/powerpc64-linux-gnu/SHA256SUMS.part
  26ecc2f42ce37f8bd7ba24bf2f80f493cd1fd45b58409de71c44e2445c291c8c  guix-build-bec911e37ac8/output/powerpc64-linux-gnu/bitcoin-bec911e37ac8-powerpc64-linux-gnu-debug.tar.gz
  4a83381ea472cc71b4a1c6569483a7e85a5f53065c1633828bf7a75d357b0297  guix-build-bec911e37ac8/output/powerpc64-linux-gnu/bitcoin-bec911e37ac8-powerpc64-linux-gnu.tar.gz
  455a9af5e7ee1c2857d87abec29284ae7bb447cf7cb2b3befa2f8e0a0a8cbec6  guix-build-bec911e37ac8/output/powerpc64le-linux-gnu/SHA256SUMS.part
  3445f53fd150032ec3c3f324e001b4ecf72728900961a7a7789c32ceb7616617  guix-build-bec911e37ac8/output/powerpc64le-linux-gnu/bitcoin-bec911e37ac8-powerpc64le-linux-gnu-debug.tar.gz
  baefeaac88bb4fbf8662c8e1150b043aa2534535a82e828c13e971d2c5fa5cbd  guix-build-bec911e37ac8/output/powerpc64le-linux-gnu/bitcoin-bec911e37ac8-powerpc64le-linux-gnu.tar.gz
  543484396a47def1636d4e54d4a105c7093265c8896165a4140edec10aeef880  guix-build-bec911e37ac8/output/riscv64-linux-gnu/SHA256SUMS.part
  ac1f6e57016703f1319a3ef80014581aee96053e56525b8cd11ada2395496b86  guix-build-bec911e37ac8/output/riscv64-linux-gnu/bitcoin-bec911e37ac8-riscv64-linux-gnu-debug.tar.gz
  f9a2b65ed21f777524b078046c84b98239b0fbb92eae8d840bc7a25cab0eec6d  guix-build-bec911e37ac8/output/riscv64-linux-gnu/bitcoin-bec911e37ac8-riscv64-linux-gnu.tar.gz
  a08ed0ee78ab1c4c815ba8368f1a21d3bd4327ce1104cb3793d63edd2bde1ef4  guix-build-bec911e37ac8/output/x86_64-apple-darwin/SHA256SUMS.part
  74059397c6c8f0e899b60415d1aae04f2f7df18b8f39cea9f314e5e0c2e0ede6  guix-build-bec911e37ac8/output/x86_64-apple-darwin/bitcoin-bec911e37ac8-x86_64-apple-darwin-unsigned.dmg
  6909ff6f59b78059d505f2b98e6fad63a4e3deb843566061c4cd6e94be1de066  guix-build-bec911e37ac8/output/x86_64-apple-darwin/bitcoin-bec911e37ac8-x86_64-apple-darwin-unsigned.tar.gz
  21b45719d927422acc69662108e7255d8cd0b1d832493e70c622c1b1b3a3a314  guix-build-bec911e37ac8/output/x86_64-apple-darwin/bitcoin-bec911e37ac8-x86_64-apple-darwin.tar.gz
  b5fdee6fd2dbcdaa6302f388c7fcaa6d130ff91fd5760e19facf6e24c7216ef6  guix-build-bec911e37ac8/output/x86_64-linux-gnu/SHA256SUMS.part
  56db24b0b0d2f463c8085a12502977c6d4f4ee5b85484e52522361f54ab3a6aa  guix-build-bec911e37ac8/output/x86_64-linux-gnu/bitcoin-bec911e37ac8-x86_64-linux-gnu-debug.tar.gz
  96dbe08e2ed0f68fe734dd6f0280c2d22af7b56c84debde424367054f118173f  guix-build-bec911e37ac8/output/x86_64-linux-gnu/bitcoin-bec911e37ac8-x86_64-linux-gnu.tar.gz
  70ac424b229befb2834a8a02ce27551e3ddde2d438497e8c11a3cedf0cea5d3c  guix-build-bec911e37ac8/output/x86_64-w64-mingw32/SHA256SUMS.part
  bad144a599b28e8dc0018cc2fd1754543e79df39d651e58f565c197241f2b8cb  guix-build-bec911e37ac8/output/x86_64-w64-mingw32/bitcoin-bec911e37ac8-win64-debug.zip
  7ce2e72621eb070a8d23b7edbaaccc9f06257b82b9851c1cad4c61f08d2c7451  guix-build-bec911e37ac8/output/x86_64-w64-mingw32/bitcoin-bec911e37ac8-win64-setup-unsigned.exe
  5f726ef8b478e3ac90b93cd3ae3c38a0e7bffa5f80306c46a7535518a73251c7  guix-build-bec911e37ac8/output/x86_64-w64-mingw32/bitcoin-bec911e37ac8-win64-unsigned.tar.gz
  87cf1a23e948e471ed35c6a518813505c907c58788b55665829e7f12f33bd312  guix-build-bec911e37ac8/output/x86_64-w64-mingw32/bitcoin-bec911e37ac8-win64.zip
  ```

ACKs for top commit:
  hebasto:
    ACK bec911e37ac826d55b789428bc07280abab76443, I have reviewed the code and it looks OK, I agree it can be merged.
  jarolrod:
    ACK bec911e37ac826d55b789428bc07280abab76443

Tree-SHA512: 190381d9489ec6cc52bb9557750925c8574f1344eb6893095e9e31e66a579bd1bc283e8cbfcba52cec3fb072985895f929103b6f5351a23f908bdd0a04b474f1

Co-authored-by: fanquake <fanquake@gmail.com>
2022-09-23 18:43:39 +04:00
Kittywhiskers Van Gogh
a35245653c
refactor: pass references to objects instead of using global definitions (#4988)
* fix: move chain activation logic downward to succeed LLMQ initialization

* fix: change order of initialization to reflect dependency

* llmq: pass all global pointers invoked as CDSNotificationInterface arguments

* llmq: pass reference to quorumDKGDebugManager instead of invoking global

* llmq: pass reference to quorumBlockProcessor instead of invoking global

* llmq: pass reference to quorumDKGSessionManager instead of invoking global

* llmq: pass reference to quorumManager instead of invoking global

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

* llmq: pass reference to quorumSigSharesManager within CSigningManager and networking

* llmq: pass reference to quorumSigSharesManager instead of invoking global

* llmq: pass reference to chainLocksHandler instead of querying global

* llmq: pass reference to quorumInstantSendManager instead of querying global

* trivial: accept argument as const where possible

* style: remove an unneeded const_cast and instead pass by const reference

* style: use const where possible

Co-authored-by: pasta <pasta@dashboost.org>
2022-09-22 15:14:48 +04:00
PastaPastaPasta
9293d2f382
Merge pull request #4975 from vijaydasmp/bp2101
backport: bitcoin#18493,18467,18633,18157,18774,19006,18612,20033, 15283
2022-09-21 18:35:26 +04:00
Konstantin Akimov
9845f8c992
Merge bitcoin#17304: refactor: Move many functions into LegacyScriptPubKeyMan and further separate it from CWallet
* MOVEONLY: Reorder LegacyScriptPubKeyMan methods

Can verify move-only with:

    git log -p -n1 --color-moved

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

* Refactor: Declare LegacyScriptPubKeyMan methods as virtual

This commit does not change behavior.

* Refactor: Add new ScriptPubKeyMan virtual methods

This commit does not change behavior.

* Refactor: Move SetAddressBook call out of LegacyScriptPubKeyMan::GetNewDestination

This commit does not change behavior.

* Refactor: Move SetWalletFlag out of LegacyScriptPubKeyMan::UpgradeKeyMetadata

This commit does not change behavior.

* Remove SetWalletFlag from WalletStorage

SetWalletFlag is unused.

Does not change any behavior

* Refactor: Remove UnsetWalletFlag call from LegacyScriptPubKeyMan::SetHDSeed

This commit does not change behavior.

* refactor: Replace UnsetWalletFlagWithDB with UnsetBlankWalletFlag in ScriptPubKeyMan

ScriptPubKeyMan is only using UnsetWalletFlagWithDB to unset the blank
wallet flag. Just make that it's own function and not expose the flag
writing directly.

This does not change behavior.

* Refactor: Move SetAddressBookWithDB call out of LegacyScriptPubKeyMan::ImportScriptPubKeys

This commit does not change behavior.

* Refactor: Move LoadKey LegacyScriptPubKeyMan method definition

This commit does not change behavior.

* Refactor: Move GetMetadata code out of getaddressinfo

Easier to review ignoring whitespace:

    git log -p -n1 -w

This commit does not change behavior.

* Refactor: Move MarkUnusedAddresses code out of CWallet::AddToWalletIfInvolvingMe

This commit does not change behavior.

* Refactor: Move HavePrivateKeys code out of CWallet::CreateWalletFromFile

This commit does not change behavior.

* Refactor: Move RewriteDB code out of CWallet

This commit does not change behavior.

* Refactor: Move GetKeypoolSize code out of CWallet

This commit does not change behavior.

* Refactor: Move nTimeFirstKey accesses out of CWallet

This commit does not change behavior.

* Re-order methods of scriptpubkeyman for easier backporting changes in future

* Fixup for missing cs_wallet lock:

```
wallet/wallet.cpp:4536:41: error: calling function 'GetTimeFirstKey' requires holding mutex 'spk_man->cs_wallet' exclusively [-Werror,-Wthread-safety-analysis]
                int64_t time = spk_man->GetTimeFirstKey();
                                        ^
wallet/wallet.cpp:4570:106: error: calling function 'GetTimeFirstKey' requires holding mutex 'walletInstance->m_spk_man->cs_wallet' exclusively [-Werror,-Wthread-safety-analysis]
        walletInstance->WalletLogPrintf("nTimeFirstKey = %u\n",               walletInstance->m_spk_man->GetTimeFirstKey());
```

* Fix 2 locks

* more of "refactor: Replace UnsetWalletFlagWithDB with UnsetBlankWalletFlag in ScriptPubKeyMan"

* Refactoring GetOldestKeyInPool -> GetOldestKeyTimeInPool, partial bitcoin#10235

Co-authored-by: Andrew Chow <achow101-github@achow101.com>
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2022-09-20 11:31:09 +04:00
MarcoFalke
01226e7830
Merge #15283: log: Fix UB with bench on genesis block
ec30a79f1c430cc7fbda37e5d747b0b31b262fa5 Fix UB with bench on genesis block (Gregory Sanders)

Pull request description:

  During the loading of the genesis block, the bench print lines in ConnectTip divide by zero due to early return in ConnectBlock.

ACKs for top commit:
  practicalswift:
    ACK ec30a79f1c430cc7fbda37e5d747b0b31b262fa5
  sipa:
    utACK ec30a79f1c430cc7fbda37e5d747b0b31b262fa5
  promag:
    ACK ec30a79, `nBlocksTotal` is only used in logging.

Tree-SHA512: b3bdbb58d10d002a2293d7f99196b227ed9f4ca8c6cd08981e95cc964be47efed98b91fad276ee6da5cf7e6684610998ace7ce9bace172dd6c51c386d985b83c
2022-09-16 19:22:13 +05:30
MarcoFalke
fce00a8118
Merge #20033: refactor: minor whitespace fixups, s/const/constexpr/ and remove template (followup to #19845)
89836a82eec63f93bbe6c3bd6a52be26e71ab54d style: minor improvements as a followup to #19845 (Vasil Dimov)

Pull request description:

  Address suggestions:
  https://github.com/bitcoin/bitcoin/pull/19845#discussion_r495486760
  https://github.com/bitcoin/bitcoin/pull/19845#discussion_r495488051
  https://github.com/bitcoin/bitcoin/pull/19845#discussion_r495730125

ACKs for top commit:
  jonatack:
    re-ACK 89836a8 change since previous review is replacing std::runtime_error with std::exception, built/ran unit tests with gcc debian 10.2.0-15, then broke a few v3 net_tests involving `BOOST_CHECK_EXCEPTION`, rebuilt, ran `src/test/test_bitcoin -t net_tests -l all` and checked the error reporting.
  hebasto:
    re-ACK 89836a82eec63f93bbe6c3bd6a52be26e71ab54d
  theStack:
    ACK 89836a82eec63f93bbe6c3bd6a52be26e71ab54d

Tree-SHA512: 36477fdccabe5a8ad91fbabb4655cc363a3a7ca237a98ae6dd4a9fae4a4113762040f864d4ca13a47d081f7d16e5bd487edbfb61ab50a37e4a0424e9bec30b24
2022-09-16 19:22:13 +05:30
Wladimir J. van der Laan
f87b37e07b
Merge #18612: script: Remove undocumented and unused operator+
ccccd5190898ece3ac17aa3178f320d091f221df script: Remove undocumented and unused operator+ (MarcoFalke)

Pull request description:

  This operator has no documented use case and is also unused outside of test code. The test code and all other (imaginary) code that might use this operator is written more clear and concise by the existing CScript push operators for opcodes and data.

  Removing the operator is also going to protect against accidentally reintroducing bugs like this 6ff5f718b6 (diff-8458adcedc17d046942185cb709ff5c3L1135) (last time it was used).

ACKs for top commit:
  laanwj:
    ACK ccccd5190898ece3ac17aa3178f320d091f221df

Tree-SHA512: 43898ac77e4d9643d9f8ac6f8f65497a4f0bbb1fb5dcaecc839c3719aa36181ba77befb213e59a9f33a20a29e0173a0e9c4763b1930940b32c3d1598b3e39af9
2022-09-16 19:22:13 +05:30
MarcoFalke
58ba7a3d88
Merge #19006: rpc: Avoid crash when g_thread_http was never started
faf45d1f1f997c316fc4c611a23c4456533eefe9 http: Avoid crash when g_thread_http was never started (MarcoFalke)
fa12a37b27f0570a551b8c103ea6537ee4a8e399 test: Replace inline-comments with logs, pep8 formatting (MarcoFalke)
fa83b39ff3ae3fbad93df002915c0e5f99c104a9 init: Remove confusing and redundant InitError (MarcoFalke)

Pull request description:

  Avoid a crash during shutdown when the init sequence failed for some reason

ACKs for top commit:
  promag:
    Tested ACK faf45d1f1f997c316fc4c611a23c4456533eefe9.
  ryanofsky:
    Code review ACK faf45d1f1f997c316fc4c611a23c4456533eefe9. Thanks for updates, this is much easier to parse for me now. Since previous reviews: split out and reverted some cleanups & replaced chmod with mkdir in test
  hebasto:
    ACK faf45d1f1f997c316fc4c611a23c4456533eefe9, tested on Linux Mint 19.3 with the following patch:

Tree-SHA512: 59632bf01c999e65c724e2728ac103250ccd8b0b16fac19d3a2a82639ab73e4f2efb86c78e63c588a5954625d8d0cf9545e2a7e070e6e15d2a54beeb50e00b61
2022-09-16 19:22:12 +05:30
MarcoFalke
9867af5500
Merge #18467: rpc: Improve documentation and return value of settxfee
38677274f931088218eeb1f258077d3387f39c89 rpc: settxfee respects -maxtxfee wallet setting (Fabian Jahr)
bda84a08a0ac92dff6cadc99cf9bb8c3fadd7e13 rpc: Add documentation for deactivating settxfee (Fabian Jahr)

Pull request description:

  ~~Closes 18315~~

  `settxfee` can be deactivated by passing 0 as the fee. That does not seem to be documented for the user so this PR adds it in the description. The return value of a simple boolean seems also too simplified given the multiple dimensions that this deactivation feature enables. I.e. it does not seem intuitive if the returned boolean shows that the call succeeded or if means that `settxfee` is active. My suggested solution is to change the return value to a JSON object that included the "active" state and the currently set fee rate.

  Examples:
  ```
  $ src/bitcoin-cli settxfee 0.0000000
  {
    "active": false,
    "fee_rate": "0.00000000 BTC/kB"
  }
  $ src/bitcoin-cli settxfee 0.0001
  {
    "active": true,
    "fee_rate": "0.00010000 BTC/kB"
  }
  ```

ACKs for top commit:
  MarcoFalke:
    ACK 38677274f931088218eeb1f258077d3387f39c89, seems useful to error out early instead of later #16257 🕍
  jonatack:
    ACK 38677274f931088218eeb
  meshcollider:
    LGTM, utACK 38677274f931088218eeb1f258077d3387f39c89

Tree-SHA512: 642813b5cf6612abb4b6cb63728081a6bd1659d809e0149c8f56060b6da7253fee989b3b202854f3051df3773c966799af30b612648c466b099f00590f356548
2022-09-16 19:22:11 +05:30
MarcoFalke
4abace34ad
Merge #18493: rpc: Remove deprecated "size" from mempool txs
0753efd9dc8f2e756955a726afbb602d904e1e92 rpc: Remove deprecated "size" from mempool txs (Vasil Dimov)

Pull request description:

  Remove the "size" property of a mempool transaction from RPC replies.

  Deprecated in e16b6a718 in 0.19, about 1 year ago.

ACKs for top commit:
  kristapsk:
    ACK 0753efd9dc8f2e756955a726afbb602d904e1e92

Tree-SHA512: 392ced6764dd6a1d47c6d1dc9de78990cf3384910d801253f8f620bd1751b2676a6b52bee8a30835d28e845d84bfb37431c1d2370f48c9d4dc8e6a48a5ae8b9e
2022-09-16 19:22:08 +05:30
UdjinM6
44fda52d68
Merge pull request #4925 from PastaPastaPasta/develop-trivial-2022-07-17
backport: trivial backports
2022-09-06 20:35:53 +03:00
PastaPastaPasta
0f3e00ce03
refactor: create an enum for DKGError, instead of passing around potentially invalid strings (#4998)
* refactor: create an enum for DKGError, instead of passing around potentially invalid strings

This also enables us to utilize an std::array instead of a std::map
This also removes the CCriticalSection and instead utilizes atomic doubles
This also adds safety to the dkgsimerror rpc rejecting invalid types

* test: add some tests for DKGError
2022-09-06 20:32:53 +03:00
fanquake
7f0bdbda11
Merge bitcoin/bitcoin#24298: fuzz: Avoid unsigned integer overflow in FormatParagraph
fa2f7d005932bff9b7d27744ae517b9e7910df8d fuzz: Avoid unsigned integer overflow in FormatParagraph (MarcoFalke)

Pull request description:

  `FormatParagraph` is only ever called with compile time constant arguments, so I don't see the need for fuzzing it.

  Though, keep it for now, but avoid the unsigned integer overflow with this patch.

ACKs for top commit:
  laanwj:
    Code review ACK fa2f7d005932bff9b7d27744ae517b9e7910df8d

Tree-SHA512: 01fc64a9ef73c183921ca1b0cd8db9514c0a242e3acf215a3393f383ae129e01625ebb16eaf9cb86370eda62d0145c3dcf8f62e40edf5958abc1f777c5687280
2022-09-03 10:43:16 -05:00
MarcoFalke
6dc5497313
Merge bitcoin/bitcoin#24095: util: Fix mis-swapped prettyIndent and indentLevel arguments
f25114148320c3fe07af3abc6e2f150d0a2c10f4 util: Fix mis-swapped `prettyIndent` and `indentLevel` arguments (Hennadii Stepanov)

Pull request description:

  On master d0bf9bb6a539f151ec92725d20a2b6c22cb095a5:
  ```
  $ cat settings.json
  {
      "wallet": [
       "210803d"
      ]
     }
  ```

  With this PR:
  ```
  $ cat settings.json
  {
      "wallet": [
          "210803d"
      ]
  }
  ```

ACKs for top commit:
  ryanofsky:
    Code review ACK f25114148320c3fe07af3abc6e2f150d0a2c10f4. Nice catch!

Tree-SHA512: 1c315c807a070039c05a77f4e8855011d468b9aeb141e4fa3b1e1aaaab252e3831e8bdfe0caddf7704a00492799022f761f6d21a047c5bf75cdbcc96f04fc04e
2022-09-03 10:43:16 -05:00
MarcoFalke
ab4405258e
Merge bitcoin/bitcoin#22591: Util: error if settings json exists, but is unreadable
2b071265c37da22f15769945fd159b50a14792a3 error if settings.json exists, but is unreadable (Tyler Chambers)

Pull request description:

  If settings.json exists, but is unreadable, we should error instead of overwriting.

  Fixes #22571

ACKs for top commit:
  Zero-1729:
    tACK 2b071265c37da22f15769945fd159b50a14792a3
  ShaMan239:
    tACK 2b071265c37da22f15769945fd159b50a14792a3
  prayank23:
    tACK 2b071265c3
  ryanofsky:
    Code review ACK 2b071265c37da22f15769945fd159b50a14792a3. Thanks for the fix! Note that PR   https://github.com/bitcoin-core/gui/pull/379 will change the appearance of dialogs shown in screenshots above. So it could be interesting to test the two PRs together (but current testing seems more than sufficient)
  theStack:
    ACK 2b071265c37da22f15769945fd159b50a14792a3 📁

Tree-SHA512: 6f7f96ce8a13213d0335198a2245d127264495c877105058d1503252435915b332a6e55068ac21088f4c0c017d564689f4956213328d5bdee81d73711efc5511
2022-09-03 10:43:15 -05:00
fanquake
2966452a1b
Merge #21486: build: link against -lsocket if required for *ifaddrs
4783115fd4cccb46a7f8c592b34fa7c094c29410 net: add ifaddrs.h include (fanquake)
879215e665a9f348c8d3fa92701c34065bc86a69 build: check if -lsocket is required with *ifaddrs (fanquake)
87deac66aa747481e6f34fc80599e1e490de3ea0 rand: only try and use freeifaddrs if available (fanquake)

Pull request description:

  Fixes #21485 by linking against `-lsocket` when it's required for using `*ifaddrs` functions.

ACKs for top commit:
  laanwj:
    Code review ACK 4783115fd4cccb46a7f8c592b34fa7c094c29410
  hebasto:
    ACK 4783115fd4cccb46a7f8c592b34fa7c094c29410, I have reviewed the code and it looks OK, I agree it can be merged.

Tree-SHA512: 4542e036e9b029de970eff8a9230fe45d9204bb22313d075f474295d49bdaf1f1cbb36c0c6e2fa8dbbcdba518d8d3a68a6116ce304b82414315f333baf9af0e4
2022-09-03 10:43:15 -05:00
MarcoFalke
dfd5f68041
Merge #21082: refactor: Treat ArgsManager::Flags as uint32_t explicitly
faf3b4b53359850e0c47e67ead1c2b6dccc55531 refactor: Treat ArgsManager::Flags as uint32_t explicitly (MarcoFalke)

Pull request description:

  The underlying type might be implementation defined, which is probably why the sanitizer kills the fuzz tests.

  Fix that by pinning the underlying type.

  This refactor does not change behaviour and only affects the sanitizer in tests.

ACKs for top commit:
  practicalswift:
    cr ACK faf3b4b53359850e0c47e67ead1c2b6dccc55531

Tree-SHA512: d446824836e1037b4200ba3630c8628090678cfad45559866275d8e06349f7c8cdb7e816619f5afb35f9f65299cc00e046d2f81b73cd8eb843e2e15676b647d5
2022-09-03 10:43:15 -05:00
MarcoFalke
e0ba1fc72d
Merge #19624: Warn on unknown rw_settings
fa48405ef84985e5a9d38ec38e90d16596ea45b5 Warn on unknown rw_settings (MarcoFalke)

Pull request description:

  Log a warning to debug log if unknown settings are encountered. This should probably only ever happen when the software is upgraded.

  Something similar is already done for the command line and config file. See:

  * test: Add test for unknown args #16234 (commit fa7dd88b71a1c6641bd450fae29a4a31849b1afd)

ACKs for top commit:
  ryanofsky:
    Code review ACK fa48405ef84985e5a9d38ec38e90d16596ea45b5. Looks good and I could see this being helpful for debugging. Thanks for taking suggestions

Tree-SHA512: cec7d88adf84fa0a842f56b26245157736eb50df433db951e622ea07fd145b899822b24cdab1d8b36c066415ce4f0ef09b493fa8a8d691532822a59c573aafa7
2022-09-03 10:43:15 -05:00
Wladimir J. van der Laan
8f0192f3cf
Merge #19593: refactor: Drop unused CBufferedFile::Seek()
7b3851e9473e74043342d414c056c2ef87c2f261 refactor: Drop unused CBufferedFile::Seek() (Hennadii Stepanov)

Pull request description:

ACKs for top commit:
  practicalswift:
    ACK 7b3851e9473e74043342d414c056c2ef87c2f261 -- deleted code is better than unused untested code:)
  MarcoFalke:
    ACK 7b3851e9473e74043342d414c056c2ef87c2f261, assuming that removing this should either be correct or result in a compile failure
  jonasschnelli:
    utACK 7b3851e9473e74043342d414c056c2ef87c2f261
  promag:
    Code review ACK 7b3851e9473e74043342d414c056c2ef87c2f261.

Tree-SHA512: 7bfd172aa4bbe349855c1303fd9cd58093d66833fefe46bd29081bfcca4ab434b84c6b84e76e94d06b8749a5abe1dc1e184f5189136cd1403d0e5bc25ad6d456
2022-09-03 10:43:14 -05:00
MarcoFalke
2353920662
Merge #16878: Fix non-deterministic coverage of test DoS_mapOrphans
4455949d6f0218b40d33d7fe6de6555f8f62192f Make test DoS_mapOrphans deterministic (David Reikher)

Pull request description:

  This pull request proposes a solution to make the test `DoS_mapOrphans` in denialofservice_tests.cpp have deterministic coverage.

  The `RandomOrphan` function in denialofservice_tests.cpp and the implicitly called function `ecdsa_signature_parse_der_lax` in pubkey.cpp were causing the non-deterministic test coverage.

  In the former, if a random orphan was selected the index of which is bigger than the max. orphan index in `mapOrphanTransactions`, the last orphan was returned from `RandomOrphan`. If the random number generated was never large enough, this condition would not be fulfilled and the corresponding branch wouldn't run. The proposed solution is to force one of the 50 dependant orphans to depend on the last orphan in `mapOrphanTransactions` using the newly introduced function `OrphanByIndex` (and passing it a large uint256), forcing this branch to run at least once.

  In the latter, if values for ECDSA `R` or `S` (or both) had no leading zeros, some code would not be executed. The solution was to find a constant signature that would be comprised of `R` and `S` values with leading zeros and calling `CPubKey::Verify` at the end of the test with this signature forcing this code to always run at least once at the end even if it hadn't throughout the test.

  To test that the coverage is (at least highly likely) deterministic, I ran

  `contrib/devtools/test_deterministic_coverage.sh denialofservice_tests/DoS_mapOrphans 1000`

  and the result was deterministic coverage across 1000 runs.

  Also - removed denialofservice_tests test entry from the list of non-deterministic tests in the coverage script.

ACKs for top commit:
  MarcoFalke:
    ACK 4455949d6f0218b40d33d7fe6de6555f8f62192f

Tree-SHA512: 987eb1f94b80d5bec4d4944e91ef43b9b8603055750362d4b4665b7f011be27045808aa9f4c6ccf8ae009b61405f9a1b8671d65a843c3328e5b8acce1f1c00a6
2022-09-03 10:43:14 -05:00
MarcoFalke
77ab447b7f
Merge #19140: tests: Avoid fuzzer-specific nullptr dereference in libevent when handling PROXY requests
20d31bdd92cc2ad9b8d26ed80da73bbcd6016144 tests: Avoid fuzzer-specific nullptr dereference in libevent when handling PROXY requests (practicalswift)

Pull request description:

  Avoid constructing requests that will be interpreted by libevent as PROXY requests to avoid triggering a `nullptr` dereference. Split out from #19074 as suggested by MarcoFalke.

  The dereference (`req->evcon->http_server`) takes place in `evhttp_parse_request_line` and is a consequence of our hacky but necessary use of the internal function `evhttp_parse_firstline_` in the `http_request` fuzzing harness.

  The suggested workaround is not aesthetically pleasing, but it successfully avoids the troublesome code path.

  `" http:// HTTP/1.1\n"` was a crashing input prior to this workaround.

  Before this PR:

  ```
  $ echo " http:// HTTP/1.1" > input
  $ src/test/fuzz/http_request input
  src/test/fuzz/http_request: Running 1 inputs 1 time(s) each.
  Running: input
  AddressSanitizer:DEADLYSIGNAL
  =================================================================
  ==27905==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000108 (pc 0x55a169b7e053 bp 0x7ffd452f1160 sp 0x7ffd452f10e0 T0)
  ==27905==The signal is caused by a READ memory access.
  ==27905==Hint: address points to the zero page.
      #0 0x55a169b7e053 in evhttp_parse_request_line depends/work/build/x86_64-pc-linux-gnu/libevent/2.1.11-stable-36daee64dc1/http.c:1883:37
      #1 0x55a169b7d9ae in evhttp_parse_firstline_ depends/work/build/x86_64-pc-linux-gnu/libevent/2.1.11-stable-36daee64dc1/http.c:2041:7
      #2 0x55a1687f624e in test_one_input(std::vector<unsigned char, std::allocator<unsigned char> > const&) src/test/fuzz/http_request.cpp:51:9
  …
  $ echo $?
  1
  ```

  After this PR:

  ```
  $ echo " http:// HTTP/1.1" > input
  $ src/test/fuzz/http_request input
  src/test/fuzz/http_request: Running 1 inputs 1 time(s) each.
  Running: input
  Executed input in 0 ms
  ***
  *** NOTE: fuzzing was not performed, you have only
  ***       executed the target code on a fixed set of inputs.
  ***
  $ echo $?
  0
  ```

  See [`doc/fuzzing.md`](https://github.com/bitcoin/bitcoin/blob/master/doc/fuzzing.md) for information on how to fuzz Bitcoin Core. Don't forget to contribute any coverage increasing inputs you find to the [Bitcoin Core fuzzing corpus repo](https://github.com/bitcoin-core/qa-assets).

  Happy fuzzing :)

Top commit has no ACKs.

Tree-SHA512: 7a6b68e52cbcd6c117487e74e47760fe03566bec09b0bb606afb3b652edfd22186ab8244e8e27c38cef3fd0d4a6c237fe68b2fd22e0970c349e4ab370cf3e304
2022-09-03 10:43:14 -05:00
fanquake
87f1f84068
Merge #19194: util: Don't reference errno when pthread fails.
cb38b069b0f41b1a26264784b1c1303c8ac6ab08 util: Don't reference errno when pthread fails. (MIZUTA Takeshi)

Pull request description:

  Pthread library does not set errno.
  Pthread library's errno is returned by return value.

ACKs for top commit:
  practicalswift:
    ACK cb38b069b0f41b1a26264784b1c1303c8ac6ab08 -- patch looks correct
  MarcoFalke:
    review ACK cb38b069b0f41b1a26264784b1c1303c8ac6ab08
  hebasto:
    ACK cb38b069b0f41b1a26264784b1c1303c8ac6ab08, only squashed commits since the [previous](https://github.com/bitcoin/bitcoin/pull/19194#pullrequestreview-425831739) review.

Tree-SHA512: e6c950e30726e5031db97a7b84c8a9215da5ad3e5d233bcc349f812ad15957ddfe378e26d18339b9e0a5dcac2f50b47a687b87a6a6beaf6139df84f31531321e
2022-09-03 10:43:14 -05:00
PastaPastaPasta
f72ebeec8c
refactor: mark stuff as [[nodiscard]] and use Mutex (#4996)
* refactor: mark some functions as [[nodiscard]] in CDeterministicMN/CDeterministicMNList

* refactor: use a Mutex instead of CCriticalSection
2022-09-03 13:20:06 +03:00
UdjinM6
b30005d246
fix(rpc): masternode outputs should work correctly with multiple outputs created via a single tx (#4967)
* fix(rpc): `masternode outputs` should produce an array

or it would ignore all but 1 outputs produced by the same tx

* rpc: improve `masternode outputs` help

* tests: check that `masternode outputs` show all outputs produced in the same tx
2022-08-31 13:32:35 +03:00
UdjinM6
cd0444fe7f
Revert "fix spaces/monospace fonts in qt console" (#4984)
This reverts commit 54a78ed036.
2022-08-29 12:42:04 +03:00
UdjinM6
ea957a73a0
Merge pull request #4845 from Munkybooty/backports-0.20-pr3
Backports 0.20 pr3
2022-08-29 12:41:20 +03:00
PastaPastaPasta
585eb4f14b
Merge pull request #4971 from knst/bc-bp-cwallet-3
Bitcoin backports with CWallet refactoring #17300, #16237, #16301, #16383, #16798, #16900
2022-08-28 18:26:35 -04:00
UdjinM6
e3cee6366e
Fix qt crash after 4930 (#4992) 2022-08-28 16:46:59 +03:00
UdjinM6
19d08ca3ba
refactor: Refactor CalcCbTxMerkleRootQuorums (#4954)
* wip

* trivial cleanups

* more refactoring/adjustments

* fix: drop incorrect assert

Ofc it's not 0 when cache is used... not sure what I was thinking about.

Co-authored-by: pasta <pasta@dashboost.org>
2022-08-27 14:29:35 +03:00
PastaPastaPasta
7bb30f57c8
Merge pull request #4987 from kittywhiskers/fuzz4
backport: bitcoin#18736, #19379, #19296, #18775, #20188, #19558, #18445, #18744, #19067, #19065 (fuzzing harness backports: part 4)
2022-08-26 18:04:45 -04:00
Kittywhiskers Van Gogh
71e8caf4b9
refactor: migrate globals to managed pointers in preparation for deglobalization (#4930)
* coinjoin: make CCoinJoinServer managed pointer, assign CConnman during init

* coinjoin: make CCoinJoinClientQueueManager managed pointer, assign CConnman during init

* sporks: move spork validation logic downwards after CConnman initialization

* sporks: make CSporkManager a pointer, reduce global invocations

* governance: make CGovernanceManager a pointer, reduce global invocations

* llmq: migrate LLMQ subsystem raw pointers to managed pointers

* masternode: make activeMasternodeManager a managed pointer

* masternode: make masternodeSync a managed pointer, assign CConnman during init

* refactor: make instantsend helper functions class members

* fix: send empty CDeterministicMNList if pointer isn't initialized yet

* fix: refactor governance object retrieval logic across node and ui

Update src/interfaces/node.cpp

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

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2022-08-26 16:52:53 -05:00
Wladimir J. van der Laan
0882c487e3 Merge #17382: rpc: Remove unused boost::this_thread::interruption_point
fa5facd3e72b6d61374b0b93b722b55e2b090020 rpc: Remove unused boost::this_thread::interruption_point (MarcoFalke)

Pull request description:

  There are predefined interruption points for `boost::thread`: https://www.boost.org/doc/libs/1_71_0/doc/html/thread/thread_management.html#interruption_points

  However, the rpc threads are `std::thread`, which does not have an `std:🧵:interrupt` member function to request interruption: https://dev.visucore.com/bitcoin/doxygen/httpserver_8cpp.html#ae1a63374e18b9abd348eb74e4243ea34

  Thus, the interruption points can be removed.

ACKs for top commit:
  laanwj:
    ACK fa5facd3e72b6d61374b0b93b722b55e2b090020, this does nothing.
  practicalswift:
    ACK fa5facd3e72b6d61374b0b93b722b55e2b090020
  jamesob:
    ACK fa5facd3e7

Tree-SHA512: 4e29a44df1f2702cbd1ffdffa559440a8bb800baab64b4116e2c3d27cd64d8d1e8aafe1dc21b1a4e3988470d03be19cae294bd5669f7abf6d487685dc8fd8d7e
2022-08-24 14:29:45 -04:00
Wladimir J. van der Laan
b3488835af Merge #17044: init: Remove auto-import of bootstrap.dat and associated code
104f7de5934f13b837fcf21f6d6b2559799eabe2 remove old bootstrap relevant code (tryphe)

Pull request description:

  This picks up #15954

  I fixed the code and added at a functional test utilizing the scripts in `contrib/linearize` as suggested by @MarcoFalke .

ACKs for top commit:
  laanwj:
    ACK 104f7de5934f13b837fcf21f6d6b2559799eabe2

Tree-SHA512: acac9f285f9785fcbc3afc78118461e45bec2962f90ab90e9f82f3ad28adc90a44f0443b712458ccf486e46d891eb8a67f53e7bee5fa6d89e4387814fe03f117
2022-08-24 14:29:45 -04:00
Samuel Dobson
d839dd4c1e Merge #17258: Fix issue with conflicted mempool tx in listsinceblock
436ad436434b94982bcb7dc1d13a21949263ef73 Fix issue with conflicted mempool tx in listsinceblock (Adam Jonas)

Pull request description:

  Closes #8752 by bringing back abandoned #10470.

  This now checks that returned transactions are not conflicting with any transactions that are filtered out by the given blockhash and add a functional test to prevent this in the future.

  For more context, #8757 was closed in favor of #10470.

ACKs for top commit:
  instagibbs:
    utACK 436ad43643
  kallewoof:
    utACK 436ad436434b94982bcb7dc1d13a21949263ef73
  jonatack:
    I'm not qualifed to give an ACK here but 436ad436434b94982bcb7dc1d13a21949263ef73 appears reasonable. Built/ran tests/verified that this test fails without the change in rpcwallet.cpp:

Tree-SHA512: 63d75cd3d3f19fc84dc38899b200c96179b82b24db263cd0116ee5b715265be647157855c2e35912d2fbc49c7b37db9375d6aab0ac672f0f09bece8431de5ea9
2022-08-24 14:29:45 -04:00
Kittywhiskers Van Gogh
c2cb946d5c merge bitcoin#19065: Add fuzzing harness for CAddrMan 2022-08-23 21:33:34 +05:30
Kittywhiskers Van Gogh
fb77c47ed4 merge bitcoin#19067: Add fuzzing harness for CNode 2022-08-23 21:33:34 +05:30
Kittywhiskers Van Gogh
7241917b6d merge bitcoin#18744: Add fuzzing harnesses for various classes/functions in primitives/ 2022-08-23 21:33:34 +05:30
Kittywhiskers Van Gogh
ed29a2060c merge bitcoin#18445: Add fuzzing harnesses for functions/classes in chain.h and protocol.h 2022-08-23 21:33:34 +05:30
Kittywhiskers Van Gogh
1e9733f195 merge bitcoin#19558: split pthread flags out of ldflags and dont use when building libconsensus 2022-08-23 21:33:33 +05:30
Kittywhiskers Van Gogh
d9ea7fa716 merge bitcoin#20188: Add fuzzing harness for CConnman 2022-08-23 21:31:21 +05:30
Kittywhiskers Van Gogh
24a58c3934 merge bitcoin#18775: Add fuzzing harnesses for various classes/functions in policy/ (CBlockPolicyEstimator, IsRBFOptIn(…), etc.) 2022-08-23 21:31:20 +05:30
UdjinM6
c078e666a4
feat(rpc): Add service field for each member in quorum info results (#4977)
* feat(rpc): Add `service` field for each member in `quorum info` results

* add test
2022-08-22 22:43:07 +03:00
Kittywhiskers Van Gogh
5b0b206853 merge bitcoin#19296: Add fuzzing harness for AES{CBC,}256{Encrypt,Decrypt}, poly1305_auth, CHKDF_HMAC_SHA256_L32, ChaCha20 and ChaCha20Poly1305AEAD 2022-08-21 18:09:28 +05:30
Kittywhiskers Van Gogh
50b6c2af4c merge bitcoin#19379: Add fuzzing harness for SigHasLowR(...) and ecdsa_signature_parse_der_lax(...) 2022-08-21 18:09:28 +05:30
Kittywhiskers Van Gogh
208ca5bd7e merge bitcoin#18736: Add fuzzing harnesses for various classes/functions in util/ 2022-08-21 18:09:25 +05:30
UdjinM6
af085cd528
fix: Allow triggers with p2sh after DIP0024 (#4973) 2022-08-17 16:45:04 +03:00
Konstantin Akimov
d8ad2dd701 Fixup for rpc wallet unused variable 2022-08-16 22:13:31 +07:00
fanquake
1787334e29 Merge #16900: doc: Fix doxygen comment for SignTransaction in rpc/rawtransaction_util
fa8d65f07187590ae507c65a6dd63fd47b8d1fb3 doc: Fix doxygen comment for SignTransaction in rpc/rawtransaction_util (MarcoFalke)

Pull request description:

  The param `coins` to `SignTransaction` is final and can thus not be extended (as suggested by the doc).

ACKs for top commit:
  practicalswift:
    ACK fa8d65f07187590ae507c65a6dd63fd47b8d1fb3 -- const correctness is good and diff looks correct
  fanquake:
    ACK fa8d65f07187590ae507c65a6dd63fd47b8d1fb3

Tree-SHA512: 041e159f2c3cf96e296173c31f3e5f35bbc7711cc888aa4bf08aaa8c65c95ee7f7672f65396690a9af45795a618eea0fadde7fb02d29ec85f1b4df5e6d9e0c7a
2022-08-16 01:39:24 +07:00
fanquake
b2a97a3b13 Merge #16798: Refactor rawtransaction_util's SignTransaction to separate prevtx parsing
39034f1ee628dae0bc9da5b1b30b8a424e66d968 Refactor rawtransaction_util's SignTransaction to have previous tx parsing be separate (Andrew Chow)

Pull request description:

  Currently the `SignTransaction` function has to handle both the actual signing and parsing of previous transaction data. This PR splits it so that `SignTransaction` only handles the signing itself and adds a `ParsePrevouts` function which handles parsing the prevtx information.

  This allows for `SignTransaction` to just take any `SigningProvider`.

  Split from #16341

ACKs for top commit:
  MarcoFalke:
    ACK 39034f1ee628dae0bc9da5b1b30b8a424e66d968
  instagibbs:
    utACK 39034f1ee6
  ryanofsky:
    utACK 39034f1ee628dae0bc9da5b1b30b8a424e66d968. No change since previously reviewed b49bbb939be92a67ff77c3f7bca5bb94dd141906, https://github.com/bitcoin/bitcoin/pull/16341#pullrequestreview-278610269 other than rebase with no conflicts.

Tree-SHA512: 09f7733e90691766bfb5cf0f20e913dbf270bd3b51abdcad966b24d110e562ed85fd3d0d1d7bbea61f903340060052ec73c4817b09aee0dc1f3916d781a9e40c
2022-08-15 21:38:06 +07:00
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
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
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
39bf079f54
fix(llmq): Calculate quorum members while not debugging llmq
¯\_(ツ)_/¯
2022-07-27 23:34:29 +03: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
e9500f597a
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-26 00:39:04 +03:00
UdjinM6
5a5278d398
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-26 00:38:07 +03:00
UdjinM6
17b15efd61
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-26 00:36:17 +03:00
UdjinM6
1f161e520d
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-26 00:35:45 +03:00
Odysseas Gabrielides
5dbf375d31
Store QuorumDataRequests per {ProTx, quorumHash, llmqType} (#4935) 2022-07-26 00:34:33 +03:00
PastaPastaPasta
4bdb9ac95d
refactor(llmq): misc refactors (#4922)
* refactor: remove c-style casts

* refactor: avoid logging initialization when not needed

* refactor: require ';' after LogPrintfFinalCommitment

* refactor: prefer lambda to std::bind

* refactor: explicit nullptr comparison

* refactor: compress a lock and set

* refactor: don't use else after return

* refactor: more const

* refactor: avoid implicit bool conversions

* refactor: add more const

* refactor: use structured binding

* refactor: compact lambda into inline

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

* move scheduler_thread to initialization list

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2022-07-18 23:55:47 +03:00
UdjinM6
666859b47f
feat(llmq): Ensure connections between IS quorums (#4917)
* fix(llmq): Ensure connections between quorums

Every masternode will now "watch" a single node from _every other_ quorum in addition to intra-quorum connections. This should make propagation of recsigs produced by one quorum to other quorums much more reliable.

* fix: Do this only for masternodes which participate in IS quorums

* refactor: rename `CQuorumManager::EnsureQuorumConnections` to better match the actual behaviour

(and avoid confusion with `CLLMQUtils::EnsureQuorumConnections`)

* refactor: move IS quorums watch logic into `CQuorumManager::CheckQuorumConnections`

avoid calling slow `ScanQuorums` (no caching atm) inside the loop

* tests: check that inter-quorum connections are added

* use `ranges::any_of`
2022-07-18 22:26:51 +03:00
UdjinM6
0d67aa1915
fix: Pass KeyOriginInfo instead of CKeyMetadata to DeriveChildExtKey (#4918)
Resolves "hdchain -> wallet/walletdb -> ... -> hdchain" circular dependencies
2022-07-18 16:56:33 +03:00
Kittywhiskers Van Gogh
38781fc114 merge bitcoin#17989: Add one specialized ProcessMessage(...) fuzzing binary per message type for optimal results when using coverage-guided fuzzing 2022-07-15 21:24:21 +05:30
Kittywhiskers Van Gogh
141c6e2920 merge bitcoin#19934: Add fuzzing harness for Keccak and SHA3_256 2022-07-15 21:24:21 +05:30
Kittywhiskers Van Gogh
e17767ccf1 merge bitcoin#19286: Add fuzzing harness for CHash{160,256}, C{HMAC_,}SHA{1,256,512}, CRIPEMD160, CSipHasher, etc. 2022-07-15 21:24:21 +05:30
Kittywhiskers Van Gogh
bf04694e73 merge bitcoin#18393: Don't assume presence of __builtin_mul_overflow in MultiplicationOverflow(...) fuzzing harness 2022-07-15 21:24:21 +05:30
Kittywhiskers Van Gogh
b50f00a2d5 merge bitcoin#18190: Add fuzzing harness for Golomb-Rice coding (GolombRiceEncode/GolombRiceDecode) 2022-07-15 21:24:21 +05:30
Kittywhiskers Van Gogh
93d3c26063 merge bitcoin#18363: Add fuzzing harness for HTTPRequest, libevent's evhttp and related functions 2022-07-15 21:24:21 +05:30
Kittywhiskers Van Gogh
01367c944e fix(fuzz): statically cast to consistent type to account for type similarity
AdditionOverflow is a template function that expects both inputs to explicitly be of the same type
2022-07-15 21:24:20 +05:30
Kittywhiskers Van Gogh
eb2fa81288 partial bitcoin#19143: Add fuzzing harnesses for CAutoFile, CBufferedFile, LoadExternalBlockFile and other FILE* consumers 2022-07-15 21:23:01 +05:30
Kittywhiskers Van Gogh
da690542f4 merge bitcoin#19222: Add fuzzing harness for BanMan 2022-07-15 21:09:53 +05:30
Kittywhiskers Van Gogh
cd9b83c15e merge bitcoin#19247: Add fuzzing harness for {Read,Write}{LE,BE}{16,32,64} 2022-07-15 21:09:53 +05:30
Kittywhiskers Van Gogh
a7109d8724 partial bitcoin#18314: Add deserialization fuzzing of SnapshotMetadata (utxo_snapshot). Increase fuzzing coverage 2022-07-15 21:09:53 +05:30
Kittywhiskers Van Gogh
0d5a7929ac partial bitcoin#18047: Add basic fuzzing harness for CNetAddr/CService/CSubNet related functions (netaddress.h) 2022-07-15 21:09:53 +05:30
Kittywhiskers Van Gogh
09825e4678 merge bitcoin#18867: Add fuzzing harness for CCoinsViewCache 2022-07-15 21:09:53 +05:30
Odysseas Gabrielides
2974fa20bb
feat(rpc): getnetworkinfo RPC enrichment response (#4913)
* Enrich getnetworkinfo

* Adjustements
2022-07-14 16:13:47 -05:00
Odysseas Gabrielides
beba663a57
fix!: GetNumCommitmentsRequired Rotation (#4915)
* Fix in GetNumCommitmentsRequired

* Correction
2022-07-14 16:12:33 -05:00
UdjinM6
32051a35c0
fix(llmq): mark mns "bad" based on the failed connect attempts count (#4910)
* fix(llmq): mark mns "bad" based on the failed connect attempts count

Avoid using "last success time" as a proxy

* fix(tests): tweak feature_llmq_simplepose.py
2022-07-14 21:38:02 +03:00
Kittywhiskers Van Gogh
04b7bcf52a
feat(llmq): add human-readable message alongside error code (#4916) 2022-07-14 12:53:42 -05:00
PastaPastaPasta
6c0a63360f
Merge pull request #4882 from kittywhiskers/xliff_update
backport: bitcoin#21694 (Use XLIFF file to provide more context to Transifex)
2022-07-13 08:27:34 -04:00
Konstantin Akimov
0a951622f1
Bitcoin backport #16227 refactoring CWallet (#4903)
* Add HaveKey and HaveCScript to SigningProvider

* Remove CKeyStore and squash into CBasicKeyStore

* Move HaveKey static function from keystore to rpcwallet where it is used

* scripted-diff: rename CBasicKeyStore to FillableSigningProvider

-BEGIN VERIFY SCRIPT-
git grep -l "CBasicKeyStore" | xargs sed -i -e 's/CBasicKeyStore/FillableSigningProvider/g'
-END VERIFY SCRIPT-

* Move KeyOriginInfo to its own header file

* Move various SigningProviders to signingprovider.{cpp,h}

Moves all of the various SigningProviders out of sign.{cpp,h} and
keystore.{cpp,h}. As such, keystore.{cpp,h} is also removed.

Includes and the Makefile are updated to reflect this. Includes were largely
changed using:
git grep -l "keystore.h" | xargs sed -i -e 's;keystore.h;script/signingprovider.h;g'

* Remove CCryptoKeyStore and move all of it's functionality into CWallet

Instead of having a separate CCryptoKeyStore that handles the encryption
stuff, just roll it all into CWallet.

* Fixed cases of mess CWallet functions with CCryptoKeyStore and conflicts

* Move WatchOnly stuff from SigningProvider to CWallet

* Fixes for lint cirtular dependencies to calm linter

Co-authored-by: Andrew Chow <achow101-github@achow101.com>
2022-07-12 22:46:31 -05:00
PastaPastaPasta
eefdae1a53
Merge pull request #4829 from kittywhiskers/fuzz2
backport: bitcoin#18417, #18521, #18529, #18176, #18423, #17926, #18353, #18407, #18455, #18565, #18867 (fuzzing harness backports: part 2)
2022-07-12 12:32:28 -04:00
UdjinM6
a483122f5f
fix(net): Extend blocks-relay-only to also ignore some Dash-specific messages/invs (#4888)
* fix(net): Extend blocks-relay-only to also ignore some Dash-specific messages/invs

* Clarify few things
2022-07-07 18:11:38 +03:00
UdjinM6
e98929a3e9
fix(dkg): let probes on mainnet ignore existing inbound connections (#4908) 2022-07-07 10:49:55 +03:00
UdjinM6
58cfeaf321
fix(dkg): let masternodes miss few connection attempts before considering them "bad" (#4907)
* fix(dkg): let masternodes miss few connection attempts before considering them "bad"

Should help with dashd updates/restarts for nodes that were successfully probed recently.

* fix
2022-07-07 10:49:34 +03:00
UdjinM6
320edd5575
fix(net): Let MNs accept conections as soon as blockchain is synced (#4905)
Do not wait for governance data, it's not needed for DKGs
2022-07-07 00:25:02 +03:00
UdjinM6
40486ada82
feat(llmq): avoid probing mns too often instead of using a tiny window to probe them (#4904)
We only call AddQuorumProbeConnections when a new quorum is intialized. It's possible to miss the 10 minute probe window if Contribute phase takes too long (when 2 blocks were mined in 10+ minutes). 50 minutes should be enough and probing once in 10 minutes should be safe.
2022-07-07 00:24:34 +03:00
Kittywhiskers Van Gogh
5715842187 merge bitcoin#21349: Fix fuzz-cuckoocache cross-compiling for Windows with DEBUG=1 2022-07-07 01:01:32 +05:30
Kittywhiskers Van Gogh
d016ccd065 merge bitcoin#18565: Add fuzzing harnesses for classes/functions in checkqueue.h and cuckoocache.h. Add fuzzing coverage. 2022-07-06 22:14:04 +05:30
Kittywhiskers Van Gogh
ee7e37ae01 merge bitcoin#18455: Add fuzzing harness for functions/classes in flatfile.h, merkleblock.h, random.h, serialize.h and span.h 2022-07-06 22:13:37 +05:30
Kittywhiskers Van Gogh
1b424f6b3b merge bitcoin#18407: Add proof-of-work fuzzing harness 2022-07-06 22:13:37 +05:30
Kittywhiskers Van Gogh
7a954b8bd7 merge bitcoin#18423: Add fuzzing harness for classes/functions in blockfilter.h. Add integer {de,}serialization fuzzing 2022-07-06 22:13:37 +05:30
Kittywhiskers Van Gogh
f319ddbe85 merge bitcoin#18176: Add fuzzing harness for CScript and CScriptNum operations 2022-07-06 22:13:37 +05:30
Kittywhiskers Van Gogh
26ea6762d3 merge bitcoin#18529: Add fuzzer version of randomized prevector test 2022-07-06 22:13:37 +05:30
Kittywhiskers Van Gogh
1552a1e9dc merge bitcoin#18521: Add process_messages harness 2022-07-06 22:13:37 +05:30
Kittywhiskers Van Gogh
6ee033b2da merge bitcoin#18417: Add fuzzing harnesses for functions in addrdb.h, net_permissions.h and timedata.h 2022-07-06 22:13:36 +05:30
Kittywhiskers Van Gogh
ab8822c184 merge bitcoin#18353: Add fuzzing harnesses for classes CBlockHeader, CFeeRate and various functions 2022-07-06 21:48:11 +05:30
Kittywhiskers Van Gogh
d807cc7a8a merge bitcoin#17926: Add key_io fuzzing harness. Fuzz additional functions in existing fuzzing harnesses 2022-07-06 21:48:10 +05:30
UdjinM6
22262137a2
Merge pull request #4900 from UdjinM6/followup_4880
fix(qt): fix crashes introduced by 15937 and 19099 backports
2022-07-05 17:36:56 +03:00
PastaPastaPasta
87b6d1c958
Merge pull request #4830 from kittywhiskers/auxiliary_ports
backport: bitcoin#15141, #15437, #16240, #18923, #19219, #19277, #20016, #20671 (auxiliary backports)
2022-07-03 12:13:11 -05:00
UdjinM6
8755067a32
feat(qt): Make wallet repair options only available when there is a single loaded wallet only
Also fixes a crash for `-nowallet` introduced via 15937 backport (in 4880)
2022-07-03 11:01:19 +03:00
MarcoFalke
867b6efe4d
Merge bitcoin-core/gui#102: Fix SplashScreen crash when run with -disablewallet
c056064a4a93be3601a63b37afea41f8b878df79 gui: Fix SplashScreen crash when run with -disablewallet (Hennadii Stepanov)

Pull request description:

  This PR fixes the bug introduced in https://github.com/bitcoin/bitcoin/pull/19099:

  ```
  $ src/qt/bitcoin-qt -disablewallet
  bitcoin-qt: interfaces/node.cpp:236: auto interfaces::(anonymous namespace)::NodeImpl::walletClient()::(anonymous class)::operator()() const: Assertion `"m_context->wallet_client" && check' failed.
  Aborted (core dumped)
  ```

ACKs for top commit:
  Sjors:
    tACK c056064
  promag:
    ACK c056064a4a93be3601a63b37afea41f8b878df79.

Tree-SHA512: 263d9efd5899cc6e447dfc5142bf911ca627149fac0a1c5e5b58dd196aa5e0d12fe13e3f750fb5f3c4338222f7959935d2f77391263f967dbca2e0e79a416a29
2022-07-03 11:00:20 +03:00