Merge branch 'develop' into tapanito/feature/enhanced-squelching

This commit is contained in:
Vito
2025-08-05 12:28:59 +02:00
4 changed files with 46 additions and 8 deletions

View File

@@ -43,7 +43,7 @@ runs:
cd ${build_dir}
conan install \
--output-folder . \
--build '*' \
--build missing \
--options:host "&:tests=True" \
--options:host "&:xrpld=True" \
--settings:all build_type=${{ inputs.configuration }} \

View File

@@ -53,6 +53,34 @@ minimum required (see [BUILD.md][]).
clang --version
```
### Install Xcode Specific Version (Optional)
If you develop other applications using XCode you might be consistently updating to the newest version of Apple Clang.
This will likely cause issues building rippled. You may want to install a specific version of Xcode:
1. **Download Xcode**
- Visit [Apple Developer Downloads](https://developer.apple.com/download/more/)
- Sign in with your Apple Developer account
- Search for an Xcode version that includes **Apple Clang (Expected Version)**
- Download the `.xip` file
2. **Install and Configure Xcode**
```bash
# Extract the .xip file and rename for version management
# Example: Xcode_16.2.app
# Move to Applications directory
sudo mv Xcode_16.2.app /Applications/
# Set as default toolchain (persistent)
sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
# Set as environment variable (temporary)
export DEVELOPER_DIR=/Applications/Xcode_16.2.app/Contents/Developer
```
The command line developer tools should include Git too:
```

View File

@@ -1443,9 +1443,10 @@ OverlayImpl::updateSlotAndSquelch(
if (!strand_.running_in_this_thread())
return post(
strand_,
// Must capture copies of reference parameters (i.e. key, validator)
[this,
key,
validator,
key = key,
validator = validator,
peers = std::move(peers),
isTrusted]() mutable {
updateSlotAndSquelch(
@@ -1472,9 +1473,12 @@ OverlayImpl::updateSlotAndSquelch(
return;
if (!strand_.running_in_this_thread())
return post(strand_, [this, key, validator, peer, isTrusted]() {
updateSlotAndSquelch(key, validator, peer, isTrusted);
});
return post(
strand_,
// Must capture copies of reference parameters (i.e. key, validator)
[this, key = key, validator = validator, peer, isTrusted]() {
updateSlotAndSquelch(key, validator, peer, isTrusted);
});
slots_.updateSlotAndSquelch(
key,

View File

@@ -35,6 +35,7 @@
#include <optional>
#include <sstream>
#include <string>
#include <vector>
namespace ripple {
namespace reduce_relay {
@@ -233,6 +234,7 @@ Slot::deletePeer(PublicKey const& validator, Peer::id_t id, bool erase)
if (it == peers_.end())
return;
std::vector<Peer::id_t> toUnsquelch;
auto const now = clock_.now();
if (it->second.state == PeerState::Selected)
{
@@ -246,7 +248,7 @@ Slot::deletePeer(PublicKey const& validator, Peer::id_t id, bool erase)
for (auto& [k, v] : peers_)
{
if (v.state == PeerState::Squelched)
handler_.unsquelch(validator, k);
toUnsquelch.push_back(k);
v.state = PeerState::Counting;
v.count = 0;
v.expire = now;
@@ -256,7 +258,7 @@ Slot::deletePeer(PublicKey const& validator, Peer::id_t id, bool erase)
reachedThreshold_ = 0;
state_ = SlotState::Counting;
}
else if (considered_.find(id) != considered_.end())
else if (considered_.contains(id))
{
if (it->second.count > reduce_relay::MAX_MESSAGE_THRESHOLD)
--reachedThreshold_;
@@ -268,6 +270,10 @@ Slot::deletePeer(PublicKey const& validator, Peer::id_t id, bool erase)
if (erase)
peers_.erase(it);
// Must be after peers_.erase(it)
for (auto const& k : toUnsquelch)
handler_.unsquelch(validator, k);
}
void