mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
Flag "full collated data" in mc config; fix accept-block
This commit is contained in:
parent
81d32ba5d6
commit
011e97f53c
17 changed files with 76 additions and 55 deletions
|
@ -734,15 +734,15 @@ misbehaviour_punishment_config_v1#01
|
|||
= MisbehaviourPunishmentConfig;
|
||||
_ 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;
|
||||
_ CollatorConfig = ConfigParam 41;
|
||||
|
||||
oracle_bridge_params#_ bridge_address:bits256 oracle_mutlisig_address:bits256 oracles:(HashmapE 256 uint256) external_chain_address:bits256 = OracleBridgeParams;
|
||||
_ OracleBridgeParams = ConfigParam 71; // Ethereum bridge
|
||||
_ OracleBridgeParams = ConfigParam 72; // Binance Smart Chain bridge
|
||||
_ OracleBridgeParams = ConfigParam 73; // Polygon bridge
|
||||
|
||||
// Set of collators: each collator is (workchain:int32 shard:int64 adnl_id:int256)
|
||||
colator_set#a0 collators:(HashmapE 352 Unit) = CollatorSet;
|
||||
_ CollatorSet = ConfigParam 81;
|
||||
|
||||
//
|
||||
// PROOFS
|
||||
//
|
||||
|
|
|
@ -2132,4 +2132,28 @@ Ref<vm::Cell> ConfigInfo::lookup_library(td::ConstBitPtr root_hash) const {
|
|||
return lib;
|
||||
}
|
||||
|
||||
CollatorConfig Config::get_collator_config(bool need_collator_nodes) const {
|
||||
CollatorConfig collator_config;
|
||||
gen::CollatorConfig::Record rec;
|
||||
auto cell = get_config_param(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>, 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
|
||||
|
|
|
@ -482,6 +482,16 @@ class ShardConfig {
|
|||
bool set_shard_info(ton::ShardIdFull shard, Ref<vm::Cell> value);
|
||||
};
|
||||
|
||||
struct CollatorNodeDescr {
|
||||
ton::ShardIdFull shard;
|
||||
ton::NodeIdShort adnl_id;
|
||||
};
|
||||
|
||||
struct CollatorConfig {
|
||||
bool full_collated_data = false;
|
||||
std::vector<CollatorNodeDescr> collator_nodes;
|
||||
};
|
||||
|
||||
class Config {
|
||||
enum {
|
||||
default_mc_catchain_lifetime = 200,
|
||||
|
@ -593,6 +603,7 @@ class Config {
|
|||
std::vector<ton::ValidatorDescr> compute_validator_set(ton::ShardIdFull shard, ton::UnixTime time,
|
||||
ton::CatchainSeqno cc_seqno) const;
|
||||
std::vector<ton::ValidatorDescr> compute_total_validator_set(int next) const;
|
||||
CollatorConfig get_collator_config(bool need_collator_nodes) const;
|
||||
static std::vector<ton::ValidatorDescr> do_compute_validator_set(const block::CatchainValidatorsConfig& ccv_conf,
|
||||
ton::ShardIdFull shard,
|
||||
const block::ValidatorSet& vset, ton::UnixTime time,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue