aboutsummaryrefslogtreecommitdiffstats
path: root/core/rawdb/schema.go
diff options
context:
space:
mode:
authorJimmy Hu <jimmy.hu@dexon.org>2019-03-13 18:19:53 +0800
committerWei-Ning Huang <w@dexon.org>2019-04-09 21:32:58 +0800
commit3ac5e2363b00fde97288baa173c3d89c1b2e5ec1 (patch)
treec126ebef9ff1b22076a10501ad5041598c927fcc /core/rawdb/schema.go
parente87b2f32c79a811bccc2a00c89ac2e533a7da5e0 (diff)
downloaddexon-3ac5e2363b00fde97288baa173c3d89c1b2e5ec1.tar.gz
dexon-3ac5e2363b00fde97288baa173c3d89c1b2e5ec1.tar.zst
dexon-3ac5e2363b00fde97288baa173c3d89c1b2e5ec1.zip
vendor: sync to latest core (#253)
Diffstat (limited to 'core/rawdb/schema.go')
-rw-r--r--core/rawdb/schema.go15
1 files changed, 12 insertions, 3 deletions
diff --git a/core/rawdb/schema.go b/core/rawdb/schema.go
index 87a56c0ba..b469468f4 100644
--- a/core/rawdb/schema.go
+++ b/core/rawdb/schema.go
@@ -53,9 +53,10 @@ 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")
- coreDKGPrivateKeyPrefix = []byte("DPK")
- coreCompactionChainTipKey = []byte("CoreChainTip")
+ coreBlockPrefix = []byte("D")
+ coreDKGPrivateKeyPrefix = []byte("DPK")
+ coreCompactionChainTipKey = []byte("CoreChainTip")
+ coreDKGMasterPrivateSharesPrefix = []byte("CoreDKGPrv")
preimagePrefix = []byte("secure-key-") // preimagePrefix + hash -> preimage
configPrefix = []byte("ethereum-config-") // config prefix for the db
@@ -130,6 +131,14 @@ func coreDKGPrivateKeyKey(round uint64) []byte {
return ret
}
+// coreDKGMasterPrivateSharesKey = coreDKGMasterPrivateSharesPrefix + round
+func coreDKGMasterPrivateSharesKey(round uint64) []byte {
+ ret := make([]byte, len(coreDKGMasterPrivateSharesPrefix)+8)
+ copy(ret, coreDKGMasterPrivateSharesPrefix)
+ binary.LittleEndian.PutUint64(ret[len(coreDKGMasterPrivateSharesPrefix):], 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()...)