github.com/tacshi/go-ethereum@v0.0.0-20230616113857-84a434e20921/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}