Skip to content

Commit

Permalink
Merge branch 'bitcoin' into auxpow
Browse files Browse the repository at this point in the history
  • Loading branch information
domob1812 committed Aug 12, 2024
2 parents ee40ded + c2d15d9 commit 29035a3
Show file tree
Hide file tree
Showing 156 changed files with 2,573 additions and 735 deletions.
3 changes: 0 additions & 3 deletions build_msvc/bitcoin_config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@
*/
#define HAVE_DECL_SETSID 0

/* Define if the dllexport attribute is supported. */
#define HAVE_DLLEXPORT_ATTRIBUTE 1

/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "https://github.com/bitcoin/bitcoin/issues"

Expand Down
31 changes: 1 addition & 30 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -943,35 +943,6 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
[ AC_MSG_RESULT([no])]
)

AC_MSG_CHECKING([for default visibility attribute])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
int foo(void) __attribute__((visibility("default")));
int main(){}
])],
[
AC_DEFINE([HAVE_DEFAULT_VISIBILITY_ATTRIBUTE], [1], [Define if the visibility attribute is supported.])
AC_MSG_RESULT([yes])
],
[
AC_MSG_RESULT([no])
if test "$use_reduce_exports" = "yes"; then
AC_MSG_ERROR([Cannot find a working visibility attribute. Use --disable-reduce-exports.])
fi
]
)

AC_MSG_CHECKING([for dllexport attribute])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
__declspec(dllexport) int foo(void);
int main(){}
])],
[
AC_DEFINE([HAVE_DLLEXPORT_ATTRIBUTE], [1], [Define if the dllexport attribute is supported.])
AC_MSG_RESULT([yes])
],
[AC_MSG_RESULT([no])]
)

dnl Check for different ways of gathering OS randomness
AC_MSG_CHECKING([for Linux getrandom function])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
Expand Down Expand Up @@ -1722,7 +1693,7 @@ CPPFLAGS="$CPPFLAGS_TEMP"
if test -n "$use_sanitizers"; then
export SECP_CFLAGS="$SECP_CFLAGS $SANITIZER_CFLAGS"
fi
ac_configure_args="${ac_configure_args} --disable-shared --with-pic --with-ecmult-gen-kb=86 --enable-benchmark=no --enable-module-recovery --disable-module-ecdh"
ac_configure_args="${ac_configure_args} --disable-shared --with-pic --enable-benchmark=no --enable-module-recovery --disable-module-ecdh"
AC_CONFIG_SUBDIRS([src/secp256k1])

AC_OUTPUT
Expand Down
2 changes: 1 addition & 1 deletion contrib/completions/bash/bitcoin-cli.bash
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ _bitcoin_rpc() {
local rpcargs=()
for i in ${COMP_LINE}; do
case "$i" in
-conf=*|-datadir=*|-regtest|-rpc*|-testnet)
-conf=*|-datadir=*|-regtest|-rpc*|-testnet|-testnet4)
rpcargs=( "${rpcargs[@]}" "$i" )
;;
esac
Expand Down
1 change: 0 additions & 1 deletion contrib/devtools/copyright_header.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
'src/qt/bitcoinstrings.cpp',
'src/chainparamsseeds.h',
# other external copyrights:
'src/reverse_iterator.h',
'src/test/fuzz/FuzzedDataProvider.h',
'src/tinyformat.h',
'src/bench/nanobench.h',
Expand Down
2 changes: 1 addition & 1 deletion contrib/devtools/test_utxo_snapshots.sh
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ echo
echo "-- Now: add the following to CMainParams::m_assumeutxo_data"
echo " in src/kernel/chainparams.cpp, and recompile:"
echo
echo " {${RPC_BASE_HEIGHT}, AssumeutxoHash{uint256S(\"0x${RPC_AU}\")}, ${RPC_NCHAINTX}, uint256S(\"0x${RPC_BLOCKHASH}\")},"
echo " {.height = ${RPC_BASE_HEIGHT}, .hash_serialized = AssumeutxoHash{uint256{\"${RPC_AU}\"}}, .m_chain_tx_count = ${RPC_NCHAINTX}, .blockhash = consteval_ctor(uint256{\"${RPC_BLOCKHASH}\"})},"
echo
echo
echo "-- IBDing more blocks to the server node (height=$FINAL_HEIGHT) so there is a diff between snapshot and tip..."
Expand Down
2 changes: 1 addition & 1 deletion contrib/guix/libexec/prelude.bash
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ fi
time-machine() {
# shellcheck disable=SC2086
guix time-machine --url=https://git.savannah.gnu.org/git/guix.git \
--commit=efc26826400762207cde9f23802cfe75a737963c \
--commit=7bf1d7aeaffba15c4f680f93ae88fbef25427252 \
--cores="$JOBS" \
--keep-failed \
--fallback \
Expand Down
6 changes: 5 additions & 1 deletion contrib/seeds/generate-seeds.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
'''
Script to generate list of seed nodes for kernel/chainparams.cpp.
This script expects two text files in the directory that is passed as an
This script expects three text files in the directory that is passed as an
argument:
nodes_main.txt
nodes_test.txt
nodes_testnet4.txt
These files must consist of lines in the format
Expand Down Expand Up @@ -171,6 +172,9 @@ def main():
g.write('\n')
with open(os.path.join(indir,'nodes_test.txt'), 'r', encoding="utf8") as f:
process_nodes(g, f, 'chainparams_seed_test')
g.write('\n')
with open(os.path.join(indir,'nodes_testnet4.txt'), 'r', encoding="utf8") as f:
process_nodes(g, f, 'chainparams_seed_testnet4')
g.write('#endif // BITCOIN_CHAINPARAMSSEEDS_H\n')

if __name__ == '__main__':
Expand Down
2 changes: 2 additions & 0 deletions depends/packages/zeromq.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ $(package)_patches += builtin_sha1.patch
$(package)_patches += fix_have_windows.patch
$(package)_patches += openbsd_kqueue_headers.patch
$(package)_patches += cmake_minimum.patch
$(package)_patches += cacheline_undefined.patch
$(package)_patches += no_librt.patch

define $(package)_set_vars
Expand All @@ -25,6 +26,7 @@ define $(package)_preprocess_cmds
patch -p1 < $($(package)_patch_dir)/remove_libstd_link.patch && \
patch -p1 < $($(package)_patch_dir)/macos_mktemp_check.patch && \
patch -p1 < $($(package)_patch_dir)/builtin_sha1.patch && \
patch -p1 < $($(package)_patch_dir)/cacheline_undefined.patch && \
patch -p1 < $($(package)_patch_dir)/fix_have_windows.patch && \
patch -p1 < $($(package)_patch_dir)/openbsd_kqueue_headers.patch && \
patch -p1 < $($(package)_patch_dir)/cmake_minimum.patch && \
Expand Down
15 changes: 15 additions & 0 deletions depends/patches/zeromq/cacheline_undefined.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Use proper STREQUAL instead of EQUAL to compare strings.txt

See: https://github.com/zeromq/libzmq/pull/4711.

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -476,7 +476,7 @@ execute_process(
if(CACHELINE_SIZE STREQUAL ""
OR CACHELINE_SIZE EQUAL 0
OR CACHELINE_SIZE EQUAL -1
- OR CACHELINE_SIZE EQUAL "undefined")
+ OR CACHELINE_SIZE STREQUAL "undefined")
set(ZMQ_CACHELINE_SIZE 64)
else()
set(ZMQ_CACHELINE_SIZE ${CACHELINE_SIZE})
2 changes: 1 addition & 1 deletion doc/REST-interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Unauthenticated REST Interface
The REST API can be enabled with the `-rest` option.

The interface runs on the same port as the JSON-RPC interface, by default port 8332 for mainnet, port 18332 for testnet,
port 38332 for signet, and port 18443 for regtest.
port 48332 for testnet4, port 38332 for signet, and port 18443 for regtest.

REST Interface consistency guarantees
-------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion doc/bips.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ BIPs that are implemented by Bitcoin Core:
* [`BIP 111`](https://github.com/bitcoin/bips/blob/master/bip-0111.mediawiki): `NODE_BLOOM` service bit added, and enforced for all peer versions as of **v0.13.0** ([PR #6579](https://github.com/bitcoin/bitcoin/pull/6579) and [PR #6641](https://github.com/bitcoin/bitcoin/pull/6641)).
* [`BIP 112`](https://github.com/bitcoin/bips/blob/master/bip-0112.mediawiki): The CHECKSEQUENCEVERIFY opcode has been implemented since **v0.12.1** ([PR #7524](https://github.com/bitcoin/bitcoin/pull/7524)), and has been *buried* since **v0.19.0** ([PR #16060](https://github.com/bitcoin/bitcoin/pull/16060)).
* [`BIP 113`](https://github.com/bitcoin/bips/blob/master/bip-0113.mediawiki): Median time past lock-time calculations have been implemented since **v0.12.1** ([PR #6566](https://github.com/bitcoin/bitcoin/pull/6566)), and has been *buried* since **v0.19.0** ([PR #16060](https://github.com/bitcoin/bitcoin/pull/16060)).
* [`BIP 125`](https://github.com/bitcoin/bips/blob/master/bip-0125.mediawiki): Opt-in full replace-by-fee signaling partially implemented. See doc/policy/mempool-replacements.md.
* [`BIP 125`](https://github.com/bitcoin/bips/blob/master/bip-0125.mediawiki): Opt-in full replace-by-fee partially implemented: signaling is enforced if configured. For other replacement rules, see doc/policy/mempool-replacements.md.
* [`BIP 130`](https://github.com/bitcoin/bips/blob/master/bip-0130.mediawiki): direct headers announcement is negotiated with peer versions `>=70012` as of **v0.12.0** ([PR 6494](https://github.com/bitcoin/bitcoin/pull/6494)).
* [`BIP 133`](https://github.com/bitcoin/bips/blob/master/bip-0133.mediawiki): feefilter messages are respected and sent for peer versions `>=70013` as of **v0.13.0** ([PR 7542](https://github.com/bitcoin/bitcoin/pull/7542)).
* [`BIP 141`](https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki): Segregated Witness (Consensus Layer) as of **v0.13.0** ([PR 8149](https://github.com/bitcoin/bitcoin/pull/8149)), defined for mainnet as of **v0.13.1** ([PR 8937](https://github.com/bitcoin/bitcoin/pull/8937)), and *buried* since **v0.19.0** ([PR #16060](https://github.com/bitcoin/bitcoin/pull/16060)).
Expand Down
2 changes: 1 addition & 1 deletion doc/build-windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ First, install the general dependencies:

sudo apt update
sudo apt upgrade
sudo apt install build-essential libtool autotools-dev automake pkg-config bsdmainutils curl git
sudo apt install build-essential libtool autotools-dev automake pkg-config bsdmainutils cmake curl git

A host toolchain (`build-essential`) is necessary because some dependency
packages need to build host utilities that are used in the build process.
Expand Down
16 changes: 9 additions & 7 deletions doc/files.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,23 @@ Windows | `%LOCALAPPDATA%\Bitcoin\` <sup>[\[1\]](#note1)</sup>

3. All content of the data directory, except for `bitcoin.conf` file, is chain-specific. This means the actual data directory paths for non-mainnet cases differ:

Chain option | Data directory path
-------------------------------|------------------------------
`-chain=main` (default) | *path_to_datadir*`/`
`-chain=test` or `-testnet` | *path_to_datadir*`/testnet3/`
`-chain=signet` or `-signet` | *path_to_datadir*`/signet/`
`-chain=regtest` or `-regtest` | *path_to_datadir*`/regtest/`
Chain option | Data directory path
---------------------------------|------------------------------
`-chain=main` (default) | *path_to_datadir*`/`
`-chain=test` or `-testnet` | *path_to_datadir*`/testnet3/`
`-chain=testnet4` or `-testnet4` | *path_to_datadir*`/testnet4/`
`-chain=signet` or `-signet` | *path_to_datadir*`/signet/`
`-chain=regtest` or `-regtest` | *path_to_datadir*`/regtest/`

## Data directory layout

Subdirectory | File(s) | Description
-------------------|-----------------------|------------
`blocks/` | | Blocks directory; can be specified by `-blocksdir` option (except for `blocks/index/`)
`blocks/index/` | LevelDB database | Block index; `-blocksdir` option does not affect this path
`blocks/` | `blkNNNNN.dat`<sup>[\[2\]](#note2)</sup> | Actual Bitcoin blocks (in network format, dumped in raw on disk, 128 MiB per file)
`blocks/` | `blkNNNNN.dat`<sup>[\[2\]](#note2)</sup> | Actual Bitcoin blocks (dumped in network format, 128 MiB per file)
`blocks/` | `revNNNNN.dat`<sup>[\[2\]](#note2)</sup> | Block undo data (custom format)
`blocks/` | `xor.dat` | Rolling XOR pattern for block and undo data files
`chainstate/` | LevelDB database | Blockchain state (a compact representation of all currently unspent transaction outputs (UTXOs) and metadata about the transactions they are from)
`indexes/txindex/` | LevelDB database | Transaction index; *optional*, used if `-txindex=1`
`indexes/blockfilter/basic/db/` | LevelDB database | Blockfilter index LevelDB database for the basic filtertype; *optional*, used if `-blockfilterindex=basic`
Expand Down
6 changes: 3 additions & 3 deletions doc/policy/mempool-replacements.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,12 @@ A transaction ("replacement transaction") may replace its directly conflicting t
their in-mempool descendants (together, "original transactions") if, in addition to passing all
other consensus and policy rules, each of the following conditions are met:

1. The directly conflicting transactions all signal replaceability explicitly. A transaction is
1. If `-mempoolfullrbf=0` (the value is 1 by default), the directly conflicting transactions all signal replaceability explicitly. A transaction is
signaling BIP125 replaceability if any of its inputs have an nSequence number less than (0xffffffff - 1).
A transaction also signals replaceability if its version field is set to 3.

*Rationale*: See [BIP125
explanation](https://github.com/bitcoin/bips/blob/master/bip-0125.mediawiki#motivation).
Use the (`-mempoolfullrbf`) configuration option to allow transaction replacement without enforcement of the
opt-in signaling rule.

2. The replacement transaction only include an unconfirmed input if that input was included in
one of the directly conflicting transactions. An unconfirmed input spends an output from a
Expand Down Expand Up @@ -80,3 +78,5 @@ This set of rules is similar but distinct from BIP125.

* Full replace-by-fee enabled as a configurable mempool policy as of **v24.0** ([PR
#25353](https://github.com/bitcoin/bitcoin/pull/25353)).

* Full replace-by-fee is the default policy as of **v28.0** ([PR #30493](https://github.com/bitcoin/bitcoin/pull/30493)).
2 changes: 1 addition & 1 deletion doc/policy/packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ The following rules are enforced for all packages:

* Only limited package replacements are currently considered. (#28984)

- All direct conflicts must signal replacement (or the node must have `-mempoolfullrbf=1` set).
- If `-mempoolfullrbf=0` (the value is 1 by default), all direct conflicts must signal replacement.

- Packages are 1-parent-1-child, with no in-mempool ancestors of the package.

Expand Down
21 changes: 21 additions & 0 deletions doc/release-notes-22729.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Notable changes
===============

P2P and network changes
-----------------------

- Previously if Bitcoin Core was listening for P2P connections, either using
default settings or via `bind=addr:port` it would always also bind to
`127.0.0.1:8334` to listen for Tor connections. It was not possible to switch
this off, even if the node didn't use Tor. This has been changed and now
`bind=addr:port` results in binding on `addr:port` only. The default behavior
of binding to `0.0.0.0:8333` and `127.0.0.1:8334` has not been changed.

If you are using a `bind=...` configuration without `bind=...=onion` and rely
on the previous implied behavior to accept incoming Tor connections at
`127.0.0.1:8334`, you need to now make this explicit by using
`bind=... bind=127.0.0.1:8334=onion`. (#22729)

- Bitcoin Core will now fail to start up if any of its P2P binds fail, rather
than the previous behaviour where it would only abort startup if all P2P
binds had failed. (#22729)
6 changes: 6 additions & 0 deletions doc/release-notes-28052.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Blockstorage
============

Block files are now XOR'd by default with a key stored in the blocksdir.
Previous releases of Bitcoin Core or previous external software will not be able to read the blocksdir with a non-zero XOR-key.
Refer to the `-blocksxor` help for more details.
10 changes: 10 additions & 0 deletions doc/release-notes-29775.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Testnet4/BIP94 support
-----

Support for Testnet4 as specified in [BIP94](https://github.com/bitcoin/bips/blob/master/bip-0094.mediawiki)
has been added. The network can be selected with the `-testnet4` option and
the section header is also named `[testnet4]`.

While the intention is to phase out support for Testnet3 in an upcoming
version, support for it is still available via the known options in this
release.
8 changes: 8 additions & 0 deletions doc/release-notes-30212.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
RPC
---

- Previously when using the `sendrawtransaction` rpc and specifying outputs
that are already in the UXTO set an RPC error code `-27` with RPC error
text "Transaction already in block chain" was returned in response.
The help text has been updated to "Transaction outputs already in utxo set"
to more accurately describe the source of the issue.
7 changes: 7 additions & 0 deletions doc/release-notes-30275.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
RPC
---

- The default mode for the `estimatesmartfee` RPC has been updated from `conservative` to `economical`.
which is expected to reduce overestimation for many users, particularly if Replace-by-Fee is an option.
For users that require high confidence in their fee estimates at the cost of potentially overestimating,
the `conservative` mode remains available.
4 changes: 4 additions & 0 deletions doc/release-notes-30493.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Full Replace-By-Fee
===================

`mempoolfullrbf=1` is now set by default.
4 changes: 3 additions & 1 deletion doc/release-process.md
Original file line number Diff line number Diff line change
Expand Up @@ -311,13 +311,15 @@ Both variables are used as a guideline for how much space the user needs on thei
Note that all values should be taken from a **fully synced** node and have an overhead of 5-10% added on top of its base value.

To calculate `m_assumed_blockchain_size`, take the size in GiB of these directories:
- For `mainnet` -> the data directory, excluding the `/testnet3`, `/signet`, and `/regtest` directories and any overly large files, e.g. a huge `debug.log`
- For `mainnet` -> the data directory, excluding the `/testnet3`, `/testnet4`, `/signet`, and `/regtest` directories and any overly large files, e.g. a huge `debug.log`
- For `testnet` -> `/testnet3`
- For `testnet4` -> `/testnet4`
- For `signet` -> `/signet`

To calculate `m_assumed_chain_state_size`, take the size in GiB of these directories:
- For `mainnet` -> `/chainstate`
- For `testnet` -> `/testnet3/chainstate`
- For `testnet4` -> `/testnet4/chainstate`
- For `signet` -> `/signet/chainstate`

Notes:
Expand Down
2 changes: 1 addition & 1 deletion doc/tor.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ In a typical situation, where you're only reachable via Tor, this should suffice
listen on all devices and another node could establish a clearnet connection, when knowing
your address. To mitigate this, additionally bind the address of your Tor proxy:

./bitcoind ... -bind=127.0.0.1
./bitcoind ... -bind=127.0.0.1:8334=onion

If you don't care too much about hiding your node, and want to be reachable on IPv4
as well, use `discover` instead:
Expand Down
1 change: 0 additions & 1 deletion src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,6 @@ BITCOIN_CORE_H = \
random.h \
randomenv.h \
rest.h \
reverse_iterator.h \
rpc/auxpow_miner.h \
rpc/blockchain.h \
rpc/client.h \
Expand Down
1 change: 1 addition & 0 deletions src/Makefile.test.include
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ BITCOIN_TESTS =\
test/checkqueue_tests.cpp \
test/cluster_linearize_tests.cpp \
test/coins_tests.cpp \
test/coinscachepair_tests.cpp \
test/coinstatsindex_tests.cpp \
test/common_url_tests.cpp \
test/compilerbug_tests.cpp \
Expand Down
3 changes: 0 additions & 3 deletions src/bech32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ namespace

typedef std::vector<uint8_t> data;

/** The Bech32 and Bech32m checksum size */
constexpr size_t CHECKSUM_SIZE = 6;

/** The Bech32 and Bech32m character set for encoding. */
const char* CHARSET = "qpzry9x8gf2tvdw0s3jn54khce6mua7l";

Expand Down
3 changes: 3 additions & 0 deletions src/bech32.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
namespace bech32
{

/** The Bech32 and Bech32m checksum size */
constexpr size_t CHECKSUM_SIZE = 6;

enum class Encoding {
INVALID, //!< Failed decoding

Expand Down
Loading

0 comments on commit 29035a3

Please sign in to comment.