mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 15:16:43 +00:00
core/rawdb, ethdb: fix comments
This commit is contained in:
parent
a32eaccaee
commit
3143880dd3
3 changed files with 9 additions and 8 deletions
|
|
@ -37,8 +37,10 @@ const (
|
|||
ChainFreezerReceiptTable = "receipts"
|
||||
)
|
||||
|
||||
// chainFreezerTableConfigs configures whether compression is disabled for the ancient-tables.
|
||||
// Hashes and difficulties don't compress well.
|
||||
// chainFreezerTableConfigs configures the settings for tables in the chain freezer.
|
||||
// Compression is disabled for hashes as they don't compress well. Additionally,
|
||||
// tail truncation is disabled for the header and hash tables, as these are intended
|
||||
// to be retained long-term.
|
||||
var chainFreezerTableConfigs = map[string]freezerTableConfig{
|
||||
ChainFreezerHeaderTable: {noSnappy: false, prunable: false},
|
||||
ChainFreezerHashTable: {noSnappy: true, prunable: false},
|
||||
|
|
@ -46,6 +48,7 @@ var chainFreezerTableConfigs = map[string]freezerTableConfig{
|
|||
ChainFreezerReceiptTable: {noSnappy: false, prunable: true},
|
||||
}
|
||||
|
||||
// freezerTableConfig contains the settings for a freezer table.
|
||||
type freezerTableConfig struct {
|
||||
noSnappy bool // disables item compression
|
||||
prunable bool // true for tables that can be pruned by TruncateTail
|
||||
|
|
@ -63,7 +66,7 @@ const (
|
|||
stateHistoryStorageData = "storage.data"
|
||||
)
|
||||
|
||||
// stateFreezerTableConfigs configures whether compression is disabled for the state freezer.
|
||||
// stateFreezerTableConfigs configures the settings for tables in the state freezer.
|
||||
var stateFreezerTableConfigs = map[string]freezerTableConfig{
|
||||
stateHistoryMeta: {noSnappy: true, prunable: true},
|
||||
stateHistoryAccountIndex: {noSnappy: false, prunable: true},
|
||||
|
|
|
|||
|
|
@ -301,9 +301,8 @@ func (f *Freezer) TruncateHead(items uint64) (uint64, error) {
|
|||
return oitems, nil
|
||||
}
|
||||
|
||||
// TruncateTail discards all data below the provided threshold number
|
||||
// Note this will only truncate 'prunable' tables. Block headers and canonical
|
||||
// hashes cannot be truncated at this time.
|
||||
// TruncateTail discards all data below the specified threshold. Note that only
|
||||
// 'prunable' tables will be truncated.
|
||||
func (f *Freezer) TruncateTail(tail uint64) (uint64, error) {
|
||||
if f.readonly {
|
||||
return 0, errReadOnly
|
||||
|
|
|
|||
|
|
@ -129,8 +129,7 @@ type AncientWriter interface {
|
|||
// immediately, but only when the accumulated deleted data reach the threshold then
|
||||
// will be removed all together.
|
||||
//
|
||||
// Note this will only truncate 'prunable' tables. Block headers and canonical
|
||||
// hashes cannot be truncated at this time.
|
||||
// Note that data marked as non-prunable will still be retained and remain accessible.
|
||||
TruncateTail(n uint64) (uint64, error)
|
||||
|
||||
// Sync flushes all in-memory ancient store data to disk.
|
||||
|
|
|
|||
Loading…
Reference in a new issue