0

1) Snapshot file size is remarkable small relative to blocks.log size. Exactly what data is stored in snapshot file?

2) As I understand contracts states is stored in snapshot file. But history_plugin also keep its data in state db (Is that right?). So, my second question is, why is history_plugin data not in snapshot file?

3) Why can't we retrieve accounts list from snapshot? Or can we?

Thank you!

1 Answer 1

1

blocks.log contains all transactions which are the requests for changes on the state, and the state is built by sequential execution of all transactions from genesis block.

1) Snapshot only stores the latest state (sum of all changes occurred by execution of transactions) including created accounts, their permissions and keys, multi-index table, smart contract binaries etc, but its size is far smaller than blocks.

2) All transactions are stored in blocks.log, but there is no index for them, so you cannot find a specific transaction with its ID unless you know what exact block that transaction belongs to. history_plugin generated index information for transactions in state, so you could search for a transaction with its ID, but it was deprecated. (Not supported anymore) Snapshot feature was developed after the deprecation of history_plugin, so storing history_plugin data in snapshot was not implemented. Alternatively, state_history_plugin or others solutions are provided instead of history_plugin, but they are't stored in state, so snapshot will not have them either.

3) Snapshot has the information of all accounts already, so the list of accounts can be retrieved from it, if you know the right way. Refer to how eosio::chain::controller reads the state from snapshot. [link]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.