diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml index 2aa22bfd776..8ccb1f52733 100644 --- a/.github/workflows/nix.yml +++ b/.github/workflows/nix.yml @@ -69,8 +69,8 @@ jobs: with: path: ${{ steps.conan-cache.outputs.dir }} key: ${{ hashFiles('~/.conan/profiles/default', 'conanfile.py', 'external/rocksdb/*', '.github/workflows/nix.yml') }} - - name: export RocksDB - run: conan export external/rocksdb + - name: export Snappy + run: conan export external/snappy snappy/1.1.9@ - name: install dependencies run: | mkdir ${build_dir} diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index b50f9ab550a..51fdc5d27cb 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -69,8 +69,8 @@ jobs: with: path: ${{ steps.conan-cache.outputs.dir }} key: ${{ hashFiles('~/.conan/profiles/default', 'conanfile.py', 'external/rocksdb/*', '.github/workflows/windows.yml') }} - - name: export RocksDB - run: conan export external/rocksdb + - name: export Snappy + run: conan export external/snappy snappy/1.1.9@ - name: install dependencies run: | mkdir $env:build_dir diff --git a/BUILD.md b/BUILD.md index 7bb2d4d8ebb..a1376bdc5df 100644 --- a/BUILD.md +++ b/BUILD.md @@ -243,7 +243,7 @@ The first is for a single-configuration generator (e.g. Unix Makefiles) on Linux or MacOS: ``` -conan export external/rocksdb +conan export external/snappy snappy/1.1.9@ mkdir .build cd .build conan install .. --output-folder . --build missing --settings build_type=Release @@ -256,7 +256,7 @@ The second is for a multi-configuration generator (e.g. Visual Studio) on Windows: ``` -conan export external/rocksdb +conan export external/snappy snappy/1.1.9@ mkdir .build cd .build conan install .. --output-folder . --build missing --settings build_type=Release --settings compiler.runtime=MT @@ -270,10 +270,10 @@ cmake --build . --config Debug Now to explain the individual steps in each example: -1. Export our [Conan recipe for RocksDB](./external/rocksdb). +1. Export our [Conan recipe for Snappy](./external/snappy). - It builds version 6.27.3, which, as of July 8, 2022, - is not available in [Conan Center](https://conan.io/center/rocksdb). + It does not explicitly link the C++ standard library, + which allows us to statically link it. 1. Create a build directory (and move into it). diff --git a/external/rocksdb/conanfile.py b/external/rocksdb/conanfile.py deleted file mode 100644 index a219f4f5547..00000000000 --- a/external/rocksdb/conanfile.py +++ /dev/null @@ -1,193 +0,0 @@ -import os -import shutil -from conans import ConanFile, CMake -from conan.tools import microsoft as ms - -class RocksDB(ConanFile): - name = 'rocksdb' - version = '6.27.3' - - license = ('GPL-2.0-only', 'Apache-2.0') - url = 'https://github.com/conan-io/conan-center-index' - description = 'A library that provides an embeddable, persistent key-value store for fast storage' - topics = ('rocksdb', 'database', 'leveldb', 'facebook', 'key-value') - - settings = 'os', 'compiler', 'build_type', 'arch' - options = { - 'enable_sse': [False, 'sse42', 'avx2'], - 'fPIC': [True, False], - 'lite': [True, False], - 'shared': [True, False], - 'use_rtti': [True, False], - 'with_gflags': [True, False], - 'with_jemalloc': [True, False], - 'with_lz4': [True, False], - 'with_snappy': [True, False], - 'with_tbb': [True, False], - 'with_zlib': [True, False], - 'with_zstd': [True, False], - } - default_options = { - 'enable_sse': False, - 'fPIC': True, - 'lite': False, - 'shared': False, - 'use_rtti': False, - 'with_gflags': False, - 'with_jemalloc': False, - 'with_lz4': False, - 'with_snappy': False, - 'with_tbb': False, - 'with_zlib': False, - 'with_zstd': False, - } - - def requirements(self): - if self.options.with_gflags: - self.requires('gflags/2.2.2') - if self.options.with_jemalloc: - self.requires('jemalloc/5.2.1') - if self.options.with_lz4: - self.requires('lz4/1.9.3') - if self.options.with_snappy: - self.requires('snappy/1.1.9') - if self.options.with_tbb: - self.requires('onetbb/2020.3') - if self.options.with_zlib: - self.requires('zlib/1.2.11') - if self.options.with_zstd: - self.requires('zstd/1.5.2') - - def config_options(self): - if self.settings.os == 'Windows': - del self.options.fPIC - - def configure(self): - if self.options.shared: - del self.options.fPIC - - generators = 'cmake', 'cmake_find_package' - - scm = { - 'type': 'git', - 'url': 'https://github.com/facebook/rocksdb.git', - 'revision': 'v6.27.3', - } - - exports_sources = 'thirdparty.inc' - # For out-of-source build. - no_copy_source = True - - _cmake = None - - def _configure_cmake(self): - if self._cmake: - return - - self._cmake = CMake(self) - - self._cmake.definitions['CMAKE_POSITION_INDEPENDENT_CODE'] = True - - self._cmake.definitions['DISABLE_STALL_NOTIF'] = False - self._cmake.definitions['FAIL_ON_WARNINGS'] = False - self._cmake.definitions['OPTDBG'] = True - self._cmake.definitions['WITH_TESTS'] = False - self._cmake.definitions['WITH_TOOLS'] = False - - self._cmake.definitions['WITH_GFLAGS'] = self.options.with_gflags - self._cmake.definitions['WITH_JEMALLOC'] = self.options.with_jemalloc - self._cmake.definitions['WITH_LZ4'] = self.options.with_lz4 - self._cmake.definitions['WITH_SNAPPY'] = self.options.with_snappy - self._cmake.definitions['WITH_TBB'] = self.options.with_tbb - self._cmake.definitions['WITH_ZLIB'] = self.options.with_zlib - self._cmake.definitions['WITH_ZSTD'] = self.options.with_zstd - - self._cmake.definitions['USE_RTTI'] = self.options.use_rtti - self._cmake.definitions['ROCKSDB_LITE'] = self.options.lite - self._cmake.definitions['ROCKSDB_INSTALL_ON_WINDOWS'] = ( - self.settings.os == 'Windows' - ) - - if not self.options.enable_sse: - self._cmake.definitions['PORTABLE'] = True - self._cmake.definitions['FORCE_SSE42'] = False - elif self.options.enable_sse == 'sse42': - self._cmake.definitions['PORTABLE'] = True - self._cmake.definitions['FORCE_SSE42'] = True - elif self.options.enable_sse == 'avx2': - self._cmake.definitions['PORTABLE'] = False - self._cmake.definitions['FORCE_SSE42'] = False - - self._cmake.definitions['WITH_ASAN'] = False - self._cmake.definitions['WITH_BZ2'] = False - self._cmake.definitions['WITH_JNI'] = False - self._cmake.definitions['WITH_LIBRADOS'] = False - if ms.is_msvc(self): - self._cmake.definitions['WITH_MD_LIBRARY'] = ( - ms.msvc_runtime_flag(self).startswith('MD') - ) - self._cmake.definitions['WITH_RUNTIME_DEBUG'] = ( - ms.msvc_runtime_flag(self).endswith('d') - ) - self._cmake.definitions['WITH_NUMA'] = False - self._cmake.definitions['WITH_TSAN'] = False - self._cmake.definitions['WITH_UBSAN'] = False - self._cmake.definitions['WITH_WINDOWS_UTF8_FILENAMES'] = False - self._cmake.definitions['WITH_XPRESS'] = False - self._cmake.definitions['WITH_FALLOCATE'] = True - - - def build(self): - if ms.is_msvc(self): - file = os.path.join( - self.recipe_folder, '..', 'export_source', 'thirdparty.inc' - ) - shutil.copy(file, self.build_folder) - self._configure_cmake() - self._cmake.configure() - self._cmake.build() - - def package(self): - self._configure_cmake() - self._cmake.install() - - def package_info(self): - self.cpp_info.filenames['cmake_find_package'] = 'RocksDB' - self.cpp_info.filenames['cmake_find_package_multi'] = 'RocksDB' - self.cpp_info.set_property('cmake_file_name', 'RocksDB') - - self.cpp_info.names['cmake_find_package'] = 'RocksDB' - self.cpp_info.names['cmake_find_package_multi'] = 'RocksDB' - - self.cpp_info.components['librocksdb'].names['cmake_find_package'] = 'rocksdb' - self.cpp_info.components['librocksdb'].names['cmake_find_package_multi'] = 'rocksdb' - self.cpp_info.components['librocksdb'].set_property( - 'cmake_target_name', 'RocksDB::rocksdb' - ) - - self.cpp_info.components['librocksdb'].libs = ['rocksdb'] - - if self.settings.os == "Windows": - self.cpp_info.components["librocksdb"].system_libs = ["shlwapi", "rpcrt4"] - if self.options.shared: - self.cpp_info.components["librocksdb"].defines = ["ROCKSDB_DLL"] - elif self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.components["librocksdb"].system_libs = ["pthread", "m"] - - if self.options.lite: - self.cpp_info.components["librocksdb"].defines.append("ROCKSDB_LITE") - - if self.options.with_gflags: - self.cpp_info.components["librocksdb"].requires.append("gflags::gflags") - if self.options.with_jemalloc: - self.cpp_info.components["librocksdb"].requires.append("jemalloc::jemalloc") - if self.options.with_lz4: - self.cpp_info.components["librocksdb"].requires.append("lz4::lz4") - if self.options.with_snappy: - self.cpp_info.components["librocksdb"].requires.append("snappy::snappy") - if self.options.with_tbb: - self.cpp_info.components["librocksdb"].requires.append("onetbb::onetbb") - if self.options.with_zlib: - self.cpp_info.components["librocksdb"].requires.append("zlib::zlib") - if self.options.with_zstd: - self.cpp_info.components["librocksdb"].requires.append("zstd::zstd") diff --git a/external/rocksdb/thirdparty.inc b/external/rocksdb/thirdparty.inc deleted file mode 100644 index fce11784b92..00000000000 --- a/external/rocksdb/thirdparty.inc +++ /dev/null @@ -1,62 +0,0 @@ -if(WITH_GFLAGS) - # Config with namespace available since gflags 2.2.2 - find_package(gflags REQUIRED) - set(GFLAGS_LIB gflags::gflags) - list(APPEND THIRDPARTY_LIBS ${GFLAGS_LIB}) - add_definitions(-DGFLAGS=1) -endif() - -if(WITH_SNAPPY) - find_package(Snappy REQUIRED) - add_definitions(-DSNAPPY) - list(APPEND THIRDPARTY_LIBS Snappy::snappy) -endif() - -if(WITH_LZ4) - find_package(lz4 REQUIRED) - add_definitions(-DLZ4) - list(APPEND THIRDPARTY_LIBS lz4::lz4) -endif() - -if(WITH_ZLIB) - find_package(ZLIB REQUIRED) - add_definitions(-DZLIB) - list(APPEND THIRDPARTY_LIBS ZLIB::ZLIB) -endif() - -option(WITH_BZ2 "build with bzip2" OFF) -if(WITH_BZ2) - find_package(BZip2 REQUIRED) - add_definitions(-DBZIP2) - list(APPEND THIRDPARTY_LIBS BZip2::BZip2) -endif() - -if(WITH_ZSTD) - find_package(zstd REQUIRED) - add_definitions(-DZSTD) - list(APPEND THIRDPARTY_LIBS zstd::zstd) -endif() - -# ================================================== XPRESS ================================================== -# This makes use of built-in Windows API, no additional includes, links to a system lib - -if(WITH_XPRESS) - message(STATUS "XPRESS is enabled") - add_definitions(-DXPRESS) - # We are using the implementation provided by the system - list(APPEND SYSTEM_LIBS Cabinet.lib) -else() - message(STATUS "XPRESS is disabled") -endif() - -# ================================================== JEMALLOC ================================================== -if(WITH_JEMALLOC) - message(STATUS "JEMALLOC library is enabled") - add_definitions(-DROCKSDB_JEMALLOC -DJEMALLOC_EXPORT= -DJEMALLOC_NO_RENAME) - list(APPEND THIRDPARTY_LIBS jemalloc::jemalloc) - set(ARTIFACT_SUFFIX "_je") - -else () - set(ARTIFACT_SUFFIX "") - message(STATUS "JEMALLOC library is disabled") -endif () diff --git a/external/snappy/conandata.yml b/external/snappy/conandata.yml new file mode 100644 index 00000000000..6c12aed54a1 --- /dev/null +++ b/external/snappy/conandata.yml @@ -0,0 +1,16 @@ +sources: + "1.1.9": + url: "https://github.com/google/snappy/archive/1.1.9.tar.gz" + sha256: "75c1fbb3d618dd3a0483bff0e26d0a92b495bbe5059c8b4f1c962b478b6e06e7" + "1.1.8": + url: "https://github.com/google/snappy/archive/1.1.8.tar.gz" + sha256: "16b677f07832a612b0836178db7f374e414f94657c138e6993cbfc5dcc58651f" + "1.1.7": + url: "https://github.com/google/snappy/archive/1.1.7.tar.gz" + sha256: "3dfa02e873ff51a11ee02b9ca391807f0c8ea0529a4924afa645fbf97163f9d4" +patches: + "1.1.9": + - patch_file: "patches/1.1.9-0001-fix-inlining-failure.patch" + - patch_file: "patches/1.1.9-0002-no-Werror.patch" + - patch_file: "patches/1.1.9-0003-fix-clobber-list-older-llvm.patch" + - patch_file: "patches/1.1.9-0004-rtti-by-default.patch" diff --git a/external/snappy/conanfile.py b/external/snappy/conanfile.py new file mode 100644 index 00000000000..23558639f46 --- /dev/null +++ b/external/snappy/conanfile.py @@ -0,0 +1,89 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.54.0" + + +class SnappyConan(ConanFile): + name = "snappy" + description = "A fast compressor/decompressor" + topics = ("google", "compressor", "decompressor") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/google/snappy" + license = "BSD-3-Clause" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == 'Windows': + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["SNAPPY_BUILD_TESTS"] = False + if Version(self.version) >= "1.1.8": + tc.variables["SNAPPY_FUZZING_BUILD"] = False + tc.variables["SNAPPY_REQUIRE_AVX"] = False + tc.variables["SNAPPY_REQUIRE_AVX2"] = False + tc.variables["SNAPPY_INSTALL"] = True + if Version(self.version) >= "1.1.9": + tc.variables["SNAPPY_BUILD_BENCHMARKS"] = False + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "Snappy") + self.cpp_info.set_property("cmake_target_name", "Snappy::snappy") + # TODO: back to global scope in conan v2 once cmake_find_package* generators removed + self.cpp_info.components["snappylib"].libs = ["snappy"] + if not self.options.shared: + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["snappylib"].system_libs.append("m") + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "Snappy" + self.cpp_info.names["cmake_find_package_multi"] = "Snappy" + self.cpp_info.components["snappylib"].names["cmake_find_package"] = "snappy" + self.cpp_info.components["snappylib"].names["cmake_find_package_multi"] = "snappy" + self.cpp_info.components["snappylib"].set_property("cmake_target_name", "Snappy::snappy") diff --git a/external/snappy/patches/1.1.9-0001-fix-inlining-failure.patch b/external/snappy/patches/1.1.9-0001-fix-inlining-failure.patch new file mode 100644 index 00000000000..cdc119c0d58 --- /dev/null +++ b/external/snappy/patches/1.1.9-0001-fix-inlining-failure.patch @@ -0,0 +1,14 @@ +Fixes the following error: +error: inlining failed in call to ‘always_inline’ ‘size_t snappy::AdvanceToNextTag(const uint8_t**, size_t*)’: function body can be overwritten at link time + +--- snappy-stubs-internal.h ++++ snappy-stubs-internal.h +@@ -100,7 +100,7 @@ + + // Inlining hints. + #ifdef HAVE_ATTRIBUTE_ALWAYS_INLINE +-#define SNAPPY_ATTRIBUTE_ALWAYS_INLINE __attribute__((always_inline)) ++#define SNAPPY_ATTRIBUTE_ALWAYS_INLINE + #else + #define SNAPPY_ATTRIBUTE_ALWAYS_INLINE + #endif diff --git a/external/snappy/patches/1.1.9-0002-no-Werror.patch b/external/snappy/patches/1.1.9-0002-no-Werror.patch new file mode 100644 index 00000000000..d86e4e0a9df --- /dev/null +++ b/external/snappy/patches/1.1.9-0002-no-Werror.patch @@ -0,0 +1,12 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -69,7 +69,7 @@ +- # Use -Werror for clang only. ++if(0) + if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + if(NOT CMAKE_CXX_FLAGS MATCHES "-Werror") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror") + endif(NOT CMAKE_CXX_FLAGS MATCHES "-Werror") + endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") +- ++endif() diff --git a/external/snappy/patches/1.1.9-0003-fix-clobber-list-older-llvm.patch b/external/snappy/patches/1.1.9-0003-fix-clobber-list-older-llvm.patch new file mode 100644 index 00000000000..84bc674fdd5 --- /dev/null +++ b/external/snappy/patches/1.1.9-0003-fix-clobber-list-older-llvm.patch @@ -0,0 +1,12 @@ +asm clobbers do not work for clang < 9 and apple-clang < 11 (found by SpaceIm) +--- snappy.cc ++++ snappy.cc +@@ -1026,7 +1026,7 @@ + size_t literal_len = *tag >> 2; + size_t tag_type = *tag; + bool is_literal; +-#if defined(__GNUC__) && defined(__x86_64__) ++#if defined(__GNUC__) && defined(__x86_64__) && ( (!defined(__clang__) && !defined(__APPLE__)) || (!defined(__APPLE__) && defined(__clang__) && (__clang_major__ >= 9)) || (defined(__APPLE__) && defined(__clang__) && (__clang_major__ > 11)) ) + // TODO clang misses the fact that the (c & 3) already correctly + // sets the zero flag. + asm("and $3, %k[tag_type]\n\t" diff --git a/external/snappy/patches/1.1.9-0004-rtti-by-default.patch b/external/snappy/patches/1.1.9-0004-rtti-by-default.patch new file mode 100644 index 00000000000..c353a489d0e --- /dev/null +++ b/external/snappy/patches/1.1.9-0004-rtti-by-default.patch @@ -0,0 +1,20 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -53,8 +53,6 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + add_definitions(-D_HAS_EXCEPTIONS=0) + + # Disable RTTI. +- string(REGEX REPLACE "/GR" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /GR-") + else(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + # Use -Wall for clang and gcc. + if(NOT CMAKE_CXX_FLAGS MATCHES "-Wall") +@@ -78,8 +76,6 @@ endif() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions") + + # Disable RTTI. +- string(REGEX REPLACE "-frtti" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti") + endif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + + # BUILD_SHARED_LIBS is a standard CMake variable, but we declare it here to make diff --git a/src/ripple/app/misc/NetworkOPs.cpp b/src/ripple/app/misc/NetworkOPs.cpp index 610b8e71adc..d6816b1d420 100644 --- a/src/ripple/app/misc/NetworkOPs.cpp +++ b/src/ripple/app/misc/NetworkOPs.cpp @@ -2184,16 +2184,15 @@ NetworkOPsImp::pubValidation(std::shared_ptr const& val) // simplifies later operations) if (auto const baseFeeXRP = ~val->at(~sfBaseFeeDrops); baseFeeXRP && baseFeeXRP->native()) - jvObj[jss::base_fee_drops] = baseFeeXRP->xrp().jsonClipped(); + jvObj[jss::base_fee] = baseFeeXRP->xrp().jsonClipped(); if (auto const reserveBaseXRP = ~val->at(~sfReserveBaseDrops); reserveBaseXRP && reserveBaseXRP->native()) - jvObj[jss::reserve_base_drops] = - reserveBaseXRP->xrp().jsonClipped(); + jvObj[jss::reserve_base] = reserveBaseXRP->xrp().jsonClipped(); if (auto const reserveIncXRP = ~val->at(~sfReserveIncrementDrops); reserveIncXRP && reserveIncXRP->native()) - jvObj[jss::reserve_inc_drops] = reserveIncXRP->xrp().jsonClipped(); + jvObj[jss::reserve_inc] = reserveIncXRP->xrp().jsonClipped(); for (auto i = mStreamMaps[sValidations].begin(); i != mStreamMaps[sValidations].end();) diff --git a/src/ripple/protocol/jss.h b/src/ripple/protocol/jss.h index 01e30dd9327..1c5bf8463b0 100644 --- a/src/ripple/protocol/jss.h +++ b/src/ripple/protocol/jss.h @@ -151,7 +151,6 @@ JSS(balance); // out: AccountLines JSS(balances); // out: GatewayBalances JSS(base); // out: LogLevel JSS(base_fee); // out: NetworkOPs -JSS(base_fee_drops); // out: NetworkOPs JSS(base_fee_xrp); // out: NetworkOPs JSS(bids); // out: Subscribe JSS(binary); // in: AccountTX, LedgerEntry, @@ -496,10 +495,8 @@ JSS(request); // RPC JSS(requested); // out: Manifest JSS(reservations); // out: Reservations JSS(reserve_base); // out: NetworkOPs -JSS(reserve_base_drops); // out: NetworkOPs JSS(reserve_base_xrp); // out: NetworkOPs JSS(reserve_inc); // out: NetworkOPs -JSS(reserve_inc_drops); // out: NetworkOPs JSS(reserve_inc_xrp); // out: NetworkOPs JSS(response); // websocket JSS(result); // RPC diff --git a/src/test/rpc/Subscribe_test.cpp b/src/test/rpc/Subscribe_test.cpp index 783f5eb7e38..3bb0cce611c 100644 --- a/src/test/rpc/Subscribe_test.cpp +++ b/src/test/rpc/Subscribe_test.cpp @@ -411,25 +411,10 @@ class Subscribe_test : public beast::unit_test::suite if (jv.isMember(jss::server_version) != isFlagLedger) return false; - bool xrpFees = env.closed()->rules().enabled(featureXRPFees); - if ((!xrpFees && - jv.isMember(jss::reserve_base) != isFlagLedger) || - (xrpFees && jv.isMember(jss::reserve_base))) + if (jv.isMember(jss::reserve_base) != isFlagLedger) return false; - if ((!xrpFees && - jv.isMember(jss::reserve_inc) != isFlagLedger) || - (xrpFees && jv.isMember(jss::reserve_inc))) - return false; - - if ((xrpFees && - jv.isMember(jss::reserve_base_drops) != isFlagLedger) || - (!xrpFees && jv.isMember(jss::reserve_base_drops))) - return false; - - if ((xrpFees && - jv.isMember(jss::reserve_inc_drops) != isFlagLedger) || - (!xrpFees && jv.isMember(jss::reserve_inc_drops))) + if (jv.isMember(jss::reserve_inc) != isFlagLedger) return false; return true;