Commit Graph

13695 Commits

Author SHA1 Message Date
CJ Cobb
28f4cc7817 Remove gRPC code previously used for the xpring SDK 2022-10-13 15:44:43 -07:00
Richard Holland
223606aacb more unit tests for hooks, still wip 2022-10-13 12:37:47 +00:00
Richard Holland
09a4087256 more hooks unit testing params/grants 2022-10-13 09:11:03 +00:00
Chenna Keshava B S
95fabd5762 Remove inacessible code paths and outdated data format wchar_t 2022-10-11 18:11:32 -07:00
Alexander Kremer
23ce431876 Remove const_cast usage 2022-10-11 16:38:10 -07:00
seelabs
04ef885108 Support for boost 1.80.0:
Boost intrusive renamed the `comp()` function -> `get_comp()`
2022-10-11 16:36:30 -07:00
manojsdoshi
d33df35378 Merge master (1.9.4) into develop (1.10.0-b2) 2022-10-11 16:34:36 -07:00
Richard Holland
f1cbeca57d params and grants tests, fix param validation 2022-10-11 12:52:08 +00:00
Richard Holland
01e7793df1 more test cases 2022-10-11 11:34:54 +00:00
Richard Holland
2a57c89176 more hook unit test tooling 2022-10-10 12:48:52 +00:00
Richard Holland
f5a0c951fe support inline wat2wasm in sethook unit tests 2022-10-10 09:36:40 +00:00
Richard Holland
a399cd2425 allow guard checker to work with stdin 2022-10-10 08:17:57 +00:00
Richard Holland
23da73a472 more hooks unit tests 2022-10-07 12:49:16 +00:00
Richard Holland
105cd06d7e add more hook unit tests, and test wasm checker 2022-10-07 11:41:33 +00:00
Richard Holland
eff650c922 initial wasm builder for unit testing 2022-10-07 09:01:00 +00:00
Richard Holland
8662adcff8 start of some js str_concat/find tests 2022-10-06 10:43:38 +00:00
Richard Holland
80ab5ce731 remove str_format 2022-10-06 10:20:19 +00:00
Richard Holland
28a4a50f0f str_concat finished, not tested 2022-10-06 10:09:06 +00:00
Richard Holland
04a938377d initial version of hook str api 2022-10-06 08:11:49 +00:00
Nik Bougalis
ba3c0e5145 Set version to 1.9.4 2022-09-20 18:23:13 -07:00
Michael Legleux
be1ce5eca9 Pin postgres, zlib, krb5, libuv and cassandra to stable versions 2022-09-20 18:22:37 -07:00
Richard Holland
e99ffe29a3 https://github.com/XRPL-Labs/xrpld-hooks/issues/51 2022-09-19 12:48:09 +00:00
Richard Holland
2273fe99a2 update readme 2022-09-19 12:22:03 +00:00
Richard Holland
cafa3484f4 tfStrongTSH for NFTs 2022-09-16 12:51:24 +00:00
Ikko Ashimine
df66e4151e Fix typo in detail/Node.h
minumum -> minimum
2022-09-14 14:17:30 -07:00
seelabs
9a31f321cd Allow gcc 12 compilation:
Compiling with gcc 12 on manjaro (arch variant) had compilation errors
without adding an additional include file.
2022-09-14 14:16:40 -07:00
Scott Schurr
e40e38e8d3 Introduce fixRemoveNFTokenAutoTrustLine amendment:
It turns out that the feature enabled by the tfTrustLine flag
on an NFTokenMint transaction could be used as a means to
attack the NFToken issuer.  Details are in
https://github.com/XRPLF/rippled/issues/4300

The fixRemoveNFTokenAutoTrustLine amendment removes the
ability to set the tfTrustLine flag on an NFTokenMint
transaction.

Closes 4300.
2022-09-14 14:15:20 -07:00
Howard Hinnant
f5af42a640 Remove use of deprecated std::iterator 2022-09-14 14:14:18 -07:00
Richard Holland
feee395231 further fix to sfHookNamespaces managment 2022-09-01 11:27:00 +00:00
Richard Holland
6dfbf39c99 add lockedbalance and lockcount to account_lines rpc 2022-08-30 11:15:03 +00:00
Richard Holland
73bf8f3fff add lockedbalance and lockcount to account_lines rpc 2022-08-30 11:11:31 +00:00
Richard Holland
ce09f9a4c6 make sfStateCount absent when it is 0 2022-08-30 09:32:10 +00:00
Richard Holland
d81cc2104b revise destroyNamespace logic 2022-08-30 09:15:28 +00:00
Richard Holland
267ad3703e fixup for compat with 193 2022-08-29 11:12:08 +00:00
Richard Holland
0e0355cf36 Merge remote-tracking branch 'ripple/develop' into develop 2022-08-29 10:52:04 +00:00
Richard Holland
5123736c51 start writing unit tests for SetHook 2022-08-29 10:42:19 +00:00
Richard Holland
8d85c87233 [FOLD] Rename error code OVERFLOW to XFL_OVERFLOW 2022-08-29 10:36:56 +00:00
Richard Holland
27167bb866 [FOLD] First round of review changes 2022-08-29 10:25:22 +00:00
Richard Holland
5a75d067e7 Merge branch 'develop' of github.com:XRPL-Labs/xrpld-hooks into develop 2022-08-29 09:34:03 +00:00
Richard Holland
37e2a12bf5 fix tracelog display bug 2022-08-29 09:33:44 +00:00
Nik Bougalis
fe05b8c4fe Set version to 1.10.0-b1 2022-08-25 08:49:18 -07:00
Nik Bougalis
7b3507bb87 Improve wrapper around OpenSSL RAND 2022-08-25 08:49:17 -07:00
Nik Bougalis
0ecfc7cb1a Improve self-signed certificate generation:
When starting, the code generates a new ephemeral private key and
a corresponding certificate to go along with it. This process can
take time and, while this is unlikely to matter for normal server
operations, it can have a significant impact for unit testing and
development. Profiling data suggests that ~20% of the time needed
for a unit test run can be attributed to this.

This commit does several things:

1. It restructures the code so that a new self-signed certificate
   and its corresponding private key are only initialized once at
   startup; this has minimal impact on the operation of a regular
   server.
2. It provides new default DH parameters. This doesn't impact the
   security of the connection, but those who compile from scratch
   can generate new parameters if they so choose.
3. It properly sets the version number in the certificate, fixing
   issue #4007; thanks to @donovanhide for the report.
4. It uses SHA-256 instead of SHA-1 as the hash algorithm for the
   certificate and adds some X.509 extensions as well as a random
   128-bit serial number.
5. It rounds the certificate's "start of validity" period so that
   the server's precise startup time cannot be easily deduced and
   limits the validity period to two years, down from ten years.
6. It removes some CBC-based ciphers from the default cipher list
   to avoid some potential security issues, such as CVE-2016-2107
   and CVE-2013-0169.
2022-08-25 08:49:17 -07:00
Nik Bougalis
e2eed966b0 Improve AccountID string conversion caching:
Caching the base58check encoded version of an `AccountID` has
performance advantages, because because of the computationally
heavy cost associated with the conversion, which requires the
application of SHA-256 twice.

This commit makes the cache significantly more efficient in terms
of memory used: it eliminates the map, using a vector with a size
that is determined by the configured size of the node, and a hash
function to directly map any given `AccountID` to a specific slot
in the cache; the eviction policy is simple: in case of collision
the existing entry is removed and replaced with the new data.

Previously, use of the cache was optional and required additional
effort by the programmer. Now the cache is automatic and does not
require any additional work or information.

The new cache also utilizes a 64-way spinlock, to help reduce any
contention that the pressure on the cache would impose.
2022-08-25 08:49:16 -07:00
Nik Bougalis
5a15229eeb Improve detection & handling of duplicate Node ID:
Each node on the network is supposed to have a unique cryptographic
identity. Typically, this identity is generated randomly at startup
and stored for later reuse in the (poorly named) file `wallet.db`.

If the file is copied, it is possible for two nodes to share the
same node identity. This is generally not desirable and existing
servers will detect and reject connections to other servers that
have the same key.

This commit achives three things:

1. It improves the detection code to pinpoint instances where two
   distinct servers with the same key connect with each other. In
   that case, servers will log an appropriate error and shut down
   pending intervention by the server's operator.
2. It makes it possible for server administrators to securely and
   easily generate new cryptographic identities for servers using
   the new `--newnodeid` command line arguments. When a server is
   started using this command, it will generate and save a random
   secure identity.
3. It makes it possible to configure the identity using a command
   line option, which makes it possible to derive it from data or
   parameters associated with the container or hardware where the
   instance is running by passing the `--nodeid` option, followed
   by a single argument identifying the infomation from which the
   node's identity is derived. For example, the following command
   will result in nodes with different hostnames having different
   node identities: `rippled --nodeid $HOSTNAME`

The last option is particularly useful for automated cloud-based
deployments that minimize the need for storing state and provide
unique deployment identifiers.

**Important note for server operators:**
Depending on variables outside of the the control of this code,
such as operating system version or configuration, permissions,
and more, it may be possible for other users or programs to be
able to access the command line arguments of other processes
on the system.

If you are operating in a shared environment, you should avoid
using this option, preferring instead to use the `[node_seed]`
option in the configuration file, and use permissions to limit
exposure of the node seed.

A user who gains access to the value used to derive the node's
unique identity could impersonate that node.

The commit also updates the minimum supported server protocol
version to `XRPL/2.1`, which has been supported since version
1.5.0 and eliminates support for `XPRL/2.0`.
2022-08-25 08:49:14 -07:00
Nik Bougalis
d318ab612a Avoid unnecessary copying and dynamic memory allocations
Co-authored-by: Chenna Keshava B S <ckbs.keshava56@gmail.com>
2022-08-25 08:49:14 -07:00
Chenna Keshava B S
9aaa0dff5f Build the command map at compile time (fixes #3298):
We profiled different algorithms and data structures to understand which
strategy is best from a performance standpoint:

- Linear search on an array;
- Binary search on a sorted array;
- Using `std::map`; and
- Using `std::unordered_map`.

Both linear search and std::unordered_map outperformed the other alternatives
so no change to the existing data structure is justified. If more handers are
added, this should be revisited.

For some additional details and timings, please see:
https://github.com/XRPLF/rippled/issues/3298#issuecomment-1185946010
2022-08-25 08:49:04 -07:00
Chenna Keshava B S
b88ed5a8ec Update command-line usage help message (fixes #3318) 2022-08-25 08:49:04 -07:00
Chenna Keshava B S
ce64f7a90f Remove deprecated AccountTxOld.cpp (fixes #2926) 2022-08-25 08:49:04 -07:00
Chenna Keshava B S
5e1cb09b88 Update broken link to hosted Doxygen content (fixes #4251) 2022-08-25 08:49:04 -07:00