operanditech / statemirror

A fully featured receiver library for the operations sent by the nodeos statetrack_plugin
MIT License
3 stars 0 forks source link

General review #5

Closed andresberrios closed 6 years ago

andresberrios commented 6 years ago

State Track Plugin

mmcs85 commented 6 years ago

1 - Since JSON serialization adds overhead on tx execution if handled directly.

1.a) first solution is to delegate to the receiver side for parsing it later.

     Upside is that serialization can be delayed until is needed.
     Downside is that you need to fetch abi for each (can be cached) op to be able to parse it.

1.b) second solution is to create a temporary queue that serializes all op to JSON after tx is done executing.

Upside delay stream of OP until a tx is done then stream it to receivers, it avoids streaming tx with exceptions and the undo ops that result from it with a proper filter.
Downside is that database op stream is not directly on tx when executing.

2 - (General concerns lost messages)

Is possible to use a ZFS system to create differential backups and use it as a generic snapshot system to revert to a given point in time nodeos and(or) mongodb.

3 - (chainbase)

3.a) emit function on chainbase is using a std::function instead of a signal. so it handles different exceptions.

I have been thinking in trying to support the signal in this case. Cuz I realized that it may be useful for multiple plugins enabled at once trying to subscribe this events.

3.b) the line is not removed is added later _indices.erase( itr );

andresberrios commented 6 years ago

Current pending changes

mmcs85 commented 6 years ago

fixed some of the issues