Skip to content

Commit

Permalink
Merge pull request #5261 from ogabrielides/rc7_bump
Browse files Browse the repository at this point in the history
chore: bump version to rc.7
  • Loading branch information
PastaPastaPasta committed Mar 20, 2023
2 parents c4cf446 + e0fe6e4 commit bfbd912
Show file tree
Hide file tree
Showing 28 changed files with 4,792 additions and 476 deletions.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ AC_PREREQ([2.69])
define(_CLIENT_VERSION_MAJOR, 19)
define(_CLIENT_VERSION_MINOR, 0)
define(_CLIENT_VERSION_BUILD, 0)
define(_CLIENT_VERSION_RC, 6)
define(_CLIENT_VERSION_RC, 7)
define(_CLIENT_VERSION_IS_RELEASE, false)
define(_COPYRIGHT_YEAR, 2023)
define(_COPYRIGHT_HOLDERS,[The %s developers])
Expand Down
66 changes: 66 additions & 0 deletions src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <tinyformat.h>
#include <util/ranges.h>
#include <util/system.h>
#include <util/underlying.h>
#include <versionbitsinfo.h>

#include <arith_uint256.h>
Expand Down Expand Up @@ -1045,6 +1046,8 @@ class CRegTestParams : public CChainParams {

UpdateLLMQTestParametersFromArgs(args, Consensus::LLMQType::LLMQ_TEST);
UpdateLLMQTestParametersFromArgs(args, Consensus::LLMQType::LLMQ_TEST_INSTANTSEND);
UpdateLLMQInstantSendFromArgs(args);
UpdateLLMQInstantSendDIP0024FromArgs(args);
}

/**
Expand Down Expand Up @@ -1111,7 +1114,26 @@ class CRegTestParams : public CChainParams {
params->threshold = threshold;
params->dkgBadVotesThreshold = threshold;
}

/**
* Allows modifying the LLMQ type for InstantSend.
*/
void UpdateLLMQInstantSend(Consensus::LLMQType llmqType)
{
consensus.llmqTypeInstantSend = llmqType;
}

/**
* Allows modifying the LLMQ type for InstantSend (DIP0024).
*/
void UpdateLLMQDIP0024InstantSend(Consensus::LLMQType llmqType)
{
consensus.llmqTypeDIP0024InstantSend = llmqType;
}

void UpdateLLMQTestParametersFromArgs(const ArgsManager& args, const Consensus::LLMQType llmqType);
void UpdateLLMQInstantSendFromArgs(const ArgsManager& args);
void UpdateLLMQInstantSendDIP0024FromArgs(const ArgsManager& args);
};

void CRegTestParams::UpdateVersionBitsParametersFromArgs(const ArgsManager& args)
Expand Down Expand Up @@ -1253,6 +1275,50 @@ void CRegTestParams::UpdateLLMQTestParametersFromArgs(const ArgsManager& args, c
UpdateLLMQTestParameters(size, threshold, llmqType);
}

void CRegTestParams::UpdateLLMQInstantSendFromArgs(const ArgsManager& args)
{
if (!args.IsArgSet("-llmqinstantsend")) return;

const auto& llmq_params_opt = GetLLMQ(consensus.llmqTypeInstantSend);
assert(llmq_params_opt.has_value());

std::string strLLMQType = gArgs.GetArg("-llmqinstantsend", std::string(llmq_params_opt->name));

Consensus::LLMQType llmqType = Consensus::LLMQType::LLMQ_NONE;
for (const auto& params : consensus.llmqs) {
if (params.name == strLLMQType) {
llmqType = params.type;
}
}
if (llmqType == Consensus::LLMQType::LLMQ_NONE) {
throw std::runtime_error("Invalid LLMQ type specified for -llmqinstantsend.");
}
LogPrintf("Setting llmqinstantsend to size=%ld\n", ToUnderlying(llmqType));
UpdateLLMQInstantSend(llmqType);
}

void CRegTestParams::UpdateLLMQInstantSendDIP0024FromArgs(const ArgsManager& args)
{
if (!args.IsArgSet("-llmqinstantsenddip0024")) return;

const auto& llmq_params_opt = GetLLMQ(consensus.llmqTypeDIP0024InstantSend);
assert(llmq_params_opt.has_value());

std::string strLLMQType = gArgs.GetArg("-llmqinstantsenddip0024", std::string(llmq_params_opt->name));

Consensus::LLMQType llmqType = Consensus::LLMQType::LLMQ_NONE;
for (const auto& params : consensus.llmqs) {
if (params.name == strLLMQType) {
llmqType = params.type;
}
}
if (llmqType == Consensus::LLMQType::LLMQ_NONE) {
throw std::runtime_error("Invalid LLMQ type specified for -llmqinstantsenddip0024.");
}
LogPrintf("Setting llmqinstantsenddip0024 to size=%ld\n", ToUnderlying(llmqType));
UpdateLLMQDIP0024InstantSend(llmqType);
}

void CDevNetParams::UpdateDevnetSubsidyAndDiffParametersFromArgs(const ArgsManager& args)
{
if (!args.IsArgSet("-minimumdifficultyblocks") && !args.IsArgSet("-highsubsidyblocks") && !args.IsArgSet("-highsubsidyfactor")) return;
Expand Down
9 changes: 3 additions & 6 deletions src/dashbls/.github/workflows/build-binds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,13 @@ jobs:
matrix:
os: [macos-latest, ubuntu-latest]
golang: [ '1.17' ]
python: ['3.7', '3.8', '3.9', '3.10']
python: ['3.7', '3.8', '3.9', '3.10', '3.11']

steps:
- name: Checkout code
uses: actions/checkout@v3

- uses: actions/setup-python@v2
name: Install Python
- uses: chia-network/actions/setup-python@main
with:
python-version: ${{ matrix.python }}

Expand Down Expand Up @@ -60,9 +59,7 @@ jobs:
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install -qq --yes snap libgmp-dev
sudo apt-get remove --purge cmake -y
sudo snap install cmake --classic
sudo apt-get install -qq --yes valgrind libgmp-dev cmake
hash -r
cmake --version
Expand Down
6 changes: 2 additions & 4 deletions src/dashbls/.github/workflows/build-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ jobs:
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install -qq --yes valgrind snap libgmp-dev libsodium-dev
sudo apt-get remove --purge cmake -y
sudo snap install cmake --classic
sudo apt-get install -qq --yes valgrind libgmp-dev cmake
hash -r
cmake --version
Expand All @@ -49,7 +47,7 @@ jobs:
run: |
ls -l
export MACOSX_DEPLOYMENT_TARGET=10.14
brew install autoconf automake gmp
brew install autoconf automake gmp pkg-config
- name: Build library using CMake
if: startsWith(matrix.builder, 'cmake')
Expand Down
33 changes: 26 additions & 7 deletions src/dashbls/.github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,34 @@ jobs:
python:
- major-dot-minor: '3.7'
cibw-build: 'cp37-*'
manylinux:
arch: manylinux2014
intel: manylinux2010
matrix: '3.7'
- major-dot-minor: '3.8'
cibw-build: 'cp38-*'
manylinux:
arch: manylinux2014
intel: manylinux2010
matrix: '3.8'
- major-dot-minor: '3.9'
cibw-build: 'cp39-*'
manylinux:
arch: manylinux2014
intel: manylinux2010
matrix: '3.9'
- major-dot-minor: '3.10'
cibw-build: 'cp310-*'
manylinux:
arch: manylinux2014
intel: manylinux2010
matrix: '3.10'
- major-dot-minor: '3.11'
cibw-build: 'cp311-*'
manylinux:
arch: manylinux2014
intel: manylinux2014
matrix: '3.11'
arch:
- name: ARM
matrix: arm
Expand Down Expand Up @@ -114,25 +132,24 @@ jobs:
- name: Install pipx
run: |
pip install pipx
- name: Build and test
uses: pypa/cibuildwheel@v2.7.0
with:
output-dir: dist
env:
CIBW_PRERELEASE_PYTHONS: True
CIBW_BUILD_VERBOSITY_MACOS: 0
CIBW_BUILD_VERBOSITY_LINUX: 0
CIBW_BUILD_VERBOSITY_WINDOWS: 0
CIBW_BUILD: ${{ matrix.python.cibw-build }}
CIBW_SKIP: '*-manylinux_i686 *-win32 *-musllinux_*'
CIBW_MANYLINUX_AARCH64_IMAGE: manylinux2014
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2010
CIBW_ENVIRONMENT_LINUX: "PATH=/project/cmake-3.17.3-Linux-`uname -m`/bin:$PATH"
CIBW_MANYLINUX_AARCH64_IMAGE: ${{ matrix.python.manylinux['arm'] }}
CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.python.manylinux['intel'] }}
CIBW_ENVIRONMENT_LINUX: "PATH=/project/cmake-3.14.3-Linux-`uname -m`/bin:$PATH"
CIBW_BEFORE_ALL_LINUX: >
yum -y install epel-release
&& echo "epel-release installed"
&& yum -y install lzip
&& echo "lzip installed"
&& curl -L https://github.com/Kitware/CMake/releases/download/v3.17.3/cmake-3.17.3-Linux-`uname -m`.sh > cmake.sh
&& curl -L https://github.com/Kitware/CMake/releases/download/v3.14.3/cmake-3.14.3-Linux-`uname -m`.sh > cmake.sh
&& yes | sh cmake.sh | cat
&& rm -f /usr/bin/cmake
&& curl -L https://gmplib.org/download/gmp/gmp-6.2.1.tar.lz | tar x --lzip
Expand Down Expand Up @@ -176,6 +193,8 @@ jobs:
&& cp {wheel} {dest_dir}
CIBW_TEST_REQUIRES: pytest
CIBW_TEST_COMMAND: py.test -v {project}/python-bindings/test.py
run:
pipx run --spec='cibuildwheel==2.9.0' cibuildwheel --output-dir dist 2>&1

- name: Upload artifacts
uses: actions/upload-artifact@v3
Expand Down
6 changes: 5 additions & 1 deletion src/dashbls/depends/catch2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ project(
LANGUAGES CXX
)


set(
${PROJECT_NAME}_HEADERS
catch2/catch.hpp
Expand All @@ -22,6 +21,11 @@ list(
add_library(
${PROJECT_NAME}
INTERFACE
)

target_sources(
${PROJECT_NAME}
INTERFACE
"${${PROJECT_NAME}_HEADERS}"
)

Expand Down
2 changes: 1 addition & 1 deletion src/dashbls/include/dashbls/bls.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class BLS {

static void SetSecureAllocator(Util::SecureAllocCallback allocCb, Util::SecureFreeCallback freeCb);

static void CheckRelicErrors();
static void CheckRelicErrors(bool should_throw = true);
};
} // end namespace bls

Expand Down
12 changes: 7 additions & 5 deletions src/dashbls/js-bindings/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,26 @@ include_directories(
file(GLOB_RECURSE WRAP_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/wrappers/*.h)
file(GLOB_RECURSE WRAP_SRC ${CMAKE_CURRENT_SOURCE_DIR}/wrappers/*.cpp)

add_executable(blsjs ${CMAKE_CURRENT_SOURCE_DIR}/jsbindings.cpp
add_executable(blsjstmp ${CMAKE_CURRENT_SOURCE_DIR}/jsbindings.cpp
${WRAP_HEADERS} ${WRAP_SRC} ${CMAKE_CURRENT_SOURCE_DIR}/helpers.h ${CMAKE_CURRENT_SOURCE_DIR}/helpers.cpp
)
add_custom_target(install_npm_dependencies npm ci)
add_dependencies(blsjs install_npm_dependencies)
target_link_libraries(blsjs PRIVATE dashbls)
add_dependencies(blsjstmp install_npm_dependencies)
target_link_libraries(blsjstmp PRIVATE dashbls)

# Copy necessary files for the npm package
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/package.json package.json COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/package-lock.json package-lock.json COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/blsjs.d.ts blsjs.d.ts COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/README.md README.md COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/bundle_wasm_for_web.js bundle_wasm_for_web.js COPYONLY)

# Copy test files
file(GLOB JS_BINDINGS_TESTS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/tests/ ${CMAKE_CURRENT_SOURCE_DIR}/tests/*.js ${CMAKE_CURRENT_SOURCE_DIR}/tests/*.ts)
file(GLOB JS_BINDINGS_TESTS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/tests/ ${CMAKE_CURRENT_SOURCE_DIR}/tests/*)
foreach(file ${JS_BINDINGS_TESTS})
message(FILE ${file})
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/tests/${file} tests/${file} COPYONLY)
endforeach()

set_target_properties(blsjs PROPERTIES LINK_FLAGS "--bind -Oz --closure 1 -s MODULARIZE=1")
set_target_properties(blsjstmp PROPERTIES LINK_FLAGS "--bind -Oz --closure 1 -s MODULARIZE=1 -s NODEJS_CATCH_EXIT=1 -s NODEJS_CATCH_REJECTION=1")
add_custom_command(TARGET blsjstmp POST_BUILD COMMAND npm run build:web)

0 comments on commit bfbd912

Please sign in to comment.