Eos: duplicate applied_transaction signal

Created on 14 Sep 2018  ·  7Comments  ·  Source: EOSIO/eos

When I use applied_transaction, same trace will emit twice.
I try add config read_mode = head or read_node = read-only. but it still happen.
this node only receiver block and haven't use push_transaction http api.

2018-09-14T07:08:05.767 thread-0   sql_db_plugin.cpp:69          applied_transaction  ] 445fde7a81522ea17430fbae97d0b73501a10907c2cc7ed5c037e1bdb05b5866
2018-09-14T07:08:05.920 thread-0   sql_db_plugin.cpp:69          applied_transaction  ] fc376b5a18fc2c0cfe6856703523fdfce9ed65bbec397bc66302b03b4dbf8663
2018-09-14T07:08:06.006 thread-0   sql_db_plugin.cpp:69          applied_transaction  ] 445fde7a81522ea17430fbae97d0b73501a10907c2cc7ed5c037e1bdb05b5866
2018-09-14T07:08:06.006 thread-0   sql_db_plugin.cpp:69          applied_transaction  ] fc376b5a18fc2c0cfe6856703523fdfce9ed65bbec397bc66302b03b4dbf8663
2018-09-14T07:08:06.006 thread-0   producer_plugin.cpp:328       on_incoming_block    ] Received block 2e5c5401457d67ab... #20 @ 2018-09-14T07:08:06.000 signed by eosio [trxs: 2, lib: 19, conf: 0, latency: 6 ms]
2018-09-14T07:08:06.077 thread-0   sql_db_plugin.cpp:69          applied_transaction  ] c6e6758c878bb7c9effd251d218ebc1197e2f29635c88c01c3f18fe414e051c7
2018-09-14T07:08:06.252 thread-0   sql_db_plugin.cpp:69          applied_transaction  ] 4e35704e01b513340fc2e9d4ac20c9d7fbab5df2257063643d033812e81c0865
2018-09-14T07:08:06.409 thread-0   sql_db_plugin.cpp:69          applied_transaction  ] f64e6feb7b7cb2685ca5cd184eb1126df3ee65283c0116db739dbd7a9203e4aa
2018-09-14T07:08:06.507 thread-0   sql_db_plugin.cpp:69          applied_transaction  ] c6e6758c878bb7c9effd251d218ebc1197e2f29635c88c01c3f18fe414e051c7
2018-09-14T07:08:06.507 thread-0   sql_db_plugin.cpp:69          applied_transaction  ] 4e35704e01b513340fc2e9d4ac20c9d7fbab5df2257063643d033812e81c0865
2018-09-14T07:08:06.507 thread-0   sql_db_plugin.cpp:69          applied_transaction  ] f64e6feb7b7cb2685ca5cd184eb1126df3ee65283c0116db739dbd7a9203e4aa
2018-09-14T07:08:06.508 thread-0   producer_plugin.cpp:328       on_incoming_block    ] Received block 24182d996edb7ca5... #21 @ 2018-09-14T07:08:06.500 signed by eosio [trxs: 3, lib: 20, conf: 0, latency: 8 ms]
2018-09-14T07:08:06.721 thread-0   sql_db_plugin.cpp:69          applied_transaction  ] dd7e1a8df155673f71c2f1c1291c0744f7c4115d2aebd2e2092f11ff918dc80c
2018-09-14T07:08:06.932 thread-0   sql_db_plugin.cpp:69          applied_transaction  ] 654b54be6bb1defdc964455b13fec7e4a23f64f94f8e1cf3be0009288ea75a2a
2018-09-14T07:08:07.016 thread-0   sql_db_plugin.cpp:69          applied_transaction  ] dd7e1a8df155673f71c2f1c1291c0744f7c4115d2aebd2e2092f11ff918dc80c
2018-09-14T07:08:07.017 thread-0   sql_db_plugin.cpp:69          applied_transaction  ] 654b54be6bb1defdc964455b13fec7e4a23f64f94f8e1cf3be0009288ea75a2a
2018-09-14T07:08:07.018 thread-0   producer_plugin.cpp:328       on_incoming_block    ] Received block 0c27cf4b411c7bd2... #22 @ 2018-09-14T07:08:07.000 signed by eosio [trxs: 2, lib: 21, conf: 0, latency: 18 ms]
2018-09-14T07:08:07.128 thread-0   sql_db_plugin.cpp:69          applied_transaction  ] 5272d969064acbe08f4ac2370ac587bcc28ccb8fd9ff5745654be6569e7823a8
2018-09-14T07:08:07.338 thread-0   sql_db_plugin.cpp:69          applied_transaction  ] 4f22b9334195795bd7c3e5193080ff4a9f34f67633ba0ff3a0a0bfc3f65a9630
2018-09-14T07:08:07.505 thread-0   sql_db_plugin.cpp:69          applied_transaction  ] 5272d969064acbe08f4ac2370ac587bcc28ccb8fd9ff5745654be6569e7823a8
2018-09-14T07:08:07.506 thread-0   sql_db_plugin.cpp:69          applied_transaction  ] 4f22b9334195795bd7c3e5193080ff4a9f34f67633ba0ff3a0a0bfc3f65a9630
2018-09-14T07:08:07.506 thread-0   producer_plugin.cpp:328       on_incoming_block    ] Received block 17881509d3b8dc30... #23 @ 2018-09-14T07:08:07.500 signed by eosio [trxs: 2, lib: 22, conf: 0, latency: 6 ms]
2018-09-14T07:08:08.115 thread-0   producer_plugin.cpp:328       on_incoming_block    ] Received block e9c3de92eb832d5a... #24 @ 2018-09-14T07:08:08.000 signed by eosio [trxs: 0, lib: 23, conf: 0, latency: 115 ms]
2018-09-14T07:08:08.237 thread-0   sql_db_plugin.cpp:69          applied_transaction  ] 3130a92c47685a5191113da11b6a70266d7fd6093ec6d0cdc9b11f2177a6b857
2018-09-14T07:08:08.304 thread-0   sql_db_plugin.cpp:69          applied_transaction  ] 928ee60a5e6dd7b9cab416bc0374e9462f2ad0519b046293c0463a5b26aee331
2018-09-14T07:08:08.369 thread-0   sql_db_plugin.cpp:69          applied_transaction  ] d0c42bdc1d3a230be0bfcefaff816777c1dfba548058631c5b8ab60b56ef31b9
2018-09-14T07:08:08.430 thread-0   sql_db_plugin.cpp:69          applied_transaction  ] bc64f68d4c54efd59803150ec076aac6fc4823546b60de3f44c81c25cf4ccdb0
2018-09-14T07:08:08.524 thread-0   sql_db_plugin.cpp:69          applied_transaction  ] 3130a92c47685a5191113da11b6a70266d7fd6093ec6d0cdc9b11f2177a6b857
2018-09-14T07:08:08.531 thread-0   sql_db_plugin.cpp:69          applied_transaction  ] 928ee60a5e6dd7b9cab416bc0374e9462f2ad0519b046293c0463a5b26aee331
2018-09-14T07:08:08.538 thread-0   sql_db_plugin.cpp:69          applied_transaction  ] d0c42bdc1d3a230be0bfcefaff816777c1dfba548058631c5b8ab60b56ef31b9
2018-09-14T07:08:08.542 thread-0   sql_db_plugin.cpp:69          applied_transaction  ] bc64f68d4c54efd59803150ec076aac6fc4823546b60de3f44c81c25cf4ccdb0
2018-09-14T07:08:08.544 thread-0   producer_plugin.cpp:328       on_incoming_block    ] Received block 8072358b697f5659... #25 @ 2018-09-14T07:08:08.500 signed by eosio [trxs: 4, lib: 24, conf: 0, latency: 44 ms]
2018-09-14T07:08:08.555 thread-0   sql_db_plugin.cpp:69          applied_transaction  ] 7e19420bcd1667ce145ecf7503404bb0ae86efb884c943e334c21c1da0d5d41c
2018-09-14T07:08:08.621 thread-0   sql_db_plugin.cpp:69          applied_transaction  ] 9c69400e46c44fc60e993ea7c31bc01333b334d607b9c1a057e2d0eaee5fcaaf
2018-09-14T07:08:08.685 thread-0   sql_db_plugin.cpp:69          applied_transaction  ] 123cac61dc8f42578246ad74a215974ba02a0ae0effe8408cf30f395de0ee52b
2018-09-14T07:08:08.722 thread-0   sql_db_plugin.cpp:69          applied_transaction  ] 3658e19e5c7052c2fbf697f5c219955e5cf207bec122c0faa7107fa9f1896238
2018-09-14T07:08:08.759 thread-0   sql_db_plugin.cpp:69          applied_transaction  ] 600188d0c1fc24edbf20ecd2cd588490c561f2a58558c0c0815c318493b73fb3
2018-09-14T07:08:08.822 thread-0   sql_db_plugin.cpp:69          applied_transaction  ] d4d7f67ca7556b92d6151ef43b9a4864a17b336912a61f65a787e7363c388e12
2018-09-14T07:08:08.960 thread-0   sql_db_plugin.cpp:69          applied_transaction  ] a50799dd9768c3fd9781b489e675e26773e379b0d505c88a950669ee8a9ab31e
2018-09-14T07:08:09.010 thread-0   sql_db_plugin.cpp:69          applied_transaction  ] 7e19420bcd1667ce145ecf7503404bb0ae86efb884c943e334c21c1da0d5d41c
2018-09-14T07:08:09.017 thread-0   sql_db_plugin.cpp:69          applied_transaction  ] 9c69400e46c44fc60e993ea7c31bc01333b334d607b9c1a057e2d0eaee5fcaaf
2018-09-14T07:08:09.024 thread-0   sql_db_plugin.cpp:69          applied_transaction  ] 123cac61dc8f42578246ad74a215974ba02a0ae0effe8408cf30f395de0ee52b
2018-09-14T07:08:09.025 thread-0   sql_db_plugin.cpp:69          applied_transaction  ] 3658e19e5c7052c2fbf697f5c219955e5cf207bec122c0faa7107fa9f1896238
2018-09-14T07:08:09.025 thread-0   sql_db_plugin.cpp:69          applied_transaction  ] 600188d0c1fc24edbf20ecd2cd588490c561f2a58558c0c0815c318493b73fb3
2018-09-14T07:08:09.028 thread-0   sql_db_plugin.cpp:69          applied_transaction  ] d4d7f67ca7556b92d6151ef43b9a4864a17b336912a61f65a787e7363c388e12
2018-09-14T07:08:09.029 thread-0   sql_db_plugin.cpp:69          applied_transaction  ] a50799dd9768c3fd9781b489e675e26773e379b0d505c88a950669ee8a9ab31e
2018-09-14T07:08:09.029 thread-0   producer_plugin.cpp:328       on_incoming_block    ] Received block c69bd57dcba23abb... #26 @ 2018-09-14T07:08:09.000 signed by eosio [trxs: 7, lib: 25, conf: 0, latency: 29 ms]
2018-09-14T07:08:09.031 thread-0   sql_db_plugin.cpp:69          applied_transaction  ] cc437f3fedd2e7c74217802ebfe46e73a3423d20758d5295c34e2e3e880311e9
2018-09-14T07:08:09.062 thread-0   sql_db_plugin.cpp:69          applied_transaction  ] 5150c2573f5b70a0c47a0dbefd77c5ccffcc1d4e440d866bfe6859ee21c6d2dc
2018-09-14T07:08:09.512 thread-0   sql_db_plugin.cpp:69          applied_transaction  ] cc437f3fedd2e7c74217802ebfe46e73a3423d20758d5295c34e2e3e880311e9
2018-09-14T07:08:09.513 thread-0   sql_db_plugin.cpp:69          applied_transaction  ] 5150c2573f5b70a0c47a0dbefd77c5ccffcc1d4e440d866bfe6859ee21c6d2dc
2018-09-14T07:08:09.514 thread-0   producer_plugin.cpp:328       on_incoming_block    ] Received block d2f87a1d4e2dd1a4... #27 @ 2018-09-14T07:08:09.500 signed by eosio [trxs: 2, lib: 26, conf: 0, latency: 14 ms]
2018-09-14T07:08:10.011 thread-0   producer_plugin.cpp:328       on_incoming_block    ] Received block 5c9c876b2d621cf9... #28 @ 2018-09-14T07:08:10.000 signed by eosio [trxs: 0, lib: 27, conf: 0, latency: 11 ms]
2018-09-14T07:08:10.264 thread-0   sql_db_plugin.cpp:69          applied_transaction  ] 422ad4c40fddcb2864a461fcdb74fe3163063c594e0c050af58e8825967a9f17
2018-09-14T07:08:10.512 thread-0   sql_db_plugin.cpp:69          applied_transaction  ] 422ad4c40fddcb2864a461fcdb74fe3163063c594e0c050af58e8825967a9f17
Support

Most helpful comment

This is really a low-level mistake. Thanks. @heifner

All 7 comments

I found even exectrx_context.undo() , but it still emit accepted_transaction and applied_transaction signal, should I push them into else

// call the accept signal but only once for this transaction
if (!trx->accepted) {
   trx->accepted = true;
   emit( self.accepted_transaction, trx);
}

emit(self.applied_transaction, trace);


if ( read_mode != db_read_mode::SPECULATIVE && pending->_block_status == controller::block_status::incomplete ) {
   //this may happen automatically in destructor, but I prefere make it more explicit
   trx_context.undo();
} else {
   restore.cancel();
   trx_context.squash();
}

version is 1.2.5

sql_db_plugin is deprecated. Please use mongo_db_plugin instead.

@taokayan I rewrote sql_db_plugin. In this example, I just print applied_transaction id and haven't sql operation. How to avoid duplicate applied_transaction signal.

The config must be read-mode = read-only you indicated _

This is really a low-level mistake. Thanks. @heifner

sql_db_plugin is not precisely deprecated. It was never part of an EOS.IO software release. There was a pull request, but it was not merged to any release. Instead it is a third-party plugin. Provisions to support third-party plugins have been available since 1.2.0. Developers are encouraged to take advantage of those provisions for projects better served by a custom plugin than what's possible via RPC calls alone.

Was this page helpful?
0 / 5 - 0 ratings