mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Compare commits
9 Commits
Bronek/pro
...
Bronek/opt
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7d90d6311e | ||
|
|
205d2965da | ||
|
|
c40ca84363 | ||
|
|
1fd24c31d3 | ||
|
|
96d0fcfbd1 | ||
|
|
73c83dfcad | ||
|
|
5dcd2e9d06 | ||
|
|
7d8a35c97d | ||
|
|
39b5031ab5 |
38
.github/actions/dependencies/action.yml
vendored
38
.github/actions/dependencies/action.yml
vendored
@@ -2,33 +2,25 @@ name: dependencies
|
|||||||
inputs:
|
inputs:
|
||||||
configuration:
|
configuration:
|
||||||
required: true
|
required: true
|
||||||
# An implicit input is the environment variable `build_dir`.
|
# Implicit inputs are the environment variables `build_dir`, CONAN_REMOTE_URL,
|
||||||
|
# CONAN_REMOTE_USERNAME, and CONAN_REMOTE_PASSWORD. The latter two are only
|
||||||
|
# used to upload newly built dependencies to the Conan remote.
|
||||||
runs:
|
runs:
|
||||||
using: composite
|
using: composite
|
||||||
steps:
|
steps:
|
||||||
- name: add Conan remote
|
- name: add Conan remote
|
||||||
if: env.CONAN_URL != ''
|
if: ${{ env.CONAN_REMOTE_URL != '' }}
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
if conan remote list | grep -q 'xrplf'; then
|
echo "Adding Conan remote 'xrplf' at ${{ env.CONAN_REMOTE_URL }}."
|
||||||
conan remote update --index 0 --url ${CONAN_URL} xrplf
|
conan remote add --index 0 --force xrplf ${{ env.CONAN_REMOTE_URL }}
|
||||||
echo "Updated Conan remote 'xrplf' to ${CONAN_URL}."
|
echo "Listing Conan remotes."
|
||||||
else
|
conan remote list
|
||||||
conan remote add --index 0 xrplf ${CONAN_URL}
|
|
||||||
echo "Added new Conan remote 'xrplf' at ${CONAN_URL}."
|
|
||||||
fi
|
|
||||||
- name: list missing binaries
|
|
||||||
id: binaries
|
|
||||||
shell: bash
|
|
||||||
# Print the list of dependencies that would need to be built locally.
|
|
||||||
# A non-empty list means we have "failed" to cache binaries remotely.
|
|
||||||
run: |
|
|
||||||
echo missing=$(conan info . --build missing --settings build_type=${{ inputs.configuration }} --json 2>/dev/null | grep '^\[') | tee ${GITHUB_OUTPUT}
|
|
||||||
- name: install dependencies
|
- name: install dependencies
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
mkdir ${build_dir}
|
mkdir -p ${{ env.build_dir }}
|
||||||
cd ${build_dir}
|
cd ${{ env.build_dir }}
|
||||||
conan install \
|
conan install \
|
||||||
--output-folder . \
|
--output-folder . \
|
||||||
--build missing \
|
--build missing \
|
||||||
@@ -37,10 +29,10 @@ runs:
|
|||||||
--settings:all build_type=${{ inputs.configuration }} \
|
--settings:all build_type=${{ inputs.configuration }} \
|
||||||
..
|
..
|
||||||
- name: upload dependencies
|
- name: upload dependencies
|
||||||
if: ${{ env.CONAN_URL != '' && env.CONAN_LOGIN_USERNAME_XRPLF != '' && env.CONAN_PASSWORD_XRPLF != '' && github.ref_type == 'branch' && github.ref_name == github.event.repository.default_branch }}
|
if: ${{ env.CONAN_REMOTE_URL != '' && env.CONAN_REMOTE_USERNAME != '' && env.CONAN_REMOTE_PASSWORD != '' && github.ref_type == 'branch' && github.ref_name == github.event.repository.default_branch }}
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
echo "Logging into Conan remote 'xrplf' at ${CONAN_URL}."
|
echo "Logging into Conan remote 'xrplf' at ${{ env.CONAN_REMOTE_URL }}."
|
||||||
conan remote login xrplf "${{ env.CONAN_LOGIN_USERNAME_XRPLF }}" --password "${{ env.CONAN_PASSWORD_XRPLF }}"
|
conan remote login xrplf "${{ env.CONAN_REMOTE_USERNAME }}" --password "${{ env.CONAN_REMOTE_PASSWORD }}"
|
||||||
echo "Uploading dependencies for configuration '${{ inputs.configuration }}'."
|
echo "Uploading dependencies."
|
||||||
conan upload --all --confirm --remote xrplf . --settings build_type=${{ inputs.configuration }}
|
conan upload '*' --confirm --check --remote xrplf
|
||||||
|
|||||||
12
.github/workflows/libxrpl.yml
vendored
12
.github/workflows/libxrpl.yml
vendored
@@ -1,8 +1,8 @@
|
|||||||
name: Check libXRPL compatibility with Clio
|
name: Check libXRPL compatibility with Clio
|
||||||
env:
|
env:
|
||||||
CONAN_URL: https://conan.ripplex.io
|
CONAN_REMOTE_URL: ${{ vars.CONAN_REMOTE_URL }}
|
||||||
CONAN_LOGIN_USERNAME_XRPLF: ${{ secrets.CONAN_USERNAME }}
|
CONAN_LOGIN_USERNAME_XRPLF: ${{ secrets.CONAN_REMOTE_USERNAME }}
|
||||||
CONAN_PASSWORD_XRPLF: ${{ secrets.CONAN_TOKEN }}
|
CONAN_PASSWORD_XRPLF: ${{ secrets.CONAN_REMOTE_PASSWORD }}
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
@@ -46,10 +46,10 @@ jobs:
|
|||||||
- name: Add Conan remote
|
- name: Add Conan remote
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
echo "Adding Conan remote 'xrplf' at ${{ env.CONAN_REMOTE_URL }}."
|
||||||
|
conan remote add xrplf ${{ env.CONAN_REMOTE_URL }} --insert 0 --force
|
||||||
|
echo "Listing Conan remotes."
|
||||||
conan remote list
|
conan remote list
|
||||||
conan remote remove xrplf || true
|
|
||||||
# Do not quote the URL. An empty string will be accepted (with a non-fatal warning), but a missing argument will not.
|
|
||||||
conan remote add xrplf ${{ env.CONAN_URL }} --insert 0
|
|
||||||
- name: Parse new version
|
- name: Parse new version
|
||||||
id: version
|
id: version
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|||||||
9
.github/workflows/macos.yml
vendored
9
.github/workflows/macos.yml
vendored
@@ -18,9 +18,12 @@ concurrency:
|
|||||||
# This part of Conan configuration is specific to this workflow only; we do not want
|
# This part of Conan configuration is specific to this workflow only; we do not want
|
||||||
# to pollute conan/profiles directory with settings which might not work for others
|
# to pollute conan/profiles directory with settings which might not work for others
|
||||||
env:
|
env:
|
||||||
CONAN_URL: https://conan.ripplex.io
|
CONAN_REMOTE_URL: ${{ vars.CONAN_REMOTE_URL }}
|
||||||
CONAN_LOGIN_USERNAME_XRPLF: ${{ secrets.CONAN_USERNAME }}
|
CONAN_REMOTE_USERNAME: ${{ secrets.CONAN_REMOTE_USERNAME }}
|
||||||
CONAN_PASSWORD_XRPLF: ${{ secrets.CONAN_TOKEN }}
|
CONAN_REMOTE_PASSWORD: ${{ secrets.CONAN_REMOTE_PASSWORD }}
|
||||||
|
# This part of the Conan configuration is specific to this workflow only; we
|
||||||
|
# do not want to pollute the 'conan/profiles' directory with settings that
|
||||||
|
# might not work for other workflows.
|
||||||
CONAN_GLOBAL_CONF: |
|
CONAN_GLOBAL_CONF: |
|
||||||
core.download:parallel={{os.cpu_count()}}
|
core.download:parallel={{os.cpu_count()}}
|
||||||
core.upload:parallel={{os.cpu_count()}}
|
core.upload:parallel={{os.cpu_count()}}
|
||||||
|
|||||||
11
.github/workflows/nix.yml
vendored
11
.github/workflows/nix.yml
vendored
@@ -16,12 +16,13 @@ concurrency:
|
|||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
# This part of Conan configuration is specific to this workflow only; we do not want
|
|
||||||
# to pollute conan/profiles directory with settings which might not work for others
|
|
||||||
env:
|
env:
|
||||||
CONAN_URL: https://conan.ripplex.io
|
CONAN_REMOTE_URL: ${{ vars.CONAN_REMOTE_URL }}
|
||||||
CONAN_LOGIN_USERNAME_XRPLF: ${{ secrets.CONAN_USERNAME }}
|
CONAN_REMOTE_USERNAME: ${{ secrets.CONAN_REMOTE_USERNAME }}
|
||||||
CONAN_PASSWORD_XRPLF: ${{ secrets.CONAN_TOKEN }}
|
CONAN_REMOTE_PASSWORD: ${{ secrets.CONAN_REMOTE_PASSWORD }}
|
||||||
|
# This part of the Conan configuration is specific to this workflow only; we
|
||||||
|
# do not want to pollute the 'conan/profiles' directory with settings that
|
||||||
|
# might not work for other workflows.
|
||||||
CONAN_GLOBAL_CONF: |
|
CONAN_GLOBAL_CONF: |
|
||||||
core.download:parallel={{ os.cpu_count() }}
|
core.download:parallel={{ os.cpu_count() }}
|
||||||
core.upload:parallel={{ os.cpu_count() }}
|
core.upload:parallel={{ os.cpu_count() }}
|
||||||
|
|||||||
11
.github/workflows/windows.yml
vendored
11
.github/workflows/windows.yml
vendored
@@ -18,12 +18,13 @@ on:
|
|||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
# This part of Conan configuration is specific to this workflow only; we do not want
|
|
||||||
# to pollute conan/profiles directory with settings which might not work for others
|
|
||||||
env:
|
env:
|
||||||
CONAN_URL: https://conan.ripplex.io
|
CONAN_REMOTE_URL: ${{ vars.CONAN_REMOTE_URL }}
|
||||||
CONAN_LOGIN_USERNAME_XRPLF: ${{ secrets.CONAN_USERNAME }}
|
CONAN_REMOTE_USERNAME: ${{ secrets.CONAN_REMOTE_USERNAME }}
|
||||||
CONAN_PASSWORD_XRPLF: ${{ secrets.CONAN_TOKEN }}
|
CONAN_REMOTE_PASSWORD: ${{ secrets.CONAN_REMOTE_PASSWORD }}
|
||||||
|
# This part of the Conan configuration is specific to this workflow only; we
|
||||||
|
# do not want to pollute the 'conan/profiles' directory with settings that
|
||||||
|
# might not work for other workflows.
|
||||||
CONAN_GLOBAL_CONF: |
|
CONAN_GLOBAL_CONF: |
|
||||||
core.download:parallel={{os.cpu_count()}}
|
core.download:parallel={{os.cpu_count()}}
|
||||||
core.upload:parallel={{os.cpu_count()}}
|
core.upload:parallel={{os.cpu_count()}}
|
||||||
|
|||||||
@@ -36,10 +36,10 @@ class xxhasher
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
using result_type = std::size_t;
|
using result_type = std::size_t;
|
||||||
|
static int volatile test;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static_assert(sizeof(std::size_t) == 8, "requires 64-bit std::size_t");
|
static_assert(sizeof(std::size_t) == 8, "requires 64-bit std::size_t");
|
||||||
|
|
||||||
// Have an internal buffer to avoid the streaming API
|
// Have an internal buffer to avoid the streaming API
|
||||||
// A 64-byte buffer should to be big enough for us
|
// A 64-byte buffer should to be big enough for us
|
||||||
static constexpr std::size_t INTERNAL_BUFFER_SIZE = 64;
|
static constexpr std::size_t INTERNAL_BUFFER_SIZE = 64;
|
||||||
@@ -144,6 +144,7 @@ public:
|
|||||||
{
|
{
|
||||||
if (state_)
|
if (state_)
|
||||||
{
|
{
|
||||||
|
test = test + 1;
|
||||||
XXH3_freeState(state_);
|
XXH3_freeState(state_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,13 +22,15 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||||||
|
|
||||||
namespace beast {
|
namespace beast {
|
||||||
|
|
||||||
|
int volatile xxhasher::test = 0;
|
||||||
|
|
||||||
class XXHasher_test : public unit_test::suite
|
class XXHasher_test : public unit_test::suite
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void
|
void
|
||||||
testWithoutSeed()
|
testWithoutSeed()
|
||||||
{
|
{
|
||||||
testcase("Without Seed");
|
testcase("Without seed");
|
||||||
|
|
||||||
xxhasher hasher{};
|
xxhasher hasher{};
|
||||||
|
|
||||||
@@ -43,7 +45,7 @@ public:
|
|||||||
void
|
void
|
||||||
testWithSeed()
|
testWithSeed()
|
||||||
{
|
{
|
||||||
testcase("With Seed");
|
testcase("With seed");
|
||||||
|
|
||||||
xxhasher hasher{static_cast<std::uint32_t>(102)};
|
xxhasher hasher{static_cast<std::uint32_t>(102)};
|
||||||
|
|
||||||
@@ -58,7 +60,7 @@ public:
|
|||||||
void
|
void
|
||||||
testWithTwoSeeds()
|
testWithTwoSeeds()
|
||||||
{
|
{
|
||||||
testcase("With Two Seeds");
|
testcase("With two seeds");
|
||||||
xxhasher hasher{
|
xxhasher hasher{
|
||||||
static_cast<std::uint32_t>(102), static_cast<std::uint32_t>(103)};
|
static_cast<std::uint32_t>(102), static_cast<std::uint32_t>(103)};
|
||||||
|
|
||||||
@@ -73,7 +75,7 @@ public:
|
|||||||
void
|
void
|
||||||
testBigObjectWithMultiupleSmallUpdatesWithoutSeed()
|
testBigObjectWithMultiupleSmallUpdatesWithoutSeed()
|
||||||
{
|
{
|
||||||
testcase("Big Object With Multiuple Small Updates Without Seed");
|
testcase("Big object with multiple small updates without seed");
|
||||||
xxhasher hasher{};
|
xxhasher hasher{};
|
||||||
|
|
||||||
std::string objectToHash{"Hello, xxHash!"};
|
std::string objectToHash{"Hello, xxHash!"};
|
||||||
@@ -90,7 +92,7 @@ public:
|
|||||||
void
|
void
|
||||||
testBigObjectWithMultiupleSmallUpdatesWithSeed()
|
testBigObjectWithMultiupleSmallUpdatesWithSeed()
|
||||||
{
|
{
|
||||||
testcase("Big Object With Multiuple Small Updates With Seed");
|
testcase("Big object with multiple small updates with seed");
|
||||||
xxhasher hasher{static_cast<std::uint32_t>(103)};
|
xxhasher hasher{static_cast<std::uint32_t>(103)};
|
||||||
|
|
||||||
std::string objectToHash{"Hello, xxHash!"};
|
std::string objectToHash{"Hello, xxHash!"};
|
||||||
@@ -102,12 +104,14 @@ public:
|
|||||||
BEAST_EXPECT(
|
BEAST_EXPECT(
|
||||||
static_cast<xxhasher::result_type>(hasher) ==
|
static_cast<xxhasher::result_type>(hasher) ==
|
||||||
17285302196561698791ULL);
|
17285302196561698791ULL);
|
||||||
|
|
||||||
|
BEAST_EXPECT(xxhasher::test > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
testBigObjectWithSmallAndBigUpdatesWithoutSeed()
|
testBigObjectWithSmallAndBigUpdatesWithoutSeed()
|
||||||
{
|
{
|
||||||
testcase("Big Object With Small And Big Updates Without Seed");
|
testcase("Big object with small and big updates without seed");
|
||||||
xxhasher hasher{};
|
xxhasher hasher{};
|
||||||
|
|
||||||
std::string objectToHash{"Hello, xxHash!"};
|
std::string objectToHash{"Hello, xxHash!"};
|
||||||
@@ -123,12 +127,14 @@ public:
|
|||||||
BEAST_EXPECT(
|
BEAST_EXPECT(
|
||||||
static_cast<xxhasher::result_type>(hasher) ==
|
static_cast<xxhasher::result_type>(hasher) ==
|
||||||
1865045178324729219ULL);
|
1865045178324729219ULL);
|
||||||
|
|
||||||
|
BEAST_EXPECT(xxhasher::test > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
testBigObjectWithSmallAndBigUpdatesWithSeed()
|
testBigObjectWithSmallAndBigUpdatesWithSeed()
|
||||||
{
|
{
|
||||||
testcase("Big Object With Small And Big Updates With Seed");
|
testcase("Big object with small and big updates with seed");
|
||||||
xxhasher hasher{static_cast<std::uint32_t>(103)};
|
xxhasher hasher{static_cast<std::uint32_t>(103)};
|
||||||
|
|
||||||
std::string objectToHash{"Hello, xxHash!"};
|
std::string objectToHash{"Hello, xxHash!"};
|
||||||
@@ -144,12 +150,14 @@ public:
|
|||||||
BEAST_EXPECT(
|
BEAST_EXPECT(
|
||||||
static_cast<xxhasher::result_type>(hasher) ==
|
static_cast<xxhasher::result_type>(hasher) ==
|
||||||
16189862915636005281ULL);
|
16189862915636005281ULL);
|
||||||
|
|
||||||
|
BEAST_EXPECT(xxhasher::test > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
testBigObjectWithOneUpdateWithoutSeed()
|
testBigObjectWithOneUpdateWithoutSeed()
|
||||||
{
|
{
|
||||||
testcase("Big Object With One Update Without Seed");
|
testcase("Big object with one update without seed");
|
||||||
xxhasher hasher{};
|
xxhasher hasher{};
|
||||||
|
|
||||||
std::string objectToHash;
|
std::string objectToHash;
|
||||||
@@ -162,12 +170,14 @@ public:
|
|||||||
BEAST_EXPECT(
|
BEAST_EXPECT(
|
||||||
static_cast<xxhasher::result_type>(hasher) ==
|
static_cast<xxhasher::result_type>(hasher) ==
|
||||||
15296278154063476002ULL);
|
15296278154063476002ULL);
|
||||||
|
|
||||||
|
BEAST_EXPECT(xxhasher::test > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
testBigObjectWithOneUpdateWithSeed()
|
testBigObjectWithOneUpdateWithSeed()
|
||||||
{
|
{
|
||||||
testcase("Big Object With One Update With Seed");
|
testcase("Big object with one update with seed");
|
||||||
xxhasher hasher{static_cast<std::uint32_t>(103)};
|
xxhasher hasher{static_cast<std::uint32_t>(103)};
|
||||||
|
|
||||||
std::string objectToHash;
|
std::string objectToHash;
|
||||||
@@ -180,6 +190,40 @@ public:
|
|||||||
BEAST_EXPECT(
|
BEAST_EXPECT(
|
||||||
static_cast<xxhasher::result_type>(hasher) ==
|
static_cast<xxhasher::result_type>(hasher) ==
|
||||||
17285302196561698791ULL);
|
17285302196561698791ULL);
|
||||||
|
|
||||||
|
BEAST_EXPECT(xxhasher::test > 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
testOperatorResultTypeDoesNotChangeInternalState()
|
||||||
|
{
|
||||||
|
testcase("Operator result type doesn't change the internal state");
|
||||||
|
{
|
||||||
|
xxhasher hasher;
|
||||||
|
|
||||||
|
std::string object{"Hello xxhash"};
|
||||||
|
hasher(object.data(), object.size());
|
||||||
|
auto xxhashResult1 = static_cast<xxhasher::result_type>(hasher);
|
||||||
|
auto xxhashResult2 = static_cast<xxhasher::result_type>(hasher);
|
||||||
|
|
||||||
|
BEAST_EXPECT(xxhashResult1 == xxhashResult2);
|
||||||
|
}
|
||||||
|
{
|
||||||
|
xxhasher hasher;
|
||||||
|
|
||||||
|
std::string object;
|
||||||
|
for (int i = 0; i < 100; i++)
|
||||||
|
{
|
||||||
|
object += "Hello, xxHash!";
|
||||||
|
}
|
||||||
|
hasher(object.data(), object.size());
|
||||||
|
auto xxhashResult1 = hasher.operator xxhasher::result_type();
|
||||||
|
auto xxhashResult2 = hasher.operator xxhasher::result_type();
|
||||||
|
|
||||||
|
BEAST_EXPECT(xxhashResult1 == xxhashResult2);
|
||||||
|
}
|
||||||
|
|
||||||
|
BEAST_EXPECT(xxhasher::test > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -194,6 +238,7 @@ public:
|
|||||||
testBigObjectWithSmallAndBigUpdatesWithSeed();
|
testBigObjectWithSmallAndBigUpdatesWithSeed();
|
||||||
testBigObjectWithOneUpdateWithoutSeed();
|
testBigObjectWithOneUpdateWithoutSeed();
|
||||||
testBigObjectWithOneUpdateWithSeed();
|
testBigObjectWithOneUpdateWithSeed();
|
||||||
|
testOperatorResultTypeDoesNotChangeInternalState();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user