-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Conversation
…rue with a irreversible=false
…ef instead of bytes in mongodb.
Thanks to Scott Sallinen scotts@ece.ubc.ca for implementation.
…ion-traces, and action-traces
b5f7493
to
d24e006
Compare
brief of changes: The optional The It is recommended that a large It is also recommended that read-only mode is used to avoid speculative execution. See read-only db mode documentation. Forked data is still recorded (data that never becomes irreversible) but speculative transaction processing and signaling is avoided minimizing the transaction_traces/action_traces stored. action data is stored on chain as raw bytes. This plugin attempts to use associated ABI on accounts to deserialize the raw bytes into explanded abi_def form for storage into mongo. Note that invalid or missing abi on a contract will result in the action data being stored as raw bytes. For example the eosio system contract does not provide abi for the
Example filter options:
The following mongo collections are created:
The equivalent of /v1/history/get_controlled_acounts with mongo:
The equivalent of /v1/history/get_key_accounts with mongo: |
Looking forward to see this merged in the future releases 😄 |
@DenisCarriere Sorry about the actions->action_traces and changes to transactions. Should be more stable going forward. Hopefully, it will not cost you too much rework on: https://github.com/EOS-BP-Developers/eosio-mongodb-queries . On the plus side it is much faster and now includes scheduled transactions and inline actions. |
if( filter_on_star ) { | ||
include = true; | ||
} | ||
if( filter_on.find( {act.account, act.name, 0} ) != filter_on.end() ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason not to optimize this with if (!include && ...
if( filter_on.find( {act.account, act.name, 0} ) != filter_on.end() ) { | ||
include = true; | ||
} | ||
for( const auto& a : act.authorization ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrap in if (!include) {...}
} | ||
for( const auto& a : act.authorization ) { | ||
if( filter_on.find( {act.account, act.name, a.actor} ) != filter_on.end() ) { | ||
include = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add break to optimize
@@ -1273,6 +1326,11 @@ void mongo_db_plugin::set_program_options(options_description& cli, options_desc | |||
"MongoDB URI connection string, see: https://docs.mongodb.com/master/reference/connection-string/." | |||
" If not specified then plugin is disabled. Default database 'EOS' is used if not specified in URI." | |||
" Example: mongodb://127.0.0.1:27017/EOS") | |||
("mongodb-filter-on", bpo::value<vector<string>>()->composing(), | |||
"Mongodb: Track actions which match receiver:action:actor. Actor may be blank to include all. Receiver and Action may not be blank. Default is * include everything.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering if using the linux command line convention would make this clearer:
receiver:action:[actor]
??
("mongodb-filter-on", bpo::value<vector<string>>()->composing(), | ||
"Mongodb: Track actions which match receiver:action:actor. Actor may be blank to include all. Receiver and Action may not be blank. Default is * include everything.") | ||
("mongodb-filter-out", bpo::value<vector<string>>()->composing(), | ||
"Mongodb: Do not track actions which match receiver:action:actor. Action and Actor both blank excludes all from reciever. Actor blank excludes all from reciever:action. Receiver may not be blank.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we do above then this would be receiver:[action]:[actor]
@heifner No worries, I'll adjust accordingly to these changes. I'll rework MongoDB Queries once this is released 👍 |
🎉 Woot |
I'm trying to only use
At the moment, this config still returns Maybe I'm missing something? CC: @heifner & @ScottSallinen |
Looks like you are correct. I'll get a fix put in. |
Perhaps a |
Resolves #4968
-- New action_traces collection replaces actions collection
-- action_traces include all actions including inline, implicit, and scheduled
-- Thanks to Scott Sallinen (TeamGreymass) for implementation.