Skip to content

Commit d5e137d

Browse files
committed
Merge remote-tracking branch 'XRPLF/develop' into ximinez/lending-refactoring-1
* XRPLF/develop: Switch Conan 1 commands to Conan 2 and fix credentials (#5655) perf: Move mutex to the partition level (#5486) Upload Conan dependencies upon merge into develop (#5654)
2 parents c863bd2 + 39b5031 commit d5e137d

File tree

13 files changed

+177
-175
lines changed

13 files changed

+177
-175
lines changed

.github/actions/dependencies/action.yml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,37 @@ name: dependencies
22
inputs:
33
configuration:
44
required: true
5-
# An implicit input is the environment variable `build_dir`.
5+
# Implicit inputs are the environment variables `build_dir`, CONAN_REMOTE_URL,
6+
# CONAN_REMOTE_USERNAME, and CONAN_REMOTE_PASSWORD. The latter two are only
7+
# used to upload newly built dependencies to the Conan remote.
68
runs:
79
using: composite
810
steps:
911
- name: add Conan remote
10-
if: env.CONAN_URL != ''
12+
if: ${{ env.CONAN_REMOTE_URL != '' }}
1113
shell: bash
1214
run: |
13-
if conan remote list | grep -q 'xrplf'; then
14-
conan remote update --index 0 --url ${CONAN_URL} xrplf
15-
echo "Updated Conan remote 'xrplf' to ${CONAN_URL}."
16-
else
17-
conan remote add --index 0 xrplf ${CONAN_URL}
18-
echo "Added new conan remote 'xrplf' at ${CONAN_URL}."
19-
fi
20-
- name: list missing binaries
21-
id: binaries
22-
shell: bash
23-
# Print the list of dependencies that would need to be built locally.
24-
# A non-empty list means we have "failed" to cache binaries remotely.
25-
run: |
26-
echo missing=$(conan info . --build missing --settings build_type=${{ inputs.configuration }} --json 2>/dev/null | grep '^\[') | tee ${GITHUB_OUTPUT}
15+
echo "Adding Conan remote 'xrplf' at ${{ env.CONAN_REMOTE_URL }}."
16+
conan remote add --index 0 --force xrplf ${{ env.CONAN_REMOTE_URL }}
17+
echo "Listing Conan remotes."
18+
conan remote list
2719
- name: install dependencies
2820
shell: bash
2921
run: |
30-
mkdir ${build_dir}
31-
cd ${build_dir}
22+
mkdir -p ${{ env.build_dir }}
23+
cd ${{ env.build_dir }}
3224
conan install \
3325
--output-folder . \
3426
--build missing \
3527
--options:host "&:tests=True" \
3628
--options:host "&:xrpld=True" \
3729
--settings:all build_type=${{ inputs.configuration }} \
3830
..
31+
- name: upload dependencies
32+
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 }}
33+
shell: bash
34+
run: |
35+
echo "Logging into Conan remote 'xrplf' at ${{ env.CONAN_REMOTE_URL }}."
36+
conan remote login xrplf "${{ env.CONAN_REMOTE_USERNAME }}" --password "${{ env.CONAN_REMOTE_PASSWORD }}"
37+
echo "Uploading dependencies."
38+
conan upload '*' --confirm --check --remote xrplf

.github/workflows/libxrpl.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name: Check libXRPL compatibility with Clio
22
env:
3-
CONAN_URL: https://conan.ripplex.io
4-
CONAN_LOGIN_USERNAME_XRPLF: ${{ secrets.CONAN_USERNAME }}
5-
CONAN_PASSWORD_XRPLF: ${{ secrets.CONAN_TOKEN }}
3+
CONAN_REMOTE_URL: ${{ vars.CONAN_REMOTE_URL }}
4+
CONAN_LOGIN_USERNAME_XRPLF: ${{ secrets.CONAN_REMOTE_USERNAME }}
5+
CONAN_PASSWORD_XRPLF: ${{ secrets.CONAN_REMOTE_PASSWORD }}
66
on:
77
pull_request:
88
paths:
@@ -46,10 +46,10 @@ jobs:
4646
- name: Add Conan remote
4747
shell: bash
4848
run: |
49+
echo "Adding Conan remote 'xrplf' at ${{ env.CONAN_REMOTE_URL }}."
50+
conan remote add xrplf ${{ env.CONAN_REMOTE_URL }} --insert 0 --force
51+
echo "Listing Conan remotes."
4952
conan remote list
50-
conan remote remove xrplf || true
51-
# Do not quote the URL. An empty string will be accepted (with a non-fatal warning), but a missing argument will not.
52-
conan remote add xrplf ${{ env.CONAN_URL }} --insert 0
5353
- name: Parse new version
5454
id: version
5555
shell: bash

.github/workflows/macos.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@ concurrency:
1818
# This part of Conan configuration is specific to this workflow only; we do not want
1919
# to pollute conan/profiles directory with settings which might not work for others
2020
env:
21-
CONAN_URL: https://conan.ripplex.io
21+
CONAN_REMOTE_URL: ${{ vars.CONAN_REMOTE_URL }}
22+
CONAN_REMOTE_USERNAME: ${{ secrets.CONAN_REMOTE_USERNAME }}
23+
CONAN_REMOTE_PASSWORD: ${{ secrets.CONAN_REMOTE_PASSWORD }}
24+
# This part of the Conan configuration is specific to this workflow only; we
25+
# do not want to pollute the 'conan/profiles' directory with settings that
26+
# might not work for other workflows.
2227
CONAN_GLOBAL_CONF: |
2328
core.download:parallel={{os.cpu_count()}}
2429
core.upload:parallel={{os.cpu_count()}}

.github/workflows/nix.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,13 @@ concurrency:
1616
group: ${{ github.workflow }}-${{ github.ref }}
1717
cancel-in-progress: true
1818

19-
# This part of Conan configuration is specific to this workflow only; we do not want
20-
# to pollute conan/profiles directory with settings which might not work for others
2119
env:
22-
CONAN_URL: https://conan.ripplex.io
20+
CONAN_REMOTE_URL: ${{ vars.CONAN_REMOTE_URL }}
21+
CONAN_REMOTE_USERNAME: ${{ secrets.CONAN_REMOTE_USERNAME }}
22+
CONAN_REMOTE_PASSWORD: ${{ secrets.CONAN_REMOTE_PASSWORD }}
23+
# This part of the Conan configuration is specific to this workflow only; we
24+
# do not want to pollute the 'conan/profiles' directory with settings that
25+
# might not work for other workflows.
2326
CONAN_GLOBAL_CONF: |
2427
core.download:parallel={{ os.cpu_count() }}
2528
core.upload:parallel={{ os.cpu_count() }}

.github/workflows/windows.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,13 @@ on:
1818
concurrency:
1919
group: ${{ github.workflow }}-${{ github.ref }}
2020
cancel-in-progress: true
21-
# This part of Conan configuration is specific to this workflow only; we do not want
22-
# to pollute conan/profiles directory with settings which might not work for others
2321
env:
24-
CONAN_URL: https://conan.ripplex.io
22+
CONAN_REMOTE_URL: ${{ vars.CONAN_REMOTE_URL }}
23+
CONAN_REMOTE_USERNAME: ${{ secrets.CONAN_REMOTE_USERNAME }}
24+
CONAN_REMOTE_PASSWORD: ${{ secrets.CONAN_REMOTE_PASSWORD }}
25+
# This part of the Conan configuration is specific to this workflow only; we
26+
# do not want to pollute the 'conan/profiles' directory with settings that
27+
# might not work for other workflows.
2528
CONAN_GLOBAL_CONF: |
2629
core.download:parallel={{os.cpu_count()}}
2730
core.upload:parallel={{os.cpu_count()}}

include/xrpl/basics/SHAMapHash.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#define RIPPLE_BASICS_SHAMAP_HASH_H_INCLUDED
2222

2323
#include <xrpl/basics/base_uint.h>
24-
#include <xrpl/basics/partitioned_unordered_map.h>
2524

2625
#include <ostream>
2726

include/xrpl/basics/TaggedCache.h

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,6 @@ class TaggedCache
9090
int
9191
getCacheSize() const;
9292

93-
int
94-
getTrackSize() const;
95-
9693
float
9794
getHitRate();
9895

@@ -170,9 +167,6 @@ class TaggedCache
170167
bool
171168
retrieve(key_type const& key, T& data);
172169

173-
mutex_type&
174-
peekMutex();
175-
176170
std::vector<key_type>
177171
getKeys() const;
178172

@@ -193,11 +187,14 @@ class TaggedCache
193187

194188
private:
195189
SharedPointerType
196-
initialFetch(key_type const& key, std::lock_guard<mutex_type> const& l);
190+
initialFetch(key_type const& key);
197191

198192
void
199193
collect_metrics();
200194

195+
Mutex&
196+
lockPartition(key_type const& key) const;
197+
201198
private:
202199
struct Stats
203200
{
@@ -300,8 +297,8 @@ class TaggedCache
300297
[[maybe_unused]] clock_type::time_point const& now,
301298
typename KeyValueCacheType::map_type& partition,
302299
SweptPointersVector& stuffToSweep,
303-
std::atomic<int>& allRemovals,
304-
std::lock_guard<std::recursive_mutex> const&);
300+
std::atomic<int>& allRemoval,
301+
Mutex& partitionLock);
305302

306303
[[nodiscard]] std::thread
307304
sweepHelper(
@@ -310,14 +307,12 @@ class TaggedCache
310307
typename KeyOnlyCacheType::map_type& partition,
311308
SweptPointersVector&,
312309
std::atomic<int>& allRemovals,
313-
std::lock_guard<std::recursive_mutex> const&);
310+
Mutex& partitionLock);
314311

315312
beast::Journal m_journal;
316313
clock_type& m_clock;
317314
Stats m_stats;
318315

319-
mutex_type mutable m_mutex;
320-
321316
// Used for logging
322317
std::string m_name;
323318

@@ -328,10 +323,11 @@ class TaggedCache
328323
clock_type::duration const m_target_age;
329324

330325
// Number of items cached
331-
int m_cache_count;
326+
std::atomic<int> m_cache_count;
332327
cache_type m_cache; // Hold strong reference to recent objects
333-
std::uint64_t m_hits;
334-
std::uint64_t m_misses;
328+
std::atomic<std::uint64_t> m_hits;
329+
std::atomic<std::uint64_t> m_misses;
330+
mutable std::vector<mutex_type> partitionLocks_;
335331
};
336332

337333
} // namespace ripple

0 commit comments

Comments
 (0)