mirror of
https://github.com/ton-blockchain/ton
synced 2025-02-14 12:12:21 +00:00
Fix validator session options hash; fix proto_version
This commit is contained in:
parent
ce65245a69
commit
30ba32bef9
4 changed files with 13 additions and 7 deletions
|
@ -311,10 +311,12 @@ validatorSession.config catchain_idle_timeout:double catchain_max_deps:int round
|
|||
max_round_attempts:int max_block_size:int max_collated_data_size:int = validatorSession.Config;
|
||||
validatorSession.configNew catchain_idle_timeout:double catchain_max_deps:int round_candidates:int next_candidate_delay:double round_attempt_duration:int
|
||||
max_round_attempts:int max_block_size:int max_collated_data_size:int new_catchain_ids:Bool = validatorSession.Config;
|
||||
validatorSession.configVersioned catchain_idle_timeout:double catchain_max_deps:int round_candidates:int next_candidate_delay:double round_attempt_duration:int
|
||||
max_round_attempts:int max_block_size:int max_collated_data_size:int version:int = validatorSession.Config;
|
||||
|
||||
validatorSession.catchainOptions idle_timeout:double max_deps:int max_block_size:int block_hash_covers_data:Bool
|
||||
max_block_height_ceoff:int debug_disable_db:Bool = validatorSession.CatChainOptions;
|
||||
validatorSession.configVersioned catchain_opts:validatorSession.CatChainOptions round_candidates:int next_candidate_delay:double
|
||||
validatorSession.configVersionedV2 catchain_opts:validatorSession.CatChainOptions round_candidates:int next_candidate_delay:double
|
||||
round_attempt_duration:int max_round_attempts:int max_block_size:int max_collated_data_size:int version:int = validatorSession.Config;
|
||||
|
||||
---functions---
|
||||
|
|
Binary file not shown.
|
@ -882,7 +882,7 @@ td::actor::ActorOwn<ValidatorSession> ValidatorSession::create(
|
|||
}
|
||||
|
||||
td::Bits256 ValidatorSessionOptions::get_hash() const {
|
||||
if(!proto_version) {
|
||||
if (proto_version == 0) {
|
||||
if (!new_catchain_ids) {
|
||||
return create_hash_tl_object<ton_api::validatorSession_config>(
|
||||
catchain_opts.idle_timeout, catchain_opts.max_deps, round_candidates, next_candidate_delay,
|
||||
|
@ -892,13 +892,17 @@ td::Bits256 ValidatorSessionOptions::get_hash() const {
|
|||
catchain_opts.idle_timeout, catchain_opts.max_deps, round_candidates, next_candidate_delay,
|
||||
round_attempt_duration, max_round_attempts, max_block_size, max_collated_data_size, new_catchain_ids);
|
||||
}
|
||||
} else {
|
||||
} else if (proto_version == 1) {
|
||||
return create_hash_tl_object<ton_api::validatorSession_configVersioned>(
|
||||
catchain_opts.idle_timeout, catchain_opts.max_deps, round_candidates, next_candidate_delay,
|
||||
round_attempt_duration, max_round_attempts, max_block_size, max_collated_data_size, proto_version);
|
||||
} else {
|
||||
return create_hash_tl_object<ton_api::validatorSession_configVersionedV2>(
|
||||
create_tl_object<ton_api::validatorSession_catchainOptions>(
|
||||
catchain_opts.idle_timeout, catchain_opts.max_deps, catchain_opts.max_serialized_block_size,
|
||||
catchain_opts.block_hash_covers_data, catchain_opts.max_block_height_coeff, catchain_opts.debug_disable_db),
|
||||
round_candidates, next_candidate_delay, round_attempt_duration,
|
||||
max_round_attempts, max_block_size, max_collated_data_size, proto_version);
|
||||
round_candidates, next_candidate_delay, round_attempt_duration, max_round_attempts, max_block_size,
|
||||
max_collated_data_size, proto_version);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1726,8 +1726,8 @@ void ValidatorManagerImpl::update_shards() {
|
|||
td::uint32 threshold = 9407194;
|
||||
bool force_group_id_upgrade = last_masterchain_seqno_ == threshold;
|
||||
auto legacy_opts_hash = opts.get_hash();
|
||||
if(last_masterchain_seqno_ >= threshold) { //TODO move to get_consensus_config()
|
||||
opts.proto_version = 1;
|
||||
if (last_masterchain_seqno_ >= threshold) { //TODO move to get_consensus_config()
|
||||
opts.proto_version = std::max<td::uint32>(opts.proto_version, 1);
|
||||
}
|
||||
auto opts_hash = opts.get_hash();
|
||||
|
||||
|
|
Loading…
Reference in a new issue