aboutsummaryrefslogtreecommitdiffstats
path: root/core/rawdb/schema.go
diff options
context:
space:
mode:
authorMission Liao <mission.liao@dexon.org>2018-12-18 10:02:30 +0800
committerWei-Ning Huang <w@dexon.org>2018-12-19 20:54:27 +0800
commit3e733e42419338c89080657b2e290168818b311a (patch)
tree74654f7ca6f0313c4be3e2cf97f4cfaede32d465 /core/rawdb/schema.go
parent310d8e5329cdccaef4a0add983b75cb5ca1751f9 (diff)
downloaddexon-3e733e42419338c89080657b2e290168818b311a.tar
dexon-3e733e42419338c89080657b2e290168818b311a.tar.gz
dexon-3e733e42419338c89080657b2e290168818b311a.tar.bz2
dexon-3e733e42419338c89080657b2e290168818b311a.tar.lz
dexon-3e733e42419338c89080657b2e290168818b311a.tar.xz
dexon-3e733e42419338c89080657b2e290168818b311a.tar.zst
dexon-3e733e42419338c89080657b2e290168818b311a.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.go12
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()...)