mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-14 02:12:33 +00:00
rename --reconstruct-historic-states to --archive (#8795)
Co-Authored-By: dapplion <35266934+dapplion@users.noreply.github.com>
This commit is contained in:
@@ -372,8 +372,8 @@ where
|
||||
|
||||
// Initialize anchor info before attempting to write the genesis state.
|
||||
// Since v4.4.0 we will set the anchor with a dummy state upper limit in order to prevent
|
||||
// historic states from being retained (unless `--reconstruct-historic-states` is set).
|
||||
let retain_historic_states = self.chain_config.reconstruct_historic_states;
|
||||
// historic states from being retained (unless `--archive` is set).
|
||||
let retain_historic_states = self.chain_config.archive;
|
||||
let genesis_beacon_block = genesis_block(&mut beacon_state, &self.spec)?;
|
||||
self.pending_io_batch.push(
|
||||
store
|
||||
@@ -529,7 +529,7 @@ where
|
||||
// case it will be stored in the hot DB. In this case, we need to ensure the store's anchor
|
||||
// is initialised prior to storing the state, as the anchor is required for working out
|
||||
// hdiff storage strategies.
|
||||
let retain_historic_states = self.chain_config.reconstruct_historic_states;
|
||||
let retain_historic_states = self.chain_config.archive;
|
||||
self.pending_io_batch.push(
|
||||
store
|
||||
.init_anchor_info(
|
||||
@@ -1125,9 +1125,7 @@ where
|
||||
);
|
||||
|
||||
// Check for states to reconstruct (in the background).
|
||||
if beacon_chain.config.reconstruct_historic_states
|
||||
&& beacon_chain.store.get_oldest_block_slot() == 0
|
||||
{
|
||||
if beacon_chain.config.archive && beacon_chain.store.get_oldest_block_slot() == 0 {
|
||||
beacon_chain.store_migrator.process_reconstruction();
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ pub struct ChainConfig {
|
||||
/// If `None`, there is no weak subjectivity verification.
|
||||
pub weak_subjectivity_checkpoint: Option<Checkpoint>,
|
||||
/// Determine whether to reconstruct historic states, usually after a checkpoint sync.
|
||||
pub reconstruct_historic_states: bool,
|
||||
pub archive: bool,
|
||||
/// The max size of a message that can be sent over the network.
|
||||
pub max_network_size: usize,
|
||||
/// Maximum percentage of the head committee weight at which to attempt re-orging the canonical head.
|
||||
@@ -130,7 +130,7 @@ impl Default for ChainConfig {
|
||||
Self {
|
||||
import_max_skip_slots: None,
|
||||
weak_subjectivity_checkpoint: None,
|
||||
reconstruct_historic_states: false,
|
||||
archive: false,
|
||||
max_network_size: 10 * 1_048_576, // 10M
|
||||
re_org_head_threshold: Some(DEFAULT_RE_ORG_HEAD_THRESHOLD),
|
||||
re_org_parent_threshold: Some(DEFAULT_RE_ORG_PARENT_THRESHOLD),
|
||||
|
||||
@@ -305,10 +305,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
|
||||
// If backfill has completed and the chain is configured to reconstruct historic states,
|
||||
// send a message to the background migrator instructing it to begin reconstruction.
|
||||
// This can only happen if we have backfilled all the way to genesis.
|
||||
if backfill_complete
|
||||
&& self.genesis_backfill_slot == Slot::new(0)
|
||||
&& self.config.reconstruct_historic_states
|
||||
{
|
||||
if backfill_complete && self.genesis_backfill_slot == Slot::new(0) && self.config.archive {
|
||||
self.store_migrator.process_reconstruction();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user