aboutsummaryrefslogtreecommitdiff
path: root/contrib
AgeCommit message (Collapse)Author
2021-02-08build: Disable --disable-fuzz-binary for guix buildsHennadii Stepanov
2021-02-08build: Disable --disable-fuzz-binary for gitian buildsHennadii Stepanov
2021-02-03gitian: remove execstack workaround for ricv64 & powerpc64lefanquake
When building with g++-10 (or 8) on Focal, binaries are being produced with noexecstack by default, so we can remove the workaround of explicitly passing "-Wl,-z,noexecstack" for risvc46 and powerpc64le. When building for powerpc64 this is still required.
2021-02-03build: use focal in gitian descriptorsfanquake
Compilers used change as follows: Linux native GCC 7.5 -> GCC 8.4 Linux cross GCC 8.4 -> GCC 8.4 Windows mingw-w64 7.3 -> mingw-w64 9.3 macOS Clang 8.0.0 -> Clang 8.0.0 The macOS and Win cross builds in the CI are updated to use Focal, and per the op, running the security tests is disabled in the Windows build.
2021-02-02Merge #19509: Per-Peer Message CaptureMarcoFalke
bff7c66e67aa2f18ef70139338643656a54444fe Add documentation to contrib folder (Troy Giorshev) 381f77be858d7417209b6de0b7cd23cb7eb99261 Add Message Capture Test (Troy Giorshev) e4f378a505922c0f544b4cfbfdb169e884e02be9 Add capture parser (Troy Giorshev) 4d1a582549bc982d55e24585b0ba06f92f21e9da Call CaptureMessage at appropriate locations (Troy Giorshev) f2a77ff97bec09dd5fcc043d8659d8ec5dfb87c2 Add CaptureMessage (Troy Giorshev) dbf779d5deb04f55c6e8493ce4e12ed4628638f3 Clean PushMessage and ProcessMessages (Troy Giorshev) Pull request description: This PR introduces per-peer message capture into Bitcoin Core. 📓 ## Purpose The purpose and scope of this feature is intentionally limited. It answers a question anyone new to Bitcoin's P2P protocol has had: "Can I see what messages my node is sending and receiving?". ## Functionality When a new debug-only command line argument `capturemessages` is set, any message that the node receives or sends is captured. The capture occurs in the MessageHandler thread. When receiving a message, it is captured as soon as the MessageHandler thread takes the message off of the vProcessMsg queue. When sending, the message is captured just before the message is pushed onto the vSendMsg queue. The message capture is as minimal as possible to reduce the performance impact on the node. Messages are captured to a new `message_capture` folder in the datadir. Each node has their own subfolder named with their IP address and port. Inside, received and sent messages are captured into two binary files, msgs_recv.dat and msgs_sent.dat, like so: ``` message_capture/203.0.113.7:56072/msgs_recv.dat message_capture/203.0.113.7:56072/msgs_sent.dat ``` Because the messages are raw binary dumps, included in this PR is a Python parsing tool to convert the binary files into human-readable JSON. This script has been placed on its own and out of the way in the new `contrib/message-capture` folder. Its usage is simple and easily discovered by the autogenerated `-h` option. ## Future Maintenance I sympathize greatly with anyone who says "the best code is no code". The future maintenance of this feature will be minimal. The logic to deserialize the payload of the p2p messages exists in our testing framework. As long as our testing framework works, so will this tool. Additionally, I hope that the simplicity of this tool will mean that it gets used frequently, so that problems will be discovered and solved when they are small. ## FAQ "Why not just use Wireshark" Yes, Wireshark has the ability to filter and decode Bitcoin messages. However, the purpose of the message capture added in this PR is to assist with debugging, primarily for new developers looking to improve their knowledge of the Bitcoin Protocol. This drives the design in a different direction than Wireshark, in two different ways. First, this tool must be convenient and simple to use. Using an external tool, like Wireshark, requires setup and interpretation of the results. To a new user who doesn't necessarily know what to expect, this is unnecessary difficulty. This tool, on the other hand, "just works". Turn on the command line flag, run your node, run the script, read the JSON. Second, because this tool is being used for debugging, we want it to be as close to the true behavior of the node as possible. A lot can happen in the SocketHandler thread that would be missed by Wireshark. Additionally, if we are to use Wireshark, we are at the mercy of whoever it maintaining the protocol in Wireshark, both as to it being accurate and recent. As can be seen by the **many** previous attempts to include Bitcoin in Wireshark (google "bitcoin dissector") this is easier said than done. Lastly, I truly believe that this tool will be used significantly more by being included in the codebase. It's just that much more discoverable. ACKs for top commit: MarcoFalke: re-ACK bff7c66e67aa2f18ef70139338643656a54444fe only some minor changes: 👚 jnewbery: utACK bff7c66e67aa2f18ef70139338643656a54444fe theStack: re-ACK bff7c66e67aa2f18ef70139338643656a54444fe Tree-SHA512: e59e3160422269221f70f98720b47842775781c247c064071d546c24fa7a35a0e5534e8baa4b4591a750d7eb16de6b4ecf54cbee6d193b261f4f104e28c15f47
2021-01-29Merge #20689: contrib: replace binary verification script verify.sh with ↵Wladimir J. van der Laan
python rewrite c86b9a65eb0d6d1e659415880702c4dc889c34e6 contrib: remove verify.sh (Sebastian Falbesoner) c84838e7afb7b084a56a75e98325563b6de83124 contrib: binary verification script verify.sh rewritten in python (Sebastian Falbesoner) Pull request description: The rationale for the PR is the same as for #18132: > Most of our test scripts are written in python. We don't have enough reviewers for bash scripts and they tend to be clumsy anyway. Especially when it comes to argument parsing. Note that there are still a lot of things that could be improved in this replacement (e.g. using regexps for version string parsing, adding type annotations, dividing up into more functions, getting a pylint score closer to 10, etc.), but I found the original shell script quite hard to read, so it's possibly still a good first step for an improvement. ~Not sure though if it's worth the reviewers time, and if it's even continued to be used long-term (maybe there are plans to merge it with `get_previous_releases.py`, which partly does the same?), so chasing for Concept ACKs right now.~ ACKs for top commit: laanwj: Tested and code review ACK c86b9a65eb0d6d1e659415880702c4dc889c34e6 Tree-SHA512: f7949eead4ef7e5913fe273923ae5c5299408db485146cf996cdf6f8ad8c0ee4f4b30bb6b08a5964000d97b2ae2e7a1bdc88d11c613c16d2d135d80b444e3b16
2021-01-28Merge #20963: gitian-linux: Build binaries for 64-bit POWER (continued)Wladimir J. van der Laan
543bf745d38ca2f9f7f9f49483772d51154b93a7 gitian-linux: Extend noexec-stack workaround to powerpc (Wladimir J. van der Laan) 00f67c8aa1b8f596f945db30cdc00d54c6e34665 gitian-linux: Build binaries for 64-bit POWER (Luke Dashjr) 63fc2b1782508e750a9254f72b9b8379573a836c gitian: Properly quote arguments in wrappers (Luke Dashjr) 798bc0b29a4ad342010f7cd31dd38eeeb5b709db Support glibc-back-compat on 64-bit POWER (Luke Dashjr) Pull request description: Rebase of #14066 by luke-jr. Let's try to get PowerPC support in in the beginning of the 22.0 cycle so that it gets some testing, and is not a last-minute decision this time, like for last … 2 or 3 major versions. The symbol/security tooling-related changes have been dropped since they were part of #20434. Top commit has no ACKs. Tree-SHA512: df0f8cd320c90f359f8b512c5cb8b59bb277516b57a05482cc8923c656106513b7428e315aaa8ab53e0bd6f80556b07d3639c47f6d9913bcfbfe388b39ef47c4
2021-01-25Fix docker args conditionalsetpill
2021-01-24gitian-linux: Extend noexec-stack workaround to powerpcWladimir J. van der Laan
2021-01-24gitian-linux: Build binaries for 64-bit POWERLuke Dashjr
2021-01-24gitian-keys: Add signer aliases, some historical keysWladimir J. van der Laan
Co-authored-by: fanquake <fanquake@gmail.com>
2021-01-23Add documentation to contrib folderTroy Giorshev
This commit adds brief documentation for this feature. Included in the justification is the purpose of this feature as well as usage and functionality tips.
2021-01-23Add capture parserTroy Giorshev
This commit adds contrib/message-capture/message-capture-parser.py, a python script to be used alongside -capturemessages to parse the captured messages. It is complete with arguments and will parse any file given, sorting the messages in the files when creating the output. If an output file is specified with -o or --output, it will dump the messages in json format to that file, otherwise it will print to stdout. The small change to the unused msg_generic is to bring it in line with the other message classes, purely to avoid a bug in the future.
2021-01-22gitian-keys: add CoinForensics keycoinforensics
2021-01-21guix: Fix typoCarl Dong
2021-01-21guix: README: Add darwin HOSTS entryCarl Dong
2021-01-21guix: Check for macOS SDK before building anythingCarl Dong
2021-01-21guix: Set ZERO_AR_DATE for darwin build determinismCarl Dong
See comments inserted in this commit.
2021-01-21guix: Add support for darwin buildsCarl Dong
2021-01-20Merge #20937: guix: Make nsis reproducible by respecting SOURCE-DATE-EPOCHfanquake
1fca9811e1331ac5dae8188f6178cc37da4929a7 lint: Skip whitespace lint for guix patches (Carl Dong) a91c46c57d88fc399432afab7bb0fb14c3e490a7 guix: Make nsis reproducible by respecting SOURCE-DATE-EPOCH (Carl Dong) Pull request description: ``` When building nsis, if VERSION is not specified, it defaults to cvs_version which is non-deterministic as it includes the current date. This patches nsis to default to SOURCE_DATE_EPOCH if it exists so that nsis is reproducible. Upstream change: https://github.com/kichik/nsis/pull/13 ``` Sidenote: also a good demonstration of how Guix allows us to flexibly patch our tools! Note to reviewers: if you want to compare hashes, please build after Jan 16th 2021 without my substitute server enabled! ACKs for top commit: fanquake: ACK 1fca9811e1331ac5dae8188f6178cc37da4929a7 Tree-SHA512: b800e0ce5f73827ad353739effb9167ec3a6bdb362c725ae20dd3f025ce78660f85c70ce1d75cd0896facf1e8fe38a9e058459ed13dec71ab3a2fe41e20eaa5d
2021-01-19Merge #20906: contrib: embed C++11 patch in install_db4.shWladimir J. van der Laan
92370033a2606ee88f4d080193e0bf6da481dc2e contrib: embed C++11 patch in install_db4.sh (jackielove4u) Pull request description: This is a continuation of https://github.com/bitcoin/bitcoin/pull/20665. Closes #20722. ACKs for top commit: laanwj: ACK 92370033a2606ee88f4d080193e0bf6da481dc2e fanquake: ACK 92370033a2606ee88f4d080193e0bf6da481dc2e. Tree-SHA512: ebfd16f5301158de1acc1b8eeca43b3d94f0a6d438832133a30648e5e8a88268b4af983be0bb57f3018e3af8459f32f0de676c1b4e8942e199a4497c776631c5
2021-01-19gitian: Properly quote arguments in wrappersLuke Dashjr
2021-01-18Merge #20880: gitian: Use custom MacOS code signing toolWladimir J. van der Laan
2c403279e2f0f7c8c27c56d4e7b0573c59571f0a gitian: Remove codesign_allocate and pagestuff from MacOS build (Andrew Chow) f55eed251488d70d5e2e3a2965a4f8ec0c476853 gitian: use signapple to create the MacOS code signature (Andrew Chow) 95b06d21852b28712db6c710e420a58bdc1a0944 gitian: use signapple to apply the MacOS code signature (Andrew Chow) 42bb1ea363286b088257cabccb686ef1887c1d3b gitian: install signapple in gitian-osx-signer.yml (Andrew Chow) Pull request description: The MacOS code signing issues that were encountered during the 0.21.0 release cycle have shown that it is necessary for us to use a code signing tool for which the source code is available and modifiable by us. Given that there appears to not be such a tool available, I have written such a tool, [signapple](https://github.com/achow101/signapple), that we can use. This tool is able to create a valid MacOS code signature, detach it in a way that we were doing previously, and attach it to the unsigned binary. This tool can also verify that the signature is correct. This PR implements the usage of that tool in the gitian build for the code signed MacOS binary. The code signer will use this tool to create the detached signature. Gitian builders will use this tool to apply the detached signature. The `gitian-osx-signer.yml` descriptor has been modified to install this tool so that the `detached-sig-apply.sh` script can use it. Additionally, the `codesign_allocate` and `pagestuff` tools are no longer necessary so they are no longer added to the tarball used in code signing. Lastly, both the `detached-sig-create.sh` and `detached-sig-apply.sh` scripts are made to be significantly less complex and to not do unexpected things such as unpacking an already unpacked tarball. The detached code signature that signapple creates is almost identical to that which we were previously creating. The only difference is that the cpu architecture name is included in the extension (e.g. we have `bitcoin-qt.x86_64sign` instead of `bitcoin-qt.sign`). This was done in order to support signing universal binaries which we may want to do in the future. However signapple can still apply existing code signatures as it will accept the `.sign` extension. If it is desired, it can be modified to produce signatures with just the `.sign` extension. However I do not think it is necessary to maintain compatibility with the old process. ACKs for top commit: laanwj: Code review ACK 2c403279e2f0f7c8c27c56d4e7b0573c59571f0a Tree-SHA512: 2a0e01e9133f8859b9de26e7e8fe1d2610d2cbdee2845e6008b12c083c7e3622cbb2d9b83c50a269e2c3074ab95914a8225d3cd4108017f58b77a62bf10951e0
2021-01-18Merge #20884: script: Improve robustness of bitcoind.service on startupWladimir J. van der Laan
9d026546778629472574b26fa73338efc63d02da doc: Fix systemd spelling and link to doc/init.md (Hennadii Stepanov) 601778c3107adbd8d96eb0bb5c16a9d0a4b81594 script: Add Documentation key to bitcoind.service (Hennadii Stepanov) d9392b724cae53b7a16fa5f84ebe152eea496502 script: Improve robustness of bitcoind.service on startup (Hennadii Stepanov) Pull request description: If network interfaces are not properly up the following happens: ``` ... 2021-01-08T10:17:11Z scheduler thread start 2021-01-08T10:17:11Z libevent: getaddrinfo: address family for nodename not supported 2021-01-08T10:17:11Z Binding RPC on address 127.0.0.1 port 8332 failed. 2021-01-08T10:17:11Z HTTP: creating work queue of depth 16 2021-01-08T10:17:11Z Using random cookie authentication. 2021-01-08T10:17:11Z Generated RPC authentication cookie /var/lib/bitcoind/.cookie 2021-01-08T10:17:11Z HTTP: starting 2 worker threads 2021-01-08T10:17:11Z init message: Loading banlist... 2021-01-08T10:17:11Z SetNetworkActive: true 2021-01-08T10:17:11Z Error: Cannot resolve -externalip address: <EDITED> 2021-01-08T10:17:11Z Shutdown: In progress... 2021-01-08T10:17:11Z scheduler thread exit 2021-01-08T10:17:11Z Shutdown: done ``` This PR improves robustness on startup in such cases in documented way: https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/ Also minor doc improvements are added. ACKs for top commit: Sjors: ACK 9d02654 practicalswift: ACK 9d026546778629472574b26fa73338efc63d02da: patch looks correct darosior: ACK 9d026546778629472574b26fa73338efc63d02da -- been using the first patch too Tree-SHA512: 38294f5682c09e6ea9008de7d7459098c920cf1b98ad8ef8a5d2ca01f2f781c0fec5591dc40ef36eeb19d94991b0c7fb7cb38c4e716bc7219875c9bcd0a55e1b
2021-01-17guix: Make nsis reproducible by respecting SOURCE-DATE-EPOCHCarl Dong
When building nsis, if VERSION is not specified, it defaults to cvs_version which is non-deterministic as it includes the current date. This patches nsis to default to SOURCE_DATE_EPOCH if it exists so that nsis is reproducible. Upstream change: https://github.com/kichik/nsis/pull/13
2021-01-12doc: Add manual page generation for bitcoin-utilWladimir J. van der Laan
- Add `-version` option to `bitcoin-util` - Add `bitcoin-util` call to `gen-manpages.sh` - Add stub manual page `bitcoin-util.1` - Add install of `bitcoin-util.1` to build system
2021-01-12Merge #19937: signet mining utilityWladimir J. van der Laan
595a34dbea01954cb0372b0210d2fd64357a1762 contrib/signet: Document miner script in README.md (Anthony Towns) ff7dbdc08a11e999e7718b6ac7645ecceef81188 contrib/signet: Add script for generating a signet chain (Anthony Towns) 13762bcc9618138dd28b53c2031defdc9d762d26 Add bitcoin-util command line utility (Anthony Towns) 95d5d5e6257825bb385cee318d5681597f7f7646 rpc: allow getblocktemplate for test chains when unconnected or in IBD (Anthony Towns) 81c54dec20891f2627a49b2e3e785fdaf2a1e664 rpc: update getblocktemplate with signet rule, include signet_challenge (Anthony Towns) Pull request description: Adds `contrib/signet/miner` for mining signet blocks. Adds `bitcoin-util` cli utility, with the idea being it can provide bitcoin related functionality that does not rely on the ability to access a running node. Only subcommand currently is "grind" which takes a hex-encoded header and grinds its nonce until its nBits is satisfied. Updates `getblocktemplate` to include `signet_challenge` field, and makes `getblocktemplate` require the signet rule when invoked on the signet change. Removes connectivity and IBD checks from `getblocktemplate` when applied to a test chain (regtest, testnet, signet). ACKs for top commit: laanwj: code review ACK 595a34dbea01954cb0372b0210d2fd64357a1762 Tree-SHA512: 8d43297710fdc1edc58acd9b53e1bd1671e5724f7097b40ab73653715dc8becc70534c4496cbba9290f4dd6538a7a3d5830eb85f83391ea31a3bb5b9d3378cc3
2021-01-12contrib/signet: Document miner script in README.mdAnthony Towns
2021-01-12contrib/signet: Add script for generating a signet chainAnthony Towns
2021-01-11contrib: embed C++11 patch in install_db4.shjackielove4u
2021-01-08guix: Print build params inside/outside of containerCarl Dong
2021-01-08guix: Move DISTSRC determination to guix-build.shCarl Dong
2021-01-08guix: Move OUTDIR determination+creation to guix-build.shCarl Dong
2021-01-08guix: Add more sanity checks to guix-build.shCarl Dong
2021-01-08guix: Add section headings to guix-build.shCarl Dong
2021-01-08guix: Small updates to README wordingCarl Dong
2021-01-08guix: Update HOSTS README entry for new architecturesCarl Dong
2021-01-08guix: Remove README development environment sectionCarl Dong
2021-01-08guix: Add ADDITIONAL_GUIX_{COMMON,TIMEMACHINE}_FLAGS optionsCarl Dong
2021-01-08guix: Add SUBSTITUTE_URLS optionCarl Dong
2021-01-08guix: Make guix honor MAX_JOBS settingCarl Dong
2021-01-08doc: Fix systemd spelling and link to doc/init.mdHennadii Stepanov
See https://www.freedesktop.org/wiki/Software/systemd/
2021-01-08script: Add Documentation key to bitcoind.serviceHennadii Stepanov
2021-01-08script: Improve robustness of bitcoind.service on startupHennadii Stepanov
2021-01-07gitian: Remove codesign_allocate and pagestuff from MacOS buildAndrew Chow
2021-01-07gitian: use signapple to create the MacOS code signatureAndrew Chow
2021-01-07gitian: use signapple to apply the MacOS code signatureAndrew Chow
2021-01-07gitian: install signapple in gitian-osx-signer.ymlAndrew Chow
2021-01-07Merge #20859: gitian-keys: add miketwenty1 keyWladimir J. van der Laan
f2d93b229d8a95c0ff6c6cb9253d11cceec9d5d8 gitian-keys: add miketwenty1 key (Michael Tidwell) Pull request description: in ref to: bitcoin-core/gitian.sigs#1427 ACKs for top commit: laanwj: ACK f2d93b229d8a95c0ff6c6cb9253d11cceec9d5d8 Tree-SHA512: 895935981ada0c3a094adde556b86b73dc440b599f8d6e2a7dd1e82592351c820b797c64a3e0fa1e79ab4c2f992afb3363b4a12625a54bdfbdea75b5a19d7e95
2021-01-06gitian-keys: add miketwenty1 keyMichael Tidwell