Compare commits

..

78 Commits

Author SHA1 Message Date
Ed Hennis
c8ff090d8e Merge branch 'develop' into ximinez/fixed-ledger-entries 2025-11-03 18:04:00 -05:00
Mayukha Vadari
b18dece145 refactor: move API functions from RPCHelpers.h to ApiVersion.h (#5889)
This change moves two functions, `setVersion` and `getAPIVersionNumber`, from `RPCHelpers.h` to `ApiVersion.h`.
2025-11-03 19:09:14 +00:00
Jingchen
63a08560ca refactor: retire/remove NFT amendments (#5971)
Amendments activated for more than 2 years can be retired, and obsolete retirements that were never activated can also be removed after 2 years. This change retires the NonFungibleTokensV1_1, fixNonFungibleTokensV1_2, and fixNFTokenRemint amendments, and removes the NonFungibleTokensV1, fixNFTokenNegOffer, and fixNFTokenDirV1 amendments.
2025-11-03 18:43:57 +00:00
Ed Hennis
945c362559 Merge branch 'develop' into ximinez/fixed-ledger-entries 2025-11-03 12:41:52 -05:00
Jingchen
8ac8a47c99 refactor: Retire ImmediateOfferKilled amendment (#5973)
Amendments activated for more than 2 years can be retired. This change retires the ImmediateOfferKilled amendment.
2025-11-03 17:26:12 +00:00
Bart
12c4b5a632 ci: Update CI image hashes to use netstat (#5987)
To debug test failures we would like to use `netstat`, but that package wasn't installed yet in the CI images. This change uses the new CI images created by https://github.com/XRPLF/ci/pull/79.
2025-11-03 16:57:24 +00:00
Bart
25c5e3b17f chore: Remove version number in find_dependency for OpenSSL (#5985)
We are already using OpenSSL 3.5.2. The version number in the `find_dependency` statement is optional, and belongs in `conanfile.py` anyway.
2025-11-03 13:53:19 +00:00
Jingchen
8eb233c2ea refactor: Modularize shamap and nodestore (#5668)
This change moves the shamap and nodestore from `xrpld` to `libxrpl`.
2025-10-31 22:25:16 +00:00
Jingchen
50fc93f742 refactor: Retire fixMasterKeyAsRegularKey amendment (#5959)
Amendments activated for more than 2 years can be retired. This change retires the fixMasterKeyAsRegularKey amendment.
2025-10-31 21:01:44 +00:00
Jingchen
ab45a8a737 refactor: Retire fixReducedOffersV1 amendment (#5972)
Amendments activated for more than 2 years can be retired. This change retires the fixReducedOffersV1 amendment.
2025-10-31 20:25:05 +00:00
Jingchen
dfafb141cc refactor: Retire fixAmendmentMajorityCalc amendment (#5961)
Amendments activated for more than 2 years can be retired. This change retires the fixAmendmentMajorityCalc amendment.
2025-10-31 20:01:12 +00:00
Mayukha Vadari
4e32d2ed98 refactor: Clean up TxMeta (#5845)
This change:
* Simplifies the `TxMeta` constructors - both were setting the same set of fields, and to make it harder for future bugs to arise and keep the code DRY, we can combine those into one helper function.
* Removes an unused constructor.
* Renames the variables to avoid Hungarian naming.
* Removes a bunch of now-unnecessary helper functions.
2025-10-31 19:29:30 +00:00
yinyiqian1
fa69918124 fix: Address permission delegation vulnerability (#5825)
This change introduces the `featurePermissionDelegationV1_1` amendment, which is designed to supersede both `featurePermissionDelegation` and `fixDelegateV1_1 amendments, which should be considered deprecated. The `checkPermission` function will now return `terNO_DELEGATE_PERMISSION` when a delegate transaction lacks the necessary permissions.
2025-10-31 15:01:06 -04:00
Ed Hennis
9546c52013 Merge branch 'develop' into ximinez/fixed-ledger-entries 2025-10-31 13:51:19 -04:00
Ed Hennis
cbbb2b1be0 test: Count crashed test suites (#5924)
When outputting the unit test summary, this change counts crashed tests as failures.
2025-10-31 17:10:53 +00:00
Ed Hennis
3a099aeb64 Merge branch 'develop' into ximinez/fixed-ledger-entries 2025-10-31 12:51:28 -04:00
Vlad
cf2d763fa1 refactor: Improve txset handling (#5951) 2025-10-31 16:10:14 +00:00
Ed Hennis
8567bd0d12 Merge branch 'develop' into ximinez/fixed-ledger-entries 2025-10-29 14:23:15 -04:00
Ed Hennis
3cb1851537 Merge branch 'develop' into ximinez/fixed-ledger-entries 2025-10-29 13:42:25 -04:00
Ed Hennis
55feea308e Merge branch 'develop' into ximinez/fixed-ledger-entries 2025-10-29 12:54:20 -04:00
Ed Hennis
a6692af17a Merge branch 'develop' into ximinez/fixed-ledger-entries 2025-10-28 17:38:25 -04:00
Ed Hennis
1d058a5d78 Merge branch 'develop' into ximinez/fixed-ledger-entries 2025-10-26 19:12:36 -04:00
Ed Hennis
a70821adc5 Merge branch 'develop' into ximinez/fixed-ledger-entries 2025-10-23 13:24:29 -04:00
Ed Hennis
bfeb60d3f5 Merge branch 'develop' into ximinez/fixed-ledger-entries 2025-10-22 11:38:53 -04:00
Ed Hennis
c86bfa32f7 Merge branch 'develop' into ximinez/fixed-ledger-entries 2025-10-21 22:20:09 -04:00
Ed Hennis
0f44d619b6 Merge branch 'develop' into ximinez/fixed-ledger-entries 2025-10-17 18:21:41 -04:00
Ed Hennis
2add6a7917 Merge branch 'develop' into ximinez/fixed-ledger-entries 2025-10-16 13:12:12 -04:00
Ed Hennis
d21c4f3218 Merge branch 'develop' into ximinez/fixed-ledger-entries 2025-10-16 10:48:48 -04:00
Ed Hennis
265a504301 Merge branch 'develop' into ximinez/fixed-ledger-entries 2025-10-10 13:01:37 -04:00
Ed Hennis
b1e576d3d1 Merge branch 'develop' into ximinez/fixed-ledger-entries 2025-10-09 15:14:51 -04:00
Ed Hennis
d2d3039ce6 Merge branch 'develop' into ximinez/fixed-ledger-entries 2025-10-08 14:21:37 -04:00
Ed Hennis
16e85a7b79 Merge branch 'develop' into ximinez/fixed-ledger-entries 2025-10-02 11:03:12 -04:00
Ed Hennis
4ae1c01e13 Merge branch 'develop' into ximinez/fixed-ledger-entries 2025-10-01 18:11:01 -04:00
Ed Hennis
8807afc074 Merge branch 'develop' into ximinez/fixed-ledger-entries 2025-10-01 13:14:26 -04:00
Ed Hennis
a4e13e07d5 Merge branch 'develop' into ximinez/fixed-ledger-entries 2025-09-30 22:28:57 -04:00
Ed Hennis
6067d59336 Merge branch 'develop' into ximinez/fixed-ledger-entries 2025-09-29 18:34:47 -04:00
Ed Hennis
e14aecee66 Merge branch 'develop' into ximinez/fixed-ledger-entries 2025-09-29 13:32:16 -04:00
Ed Hennis
0e4c3e3427 Merge branch 'develop' into ximinez/fixed-ledger-entries 2025-09-26 19:26:10 -04:00
Ed Hennis
da5c563426 Merge branch 'develop' into ximinez/fixed-ledger-entries 2025-09-26 13:41:39 -04:00
Ed Hennis
b9f5d8b1c5 Merge branch 'develop' into ximinez/fixed-ledger-entries 2025-09-26 12:09:21 -04:00
Ed Hennis
5ea7b562a2 Review feedback from @mvadari: Document test lambdas 2025-09-25 14:23:10 -04:00
Ed Hennis
8450970b80 Merge branch 'develop' into ximinez/fixed-ledger-entries 2025-09-25 13:27:21 -04:00
Ed Hennis
14d4cff530 Merge branch 'develop' into ximinez/fixed-ledger-entries 2025-09-24 15:50:03 -04:00
Ed Hennis
88ac659d86 Move the lambda to the top so that the parse functions stay alphabetical 2025-09-24 12:54:47 -04:00
Ed Hennis
43fdbf27b9 Merge branch 'develop' into ximinez/fixed-ledger-entries 2025-09-20 15:44:43 -04:00
Ed Hennis
1e33f8e868 Merge branch 'develop' into ximinez/fixed-ledger-entries 2025-09-18 14:08:38 -04:00
Ed Hennis
a6e30857df Merge branch 'develop' into ximinez/fixed-ledger-entries 2025-09-18 12:26:54 -04:00
Ed Hennis
563f24edb0 Merge branch 'develop' into ximinez/fixed-ledger-entries 2025-09-17 10:49:24 -04:00
Ed Hennis
a89f6d5da2 Merge branch 'develop' into ximinez/fixed-ledger-entries 2025-09-16 11:15:08 -04:00
Ed Hennis
5b2e91986a Merge branch 'develop' into ximinez/fixed-ledger-entries 2025-09-15 11:13:49 -04:00
Ed Hennis
fbc5056817 Gate the new "index: special_case" on the current beta apiVersion 3 2025-09-12 14:02:38 -04:00
Ed Hennis
b7cafed040 Merge branch 'develop' into ximinez/fixed-ledger-entries 2025-09-11 10:33:34 -04:00
Ed Hennis
b6ebd34b30 Merge branch 'develop' into ximinez/fixed-ledger-entries 2025-09-10 19:40:02 -04:00
Ed Hennis
74c2765159 Merge branch 'develop' into ximinez/fixed-ledger-entries 2025-09-09 17:14:37 -04:00
Ed Hennis
62c7fdadba Merge branch 'develop' into ximinez/fixed-ledger-entries 2025-09-08 11:42:06 -04:00
Ed Hennis
372c66e684 Merge branch 'develop' into ximinez/fixed-ledger-entries 2025-09-05 17:44:24 -04:00
Ed Hennis
a2fab5bcaf Merge branch 'develop' into ximinez/fixed-ledger-entries 2025-09-04 20:25:13 -04:00
Ed Hennis
2e4f41571c Merge branch 'develop' into ximinez/fixed-ledger-entries 2025-09-04 16:44:07 -04:00
Ed Hennis
8799a6dbfd Merge branch 'develop' into ximinez/fixed-ledger-entries 2025-09-04 12:36:56 -04:00
Ed Hennis
e655087027 Merge branch 'develop' into ximinez/fixed-ledger-entries 2025-09-03 14:04:19 -04:00
Ed Hennis
46bd2a4090 Merge remote-tracking branch 'upstream/develop' into ximinez/fixed-ledger-entries
* upstream/develop:
  Refactor `ledger_entry` RPC source code and tests (5237)
2025-08-29 17:55:45 -04:00
Ed Hennis
f3b8a8aef3 Merge branch 'develop' into ximinez/fixed-ledger-entries 2025-08-29 10:43:07 -04:00
Ed Hennis
ee0c917e95 Merge branch 'develop' into ximinez/fixed-ledger-entries 2025-08-28 18:17:43 -04:00
Ed Hennis
375aedd340 Merge branch 'develop' into ximinez/fixed-ledger-entries 2025-08-27 11:15:17 -04:00
Ed Hennis
95397a7710 Merge branch 'develop' into ximinez/fixed-ledger-entries 2025-08-25 19:51:08 -04:00
Ed Hennis
7af8a52d27 Merge branch 'develop' into ximinez/fixed-ledger-entries 2025-08-22 20:34:53 -04:00
Ed Hennis
326a8093c9 Merge branch 'develop' into ximinez/fixed-ledger-entries 2025-08-22 19:31:27 -04:00
Ed Hennis
9f0e159205 Merge branch 'develop' into ximinez/fixed-ledger-entries 2025-08-22 19:08:59 -04:00
Ed Hennis
2fda101b44 Merge branch 'develop' into ximinez/fixed-ledger-entries 2025-08-21 11:39:13 -04:00
Ed Hennis
e6e1e4f9dd Merge branch 'develop' into ximinez/fixed-ledger-entries 2025-08-19 16:05:38 -04:00
Ed Hennis
70591265e5 Merge branch 'develop' into ximinez/fixed-ledger-entries 2025-08-18 12:26:01 -04:00
Ed Hennis
ed1d477a45 Merge branch 'develop' into ximinez/fixed-ledger-entries 2025-08-08 18:23:40 -04:00
Ed Hennis
cd58f636d3 Merge branch 'develop' into ximinez/fixed-ledger-entries 2025-08-06 21:03:20 -04:00
Ed Hennis
3152f2233f Merge branch 'develop' into ximinez/fixed-ledger-entries 2025-08-05 21:17:03 -04:00
Ed Hennis
0c147a895c Restrict which values are valid for fixed types.
- True or a ledger index for those that can't parameters
- Number, true, or a ledger index for "hashes".
2025-08-04 19:23:59 -04:00
Ed Hennis
cf80710ef1 Refactor a little bit to reduce future conflicts
- Specifically #5237
2025-08-04 17:38:52 -04:00
Ed Hennis
fc929ab984 Add support for "index":"fixed type" lookups in ledger_entry
- For example "index":"amendments" will return the amendments object as
  if the request was
  "index":"7DB0788C020F02780A673DC74757F23823FA3014C1866E72CC4CD8B226CD6EF4"
- Works for amendments, fee, nunl, and hashes (for the recent history
  list only).
- Always returns the valid computed index, even if the object is not
  found.
2025-08-04 17:23:45 -04:00
Ed Hennis
145a8817dc Add ledger_entry options for fee, amendments, NUNL, and hashes
- Request format for fee, amendments, and nunl is
  "fieldName":<any valid json>, including null. Because these types
  have no inputs to the index computation, any value
  works.
- Request format for hashes is "hashes":<uint value or any valid
  json>. If the value is numeric, and evaluates to a uint, return the
  hashes history page for that ledger sequence. (AKA "long" skip list.)
  Any other valid json value will return the "short" skip list.
2025-08-04 17:23:43 -04:00
209 changed files with 1909 additions and 3454 deletions

View File

@@ -17,7 +17,7 @@ Loop: xrpld.app xrpld.rpc
xrpld.rpc > xrpld.app
Loop: xrpld.app xrpld.shamap
xrpld.app > xrpld.shamap
xrpld.shamap ~= xrpld.app
Loop: xrpld.core xrpld.perflog
xrpld.perflog == xrpld.core

View File

@@ -8,6 +8,10 @@ libxrpl.ledger > xrpl.ledger
libxrpl.ledger > xrpl.protocol
libxrpl.net > xrpl.basics
libxrpl.net > xrpl.net
libxrpl.nodestore > xrpl.basics
libxrpl.nodestore > xrpl.json
libxrpl.nodestore > xrpl.nodestore
libxrpl.nodestore > xrpl.protocol
libxrpl.protocol > xrpl.basics
libxrpl.protocol > xrpl.json
libxrpl.protocol > xrpl.protocol
@@ -18,6 +22,9 @@ libxrpl.server > xrpl.basics
libxrpl.server > xrpl.json
libxrpl.server > xrpl.protocol
libxrpl.server > xrpl.server
libxrpl.shamap > xrpl.basics
libxrpl.shamap > xrpl.protocol
libxrpl.shamap > xrpl.shamap
test.app > test.jtx
test.app > test.rpc
test.app > test.toplevel
@@ -25,11 +32,11 @@ test.app > test.unit_test
test.app > xrpl.basics
test.app > xrpld.app
test.app > xrpld.core
test.app > xrpld.nodestore
test.app > xrpld.overlay
test.app > xrpld.rpc
test.app > xrpl.json
test.app > xrpl.ledger
test.app > xrpl.nodestore
test.app > xrpl.protocol
test.app > xrpl.resource
test.basics > test.jtx
@@ -86,8 +93,7 @@ test.nodestore > test.toplevel
test.nodestore > test.unit_test
test.nodestore > xrpl.basics
test.nodestore > xrpld.core
test.nodestore > xrpld.nodestore
test.nodestore > xrpld.unity
test.nodestore > xrpl.nodestore
test.overlay > test.jtx
test.overlay > test.toplevel
test.overlay > test.unit_test
@@ -95,8 +101,8 @@ test.overlay > xrpl.basics
test.overlay > xrpld.app
test.overlay > xrpld.overlay
test.overlay > xrpld.peerfinder
test.overlay > xrpld.shamap
test.overlay > xrpl.protocol
test.overlay > xrpl.shamap
test.peerfinder > test.beast
test.peerfinder > test.unit_test
test.peerfinder > xrpl.basics
@@ -131,9 +137,9 @@ test.server > xrpl.json
test.server > xrpl.server
test.shamap > test.unit_test
test.shamap > xrpl.basics
test.shamap > xrpld.nodestore
test.shamap > xrpld.shamap
test.shamap > xrpl.nodestore
test.shamap > xrpl.protocol
test.shamap > xrpl.shamap
test.toplevel > test.csf
test.toplevel > xrpl.json
test.unit_test > xrpl.basics
@@ -144,6 +150,8 @@ xrpl.json > xrpl.basics
xrpl.ledger > xrpl.basics
xrpl.ledger > xrpl.protocol
xrpl.net > xrpl.basics
xrpl.nodestore > xrpl.basics
xrpl.nodestore > xrpl.protocol
xrpl.protocol > xrpl.basics
xrpl.protocol > xrpl.json
xrpl.resource > xrpl.basics
@@ -152,17 +160,21 @@ xrpl.resource > xrpl.protocol
xrpl.server > xrpl.basics
xrpl.server > xrpl.json
xrpl.server > xrpl.protocol
xrpl.shamap > xrpl.basics
xrpl.shamap > xrpl.nodestore
xrpl.shamap > xrpl.protocol
xrpld.app > test.unit_test
xrpld.app > xrpl.basics
xrpld.app > xrpld.conditions
xrpld.app > xrpld.consensus
xrpld.app > xrpld.nodestore
xrpld.app > xrpld.perflog
xrpld.app > xrpl.json
xrpld.app > xrpl.ledger
xrpld.app > xrpl.net
xrpld.app > xrpl.nodestore
xrpld.app > xrpl.protocol
xrpld.app > xrpl.resource
xrpld.app > xrpl.shamap
xrpld.conditions > xrpl.basics
xrpld.conditions > xrpl.protocol
xrpld.consensus > xrpl.basics
@@ -172,11 +184,6 @@ xrpld.core > xrpl.basics
xrpld.core > xrpl.json
xrpld.core > xrpl.net
xrpld.core > xrpl.protocol
xrpld.nodestore > xrpl.basics
xrpld.nodestore > xrpld.core
xrpld.nodestore > xrpld.unity
xrpld.nodestore > xrpl.json
xrpld.nodestore > xrpl.protocol
xrpld.overlay > xrpl.basics
xrpld.overlay > xrpld.core
xrpld.overlay > xrpld.peerfinder
@@ -192,13 +199,11 @@ xrpld.perflog > xrpl.basics
xrpld.perflog > xrpl.json
xrpld.rpc > xrpl.basics
xrpld.rpc > xrpld.core
xrpld.rpc > xrpld.nodestore
xrpld.rpc > xrpl.json
xrpld.rpc > xrpl.ledger
xrpld.rpc > xrpl.net
xrpld.rpc > xrpl.nodestore
xrpld.rpc > xrpl.protocol
xrpld.rpc > xrpl.resource
xrpld.rpc > xrpl.server
xrpld.shamap > xrpl.basics
xrpld.shamap > xrpld.nodestore
xrpld.shamap > xrpl.protocol
xrpld.shamap > xrpl.shamap

View File

@@ -15,168 +15,168 @@
"distro_version": "bookworm",
"compiler_name": "gcc",
"compiler_version": "12",
"image_sha": "6948666"
"image_sha": "97ba375"
},
{
"distro_name": "debian",
"distro_version": "bookworm",
"compiler_name": "gcc",
"compiler_version": "13",
"image_sha": "6948666"
"image_sha": "97ba375"
},
{
"distro_name": "debian",
"distro_version": "bookworm",
"compiler_name": "gcc",
"compiler_version": "14",
"image_sha": "6948666"
"image_sha": "97ba375"
},
{
"distro_name": "debian",
"distro_version": "bookworm",
"compiler_name": "gcc",
"compiler_version": "15",
"image_sha": "6948666"
"image_sha": "97ba375"
},
{
"distro_name": "debian",
"distro_version": "bookworm",
"compiler_name": "clang",
"compiler_version": "16",
"image_sha": "6948666"
"image_sha": "97ba375"
},
{
"distro_name": "debian",
"distro_version": "bookworm",
"compiler_name": "clang",
"compiler_version": "17",
"image_sha": "6948666"
"image_sha": "97ba375"
},
{
"distro_name": "debian",
"distro_version": "bookworm",
"compiler_name": "clang",
"compiler_version": "18",
"image_sha": "6948666"
"image_sha": "97ba375"
},
{
"distro_name": "debian",
"distro_version": "bookworm",
"compiler_name": "clang",
"compiler_version": "19",
"image_sha": "6948666"
"image_sha": "97ba375"
},
{
"distro_name": "debian",
"distro_version": "bookworm",
"compiler_name": "clang",
"compiler_version": "20",
"image_sha": "6948666"
"image_sha": "97ba375"
},
{
"distro_name": "rhel",
"distro_version": "8",
"compiler_name": "gcc",
"compiler_version": "14",
"image_sha": "10e69b4"
"image_sha": "97ba375"
},
{
"distro_name": "rhel",
"distro_version": "8",
"compiler_name": "clang",
"compiler_version": "any",
"image_sha": "10e69b4"
"image_sha": "97ba375"
},
{
"distro_name": "rhel",
"distro_version": "9",
"compiler_name": "gcc",
"compiler_version": "12",
"image_sha": "10e69b4"
"image_sha": "97ba375"
},
{
"distro_name": "rhel",
"distro_version": "9",
"compiler_name": "gcc",
"compiler_version": "13",
"image_sha": "10e69b4"
"image_sha": "97ba375"
},
{
"distro_name": "rhel",
"distro_version": "9",
"compiler_name": "gcc",
"compiler_version": "14",
"image_sha": "10e69b4"
"image_sha": "97ba375"
},
{
"distro_name": "rhel",
"distro_version": "9",
"compiler_name": "clang",
"compiler_version": "any",
"image_sha": "10e69b4"
"image_sha": "97ba375"
},
{
"distro_name": "rhel",
"distro_version": "10",
"compiler_name": "gcc",
"compiler_version": "14",
"image_sha": "10e69b4"
"image_sha": "97ba375"
},
{
"distro_name": "rhel",
"distro_version": "10",
"compiler_name": "clang",
"compiler_version": "any",
"image_sha": "10e69b4"
"image_sha": "97ba375"
},
{
"distro_name": "ubuntu",
"distro_version": "jammy",
"compiler_name": "gcc",
"compiler_version": "12",
"image_sha": "6948666"
"image_sha": "97ba375"
},
{
"distro_name": "ubuntu",
"distro_version": "noble",
"compiler_name": "gcc",
"compiler_version": "13",
"image_sha": "6948666"
"image_sha": "97ba375"
},
{
"distro_name": "ubuntu",
"distro_version": "noble",
"compiler_name": "gcc",
"compiler_version": "14",
"image_sha": "6948666"
"image_sha": "97ba375"
},
{
"distro_name": "ubuntu",
"distro_version": "noble",
"compiler_name": "clang",
"compiler_version": "16",
"image_sha": "6948666"
"image_sha": "97ba375"
},
{
"distro_name": "ubuntu",
"distro_version": "noble",
"compiler_name": "clang",
"compiler_version": "17",
"image_sha": "6948666"
"image_sha": "97ba375"
},
{
"distro_name": "ubuntu",
"distro_version": "noble",
"compiler_name": "clang",
"compiler_version": "18",
"image_sha": "6948666"
"image_sha": "97ba375"
},
{
"distro_name": "ubuntu",
"distro_version": "noble",
"compiler_name": "clang",
"compiler_version": "19",
"image_sha": "6948666"
"image_sha": "97ba375"
}
],
"build_type": ["Debug", "Release"],

View File

@@ -1,13 +1,10 @@
# This workflow runs all workflows to check, build, package and test the project on
# various Linux flavors, as well as on macOS and Windows, on every push to a
# This workflow runs all workflows to check, build and test the project on
# various Linux flavors, as well as on MacOS and Windows, on every push to a
# user branch. However, it will not run if the pull request is a draft unless it
# has the 'DraftRunCI' label.
name: PR
on:
push:
branches:
- legleux/linux_packages
merge_group:
types:
- checks_requested
@@ -65,7 +62,6 @@ jobs:
.github/workflows/reusable-build.yml
.github/workflows/reusable-build-test-config.yml
.github/workflows/reusable-build-test.yml
.github/workflows/reusable-build-pkg.yml
.github/workflows/reusable-strategy-matrix.yml
.github/workflows/reusable-test.yml
.codecov.yml
@@ -73,7 +69,6 @@ jobs:
conan/**
external/**
include/**
pkgs/**
src/**
tests/**
CMakeLists.txt
@@ -98,57 +93,40 @@ jobs:
outputs:
go: ${{ steps.go.outputs.go == 'true' }}
# check-levelization:
# needs: should-run
# if: ${{ needs.should-run.outputs.go == 'true' }}
# uses: ./.github/workflows/reusable-check-levelization.yml
# build-test:
# needs: should-run
# if: ${{ needs.should-run.outputs.go == 'true' }}
# uses: ./.github/workflows/reusable-build-test.yml
# strategy:
# matrix:
# os: [linux, macos, windows]
# with:
# os: ${{ matrix.os }}
# secrets:
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
build-package:
name: Build ${{ matrix.pkg_type }}-${{ matrix.arch }} packages
check-levelization:
needs: should-run
if: ${{ needs.should-run.outputs.go == 'true' }}
uses: ./.github/workflows/reusable-build-pkg.yml
secrets: inherit
uses: ./.github/workflows/reusable-check-levelization.yml
build-test:
needs: should-run
if: ${{ needs.should-run.outputs.go == 'true' }}
uses: ./.github/workflows/reusable-build-test.yml
strategy:
fail-fast: false
matrix:
# pkg_type: [rpm]
pkg_type: [deb, rpm]
arch: [amd64]
# arch: [amd64, arm64]
os: [linux, macos, windows]
with:
pkg_type: ${{ matrix.pkg_type }}
arch: ${{ matrix.arch }}
os: ${{ matrix.os }}
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
# notify-clio:
# needs:
# - should-run
# - build-test
# if: ${{ needs.should-run.outputs.go == 'true' && contains(fromJSON('["release", "master"]'), github.ref_name) }}
# uses: ./.github/workflows/reusable-notify-clio.yml
# secrets:
# clio_notify_token: ${{ secrets.CLIO_NOTIFY_TOKEN }}
# conan_remote_username: ${{ secrets.CONAN_REMOTE_USERNAME }}
# conan_remote_password: ${{ secrets.CONAN_REMOTE_PASSWORD }}
notify-clio:
needs:
- should-run
- build-test
if: ${{ needs.should-run.outputs.go == 'true' && contains(fromJSON('["release", "master"]'), github.ref_name) }}
uses: ./.github/workflows/reusable-notify-clio.yml
secrets:
clio_notify_token: ${{ secrets.CLIO_NOTIFY_TOKEN }}
conan_remote_username: ${{ secrets.CONAN_REMOTE_USERNAME }}
conan_remote_password: ${{ secrets.CONAN_REMOTE_PASSWORD }}
passed:
if: failure() || cancelled()
needs:
# - build-test
# - check-levelization
- build-package
- build-test
- check-levelization
runs-on: ubuntu-latest
steps:
- name: Fail

View File

@@ -12,7 +12,6 @@ on:
- "develop"
- "release*"
- "master"
- "legleux/linux_packages"
paths:
# These paths are unique to `on-trigger.yml`.
- ".github/workflows/reusable-check-missing-commits.yml"
@@ -27,7 +26,6 @@ on:
- ".github/workflows/reusable-build.yml"
- ".github/workflows/reusable-build-test-config.yml"
- ".github/workflows/reusable-build-test.yml"
- ".github/workflows/reusable-build-pkg.yml"
- ".github/workflows/reusable-strategy-matrix.yml"
- ".github/workflows/reusable-test.yml"
- ".codecov.yml"
@@ -35,7 +33,6 @@ on:
- "conan/**"
- "external/**"
- "include/**"
- "pkgs/**"
- "src/**"
- "tests/**"
- "CMakeLists.txt"
@@ -66,32 +63,18 @@ defaults:
shell: bash
jobs:
# check-missing-commits:
# if: ${{ github.event_name == 'push' && github.ref_type == 'branch' && contains(fromJSON('["develop", "release"]'), github.ref_name) }}
# uses: ./.github/workflows/reusable-check-missing-commits.yml
check-missing-commits:
if: ${{ github.event_name == 'push' && github.ref_type == 'branch' && contains(fromJSON('["develop", "release"]'), github.ref_name) }}
uses: ./.github/workflows/reusable-check-missing-commits.yml
# build-test:
# uses: ./.github/workflows/reusable-build-test.yml
# strategy:
# matrix:
# os: [linux, macos, windows]
# with:
# os: ${{ matrix.os }}
# strategy_matrix: ${{ github.event_name == 'schedule' && 'all' || 'minimal' }}
# secrets:
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
build-package:
name: Build ${{ matrix.pkg_type }}-${{ matrix.arch }} packages
uses: ./.github/workflows/reusable-build-pkg.yml
secrets: inherit
build-test:
uses: ./.github/workflows/reusable-build-test.yml
strategy:
fail-fast: ${{ github.event_name == 'merge_group' }}
matrix:
# pkg_type: [rpm]
pkg_type: [deb, rpm]
arch: [amd64]
# arch: [amd64, arm64]
os: [linux, macos, windows]
with:
pkg_type: ${{ matrix.pkg_type }}
arch: ${{ matrix.arch }}
os: ${{ matrix.os }}
strategy_matrix: ${{ github.event_name == 'schedule' && 'all' || 'minimal' }}
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

View File

@@ -1,32 +0,0 @@
on:
workflow_call:
inputs:
pkg_type:
required: false
type: string
arch:
required: false
type: string
defaults:
run:
shell: bash
jobs:
build:
name: Build ${{ inputs.pkg_type }}-${{ inputs.arch }} package
runs-on: heavy${{ inputs.arch == 'arm64' && '-arm64' || '' }}
container: ghcr.io/xrplf/ci/${{ inputs.pkg_type == 'rpm' && 'rhel-9' || 'debian-bookworm' }}:gcc-12
steps:
- name: Checkout repository
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
- name: Build packages
run: |
./pkgs/build.sh
cat build_vars >> $GITHUB_STEP_SUMMARY
- uses: actions/upload-artifact@v4
with:
name: ${{ inputs.pkg_type }}-${{ inputs.arch }}
path: "*${{ inputs.arch }}.${{ inputs.pkg_type }}"
if-no-files-found: error

View File

@@ -45,7 +45,7 @@ if (static OR APPLE OR MSVC)
set (OPENSSL_USE_STATIC_LIBS ON)
endif ()
set (OPENSSL_MSVC_STATIC_RT ON)
find_dependency (OpenSSL 1.1.1 REQUIRED)
find_dependency (OpenSSL REQUIRED)
find_dependency (ZLIB)
find_dependency (date)
if (TARGET ZLIB::ZLIB)

View File

@@ -53,14 +53,15 @@ add_library(xrpl.imports.main INTERFACE)
target_link_libraries(xrpl.imports.main
INTERFACE
LibArchive::LibArchive
OpenSSL::Crypto
Ripple::boost
Ripple::opts
Ripple::syslibs
absl::random_random
date::date
ed25519::ed25519
LibArchive::LibArchive
OpenSSL::Crypto
Ripple::boost
Ripple::libs
Ripple::opts
Ripple::syslibs
secp256k1::secp256k1
xrpl.libpb
xxHash::xxhash
@@ -111,6 +112,21 @@ target_link_libraries(xrpl.libxrpl.net PUBLIC
add_module(xrpl server)
target_link_libraries(xrpl.libxrpl.server PUBLIC xrpl.libxrpl.protocol)
add_module(xrpl nodestore)
target_link_libraries(xrpl.libxrpl.nodestore PUBLIC
xrpl.libxrpl.basics
xrpl.libxrpl.json
xrpl.libxrpl.protocol
)
add_module(xrpl shamap)
target_link_libraries(xrpl.libxrpl.shamap PUBLIC
xrpl.libxrpl.basics
xrpl.libxrpl.crypto
xrpl.libxrpl.protocol
xrpl.libxrpl.nodestore
)
add_module(xrpl ledger)
target_link_libraries(xrpl.libxrpl.ledger PUBLIC
xrpl.libxrpl.basics
@@ -136,6 +152,8 @@ target_link_modules(xrpl PUBLIC
protocol
resource
server
nodestore
shamap
net
ledger
)

View File

@@ -8,20 +8,23 @@ install (
TARGETS
common
opts
ripple_syslibs
ripple_boost
ripple_libs
ripple_syslibs
xrpl.imports.main
xrpl.libpb
xrpl.libxrpl
xrpl.libxrpl.basics
xrpl.libxrpl.beast
xrpl.libxrpl.crypto
xrpl.libxrpl.json
xrpl.libxrpl.ledger
xrpl.libxrpl.net
xrpl.libxrpl.nodestore
xrpl.libxrpl.protocol
xrpl.libxrpl.resource
xrpl.libxrpl.ledger
xrpl.libxrpl.server
xrpl.libxrpl.net
xrpl.libxrpl
xrpl.libxrpl.shamap
antithesis-sdk-cpp
EXPORT RippleExports
LIBRARY DESTINATION lib

View File

@@ -20,7 +20,7 @@
#ifndef RIPPLE_NODESTORE_BACKEND_H_INCLUDED
#define RIPPLE_NODESTORE_BACKEND_H_INCLUDED
#include <xrpld/nodestore/Types.h>
#include <xrpl/nodestore/Types.h>
#include <cstdint>

View File

@@ -20,13 +20,12 @@
#ifndef RIPPLE_NODESTORE_DATABASE_H_INCLUDED
#define RIPPLE_NODESTORE_DATABASE_H_INCLUDED
#include <xrpld/nodestore/Backend.h>
#include <xrpld/nodestore/NodeObject.h>
#include <xrpld/nodestore/Scheduler.h>
#include <xrpl/basics/BasicConfig.h>
#include <xrpl/basics/Log.h>
#include <xrpl/basics/TaggedCache.ipp>
#include <xrpl/nodestore/Backend.h>
#include <xrpl/nodestore/NodeObject.h>
#include <xrpl/nodestore/Scheduler.h>
#include <xrpl/protocol/SystemParameters.h>
#include <condition_variable>

View File

@@ -20,7 +20,7 @@
#ifndef RIPPLE_NODESTORE_DATABASEROTATING_H_INCLUDED
#define RIPPLE_NODESTORE_DATABASEROTATING_H_INCLUDED
#include <xrpld/nodestore/Database.h>
#include <xrpl/nodestore/Database.h>
namespace ripple {
namespace NodeStore {

View File

@@ -20,7 +20,7 @@
#ifndef RIPPLE_NODESTORE_DUMMYSCHEDULER_H_INCLUDED
#define RIPPLE_NODESTORE_DUMMYSCHEDULER_H_INCLUDED
#include <xrpld/nodestore/Scheduler.h>
#include <xrpl/nodestore/Scheduler.h>
namespace ripple {
namespace NodeStore {

View File

@@ -20,11 +20,10 @@
#ifndef RIPPLE_NODESTORE_FACTORY_H_INCLUDED
#define RIPPLE_NODESTORE_FACTORY_H_INCLUDED
#include <xrpld/nodestore/Backend.h>
#include <xrpld/nodestore/Scheduler.h>
#include <xrpl/basics/BasicConfig.h>
#include <xrpl/beast/utility/Journal.h>
#include <xrpl/nodestore/Backend.h>
#include <xrpl/nodestore/Scheduler.h>
#include <nudb/store.hpp>

View File

@@ -20,8 +20,8 @@
#ifndef RIPPLE_NODESTORE_MANAGER_H_INCLUDED
#define RIPPLE_NODESTORE_MANAGER_H_INCLUDED
#include <xrpld/nodestore/DatabaseRotating.h>
#include <xrpld/nodestore/Factory.h>
#include <xrpl/nodestore/DatabaseRotating.h>
#include <xrpl/nodestore/Factory.h>
namespace ripple {

View File

@@ -20,7 +20,7 @@
#ifndef RIPPLE_NODESTORE_SCHEDULER_H_INCLUDED
#define RIPPLE_NODESTORE_SCHEDULER_H_INCLUDED
#include <xrpld/nodestore/Task.h>
#include <xrpl/nodestore/Task.h>
#include <chrono>

View File

@@ -20,7 +20,7 @@
#ifndef RIPPLE_NODESTORE_TYPES_H_INCLUDED
#define RIPPLE_NODESTORE_TYPES_H_INCLUDED
#include <xrpld/nodestore/NodeObject.h>
#include <xrpl/nodestore/NodeObject.h>
#include <vector>

View File

@@ -20,9 +20,9 @@
#ifndef RIPPLE_NODESTORE_BATCHWRITER_H_INCLUDED
#define RIPPLE_NODESTORE_BATCHWRITER_H_INCLUDED
#include <xrpld/nodestore/Scheduler.h>
#include <xrpld/nodestore/Task.h>
#include <xrpld/nodestore/Types.h>
#include <xrpl/nodestore/Scheduler.h>
#include <xrpl/nodestore/Task.h>
#include <xrpl/nodestore/Types.h>
#include <condition_variable>
#include <mutex>

View File

@@ -20,10 +20,9 @@
#ifndef RIPPLE_NODESTORE_DATABASENODEIMP_H_INCLUDED
#define RIPPLE_NODESTORE_DATABASENODEIMP_H_INCLUDED
#include <xrpld/nodestore/Database.h>
#include <xrpl/basics/TaggedCache.h>
#include <xrpl/basics/chrono.h>
#include <xrpl/nodestore/Database.h>
namespace ripple {
namespace NodeStore {

View File

@@ -20,7 +20,7 @@
#ifndef RIPPLE_NODESTORE_DATABASEROTATINGIMP_H_INCLUDED
#define RIPPLE_NODESTORE_DATABASEROTATINGIMP_H_INCLUDED
#include <xrpld/nodestore/DatabaseRotating.h>
#include <xrpl/nodestore/DatabaseRotating.h>
#include <mutex>

View File

@@ -20,7 +20,7 @@
#ifndef RIPPLE_NODESTORE_DECODEDBLOB_H_INCLUDED
#define RIPPLE_NODESTORE_DECODEDBLOB_H_INCLUDED
#include <xrpld/nodestore/NodeObject.h>
#include <xrpl/nodestore/NodeObject.h>
namespace ripple {
namespace NodeStore {

View File

@@ -20,9 +20,8 @@
#ifndef RIPPLE_NODESTORE_ENCODEDBLOB_H_INCLUDED
#define RIPPLE_NODESTORE_ENCODEDBLOB_H_INCLUDED
#include <xrpld/nodestore/NodeObject.h>
#include <xrpl/beast/utility/instrumentation.h>
#include <xrpl/nodestore/NodeObject.h>
#include <boost/align/align_up.hpp>

View File

@@ -20,7 +20,7 @@
#ifndef RIPPLE_NODESTORE_MANAGERIMP_H_INCLUDED
#define RIPPLE_NODESTORE_MANAGERIMP_H_INCLUDED
#include <xrpld/nodestore/Manager.h>
#include <xrpl/nodestore/Manager.h>
namespace ripple {
@@ -39,7 +39,7 @@ public:
static void
missing_backend();
ManagerImp() = default;
ManagerImp();
~ManagerImp() = default;

View File

@@ -23,11 +23,10 @@
// Disable lz4 deprecation warning due to incompatibility with clang attributes
#define LZ4_DISABLE_DEPRECATE_WARNINGS
#include <xrpld/nodestore/NodeObject.h>
#include <xrpld/nodestore/detail/varint.h>
#include <xrpl/basics/contract.h>
#include <xrpl/basics/safe_cast.h>
#include <xrpl/nodestore/NodeObject.h>
#include <xrpl/nodestore/detail/varint.h>
#include <xrpl/protocol/HashPrefix.h>
#include <nudb/detail/field.hpp>

View File

@@ -20,6 +20,11 @@
#ifndef RIPPLE_PROTOCOL_APIVERSION_H_INCLUDED
#define RIPPLE_PROTOCOL_APIVERSION_H_INCLUDED
#include <xrpl/beast/core/SemanticVersion.h>
#include <xrpl/beast/utility/instrumentation.h>
#include <xrpl/json/json_value.h>
#include <xrpl/protocol/jss.h>
#include <type_traits>
#include <utility>
@@ -72,6 +77,77 @@ static_assert(apiMaximumSupportedVersion >= apiMinimumSupportedVersion);
static_assert(apiBetaVersion >= apiMaximumSupportedVersion);
static_assert(apiMaximumValidVersion >= apiMaximumSupportedVersion);
template <class JsonObject>
void
setVersion(JsonObject& parent, unsigned int apiVersion, bool betaEnabled)
{
XRPL_ASSERT(
apiVersion != apiInvalidVersion,
"ripple::RPC::setVersion : input is valid");
auto& retObj = addObject(parent, jss::version);
if (apiVersion == apiVersionIfUnspecified)
{
// API version numbers used in API version 1
static beast::SemanticVersion const firstVersion{"1.0.0"};
static beast::SemanticVersion const goodVersion{"1.0.0"};
static beast::SemanticVersion const lastVersion{"1.0.0"};
retObj[jss::first] = firstVersion.print();
retObj[jss::good] = goodVersion.print();
retObj[jss::last] = lastVersion.print();
}
else
{
retObj[jss::first] = apiMinimumSupportedVersion.value;
retObj[jss::last] =
betaEnabled ? apiBetaVersion : apiMaximumSupportedVersion;
}
}
/**
* Retrieve the api version number from the json value
*
* Note that APIInvalidVersion will be returned if
* 1) the version number field has a wrong format
* 2) the version number retrieved is out of the supported range
* 3) the version number is unspecified and
* APIVersionIfUnspecified is out of the supported range
*
* @param jv a Json value that may or may not specifies
* the api version number
* @param betaEnabled if the beta API version is enabled
* @return the api version number
*/
inline unsigned int
getAPIVersionNumber(Json::Value const& jv, bool betaEnabled)
{
static Json::Value const minVersion(RPC::apiMinimumSupportedVersion);
Json::Value const maxVersion(
betaEnabled ? RPC::apiBetaVersion : RPC::apiMaximumSupportedVersion);
if (jv.isObject())
{
if (jv.isMember(jss::api_version))
{
auto const specifiedVersion = jv[jss::api_version];
if (!specifiedVersion.isInt() && !specifiedVersion.isUInt())
{
return RPC::apiInvalidVersion;
}
auto const specifiedVersionInt = specifiedVersion.asInt();
if (specifiedVersionInt < minVersion ||
specifiedVersionInt > maxVersion)
{
return RPC::apiInvalidVersion;
}
return specifiedVersionInt;
}
}
return RPC::apiVersionIfUnspecified;
}
} // namespace RPC
template <unsigned minVer, unsigned maxVer, typename Fn, typename... Args>

View File

@@ -73,14 +73,8 @@ static constexpr std::uint32_t XRP_LEDGER_EARLIEST_SEQ{32570u};
* used in asserts and tests. */
static constexpr std::uint32_t XRP_LEDGER_EARLIEST_FEES{562177u};
/** The minimum amount of support an amendment should have.
@note This value is used by legacy code and will become obsolete
once the fixAmendmentMajorityCalc amendment activates.
*/
constexpr std::ratio<204, 256> preFixAmendmentMajorityCalcThreshold;
constexpr std::ratio<80, 100> postFixAmendmentMajorityCalcThreshold;
/** The minimum amount of support an amendment should have. */
constexpr std::ratio<80, 100> amendmentMajorityCalcThreshold;
/** The minimum amount of time an amendment must hold a majority */
constexpr std::chrono::seconds const defaultAmendmentMajorityTime = weeks{2};

View File

@@ -225,8 +225,9 @@ enum TERcodes : TERUnderlyingType {
terQUEUED, // Transaction is being held in TxQ until fee drops
terPRE_TICKET, // Ticket is not yet in ledger but might be on its way
terNO_AMM, // AMM doesn't exist for the asset pair
terADDRESS_COLLISION, // Failed to allocate AccountID when trying to
// create a pseudo-account
terADDRESS_COLLISION, // Failed to allocate AccountID when trying to
// create a pseudo-account
terNO_DELEGATE_PERMISSION, // Delegate does not have permission
};
//------------------------------------------------------------------------------
@@ -361,6 +362,9 @@ enum TECcodes : TERUnderlyingType {
tecLIMIT_EXCEEDED = 195,
tecPSEUDO_ACCOUNT = 196,
tecPRECISION_LOSS = 197,
// DEPRECATED: This error code tecNO_DELEGATE_PERMISSION is reserved for
// backward compatibility with historical data on non-prod networks, can be
// reclaimed after those networks reset.
tecNO_DELEGATE_PERMISSION = 198,
};

View File

@@ -33,51 +33,35 @@ namespace ripple {
class TxMeta
{
private:
struct CtorHelper
{
explicit CtorHelper() = default;
};
template <class T>
TxMeta(
uint256 const& txID,
std::uint32_t ledger,
T const& data,
CtorHelper);
public:
TxMeta(
uint256 const& transactionID,
std::uint32_t ledger,
std::optional<uint256> parentBatchId = std::nullopt);
TxMeta(uint256 const& transactionID, std::uint32_t ledger);
TxMeta(uint256 const& txID, std::uint32_t ledger, Blob const&);
TxMeta(uint256 const& txID, std::uint32_t ledger, std::string const&);
TxMeta(uint256 const& txID, std::uint32_t ledger, STObject const&);
uint256 const&
getTxID() const
{
return mTransactionID;
return transactionID_;
}
std::uint32_t
getLgrSeq() const
{
return mLedger;
return ledgerSeq_;
}
int
getResult() const
{
return mResult;
return result_;
}
TER
getResultTER() const
{
return TER::fromInt(mResult);
return TER::fromInt(result_);
}
std::uint32_t
getIndex() const
{
return mIndex;
return index_;
}
void
@@ -104,66 +88,52 @@ public:
STArray&
getNodes()
{
return (mNodes);
return nodes_;
}
STArray const&
getNodes() const
{
return (mNodes);
return nodes_;
}
void
setDeliveredAmount(STAmount const& delivered)
setAdditionalFields(STObject const& obj)
{
mDelivered = delivered;
if (obj.isFieldPresent(sfDeliveredAmount))
deliveredAmount_ = obj.getFieldAmount(sfDeliveredAmount);
if (obj.isFieldPresent(sfParentBatchID))
parentBatchID_ = obj.getFieldH256(sfParentBatchID);
}
STAmount
std::optional<STAmount> const&
getDeliveredAmount() const
{
XRPL_ASSERT(
hasDeliveredAmount(),
"ripple::TxMeta::getDeliveredAmount : non-null delivered amount");
return *mDelivered;
}
bool
hasDeliveredAmount() const
{
return static_cast<bool>(mDelivered);
return deliveredAmount_;
}
void
setParentBatchId(uint256 const& parentBatchId)
setDeliveredAmount(std::optional<STAmount> const& amount)
{
mParentBatchId = parentBatchId;
deliveredAmount_ = amount;
}
uint256
getParentBatchId() const
void
setParentBatchID(std::optional<uint256> const& id)
{
XRPL_ASSERT(
hasParentBatchId(),
"ripple::TxMeta::getParentBatchId : non-null batch id");
return *mParentBatchId;
}
bool
hasParentBatchId() const
{
return static_cast<bool>(mParentBatchId);
parentBatchID_ = id;
}
private:
uint256 mTransactionID;
std::uint32_t mLedger;
std::uint32_t mIndex;
int mResult;
uint256 transactionID_;
std::uint32_t ledgerSeq_;
std::uint32_t index_;
int result_;
std::optional<STAmount> mDelivered;
std::optional<uint256> mParentBatchId;
std::optional<STAmount> deliveredAmount_;
std::optional<uint256> parentBatchID_;
STArray mNodes;
STArray nodes_;
};
} // namespace ripple

View File

@@ -30,11 +30,11 @@
// Add new amendments to the top of this list.
// Keep it sorted in reverse chronological order.
XRPL_FEATURE(PermissionDelegationV1_1, Supported::no, VoteBehavior::DefaultNo)
XRPL_FIX (DirectoryLimit, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FIX (IncludeKeyletFields, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FEATURE(DynamicMPT, Supported::no, VoteBehavior::DefaultNo)
XRPL_FIX (TokenEscrowV1, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FIX (DelegateV1_1, Supported::no, VoteBehavior::DefaultNo)
XRPL_FIX (PriceOracleOrder, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FIX (MPTDeliveredAmount, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FIX (AMMClawbackRounding, Supported::yes, VoteBehavior::DefaultNo)
@@ -44,7 +44,6 @@ XRPL_FIX (AMMv1_3, Supported::yes, VoteBehavior::DefaultNo
XRPL_FEATURE(PermissionedDEX, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FEATURE(Batch, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FEATURE(SingleAssetVault, Supported::no, VoteBehavior::DefaultNo)
XRPL_FEATURE(PermissionDelegation, Supported::no, VoteBehavior::DefaultNo)
XRPL_FIX (PayChanCancelAfter, Supported::yes, VoteBehavior::DefaultNo)
// Check flags in Credential transactions
XRPL_FIX (InvalidTxFlags, Supported::yes, VoteBehavior::DefaultNo)
@@ -78,27 +77,20 @@ XRPL_FIX (DisallowIncomingV1, Supported::yes, VoteBehavior::DefaultNo
XRPL_FEATURE(XChainBridge, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FEATURE(AMM, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FEATURE(Clawback, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FIX (ReducedOffersV1, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FIX (NFTokenRemint, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FIX (NonFungibleTokensV1_2, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FIX (UniversalNumber, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FEATURE(XRPFees, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FEATURE(DisallowIncoming, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FEATURE(ImmediateOfferKilled, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FIX (RemoveNFTokenAutoTrustLine, Supported::yes, VoteBehavior::DefaultYes)
XRPL_FIX (TrustLinesToSelf, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FEATURE(NonFungibleTokensV1_1, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FEATURE(ExpandedSignerList, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FEATURE(CheckCashMakesTrustLine, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FEATURE(FlowSortStrands, Supported::yes, VoteBehavior::DefaultYes)
XRPL_FEATURE(TicketBatch, Supported::yes, VoteBehavior::DefaultYes)
XRPL_FEATURE(NegativeUNL, Supported::yes, VoteBehavior::DefaultYes)
XRPL_FIX (AmendmentMajorityCalc, Supported::yes, VoteBehavior::DefaultYes)
XRPL_FEATURE(HardenedValidations, Supported::yes, VoteBehavior::DefaultYes)
XRPL_FEATURE(RequireFullyCanonicalSig, Supported::yes, VoteBehavior::DefaultYes)
XRPL_FEATURE(DeletableAccounts, Supported::yes, VoteBehavior::DefaultYes)
XRPL_FIX (PayChanRecipientOwnerDir, Supported::yes, VoteBehavior::DefaultYes)
XRPL_FIX (MasterKeyAsRegularKey, Supported::yes, VoteBehavior::DefaultYes)
XRPL_FEATURE(MultiSignReserve, Supported::yes, VoteBehavior::DefaultYes)
XRPL_FEATURE(DepositPreauth, Supported::yes, VoteBehavior::DefaultYes)
XRPL_FEATURE(Checks, Supported::yes, VoteBehavior::DefaultYes)
@@ -116,9 +108,6 @@ XRPL_FEATURE(Flow, Supported::yes, VoteBehavior::DefaultYe
//
// If a feature remains obsolete for long enough that no clients are able
// to vote for it, the feature can be removed (entirely?) from the code.
XRPL_FIX (NFTokenNegOffer, Supported::yes, VoteBehavior::Obsolete)
XRPL_FIX (NFTokenDirV1, Supported::yes, VoteBehavior::Obsolete)
XRPL_FEATURE(NonFungibleTokensV1, Supported::yes, VoteBehavior::Obsolete)
XRPL_FEATURE(CryptoConditionsSuite, Supported::yes, VoteBehavior::Obsolete)
// The following amendments have been active for at least two years. Their
@@ -140,8 +129,13 @@ XRPL_RETIRE(fix1571)
XRPL_RETIRE(fix1578)
XRPL_RETIRE(fix1623)
XRPL_RETIRE(fix1781)
XRPL_RETIRE(fixAmendmentMajorityCalc)
XRPL_RETIRE(fixCheckThreading)
XRPL_RETIRE(fixNonFungibleTokensV1_2)
XRPL_RETIRE(fixNFTokenRemint)
XRPL_RETIRE(fixMasterKeyAsRegularKey)
XRPL_RETIRE(fixQualityUpperBound)
XRPL_RETIRE(fixReducedOffersV1)
XRPL_RETIRE(fixRmSmallIncreasedQOffers)
XRPL_RETIRE(fixSTAmountCanonicalize)
XRPL_RETIRE(fixTakerDryOfferRemoval)
@@ -150,7 +144,9 @@ XRPL_RETIRE(Escrow)
XRPL_RETIRE(EnforceInvariants)
XRPL_RETIRE(FeeEscalation)
XRPL_RETIRE(FlowCross)
XRPL_RETIRE(ImmediateOfferKilled)
XRPL_RETIRE(MultiSign)
XRPL_RETIRE(NonFungibleTokensV1_1)
XRPL_RETIRE(PayChan)
XRPL_RETIRE(SortedDirectories)
XRPL_RETIRE(TickSize)

View File

@@ -316,7 +316,7 @@ TRANSACTION(ttTRUST_SET, 20, TrustSet,
#endif
TRANSACTION(ttACCOUNT_DELETE, 21, AccountDelete,
Delegation::notDelegatable,
uint256{},
featureDeletableAccounts,
mustDeleteAcct,
({
{sfDestination, soeREQUIRED},
@@ -332,7 +332,7 @@ TRANSACTION(ttACCOUNT_DELETE, 21, AccountDelete,
#endif
TRANSACTION(ttNFTOKEN_MINT, 25, NFTokenMint,
Delegation::delegatable,
featureNonFungibleTokensV1,
uint256{},
changeNFTCounts,
({
{sfNFTokenTaxon, soeREQUIRED},
@@ -350,7 +350,7 @@ TRANSACTION(ttNFTOKEN_MINT, 25, NFTokenMint,
#endif
TRANSACTION(ttNFTOKEN_BURN, 26, NFTokenBurn,
Delegation::delegatable,
featureNonFungibleTokensV1,
uint256{},
changeNFTCounts,
({
{sfNFTokenID, soeREQUIRED},
@@ -363,7 +363,7 @@ TRANSACTION(ttNFTOKEN_BURN, 26, NFTokenBurn,
#endif
TRANSACTION(ttNFTOKEN_CREATE_OFFER, 27, NFTokenCreateOffer,
Delegation::delegatable,
featureNonFungibleTokensV1,
uint256{},
noPriv,
({
{sfNFTokenID, soeREQUIRED},
@@ -379,7 +379,7 @@ TRANSACTION(ttNFTOKEN_CREATE_OFFER, 27, NFTokenCreateOffer,
#endif
TRANSACTION(ttNFTOKEN_CANCEL_OFFER, 28, NFTokenCancelOffer,
Delegation::delegatable,
featureNonFungibleTokensV1,
uint256{},
noPriv,
({
{sfNFTokenOffers, soeREQUIRED},
@@ -391,7 +391,7 @@ TRANSACTION(ttNFTOKEN_CANCEL_OFFER, 28, NFTokenCancelOffer,
#endif
TRANSACTION(ttNFTOKEN_ACCEPT_OFFER, 29, NFTokenAcceptOffer,
Delegation::delegatable,
featureNonFungibleTokensV1,
uint256{},
noPriv,
({
{sfNFTokenBuyOffer, soeOPTIONAL},
@@ -837,7 +837,7 @@ TRANSACTION(ttPERMISSIONED_DOMAIN_DELETE, 63, PermissionedDomainDelete,
#endif
TRANSACTION(ttDELEGATE_SET, 64, DelegateSet,
Delegation::notDelegatable,
featurePermissionDelegation,
featurePermissionDelegationV1_1,
noPriv,
({
{sfAuthorize, soeREQUIRED},

View File

@@ -20,11 +20,10 @@
#ifndef RIPPLE_SHAMAP_FAMILY_H_INCLUDED
#define RIPPLE_SHAMAP_FAMILY_H_INCLUDED
#include <xrpld/nodestore/Database.h>
#include <xrpld/shamap/FullBelowCache.h>
#include <xrpld/shamap/TreeNodeCache.h>
#include <xrpl/beast/utility/Journal.h>
#include <xrpl/nodestore/Database.h>
#include <xrpl/shamap/FullBelowCache.h>
#include <xrpl/shamap/TreeNodeCache.h>
#include <cstdint>

View File

@@ -20,21 +20,19 @@
#ifndef RIPPLE_SHAMAP_SHAMAP_H_INCLUDED
#define RIPPLE_SHAMAP_SHAMAP_H_INCLUDED
#include <xrpld/nodestore/Database.h>
#include <xrpld/nodestore/NodeObject.h>
#include <xrpld/shamap/Family.h>
#include <xrpld/shamap/SHAMapAddNode.h>
#include <xrpld/shamap/SHAMapInnerNode.h>
#include <xrpld/shamap/SHAMapItem.h>
#include <xrpld/shamap/SHAMapLeafNode.h>
#include <xrpld/shamap/SHAMapMissingNode.h>
#include <xrpld/shamap/SHAMapTreeNode.h>
#include <xrpld/shamap/TreeNodeCache.h>
#include <xrpl/basics/IntrusivePointer.h>
#include <xrpl/basics/UnorderedContainers.h>
#include <xrpl/beast/utility/Journal.h>
#include <xrpl/beast/utility/instrumentation.h>
#include <xrpl/nodestore/Database.h>
#include <xrpl/nodestore/NodeObject.h>
#include <xrpl/shamap/Family.h>
#include <xrpl/shamap/SHAMapAddNode.h>
#include <xrpl/shamap/SHAMapInnerNode.h>
#include <xrpl/shamap/SHAMapItem.h>
#include <xrpl/shamap/SHAMapLeafNode.h>
#include <xrpl/shamap/SHAMapMissingNode.h>
#include <xrpl/shamap/SHAMapTreeNode.h>
#include <set>
#include <stack>

View File

@@ -20,12 +20,11 @@
#ifndef RIPPLE_SHAMAP_SHAMAPACCOUNTSTATELEAFNODE_H_INCLUDED
#define RIPPLE_SHAMAP_SHAMAPACCOUNTSTATELEAFNODE_H_INCLUDED
#include <xrpld/shamap/SHAMapItem.h>
#include <xrpld/shamap/SHAMapLeafNode.h>
#include <xrpl/basics/CountedObject.h>
#include <xrpl/protocol/HashPrefix.h>
#include <xrpl/protocol/digest.h>
#include <xrpl/shamap/SHAMapItem.h>
#include <xrpl/shamap/SHAMapLeafNode.h>
namespace ripple {

View File

@@ -20,10 +20,9 @@
#ifndef RIPPLE_SHAMAP_SHAMAPINNERNODE_H_INCLUDED
#define RIPPLE_SHAMAP_SHAMAPINNERNODE_H_INCLUDED
#include <xrpld/shamap/SHAMapNodeID.h>
#include <xrpld/shamap/detail/TaggedPointer.h>
#include <xrpl/basics/IntrusivePointer.h>
#include <xrpl/shamap/SHAMapNodeID.h>
#include <xrpl/shamap/detail/TaggedPointer.h>
#include <atomic>
#include <cstdint>

View File

@@ -20,8 +20,8 @@
#ifndef RIPPLE_SHAMAP_SHAMAPLEAFNODE_H_INCLUDED
#define RIPPLE_SHAMAP_SHAMAPLEAFNODE_H_INCLUDED
#include <xrpld/shamap/SHAMapItem.h>
#include <xrpld/shamap/SHAMapTreeNode.h>
#include <xrpl/shamap/SHAMapItem.h>
#include <xrpl/shamap/SHAMapTreeNode.h>
#include <cstdint>

View File

@@ -20,9 +20,8 @@
#ifndef RIPPLE_SHAMAP_SHAMAPMISSINGNODE_H_INCLUDED
#define RIPPLE_SHAMAP_SHAMAPMISSINGNODE_H_INCLUDED
#include <xrpld/shamap/SHAMapTreeNode.h>
#include <xrpl/basics/base_uint.h>
#include <xrpl/shamap/SHAMapTreeNode.h>
#include <iosfwd>
#include <stdexcept>

View File

@@ -20,7 +20,7 @@
#ifndef RIPPLE_SHAMAP_SHAMAPSYNCFILTER_H_INCLUDED
#define RIPPLE_SHAMAP_SHAMAPSYNCFILTER_H_INCLUDED
#include <xrpld/shamap/SHAMapTreeNode.h>
#include <xrpl/shamap/SHAMapTreeNode.h>
#include <optional>

View File

@@ -20,13 +20,12 @@
#ifndef RIPPLE_SHAMAP_SHAMAPTREENODE_H_INCLUDED
#define RIPPLE_SHAMAP_SHAMAPTREENODE_H_INCLUDED
#include <xrpld/shamap/SHAMapItem.h>
#include <xrpld/shamap/SHAMapNodeID.h>
#include <xrpl/basics/IntrusivePointer.h>
#include <xrpl/basics/IntrusiveRefCounts.h>
#include <xrpl/basics/SHAMapHash.h>
#include <xrpl/protocol/Serializer.h>
#include <xrpl/shamap/SHAMapItem.h>
#include <xrpl/shamap/SHAMapNodeID.h>
#include <cstdint>
#include <string>

View File

@@ -20,12 +20,11 @@
#ifndef RIPPLE_SHAMAP_SHAMAPTXLEAFNODE_H_INCLUDED
#define RIPPLE_SHAMAP_SHAMAPTXLEAFNODE_H_INCLUDED
#include <xrpld/shamap/SHAMapItem.h>
#include <xrpld/shamap/SHAMapLeafNode.h>
#include <xrpl/basics/CountedObject.h>
#include <xrpl/protocol/HashPrefix.h>
#include <xrpl/protocol/digest.h>
#include <xrpl/shamap/SHAMapItem.h>
#include <xrpl/shamap/SHAMapLeafNode.h>
namespace ripple {

View File

@@ -20,12 +20,11 @@
#ifndef RIPPLE_SHAMAP_SHAMAPLEAFTXPLUSMETANODE_H_INCLUDED
#define RIPPLE_SHAMAP_SHAMAPLEAFTXPLUSMETANODE_H_INCLUDED
#include <xrpld/shamap/SHAMapItem.h>
#include <xrpld/shamap/SHAMapLeafNode.h>
#include <xrpl/basics/CountedObject.h>
#include <xrpl/protocol/HashPrefix.h>
#include <xrpl/protocol/digest.h>
#include <xrpl/shamap/SHAMapItem.h>
#include <xrpl/shamap/SHAMapLeafNode.h>
namespace ripple {

View File

@@ -20,10 +20,9 @@
#ifndef RIPPLE_SHAMAP_TREENODECACHE_H_INCLUDED
#define RIPPLE_SHAMAP_TREENODECACHE_H_INCLUDED
#include <xrpld/shamap/SHAMapTreeNode.h>
#include <xrpl/basics/IntrusivePointer.h>
#include <xrpl/basics/TaggedCache.h>
#include <xrpl/shamap/SHAMapTreeNode.h>
namespace ripple {

View File

@@ -20,9 +20,8 @@
#ifndef RIPPLE_SHAMAP_TAGGEDPOINTER_H_INCLUDED
#define RIPPLE_SHAMAP_TAGGEDPOINTER_H_INCLUDED
#include <xrpld/shamap/SHAMapTreeNode.h>
#include <xrpl/basics/IntrusivePointer.h>
#include <xrpl/shamap/SHAMapTreeNode.h>
#include <array>
#include <cstdint>

View File

@@ -17,10 +17,9 @@
*/
//==============================================================================
#include <xrpld/shamap/SHAMapInnerNode.h>
#include <xrpld/shamap/detail/TaggedPointer.h>
#include <xrpl/basics/ByteUtilities.h>
#include <xrpl/shamap/SHAMapInnerNode.h>
#include <xrpl/shamap/detail/TaggedPointer.h>
#include <boost/pool/pool_alloc.hpp>

View File

@@ -1,167 +0,0 @@
#!/usr/bin/env bash
set -o errexit
set -o xtrace
. /etc/os-release
case "$ID $ID_LIKE" in
*rhel*|*fedora*)
pkg="rpm"
;;
*debian*|*ubuntu*)
pkg="deb"
;;
esac
repo_dir=$PWD
set -a
repo_name="rippled"
pkgs_dir="${repo_dir}/pkgs"
shared_files="${pkgs_dir}/shared"
pkg_files="${pkgs_dir}/${pkg}"
build_info_src="${repo_dir}/src/libxrpl/protocol/BuildInfo.cpp"
xrpl_version=$(grep -E -i -o "\b(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-[0-9a-z\-]+(\.[0-9a-z\-]+)*)?(\+[0-9a-z\-]+(\.[0-9a-z\-]+)*)?\b" "${build_info_src}")
git config --global --add safe.directory '*'
branch=$(git rev-parse --abbrev-ref HEAD)
commit=$(git rev-parse HEAD)
short_commit=$(git rev-parse --short=7 HEAD)
date=$(git show -s --format=%cd --date=format-local:"%Y%m%d%H%M%S")
BUILD_TYPE=${BUILD_TYPE:-Release}
set +a
if [ "${branch}" = 'develop' ]; then
# TODO: Can remove when CMake sets version
dev_version="${date}~${short_commit}"
xrpl_version="${xrpl_version}+${dev_version}"
fi
if [ "${pkg}" = 'rpm' ]; then
IFS='-' read -r RIPPLED_RPM_VERSION RELEASE <<< "${xrpl_version}"
export RIPPLED_RPM_VERSION
RPM_RELEASE=${RPM_RELEASE-1}
# post-release version
if [ "hf" = "$(echo "$RELEASE" | cut -c -2)" ]; then
RPM_RELEASE="${RPM_RELEASE}.${RELEASE}"
# pre-release version (-b or -rc)
elif [[ $RELEASE ]]; then
RPM_RELEASE="0.${RPM_RELEASE}.${RELEASE}"
fi
export RPM_RELEASE
if [[ $RPM_PATCH ]]; then
RPM_PATCH=".${RPM_PATCH}"
export RPM_PATCH
fi
build_dir="build/${pkg}/packages"
rm -rf "${build_dir}"
mkdir -p "${build_dir}/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}"
# cp "${pkgs_dir}/rippled.patch" "${build_dir}/rpmbuild/SOURCES/"
git archive \
--remote "${repo_dir}" HEAD \
--prefix ${repo_name}/ \
--format tar.gz \
--output "${build_dir}/rpmbuild/SOURCES/rippled.tar.gz"
ln --symbolic "${repo_dir}" "${build_dir}/rippled"
cp -r "${pkg_files}/rippled.spec" "${build_dir}"
pushd "${build_dir}" || exit
rpmbuild \
--define "_topdir ${PWD}/rpmbuild" \
--define "_smp_build_ncpus %(nproc --ignore=2 2>/dev/null || echo 1)" \
-ba rippled.spec
RPM_VERSION_RELEASE=$(rpm -qp --qf='%{NAME}-%{VERSION}-%{RELEASE}' ./rpmbuild/RPMS/x86_64/rippled-[0-9]*.rpm)
tar_file=$RPM_VERSION_RELEASE.tar.gz
printf '%s\n' \
"rpm_md5sum=$(rpm -q --queryformat '%{SIGMD5}\n' -p ./rpmbuild/RPMS/x86_64/rippled-[0-9]*.rpm 2>/dev/null)" \
"rpm_sha256=$(sha256sum ./rpmbuild/RPMS/x86_64/rippled-[0-9]*.rpm | awk '{ print $1 }')" \
"rippled_version=${xrpl_version}" \
"rippled_git_hash=${commit}" \
"rpm_version=${RIPPLED_RPM_VERSION}" \
"rpm_file_name=${tar_file}" \
"rpm_version_release=${RPM_VERSION_RELEASE}" \
> build_vars
# Rename the files arch to match the debs
mv rpmbuild/RPMS/x86_64/* .
for f in *x86_64.rpm; do
new="${f/x86_64/amd64}"
mv "$f" "$new"
echo "Renamed $f -> $new"
done
rm -rf rpmbuild
rm -f rippled rippled.tar.gz rippled.spec
pushd -0 && dirs -c
mv "${build_dir}/build_vars" .
elif [ "${pkg}" = 'deb' ]; then
# dpkg_version=$(echo "${xrpl_version}" | sed 's:-:~:g')
dpkg_version=${xrpl_version//-/\~}
full_version="${dpkg_version}"
build_dir="build/${pkg}/packages"
rm -rf "${build_dir}"
mkdir -p "${build_dir}"
git archive \
--remote "${repo_dir}" HEAD \
--prefix ${repo_name}/ \
--format tar.gz \
--output "${build_dir}/${repo_name}_${dpkg_version}.orig.tar.gz"
pushd "${build_dir}" || exit
tar -zxf "${repo_name}_${dpkg_version}.orig.tar.gz"
pushd ${repo_name} || exit
# Prepare the package metadata directory, `debian/`, within `rippled/`.
cp -r "${pkg_files}/debian" .
cp "${shared_files}/rippled.service" debian/
cp "${shared_files}/update-rippled.sh" .
cp "${shared_files}/update-rippled-cron" .
cp "${shared_files}/rippled-logrotate" .
if [ "${branch}" = 'develop' ]; then
# TODO: Can remove when CMake sets version
sed --in-place "s/versionString = \"\([^\"]*\)\"/versionString = \"${xrpl_version}\"/" "${build_info_src}"
fi
cat << CHANGELOG > ./debian/changelog
rippled (${xrpl_version}) unstable; urgency=low
* see RELEASENOTES
-- Ripple Labs Inc. <support@ripple.com> $(TZ=UTC date -R)
CHANGELOG
cat ./debian/changelog
dpkg-buildpackage -b -d -us -uc
popd || exit
rm -rf ${repo_name}
# for f in *.ddeb; do mv -- "$f" "${f%.ddeb}.deb"; done
popd || exit
cp "${build_dir}/${repo_name}_${xrpl_version}_amd64.changes" .
awk '/Checksums-Sha256:/{hit=1;next}/Files:/{hit=0}hit' "${repo_name}_${xrpl_version}_amd64.changes" | sed -E 's!^[[:space:]]+!!' > shasums
sha() {
<shasums awk "/$1/ { print \$1 }"
}
printf '%s\n' \
"deb_sha256=$(sha "rippled_${full_version}_amd64.deb")" \
"dbg_sha256=$(sha "rippled-dbgsym_${full_version}_amd64.deb")" \
"rippled_version=${xrpl_version}" \
"rippled_git_hash=${commit}" \
"dpkg_version=${dpkg_version}" \
"dpkg_full_version=${full_version}" \
> build_vars
pushd -0 && dirs -c
fi
cp "${build_dir}/"*.$pkg .

View File

@@ -1,3 +0,0 @@
rippled daemon
-- Mike Ellery <mellery451@gmail.com> Tue, 04 Dec 2018 18:19:03 +0000

View File

@@ -1,20 +0,0 @@
Source: rippled
Section: net
Priority: optional
Maintainer: Ripple Labs Inc. <support@ripple.com>
Build-Depends: cmake,
debhelper (>= 13),
debhelper-compat (= 13)
# debhelper (>= 14),
# debhelper-compat (= 14),
# TODO: Let's go for 14!
Standards-Version: 4.6.0
Homepage: https://github.com/XRPLF/rippled.git
Rules-Requires-Root: no
Package: rippled
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: XRP Ledger server (rippled)
rippled is the core server of the XRP Ledger, providing a peer-to-peer
network node for validating and processing transactions.

View File

@@ -1,86 +0,0 @@
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: rippled
Source: https://github.com/ripple/rippled
Files: *
Copyright: 2012-2019 Ripple Labs Inc.
License: __UNKNOWN__
The accompanying files under various copyrights.
Copyright (c) 2012, 2013, 2014 Ripple Labs Inc.
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
The accompanying files incorporate work covered by the following copyright
and previous license notice:
Copyright (c) 2011 Arthur Britto, David Schwartz, Jed McCaleb,
Vinnie Falco, Bob Way, Eric Lombrozo, Nikolaos D. Bougalis, Howard Hinnant
Some code from Raw Material Software, Ltd., provided under the terms of the
ISC License. See the corresponding source files for more details.
Copyright (c) 2013 - Raw Material Software Ltd.
Please visit http://www.juce.com
Some code from ASIO examples:
// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
Some code from Bitcoin:
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2011 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
Some code from Tom Wu:
This software is covered under the following copyright:
/*
* Copyright (c) 2003-2005 Tom Wu
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
*
* IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
* INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER
* RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF
* THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* In addition, the following condition applies:
*
* All redistributions must retain an intact copy of this copyright notice
* and disclaimer.
*/
Address all questions regarding this license to:
Tom Wu
tjw@cs.Stanford.EDU

View File

@@ -1,3 +0,0 @@
/var/log/rippled/
/var/lib/rippled/
/etc/systemd/system/rippled.service.d/

View File

@@ -1,2 +0,0 @@
README.md
LICENSE.md

View File

@@ -1,3 +0,0 @@
opt/ripple/include
opt/ripple/lib/*.a
opt/ripple/lib/cmake/*

View File

@@ -1,2 +0,0 @@
/opt/ripple/etc/rippled.cfg
/opt/ripple/etc/validators.txt

View File

@@ -1,10 +0,0 @@
etc/logrotate.d/rippled
opt/ripple/bin/rippled
opt/ripple/bin/update-rippled.sh
opt/ripple/bin/validator-keys
opt/ripple/bin/xrpld
opt/ripple/etc/rippled.cfg
opt/ripple/etc/update-rippled-cron
opt/ripple/etc/validators.txt
opt/ripple/include/*
opt/ripple/lib/*

View File

@@ -1,4 +0,0 @@
opt/ripple/etc/rippled.cfg etc/opt/ripple/rippled.cfg
opt/ripple/etc/validators.txt etc/opt/ripple/validators.txt
opt/ripple/bin/rippled usr/local/bin/rippled
opt/ripple/bin/rippled opt/ripple/bin/xrpld

View File

@@ -1,39 +0,0 @@
#!/bin/sh
set -e
USER_NAME=rippled
GROUP_NAME=rippled
case "$1" in
configure)
id -u $USER_NAME >/dev/null 2>&1 || \
useradd --system \
--home-dir /nonexistent \
--no-create-home \
--shell /usr/sbin/nologin \
--comment "system user for rippled" \
--user-group \
${USER_NAME}
chown -R $USER_NAME:$GROUP_NAME /var/log/rippled/
chown -R $USER_NAME:$GROUP_NAME /var/lib/rippled/
chown -R $USER_NAME:$GROUP_NAME /opt/ripple
chmod 755 /var/log/rippled/
chmod 755 /var/lib/rippled/
chmod 644 /opt/ripple/etc/update-rippled-cron
chmod 644 /etc/logrotate.d/rippled
chown -R root:$GROUP_NAME /opt/ripple/etc/update-rippled-cron
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
#DEBHELPER#
exit 0

View File

@@ -1,17 +0,0 @@
#!/bin/sh
set -e
case "$1" in
purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
;;
*)
echo "postrm called with unknown argument \`$1'" >&2
exit 1
;;
esac
#DEBHELPER#
exit 0

View File

@@ -1,20 +0,0 @@
#!/bin/sh
set -e
case "$1" in
install|upgrade)
;;
abort-upgrade)
;;
*)
echo "preinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
#DEBHELPER#
exit 0

View File

@@ -1,20 +0,0 @@
#!/bin/sh
set -e
case "$1" in
remove|upgrade|deconfigure)
;;
failed-upgrade)
;;
*)
echo "prerm called with unknown argument \`$1'" >&2
exit 1
;;
esac
#DEBHELPER#
exit 0

View File

@@ -1,77 +0,0 @@
#!/usr/bin/make -f
export DH_VERBOSE = 1
export DH_OPTIONS = -v
## TODO: Confirm these are still required.
# debuild sets some warnings that don't work well
# for our curent build..so try to remove those flags here:
export CFLAGS:=$(subst -Wformat,,$(CFLAGS))
export CFLAGS:=$(subst -Werror=format-security,,$(CFLAGS))
export CXXFLAGS:=$(subst -Wformat,,$(CXXFLAGS))
export CXXFLAGS:=$(subst -Werror=format-security,,$(CXXFLAGS))
## TODO: Confirm these are still required.
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_BUILD_OPTIONS = nodwz
export RIPPLE_REMOTE = xrplf
export RIPPLE_REMOTE_URL = https://conan.ripplex.io
# ## CMake Configure args
# export DEB_CMAKE_GENERATOR = Ninja
export DEB_CMAKE_BUILD_TYPE = Release
NPROC := $(shell nproc --ignore=2)
export DEB_BUILD_OPTIONS += parallel=$(NPROC)
CONAN_HOME := $(shell conan config home)
CONAN_PROFILE := $(shell conan profile path default)
CONAN_GCONF := $(CONAN_HOME)/global.conf
INSTALL_PREFIX := "/opt/ripple"
BUILD_DIR := obj-$(DEB_BUILD_GNU_TYPE)
.ONESHELL:
SHELL := /bin/bash
%:
dh $@ --buildsystem=cmake
override_dh_installsystemd:
dh_installsystemd --no-start
override_dh_auto_configure:
conan remote add --index 0 $(RIPPLE_REMOTE) $(RIPPLE_REMOTE_URL) --force
conan config install ./conan/profiles/default --target-folder $(CONAN_HOME)/profiles
echo "tools.build:jobs={{ os.cpu_count() - 2 }}" >> ${CONAN_HOME}/global.conf
echo "core.download:parallel={{ os.cpu_count() }}" >> $(CONAN_GCONF)
conan install . \
--settings:all build_type=$(DEB_CMAKE_BUILD_TYPE) \
--output-folder=$(BUILD_DIR) \
--options:host "&:xrpld=True" \
--options:host "&:tests=True" \
--build=missing
# Debian assumes an offline build process and sets CMake's FETCHCONTENT_FULLY_DISCONNECTED variable to ON
# To use as much as the default settings as possible we'll clone it where CMake's FetchContent expects it.
mkdir -p "$(BUILD_DIR)/_deps"
git clone https://github.com/ripple/validator-keys-tool.git "$(BUILD_DIR)/_deps/validator_keys-src"
dh_auto_configure --builddirectory=$(BUILD_DIR) -- \
-DCMAKE_BUILD_TYPE:STRING=$(DEB_CMAKE_BUILD_TYPE) \
-Dxrpld=ON -Dtests=ON -Dvalidator_keys=ON \
-DCMAKE_INSTALL_PREFIX:PATH=$(INSTALL_PREFIX) \
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
-DCMAKE_TOOLCHAIN_FILE:FILEPATH=$(BUILD_DIR)/build/generators/conan_toolchain.cmake
override_dh_auto_build:
dh_auto_build \
--builddirectory=$(BUILD_DIR) -- rippled validator-keys
override_dh_auto_install:
cmake --install $(BUILD_DIR) --prefix debian/tmp/opt/ripple
install -D update-rippled.sh debian/tmp/opt/ripple/bin/update-rippled.sh
install -D update-rippled-cron debian/tmp/opt/ripple/etc/update-rippled-cron
install -D rippled-logrotate debian/tmp/etc/logrotate.d/rippled
rm -rf debian/tmp/opt/ripple/lib64/cmake/date
override_dh_dwz:
@echo "Skipping DWZ due to huge debug info"

View File

@@ -1 +0,0 @@
3.0 (native)

View File

@@ -1,2 +0,0 @@
#abort-on-upstream-changes
#unapply-patches

View File

@@ -1 +0,0 @@
enable rippled.service

View File

@@ -1,171 +0,0 @@
%global pkg_name %{getenv:repo_name}
%global branch %{getenv:branch}
%global commit %{getenv:commit}
%global shortcommit %{getenv:shortcommit}
%global date %{getenv:commit_date}
%global conan_remote_name %{getenv:conan_remote_name}
%global conan_remote_url %{getenv:conan_remote_url}
%global shared_files %{getenv:shared_files}
%global pkg_files %{getenv:pkg_files}
%global build_type %{getenv:BUILD_TYPE}
%global _prefix /opt/ripple
%global srcdir %{_builddir}/rippled
%global blddir %{srcdir}/bld.rippled
%global xrpl_version %{getenv:xrpl_version}
%global ver_base %(v=%{xrpl_version}; echo ${v%%-*})
%global _has_dash %(v=%{xrpl_version}; [ "${v#*-}" != "$v" ] && echo 1 || echo 0)
%if 0%{?_has_dash}
%global ver_suffix %(v=%{xrpl_version}; printf %s "${v#*-}")
%endif
Name: %{pkg_name}
Version: %{ver_base}
Release: %{?ver_suffix:0.%{ver_suffix}}%{!?ver_suffix:1}%{?dist}
Summary: %{name} XRPL daemon
License: ISC
URL: https://github.com/XRPLF/rippled
Source0: rippled.tar.gz
Patch0: rippled.patch
%{warn:name=%{name}}
%{warn:version=%{version}}
%{warn:ver_base=%{ver_base}}
%{warn:ver_suffix=%{ver_suffix}}
%{warn:release=%{release}}
%{warn:FullReleaseVersion=%{name}-%{version}-%{release}.%{_arch}.rpm}
%description
%{name} with p2p server for the XRP Ledger.
%prep
%autosetup -p1 -n %{name}
# TODO: Remove when version set with CMake.
if [ %{branch} == 'develop' ]; then
sed --in-place "s/versionString = \"\([^\"]*\)\"/versionString = \"\1+%{ver_input}\"/" src/libxrpl/protocol/BuildInfo.cpp
fi
%build
conan remote add --index 0 %{conan_remote_name} %{conan_remote_url} --force
conan config install conan/profiles/default --target-folder $(conan config home)/profiles/
echo "tools.build:jobs={{ os.cpu_count() - 2 }}" >> ${CONAN_HOME}/global.conf
echo "core.download:parallel={{ os.cpu_count() }}" >> ${CONAN_HOME}/global.conf
conan install %{srcdir} \
--settings:all build_type=%{build_type} \
--output-folder %{srcdir}/conan_deps \
--options:host "&:xrpld=True" \
--options:host "&:tests=True" \
--build=missing
cmake \
-S %{srcdir} \
-B %{blddir} \
-Dxrpld=ON \
-Dvalidator_keys=ON \
-Dtests=ON \
-DCMAKE_BUILD_TYPE:STRING=%{build_type} \
-DCMAKE_INSTALL_PREFIX:PATH=%{_prefix} \
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
-DCMAKE_TOOLCHAIN_FILE:FILEPATH=%{srcdir}/conan_deps/build/generators/conan_toolchain.cmake
cmake \
--build %{blddir} \
--parallel %{_smp_build_ncpus} \
--target rippled \
--target validator-keys
%install
rm -rf %{buildroot}
DESTDIR=%{buildroot} cmake --install %{blddir}
install -Dm0755 %{shared_files}/update-rippled.sh %{buildroot}%{_bindir}/update-rippled.sh
ln -s rippled %{buildroot}%{_bindir}/xrpld
ln -s update-rippled.sh %{buildroot}%{_bindir}/update-xrpld.sh
# configs
install -Dm0644 %{srcdir}/cfg/rippled-example.cfg %{buildroot}%{_prefix}/etc/rippled.cfg
install -Dm0644 %{srcdir}/cfg/validators-example.txt %{buildroot}%{_prefix}/etc/validators.txt
mkdir -p %{buildroot}%{_sysconfdir}/opt/ripple
#/etc points to /opt
ln -s ../../../opt/ripple/rippled.cfg %{buildroot}%{_sysconfdir}/opt/ripple/xrpld.cfg
ln -s ../../../opt/ripple/etc/rippled.cfg %{buildroot}%{_sysconfdir}/opt/ripple/rippled.cfg
ln -s ../../../opt/ripple/etc/validators.txt %{buildroot}%{_sysconfdir}/opt/ripple/validators.txt
# systemd/sysusers/tmpfiles
install -Dm0644 %{shared_files}/rippled.service %{buildroot}%{_unitdir}/rippled.service
install -Dm0644 %{pkg_files}/rippled.sysusers %{buildroot}%{_sysusersdir}/rippled.conf
install -Dm0644 %{pkg_files}/rippled.tmpfiles %{buildroot}%{_tmpfilesdir}/rippled.conf
%files
%license LICENSE*
%doc README*
# Files/dirs the pkgs owns
%dir %{_prefix}
%dir %{_prefix}/bin
%dir %{_prefix}/etc
%if 0
%dir %{_sysconfdir}/opt # Add this if rpmlint cries.
%endif
%dir %{_sysconfdir}/opt/ripple
# Binaries and symlinks under our (non-standard) _prefix (/opt/ripple)
%{_bindir}/rippled
%{_bindir}/xrpld
%{_bindir}/update-rippled.sh
%{_bindir}/update-xrpld.sh
%{_bindir}/validator-keys
# We won't ship these but we'll create them.
%ghost /usr/local/bin/rippled
%ghost /usr/local/bin/xrpld
%config(noreplace) %{_prefix}/etc/rippled.cfg
%config(noreplace) %{_prefix}/etc/validators.txt
%config(noreplace) %{_sysconfdir}/opt/ripple/rippled.cfg
%config(noreplace) %{_sysconfdir}/opt/ripple/xrpld.cfg
%config(noreplace) %{_sysconfdir}/opt/ripple/validators.txt
# systemd and service user creation
%{_unitdir}/rippled.service
%{_sysusersdir}/rippled.conf
%{_tmpfilesdir}/rippled.conf
# Let tmpfiles create the db and log dirs
%ghost %dir /var/opt/ripple
%ghost %dir /var/opt/ripple/lib
%ghost %dir /var/opt/ripple/log
# TODO: Fix the CMake install() calls so we don't need to exclude these.
%exclude %{_prefix}/include/*
%exclude %{_prefix}/lib/*
%exclude %{_prefix}/lib/pkgconfig/*
%exclude /usr/lib/debug/**
%post
# Add a link to $PATH /usr/local/bin/rippled %{_bindir}/rippled (also non-standard)
mkdir -p /usr/local/bin
for i in rippled xrpld
do
if [ ! -e /usr/local/bin/${i} ]; then
ln -s %{_bindir}/${i} /usr/local/bin/${i}
elif [ -L /usr/local/bin/${i} ] && \
[ "$(readlink -f /usr/local/bin/${i})" != "%{_bindir}/${i}" ]; then
ln -sfn %{_bindir}/${i} /usr/local/bin/${i}
fi
done
%preun
# remove the link only if it points to us (on erase, $1 == 0)
for i in rippled xrpld
do
if [ "$1" -eq 0 ] && [ -L /usr/local/bin/${i} ] && \
[ "$(readlink -f /usr/local/bin/${i})" = "%{_bindir}/${i}" ]; then
rm -f /usr/local/bin/${i}
fi
done

View File

@@ -1,2 +0,0 @@
u rippled - "System user for rippled service"
g rippled - -

View File

@@ -1,2 +0,0 @@
d /var/opt/ripple/lib 0750 rippled rippled -
d /var/opt/ripple/log 0750 rippled adm -

View File

@@ -1,15 +0,0 @@
/var/log/rippled/*.log {
daily
minsize 200M
rotate 7
nocreate
missingok
notifempty
compress
compresscmd /usr/bin/nice
compressoptions -n19 ionice -c3 gzip
compressext .gz
postrotate
/opt/ripple/bin/rippled --conf /opt/ripple/etc/rippled.cfg logrotate
endscript
}

View File

@@ -1,15 +0,0 @@
[Unit]
Description=Ripple Daemon
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
ExecStart=/opt/ripple/bin/rippled --net --silent --conf /etc/opt/ripple/rippled.cfg
Restart=on-failure
User=rippled
Group=rippled
LimitNOFILE=65536
[Install]
WantedBy=multi-user.target

View File

@@ -1,10 +0,0 @@
# For automatic updates, symlink this file to /etc/cron.d/
# Do not remove the newline at the end of this cron script
# bash required for use of RANDOM below.
SHELL=/bin/bash
PATH=/sbin;/bin;/usr/sbin;/usr/bin
# invoke check/update script with random delay up to 59 mins
0 * * * * root sleep $((RANDOM*3540/32768)) && /opt/ripple/bin/update-rippled.sh

View File

@@ -1,65 +0,0 @@
#!/usr/bin/env bash
# auto-update script for rippled daemon
# Check for sudo/root permissions
if [[ $(id -u) -ne 0 ]] ; then
echo "This update script must be run as root or sudo"
exit 1
fi
LOCKDIR=/tmp/rippleupdate.lock
UPDATELOG=/var/log/rippled/update.log
function cleanup {
# If this directory isn't removed, future updates will fail.
rmdir $LOCKDIR
}
# Use mkdir to check if process is already running. mkdir is atomic, as against file create.
if ! mkdir $LOCKDIR 2>/dev/null; then
echo $(date -u) "lockdir exists - won't proceed." >> $UPDATELOG
exit 1
fi
trap cleanup EXIT
source /etc/os-release
can_update=false
if [[ "$ID" == "ubuntu" || "$ID" == "debian" ]] ; then
# Silent update
apt-get update -qq
# The next line is an "awk"ward way to check if the package needs to be updated.
RIPPLE=$(apt-get install -s --only-upgrade rippled | awk '/^Inst/ { print $2 }')
test "$RIPPLE" == "rippled" && can_update=true
function apply_update {
apt-get install rippled -qq
}
elif [[ "$ID" == "fedora" || "$ID" == "centos" || "$ID" == "rhel" || "$ID" == "scientific" ]] ; then
RIPPLE_REPO=${RIPPLE_REPO-stable}
yum --disablerepo=* --enablerepo=ripple-$RIPPLE_REPO clean expire-cache
yum check-update -q --enablerepo=ripple-$RIPPLE_REPO rippled || can_update=true
function apply_update {
yum update -y --enablerepo=ripple-$RIPPLE_REPO rippled
}
else
echo "unrecognized distro!"
exit 1
fi
# Do the actual update and restart the service after reloading systemctl daemon.
if [ "$can_update" = true ] ; then
exec 3>&1 1>>${UPDATELOG} 2>&1
set -e
apply_update
systemctl daemon-reload
systemctl restart rippled.service
echo $(date -u) "rippled daemon updated."
else
echo $(date -u) "no updates available" >> $UPDATELOG
fi

View File

@@ -126,10 +126,10 @@ ApplyStateTable::apply(
std::optional<TxMeta> metadata;
if (!to.open() || isDryRun)
{
TxMeta meta(tx.getTransactionID(), to.seq(), parentBatchId);
TxMeta meta(tx.getTransactionID(), to.seq());
if (deliver)
meta.setDeliveredAmount(*deliver);
meta.setDeliveredAmount(deliver);
meta.setParentBatchID(parentBatchId);
Mods newMod;
for (auto& item : items_)

View File

@@ -17,7 +17,7 @@
*/
//==============================================================================
#include <xrpld/nodestore/detail/BatchWriter.h>
#include <xrpl/nodestore/detail/BatchWriter.h>
namespace ripple {
namespace NodeStore {

View File

@@ -17,11 +17,10 @@
*/
//==============================================================================
#include <xrpld/nodestore/Database.h>
#include <xrpl/basics/chrono.h>
#include <xrpl/beast/core/CurrentThreadName.h>
#include <xrpl/json/json_value.h>
#include <xrpl/nodestore/Database.h>
#include <xrpl/protocol/HashPrefix.h>
#include <xrpl/protocol/jss.h>

View File

@@ -17,7 +17,7 @@
*/
//==============================================================================
#include <xrpld/nodestore/detail/DatabaseNodeImp.h>
#include <xrpl/nodestore/detail/DatabaseNodeImp.h>
namespace ripple {
namespace NodeStore {

View File

@@ -17,7 +17,7 @@
*/
//==============================================================================
#include <xrpld/nodestore/detail/DatabaseRotatingImp.h>
#include <xrpl/nodestore/detail/DatabaseRotatingImp.h>
namespace ripple {
namespace NodeStore {

View File

@@ -17,10 +17,9 @@
*/
//==============================================================================
#include <xrpld/nodestore/detail/DecodedBlob.h>
#include <xrpl/basics/safe_cast.h>
#include <xrpl/beast/utility/instrumentation.h>
#include <xrpl/nodestore/detail/DecodedBlob.h>
#include <algorithm>

View File

@@ -17,7 +17,7 @@
*/
//==============================================================================
#include <xrpld/nodestore/DummyScheduler.h>
#include <xrpl/nodestore/DummyScheduler.h>
namespace ripple {
namespace NodeStore {

View File

@@ -17,8 +17,8 @@
*/
//==============================================================================
#include <xrpld/nodestore/detail/DatabaseNodeImp.h>
#include <xrpld/nodestore/detail/ManagerImp.h>
#include <xrpl/nodestore/detail/DatabaseNodeImp.h>
#include <xrpl/nodestore/detail/ManagerImp.h>
#include <boost/algorithm/string/predicate.hpp>
@@ -41,6 +41,27 @@ ManagerImp::missing_backend()
"please see the rippled-example.cfg file!");
}
// We shouldn't rely on global variables for lifetime management because their
// lifetime is not well-defined. ManagerImp may get destroyed before the Factory
// classes, and then, calling Manager::instance().erase() in the destructors of
// the Factory classes is an undefined behaviour.
void
registerNuDBFactory(Manager& manager);
void
registerRocksDBFactory(Manager& manager);
void
registerNullFactory(Manager& manager);
void
registerMemoryFactory(Manager& manager);
ManagerImp::ManagerImp()
{
registerNuDBFactory(*this);
registerRocksDBFactory(*this);
registerNullFactory(*this);
registerMemoryFactory(*this);
}
std::unique_ptr<Backend>
ManagerImp::make_Backend(
Section const& parameters,

View File

@@ -17,7 +17,7 @@
*/
//==============================================================================
#include <xrpld/nodestore/NodeObject.h>
#include <xrpl/nodestore/NodeObject.h>
#include <memory>

View File

@@ -17,10 +17,9 @@
*/
//==============================================================================
#include <xrpld/nodestore/Factory.h>
#include <xrpld/nodestore/Manager.h>
#include <xrpl/basics/contract.h>
#include <xrpl/nodestore/Factory.h>
#include <xrpl/nodestore/Manager.h>
#include <boost/beast/core/string.hpp>
#include <boost/core/ignore_unused.hpp>
@@ -46,10 +45,10 @@ class MemoryFactory : public Factory
private:
std::mutex mutex_;
std::map<std::string, MemoryDB, boost::beast::iless> map_;
Manager& manager_;
public:
MemoryFactory();
~MemoryFactory() override;
explicit MemoryFactory(Manager& manager);
std::string
getName() const override;
@@ -75,7 +74,14 @@ public:
}
};
static MemoryFactory memoryFactory;
MemoryFactory* memoryFactory = nullptr;
void
registerMemoryFactory(Manager& manager)
{
static MemoryFactory instance{manager};
memoryFactory = &instance;
}
//------------------------------------------------------------------------------
@@ -112,9 +118,9 @@ public:
}
void
open(bool createIfMissing) override
open(bool) override
{
db_ = &memoryFactory.open(name_);
db_ = &memoryFactory->open(name_);
}
bool
@@ -219,14 +225,9 @@ public:
//------------------------------------------------------------------------------
MemoryFactory::MemoryFactory()
MemoryFactory::MemoryFactory(Manager& manager) : manager_(manager)
{
Manager::instance().insert(*this);
}
MemoryFactory::~MemoryFactory()
{
Manager::instance().erase(*this);
manager_.insert(*this);
}
std::string

View File

@@ -17,15 +17,14 @@
*/
//==============================================================================
#include <xrpld/nodestore/Factory.h>
#include <xrpld/nodestore/Manager.h>
#include <xrpld/nodestore/detail/DecodedBlob.h>
#include <xrpld/nodestore/detail/EncodedBlob.h>
#include <xrpld/nodestore/detail/codec.h>
#include <xrpl/basics/contract.h>
#include <xrpl/beast/core/LexicalCast.h>
#include <xrpl/beast/utility/instrumentation.h>
#include <xrpl/nodestore/Factory.h>
#include <xrpl/nodestore/Manager.h>
#include <xrpl/nodestore/detail/DecodedBlob.h>
#include <xrpl/nodestore/detail/EncodedBlob.h>
#include <xrpl/nodestore/detail/codec.h>
#include <boost/filesystem.hpp>
@@ -427,15 +426,13 @@ private:
class NuDBFactory : public Factory
{
public:
NuDBFactory()
{
Manager::instance().insert(*this);
}
private:
Manager& manager_;
~NuDBFactory() override
public:
explicit NuDBFactory(Manager& manager) : manager_(manager)
{
Manager::instance().erase(*this);
manager_.insert(*this);
}
std::string
@@ -470,7 +467,11 @@ public:
}
};
static NuDBFactory nuDBFactory;
void
registerNuDBFactory(Manager& manager)
{
static NuDBFactory instance{manager};
}
} // namespace NodeStore
} // namespace ripple

View File

@@ -17,8 +17,8 @@
*/
//==============================================================================
#include <xrpld/nodestore/Factory.h>
#include <xrpld/nodestore/Manager.h>
#include <xrpl/nodestore/Factory.h>
#include <xrpl/nodestore/Manager.h>
#include <memory>
@@ -111,15 +111,13 @@ private:
class NullFactory : public Factory
{
public:
NullFactory()
{
Manager::instance().insert(*this);
}
private:
Manager& manager_;
~NullFactory() override
public:
explicit NullFactory(Manager& manager) : manager_(manager)
{
Manager::instance().erase(*this);
manager_.insert(*this);
}
std::string
@@ -140,7 +138,11 @@ public:
}
};
static NullFactory nullFactory;
void
registerNullFactory(Manager& manager)
{
static NullFactory instance{manager};
}
} // namespace NodeStore
} // namespace ripple

View File

@@ -17,20 +17,18 @@
*/
//==============================================================================
#include <xrpld/unity/rocksdb.h>
#include <xrpl/basics/rocksdb.h>
#if RIPPLE_ROCKSDB_AVAILABLE
#include <xrpld/core/Config.h> // VFALCO Bad dependency
#include <xrpld/nodestore/Factory.h>
#include <xrpld/nodestore/Manager.h>
#include <xrpld/nodestore/detail/BatchWriter.h>
#include <xrpld/nodestore/detail/DecodedBlob.h>
#include <xrpld/nodestore/detail/EncodedBlob.h>
#include <xrpl/basics/ByteUtilities.h>
#include <xrpl/basics/contract.h>
#include <xrpl/basics/safe_cast.h>
#include <xrpl/beast/core/CurrentThreadName.h>
#include <xrpl/nodestore/Factory.h>
#include <xrpl/nodestore/Manager.h>
#include <xrpl/nodestore/detail/BatchWriter.h>
#include <xrpl/nodestore/detail/DecodedBlob.h>
#include <xrpl/nodestore/detail/EncodedBlob.h>
#include <atomic>
#include <memory>
@@ -461,17 +459,15 @@ public:
class RocksDBFactory : public Factory
{
private:
Manager& manager_;
public:
RocksDBEnv m_env;
RocksDBFactory()
RocksDBFactory(Manager& manager) : manager_(manager)
{
Manager::instance().insert(*this);
}
~RocksDBFactory() override
{
Manager::instance().erase(*this);
manager_.insert(*this);
}
std::string
@@ -493,7 +489,11 @@ public:
}
};
static RocksDBFactory rocksDBFactory;
void
registerRocksDBFactory(Manager& manager)
{
static RocksDBFactory instance{manager};
}
} // namespace NodeStore
} // namespace ripple

View File

@@ -174,21 +174,22 @@ Permission::isDelegatable(
auto const txType = permissionToTxType(permissionValue);
auto const it = delegatableTx_.find(txType);
if (rules.enabled(fixDelegateV1_1))
{
if (it == delegatableTx_.end())
return false;
if (it == delegatableTx_.end())
return false;
auto const feature = getTxFeature(txType);
auto const txFeaturesIt = txFeatureMap_.find(txType);
XRPL_ASSERT(
txFeaturesIt != txFeatureMap_.end(),
"ripple::Permissions::isDelegatable : tx exists in txFeatureMap_");
// fixDelegateV1_1: Delegation is only allowed if the required amendment
// for the transaction is enabled. For transactions that do not require
// an amendment, delegation is always allowed.
if (feature && !rules.enabled(*feature))
return false;
}
// Delegation is only allowed if the required amendment for the transaction
// is enabled. For transactions that do not require an amendment, delegation
// is always allowed.
if (txFeaturesIt->second != uint256{} &&
!rules.enabled(txFeaturesIt->second))
return false;
if (it != delegatableTx_.end() && it->second == Delegation::notDelegatable)
if (it->second == Delegation::notDelegatable)
return false;
return true;

View File

@@ -131,17 +131,6 @@ Rules::enabled(uint256 const& feature) const
{
XRPL_ASSERT(impl_, "ripple::Rules::enabled : initialized");
// The functionality of the "NonFungibleTokensV1_1" amendment is
// precisely the functionality of the following three amendments
// so if their status is ever queried individually, we inject an
// extra check here to simplify the checking elsewhere.
if (feature == featureNonFungibleTokensV1 ||
feature == fixNFTokenNegOffer || feature == fixNFTokenDirV1)
{
if (impl_->enabled(featureNonFungibleTokensV1_1))
return true;
}
return impl_->enabled(feature);
}

View File

@@ -127,7 +127,6 @@ transResults()
MAKE_ERROR(tecLIMIT_EXCEEDED, "Limit exceeded."),
MAKE_ERROR(tecPSEUDO_ACCOUNT, "This operation is not allowed against a pseudo-account."),
MAKE_ERROR(tecPRECISION_LOSS, "The amounts used by the transaction cannot interact."),
MAKE_ERROR(tecNO_DELEGATE_PERMISSION, "Delegated account lacks permission to perform this transaction."),
MAKE_ERROR(tefALREADY, "The exact transaction was already in this ledger."),
MAKE_ERROR(tefBAD_ADD_AUTH, "Not authorized to add account."),
@@ -235,6 +234,7 @@ transResults()
MAKE_ERROR(terPRE_TICKET, "Ticket is not yet in ledger."),
MAKE_ERROR(terNO_AMM, "AMM doesn't exist for the asset pair."),
MAKE_ERROR(terADDRESS_COLLISION, "Failed to allocate an unique account address."),
MAKE_ERROR(terNO_DELEGATE_PERMISSION, "Delegated account lacks permission to perform this transaction."),
MAKE_ERROR(tesSUCCESS, "The transaction was applied. Only final in a validated ledger."),
};

View File

@@ -39,35 +39,13 @@
namespace ripple {
template <class T>
TxMeta::TxMeta(
uint256 const& txid,
std::uint32_t ledger,
T const& data,
CtorHelper)
: mTransactionID(txid), mLedger(ledger), mNodes(sfAffectedNodes, 32)
{
SerialIter sit(makeSlice(data));
STObject obj(sit, sfMetadata);
mResult = obj.getFieldU8(sfTransactionResult);
mIndex = obj.getFieldU32(sfTransactionIndex);
mNodes = *dynamic_cast<STArray*>(&obj.getField(sfAffectedNodes));
if (obj.isFieldPresent(sfDeliveredAmount))
setDeliveredAmount(obj.getFieldAmount(sfDeliveredAmount));
if (obj.isFieldPresent(sfParentBatchID))
setParentBatchId(obj.getFieldH256(sfParentBatchID));
}
TxMeta::TxMeta(uint256 const& txid, std::uint32_t ledger, STObject const& obj)
: mTransactionID(txid)
, mLedger(ledger)
, mNodes(obj.getFieldArray(sfAffectedNodes))
: transactionID_(txid)
, ledgerSeq_(ledger)
, nodes_(obj.getFieldArray(sfAffectedNodes))
{
mResult = obj.getFieldU8(sfTransactionResult);
mIndex = obj.getFieldU32(sfTransactionIndex);
result_ = obj.getFieldU8(sfTransactionResult);
index_ = obj.getFieldU32(sfTransactionIndex);
auto affectedNodes =
dynamic_cast<STArray const*>(obj.peekAtPField(sfAffectedNodes));
@@ -75,40 +53,32 @@ TxMeta::TxMeta(uint256 const& txid, std::uint32_t ledger, STObject const& obj)
affectedNodes,
"ripple::TxMeta::TxMeta(STObject) : type cast succeeded");
if (affectedNodes)
mNodes = *affectedNodes;
nodes_ = *affectedNodes;
if (obj.isFieldPresent(sfDeliveredAmount))
setDeliveredAmount(obj.getFieldAmount(sfDeliveredAmount));
if (obj.isFieldPresent(sfParentBatchID))
setParentBatchId(obj.getFieldH256(sfParentBatchID));
setAdditionalFields(obj);
}
TxMeta::TxMeta(uint256 const& txid, std::uint32_t ledger, Blob const& vec)
: TxMeta(txid, ledger, vec, CtorHelper())
: transactionID_(txid), ledgerSeq_(ledger), nodes_(sfAffectedNodes, 32)
{
SerialIter sit(makeSlice(vec));
STObject obj(sit, sfMetadata);
result_ = obj.getFieldU8(sfTransactionResult);
index_ = obj.getFieldU32(sfTransactionIndex);
nodes_ = obj.getFieldArray(sfAffectedNodes);
setAdditionalFields(obj);
}
TxMeta::TxMeta(
uint256 const& txid,
std::uint32_t ledger,
std::string const& data)
: TxMeta(txid, ledger, data, CtorHelper())
TxMeta::TxMeta(uint256 const& transactionID, std::uint32_t ledger)
: transactionID_(transactionID)
, ledgerSeq_(ledger)
, index_(std::numeric_limits<std::uint32_t>::max())
, result_(255)
, nodes_(sfAffectedNodes)
{
}
TxMeta::TxMeta(
uint256 const& transactionID,
std::uint32_t ledger,
std::optional<uint256> parentBatchId)
: mTransactionID(transactionID)
, mLedger(ledger)
, mIndex(static_cast<std::uint32_t>(-1))
, mResult(255)
, mParentBatchId(parentBatchId)
, mNodes(sfAffectedNodes)
{
mNodes.reserve(32);
nodes_.reserve(32);
}
void
@@ -118,7 +88,7 @@ TxMeta::setAffectedNode(
std::uint16_t nodeType)
{
// make sure the node exists and force its type
for (auto& n : mNodes)
for (auto& n : nodes_)
{
if (n.getFieldH256(sfLedgerIndex) == node)
{
@@ -128,8 +98,8 @@ TxMeta::setAffectedNode(
}
}
mNodes.push_back(STObject(type));
STObject& obj = mNodes.back();
nodes_.push_back(STObject(type));
STObject& obj = nodes_.back();
XRPL_ASSERT(
obj.getFName() == type,
@@ -146,14 +116,15 @@ TxMeta::getAffectedAccounts() const
// This code should match the behavior of the JS method:
// Meta#getAffectedAccounts
for (auto const& it : mNodes)
for (auto const& node : nodes_)
{
int index = it.getFieldIndex(
(it.getFName() == sfCreatedNode) ? sfNewFields : sfFinalFields);
int index = node.getFieldIndex(
(node.getFName() == sfCreatedNode) ? sfNewFields : sfFinalFields);
if (index != -1)
{
auto inner = dynamic_cast<STObject const*>(&it.peekAtIndex(index));
auto const* inner =
dynamic_cast<STObject const*>(&node.peekAtIndex(index));
XRPL_ASSERT(
inner,
"ripple::getAffectedAccounts : STObject type cast succeeded");
@@ -213,13 +184,13 @@ STObject&
TxMeta::getAffectedNode(SLE::ref node, SField const& type)
{
uint256 index = node->key();
for (auto& n : mNodes)
for (auto& n : nodes_)
{
if (n.getFieldH256(sfLedgerIndex) == index)
return n;
}
mNodes.push_back(STObject(type));
STObject& obj = mNodes.back();
nodes_.push_back(STObject(type));
STObject& obj = nodes_.back();
XRPL_ASSERT(
obj.getFName() == type,
@@ -233,7 +204,7 @@ TxMeta::getAffectedNode(SLE::ref node, SField const& type)
STObject&
TxMeta::getAffectedNode(uint256 const& node)
{
for (auto& n : mNodes)
for (auto& n : nodes_)
{
if (n.getFieldH256(sfLedgerIndex) == node)
return n;
@@ -241,7 +212,7 @@ TxMeta::getAffectedNode(uint256 const& node)
// LCOV_EXCL_START
UNREACHABLE("ripple::TxMeta::getAffectedNode(uint256) : node not found");
Throw<std::runtime_error>("Affected node not found");
return *(mNodes.begin()); // Silence compiler warning.
return *(nodes_.begin()); // Silence compiler warning.
// LCOV_EXCL_STOP
}
@@ -249,15 +220,15 @@ STObject
TxMeta::getAsObject() const
{
STObject metaData(sfTransactionMetaData);
XRPL_ASSERT(mResult != 255, "ripple::TxMeta::getAsObject : result is set");
metaData.setFieldU8(sfTransactionResult, mResult);
metaData.setFieldU32(sfTransactionIndex, mIndex);
metaData.emplace_back(mNodes);
if (hasDeliveredAmount())
metaData.setFieldAmount(sfDeliveredAmount, getDeliveredAmount());
XRPL_ASSERT(result_ != 255, "ripple::TxMeta::getAsObject : result_ is set");
metaData.setFieldU8(sfTransactionResult, result_);
metaData.setFieldU32(sfTransactionIndex, index_);
metaData.emplace_back(nodes_);
if (deliveredAmount_.has_value())
metaData.setFieldAmount(sfDeliveredAmount, *deliveredAmount_);
if (hasParentBatchId())
metaData.setFieldH256(sfParentBatchID, getParentBatchId());
if (parentBatchID_.has_value())
metaData.setFieldH256(sfParentBatchID, *parentBatchID_);
return metaData;
}
@@ -265,13 +236,13 @@ TxMeta::getAsObject() const
void
TxMeta::addRaw(Serializer& s, TER result, std::uint32_t index)
{
mResult = TERtoInt(result);
mIndex = index;
result_ = TERtoInt(result);
index_ = index;
XRPL_ASSERT(
(mResult == 0) || ((mResult > 100) && (mResult <= 255)),
(result_ == 0) || ((result_ > 100) && (result_ <= 255)),
"ripple::TxMeta::addRaw : valid TER input");
mNodes.sort([](STObject const& o1, STObject const& o2) {
nodes_.sort([](STObject const& o1, STObject const& o2) {
return o1.getFieldH256(sfLedgerIndex) < o2.getFieldH256(sfLedgerIndex);
});

View File

@@ -17,15 +17,14 @@
*/
//==============================================================================
#include <xrpld/shamap/SHAMap.h>
#include <xrpld/shamap/SHAMapAccountStateLeafNode.h>
#include <xrpld/shamap/SHAMapNodeID.h>
#include <xrpld/shamap/SHAMapSyncFilter.h>
#include <xrpld/shamap/SHAMapTxLeafNode.h>
#include <xrpld/shamap/SHAMapTxPlusMetaLeafNode.h>
#include <xrpl/basics/TaggedCache.ipp>
#include <xrpl/basics/contract.h>
#include <xrpl/shamap/SHAMap.h>
#include <xrpl/shamap/SHAMapAccountStateLeafNode.h>
#include <xrpl/shamap/SHAMapNodeID.h>
#include <xrpl/shamap/SHAMapSyncFilter.h>
#include <xrpl/shamap/SHAMapTxLeafNode.h>
#include <xrpl/shamap/SHAMapTxPlusMetaLeafNode.h>
namespace ripple {

View File

@@ -17,10 +17,9 @@
*/
//==============================================================================
#include <xrpld/shamap/SHAMap.h>
#include <xrpl/basics/IntrusivePointer.ipp>
#include <xrpl/basics/contract.h>
#include <xrpl/shamap/SHAMap.h>
#include <array>
#include <stack>

View File

@@ -17,16 +17,15 @@
*/
//==============================================================================
#include <xrpld/shamap/SHAMapInnerNode.h>
#include <xrpld/shamap/SHAMapTreeNode.h>
#include <xrpld/shamap/detail/TaggedPointer.ipp>
#include <xrpl/basics/IntrusivePointer.ipp>
#include <xrpl/basics/Slice.h>
#include <xrpl/basics/contract.h>
#include <xrpl/basics/spinlock.h>
#include <xrpl/protocol/HashPrefix.h>
#include <xrpl/protocol/digest.h>
#include <xrpl/shamap/SHAMapInnerNode.h>
#include <xrpl/shamap/SHAMapTreeNode.h>
#include <xrpl/shamap/detail/TaggedPointer.ipp>
namespace ripple {

View File

@@ -17,7 +17,7 @@
*/
//==============================================================================
#include <xrpld/shamap/SHAMapLeafNode.h>
#include <xrpl/shamap/SHAMapLeafNode.h>
namespace ripple {

View File

@@ -17,12 +17,11 @@
*/
//==============================================================================
#include <xrpld/shamap/SHAMap.h>
#include <xrpld/shamap/SHAMapNodeID.h>
#include <xrpl/beast/core/LexicalCast.h>
#include <xrpl/beast/utility/instrumentation.h>
#include <xrpl/protocol/Serializer.h>
#include <xrpl/shamap/SHAMap.h>
#include <xrpl/shamap/SHAMapNodeID.h>
namespace ripple {

Some files were not shown because too many files have changed in this diff Show More