aboutsummaryrefslogtreecommitdiff
path: root/src/test
AgeCommit message (Collapse)Author
2021-12-28test: Remove unused AddrManTest classMartin Zumsande
2021-12-28test: Remove tests for internal helper functionsMartin Zumsande
The logic of these functions is already covered by existing unit tests using publicly exposed functions of the interface. Therefore, removing them does not decrease test coverage.
2021-12-28test: use AddrMan instead of AddrManTest where possibleMartin Zumsande
Switches to AddrMan for tests that use no features of AddrManTest. Also removes unusued AddrManTest variables Co-Authored-By: Amiti Uttarwar <amiti@uttarwar.org>
2021-12-28test: Inline SimConnFail functionMartin Zumsande
No need for a function, since it is only used once. Co-Authored-By: Amiti Uttarwar <amiti@uttarwar.org>
2021-12-28test: delete unused GetBucketAndEntry functionAmiti Uttarwar
2021-12-28test: Update addrman_serialization unit test to use AddrMan's interfaceAmiti Uttarwar
By updating the test to use FindEntry, it no longer needs to reach into AddrMan's internals (via GetBucketAndEntry) to assert expected behaviors.
2021-12-23Merge bitcoin/bitcoin#23736: test: call VerifyLoadedChainstate during ↵fanquake
ChainTestingSetup 826e12b010eda4238f9e8cd875e8915a405bed0d test: call VerifyLoadedChainstate during ChainTestingSetup (James O'Beirne) Pull request description: for additional coverage and similarity to actual init process. Followup to #23280. ACKs for top commit: dongcarl: Code Review ACK 826e12b010eda4238f9e8cd875e8915a405bed0d ryanofsky: Code review ACK 826e12b010eda4238f9e8cd875e8915a405bed0d Tree-SHA512: a4e7fd25e5d7a08b1e154ae6daf67c3048260a2684b0e569b544dd826693b7b969db9923b191e499cb8d8d0a2a73eb9330ff45909313145a9abb6052eb8c3ad9
2021-12-20Merge bitcoin/bitcoin#23780: refactor, test: update `addrman_tests.cpp` to ↵MarcoFalke
use output from `AddrMan::Good()` bf4f8171352e9b384b42c91da61dfc9c3ca89ed8 refactor: addrman_select test (josibake) 5a64dc018c04ce16202a8e58ce92d2657c0b1806 refactor: addrman_evictionworks test (josibake) e281fccd8a80d7cd48c3b17d58fd4a8915e1e965 refactor: addrman_noevict test (josibake) 8bdd9240d4310aafa1332159355f106a8fcfc5c9 refactor: addrman_selecttriedcollisions test (josibake) Pull request description: As a follow-up to #23713 , this PR refactors the remaining tests in `src/tests/addrman_tests.cpp` to use the output from `AddrMan::Good()` where appropriate. ACKs for top commit: naumenkogs: ACK bf4f8171352e9b384b42c91da61dfc9c3ca89ed8 mzumsande: Code Review ACK bf4f8171352e9b384b42c91da61dfc9c3ca89ed8 Tree-SHA512: 93cc127aecff42c1c174daa04911af7e3460a5c40ddf96952fe4a6ab86fa1ff22d66724326abb709008d7f9f79c26c55c6d62753c40059c9ac60f869507ec913
2021-12-18Merge bitcoin/bitcoin#23219: p2p, refactor: tidy up LookupSubNet()W. J. van der Laan
c44c20108f7b7314f59f034110789385a24db280 p2p, refactor: drop unused DNSLookupFn param in LookupSubnet() (Vasil Dimov) f0c9e68080432c1ab11b14e571b8dfb7cfe727f8 p2p, refactor: tidy up LookupSubNet() (Jon Atack) Pull request description: This pull originally resolved a code `TO-DO`, as well as fixing different param names between the function declaration and definition, updating the function to current style standards, clearer variable naming, and improving the Doxygen documentation. Following the merge of #17160, it now does the non-`TODO` changes and also now drops an unused param to simplify the function. ACKs for top commit: dunxen: ACK c44c201 vasild: ACK c44c20108f7b7314f59f034110789385a24db280 shaavan: crACK c44c20108f7b7314f59f034110789385a24db280 Tree-SHA512: 55f64c7f403819dec84f4da06e63db50f7c0601a2d9a1ec196fda667c220ec6f5ad2a3c95e0e02275da9f6da6b984275d1dc10e19ed82005c5e13da5c5ecab02
2021-12-18Merge bitcoin/bitcoin#23781: test: Fix `system_tests/run_command` on WindowsW. J. van der Laan
edd0313ae7c94420642081c9172e349080bb9335 test: Improve "invalid_command" subtest in system_tests for Windows (Hennadii Stepanov) fb1b0590af138e317803893d2cab9dc887f33c5b test: Fix "non-zero exit code" subtest in system_tests for Windows (Hennadii Stepanov) 0aad33db6410ed36fa0f4b96245cacbae7897d2e test: Fix "false" subtest in system_tests for Windows (Hennadii Stepanov) 507c009c1ee68a4c3ad100f765bf854307d5bf39 test: Fix "echo" subtest in the system_tests for Windows (Hennadii Stepanov) Pull request description: An attempt to fix bitcoin/bitcoin#23775. With this PR on Windows 10 Pro 21H1 (build 19043.1348): ``` C:\Users\hebasto\bitcoin>src\test_bitcoin.exe --run_test=system_tests/run_command Running 1 test case... *** No errors detected C:\Users\hebasto\bitcoin>src\test_bitcoin.exe Running 482 test cases... *** No errors detected ``` ACKs for top commit: sipsorcery: tACK edd0313ae7c94420642081c9172e349080bb9335 Tru3Nrg: tACK https://github.com/bitcoin/bitcoin/pull/23781/commits/edd0313ae7c94420642081c9172e349080bb9335 Tree-SHA512: 66a4f2372858011ff862b71c6530bedb8bc731b18595636fac9affc9189d9320f212c68b62498f2b57ee7a07f59e842dbec085b76a7419791d1a06c8e80e7744
2021-12-17Refactor the chacha20 differential fuzz teststratospher
2021-12-17Merge bitcoin/bitcoin#22704: fuzz: Differential fuzzing to compare Bitcoin ↵W. J. van der Laan
Core's and D. J. Bernstein's implementation of ChaCha20 4d0ac72f3ae78e3c6a0d5dc4f7e809583abd0546 [fuzz] Add fuzzing harness to compare both implementations of ChaCha20 (stratospher) 65ef93203cc6a977c8e96f07cb9155f46faf5004 [fuzz] Add D. J. Bernstein's implementation of ChaCha20 (stratospher) Pull request description: This PR compares Bitcoin Core's implementation of ChaCha20 with D. J. Bernstein's in order to find implementation discrepancies if any. ACKs for top commit: laanwj: Code review ACK 4d0ac72f3ae78e3c6a0d5dc4f7e809583abd0546 Tree-SHA512: f826144b4db61b9cbdd7efaaca8fa9cbb899953065bc8a26820a566303b2ab6a17431e7c114635789f0a63fbe3b65cb0bf2ab85baf882803a5ee172af4881544
2021-12-15Merge bitcoin/bitcoin#22674: validation: mempool validation and submission ↵W. J. van der Laan
for packages of 1 child + parents 046e8ff264be6b888c0f9a9d822e32aa74e19b78 [unit test] package submission (glozow) e12fafda2dfbbdf63f125e5af797ecfaa6488f66 [validation] de-duplicate package transactions already in mempool (glozow) 8310d942e046c5a9b6bd90afdcd3af68dd91e081 [packages] add sanity checks for package vs mempool limits (glozow) be3ff151a1f9665720cdf70d072b098a2f9726a9 [validation] full package accept + mempool submission (glozow) 144a29099a865ac1dc3e5291d9529fbcca9c83a4 [policy] require submitted packages to be child-with-unconfirmed-parents (glozow) d59ddc5c3d1c035474d7bc9fa9f8a0eeb1c8498c [packages/doc] define and document package rules (glozow) ba26169f6035c238378a3c9647213328a006fa23 [unit test] context-free package checks (glozow) 9b2fdca7f03911ac40fe0f8a0b5da534bee4554b [packages] add static IsChildWithParents function (glozow) Pull request description: This is 1 chunk of [Package Mempool Accept](https://gist.github.com/glozow/dc4e9d5c5b14ade7cdfac40f43adb18a); it restricts packages to 1 child with its parents, doesn't allow conflicts, and doesn't have CPFP (yet). Future PRs (see #22290) will add RBF and CPFP within packages. ACKs for top commit: laanwj: Code review ACK 046e8ff264be6b888c0f9a9d822e32aa74e19b78 Tree-SHA512: 37dbba37d527712f8efef71ee05c90a8308992615af35f5e0cfeafc60d859cc792737d125aac526e37742fe7683ac8c155ac24af562426213904333c01260c95
2021-12-15refactor: addrman_select testjosibake
Check that `Good()` is successful whenever it is called.
2021-12-15refactor: addrman_evictionworks testjosibake
Test for collisions and duplicates directly with `Good()`. If an entry to tried is a duplicate, `Good()` will return false but `SelectTriedCollision()` will be empty (assuming there were no prior collisions). If there is a collision, `Good()` will retun false and `SelectTriedCollision()` will return a value.
2021-12-15refactor: addrman_noevict testjosibake
Check the response from `Good()` wherever it is called. Previously, the test was using `size()` (incorrect for checking tried) and `SelectTriedCollision()` to determine if a collision happened.
2021-12-15refactor: addrman_selecttriedcollisions testjosibake
Check `Good()` directly when adding addresses. Previously, test would check `size()`, which is incorrect. Check that duplicates are also handled by checking the output from `SelectTriedCollision()` when `Good()` returns false.
2021-12-15test: Improve "invalid_command" subtest in system_tests for WindowsHennadii Stepanov
No need to explain code with comments.
2021-12-15test: Fix "non-zero exit code" subtest in system_tests for WindowsHennadii Stepanov
2021-12-15test: Fix "false" subtest in system_tests for WindowsHennadii Stepanov
2021-12-15test: Fix "echo" subtest in the system_tests for WindowsHennadii Stepanov
2021-12-15Merge bitcoin/bitcoin#23758: net: Use type-safe mockable time for peer ↵MarcoFalke
connection time fad943821e35d0eb2143061e718f0193e12a4c71 scripted-diff: Rename touched member variables (MarcoFalke) fa663a4c0d20487ed3f7a93e1c2ca9932b05f5a8 Use mockable time for peer connection time (MarcoFalke) fad7ead146a152f46b25ce6623e05cbb1dbc8cca refactor: Use type-safe std::chrono in net (MarcoFalke) Pull request description: Benefits: * Type-safe * Mockable * Allows to revert a temporary test workaround ACKs for top commit: naumenkogs: ACK fad943821e35d0eb2143061e718f0193e12a4c71 shaavan: ACK fad943821e35d0eb2143061e718f0193e12a4c71 Tree-SHA512: af9bdfc695ab727b100c6810a7289d29b02b0ea9fa4fee9cc1f3eeefb52c8c465ea2734bae0c1c63b3b0d6264ba2c493268bc970ef6916570eb166de77829d82
2021-12-15Merge bitcoin/bitcoin#22362: Drop only invalid entries when reading banlist.jsonW. J. van der Laan
faa6c3d44c861c0486c1369e1d098b7645ab07cd net: Drop only invalid entries when reading banlist.json (MarcoFalke) Pull request description: All entries will be dropped when there is at least one invalid one in `banlist.json`. Fix this by only dropping invalid ones. Also suggested in https://github.com/bitcoin/bitcoin/pull/20966#issuecomment-861150204 ACKs for top commit: laanwj: Re-ACK faa6c3d44c861c0486c1369e1d098b7645ab07cd Tree-SHA512: 5a58e7f1dcabf78d0c65d8c6d5d997063af1efeaa50ca7730fc00056fda7e0061b6f7a38907ea045fe667c9f61d392e01e556b425a95e6b126e3c41cd33deb83
2021-12-15Merge bitcoin/bitcoin#23174: validation: have LoadBlockIndex account for ↵MarcoFalke
snapshot use 2283b9cd1ee0fbd1e8ebc61673b1fe7596199a24 test: add tests for LoadBlockIndex when using multiple chainstates (James O'Beirne) 0fd599a51a700c028d6f7ed8067d2d9f6e6a04a5 validation: have LoadBlockIndex account for snapshot use (James O'Beirne) d0c6e61f5dd3b6af818459d9d03b7ba316c5a3f7 validation: don't modify genesis during snapshot load (James O'Beirne) Pull request description: This is part of the [assumeutxo project](https://github.com/bitcoin/bitcoin/projects/11) (parent PR: #15606) --- Currently, `BlockManager::LoadBlockIndex` adds all blocks that have downloaded transactions to the active chain state's `setBlockIndexCandidates` set, ignoring the background chain state. This PR changes ChainstateManager::LoadBlockIndex to update `setBlockIndexCandidates` in the background chain, not just the active chain. In the active chain, the same blocks are added as before. In the background chain, only blocks that have actually been validated, not blocks marked assumed-valid are added so the background chain will continue to download and validate assumed-valid blocks. ACKs for top commit: MarcoFalke: Concept ACK 2283b9cd1ee0fbd1e8ebc61673b1fe7596199a24 🤽 Sjors: utACK 2283b9cd1ee0fbd1e8ebc61673b1fe7596199a24 Tree-SHA512: 7c9a80802df4722d85d12b78d2e7f628ac5f11cb8be66913d5c3230339bd1220c6723805509d4460826a17d1dc04b0ae172eb7d09ac0ea5dc5e41d77975cbd5e
2021-12-15Merge bitcoin/bitcoin#23713: refactor, test: refactor ↵MarcoFalke
addrman_tried_collisions test to directly check for collisions caac999ff0fc5c98fa438b7e96fe1232f6573fd5 refactor: remove dependence on AddrManTest (josibake) f961c477b56737c546c275e4d86cecfa3f75d48c refactor: check Good() in tried_collisions test (josibake) 207f1c825c632c54af009516d376d392ea9106fa refactor: make AddrMan::Good return bool (josibake) Pull request description: Previously, the `addrman_tried_collisions` test behaved in the following way: 1. add an address to addrman 2. attempt to move the new address to the tried table (using `AddrMan.Good()`) 3. verify that `num_addrs` matched `size()` to check for collisions in the new table `AddrMan.size()`, however, returns the number of unique address in addrman, regardless of whether they are in new or tried. This means the test would still pass for addresses where a collision did occur in the tried table. After 3 collisions in the tried table, there would eventually be a collision in the new table when trying to add a new address, which was then detected by checking `num_addrs - collisions == size()`. While the collision in the new table was caused by a collision in the tried table, the test is misleading as it's not directly testing for collisions in the tried table and misses 3 collisions before identifying a collision in the new table. ### solution To more directly test the tried table, I refactored `AddrMan::Good()` to return a boolean after successfully adding an address to the tried table. This makes the test much cleaner by first adding an address to new, calling `Good` to move it to the tried table, and checking if it was successful or not. It is worth noting there are other reasons, aside from collisions, which will cause `Good` to return false. That being said, this is an improvement over the previous testing methodology. Additionally, having `Good()` return a boolean is useful outside of testing as it allows the caller to handle the case where `Good` is unable to move the entry to the tried table (e.g https://github.com/bitcoin/bitcoin/blob/a06364741358feae04813050e4225eb43fc386e3/src/rpc/net.cpp#L945). ### followup As a follow up to this PR, I plan to look at the following places `Good()` is called and see if it makes sense to handle the case where it is unable to add an entry to tried: * https://github.com/bitcoin/bitcoin/blob/a06364741358feae04813050e4225eb43fc386e3/src/rpc/net.cpp#L945 * https://github.com/bitcoin/bitcoin/blob/a06364741358feae04813050e4225eb43fc386e3/src/net.cpp#L2067 * https://github.com/bitcoin/bitcoin/blob/a06364741358feae04813050e4225eb43fc386e3/src/net_processing.cpp#L2708 ACKs for top commit: jnewbery: utACK caac999ff0 mzumsande: Code review ACK caac999ff0fc5c98fa438b7e96fe1232f6573fd5 Tree-SHA512: f328896b1f095e8d2581fcdbddce46fc0491731a0440c6fff01081fa5696cfb896dbbe1d183eda2c100f19aa111e1f8b096ef93582197edc6b791de563a58f99
2021-12-14net: Drop only invalid entries when reading banlist.jsonMarcoFalke
Currently all entries in the file are dropped. Fix that by only dropping the invalid ones
2021-12-14refactor: remove dependence on AddrManTestjosibake
2021-12-14refactor: check Good() in tried_collisions testjosibake
Rather than try to infer a collision by checking `AddrMan::size`, check whether or not moving to the tried table was successful by checking the output from `AddrMan::Good`
2021-12-14Merge bitcoin/bitcoin#23575: fuzz: Rework FillNodefanquake
fa19bab90a3ccc2f76c20aa805292d6a9c5d8071 fuzz: Rework FillNode (MarcoFalke) fae6e31df7c6df04f41fc8401e2a9781a4d75be7 refactor: Set fSuccessfullyConnected in FillNode (MarcoFalke) fa3583f856e34b6c6134745da14f5206cf71fa3e fuzz: Avoid negative NodeId in ConsumeNode (MarcoFalke) Pull request description: Currently `FillNode` is a bit clumsy because it directly modifies memory of `CNode`. This gets in the way of moving that memory to `Peer`. Also, it isn't particularly consistent. See for example https://github.com/bitcoin/bitcoin/pull/21160#discussion_r739206139 . Fix all issues by sending a `version`/`verack` in `FillNode` and let net_processing figure out the internal details. ACKs for top commit: jnewbery: Strong concept ACK and light code review ACK fa19bab90a3ccc2f76c20aa805292d6a9c5d8071 Tree-SHA512: 33261d857c3fa6d5d39d742624009a29178ad5a15eb3fd062da741affa5a4854fd45ed20d59a6bba2fb068cf7b39cad6f95b2910be7cb6afdc27cd7917955b67
2021-12-13test: add tests for LoadBlockIndex when using multiple chainstatesJames O'Beirne
Incorporates feedback from Russ Yanofsky.
2021-12-13validation: don't modify genesis during snapshot loadJames O'Beirne
Avoid modifying the genesis block index entry during snapshot load. This is because, in a future change that fixes LoadBlockIndex for UTXO snapshots, we detect block index entries that are reliant on assumed-valid ancestors and treat them specially. Since the genesis block doesn't have BLOCK_VALID_SCRIPTS, it would be erroneously marked BLOCK_ASSUMED_VALID during snapshot load if we didn't skip it here. This would cause a "setBlockIndexCandidates() empty" assertion to be tripped since all block index entries would be marked assume-valid due to genesis, which is never re-validated. There's probably no good reason to modify the genesis block index entry during snapshot load anyway...
2021-12-13test: call VerifyLoadedChainstate during ChainTestingSetupJames O'Beirne
for additional coverage and similarity to actual init process.
2021-12-13scripted-diff: Rename touched member variablesMarcoFalke
-BEGIN VERIFY SCRIPT- ren() { sed -i "s/\<$1\>/$2/g" $( git grep -l "$1" ./src/ ) ; } ren nLastBlockTime m_last_block_time ren nLastTXTime m_last_tx_time ren nTimeConnected m_connected -END VERIFY SCRIPT-
2021-12-13Use mockable time for peer connection timeMarcoFalke
This allows to revert the temporary commit 0bfb9208df556f77cddfedfd73e5811a0e031d34 (test: fix test failures in test/functional/p2p_timeouts.py).
2021-12-13refactor: Use type-safe std::chrono in netMarcoFalke
2021-12-11Merge bitcoin/bitcoin#23733: fuzz: Move ISO8601 to one placeMarcoFalke
fa72dd314fe857d827d9b311bdf0453e9463746f fuzz: Move ISO8601 to one place (MarcoFalke) Pull request description: Seems confusing to split this to two places. Also fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=42178 ACKs for top commit: fanquake: ACK fa72dd314fe857d827d9b311bdf0453e9463746f Tree-SHA512: 637b0671078848ea417fdf66b92715602040fad34d4ca5f7b843a519a1cfeebe5d992a79a399deba39926905125681d66ab0dc05f66f79a26f3bf555e12fb0ba
2021-12-11[fuzz] Add fuzzing harness to compare both implementations of ChaCha20stratospher
Co-authored-by: Prakash Choudhary <44579179+prakash1512@users.noreply.github.com>
2021-12-11[fuzz] Add D. J. Bernstein's implementation of ChaCha20stratospher
Co-authored-by: Prakash Choudhary <44579179+prakash1512@users.noreply.github.com>
2021-12-10Merge bitcoin/bitcoin#17034: [BIP 174] PSBT version, proprietary, and xpub ↵W. J. van der Laan
fields 81521173ba830ca1dea204e83897482f8970e519 Merge global xpubs in joinpsbts and combinepsbts (Andrew Chow) d8043ddf640b1bb7a536834618c468334e3eb15f Add global xpub test vectors from BIP (Andrew Chow) 35670df866e0bb4a58a7cc032f7bcae508fd0273 Add global_xpubs to decodepsbt (Andrew Chow) 903848562ec5d8a167d24c5f5083695b2f104780 Implement serializations for PSBT_GLOBAL_XPUB (Andrew Chow) c5c63b8e4f3fbdb6b5a423a39d6e318fecab991f Implement operator< for KeyOriginInfo and CExtPubKey (Andrew Chow) d3dbb16168145ccbcc7ef0a8e150695711b661b7 Separate individual HD Keypath serialization into separate functions (Andrew Chow) a69332fd89a5c1e293113b641fbe6b23cf279741 Store version bytes and be able to serialize them in CExtPubKey (Andrew Chow) 5fdaf6a2adbf99c4ab2c2863fba35a0baa559fb5 moveonly: Move (Un)Serialize(To/From)Vector, (De)SerializeHDKeypaths to psbt module (Andrew Chow) 94065cc6c5a087a5657519202a4ca08db7c1d861 Test for proprietary field (Andrew Chow) a4cf8101746039ec8be234d899bdaf848548598e Output proprietary type info in decodepsbt (Andrew Chow) aebe758e54802ead664a3c8b694fe0b447e01724 Implement PSBT proprietary type (Andrew Chow) 10ba0b593d3c9bc03e36d52344237be6e89c443f Output psbt version in decodepsbt (Andrew Chow) df84fa99c5a52e4688e240c585f7d22b20401906 Add GetVersion helper to PSBT (Andrew Chow) c3eb416b882522dffa4254b52d2da5b53c970efe Implement PSBT versions (Andrew Chow) 3235847473e36070cbe9b0e9deacdd8d8d9428fe Types are compact size uints (Andrew Chow) Pull request description: Implements the changes to BIP 174 proposed in https://github.com/bitcoin/bips/pull/849 and https://github.com/bitcoin/bips/pull/784 Implements `PSBT_GLOBAL_VERSION`, `PSBT_GLOBAL_PROPRIETARY`, `PSBT_IN_PROPRIETARY`, `PSBT_OUT_PROPRIETARY`, and `PSBT_GLOBAL_XPUB`. The `PSBT_GLOBAL_XPUB` changes are merged in from #16463. Also includes the test vectors added to BIP 174 for these fields. A number of additional changes to keypath and xpub serialization are made to support `PSBT_GLOBAL_XPUB`. ACKs for top commit: laanwj: Code review ACK 81521173ba830ca1dea204e83897482f8970e519 Tree-SHA512: bd71c3f26030fc23824e76a30d3d346a753e1db224ecee163d6813348feb52d3f4cf4e739a4699e2cff381197ce2a7ea4a92a054f2c3e1db579e91e92a0945e0
2021-12-10Merge bitcoin/bitcoin#23280: init: Coalesce Chainstate loading sequence ↵MarcoFalke
between {,non-}unittest codepaths 7f15eff2ddd86034e84a19413e1a42883987f660 style-only: Remove redundant scope in *Chainstate (Carl Dong) 89bec827fdea1cedd560be85201f04e0a78aa48d Collapse the 2 cs_main locks in LoadChainstate (Carl Dong) 3b1584b794499158e0df07bd1bee1b803c568614 Remove all #include // for * comments (Carl Dong) 9a5a5a3d08b2c130ab9147914739ff3583b0dc84 test/setup: Use LoadChainstate (Carl Dong) c541da0d62eaf5e96eca00d7508899f98bdfc1bc node/chainstate: Add options for in-memory DBs (Carl Dong) ceb979034184345a662be4e3b327a573fbb31c63 node/caches: Remove intermediate variables (Carl Dong) ac4bf138b849a8544798f3891d6623803040c265 node/caches: Extract cache calculation logic (Carl Dong) 15f2e33bb3d1ad3bc997f6a84956337f46495091 validation: VerifyDB only needs Consensus::Params (Carl Dong) 4da9c076d1cf12728730bb1f7e8906d4e9bfaba5 node/chainstate: Decouple from ShutdownRequested (Carl Dong) 05441c2dc5f60e2025476d8ec94c9025032d118c node/chainstate: Decouple from GetTime (Carl Dong) 2414ebc18b8bebf79c47e58a4293d0fc6420a811 init: Delay RPC block notif until warmup finished (Carl Dong) 8d466a8504bfb81ce8699d650aa72ec9cc8b0a54 Move -checkblocks LogPrintf to AppInitMain (Carl Dong) aad8d597890c3707ae96fdb2b9fadc270ca574dd node/chainstate: Reduce coupling of LogPrintf (Carl Dong) b345979a2b03b671c0984edd7e48e0baec2e2f34 node/chainstate: Decouple from concept of uiInterface (Carl Dong) ca7c0b934db68acdc410e3a82f1ed898382da2e5 Split off VerifyLoadedChainstate (Carl Dong) adf4912d77496b9a243476c5944528f95641f14d node/chainstate: Remove do/while loop (Carl Dong) 975235ca0a8f5bcf9df880698b3b0d4bbde9f7fb Move init logistics message for BAD_GENESIS_BLOCK to init.cpp (Carl Dong) 8715658983a0a07c56513acd8ded8dfc59c5c169 Move mempool nullptr Assert out of LoadChainstate (Carl Dong) 9162a4f93ef5aeb57fe11a6e09f5881cf431f5e6 node/chainstate: Decouple from concept of NodeContext (Carl Dong) c7a5c46e6fd6d6ff46ca7a65fc3f0fff3cbdb24e node/chainstate: Decouple from ArgsManager (Carl Dong) ae9121f958a4124ea6238cad0c3f2acb8b9eb4bb node/chainstate: Decouple from stringy errors (Carl Dong) cbac28b72f5b831f6f84b7628f73e85627af3d94 node/chainstate: Decouple from GetTimeMillis (Carl Dong) cb64af9635a9553e335f2dc0b1cca20c6bbd0933 node: Extract chainstate loading sequence (Carl Dong) Pull request description: This PR: 1. Coalesce the Chainstate loading sequence between `AppInitMain` and `*TestingSetup` (which makes it more tested) 2. Makes the Chainstate loading sequence reusable in preparation for future work extracting out our consensus engine. Code-wise, this PR: 1. Extracts `AppInitMain`'s Chainstate loading sequence into a `::LoadChainstateSequence` function 2. Makes this `::LoadChainstateSequence` function reusable by 1. Decoupling it from various concepts (`ArgsManager`, `uiInterface`, etc) 2. Making it report errors using an `enum` rather than by setting a `bilingual_str` 3. Makes `*TestingSetup` use this new `::LoadChainstateSequence` Reviewers: Aside from commentary, I've also included `git diff` flags of interest in the commit messages which I hope will aid review! ACKs for top commit: ryanofsky: Code review ACK 7f15eff2ddd86034e84a19413e1a42883987f660. Thanks for updates! MarcoFalke: review ACK 7f15eff2ddd86034e84a19413e1a42883987f66 💳 Tree-SHA512: fb9a6cbd1c511a52b477c62a5e68e53a8be5dec2fff0e44a279966afb91efbab44bf1fe7c6b1519f8464ecc25f42dd4bae8e1efbf55ee91fc90fa0b92e3a83e2
2021-12-10moveonly: Move (Un)Serialize(To/From)Vector, (De)SerializeHDKeypaths to psbt ↵Andrew Chow
module SerializeToVector, UnserializeFromVector, DeserializeHDKeypaths, and SerializeHDKeypaths were in sign.h where PSBT was originally implemented. Since all of the PSBT serialization has moved to its own file, these functions should follow.
2021-12-10Types are compact size uintsAndrew Chow
2021-12-10fuzz: Move ISO8601 to one placeMarcoFalke
2021-12-10Merge bitcoin/bitcoin#19499: p2p: Make timeout mockable and type safe, speed ↵MarcoFalke
up test fadc0c80ae4e526fb2b503f7cc02f6122aaf1de5 p2p: Make timeout mockable and type safe, speed up test (MarcoFalke) fa6d5a238d2c94440105ddd4f1554f85659d6c5b scripted-diff: Rename m_last_send and m_last_recv (MarcoFalke) Pull request description: Use type-safe time for better code readability/maintainability and mockable time for better testability. This speeds up the p2p_timeout test. This is also a bugfix for intermittent test issues like: https://cirrus-ci.com/task/4769904156999680?command=ci#L2836 Fixes #20654 ACKs for top commit: laanwj: Code review ACK fadc0c80ae4e526fb2b503f7cc02f6122aaf1de5 naumenkogs: ACK fadc0c80ae4e526fb2b503f7cc02f6122aaf1de5 Tree-SHA512: 28c6544c97f188c8a0fbc80411c74ab74ffd055885322c325aa3d1c404b29c3fd70a737e86083eecae58ef394db1cb56bc122d06cff63742aa89a8e868730c64
2021-12-08fuzz: Fix RPC internal bug detectionMarcoFalke
2021-12-08Merge bitcoin/bitcoin#20295: rpc: getblockfrompeerMarcoFalke
dce8c4c38111556ca480aa0e63c46b71f66b508f rpc: getblockfrompeer (Sjors Provoost) b884ababc29ce963826d8a4327ed6a5e629ff175 rpc: move Ensure* helpers to server_util.h (Sjors Provoost) Pull request description: This adds an RPC method to fetch a block directly from a peer. This can used to fetch stale blocks with lower proof of work that are normally ignored by the node (`headers-only` in `getchaintips`). Usage: ``` bitcoin-cli getblockfrompeer HASH peer_n ``` Closes #20155 Limitations: * you have to specify which peer to fetch the block from * the node must already have the header ACKs for top commit: jnewbery: ACK dce8c4c38111556ca480aa0e63c46b71f66b508f fjahr: re-ACK dce8c4c38111556ca480aa0e63c46b71f66b508f Tree-SHA512: 843ba2b7a308f640770d624d0aa3265fdc5c6ea48e8db32269b96a082b7420f7953d1d8d1ef2e6529392c7172dded9d15639fbc9c24e7bfa5cfb79e13a5498c8
2021-12-08Merge bitcoin/bitcoin#23465: Remove CTxMemPool params from ATMPMarcoFalke
f1f10c0514fe81318c8b064f9dad0e2f9a2cd037 Remove CTxMemPool params from ATMP (lsilva01) Pull request description: Remove `CTxMemPool` parameter from `AcceptToMemoryPool` function, as suggested in https://github.com/bitcoin/bitcoin/pull/23437#issuecomment-962536149 . This requires that `CChainState` has access to `MockedTxPool` in `tx_pool.cpp` as mentioned https://github.com/bitcoin/bitcoin/pull/23173#discussion_r731895386. So the `MockedTxPool` is attributed to `CChainState::m_mempool` before calling `AcceptToMemoryPool`. Requires #23437. ACKs for top commit: jnewbery: utACK f1f10c0514fe81318c8b064f9dad0e2f9a2cd037 MarcoFalke: review ACK f1f10c0514fe81318c8b064f9dad0e2f9a2cd037 🔙 Tree-SHA512: 2a4885f4645014fc1fa98bb1090f13721c1a0796bc0021b9cb43bc8cc13920b6eaf057d1f5ed796e0a110e7813e41fe0196334ce7c80d1231fc057a9a3bdf349
2021-12-07Remove CTxMemPool params from ATMPlsilva01
Co-authored-by: John Newbery <1063656+jnewbery@users.noreply.github.com> Co-authored-by: Jon Atack <jon@atack.com>
2021-12-07Remove all #include // for * commentsCarl Dong
2021-12-07test/setup: Use LoadChainstateCarl Dong
This commit coalesces the chainstate loading sequence between our unit test and non-unit test init codepaths.