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:
parent
52b010ff34
commit
061c82f89c
30 changed files with 426 additions and 13 deletions
|
@ -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");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue