Skip to content

Catch up with Core until commit f617e05c38c9c7e663b824fefe5329cc5cbbf26a - #620

Merged
stevenroose merged 425 commits into
ElementsProject:masterfrom
stevenroose:catchup
May 16, 2019
Merged

Catch up with Core until commit f617e05c38c9c7e663b824fefe5329cc5cbbf26a#620
stevenroose merged 425 commits into
ElementsProject:masterfrom
stevenroose:catchup

Conversation

@stevenroose

@stevenroose stevenroose commented May 14, 2019

Copy link
Copy Markdown
Contributor

Currently this catches up until Core commit f617e05 and has everything working except the p2p_invalid_messages unit test that gets some updates in later upstream commits.

I'm planning to continue to catch up to 519b0bc next, which is the merge-base between upstream master and upstream v0.18.0.

Fixes #532.

practicalswift and others added 30 commits October 16, 2018 13:48
032488e Move SocketHandler logic to private method. (Patrick Strateman)
2af9cff Move InactivityCheck logic to private method. (Patrick Strateman)
7479b63 Move DisconnectNodes logic to private method. (Patrick Strateman)
edb5350 Move NotifyNumConnectionsChanged logic to private method. (Patrick Strateman)

Pull request description:

  Working towards using poll() on unix like systems.

  A number of small changes designed to separate the actual socket handling from the rest of the logic in ThreadSocketHandler.

  This is a simpler version of #14147

Tree-SHA512: 72f35c8ef7649019dcbfe19537d8c9f7e3d0fc5854dc691a70c5573352230fc31c3f55565820c632e9b8cb3c55b878bed19e0ad9423100762197ac35967d8067
In advance of deprecating the generate RPC method, make some small
changes to a small number of inidividual test cases:

- make memory checking less prescriptive in wallet_basic.py
- replace calls to generate with generatetoaddress in wallet_keypool.py
- replace calls to generate with generatetoaddress and fixup label
  issues in wallet_labels.py
- replace calls to generate with generatetoaddress in wallet_multiwallet.py
When we receive invalid txs for the first time, we mark the sender as
misbehaving. If we receive the same tx before a new block is seen, we *don't*
punish the second sender (in the same way we do the original sender). It wasn't
initially clear to me that this is intentional, so add a clarifying comment.
c32cf6a Add ignored word: mut (practicalswift)
4ae50da Revert "qa: Fix codespell error and have lint-spelling error instead of warn" (practicalswift)

Pull request description:

  Revert `codespell` policy change introduced in #14179.

  Context: bitcoin/bitcoin#13954 (comment)

Tree-SHA512: 4606b19bb32cdd661f90b3778759818d3493e5ed1a4a2f95982f07eeb6b9c889bc8d53cde31706e0a3b9524c3d3a7378f1b769a60baeb0d00da4c68fd3068114
…nstall from PyPI in Travis

ee0b7c4 build: Pin to specific versions of Python packages we install from PyPI in Travis (practicalswift)

Pull request description:

  Pin to specific versions of Python packages we install from PyPI in Travis.

  To avoid the possibility of surprise build failures when a new version of a PyPI dependency is released.

Tree-SHA512: 1c9abc094ad6b38992d0e7a5dd7f6c6c070a2eb81b052eb2397c1f1a489162cf8cedbd33db9bf97f32a81ed4dd0e986a76815c623a9b6c04b6ca6c5832d68211
081cc02 Fix QCompleter popup regression (Hennadii Stepanov)

Pull request description:

  The PR #8129 has introduced a regression with the `QCompleter` popup in the Debug window.

  How to reproduce:

  1.  open the Debug window;
  2.  go to the 'Console' tab;
  3.  start writing some RPC command and try to pick it from the list using arrow keys, press Enter.

  Note that the popup used to display completions is not being closed. To close it they should mouse click somewhere outside of the popup.

  The wrong behaviour of the `QCompleter` popup is observed on Linux Mint 19 and Windows 10.
  This PR fixes this regression.

  Refs:

  - #7613
  - #7772
  - #8129

Tree-SHA512: f3ba8d08e1c07619d4ef307544306b57be43e4e726770976cf0c2af95082bd66e2eefe8aabb9a3fad0601cd9e6e4dea0459b6a63eba512023234feb308484655
d562027 [doc] getblocktemplate: use SegWit in example (Sjors Provoost)

Pull request description:

  Make it less likely for new miners to accidentally mine non-SegWit blocks.

  Suggest backport to 0.17 so the docs on bitcoincore.org get updated at the next minor release.

Tree-SHA512: fc8c51690559d3e64d03c0eec433c75e5581d616d36b529e16f89ff2433457386feba7ef3b0d22f245d3f725183a2204fef7ee13e25cb92b945ab61f99068dee
…ename on Windows

43c7fbb Make MSVC compiler read the source code using utf-8 (Chun Kuan Lee)
f86a571 tests: Add test case for std::ios_base::ate (Chun Kuan Lee)
a554cc9 Move boost/std fstream to fsbridge (Chun Kuan Lee)
86eb3b3 utils: Add fsbridge fstream function wrapper (Chun Kuan Lee)

Pull request description:

  If compiled with mingw, use glibc++ extension `stdio_filebuf` to open the file by `FILE*` instead of filename.

  In other condition, we can use boost::fstream.

Tree-SHA512: b5dbd83e347fb9b2a0c8b1c2c7bd71a272e839ec0617883b2a0ec12506ae9e825373cf6e95b9bcc91d7edc85bf51580a7716b56a9ecaad776bc3ae61638cb3da
2d47163 wallet: Remove trailing separators from -walletdir arg (Pierre Rochard)
ea3009e wallet: Add walletdir arg unit tests (Pierre Rochard)

Pull request description:

  If a user passes in a path with a trailing separator as the `walletdir`, multiple BerkeleyEnvironments may be created in the same directory which can lead to data corruption.

  Discovered while reviewing bitcoin/bitcoin#12493 (comment)

Tree-SHA512: f2bbf1749d904fd3f326b88f2ead58c8386034355910906d7faea155d518642e9cd4ceb3cae272f2d9d8feb61f126523e1c97502799d24e4315bb53e49fd7c09
b0510d7 Set C locale for amountWidget (Hennadii Stepanov)

Pull request description:

  Fix #13873

Tree-SHA512: ef26b35ef83c3a87ebd90650f6d833b00a24f6c114b68fe01acd4a14d1f5bdec066f438eb7781c1e55c32640838c54e00b8f082c390639ade8d9a58830833d4a
2ab9140 Add tooltips for both datadir and blocksdir (Hennadii Stepanov)
3045704 Add "Blocksdir" to Debug window (Hennadii Stepanov)

Pull request description:

  To get the current `blocksdir` is valuable for debug purposes after
  merging #12653.

  ![screenshot from 2018-10-02 23-16-52](https://user-images.githubusercontent.com/32963518/46374770-2ef6f580-c69a-11e8-85c2-44a49fa36b28.png)

Tree-SHA512: a93f2c00ee19cf6acb499d3bd9bccf4be8ef01c53c44d917ad401aa4797db02cbccb71a9c24e05262ea09345e15f9299381367fdc6951f21dd3788a4a58d2132
…::bits()

96f6dc9 Avoid triggering undefined behaviour in base_uint<BITS>::bits() (practicalswift)

Pull request description:

  Avoid triggering undefined behaviour in `base_uint<BITS>::bits()`.

  `1 << 31` is undefined behaviour in C++11.

  Given the reasonable assumption of `sizeof(int) * CHAR_BIT == 32`.

Tree-SHA512: 995fa38e71c8921873139ecf1b7dd54178555219af3be60d07290f379439ddd8479e3963c6f3cae8178efb61063a0f9add6cba82a5578d13888597b5bcd54f22
Adds a generate() method to the TestNode class in the test framework.
This method intercepts calls to generate, imports a dewterministic
private key to the node and then calls generatetoaddress to generate the
block to that address.

Note that repeated calls to importprivkey for the same private keys are
no-ops, so it's fine to call the generate() method many times.
ListWalletDir returns all available wallets in the current wallet directory.

Based on MeshCollider work in pull #11485.
d56a068 docs: Add release notes for listwalletdir RPC (João Barbosa)
0cb3cad qa: Add tests for listwalletdir RPC (João Barbosa)
cc33773 rpc: Add listwalletdir RPC (João Barbosa)
d1b03b8 interfaces: Add getWalletDir and listWalletDir to Node (João Barbosa)
fc4db35 wallet: Add ListWalletDir utility (João Barbosa)

Pull request description:

  `ListWalletDir` returns all available wallets in the current wallet directory.

  Based on MeshCollider work in pull #11485.

Tree-SHA512: 5843e3dbd1e0449f55bb8ea7c241a536078ff6ffcaad88ce5fcf8963971d48c78600fbc4f44919523b8a92329d5d8a5f567a3e0ccb0270fdd27366e19603a716
@instagibbs

ghost commented May 14, 2019

Copy link
Copy Markdown
Contributor

linter:

Duplicate include(s) in src/rpc/rawtransaction.cpp:
#include <keystore.h>
#include <rpc/util.h>

@stevenroose stevenroose changed the title WIP: Catch up with Core until 0.18.0 Catch up with Core until commit f617e05c38c9c7e663b824fefe5329cc5cbbf26a May 14, 2019
@instagibbs

ghost commented May 14, 2019

Copy link
Copy Markdown
Contributor
test/functional/test_framework/liquid_addr.py:16: invalid syntax at "chk = ((chk & 0x7fffffffffffff) << 5) ^^ value # 0x1ffffff->0x7fffffffffffff"
test/functional/feature_bip68_sequence.py:33: unused attribute 'node_fastmerkle' (60% confidence)
test/functional/feature_confidential_transactions.py:45: unused attribute 'is_network_split' (60% confidence)
test/functional/feature_default_asset_name.py:29: unused attribute 'is_network_split' (60% confidence)
test/functional/feature_fedpeg.py:181: unused attribute 'node_fastmerkle' (60% confidence)
test/functional/feature_initial_reissuance_token.py:32: unused attribute 'is_network_split' (60% confidence)
test/functional/feature_issuance.py:104: unused attribute 'is_network_split' (60% confidence)
test/functional/feature_mandatory_coinbase.py:17: unused variable 'mandatory_pubkey' (60% confidence)
test/functional/feature_nulldummy.py:51: unused attribute 'node_fastmerkle' (60% confidence)
test/functional/feature_pak.py:68: unused variable 'validate' (100% confidence)
test/functional/feature_progress.py:31: unused attribute 'is_network_split' (60% confidence)
test/functional/feature_txwitness.py:217: unused attribute 'node_fastmerkle' (60% confidence)
test/functional/p2p_compactblocks.py:798: unused attribute 'node_fastmerkle' (60% confidence)
test/functional/p2p_segwit.py:224: unused attribute 'node_fastmerkle' (60% confidence)
test/functional/rpc_calcfastmerkleroot.py:13: unused attribute 'node_fastmerkle' (60% confidence)
test/functional/test_framework/messages.py:417: unused function 'setToAsset' (60% confidence)
test/functional/wallet_bumpfee.py:41: unused attribute 'node_fastmerkle' (60% confidence)
^---- failure generated from test/lint/lint-python-dead-code.sh

f.write("discover=0\n")
f.write("listenonion=0\n")
f.write("printtoconsole=0\n")
# Elements:

ghost May 14, 2019

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If we're using regtest I don't think these are required... I can do a follow-up PR if true

ghost May 14, 2019

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

none of them?

ghost May 14, 2019

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'll test later :)


assert_raises_rpc_error(-8, "bitcoin_descriptor must be a ranged descriptor.", self.nodes[i_pak1].initpegoutwallet, "pkh(tpubD6NzVbkrYhZ4WaWSyoBvQwbpLkojyoTZPRsgXELWz3Popb3qkjcJyJUGLnL4qHHoQvao8ESaAstxYSnhyswJ76uZPStJRJCTKvosUCJZL5B)")

# key origins aren't supported in 0.17

ghost May 14, 2019

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: we should add "positive" tests since they're supported now... not sure what it'll do

@instagibbs

ghost commented May 14, 2019

Copy link
Copy Markdown
Contributor

note that this PR resolves #532

@instagibbs

ghost commented May 15, 2019

Copy link
Copy Markdown
Contributor

Last clang issues:

test/mempool_tests.cpp:448:19: warning: unused variable 'tx1Hash' [-Wunused-variable]
    const uint256 tx1Hash(tx.GetHash());
                  ^
1 warning generated.

and

wallet/rpcwallet.cpp:1201:17: warning: unused function 'addwitnessaddress' [-Wunused-function]
static UniValue addwitnessaddress(const JSONRPCRequest& request)
                ^
1 warning generated.

and

wallet/wallet.cpp:2692:59: warning: reading variable 'mapWallet' requires holding mutex 'cs_wallet' [-Wthread-safety-analysis]
        std::map<uint256, CWalletTx>::const_iterator it = mapWallet.find(presetInput.hash);
                                                          ^
wallet/wallet.cpp:2693:19: warning: reading variable 'mapWallet' requires holding mutex 'cs_wallet' [-Wthread-safety-analysis]
        if (it != mapWallet.end()) {
                  ^
2 warnings generated.

@stevenroose
stevenroose force-pushed the catchup branch 2 times, most recently from faaec43 to d21e056 Compare May 15, 2019 16:25
Steven Roose and others added 4 commits May 15, 2019 17:30
Apparently my upstream checkpoint was in the middle of a series of
commits by ianofsky separating wallet from the main code.  This means
that I have to add this main lock which will be replaced by the
locked_chain interface in a subsequence catchup.
@instagibbs

ghost commented May 15, 2019

Copy link
Copy Markdown
Contributor

utACK 693f206

@stevenroose
stevenroose merged commit 693f206 into ElementsProject:master May 16, 2019
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.

move bitcoin compatibility tests back to regtest