github.com/prysmaticlabs/prysm@v1.4.4/proto/eth/v1/events_service.proto (about) 1 // Copyright 2020 Prysmatic Labs. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 syntax = "proto3"; 15 16 package ethereum.eth.v1; 17 18 import "google/api/annotations.proto"; 19 import "google/protobuf/descriptor.proto"; 20 import "proto/eth/ext/options.proto"; 21 import "proto/gateway/event_source.proto"; 22 23 option csharp_namespace = "Ethereum.Eth.v1"; 24 option go_package = "github.com/prysmaticlabs/prysm/proto/eth/v1"; 25 option java_multiple_files = true; 26 option java_outer_classname = "BeaconEventsProto"; 27 option java_package = "org.ethereum.eth.v1"; 28 option php_namespace = "Ethereum\\Eth\\v1"; 29 30 // Events API 31 // 32 // This service is defined in the upstream Ethereum consensus APIs repository (eth2.0-APIs/apis/debug). 33 service Events { 34 rpc StreamEvents(StreamEventsRequest) returns (stream gateway.EventSource) { 35 option (google.api.http) = { 36 get: "/eth/v1/events" 37 }; 38 } 39 } 40 41 message StreamEventsRequest { 42 // List of topics to request for event streaming items. Allowed request topics are 43 // head, attestation, block, voluntary_exit, finalized_checkpoint, chain_reorg. 44 repeated string topics = 1; 45 } 46 47 message EventHead { 48 // Slot of the new chain head. 49 uint64 slot = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Slot"]; 50 51 // Block root of the new chain head. 52 bytes block = 2 [(ethereum.eth.ext.ssz_size) = "32"]; 53 54 // State root of the new chain head. 55 bytes state = 3 [(ethereum.eth.ext.ssz_size) = "32"]; 56 57 // Whether or not the new chain head is at an epoch transition. 58 bool epoch_transition = 4; 59 60 // The previous dependent root. 61 bytes previous_duty_dependent_root = 5 [(ethereum.eth.ext.ssz_size) = "32"]; 62 63 // The current dependent root. 64 bytes current_duty_dependent_root = 6 [(ethereum.eth.ext.ssz_size) = "32"]; 65 } 66 67 message EventBlock { 68 // The slot of the observed block. 69 uint64 slot = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Slot"]; 70 71 // The root of the observed block. 72 bytes block = 2 [(ethereum.eth.ext.ssz_size) = "32"]; 73 } 74 75 message EventChainReorg { 76 // The slot of the observed reorg. 77 uint64 slot = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Slot"]; 78 79 // Depth of the reorg in slots. 80 uint64 depth = 2; 81 82 // Block root of the old head. 83 bytes old_head_block = 3 [(ethereum.eth.ext.ssz_size) = "32"]; 84 85 // Block root of the new head. 86 bytes new_head_block = 4 [(ethereum.eth.ext.ssz_size) = "32"]; 87 88 // State root of the old state. 89 bytes old_head_state = 5 [(ethereum.eth.ext.ssz_size) = "32"]; 90 91 // State root of the new state. 92 bytes new_head_state = 6 [(ethereum.eth.ext.ssz_size) = "32"]; 93 94 // Epoch of the observed reorg. 95 uint64 epoch = 7 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"]; 96 } 97 98 message EventFinalizedCheckpoint { 99 // Block root of the finalized checkpoint. 100 bytes block = 1 [(ethereum.eth.ext.ssz_size) = "32"]; 101 102 // State root of the finalized checkpoint. 103 bytes state = 2 [(ethereum.eth.ext.ssz_size) = "32"]; 104 105 // Epoch the checkpoint references. 106 uint64 epoch = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"]; 107 }