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

0.18.1: Backports #16035

Merged
merged 36 commits into from Jul 4, 2019
Merged

0.18.1: Backports #16035

merged 36 commits into from Jul 4, 2019

Conversation

maflcko
Copy link
Member

@maflcko maflcko commented May 16, 2019

No description provided.

@maflcko maflcko added this to the 0.18.1 milestone May 16, 2019
@laanwj
Copy link
Member

laanwj commented May 16, 2019

utACK for 5935f01

But I guess it makes sense to keep this open for a while for other things that need to be backported to the 0.18 branch.

MarcoFalke added 4 commits May 16, 2019 16:15
This helps to distinguish it from CNode::fRelayTxes and avoid bugs like
425278d

Github-Pull: bitcoin#15990
Rebased-From: fa1dce7
@fanquake
Copy link
Member

Could include #14984.

harding and others added 2 commits May 17, 2019 07:35
Updates text since -whitelistforcerelay was set to false by default in
PR bitcoin#15193.

Github-Pull: bitcoin#15890
Rebased-From: e0bb279
This change marks the already-existing bitcoin-wallet.1 manpage file for
installation together with the others.  Previously, only bitcoind.1,
bitcoin-cli.1, bitcoin-tx.1 and bitcoin-qt.1 would be installed.

Github-Pull: bitcoin#15947
Rebased-From: 00d1104
@promag
Copy link
Member

promag commented May 18, 2019

@MarcoFalke I won't open a PR to backport 14984 until you say so, it should be a clean cherry pick.

@promag
Copy link
Member

promag commented Jun 6, 2019

Can you include #16122 and #16135?

@maflcko
Copy link
Member Author

maflcko commented Jun 7, 2019

Done

@fanquake
Copy link
Member

fanquake commented Jun 7, 2019

The GCC bug test backport needs to be fixed for the setup_common refactor.

test/compilerbug_tests.cpp:5:10: fatal error: test/setup_common.h: No such file or directory
 #include <test/setup_common.h>
          ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.

@maflcko
Copy link
Member Author

maflcko commented Jun 7, 2019

Ugh, thx. Fixed.

The menu must be created before connecting to aboutToShow signal.

Github-Pull: bitcoin#16231
Rebased-From: 5224be5
@practicalswift
Copy link
Contributor

practicalswift commented Jun 23, 2019

@MarcoFalke What makes #16205 important to backport?

@fanquake
Copy link
Member

@practicalswift It's mentioned at the bottom of that PR: #16205 (comment).

Looks like this accidentally fixed multiple test failures with the cross-compiled windows binaries
I am going to backport this, since it turned out to be a bugfix

@maflcko
Copy link
Member Author

maflcko commented Jun 24, 2019

Thanks for asking. Please let me know if there is a pull request missing for backport or something was backported in error.

Apart from a bunch one-line conflicts, the commits are all clean cherry-picks.

Qt docs: This attribute must be set before QGuiApplication is
constructed.

Github-Pull: bitcoin#16254
Rebased-From: 099e4b9
Copy link
Member

@fanquake fanquake left a comment

Choose a reason for hiding this comment

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

Checked 5935f01 and ensured that -fstack-reuse=none was being added to CXXFLAGS when compiling with GCC:

  CC            = gcc
  CFLAGS        = -g -O2
  CPPFLAGS      =   -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2  -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS
  CXX           = g++ -std=c++11
  CXXFLAGS      =   -fstack-reuse=none -Wstack-protector -fstack-protector-all  -Wall -Wextra -Wformat -Wvla -Wredundant-decls  -Wno-unused-parameter -Wno-implicit-fallthrough   -g -O2
  LDFLAGS       = -pthread  -Wl,-z,relro -Wl,-z,now -pie  
  ARFLAGS       = cr
...
(16035)root@69972490e9d9:/bitcoin# gcc --version
gcc (Debian 8.3.0-6) 8.3.0

Checked 3dbc7de, and that loaded wallets are shown as disabled.

loaded_wallets

Checked b55cbe8 and that the bitcoin.conf opening behaviour works as expected.

bitcoin_conf

Checked 7ed1a60 and that it’s not possible to enter and execute commands in the console during startup.

Checked d80c558 and that you cannot cause a segfault using:

src/bitcoin-cli -regtest dumpwallet ~/downloads/wallet
src/bitcoin-cli -regtest importwallet ~/downloads/wallet

Checked d1f2611. Note that this is not a clean cherry-pick. #include <test/setup_common.h> has been fixed up to be #include <test/test_bitcoin.h> for 0.18.

Also checked that the test failed if you compile without -fstack-protector=none:

Running 1 test case...
Entering test module "Bitcoin Test Suite"
test/compilerbug_tests.cpp(8): Entering test suite "compilerbug_tests"
test/compilerbug_tests.cpp(30): Entering test case "gccbug_90348"
test/compilerbug_tests.cpp(38): error: in "compilerbug_tests/gccbug_90348": check check_zero(in, i) has failed
test/compilerbug_tests.cpp(38): error: in "compilerbug_tests/gccbug_90348": check check_zero(in, i) has failed
test/compilerbug_tests.cpp(38): error: in "compilerbug_tests/gccbug_90348": check check_zero(in, i) has failed
test/compilerbug_tests.cpp(38): error: in "compilerbug_tests/gccbug_90348": check check_zero(in, i) has failed
test/compilerbug_tests.cpp(30): Leaving test case "gccbug_90348"; testing time: 19263us
test/compilerbug_tests.cpp(8): Leaving test suite "compilerbug_tests"; testing time: 19286us
Leaving test module "Bitcoin Test Suite"; testing time: 19364us
*** 4 failures are detected in the test module "Bitcoin Test Suite"
make[3]: *** [Makefile:14472: test/compilerbug_tests.cpp.test] Error 1

Note that 592016b is not a clean cherry-pick. It has the removal of the assert_greater_than include, which is not in the referenced commit (f402012).

Note that 79745d1 does not contain the src/sync.cpp change from fa8f195.

I assume d9fc969 was backported because other test changes rely on it? Regardless, why not backport the other commit (b679785) from # 15826? I’d have thought backporting the documentation would also be useful.

Checked 2800b3d and that wallets still appear in the GUI.

listed_wallets

Checked 715da91 and that the warning is removed on a Ubuntu Bionic system. Given I'm running in virtualbox, I don't think I can see the same improvements that others saw in #16254.

ubuntu

Other commits I looked over the backported code.

Currently seeing failures running the functional tests. Have commented inline.


raw = self.nodes[0].createrawtransaction([{"txid": unspent['txid'], "vout": unspent['vout']}], {self.nodes[0].getnewaddress(): 1})
tx = FromHex(CTransaction(), raw)
assert_raises_rpc_error(-22, "TX decode failed", self.nodes[0].decoderawtransaction, serialize_with_bogus_witness(tx).hex())
Copy link
Member

Choose a reason for hiding this comment

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

Traceback (most recent call last):
  File "/Users/michael/github/bitcoin/test/functional/test_framework/test_framework.py", line 175, in main
    self.run_test()
  File "/Users/michael/github/bitcoin/test/functional/p2p_segwit.py", line 278, in run_test
    self.test_superfluous_witness()
  File "/Users/michael/github/bitcoin/test/functional/p2p_segwit.py", line 2076, in test_superfluous_witness
    assert_raises_rpc_error(-22, "TX decode failed", self.nodes[0].decoderawtransaction, serialize_with_bogus_witness(tx).hex())
AttributeError: 'bytes' object has no attribute 'hex'

Copy link
Member Author

Choose a reason for hiding this comment

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

@fanquake .hex requires python3.5

Copy link
Member

Choose a reason for hiding this comment

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

@MarcoFalke isn’t the 0.18 branch minimum 3.4.9?

Copy link
Member Author

Choose a reason for hiding this comment

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

Bumped it, since 3.4 is EOL

@maflcko
Copy link
Member Author

maflcko commented Jun 26, 2019

assume d9fc969 was backported because other test changes rely on it? Regardless, why not backport the other commit (b679785) from # 15826? I’d have thought backporting the documentation would also be useful.

Indeed. Good point on the doc, added as backport.

Copy link
Member

@promag promag left a comment

Choose a reason for hiding this comment

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

Commit 79745d1 is missing:

--- a/src/sync.cpp
+++ b/src/sync.cpp
@@ -47,7 +47,9 @@ struct CLockLocation {

     std::string ToString() const
     {
-        return mutexName + "  " + sourceFile + ":" + itostr(sourceLine) + (fTry ? " (TRY)" : "");
+        return strprintf(
+            "%s %s:%s%s (in thread %s)",
+            mutexName, sourceFile, itostr(sourceLine), (fTry ? " (TRY)" : ""), m_thread_name);
     }

 private:

Is there a reason?

Edit: if the goal is to just replace fprintf then it's all good.

@promag
Copy link
Member

promag commented Jun 26, 2019

ACK bcb27d7, I've verified all commits but just built each unclean cherry pick (which are trivial).

But I guess it makes sense to keep this open for a while for other things that need to be backported to the 0.18 branch.

Edit: I think this PR is now substantial enough.

Copy link
Member

@fanquake fanquake left a comment

Choose a reason for hiding this comment

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

ACK bcb27d7

Had a quick look over af25a75, and confirmed that the functional tests are now running (using 3.5.6) after bcb27d7. Full test output is here. Note that p2p_invalid_messages.py fails quite often on macOS, so isn't an issue here.

I agree that this is turning into a lot to review and test, so would suggest we merge this soon (assuming some more reviewers) without piling to much more in.

Copy link
Member

@luke-jr luke-jr left a comment

Choose a reason for hiding this comment

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

These should be a clean merge, not cherry-picked:

Bugfix: test/functional/rpc_psbt: Remove check for specific error mes…
Bugfix: test/functional/rpc_psbt: Correct test description comment …

@maflcko
Copy link
Member Author

maflcko commented Jul 1, 2019

@luke-jr I used cherry-picks for consistency. (Most other backports are cherry-picks)

@luke-jr
Copy link
Member

luke-jr commented Jul 1, 2019

Merges should be used whenever possible. (Ideally, it would be nice if we could get to the point where most fixes are clean merges.)

@maflcko
Copy link
Member Author

maflcko commented Jul 1, 2019

I agree, but sometimes it is not clear in advance what is a fix and needs to be backported. Sounds off-topic for this pull request and could be raised in an irc meeting?

@luke-jr
Copy link
Member

luke-jr commented Jul 1, 2019

The incorrect cherry-picks are part of this PR :)

@maflcko
Copy link
Member Author

maflcko commented Jul 1, 2019

This has been the policy for years, afaic. So to change it, it would have to be discussed. Also, I am not sure how that will interfere with the release process scripts of @laanwj.

@luke-jr
Copy link
Member

luke-jr commented Jul 1, 2019

It was never a policy. For a few recent examples, #15552 and #15524 were merged into 0.18 cleanly.

@bitcoin bitcoin deleted a comment from Nomed456 Jul 1, 2019
@ajtowns
Copy link
Contributor

ajtowns commented Jul 3, 2019

ACK bcb27d7 ; compiled and ran the tests; checked the commits match the commits they claim to, and that those commits are in master. didn't check that the commits haven't been reverted in master.

@laanwj
Copy link
Member

laanwj commented Jul 3, 2019

ACK bcb27d7

Please don't merge yet as @fanquake would like to do this as his first merge to a branch 😄

This has been the policy for years, afaic. So to change it, it would have to be discussed. Also, I am not sure how that will interfere with the release process scripts of @laanwj.

It can handle either merges (only requirement is to have the correct PR # in the title of the merge commit), or the 'Github-Pull: #?(\d+)' metadata.

@maflcko maflcko assigned fanquake and unassigned laanwj Jul 3, 2019
@fanquake fanquake merged commit bcb27d7 into bitcoin:0.18 Jul 4, 2019
fanquake added a commit that referenced this pull request Jul 4, 2019
bcb27d7 .python-version: Bump to 3.5.6 (MarcoFalke)
af25a75 Add comments to Python ECDSA implementation (John Newbery)
715da91 Set AA_EnableHighDpiScaling attribute early (Hennadii Stepanov)
2800b3d gui: Fix open wallet menu initialization order (João Barbosa)
e78007f Make and get the multisig redeemscript and destination in one function instead of two (Andrew Chow)
d9fc969 Pure python EC (Pieter Wuille)
23ba460 test: Add test that addmultisigaddress fails for watchonly addresses (MarcoFalke)
13b3bb5 test: Fixup creatmultisig documentation and whitespace (MarcoFalke)
79745d1 Replace remaining fprintf with tfm::format manually (MarcoFalke)
beb09f0 scripted-diff: Replace fprintf with tfm::format (MarcoFalke)
e29aa6e Exceptions should be caught by reference, not by value. (Kristaps Kaupe)
f88959b tinyformat: Add doc to Bitcoin Core specific strprintf (MarcoFalke)
0023c97 rpc: bugfix: Properly use iswitness in converttopsbt (MarcoFalke)
832eb4f Bugfix: test/functional/rpc_psbt: Correct test description comment (Luke Dashjr)
966d8d0 Bugfix: test/functional/rpc_psbt: Remove check for specific error message that depends on uncertain assumptions (Luke Dashjr)
bb36ac8 rpc: Switch touched RPCs to IsValidNumArgs (MarcoFalke)
d24d0ec Add example 2nd arg to signrawtransactionwithkey (Chris Moore)
592016b fixup: Fix prunning test (João Barbosa)
c80a498 Fix RPC/pruneblockchain returned prune height (Jonas Schnelli)
b239824 gui: Enable open wallet menu on setWalletController (João Barbosa)
d1f2611 Add test for GCC bug 90348 (Pieter Wuille)
d80c558 gui: Set progressDialog to nullptr (João Barbosa)
7ed1a60 gui: Enable console line edit on setClientModel (João Barbosa)
b55cbe8 qt: fix opening bitcoin.conf via Preferences on macOS; see #15409 (shannon1916)
b6c1f94 Disallow extended encoding for non-witness transactions (take 3) (MarcoFalke)
8603108 Add test for superfluous witness record in deserialization (Gregory Sanders)
5a58ddb Fix missing input template by making minimal tx (Gregory Sanders)
206f5ee Disallow extended encoding for non-witness transactions (Pieter Wuille)
3dbc7de Show loaded wallets as disabled in open menu instead of nothing (MeshCollider)
a635377 Install bitcoin-wallet manpage. (Daniel Kraft)
eb85ee6 Doc: remove text about txes always relayed from -whitelist (David A. Harding)
890a92e doc: Mention blocksonly in reduce-traffic.md, unhide option (MarcoFalke)
3460555 test: Add test for p2p_blocksonly (MarcoFalke)
8f215c7 test: Format predicate source as multiline on error (MarcoFalke)
9c1a607 net: Rename ::fRelayTxes to ::g_relay_txes (MarcoFalke)
5935f01 build with -fstack-reuse=none (MarcoFalke)

Pull request description:

Tree-SHA512: 5cd73a4319cb69c92b528239cf97c0ed5fcf2b9e8c7fe154e4679eeec95db433a0223d8dc574e4cdc96c1913cfdf160b10c42dcdbcb5bbc8fb743c07930ef9da
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Dec 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet