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 Mar 3, 2025
2 parents 73a09c2 + 3c1f72a commit e2afc3e
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 43 deletions.
52 changes: 22 additions & 30 deletions cmake/minisketch.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ check_cxx_source_compiles_with_flags("
)

add_library(minisketch_common INTERFACE)
target_compile_definitions(minisketch_common INTERFACE
DISABLE_DEFAULT_FIELDS
ENABLE_FIELD_32
)
if(MSVC)
target_compile_options(minisketch_common INTERFACE
/wd4060
Expand All @@ -42,29 +38,6 @@ if(MSVC)
)
endif()

if(HAVE_CLMUL)
add_library(minisketch_clmul OBJECT EXCLUDE_FROM_ALL
${PROJECT_SOURCE_DIR}/src/minisketch/src/fields/clmul_1byte.cpp
${PROJECT_SOURCE_DIR}/src/minisketch/src/fields/clmul_2bytes.cpp
${PROJECT_SOURCE_DIR}/src/minisketch/src/fields/clmul_3bytes.cpp
${PROJECT_SOURCE_DIR}/src/minisketch/src/fields/clmul_4bytes.cpp
${PROJECT_SOURCE_DIR}/src/minisketch/src/fields/clmul_5bytes.cpp
${PROJECT_SOURCE_DIR}/src/minisketch/src/fields/clmul_6bytes.cpp
${PROJECT_SOURCE_DIR}/src/minisketch/src/fields/clmul_7bytes.cpp
${PROJECT_SOURCE_DIR}/src/minisketch/src/fields/clmul_8bytes.cpp
)
target_compile_definitions(minisketch_clmul PUBLIC HAVE_CLMUL)
target_compile_options(minisketch_clmul PRIVATE ${CLMUL_CXXFLAGS})
target_link_libraries(minisketch_clmul
PRIVATE
core_interface
minisketch_common
)
set_target_properties(minisketch_clmul PROPERTIES
EXPORT_COMPILE_COMMANDS OFF
)
endif()

add_library(minisketch STATIC EXCLUDE_FROM_ALL
${PROJECT_SOURCE_DIR}/src/minisketch/src/minisketch.cpp
${PROJECT_SOURCE_DIR}/src/minisketch/src/fields/generic_1byte.cpp
Expand All @@ -77,8 +50,11 @@ add_library(minisketch STATIC EXCLUDE_FROM_ALL
${PROJECT_SOURCE_DIR}/src/minisketch/src/fields/generic_8bytes.cpp
)

# Workaround for https://gitlab.kitware.com/cmake/cmake/-/issues/24058
set_target_properties(minisketch PROPERTIES OPTIMIZE_DEPENDENCIES OFF)
target_compile_definitions(minisketch
PRIVATE
DISABLE_DEFAULT_FIELDS
ENABLE_FIELD_32
)

target_include_directories(minisketch
PUBLIC
Expand All @@ -89,9 +65,25 @@ target_link_libraries(minisketch
PRIVATE
core_interface
minisketch_common
$<TARGET_NAME_IF_EXISTS:minisketch_clmul>
)

set_target_properties(minisketch PROPERTIES
EXPORT_COMPILE_COMMANDS OFF
)

if(HAVE_CLMUL)
set(_minisketch_clmul_src
${PROJECT_SOURCE_DIR}/src/minisketch/src/fields/clmul_1byte.cpp
${PROJECT_SOURCE_DIR}/src/minisketch/src/fields/clmul_2bytes.cpp
${PROJECT_SOURCE_DIR}/src/minisketch/src/fields/clmul_3bytes.cpp
${PROJECT_SOURCE_DIR}/src/minisketch/src/fields/clmul_4bytes.cpp
${PROJECT_SOURCE_DIR}/src/minisketch/src/fields/clmul_5bytes.cpp
${PROJECT_SOURCE_DIR}/src/minisketch/src/fields/clmul_6bytes.cpp
${PROJECT_SOURCE_DIR}/src/minisketch/src/fields/clmul_7bytes.cpp
${PROJECT_SOURCE_DIR}/src/minisketch/src/fields/clmul_8bytes.cpp
)
target_sources(minisketch PRIVATE ${_minisketch_clmul_src})
set_property(SOURCE ${_minisketch_clmul_src} PROPERTY COMPILE_OPTIONS ${CLMUL_CXXFLAGS})
target_compile_definitions(minisketch PRIVATE HAVE_CLMUL)
unset(_minisketch_clmul_src)
endif()
4 changes: 2 additions & 2 deletions depends/packages/native_libmultiprocess.mk
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package=native_libmultiprocess
$(package)_version=07c917f7ca910d66abc6d3873162fc9061704074
$(package)_version=1954f7f65661d49e700c344eae0fc8092decf975
$(package)_download_path=https://github.com/chaincodelabs/libmultiprocess/archive
$(package)_file_name=$($(package)_version).tar.gz
$(package)_sha256_hash=ac9db311e3b22aac3c7b7b7b3f6b7fee5cf3043ebb3c3bf412049e8b17166de8
$(package)_sha256_hash=fc014bd74727c1d5d30b396813685012c965d079244dd07b53bc1c75c610a2cb
$(package)_dependencies=native_capnp

define $(package)_config_cmds
Expand Down
2 changes: 1 addition & 1 deletion doc/translation_process.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ We use automated scripts to help extract translations in both Qt, and non-Qt sou

To automatically regenerate the `bitcoin_en.ts` file, run the following commands:
```sh
cmake --preset dev-mode -DWITH_USDT=OFF
cmake --preset dev-mode -DWITH_USDT=OFF -DWITH_MULTIPROCESS=OFF
cmake --build build_dev_mode --target translate
```

Expand Down
2 changes: 1 addition & 1 deletion test/functional/p2p_orphan_handling.py
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,7 @@ def test_parents_change(self):
node.bumpmocktime(NONPREF_PEER_TX_DELAY + TXID_RELAY_DELAY)
peer1.wait_for_getdata([int(parent_missing["txid"], 16)])

# Replace parent_peekaboo_AB so that is is a newly missing parent.
# Replace parent_peekaboo_AB so that is a newly missing parent.
# Then, replace the replacement so that it can be resubmitted.
node.sendrawtransaction(tx_replacer_BC["hex"])
assert tx_replacer_BC["txid"] in node.getrawmempool()
Expand Down
15 changes: 9 additions & 6 deletions test/functional/test-shell.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,16 @@ user inputs. Such environments include the Python3 command line interpreter or

## 2. Importing `TestShell` from the Bitcoin Core repository

We can import the `TestShell` by adding the path of the Bitcoin Core
We can import the `TestShell` by adding the path of the configured Bitcoin Core
`test_framework` module to the beginning of the PATH variable, and then
importing the `TestShell` class from the `test_shell` sub-package.
importing the `TestShell` class from the `test_shell` sub-package. Since
the build system creates a copy of the `test_framework` module into a new `build/`
directory along with the required configuration file, the path to the build copy
must be used.

```
>>> import sys
>>> sys.path.insert(0, "/path/to/bitcoin/test/functional")
>>> sys.path.insert(0, "/path/to/bitcoin/build/test/functional")
>>> from test_framework.test_shell import TestShell
```

Expand Down Expand Up @@ -155,7 +158,7 @@ To prevent the logs from being removed after a shutdown, simply set the
The following utility consolidates logs from the bitcoind nodes and the
underlying `BitcoinTestFramework`:

* `/path/to/bitcoin/test/functional/combine_logs.py
* `/path/to/bitcoin/build/test/functional/combine_logs.py
'/path/to/bitcoin_func_test_XXXXXXX'`

## 6. Custom `TestShell` parameters
Expand All @@ -170,9 +173,9 @@ can be called after the TestShell is shut down.
| Test parameter key | Default Value | Description |
|---|---|---|
| `bind_to_localhost_only` | `True` | Binds bitcoind P2P services to `127.0.0.1` if set to `True`.|
| `cachedir` | `"/path/to/bitcoin/test/cache"` | Sets the bitcoind datadir directory. |
| `cachedir` | `"/path/to/bitcoin/build/test/cache"` | Sets the bitcoind datadir directory. |
| `chain` | `"regtest"` | Sets the chain-type for the underlying test bitcoind processes. |
| `configfile` | `"/path/to/bitcoin/test/config.ini"` | Sets the location of the test framework config file. |
| `configfile` | `"/path/to/bitcoin/build/test/config.ini"` | Sets the location of the test framework config file. |
| `coveragedir` | `None` | Records bitcoind RPC test coverage into this directory if set. |
| `loglevel` | `INFO` | Logs events at this level and higher. Can be set to `DEBUG`, `INFO`, `WARNING`, `ERROR` or `CRITICAL`. |
| `nocleanup` | `False` | Cleans up temporary test directory if set to `True` during `shutdown`. |
Expand Down
7 changes: 4 additions & 3 deletions test/functional/test_framework/test_shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ def reset(self):
print("Shutdown TestShell before resetting!")
else:
self.num_nodes = None
super().__init__()
dummy_testshell_file = pathlib.Path(__file__).absolute().parent.parent / "testshell_dummy.py"
super().__init__(dummy_testshell_file)

instance = None

Expand All @@ -74,8 +75,8 @@ def __new__(cls):
# cache. Since TestShell is meant for interactive use, there is no concrete
# test; passing a dummy name is fine though, as only the containing directory
# is relevant for successful initialization.
tests_directory = pathlib.Path(__file__).resolve().parent.parent
TestShell.instance = TestShell.__TestShell(tests_directory / "testshell_dummy.py")
dummy_testshell_file = pathlib.Path(__file__).absolute().parent.parent / "testshell_dummy.py"
TestShell.instance = TestShell.__TestShell(dummy_testshell_file)
TestShell.instance.running = False
return TestShell.instance

Expand Down
4 changes: 4 additions & 0 deletions test/functional/wallet_abandonconflict.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ def run_test(self):
txB = alice.sendtoaddress(alice.getnewaddress(), Decimal("10"))
txC = alice.sendtoaddress(alice.getnewaddress(), Decimal("10"))
self.sync_mempools()

# Can not abandon transaction in mempool
assert_raises_rpc_error(-5, 'Transaction not eligible for abandonment', lambda: alice.abandontransaction(txid=txA))

self.generate(self.nodes[1], 1)

# Can not abandon non-wallet transaction
Expand Down

0 comments on commit e2afc3e

Please sign in to comment.