Commit graph

590 commits

Author SHA1 Message Date
Andrew Poelstra
0657bbeffa Merge 68da54987d into merged_master (Bitcoin PR #16471) 2020-11-09 21:20:09 +00:00
Andrew Poelstra
31aa2513fb Merge d5a54ce8f0 into merged_master (Bitcoin PR #15305) 2020-11-09 21:20:08 +00:00
Andrew Poelstra
83019c2acd Merge d960d5ca99 into merged_master (Bitcoin PR #16362) 2020-11-09 21:20:08 +00:00
Andrew Poelstra
04f0e67e67 Merge 51a6e2c419 into merged_master (Bitcoin PR #15681) 2020-11-09 21:20:07 +00:00
Andrew Poelstra
1e58aac3d1 Merge 8f604361eb into merged_master (Bitcoin PR #16194) 2020-11-09 21:20:06 +00:00
Andrew Poelstra
f7cb3a9645 Merge f373beebbc into merged_master (Bitcoin PR #16344) 2020-11-09 03:58:19 +00:00
Andrew Poelstra
62a63e4c6b Merge 8c69fae944 into merged_master (Bitcoin PR #15457) 2020-11-09 03:58:19 +00:00
Andrew Poelstra
19568c3891 Merge c6e42f1ca9 into merged_master (Bitcoin PR #14193) 2020-11-09 03:58:18 +00:00
Andrew Poelstra
695bf1c24d Merge 332c6134bb into merged_master (Bitcoin PR #15894) 2020-11-09 03:58:16 +00:00
Andrew Poelstra
f60ef72524 Merge 0b68fca700 into merged_master (Bitcoin PR #16092) 2020-11-06 15:20:15 +00:00
Andrew Poelstra
83f93df4d0 Merge e2182b02b5 into merged_master (Bitcoin PR #16171) 2020-11-06 15:20:15 +00:00
Andrew Poelstra
2c4ed107ff Merge c977f2b99d into merged_master (Elements PR #664) 2020-11-06 15:20:14 +00:00
Andrew Poelstra
68d9951825 Merge d0f81a96d9 into merged_master (Bitcoin PR #16129) 2020-11-06 15:20:13 +00:00
Andrew Poelstra
cb15f46946 Merge 5d37c1bde0 into merged_master (Bitcoin PR #15976) 2020-11-06 15:20:12 +00:00
Andrew Poelstra
a835ebdb2f Merge 1c177c3a00 into merged_master (Bitcoin PR #16015) 2020-10-29 20:55:17 +00:00
Andrew Poelstra
96169f79e3 Merge 7110d455eb into merged_master (Bitcoin PR #12980) 2020-10-29 19:54:46 +00:00
Andrew Poelstra
e6adc4efa2 Merge a822a0e4f6 into merged_master (Bitcoin PR #15999) 2020-10-29 19:17:12 +00:00
Andrew Poelstra
f6f2aefae3 Merge 40c66bb3d1 into merged_master (Bitcoin PR #15855) 2020-10-29 16:50:16 +00:00
Andrew Poelstra
5bf56b8829 Merge 49c1aa5f83 into merged_master (Bitcoin PR #15971) 2020-10-29 04:29:12 +00:00
Andrew Poelstra
c91184f6c2 Merge b2a6b02161 into merged_master (Bitcoin PR #15948) 2020-10-29 02:36:55 +00:00
Andrew Poelstra
2d57dcb681 Merge d7d7d31506 into merged_master (Bitcoin PR #15141) 2020-10-29 02:10:39 +00:00
Andrew Poelstra
cf22dd0930 Merge 12aa2ac988 into merged_master (Bitcoin PR #15323) 2020-10-29 02:07:08 +00:00
Andrew Poelstra
44e5901b98 Merge 2c35fe6238 into merged_master (Bitcoin PR #15849) 2020-10-29 02:06:12 +00:00
Andrew Poelstra
ad0dc00fc2 Merge 3356799ee3 into merged_master (Bitcoin PR #15778) 2020-10-28 23:22:29 +00:00
Andrew Poelstra
e490be0579 Merge d76b72a454 into merged_master (Bitcoin PR #15267) 2020-10-28 22:35:27 +00:00
Andrew Poelstra
e316ed34be Merge ae2c19f578 into merged_master (Bitcoin PR #15655) 2020-10-28 20:52:58 +00:00
Andrew Poelstra
a8581ea138 Merge 6a135fbe5b into merged_master (Bitcoin PR #15638) 2020-10-28 03:16:57 +00:00
Andrew Poelstra
45dad5302b Merge 93623eea71 into merged_master (Bitcoin PR #15623) 2020-10-28 00:09:42 +00:00
Andrew Poelstra
0a64319362 Merge e45b7f20e6 into merged_master (Bitcoin PR #15618) 2020-10-28 00:09:11 +00:00
Andrew Poelstra
7d93f137a0 Merge c033c4b5ce into merged_master (Bitcoin PR #13541) 2020-10-28 00:09:04 +00:00
Andrew Poelstra
1e375568af Merge 2d46f1be0c into merged_master (Bitcoin PR #15118) 2020-10-27 21:52:10 +00:00
Andrew Poelstra
2b24674400 Merge d88f7f8764 into merged_master (Bitcoin PR #15471) 2020-10-27 19:13:32 +00:00
John Newbery
42a5e912ee [mempool] log correct messages when CPFP fails 2019-07-26 16:21:26 -04:00
fanquake
d5a54ce8f0
Merge #15305: [validation] Crash if disconnecting a block fails
a47df13471 [qa] Test disconnect block failure -> shutdown (Suhas Daftuar)
4433ed0f73 [validation] Crash if disconnecting a block fails (Suhas Daftuar)

Pull request description:

  If we're unable to disconnect a block during normal operation, then that is a
  failure of our local system (such as disk failure) or the chain that we are on
  (eg CVE-2018-17144), but cannot be due to failure of the (more work) chain that
  we're trying to validate.

  We should abort rather than stay on a less work chain.

  Fixes #14341.

ACKs for top commit:
  practicalswift:
    utACK a47df13471
  TheBlueMatt:
    utACK a47df13471. Didn't bother to review the test in detail, it looked fine. Debated whether invalidateblock should ever crash the node, but *not* crashing in the case of hitting a pruned block (which is the only change here) is clearly better, even if there are other cases I'd argue we should crash in.
  ryanofsky:
    utACK a47df13471. Only change since last review is new comment.
  promag:
    ACK a47df1347, it takes awhile to quit (RPC connection timeouts) but that's unrelated - hope to fix that soon.
  fanquake:
    ACK a47df13471

Tree-SHA512: 4dec8cef6e7dbbe513c138fc5821a7ceab855e603ece3c16185b51a3830ab7ebbc844a28827bf64e75326f45325991dcb672f13bd7baede53304f27289c4af8d
2019-07-25 09:05:22 +08:00
Hennadii Stepanov
753f7cccce
scripted-diff: Make translation bilingual
-BEGIN VERIFY SCRIPT-
sed -i 's/inline std::string _(const char\* psz)/inline bilingual_str _(const char\* psz)/' src/util/translation.h
sed -i 's/return G_TRANSLATION_FUN ? (G_TRANSLATION_FUN)(psz) : psz;/return bilingual_str{psz, G_TRANSLATION_FUN ? (G_TRANSLATION_FUN)(psz) : psz};/' src/util/translation.h
sed -i 's/\b_("\([^"]\|\\"\)*")/&.translated/g' $(git grep --files-with-matches '\b_("' src)
echo Hard cases - multiline strings.
sed -i 's/"Visit %s for further information about the software.")/&.translated/g' src/init.cpp
sed -i "s/\"Only rebuild the block database if you are sure that your computer's date and time are correct\")/&.translated/g" src/init.cpp
sed -i 's/" restore from a backup.")/&.translated/g' src/wallet/db.cpp
sed -i 's/" or address book entries might be missing or incorrect.")/&.translated/g' src/wallet/wallet.cpp
echo Special case.
sed -i 's/_(COPYRIGHT_HOLDERS)/&.translated/' src/util/system.cpp test/lint/lint-format-strings.py
-END VERIFY SCRIPT-
2019-07-24 16:33:20 +03:00
Hennadii Stepanov
0b86e517ad
Refactor out translation.h
This is a prerequisite for introducing bilingual error messages.
Note: #includes are arranged by clang-format-diff.py script.
2019-07-24 16:32:53 +03:00
Wladimir J. van der Laan
51a6e2c419
Merge #15681: [mempool] Allow one extra single-ancestor transaction per package
50cede3f5a [mempool] Allow one extra single-ancestor transaction per package (Matt Corallo)

Pull request description:

  This implements the proposed policy change from [1], which allows
  certain classes of contract protocols involving revocation
  punishments to use CPFP. Note that some such use-cases may still
  want some form of one-deep package relay, though even this alone
  may greatly simplify some lightning fee negotiation.

  [1] https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2018-November/016518.html

ACKs for top commit:
  ajtowns:
    ACK 50cede3f5a -- looked over code again, compared with previous commit, compiles, etc.
  sdaftuar:
    ACK 50cede3f5a
  ryanofsky:
    utACK 50cede3f5a. Changes since last review: adding EXTRA_DESCENDANT_TX_SIZE_LIMIT constant, changing max ancestor size from 1,000,000 to nLimitAncestorSize constant (101,000), fixing test comment and getting rid of unused test node.

Tree-SHA512: b052c2a0f384855572b4579310131897b612201214b5abbb225167224e4f550049e300b471dbf320928652571e92ca2d650050b7cf39ac92b3bc1d2bcd386c1c
2019-07-19 20:00:12 +02:00
Matt Corallo
50cede3f5a [mempool] Allow one extra single-ancestor transaction per package
This implements the proposed policy change from [1], which allows
certain classes of contract protocols involving revocation
punishments to use CPFP. Note that some such use-cases may still
want some form of one-deep package relay, though even this alone
may greatly simplify some lightning fee negotiation.

[1] https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2018-November/016518.html
2019-07-09 15:46:25 -04:00
James O'Beirne
682a1d0f20 refactoring: remove mapBlockIndex global
in lieu of ::BlockIndex().
2019-07-08 11:33:13 -04:00
James O'Beirne
55d525ab90 refactoring: make pindexBestInvalid internal to validation.cpp
There's no need to have this member live on CChainState since it's only used
in validation.cpp.
2019-07-08 11:33:13 -04:00
James O'Beirne
4ed55dfcd7 refactoring: add block_index_candidates arg to LoadBlockIndex
Prevents BlockManager from having to reference ChainstateActive()
within one of its methods which improves encapsulation and makes
testing easier.
2019-07-08 11:33:12 -04:00
James O'Beirne
613c46fe9e refactoring: move block metadata structures into BlockManager
Separate out the management of chain-agnostic block metadata from any given
CChainState instance. This allows us to avoid duplicating data like
`mapBlockIndex` unnecessarily for multiple chainstates.

This also adds a CChainState constructor that accepts and sets m_blockman.
Ultimately this reference will point to a BlockMan instance that
is shared across CChainStates.

This commit can be decomposed into smaller commits if necessary.
2019-07-08 11:33:12 -04:00
Sjors Provoost
976b034b13
[build]: use #if HAVE_SYSTEM instead of defined(HAVE_SYSTEM) 2019-07-05 18:32:05 +02:00
Wladimir J. van der Laan
8c69fae944
Merge #15457: Check std::system for -[alert|block|wallet]notify
f874e14cd3 [build]: check std::system for -[alert|block|wallet]notify (Sjors Provoost)
cc3ad56ff2 [build] MSVC: set HAVE_SYSTEM for desktop apps (Sjors Provoost)
c1c91bb78d [build] detect std::system or ::wsystem (Sjors Provoost)

Pull request description:

  Platforms such as iOs and Universal Windows Platform do not support launching a process through system().

ACKs for top commit:
  laanwj:
    code review ACK f874e14cd3

Tree-SHA512: 16bb4a8fa1896046ccb22a46c8985e1aa45f5b11ecf5539eb2299e9a58f1a5b085c0c12cb6939c7493d93abce7e84fadcbfc73374c887db63da6d00c08aa476d
2019-07-05 17:33:33 +02:00
Wladimir J. van der Laan
c6e42f1ca9
Merge #14193: validation: Add missing mempool locks
fa2b083c3f [test] Add test to check mempool consistency in case of reorgs (MarcoFalke)
fabeb1f613 validation: Add missing mempool locks (MarcoFalke)
fa0c9dbf91 txpool: Make nTransactionsUpdated atomic (MarcoFalke)

Pull request description:

  Take the mempool read lock during reorgs, so that we don't accidentally read an inconsistent mempool.

ACKs for top commit:
  laanwj:
    code review ACK fa2b083c3f
  ryanofsky:
    utACK fa2b083c3f [EDIT: was ~e284e422e75189794e24fe482819d8b1407857c3~, from bad copy and paste]. Changes since last review: rebase after #15976, adding vTxHashes lock annotation, adding new commit dropping mempool lock for nTransactionsUpdated and making it atomic to avoid deadlock between mempool lock and g_best_block_mutex

Tree-SHA512: cfe7777993589087753e000e3736d79d320dca412383fb77b56bef8946a04049722bf888c11b6f722adf677165185c7e58b4a269f7c5fa25e84dda375f6c8a7d
2019-07-02 16:29:08 +02:00
Hennadii Stepanov
f724f31401
Make AbortNode() aware of MSG_NOPREFIX flag 2019-06-19 19:22:34 +03:00
MarcoFalke
0b68fca700
Merge #16092: Don't use global (external) symbols for symbols that are used in only one translation unit
0959d37e3e Don't use global (external) symbols for symbols that are used in only one translation unit (practicalswift)

Pull request description:

  Don't use global (external) symbols for symbols that are used in only one translation unit.

  Before:

  ```
  $ for SYMBOL in $(nm src/bitcoind | grep -E ' [BD] ' | c++filt | cut -f3- -d' ' | grep -v @ | grep -v : | sort | grep '[a-z]' | sort -u | grep -vE '(^_|typeinfo|vtable)'); do
        REFERENCES=$(git grep -lE "([^a-zA-Z]|^)${SYMBOL}([^a-zA-Z]|\$)" -- "*.cpp" "*.h")
        N_REFERENCES=$(wc -l <<< "${REFERENCES}")
        if [[ ${N_REFERENCES} > 1 ]]; then
            continue
        fi
        echo "Global symbol ${SYMBOL} is used in only one translation unit: ${REFERENCES}"
    done
  Global symbol g_chainstate is used in only one translation unit: src/validation.cpp
  Global symbol g_ui_signals is used in only one translation unit: src/ui_interface.cpp
  Global symbol instance_of_cmaincleanup is used in only one translation unit: src/validation.cpp
  Global symbol instance_of_cnetcleanup is used in only one translation unit: src/net.cpp
  Global symbol instance_of_cnetprocessingcleanup is used in only one translation unit: src/net_processing.cpp
  Global symbol pindexBestForkBase is used in only one translation unit: src/validation.cpp
  Global symbol pindexBestForkTip is used in only one translation unit: src/validation.cpp
  $
  ```

  After:

  ```
  $ for SYMBOL in $(nm src/bitcoind | grep -E ' [BD] ' | c++filt | cut -f3- -d' ' | grep -v @ | grep -v : | sort | grep '[a-z]' | sort -u | grep -vE '(^_|typeinfo|vtable)'); do
        REFERENCES=$(git grep -lE "([^a-zA-Z]|^)${SYMBOL}([^a-zA-Z]|\$)" -- "*.cpp" "*.h")
        N_REFERENCES=$(wc -l <<< "${REFERENCES}")
        if [[ ${N_REFERENCES} > 1 ]]; then
            continue
        fi
        echo "Global symbol ${SYMBOL} is used in only one translation unit: ${REFERENCES}"
    done
  $
  ```

  ♻️ Think about future generations: save the global namespace from unnecessary pollution!  ♻️

ACKs for commit 0959d3:
  Empact:
    ACK https://github.com/bitcoin/bitcoin/pull/16092/commits/0959d37e3e0f80010a78d175e3846dabf5d35919
  MarcoFalke:
    ACK 0959d37e3e
  hebasto:
    ACK 0959d37e3e
  promag:
    ACK 0959d37.

Tree-SHA512: 722f66bb50450f19b57e8a8fbe949f30cd651eb8564e5787cbb772a539bf3a288c048dc49e655fd73ece6a46f6dafade515ec4004729bf2b3ab83117b7c5d153
2019-06-18 15:59:53 -04:00
Gregory Sanders
8838e76753 Do non-depth check for peg-in witness where possible 2019-06-13 10:56:54 -04:00
Matt Corallo
8053e5cdad Remove -mempoolreplacement to prevent needless block prop slowness.
At this point there is no reasonable excuse to disable opt-in RBF,
and, unlike when this option was added, there are now significant
issues created when disabling it (in the form of compact block
reconstruction failures). Further, it breaks a lot of modern wallet
behavior.
2019-06-08 09:32:33 -04:00
MarcoFalke
fabeb1f613
validation: Add missing mempool locks 2019-06-07 11:07:09 +02:00