diff --git a/modules/consensus/esbocs/dap_chain_cs_esbocs.c b/modules/consensus/esbocs/dap_chain_cs_esbocs.c index 52d77b0728b81d9d8f93bb18fce888d346bced11..3ba6115c5f17c2b144681adbaa6a3025105bf5de 100644 --- a/modules/consensus/esbocs/dap_chain_cs_esbocs.c +++ b/modules/consensus/esbocs/dap_chain_cs_esbocs.c @@ -165,21 +165,21 @@ static int s_callback_new(dap_chain_t *a_chain, dap_config_t *a_chain_cfg) if ((l_cert_cur = dap_cert_find_by_name(l_cert_name)) == NULL) { snprintf(l_cert_name, sizeof(l_cert_name), "%s.%zu.pub", l_auth_certs_prefix, i); if ((l_cert_cur = dap_cert_find_by_name(l_cert_name)) == NULL) { - log_it(L_ERROR, "ESBOCS: Can't find cert \"%s\"", l_cert_name); + log_it(L_ERROR, "Can't find cert \"%s\"", l_cert_name); l_ret = -3; goto lb_err; } } dap_chain_addr_t l_signing_addr; - log_it(L_NOTICE, "ESBOCS: Initialized auth cert \"%s\"", l_cert_name); + log_it(L_NOTICE, "Initialized auth cert \"%s\"", l_cert_name); dap_chain_addr_fill_from_key(&l_signing_addr, l_cert_cur->enc_key, a_chain->net_id); dap_chain_node_addr_t l_signer_node_addr; if (dap_chain_node_addr_from_str(&l_signer_node_addr, l_addrs[i])) { - log_it(L_ERROR,"ESBOCS: Wrong address format, should be like 0123::4567::89AB::CDEF"); + log_it(L_ERROR,"Wrong address format, should be like 0123::4567::89AB::CDEF"); l_ret = -4; goto lb_err; } - log_it(L_MSG, "ESBOCS: add validator addr:"NODE_ADDR_FP_STR"", NODE_ADDR_FP_ARGS_S(l_signer_node_addr)); + log_it(L_MSG, "add validator addr:"NODE_ADDR_FP_STR"", NODE_ADDR_FP_ARGS_S(l_signer_node_addr)); if (l_esbocs_pvt->poa_mode) { // auth by certs in PoA mode dap_chain_esbocs_validator_t *l_validator = DAP_NEW(dap_chain_esbocs_validator_t); l_validator->signing_addr = l_signing_addr; @@ -280,11 +280,11 @@ static int s_callback_created(dap_chain_t *a_chain, dap_config_t *a_chain_net_cf dap_chain_add_callback_notify(a_chain, s_new_atom_notifier, l_session); s_session_round_new(l_session); - log_it(L_INFO, "ESBOCS: init session for net:%s, chain:%s", a_chain->net_name, a_chain->name); + log_it(L_INFO, "init session for net:%s, chain:%s", a_chain->net_name, a_chain->name); DL_APPEND(s_session_items, l_session); if (!s_session_cs_timer) { s_session_cs_timer = dap_timerfd_start(1000, s_session_timer, NULL); - debug_if(l_esbocs_pvt->debug, L_MSG, "ESBOCS: Consensus main timer is started"); + debug_if(l_esbocs_pvt->debug, L_MSG, "Consensus main timer is started"); } return 0; } @@ -354,8 +354,8 @@ static dap_list_t *s_get_validators_list(dap_chain_esbocs_session_t *a_session, dap_list_free_full(l_validators, NULL); return NULL; } - size_t n = (size_t)l_esbocs_pvt->min_validators_count * 3; - size_t l_consensus_optimum = (n / 2) + (n % 2); + //size_t n = (size_t)l_esbocs_pvt->min_validators_count * 3; + size_t l_consensus_optimum = (size_t)l_esbocs_pvt->min_validators_count * 2 - 1;//(n / 2) + (n % 2); size_t l_need_vld_cnt = MIN(l_validators_count, l_consensus_optimum); if (l_validators_count == l_need_vld_cnt) { l_ret = dap_list_copy_deep(l_validators, s_callback_list_form, NULL); @@ -434,7 +434,7 @@ static void s_session_send_startsync(dap_chain_esbocs_session_t *a_session) return; // My last block hash is different, so skip this round if (!s_validator_check(&a_session->my_signing_addr, a_session->cur_round.validators_list)) return; // I'm not a selected validator, just skip sync message - debug_if(PVT(a_session->esbocs)->debug, L_MSG, "ESBOCS: net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U"." + debug_if(PVT(a_session->esbocs)->debug, L_MSG, "net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U"." " Sent START_SYNC pkt, attempt %"DAP_UINT64_FORMAT_U, a_session->chain->net_name, a_session->chain->name, a_session->cur_round.id, a_session->cur_round.sync_attempt); s_message_send(a_session, DAP_STREAM_CH_VOTING_MSG_TYPE_START_SYNC, &l_last_block_hash, @@ -508,7 +508,7 @@ static void s_session_round_new(dap_chain_esbocs_session_t *a_session) HASH_FIND(hh, a_session->sync_items, &a_session->cur_round.last_block_hash, sizeof(dap_hash_fast_t), l_item); if (l_item) { debug_if(PVT(a_session->esbocs)->debug, - L_MSG, "ESBOCS: net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U" already started. Process sync messages", + L_MSG, "net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U" already started. Process sync messages", a_session->chain->net_name, a_session->chain->name, a_session->cur_round.id); l_round_already_started = true; for (dap_list_t *it = l_item->messages; it; it = it->next) { @@ -526,7 +526,7 @@ static void s_session_round_new(dap_chain_esbocs_session_t *a_session) } debug_if(PVT(a_session->esbocs)->debug, L_MSG, - "ESBOCS: net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U" start. Syncing validators in %u seconds", + "net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U" start. Syncing validators in %u seconds", a_session->chain->net_name, a_session->chain->name, a_session->cur_round.id, l_round_already_started ? 0 : PVT(a_session->esbocs)->new_round_delay); } @@ -541,7 +541,7 @@ static void s_session_round_new(dap_chain_esbocs_session_t *a_session) static void s_session_attempt_new(dap_chain_esbocs_session_t *a_session) { if (a_session->cur_round.attempt_num++ > PVT(a_session->esbocs)->round_attempts_max ) { - debug_if(PVT(a_session->esbocs)->debug, L_MSG, "ESBOCS: net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U"." + debug_if(PVT(a_session->esbocs)->debug, L_MSG, "net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U"." " Round finished by reason: attempts is out", a_session->chain->net_name, a_session->chain->name, a_session->cur_round.id); @@ -552,14 +552,14 @@ static void s_session_attempt_new(dap_chain_esbocs_session_t *a_session) dap_chain_esbocs_validator_t *l_validator = it->data; if (l_validator->is_synced && !l_validator->is_chosen) { // We have synced validator with no submitted candidate - debug_if(PVT(a_session->esbocs)->debug, L_MSG, "ESBOCS: net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U". Attempt:%hu is started", + debug_if(PVT(a_session->esbocs)->debug, L_MSG, "net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U". Attempt:%hu is started", a_session->chain->net_name, a_session->chain->name, a_session->cur_round.id, a_session->cur_round.attempt_num); s_session_state_change(a_session, DAP_CHAIN_ESBOCS_SESSION_STATE_WAIT_PROC, dap_time_now()); return; } } - debug_if(PVT(a_session->esbocs)->debug, L_MSG, "ESBOCS: net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U"." + debug_if(PVT(a_session->esbocs)->debug, L_MSG, "net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U"." " Round finished by reason: all synced validators already tryed its attempt", a_session->chain->net_name, a_session->chain->name, a_session->cur_round.id); @@ -576,7 +576,8 @@ static uint64_t s_session_calc_current_round_id(dap_chain_esbocs_session_t *a_se dap_chain_esbocs_message_item_t *l_item, *l_tmp; HASH_ITER(hh, a_session->cur_round.message_items, l_item, l_tmp) { if (l_item->message->hdr.type == DAP_STREAM_CH_VOTING_MSG_TYPE_START_SYNC && - a_session->cur_round.sync_attempt == *(uint64_t *)l_item->message->msg_n_sign) { + a_session->cur_round.sync_attempt == *(uint64_t *)l_item->message->msg_n_sign && + s_validator_check(&l_item->signing_addr, a_session->cur_round.validators_list)) { uint64_t l_id_candidate = l_item->message->hdr.round_id; bool l_candidate_found = false; for (uint16_t i = 0; i < l_fill_idx; i++) @@ -589,7 +590,7 @@ static uint64_t s_session_calc_current_round_id(dap_chain_esbocs_session_t *a_se l_id_candidates[l_fill_idx].id = l_id_candidate; l_id_candidates[l_fill_idx].counter = 1; if (++l_fill_idx > a_session->cur_round.validators_synced_count) { - log_it(L_WARNING, "Count of sync messages with same sync attempt is greater" + log_it(L_ERROR, "Count of sync messages with same sync attempt is greater" " than current synced validators count %hu > %hu", l_fill_idx, a_session->cur_round.validators_synced_count); l_fill_idx--; @@ -669,7 +670,7 @@ static void s_session_state_change(dap_chain_esbocs_session_t *a_session, enum s dap_chain_esbocs_store_t *l_store; HASH_FIND(hh, a_session->cur_round.store_items, &a_session->cur_round.attempt_candidate_hash, sizeof(dap_hash_fast_t), l_store); if (!l_store) { - log_it(L_ERROR, "ESBOCS: No finish candidate found!"); + log_it(L_ERROR, "No finish candidate found!"); break; } l_store->candidate_signs = dap_list_sort(l_store->candidate_signs, s_signs_sort_callback); @@ -726,17 +727,17 @@ static void s_session_proc_state(dap_chain_esbocs_session_t *a_session) dap_time_t l_round_timeout = PVT(a_session->esbocs)->round_start_sync_timeout; bool l_round_skip = !s_validator_check(&a_session->my_signing_addr, a_session->cur_round.validators_list); if (l_round_skip) - l_round_timeout += PVT(a_session->esbocs)->round_attempt_timeout * PVT(a_session->esbocs)->round_attempts_max; + l_round_timeout += PVT(a_session->esbocs)->round_attempt_timeout * 3 * PVT(a_session->esbocs)->round_attempts_max; if (a_session->ts_round_sync_start && l_time - a_session->ts_round_sync_start >= l_round_timeout) { if (a_session->cur_round.validators_synced_count >= PVT(a_session->esbocs)->min_validators_count) { a_session->cur_round.id = s_session_calc_current_round_id(a_session); - debug_if(l_cs_debug, L_MSG, "ESBOCS: net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu." + debug_if(l_cs_debug, L_MSG, "net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu." " Minimum count of validators are synchronized, wait to submit candidate", a_session->chain->net_name, a_session->chain->name, a_session->cur_round.id, a_session->cur_round.attempt_num); s_session_state_change(a_session, DAP_CHAIN_ESBOCS_SESSION_STATE_WAIT_PROC, l_time); } else { // timeout start sync - debug_if(l_cs_debug, L_MSG, "ESBOCS: net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu." + debug_if(l_cs_debug, L_MSG, "net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu." " Round finished by reason: %s", a_session->chain->net_name, a_session->chain->name, a_session->cur_round.id, a_session->cur_round.attempt_num, @@ -747,7 +748,7 @@ static void s_session_proc_state(dap_chain_esbocs_session_t *a_session) } break; case DAP_CHAIN_ESBOCS_SESSION_STATE_WAIT_PROC: if (l_time - a_session->ts_attempt_start >= PVT(a_session->esbocs)->round_attempt_timeout) { - debug_if(l_cs_debug, L_MSG, "ESBOCS: net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu." + debug_if(l_cs_debug, L_MSG, "net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu." " Attempt finished by reason: haven't cantidate submitted", a_session->chain->net_name, a_session->chain->name, a_session->cur_round.id, a_session->cur_round.attempt_num); @@ -759,14 +760,14 @@ static void s_session_proc_state(dap_chain_esbocs_session_t *a_session) dap_chain_esbocs_store_t *l_store; HASH_FIND(hh, a_session->cur_round.store_items, &a_session->cur_round.attempt_candidate_hash, sizeof(dap_hash_fast_t), l_store); if (!l_store) { - log_it(L_ERROR, "ESBOCS: No round candidate found!"); + log_it(L_ERROR, "No round candidate found!"); s_session_attempt_new(a_session); break; } if (dap_list_length(l_store->candidate_signs) >= PVT(a_session->esbocs)->min_validators_count) { if(l_cs_debug) { char *l_candidate_hash_str = dap_chain_hash_fast_to_str_new(&a_session->cur_round.attempt_candidate_hash); - log_it(L_MSG, "ESBOCS: net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu" + log_it(L_MSG, "net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu" " Candidate:%s collected sings of minimum number of validators, so to sent PRE_COMMIT", a_session->chain->net_name, a_session->chain->name, a_session->cur_round.id, a_session->cur_round.attempt_num, l_candidate_hash_str); @@ -775,7 +776,7 @@ static void s_session_proc_state(dap_chain_esbocs_session_t *a_session) s_session_state_change(a_session, DAP_CHAIN_ESBOCS_SESSION_STATE_WAIT_FINISH, l_time); break; } - debug_if(l_cs_debug, L_MSG, "ESBOCS: net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu." + debug_if(l_cs_debug, L_MSG, "net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu." " Attempt finished by reason: cant't collect minimum number of validator's signs", a_session->chain->net_name, a_session->chain->name, a_session->cur_round.id, a_session->cur_round.attempt_num); @@ -784,7 +785,7 @@ static void s_session_proc_state(dap_chain_esbocs_session_t *a_session) break; case DAP_CHAIN_ESBOCS_SESSION_STATE_WAIT_FINISH: if (l_time - a_session->ts_attempt_start >= PVT(a_session->esbocs)->round_attempt_timeout) { - debug_if(l_cs_debug, L_MSG, "ESBOCS: net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu." + debug_if(l_cs_debug, L_MSG, "net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu." " Attempt finished by reason: cant't collect minimum number of validator's precommits with same final hash", a_session->chain->net_name, a_session->chain->name, a_session->cur_round.id, a_session->cur_round.attempt_num); @@ -840,14 +841,14 @@ static void s_session_candidate_submit(dap_chain_esbocs_session_t *a_session) dap_hash_fast(l_candidate, l_candidate_size, &l_candidate_hash); if (PVT(a_session->esbocs)->debug) { char *l_candidate_hash_str = dap_chain_hash_fast_to_str_new(&l_candidate_hash); - log_it(L_MSG, "ESBOCS: net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu. Submit my candidate:%s", + log_it(L_MSG, "net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu. Submit my candidate:%s", a_session->chain->net_name, a_session->chain->name, a_session->cur_round.id, a_session->cur_round.attempt_num, l_candidate_hash_str); DAP_DELETE(l_candidate_hash_str); } } else { // there is no my candidate, send null hash if (PVT(a_session->esbocs)->debug) - log_it(L_MSG, "ESBOCS: net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu." + log_it(L_MSG, "net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu." " I don't have a candidate. I submit a null candidate.", a_session->chain->net_name, a_session->chain->name, a_session->cur_round.id, a_session->cur_round.attempt_num); @@ -869,7 +870,7 @@ static void s_session_candidate_verify(dap_chain_esbocs_session_t *a_session, da NULL, 0, a_session->cur_round.validators_list); if (PVT(a_session->esbocs)->debug) { char *l_candidate_hash_str = dap_chain_hash_fast_to_str_new(a_candidate_hash); - log_it(L_MSG, "ESBOCS: net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu Sent APPROVE candidate:%s", + log_it(L_MSG, "net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu Sent APPROVE candidate:%s", a_session->chain->net_name, a_session->chain->name, a_session->cur_round.id, a_session->cur_round.attempt_num, l_candidate_hash_str); DAP_DELETE(l_candidate_hash_str); @@ -880,7 +881,7 @@ static void s_session_candidate_verify(dap_chain_esbocs_session_t *a_session, da NULL, 0, a_session->cur_round.validators_list); if (PVT(a_session->esbocs)->debug) { char *l_candidate_hash_str = dap_chain_hash_fast_to_str_new(a_candidate_hash); - log_it(L_MSG, "ESBOCS: net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu Sent REJECT candidate:%s", + log_it(L_MSG, "net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu Sent REJECT candidate:%s", a_session->chain->net_name, a_session->chain->name, a_session->cur_round.id, a_session->cur_round.attempt_num, l_candidate_hash_str); DAP_DELETE(l_candidate_hash_str); @@ -900,26 +901,26 @@ static bool s_session_candidate_to_chain(dap_chain_esbocs_session_t *a_session, case ATOM_ACCEPT: // block save to chain if (dap_chain_atom_save(a_session->chain, (uint8_t *)l_candidate, a_candidate_size, a_session->chain->cells->id) < 0) - log_it(L_ERROR, "ESBOCS: Can't save atom %s to the file", l_candidate_hash_str); + log_it(L_ERROR, "Can't save atom %s to the file", l_candidate_hash_str); else { - log_it(L_INFO, "ESBOCS: block %s added in chain successfully", l_candidate_hash_str); + log_it(L_INFO, "block %s added in chain successfully", l_candidate_hash_str); res = true; } break; case ATOM_MOVE_TO_THRESHOLD: - log_it(L_INFO, "ESBOCS: Thresholded atom with hash %s", l_candidate_hash_str); + log_it(L_INFO, "Thresholded atom with hash %s", l_candidate_hash_str); break; case ATOM_PASS: - log_it(L_WARNING, "ESBOCS: Atom with hash %s not accepted (code ATOM_PASS, already present)", l_candidate_hash_str); + log_it(L_WARNING, "Atom with hash %s not accepted (code ATOM_PASS, already present)", l_candidate_hash_str); DAP_DELETE(l_candidate); break; case ATOM_REJECT: - log_it(L_WARNING,"ESBOCS: Atom with hash %s rejected", l_candidate_hash_str); + log_it(L_WARNING,"Atom with hash %s rejected", l_candidate_hash_str); DAP_DELETE(l_candidate); break; default: - log_it(L_CRITICAL, "ESBOCS: Wtf is this ret code ? Atom hash %s code %d", l_candidate_hash_str, l_res); + log_it(L_CRITICAL, "Wtf is this ret code ? Atom hash %s code %d", l_candidate_hash_str, l_res); DAP_DELETE(l_candidate); } DAP_DELETE(l_candidate_hash_str); @@ -938,7 +939,7 @@ static void s_session_round_finish(dap_chain_esbocs_session_t *a_session, dap_ch if (!dap_hash_fast_compare(&a_session->cur_round.attempt_candidate_hash, &l_store->candidate_hash)) { char *l_current_candidate_hash_str = dap_chain_hash_fast_to_str_new(&a_session->cur_round.attempt_candidate_hash); char *l_finish_candidate_hash_str = dap_chain_hash_fast_to_str_new(&l_store->candidate_hash); - debug_if(l_cs_debug, L_WARNING, "ESBOCS: Trying to finish candidate of not the current attempt (%s but not %s)", + debug_if(l_cs_debug, L_WARNING, "Trying to finish candidate of not the current attempt (%s but not %s)", l_current_candidate_hash_str, l_finish_candidate_hash_str); DAP_DELETE(l_current_candidate_hash_str); DAP_DELETE(l_finish_candidate_hash_str); @@ -947,28 +948,28 @@ static void s_session_round_finish(dap_chain_esbocs_session_t *a_session, dap_ch if (l_store->reject_count >= l_cs_level) { char *l_finish_candidate_hash_str = dap_chain_hash_fast_to_str_new(&l_store->candidate_hash); - debug_if(l_cs_debug, L_WARNING, "ESBOCS: Trying to finish rejected candidate %s", l_finish_candidate_hash_str); + debug_if(l_cs_debug, L_WARNING, "Trying to finish rejected candidate %s", l_finish_candidate_hash_str); DAP_DELETE(l_finish_candidate_hash_str); return; } if (l_store->approve_count < l_cs_level) { char *l_finish_candidate_hash_str = dap_chain_hash_fast_to_str_new(&l_store->candidate_hash); - debug_if(l_cs_debug, L_WARNING, "ESBOCS: Trying to finish not properly approved candidate %s", l_finish_candidate_hash_str); + debug_if(l_cs_debug, L_WARNING, "Trying to finish not properly approved candidate %s", l_finish_candidate_hash_str); DAP_DELETE(l_finish_candidate_hash_str); return; } if (dap_list_length(l_store->candidate_signs) < l_cs_level) { char *l_finish_candidate_hash_str = dap_chain_hash_fast_to_str_new(&l_store->candidate_hash); - debug_if(l_cs_debug, L_WARNING, "ESBOCS: Trying to finish not properly signed candidate %s", l_finish_candidate_hash_str); + debug_if(l_cs_debug, L_WARNING, "Trying to finish not properly signed candidate %s", l_finish_candidate_hash_str); DAP_DELETE(l_finish_candidate_hash_str); return; } if (l_store->precommit_count < l_cs_level) { char *l_finish_candidate_hash_str = dap_chain_hash_fast_to_str_new(&l_store->candidate_hash); - debug_if(l_cs_debug, L_WARNING, "ESBOCS: Trying to finish not properly precommited candidate %s", l_finish_candidate_hash_str); + debug_if(l_cs_debug, L_WARNING, "Trying to finish not properly precommited candidate %s", l_finish_candidate_hash_str); DAP_DELETE(l_finish_candidate_hash_str); return; } @@ -976,7 +977,7 @@ static void s_session_round_finish(dap_chain_esbocs_session_t *a_session, dap_ch if (l_cs_debug) { char *l_finish_candidate_hash_str = dap_chain_hash_fast_to_str_new(&l_store->candidate_hash); char *l_finish_block_hash_str = dap_chain_hash_fast_to_str_new(&l_store->precommit_candidate_hash); - log_it(L_MSG, "ESBOCS: net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu Candidate:%s passed the consensus!\n" + log_it(L_MSG, "net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu Candidate:%s passed the consensus!\n" "Move block %s to chains", a_session->chain->net_name, a_session->chain->name, a_session->cur_round.id, a_session->cur_round.attempt_num, l_finish_candidate_hash_str, l_finish_block_hash_str); @@ -1031,31 +1032,31 @@ static void s_session_packet_in(void *a_arg, dap_chain_node_addr_t *a_sender_nod if (a_sender_node_addr) { //Process network message pthread_mutex_lock(&l_session->mutex); - debug_if(l_cs_debug, L_MSG, "ESBOCS: net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu." + debug_if(l_cs_debug, L_MSG, "net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu." " Receive pkt type:0x%x from addr:"NODE_ADDR_FP_STR", my_addr:"NODE_ADDR_FP_STR"", l_session->chain->net_name, l_session->chain->name, l_session->cur_round.id, l_session->cur_round.attempt_num, l_message->hdr.type, NODE_ADDR_FP_ARGS(a_sender_node_addr), NODE_ADDR_FP_ARGS_S(l_session->my_addr)); if (a_receiver_node_addr->uint64 != l_session->my_addr.uint64) { - debug_if(l_cs_debug, L_MSG, "ESBOCS: Wrong packet destination address"); + debug_if(l_cs_debug, L_MSG, "Wrong packet destination address"); goto session_unlock; } if (sizeof(*l_message) + l_message->hdr.sign_size + l_message->hdr.message_size != a_data_size) { - log_it(L_WARNING, "ESBOCS: incorrect message size in header is %zu when data size is only %zu and header size is %zu", + log_it(L_WARNING, "incorrect message size in header is %zu when data size is only %zu and header size is %zu", l_message->hdr.sign_size, a_data_size, sizeof(*l_message)); goto session_unlock; } if (l_message->hdr.chain_id.uint64 != l_session->chain->id.uint64) { - debug_if(l_cs_debug, L_MSG, "ESBOCS: Invalid chain ID %"DAP_UINT64_FORMAT_U, l_message->hdr.chain_id.uint64); + debug_if(l_cs_debug, L_MSG, "Invalid chain ID %"DAP_UINT64_FORMAT_U, l_message->hdr.chain_id.uint64); goto session_unlock; } dap_chain_hash_fast_t l_data_hash = {}; dap_hash_fast(l_message, a_data_size, &l_data_hash); if (!dap_hash_fast_compare(a_data_hash, &l_data_hash)) { - debug_if(l_cs_debug, L_MSG, "ESBOCS: net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu." + debug_if(l_cs_debug, L_MSG, "net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu." " Message rejected: message hash does not match", l_session->chain->net_name, l_session->chain->name, l_session->cur_round.id, l_session->cur_round.attempt_num); @@ -1064,7 +1065,7 @@ static void s_session_packet_in(void *a_arg, dap_chain_node_addr_t *a_sender_nod l_message->hdr.sign_size = 0; // restore header on signing time if (dap_sign_verify_all(l_sign, l_sign_size, l_message, l_message_data_size + sizeof(l_message->hdr))) { - debug_if(l_cs_debug, L_MSG, "ESBOCS: net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu." + debug_if(l_cs_debug, L_MSG, "net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu." " Message rejected from addr:"NODE_ADDR_FP_STR" not passed verification", l_session->chain->net_name, l_session->chain->name, l_session->cur_round.id, l_session->cur_round.attempt_num, NODE_ADDR_FP_ARGS(a_sender_node_addr)); @@ -1081,7 +1082,7 @@ static void s_session_packet_in(void *a_arg, dap_chain_node_addr_t *a_sender_nod } else if (l_message->hdr.round_id != l_session->cur_round.id || l_message->hdr.attempt_num < l_session->cur_round.attempt_num) { // round check - debug_if(l_cs_debug, L_MSG, "ESBOCS: net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu." + debug_if(l_cs_debug, L_MSG, "net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu." " Message rejected: round or attempt in message does not match", l_session->chain->net_name, l_session->chain->name, l_session->cur_round.id, l_session->cur_round.attempt_num); @@ -1098,7 +1099,7 @@ static void s_session_packet_in(void *a_arg, dap_chain_node_addr_t *a_sender_nod !s_validator_check(&l_signing_addr, l_session->cur_round.validators_list)) || (l_message->hdr.type == DAP_STREAM_CH_VOTING_MSG_TYPE_START_SYNC && // Accept all validators !dap_chain_net_srv_stake_key_delegated(&l_signing_addr))) { - debug_if(l_cs_debug, L_MSG, "ESBOCS: net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu." + debug_if(l_cs_debug, L_MSG, "net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu." " Message rejected: validator addr:%s not in the list.", l_session->chain->net_name, l_session->chain->name, l_session->cur_round.id, l_message->hdr.attempt_num, l_validator_addr_str); @@ -1111,7 +1112,7 @@ static void s_session_packet_in(void *a_arg, dap_chain_node_addr_t *a_sender_nod dap_chain_esbocs_message_item_t *l_message_item_temp = NULL; HASH_FIND(hh, l_round->message_items, a_data_hash, sizeof(dap_chain_hash_fast_t), l_message_item_temp); if (l_message_item_temp) { - debug_if(l_cs_debug, L_MSG, "ESBOCS: net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu." + debug_if(l_cs_debug, L_MSG, "net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu." " Message rejected: message hash is exists in chain (duplicate)", l_session->chain->net_name, l_session->chain->name, l_session->cur_round.id, l_message->hdr.attempt_num); @@ -1130,7 +1131,7 @@ static void s_session_packet_in(void *a_arg, dap_chain_node_addr_t *a_sender_nod dap_hash_fast_compare(&l_chain_message->message->hdr.candidate_hash, &l_message->hdr.candidate_hash)) { if (l_message->hdr.type != DAP_STREAM_CH_VOTING_MSG_TYPE_START_SYNC || // Not sync or same sync attempt *(uint64_t *)l_message_data == *(uint64_t *)l_chain_message->message->msg_n_sign) { - debug_if(l_cs_debug, L_MSG, "ESBOCS: net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu." + debug_if(l_cs_debug, L_MSG, "net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu." " Message rejected: duplicate message %s", l_session->chain->net_name, l_session->chain->name, l_session->cur_round.id, l_message->hdr.attempt_num, @@ -1146,54 +1147,63 @@ static void s_session_packet_in(void *a_arg, dap_chain_node_addr_t *a_sender_nod switch (l_message->hdr.type) { case DAP_STREAM_CH_VOTING_MSG_TYPE_START_SYNC: { uint64_t l_sync_attempt = *(uint64_t *)l_message_data; - debug_if(l_cs_debug, L_MSG, "ESBOCS: net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U + debug_if(l_cs_debug, L_MSG, "net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U " Receive START_SYNC: from validator:%s, sync attempt %"DAP_UINT64_FORMAT_U, l_session->chain->net_name, l_session->chain->name, l_message->hdr.round_id, - l_validator_addr_str, l_sync_attempt); + l_validator_addr_str, l_sync_attempt); if (l_sync_attempt != l_session->cur_round.sync_attempt) { if (l_sync_attempt < l_session->cur_round.sync_attempt) { - debug_if(l_cs_debug, L_MSG, "ESBOCS: net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U + debug_if(l_cs_debug, L_MSG, "net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U " SYNC message is rejected because current sync attempt %"DAP_UINT64_FORMAT_U " is greater than meassage sync attempt %"DAP_UINT64_FORMAT_U, l_session->chain->net_name, l_session->chain->name, l_session->cur_round.id, l_session->cur_round.sync_attempt, l_sync_attempt); - break; } else { uint64_t l_attempts_miss = l_sync_attempt - l_session->cur_round.sync_attempt; if (l_attempts_miss > UINT16_MAX) { - debug_if(l_cs_debug, L_MSG, "ESBOCS: net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U + debug_if(l_cs_debug, L_MSG, "net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U " SYNC message is rejected - too much sync attempt difference %"DAP_UINT64_FORMAT_U, l_session->chain->net_name, l_session->chain->name, l_session->cur_round.id, l_attempts_miss); - break; - } - debug_if(l_cs_debug, L_MSG, "ESBOCS: net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U - " SYNC message sync attempt %"DAP_UINT64_FORMAT_U" is greater than" - " current round sync attempt %"DAP_UINT64_FORMAT_U" so fast-forward this round", - l_session->chain->net_name, l_session->chain->name, l_session->cur_round.id, - l_sync_attempt, l_session->cur_round.sync_attempt); - for (uint64_t i = 0; i < l_attempts_miss - 1; i++) { - // Fast-forward current sync attempt - s_get_validators_list(l_session, NULL); - l_session->cur_round.sync_attempt++; + } else { + debug_if(l_cs_debug, L_MSG, "net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U + " SYNC message sync attempt %"DAP_UINT64_FORMAT_U" is greater than" + " current round sync attempt %"DAP_UINT64_FORMAT_U" so fast-forward this round", + l_session->chain->net_name, l_session->chain->name, l_session->cur_round.id, + l_sync_attempt, l_session->cur_round.sync_attempt); + for (uint64_t i = 0; i < l_attempts_miss - 1; i++) { + // Fast-forward current sync attempt + s_get_validators_list(l_session, NULL); + l_session->cur_round.sync_attempt++; + } + // Process this message in new round, it will increment current sync attempt + s_session_sync_queue_add(l_session, l_message, a_data_size); + l_session->round_fast_forward = true; + l_session->cur_round.id = l_message->hdr.round_id - 1; } - // Process this message in new round, it will increment current sync attempt - s_session_sync_queue_add(l_session, l_message, a_data_size); - l_session->round_fast_forward = true; - l_session->cur_round.id = l_message->hdr.round_id - 1; - s_session_round_new(l_session); - break; } + break; } + bool l_msg_from_list = false; for (dap_list_t *it = l_session->cur_round.validators_list; it; it = it->next) { dap_chain_esbocs_validator_t *l_validator = it->data; - if (dap_chain_addr_compare(&l_validator->signing_addr, &l_signing_addr)) + if (dap_chain_addr_compare(&l_validator->signing_addr, &l_signing_addr)) { l_validator->is_synced = true; + l_msg_from_list = true; + } + } + if (!l_msg_from_list) { + debug_if(l_cs_debug, L_MSG, "net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U + " SYNC message is rejected because validator %s" + " not in the current round validators list", + l_session->chain->net_name, l_session->chain->name, + l_session->cur_round.id, l_validator_addr_str); + break; } if (++l_session->cur_round.validators_synced_count == dap_list_length(l_session->cur_round.validators_list)) { l_session->cur_round.id = s_session_calc_current_round_id(l_session); - debug_if(l_cs_debug, L_MSG, "ESBOCS: net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu." + debug_if(l_cs_debug, L_MSG, "net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu." " All validators are synchronized, wait to submit candidate", l_session->chain->net_name, l_session->chain->name, l_session->cur_round.id, l_message->hdr.attempt_num); @@ -1204,7 +1214,7 @@ static void s_session_packet_in(void *a_arg, dap_chain_node_addr_t *a_sender_nod uint8_t *l_candidate = l_message->msg_n_sign; size_t l_candidate_size = l_message->hdr.message_size; if (!l_candidate_size || dap_hash_fast_is_blank(&l_message->hdr.candidate_hash)) { - debug_if(l_cs_debug, L_MSG, "ESBOCS: net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu." + debug_if(l_cs_debug, L_MSG, "net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu." " Receive SUBMIT candidate NULL", l_session->chain->net_name, l_session->chain->name, l_session->cur_round.id, l_message->hdr.attempt_num); @@ -1216,7 +1226,7 @@ static void s_session_packet_in(void *a_arg, dap_chain_node_addr_t *a_sender_nod dap_chain_hash_fast_t l_check_hash; dap_hash_fast(l_candidate, l_candidate_size, &l_check_hash); if (!dap_hash_fast_compare(&l_check_hash, l_candidate_hash)) { - debug_if(l_cs_debug, L_MSG, "ESBOCS: net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu." + debug_if(l_cs_debug, L_MSG, "net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu." " Receive SUBMIT candidate hash broken", l_session->chain->net_name, l_session->chain->name, l_session->cur_round.id, l_message->hdr.attempt_num); @@ -1225,7 +1235,7 @@ static void s_session_packet_in(void *a_arg, dap_chain_node_addr_t *a_sender_nod if (l_cs_debug) { char *l_candidate_hash_str = dap_chain_hash_fast_to_str_new(l_candidate_hash); - log_it(L_MSG, "ESBOCS: net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu." + log_it(L_MSG, "net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu." " Receive SUBMIT candidate %s, size %zu", l_session->chain->net_name, l_session->chain->name, l_session->cur_round.id, l_message->hdr.attempt_num, l_candidate_hash_str, l_candidate_size); @@ -1236,7 +1246,7 @@ static void s_session_packet_in(void *a_arg, dap_chain_node_addr_t *a_sender_nod HASH_FIND(hh, l_session->cur_round.store_items, l_candidate_hash, sizeof(dap_chain_hash_fast_t), l_store); if (l_store) { char *l_candidate_hash_str = dap_chain_hash_fast_to_str_new(l_candidate_hash); - log_it(L_WARNING, "ESBOCS: Duplicate candidate:%s", l_candidate_hash_str); + log_it(L_WARNING, "Duplicate candidate:%s", l_candidate_hash_str); DAP_DELETE(l_candidate_hash_str); break; } @@ -1263,7 +1273,7 @@ static void s_session_packet_in(void *a_arg, dap_chain_node_addr_t *a_sender_nod HASH_FIND(hh, l_session->cur_round.store_items, l_candidate_hash, sizeof(dap_chain_hash_fast_t), l_store); if (!l_store) { l_candidate_hash_str = dap_chain_hash_fast_to_str_new(l_candidate_hash); - log_it(L_WARNING, "ESBOCS: net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu." + log_it(L_WARNING, "net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu." " Receive REJECT message for unknown candidate:%s", l_session->chain->net_name, l_session->chain->name, l_session->cur_round.id, l_message->hdr.attempt_num, @@ -1274,7 +1284,7 @@ static void s_session_packet_in(void *a_arg, dap_chain_node_addr_t *a_sender_nod if (l_cs_debug) { l_candidate_hash_str = dap_chain_hash_fast_to_str_new(l_candidate_hash); - log_it(L_MSG, "ESBOCS: net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu." + log_it(L_MSG, "net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu." " Receive REJECT: candidate:%s", l_session->chain->net_name, l_session->chain->name, l_session->cur_round.id, l_message->hdr.attempt_num, l_candidate_hash_str); @@ -1282,7 +1292,7 @@ static void s_session_packet_in(void *a_arg, dap_chain_node_addr_t *a_sender_nod if (++l_store->reject_count >= l_cs_level && !l_store->decide_reject && dap_hash_fast_compare(&l_session->cur_round.attempt_candidate_hash, l_candidate_hash)) { l_store->decide_reject = true; - debug_if(l_cs_debug, L_MSG, "ESBOCS: net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu." + debug_if(l_cs_debug, L_MSG, "net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu." " Candidate:%s rejected by minimum number of validators, attempt failed", l_session->chain->net_name, l_session->chain->name, l_session->cur_round.id, l_message->hdr.attempt_num, l_candidate_hash_str); @@ -1297,7 +1307,7 @@ static void s_session_packet_in(void *a_arg, dap_chain_node_addr_t *a_sender_nod HASH_FIND(hh, l_session->cur_round.store_items, l_candidate_hash, sizeof(dap_chain_hash_fast_t), l_store); if (!l_store) { l_candidate_hash_str = dap_chain_hash_fast_to_str_new(l_candidate_hash); - log_it(L_WARNING, "ESBOCS: net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu." + log_it(L_WARNING, "net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu." " Receive APPROVE message for unknown candidate:%s", l_session->chain->net_name, l_session->chain->name, l_session->cur_round.id, l_message->hdr.attempt_num, @@ -1308,7 +1318,7 @@ static void s_session_packet_in(void *a_arg, dap_chain_node_addr_t *a_sender_nod if (l_cs_debug) { l_candidate_hash_str = dap_chain_hash_fast_to_str_new(l_candidate_hash); - log_it(L_MSG, "ESBOCS: net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu." + log_it(L_MSG, "net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu." " Receive APPROVE: candidate:%s", l_session->chain->net_name, l_session->chain->name, l_session->cur_round.id, l_message->hdr.attempt_num, l_candidate_hash_str); @@ -1316,7 +1326,7 @@ static void s_session_packet_in(void *a_arg, dap_chain_node_addr_t *a_sender_nod if (++l_store->approve_count >= l_cs_level && !l_store->decide_approve && dap_hash_fast_compare(&l_session->cur_round.attempt_candidate_hash, l_candidate_hash)) { l_store->decide_approve = true; - debug_if(l_cs_debug, L_MSG, "ESBOCS: net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu." + debug_if(l_cs_debug, L_MSG, "net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu." " Candidate:%s approved by minimum number of validators, let's sign it", l_session->chain->net_name, l_session->chain->name, l_session->cur_round.id, l_message->hdr.attempt_num, l_candidate_hash_str); @@ -1346,7 +1356,7 @@ static void s_session_packet_in(void *a_arg, dap_chain_node_addr_t *a_sender_nod HASH_FIND(hh, l_session->cur_round.store_items, l_candidate_hash, sizeof(dap_chain_hash_fast_t), l_store); if (!l_store) { l_candidate_hash_str = dap_chain_hash_fast_to_str_new(l_candidate_hash); - log_it(L_WARNING, "ESBOCS: net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu." + log_it(L_WARNING, "net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu." " Receive COMMIT_SIGN message for unknown candidate:%s", l_session->chain->net_name, l_session->chain->name, l_session->cur_round.id, l_message->hdr.attempt_num, @@ -1357,7 +1367,7 @@ static void s_session_packet_in(void *a_arg, dap_chain_node_addr_t *a_sender_nod if (l_cs_debug) { l_candidate_hash_str = dap_chain_hash_fast_to_str_new(l_candidate_hash); - log_it(L_MSG, "ESBOCS: net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu." + log_it(L_MSG, "net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu." " Receive COMMIT_SIGN: candidate:%s", l_session->chain->net_name, l_session->chain->name, l_session->cur_round.id, l_message->hdr.attempt_num, l_candidate_hash_str); @@ -1372,7 +1382,7 @@ static void s_session_packet_in(void *a_arg, dap_chain_node_addr_t *a_sender_nod DAP_DUP_SIZE(l_candidate_sign, l_candidate_sign_size)); if (dap_list_length(l_store->candidate_signs) == l_round->validators_synced_count) { if (PVT(l_session->esbocs)->debug) - log_it(L_MSG, "ESBOCS: net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu." + log_it(L_MSG, "net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu." " Candidate:%s collected signs of all synced validators", l_session->chain->net_name, l_session->chain->name, l_round->id, l_message->hdr.attempt_num, l_candidate_hash_str); @@ -1392,7 +1402,7 @@ static void s_session_packet_in(void *a_arg, dap_chain_node_addr_t *a_sender_nod HASH_FIND(hh, l_session->cur_round.store_items, l_candidate_hash, sizeof(dap_chain_hash_fast_t), l_store); if (!l_store) { l_candidate_hash_str = dap_chain_hash_fast_to_str_new(l_candidate_hash); - log_it(L_WARNING, "ESBOCS: net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu." + log_it(L_WARNING, "net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu." " Receive PRE_COMMIT message for unknown candidate:%s", l_session->chain->net_name, l_session->chain->name, l_session->cur_round.id, l_message->hdr.attempt_num, @@ -1411,7 +1421,7 @@ static void s_session_packet_in(void *a_arg, dap_chain_node_addr_t *a_sender_nod l_candidate_hash_str = dap_chain_hash_fast_to_str_new(l_candidate_hash); char *l_my_precommit_hash_str = dap_chain_hash_fast_to_str_new(&l_store->precommit_candidate_hash); char *l_remote_precommit_hash_str = dap_chain_hash_fast_to_str_new(l_precommit_hash); - log_it(L_MSG, "ESBOCS: net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu." + log_it(L_MSG, "net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu." " Candidate:%s has different final hash of local and remote validators\n" "(%s and %s)", l_session->chain->net_name, l_session->chain->name, l_session->cur_round.id, @@ -1426,7 +1436,7 @@ static void s_session_packet_in(void *a_arg, dap_chain_node_addr_t *a_sender_nod if (l_cs_debug) { l_candidate_hash_str = dap_chain_hash_fast_to_str_new(l_candidate_hash); - log_it(L_MSG, "ESBOCS: net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu." + log_it(L_MSG, "net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu." " Receive PRE_COMMIT: candidate:%s", l_session->chain->net_name, l_session->chain->name, l_session->cur_round.id, l_message->hdr.attempt_num, l_candidate_hash_str); @@ -1434,7 +1444,7 @@ static void s_session_packet_in(void *a_arg, dap_chain_node_addr_t *a_sender_nod if (++l_store->precommit_count >= l_cs_level && !l_store->decide_commit && dap_hash_fast_compare(&l_session->cur_round.attempt_candidate_hash, l_candidate_hash)) { l_store->decide_commit = true; - debug_if(l_cs_debug, L_MSG, "ESBOCS: net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu." + debug_if(l_cs_debug, L_MSG, "net:%s, chain:%s, round:%"DAP_UINT64_FORMAT_U", attempt:%hu." " Candidate:%s precommted by minimum number of validators, try to finish this round", l_session->chain->net_name, l_session->chain->name, l_session->cur_round.id, l_message->hdr.attempt_num, l_candidate_hash_str);