Skip to content

Commit 0238b4d

Browse files
committed
Merge remote-tracking branch 'upstream/ripple/wasmi-host-functions' into hf-macro2
2 parents 97d91f7 + 6728ab5 commit 0238b4d

File tree

79 files changed

+100458
-839
lines changed

Some content is hidden

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

79 files changed

+100458
-839
lines changed

.github/CODEOWNERS

Lines changed: 0 additions & 2 deletions
This file was deleted.

.github/scripts/strategy-matrix/generate.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,11 +196,22 @@ def generate_strategy_matrix(all: bool, config: Config) -> list:
196196
# Enable code coverage for Debian Bookworm using GCC 15 in Debug on
197197
# linux/amd64
198198
if (
199-
f"{os['compiler_name']}-{os['compiler_version']}" == "gcc-15"
199+
f"{os['distro_name']}-{os['distro_version']}" == "debian-bookworm"
200+
and f"{os['compiler_name']}-{os['compiler_version']}" == "gcc-15"
200201
and build_type == "Debug"
201202
and architecture["platform"] == "linux/amd64"
202203
):
203-
cmake_args = f"-Dcoverage=ON -Dcoverage_format=xml -DCODE_COVERAGE_VERBOSE=ON -DCMAKE_C_FLAGS=-O0 -DCMAKE_CXX_FLAGS=-O0 {cmake_args}"
204+
cmake_args = f"{cmake_args} -Dcoverage=ON -Dcoverage_format=xml -DCODE_COVERAGE_VERBOSE=ON -DCMAKE_C_FLAGS=-O0 -DCMAKE_CXX_FLAGS=-O0"
205+
206+
# Enable unity build for Ubuntu Jammy using GCC 12 in Debug on
207+
# linux/amd64.
208+
if (
209+
f"{os['distro_name']}-{os['distro_version']}" == "ubuntu-jammy"
210+
and f"{os['compiler_name']}-{os['compiler_version']}" == "gcc-12"
211+
and build_type == "Debug"
212+
and architecture["platform"] == "linux/amd64"
213+
):
214+
cmake_args = f"{cmake_args} -Dunity=ON"
204215

205216
# Generate a unique name for the configuration, e.g. macos-arm64-debug
206217
# or debian-bookworm-gcc-12-amd64-release.
@@ -217,6 +228,8 @@ def generate_strategy_matrix(all: bool, config: Config) -> list:
217228
config_name += f"-{build_type.lower()}"
218229
if "-Dcoverage=ON" in cmake_args:
219230
config_name += "-coverage"
231+
if "-Dunity=ON" in cmake_args:
232+
config_name += "-unity"
220233

221234
# Add the configuration to the list, with the most unique fields first,
222235
# so that they are easier to identify in the GitHub Actions UI, as long

BUILD.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,10 +575,16 @@ See [Sanitizers docs](./docs/build/sanitizers.md) for more details.
575575
| `assert` | OFF | Enable assertions. |
576576
| `coverage` | OFF | Prepare the coverage report. |
577577
| `tests` | OFF | Build tests. |
578+
| `unity` | OFF | Configure a unity build. |
578579
| `xrpld` | OFF | Build the xrpld application, and not just the libxrpl library. |
579580
| `werr` | OFF | Treat compilation warnings as errors |
580581
| `wextra` | OFF | Enable additional compilation warnings |
581582

583+
[Unity builds][5] may be faster for the first build (at the cost of much more
584+
memory) since they concatenate sources into fewer translation units. Non-unity
585+
builds may be faster for incremental builds, and can be helpful for detecting
586+
`#include` omissions.
587+
582588
## Troubleshooting
583589

584590
### Conan
@@ -645,6 +651,7 @@ If you want to experiment with a new package, follow these steps:
645651
[1]: https://github.com/conan-io/conan-center-index/issues/13168
646652
[2]: https://en.cppreference.com/w/cpp/compiler_support/20
647653
[3]: https://docs.conan.io/en/latest/getting_started.html
654+
[5]: https://en.wikipedia.org/wiki/Unity_build
648655
[6]: https://github.com/boostorg/beast/issues/2648
649656
[7]: https://github.com/boostorg/beast/issues/2661
650657
[gcovr]: https://gcovr.com/en/stable/getting-started.html

cfg/xrpld-example.cfg

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -940,32 +940,14 @@
940940
#
941941
# path Location to store the database
942942
#
943-
# Optional keys
944-
#
945-
# cache_size Size of cache for database records. Default is 16384.
946-
# Setting this value to 0 will use the default value.
947-
#
948-
# cache_age Length of time in minutes to keep database records
949-
# cached. Default is 5 minutes. Setting this value to
950-
# 0 will use the default value.
951-
#
952-
# Note: if neither cache_size nor cache_age is
953-
# specified, the cache for database records will not
954-
# be created. If only one of cache_size or cache_age
955-
# is specified, the cache will be created using the
956-
# default value for the unspecified parameter.
957-
#
958-
# Note: the cache will not be created if online_delete
959-
# is specified.
943+
# Optional keys for NuDB and RocksDB:
960944
#
961945
# fast_load Boolean. If set, load the last persisted ledger
962946
# from disk upon process start before syncing to
963947
# the network. This is likely to improve performance
964948
# if sufficient IOPS capacity is available.
965949
# Default 0.
966950
#
967-
# Optional keys for NuDB or RocksDB:
968-
#
969951
# earliest_seq The default is 32570 to match the XRP ledger
970952
# network's earliest allowed sequence. Alternate
971953
# networks may set this value. Minimum value of 1.

cmake/XrplCore.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@
44

55
include(target_protobuf_sources)
66

7+
# Protocol buffers cannot participate in a unity build,
8+
# because all the generated sources
9+
# define a bunch of `static const` variables with the same names,
10+
# so we just build them as a separate library.
711
add_library(xrpl.libpb)
12+
set_target_properties(xrpl.libpb PROPERTIES UNITY_BUILD OFF)
813
target_protobuf_sources(xrpl.libpb xrpl/proto LANGUAGE cpp IMPORT_DIRS include/xrpl/proto
914
PROTOS include/xrpl/proto/xrpl.proto)
1015

cmake/XrplSettings.cmake

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@ if (tests)
3030
endif ()
3131
endif ()
3232

33+
option(unity "Creates a build using UNITY support in cmake." OFF)
34+
if (unity)
35+
if (NOT is_ci)
36+
set(CMAKE_UNITY_BUILD_BATCH_SIZE 15 CACHE STRING "")
37+
endif ()
38+
set(CMAKE_UNITY_BUILD ON CACHE BOOL "Do a unity build")
39+
endif ()
40+
3341
if (is_clang AND is_linux)
3442
option(voidstar "Enable Antithesis instrumentation." OFF)
3543
endif ()

conan.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"sqlite3/3.49.1#8631739a4c9b93bd3d6b753bac548a63%1765850149.926",
88
"soci/4.0.3#a9f8d773cd33e356b5879a4b0564f287%1765850149.46",
99
"snappy/1.1.10#968fef506ff261592ec30c574d4a7809%1765850147.878",
10-
"secp256k1/0.7.0#0fda78daa3b864deb8a2fbc083398356%1770226294.524",
10+
"secp256k1/0.7.1#3a61e95e220062ef32c48d019e9c81f7%1770306721.686",
1111
"rocksdb/10.5.1#4a197eca381a3e5ae8adf8cffa5aacd0%1765850186.86",
1212
"re2/20230301#ca3b241baec15bd31ea9187150e0b333%1765850148.103",
1313
"protobuf/6.32.1#f481fd276fc23a33b85a3ed1e898b693%1765850161.038",

conanfile.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ class Xrpl(ConanFile):
2323
"shared": [True, False],
2424
"static": [True, False],
2525
"tests": [True, False],
26+
"unity": [True, False],
2627
"xrpld": [True, False],
2728
}
2829

@@ -32,7 +33,7 @@ class Xrpl(ConanFile):
3233
"libarchive/3.8.1",
3334
"nudb/2.0.9",
3435
"openssl/3.5.5",
35-
"secp256k1/0.7.0",
36+
"secp256k1/0.7.1",
3637
"soci/4.0.3",
3738
"wasmi/1.0.6",
3839
"zlib/1.3.1",
@@ -55,6 +56,7 @@ class Xrpl(ConanFile):
5556
"shared": False,
5657
"static": True,
5758
"tests": False,
59+
"unity": False,
5860
"xrpld": False,
5961
"date/*:header_only": True,
6062
"ed25519/*:shared": False,
@@ -167,6 +169,7 @@ def generate(self):
167169
tc.variables["rocksdb"] = self.options.rocksdb
168170
tc.variables["BUILD_SHARED_LIBS"] = self.options.shared
169171
tc.variables["static"] = self.options.static
172+
tc.variables["unity"] = self.options.unity
170173
tc.variables["xrpld"] = self.options.xrpld
171174
tc.generate()
172175

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,45 @@
11
ignorePaths:
22
- build/**
33
- src/libxrpl/crypto
4-
- src/test/** # Will be removed in the future
54
- CMakeUserPresets.json
65
- Doxyfile
76
- docs/**/*.puml
87
- cmake/**
98
- LICENSE.md
9+
- src/test/app/wasm_fixtures/**/*.wat
10+
- src/test/app/wasm_fixtures/*.c
1011
language: en
11-
allowCompoundWords: true
12+
allowCompoundWords: true # TODO (#6334)
1213
ignoreRandomStrings: true
1314
minWordLength: 5
1415
dictionaries:
1516
- cpp
1617
- en_US
1718
- en_GB
1819
ignoreRegExpList:
19-
- /[rs][1-9A-HJ-NP-Za-km-z]{25,34}/g # addresses and seeds
20-
- /(XRPL|BEAST)_[A-Z_0-9]+_H_INCLUDED+/g # include guards
21-
- /(XRPL|BEAST)_[A-Z_0-9]+_H+/g # include guards
20+
- /\b[rs][1-9A-HJ-NP-Za-km-z]{25,34}/g # addresses and seeds
21+
- /\bC[A-Z0-9]{15}/g # CTIDs
22+
- /\b(XRPL|BEAST)_[A-Z_0-9]+_H_INCLUDED+/g # include guards
23+
- /\b(XRPL|BEAST)_[A-Z_0-9]+_H+/g # include guards
2224
- /::[a-z:_]+/g # things from other namespaces
23-
- /lib[a-z]+/g # libraries
24-
- /[0-9]{4}-[0-9]{2}-[0-9]{2}[,:][A-Za-zÀ-ÖØ-öø-ÿ.\s]+/g # copyright dates
25-
- /[0-9]{4}[,:]?\s*[A-Za-zÀ-ÖØ-öø-ÿ.\s]+/g # copyright years
25+
- /\blib[a-z]+/g # libraries
26+
- /\b[0-9]{4}-[0-9]{2}-[0-9]{2}[,:][A-Za-zÀ-ÖØ-öø-ÿ.\s]+/g # copyright dates
27+
- /\b[0-9]{4}[,:]?\s*[A-Za-zÀ-ÖØ-öø-ÿ.\s]+/g # copyright years
2628
- /\[[A-Za-z0-9-]+\]\(https:\/\/github.com\/[A-Za-z0-9-]+\)/g # Github usernames
2729
- /-[DWw][a-zA-Z0-9_-]+=/g # compile flags
2830
- /[\['"`]-[DWw][a-zA-Z0-9_-]+['"`\]]/g # compile flags
31+
- ABCDEFGHIJKLMNOPQRSTUVWXYZ
32+
- ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
33+
overrides:
34+
- filename: "**/*_test.cpp" # all test files
35+
ignoreRegExpList:
36+
- /"[^"]*"/g # double-quoted strings
37+
- /'[^']*'/g # single-quoted strings
38+
- /`[^`]*`/g # backtick strings
2939
suggestWords:
3040
- xprl->xrpl
31-
- xprld->xrpld
32-
- unsynched->unsynced
41+
- xprld->xrpld # cspell: disable-line not sure what this problem is....
42+
- unsynched->unsynced # cspell: disable-line not sure what this problem is....
3343
- synched->synced
3444
- synch->sync
3545
words:
@@ -51,6 +61,8 @@ words:
5161
- Britto
5262
- Btrfs
5363
- canonicality
64+
- cdylib
65+
- changespq
5466
- checkme
5567
- choco
5668
- chrono
@@ -106,12 +118,14 @@ words:
106118
- inequation
107119
- insuf
108120
- insuff
121+
- invasively
109122
- iou
110123
- ious
111124
- isrdc
112125
- itype
113126
- jemalloc
114127
- jlog
128+
- jtnofill
115129
- keylet
116130
- keylets
117131
- keyvadb
@@ -138,6 +152,7 @@ words:
138152
- Metafuncton
139153
- misprediction
140154
- mptbalance
155+
- MPTDEX
141156
- mptflags
142157
- mptid
143158
- mptissuance
@@ -147,6 +162,7 @@ words:
147162
- mptokenissuance
148163
- mptokens
149164
- mpts
165+
- mtgox
150166
- multisig
151167
- multisign
152168
- multisigned
@@ -174,6 +190,7 @@ words:
174190
- perminute
175191
- permissioned
176192
- pointee
193+
- populator
177194
- preauth
178195
- preauthorization
179196
- preauthorize
@@ -182,6 +199,7 @@ words:
182199
- protobuf
183200
- protos
184201
- ptrs
202+
- pushd
185203
- pyenv
186204
- qalloc
187205
- queuable

include/xrpl/nodestore/Database.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,6 @@ class Database
133133
std::uint32_t ledgerSeq,
134134
std::function<void(std::shared_ptr<NodeObject> const&)>&& callback);
135135

136-
/** Remove expired entries from the positive and negative caches. */
137-
virtual void
138-
sweep() = 0;
139-
140136
/** Gather statistics pertaining to read and write activities.
141137
*
142138
* @param obj Json object reference into which to place counters.

0 commit comments

Comments
 (0)