The previous default for `prune=htrc` would be different after the prune
hack. This would lead to error in the node. This PR is to retain the
value in the database for `prune.r` value before checking for change.
This is a hack to not prune logs of certain special contracts,
designated through chain config property, `noPruneContracts`
**Background**
CL needs deposit contract logs to create and maintain its own state
(deposit tree, in particular). It requests the data through
`eth_getLogs`. The naive approach is to not prune any logs of any
contract since the block of the deposit contract. This results in a much
bloated database for Logs. A validating node must be like that.
**Proposed solution**
Add the deposit contract to a special list. On execute stage, skip
pruning Log table. In LogIndex stage, selectively prune logs, i.e. don't
prune those of any of the special contracts' logs.
**Results**
Gnosis pruned node went from about 600GB to 320GB, and can still be a
validating node (not battle tested yet)
* Changes:
* Proceeded to check if other h, r, t or c flags for 'before' and 'older' are set before returning from the default state of --prune
Concern:
* Does the 'disabled' value for '--prune=' need to be updated if the '--prune.*' flags are set but the '--prune=' flag is not?
* Modify mode.Initialised only when it is changed
* Updated layout for --prune=*
* save
* save
Co-authored-by: alex.sharov <AskAlexSharov@gmail.com>
* Pruning for: exec, log_index, tx_lookup, history stages
* Pruning for: exec, log_index, tx_lookup, history stages
* Pruning for: exec, log_index, tx_lookup, history stages
* Pruning for: exec, log_index, tx_lookup, history stages
* add tvm flag
* save
* db migration for storage mode
add flag --prune=
remove flag --storage-mode=
add flag --experiments=tevm,...
rename integration set_storage_mode to set_prune
* fix
* forward move of stages must skip everything before PruneTo
* keep in db progress of prune method
* keep in db progress of prune method
* simplify logs
* simplify logs
* simplify logs
* fix test
* simplify logs
* simplify logs
* simplify logs
* simplify logs
* remove callTraceSet as dupsort
use etl transform for txlookup prune
remove some logs
* cleanup tests a bit
* print_stages and eth_sync to show prune progress
* fix print_stages
* add readme about --prune.to flag
* more docs
* add --prune.history.older and other flags support
* fix migration on empty db
* better toString
* better toString