Merge #5888: backport: trivial 2024 02 14

99402584d7 Merge bitcoin/bitcoin#25332: build: test for timingsafe_bcmp (laanwj)
ca4b0fe4d6 Merge bitcoin/bitcoin#25320: util: modify Win32LockedPageAllocator to query windows for limit. (laanwj)
edaf9cc646 Merge bitcoin/bitcoin#25359: doc: add distcc to productivity notes (laanwj)
c1fa5a0f15 Merge bitcoin/bitcoin#25312: test: Fix port collisions caused by p2p_getaddr_caching.py (MacroFake)
aaa83ae043 Merge bitcoin/bitcoin#25165: doc: Explain squashing with merge commits (laanwj)
ef13101d2b Merge bitcoin/bitcoin#25210: doc: remove misleading AreInputsStandard() comment (laanwj)
0a847fd980 Merge bitcoin/bitcoin#25046: build: Fix `libmultiprocess` cross-compiling to Linux hosts (fanquake)
82eec21fee Merge bitcoin/bitcoin#24754: build: specify cmake build dir for multiprocess depends build (fanquake)
a91512e1d4 Merge bitcoin/bitcoin#24574: test: Actually print TSan tracebacks (fanquake)
2e01c11146 Merge bitcoin-core/gui#568: options: flip listenonion to false if not listening (Hennadii Stepanov)
200d2d58dc Merge bitcoin/bitcoin#24385: build: remove boost dep from libmultiprocess (MarcoFalke)
28ed1a23ac Merge bitcoin/bitcoin#24316: ci: Rename Cirrus CI osx_instance to macos_instance (MarcoFalke)
8d3eceacc0 Merge bitcoin/bitcoin#23130: doc: Revert "Remove outdated comments" and place comment correctly (W. J. van der Laan)
5fbdfa1163 Merge bitcoin/bitcoin#23094: doc: Remove outdated comments (W. J. van der Laan)

Pull request description:

  ## Issue being fixed or feature implemented
  Small batch of trivial backports

  ## What was done?
    _Describe your changes in detail_

  ## How Has This Been Tested?
  Previous versions had been build and tested locally I believe. Please wait for CI

  ## Breaking Changes
  None

  ## Checklist:
    _Go over all the following points, and put an `x` in all the boxes that apply._
  - [ ] I have performed a self-review of my own code
  - [ ] I have commented my code, particularly in hard-to-understand areas
  - [ ] I have added or updated relevant unit/integration/functional/e2e tests
  - [ ] I have made corresponding changes to the documentation
  - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_

Top commit has no ACKs.

Tree-SHA512: 0e3cfb7aab0a6373cf4167ae18849262fc4a5a62c0d301f558c7efd7c5db5a18e025aec0eba7b642829b2102133f92eda15aa5263319c65d158c2dd1506a13a2
This commit is contained in:
pasta 2024-02-22 21:01:01 -06:00
commit 73c90c8370
No known key found for this signature in database
GPG Key ID: 52527BEDABE87984
15 changed files with 51 additions and 23 deletions

View File

@ -12,6 +12,7 @@ env:
MAKEJOBS: "-j4"
DANGER_RUN_CI_ON_HOST: "1" # Containers will be discarded after the run, so there is no risk that the ci scripts modify the system
TEST_RUNNER_PORT_MIN: "14000" # Must be larger than 12321, which is used for the http cache. See https://cirrus-ci.org/guide/writing-tasks/#http-cache
CI_FAILFAST_TEST_LEAVE_DANGLING: "1" # Cirrus CI does not care about dangling process and setting this variable avoids killing the CI script itself on error
CCACHE_SIZE: "200M"
CCACHE_DIR: "/tmp/ccache_dir"
@ -122,7 +123,7 @@ task:
macos_brew_addon_script:
- brew install boost libevent berkeley-db4 qt miniupnpc ccache zeromq qrencode sqlite libtool automake pkg-config gnu-getopt
<< : *GLOBAL_TASK_TEMPLATE
osx_instance:
macos_instance:
# Use latest image, but hardcode version to avoid silent upgrades (and breaks)
image: catalina-xcode-12.1 # https://cirrus-ci.org/guide/macOS
env:

View File

@ -190,9 +190,9 @@ Please update the resulting commit message, if needed. It should read as a
coherent message. In most cases, this means not just listing the interim
commits.
If you have problems with squashing or other git workflows, you can enable
"Allow edits from maintainers" in the right-hand sidebar of the GitHub web
interface and ask for help in the pull request.
If your change contains a merge commit, the above workflow may not work and you
will need to remove the merge commit first. See the next section for details on
how to rebase.
Please refrain from creating several pull requests for the same change.
Use the pull request that is already open (or was created earlier) to amend
@ -205,7 +205,9 @@ pull request to pull request.
### Rebasing Changes
When a pull request conflicts with the target branch, you may be asked to rebase it on top of the current target branch.
The `git rebase` command will take care of rebuilding your commits on top of the new base.
git fetch https://github.com/bitcoin/bitcoin # Fetch the latest upstream commit
git rebase FETCH_HEAD # Rebuild commits on top of the new base
Avoid rebasing a non-conflicting pull request on top of the updated target
branch if you requested a review already. If you need to tweak some commit in

View File

@ -1016,6 +1016,8 @@ AC_CHECK_DECLS([daemon])
AC_CHECK_DECLS([pipe2])
AC_CHECK_FUNCS([timingsafe_bcmp])
AC_CHECK_DECLS([le16toh, le32toh, le64toh, htole16, htole32, htole64, be16toh, be32toh, be64toh, htobe16, htobe32, htobe64],,,
[#if HAVE_ENDIAN_H
#include <endian.h>

View File

@ -176,7 +176,7 @@ $(1)_cmake=env CC="$$($(1)_cc)" \
CXX="$$($(1)_cxx)" \
CXXFLAGS="$$($(1)_cppflags) $$($(1)_cxxflags)" \
LDFLAGS="$$($(1)_ldflags)" \
cmake -DCMAKE_INSTALL_PREFIX:PATH="$$($($(1)_type)_prefix)"
cmake -DCMAKE_INSTALL_PREFIX:PATH="$$($($(1)_type)_prefix)" $$($(1)_cmake_opts)
ifeq ($($(1)_type),build)
$(1)_cmake += -DCMAKE_INSTALL_RPATH:PATH="$$($($(1)_type)_prefix)/lib"
else

View File

@ -3,10 +3,20 @@ $(package)_version=$(native_$(package)_version)
$(package)_download_path=$(native_$(package)_download_path)
$(package)_file_name=$(native_$(package)_file_name)
$(package)_sha256_hash=$(native_$(package)_sha256_hash)
$(package)_dependencies=native_$(package) boost capnp
$(package)_dependencies=native_$(package) capnp
ifneq ($(host),$(build))
$(package)_dependencies += native_capnp
endif
define $(package)_set_vars :=
ifneq ($(host),$(build))
$(package)_cmake_opts := -DCAPNP_EXECUTABLE="$$(native_capnp_prefixbin)/capnp"
$(package)_cmake_opts += -DCAPNPC_CXX_EXECUTABLE="$$(native_capnp_prefixbin)/capnpc-c++"
endif
endef
define $(package)_config_cmds
$($(package)_cmake)
$($(package)_cmake) .
endef
define $(package)_build_cmds

View File

@ -6,7 +6,7 @@ $(package)_sha256_hash=ac848db49a6ed53e423c62d54bd87f1f08cbb0326254a8667e10bbfe5
$(package)_dependencies=native_capnp
define $(package)_config_cmds
$($(package)_cmake)
$($(package)_cmake) .
endef
define $(package)_build_cmds

View File

@ -9,6 +9,7 @@ Table of Contents
* [Disable features with `./configure`](#disable-features-with-configure)
* [Make use of your threads with `make -j`](#make-use-of-your-threads-with-make--j)
* [Only build what you need](#only-build-what-you-need)
* [Compile on multiple machines](#compile-on-multiple-machines)
* [Multiple working directories with `git worktrees`](#multiple-working-directories-with-git-worktrees)
* [Interactive "dummy rebases" for fixups and execs with `git merge-base`](#interactive-dummy-rebases-for-fixups-and-execs-with-git-merge-base)
* [Writing code](#writing-code)
@ -81,6 +82,10 @@ make -C src dash_bench
(You can and should combine this with `-j`, as above, for a parallel build.)
### Compile on multiple machines
If you have more than one computer at your disposal, you can use [distcc](https://www.distcc.org) to speed up compilation. This is easiest when all computers run the same operating system and compiler version.
### Multiple working directories with `git worktrees`
If you work with multiple branches or multiple copies of the repository, you should try `git worktrees`.

View File

@ -2,6 +2,10 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#if defined(HAVE_CONFIG_H)
#include <config/bitcoin-config.h>
#endif
#include <crypto/chacha_poly_aead.h>
#include <crypto/poly1305.h>

View File

@ -1261,8 +1261,6 @@ bool AppInitParameterInteraction(const ArgsManager& args)
nUserMaxConnections = args.GetArg("-maxconnections", DEFAULT_MAX_PEER_CONNECTIONS);
nMaxConnections = std::max(nUserMaxConnections, 0);
// Trim requested connection counts, to fit into system limitations
// <int> in std::min<int>(...) to work around FreeBSD compilation issue described in #2695
nFD = RaiseFileDescriptorLimit(nMaxConnections + MIN_CORE_FILEDESCRIPTORS + MAX_ADDNODE_CONNECTIONS + nBind + NUM_FDS_MESSAGE_CAPTURE);
#ifdef USE_POLL
@ -1270,6 +1268,8 @@ bool AppInitParameterInteraction(const ArgsManager& args)
#else
int fd_max = FD_SETSIZE;
#endif
// Trim requested connection counts, to fit into system limitations
// <int> in std::min<int>(...) to work around FreeBSD compilation issue described in #2695
nMaxConnections = std::max(std::min<int>(nMaxConnections, fd_max - nBind - MIN_CORE_FILEDESCRIPTORS - MAX_ADDNODE_CONNECTIONS - NUM_FDS_MESSAGE_CAPTURE), 0);
if (nFD < MIN_CORE_FILEDESCRIPTORS)
return InitError(_("Not enough file descriptors available."));

View File

@ -266,8 +266,11 @@ void OptionsModel::Init(bool resetSettings)
if (!settings.contains("fListen"))
settings.setValue("fListen", DEFAULT_LISTEN);
if (!gArgs.SoftSetBoolArg("-listen", settings.value("fListen").toBool()))
if (!gArgs.SoftSetBoolArg("-listen", settings.value("fListen").toBool())) {
addOverriddenOption("-listen");
} else if (!settings.value("fListen").toBool()) {
gArgs.SoftSetBoolArg("-listenonion", false);
}
if (!settings.contains("fUseProxy"))
settings.setValue("fUseProxy", false);

View File

@ -204,7 +204,10 @@ void Win32LockedPageAllocator::FreeLocked(void* addr, size_t len)
size_t Win32LockedPageAllocator::GetLimit()
{
// TODO is there a limit on Windows, how to get it?
size_t min, max;
if(GetProcessWorkingSetSize(GetCurrentProcess(), &min, &max) != 0) {
return min;
}
return std::numeric_limits<size_t>::max();
}
#endif

View File

@ -765,7 +765,6 @@ bool MemPoolAccept::PreChecks(ATMPArgs& args, Workspace& ws)
return false; // state filled in by CheckTxInputs
}
// Check for non-standard pay-to-script-hash in inputs
if (fRequireStandard && !AreInputsStandard(tx, m_view)) {
return state.Invalid(TxValidationResult::TX_INPUTS_NOT_STANDARD, "bad-txns-nonstandard-inputs");
}

View File

@ -12,8 +12,7 @@ from test_framework.p2p import (
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
assert_equal,
PORT_MIN,
PORT_RANGE,
p2p_port,
)
# As defined in net_processing.
@ -42,10 +41,9 @@ class AddrReceiver(P2PInterface):
class AddrTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 1
# Start onion ports after p2p and rpc ports.
port = PORT_MIN + 2 * PORT_RANGE
self.onion_port1 = port
self.onion_port2 = port + 1
# Use some of the remaining p2p ports for the onion binds.
self.onion_port1 = p2p_port(1)
self.onion_port2 = p2p_port(2)
self.extra_args = [
[f"-bind=127.0.0.1:{self.onion_port1}=onion", f"-bind=127.0.0.1:{self.onion_port2}=onion"],
]

View File

@ -236,11 +236,11 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
# source: https://stackoverflow.com/questions/48796169/how-to-fix-ipykernel-launcher-py-error-unrecognized-arguments-in-jupyter/56349168#56349168
parser.add_argument("-f", "--fff", help="a dummy argument to fool ipython", default="1")
PortSeed.n = self.options.port_seed
def setup(self):
"""Call this method to start up the test framework object with options set."""
PortSeed.n = self.options.port_seed
check_json_precision()
self.options.cachedir = os.path.abspath(self.options.cachedir)

View File

@ -546,11 +546,12 @@ def run_tests(*, test_list, src_dir, build_dir, tmpdir, jobs=1, attempts=1, enab
# Clean up dangling processes if any. This may only happen with --failfast option.
# Killing the process group will also terminate the current process but that is
# not an issue
if len(job_queue.jobs):
if not os.getenv("CI_FAILFAST_TEST_LEAVE_DANGLING") and len(job_queue.jobs):
os.killpg(os.getpgid(0), signal.SIGKILL)
sys.exit(not all_passed)
def print_results(test_results, max_len_name, runtime):
results = "\n" + BOLD[1] + "%s | %s | %s\n\n" % ("TEST".ljust(max_len_name), "STATUS ", "DURATION") + BOLD[0]