Commit Graph

22224 Commits

Author SHA1 Message Date
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
822c5208d2 merge bitcoin#18249: Bump timeouts to accomodate really slow disks 2022-10-02 12:05:13 +05:30
Kittywhiskers Van Gogh
debaa56c4a merge bitcoin#19659: Add a seed corpus generation option to the fuzzing test_runner 2022-10-02 12:05:13 +05:30
Kittywhiskers Van Gogh
8949c143da partial bitcoin#18929: Pass down LD_LIBRARY_PATH and MAKEJOBS to fuzz test_runner 2022-10-02 12:05:13 +05:30
Kittywhiskers Van Gogh
5f017981d6 merge bitcoin#18688: Run in parallel 2022-10-02 12:05:13 +05:30
Kittywhiskers Van Gogh
66a400eef5 partial bitcoin#18166: Run fuzz testing test cases (bitcoin-core/qa-assets) under valgrind to catch memory errors 2022-10-02 12:05:13 +05:30
Kittywhiskers Van Gogh
b567c459e3 merge bitcoin#18566: Set -use_value_profile=1 when merging fuzz inputs 2022-10-02 12:05:13 +05:30
Kittywhiskers Van Gogh
059e3d0981 merge bitcoin#18509: Avoid running over all inputs after merging them 2022-10-02 12:05:13 +05:30
Kittywhiskers Van Gogh
acfcc6e1ff merge bitcoin#18300: Add option to merge input dir to test runner 2022-10-02 12:05:13 +05:30
Kittywhiskers Van Gogh
c96147a3fb merge bitcoin#18047: Add basic fuzzing harness for CNetAddr/CService/CSubNet related functions (netaddress.h) 2022-10-02 12:05:13 +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
UdjinM6
4d4ebfa7e3
Merge pull request #5029 from PastaPastaPasta/backport/18.0.2-backports
Backport: 18.0.2 backports
2022-09-30 18:53:59 +03:00
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
pasta
8205f22d53
docs: add release notes for 18.0.2 2022-09-30 10:23:32 -05:00
Kittywhiskers Van Gogh
666ff7bff9
merge bitcoin#14193: Add missing mempool locks
Co-authored-by: "UdjinM6 <UdjinM6@users.noreply.github.com>"
2022-09-30 10:21:52 -05:00
pasta
96f4022a6a
chore: archive release-nodes.md 2022-09-29 16:40:28 -05:00
pasta
0b60096d8a
chore: bump version to 18.0.2 2022-09-29 16:32:40 -05:00
UdjinM6
e8afde2740
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-29 16:31:28 -05:00
UdjinM6
8efd7f04c6
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-29 16:30:10 -05:00
UdjinM6
c92cbce6a5
trivial: Fix trailing whitespaces in release notes (#4989)
Local CI linter complains
2022-09-29 16:30:01 -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
8dc4e05c1a merge bitcoin#19264: don't import asyncio to test magic bytes 2022-09-24 08:51:05 +05:30
Kittywhiskers Van Gogh
3289e55877 merge bitcoin#18764: replace inv type magic numbers by constants 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
82938bdfb9 trivial: relocate MSG_* constants from mininode to messages 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
Konstantin Akimov
7228d918f6
fix(tests): fix for default initialization of structures in messages.py (#5008)
Excepted zeroes in non-initialized data, in-fact there are non-zero characters.

>>> print(b'\\x0'.hex())
5c7830
>>> print(b'\x00'.hex())
00
2022-09-19 13:04:20 +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
ed096a5d28
Merge #18774: test: added test for upgradewallet RPC
66fe7b1a98c03f690dcf60d359baac124658aeae test: added test for upgradewallet RPC (Harris)

Pull request description:

  This PR adds tests for the newly merged *upgradewallet* RPC.

  Additionally, it expands `test_framework/util.py` by adding the function `adjust_bitcoin_conf_for_pre_17` to support nodes that don't parse configuration sections.

  This test uses two older node versions, v0.15.2 and v0.16.3, to create older wallet versions to be used by `upgradewallet`.

  Fixes https://github.com/bitcoin/bitcoin/issues/18767

Top commit has no ACKs.

Tree-SHA512: bb72ff1e829e2c3954386cc308842820ef0828a4fbb754202b225a8748f92d4dcc5ec77fb146bfd5484a5c2f29ce95adf9f3fb4483437088ff3ea4a8d2c442c1
2022-09-16 19:22:12 +05:30
MarcoFalke
3dde9ab5c3
Merge #18157: doc: fixing init.md documentation to not require rpcpassword
a2a03c3ca94b1cdd279ac09f2a81e04d262586fd fixing documentation to not require rpcpassword (“jkcd”)

Pull request description:

  Configuration section in [doc/init.md](https://github.com/bitcoin/bitcoin/blob/master/doc/init.md) says user must set rpcpassword in order to run bitcoind. Since [71cbea](71cbeaad9a) fixed the code to use a cookie for authentication, it is not mandatory to set rpcpassword in the configuration.

  Fixes #16346

ACKs for top commit:
  hebasto:
    ACK a2a03c3ca94b1cdd279ac09f2a81e04d262586fd, modulo nit

Tree-SHA512: a62816fef78bed32200bb278cfc7aacf6ea154a60fdf5181927e48b806a1bd694bdf3ccec8362f5e58aad694d636c63f540323d54d85b61deaa417b95b8b56eb
2022-09-16 19:22:12 +05:30
MarcoFalke
2e28e6eee3
Merge #18633: test: Properly raise FailedToStartError when rpc shutdown before warmup finished (take 2)
fa03713e133e3017112fdd5c278e0c8643054578 test: Properly raise FailedToStartError when rpc shutdown before warmup finished (take 2) (MarcoFalke)

Pull request description:

  actually (?) fix #18561

  See most recent traceback https://travis-ci.org/github/bitcoin/bitcoin/jobs/674668692#L7062

  I believe the reason the error is still there is that ConnectionResetError is derived from OSError:

  ConnectionResetError(ConnectionError(OSError))

  And IOError is an alias for OSError since python 3.3, see https://docs.python.org/3/library/exceptions.html#IOError

  So fix that by renaming IOError to the alias OSError and move the less specific catch clause down a few lines.

ACKs for top commit:
  jonatack:
    ACK fa03713e133e3017112fdd5c278e0c8643054578

Tree-SHA512: 6e5b214ed9101bf8ebe7472dcc1f9e9d128e2575c93ec00c8d0774ae1a9b52a8c2a653a45a0eab8d881570b08dd5ffeddf5aca88a10438c366e1f633253cb0b5
2022-09-16 19:22:12 +05:30