Trait ethcore::snapshot::SnapshotComponents
source · [−]pub trait SnapshotComponents: Send {
fn chunk_all(
&mut self,
chain: &BlockChain,
block_at: H256,
chunk_sink: &mut ChunkSink<'_>,
progress: &Progress,
preferred_size: usize,
eip1559_transition: BlockNumber
) -> Result<(), Error>;
fn rebuilder(
&self,
chain: BlockChain,
db: Arc<dyn BlockChainDB>,
manifest: &ManifestData
) -> Result<Box<dyn Rebuilder>, Error>;
fn min_supported_version(&self) -> u64;
fn current_version(&self) -> u64;
}
Expand description
Components necessary for snapshot creation and restoration.
Required methods
Create secondary snapshot chunks; these corroborate the state data in the state chunks.
Chunks shouldn’t exceed the given preferred size, and should be fed uncompressed into the sink.
This will vary by consensus engine, so it’s exposed as a trait.
fn rebuilder(
&self,
chain: BlockChain,
db: Arc<dyn BlockChainDB>,
manifest: &ManifestData
) -> Result<Box<dyn Rebuilder>, Error>
fn rebuilder(
&self,
chain: BlockChain,
db: Arc<dyn BlockChainDB>,
manifest: &ManifestData
) -> Result<Box<dyn Rebuilder>, Error>
Create a rebuilder, which will have chunks fed into it in aribtrary order and then be finalized.
The manifest, a database, and fresh BlockChain
are supplied.
The engine passed to the Rebuilder
methods will be the same instance
that created the SnapshotComponents
.
fn min_supported_version(&self) -> u64
fn min_supported_version(&self) -> u64
Minimum supported snapshot version number.
fn current_version(&self) -> u64
fn current_version(&self) -> u64
Current version number