erigon-pulse/interfaces/remote/ethbackend.proto

157 lines
3.8 KiB
Protocol Buffer
Raw Normal View History

syntax = "proto3";
import "google/protobuf/empty.proto";
import "types/types.proto";
package remote;
option go_package = "./remote;remote";
service ETHBACKEND {
rpc Etherbase(EtherbaseRequest) returns (EtherbaseReply);
rpc NetVersion(NetVersionRequest) returns (NetVersionReply);
2021-11-14 04:08:45 +00:00
rpc NetPeerCount(NetPeerCountRequest) returns (NetPeerCountReply);
2021-11-14 04:08:45 +00:00
// ------------------------------------------------------------------------
// "The Merge" RPC requests natively implemented in the Erigon node backend
// Fetch Execution Payload using its ID.
2021-11-14 04:08:45 +00:00
rpc EngineGetPayloadV1(EngineGetPayloadRequest) returns (types.ExecutionPayload);
// Validate and possibly execute the payload.
rpc EngineNewPayloadV1(types.ExecutionPayload) returns (EnginePayloadStatus);
2021-11-14 04:08:45 +00:00
// Update fork choice
rpc EngineForkChoiceUpdatedV1(EngineForkChoiceUpdatedRequest) returns (EngineForkChoiceUpdatedReply);
// End of the Merge requests
// ------------------------------------------------------------------------
// Version returns the service version number
rpc Version(google.protobuf.Empty) returns (types.VersionReply);
// ProtocolVersion returns the Ethereum protocol version number (e.g. 66 for ETH66).
rpc ProtocolVersion(ProtocolVersionRequest) returns (ProtocolVersionReply);
// ClientVersion returns the Ethereum client version string using node name convention (e.g. TurboGeth/v2021.03.2-alpha/Linux).
rpc ClientVersion(ClientVersionRequest) returns (ClientVersionReply);
rpc Subscribe(SubscribeRequest) returns (stream SubscribeReply);
2021-11-14 04:08:45 +00:00
// High-level method - can read block from db, snapshots or apply any other logic
// it doesn't provide consistency
2022-01-07 10:14:21 +00:00
// Request fields are optional - it's ok to request block only by hash or only by number
2021-11-14 04:08:45 +00:00
rpc Block(BlockRequest) returns (BlockReply);
2022-01-07 10:14:21 +00:00
// High-level method - can find block number by txn hash
// it doesn't provide consistency
rpc TxnLookup(TxnLookupRequest) returns (TxnLookupReply);
// NodeInfo collects and returns NodeInfo from all running celery instances.
rpc NodeInfo(NodesInfoRequest) returns(NodesInfoReply);
}
enum Event {
HEADER = 0;
PENDING_LOGS = 1;
PENDING_BLOCK = 2;
}
message EtherbaseRequest {}
message EtherbaseReply { types.H160 address = 1; }
message NetVersionRequest {}
message NetVersionReply { uint64 id = 1; }
message NetPeerCountRequest {}
message NetPeerCountReply { uint64 count = 1; }
2021-11-14 04:08:45 +00:00
message EngineGetPayloadRequest {
uint64 payloadId = 1;
}
enum EngineStatus {
VALID = 0;
INVALID = 1;
SYNCING = 2;
ACCEPTED = 3;
INVALID_BLOCK_HASH = 4;
INVALID_TERMINAL_BLOCK = 5;
}
message EnginePayloadStatus {
EngineStatus status = 1;
2021-11-14 04:08:45 +00:00
types.H256 latestValidHash = 2;
string validationError = 3;
2021-11-14 04:08:45 +00:00
}
message EnginePayloadAttributes {
uint64 timestamp = 1;
types.H256 random = 2;
types.H160 suggestedFeeRecipient = 3;
2021-11-14 04:08:45 +00:00
}
message EngineForkChoiceState {
2021-11-14 04:08:45 +00:00
types.H256 headBlockHash = 1;
types.H256 safeBlockHash = 2;
types.H256 finalizedBlockHash = 3;
}
message EngineForkChoiceUpdatedRequest {
EngineForkChoiceState forkchoiceState = 1;
EnginePayloadAttributes payloadAttributes = 2;
2021-11-14 04:08:45 +00:00
}
message EngineForkChoiceUpdatedReply {
EnginePayloadStatus payloadStatus = 1;
2021-11-14 04:08:45 +00:00
uint64 payloadId = 2;
}
message ProtocolVersionRequest {}
message ProtocolVersionReply { uint64 id = 1; }
message ClientVersionRequest {}
message ClientVersionReply { string nodeName = 1; }
message SubscribeRequest {
Event type = 1;
}
message SubscribeReply {
Event type = 1;
bytes data = 2; // serialized data
}
2021-11-14 04:08:45 +00:00
message BlockRequest {
uint64 blockHeight = 2;
types.H256 blockHash = 3;
}
message BlockReply {
bytes blockRlp = 1;
bytes senders = 2;
}
2022-01-07 10:14:21 +00:00
message TxnLookupRequest {
types.H256 txnHash = 1;
}
message TxnLookupReply {
uint64 blockNumber = 1;
}
message NodesInfoRequest {
uint32 limit = 1;
}
message NodesInfoReply {
repeated types.NodeInfoReply nodesInfo = 1;
}