prysm-pulse/slasher/db/schema.go
shayzluf a29032c2bf
Fix indexed attestations Slasher store (#3897)
* first version of the watchtower api

* service files

* Begin work on grpc server

* More changes to server

* REnames and mock setup

* working test

* merge

* double propose detection test

* nishant review

* todo change

* gaz

* fix service

* gaz

* remove unused import

* gaz

* resolve circular dependency

* resolve circular dependency 2nd try

* remove package

* fix package

* fix test

* added tests

* gaz

* remove status check

* gaz

* remove context

* remove context

* change var name

* moved to rpc dir

* gaz

* remove server code

* gaz

* slasher server

* visibility change

* pb

* service update

* gaz

* slasher grpc server

* making it work

* setup db and start

* gaz

* service flags fixes

* grpc service running

* go imports

* remove new initializer

* gaz

* remove feature flags

* change back SetupSlasherDB

* fix SetupSlasherDB calls

* define err

* fix bad merge

* fix test

* fix imports

* fix imports

* fix imports

* add cancel

* comment stop

* fix cancel issue

* remove unneeded code

* bring back bad merge that removed TODO

* remove use of epoch as am input

* fixed slasher to be runable again

* wait for channel close

* gaz

* small test

* flags fix

* fix flag order
2019-10-31 12:59:13 +05:30

26 lines
856 B
Go

package db
import (
"github.com/prysmaticlabs/prysm/shared/bytesutil"
)
var (
// Slasher
historicIndexedAttestationsBucket = []byte("historic-indexed-attestations-bucket")
historicBlockHeadersBucket = []byte("historic-block-headers-bucket")
indexedAttestationsIndicesBucket = []byte("indexed-attestations-indices-bucket")
)
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...)
}
func encodeEpochSig(sourceEpoch uint64, targetEpoch uint64, sig []byte) []byte {
st := append(bytesutil.Bytes8(sourceEpoch), bytesutil.Bytes8(targetEpoch)...)
return append(st, sig...)
}