1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-03-09 15:40:10 +00:00

Send validator telemetry to the private overlay (#1325)

* Send validator telemetry to the private overlay

* Improve rotating neighbours in overlays
This commit is contained in:
SpyCheese 2024-11-25 23:37:18 +04:00 committed by GitHub
parent 52b010ff34
commit 061c82f89c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
30 changed files with 426 additions and 13 deletions

View file

@ -28,14 +28,14 @@ namespace ton {
namespace validator {
using td::Ref;
const ValidatorDescr *ValidatorSetQ::find_validator(const NodeIdShort &id) const {
const ValidatorDescr *ValidatorSetQ::get_validator(const NodeIdShort &id) const {
auto it =
std::lower_bound(ids_map_.begin(), ids_map_.end(), id, [](const auto &p, const auto &x) { return p.first < x; });
return it < ids_map_.end() && it->first == id ? &ids_[it->second] : nullptr;
}
bool ValidatorSetQ::is_validator(NodeIdShort id) const {
return find_validator(id);
return get_validator(id);
}
td::Result<ValidatorWeight> ValidatorSetQ::check_signatures(RootHash root_hash, FileHash file_hash,
@ -53,7 +53,7 @@ td::Result<ValidatorWeight> ValidatorSetQ::check_signatures(RootHash root_hash,
}
nodes.insert(sig.node);
auto vdescr = find_validator(sig.node);
auto vdescr = get_validator(sig.node);
if (!vdescr) {
return td::Status::Error(ErrorCode::protoviolation, "unknown node to sign");
}
@ -84,7 +84,7 @@ td::Result<ValidatorWeight> ValidatorSetQ::check_approve_signatures(RootHash roo
}
nodes.insert(sig.node);
auto vdescr = find_validator(sig.node);
auto vdescr = get_validator(sig.node);
if (!vdescr) {
return td::Status::Error(ErrorCode::protoviolation, "unknown node to sign");
}