Skip to content
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

Bitcoin integration #1117

Closed
wants to merge 1,885 commits into from
Closed

Conversation

dsaveliev
Copy link
Member

@dsaveliev dsaveliev commented Jun 3, 2019

Merge Bitcoin 0.18.0 to the master branch.

Agenda:

  • Make it compile
  • Rebase (and keep rebased) with current master
  • Refactor the locked_chain logic
  • Remove all the TODOs, related to this backport (See UNIT-E TODO [0.18.] tags)
  • Get rid of the compilation warnings
  • Get rid of the linkage errors
  • Fix unit tests:
    • blockdiskstorage_tests (see blockdiskstorage_tests.log)
    • proposer_tests (see proposer_tests.log)
    • fs_tests (see fs_tests.log)
    • rpcwalletext_tests (see rpcwalletext_tests.log)
    • tx_validationcache_tests (see tx_validationcache_tests.log)
    • txindex_tests (see txindex_tests.log)
    • txvalidation_tests (see txvalidation_tests.log)
    • validation_block_tests (see validation_block_tests.log)
    • wallet_tests (see wallet_tests.log)
    • walletextension_tests (see walletextension_tests.log)
  • Fix functional tests
  • Fix lint checks

Signed-off-by: Dmitry Saveliev [email protected]

meshcollider and others added 30 commits February 13, 2019 14:26
5039e4b Remove unnecessary const_cast (Julian Fleischer)

Pull request description:

  The const_cast

  ```C++
  CBlock &block = const_cast<CBlock&>(chainparams.GenesisBlock());
  ```

  is not necessary as all the functions invoked form this block receive a `const CBlock&` anyway. Simply add the `const` to `block`:

  ```C++
  const CBlock& block = chainparams.GenesisBlock();
  ```

  Casting away `const`, especially from something as precious as the genesis block, feels really weird to me as a reader of bitcoin-core source code.

Tree-SHA512: 0290b2cabb216a60655ded153ed1f213c051fb216cec6f3f810f8b760e276f8def86eb696c492e89631682531e215f56d7897b59685d3aa787bcd80cc4f86c90
318b1f7 [wallet] Close bdb when flushing wallet. (John Newbery)

Pull request description:

  bdb would not be closed when closing the wallet in wallet-tool. Fix this by calling wallet->flush with true.

Tree-SHA512: f722e527e4806eca5254221e944f57853d11bf89a9264309fa558a6cc2b23feefb7bb2963e87b4fad9cfb31ac4cffe563688988e0614a481a8ff1d393aceb132
a4b92e4 Log full paths for wallets (Hennadii Stepanov)

Pull request description:

  Fix #15333

  `debug.log` with this PR:
  ```
  ...
  2019-02-03T19:02:35Z Using wallet directory /home/hebasto/.bitcoin/testnet3/wallets
  2019-02-03T19:02:35Z init message: Verifying wallet(s)...
  2019-02-03T19:02:35Z Using BerkeleyDB version Berkeley DB 4.8.30: (April  9, 2010)
  2019-02-03T19:02:35Z Using wallet test_alpha/wallet.dat
  2019-02-03T19:02:35Z BerkeleyEnvironment::Open: LogDir=/home/hebasto/.bitcoin/testnet3/wallets/test_alpha/database ErrorFile=/home/hebasto/.bitcoin/testnet3/wallets/test_alpha/db.log
  2019-02-03T19:02:35Z Using BerkeleyDB version Berkeley DB 4.8.30: (April  9, 2010)
  2019-02-03T19:02:35Z Using wallet alpha_wallet/wallet.dat
  2019-02-03T19:02:35Z BerkeleyEnvironment::Open: LogDir=/home/hebasto/.bitcoin/testnet3/wallets/alpha_wallet/database ErrorFile=/home/hebasto/.bitcoin/testnet3/wallets/alpha_wallet/db.log
  2019-02-03T19:02:35Z Using BerkeleyDB version Berkeley DB 4.8.30: (April  9, 2010)
  2019-02-03T19:02:35Z Using wallet wallet.dat
  2019-02-03T19:02:35Z BerkeleyEnvironment::Open: LogDir=/home/hebasto/.bitcoin/testnet3/wallets/database ErrorFile=/home/hebasto/.bitcoin/testnet3/wallets/db.log
  2019-02-03T19:02:35Z Using BerkeleyDB version Berkeley DB 4.8.30: (April  9, 2010)
  2019-02-03T19:02:35Z Using wallet none/wallet.dat
  2019-02-03T19:02:35Z BerkeleyEnvironment::Open: LogDir=/home/hebasto/.bitcoin/testnet3/wallets/none/database ErrorFile=/home/hebasto/.bitcoin/testnet3/wallets/none/db.log
  2019-02-03T19:02:35Z init message: Loading banlist...
  ...
  ```

Tree-SHA512: 8dd4408d3f6b04f396dd0ae0d248fedc3a0f6d36788556ae1662443f06f2ecce1c2be9456bf8d1b3d25b29c2a0cfb03cb805bde0a40387e68988ab932e17e118
…; related refactoring.

102faad Factor out combine / finalize / extract PSBT helpers (Glenn Willen)
78b9893 Remove op== on PSBTs; check compatibility in Merge (Glenn Willen)
bd0dbe8 Switch away from exceptions in refactored tx code (Glenn Willen)
c6c3d42 Move PSBT definitions and code to separate files (Glenn Willen)
81cd958 Factor BroadcastTransaction out of sendrawtransaction (Glenn Willen)
c734aaa Split DecodePSBT into Base64 and Raw versions (Glenn Willen)
162ffef Add pf_invalid arg to std::string DecodeBase{32,64} (Glenn Willen)

Pull request description:

  * Move most PSBT definitions into psbt.h.
  * Move most PSBT RPC utilities into psbt.{h,cpp}.
  * Move wallet-touching PSBT RPC utilities (FillPSBT) into
      wallet/psbtwallet.{h,cpp}.
  * Switch exceptions from JSONRPCError() to new PSBTException class.
  * Split DecodePSBT into DecodeBase64PSBT (old behavior) and DecodeRawPSBT.
  * Add one new version of DecodeBase64 utility in strencodings.h (and
      corresponding DecodeBase32 for completeness).
  * Factor BroadcastTransaction utility function out of sendrawtransaction RPC
      handler in rpc/rawtransaction.cpp

  Note: For those keeping score at home wondering why refactor, this is in anticipation of (and developed in parallel with) a change to actually introduce GUI use of all this stuff, which is already under development and working-ish.

Tree-SHA512: 2197c448e657421f430943025357597e7b06c4c377d5d4b2622b9edea52a7193c48843dd731abb3a88ac4023a9c88d211991e0a9b740c22f2e1cbe72adefe390
This commit was a fix to `m_assumed_blockchain_size` reverted from
3fc2063's 220 to 9d0e528's 200 since work on 9d0e528 was being done in
parallel and ended up reverting `m_assumed_blockchain_size`.

This commits is now a intended to be a bump of
`m_assumed_blockchain_size` for both mainnet and testnet for new
reasonable values.
8c3fdd3 fixes m_assumed_blockchain_size variables values: (marcoagner)

Pull request description:

  This is used by Qt but I'm not sure if this is the right tag here.
  Please, edit the title if there's something better.

  `m_assumed_blockchain_size` (src/chainparams.cpp:CChainParams) was
  `BLOCK_CHAIN_SIZE` (src/qt/intro.cpp) and while the transition was being
  made by PR 13216 (merged commit: 9d0e528), 3fc2063 changed its value
  from 200 to 220, which 9d0e528 ended up reverting.

  So, as per MarcoFalke's suggestion (bitcoin/bitcoin#13216 (comment)), I'm bumping it to 240 before 0.18 is
  branched to avoid any confusion.

  Anything else (e.g. constexpr) that should/could be done here? Thanks.

Tree-SHA512: 4319739b870a2b96a57f268f9edc7dd9f9eff5c4ca3b01863e6b861b9ca58c245416ce362dae54d1673e3d5b1c7f5a16e4031842af250e1b1f0a5109b75fb3c3
…72 part II

3c6ef03 msvc: Fix silent merge conflict between #13926 and #14372 part II (Chun Kuan Lee)

Pull request description:

  In #15325, I added secp256k1 as a dependency of bitcoin-wallet. However, I didn't notice that leveldb is also a dependency of it.

Tree-SHA512: dc29b5cad6c529dd9517d6c2cbbe5297b69e73303e2fbbcd4b4842c9c5b51a4332df5a4bf3b82cd3ed2c1668cc95f8c9636f9485af0d722fed9c1319da3cc2e2
4a43eb8 [build] Makefile.am: add rule for src/bitcoin-wallet (Sjors Provoost)

Pull request description:

  Otherwise `make src/bitcoin-wallet` will fail with `No rule to make target`.

  Also adds `bitcoin-wallet.exe` to the Windows installer.

Tree-SHA512: 932c34b349ec3efa17d1f1251d386434d0db6a07939d500236364a851468981c69392e2a00e26c9753d9b2d8ef056b5de870c5bd5202aa0c73326f9ed1403681
Creates new files util/bip32.h and util/bip32.cpp for containing
BIP 32 stuff.
Moves FormatKeyPath from descriptor.cpp to util/bip32.
Adds a wrapper around it to prepent the 'm' for when just the
BIP 32 style keypath is needed.
…1 parsing

84f5315 Travis: Add test without BIP70 (but still full wallet + tests) (Luke Dashjr)
113f000 GUI: If BIP70 is disabled, give a proper error when trying to open a payment request file (Luke Dashjr)
9975282 GUI: If BIP70 is disabled, attempt to fall back to BIP21 parsing (Luke Dashjr)

Pull request description:

Tree-SHA512: 66a684ce4336d0eac8b0107b405ff3a2cf312258a967f3e1b14734cd39db11e2db3e9b03492755583170d94d54754ef536b0776e5f19a0cc2caca8379eeb4495
fd46c4c Bump minimum Qt version to 5.5.1 (Sjors Provoost)

Pull request description:

  Fixes #13478

  Compiled and lightly tested on 10.14.3 against QT 5.12.0.

Tree-SHA512: 6890331969bbf4c66dc0993b8817b1f0831d008f5863554e9c09a38f4700260b84044ff961664c377decc9fb8300e3543c267f935ec64fbc97b20f8fb396247a
94086fb gui: Add close wallet action (João Barbosa)
f77ba34 gui: Add closeWallet to WalletController (João Barbosa)
f6122ab interfaces: Add remove to Wallet (João Barbosa)

Pull request description:

  This PR adds support to close the current wallet in the GUI.

  <img width="543" alt="screenshot 2019-01-18 at 00 44 26" src="https://user-images.githubusercontent.com/3534524/51358241-424b9680-1aba-11e9-88f2-b85869507737.png">
  <img width="532" alt="screenshot 2019-01-18 at 00 44 38" src="https://user-images.githubusercontent.com/3534524/51358242-424b9680-1aba-11e9-83e2-fa275a9017b3.png">

Tree-SHA512: fd7da4d0f73dc240864cc57a1ff1526daf2376904ce3872e52eeca5d40cc21c6dd29eb2ef25f85ffa63697362c150221a2369d80ad36ae445cc99989d337b688
@dsaveliev dsaveliev added the upstream sync Related to upstream merges label Jun 3, 2019
@dsaveliev dsaveliev added this to the 0.2 milestone Jun 3, 2019
@dsaveliev dsaveliev requested a review from a team June 3, 2019 07:34
@dsaveliev dsaveliev self-assigned this Jun 3, 2019
@castarco castarco added the wip Work in progress which is not supposed to be merged yet label Jun 3, 2019
Copy link
Member

@cornelius cornelius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good in general. Kudos for doing this work :-).

I added comments about some details.

.appveyor.yml Outdated Show resolved Hide resolved
@@ -0,0 +1,49 @@
Building unit-e with Visual Studio
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose we haven't tested building unit-e with Visual Studio yet. Maybe we should remove the build_msvc directory until we have done that and readd it then.

configure.ac Show resolved Hide resolved
AC_ARG_ENABLE(gui-tests,
AS_HELP_STRING([--disable-gui-tests],[do not compile GUI tests (default is to compile if GUI and tests enabled)]),
[use_gui_tests=$enableval],
[use_gui_tests=$use_tests])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose we don't need the gui tests as we have removed the gui.

@@ -1,25 +0,0 @@
# It is not recommended to modify this file in-place, because it will
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why has this file been deleted?

doc/build-osx.md Outdated Show resolved Hide resolved
doc/build-osx.md Outdated Show resolved Hide resolved
doc/psbt.md Outdated Show resolved Hide resolved
test/lint/lint-qt.sh Outdated Show resolved Hide resolved
test/lint/lint-assertions.sh Show resolved Hide resolved
We currently don't run AppVeyor on unit-e, so remove the upstream
configuration for it.

Signed-off-by: Cornelius Schumacher <[email protected]>
Use `unit-e` when referring to the client.

Signed-off-by: Cornelius Schumacher <[email protected]>
We have removed the Qt wallet, so it's not necessary to build Qt anymore.

We also don't build the DMGs for Mac, so these notes are not needed
anymore. We had removed them from the README_osx.md but that content
was moved to the build-osx.md file in 0.18.

Signed-off-by: Cornelius Schumacher <[email protected]>
Keep "Bitcoin" in "Partially Signed Bitcoin Transactions" as this
is the name of the concept. We apply this to Unit-e transactions
in unit-e, but keep the name and the acronym "PSBT".

Signed-off-by: Cornelius Schumacher <[email protected]>
We don't have Qt code anymore so we don't need the linter.

Signed-off-by: Cornelius Schumacher <[email protected]>
Include lint checks which were added in 0.18 in the lint-all script
so they are all run.

Also fix the logic to be the one from the unit-e
master branch to always run all checks and not stop on the first
failure and remove the obsolete LINTALL variable.

Some of the checks fail on the upstream sync branch. We'll need to
fix them. I'll add todos to the pull request.

Signed-off-by: Cornelius Schumacher <[email protected]>
We don't build Qt anymore so we also don't need the patches.

Signed-off-by: Cornelius Schumacher <[email protected]>
[enable_fuzz=$enableval],
[enable_fuzz=no])

AC_ARG_WITH([qrencode],
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, we don't need QR support

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't?

@cornelius cornelius mentioned this pull request Jun 5, 2019
4 tasks
dsaveliev and others added 9 commits June 6, 2019 10:21
Signed-off-by: Dmitry Saveliev <[email protected]>
Remove the empty library which sneaked in during the merge again.

Signed-off-by: Cornelius Schumacher <[email protected]>
Signed-off-by: Dmitry Saveliev <[email protected]>
Signed-off-by: Dmitry Saveliev <[email protected]>
Signed-off-by: Stanislav Frolov <[email protected]>
Signed-off-by: Stanislav Frolov <[email protected]>
Signed-off-by: Dmitry Saveliev <[email protected]>
@thothd thothd closed this Aug 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream sync Related to upstream merges wip Work in progress which is not supposed to be merged yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.