mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
Send block broadcasts directly to collators
This commit is contained in:
parent
b0c2c6c525
commit
699a56b951
20 changed files with 143 additions and 26 deletions
|
@ -735,7 +735,8 @@ misbehaviour_punishment_config_v1#01
|
|||
_ MisbehaviourPunishmentConfig = ConfigParam 40;
|
||||
|
||||
// collator_nodes: each collator is (workchain:int32 shard:uint64 adnl_id:uint256)
|
||||
colator_config#a0 full_collated_data:Bool collator_nodes:(HashmapE 352 Unit) = CollatorConfig;
|
||||
collator_info#0 full_node_id:(Maybe uint256) = CollatorInfo;
|
||||
colator_config#a0 full_collated_data:Bool collator_nodes:(HashmapE 352 CollatorInfo) = CollatorConfig;
|
||||
_ CollatorConfig = ConfigParam 41;
|
||||
|
||||
oracle_bridge_params#_ bridge_address:bits256 oracle_mutlisig_address:bits256 oracles:(HashmapE 256 uint256) external_chain_address:bits256 = OracleBridgeParams;
|
||||
|
|
|
@ -2142,14 +2142,19 @@ CollatorConfig Config::get_collator_config(bool need_collator_nodes) const {
|
|||
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>, td::ConstBitPtr key, int n) {
|
||||
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});
|
||||
td::Bits256 full_node_id = td::Bits256::zero();
|
||||
gen::CollatorInfo::Record info;
|
||||
if (tlb::csr_unpack(std::move(value), info) && info.full_node_id->size() == 257) {
|
||||
full_node_id = td::Bits256(info.full_node_id->data_bits() + 1);
|
||||
}
|
||||
collator_config.collator_nodes.push_back({ton::ShardIdFull(workchain, shard), adnl_id, full_node_id});
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
|
|
@ -485,6 +485,7 @@ class ShardConfig {
|
|||
struct CollatorNodeDescr {
|
||||
ton::ShardIdFull shard;
|
||||
ton::NodeIdShort adnl_id;
|
||||
ton::NodeIdShort full_node_id;
|
||||
};
|
||||
|
||||
struct CollatorConfig {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue