Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/ci-expanded.yml
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,18 @@ jobs:
boost: ""
options: "--enable-isystem --build-skip-test-run"

- image: ubuntu-26.04
config: "release"
link: "static"
cc: "x86_64-w64-mingw32-gcc-posix"
cxx: "x86_64-w64-mingw32-g++-posix"
flags: ""
coverage: ""
package: "gcc-mingw-w64-x86-64-posix g++-mingw-w64-x86-64-posix"
host: "x86_64-w64-mingw32"
boost: ""
options: "--enable-isystem --build-skip-test-run"

runs-on: ${{ matrix.image }}

env:
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,18 @@ jobs:
boost: ""
options: "--enable-isystem --build-skip-test-run"

- image: ubuntu-26.04
config: "release"
link: "static"
cc: "x86_64-w64-mingw32-gcc-posix"
cxx: "x86_64-w64-mingw32-g++-posix"
flags: ""
coverage: ""
package: "gcc-mingw-w64-x86-64-posix g++-mingw-w64-x86-64-posix"
host: "x86_64-w64-mingw32"
boost: ""
options: "--enable-isystem --build-skip-test-run"

runs-on: ${{ matrix.image }}

env:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ builds/gnu/*.pc
# configured headers from in-tree configure
builds/gnu/include

# configured sources from in-tree make
builds/gnu/src

# msbuild/msvc
/.vs
*.db
Expand Down
27 changes: 26 additions & 1 deletion builds/cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
###############################################################################
cmake_minimum_required(VERSION 3.30 FATAL_ERROR)

find_package(Git QUIET)
if ( NOT CMAKE_SCRIPT_MODE_FILE )
find_package(Git QUIET)
endif()

set( GIT_COMMIT_HASH "unknown" )
set( GIT_COMMIT_HEIGHT 0 )
Expand Down Expand Up @@ -63,6 +65,11 @@ set( LIBBITCOIN_VERSION_MAJOR 4 )
set( LIBBITCOIN_VERSION_MINOR 0 )
set( LIBBITCOIN_VERSION_PATCH ${GIT_COMMIT_HEIGHT} )

if ( CMAKE_SCRIPT_MODE_FILE )
configure_file( ${CONFIGURE_INPUT} ${CONFIGURE_OUTPUT} @ONLY )
return()
endif()

project( libbitcoin-node
VERSION ${LIBBITCOIN_VERSION_MAJOR}.${LIBBITCOIN_VERSION_MINOR}.${LIBBITCOIN_VERSION_PATCH}
DESCRIPTION "Bitcoin Full Node"
Expand Down Expand Up @@ -192,6 +199,11 @@ configure_file(
${CMAKE_CURRENT_BINARY_DIR}/include/bitcoin/node/version.hpp
@ONLY )

configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/../../src/version.cpp.in
${CMAKE_CURRENT_BINARY_DIR}/src/version.cpp
@ONLY )

#------------------------------------------------------------------------------
# libbitcoin-node library
#------------------------------------------------------------------------------
Expand Down Expand Up @@ -253,6 +265,19 @@ target_link_libraries( libbitcoin-node
bitcoin::network
)

add_custom_target( libbitcoin-node-version.cpp
COMMAND ${CMAKE_COMMAND}
-DGIT_EXECUTABLE=${GIT_EXECUTABLE}
-DCONFIGURE_INPUT=${CMAKE_CURRENT_SOURCE_DIR}/../../src/version.cpp.in
-DCONFIGURE_OUTPUT=${CMAKE_CURRENT_BINARY_DIR}/src/version.cpp
-P ${CMAKE_CURRENT_LIST_FILE}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/src/version.cpp
VERBATIM )

add_dependencies( libbitcoin-node libbitcoin-node-version.cpp )
target_sources( libbitcoin-node PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/src/version.cpp )

set_target_properties( libbitcoin-node
PROPERTIES
VERSION ${PROJECT_VERSION}
Expand Down
21 changes: 21 additions & 0 deletions builds/gnu/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,26 @@ src_libbitcoin_node_la_SOURCES = \
${srcdir}/../../src/sessions/session_manual.cpp \
${srcdir}/../../src/sessions/session_outbound.cpp

nodist_src_libbitcoin_node_la_SOURCES = \
src/version.cpp

src/version.cpp: FORCE
@${MKDIR_P} src
@commit=`git -C ${srcdir} rev-parse HEAD 2>/dev/null || echo unknown`; \
height=`git -C ${srcdir} rev-list --count HEAD 2>/dev/null || echo 0`; \
url=`git -C ${srcdir} ls-remote --get-url 2>/dev/null | grep -e '://' -e '@' || echo unknown`; \
if git -C ${srcdir} status --porcelain 2>/dev/null | grep -q . ; then dirty=1; else dirty=0; fi; \
sed -e "s|[@]LIBBITCOIN_VERSION_MAJOR[@]|${LIBBITCOIN_VERSION_MAJOR}|g" \
-e "s|[@]LIBBITCOIN_VERSION_MINOR[@]|${LIBBITCOIN_VERSION_MINOR}|g" \
-e "s|[@]LIBBITCOIN_VERSION_PATCH[@]|$$height|g" \
-e "s|[@]GIT_COMMIT_HASH[@]|$$commit|g" \
-e "s|[@]GIT_ORIGIN_URL[@]|$$url|g" \
-e "s|[@]GIT_DIRTY[@]|$$dirty|g" \
${srcdir}/../../src/version.cpp.in > $@.tmp; \
if cmp -s $@.tmp $@; then rm -f $@.tmp; else mv -f $@.tmp $@; fi

FORCE:

include_bitcoindir = \
${includedir}/bitcoin

Expand Down Expand Up @@ -210,6 +230,7 @@ test_libbitcoin_node_test_CPPFLAGS = \
${src_libbitcoin_node_la_CPPFLAGS}

test_libbitcoin_node_test_LDFLAGS = \
${mingw_program_LDFLAGS} \
${boost_LDFLAGS} \
${src_libbitcoin_node_la_LDFLAGS}

Expand Down
10 changes: 10 additions & 0 deletions builds/gnu/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,16 @@ AC_CONFIG_MACRO_DIR([m4])
AC_CANONICAL_BUILD
AC_CANONICAL_HOST

# Define the Windows platform and link the Windows system libraries for MinGW.
# Programs link statically, and wmain programs link the unicode entry point.
AS_CASE([${host_os}], [*mingw*],
[CPPFLAGS="${CPPFLAGS} -DUNICODE -D_UNICODE -DWIN32_LEAN_AND_MEAN -DNOMINMAX -D_WIN32_WINNT=0x0A00"
LIBS="${LIBS} -lws2_32 -lmswsock -ldbghelp"
mingw_program_LDFLAGS="-all-static"
mingw_wmain_LDFLAGS="-municode"])
AC_SUBST([mingw_program_LDFLAGS])
AC_SUBST([mingw_wmain_LDFLAGS])

# Run macros for operation of generated Makefiles, enable non-recursive make.
# Unless [foreign] is specified standard GNU files will be required,
# specifically: AUTHORS, COPYING, INSTALL, NEWS, README and ChangeLog.
Expand Down
12 changes: 12 additions & 0 deletions builds/msvc/properties/Common.props
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,16 @@
</ClCompile>
</ItemDefinitionGroup>

<!-- clang-cl enables x86 intrinsics by target feature, as gcc/clang, where msvc uses the WITH_ options. -->
<ItemDefinitionGroup Condition="'$(Option-clang)' == 'true' And ('$(Platform)' == 'x64' Or '$(Platform)' == 'Win32')">
<ClCompile>
<AdditionalOptions Condition="'$(Option-sha)' == 'true'">-msse4.1 -msha %(AdditionalOptions)</AdditionalOptions>
<AdditionalOptions Condition="'$(Option-sha512)' == 'true'">-mavx2 -msha512 %(AdditionalOptions)</AdditionalOptions>
<AdditionalOptions Condition="'$(Option-avx512ifma)' == 'true'">-mavx512ifma -mavx512vl %(AdditionalOptions)</AdditionalOptions>
<AdditionalOptions Condition="'$(Option-avxifma)' == 'true'">-mavxifma %(AdditionalOptions)</AdditionalOptions>
<AdditionalOptions Condition="'$(Option-aesni)' == 'true'">-msse4.1 -maes -mpclmul %(AdditionalOptions)</AdditionalOptions>
<AdditionalOptions Condition="'$(Option-vaes)' == 'true'">-mavx2 -maes -mpclmul -mvaes -mvpclmulqdq %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
</ItemDefinitionGroup>

</Project>
2 changes: 1 addition & 1 deletion builds/msvc/properties/Git.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<!-- Substitutes @TOKEN@ values into each ConfigurableFile, writing %(Generated) only when its content changes. -->
<Target Name="ConfigureFiles" BeforeTargets="ClCompile;ResourceCompile" Inputs="%(ConfigurableFile.Identity)" Outputs="%(ConfigurableFile.Generated)">
<Target Name="ConfigureFiles" BeforeTargets="ClCompile;ResourceCompile" Condition="'@(ConfigurableFile)' != ''" Outputs="%(ConfigurableFile.Generated)">

<Exec Command="git -C &quot;$(RepoRoot).&quot; rev-parse HEAD 2&gt;nul" Condition="'$(GitCommitHash)' == ''" ConsoleToMSBuild="true" EchoOff="true" IgnoreExitCode="true" IgnoreStandardErrorWarningFormat="true" StandardOutputImportance="low">
<Output TaskParameter="ConsoleOutput" PropertyName="GitCommitHash" />
Expand Down
6 changes: 6 additions & 0 deletions builds/msvc/vs2026/libbitcoin-node/libbitcoin-node.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,13 @@
<ConfigurableFile Include="..\..\..\..\include\bitcoin\node\version.hpp.in">
<Generated>..\..\..\..\build\include\bitcoin\node\version.hpp</Generated>
</ConfigurableFile>
<ConfigurableFile Include="..\..\..\..\src\version.cpp.in">
<Generated>..\..\..\..\build\src\version.cpp</Generated>
</ConfigurableFile>
<ClInclude Include="..\..\..\..\build\include\bitcoin\node\version.hpp" />
<ClCompile Include="..\..\..\..\build\src\version.cpp">
<ObjectFileName>$(IntDir)build_src_version.obj</ObjectFileName>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\..\src\block_arena.cpp" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,9 @@
<ClInclude Include="..\..\..\..\build\include\bitcoin\node\version.hpp">
<Filter>include\bitcoin\node</Filter>
</ClInclude>
<ClCompile Include="..\..\..\..\build\src\version.cpp">
<Filter>src</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="..\..\..\..\include\bitcoin\node\impl\sessions\session_peer.ipp">
Expand Down
1 change: 0 additions & 1 deletion builds/msvc/vs2026/libbitcoin-system.import.props
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
<PreprocessorDefinitions Condition="'$(Linkage-libbitcoin-system)' == 'static' Or '$(Linkage-libbitcoin-system)' == 'ltcg'">BC_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="$(Configuration.IndexOf('Debug')) != -1">_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<!-- Enable use of CPU intrinsics. -->
<!-- Eventually these options will be used to select SVE levels. -->
<PreprocessorDefinitions Condition="'$(Option-sha)' == 'true'">WITH_SHA;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Option-sha512)' == 'true'">WITH_SHA512;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Option-avx512ifma)' == 'true'">WITH_AVX512IFMA;%(PreprocessorDefinitions)</PreprocessorDefinitions>
Expand Down
48 changes: 40 additions & 8 deletions include/bitcoin/node/version.hpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,48 @@
#define LIBBITCOIN_NODE_VERSION_HPP

/**
* The semantic version of this repository as: [major].[minor].[patch]
* The version of this repository as: [major].[minor]
* For interpretation of the versioning scheme see: http://semver.org
*/

#define LIBBITCOIN_NODE_VERSION "@LIBBITCOIN_VERSION_MAJOR@.@LIBBITCOIN_VERSION_MINOR@.@LIBBITCOIN_VERSION_PATCH@"
#define LIBBITCOIN_NODE_MAJOR_VERSION @LIBBITCOIN_VERSION_MAJOR@
#define LIBBITCOIN_NODE_MINOR_VERSION @LIBBITCOIN_VERSION_MINOR@
#define LIBBITCOIN_NODE_PATCH_VERSION @LIBBITCOIN_VERSION_PATCH@
#define LIBBITCOIN_NODE_COMMIT_HASH "@GIT_COMMIT_HASH@"
#define LIBBITCOIN_NODE_REPOSITORY_URL "@GIT_ORIGIN_URL@"
#define LIBBITCOIN_NODE_IS_DIRTY @GIT_DIRTY@
#define LIBBITCOIN_NODE_VERSION "@LIBBITCOIN_VERSION_MAJOR@.@LIBBITCOIN_VERSION_MINOR@"
#define LIBBITCOIN_NODE_MAJOR_VERSION @LIBBITCOIN_VERSION_MAJOR@
#define LIBBITCOIN_NODE_MINOR_VERSION @LIBBITCOIN_VERSION_MINOR@

#ifndef RC_INVOKED

#include <string_view>

#if defined(BCN_STATIC)
#define LIBBITCOIN_NODE_VERSION_API
#elif defined(_MSC_VER) || defined(__CYGWIN__)
#if defined(BCN_DLL)
#define LIBBITCOIN_NODE_VERSION_API __declspec(dllexport)
#else
#define LIBBITCOIN_NODE_VERSION_API __declspec(dllimport)
#endif
#else
#define LIBBITCOIN_NODE_VERSION_API __attribute__((visibility("default")))
#endif

namespace libbitcoin {
namespace node {

/// The version of a build, as [major].[minor].[patch] with its git state.
struct build_version_t
{
std::string_view semantic;
std::string_view commit_hash;
std::string_view repository_url;
bool dirty;
};

/// The version of this build.
LIBBITCOIN_NODE_VERSION_API const build_version_t& build_version() noexcept;

} // namespace node
} // namespace libbitcoin

#endif

#endif
4 changes: 4 additions & 0 deletions src/configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,14 @@ code configuration::initialize() NOEXCEPT
{
database.ecdsa.size = 0;
database.schnorr.size = 0;
database.prevalid.size = 0;
}

if (!node.batch_silent_enabled() || !(node.cpu_batch_silent || gpu))
{
database.silent.size = 0;
database.presilent.size = 0;
}

if (!gpu)
database.gpu_scan_minimum = max_uint32;
Expand Down
26 changes: 26 additions & 0 deletions src/version.cpp.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
///////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2014-2026 libbitcoin-node developers (see COPYING).
//
// GENERATED SOURCE CODE, DO NOT EDIT EXCEPT EXPERIMENTALLY
//
///////////////////////////////////////////////////////////////////////////////
#include <bitcoin/node/version.hpp>

namespace libbitcoin {
namespace node {

const build_version_t& build_version() noexcept
{
static constexpr build_version_t value
{
"@LIBBITCOIN_VERSION_MAJOR@.@LIBBITCOIN_VERSION_MINOR@.@LIBBITCOIN_VERSION_PATCH@",
"@GIT_COMMIT_HASH@",
"@GIT_ORIGIN_URL@",
@GIT_DIRTY@ != 0
};

return value;
}

} // namespace node
} // namespace libbitcoin
8 changes: 8 additions & 0 deletions test/configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,14 @@ BOOST_AUTO_TEST_CASE(configuration__initialize__cpu_batching_without_gpu__tables
instance.database.ecdsa.size = 42;
instance.database.schnorr.size = 42;
instance.database.silent.size = 42;
instance.database.prevalid.size = 42;
instance.database.presilent.size = 42;
BOOST_REQUIRE(!instance.initialize());
BOOST_REQUIRE_EQUAL(instance.database.ecdsa.size, 42u);
BOOST_REQUIRE_EQUAL(instance.database.schnorr.size, 42u);
BOOST_REQUIRE_EQUAL(instance.database.silent.size, 42u);
BOOST_REQUIRE_EQUAL(instance.database.prevalid.size, 42u);
BOOST_REQUIRE_EQUAL(instance.database.presilent.size, 42u);
BOOST_REQUIRE_EQUAL(instance.database.gpu_scan_minimum, max_uint32);
}

Expand All @@ -155,10 +159,14 @@ BOOST_AUTO_TEST_CASE(configuration__initialize__no_batching_without_gpu__tables_
instance.database.ecdsa.size = 42;
instance.database.schnorr.size = 42;
instance.database.silent.size = 42;
instance.database.prevalid.size = 42;
instance.database.presilent.size = 42;
BOOST_REQUIRE(!instance.initialize());
BOOST_REQUIRE_EQUAL(instance.database.ecdsa.size, 0u);
BOOST_REQUIRE_EQUAL(instance.database.schnorr.size, 0u);
BOOST_REQUIRE_EQUAL(instance.database.silent.size, 0u);
BOOST_REQUIRE_EQUAL(instance.database.prevalid.size, 0u);
BOOST_REQUIRE_EQUAL(instance.database.presilent.size, 0u);
BOOST_REQUIRE_EQUAL(instance.database.gpu_scan_minimum, max_uint32);
}

Expand Down
Loading