mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-11 20:20:05 +00:00
b50f1583f3
* store validator min max span * terence feedback * terence feedback * raul feedback * raul formatting feedback * raul formatting feedback * raul validatorIdx feedback * fix * shorter err * Update slasher/db/min_max_span.go Co-Authored-By: terence tsao <terence@prysmaticlabs.com> * Update proto/eth/v1alpha1/slasher.proto Co-Authored-By: terence tsao <terence@prysmaticlabs.com> * Update slasher/db/min_max_span.go Co-Authored-By: terence tsao <terence@prysmaticlabs.com> * Update slasher/db/min_max_span.go Co-Authored-By: terence tsao <terence@prysmaticlabs.com> * Update slasher/db/min_max_span.go Co-Authored-By: terence tsao <terence@prysmaticlabs.com> * Update slasher/db/min_max_span.go Co-Authored-By: terence tsao <terence@prysmaticlabs.com> * Update slasher/db/min_max-span_test.go Co-Authored-By: terence tsao <terence@prysmaticlabs.com> * Update slasher/db/min_max-span_test.go
64 lines
2.4 KiB
Protocol Buffer
64 lines
2.4 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package ethereum.eth.v1alpha1;
|
|
|
|
import "google/protobuf/empty.proto";
|
|
import "proto/eth/v1alpha1/beacon_block.proto";
|
|
import "proto/eth/v1alpha1/attestation.proto";
|
|
|
|
option go_package = "github.com/prysmaticlabs/prysm/proto/eth/v1alpha1;eth";
|
|
|
|
// Slasher service API
|
|
//
|
|
// Slasher service provides an interface for validators and beacon chain server to query
|
|
// and subscribe for slashable events on the network as well as to make sure that the
|
|
// attestation or proposal they are going to submit to the network are not going to
|
|
// produce a slashable event.
|
|
service Slasher {
|
|
// Gets AttesterSlashing container if the attestation that
|
|
// was received produces a slashable event.
|
|
rpc IsSlashableAttestation(ethereum.eth.v1alpha1.Attestation) returns (ethereum.eth.v1alpha1.AttesterSlashing);
|
|
|
|
// Gets ProposerSlashing container if the block header that
|
|
// was received produces a slashable event.
|
|
rpc IsSlashableBlock(ProposerSlashingRequest) returns (ProposerSlashingResponse);
|
|
|
|
// Subscription to receive all slashable proposer slashing events found by the watchtower.
|
|
rpc SlashableProposals(google.protobuf.Empty) returns (stream ethereum.eth.v1alpha1.ProposerSlashing);
|
|
|
|
// Subscription to receive all slashable attester slashing events found by the watchtower.
|
|
rpc SlashableAttestations(google.protobuf.Empty) returns (stream ethereum.eth.v1alpha1.AttesterSlashing);
|
|
}
|
|
|
|
message ValidatorIDToIdxAtt {
|
|
repeated uint64 indices = 1 ;
|
|
bytes data_root = 2;
|
|
// 96 bytes aggregate signature.
|
|
bytes signature = 3;
|
|
}
|
|
message ValidatorIDToIdxAttList {
|
|
repeated ValidatorIDToIdxAtt indicesList = 1 ;
|
|
}
|
|
|
|
message ProposerSlashingRequest {
|
|
ethereum.eth.v1alpha1.BeaconBlockHeader block_header = 1;
|
|
uint64 validator_index = 2;
|
|
}
|
|
message ProposerSlashingResponse {
|
|
repeated ethereum.eth.v1alpha1.ProposerSlashing proposer_slashing = 1;
|
|
}
|
|
// In order to detect surrounded attestation we need to compare
|
|
// each attestation source to those spans
|
|
// see https://github.com/protolambda/eth2-surround/blob/master/README.md#min-max-surround
|
|
// for further details.
|
|
message MinMaxSpan {
|
|
uint32 min_span = 1;
|
|
uint32 max_span = 2;
|
|
}
|
|
// every validator will have his own spans map containing min and max value for each epoch
|
|
// in order to detect slashable attestation as quick as possible.
|
|
message EpochSpanMap {
|
|
// uint64 is for storing the epoch
|
|
map<uint64, MinMaxSpan> epoch_span_map = 1;
|
|
}
|