2019-09-02 15:36:29 +00:00
|
|
|
package db
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/prysmaticlabs/prysm/shared/bytesutil"
|
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
|
|
|
// Slasher
|
2019-10-19 03:35:09 +00:00
|
|
|
historicIndexedAttestationsBucket = []byte("historic-indexed-attestations-bucket")
|
|
|
|
historicBlockHeadersBucket = []byte("historic-block-headers-bucket")
|
|
|
|
indexedAttestationsIndicesBucket = []byte("indexed-attestations-indices-bucket")
|
2019-11-05 13:54:27 +00:00
|
|
|
validatorsPublicKeysBucket = []byte("validators-public-keys-bucket")
|
2019-09-02 15:36:29 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func encodeEpochValidatorID(epoch uint64, validatorID uint64) []byte {
|
|
|
|
return append(bytesutil.Bytes8(epoch), bytesutil.Bytes8(validatorID)...)
|
|
|
|
}
|
|
|
|
|
|
|
|
func encodeEpochValidatorIDSig(epoch uint64, validatorID uint64, sig []byte) []byte {
|
|
|
|
return append(append(bytesutil.Bytes8(epoch), bytesutil.Bytes8(validatorID)...), sig...)
|
|
|
|
}
|
2019-10-19 03:35:09 +00:00
|
|
|
|
2019-10-31 07:29:13 +00:00
|
|
|
func encodeEpochSig(sourceEpoch uint64, targetEpoch uint64, sig []byte) []byte {
|
|
|
|
st := append(bytesutil.Bytes8(sourceEpoch), bytesutil.Bytes8(targetEpoch)...)
|
|
|
|
return append(st, sig...)
|
2019-10-19 03:35:09 +00:00
|
|
|
}
|