1
0
Fork 0
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:
SpyCheese 2025-02-13 14:25:04 +03:00
parent 3c245c6146
commit ce6c29941e
14 changed files with 310 additions and 200 deletions

View file

@ -360,7 +360,6 @@ MsgProcessedUptoCollection::MsgProcessedUptoCollection(ton::ShardIdFull _owner,
z.shard = key.get_uint(64);
z.mc_seqno = (unsigned)((key + 64).get_uint(32));
z.last_inmsg_lt = value.write().fetch_ulong(64);
// std::cerr << "ProcessedUpto shard " << std::hex << z.shard << std::dec << std::endl;
return value.write().fetch_bits_to(z.last_inmsg_hash) && z.shard && ton::shard_contains(owner.shard, z.shard);
});
}
@ -862,8 +861,10 @@ td::Status ShardState::unpack_out_msg_queue_info(Ref<vm::Cell> out_msg_queue_inf
out_msg_queue_ =
std::make_unique<vm::AugmentedDictionary>(std::move(qinfo.out_queue), 352, block::tlb::aug_OutMsgQueue);
if (verbosity >= 3 * 1) {
LOG(DEBUG) << "unpacking ProcessedUpto of our previous block " << id_.to_str();
block::gen::t_ProcessedInfo.print(std::cerr, qinfo.proc_info);
FLOG(DEBUG) {
sb << "unpacking ProcessedUpto of our previous block " << id_.to_str();
block::gen::t_ProcessedInfo.print(sb, qinfo.proc_info);
};
}
if (!block::gen::t_ProcessedInfo.validate_csr(1024, qinfo.proc_info)) {
return td::Status::Error(

View file

@ -163,8 +163,11 @@ td::Status ConfigInfo::unpack() {
}
gen::McStateExtra::Record extra_info;
if (!tlb::unpack_cell(state_extra_root_, extra_info)) {
vm::load_cell_slice(state_extra_root_).print_rec(std::cerr);
block::gen::t_McStateExtra.print_ref(std::cerr, state_extra_root_);
FLOG(WARNING) {
sb << "state extra information is invalid: ";
vm::load_cell_slice(state_extra_root_).print_rec(sb);
block::gen::t_McStateExtra.print_ref(sb, state_extra_root_);
};
return td::Status::Error("state extra information is invalid");
}
gen::ValidatorInfo::Record validator_info;
@ -1067,7 +1070,6 @@ Ref<McShardHash> ShardConfig::get_shard_hash(ton::ShardIdFull id, bool exact) co
ton::ShardIdFull true_id;
vm::CellSlice cs;
if (get_shard_hash_raw(cs, id, true_id, exact)) {
// block::gen::t_ShardDescr.print(std::cerr, vm::CellSlice{cs});
return McShardHash::unpack(cs, true_id);
} else {
return {};
@ -1637,8 +1639,10 @@ bool ShardConfig::set_shard_info(ton::ShardIdFull shard, Ref<vm::Cell> value) {
if (!gen::t_BinTree_ShardDescr.validate_ref(1024, value)) {
LOG(ERROR) << "attempting to store an invalid (BinTree ShardDescr) at shard configuration position "
<< shard.to_str();
gen::t_BinTree_ShardDescr.print_ref(std::cerr, value);
vm::load_cell_slice(value).print_rec(std::cerr);
FLOG(WARNING) {
gen::t_BinTree_ShardDescr.print_ref(sb, value);
vm::load_cell_slice(value).print_rec(sb);
};
return false;
}
auto root = shard_hashes_dict_->lookup_ref(td::BitArray<32>{shard.workchain});

View file

@ -138,7 +138,6 @@ bool OutputQueueMerger::add_root(int src, Ref<vm::Cell> outmsg_root) {
if (outmsg_root.is_null()) {
return true;
}
//block::gen::HashmapAug{352, block::gen::t_EnqueuedMsg, block::gen::t_uint64}.print_ref(std::cerr, outmsg_root);
auto kv = std::make_unique<MsgKeyValue>(src, std::move(outmsg_root));
if (kv->replace_by_prefix(common_pfx.cbits(), common_pfx_len)) {
heap.push_back(std::move(kv));

View file

@ -446,8 +446,10 @@ bool Account::unpack(Ref<vm::CellSlice> shard_account, ton::UnixTime now, bool s
return false;
}
if (verbosity > 2) {
shard_account->print_rec(std::cerr, 2);
block::gen::t_ShardAccount.print(std::cerr, *shard_account);
FLOG(INFO) {
shard_account->print_rec(sb, 2);
block::gen::t_ShardAccount.print(sb, shard_account);
};
}
block::gen::ShardAccount::Record acc_info;
if (!(block::tlb::t_ShardAccount.validate_csr(shard_account) && tlb::unpack_exact(shard_account.write(), acc_info))) {
@ -737,9 +739,11 @@ bool Transaction::unpack_input_msg(bool ihr_delivered, const ActionPhaseConfig*
return false;
}
if (verbosity > 2) {
fprintf(stderr, "unpacking inbound message for a new transaction: ");
block::gen::t_Message_Any.print_ref(std::cerr, in_msg);
load_cell_slice(in_msg).print_rec(std::cerr);
FLOG(INFO) {
sb << "unpacking inbound message for a new transaction: ";
block::gen::t_Message_Any.print_ref(sb, in_msg);
load_cell_slice(in_msg).print_rec(sb);
};
}
auto cs = vm::load_cell_slice(in_msg);
int tag = block::gen::t_CommonMsgInfo.get_tag(cs);
@ -1550,11 +1554,13 @@ bool Transaction::run_precompiled_contract(const ComputePhaseConfig& cfg, precom
cp.actions = impl.get_c5();
int out_act_num = output_actions_count(cp.actions);
if (verbosity > 2) {
std::cerr << "new smart contract data: ";
FLOG(INFO) {
sb << "new smart contract data: ";
bool can_be_special = true;
load_cell_slice_special(cp.new_data, can_be_special).print_rec(std::cerr);
std::cerr << "output actions: ";
block::gen::OutList{out_act_num}.print_ref(std::cerr, cp.actions);
load_cell_slice_special(cp.new_data, can_be_special).print_rec(sb);
sb << "output actions: ";
block::gen::OutList{out_act_num}.print_ref(sb, cp.actions);
};
}
}
cp.mode = 0;
@ -1619,7 +1625,6 @@ bool Transaction::prepare_compute_phase(const ComputePhaseConfig& cfg) {
if (in_msg_state.not_null()) {
LOG(DEBUG) << "HASH(in_msg_state) = " << in_msg_state->get_hash().bits().to_hex(256)
<< ", account_state_hash = " << account.state_hash.to_hex();
// vm::load_cell_slice(in_msg_state).print_rec(std::cerr);
} else {
LOG(DEBUG) << "in_msg_state is null";
}
@ -1775,11 +1780,13 @@ bool Transaction::prepare_compute_phase(const ComputePhaseConfig& cfg) {
cp.actions = vm.get_committed_state().c5; // c5 -> action list
int out_act_num = output_actions_count(cp.actions);
if (verbosity > 2) {
std::cerr << "new smart contract data: ";
FLOG(INFO) {
sb << "new smart contract data: ";
bool can_be_special = true;
load_cell_slice_special(cp.new_data, can_be_special).print_rec(std::cerr);
std::cerr << "output actions: ";
block::gen::OutList{out_act_num}.print_ref(std::cerr, cp.actions);
load_cell_slice_special(cp.new_data, can_be_special).print_rec(sb);
sb << "output actions: ";
block::gen::OutList{out_act_num}.print_ref(sb, cp.actions);
};
}
}
cp.mode = 0;
@ -2725,14 +2732,18 @@ int Transaction::try_action_send_msg(const vm::CellSlice& cs0, ActionPhase& ap,
}
if (!block::gen::t_Message_Any.validate_ref(new_msg)) {
LOG(ERROR) << "generated outbound message is not a valid (Message Any) according to automated check";
block::gen::t_Message_Any.print_ref(std::cerr, new_msg);
vm::load_cell_slice(new_msg).print_rec(std::cerr);
FLOG(INFO) {
block::gen::t_Message_Any.print_ref(sb, new_msg);
vm::load_cell_slice(new_msg).print_rec(sb);
};
collect_fine();
return -1;
}
if (verbosity > 2) {
std::cerr << "converted outbound message: ";
block::gen::t_Message_Any.print_ref(std::cerr, new_msg);
FLOG(INFO) {
sb << "converted outbound message: ";
block::gen::t_Message_Any.print_ref(sb, new_msg);
};
}
ap.msgs_created++;
@ -3045,8 +3056,10 @@ bool Transaction::prepare_bounce_phase(const ActionPhaseConfig& cfg) {
}
CHECK(cb.finalize_to(bp.out_msg));
if (verbosity > 2) {
LOG(INFO) << "generated bounced message: ";
block::gen::t_Message_Any.print_ref(std::cerr, bp.out_msg);
FLOG(INFO) {
sb << "generated bounced message: ";
block::gen::t_Message_Any.print_ref(sb, bp.out_msg);
};
}
out_msgs.push_back(bp.out_msg);
bp.ok = true;
@ -3167,11 +3180,13 @@ bool Transaction::compute_state() {
auto frozen_state = cb2.finalize();
frozen_hash = frozen_state->get_hash().bits();
if (verbosity >= 3 * 1) { // !!!DEBUG!!!
std::cerr << "freezing state of smart contract: ";
block::gen::t_StateInit.print_ref(std::cerr, frozen_state);
FLOG(INFO) {
sb << "freezing state of smart contract: ";
block::gen::t_StateInit.print_ref(sb, frozen_state);
CHECK(block::gen::t_StateInit.validate_ref(frozen_state));
CHECK(block::tlb::t_StateInit.validate_ref(frozen_state));
std::cerr << "with hash " << frozen_hash.to_hex() << std::endl;
sb << "with hash " << frozen_hash.to_hex();
};
}
}
new_code.clear();
@ -3229,8 +3244,10 @@ bool Transaction::compute_state() {
CHECK(cb.append_data_cell_bool(std::move(storage)));
new_total_state = cb.finalize();
if (verbosity > 2) {
std::cerr << "new account state: ";
block::gen::t_Account.print_ref(std::cerr, new_total_state);
FLOG(INFO) {
sb << "new account state: ";
block::gen::t_Account.print_ref(sb, new_total_state);
};
}
CHECK(block::tlb::t_Account.validate_ref(new_total_state));
return true;
@ -3322,22 +3339,28 @@ bool Transaction::serialize() {
return false;
}
if (verbosity >= 3 * 1) {
std::cerr << "new transaction: ";
block::gen::t_Transaction.print_ref(std::cerr, root);
vm::load_cell_slice(root).print_rec(std::cerr);
FLOG(INFO) {
sb << "new transaction: ";
block::gen::t_Transaction.print_ref(sb, root);
vm::load_cell_slice(root).print_rec(sb);
};
}
if (!block::gen::t_Transaction.validate_ref(4096, root)) {
LOG(ERROR) << "newly-generated transaction failed to pass automated validation:";
vm::load_cell_slice(root).print_rec(std::cerr);
block::gen::t_Transaction.print_ref(std::cerr, root);
FLOG(INFO) {
vm::load_cell_slice(root).print_rec(sb);
block::gen::t_Transaction.print_ref(sb, root);
};
root.clear();
return false;
}
if (!block::tlb::t_Transaction.validate_ref(4096, root)) {
LOG(ERROR) << "newly-generated transaction failed to pass hand-written validation:";
vm::load_cell_slice(root).print_rec(std::cerr);
block::gen::t_Transaction.print_ref(std::cerr, root);
FLOG(INFO) {
vm::load_cell_slice(root).print_rec(sb);
block::gen::t_Transaction.print_ref(sb, root);
};
root.clear();
return false;
}

View file

@ -196,6 +196,13 @@ bool TLB::print_ref(std::ostream& os, Ref<vm::Cell> cell_ref, int indent, int re
return pp.fail_unless(print_ref(pp, std::move(cell_ref)));
}
bool TLB::print_ref(td::StringBuilder& sb, Ref<vm::Cell> cell_ref, int indent, int rec_limit) const {
std::ostringstream ss;
auto result = print_ref(ss, std::move(cell_ref), indent, rec_limit);
sb << ss.str();
return result;
}
std::string TLB::as_string_skip(vm::CellSlice& cs, int indent) const {
std::ostringstream os;
print_skip(os, cs, indent);

View file

@ -246,7 +246,14 @@ class TLB {
bool print(std::ostream& os, Ref<vm::CellSlice> cs_ref, int indent = 0, int rec_limit = 0) const {
return print(os, *cs_ref, indent, rec_limit);
}
bool print(td::StringBuilder& sb, Ref<vm::CellSlice> cs_ref, int indent = 0, int rec_limit = 0) const {
std::ostringstream ss;
auto result = print(ss, *cs_ref, indent, rec_limit);
sb << ss.str();
return result;
}
bool print_ref(std::ostream& os, Ref<vm::Cell> cell_ref, int indent = 0, int rec_limit = 0) const;
bool print_ref(td::StringBuilder& sb, Ref<vm::Cell> cell_ref, int indent = 0, int rec_limit = 0) const;
bool print_ref(int rec_limit, std::ostream& os, Ref<vm::Cell> cell_ref, int indent = 0) const {
return print_ref(os, std::move(cell_ref), indent, rec_limit);
}

View file

@ -1026,6 +1026,13 @@ bool CellSlice::print_rec(std::ostream& os, int indent) const {
return print_rec(os, &limit, indent);
}
bool CellSlice::print_rec(td::StringBuilder& sb, int indent) const {
std::ostringstream ss;
auto result = print_rec(ss, indent);
sb << ss.str();
return result;
}
bool CellSlice::print_rec(int limit, std::ostream& os, int indent) const {
return print_rec(os, &limit, indent);
}

View file

@ -257,6 +257,7 @@ class CellSlice : public td::CntObject {
void dump(std::ostream& os, int level = 0, bool endl = true) const;
void dump_hex(std::ostream& os, int mode = 0, bool endl = false) const;
bool print_rec(std::ostream& os, int indent = 0) const;
bool print_rec(td::StringBuilder& sb, int indent = 0) const;
bool print_rec(std::ostream& os, int* limit, int indent = 0) const;
bool print_rec(int limit, std::ostream& os, int indent = 0) const;
void error() const {

View file

@ -264,8 +264,8 @@ class Logger {
sb_ << other;
return *this;
}
LambdaPrintHelper<td::Logger> operator<<(const LambdaPrint &) {
return LambdaPrintHelper<td::Logger>{*this};
LambdaPrintHelper<td::StringBuilder> operator<<(const LambdaPrint &) {
return LambdaPrintHelper<td::StringBuilder>{sb_};
}
MutableCSlice as_cslice() {

View file

@ -308,8 +308,11 @@ bool AcceptBlockQuery::create_new_proof() {
}
// 10. check resulting object
if (!block::gen::t_BlockProof.validate_ref(bs_cell)) {
block::gen::t_BlockProof.print_ref(std::cerr, bs_cell);
vm::load_cell_slice(bs_cell).print_rec(std::cerr);
FLOG(WARNING) {
sb << "BlockProof object just created failed to pass automated consistency checks: ";
block::gen::t_BlockProof.print_ref(sb, bs_cell);
vm::load_cell_slice(bs_cell).print_rec(sb);
};
return fatal_error("BlockProof object just created failed to pass automated consistency checks");
}
// 11. create a proof object from this cell
@ -851,15 +854,12 @@ bool AcceptBlockQuery::create_top_shard_block_description() {
&& (root.is_null() || cb.store_ref_bool(std::move(root))) && cb.finalize_to(td_cell))) {
return fatal_error("cannot serialize ShardTopBlockDescription for the newly-accepted block "s + id_.to_str());
}
if (false) {
// debug output
std::cerr << "new ShardTopBlockDescription: ";
block::gen::t_TopBlockDescr.print_ref(std::cerr, td_cell);
vm::load_cell_slice(td_cell).print_rec(std::cerr);
}
if (!block::gen::t_TopBlockDescr.validate_ref(td_cell)) {
block::gen::t_TopBlockDescr.print_ref(std::cerr, td_cell);
vm::load_cell_slice(td_cell).print_rec(std::cerr);
FLOG(WARNING) {
sb << "just created ShardTopBlockDescription is invalid: ";
block::gen::t_TopBlockDescr.print_ref(sb, td_cell);
vm::load_cell_slice(td_cell).print_rec(sb);
};
return fatal_error("just created ShardTopBlockDescription for "s + id_.to_str() + " is invalid");
}
auto res = vm::std_boc_serialize(td_cell, 0);

View file

@ -53,16 +53,6 @@ static constexpr int HIGH_PRIORITY_EXTERNAL = 10; // don't skip high priority e
static constexpr int MAX_ATTEMPTS = 5;
#define DBG(__n) dbg(__n)&&
#define DSTART int __dcnt = 0;
#define DEB DBG(++__dcnt)
static inline bool dbg(int c) TD_UNUSED;
static inline bool dbg(int c) {
std::cerr << '[' << (char)('0' + c / 10) << (char)('0' + c % 10) << ']';
return true;
}
/**
* Constructs a Collator object.
*
@ -761,8 +751,6 @@ bool Collator::unpack_last_mc_state() {
<< " (upgrade validator software?)";
}
// TODO: extract start_lt and end_lt from prev_mc_block as well
// std::cerr << " block::gen::ShardState::print_ref(mc_state_root) = ";
// block::gen::t_ShardState.print_ref(std::cerr, mc_state_root, 2);
return true;
}
@ -888,8 +876,10 @@ void Collator::got_neighbor_out_queue(int i, td::Result<Ref<MessageQueue>> res)
// 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) {
@ -1756,9 +1746,11 @@ bool Collator::import_new_shard_top_blocks() {
shard_conf_adjusted_ = true;
}
if (tb_act && verbosity >= 0) { // DEBUG
LOG(INFO) << "updated shard block configuration to ";
FLOG(INFO) {
sb << "updated shard block configuration to ";
auto csr = shard_conf_->get_root_csr();
block::gen::t_ShardHashes.print(std::cerr, csr.write());
block::gen::t_ShardHashes.print(sb, csr);
};
}
block::gen::ShardFeeCreated::Record fc;
if (!(tlb::csr_unpack(fees_import_dict_->get_root_extra(),
@ -2279,10 +2271,12 @@ bool Collator::dequeue_message(Ref<vm::Cell> msg_envelope, ton::LogicalTime deli
bool Collator::out_msg_queue_cleanup() {
LOG(INFO) << "cleaning outbound queue from messages already imported by neighbors";
if (verbosity >= 2) {
FLOG(INFO) {
auto rt = out_msg_queue_->get_root();
std::cerr << "old out_msg_queue is ";
block::gen::t_OutMsgQueue.print(std::cerr, *rt);
rt->print_rec(std::cerr);
sb << "old out_msg_queue is ";
block::gen::t_OutMsgQueue.print(sb, rt);
rt->print_rec(sb);
};
}
if (after_merge_) {
@ -2422,10 +2416,12 @@ bool Collator::out_msg_queue_cleanup() {
<< out_msg_queue_size_;
}
if (verbosity >= 2) {
FLOG(INFO) {
auto rt = out_msg_queue_->get_root();
std::cerr << "new out_msg_queue is ";
block::gen::t_OutMsgQueue.print(std::cerr, *rt);
rt->print_rec(std::cerr);
sb << "new out_msg_queue is ";
block::gen::t_OutMsgQueue.print(sb, rt);
rt->print_rec(sb);
};
}
return register_out_msg_queue_op(true);
}
@ -2524,19 +2520,27 @@ bool Collator::combine_account_transactions() {
auto cell = cb.finalize();
auto csr = vm::load_cell_slice_ref(cell);
if (verbosity > 2) {
std::cerr << "new AccountBlock for " << z.first.to_hex() << ": ";
block::gen::t_AccountBlock.print_ref(std::cerr, cell);
csr->print_rec(std::cerr);
FLOG(INFO) {
sb << "new AccountBlock for " << z.first.to_hex() << ": ";
block::gen::t_AccountBlock.print_ref(sb, cell);
csr->print_rec(sb);
};
}
if (!block::gen::t_AccountBlock.validate_ref(100000, cell)) {
block::gen::t_AccountBlock.print_ref(std::cerr, cell);
csr->print_rec(std::cerr);
FLOG(WARNING) {
sb << "AccountBlock failed to pass automatic validation tests: ";
block::gen::t_AccountBlock.print_ref(sb, cell);
csr->print_rec(sb);
};
return fatal_error(std::string{"new AccountBlock for "} + z.first.to_hex() +
" failed to pass automatic validation tests");
}
if (!block::tlb::t_AccountBlock.validate_ref(100000, cell)) {
block::gen::t_AccountBlock.print_ref(std::cerr, cell);
csr->print_rec(std::cerr);
FLOG(WARNING) {
sb << "AccountBlock failed to pass handwritten validation tests: ";
block::gen::t_AccountBlock.print_ref(sb, cell);
csr->print_rec(sb);
};
return fatal_error(std::string{"new AccountBlock for "} + z.first.to_hex() +
" failed to pass handwritten validation tests");
}
@ -2561,8 +2565,10 @@ bool Collator::combine_account_transactions() {
} else if (acc.status == block::Account::acc_nonexist) {
// account deleted
if (verbosity > 2) {
std::cerr << "deleting account " << acc.addr.to_hex() << " with empty new value ";
block::gen::t_Account.print_ref(std::cerr, acc.total_state);
FLOG(INFO) {
sb << "deleting account " << acc.addr.to_hex() << " with empty new value ";
block::gen::t_Account.print_ref(sb, acc.total_state);
};
}
if (account_dict->lookup_delete(acc.addr).is_null()) {
return fatal_error(std::string{"cannot delete account "} + acc.addr.to_hex() + " from ShardAccounts");
@ -2570,8 +2576,10 @@ bool Collator::combine_account_transactions() {
} else {
// existing account modified
if (verbosity > 4) {
std::cerr << "modifying account " << acc.addr.to_hex() << " to ";
block::gen::t_Account.print_ref(std::cerr, acc.total_state);
FLOG(INFO) {
sb << "modifying account " << acc.addr.to_hex() << " to ";
block::gen::t_Account.print_ref(sb, acc.total_state);
};
}
if (!(cb.store_ref_bool(acc.total_state) // account_descr$_ account:^Account
&& cb.store_bits_bool(acc.last_trans_hash_) // last_trans_hash:bits256
@ -2594,9 +2602,11 @@ bool Collator::combine_account_transactions() {
return fatal_error("cannot serialize ShardAccountBlocks");
}
if (verbosity > 2) {
std::cerr << "new ShardAccountBlocks: ";
block::gen::t_ShardAccountBlocks.print_ref(std::cerr, shard_account_blocks_);
vm::load_cell_slice(shard_account_blocks_).print_rec(std::cerr);
FLOG(INFO) {
sb << "new ShardAccountBlocks: ";
block::gen::t_ShardAccountBlocks.print_ref(sb, shard_account_blocks_);
vm::load_cell_slice(shard_account_blocks_).print_rec(sb);
};
}
if (!block::gen::t_ShardAccountBlocks.validate_ref(100000, shard_account_blocks_)) {
return fatal_error("new ShardAccountBlocks failed to pass automatic validity tests");
@ -2606,9 +2616,11 @@ bool Collator::combine_account_transactions() {
}
auto shard_accounts = account_dict->get_root();
if (verbosity > 2) {
std::cerr << "new ShardAccounts: ";
block::gen::t_ShardAccounts.print(std::cerr, *shard_accounts);
shard_accounts->print_rec(std::cerr);
FLOG(INFO) {
sb << "new ShardAccounts: ";
block::gen::t_ShardAccounts.print(sb, shard_accounts);
shard_accounts->print_rec(sb);
};
}
if (verify >= 2) {
LOG(INFO) << "verifying new ShardAccounts";
@ -2659,7 +2671,9 @@ bool Collator::create_special_transaction(block::CurrencyCollection amount, Ref<
addr.to_hex());
}
if (verbosity >= 4) {
block::gen::t_Message_Any.print_ref(std::cerr, msg);
FLOG(INFO) {
block::gen::t_Message_Any.print_ref(sb, msg);
};
}
CHECK(block::gen::t_Message_Any.validate_ref(msg));
CHECK(block::tlb::t_Message.validate_ref(msg));
@ -3163,8 +3177,10 @@ int Collator::process_one_new_message(block::NewOutMsg msg, bool enqueue_only, R
Ref<vm::Cell> msg_env;
CHECK(block::tlb::pack_cell(msg_env, msg_env_rec));
if (verbosity > 2) {
std::cerr << "new (processed outbound) message envelope: ";
block::gen::t_MsgEnvelope.print_ref(std::cerr, msg_env);
FLOG(INFO) {
sb << "new (processed outbound) message envelope: ";
block::gen::t_MsgEnvelope.print_ref(sb, msg_env);
};
}
// 3. create InMsg, referring to this MsgEnvelope and this Transaction
vm::CellBuilder cb;
@ -3286,16 +3302,20 @@ bool Collator::enqueue_transit_message(Ref<vm::Cell> msg, Ref<vm::Cell> old_msg_
Ref<vm::Cell> out_msg = cb.finalize();
// 4.1. insert OutMsg into OutMsgDescr
if (verbosity > 2) {
std::cerr << "OutMsg for a transit message: ";
block::gen::t_OutMsg.print_ref(std::cerr, out_msg);
FLOG(INFO) {
sb << "OutMsg for a transit message: ";
block::gen::t_OutMsg.print_ref(sb, out_msg);
};
}
if (!insert_out_msg(out_msg)) {
return fatal_error("cannot insert a new OutMsg into OutMsgDescr");
}
// 4.2. insert InMsg into InMsgDescr
if (verbosity > 2) {
std::cerr << "InMsg for a transit message: ";
block::gen::t_InMsg.print_ref(std::cerr, in_msg);
FLOG(INFO) {
sb << "InMsg for a transit message: ";
block::gen::t_InMsg.print_ref(sb, in_msg);
};
}
if (!insert_in_msg(in_msg)) {
return fatal_error("cannot insert a new InMsg into InMsgDescr");
@ -3366,7 +3386,10 @@ bool Collator::process_inbound_message(Ref<vm::CellSlice> enq_msg, ton::LogicalT
if (enq_msg.is_null() || enq_msg->size_ext() != 0x10040 ||
(enqueued_lt = enq_msg->prefetch_ulong(64)) < /* 0 */ 1 * lt) { // DEBUG
if (enq_msg.not_null()) {
block::gen::t_EnqueuedMsg.print(std::cerr, *enq_msg);
FLOG(WARNING) {
sb << "inbound internal message is not a valid EnqueuedMsg: ";
block::gen::t_EnqueuedMsg.print(sb, enq_msg);
};
}
LOG(ERROR) << "inbound internal message is not a valid EnqueuedMsg (created lt " << lt << ", enqueued "
<< enqueued_lt << ")";
@ -3590,14 +3613,18 @@ bool Collator::process_inbound_internal_messages() {
LOG(DEBUG) << "processing inbound message with (lt,hash)=(" << kv->lt << "," << kv->key.to_hex()
<< ") from neighbor #" << kv->source;
if (verbosity > 2) {
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);
};
}
if (!process_inbound_message(kv->msg, kv->lt, kv->key.cbits(), neighbors_.at(kv->source))) {
if (verbosity > 1) {
std::cerr << "invalid inbound message: lt=" << kv->lt << " from=" << kv->source << " key=" << kv->key.to_hex()
FLOG(INFO) {
sb << "invalid inbound message: lt=" << kv->lt << " from=" << kv->source << " key=" << kv->key.to_hex()
<< " msg=";
block::gen::t_EnqueuedMsg.print(std::cerr, *(kv->msg));
block::gen::t_EnqueuedMsg.print(sb, kv->msg);
};
}
return fatal_error("error processing inbound internal message");
}
@ -3884,7 +3911,10 @@ bool Collator::process_deferred_message(Ref<vm::CellSlice> enq_msg, StdSmcAddres
LogicalTime enqueued_lt = 0;
if (enq_msg.is_null() || enq_msg->size_ext() != 0x10040 || (enqueued_lt = enq_msg->prefetch_ulong(64)) != lt) {
if (enq_msg.not_null()) {
block::gen::t_EnqueuedMsg.print(std::cerr, *enq_msg);
FLOG(WARNING) {
sb << "internal message in DispatchQueue is not a valid EnqueuedMsg: ";
block::gen::t_EnqueuedMsg.print(sb, enq_msg);
};
}
LOG(ERROR) << "internal message in DispatchQueue is not a valid EnqueuedMsg (created lt " << lt << ", enqueued "
<< enqueued_lt << ")";
@ -3986,8 +4016,10 @@ bool Collator::process_deferred_message(Ref<vm::CellSlice> enq_msg, StdSmcAddres
*/
bool Collator::insert_in_msg(Ref<vm::Cell> in_msg) {
if (verbosity > 2) {
std::cerr << "InMsg being inserted into InMsgDescr: ";
block::gen::t_InMsg.print_ref(std::cerr, in_msg);
FLOG(INFO) {
sb << "InMsg being inserted into InMsgDescr: ";
block::gen::t_InMsg.print_ref(sb, in_msg);
};
}
auto cs = load_cell_slice(in_msg);
if (!cs.size_refs()) {
@ -4028,8 +4060,10 @@ bool Collator::insert_in_msg(Ref<vm::Cell> in_msg) {
*/
bool Collator::insert_out_msg(Ref<vm::Cell> out_msg) {
if (verbosity > 2) {
std::cerr << "OutMsg being inserted into OutMsgDescr: ";
block::gen::t_OutMsg.print_ref(std::cerr, out_msg);
FLOG(INFO) {
sb << "OutMsg being inserted into OutMsgDescr: ";
block::gen::t_OutMsg.print_ref(sb, out_msg);
};
}
auto cs = load_cell_slice(out_msg);
if (!cs.size_refs()) {
@ -4125,8 +4159,10 @@ bool Collator::enqueue_message(block::NewOutMsg msg, td::RefInt256 fwd_fees_rema
}
// 4. insert OutMsg into OutMsgDescr
if (verbosity > 2) {
std::cerr << "OutMsg for a newly-generated message: ";
block::gen::t_OutMsg.print_ref(std::cerr, out_msg);
FLOG(INFO) {
sb << "OutMsg for a newly-generated message: ";
block::gen::t_OutMsg.print_ref(sb, out_msg);
};
}
if (!insert_out_msg(out_msg)) {
return fatal_error("cannot insert a new OutMsg into OutMsgDescr");
@ -4419,9 +4455,12 @@ bool Collator::create_mc_state_extra() {
bool ignore_cfg_changes = false;
Ref<vm::Cell> cfg0;
if (!block::valid_config_data(cfg_smc_config, config_addr, true, true, old_mparams_)) {
block::gen::t_Hashmap_32_Ref_Cell.print_ref(std::cerr, cfg_smc_config);
LOG(ERROR) << "configuration smart contract "s + config_addr.to_hex() +
" contains an invalid configuration in its data, IGNORING CHANGES";
FLOG(WARNING) {
sb << "ignored configuration: ";
block::gen::t_Hashmap_32_Ref_Cell.print_ref(sb, cfg_smc_config);
};
ignore_cfg_changes = true;
} else {
cfg0 = cfg_dict.lookup_ref(td::BitArray<32>{(long long)0});
@ -4459,34 +4498,26 @@ bool Collator::create_mc_state_extra() {
return fatal_error(wset_res.move_as_error());
}
bool update_shard_cc = is_key_block_ || (now_ / ccvc.shard_cc_lifetime > prev_now_ / ccvc.shard_cc_lifetime);
// temp debug
if (verbosity >= 3 * 1) {
auto csr = shard_conf_->get_root_csr();
LOG(INFO) << "new shard configuration before post-processing is";
std::ostringstream os;
csr->print_rec(os);
block::gen::t_ShardHashes.print(os, csr.write());
LOG(INFO) << os.str();
}
// end (temp debug)
if (!update_shard_config(wset_res.move_as_ok(), ccvc, update_shard_cc)) {
auto csr = shard_conf_->get_root_csr();
if (csr.is_null()) {
LOG(WARNING) << "new shard configuration is null (!)";
} else {
LOG(WARNING) << "invalid new shard configuration is";
std::ostringstream os;
csr->print_rec(os);
block::gen::t_ShardHashes.print(os, csr.write());
LOG(WARNING) << os.str();
FLOG(WARNING) {
csr->print_rec(sb);
block::gen::t_ShardHashes.print(sb, csr);
};
}
return fatal_error("cannot post-process shard configuration");
}
// 3. save new shard_hashes
state_extra.shard_hashes = shard_conf_->get_root_csr();
if (verbosity >= 3 * 0) { // DEBUG
std::cerr << "updated shard configuration to ";
block::gen::t_ShardHashes.print(std::cerr, *state_extra.shard_hashes);
if (verbosity >= 3) {
FLOG(INFO) {
sb << "updated shard configuration to ";
block::gen::t_ShardHashes.print(sb, state_extra.shard_hashes);
};
}
if (!block::gen::t_ShardHashes.validate_upto(10000, *state_extra.shard_hashes)) {
return fatal_error("new ShardHashes is invalid");
@ -4587,13 +4618,18 @@ bool Collator::create_mc_state_extra() {
if (verify >= 2) {
LOG(INFO) << "verifying new BlockCreateStats";
if (!block::gen::t_BlockCreateStats.validate_csr(100000, cs)) {
cs->print_rec(std::cerr);
block::gen::t_BlockCreateStats.print(std::cerr, *cs);
FLOG(WARNING) {
sb << "BlockCreateStats in the new masterchain state failed to pass automated validity checks: ";
cs->print_rec(sb);
block::gen::t_BlockCreateStats.print(sb, cs);
};
return fatal_error("BlockCreateStats in the new masterchain state failed to pass automated validity checks");
}
}
if (verbosity >= 4 * 1) {
block::gen::t_BlockCreateStats.print(std::cerr, *cs);
FLOG(INFO) {
block::gen::t_BlockCreateStats.print(sb, cs);
};
}
} else {
state_extra.r1.block_create_stats.clear();
@ -4628,7 +4664,6 @@ bool Collator::update_block_creator_count(td::ConstBitPtr key, unsigned shard_in
if (!block::unpack_CreatorStats(std::move(cs), mc_cnt, shard_cnt)) {
return fatal_error("cannot unpack CreatorStats for "s + key.to_hex(256) + " from previous masterchain state");
}
// std::cerr << mc_cnt.to_str() << " " << shard_cnt.to_str() << std::endl;
if (mc_incr && !mc_cnt.increase_by(mc_incr, now_)) {
return fatal_error(PSTRING() << "cannot increase masterchain block counter in CreatorStats for " << key.to_hex(256)
<< " by " << mc_incr << " (old value is " << mc_cnt.to_str() << ")");
@ -4999,9 +5034,11 @@ bool Collator::update_public_libraries() {
}
}
if (libraries_changed_ && verbosity >= 2) {
std::cerr << "New public libraries: ";
block::gen::t_HashmapE_256_LibDescr.print(std::cerr, shard_libraries_->get_root());
shard_libraries_->get_root()->print_rec(std::cerr);
FLOG(INFO) {
sb << "New public libraries: ";
block::gen::t_HashmapE_256_LibDescr.print(sb, shard_libraries_->get_root());
shard_libraries_->get_root()->print_rec(sb);
};
}
return true;
}
@ -5124,9 +5161,11 @@ bool Collator::create_shard_state() {
}
LOG(DEBUG) << "min_ref_mc_seqno is " << min_ref_mc_seqno_;
if (verbosity > 2) {
std::cerr << "new ShardState: ";
block::gen::t_ShardState.print_ref(std::cerr, state_root);
vm::load_cell_slice(state_root).print_rec(std::cerr);
FLOG(INFO) {
sb << "new ShardState: ";
block::gen::t_ShardState.print_ref(sb, state_root);
vm::load_cell_slice(state_root).print_rec(sb);
};
}
if (verify >= 2) {
LOG(INFO) << "verifying new ShardState";
@ -5139,9 +5178,11 @@ bool Collator::create_shard_state() {
return fatal_error("cannot create Merkle update for ShardState");
}
if (verbosity > 2) {
std::cerr << "Merkle Update for ShardState: ";
FLOG(INFO) {
sb << "Merkle Update for ShardState: ";
vm::CellSlice cs{vm::NoVm{}, state_update};
cs.print_rec(std::cerr);
cs.print_rec(sb);
};
}
LOG(INFO) << "updating block profile statistics";
block_limit_status_->add_proof(state_root);
@ -5186,10 +5227,12 @@ bool Collator::update_processed_upto() {
*/
bool Collator::compute_out_msg_queue_info(Ref<vm::Cell>& out_msg_queue_info) {
if (verbosity >= 2) {
FLOG(INFO) {
auto rt = out_msg_queue_->get_root();
std::cerr << "resulting out_msg_queue is ";
block::gen::t_OutMsgQueue.print(std::cerr, *rt);
rt->print_rec(std::cerr);
sb << "resulting out_msg_queue is ";
block::gen::t_OutMsgQueue.print(sb, rt);
rt->print_rec(sb);
};
}
vm::CellBuilder cb;
// out_msg_queue_extra#0 dispatch_queue:DispatchQueue out_queue_size:(Maybe uint48) = OutMsgQueueExtra;
@ -5239,8 +5282,10 @@ bool Collator::compute_total_balance() {
}
vm::CellSlice cs{*(in_msg_dict->get_root_extra())};
if (verbosity > 2) {
block::gen::t_ImportFees.print(std::cerr, vm::CellSlice{*(in_msg_dict->get_root_extra())});
cs.print_rec(std::cerr);
FLOG(INFO) {
block::gen::t_ImportFees.print(sb, in_msg_dict->get_root_extra());
cs.print_rec(sb);
};
}
auto new_import_fees = block::tlb::t_Grams.as_integer_skip(cs);
if (new_import_fees.is_null()) {
@ -5468,9 +5513,11 @@ bool Collator::create_block() {
return fatal_error("cannot create new Block");
}
if (verbosity >= 3 * 1) {
std::cerr << "new Block: ";
block::gen::t_Block.print_ref(std::cerr, new_block);
vm::load_cell_slice(new_block).print_rec(std::cerr);
FLOG(INFO) {
sb << "new Block: ";
block::gen::t_Block.print_ref(sb, new_block);
vm::load_cell_slice(new_block).print_rec(sb);
};
}
if (verify >= 1) {
LOG(INFO) << "verifying new Block";
@ -5508,9 +5555,11 @@ Ref<vm::Cell> Collator::collate_shard_block_descr_set() {
return {};
}
if (verbosity >= 4 * 1) {
std::cerr << "serialized TopBlockDescrSet for collated data is: ";
block::gen::t_TopBlockDescrSet.print_ref(std::cerr, cell);
vm::load_cell_slice(cell).print_rec(std::cerr);
FLOG(INFO) {
sb << "serialized TopBlockDescrSet for collated data is: ";
block::gen::t_TopBlockDescrSet.print_ref(sb, cell);
vm::load_cell_slice(cell).print_rec(sb);
};
}
return cell;
}
@ -5717,8 +5766,10 @@ td::Result<bool> Collator::register_external_message_cell(Ref<vm::Cell> ext_msg,
return td::Status::Error("inbound external message has destination address not in this shard");
}
if (verbosity > 2) {
std::cerr << "registered external message: ";
block::gen::t_Message_Any.print_ref(std::cerr, ext_msg);
FLOG(INFO) {
sb << "registered external message: ";
block::gen::t_Message_Any.print_ref(sb, ext_msg);
};
}
ext_msg_map.emplace(hash, 1);
ext_msg_list_.push_back({std::move(ext_msg), ext_hash, priority});

View file

@ -42,9 +42,6 @@ td::BufferSlice BlockSignatureSetQ::serialize() const {
}
Ref<vm::Cell> root;
CHECK(serialize_to(root));
//std::cerr << "serializing BlockSignatureSet: ";
//vm::CellSlice{vm::NoVm{}, root}.print_rec(std::cerr);
//std::cerr << std::endl;
auto res = vm::std_boc_serialize(std::move(root));
LOG_CHECK(res.is_ok()) << res.move_as_error();
return res.move_as_ok();

View file

@ -175,9 +175,11 @@ td::Status ShardTopBlockDescrQ::unpack() {
block::gen::TopBlockDescr::Record rec;
if (!(block::gen::t_TopBlockDescr.force_validate_ref(root_) && tlb::unpack_cell(root_, rec) &&
block::tlb::t_BlockIdExt.unpack(rec.proof_for.write(), block_id_))) {
std::cerr << "invalid ShardTopBlockDescr: ";
block::gen::t_TopBlockDescr.print_ref(std::cerr, root_);
vm::load_cell_slice(root_).print_rec(std::cerr);
FLOG(INFO) {
sb << "invalid ShardTopBlockDescr: ";
block::gen::t_TopBlockDescr.print_ref(sb, root_);
vm::load_cell_slice(root_).print_rec(sb);
};
return td::Status::Error(-666, "Shard top block description is not a valid TopBlockDescr TL-B object");
}
LOG(DEBUG) << "unpacking a ShardTopBlockDescr for " << block_id_.to_str() << " with " << rec.len << " links";

View file

@ -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;
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(std::cerr, *old_value);
block::gen::t_ShardAccount.print(sb, old_value);
} else {
std::cerr << "<absent>" << std::endl;
sb << "<absent>" << "\n";
}
std::cerr << "state of account " << workchain() << ":" << acc_id.to_hex(256)
<< " in the new shardchain state:" << std::endl;
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(std::cerr, *new_value);
block::gen::t_ShardAccount.print(sb, new_value);
} else {
std::cerr << "<absent>" << std::endl;
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
FLOG(INFO) {
sb << "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));
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()