github.com/jimmyx0x/go-ethereum@v1.10.28/core/rawdb/ancient_scheme.go (about)

     1  // Copyright 2022 The go-ethereum Authors
     2  // This file is part of the go-ethereum library.
     3  //
     4  // The go-ethereum library is free software: you can redistribute it and/or modify
     5  // it under the terms of the GNU Lesser General Public License as published by
     6  // the Free Software Foundation, either version 3 of the License, or
     7  // (at your option) any later version.
     8  //
     9  // The go-ethereum library is distributed in the hope that it will be useful,
    10  // but WITHOUT ANY WARRANTY; without even the implied warranty of
    11  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    12  // GNU Lesser General Public License for more details.
    13  //
    14  // You should have received a copy of the GNU Lesser General Public License
    15  // along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
    16  
    17  package rawdb
    18  
    19  // The list of table names of chain freezer.
    20  const (
    21  	// chainFreezerHeaderTable indicates the name of the freezer header table.
    22  	chainFreezerHeaderTable = "headers"
    23  
    24  	// chainFreezerHashTable indicates the name of the freezer canonical hash table.
    25  	chainFreezerHashTable = "hashes"
    26  
    27  	// chainFreezerBodiesTable indicates the name of the freezer block body table.
    28  	chainFreezerBodiesTable = "bodies"
    29  
    30  	// chainFreezerReceiptTable indicates the name of the freezer receipts table.
    31  	chainFreezerReceiptTable = "receipts"
    32  
    33  	// chainFreezerDifficultyTable indicates the name of the freezer total difficulty table.
    34  	chainFreezerDifficultyTable = "diffs"
    35  )
    36  
    37  // chainFreezerNoSnappy configures whether compression is disabled for the ancient-tables.
    38  // Hashes and difficulties don't compress well.
    39  var chainFreezerNoSnappy = map[string]bool{
    40  	chainFreezerHeaderTable:     false,
    41  	chainFreezerHashTable:       true,
    42  	chainFreezerBodiesTable:     false,
    43  	chainFreezerReceiptTable:    false,
    44  	chainFreezerDifficultyTable: true,
    45  }
    46  
    47  // The list of identifiers of ancient stores.
    48  var (
    49  	chainFreezerName = "chain" // the folder name of chain segment ancient store.
    50  )
    51  
    52  // freezers the collections of all builtin freezers.
    53  var freezers = []string{chainFreezerName}