Documentation ¶
Index ¶
- func ExportSlashingProtectionJSONCli(cliCtx *cli.Context) error
- func ImportSlashingProtectionCLI(cliCtx *cli.Context) error
- type Config
- type Service
- func (s *Service) CheckAttestationSafety(ctx context.Context, attestation *ethpb.IndexedAttestation) bool
- func (s *Service) CheckBlockSafety(ctx context.Context, blockHeader *ethpb.BeaconBlockHeader) bool
- func (s *Service) CommitAttestation(ctx context.Context, attestation *ethpb.IndexedAttestation) bool
- func (s *Service) CommitBlock(ctx context.Context, blockHeader *ethpb.SignedBeaconBlockHeader) (bool, error)
- func (s *Service) Start()
- func (s *Service) Status() error
- func (s *Service) Stop() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExportSlashingProtectionJSONCli ¶ added in v1.2.0
func ExportSlashingProtectionJSONCli(cliCtx *cli.Context) error
ExportSlashingProtectionJSONCli extracts a validator's slashing protection history from their database and formats it into an EIP-3076 standard JSON file via a CLI entrypoint to make it easy to migrate machines or Ethereum consensus clients.
Steps: 1. Parse a path to the validator's datadir from the CLI context. 2. Open the validator database. 3. Call the function which actually exports the data from from the validator's db into an EIP standard slashing protection format 4. Format and save the JSON file to a user's specified output directory.
func ImportSlashingProtectionCLI ¶ added in v1.2.0
func ImportSlashingProtectionCLI(cliCtx *cli.Context) error
ImportSlashingProtectionCLI reads an input slashing protection EIP-3076 standard JSON file and attempts to insert its data into our validator DB.
Steps: 1. Parse a path to the validator's datadir from the CLI context. 2. Open the validator database. 3. Read the JSON file from user input. 4. Call the function which actually imports the data from from the standard slashing protection JSON file into our database.
Types ¶
type Config ¶
type Config struct { Endpoint string CertFlag string GrpcMaxCallRecvMsgSizeFlag int GrpcRetriesFlag uint GrpcRetryDelay time.Duration GrpcHeadersFlag string }
Config for the validator service.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service represents a service to manage the validator �slashing protection.
func NewService ¶
NewService creates a new validator service for the service registry.
func (*Service) CheckAttestationSafety ¶
func (s *Service) CheckAttestationSafety(ctx context.Context, attestation *ethpb.IndexedAttestation) bool
CheckAttestationSafety implements the slashing protection for attestations without db update. To be used before signing.
func (*Service) CheckBlockSafety ¶
CheckBlockSafety this function is part of slashing protection for block proposals it performs validation without db update. To be used before the block is signed.
func (*Service) CommitAttestation ¶
func (s *Service) CommitAttestation(ctx context.Context, attestation *ethpb.IndexedAttestation) bool
CommitAttestation implements the slashing protection for attestations it performs validation and db update. To be used after the attestation is proposed.
func (*Service) CommitBlock ¶
func (s *Service) CommitBlock(ctx context.Context, blockHeader *ethpb.SignedBeaconBlockHeader) (bool, error)
CommitBlock this function is part of slashing protection for block proposals it performs validation and db update. To be used after the block is proposed.
func (*Service) Start ¶
func (s *Service) Start()
Start the slasher protection service and grpc client.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
local
|
|
standard-protection-format/format
Package format defines methods to parse, import, and export slashing protection data from a standard JSON file according to EIP-3076 https://eips.ethereum.org/EIPS/eip-3076.
|
Package format defines methods to parse, import, and export slashing protection data from a standard JSON file according to EIP-3076 https://eips.ethereum.org/EIPS/eip-3076. |