Skip to content

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

Closed
wants to merge 4,618 commits into from

Conversation

apoelstra
Copy link
Member

WIP while I get CI to pass.

MarcoFalke and others added 30 commits July 19, 2021 19:12
…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
@gwillen
Copy link
Contributor

gwillen commented Mar 19, 2022

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.

@gwillen
Copy link
Contributor

gwillen commented Mar 21, 2022

Noting the suggested follow-up from a commit mesage:

commit 183caa4bd24123e9395d2d70d8d3ead4443c4d1e
Merge: bc9605a44a 6f2ca726ce
Author: Andrew Poelstra <apoelstra@wpsoftware.net>
Commit: Andrew Poelstra <apoelstra@wpsoftware.net>

    Merge 6f2ca726ce2 into merged_master (Bitcoin PR #20658)
    
    This deletes .travis.yml. In a follow-up commit (to the whole rebase) we should
    re-instate the Liquid-specific CI tests in Cirrus.

@gwillen
Copy link
Contributor

gwillen commented Mar 21, 2022

When bringing in bitcoin/bitcoin#20480 , switching from boost::variant to std::variant, it seems like you'd want to switch from boost::get to the directly-analogous std::get, rather than std::get_if, which is the version that can return nullptr on failure, and as a result has to use pointers instead of references. It looks like you are in fact assuming success, since you immediately dereference the returned pointers anyway (in at least one place.) What's up here?

(This was in your merge commit acf709b .)

EDIT: Oh, slight revision to that: It looks like boost::get is overloaded to provide both versions. So it's possible you want std::get when it's used with references and std::get_if when it's used with pointers. If there's not some other reason you did it the way you did instead, I'm happy to poke more at it and propose an alternative version.

@gwillen
Copy link
Contributor

gwillen commented Mar 21, 2022

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.)

@apoelstra
Copy link
Member Author

@gwillen get, by using references rather than pointers, does not have the correct signature to use in these contexts. It would be more invasive to switch everything to references (assuming that I even could), though maybe I should've.

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 std method depends on which overload was used.

@gwillen
Copy link
Contributor

gwillen commented Mar 22, 2022

@gwillen get, by using references rather than pointers, does not have the correct signature to use in these contexts. It would be more invasive to switch everything to references (assuming that I even could), though maybe I should've.

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 std method depends on which overload was used.

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 boost::get with references, and you switched to std::get_if with pointers, instead of std::get. Possibly you did a few of these before noticing the difference, and didn't go back and undo them? I can find specific instances if you want, but it looked like there were lots.

@gwillen
Copy link
Contributor

gwillen commented Mar 22, 2022

Merge https://github.com/ElementsProject/elements/commit/11cbd4bb54af079674c5fc1f0c695c00c7e1e44a into merged_master (Bitcoin PR #17556)
This PR eliminates "strange regtest=0 behavior" in a test which had forced
us to disable the test for Elements. Can re-enable now :)

I also removed the `chain_in_args` parameter to `TestNode`, which Steven added
in https://github.com/ElementsProject/elements/pull/533 (which itself replaces
unconditionally adding chain={} on the command-line, which was added in https://github.com/ElementsProject/elements/pull/458).
These were added in the 0.17 rebase to deal with the job of starting bitcoind,
which then did not support the `chain=` command-line arg as well as elementsd,
which back then required this command-line arg.

This was causing some issues with the "check -acceptnonstdtxn doesn't work on
mainnet" test because it would add -chain=elementsregtest to the command-line
of a daemon that was supposed to be connecting to mainnet/liquidv1. It is
possible to override this behavior, but since 0.20+ versions of elementsd and
bitcoind have essentially the same support for chain= options, it seemed
cleaner to just eliminate the diff.

Beautiful and glorious. I love the smell of special-case hacks getting deleted from the codebase. 👏

@gwillen
Copy link
Contributor

gwillen commented Mar 28, 2022

Nit: in d6c85c5, merging bitcoin PR #20832, in the help text for validateaddress, our change from The bitcoin address validated to The address validated got accidentally reversed in the merge.

@gwillen
Copy link
Contributor

gwillen commented Mar 29, 2022

In b8d3a6e, bringing in bitcoin #21042 -- upstream removes self.setup_clean_chain = False in a bunch of places, since it's the default. However we had changed this to True in IncludeConfTest. I have no idea why and it doesn't sound like it would matter, especially assuming tests kept passing after this merge. But noting for the record that this merge deleted the line where we had set it to True, so defaulting it back to False, as far as I can tell.

@gwillen
Copy link
Contributor

gwillen commented Mar 29, 2022

In bcd5f22, bringing in Bitcoin #20267, upstream splits some tests into --legacy-wallet and --descriptors invocations. For rpc_rawtransaction.py, it looks like after the merge, we actually invoke it three times, once with each of those arguments, but also once with neither. I don't know what that does, I assume the test suite still passes after this change so maybe it just silently does nothing, but it seems like a typo.

@gwillen
Copy link
Contributor

gwillen commented Mar 30, 2022

Noting for the record, from 61a241c:

    TODO: determine how Assumeutxo interacts with the fact that we don't save
    out nonces in our normal UTXO serialization. Probably we will need to remove
    the nonce from the CCoinStats serialization to avoid having inconsistent
    hashes across nodes, since these hashes are now checked in assumeutxo?

@gwillen
Copy link
Contributor

gwillen commented Mar 30, 2022

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 .)

@apoelstra
Copy link
Member Author

@gwillen get, by using references rather than pointers, does not have the correct signature to use in these contexts. It would be more invasive to switch everything to references (assuming that I even could), though maybe I should've.
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 std method depends on which overload was used.

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 boost::get with references, and you switched to std::get_if with pointers, instead of std::get. Possibly you did a few of these before noticing the difference, and didn't go back and undo them? I can find specific instances if you want, but it looked like there were lots.

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.

@gwillen
Copy link
Contributor

gwillen commented Apr 5, 2022

Nit: Seems like some debugging bits maybe got left in a couple places. In d39d57c, merging upstream #20286, there's a new print(output) in test/functional/feature_pak.py that looks like it might not have been meant to leave in (although I don't really know where that even goes in a test.)

And in c4faf2f, merging upstream #20459, an empty if added to src/rpc/util.cpp, and an addition of #include <iostream> that looks like it might have been for debug output.

@gwillen
Copy link
Contributor

gwillen commented Apr 5, 2022

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.

@gwillen
Copy link
Contributor

gwillen commented Apr 6, 2022

Noting for the record, from the commit message in d51f425, merging upstream #21169:

    Adds fuzztests for RPC. FIXME there is a crash; I just disabled the
    test for now and we can revisit in a future PR.

@gwillen
Copy link
Contributor

gwillen commented Apr 6, 2022

For the record, the commit message from d56bdbd, merging bitcoin/bitcoin#21359:

    I hacked up rpc_fundrawtransaction.py a little bit because our `get_address`
    method here depends on nobody having called `createwallet` on a particular
    node ... the "correct" fix for this would be to redo the Elements changes
    to this functional test for the 0.20+ createwallet changes, but because
    there will be big future changes to this test (in Elements #900 (PSET))
    I did the quick/hacky thing, and will defer cleanups to a separate
    post-rebase PR.

(I'm just commenting whenever I encounter a commit message saying some work was deferred to later, so we remember to track that work.)

@gwillen
Copy link
Contributor

gwillen commented Apr 6, 2022

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.

@gwillen
Copy link
Contributor

gwillen commented Apr 6, 2022

More future-work notes from commit messages, 3ffb9aa:

    Merge c7dd9ff71b9 into merged_master (Bitcoin PR bitcoin/bitcoin#22051)
    
    Does the bare minimum to introduce Taproot wallet support with CT; just
    adds a CPubKey blinding_pubkey to the taproot destination variant and
    updates some visitors.
    
    In future when we define blech32 we will need to make sure we are using
    that encoding and using the pubkey.

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.

@gwillen
Copy link
Contributor

gwillen commented Apr 7, 2022

More future-work notes, from e4746d6:

    This PR adds a fuzz test ensuring that all the different destination types
    round-trip to strings (an important test given that Satoshi managed to mess
    this up, having two different address types encode the same way..)
    
    Anyway we fail this test, since both CNoDestination and NullData encode as
    empty strings, and then this "decodes" as CNoDestination (and returns an
    error, but the fuzztest doesn't check that). To make the fuzzer pass, I
    changed NullData to encode and decode as "null".
    
    I think this actually adds some functionality, letting you use "null" as
    an "address" for sendtoaddress and createrawtransaction, thus burning the
    coins and fixing #1011...but this was not my intent and we probably want
    to think a bit more carefully before deliberately supporting this.

@gwillen
Copy link
Contributor

gwillen commented Apr 7, 2022

Note: ae15e5d (bitcoin/bitcoin#22405) is where the --enable-glibc-back-compat gets removed from the Guix build, which IIRC impacts us negatively.

@gwillen
Copy link
Contributor

gwillen commented Apr 7, 2022

Future-work from 36e5e2a:

    TODO: grep for `blindpsbt` and you will see that this RPC is still referenced
    in documentation and help text even though it was deleted. Need to fix this
    in 0.21 in a separate PR.

@gwillen
Copy link
Contributor

gwillen commented Apr 12, 2022

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 boost::variant left in a comment in src/util/settings.h.

Also, from the commit message:

    TODO: grep for `blindpsbt` and you will see that this RPC is still referenced
    in documentation and help text even though it was deleted. Need to fix this
    in 0.21 in a separate PR.

@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.)

@gwillen
Copy link
Contributor

gwillen commented Apr 12, 2022

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 _ELEMENTS? I know ideally one would be clear about that, but it adds quite a lot of extra diff that it would be nice to avoid.

@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.)

@gwillen
Copy link
Contributor

gwillen commented Apr 12, 2022

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.)

@gwillen
Copy link
Contributor

gwillen commented Apr 12, 2022

Future work from 446f764 merging elements#1033:

    This fixes a bug that was eliminated by #22008 -- although a conceptually
    similar one was reintroduced (basically, we do a "test blinding" for fee
    estimation, then potentially delete a change output, then we actually blind
    the tranasction .... but if removing the change output pushes us into an
    edge-case scenario for blinding, Bad Things happen).
    
    Patched in a simple hack. We should fix this properly in a post-22 PR.

@sanket1729
Copy link
Member

I know ideally one would be clear about that, but it adds quite a lot of extra diff that it would be nice to avoid.

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.

@gwillen
Copy link
Contributor

gwillen commented Apr 20, 2022

In e4c9cc0, which is back quite a ways, there's an issue I did not catch when initially looking at it -- the &s on some reference parameters got dropped. This caused them to become apparently-unused, which acab524 was attempting to fix. However, they were not unused, and this breaks the original change (and this may be related to the CI issues.)

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants