prysm-pulse/proto/slashing/slashing.proto

60 lines
2.7 KiB
Protocol Buffer
Raw Normal View History

2019-08-14 19:16:17 +00:00
syntax = "proto3";
package ethereum.slashing;
2019-08-14 19:16:17 +00:00
import "eth/v1alpha1/beacon_block.proto";
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
2019-08-14 19:16:17 +00:00
// Slasher service API
//
2019-08-14 19:16:17 +00:00
// 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
2019-08-14 19:16:17 +00:00
// produce a slashable event.
service Slasher {
// Returns any found attester slashings if the passed in attestation conflicts with a validators history.
Double vote detection (#4049) * first version of the watchtower api * service files * Begin work on grpc server * More changes to server * REnames and mock setup * working test * merge * double propose detection test * nishant review * todo change * gaz * fix service * gaz * remove unused import * gaz * resolve circular dependency * resolve circular dependency 2nd try * remove package * fix package * fix test * added tests * gaz * remove status check * gaz * remove context * remove context * change var name * moved to rpc dir * gaz * remove server code * gaz * slasher server * visibility change * pb * service update * gaz * slasher grpc server * making it work * setup db and start * gaz * service flags fixes * grpc service running * go imports * remove new initializer * gaz * remove feature flags * change back SetupSlasherDB * fix SetupSlasherDB calls * define err * fix bad merge * fix test * fix imports * fix imports * fix imports * add cancel * comment stop * fix cancel issue * remove unneeded code * bring back bad merge that removed TODO * remove use of epoch as am input * fixed slasher to be runable again * wait for channel close * gaz * small test * flags fix * fix flag order * double vote detection * remove source epoch from indexed attestation indices * change server method to receive indexed attestation * start implementation * double vote detection * proto * pb * fir comment * nishant review * import fix * Update slasher/db/indexed_attestations.go Co-Authored-By: terence tsao <terence@prysmaticlabs.com> * terence feedback
2019-11-20 05:14:50 +00:00
rpc IsSlashableAttestation(ethereum.eth.v1alpha1.IndexedAttestation) returns (AttesterSlashingResponse);
2019-08-14 19:16:17 +00:00
// Returns any found proposer slashings if the passed in proposal conflicts with a validators history.
rpc IsSlashableBlock(ethereum.eth.v1alpha1.SignedBeaconBlockHeader) returns (ProposerSlashingResponse);
No sig slasher rpc (#6174) * detect slashable attestations and blocks without db update * lint fixes * fix mock * Merge refs/heads/master into no_sig_slasher_rpc * Merge refs/heads/master into no_sig_slasher_rpc * preston feedback * Merge branch 'no_sig_slasher_rpc' of github.com:prysmaticlabs/prysm into no_sig_slasher_rpc * Merge refs/heads/master into no_sig_slasher_rpc * Merge refs/heads/master into no_sig_slasher_rpc * Merge refs/heads/master into no_sig_slasher_rpc * Merge refs/heads/master into no_sig_slasher_rpc * Merge refs/heads/master into no_sig_slasher_rpc * Merge refs/heads/master into no_sig_slasher_rpc * Merge refs/heads/master into no_sig_slasher_rpc * Merge refs/heads/master into no_sig_slasher_rpc * Merge refs/heads/master into no_sig_slasher_rpc * Merge refs/heads/master into no_sig_slasher_rpc * Merge refs/heads/master into no_sig_slasher_rpc * Merge refs/heads/master into no_sig_slasher_rpc * Merge refs/heads/master into no_sig_slasher_rpc * Merge refs/heads/master into no_sig_slasher_rpc * Merge refs/heads/master into no_sig_slasher_rpc * Merge refs/heads/master into no_sig_slasher_rpc * Merge refs/heads/master into no_sig_slasher_rpc * Merge refs/heads/master into no_sig_slasher_rpc * Merge refs/heads/master into no_sig_slasher_rpc * Merge refs/heads/master into no_sig_slasher_rpc * Merge refs/heads/master into no_sig_slasher_rpc * Merge refs/heads/master into no_sig_slasher_rpc * Merge refs/heads/master into no_sig_slasher_rpc * nishant and ivan feedback * Merge branch 'no_sig_slasher_rpc' of github.com:prysmaticlabs/prysm into no_sig_slasher_rpc * Merge refs/heads/master into no_sig_slasher_rpc * Merge refs/heads/master into no_sig_slasher_rpc * Apply suggestions from code review
2020-06-11 18:50:12 +00:00
// Returns if a given indexed attestation could be slashable when compared to the slashers history for the attesters.
// This function is read-only, and does not need the indexed attestation to be signed.
rpc IsSlashableAttestationNoUpdate(ethereum.eth.v1alpha1.IndexedAttestation) returns (Slashable);
// Returns if a given beacon block header could be slashable when compared to the slashers history for the proposer.
// This function is read-only, and does not need the beacon block header to be signed.
rpc IsSlashableBlockNoUpdate(ethereum.eth.v1alpha1.BeaconBlockHeader) returns (Slashable);
}
2019-08-14 19:16:17 +00:00
message ProposerSlashingResponse {
repeated ethereum.eth.v1alpha1.ProposerSlashing proposer_slashing = 1;
}
No sig slasher rpc (#6174) * detect slashable attestations and blocks without db update * lint fixes * fix mock * Merge refs/heads/master into no_sig_slasher_rpc * Merge refs/heads/master into no_sig_slasher_rpc * preston feedback * Merge branch 'no_sig_slasher_rpc' of github.com:prysmaticlabs/prysm into no_sig_slasher_rpc * Merge refs/heads/master into no_sig_slasher_rpc * Merge refs/heads/master into no_sig_slasher_rpc * Merge refs/heads/master into no_sig_slasher_rpc * Merge refs/heads/master into no_sig_slasher_rpc * Merge refs/heads/master into no_sig_slasher_rpc * Merge refs/heads/master into no_sig_slasher_rpc * Merge refs/heads/master into no_sig_slasher_rpc * Merge refs/heads/master into no_sig_slasher_rpc * Merge refs/heads/master into no_sig_slasher_rpc * Merge refs/heads/master into no_sig_slasher_rpc * Merge refs/heads/master into no_sig_slasher_rpc * Merge refs/heads/master into no_sig_slasher_rpc * Merge refs/heads/master into no_sig_slasher_rpc * Merge refs/heads/master into no_sig_slasher_rpc * Merge refs/heads/master into no_sig_slasher_rpc * Merge refs/heads/master into no_sig_slasher_rpc * Merge refs/heads/master into no_sig_slasher_rpc * Merge refs/heads/master into no_sig_slasher_rpc * Merge refs/heads/master into no_sig_slasher_rpc * Merge refs/heads/master into no_sig_slasher_rpc * Merge refs/heads/master into no_sig_slasher_rpc * Merge refs/heads/master into no_sig_slasher_rpc * Merge refs/heads/master into no_sig_slasher_rpc * nishant and ivan feedback * Merge branch 'no_sig_slasher_rpc' of github.com:prysmaticlabs/prysm into no_sig_slasher_rpc * Merge refs/heads/master into no_sig_slasher_rpc * Merge refs/heads/master into no_sig_slasher_rpc * Apply suggestions from code review
2020-06-11 18:50:12 +00:00
message Slashable {
bool slashable = 1;
}
message AttesterSlashingResponse {
repeated ethereum.eth.v1alpha1.AttesterSlashing attester_slashing = 1;
2019-08-14 19:16:17 +00:00
}
2019-10-19 03:35:09 +00:00
// ProposalHistory defines the structure for recording a validator's historical proposals.
// Using a bitlist to represent the epochs and an uint64 to mark the latest marked
// epoch of the bitlist, we can easily store which epochs a validator has proposed
// a block for while pruning the older data.
message ProposalHistory {
bytes epoch_bits = 1 [(gogoproto.casttype) = "github.com/prysmaticlabs/go-bitfield.Bitlist"];
uint64 latest_epoch_written = 2;
}
// AttestationHistory defines the structure for recording a validator's historical attestation.
// Using a map[uint64]uint64 to map its target epoch to its source epoch, in order to detect if a
// vote being created is not a double vote and surrounded by, or surrounding any other votes.
// Using an uint64 to mark the latest written epoch, we can safely perform a rolling prune whenever
// the history is updated.
message AttestationHistory {
map<uint64, uint64> target_to_source = 1;
uint64 latest_epoch_written = 2;
}