mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
bugfixes + decreased archive slice size
This commit is contained in:
parent
148a5e0179
commit
8be3fc99ed
11 changed files with 290 additions and 102 deletions
|
@ -2965,6 +2965,9 @@ static int update_one_shard(block::McShardHash& info, const block::McShardHash*
|
|||
if (!info.is_fsm_none() && (now >= info.fsm_utime_end() || info.before_split_)) {
|
||||
info.clear_fsm();
|
||||
changed = true;
|
||||
} else if (info.is_fsm_merge() && (!sibling || sibling->before_split_)) {
|
||||
info.clear_fsm();
|
||||
changed = true;
|
||||
}
|
||||
if (wc_info && !info.before_split_) {
|
||||
// workchain present in configuration?
|
||||
|
@ -2977,14 +2980,15 @@ static int update_one_shard(block::McShardHash& info, const block::McShardHash*
|
|||
LOG(INFO) << "preparing to split shard " << info.shard().to_str() << " during " << info.fsm_utime() << " .. "
|
||||
<< info.fsm_utime_end();
|
||||
} else if (info.is_fsm_none() && depth > wc_info->min_split && (info.want_merge_ || depth > wc_info->max_split) &&
|
||||
sibling && sibling->is_fsm_none() && (sibling->want_merge_ || depth > wc_info->max_split)) {
|
||||
sibling && !sibling->before_split_ && sibling->is_fsm_none() &&
|
||||
(sibling->want_merge_ || depth > wc_info->max_split)) {
|
||||
// prepare merge
|
||||
info.set_fsm_merge(now + ton::split_merge_delay, ton::split_merge_interval);
|
||||
changed = true;
|
||||
LOG(INFO) << "preparing to merge shard " << info.shard().to_str() << " with " << sibling->shard().to_str()
|
||||
<< " during " << info.fsm_utime() << " .. " << info.fsm_utime_end();
|
||||
} else if (info.is_fsm_merge() && depth > wc_info->min_split && sibling && sibling->is_fsm_merge() &&
|
||||
now >= info.fsm_utime() && now >= sibling->fsm_utime() &&
|
||||
} else if (info.is_fsm_merge() && depth > wc_info->min_split && sibling && !sibling->before_split_ &&
|
||||
sibling->is_fsm_merge() && now >= info.fsm_utime() && now >= sibling->fsm_utime() &&
|
||||
(depth > wc_info->max_split || (info.want_merge_ && sibling->want_merge_))) {
|
||||
// force merge
|
||||
info.before_merge_ = true;
|
||||
|
|
|
@ -1599,7 +1599,8 @@ bool ValidateQuery::check_one_shard(const block::McShardHash& info, const block:
|
|||
}
|
||||
unsigned depth = ton::shard_prefix_length(shard);
|
||||
bool split_cond = ((info.want_split_ || depth < wc_info->min_split) && depth < wc_info->max_split && depth < 60);
|
||||
bool merge_cond = depth > wc_info->min_split && (info.want_merge_ || depth > wc_info->max_split) && sibling &&
|
||||
bool merge_cond = !info.before_split_ && depth > wc_info->min_split &&
|
||||
(info.want_merge_ || depth > wc_info->max_split) && sibling && !sibling->before_split_ &&
|
||||
(sibling->want_merge_ || depth > wc_info->max_split);
|
||||
if (!fsm_inherited && !info.is_fsm_none()) {
|
||||
if (info.fsm_utime() < now_ || info.fsm_utime_end() <= info.fsm_utime() ||
|
||||
|
@ -1618,6 +1619,11 @@ bool ValidateQuery::check_one_shard(const block::McShardHash& info, const block:
|
|||
" in new shard configuration, but merge conditions are not met");
|
||||
}
|
||||
}
|
||||
if (info.is_fsm_merge() && (!sibling || sibling->before_split_)) {
|
||||
return reject_query(
|
||||
"future merge for shard "s + shard.to_str() +
|
||||
" is still set in the new shard configuration, but its sibling is absent or has before_split set");
|
||||
}
|
||||
if (info.before_merge_) {
|
||||
if (!sibling || !sibling->before_merge_) {
|
||||
return reject_query("before_merge set for shard "s + shard.to_str() +
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue