Skip to content

Commit ed8bae5

Browse files
authored
Merge pull request #192 from oleonardolima/feat/add-custom-signet-support
feat: add custom signet support
2 parents 0cd2676 + f405854 commit ed8bae5

230 files changed

Lines changed: 5179 additions & 1260 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1414
- Added `ScriptPubkeyExt::as_bytes` to return a zero-copy slice into kernel-managed memory. Unlike `to_bytes`, this does not allocate.
1515
- Added `Transaction::check` for context-free consensus validation of a transaction. Returns `TxCheckResult::Valid` on success or `TxCheckResult::Invalid(TxValidationResult)` on failure.
1616
- Added `TxValidationResult` enum with all transaction validation result variants.
17+
- Added `ChainParams::new_signet` and `ContextBuilder::signet` to configure a custom signet from a user-provided challenge.
1718

1819
### Changed
1920
- The `verify` function's `flags` parameter now uses `ScriptVerificationFlags` instead of `u32`, making the type explicit in the public API.

libbitcoinkernel-sys/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212
- New `btck_TxValidationResult` type with named constants for all transaction validation result variants
1313
- New `btck_tx_validation_state_create`, `btck_tx_validation_state_get_validation_mode`, `btck_tx_validation_state_get_tx_validation_result` and `btck_tx_validation_state_destroy` for managing and inspecting transaction validation state
1414
- New `btck_transaction_check` for context-free consensus validation of transactions (reachable results: `UNSET` on success, `CONSENSUS` on failure)
15+
- New `btck_chain_parameters_create_signet` for creating chain parameters for a custom signet from a user-provided challenge.
1516

1617
### Changed
1718
- `btck_block_header_create` now asserts that the input buffer is non-null and exactly 80 bytes; previously non-null buffer of any length was accepted

libbitcoinkernel-sys/bitcoin/.github/ISSUE_TEMPLATE/bug.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ body:
1010
* General bitcoin questions and/or support requests should use Bitcoin StackExchange at https://bitcoin.stackexchange.com.
1111
* For reporting security issues, please read instructions at https://bitcoincore.org/en/contact/.
1212
* If the node is "stuck" during sync or giving "block checksum mismatch" errors, please ensure your hardware is stable by running `memtest` and observe CPU temperature with a load-test tool such as `linpack` before creating an issue.
13+
* If you use AI tools when opening this issue, please read the [AI policy](https://github.com/bitcoin/bitcoin/blob/master/doc/AI_POLICY.md).
1314
1415
----
1516
- type: checkboxes

libbitcoinkernel-sys/bitcoin/.github/ISSUE_TEMPLATE/feature_request.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ name: Feature Request
22
description: Suggest an idea for this project.
33
labels: [Feature]
44
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
If you use AI tools when opening this issue, please read the [AI policy](https://github.com/bitcoin/bitcoin/blob/master/doc/AI_POLICY.md).
9+
510
- type: textarea
611
id: feature
712
attributes:

libbitcoinkernel-sys/bitcoin/.github/ISSUE_TEMPLATE/gui_issue.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ name: Issue or feature request related to the GUI
22
description: Any report, issue or feature request related to the GUI
33
labels: [GUI]
44
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
If you use AI tools when opening this issue, please read the [AI policy](https://github.com/bitcoin/bitcoin/blob/master/doc/AI_POLICY.md).
9+
510
- type: checkboxes
611
id: acknowledgement
712
attributes:

libbitcoinkernel-sys/bitcoin/.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
<!--
22
*** Please remove the following help text before submitting: ***
33
4-
Pull requests without a rationale and clear improvement may be closed
5-
immediately.
4+
Pull requests may be closed immediately if they:
5+
- do not have a rationale and clear improvement
6+
- do not adhere to doc/AI_POLICY.md
67
78
GUI-related pull requests should be opened against
8-
https://github.com/bitcoin-core/gui
9-
first. See CONTRIBUTING.md
9+
https://github.com/bitcoin-core/gui first.
10+
See CONTRIBUTING.md
1011
-->
1112

1213
<!--

libbitcoinkernel-sys/bitcoin/.github/workflows/ci.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,12 @@ jobs:
469469
timeout-minutes: 120
470470
file-env: './ci/test/00_setup_env_freebsd_cross.sh'
471471

472+
- name: 'OpenBSD Cross'
473+
warp-runner: 'warp-ubuntu-latest-x64-8x'
474+
fallback-runner: 'ubuntu-latest'
475+
timeout-minutes: 120
476+
file-env: './ci/test/00_setup_env_openbsd_cross.sh'
477+
472478
- name: 'No wallet'
473479
warp-runner: 'warp-ubuntu-latest-x64-4x'
474480
fallback-runner: 'ubuntu-latest'
@@ -523,6 +529,12 @@ jobs:
523529
timeout-minutes: 120
524530
file-env: './ci/test/00_setup_env_native_msan.sh'
525531

532+
- name: 'riscv32 bare metal, static libbitcoin_consensus'
533+
warp-runner: 'warp-ubuntu-latest-x64-8x'
534+
fallback-runner: 'ubuntu-latest'
535+
timeout-minutes: 120
536+
file-env: './ci/test/00_setup_env_riscv_bare_cross.sh'
537+
526538
steps:
527539
- *ANNOTATION_PR_NUMBER
528540

libbitcoinkernel-sys/bitcoin/CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,6 @@ if(BUILD_FOR_FUZZING)
192192
set(BUILD_TESTS OFF)
193193
set(BUILD_GUI_TESTS OFF)
194194
set(BUILD_BENCH OFF)
195-
set(ENABLE_IPC OFF)
196195
set(BUILD_FUZZ_BINARY ON)
197196

198197
target_compile_definitions(core_interface INTERFACE
@@ -204,22 +203,28 @@ endif()
204203
# Check and set PIC/PIE
205204
#=============================
206205
set(configure_warnings)
206+
if(NOT CMAKE_SYSTEM_NAME STREQUAL "Generic")
207207
include(CheckLinkerSupportsPIE)
208208
# Set CMAKE_POSITION_INDEPENDENT_CODE early so it applies to all
209209
# subsequent checks, including dependency packages and tool flags.
210210
check_linker_supports_pie(configure_warnings)
211+
endif()
211212

212213
#=============================
213214
# Find dependencies
214215
#=============================
216+
if(NOT CMAKE_SYSTEM_NAME STREQUAL "Generic")
215217
set(THREADS_PREFER_PTHREAD_FLAG ON)
216218
find_package(Threads REQUIRED)
217219
target_link_libraries(core_interface INTERFACE
218220
Threads::Threads
219221
)
222+
endif()
220223

224+
if(NOT CMAKE_SYSTEM_NAME STREQUAL "Generic")
221225
include(AddBoostIfNeeded)
222226
add_boost_if_needed()
227+
endif()
223228

224229
if(ENABLE_WALLET)
225230
if(VCPKG_TARGET_TRIPLET)

libbitcoinkernel-sys/bitcoin/CONTRIBUTING.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ Getting Started
1919

2020
New contributors are very welcome and needed.
2121

22+
If you use AI tools while contributing, please read and follow the [AI
23+
policy](/doc/AI_POLICY.md). Contributors are responsible for understanding and
24+
explaining their own work in their own words.
25+
2226
In-depth reviewing and testing are the bottleneck of the project, and are the
2327
most effective way anyone can start to contribute. It will teach you much more
2428
about the code and process than opening pull requests, and may help you uncover

libbitcoinkernel-sys/bitcoin/ci/test/00_setup_env_freebsd_cross.sh

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,25 @@ export LC_ALL=C.UTF-8
99
export CONTAINER_NAME=ci_freebsd_cross
1010
export CI_IMAGE_NAME_TAG="mirror.gcr.io/ubuntu:26.04"
1111
export APT_LLVM_V="22"
12-
export FREEBSD_VERSION=15.0
13-
export PACKAGES="clang-${APT_LLVM_V} llvm-${APT_LLVM_V} lld"
1412
export HOST=x86_64-unknown-freebsd
15-
export DEP_OPTS="build_CC=clang build_CXX=clang++ AR=llvm-ar-${APT_LLVM_V} STRIP=llvm-strip-${APT_LLVM_V} NM=llvm-nm-${APT_LLVM_V} RANLIB=llvm-ranlib-${APT_LLVM_V}"
13+
export FREEBSD_VERSION=15.1
14+
export FREEBSD_SDK_BASENAME="freebsd-${HOST}-${FREEBSD_VERSION}"
15+
export PACKAGES="clang-${APT_LLVM_V} llvm-${APT_LLVM_V} lld-${APT_LLVM_V}"
16+
export SYSROOT="--sysroot=${DEPENDS_DIR}/SDKs/${FREEBSD_SDK_BASENAME}"
17+
export DEP_OPTS="build_CC=clang build_CXX=clang++ \
18+
CC='clang --target=${HOST} ${SYSROOT}' \
19+
CXX='clang++ --target=${HOST} ${SYSROOT} -stdlib=libc++' \
20+
LDFLAGS='-Wc,-fuse-ld=lld -fuse-ld=lld' \
21+
AR=llvm-ar-${APT_LLVM_V} \
22+
NM=llvm-nm-${APT_LLVM_V} \
23+
OBJCOPY=llvm-objcopy-${APT_LLVM_V} \
24+
OBJDUMP=llvm-objdump-${APT_LLVM_V} \
25+
RANLIB=llvm-ranlib-${APT_LLVM_V} \
26+
STRIP=llvm-strip-${APT_LLVM_V}"
1627
export GOAL="install"
1728
export BITCOIN_CONFIG="\
1829
--preset=dev-mode \
30+
-DCMAKE_LINKER_TYPE=LLD \
1931
-DREDUCE_EXPORTS=ON \
2032
-DWITH_USDT=OFF \
2133
"

0 commit comments

Comments
 (0)