-
Notifications
You must be signed in to change notification settings - Fork 388
Bring Elements up to date with Bitcoin Core 22.0 #1058
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bring Elements up to date with Bitcoin Core 22.0 #1058
Conversation
…issue" -BEGIN VERIFY SCRIPT- git show faf1af5 | git apply --reverse -END VERIFY SCRIPT-
- Added detailed Guix bootstrap/installation instructions
That way we can easily combine the document and detached signature to produce cleartext signature files for upload during the release process. See subsequent commits which modify doc/release-process.md for more details.
Also, clean up release-process.md
…evert e0a2b39) d4b67c8 scripted-diff: remove ResetI2PPorts() (revert e0a2b39) (Vasil Dimov) Pull request description: `CAddrMan::ResetI2PPorts()` was temporary. Remove it: * it has partially achieved its goal: probably ran on about half of the I2P nodes * it is hackish, deemed risky and two bugs where found in it: bitcoin/bitcoin#22467 bitcoin/bitcoin#22470 -BEGIN VERIFY SCRIPT- git show e0a2b39 |git apply -R -END VERIFY SCRIPT- Fixes bitcoin/bitcoin#22467 Fixes bitcoin/bitcoin#22470 ACKs for top commit: laanwj: ACK d4b67c8 MarcoFalke: review ACK d4b67c8 😲 jonatack: ACK d4b67c8 per IRC discussions https://www.erisian.com.au/bitcoin-core-dev/log-2021-07-16.html#l-212 and https://www.erisian.com.au/bitcoin-core-dev/log-2021-07-19.html#l-210 Tree-SHA512: 60d8f0ea0f66a8fcedfcb9c8944a419b974b15509b54ddfeec58db49ae9418e6916df712bba3fbd6b29497d85f7951fb9aa2e48eb9c59f88d09435685bd00b4c
…ry debug assert for oss-fuzz issue" facd567 scripted-diff: Revert "fuzz: Add Temporary debug assert for oss-fuzz issue" (MarcoFalke) Pull request description: No longer needed, as it wouldn't help to debug this issue. See bitcoin/bitcoin#22472 (comment) ACKs for top commit: fanquake: ACK facd567 Tree-SHA512: 13352b3529c43d6e65ab127134b32158d3072dc2fbbb326fea9adfeada5a8610d0477ea75748b8b68e7abb3b9869a989df3a3169e92bdd458053d64bae6ed379
…cumentation fac4814 doc/release-process: Add torrent creation details (Carl Dong) 5d24cc3 guix/INSTALL: Guix installs init scripts in libdir (Carl Dong) 5da2ee4 guix/INSTALL: Add coreutils/inotify-dir-recreate troubleshooting (Carl Dong) 318c607 guix: Adapt release-process.md to new Guix process (Carl Dong) fcab35b guix-attest: Produce and sign normalized documents (Carl Dong) c2541fd guix: Overhaul README (Carl Dong) 46ce6ce tree-wide: Rename gitian-keys to builder-keys (Carl Dong) fc4f844 guix: Update various check_tools lists (Carl Dong) 263220a guix: Check for a sane services database (Carl Dong) Pull request description: Based on: #21462 Keeping the README in one file so that it's easy to search through. Will add more jumping links later so navigation is easier. Current TODOs: - [x] Shell installer option: prompt user to re-login for `/etc/profile.d` entry to be picked up - [x] Binary tarball option: prompt user to create `/etc/profile.d` entry and re-login - [x] Fanquake docker option: complete section - [x] Arch Linux AUR option: prompt to start `guix-daemon-latest` unit after finishing "optional setup" section - [x] Building from source option: Insert dependency tree diagram that I made - [x] Building from source option: redo sectioning, kind of a mess right now - [x] Optional setup: make clear which parts are only needed if building from source - [x] Workaround 1 for GnuTLS: perhaps mention how to remove Guix build farm's key - [x] Overall (after everything): Make the links work. Note to self: wherever possible, tell user how to check that something is true rather than branching by installation option. ACKs for top commit: fanquake: ACK fac4814 - going to go ahead and merge this now. It's a lot of documentation, and could probably be nit-picked / improved further, however, that can continue over the next few weeks. I'm sure more (backportable) improvements / clarifications will be made while we progress through RCs towards a new release. Tree-SHA512: dc46c0ecdfc67c7c7743ca26e4a603eb3f54adbf81be2f4c1f4c20577ebb84b5250b9c9ec89c0e9860337ab1c7cff94d7963c603287267deecfe1cd987fa070a
0a5723b macdeploy: cleanup .temp.dmg if present (fanquake) ecffe86 macdeploy: remove qt4 related code (fanquake) 639f064 macdeploy: select the plugins we need, rather than excluding those we don't (fanquake) 3d26b6b macdeploy: fix framework printing when passing -verbose (fanquake) dca6c90 macdeploy: remove unused plistlib import (fanquake) Pull request description: This includes [one followup](bitcoin/bitcoin#20422 (comment)) and [one bug fix](bitcoin/bitcoin@3d26b6b) from #20422, as well as some simplifications to the `macdeployqtplus` code. ACKs for top commit: hebasto: ACK 0a5723b, tested on macOS Big Sur 11.4 (20F71, x86_64) + Homebrew's Qt 5.15.2. Tree-SHA512: cfad9505eacd32fe3a9d06eb13b2de0b6d2cad7b17778e90b503501cbf922e53d4e7f7f74952d1aed58410bdae9b0bb3248098583ef5b85689cb27d4dc06c029
…chine to upstream 1.3.0 commit e6a94d4 guix: Bump to version-1.3.0 from upstream (Carl Dong) 90fd13b guix: Pin kernel header version (Carl Dong) Pull request description: ``` - Use 4.19 for riscv64 (earliest LTS release w/ riscv64 support) - Use 4.9 for all others (second-oldest LTS release, released in combination with glibc glibc 2.24 in Debian stretch) ``` ``` The chosen commit is the HEAD of Guix's version-1.3.0 branch as of July 15th, 2021. Also fix visual indenting. ``` ----- This + the documentation PR should make our Guix system ready for release! ACKs for top commit: MarcoFalke: review ACK e6a94d4 to change to vanilla guix. Did not review the kernel change. laanwj: ACK e6a94d4 fanquake: ACK e6a94d4 Tree-SHA512: a175e4ddb3ee786a39f5e800ce336932ad2f6797a3a28400a6f723875d0f19833fd36cedc41b3580e4604110517211bd9f557be36adf7265fd8e591c434ae032
…ing for darwin on aarch64 54c7754 build: use aarch64 Clang if cross-compiling for darwin on aarch64 (fanquake) Pull request description: If we're cross-compiling for darwin on aarch64 hardware, we need to use a Clang that will run on that hardware. Only tested in a Linux Docker container (aarch64-unknown-linux-gnu), running on an Apple M1 mac-mini (aarch64-apple-darwin20.5.0). ACKs for top commit: hebasto: ACK 54c7754, I agree it can be merged (fix in #22448 is orthogonal to this one). Tree-SHA512: 66c530097a5dc072a0a00dc22eb3d4a7d923dfa8ab8160f7c3e395cbe58da324f367548d673c0510606f5225d5d37bb5607a76b1703b8b03ac7d2cceeccbd542
…f-announcements 5730a43 test: Add functional test for AddrFetch connections (Martin Zumsande) c34ad33 net, rpc: Enable AddrFetch connections for functional testing (Martin Zumsande) 533500d p2p: Add timeout for AddrFetch peers (Martin Zumsande) b6c5d1e p2p: AddrFetch - don't disconnect on self-announcements (Martin Zumsande) Pull request description: AddrFetch connections (old name: oneshots) are intended to be short-lived connections on which we ask a peer for addresses via `getaddr` and disconnect after receiving them. This is done by disconnecting after receiving the first `addr`. However, it is no longer working as intended, because nowadays, the first `addr` a typical bitcoin core node sends is its self-announcement. So we'll disconnect before the peer gets a chance to answer our `getaddr`. I checked that this affects both `-seednode` peers specified manually, and DNS seeds when AddrFetch is used as a fallback if DNS doesn't work for us. The current behavior of getting peers via AddrFetch when starting with an empty addrman would be to connect to the peer, receive its self-announcement and add it to addrman, disconnect, reconnect to the same peer again as a full outbound (no other addresses in addrman) and then receive more `addr`. This is silly and not in line with AddrFetch peer being intended to be short-lived peers. Fix this by only disconnecting after receiving an `addr` message of size > 1. [Edit] As per review discussion, this PR now also adds a timeout after which we disconnect if we haven't received any suitable `addr`, and a functional test. ACKs for top commit: amitiuttarwar: reACK 5730a43 naumenkogs: ACK 5730a43 jnewbery: ACK 5730a43 Tree-SHA512: 8a81234f37e827705138eb254223f7f3b3bf44a06cb02126fc7990b0d231b9bd8f07d38d185cc30d55bf35548a6fdc286b69602498d875b937e7c58332158bf9
…oadcast logic 5a77abd [style] Clean up BroadcastTransaction() (John Newbery) 7282d4c [test] Allow rebroadcast for same-txid-different-wtxid transactions (glozow) cd48372 [mempool] Allow rebroadcast for same-txid-different-wtxid transactions (John Newbery) 847b6ed [test] Test transactions are not re-added to unbroadcast set (Duncan Dean) 2837a9f [mempool] Only add a transaction to the unbroadcast set when it's added to the mempool (John Newbery) Pull request description: 1. Only add a transaction to the unbroadcast set when it's added to the mempool Currently, if BroadcastTransaction() is called to rebroadcast a transaction (e.g. by ResendWalletTransactions()), then we add the transaction to the unbroadcast set. That transaction has already been broadcast in the past, so peers are unlikely to request it again, meaning RemoveUnbroadcastTx() won't be called and it won't be removed from m_unbroadcast_txids. Net processing will therefore continue to attempt rebroadcast for the transaction every 10-15 minutes. This will most likely continue until the node connects to a new peer which hasn't yet seen the transaction (or perhaps indefinitely). Fix by only adding the transaction to the broadcast set when it's added to the mempool. 2. Allow rebroadcast for same-txid-different-wtxid transactions There is some slightly unexpected behaviour when: - there is already transaction in the mempool (the "mempool tx") - BroadcastTransaction() is called for a transaction with the same txid as the mempool transaction but a different witness (the "new tx") Prior to this commit, if BroadcastTransaction() is called with relay=true, then it'll call RelayTransaction() using the txid/wtxid of the new tx, not the txid/wtxid of the mempool tx. For wtxid relay peers, in SendMessages(), the wtxid of the new tx will be taken from setInventoryTxToSend, but will then be filtered out from the vector of wtxids to announce, since m_mempool.info() won't find the transaction (the mempool contains the mempool tx, which has a different wtxid from the new tx). Fix this by calling RelayTransaction() with the wtxid of the mempool transaction in this case. The third commit is a comment/whitespace only change to tidy up the BroadcastTransaction() function. ACKs for top commit: duncandean: reACK 5a77abd naumenkogs: ACK 5a77abd theStack: re-ACK 5a77abd lsilva01: re-ACK bitcoin/bitcoin@5a77abd Tree-SHA512: d1a46d32a9f975220e5b432ff6633fac9be01ea41925b4958395b8d641680500dc44476b12d18852e5b674d2d87e4d0160b4483e45d3d149176bdff9f4dc8516
…void lock order assertion 9b85a5e tests: Test for dumpwallet lock order issue (Andrew Chow) 25d99e6 Reorder dumpwallet so that cs_main functions go first (Andrew Chow) Pull request description: When a wallet is loaded which has an unconfirmed transaction in the mempool, it will end up establishing the lock order of cs_wallet -> cs_main -> cs_KeyStore. If `dumpwallet` is used on this wallet, then a lock order of cs_wallet -> cs_KeyStore -> cs_main will be used, which causes a lock order assertion. This PR fixes this by reordering `dumpwallet` and `GetKeyBirthTimes` (only used by `dumpwallet`). Specifically, in both functions, the function calls which lock cs_main are done prior to locking cs_KeyStore. This avoids the lock order issue. Additionally, I have added a test case to `wallet_dump.py`. Of course testing this requires `--enable-debug`. Fixes #22489 ACKs for top commit: MarcoFalke: review ACK 9b85a5e 🎰 ryanofsky: Code review ACK 9b85a5e. Nice to reduce lock scope, and good test! prayank23: tACK bitcoin/bitcoin@9b85a5e lsilva01: Tested ACK bitcoin/bitcoin@9b85a5e under the same conditions reported in issue #22489 and the `dumpwallet` command completed successfully. Tree-SHA512: d370a8f415ad64ee6a538ff419155837bcdbb167e3831b06572562289239028c6b46d80b23d227286afe875d9351f3377574ed831549ea426fb926af0e19c755
eeddd1c Update assumed chain params (Sriram) Pull request description: Update the relevant variables in `src/chainparams.cpp` for `mainnet`, `testnet`, and `signet` as given [here](https://github.com/bitcoin/bitcoin/blob/master/doc/release-process.md#before-branch-off). To review this PR, check out [this guide](https://github.com/fanquake/core-review/blob/master/update-assumevalid.md). Note: added a 10% overhead to the base value of `mainnet` in `m_assumed_blockchain_size` ACKs for top commit: MarcoFalke: ACK eeddd1c, checked against my node 🌮 bfolkens: ACK eeddd1c - checked against `mainnet` achow101: Code Review ACK eeddd1c 0xB10C: ACK mainnet, testnet, and signet eeddd1c jamesob: ACK eeddd1c ([`jamesob/ackr/22499.1.sriramdvt.update_assumed_chain_par`](https://github.com/jamesob/bitcoin/tree/ackr/22499.1.sriramdvt.update_assumed_chain_par)) darosior: ACK eeddd1c mainnet and testnet Tree-SHA512: 0ab19d2acc6a854c6aa38fba199d61c68cec40f005d1d54341ea32b59aae9b7d1aabfd21d7c0bc79f54be99d3e71d1d727196cab88f370259fd2c6e002d3e43c
Reviewed up to, but not including, c8d2647 . That took about half an hour to do about 100 commits using my script, which suggests about another 5 hours at this rate, if nothing unexpectedly complex shows up. That's not counting time to deal with whatever fresh changes at the end of the list are not coming from existing PRs. |
Noting the suggested follow-up from a commit mesage:
|
When bringing in bitcoin/bitcoin#20480 , switching from (This was in your merge commit acf709b .) EDIT: Oh, slight revision to that: It looks like |
Reviewed up to, but not including, 81f3883 . Rate continues to be about 3 commits / minute, script reports 859 commits left, a bit under 4h45m of reviewing. (I think I eyeballed it slightly low before.) |
@gwillen boost::get appears to have overloads for both references and pointers, I guess because this is a creative way to make pointer nullability even worse and the boost authors couldn't resist. So the equivalent |
Right, what I'm saying is that it looked like you went the opposite way and switched everything to pointers. In retrospect I'm only seeing a subset of callsites in my diff, but there were a bunch I saw where it looked like the existing code was using |
Beautiful and glorious. I love the smell of special-case hacks getting deleted from the codebase. 👏 |
Nit: in d6c85c5, merging bitcoin PR #20832, in the help text for |
In b8d3a6e, bringing in bitcoin #21042 -- upstream removes |
In bcd5f22, bringing in Bitcoin #20267, upstream splits some tests into |
Noting for the record, from 61a241c:
|
Noting for the record in case I have to investigate anything about the GUI later: there was a merge conflict related to the GUI in 2b9625f, merging bitcoin-core/gui#204 (and again in 41743b6 merging bitcoin-core/gui#205 .) |
Sure, I'd appreciate some examples. This was many months ago and I've forgotten what I did. I wouldn't mind opening an issue to audit all these instances after this PR. |
Nit: Seems like some debugging bits maybe got left in a couple places. In d39d57c, merging upstream #20286, there's a new And in c4faf2f, merging upstream #20459, an empty |
Nit: something slightly annoying happened with formatting in a9ef79a, merging upstream PR #21575. It looks like they did a move commit that also changed some formatting stuff for no particular reason, AND conflicted with some changes of ours, and in merging our changes back in we undid the formatting stuff, creating some unintentional bonus diff. Possibly not worth fixing. |
Noting for the record, from the commit message in d51f425, merging upstream #21169:
|
For the record, the commit message from d56bdbd, merging bitcoin/bitcoin#21359:
(I'm just commenting whenever I encounter a commit message saying some work was deferred to later, so we remember to track that work.) |
I'm going to be a coward and SKIP reviewing 8b34c97 for now -- I'm going to go right past it and not even read it, making a note here to come back to it later. It's definitely the largest diff of any that I have encountered during this entire review, maybe by an order of magnitude, and I'm not going to be able to do it justice at 11PM. I'll come back for it at the end when I'm a little more awake. |
More future-work notes from commit messages, 3ffb9aa:
Also, there's some added code for CT-Taproot in this commit, which looks reasonable to my eyeball, but I'm not familiar enough with Taproot to really have an opinion about the approach. |
More future-work notes, from e4746d6:
|
Note: ae15e5d (bitcoin/bitcoin#22405) is where the |
Future-work from 36e5e2a:
|
36e5e2a, merging elements#900, is complex enough that it might be nice to get @achow101 to review the merge given that the merged PR is his work. The only thing I definitely noticed was a nit: a stray mention of Also, from the commit message:
@achow101 if you do want to look at this (reviewing the merge forward-porting #900 to 0.22) please let me know and I'm happy to provide any assistance. (I have a script to help me review merges, but I can't find any diff view that doesn't make a hash of this one unfortunately.) |
In 7d1c77f, merging #1002 (which looks fine) I'm curious about something strategy-wise, in terms of how we maintain our diff vs upstream -- why rename the various Taproot constants to @sanket1729 I guess you were the implementer here -- any thoughts on this? (In general, going through this process makes me wish we had less diff against upstream in some places even though the diff is for a good reason; e.g. all the places we renamed nValue to mapValue or something like that, I kind of would like to undo the rename to reduce the diff a lot, and just leave a comment at the declaration instead.) |
From ba3d786: "In future let's really try to stay up to date with Core." Yeah, I think having backports come in pieces from Core as Elements MRs and then separately as core PRs makes for weird and messy merges and diffs. I'm not sure what our strategy ought to be, but we ought to think and talk about our strategy for this kind of thing if there will be more in the future. (If just doing Elements releases fairly quickly after Core releases would be sufficient that we don't need to backport stuff, I'm all for making that our aim.) |
Future work from 446f764 merging elements#1033:
|
The values of the constants were changed from bitcoin, which is why I renamed them. I have no opposition to renaming the constants if it makes maintaining elements easier. |
In e4c9cc0, which is back quite a ways, there's an issue I did not catch when initially looking at it -- the I will have to figure out why I didn't catch this the first time through, and also what I should do about it -- trying to go back and fix the original merge is probably not worth it. |
WIP while I get CI to pass.