2021-01-22 23:12:22 +00:00
|
|
|
package format
|
2020-11-17 22:37:43 +00:00
|
|
|
|
2021-02-03 16:59:17 +00:00
|
|
|
// InterchangeFormatVersion specified by https://eips.ethereum.org/EIPS/eip-3076.
|
2020-11-17 22:37:43 +00:00
|
|
|
// The version Prysm supports is version 5.
|
2021-02-03 16:59:17 +00:00
|
|
|
const InterchangeFormatVersion = "5"
|
2020-11-17 22:37:43 +00:00
|
|
|
|
|
|
|
// EIPSlashingProtectionFormat string representation of a standard
|
|
|
|
// format for representing validator slashing protection db data.
|
|
|
|
type EIPSlashingProtectionFormat struct {
|
|
|
|
Metadata struct {
|
|
|
|
InterchangeFormatVersion string `json:"interchange_format_version"`
|
|
|
|
GenesisValidatorsRoot string `json:"genesis_validators_root"`
|
|
|
|
} `json:"metadata"`
|
|
|
|
Data []*ProtectionData `json:"data"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// ProtectionData field for the standard slashing protection format.
|
|
|
|
type ProtectionData struct {
|
|
|
|
Pubkey string `json:"pubkey"`
|
|
|
|
SignedBlocks []*SignedBlock `json:"signed_blocks"`
|
|
|
|
SignedAttestations []*SignedAttestation `json:"signed_attestations"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// SignedAttestation in the standard slashing protection format file, including
|
|
|
|
// a source epoch, target epoch, and an optional signing root.
|
|
|
|
type SignedAttestation struct {
|
|
|
|
SourceEpoch string `json:"source_epoch"`
|
|
|
|
TargetEpoch string `json:"target_epoch"`
|
|
|
|
SigningRoot string `json:"signing_root,omitempty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// SignedBlock in the standard slashing protection format, including a slot
|
|
|
|
// and an optional signing root.
|
|
|
|
type SignedBlock struct {
|
|
|
|
Slot string `json:"slot"`
|
|
|
|
SigningRoot string `json:"signing_root,omitempty"`
|
|
|
|
}
|