Skip to content

Commit 1e033a0

Browse files
committed
Merge remote-tracking branch 'upstream/ripple/smart-escrow' into develop
2 parents 7f41012 + a184408 commit 1e033a0

File tree

130 files changed

+20073
-136
lines changed

Some content is hidden

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

130 files changed

+20073
-136
lines changed

.config/cspell.config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,7 @@ words:
272272
- venv
273273
- vfalco
274274
- vinnie
275+
- wasmi
275276
- wextra
276277
- wptr
277278
- writeme

.github/CODEOWNERS

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,2 @@
11
# Allow anyone to review any change by default.
22
*
3-
4-
# Require the rpc-reviewers team to review changes to the rpc code.
5-
include/xrpl/protocol/ @xrplf/rpc-reviewers
6-
src/libxrpl/protocol/ @xrplf/rpc-reviewers
7-
src/xrpld/rpc/ @xrplf/rpc-reviewers
8-
src/xrpld/app/misc/ @xrplf/rpc-reviewers

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ find_package(OpenSSL REQUIRED)
103103
find_package(secp256k1 REQUIRED)
104104
find_package(SOCI REQUIRED)
105105
find_package(SQLite3 REQUIRED)
106+
find_package(wasmi REQUIRED)
106107
find_package(xxHash REQUIRED)
107108

108109
target_link_libraries(

cfg/xrpld-example.cfg

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1290,6 +1290,39 @@
12901290
# Example:
12911291
# owner_reserve = 2000000 # 2 XRP
12921292
#
1293+
# extension_compute_limit = <gas>
1294+
#
1295+
# The extension compute limit is the maximum amount of gas that can be
1296+
# consumed by a single transaction. The gas limit is used to prevent
1297+
# transactions from consuming too many resources.
1298+
#
1299+
# If this parameter is unspecified, xrpld will use an internal
1300+
# default. Don't change this without understanding the consequences.
1301+
#
1302+
# Example:
1303+
# extension_compute_limit = 1000000 # 1 million gas
1304+
#
1305+
# extension_size_limit = <bytes>
1306+
#
1307+
# The extension size limit is the maximum size of a WASM extension in
1308+
# bytes. The size limit is used to prevent extensions from consuming
1309+
# too many resources.
1310+
#
1311+
# If this parameter is unspecified, xrpld will use an internal
1312+
# default. Don't change this without understanding the consequences.
1313+
#
1314+
# Example:
1315+
# extension_size_limit = 100000 # 100 kb
1316+
#
1317+
# gas_price = <bytes>
1318+
#
1319+
# The gas price is the conversion between WASM gas and its price in drops.
1320+
#
1321+
# If this parameter is unspecified, xrpld will use an internal
1322+
# default. Don't change this without understanding the consequences.
1323+
#
1324+
# Example:
1325+
# gas_price = 1000000 # 1 drop per gas
12931326
#-------------------------------------------------------------------------------
12941327
#
12951328
# 9. Misc Settings

cmake/XrplCore.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ target_link_libraries(
4040
Xrpl::opts
4141
Xrpl::syslibs
4242
secp256k1::secp256k1
43+
wasmi::wasmi
4344
xrpl.libpb
4445
xxHash::xxhash
4546
$<$<BOOL:${voidstar}>:antithesis-sdk-cpp>)

conan.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"requires": [
44
"zlib/1.3.1#b8bc2603263cf7eccbd6e17e66b0ed76%1765850150.075",
55
"xxhash/0.8.3#681d36a0a6111fc56e5e45ea182c19cc%1765850149.987",
6+
"wasmi/1.0.6#407c9db14601a8af1c7dd3b388f3e4cd%1768164779.349",
67
"sqlite3/3.49.1#8631739a4c9b93bd3d6b753bac548a63%1765850149.926",
78
"soci/4.0.3#a9f8d773cd33e356b5879a4b0564f287%1765850149.46",
89
"snappy/1.1.10#968fef506ff261592ec30c574d4a7809%1765850147.878",

conanfile.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ class Xrpl(ConanFile):
3434
"openssl/3.5.5",
3535
"secp256k1/0.7.0",
3636
"soci/4.0.3",
37+
"wasmi/1.0.6",
3738
"zlib/1.3.1",
3839
]
3940

@@ -212,6 +213,7 @@ def package_info(self):
212213
"soci::soci",
213214
"secp256k1::secp256k1",
214215
"sqlite3::sqlite",
216+
"wasmi::wasmi",
215217
"xxhash::xxhash",
216218
"zlib::zlib",
217219
]

include/xrpl/basics/Number.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -716,6 +716,10 @@ abs(Number x) noexcept
716716
Number
717717
power(Number const& f, unsigned n);
718718

719+
// logarithm with base 10
720+
Number
721+
log10(Number const& value, int iterations = 50);
722+
719723
// Returns f^(1/d)
720724
// Uses Newton–Raphson iterations until the result stops changing
721725
// to find the root of the polynomial g(x) = x^d - f

include/xrpl/ledger/ApplyViewImpl.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,18 @@ class ApplyViewImpl final : public detail::ApplyViewBase
4848
deliver_ = amount;
4949
}
5050

51+
void
52+
setGasUsed(std::optional<std::uint32_t> const gasUsed)
53+
{
54+
gasUsed_ = gasUsed;
55+
}
56+
57+
void
58+
setWasmReturnCode(std::int32_t const wasmReturnCode)
59+
{
60+
wasmReturnCode_ = wasmReturnCode;
61+
}
62+
5163
/** Get the number of modified entries
5264
*/
5365
std::size_t
@@ -66,6 +78,8 @@ class ApplyViewImpl final : public detail::ApplyViewBase
6678

6779
private:
6880
std::optional<STAmount> deliver_;
81+
std::optional<std::uint32_t> gasUsed_;
82+
std::optional<std::int32_t> wasmReturnCode_;
6983
};
7084

7185
} // namespace xrpl

include/xrpl/ledger/detail/ApplyStateTable.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ class ApplyStateTable
5252
TER ter,
5353
std::optional<STAmount> const& deliver,
5454
std::optional<uint256 const> const& parentBatchId,
55+
std::optional<std::uint32_t> const& gasUsed,
56+
std::optional<std::int32_t> const& wasmReturnCode,
5557
bool isDryRun,
5658
beast::Journal j);
5759

0 commit comments

Comments
 (0)