mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
Get rid of std::cerr logs in collator/validator
This commit is contained in:
parent
3c245c6146
commit
ce6c29941e
14 changed files with 310 additions and 200 deletions
|
@ -1553,8 +1553,10 @@ void ValidateQuery::got_neighbor_out_queue(int i, td::Result<Ref<MessageQueue>>
|
|||
// unpack ProcessedUpto
|
||||
LOG(DEBUG) << "unpacking ProcessedUpto of neighbor " << descr.blk_.to_str();
|
||||
if (verbosity >= 2) {
|
||||
block::gen::t_ProcessedInfo.print(std::cerr, qinfo.proc_info);
|
||||
qinfo.proc_info->print_rec(std::cerr);
|
||||
FLOG(INFO) {
|
||||
block::gen::t_ProcessedInfo.print(sb, qinfo.proc_info);
|
||||
qinfo.proc_info->print_rec(sb);
|
||||
};
|
||||
}
|
||||
descr.processed_upto = block::MsgProcessedUptoCollection::unpack(descr.shard(), qinfo.proc_info);
|
||||
if (!descr.processed_upto) {
|
||||
|
@ -2656,7 +2658,6 @@ bool ValidateQuery::unpack_precheck_value_flow(Ref<vm::Cell> value_flow_root) {
|
|||
" but the sum over all accounts present in the new state is " + cc.to_str());
|
||||
}
|
||||
auto msg_extra = in_msg_dict_->get_root_extra();
|
||||
// block::gen::t_ImportFees.print(std::cerr, msg_extra);
|
||||
if (!(block::tlb::t_Grams.as_integer_skip_to(msg_extra.write(), import_fees_) && cc.unpack(std::move(msg_extra)))) {
|
||||
return reject_query("cannot unpack ImportFees from the augmentation of the InMsgDescr dictionary");
|
||||
}
|
||||
|
@ -2760,20 +2761,22 @@ bool ValidateQuery::precheck_one_account_update(td::ConstBitPtr acc_id, Ref<vm::
|
|||
auto acc_blk_root = account_blocks_dict_->lookup(acc_id, 256);
|
||||
if (acc_blk_root.is_null()) {
|
||||
if (verbosity >= 3 * 0) {
|
||||
std::cerr << "state of account " << workchain() << ":" << acc_id.to_hex(256)
|
||||
<< " in the old shardchain state:" << std::endl;
|
||||
if (old_value.not_null()) {
|
||||
block::gen::t_ShardAccount.print(std::cerr, *old_value);
|
||||
} else {
|
||||
std::cerr << "<absent>" << std::endl;
|
||||
}
|
||||
std::cerr << "state of account " << workchain() << ":" << acc_id.to_hex(256)
|
||||
<< " in the new shardchain state:" << std::endl;
|
||||
if (new_value.not_null()) {
|
||||
block::gen::t_ShardAccount.print(std::cerr, *new_value);
|
||||
} else {
|
||||
std::cerr << "<absent>" << std::endl;
|
||||
}
|
||||
FLOG(INFO) {
|
||||
sb << "state of account " << workchain() << ":" << acc_id.to_hex(256)
|
||||
<< " in the old shardchain state:" << "\n";
|
||||
if (old_value.not_null()) {
|
||||
block::gen::t_ShardAccount.print(sb, old_value);
|
||||
} else {
|
||||
sb << "<absent>" << "\n";
|
||||
}
|
||||
sb << "state of account " << workchain() << ":" << acc_id.to_hex(256)
|
||||
<< " in the new shardchain state:" << "\n";
|
||||
if (new_value.not_null()) {
|
||||
block::gen::t_ShardAccount.print(sb, new_value);
|
||||
} else {
|
||||
sb << "<absent>" << "\n";
|
||||
}
|
||||
};
|
||||
}
|
||||
return reject_query("the state of account "s + acc_id.to_hex(256) +
|
||||
" changed in the new state with respect to the old state, but the block contains no "
|
||||
|
@ -2931,8 +2934,6 @@ bool ValidateQuery::precheck_one_account_block(td::ConstBitPtr acc_id, Ref<vm::C
|
|||
" not belonging to the block's shard " + shard_.to_str());
|
||||
}
|
||||
CHECK(acc_blk_root.not_null());
|
||||
// acc_blk_root->print_rec(std::cerr);
|
||||
// block::gen::t_AccountBlock.print(std::cerr, acc_blk_root);
|
||||
block::gen::AccountBlock::Record acc_blk;
|
||||
block::gen::HASH_UPDATE::Record hash_upd;
|
||||
if (!(tlb::csr_unpack(acc_blk_root, acc_blk) &&
|
||||
|
@ -3860,7 +3861,9 @@ bool ValidateQuery::check_in_msg(td::ConstBitPtr key, Ref<vm::CellSlice> in_msg)
|
|||
ton::LogicalTime trans_lt;
|
||||
CHECK(block::get_transaction_id(transaction, trans_addr, trans_lt));
|
||||
if (dest_addr != trans_addr) {
|
||||
block::gen::t_InMsg.print(std::cerr, *in_msg);
|
||||
FLOG(INFO) {
|
||||
block::gen::t_InMsg.print(sb, in_msg);
|
||||
};
|
||||
return reject_query(PSTRING() << "InMsg corresponding to inbound message with hash " << key.to_hex(256)
|
||||
<< " and destination address " << dest_addr.to_hex()
|
||||
<< " claims that the message is processed by transaction " << trans_lt
|
||||
|
@ -4408,7 +4411,9 @@ bool ValidateQuery::check_out_msg(td::ConstBitPtr key, Ref<vm::CellSlice> out_ms
|
|||
ton::LogicalTime trans_lt;
|
||||
CHECK(block::get_transaction_id(transaction, trans_addr, trans_lt));
|
||||
if (src_addr != trans_addr) {
|
||||
block::gen::t_OutMsg.print(std::cerr, *out_msg);
|
||||
FLOG(INFO) {
|
||||
block::gen::t_OutMsg.print(sb, out_msg);
|
||||
};
|
||||
return reject_query(PSTRING() << "OutMsg corresponding to outbound message with hash " << key.to_hex(256)
|
||||
<< " and source address " << src_addr.to_hex()
|
||||
<< " claims that the message was created by transaction " << trans_lt
|
||||
|
@ -5022,15 +5027,19 @@ bool ValidateQuery::check_in_queue() {
|
|||
LOG(DEBUG) << "processing inbound message with (lt,hash)=(" << kv->lt << "," << kv->key.to_hex()
|
||||
<< ") from neighbor #" << kv->source;
|
||||
if (verbosity > 3) {
|
||||
std::cerr << "inbound message: lt=" << kv->lt << " from=" << kv->source << " key=" << kv->key.to_hex() << " msg=";
|
||||
block::gen::t_EnqueuedMsg.print(std::cerr, *(kv->msg));
|
||||
FLOG(INFO) {
|
||||
sb << "inbound message: lt=" << kv->lt << " from=" << kv->source << " key=" << kv->key.to_hex() << " msg=";
|
||||
block::gen::t_EnqueuedMsg.print(sb, kv->msg);
|
||||
};
|
||||
}
|
||||
bool unprocessed = false;
|
||||
if (!check_neighbor_outbound_message(kv->msg, kv->lt, kv->key.cbits(), neighbors_.at(kv->source), unprocessed)) {
|
||||
if (verbosity > 1) {
|
||||
std::cerr << "invalid neighbor outbound message: lt=" << kv->lt << " from=" << kv->source
|
||||
<< " key=" << kv->key.to_hex() << " msg=";
|
||||
block::gen::t_EnqueuedMsg.print(std::cerr, *(kv->msg));
|
||||
FLOG(INFO) {
|
||||
sb << "invalid neighbor outbound message: lt=" << kv->lt << " from=" << kv->source
|
||||
<< " key=" << kv->key.to_hex() << " msg=";
|
||||
block::gen::t_EnqueuedMsg.print(sb, kv->msg);
|
||||
};
|
||||
}
|
||||
return reject_query("error processing outbound internal message "s + kv->key.to_hex() + " of neighbor " +
|
||||
neighbors_.at(kv->source).blk_.to_str());
|
||||
|
@ -5636,10 +5645,12 @@ bool ValidateQuery::check_one_transaction(block::Account& account, ton::LogicalT
|
|||
// now compare the re-created transaction with the one we have
|
||||
if (trans_root2->get_hash() != trans_root->get_hash()) {
|
||||
if (verbosity >= 3 * 0) {
|
||||
std::cerr << "original transaction " << lt << " of " << addr.to_hex() << ": ";
|
||||
block::gen::t_Transaction.print_ref(std::cerr, trans_root);
|
||||
std::cerr << "re-created transaction " << lt << " of " << addr.to_hex() << ": ";
|
||||
block::gen::t_Transaction.print_ref(std::cerr, trans_root2);
|
||||
FLOG(INFO) {
|
||||
sb << "original transaction " << lt << " of " << addr.to_hex() << ": ";
|
||||
block::gen::t_Transaction.print_ref(sb, trans_root);
|
||||
sb << "re-created transaction " << lt << " of " << addr.to_hex() << ": ";
|
||||
block::gen::t_Transaction.print_ref(sb, trans_root2);
|
||||
};
|
||||
}
|
||||
return reject_query(PSTRING() << "the transaction " << lt << " of " << addr.to_hex() << " has hash "
|
||||
<< trans_root->get_hash().to_hex()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue