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
|
@ -2339,28 +2339,4 @@ td::optional<PrecompiledContractsConfig::Contract> PrecompiledContractsConfig::g
|
|||
return c;
|
||||
}
|
||||
|
||||
CollatorConfig Config::get_collator_config(bool need_collator_nodes) const {
|
||||
CollatorConfig collator_config;
|
||||
gen::CollatorConfig::Record rec;
|
||||
auto cell = get_config_param(41, -41);
|
||||
if (cell.is_null() || !tlb::unpack_cell(std::move(cell), rec)) {
|
||||
return collator_config;
|
||||
}
|
||||
collator_config.full_collated_data = rec.full_collated_data;
|
||||
if (need_collator_nodes) {
|
||||
vm::Dictionary dict{rec.collator_nodes->prefetch_ref(), 32 + 64 + 256};
|
||||
dict.check_for_each([&](Ref<vm::CellSlice> value, td::ConstBitPtr key, int n) {
|
||||
CHECK(n == 32 + 64 + 256);
|
||||
auto workchain = (td::int32)key.get_int(32);
|
||||
key.advance(32);
|
||||
td::uint64 shard = key.get_uint(64);
|
||||
key.advance(64);
|
||||
td::Bits256 adnl_id(key);
|
||||
collator_config.collator_nodes.push_back({ton::ShardIdFull(workchain, shard), adnl_id});
|
||||
return true;
|
||||
});
|
||||
}
|
||||
return collator_config;
|
||||
}
|
||||
|
||||
} // namespace block
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue