mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Compare commits
9 Commits
pratik/Cha
...
ripple/was
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8a403f1241 | ||
|
|
b986395ecc | ||
|
|
6d2640871d | ||
|
|
500bb68831 | ||
|
|
16087c9680 | ||
|
|
25c3060fef | ||
|
|
ce9f0b38a4 | ||
|
|
35f7cbf772 | ||
|
|
0db564d261 |
1
.github/actions/build-deps/action.yml
vendored
1
.github/actions/build-deps/action.yml
vendored
@@ -35,6 +35,7 @@ runs:
|
|||||||
LOG_VERBOSITY: ${{ inputs.log_verbosity }}
|
LOG_VERBOSITY: ${{ inputs.log_verbosity }}
|
||||||
run: |
|
run: |
|
||||||
echo 'Installing dependencies.'
|
echo 'Installing dependencies.'
|
||||||
|
conan export --version 0.42.1 external/wasmi #TODO Switch to conan package
|
||||||
mkdir -p "${BUILD_DIR}"
|
mkdir -p "${BUILD_DIR}"
|
||||||
cd "${BUILD_DIR}"
|
cd "${BUILD_DIR}"
|
||||||
conan install \
|
conan install \
|
||||||
|
|||||||
56
.github/scripts/strategy-matrix/linux.json
vendored
56
.github/scripts/strategy-matrix/linux.json
vendored
@@ -15,196 +15,196 @@
|
|||||||
"distro_version": "bookworm",
|
"distro_version": "bookworm",
|
||||||
"compiler_name": "gcc",
|
"compiler_name": "gcc",
|
||||||
"compiler_version": "12",
|
"compiler_version": "12",
|
||||||
"image_sha": "0525eae"
|
"image_sha": "ca4517d"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "debian",
|
"distro_name": "debian",
|
||||||
"distro_version": "bookworm",
|
"distro_version": "bookworm",
|
||||||
"compiler_name": "gcc",
|
"compiler_name": "gcc",
|
||||||
"compiler_version": "13",
|
"compiler_version": "13",
|
||||||
"image_sha": "0525eae"
|
"image_sha": "ca4517d"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "debian",
|
"distro_name": "debian",
|
||||||
"distro_version": "bookworm",
|
"distro_version": "bookworm",
|
||||||
"compiler_name": "gcc",
|
"compiler_name": "gcc",
|
||||||
"compiler_version": "14",
|
"compiler_version": "14",
|
||||||
"image_sha": "0525eae"
|
"image_sha": "ca4517d"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "debian",
|
"distro_name": "debian",
|
||||||
"distro_version": "bookworm",
|
"distro_version": "bookworm",
|
||||||
"compiler_name": "gcc",
|
"compiler_name": "gcc",
|
||||||
"compiler_version": "15",
|
"compiler_version": "15",
|
||||||
"image_sha": "0525eae"
|
"image_sha": "ca4517d"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "debian",
|
"distro_name": "debian",
|
||||||
"distro_version": "bookworm",
|
"distro_version": "bookworm",
|
||||||
"compiler_name": "clang",
|
"compiler_name": "clang",
|
||||||
"compiler_version": "16",
|
"compiler_version": "16",
|
||||||
"image_sha": "0525eae"
|
"image_sha": "ca4517d"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "debian",
|
"distro_name": "debian",
|
||||||
"distro_version": "bookworm",
|
"distro_version": "bookworm",
|
||||||
"compiler_name": "clang",
|
"compiler_name": "clang",
|
||||||
"compiler_version": "17",
|
"compiler_version": "17",
|
||||||
"image_sha": "0525eae"
|
"image_sha": "ca4517d"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "debian",
|
"distro_name": "debian",
|
||||||
"distro_version": "bookworm",
|
"distro_version": "bookworm",
|
||||||
"compiler_name": "clang",
|
"compiler_name": "clang",
|
||||||
"compiler_version": "18",
|
"compiler_version": "18",
|
||||||
"image_sha": "0525eae"
|
"image_sha": "ca4517d"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "debian",
|
"distro_name": "debian",
|
||||||
"distro_version": "bookworm",
|
"distro_version": "bookworm",
|
||||||
"compiler_name": "clang",
|
"compiler_name": "clang",
|
||||||
"compiler_version": "19",
|
"compiler_version": "19",
|
||||||
"image_sha": "0525eae"
|
"image_sha": "ca4517d"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "debian",
|
"distro_name": "debian",
|
||||||
"distro_version": "bookworm",
|
"distro_version": "bookworm",
|
||||||
"compiler_name": "clang",
|
"compiler_name": "clang",
|
||||||
"compiler_version": "20",
|
"compiler_version": "20",
|
||||||
"image_sha": "0525eae"
|
"image_sha": "ca4517d"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "debian",
|
"distro_name": "debian",
|
||||||
"distro_version": "trixie",
|
"distro_version": "trixie",
|
||||||
"compiler_name": "gcc",
|
"compiler_name": "gcc",
|
||||||
"compiler_version": "14",
|
"compiler_version": "14",
|
||||||
"image_sha": "0525eae"
|
"image_sha": "ca4517d"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "debian",
|
"distro_name": "debian",
|
||||||
"distro_version": "trixie",
|
"distro_version": "trixie",
|
||||||
"compiler_name": "gcc",
|
"compiler_name": "gcc",
|
||||||
"compiler_version": "15",
|
"compiler_version": "15",
|
||||||
"image_sha": "0525eae"
|
"image_sha": "ca4517d"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "debian",
|
"distro_name": "debian",
|
||||||
"distro_version": "trixie",
|
"distro_version": "trixie",
|
||||||
"compiler_name": "clang",
|
"compiler_name": "clang",
|
||||||
"compiler_version": "20",
|
"compiler_version": "20",
|
||||||
"image_sha": "0525eae"
|
"image_sha": "ca4517d"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "debian",
|
"distro_name": "debian",
|
||||||
"distro_version": "trixie",
|
"distro_version": "trixie",
|
||||||
"compiler_name": "clang",
|
"compiler_name": "clang",
|
||||||
"compiler_version": "21",
|
"compiler_version": "21",
|
||||||
"image_sha": "0525eae"
|
"image_sha": "ca4517d"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "rhel",
|
"distro_name": "rhel",
|
||||||
"distro_version": "8",
|
"distro_version": "8",
|
||||||
"compiler_name": "gcc",
|
"compiler_name": "gcc",
|
||||||
"compiler_version": "14",
|
"compiler_version": "14",
|
||||||
"image_sha": "e1782cd"
|
"image_sha": "ca4517d"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "rhel",
|
"distro_name": "rhel",
|
||||||
"distro_version": "8",
|
"distro_version": "8",
|
||||||
"compiler_name": "clang",
|
"compiler_name": "clang",
|
||||||
"compiler_version": "any",
|
"compiler_version": "any",
|
||||||
"image_sha": "e1782cd"
|
"image_sha": "ca4517d"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "rhel",
|
"distro_name": "rhel",
|
||||||
"distro_version": "9",
|
"distro_version": "9",
|
||||||
"compiler_name": "gcc",
|
"compiler_name": "gcc",
|
||||||
"compiler_version": "12",
|
"compiler_version": "12",
|
||||||
"image_sha": "e1782cd"
|
"image_sha": "ca4517d"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "rhel",
|
"distro_name": "rhel",
|
||||||
"distro_version": "9",
|
"distro_version": "9",
|
||||||
"compiler_name": "gcc",
|
"compiler_name": "gcc",
|
||||||
"compiler_version": "13",
|
"compiler_version": "13",
|
||||||
"image_sha": "e1782cd"
|
"image_sha": "ca4517d"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "rhel",
|
"distro_name": "rhel",
|
||||||
"distro_version": "9",
|
"distro_version": "9",
|
||||||
"compiler_name": "gcc",
|
"compiler_name": "gcc",
|
||||||
"compiler_version": "14",
|
"compiler_version": "14",
|
||||||
"image_sha": "e1782cd"
|
"image_sha": "ca4517d"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "rhel",
|
"distro_name": "rhel",
|
||||||
"distro_version": "9",
|
"distro_version": "9",
|
||||||
"compiler_name": "clang",
|
"compiler_name": "clang",
|
||||||
"compiler_version": "any",
|
"compiler_version": "any",
|
||||||
"image_sha": "e1782cd"
|
"image_sha": "ca4517d"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "rhel",
|
"distro_name": "rhel",
|
||||||
"distro_version": "10",
|
"distro_version": "10",
|
||||||
"compiler_name": "gcc",
|
"compiler_name": "gcc",
|
||||||
"compiler_version": "14",
|
"compiler_version": "14",
|
||||||
"image_sha": "e1782cd"
|
"image_sha": "ca4517d"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "rhel",
|
"distro_name": "rhel",
|
||||||
"distro_version": "10",
|
"distro_version": "10",
|
||||||
"compiler_name": "clang",
|
"compiler_name": "clang",
|
||||||
"compiler_version": "any",
|
"compiler_version": "any",
|
||||||
"image_sha": "e1782cd"
|
"image_sha": "ca4517d"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "ubuntu",
|
"distro_name": "ubuntu",
|
||||||
"distro_version": "jammy",
|
"distro_version": "jammy",
|
||||||
"compiler_name": "gcc",
|
"compiler_name": "gcc",
|
||||||
"compiler_version": "12",
|
"compiler_version": "12",
|
||||||
"image_sha": "e1782cd"
|
"image_sha": "ca4517d"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "ubuntu",
|
"distro_name": "ubuntu",
|
||||||
"distro_version": "noble",
|
"distro_version": "noble",
|
||||||
"compiler_name": "gcc",
|
"compiler_name": "gcc",
|
||||||
"compiler_version": "13",
|
"compiler_version": "13",
|
||||||
"image_sha": "e1782cd"
|
"image_sha": "ca4517d"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "ubuntu",
|
"distro_name": "ubuntu",
|
||||||
"distro_version": "noble",
|
"distro_version": "noble",
|
||||||
"compiler_name": "gcc",
|
"compiler_name": "gcc",
|
||||||
"compiler_version": "14",
|
"compiler_version": "14",
|
||||||
"image_sha": "e1782cd"
|
"image_sha": "ca4517d"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "ubuntu",
|
"distro_name": "ubuntu",
|
||||||
"distro_version": "noble",
|
"distro_version": "noble",
|
||||||
"compiler_name": "clang",
|
"compiler_name": "clang",
|
||||||
"compiler_version": "16",
|
"compiler_version": "16",
|
||||||
"image_sha": "e1782cd"
|
"image_sha": "ca4517d"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "ubuntu",
|
"distro_name": "ubuntu",
|
||||||
"distro_version": "noble",
|
"distro_version": "noble",
|
||||||
"compiler_name": "clang",
|
"compiler_name": "clang",
|
||||||
"compiler_version": "17",
|
"compiler_version": "17",
|
||||||
"image_sha": "e1782cd"
|
"image_sha": "ca4517d"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "ubuntu",
|
"distro_name": "ubuntu",
|
||||||
"distro_version": "noble",
|
"distro_version": "noble",
|
||||||
"compiler_name": "clang",
|
"compiler_name": "clang",
|
||||||
"compiler_version": "18",
|
"compiler_version": "18",
|
||||||
"image_sha": "e1782cd"
|
"image_sha": "ca4517d"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "ubuntu",
|
"distro_name": "ubuntu",
|
||||||
"distro_version": "noble",
|
"distro_version": "noble",
|
||||||
"compiler_name": "clang",
|
"compiler_name": "clang",
|
||||||
"compiler_version": "19",
|
"compiler_version": "19",
|
||||||
"image_sha": "e1782cd"
|
"image_sha": "ca4517d"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"build_type": ["Debug", "Release"],
|
"build_type": ["Debug", "Release"],
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ jobs:
|
|||||||
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
|
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
|
||||||
|
|
||||||
- name: Prepare runner
|
- name: Prepare runner
|
||||||
uses: XRPLF/actions/.github/actions/prepare-runner@99685816bb60a95a66852f212f382580e180df3a
|
uses: XRPLF/actions/.github/actions/prepare-runner@ff9f8f649df5855ffe1a1ae715df43e51807f2e0
|
||||||
with:
|
with:
|
||||||
disable_ccache: false
|
disable_ccache: false
|
||||||
|
|
||||||
|
|||||||
2
.github/workflows/upload-conan-deps.yml
vendored
2
.github/workflows/upload-conan-deps.yml
vendored
@@ -70,7 +70,7 @@ jobs:
|
|||||||
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
|
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
|
||||||
|
|
||||||
- name: Prepare runner
|
- name: Prepare runner
|
||||||
uses: XRPLF/actions/.github/actions/prepare-runner@99685816bb60a95a66852f212f382580e180df3a
|
uses: XRPLF/actions/.github/actions/prepare-runner@ff9f8f649df5855ffe1a1ae715df43e51807f2e0
|
||||||
with:
|
with:
|
||||||
disable_ccache: false
|
disable_ccache: false
|
||||||
|
|
||||||
|
|||||||
33
BUILD.md
33
BUILD.md
@@ -141,26 +141,37 @@ Alternatively, you can pull the patched recipes into the repository and use them
|
|||||||
locally:
|
locally:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
# Extract the version number from the lockfile.
|
||||||
|
function extract_version {
|
||||||
|
version=$(cat conan.lock | sed -nE "s@.+${1}/(.+)#.+@\1@p" | head -n1)
|
||||||
|
echo ${version}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Define which recipes to export.
|
||||||
|
recipes=(ed25519 grpc secp256k1 snappy soci)
|
||||||
|
|
||||||
|
# Selectively check out the recipes from our CCI fork.
|
||||||
cd external
|
cd external
|
||||||
mkdir -p conan-center-index
|
mkdir -p conan-center-index
|
||||||
cd conan-center-index
|
cd conan-center-index
|
||||||
git init
|
git init
|
||||||
git remote add origin git@github.com:XRPLF/conan-center-index.git
|
git remote add origin git@github.com:XRPLF/conan-center-index.git
|
||||||
git sparse-checkout init
|
git sparse-checkout init
|
||||||
git sparse-checkout set recipes/ed25519
|
for recipe in ${recipes[@]}; do
|
||||||
git sparse-checkout add recipes/grpc
|
echo "Checking out ${recipe}..."
|
||||||
git sparse-checkout add recipes/secp256k1
|
git sparse-checkout add recipes/${recipe}/all
|
||||||
git sparse-checkout add recipes/snappy
|
done
|
||||||
git sparse-checkout add recipes/soci
|
|
||||||
git fetch origin master
|
git fetch origin master
|
||||||
git checkout master
|
git checkout master
|
||||||
rm -rf .git
|
|
||||||
cd ../..
|
cd ../..
|
||||||
conan export --version 2015.03 external/conan-center-index/recipes/ed25519/all
|
|
||||||
conan export --version 1.72.0 external/conan-center-index/recipes/grpc/all
|
# Export the recipes into the local cache.
|
||||||
conan export --version 0.7.0 external/conan-center-index/recipes/secp256k1/all
|
for recipe in ${recipes[@]}; do
|
||||||
conan export --version 1.1.10 external/conan-center-index/recipes/snappy/all
|
version=$(extract_version ${recipe})
|
||||||
conan export --version 4.0.3 external/conan-center-index/recipes/soci/all
|
echo "Exporting ${recipe}/${version}..."
|
||||||
|
conan export --version $(extract_version ${recipe}) \
|
||||||
|
external/conan-center-index/recipes/${recipe}/all
|
||||||
|
done
|
||||||
```
|
```
|
||||||
|
|
||||||
In the case we switch to a newer version of a dependency that still requires a
|
In the case we switch to a newer version of a dependency that still requires a
|
||||||
|
|||||||
@@ -113,6 +113,7 @@ find_package(date REQUIRED)
|
|||||||
find_package(ed25519 REQUIRED)
|
find_package(ed25519 REQUIRED)
|
||||||
find_package(nudb REQUIRED)
|
find_package(nudb REQUIRED)
|
||||||
find_package(secp256k1 REQUIRED)
|
find_package(secp256k1 REQUIRED)
|
||||||
|
find_package(wasmi REQUIRED)
|
||||||
find_package(xxHash REQUIRED)
|
find_package(xxHash REQUIRED)
|
||||||
|
|
||||||
target_link_libraries(xrpl_libs INTERFACE
|
target_link_libraries(xrpl_libs INTERFACE
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ target_link_libraries(xrpl.imports.main
|
|||||||
Xrpl::opts
|
Xrpl::opts
|
||||||
Xrpl::syslibs
|
Xrpl::syslibs
|
||||||
secp256k1::secp256k1
|
secp256k1::secp256k1
|
||||||
|
wasmi::wasmi
|
||||||
xrpl.libpb
|
xrpl.libpb
|
||||||
xxHash::xxhash
|
xxHash::xxhash
|
||||||
$<$<BOOL:${voidstar}>:antithesis-sdk-cpp>
|
$<$<BOOL:${voidstar}>:antithesis-sdk-cpp>
|
||||||
|
|||||||
62
conan.lock
62
conan.lock
@@ -1,62 +0,0 @@
|
|||||||
{
|
|
||||||
"version": "0.5",
|
|
||||||
"requires": [
|
|
||||||
"zlib/1.3.1#b8bc2603263cf7eccbd6e17e66b0ed76%1756234269.497",
|
|
||||||
"xxhash/0.8.3#681d36a0a6111fc56e5e45ea182c19cc%1756234289.683",
|
|
||||||
"sqlite3/3.49.1#8631739a4c9b93bd3d6b753bac548a63%1756234266.869",
|
|
||||||
"soci/4.0.3#a9f8d773cd33e356b5879a4b0564f287%1756234262.318",
|
|
||||||
"snappy/1.1.10#968fef506ff261592ec30c574d4a7809%1756234314.246",
|
|
||||||
"secp256k1/0.7.0#9210e4c655d0a665400378a663960d17%1764261276.764",
|
|
||||||
"rocksdb/10.5.1#4a197eca381a3e5ae8adf8cffa5aacd0%1762797952.535",
|
|
||||||
"re2/20230301#ca3b241baec15bd31ea9187150e0b333%1764175362.029",
|
|
||||||
"protobuf/6.32.1#f481fd276fc23a33b85a3ed1e898b693%1759134873.45",
|
|
||||||
"openssl/3.5.4#a1d5835cc6ed5c5b8f3cd5b9b5d24205%1760106486.594",
|
|
||||||
"nudb/2.0.9#fb8dfd1a5557f5e0528114c2da17721e%1763150366.909",
|
|
||||||
"lz4/1.10.0#59fc63cac7f10fbe8e05c7e62c2f3504%1756234228.999",
|
|
||||||
"libiconv/1.17#1e65319e945f2d31941a9d28cc13c058%1756223727.64",
|
|
||||||
"libbacktrace/cci.20210118#a7691bfccd8caaf66309df196790a5a1%1756230911.03",
|
|
||||||
"libarchive/3.8.1#ffee18995c706e02bf96e7a2f7042e0d%1764175360.142",
|
|
||||||
"jemalloc/5.3.0#e951da9cf599e956cebc117880d2d9f8%1729241615.244",
|
|
||||||
"grpc/1.72.0#f244a57bff01e708c55a1100b12e1589%1763158050.628",
|
|
||||||
"ed25519/2015.03#ae761bdc52730a843f0809bdf6c1b1f6%1764270189.893",
|
|
||||||
"doctest/2.4.12#eb9fb352fb2fdfc8abb17ec270945165%1762797941.757",
|
|
||||||
"date/3.0.4#862e11e80030356b53c2c38599ceb32b%1763584497.32",
|
|
||||||
"c-ares/1.34.5#5581c2b62a608b40bb85d965ab3ec7c8%1764175359.429",
|
|
||||||
"bzip2/1.0.8#c470882369c2d95c5c77e970c0c7e321%1764175359.429",
|
|
||||||
"boost/1.88.0#8852c0b72ce8271fb8ff7c53456d4983%1756223752.326",
|
|
||||||
"abseil/20250127.0#9e8e8cfc89a1324139fc0ee3bd4d8c8c%1753819045.301"
|
|
||||||
],
|
|
||||||
"build_requires": [
|
|
||||||
"zlib/1.3.1#b8bc2603263cf7eccbd6e17e66b0ed76%1756234269.497",
|
|
||||||
"strawberryperl/5.32.1.1#707032463aa0620fa17ec0d887f5fe41%1756234281.733",
|
|
||||||
"protobuf/6.32.1#f481fd276fc23a33b85a3ed1e898b693%1759134873.45",
|
|
||||||
"nasm/2.16.01#31e26f2ee3c4346ecd347911bd126904%1756234232.901",
|
|
||||||
"msys2/cci.latest#5b73b10144f73cc5bfe0572ed9be39e1%1751977009.857",
|
|
||||||
"m4/1.4.19#70dc8bbb33e981d119d2acc0175cf381%1763158052.846",
|
|
||||||
"cmake/4.2.0#ae0a44f44a1ef9ab68fd4b3e9a1f8671%1764175359.44",
|
|
||||||
"cmake/3.31.10#313d16a1aa16bbdb2ca0792467214b76%1764175359.429",
|
|
||||||
"b2/5.3.3#107c15377719889654eb9a162a673975%1756234226.28",
|
|
||||||
"automake/1.16.5#b91b7c384c3deaa9d535be02da14d04f%1755524470.56",
|
|
||||||
"autoconf/2.71#51077f068e61700d65bb05541ea1e4b0%1731054366.86",
|
|
||||||
"abseil/20250127.0#9e8e8cfc89a1324139fc0ee3bd4d8c8c%1753819045.301"
|
|
||||||
],
|
|
||||||
"python_requires": [],
|
|
||||||
"overrides": {
|
|
||||||
"protobuf/5.27.0": [
|
|
||||||
"protobuf/6.32.1"
|
|
||||||
],
|
|
||||||
"lz4/1.9.4": [
|
|
||||||
"lz4/1.10.0"
|
|
||||||
],
|
|
||||||
"boost/1.83.0": [
|
|
||||||
"boost/1.88.0"
|
|
||||||
],
|
|
||||||
"sqlite3/3.44.2": [
|
|
||||||
"sqlite3/3.49.1"
|
|
||||||
],
|
|
||||||
"lz4/[>=1.9.4 <2]": [
|
|
||||||
"lz4/1.10.0#59fc63cac7f10fbe8e05c7e62c2f3504"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"config_requires": []
|
|
||||||
}
|
|
||||||
@@ -35,6 +35,7 @@ class Xrpl(ConanFile):
|
|||||||
"openssl/3.5.4",
|
"openssl/3.5.4",
|
||||||
"secp256k1/0.7.0",
|
"secp256k1/0.7.0",
|
||||||
"soci/4.0.3",
|
"soci/4.0.3",
|
||||||
|
"wasmi/0.42.1",
|
||||||
"zlib/1.3.1",
|
"zlib/1.3.1",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -212,6 +213,7 @@ class Xrpl(ConanFile):
|
|||||||
"soci::soci",
|
"soci::soci",
|
||||||
"secp256k1::secp256k1",
|
"secp256k1::secp256k1",
|
||||||
"sqlite3::sqlite",
|
"sqlite3::sqlite",
|
||||||
|
"wasmi::wasmi",
|
||||||
"xxhash::xxhash",
|
"xxhash::xxhash",
|
||||||
"zlib::zlib",
|
"zlib::zlib",
|
||||||
]
|
]
|
||||||
|
|||||||
11
external/wasmi/conandata.yml
vendored
Normal file
11
external/wasmi/conandata.yml
vendored
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# Do not update. Maintained by programmability team.
|
||||||
|
|
||||||
|
sources:
|
||||||
|
"0.42.1":
|
||||||
|
sha256: 2a5697be33c7afce8f671af4a5a3621d9e93ce55d253d31bd8201458e465fbb8
|
||||||
|
url: https://github.com/wasmi-labs/wasmi/archive/refs/tags/v0.42.1.tar.gz
|
||||||
|
patches:
|
||||||
|
"0.42.1":
|
||||||
|
- patch_file: "patches/0001-xrplf-0.42.1.patch"
|
||||||
|
patch_type: conan
|
||||||
|
patch_description: Integration patch. Make wasmi lib to be able to build with existing smart-escrow branch.
|
||||||
48
external/wasmi/conanfile.py
vendored
Normal file
48
external/wasmi/conanfile.py
vendored
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
from conan import ConanFile, tools
|
||||||
|
from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout
|
||||||
|
from conan.tools.files import apply_conandata_patches, export_conandata_patches, get
|
||||||
|
import os
|
||||||
|
|
||||||
|
required_conan_version = ">=2.0.0"
|
||||||
|
|
||||||
|
class WasmiConan(ConanFile):
|
||||||
|
name = "wasmi"
|
||||||
|
license = "Apache License v2.0"
|
||||||
|
url = "https://github.com/wasmi-labs/wasmi.git"
|
||||||
|
description = "WebAssembly (Wasm) interpreter"
|
||||||
|
package_type = "library"
|
||||||
|
settings = "os", "arch", "compiler", "build_type"
|
||||||
|
options = {"shared": [False]}
|
||||||
|
default_options = {"shared": False}
|
||||||
|
|
||||||
|
def export_sources(self):
|
||||||
|
export_conandata_patches(self)
|
||||||
|
|
||||||
|
def layout(self):
|
||||||
|
cmake_layout(self, src_folder="src")
|
||||||
|
|
||||||
|
def source(self):
|
||||||
|
get(self, **self.conan_data["sources"][self.version], strip_root=True)
|
||||||
|
apply_conandata_patches(self)
|
||||||
|
|
||||||
|
def generate(self):
|
||||||
|
tc = CMakeToolchain(self)
|
||||||
|
tc.variables["BUILD_SHARED_LIBS"] = self.options.shared
|
||||||
|
tc.generate()
|
||||||
|
|
||||||
|
deps = CMakeDeps(self)
|
||||||
|
deps.generate()
|
||||||
|
|
||||||
|
def build(self):
|
||||||
|
cmake = CMake(self)
|
||||||
|
cmake.configure(build_script_folder=os.path.join(self.source_folder, "crates", "c_api"))
|
||||||
|
cmake.build()
|
||||||
|
|
||||||
|
def package(self):
|
||||||
|
cmake = CMake(self)
|
||||||
|
cmake.install()
|
||||||
|
|
||||||
|
def package_info(self):
|
||||||
|
self.cpp_info.libs = ["wasmi"]
|
||||||
|
self.cpp_info.names["cmake_find_package"] = "wasmi"
|
||||||
|
self.cpp_info.names["cmake_find_package_multi"] = "wasmi"
|
||||||
180
external/wasmi/patches/0001-xrplf-0.42.1.patch
vendored
Normal file
180
external/wasmi/patches/0001-xrplf-0.42.1.patch
vendored
Normal file
@@ -0,0 +1,180 @@
|
|||||||
|
diff --git a/crates/c_api/CMakeLists.txt b/crates/c_api/CMakeLists.txt
|
||||||
|
index b15c787a..54eaed2d 100644
|
||||||
|
--- a/crates/c_api/CMakeLists.txt
|
||||||
|
+++ b/crates/c_api/CMakeLists.txt
|
||||||
|
@@ -6,6 +6,8 @@ option(BUILD_SHARED_LIBS "Build using shared libraries" OFF)
|
||||||
|
option(WASMI_ALWAYS_BUILD "If cmake should always invoke cargo to build Wasmi" ON)
|
||||||
|
set(WASMI_TARGET "" CACHE STRING "Rust target to build for")
|
||||||
|
|
||||||
|
+add_compile_definitions(COMPILING_WASM_RUNTIME_API=1)
|
||||||
|
+
|
||||||
|
if(NOT WASMI_TARGET)
|
||||||
|
execute_process(
|
||||||
|
COMMAND rustc -vV
|
||||||
|
@@ -43,6 +45,10 @@ endif()
|
||||||
|
list(TRANSFORM WASMI_SHARED_FILES PREPEND ${WASMI_TARGET_DIR}/)
|
||||||
|
list(TRANSFORM WASMI_STATIC_FILES PREPEND ${WASMI_TARGET_DIR}/)
|
||||||
|
|
||||||
|
+if(NOT BUILD_SHARED_LIBS)
|
||||||
|
+ set(WASMI_SHARED_FILES)
|
||||||
|
+endif()
|
||||||
|
+
|
||||||
|
# Instructions on how to build and install the Wasmi Rust crate.
|
||||||
|
find_program(WASMI_CARGO_BINARY cargo REQUIRED)
|
||||||
|
include(ExternalProject)
|
||||||
|
@@ -79,7 +85,6 @@ else()
|
||||||
|
target_link_libraries(wasmi INTERFACE ${WASMI_STATIC_FILES})
|
||||||
|
|
||||||
|
if(WASMI_TARGET MATCHES "windows")
|
||||||
|
- target_compile_options(wasmi INTERFACE -DWASM_API_EXTERN= -DWASI_API_EXTERN=)
|
||||||
|
target_link_libraries(wasmi INTERFACE ws2_32 advapi32 userenv ntdll shell32 ole32 bcrypt)
|
||||||
|
elseif(NOT WASMI_TARGET MATCHES "darwin")
|
||||||
|
target_link_libraries(wasmi INTERFACE pthread dl m)
|
||||||
|
@@ -112,6 +117,7 @@ install(
|
||||||
|
DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||||
|
)
|
||||||
|
|
||||||
|
+if(BUILD_SHARED_LIBS)
|
||||||
|
if(WASMI_TARGET MATCHES "darwin")
|
||||||
|
set(INSTALLED_LIB "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/libwasmi.dylib")
|
||||||
|
install(
|
||||||
|
@@ -131,6 +137,7 @@ if(WASMI_TARGET MATCHES "darwin")
|
||||||
|
install(CODE "execute_process(COMMAND ${install_name_tool_cmd})")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
+endif()
|
||||||
|
|
||||||
|
# Documentation Generation via Doxygen:
|
||||||
|
set(DOXYGEN_CONF_IN ${CMAKE_CURRENT_SOURCE_DIR}/doxygen.conf.in)
|
||||||
|
@@ -141,19 +148,3 @@ add_custom_target(doc
|
||||||
|
DEPENDS ${WASMI_GENERATED_CONF_H} ${DOXYGEN_CONF_OUT}
|
||||||
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
|
)
|
||||||
|
-
|
||||||
|
-# C-Header Formatting via clang-format:
|
||||||
|
-find_program(CLANG_FORMAT clang-format REQUIRED)
|
||||||
|
-file(GLOB_RECURSE HEADER_FILES
|
||||||
|
- ${CMAKE_CURRENT_SOURCE_DIR}/include/wasmi.h
|
||||||
|
- ${CMAKE_CURRENT_SOURCE_DIR}/include/wasmi/*.h
|
||||||
|
- ${CMAKE_CURRENT_SOURCE_DIR}/include/wasmi/*.hh
|
||||||
|
-)
|
||||||
|
-add_custom_target(check-format
|
||||||
|
- COMMAND ${CLANG_FORMAT} -style=llvm -Werror --dry-run ${HEADER_FILES}
|
||||||
|
- COMMENT "clang-format: Check formatting for Wasmi C-API header files"
|
||||||
|
-)
|
||||||
|
-add_custom_target(format
|
||||||
|
- COMMAND ${CLANG_FORMAT} -style=llvm -i ${HEADER_FILES}
|
||||||
|
- COMMENT "clang-format: Apply formatting rules for Wasmi C-API header files"
|
||||||
|
-)
|
||||||
|
diff --git a/crates/c_api/include/wasm.h b/crates/c_api/include/wasm.h
|
||||||
|
index 5ee617ff..37809a6f 100644
|
||||||
|
--- a/crates/c_api/include/wasm.h
|
||||||
|
+++ b/crates/c_api/include/wasm.h
|
||||||
|
@@ -13,11 +13,17 @@
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
|
#ifndef WASM_API_EXTERN
|
||||||
|
-#if defined(_WIN32) && !defined(__MINGW32__) && !defined(LIBWASM_STATIC)
|
||||||
|
+#if defined(_MSC_BUILD)
|
||||||
|
+#if defined(COMPILING_WASM_RUNTIME_API)
|
||||||
|
+#define WASM_API_EXTERN __declspec(dllexport)
|
||||||
|
+#elif defined(_DLL)
|
||||||
|
#define WASM_API_EXTERN __declspec(dllimport)
|
||||||
|
#else
|
||||||
|
#define WASM_API_EXTERN
|
||||||
|
#endif
|
||||||
|
+#else
|
||||||
|
+#define WASM_API_EXTERN
|
||||||
|
+#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
@@ -146,6 +152,13 @@ WASM_DECLARE_OWN(store)
|
||||||
|
|
||||||
|
WASM_API_EXTERN own wasm_store_t* wasm_store_new(wasm_engine_t*);
|
||||||
|
|
||||||
|
+// Store fuel functions (forward declarations)
|
||||||
|
+struct wasmi_error;
|
||||||
|
+
|
||||||
|
+WASM_API_EXTERN struct wasmi_error* wasm_store_get_fuel(const wasm_store_t*, uint64_t* fuel);
|
||||||
|
+WASM_API_EXTERN struct wasmi_error* wasm_store_set_fuel(wasm_store_t*, uint64_t fuel);
|
||||||
|
+//WASM_API_EXTERN void *wasm_store_get_data(const wasm_store_t*);
|
||||||
|
+//WASM_API_EXTERN void wasm_store_set_data(wasm_store_t*, void *data);
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Type Representations
|
||||||
|
diff --git a/crates/c_api/include/wasmi.h b/crates/c_api/include/wasmi.h
|
||||||
|
index 2caffa37..0c0584ec 100644
|
||||||
|
--- a/crates/c_api/include/wasmi.h
|
||||||
|
+++ b/crates/c_api/include/wasmi.h
|
||||||
|
@@ -10,7 +10,7 @@
|
||||||
|
/**
|
||||||
|
* \brief Wasmi version string.
|
||||||
|
*/
|
||||||
|
-#define WASMI_VERSION "0.35.0"
|
||||||
|
+#define WASMI_VERSION "0.42.1"
|
||||||
|
/**
|
||||||
|
* \brief Wasmi major version number.
|
||||||
|
*/
|
||||||
|
@@ -18,10 +18,10 @@
|
||||||
|
/**
|
||||||
|
* \brief Wasmi minor version number.
|
||||||
|
*/
|
||||||
|
-#define WASMI_VERSION_MINOR 35
|
||||||
|
+#define WASMI_VERSION_MINOR 42
|
||||||
|
/**
|
||||||
|
* \brief Wasmi patch version number.
|
||||||
|
*/
|
||||||
|
-#define WASMI_VERSION_PATCH 0
|
||||||
|
+#define WASMI_VERSION_PATCH 1
|
||||||
|
|
||||||
|
#endif // WASMI_H
|
||||||
|
diff --git a/crates/c_api/src/store.rs b/crates/c_api/src/store.rs
|
||||||
|
index 56d4898f..543dbff8 100644
|
||||||
|
--- a/crates/c_api/src/store.rs
|
||||||
|
+++ b/crates/c_api/src/store.rs
|
||||||
|
@@ -175,3 +175,44 @@ pub extern "C" fn wasmi_context_set_fuel(
|
||||||
|
) -> Option<Box<wasmi_error_t>> {
|
||||||
|
crate::handle_result(store.set_fuel(fuel), |()| {})
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
+////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
+////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
+////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
+
|
||||||
|
+/// Returns the current fuel of the wasm store context in `fuel`.
|
||||||
|
+///
|
||||||
|
+/// Wraps [`Store::get_fuel`].
|
||||||
|
+///
|
||||||
|
+/// # Errors
|
||||||
|
+///
|
||||||
|
+/// If [`Store::get_fuel`] errors.
|
||||||
|
+#[no_mangle]
|
||||||
|
+pub extern "C" fn wasm_store_get_fuel(
|
||||||
|
+ store: &wasm_store_t,
|
||||||
|
+ fuel: &mut u64,
|
||||||
|
+) -> Option<Box<wasmi_error_t>> {
|
||||||
|
+ let context = unsafe { store.inner.context() };
|
||||||
|
+ crate::handle_result(context.get_fuel(), |amt| {
|
||||||
|
+ *fuel = amt;
|
||||||
|
+ })
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+/// Sets the current fuel of the wasm store context to `fuel`.
|
||||||
|
+///
|
||||||
|
+/// Wraps [`Store::set_fuel`].
|
||||||
|
+///
|
||||||
|
+/// # Errors
|
||||||
|
+///
|
||||||
|
+/// If [`Store::set_fuel`] errors.
|
||||||
|
+#[no_mangle]
|
||||||
|
+pub extern "C" fn wasm_store_set_fuel(
|
||||||
|
+ store: &mut wasm_store_t,
|
||||||
|
+ fuel: u64,
|
||||||
|
+) -> Option<Box<wasmi_error_t>> {
|
||||||
|
+
|
||||||
|
+ let mut context = unsafe { store.inner.context_mut() };
|
||||||
|
+ crate::handle_result(context.set_fuel(fuel), |()| {})
|
||||||
|
+}
|
||||||
|
+
|
||||||
@@ -67,7 +67,6 @@ XRPL_FEATURE(Clawback, Supported::yes, VoteBehavior::DefaultNo
|
|||||||
XRPL_FIX (UniversalNumber, Supported::yes, VoteBehavior::DefaultNo)
|
XRPL_FIX (UniversalNumber, Supported::yes, VoteBehavior::DefaultNo)
|
||||||
XRPL_FEATURE(XRPFees, Supported::yes, VoteBehavior::DefaultNo)
|
XRPL_FEATURE(XRPFees, Supported::yes, VoteBehavior::DefaultNo)
|
||||||
XRPL_FIX (RemoveNFTokenAutoTrustLine, Supported::yes, VoteBehavior::DefaultYes)
|
XRPL_FIX (RemoveNFTokenAutoTrustLine, Supported::yes, VoteBehavior::DefaultYes)
|
||||||
XRPL_FIX (TMGetObjectByHashLimit, Supported::yes, VoteBehavior::DefaultYes)
|
|
||||||
|
|
||||||
// The following amendments are obsolete, but must remain supported
|
// The following amendments are obsolete, but must remain supported
|
||||||
// because they could potentially get enabled.
|
// because they could potentially get enabled.
|
||||||
|
|||||||
@@ -18,7 +18,6 @@
|
|||||||
#include <xrpl/basics/base64.h>
|
#include <xrpl/basics/base64.h>
|
||||||
#include <xrpl/basics/random.h>
|
#include <xrpl/basics/random.h>
|
||||||
#include <xrpl/basics/safe_cast.h>
|
#include <xrpl/basics/safe_cast.h>
|
||||||
#include <xrpl/protocol/Feature.h>
|
|
||||||
#include <xrpl/protocol/TxFlags.h>
|
#include <xrpl/protocol/TxFlags.h>
|
||||||
#include <xrpl/protocol/digest.h>
|
#include <xrpl/protocol/digest.h>
|
||||||
|
|
||||||
@@ -2590,51 +2589,9 @@ PeerImp::onMessage(std::shared_ptr<protocol::TMGetObjectByHash> const& m)
|
|||||||
reply.set_ledgerhash(packet.ledgerhash());
|
reply.set_ledgerhash(packet.ledgerhash());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get validated rules to check if the fix is enabled
|
|
||||||
auto const rules = app_.getLedgerMaster().getValidatedRules();
|
|
||||||
|
|
||||||
// Charge resource fee based on request size when fix is enabled
|
|
||||||
if (rules.enabled(fixTMGetObjectByHashLimit))
|
|
||||||
{
|
|
||||||
// Enforce per-request object cap
|
|
||||||
if (packet.objects_size() > Tuning::maxGetObjectByHash)
|
|
||||||
{
|
|
||||||
fee_.update(Resource::feeMalformedRequest, "too many objects");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Charge heavier fee for large requests (>256 objects)
|
|
||||||
if (packet.objects_size() > 256)
|
|
||||||
{
|
|
||||||
fee_.update(
|
|
||||||
Resource::feeHeavyBurdenPeer,
|
|
||||||
"large get object by hash request");
|
|
||||||
}
|
|
||||||
else if (packet.objects_size() > 64)
|
|
||||||
{
|
|
||||||
fee_.update(
|
|
||||||
Resource::feeModerateBurdenPeer,
|
|
||||||
"moderate get object by hash request");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
fee_.update(
|
|
||||||
Resource::feeTrivialPeer,
|
|
||||||
"small get object by hash request");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Legacy behavior: charge moderate fee for all requests
|
|
||||||
fee_.update(
|
fee_.update(
|
||||||
Resource::feeModerateBurdenPeer,
|
Resource::feeModerateBurdenPeer,
|
||||||
" received a get object by hash request");
|
" received a get object by hash request");
|
||||||
}
|
|
||||||
|
|
||||||
// Track reply bytes and stop when over budget (16 MiB) when fix is enabled
|
|
||||||
std::size_t replyBudgetBytes =
|
|
||||||
rules.enabled(fixTMGetObjectByHashLimit) ? megabytes(16) : 0;
|
|
||||||
std::size_t replyBytes = 0;
|
|
||||||
|
|
||||||
// This is a very minimal implementation
|
// This is a very minimal implementation
|
||||||
for (int i = 0; i < packet.objects_size(); ++i)
|
for (int i = 0; i < packet.objects_size(); ++i)
|
||||||
@@ -2649,28 +2606,17 @@ PeerImp::onMessage(std::shared_ptr<protocol::TMGetObjectByHash> const& m)
|
|||||||
auto nodeObject{app_.getNodeStore().fetchNodeObject(hash, seq)};
|
auto nodeObject{app_.getNodeStore().fetchNodeObject(hash, seq)};
|
||||||
if (nodeObject)
|
if (nodeObject)
|
||||||
{
|
{
|
||||||
auto const dataSz = nodeObject->getData().size();
|
|
||||||
// Check if adding this object would exceed the reply budget
|
|
||||||
// (only when fix is enabled)
|
|
||||||
if (replyBudgetBytes > 0 &&
|
|
||||||
replyBytes + dataSz + 64 > replyBudgetBytes)
|
|
||||||
break;
|
|
||||||
|
|
||||||
protocol::TMIndexedObject& newObj = *reply.add_objects();
|
protocol::TMIndexedObject& newObj = *reply.add_objects();
|
||||||
newObj.set_hash(hash.begin(), hash.size());
|
newObj.set_hash(hash.begin(), hash.size());
|
||||||
newObj.set_data(
|
newObj.set_data(
|
||||||
&nodeObject->getData().front(),
|
&nodeObject->getData().front(),
|
||||||
dataSz);
|
nodeObject->getData().size());
|
||||||
|
|
||||||
if (obj.has_nodeid())
|
if (obj.has_nodeid())
|
||||||
newObj.set_index(obj.nodeid());
|
newObj.set_index(obj.nodeid());
|
||||||
if (obj.has_ledgerseq())
|
if (obj.has_ledgerseq())
|
||||||
newObj.set_ledgerseq(obj.ledgerseq());
|
newObj.set_ledgerseq(obj.ledgerseq());
|
||||||
|
|
||||||
// Track reply bytes when fix is enabled
|
|
||||||
if (replyBudgetBytes > 0)
|
|
||||||
replyBytes += dataSz + 64; // include modest overhead estimate
|
|
||||||
|
|
||||||
// VFALCO NOTE "seq" in the message is obsolete
|
// VFALCO NOTE "seq" in the message is obsolete
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,9 +22,6 @@ enum {
|
|||||||
/** The hard cap on the number of ledger entries in a single reply. */
|
/** The hard cap on the number of ledger entries in a single reply. */
|
||||||
hardMaxReplyNodes = 12288,
|
hardMaxReplyNodes = 12288,
|
||||||
|
|
||||||
/** Hard cap on TMGetObjectByHash objects per request (non-TRANSACTIONS). */
|
|
||||||
maxGetObjectByHash = 1024,
|
|
||||||
|
|
||||||
/** How many timer intervals a sendq has to stay large before we disconnect
|
/** How many timer intervals a sendq has to stay large before we disconnect
|
||||||
*/
|
*/
|
||||||
sendqIntervals = 4,
|
sendqIntervals = 4,
|
||||||
|
|||||||
Reference in New Issue
Block a user