changes selection parameters and number of untrusted slots

Simulation results revealed that by requiring a minimum number of peers to send a message, valdiations will stop propagating, as the servers that are directly connected to peers will receive a unique message from only a single peer, the validator. Therefore, they will fail to select a slot.
Furthermore, by increasing untrusted slots to 30 we guarantee that some validators will propagate through most of the network.
This commit is contained in:
Vito
2025-07-10 14:25:39 +02:00
parent a9a9b9976a
commit 8087785204
2 changed files with 4 additions and 5 deletions

View File

@@ -55,7 +55,7 @@ static constexpr uint16_t MAX_MESSAGE_THRESHOLD = 20;
static constexpr uint16_t MAX_SELECTED_PEERS = 5;
// Max number of untrusted slots the server will maintain
static constexpr uint16_t MAX_UNTRUSTED_SLOTS = 5;
static constexpr uint16_t MAX_UNTRUSTED_SLOTS = 30;
// The maximum of seconds an untrusted validator can go without sending a
// validation message. After this, a validator may be squelched

View File

@@ -98,8 +98,8 @@ Slot::update(
JLOG(journal_.trace())
<< "update: existing peer " << Slice(validator) << " " << id
<< " slot state " << static_cast<int>(state_) << " peer state "
<< static_cast<int>(peer.state) << " count " << peer.count << " last "
<< " slot state " << to_string(state_) << " peer state "
<< to_string(peer.state) << " count " << peer.count << " last "
<< duration_cast<milliseconds>(now - peer.lastMessage).count()
<< " pool " << considered_.size() << " threshold " << reachedThreshold_;
@@ -530,8 +530,7 @@ Slots::updateConsideredValidator(PublicKey const& validator, Peer::id_t peer)
++it->second.count;
// if the validator has not met selection criteria yet
if (it->second.count < reduce_relay::MAX_MESSAGE_THRESHOLD ||
it->second.peers.size() < reduce_relay::MAX_SELECTED_PEERS)
if (it->second.count < reduce_relay::MAX_MESSAGE_THRESHOLD)
return std::nullopt;
auto const key = it->first;