github.com/fibonacci-chain/fbc@v0.0.0-20231124064014-c7636198c1e9/libs/cosmos-sdk/store/mpt/params.go (about) 1 package mpt 2 3 import ( 4 ethcmn "github.com/ethereum/go-ethereum/common" 5 ethtypes "github.com/ethereum/go-ethereum/core/types" 6 "github.com/ethereum/go-ethereum/crypto" 7 "github.com/fibonacci-chain/fbc/libs/cosmos-sdk/types" 8 ) 9 10 const ( 11 StoreTypeMPT = types.StoreTypeMPT 12 13 TriesInMemory = 100 14 15 // StoreKey is string representation of the store key for mpt 16 StoreKey = "mpt" 17 ) 18 19 const ( 20 FlagTrieWriteAhead = "trie.write-ahead" 21 FlagTrieDirtyDisabled = "trie.dirty-disabled" 22 FlagTrieCacheSize = "trie.cache-size" 23 FlagTrieNodesLimit = "trie.nodes-limit" 24 FlagTrieImgsLimit = "trie.imgs-limit" 25 ) 26 27 var ( 28 TrieWriteAhead = false 29 TrieDirtyDisabled = false 30 TrieCacheSize uint = 2048 // MB 31 TrieNodesLimit uint = 256 // MB 32 TrieImgsLimit uint = 4 // MB 33 TrieCommitGap int64 = 100 34 ) 35 36 var ( 37 KeyPrefixAccRootMptHash = []byte{0x11} 38 KeyPrefixAccLatestStoredHeight = []byte{0x12} 39 KeyPrefixEvmRootMptHash = []byte{0x13} 40 KeyPrefixEvmLatestStoredHeight = []byte{0x14} 41 42 GAccToPrefetchChannel = make(chan [][]byte, 2000) 43 GAccTryUpdateTrieChannel = make(chan struct{}) 44 GAccTrieUpdatedChannel = make(chan struct{}) 45 ) 46 47 var ( 48 NilHash = ethcmn.Hash{} 49 50 // EmptyCodeHash is the known hash of an empty code. 51 EmptyCodeHash = crypto.Keccak256Hash(nil) 52 EmptyCodeHashBytes = crypto.Keccak256(nil) 53 54 // EmptyRootHash is the known root hash of an empty trie. 55 EmptyRootHash = ethtypes.EmptyRootHash 56 EmptyRootHashBytes = EmptyRootHash.Bytes() 57 )