diff options
author | Mission Liao <mission.liao@dexon.org> | 2018-12-18 10:02:30 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-03-12 12:19:09 +0800 |
commit | 9b24bf9dc17fa8d1fcf658cd2d7a7b4754e65233 (patch) | |
tree | 62340aff3a722cd2a8ccbf36193839f1cc26b8e9 /core/rawdb/schema.go | |
parent | c072ba693976104141caa2bb0828cc1230c4bc00 (diff) | |
download | dexon-9b24bf9dc17fa8d1fcf658cd2d7a7b4754e65233.tar dexon-9b24bf9dc17fa8d1fcf658cd2d7a7b4754e65233.tar.gz dexon-9b24bf9dc17fa8d1fcf658cd2d7a7b4754e65233.tar.bz2 dexon-9b24bf9dc17fa8d1fcf658cd2d7a7b4754e65233.tar.lz dexon-9b24bf9dc17fa8d1fcf658cd2d7a7b4754e65233.tar.xz dexon-9b24bf9dc17fa8d1fcf658cd2d7a7b4754e65233.tar.zst dexon-9b24bf9dc17fa8d1fcf658cd2d7a7b4754e65233.zip |
vendor: sync to latest core (#91)
- Implement new methods in db to cache DKG
private key.
- Implement new methods in db to cache compaction
chain tip.
Diffstat (limited to 'core/rawdb/schema.go')
-rw-r--r-- | core/rawdb/schema.go | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/core/rawdb/schema.go b/core/rawdb/schema.go index 9a820a578..87a56c0ba 100644 --- a/core/rawdb/schema.go +++ b/core/rawdb/schema.go @@ -53,7 +53,9 @@ var ( txLookupPrefix = []byte("l") // txLookupPrefix + hash -> transaction/receipt lookup metadata bloomBitsPrefix = []byte("B") // bloomBitsPrefix + bit (uint16 big endian) + section (uint64 big endian) + hash -> bloom bits - coreBlockPrefix = []byte("D") + coreBlockPrefix = []byte("D") + coreDKGPrivateKeyPrefix = []byte("DPK") + coreCompactionChainTipKey = []byte("CoreChainTip") preimagePrefix = []byte("secure-key-") // preimagePrefix + hash -> preimage configPrefix = []byte("ethereum-config-") // config prefix for the db @@ -120,6 +122,14 @@ func coreBlockKey(hash common.Hash) []byte { return append(coreBlockPrefix, hash.Bytes()...) } +// coreDKGPrivateKeyKey = coreDKGPrivateKeyPrefix + round +func coreDKGPrivateKeyKey(round uint64) []byte { + ret := make([]byte, len(coreDKGPrivateKeyPrefix)+8) + copy(ret, coreDKGPrivateKeyPrefix) + binary.LittleEndian.PutUint64(ret[len(coreDKGPrivateKeyPrefix):], round) + return ret +} + // bloomBitsKey = bloomBitsPrefix + bit (uint16 big endian) + section (uint64 big endian) + hash func bloomBitsKey(bit uint, section uint64, hash common.Hash) []byte { key := append(append(bloomBitsPrefix, make([]byte, 10)...), hash.Bytes()...) |