Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
sysio::chain::deep_mind_handler Class Reference

#include <deep_mind.hpp>

Classes

struct  deep_mind_config
 

Public Types

enum class  operation_qualifier { none , modify , push }
 

Public Member Functions

void update_config (deep_mind_config config)
 
void update_logger (const std::string &logger_name)
 
void on_startup (chainbase::database &db, uint32_t head_block_num)
 
void on_start_block (uint32_t block_num)
 
void on_accepted_block (const std::shared_ptr< block_state > &bsp)
 
void on_switch_forks (const block_id_type &old_head, const block_id_type &new_head)
 
void on_onerror (const signed_transaction &etrx)
 
void on_onblock (const signed_transaction &trx)
 
void on_start_transaction ()
 
void on_end_transaction ()
 
void on_applied_transaction (uint32_t block_num, const std::shared_ptr< transaction_trace > &trace)
 
void on_add_ram_correction (const account_ram_correction_object &rco, uint64_t delta)
 
void on_preactivate_feature (const protocol_feature &feature)
 
void on_activate_feature (const protocol_feature &feature)
 
void on_input_action ()
 
void on_end_action ()
 
void on_require_recipient ()
 
void on_send_inline ()
 
void on_send_context_free_inline ()
 
void on_cancel_deferred (operation_qualifier qual, const generated_transaction_object &gto)
 
void on_send_deferred (operation_qualifier qual, const generated_transaction_object &gto)
 
void on_create_deferred (operation_qualifier qual, const generated_transaction_object &gto, const packed_transaction &packed_trx)
 
void on_fail_deferred ()
 
void on_create_table (const table_id_object &tid)
 
void on_remove_table (const table_id_object &tid)
 
void on_db_store_i64 (const table_id_object &tid, const key_value_object &kvo)
 
void on_db_update_i64 (const table_id_object &tid, const key_value_object &kvo, account_name payer, const char *buffer, std::size_t buffer_size)
 
void on_db_remove_i64 (const table_id_object &tid, const key_value_object &kvo)
 
void on_init_resource_limits (const resource_limits::resource_limits_config_object &config, const resource_limits::resource_limits_state_object &state)
 
void on_update_resource_limits_config (const resource_limits::resource_limits_config_object &config)
 
void on_update_resource_limits_state (const resource_limits::resource_limits_state_object &state)
 
void on_newaccount_resource_limits (const resource_limits::resource_limits_object &limits, const resource_limits::resource_usage_object &usage)
 
void on_update_account_usage (const resource_limits::resource_usage_object &usage)
 
void on_set_account_limits (const resource_limits::resource_limits_object &limits)
 
void on_ram_trace (std::string &&event_id, const char *family, const char *operation, const char *legacy_tag)
 
void on_ram_event (account_name account, uint64_t new_usage, int64_t delta)
 
void on_create_permission (const permission_object &p)
 
void on_modify_permission (const permission_object &old_permission, const permission_object &new_permission)
 
void on_remove_permission (const permission_object &permission)
 

Detailed Description

Definition at line 45 of file deep_mind.hpp.

Member Enumeration Documentation

◆ operation_qualifier

Member Function Documentation

◆ on_accepted_block()

void sysio::chain::deep_mind_handler::on_accepted_block ( const std::shared_ptr< block_state > & bsp)

Definition at line 74 of file deep_mind.cpp.

75 {
76 auto packed_blk = fc::raw::pack(*bsp);
77
78 fc_dlog(_logger, "ACCEPTED_BLOCK ${num} ${blk}",
79 ("num", bsp->block_num)
80 ("blk", fc::to_hex(packed_blk))
81 );
82 }
#define fc_dlog(LOGGER, FORMAT,...)
Definition logger.hpp:77
void pack(Stream &s, const std::deque< T > &value)
Definition raw.hpp:531
fc::string to_hex(const char *d, uint32_t s)
Definition hex.cpp:17
Here is the call graph for this function:

◆ on_activate_feature()

void sysio::chain::deep_mind_handler::on_activate_feature ( const protocol_feature & feature)

Definition at line 162 of file deep_mind.cpp.

163 {
164 fc_dlog(_logger, "FEATURE_OP ACTIVATE ${feature_digest} ${feature}",
165 ("feature_digest", feature.feature_digest)
166 ("feature", feature.to_variant())
167 );
168 }

◆ on_add_ram_correction()

void sysio::chain::deep_mind_handler::on_add_ram_correction ( const account_ram_correction_object & rco,
uint64_t delta )

Definition at line 141 of file deep_mind.cpp.

142 {
143 fc_dlog(_logger, "RAM_CORRECTION_OP ${action_id} ${correction_id} ${event_id} ${payer} ${delta}",
144 ("action_id", _action_id)
145 ("correction_id", rco.id._id)
146 ("event_id", _ram_trace.event_id)
147 ("payer", rco.name)
148 ("delta", delta)
149 );
150 _ram_trace = ram_trace();
151 }

◆ on_applied_transaction()

void sysio::chain::deep_mind_handler::on_applied_transaction ( uint32_t block_num,
const std::shared_ptr< transaction_trace > & trace )

Definition at line 122 of file deep_mind.cpp.

123 {
124 std::vector<char> packed_trace;
125
126 if (_config.zero_elapsed) {
127 transaction_trace trace_copy = *trace;
128 set_trace_elapsed_to_zero(trace_copy);
129 packed_trace = fc::raw::pack(trace_copy);
130
131 } else {
132 packed_trace = fc::raw::pack(*trace);
133 }
134
135 fc_dlog(_logger, "APPLIED_TRANSACTION ${block} ${traces}",
136 ("block", block_num)
137 ("traces", fc::to_hex(packed_trace))
138 );
139 }
Here is the call graph for this function:

◆ on_cancel_deferred()

void sysio::chain::deep_mind_handler::on_cancel_deferred ( operation_qualifier qual,
const generated_transaction_object & gto )

Definition at line 198 of file deep_mind.cpp.

199 {
200 fc_dlog(_logger, "DTRX_OP ${qual}CANCEL ${action_id} ${sender} ${sender_id} ${payer} ${published} ${delay} ${expiration} ${trx_id} ${trx}",
201 ("qual", prefix(qual))
202 ("action_id", _action_id)
203 ("sender", gto.sender)
204 ("sender_id", gto.sender_id)
205 ("payer", gto.payer)
206 ("published", gto.published)
207 ("delay", gto.delay_until)
208 ("expiration", gto.expiration)
209 ("trx_id", gto.trx_id)
210 ("trx", fc::to_hex(gto.packed_trx.data(), gto.packed_trx.size()))
211 );
212 }
Here is the call graph for this function:

◆ on_create_deferred()

void sysio::chain::deep_mind_handler::on_create_deferred ( operation_qualifier qual,
const generated_transaction_object & gto,
const packed_transaction & packed_trx )

Definition at line 228 of file deep_mind.cpp.

229 {
230 auto packed_signed_trx = fc::raw::pack(packed_trx.get_signed_transaction());
231
232 fc_dlog(_logger, "DTRX_OP ${qual}CREATE ${action_id} ${sender} ${sender_id} ${payer} ${published} ${delay} ${expiration} ${trx_id} ${trx}",
233 ("qual", prefix(qual))
234 ("action_id", _action_id)
235 ("sender", gto.sender)
236 ("sender_id", gto.sender_id)
237 ("payer", gto.payer)
238 ("published", gto.published)
239 ("delay", gto.delay_until)
240 ("expiration", gto.expiration)
241 ("trx_id", gto.trx_id)
242 ("trx", fc::to_hex(packed_signed_trx.data(), packed_signed_trx.size()))
243 );
244 }
Here is the call graph for this function:

◆ on_create_permission()

void sysio::chain::deep_mind_handler::on_create_permission ( const permission_object & p)

Definition at line 370 of file deep_mind.cpp.

371 {
372 fc_dlog(_logger, "PERM_OP INS ${action_id} ${permission_id} ${data}",
373 ("action_id", _action_id)
374 ("permission_id", p.id)
375 ("data", p)
376 );
377 }
const mie::Vuint & p
Definition bn.cpp:27

◆ on_create_table()

void sysio::chain::deep_mind_handler::on_create_table ( const table_id_object & tid)

Definition at line 251 of file deep_mind.cpp.

252 {
253 fc_dlog(_logger, "TBL_OP INS ${action_id} ${code} ${scope} ${table} ${payer}",
254 ("action_id", _action_id)
255 ("code", tid.code)
256 ("scope", tid.scope)
257 ("table", tid.table)
258 ("payer", tid.payer)
259 );
260 }

◆ on_db_remove_i64()

void sysio::chain::deep_mind_handler::on_db_remove_i64 ( const table_id_object & tid,
const key_value_object & kvo )

Definition at line 297 of file deep_mind.cpp.

298 {
299 fc_dlog(_logger, "DB_OP REM ${action_id} ${payer} ${table_code} ${scope} ${table_name} ${primkey} ${odata}",
300 ("action_id", _action_id)
301 ("payer", kvo.payer)
302 ("table_code", tid.code)
303 ("scope", tid.scope)
304 ("table_name", tid.table)
305 ("primkey", name(kvo.primary_key))
306 ("odata", fc::to_hex(kvo.value.data(), kvo.value.size()))
307 );
308 }
std::string name
Here is the call graph for this function:

◆ on_db_store_i64()

void sysio::chain::deep_mind_handler::on_db_store_i64 ( const table_id_object & tid,
const key_value_object & kvo )

Definition at line 271 of file deep_mind.cpp.

272 {
273 fc_dlog(_logger, "DB_OP INS ${action_id} ${payer} ${table_code} ${scope} ${table_name} ${primkey} ${ndata}",
274 ("action_id", _action_id)
275 ("payer", kvo.payer)
276 ("table_code", tid.code)
277 ("scope", tid.scope)
278 ("table_name", tid.table)
279 ("primkey", name(kvo.primary_key))
280 ("ndata", fc::to_hex(kvo.value.data(), kvo.value.size()))
281 );
282 }
Here is the call graph for this function:

◆ on_db_update_i64()

void sysio::chain::deep_mind_handler::on_db_update_i64 ( const table_id_object & tid,
const key_value_object & kvo,
account_name payer,
const char * buffer,
std::size_t buffer_size )

Definition at line 283 of file deep_mind.cpp.

284 {
285 fc_dlog(_logger, "DB_OP UPD ${action_id} ${opayer}:${npayer} ${table_code} ${scope} ${table_name} ${primkey} ${odata}:${ndata}",
286 ("action_id", _action_id)
287 ("opayer", kvo.payer)
288 ("npayer", payer)
289 ("table_code", tid.code)
290 ("scope", tid.scope)
291 ("table_name", tid.table)
292 ("primkey", name(kvo.primary_key))
293 ("odata", fc::to_hex(kvo.value.data(),kvo.value.size()))
294 ("ndata", fc::to_hex(buffer, buffer_size))
295 );
296 }
Here is the call graph for this function:

◆ on_end_action()

void sysio::chain::deep_mind_handler::on_end_action ( )

Definition at line 176 of file deep_mind.cpp.

177 {
178 ++_action_id;
179 }

◆ on_end_transaction()

void sysio::chain::deep_mind_handler::on_end_transaction ( )

Definition at line 117 of file deep_mind.cpp.

118 {
119 _action_id = 0;
120 }

◆ on_fail_deferred()

void sysio::chain::deep_mind_handler::on_fail_deferred ( )

Definition at line 245 of file deep_mind.cpp.

246 {
247 fc_dlog(_logger, "DTRX_OP FAILED ${action_id}",
248 ("action_id", _action_id)
249 );
250 }

◆ on_init_resource_limits()

void sysio::chain::deep_mind_handler::on_init_resource_limits ( const resource_limits::resource_limits_config_object & config,
const resource_limits::resource_limits_state_object & state )

Definition at line 309 of file deep_mind.cpp.

310 {
311 fc_dlog(_logger, "RLIMIT_OP CONFIG INS ${data}",
312 ("data", config)
313 );
314 fc_dlog(_logger, "RLIMIT_OP STATE INS ${data}",
315 ("data", state)
316 );
317 }

◆ on_input_action()

void sysio::chain::deep_mind_handler::on_input_action ( )

Definition at line 170 of file deep_mind.cpp.

171 {
172 fc_dlog(_logger, "CREATION_OP ROOT ${action_id}",
173 ("action_id", _action_id)
174 );
175 }

◆ on_modify_permission()

void sysio::chain::deep_mind_handler::on_modify_permission ( const permission_object & old_permission,
const permission_object & new_permission )

Definition at line 378 of file deep_mind.cpp.

379 {
380 fc_dlog(_logger, "PERM_OP UPD ${action_id} ${permission_id} ${data}",
381 ("action_id", _action_id)
382 ("permission_id", new_permission.id)
384 ("old", old_permission)
385 ("new", new_permission)
386 )
387 );
388 }
An order-preserving dictionary of variants.

◆ on_newaccount_resource_limits()

void sysio::chain::deep_mind_handler::on_newaccount_resource_limits ( const resource_limits::resource_limits_object & limits,
const resource_limits::resource_usage_object & usage )

Definition at line 330 of file deep_mind.cpp.

331 {
332 fc_dlog(_logger, "RLIMIT_OP ACCOUNT_LIMITS INS ${data}",
333 ("data", limits)
334 );
335 fc_dlog(_logger, "RLIMIT_OP ACCOUNT_USAGE INS ${data}",
336 ("data", usage)
337 );
338 }

◆ on_onblock()

void sysio::chain::deep_mind_handler::on_onblock ( const signed_transaction & trx)

Definition at line 102 of file deep_mind.cpp.

103 {
104 auto packed_trx = fc::raw::pack(trx);
105
106 fc_dlog(_logger, "TRX_OP CREATE onblock ${id} ${trx}",
107 ("id", trx.id())
108 ("trx", fc::to_hex(packed_trx))
109 );
110 }
Here is the call graph for this function:

◆ on_onerror()

void sysio::chain::deep_mind_handler::on_onerror ( const signed_transaction & etrx)

Definition at line 92 of file deep_mind.cpp.

93 {
94 auto packed_trx = fc::raw::pack(etrx);
95
96 fc_dlog(_logger, "TRX_OP CREATE onerror ${id} ${trx}",
97 ("id", etrx.id())
98 ("trx", fc::to_hex(packed_trx))
99 );
100 }
Here is the call graph for this function:

◆ on_preactivate_feature()

void sysio::chain::deep_mind_handler::on_preactivate_feature ( const protocol_feature & feature)

Definition at line 153 of file deep_mind.cpp.

154 {
155 fc_dlog(_logger, "FEATURE_OP PRE_ACTIVATE ${action_id} ${feature_digest} ${feature}",
156 ("action_id", _action_id)
157 ("feature_digest", feature.feature_digest)
158 ("feature", feature.to_variant())
159 );
160 }

◆ on_ram_event()

void sysio::chain::deep_mind_handler::on_ram_event ( account_name account,
uint64_t new_usage,
int64_t delta )

Definition at line 355 of file deep_mind.cpp.

356 {
357 fc_dlog(_logger, "RAM_OP ${action_id} ${event_id} ${family} ${operation} ${legacy_tag} ${payer} ${new_usage} ${delta}",
358 ("action_id", _action_id)
359 ("event_id", _ram_trace.event_id)
360 ("family", _ram_trace.family)
361 ("operation", _ram_trace.operation)
362 ("legacy_tag", _ram_trace.legacy_tag)
363 ("payer", account)
364 ("new_usage", new_usage)
365 ("delta", delta)
366 );
367 _ram_trace = ram_trace();
368 }
const char * legacy_tag
Definition deep_mind.hpp:39

◆ on_ram_trace()

void sysio::chain::deep_mind_handler::on_ram_trace ( std::string && event_id,
const char * family,
const char * operation,
const char * legacy_tag )

Definition at line 351 of file deep_mind.cpp.

352 {
353 _ram_trace = ram_trace(std::move(event_id), family, operation, legacy_tag);
354 }

◆ on_remove_permission()

void sysio::chain::deep_mind_handler::on_remove_permission ( const permission_object & permission)

Definition at line 389 of file deep_mind.cpp.

390 {
391 fc_dlog(_logger, "PERM_OP REM ${action_id} ${permission_id} ${data}",
392 ("action_id", _action_id)
393 ("permission_id", permission.id)
394 ("data", permission)
395 );
396 }

◆ on_remove_table()

void sysio::chain::deep_mind_handler::on_remove_table ( const table_id_object & tid)

Definition at line 261 of file deep_mind.cpp.

262 {
263 fc_dlog(_logger, "TBL_OP REM ${action_id} ${code} ${scope} ${table} ${payer}",
264 ("action_id", _action_id)
265 ("code", tid.code)
266 ("scope", tid.scope)
267 ("table", tid.table)
268 ("payer", tid.payer)
269 );
270 }

◆ on_require_recipient()

void sysio::chain::deep_mind_handler::on_require_recipient ( )

Definition at line 180 of file deep_mind.cpp.

181 {
182 fc_dlog(_logger, "CREATION_OP NOTIFY ${action_id}",
183 ("action_id", _action_id)
184 );
185 }

◆ on_send_context_free_inline()

void sysio::chain::deep_mind_handler::on_send_context_free_inline ( )

Definition at line 192 of file deep_mind.cpp.

193 {
194 fc_dlog(_logger, "CREATION_OP CFA_INLINE ${action_id}",
195 ("action_id", _action_id)
196 );
197 }

◆ on_send_deferred()

void sysio::chain::deep_mind_handler::on_send_deferred ( operation_qualifier qual,
const generated_transaction_object & gto )

Definition at line 213 of file deep_mind.cpp.

214 {
215 fc_dlog(_logger, "DTRX_OP ${qual}CREATE ${action_id} ${sender} ${sender_id} ${payer} ${published} ${delay} ${expiration} ${trx_id} ${trx}",
216 ("qual", prefix(qual))
217 ("action_id", _action_id)
218 ("sender", gto.sender)
219 ("sender_id", gto.sender_id)
220 ("payer", gto.payer)
221 ("published", gto.published)
222 ("delay", gto.delay_until)
223 ("expiration", gto.expiration)
224 ("trx_id", gto.trx_id)
225 ("trx", fc::to_hex(gto.packed_trx.data(), gto.packed_trx.size()))
226 );
227 }
Here is the call graph for this function:

◆ on_send_inline()

void sysio::chain::deep_mind_handler::on_send_inline ( )

Definition at line 186 of file deep_mind.cpp.

187 {
188 fc_dlog(_logger, "CREATION_OP INLINE ${action_id}",
189 ("action_id", _action_id)
190 );
191 }

◆ on_set_account_limits()

void sysio::chain::deep_mind_handler::on_set_account_limits ( const resource_limits::resource_limits_object & limits)

Definition at line 345 of file deep_mind.cpp.

346 {
347 fc_dlog(_logger, "RLIMIT_OP ACCOUNT_LIMITS UPD ${data}",
348 ("data", limits)
349 );
350 }

◆ on_start_block()

void sysio::chain::deep_mind_handler::on_start_block ( uint32_t block_num)

Definition at line 69 of file deep_mind.cpp.

70 {
71 fc_dlog(_logger, "START_BLOCK ${block_num}", ("block_num", block_num));
72 }

◆ on_start_transaction()

void sysio::chain::deep_mind_handler::on_start_transaction ( )

Definition at line 112 of file deep_mind.cpp.

113 {
114 _action_id = 0;
115 }

◆ on_startup()

void sysio::chain::deep_mind_handler::on_startup ( chainbase::database & db,
uint32_t head_block_num )

Definition at line 48 of file deep_mind.cpp.

49 {
50 // FIXME: We should probably feed that from CMake directly somehow ...
51 fc_dlog(_logger, "DEEP_MIND_VERSION wire_sysio 13 0");
52
53 fc_dlog(_logger, "ABIDUMP START ${block_num} ${global_sequence_num}",
54 ("block_num", head_block_num)
55 ("global_sequence_num", db.get<dynamic_global_property_object>().global_action_sequence)
56 );
57 const auto& idx = db.get_index<account_index>();
58 for (auto& row : idx.indices()) {
59 if (row.abi.size() != 0) {
60 fc_dlog(_logger, "ABIDUMP ABI ${contract} ${abi}",
61 ("contract", row.name)
62 ("abi", row.abi)
63 );
64 }
65 }
66 fc_dlog(_logger, "ABIDUMP END");
67 }
const generic_index< MultiIndexType > & get_index() const
const ObjectType & get(CompatibleKey &&key) const
chainbase::shared_multi_index_container< account_object, indexed_by< ordered_unique< tag< by_id >, member< account_object, account_object::id_type, &account_object::id > >, ordered_unique< tag< by_name >, member< account_object, account_name, &account_object::name > > > > account_index
Here is the call graph for this function:

◆ on_switch_forks()

void sysio::chain::deep_mind_handler::on_switch_forks ( const block_id_type & old_head,
const block_id_type & new_head )

Definition at line 84 of file deep_mind.cpp.

85 {
86 fc_dlog(_logger, "SWITCH_FORK ${from_id} ${to_id}",
87 ("from_id", old_head)
88 ("to_id", new_head)
89 );
90 }

◆ on_update_account_usage()

void sysio::chain::deep_mind_handler::on_update_account_usage ( const resource_limits::resource_usage_object & usage)

Definition at line 339 of file deep_mind.cpp.

340 {
341 fc_dlog(_logger, "RLIMIT_OP ACCOUNT_USAGE UPD ${data}",
342 ("data", usage)
343 );
344 }

◆ on_update_resource_limits_config()

void sysio::chain::deep_mind_handler::on_update_resource_limits_config ( const resource_limits::resource_limits_config_object & config)

Definition at line 318 of file deep_mind.cpp.

319 {
320 fc_dlog(_logger, "RLIMIT_OP CONFIG UPD ${data}",
321 ("data", config)
322 );
323 }

◆ on_update_resource_limits_state()

void sysio::chain::deep_mind_handler::on_update_resource_limits_state ( const resource_limits::resource_limits_state_object & state)

Definition at line 324 of file deep_mind.cpp.

325 {
326 fc_dlog(_logger, "RLIMIT_OP STATE UPD ${data}",
327 ("data", state)
328 );
329 }

◆ update_config()

void sysio::chain::deep_mind_handler::update_config ( deep_mind_config config)

Definition at line 29 of file deep_mind.cpp.

30 {
31 _config = std::move(config);
32 }

◆ update_logger()

void sysio::chain::deep_mind_handler::update_logger ( const std::string & logger_name)

Definition at line 34 of file deep_mind.cpp.

35 {
37 }
static void update(const fc::string &name, logger &log)
Definition logger.cpp:92
const fc::string logger_name("net_plugin_impl")
Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following files: