diff --git a/libraries/chain/apply_context.cpp b/libraries/chain/apply_context.cpp index b2a12a87561..a216e4c15b6 100644 --- a/libraries/chain/apply_context.cpp +++ b/libraries/chain/apply_context.cpp @@ -582,10 +582,6 @@ void apply_context::schedule_deferred_transaction( const uint128_t& sender_id, a } if (auto dm_logger = control.get_deep_mind_logger()) { - fc::datastream ds( ptr->packed_trx.data(), ptr->packed_trx.size() ); - transaction dtrx; - fc::raw::unpack(ds, dtrx); - fc_dlog(*dm_logger, "DTRX_OP MODIFY_CANCEL ${action_id} ${sender} ${sender_id} ${payer} ${published} ${delay} ${expiration} ${trx_id} ${trx}", ("action_id", get_action_id()) ("sender", receiver) @@ -594,8 +590,8 @@ void apply_context::schedule_deferred_transaction( const uint128_t& sender_id, a ("published", ptr->published) ("delay", ptr->delay_until) ("expiration", ptr->expiration) - ("trx_id", dtrx.id()) - ("trx", control.maybe_to_variant_with_abi(dtrx, abi_serializer::create_yield_function(control.get_abi_serializer_max_time()))) + ("trx_id", ptr->trx_id) + ("trx", fc::to_hex(ptr->packed_trx.data(), ptr->packed_trx.size())) ); } @@ -626,7 +622,7 @@ void apply_context::schedule_deferred_transaction( const uint128_t& sender_id, a ("delay", gtx.delay_until) ("expiration", gtx.expiration) ("trx_id", trx.id()) - ("trx", control.maybe_to_variant_with_abi(trx, abi_serializer::create_yield_function(control.get_abi_serializer_max_time()))) + ("trx", fc::to_hex(gtx.packed_trx.data(), gtx.packed_trx.size())) ); } } ); @@ -654,8 +650,8 @@ void apply_context::schedule_deferred_transaction( const uint128_t& sender_id, a ("published", gtx.published) ("delay", gtx.delay_until) ("expiration", gtx.expiration) - ("trx_id", trx.id()) - ("trx", control.maybe_to_variant_with_abi(trx, abi_serializer::create_yield_function(control.get_abi_serializer_max_time()))) + ("trx_id", gtx.trx_id) + ("trx", fc::to_hex(gtx.packed_trx.data(), gtx.packed_trx.size())) ); } } ); @@ -678,10 +674,6 @@ bool apply_context::cancel_deferred_transaction( const uint128_t& sender_id, acc if ( gto ) { std::string event_id; if (auto dm_logger = control.get_deep_mind_logger()) { - fc::datastream ds( gto->packed_trx.data(), gto->packed_trx.size() ); - transaction dtrx; - fc::raw::unpack(ds, dtrx); - event_id = STORAGE_EVENT_ID("${id}", ("id", gto->id)); fc_dlog(*dm_logger, "DTRX_OP CANCEL ${action_id} ${sender} ${sender_id} ${payer} ${published} ${delay} ${expiration} ${trx_id} ${trx}", @@ -692,8 +684,8 @@ bool apply_context::cancel_deferred_transaction( const uint128_t& sender_id, acc ("published", gto->published) ("delay", gto->delay_until) ("expiration", gto->expiration) - ("trx_id", dtrx.id()) - ("trx", control.maybe_to_variant_with_abi(dtrx, abi_serializer::create_yield_function(control.get_abi_serializer_max_time()))) + ("trx_id", gto->trx_id) + ("trx", fc::to_hex(gto->packed_trx.data(), gto->packed_trx.size())) ); } diff --git a/libraries/chain/authorization_manager.cpp b/libraries/chain/authorization_manager.cpp index 6e6f10b9a84..1427b3c3bff 100644 --- a/libraries/chain/authorization_manager.cpp +++ b/libraries/chain/authorization_manager.cpp @@ -159,8 +159,9 @@ namespace eosio { namespace chain { p.auth = auth; if (auto dm_logger = _control.get_deep_mind_logger()) { - fc_dlog(*dm_logger, "PERM_OP INS ${action_id} ${data}", + fc_dlog(*dm_logger, "PERM_OP INS ${action_id} ${permission_id} ${data}", ("action_id", action_id) + ("permission_id", p.id) ("data", p) ); } @@ -198,8 +199,9 @@ namespace eosio { namespace chain { p.auth = std::move(auth); if (auto dm_logger = _control.get_deep_mind_logger()) { - fc_dlog(*dm_logger, "PERM_OP INS ${action_id} ${data}", + fc_dlog(*dm_logger, "PERM_OP INS ${action_id} ${permission_id} ${data}", ("action_id", action_id) + ("permission_id", p.id) ("data", p) ); } @@ -224,8 +226,9 @@ namespace eosio { namespace chain { po.last_updated = _control.pending_block_time(); if (auto dm_logger = _control.get_deep_mind_logger()) { - fc_dlog(*dm_logger, "PERM_OP UPD ${action_id} ${data}", + fc_dlog(*dm_logger, "PERM_OP UPD ${action_id} ${permission_id} ${data}", ("action_id", action_id) + ("permission_id", po.id) ("data", fc::mutable_variant_object() ("old", old_permission) ("new", po) @@ -244,8 +247,9 @@ namespace eosio { namespace chain { _db.get_mutable_index().remove_object( permission.usage_id._id ); if (auto dm_logger = _control.get_deep_mind_logger()) { - fc_dlog(*dm_logger, "PERM_OP REM ${action_id} ${data}", + fc_dlog(*dm_logger, "PERM_OP REM ${action_id} ${permission_id} ${data}", ("action_id", action_id) + ("permission_id", permission.id) ("data", permission) ); } diff --git a/libraries/chain/controller.cpp b/libraries/chain/controller.cpp index 79eae3bc3fd..600547b5583 100644 --- a/libraries/chain/controller.cpp +++ b/libraries/chain/controller.cpp @@ -700,6 +700,26 @@ struct controller_impl { // else no checks needed since fork_db will be completely reset on replay anyway } + if (auto dm_logger = get_deep_mind_logger()) { + // FIXME: We should probably feed that from CMake directly somehow ... + fc_dlog(*dm_logger, "DEEP_MIND_VERSION 13 0"); + + fc_dlog(*dm_logger, "ABIDUMP START ${block_num} ${global_sequence_num}", + ("block_num", head->block_num) + ("global_sequence_num", db.get().global_action_sequence) + ); + const auto& idx = db.get_index(); + for (auto& row : idx.indices()) { + if (row.abi.size() != 0) { + fc_dlog(*dm_logger, "ABIDUMP ABI ${contract} ${abi}", + ("contract", row.name) + ("abi", row.abi) + ); + } + } + fc_dlog(*dm_logger, "ABIDUMP END"); + } + if( last_block_num > head->block_num ) { replay( check_shutdown ); // replay any irreversible and reversible blocks ahead of current head } @@ -894,9 +914,11 @@ struct controller_impl { } if (auto dm_logger = get_deep_mind_logger()) { + auto packed_trx = fc::raw::pack(etrx); + fc_dlog(*dm_logger, "TRX_OP CREATE onerror ${id} ${trx}", ("id", etrx.id()) - ("trx", self.maybe_to_variant_with_abi(etrx, abi_serializer::create_yield_function(self.get_abi_serializer_max_time()))) + ("trx", fc::to_hex(packed_trx)) ); } @@ -2253,9 +2275,11 @@ struct controller_impl { } if (auto dm_logger = get_deep_mind_logger()) { + auto packed_trx = fc::raw::pack(trx); + fc_dlog(*dm_logger, "TRX_OP CREATE onblock ${id} ${trx}", ("id", trx.id()) - ("trx", self.maybe_to_variant_with_abi(trx, abi_serializer::create_yield_function(self.get_abi_serializer_max_time()))) + ("trx", fc::to_hex(packed_trx)) ); } diff --git a/libraries/chain/transaction_context.cpp b/libraries/chain/transaction_context.cpp index 2e2efdee6c1..523fbc6a17a 100644 --- a/libraries/chain/transaction_context.cpp +++ b/libraries/chain/transaction_context.cpp @@ -647,6 +647,7 @@ namespace eosio { namespace chain { if (auto dm_logger = control.get_deep_mind_logger()) { event_id = STORAGE_EVENT_ID("${id}", ("id", gto.id)); + auto packed_signed_trx = fc::raw::pack(packed_trx.to_packed_transaction_v0()->get_signed_transaction()); fc_dlog(*dm_logger, "DTRX_OP PUSH_CREATE ${action_id} ${sender} ${sender_id} ${payer} ${published} ${delay} ${expiration} ${trx_id} ${trx}", ("action_id", get_action_id()) ("sender", gto.sender) @@ -655,8 +656,8 @@ namespace eosio { namespace chain { ("published", gto.published) ("delay", gto.delay_until) ("expiration", gto.expiration) - ("trx_id", trx.id()) - ("trx", control.maybe_to_variant_with_abi(trx, abi_serializer::create_yield_function(control.get_abi_serializer_max_time()))) + ("trx_id", gto.trx_id) + ("trx", fc::to_hex(packed_signed_trx.data(), packed_signed_trx.size())) ); } }); diff --git a/plugins/chain_plugin/chain_plugin.cpp b/plugins/chain_plugin/chain_plugin.cpp index 1b98b322c33..740e84f099d 100644 --- a/plugins/chain_plugin/chain_plugin.cpp +++ b/plugins/chain_plugin/chain_plugin.cpp @@ -1266,9 +1266,11 @@ void chain_plugin::plugin_initialize(const variables_map& options) { my->accepted_block_connection = my->chain->accepted_block.connect( [this]( const block_state_ptr& blk ) { if (auto dm_logger = my->chain->get_deep_mind_logger()) { + auto packed_blk = fc::raw::pack(*blk); + fc_dlog(*dm_logger, "ACCEPTED_BLOCK ${num} ${blk}", ("num", blk->block_num) - ("blk", blk) + ("blk", fc::to_hex(packed_blk)) ); } @@ -1291,9 +1293,11 @@ void chain_plugin::plugin_initialize(const variables_map& options) { my->applied_transaction_connection = my->chain->applied_transaction.connect( [this]( std::tuple t ) { if (auto dm_logger = my->chain->get_deep_mind_logger()) { + auto packed_trace = fc::raw::pack(*std::get<0>(t)); + fc_dlog(*dm_logger, "APPLIED_TRANSACTION ${block} ${traces}", ("block", my->chain->head_block_num() + 1) - ("traces", my->chain->maybe_to_variant_with_abi(std::get<0>(t), abi_serializer::create_yield_function(my->chain->get_abi_serializer_max_time()))) + ("traces", fc::to_hex(packed_trace)) ); }