Replace highest with lowest for signed epoch DB methods (#7965)

* Replace highest with lowerest

* Update validator/db/kv/attestation_history_v2.go

Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>

* Update validator/db/kv/attestation_history_v2.go

Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>

* Invert equality for saveLowestSourceTargetToDB

Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
This commit is contained in:
terence tsao
2020-11-26 09:35:36 -08:00
committed by GitHub
parent 10857223d0
commit c456dcdce8
7 changed files with 110 additions and 110 deletions

View File

@@ -27,10 +27,10 @@ type ValidatorDB interface {
ProposedPublicKeys(ctx context.Context) ([][48]byte, error)
// Attester protection related methods.
HighestSignedTargetEpoch(ctx context.Context, publicKey [48]byte) (uint64, error)
HighestSignedSourceEpoch(ctx context.Context, publicKey [48]byte) (uint64, error)
SaveHighestSignedTargetEpoch(ctx context.Context, publicKey [48]byte, epoch uint64) error
SaveHighestSignedSourceEpoch(ctx context.Context, publicKey [48]byte, epoch uint64) error
LowestSignedTargetEpoch(ctx context.Context, publicKey [48]byte) (uint64, error)
LowestSignedSourceEpoch(ctx context.Context, publicKey [48]byte) (uint64, error)
SaveLowestSignedTargetEpoch(ctx context.Context, publicKey [48]byte, epoch uint64) error
SaveLowestSignedSourceEpoch(ctx context.Context, publicKey [48]byte, epoch uint64) error
AttestationHistoryForPubKeysV2(ctx context.Context, publicKeys [][48]byte) (map[[48]byte]kv.EncHistoryData, error)
SaveAttestationHistoryForPubKeysV2(ctx context.Context, historyByPubKeys map[[48]byte]kv.EncHistoryData) error
SaveAttestationHistoryForPubKeyV2(ctx context.Context, pubKey [48]byte, history kv.EncHistoryData) error