mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-05-02 03:02:54 -04:00
* Finish refactor for attestation protection
* Finish refactor for proposal history
* Revert "Finish refactor for proposal history"
This reverts commit 2f13720063.
* Fix tests
* Implement UpdateProtections
* Implement refactor
* Fixes
* fix
* Undo proposer changes
* Fix test
* Final look through
* Add tests for protections function
* Add lock
* Add flag in front of attester protection code
* Add proper rwlocks and fix flags
* fix
* fix build
* Fix atestation tests
* Fix deprecated flags
* Add protect attester to standard attesting test
* Remove comment
* gofmt
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
26 lines
1.0 KiB
Go
26 lines
1.0 KiB
Go
// Package iface defines an interface for the validator database.
|
|
package iface
|
|
|
|
import (
|
|
"context"
|
|
"io"
|
|
|
|
"github.com/prysmaticlabs/go-bitfield"
|
|
slashpb "github.com/prysmaticlabs/prysm/proto/slashing"
|
|
)
|
|
|
|
// ValidatorDB defines the necessary methods for a Prysm validator DB.
|
|
type ValidatorDB interface {
|
|
io.Closer
|
|
DatabasePath() string
|
|
ClearDB() error
|
|
// Proposer protection related methods.
|
|
ProposalHistoryForEpoch(ctx context.Context, publicKey []byte, epoch uint64) (bitfield.Bitlist, error)
|
|
SaveProposalHistoryForEpoch(ctx context.Context, publicKey []byte, epoch uint64, history bitfield.Bitlist) error
|
|
DeleteProposalHistory(ctx context.Context, publicKey []byte) error
|
|
// Attester protection related methods.
|
|
AttestationHistoryForPubKeys(ctx context.Context, publicKeys [][48]byte) (map[[48]byte]*slashpb.AttestationHistory, error)
|
|
SaveAttestationHistoryForPubKeys(ctx context.Context, historyByPubKey map[[48]byte]*slashpb.AttestationHistory) error
|
|
DeleteAttestationHistory(ctx context.Context, publicKey []byte) error
|
|
}
|