Documentation ¶
Index ¶
- Variables
- type AttesterSlashingTest
- type ProposerSlashingTest
- type SlashingInterceptor
- func (s *SlashingInterceptor) InterceptAttestationData(ctx context.Context, slot phase0.Slot, committeeIndex phase0.CommitteeIndex, ...) (*phase0.AttestationData, error)
- func (s *SlashingInterceptor) InterceptAttesterDuties(ctx context.Context, epoch phase0.Epoch, indices []phase0.ValidatorIndex, ...) ([]*v1.AttesterDuty, error)
- func (s *SlashingInterceptor) InterceptBlockProposal(ctx context.Context, slot phase0.Slot, randaoReveal phase0.BLSSignature, ...) (*spec.VersionedBeaconBlock, error)
- func (s *SlashingInterceptor) InterceptProposerDuties(ctx context.Context, epoch phase0.Epoch, indices []phase0.ValidatorIndex, ...) ([]*v1.ProposerDuty, error)
- func (s *SlashingInterceptor) InterceptSubmitAttestations(ctx context.Context, attestations []*phase0.Attestation) ([]*phase0.Attestation, error)
- func (s *SlashingInterceptor) InterceptSubmitBlockProposal(ctx context.Context, block *spec.VersionedSignedBeaconBlock) (*spec.VersionedSignedBeaconBlock, error)
- func (s *SlashingInterceptor) WatchSubmissions()
Constants ¶
This section is empty.
Variables ¶
View Source
var AttesterSlashingTests = []AttesterSlashingTest{ { Name: "SameSource_HigherTarget_DifferentRoot", Slashable: false, Apply: func(data *phase0.AttestationData) error { data.Target.Epoch += startEndEpochsDiff _, err := rand.Read(data.BeaconBlockRoot[:]) return err }, }, { Name: "SameSource_SameTarget_SameRoot", Slashable: true, Apply: func(data *phase0.AttestationData) error { return nil }, }, { Name: "SameSource_SameTarget_DifferentRoot", Slashable: true, Apply: func(data *phase0.AttestationData) error { _, err := rand.Read(data.BeaconBlockRoot[:]) return err }, }, { Name: "LowerSource_HigherTarget_SameRoot", Slashable: true, Apply: func(data *phase0.AttestationData) error { data.Source.Epoch-- return nil }, }, { Name: "LowerSource_HigherTarget_SameRoot", Slashable: true, Apply: func(data *phase0.AttestationData) error { data.Source.Epoch-- return nil }, }, }
View Source
var ProposerSlashingTests = []ProposerSlashingTest{ { Name: "HigherSlot_DifferentRoot", Slashable: false, Apply: func(block *spec.VersionedBeaconBlock) error { switch block.Version { case spec.DataVersionCapella: block.Capella.Slot++ default: return fmt.Errorf("unsupported version: %s", block.Version) } _, err := rand.Read(block.Capella.ParentRoot[:]) return err }, }, { Name: "SameSlot_DifferentRoot", Slashable: true, Apply: func(block *spec.VersionedBeaconBlock) error { switch block.Version { case spec.DataVersionCapella: _, err := rand.Read(block.Capella.ParentRoot[:]) return err default: return fmt.Errorf("unsupported version: %s", block.Version) } }, }, { Name: "LowerSlot_SameRoot", Slashable: true, Apply: func(block *spec.VersionedBeaconBlock) error { switch block.Version { case spec.DataVersionCapella: block.Capella.Slot-- default: return fmt.Errorf("unsupported version: %s", block.Version) } return nil }, }, }
Functions ¶
This section is empty.
Types ¶
type AttesterSlashingTest ¶
type AttesterSlashingTest struct { Name string Slashable bool Apply func(*phase0.AttestationData) error }
type ProposerSlashingTest ¶
type ProposerSlashingTest struct { Name string Slashable bool Apply func(*spec.VersionedBeaconBlock) error }
type SlashingInterceptor ¶
type SlashingInterceptor struct {
// contains filtered or unexported fields
}
func (*SlashingInterceptor) InterceptAttestationData ¶
func (s *SlashingInterceptor) InterceptAttestationData( ctx context.Context, slot phase0.Slot, committeeIndex phase0.CommitteeIndex, data *phase0.AttestationData, ) (*phase0.AttestationData, error)
func (*SlashingInterceptor) InterceptAttesterDuties ¶
func (s *SlashingInterceptor) InterceptAttesterDuties( ctx context.Context, epoch phase0.Epoch, indices []phase0.ValidatorIndex, duties []*v1.AttesterDuty, ) ([]*v1.AttesterDuty, error)
func (*SlashingInterceptor) InterceptBlockProposal ¶
func (s *SlashingInterceptor) InterceptBlockProposal( ctx context.Context, slot phase0.Slot, randaoReveal phase0.BLSSignature, graffiti [32]byte, block *spec.VersionedBeaconBlock, ) (*spec.VersionedBeaconBlock, error)
func (*SlashingInterceptor) InterceptProposerDuties ¶
func (s *SlashingInterceptor) InterceptProposerDuties( ctx context.Context, epoch phase0.Epoch, indices []phase0.ValidatorIndex, duties []*v1.ProposerDuty, ) ([]*v1.ProposerDuty, error)
func (*SlashingInterceptor) InterceptSubmitAttestations ¶
func (s *SlashingInterceptor) InterceptSubmitAttestations( ctx context.Context, attestations []*phase0.Attestation, ) ([]*phase0.Attestation, error)
func (*SlashingInterceptor) InterceptSubmitBlockProposal ¶
func (s *SlashingInterceptor) InterceptSubmitBlockProposal(ctx context.Context, block *spec.VersionedSignedBeaconBlock) (*spec.VersionedSignedBeaconBlock, error)
func (*SlashingInterceptor) WatchSubmissions ¶
func (s *SlashingInterceptor) WatchSubmissions()
Click to show internal directories.
Click to hide internal directories.