This repository has been archived by the owner on Aug 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This reverts commit e2ec9f9.
…x several bugs that result from that concept
…rom a snapshot, fix bugs that bubbled up as a result
…tation details in source files or detail namespaces
…m between header info and blocks
…or return the integrity hash over the database
…e a node from a snapshot
@dskvr please see the documentation above and comment on any concerns 😄 |
heifner
reviewed
Oct 11, 2018
libraries/chain/block_log.cpp
Outdated
my->block_stream.write((char*)&totem, sizeof(totem)); | ||
|
||
if (first_block) { | ||
auto ret = append(first_block); |
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.
I would think ret
would be warning with some compilers.. unused.
…e irreversible block implied by the snapshot
…optimized for undo
Closed
* contract tables are now in their own index set * this index set is snapshotted and included in the integrity check through a different process * traversal of the normal index set will include the table_id_objects * traversal of the contracts tables is then free to use those objects to traverse tables in the order of the table_id_objects * this will traverse logical tables instead of the whole combined table * each logical table gets its own section and is ordered by the next most appropriate key depending on its type
…ake up space and are not worth it
The original version of the snapshot was not safe WRT foreign keys, The second version of the snapshot was really slow. This represents a 3rd attempt at foreign key support that is performant. Smoke tests on existing chains are coming back positive. |
depends on EOSIO/fc#29 |
…napshot datafile and the structure of the snapshotted data are versioned separately
Could you please tell me how to create the snapshot in JSON format? Thanks |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Starting this review early.
This is the plumbing and unit tests for creating:
HEAD
state of the chain BUT are loaded as if irreversible so, snapshots should only be used if the head block they represent become irreversible untilirreversible
read mode is available.Things left to do:
instructions for using snapshots
configuring a snapshot directory
By default snapshots are written to the
snapshots
directory relative to yournodeos
data directory. This can be overridden with a relative or absolute path using thesnapshots_dir
configuration or using the--snapshots_dir
command line option.Snapshots are written out to files named with the pattern
snapshot-<head block id in hex>.bin
Triggering the creation of a snapshot
Snapshots can be triggered at runtime using the RPC available through the
producer_api_plugin
. For example:Instantiating a node from a snapshot
When starting a new instance of
nodeos
the--snapshot <path to snapshot>
command line option can be used instead of replaying ablocks.log
or resyncing from a network. If ablocks.log
is provided it MUST at least contain blocks up to the snapshotted block and MAY contain additional blocks that will be applied as part of startup. In addition, any availablereversible/
blocks will be applied.When instantiating a node from a snapshot, it is illegal to pass in any
--genesis-*
arguments as that information is loaded from a snapshot. If ablocks.log
exists, the genesis information it contains will be validated against the genesis data in the snapshot and error if they are not consistent.NOTE instantiating a node from a snapshot without a blocks.log is valid BUT it will create a partial blocks.log which will affect its ability to service RPC/P2P requests for block data.
Instructions for using integrity hashes
Integrity hashes are a way of comparing the contents of the blockchain state database. They consist of a sha256 hash of a deterministic binary representation of all consensus affecting state.
calculating an integrity hash
Integrity hashes can be retrieved at runtime using the RPC available through the
producer_api_plugin
. For example: