Merge remote-tracking branch 'ripple/develop' into develop

This commit is contained in:
Richard Holland
2022-02-18 13:43:00 +00:00
26 changed files with 431 additions and 233 deletions

View File

@@ -9,9 +9,21 @@ if (static)
set (Protobuf_USE_STATIC_LIBS ON) set (Protobuf_USE_STATIC_LIBS ON)
endif () endif ()
find_package (Protobuf 3.8) find_package (Protobuf 3.8)
if (local_protobuf OR NOT Protobuf_FOUND) if (is_multiconfig)
set(protobuf_protoc_lib ${Protobuf_PROTOC_LIBRARIES})
else ()
string(TOUPPER ${CMAKE_BUILD_TYPE} upper_cmake_build_type)
set(protobuf_protoc_lib ${Protobuf_PROTOC_LIBRARY_${upper_cmake_build_type}})
endif ()
if (local_protobuf OR NOT (Protobuf_FOUND AND Protobuf_PROTOC_EXECUTABLE AND protobuf_protoc_lib))
include (GNUInstallDirs) include (GNUInstallDirs)
message (STATUS "using local protobuf build.") message (STATUS "using local protobuf build.")
set(protobuf_reqs Protobuf_PROTOC_EXECUTABLE protobuf_protoc_lib)
foreach(lib ${protobuf_reqs})
if(NOT ${lib})
message(STATUS "Couldn't find ${lib}")
endif()
endforeach()
if (WIN32) if (WIN32)
# protobuf prepends lib even on windows # protobuf prepends lib even on windows
set (pbuf_lib_pre "lib") set (pbuf_lib_pre "lib")

View File

@@ -8,7 +8,7 @@ set_target_properties (rocksdb_lib
option (local_rocksdb "use local build of rocksdb." OFF) option (local_rocksdb "use local build of rocksdb." OFF)
if (NOT local_rocksdb) if (NOT local_rocksdb)
find_package (RocksDB 6.7 QUIET CONFIG) find_package (RocksDB 6.27 QUIET CONFIG)
if (TARGET RocksDB::rocksdb) if (TARGET RocksDB::rocksdb)
message (STATUS "Found RocksDB using config.") message (STATUS "Found RocksDB using config.")
get_target_property (_rockslib_l RocksDB::rocksdb IMPORTED_LOCATION_DEBUG) get_target_property (_rockslib_l RocksDB::rocksdb IMPORTED_LOCATION_DEBUG)
@@ -40,7 +40,7 @@ if (NOT local_rocksdb)
# TBD if there is some way to extract transitive deps..then: # TBD if there is some way to extract transitive deps..then:
#set (RocksDB_USE_STATIC ON) #set (RocksDB_USE_STATIC ON)
else () else ()
find_package (RocksDB 6.7 MODULE) find_package (RocksDB 6.27 MODULE)
if (ROCKSDB_FOUND) if (ROCKSDB_FOUND)
if (RocksDB_LIBRARY_DEBUG) if (RocksDB_LIBRARY_DEBUG)
set_target_properties (rocksdb_lib PROPERTIES IMPORTED_LOCATION_DEBUG ${RocksDB_LIBRARY_DEBUG}) set_target_properties (rocksdb_lib PROPERTIES IMPORTED_LOCATION_DEBUG ${RocksDB_LIBRARY_DEBUG})
@@ -60,7 +60,7 @@ if (local_rocksdb)
ExternalProject_Add (rocksdb ExternalProject_Add (rocksdb
PREFIX ${nih_cache_path} PREFIX ${nih_cache_path}
GIT_REPOSITORY https://github.com/facebook/rocksdb.git GIT_REPOSITORY https://github.com/facebook/rocksdb.git
GIT_TAG v6.7.3 GIT_TAG v6.27.3
PATCH_COMMAND PATCH_COMMAND
# only used by windows build # only used by windows build
${CMAKE_COMMAND} -E copy_if_different ${CMAKE_COMMAND} -E copy_if_different
@@ -96,9 +96,13 @@ if (local_rocksdb)
-Dlz4_FOUND=ON -Dlz4_FOUND=ON
-USNAPPY_* -USNAPPY_*
-Usnappy_* -Usnappy_*
-USnappy_*
-Dsnappy_INCLUDE_DIRS=$<JOIN:$<TARGET_PROPERTY:snappy_lib,INTERFACE_INCLUDE_DIRECTORIES>,::> -Dsnappy_INCLUDE_DIRS=$<JOIN:$<TARGET_PROPERTY:snappy_lib,INTERFACE_INCLUDE_DIRECTORIES>,::>
-Dsnappy_LIBRARIES=$<IF:$<CONFIG:Debug>,$<TARGET_PROPERTY:snappy_lib,IMPORTED_LOCATION_DEBUG>,$<TARGET_PROPERTY:snappy_lib,IMPORTED_LOCATION_RELEASE>> -Dsnappy_LIBRARIES=$<IF:$<CONFIG:Debug>,$<TARGET_PROPERTY:snappy_lib,IMPORTED_LOCATION_DEBUG>,$<TARGET_PROPERTY:snappy_lib,IMPORTED_LOCATION_RELEASE>>
-Dsnappy_FOUND=ON -Dsnappy_FOUND=ON
-DSnappy_INCLUDE_DIRS=$<JOIN:$<TARGET_PROPERTY:snappy_lib,INTERFACE_INCLUDE_DIRECTORIES>,::>
-DSnappy_LIBRARIES=$<IF:$<CONFIG:Debug>,$<TARGET_PROPERTY:snappy_lib,IMPORTED_LOCATION_DEBUG>,$<TARGET_PROPERTY:snappy_lib,IMPORTED_LOCATION_RELEASE>>
-DSnappy_FOUND=ON
-DWITH_MD_LIBRARY=OFF -DWITH_MD_LIBRARY=OFF
-DWITH_RUNTIME_DEBUG=$<IF:$<CONFIG:Debug>,ON,OFF> -DWITH_RUNTIME_DEBUG=$<IF:$<CONFIG:Debug>,ON,OFF>
-DFAIL_ON_WARNINGS=OFF -DFAIL_ON_WARNINGS=OFF

View File

@@ -1,4 +1,71 @@
#include "build_version.h" // Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
const char* rocksdb_build_git_sha = "rocksdb_build_git_sha: N/A";
const char* rocksdb_build_git_date = "rocksdb_build_git_date: N/A"; #include <memory>
const char* rocksdb_build_compile_date = "N/A";
#include "rocksdb/version.h"
#include "util/string_util.h"
// The build script may replace these values with real values based
// on whether or not GIT is available and the platform settings
static const std::string rocksdb_build_git_sha = "rocksdb_build_git_sha:@GIT_SHA@";
static const std::string rocksdb_build_git_tag = "rocksdb_build_git_tag:@GIT_TAG@";
#define HAS_GIT_CHANGES @GIT_MOD@
#if HAS_GIT_CHANGES == 0
// If HAS_GIT_CHANGES is 0, the GIT date is used.
// Use the time the branch/tag was last modified
static const std::string rocksdb_build_date = "rocksdb_build_date:@GIT_DATE@";
#else
// If HAS_GIT_CHANGES is > 0, the branch/tag has modifications.
// Use the time the build was created.
static const std::string rocksdb_build_date = "rocksdb_build_date:@BUILD_DATE@";
#endif
namespace ROCKSDB_NAMESPACE {
static void AddProperty(std::unordered_map<std::string, std::string> *props, const std::string& name) {
size_t colon = name.find(":");
if (colon != std::string::npos && colon > 0 && colon < name.length() - 1) {
// If we found a "@:", then this property was a build-time substitution that failed. Skip it
size_t at = name.find("@", colon);
if (at != colon + 1) {
// Everything before the colon is the name, after is the value
(*props)[name.substr(0, colon)] = name.substr(colon + 1);
}
}
}
static std::unordered_map<std::string, std::string>* LoadPropertiesSet() {
auto * properties = new std::unordered_map<std::string, std::string>();
AddProperty(properties, rocksdb_build_git_sha);
AddProperty(properties, rocksdb_build_git_tag);
AddProperty(properties, rocksdb_build_date);
return properties;
}
const std::unordered_map<std::string, std::string>& GetRocksBuildProperties() {
static std::unique_ptr<std::unordered_map<std::string, std::string>> props(LoadPropertiesSet());
return *props;
}
std::string GetRocksVersionAsString(bool with_patch) {
std::string version = ToString(ROCKSDB_MAJOR) + "." + ToString(ROCKSDB_MINOR);
if (with_patch) {
return version + "." + ToString(ROCKSDB_PATCH);
} else {
return version;
}
}
std::string GetRocksBuildInfoAsString(const std::string& program, bool verbose) {
std::string info = program + " (RocksDB) " + GetRocksVersionAsString(true);
if (verbose) {
for (const auto& it : GetRocksBuildProperties()) {
info.append("\n ");
info.append(it.first);
info.append(": ");
info.append(it.second);
}
}
return info;
}
} // namespace ROCKSDB_NAMESPACE

View File

@@ -184,44 +184,36 @@ centos_7_smoketest:
name: artifactory.ops.ripple.com/centos:7 name: artifactory.ops.ripple.com/centos:7
<<: *run_local_smoketest <<: *run_local_smoketest
fedora_29_smoketest: # TODO: Remove "allow_failure" when tests fixed
rocky_8_smoketest:
stage: smoketest stage: smoketest
dependencies: dependencies:
- rpm_build - rpm_build
- rpm_sign - rpm_sign
image: image:
name: artifactory.ops.ripple.com/fedora:29 name: rockylinux/rockylinux:8
<<: *run_local_smoketest <<: *run_local_smoketest
allow_failure: true
fedora_28_smoketest: fedora_34_smoketest:
stage: smoketest stage: smoketest
dependencies: dependencies:
- rpm_build - rpm_build
- rpm_sign - rpm_sign
image: image:
name: artifactory.ops.ripple.com/fedora:28 name: artifactory.ops.ripple.com/fedora:34
<<: *run_local_smoketest <<: *run_local_smoketest
allow_failure: true
fedora_27_smoketest: fedora_35_smoketest:
stage: smoketest stage: smoketest
dependencies: dependencies:
- rpm_build - rpm_build
- rpm_sign - rpm_sign
image: image:
name: artifactory.ops.ripple.com/fedora:27 name: artifactory.ops.ripple.com/fedora:35
<<: *run_local_smoketest
## this one is not LTS, but we
## get some extra coverage by including it
## consider dropping it when 20.04 is ready
ubuntu_20_smoketest:
stage: smoketest
dependencies:
- dpkg_build
- dpkg_sign
image:
name: artifactory.ops.ripple.com/ubuntu:20.04
<<: *run_local_smoketest <<: *run_local_smoketest
allow_failure: true
ubuntu_18_smoketest: ubuntu_18_smoketest:
stage: smoketest stage: smoketest
@@ -232,15 +224,26 @@ ubuntu_18_smoketest:
name: artifactory.ops.ripple.com/ubuntu:18.04 name: artifactory.ops.ripple.com/ubuntu:18.04
<<: *run_local_smoketest <<: *run_local_smoketest
ubuntu_16_smoketest: ubuntu_20_smoketest:
stage: smoketest stage: smoketest
dependencies: dependencies:
- dpkg_build - dpkg_build
- dpkg_sign - dpkg_sign
image: image:
name: artifactory.ops.ripple.com/ubuntu:16.04 name: artifactory.ops.ripple.com/ubuntu:20.04
<<: *run_local_smoketest <<: *run_local_smoketest
# TODO: remove "allow_failure" when 22.04 released in 4/2022...
ubuntu_22_smoketest:
stage: smoketest
dependencies:
- dpkg_build
- dpkg_sign
image:
name: artifactory.ops.ripple.com/ubuntu:22.04
<<: *run_local_smoketest
allow_failure: true
debian_9_smoketest: debian_9_smoketest:
stage: smoketest stage: smoketest
dependencies: dependencies:
@@ -250,6 +253,24 @@ debian_9_smoketest:
name: artifactory.ops.ripple.com/debian:9 name: artifactory.ops.ripple.com/debian:9
<<: *run_local_smoketest <<: *run_local_smoketest
debian_10_smoketest:
stage: smoketest
dependencies:
- dpkg_build
- dpkg_sign
image:
name: artifactory.ops.ripple.com/debian:10
<<: *run_local_smoketest
debian_11_smoketest:
stage: smoketest
dependencies:
- dpkg_build
- dpkg_sign
image:
name: artifactory.ops.ripple.com/debian:11
<<: *run_local_smoketest
######################################################################### #########################################################################
## ## ## ##
## stage: verify_sig ## ## stage: verify_sig ##
@@ -346,38 +367,53 @@ centos_7_verify_repo_test:
<<: *only_primary <<: *only_primary
<<: *run_repo_smoketest <<: *run_repo_smoketest
fedora_29_verify_repo_test: rocky_8_verify_repo_test:
stage: verify_from_test stage: verify_from_test
variables: variables:
RPM_REPO: "rippled-rpm-test-mirror" RPM_REPO: "rippled-rpm-test-mirror"
image: image:
name: artifactory.ops.ripple.com/fedora:29 name: rockylinux/rockylinux:8
dependencies: dependencies:
- rpm_sign - rpm_sign
<<: *only_primary <<: *only_primary
<<: *run_repo_smoketest <<: *run_repo_smoketest
allow_failure: true
fedora_28_verify_repo_test: fedora_34_verify_repo_test:
stage: verify_from_test stage: verify_from_test
variables: variables:
RPM_REPO: "rippled-rpm-test-mirror" RPM_REPO: "rippled-rpm-test-mirror"
image: image:
name: artifactory.ops.ripple.com/fedora:28 name: artifactory.ops.ripple.com/fedora:34
dependencies: dependencies:
- rpm_sign - rpm_sign
<<: *only_primary <<: *only_primary
<<: *run_repo_smoketest <<: *run_repo_smoketest
allow_failure: true
fedora_27_verify_repo_test: fedora_35_verify_repo_test:
stage: verify_from_test stage: verify_from_test
variables: variables:
RPM_REPO: "rippled-rpm-test-mirror" RPM_REPO: "rippled-rpm-test-mirror"
image: image:
name: artifactory.ops.ripple.com/fedora:27 name: artifactory.ops.ripple.com/fedora:35
dependencies: dependencies:
- rpm_sign - rpm_sign
<<: *only_primary <<: *only_primary
<<: *run_repo_smoketest <<: *run_repo_smoketest
allow_failure: true
ubuntu_18_verify_repo_test:
stage: verify_from_test
variables:
DISTRO: "bionic"
DEB_REPO: "rippled-deb-test-mirror"
image:
name: artifactory.ops.ripple.com/ubuntu:18.04
dependencies:
- dpkg_sign
<<: *only_primary
<<: *run_repo_smoketest
ubuntu_20_verify_repo_test: ubuntu_20_verify_repo_test:
stage: verify_from_test stage: verify_from_test
@@ -391,29 +427,19 @@ ubuntu_20_verify_repo_test:
<<: *only_primary <<: *only_primary
<<: *run_repo_smoketest <<: *run_repo_smoketest
ubuntu_18_verify_repo_test: # TODO: remove "allow_failure" when 22.04 released in 4/2022...
ubuntu_22_verify_repo_test:
stage: verify_from_test stage: verify_from_test
variables: variables:
DISTRO: "bionic" DISTRO: "jammy"
DEB_REPO: "rippled-deb-test-mirror" DEB_REPO: "rippled-deb-test-mirror"
image: image:
name: artifactory.ops.ripple.com/ubuntu:18.04 name: artifactory.ops.ripple.com/ubuntu:22.04
dependencies:
- dpkg_sign
<<: *only_primary
<<: *run_repo_smoketest
ubuntu_16_verify_repo_test:
stage: verify_from_test
variables:
DISTRO: "xenial"
DEB_REPO: "rippled-deb-test-mirror"
image:
name: artifactory.ops.ripple.com/ubuntu:16.04
dependencies: dependencies:
- dpkg_sign - dpkg_sign
<<: *only_primary <<: *only_primary
<<: *run_repo_smoketest <<: *run_repo_smoketest
allow_failure: true
debian_9_verify_repo_test: debian_9_verify_repo_test:
stage: verify_from_test stage: verify_from_test
@@ -427,6 +453,30 @@ debian_9_verify_repo_test:
<<: *only_primary <<: *only_primary
<<: *run_repo_smoketest <<: *run_repo_smoketest
debian_10_verify_repo_test:
stage: verify_from_test
variables:
DISTRO: "buster"
DEB_REPO: "rippled-deb-test-mirror"
image:
name: artifactory.ops.ripple.com/debian:10
dependencies:
- dpkg_sign
<<: *only_primary
<<: *run_repo_smoketest
debian_11_verify_repo_test:
stage: verify_from_test
variables:
DISTRO: "bullseye"
DEB_REPO: "rippled-deb-test-mirror"
image:
name: artifactory.ops.ripple.com/debian:11
dependencies:
- dpkg_sign
<<: *only_primary
<<: *run_repo_smoketest
######################################################################### #########################################################################
## ## ## ##
## stage: wait_approval_prod ## ## stage: wait_approval_prod ##
@@ -492,38 +542,53 @@ centos_7_verify_repo_prod:
<<: *only_primary <<: *only_primary
<<: *run_repo_smoketest <<: *run_repo_smoketest
fedora_29_verify_repo_prod: rocky_8_verify_repo_test:
stage: verify_from_prod stage: verify_from_test
variables: variables:
RPM_REPO: "rippled-rpm" RPM_REPO: "rippled-rpm-test-mirror"
image: image:
name: artifactory.ops.ripple.com/fedora:29 name: rockylinux/rockylinux:8
dependencies: dependencies:
- rpm_sign - rpm_sign
<<: *only_primary <<: *only_primary
<<: *run_repo_smoketest <<: *run_repo_smoketest
allow_failure: true
fedora_28_verify_repo_prod: fedora_34_verify_repo_prod:
stage: verify_from_prod stage: verify_from_prod
variables: variables:
RPM_REPO: "rippled-rpm" RPM_REPO: "rippled-rpm"
image: image:
name: artifactory.ops.ripple.com/fedora:28 name: artifactory.ops.ripple.com/fedora:34
dependencies: dependencies:
- rpm_sign - rpm_sign
<<: *only_primary <<: *only_primary
<<: *run_repo_smoketest <<: *run_repo_smoketest
allow_failure: true
fedora_27_verify_repo_prod: fedora_35_verify_repo_prod:
stage: verify_from_prod stage: verify_from_prod
variables: variables:
RPM_REPO: "rippled-rpm" RPM_REPO: "rippled-rpm"
image: image:
name: artifactory.ops.ripple.com/fedora:27 name: artifactory.ops.ripple.com/fedora:35
dependencies: dependencies:
- rpm_sign - rpm_sign
<<: *only_primary <<: *only_primary
<<: *run_repo_smoketest <<: *run_repo_smoketest
allow_failure: true
ubuntu_18_verify_repo_prod:
stage: verify_from_prod
variables:
DISTRO: "bionic"
DEB_REPO: "rippled-deb"
image:
name: artifactory.ops.ripple.com/ubuntu:18.04
dependencies:
- dpkg_sign
<<: *only_primary
<<: *run_repo_smoketest
ubuntu_20_verify_repo_prod: ubuntu_20_verify_repo_prod:
stage: verify_from_prod stage: verify_from_prod
@@ -537,29 +602,19 @@ ubuntu_20_verify_repo_prod:
<<: *only_primary <<: *only_primary
<<: *run_repo_smoketest <<: *run_repo_smoketest
ubuntu_18_verify_repo_prod: # TODO: remove "allow_failure" when 22.04 released in 4/2022...
ubuntu_22_verify_repo_prod:
stage: verify_from_prod stage: verify_from_prod
variables: variables:
DISTRO: "bionic" DISTRO: "jammy"
DEB_REPO: "rippled-deb" DEB_REPO: "rippled-deb"
image: image:
name: artifactory.ops.ripple.com/ubuntu:18.04 name: artifactory.ops.ripple.com/ubuntu:22.04
dependencies:
- dpkg_sign
<<: *only_primary
<<: *run_repo_smoketest
ubuntu_16_verify_repo_prod:
stage: verify_from_prod
variables:
DISTRO: "xenial"
DEB_REPO: "rippled-deb"
image:
name: artifactory.ops.ripple.com/ubuntu:16.04
dependencies: dependencies:
- dpkg_sign - dpkg_sign
<<: *only_primary <<: *only_primary
<<: *run_repo_smoketest <<: *run_repo_smoketest
allow_failure: true
debian_9_verify_repo_prod: debian_9_verify_repo_prod:
stage: verify_from_prod stage: verify_from_prod
@@ -573,6 +628,30 @@ debian_9_verify_repo_prod:
<<: *only_primary <<: *only_primary
<<: *run_repo_smoketest <<: *run_repo_smoketest
debian_10_verify_repo_prod:
stage: verify_from_prod
variables:
DISTRO: "buster"
DEB_REPO: "rippled-deb"
image:
name: artifactory.ops.ripple.com/debian:10
dependencies:
- dpkg_sign
<<: *only_primary
<<: *run_repo_smoketest
debian_11_verify_repo_prod:
stage: verify_from_prod
variables:
DISTRO: "bullseye"
DEB_REPO: "rippled-deb"
image:
name: artifactory.ops.ripple.com/debian:11
dependencies:
- dpkg_sign
<<: *only_primary
<<: *run_repo_smoketest
######################################################################### #########################################################################
## ## ## ##
## stage: get_final_hashes ## ## stage: get_final_hashes ##
@@ -622,5 +701,3 @@ build_ubuntu_container:
script: script:
- . ./Builds/containers/gitlab-ci/build_container.sh dpkg - . ./Builds/containers/gitlab-ci/build_container.sh dpkg
allow_failure: true allow_failure: true

View File

@@ -19,7 +19,7 @@ RIPPLED_DBG_PKG=$(ls rippled-dbgsym_*.deb)
# TODO - where to upload src tgz? # TODO - where to upload src tgz?
RIPPLED_SRC=$(ls rippled_*.orig.tar.gz) RIPPLED_SRC=$(ls rippled_*.orig.tar.gz)
DEB_MATRIX=";deb.component=${COMPONENT};deb.architecture=amd64" DEB_MATRIX=";deb.component=${COMPONENT};deb.architecture=amd64"
for dist in stretch buster xenial bionic disco focal ; do for dist in stretch buster bullseye bionic focal jammy; do
DEB_MATRIX="${DEB_MATRIX};deb.distribution=${dist}" DEB_MATRIX="${DEB_MATRIX};deb.distribution=${dist}"
done done
echo "{ \"debs\": {" > "${TOPDIR}/files.info" echo "{ \"debs\": {" > "${TOPDIR}/files.info"
@@ -88,4 +88,3 @@ JSON
) )
curl ${SLACK_NOTIFY_URL} --data-urlencode "${CONTENT}" curl ${SLACK_NOTIFY_URL} --data-urlencode "${CONTENT}"
fi fi

View File

@@ -16,7 +16,7 @@ case ${ID} in
ubuntu|debian) ubuntu|debian)
pkgtype="dpkg" pkgtype="dpkg"
;; ;;
fedora|centos|rhel|scientific) fedora|centos|rhel|scientific|rocky)
pkgtype="rpm" pkgtype="rpm"
;; ;;
*) *)
@@ -51,7 +51,7 @@ if [ "${pkgtype}" = "dpkg" ] ; then
elif [ "${install_from}" = "local" ] ; then elif [ "${install_from}" = "local" ] ; then
# cached pkg install # cached pkg install
updateWithRetry updateWithRetry
apt-get -y install libprotobuf-dev libssl-dev apt-get -y install libprotobuf-dev libprotoc-dev protobuf-compiler libssl-dev
rm -f build/dpkg/packages/rippled-dbgsym*.* rm -f build/dpkg/packages/rippled-dbgsym*.*
dpkg --no-debsig -i build/dpkg/packages/*.deb dpkg --no-debsig -i build/dpkg/packages/*.deb
else else
@@ -76,7 +76,12 @@ else
yum -y install ${rpm_version_release} yum -y install ${rpm_version_release}
elif [ "${install_from}" = "local" ] ; then elif [ "${install_from}" = "local" ] ; then
# cached pkg install # cached pkg install
yum install -y yum-utils openssl-static zlib-static pkgs=("yum-utils openssl-static zlib-static")
if [ "$ID" = "rocky" ]; then
sed -i 's/enabled=0/enabled=1/g' /etc/yum.repos.d/Rocky-PowerTools.repo
pkgs="${pkgs[@]/openssl-static}"
fi
yum install -y $pkgs
rm -f build/rpm/packages/rippled-debug*.rpm rm -f build/rpm/packages/rippled-debug*.rpm
rm -f build/rpm/packages/*.src.rpm rm -f build/rpm/packages/*.src.rpm
rpm -i build/rpm/packages/*.rpm rpm -i build/rpm/packages/*.rpm
@@ -95,5 +100,3 @@ fi
# run unit tests # run unit tests
/opt/ripple/bin/rippled --unittest --unittest-jobs $(nproc) /opt/ripple/bin/rippled --unittest --unittest-jobs $(nproc)
/opt/ripple/bin/validator-keys --unittest /opt/ripple/bin/validator-keys --unittest

View File

@@ -17,5 +17,5 @@ Section: devel
Recommends: rippled (= ${binary:Version}) Recommends: rippled (= ${binary:Version})
Architecture: any Architecture: any
Multi-Arch: same Multi-Arch: same
Depends: ${misc:Depends}, ${shlibs:Depends}, libprotobuf-dev, libssl-dev Depends: ${misc:Depends}, ${shlibs:Depends}, libprotobuf-dev, libprotoc-dev, protobuf-compiler
Description: development files for applications using xrpl core library (serialize + sign) Description: development files for applications using xrpl core library (serialize + sign)

View File

@@ -20,7 +20,7 @@ rippled
%package devel %package devel
Summary: Files for development of applications using xrpl core library Summary: Files for development of applications using xrpl core library
Group: Development/Libraries Group: Development/Libraries
Requires: openssl-static, zlib-static Requires: zlib-static
%description devel %description devel
core library for development of standalone applications that sign transactions. core library for development of standalone applications that sign transactions.

View File

@@ -19,7 +19,7 @@ Use `apt-get` to install the dependencies provided by the distribution
``` ```
$ apt-get update $ apt-get update
$ apt-get install -y gcc g++ wget git cmake pkg-config protobuf-compiler libprotobuf-dev libssl-dev $ apt-get install -y gcc g++ wget git cmake pkg-config libprotoc-dev protobuf-compiler libprotobuf-dev libssl-dev
``` ```
To build the software in reporting mode, install these additional dependencies: To build the software in reporting mode, install these additional dependencies:

View File

@@ -12,9 +12,12 @@ set(Boost_NO_BOOST_CMAKE ON)
find_package(Git) find_package(Git)
if(Git_FOUND) if(Git_FOUND)
execute_process(COMMAND ${GIT_EXECUTABLE} describe --always --abbrev=40 execute_process(COMMAND ${GIT_EXECUTABLE} describe --always --abbrev=40
OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE GIT_COMMIT_HASH) OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE gch)
message(STATUS gch: ${GIT_COMMIT_HASH}) if(gch)
add_definitions(-DGIT_COMMIT_HASH="${GIT_COMMIT_HASH}") set(GIT_COMMIT_HASH "${gch}")
message(STATUS gch: ${GIT_COMMIT_HASH})
add_definitions(-DGIT_COMMIT_HASH="${GIT_COMMIT_HASH}")
endif()
endif() #git endif() #git
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/Builds/CMake") list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/Builds/CMake")

View File

@@ -190,3 +190,4 @@ git-subtree. See those directories' README files for more details.
* [XRP Ledger Dev Portal](https://xrpl.org/) * [XRP Ledger Dev Portal](https://xrpl.org/)
* [Setup and Installation](https://xrpl.org/install-rippled.html) * [Setup and Installation](https://xrpl.org/install-rippled.html)
* [Source Documentation (Doxygen)](https://ripple.github.io/rippled) * [Source Documentation (Doxygen)](https://ripple.github.io/rippled)
* [Learn more about the XRP Ledger (YouTube)](https://www.youtube.com/playlist?list=PLJQ55Tj1hIVZtJ_JdTvSum2qMTsedWkNi)

View File

@@ -13,13 +13,36 @@ Have new ideas? Need help with setting up your node? Come visit us [here](https:
# Releases # Releases
## Version 1.8.5
This is the 1.8.5 release of `rippled`, the reference implementation of the XRP Ledger protocol. This release includes fixes and updates for stability and security, and improvements to build scripts. There are no user-facing API or protocol changes in this release.
### Bug Fixes
This release contains the following bug fixes and under-the-hood improvements:
- **Correct TaggedPointer move constructor:** Fixes a bug in unused code for the TaggedPointer class. The old code would fail if a caller explicitly tried to remove a child that is not actually part of the node. (227a12d)
- **Ensure protocol buffer prerequisites are present:** The build scripts and packages now properly handle Protobuf packages and various packages. Prior to this change, building on Ubuntu 21.10 Impish Indri would fail unless the `libprotoc-dev` package was installed. (e06465f)
- **Improve handling of endpoints during peer discovery.** This hardens and improves handling of incoming messages on the peer protocol. (289bc0a)
- **Run tests on updated linux distros:** Test builds now run on Rocky Linux 8, Fedora 34 and 35, Ubuntu 18, 20, and 22, and Debian 9, 10, and 11. (a9ee802)
- **Avoid dereferencing empty optional in ReportingETL:** Fixes a bug in Reporting Mode that could dereference an empty optional value when throwing an error. (cdc215d)
- **Correctly add GIT_COMMIT_HASH into version string:** When building the server from a non-tagged release, the build files now add the commit ID in a way that follows the semantic-versioning standard, and correctly handle the case where the commit hash ID cannot be retrieved. (d23d37f)
- **Update RocksDB to version 6.27.3:** Updates the version of RocksDB included in the server from 6.7.3 (which was released on 2020-03-18) to 6.27.3 (released 2021-12-10).
## Version 1.8.4 ## Version 1.8.4
This is the 1.8.4 release of `rippled`, the reference implementation of the XRP Ledger protocol. This is the 1.8.4 release of `rippled`, the reference implementation of the XRP Ledger protocol.
This release corrects a technical flaw introduced with 1.8.3 that may result in failures if the newly-introduced 'fast loading' is enabled. The release also adjusts default parameters used to configure the pathfinding engine to reduce resource usage. This release corrects a technical flaw introduced with 1.8.3 that may result in failures if the newly-introduced 'fast loading' is enabled. The release also adjusts default parameters used to configure the pathfinding engine to reduce resource usage.
### Bug Fixes ### Bug Fixes
- **Adjust mutex scope in `walkMapParallel`**: This commit corrects a technical flaw introduced with commit 7c12f0135897361398917ad2c8cda888249d42ae that would result in undefined behavior if the server operator configured their server to use the 'fast loading' mechanism introduced with 1.8.3. - **Adjust mutex scope in `walkMapParallel`**: This commit corrects a technical flaw introduced with commit [7c12f0135897361398917ad2c8cda888249d42ae] that would result in undefined behavior if the server operator configured their server to use the 'fast loading' mechanism introduced with 1.8.3.
- **Adjust pathfinding configuration defaults**: This commit adjusts the default configuration of the pathfinding engine, to account for the size of the XRP Ledger mainnet. Unless explicitly overriden, the changes mean that pathfinding operations will return fewer, shallower paths than previous releases. - **Adjust pathfinding configuration defaults**: This commit adjusts the default configuration of the pathfinding engine, to account for the size of the XRP Ledger mainnet. Unless explicitly overriden, the changes mean that pathfinding operations will return fewer, shallower paths than previous releases.

View File

@@ -929,10 +929,14 @@ ReportingETL::ReportingETL(Application& app)
{ {
auto const optStartSeq = section.get("start_sequence"); auto const optStartSeq = section.get("start_sequence");
if (optStartSeq) if (optStartSeq)
{
// set a value so we can dereference
startSequence_ = 0;
asciiToIntThrows( asciiToIntThrows(
*startSequence_, *startSequence_,
*optStartSeq, *optStartSeq,
"Expected integral start_sequence config entry. Got: "); "Expected integral start_sequence config entry. Got: ");
}
} }
auto const optFlushInterval = section.get("flush_interval"); auto const optFlushInterval = section.get("flush_interval");

View File

@@ -34,11 +34,14 @@ Endpoint::Endpoint(Address const& addr, Port port) : m_addr(addr), m_port(port)
std::optional<Endpoint> std::optional<Endpoint>
Endpoint::from_string_checked(std::string const& s) Endpoint::from_string_checked(std::string const& s)
{ {
std::stringstream is(boost::trim_copy(s)); if (s.size() <= 64)
Endpoint endpoint; {
is >> endpoint; std::stringstream is(boost::trim_copy(s));
if (!is.fail() && is.rdbuf()->in_avail() == 0) Endpoint endpoint;
return endpoint; is >> endpoint;
if (!is.fail() && is.rdbuf()->in_avail() == 0)
return endpoint;
}
return {}; return {};
} }

View File

@@ -1480,16 +1480,26 @@ PeerImp::onMessage(std::shared_ptr<protocol::TMEndpoints> const& m)
if (tracking_.load() != Tracking::converged || m->version() != 2) if (tracking_.load() != Tracking::converged || m->version() != 2)
return; return;
// The number is arbitrary and doesn't have any real significance or
// implication for the protocol.
if (m->endpoints_v2().size() >= 1024)
{
charge(Resource::feeBadData);
return;
}
std::vector<PeerFinder::Endpoint> endpoints; std::vector<PeerFinder::Endpoint> endpoints;
endpoints.reserve(m->endpoints_v2().size()); endpoints.reserve(m->endpoints_v2().size());
for (auto const& tm : m->endpoints_v2()) for (auto const& tm : m->endpoints_v2())
{ {
auto result = beast::IP::Endpoint::from_string_checked(tm.endpoint()); auto result = beast::IP::Endpoint::from_string_checked(tm.endpoint());
if (!result) if (!result)
{ {
JLOG(p_journal_.error()) << "failed to parse incoming endpoint: {" JLOG(p_journal_.error()) << "failed to parse incoming endpoint: {"
<< tm.endpoint() << "}"; << tm.endpoint() << "}";
charge(Resource::feeBadData);
continue; continue;
} }
@@ -1499,10 +1509,10 @@ PeerImp::onMessage(std::shared_ptr<protocol::TMEndpoints> const& m)
// time, then we'll verify that their listener can receive incoming // time, then we'll verify that their listener can receive incoming
// by performing a connectivity test. if hops > 0, then we just // by performing a connectivity test. if hops > 0, then we just
// take the address/port we were given // take the address/port we were given
if (tm.hops() == 0)
result = remote_address_.at_port(result->port());
endpoints.emplace_back( endpoints.emplace_back(*result, tm.hops());
tm.hops() > 0 ? *result : remote_address_.at_port(result->port()),
tm.hops());
} }
if (!endpoints.empty()) if (!endpoints.empty())

View File

@@ -112,16 +112,19 @@ struct Config
/** Describes a connectible peer address along with some metadata. */ /** Describes a connectible peer address along with some metadata. */
struct Endpoint struct Endpoint
{ {
Endpoint(); Endpoint() = default;
Endpoint(beast::IP::Endpoint const& ep, int hops_); Endpoint(beast::IP::Endpoint const& ep, std::uint32_t hops_);
int hops; std::uint32_t hops = 0;
beast::IP::Endpoint address; beast::IP::Endpoint address;
}; };
bool inline bool
operator<(Endpoint const& lhs, Endpoint const& rhs); operator<(Endpoint const& lhs, Endpoint const& rhs)
{
return lhs.address < rhs.address;
}
/** A set of Endpoint used for connecting. */ /** A set of Endpoint used for connecting. */
using Endpoints = std::vector<Endpoint>; using Endpoints = std::vector<Endpoint>;

View File

@@ -18,24 +18,15 @@
//============================================================================== //==============================================================================
#include <ripple/peerfinder/PeerfinderManager.h> #include <ripple/peerfinder/PeerfinderManager.h>
#include <ripple/peerfinder/impl/Tuning.h>
namespace ripple { namespace ripple {
namespace PeerFinder { namespace PeerFinder {
Endpoint::Endpoint() : hops(0) Endpoint::Endpoint(beast::IP::Endpoint const& ep, std::uint32_t hops_)
: hops(std::min(hops_, Tuning::maxHops + 1)), address(ep)
{ {
} }
Endpoint::Endpoint(beast::IP::Endpoint const& ep, int hops_)
: hops(hops_), address(ep)
{
}
bool
operator<(Endpoint const& lhs, Endpoint const& rhs)
{
return lhs.address < rhs.address;
}
} // namespace PeerFinder } // namespace PeerFinder
} // namespace ripple } // namespace ripple

View File

@@ -363,7 +363,7 @@ public:
// Reinsert e at a new hops // Reinsert e at a new hops
void void
reinsert(Element& e, int hops); reinsert(Element& e, std::uint32_t hops);
void void
remove(Element& e); remove(Element& e);
@@ -444,8 +444,7 @@ Livecache<Allocator>::insert(Endpoint const& ep)
// when redirecting. // when redirecting.
// //
assert(ep.hops <= (Tuning::maxHops + 1)); assert(ep.hops <= (Tuning::maxHops + 1));
std::pair<typename cache_type::iterator, bool> result( auto result = m_cache.emplace(ep.address, ep);
m_cache.emplace(ep.address, ep));
Element& e(result.first->second); Element& e(result.first->second);
if (result.second) if (result.second)
{ {
@@ -522,12 +521,14 @@ template <class Allocator>
std::string std::string
Livecache<Allocator>::hops_t::histogram() const Livecache<Allocator>::hops_t::histogram() const
{ {
std::stringstream ss; std::string s;
for (typename decltype(m_hist)::size_type i(0); i < m_hist.size(); ++i) for (auto const& h : m_hist)
{ {
ss << m_hist[i] << ((i < Tuning::maxHops + 1) ? ", " : ""); if (!s.empty())
s += ", ";
s += std::to_string(h);
} }
return ss.str(); return s;
} }
template <class Allocator> template <class Allocator>
@@ -540,7 +541,7 @@ template <class Allocator>
void void
Livecache<Allocator>::hops_t::insert(Element& e) Livecache<Allocator>::hops_t::insert(Element& e)
{ {
assert(e.endpoint.hops >= 0 && e.endpoint.hops <= Tuning::maxHops + 1); assert(e.endpoint.hops <= Tuning::maxHops + 1);
// This has security implications without a shuffle // This has security implications without a shuffle
m_lists[e.endpoint.hops].push_front(e); m_lists[e.endpoint.hops].push_front(e);
++m_hist[e.endpoint.hops]; ++m_hist[e.endpoint.hops];
@@ -548,11 +549,13 @@ Livecache<Allocator>::hops_t::insert(Element& e)
template <class Allocator> template <class Allocator>
void void
Livecache<Allocator>::hops_t::reinsert(Element& e, int numHops) Livecache<Allocator>::hops_t::reinsert(Element& e, std::uint32_t numHops)
{ {
assert(numHops >= 0 && numHops <= Tuning::maxHops + 1); assert(numHops <= Tuning::maxHops + 1);
list_type& list(m_lists[e.endpoint.hops]);
auto& list = m_lists[e.endpoint.hops];
list.erase(list.iterator_to(e)); list.erase(list.iterator_to(e));
--m_hist[e.endpoint.hops]; --m_hist[e.endpoint.hops];
e.endpoint.hops = numHops; e.endpoint.hops = numHops;
@@ -564,7 +567,8 @@ void
Livecache<Allocator>::hops_t::remove(Element& e) Livecache<Allocator>::hops_t::remove(Element& e)
{ {
--m_hist[e.endpoint.hops]; --m_hist[e.endpoint.hops];
list_type& list(m_lists[e.endpoint.hops]);
auto& list = m_lists[e.endpoint.hops];
list.erase(list.iterator_to(e)); list.erase(list.iterator_to(e));
} }

View File

@@ -762,6 +762,13 @@ public:
void void
on_endpoints(SlotImp::ptr const& slot, Endpoints list) on_endpoints(SlotImp::ptr const& slot, Endpoints list)
{ {
// If we're sent too many endpoints, sample them at random:
if (list.size() > Tuning::numberOfEndpointsMax)
{
std::shuffle(list.begin(), list.end(), default_prng());
list.resize(Tuning::numberOfEndpointsMax);
}
JLOG(m_journal.trace()) JLOG(m_journal.trace())
<< beast::leftw(18) << "Endpoints from " << slot->remote_endpoint() << beast::leftw(18) << "Endpoints from " << slot->remote_endpoint()
<< " contained " << list.size() << " contained " << list.size()

View File

@@ -102,7 +102,7 @@ SlotImp::recent_t::recent_t(clock_type& clock) : cache(clock)
} }
void void
SlotImp::recent_t::insert(beast::IP::Endpoint const& ep, int hops) SlotImp::recent_t::insert(beast::IP::Endpoint const& ep, std::uint32_t hops)
{ {
auto const result(cache.emplace(ep, hops)); auto const result(cache.emplace(ep, hops));
if (!result.second) if (!result.second)
@@ -117,7 +117,7 @@ SlotImp::recent_t::insert(beast::IP::Endpoint const& ep, int hops)
} }
bool bool
SlotImp::recent_t::filter(beast::IP::Endpoint const& ep, int hops) SlotImp::recent_t::filter(beast::IP::Endpoint const& ep, std::uint32_t hops)
{ {
auto const iter(cache.find(ep)); auto const iter(cache.find(ep));
if (iter == cache.end()) if (iter == cache.end())

View File

@@ -32,9 +32,6 @@ namespace PeerFinder {
class SlotImp : public Slot class SlotImp : public Slot
{ {
private:
using recent_type = beast::aged_unordered_map<beast::IP::Endpoint, int>;
public: public:
using ptr = std::shared_ptr<SlotImp>; using ptr = std::shared_ptr<SlotImp>;
@@ -155,18 +152,18 @@ public:
sending a slot the same address too frequently. sending a slot the same address too frequently.
*/ */
void void
insert(beast::IP::Endpoint const& ep, int hops); insert(beast::IP::Endpoint const& ep, std::uint32_t hops);
/** Returns `true` if we should not send endpoint to the slot. */ /** Returns `true` if we should not send endpoint to the slot. */
bool bool
filter(beast::IP::Endpoint const& ep, int hops); filter(beast::IP::Endpoint const& ep, std::uint32_t hops);
private: private:
void void
expire(); expire();
friend class SlotImp; friend class SlotImp;
recent_type cache; beast::aged_unordered_map<beast::IP::Endpoint, std::uint32_t> cache;
} recent; } recent;
void void

View File

@@ -106,43 +106,30 @@ static std::chrono::seconds const bootcacheCooldownTime(60);
// //
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
enum { // Drop incoming messages with hops greater than this number
// Drop incoming messages with hops greater than this number std::uint32_t constexpr maxHops = 6;
maxHops = 6
// How many Endpoint to send in each mtENDPOINTS // How many Endpoint to send in each mtENDPOINTS
, std::uint32_t constexpr numberOfEndpoints = 2 * maxHops;
numberOfEndpoints = 2 * maxHops
// The most Endpoint we will accept in mtENDPOINTS // The most Endpoint we will accept in mtENDPOINTS
, std::uint32_t constexpr numberOfEndpointsMax =
numberOfEndpointsMax = 20 std::max<decltype(numberOfEndpoints)>(numberOfEndpoints * 2, 64);
// The number of peers that we want by default, unless an // Number of addresses we provide when redirecting.
// explicit value is set in the config file. std::uint32_t constexpr redirectEndpointCount = 10;
,
defaultMaxPeerCount = 21
/** Number of addresses we provide when redirecting. */
,
redirectEndpointCount = 10
};
// How often we send or accept mtENDPOINTS messages per peer // How often we send or accept mtENDPOINTS messages per peer
// (we use a prime number of purpose) // (we use a prime number of purpose)
static std::chrono::seconds const secondsPerMessage(61); std::chrono::seconds constexpr secondsPerMessage(151);
// How long an Endpoint will stay in the cache // How long an Endpoint will stay in the cache
// This should be a small multiple of the broadcast frequency // This should be a small multiple of the broadcast frequency
static std::chrono::seconds const liveCacheSecondsToLive(30); std::chrono::seconds constexpr liveCacheSecondsToLive(30);
//
//
//
// How much time to wait before trying an outgoing address again. // How much time to wait before trying an outgoing address again.
// Note that we ignore the port for purposes of comparison. // Note that we ignore the port for purposes of comparison.
static std::chrono::seconds const recentAttemptDuration(60); std::chrono::seconds constexpr recentAttemptDuration(60);
} // namespace Tuning } // namespace Tuning
/** @} */ /** @} */

View File

@@ -33,15 +33,16 @@ namespace BuildInfo {
// and follow the format described at http://semver.org/ // and follow the format described at http://semver.org/
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// clang-format off // clang-format off
char const* const versionString = "1.8.4" char const* const versionString = "1.8.5"
// clang-format on // clang-format on
"-hooks" "-hooks"
#if defined(DEBUG) || defined(SANITIZER) #if defined(DEBUG) || defined(SANITIZER)
#ifdef GIT_COMMIT_HASH
"-" GIT_COMMIT_HASH
#endif
"+" "+"
#ifdef GIT_COMMIT_HASH
GIT_COMMIT_HASH
"."
#endif
#ifdef DEBUG #ifdef DEBUG
"DEBUG" "DEBUG"
#ifdef SANITIZER #ifdef SANITIZER

View File

@@ -372,7 +372,7 @@ inline TaggedPointer::TaggedPointer(
++srcDstIndex; ++srcDstIndex;
} }
} }
else if (!inDst && !inDst) else if (!inSrc && !inDst)
{ {
// in neither // in neither
if (srcDstIsDense) if (srcDstIsDense)
@@ -433,7 +433,7 @@ inline TaggedPointer::TaggedPointer(
++srcIndex; ++srcIndex;
} }
} }
else if (!inDst && !inDst) else if (!inSrc && !inDst)
{ {
// in neither // in neither
if (dstIsDense) if (dstIsDense)

View File

@@ -387,25 +387,25 @@ public:
{ {
static std::string const cert{R"cert( static std::string const cert{R"cert(
-----BEGIN CERTIFICATE----- -----BEGIN CERTIFICATE-----
MIIDczCCAlugAwIBAgIBATANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEL MIIDczCCAlugAwIBAgIBAT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cc7n2j7tbLOu2svSLy6oXwG6n/bEagl5WpN2/TzQuwe7 GSGO8NEEq8BTVmp69zD1JyfvQcXzsi7WtkAX+/EOFZ7LesnZ6VsyjZ74wECCaQuD
f5ktutc4DDJSV7fuYYCuGumrHAjcELE= X1yu/XxHqchM+DOzzVw6wRKaM7Zsk80=
-----END CERTIFICATE----- -----END CERTIFICATE-----
)cert"}; )cert"};
return cert; return cert;
@@ -416,31 +416,31 @@ f5ktutc4DDJSV7fuYYCuGumrHAjcELE=
{ {
static std::string const key{R"pkey( static std::string const key{R"pkey(
-----BEGIN RSA PRIVATE KEY----- -----BEGIN RSA PRIVATE KEY-----
MIIEpQIBAAKCAQEA5Ky0UE9K+gFOznfwBvq2HfnQOOPGtVf4G9m63b5VQNJYCSNi MIIEpAIBAAKCAQEAueZ1hgRxwPgfeVx2AdngUYx7zYcaxcGYXyqi7izJqTuBUcVc
YxkGZW72ESM3XA8BledlkV9pwIm17+7ucB1Ed3efQjQDq2RSk5LDYDaar0Qzzy0E TRC/9Ip67RAEhfcgGudRS/a4Sv1ljwiRknSCcD/ZjzOFDLgbqYGSZNEs+T/qkwmc
C3b9+AKA6mAoVY6s1Qws/YvM4esz0H+SVvtVcFqA46kRWhJN7M5ic1lud58fAq04 /L+Pbzf85HM7RjeGOd6NDQy9+oOBbUtqpTxcSGa4ln+YBFUSeoS1Aa9fn9vrxnWX
BHqi5zOEOzfHJYPGUgQOxRTHluYkkkBrL2xioHHnOROshW+PIYFiAc/hWPzuihPH 9LgTu5dSWzH5TqFIti+Zs/v0PFjEivBIAOHPslmnzg/wCr99I6z9CAR3zVDe7+sx
nKaziPRw+O6O8ysnCxycQHgqtvx73T52eJdLxtr3ToRWaY/8VF/Cog5cuvWEtg6E R//ivpeVE7FWjgkGixnUpZAqn69zNkJjMLNXETgOYskZdMIgbVOMr+0qS1Uj77mh
ucGOszIH8O7eJWaJpVpAfZIX+c62MQWLpOLi/QIDAQABAoIBACf8mzs/4lh9Sg6I wxKfpnB6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pP2wV/jA6CPamIciNwS3bpyhDBqs9oLUc uzEYQQKBgQCJczIlwobm1Y6O41hbGZhZL/CGMNS6Z0INi2yasV0WDqYlh7XayHMD
qzXidOpXAVYg1wl/BqpaCQcmmhCrnSLJYdOMpudVyLCCfYmBJ0bs2DCAe5ibGbL7 cK55dMILcbHqeIBq/wR6sIhw6IJcaDBfFfrJiKKDilfij2lHxR2FQrEngtTCCRV+
VruAOjS4yBepkXJU9xwKHxDmgTo/oQ5smq7SNOUWDSElVI/CyZ0x7qA= ZzARzaWhQPvbDqEtLJDWuXZNXfL8/PTIs5NmuKuQ8F4+gQJpkQgwaw==
-----END RSA PRIVATE KEY----- -----END RSA PRIVATE KEY-----
)pkey"}; )pkey"};
return key; return key;
@@ -451,24 +451,26 @@ VruAOjS4yBepkXJU9xwKHxDmgTo/oQ5smq7SNOUWDSElVI/CyZ0x7qA=
{ {
static std::string const cert{R"cert( static std::string const cert{R"cert(
-----BEGIN CERTIFICATE----- -----BEGIN CERTIFICATE-----
MIIDQjCCAioCCQDxKQafEvp+VTANBgkqhkiG9w0BAQsFADBjMQswCQYDVQQGEwJV MIIDpzCCAo+gAwIBAgIUWc45WqaaNuaSLoFYTMC/Mjfqw/gwDQYJKoZIhvcNAQEL
UzELMAkGA1UECAwCQ0ExFDASBgNVBAcMC0xvcyBBbmdlbGVzMRswGQYDVQQKDBJy BQAwYzELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAkNBMRQwEgYDVQQHDAtMb3MgQW5n
aXBwbGVkLXVuaXQtdGVzdHMxFDASBgNVBAMMC2V4YW1wbGUuY29tMB4XDTE5MDgw ZWxlczEbMBkGA1UECgwScmlwcGxlZC11bml0LXRlc3RzMRQwEgYDVQQDDAtleGFt
NzE3MzM1OFoXDTQ2MTIyMzE3MzM1OFowYzELMAkGA1UEBhMCVVMxCzAJBgNVBAgM cGxlLmNvbTAeFw0yMjAyMDUyMzQ5MDFaFw00OTA2MjMyMzQ5MDFaMGMxCzAJBgNV
AkNB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iojW AAGjUzBRMB0GA1UdDgQWBBS1oydh+YyqDNOFKYOvOtVMWKqV4zAfBgNVHSMEGDAW
G2sZq7z8SNDMkUXZLbcbYNRyrZI0PdjfI0kyNpaa3pEcPcR8aOcTEOtW6V67FrPG gBS1oydh+YyqDNOFKYOvOtVMWKqV4zAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3
8aNYpr6a8PPq12aHzPSNjlUGot/qffGIQ0H2OqdWMOUXMMFnmH2KnnWi46Aq3gaF DQEBCwUAA4IBAQCDPyGKQwQ8Lz0yEgvIl/Uo9BtwAzlvjrLM/39qhStLQqDGSs2Q
uyHGrEczjJAK7NTzP8A7fbrmT00Sn6ft1FriQyhvDkUgPXBGWKpOFO84V27oo0ZL xFIbtjzjuLf5vR3q6OJ62CCvzqXgHkJ+hzVN/tAvyliGTdjJrK+xv1M5a+XipO2f
xXQHDWcpX+8yNKynjafkXLx6qXwcySF2bKcTIRsxlN6WNRqZ+wqpNStkjuoFkYR/ c9lb4gRbFL/DyoeoWgb1Rkv3gFf0FlCYH+ZUcYb9ZYCRlGtFgOcxJI2g+T7jSLFp
IfW9PBfO/gCtNJQ+lqpoTd3kLBCAng== 8+hSzQ6W5Sp9L6b5iJyCww1vjBvBqzNyZMNeB4gXGtd6z9vMDSvKboTdGD7wcFB+
mRMyNekaRw+Npy4Hjou5sx272cXHHmPCSF5TjwdaibSaGjx1k0Q50mOf7S9KG5b5
7X1e3FekJlaD02EBEhtkXURIxogOQALdFncj
-----END CERTIFICATE----- -----END CERTIFICATE-----
)cert"}; )cert"};
return cert; return cert;
@@ -479,12 +481,12 @@ IfW9PBfO/gCtNJQ+lqpoTd3kLBCAng==
{ {
static std::string const dh{R"dh( static std::string const dh{R"dh(
-----BEGIN DH PARAMETERS----- -----BEGIN DH PARAMETERS-----
MIIBCAKCAQEAnJaaKu3U2a7ZVBvIC+NVNHXo9q6hNCazze+4pwXAKBVXH0ozInEw MIIBCAKCAQEAp2I2fWEUZ3sCNfitSRC/MdAhJE/bS+NO0O2tWdIdlvmIFE6B5qhC
WKozYxVJLW7dvDHdjdFOSuTLQDqaPW9zVMQKM0BKu81+JyfJi7C3HYKUw7ECVHp4 sGW9ojrQT8DTxBvGAcbjr/jagmlE3BV4oSnxyhP37G2mDvMOJ29J3NvFD/ZFAW0d
DLvhDe6N5eBj/t1FUwcfS2VNIx4QcJiw6FH3CwNNee1fIi5VTRJp2GLUuMCHkT/I BvZJ1RNvMu29NmVCyt6/jgzcqrqnami9uD93aK+zaVrlPsPEYM8xB19HXwqsEYCL
FTODJ+Anw12cJqLdgQfV74UV/Y7JCQl3/DOIy+2YkmX8vWVHX1h6EI5Gw4a3jgqF ux2B7sqXm9Ts74HPg/EV+pcVon9phxNWxxgHlOvFc2QjZ3hXH++kzmJ4vs7N/XDB
gVyCOWoVCfgu37H5e7ERyoAxigiP8hMqoGpmJUYJghVKWoFgNUqXw+guVJ56eIuH xbEQ+TUZ5jbJGSeBqNFKFeuOUQGJ46Io0jBSYd4rSmKUXkvElQwR+n7KF3jy1uAt
0wVs/LXflOZ42PJAiwv4LTNOtpG2pWGjOwIBAg== /8hzd8tHn9TyW7Q2/CPkOA6dCXzltpOSowIBAg==
-----END DH PARAMETERS----- -----END DH PARAMETERS-----
)dh"}; )dh"};
return dh; return dh;

View File

@@ -48,7 +48,7 @@ public:
// Add the address as an endpoint // Add the address as an endpoint
template <class C> template <class C>
inline void inline void
add(beast::IP::Endpoint ep, C& c, int hops = 0) add(beast::IP::Endpoint ep, C& c, std::uint32_t hops = 0)
{ {
Endpoint cep{ep, hops}; Endpoint cep{ep, hops};
c.insert(cep); c.insert(cep);
@@ -139,7 +139,7 @@ public:
for (auto i = 0; i < num_eps; ++i) for (auto i = 0; i < num_eps; ++i)
add(beast::IP::randomEP(true), add(beast::IP::randomEP(true),
c, c,
ripple::rand_int(0, safe_cast<int>(Tuning::maxHops + 1))); ripple::rand_int<std::uint32_t>());
auto h = c.hops.histogram(); auto h = c.hops.histogram();
if (!BEAST_EXPECT(!h.empty())) if (!BEAST_EXPECT(!h.empty()))
return; return;
@@ -163,7 +163,7 @@ public:
for (auto i = 0; i < 100; ++i) for (auto i = 0; i < 100; ++i)
add(beast::IP::randomEP(true), add(beast::IP::randomEP(true),
c, c,
ripple::rand_int(0, safe_cast<int>(Tuning::maxHops + 1))); ripple::rand_int(Tuning::maxHops + 1));
using at_hop = std::vector<ripple::PeerFinder::Endpoint>; using at_hop = std::vector<ripple::PeerFinder::Endpoint>;
using all_hops = std::array<at_hop, 1 + Tuning::maxHops + 1>; using all_hops = std::array<at_hop, 1 + Tuning::maxHops + 1>;