mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
Rework validator-collator interaction
1) Remove config 41, move "full collated data" to capabilities 2) Whitelist on collator nodes 3) "Ping" request for collator nodes 4) More customizable collators list for validators 5) CollationManager
This commit is contained in:
parent
7d2110c8b0
commit
b3bea413e3
34 changed files with 1204 additions and 319 deletions
|
@ -157,6 +157,9 @@ struct ValidatorManagerOptionsImpl : public ValidatorManagerOptions {
|
|||
td::Ref<CollatorsList> get_collators_list() const override {
|
||||
return collators_list_;
|
||||
}
|
||||
bool check_collator_node_whitelist(adnl::AdnlNodeIdShort id) const override {
|
||||
return !collator_node_whitelist_enabled_ || collator_node_whitelist_.contains(id);
|
||||
}
|
||||
|
||||
void set_zero_block_id(BlockIdExt block_id) override {
|
||||
zero_block_id_ = block_id;
|
||||
|
@ -255,6 +258,16 @@ struct ValidatorManagerOptionsImpl : public ValidatorManagerOptions {
|
|||
void set_collators_list(td::Ref<CollatorsList> list) override {
|
||||
collators_list_ = std::move(list);
|
||||
}
|
||||
void set_collator_node_whitelisted_validator(adnl::AdnlNodeIdShort id, bool add) override {
|
||||
if (add) {
|
||||
collator_node_whitelist_.insert(id);
|
||||
} else {
|
||||
collator_node_whitelist_.erase(id);
|
||||
}
|
||||
}
|
||||
void set_collator_node_whitelist_enabled(bool enabled) override {
|
||||
collator_node_whitelist_enabled_ = enabled;
|
||||
}
|
||||
|
||||
ValidatorManagerOptionsImpl *make_copy() const override {
|
||||
return new ValidatorManagerOptionsImpl(*this);
|
||||
|
@ -308,7 +321,9 @@ struct ValidatorManagerOptionsImpl : public ValidatorManagerOptions {
|
|||
bool state_serializer_enabled_ = true;
|
||||
td::Ref<CollatorOptions> collator_options_{true};
|
||||
bool fast_state_serializer_enabled_ = false;
|
||||
td::Ref<CollatorsList> collators_list_{true, CollatorsList{}};
|
||||
td::Ref<CollatorsList> collators_list_{true, CollatorsList::default_list()};
|
||||
std::set<adnl::AdnlNodeIdShort> collator_node_whitelist_;
|
||||
bool collator_node_whitelist_enabled_ = false;
|
||||
};
|
||||
|
||||
} // namespace validator
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue