Increase the default pruning parameters (#11558)

* Log block number and earliest available block when snapshots fail to start

* Increase default pruning history to 128
Increase default pruning memory to 48Mb

* Decrease SNAPSHOT_PERIOD to 200 to get them snapshots started quicker

* Sync updates to defaults with the args parser

* Fix tests

* Restore the SNAPSHOT_PERIOD to 5000

* One more

* Update ethcore/src/client/config.rs
This commit is contained in:
David
2020-03-19 11:34:30 +01:00
committed by GitHub
parent 874462bfc0
commit 87fd914c94
5 changed files with 22 additions and 16 deletions

View File

@@ -737,8 +737,7 @@ impl Client {
debug!(target: "client", "Cleanup journal: DB Earliest = {:?}, Latest = {:?}", state_db.journal_db().earliest_era(), state_db.journal_db().latest_era());
let history = if config.history < MIN_HISTORY_SIZE {
info!(target: "client", "Ignoring pruning history parameter of {}\
, falling back to minimum of {}",
info!(target: "client", "Ignoring pruning history parameter of {} , falling back to minimum of {}",
config.history, MIN_HISTORY_SIZE);
MIN_HISTORY_SIZE
} else {
@@ -2558,6 +2557,7 @@ impl SnapshotClient for Client {
let block_number = self.block_number(at).ok_or_else(|| SnapshotError::InvalidStartingBlock(at))?;
let earliest_era = db.earliest_era().unwrap_or(0);
if db.is_prunable() && earliest_era > block_number {
warn!(target: "snapshot", "Tried to take a snapshot at #{} but the earliest available block is #{}", block_number, earliest_era);
return Err(SnapshotError::OldBlockPrunedDB.into());
}

View File

@@ -99,6 +99,9 @@ pub struct ClientConfig {
impl Default for ClientConfig {
fn default() -> Self {
let mb = 1024 * 1024;
// Note/TODO: the defaults here are overridden by the command line
// argument parser and changes to defaults here must be performed "over
// there" as well (see `cli/mod.rs` and https://github.com/openethereum/openethereum/issues/11574).
ClientConfig {
queue: Default::default(),
blockchain: Default::default(),
@@ -113,8 +116,8 @@ impl Default for ClientConfig {
verifier_type: VerifierType::Canon,
state_cache_size: 1 * mb,
jump_table_size: 1 * mb,
history: 64,
history_mem: 32 * mb,
history: 128,
history_mem: 64 * mb,
check_seal: true,
transaction_verification_queue_size: 8192,
max_round_blocks_to_import: 12,