grpc GetBlock api (#159)

This commit is contained in:
Alex Sharov 2021-11-14 11:08:45 +07:00 committed by GitHub
parent fd19ad8148
commit acc584c097
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 1415 additions and 167 deletions

File diff suppressed because it is too large Load Diff

View File

@ -23,6 +23,12 @@ type ETHBACKENDClient interface {
Etherbase(ctx context.Context, in *EtherbaseRequest, opts ...grpc.CallOption) (*EtherbaseReply, error)
NetVersion(ctx context.Context, in *NetVersionRequest, opts ...grpc.CallOption) (*NetVersionReply, error)
NetPeerCount(ctx context.Context, in *NetPeerCountRequest, opts ...grpc.CallOption) (*NetPeerCountReply, error)
// Fetch Execution Payload using its id.
EngineGetPayloadV1(ctx context.Context, in *EngineGetPayloadRequest, opts ...grpc.CallOption) (*types.ExecutionPayload, error)
// Execute the payload.
EngineExecutePayloadV1(ctx context.Context, in *types.ExecutionPayload, opts ...grpc.CallOption) (*EngineExecutePayloadReply, error)
// Update fork choice
EngineForkChoiceUpdatedV1(ctx context.Context, in *EngineForkChoiceUpdatedRequest, opts ...grpc.CallOption) (*EngineForkChoiceUpdatedReply, error)
// Version returns the service version number
Version(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*types.VersionReply, error)
// ProtocolVersion returns the Ethereum protocol version number (e.g. 66 for ETH66).
@ -30,6 +36,9 @@ type ETHBACKENDClient interface {
// ClientVersion returns the Ethereum client version string using node name convention (e.g. TurboGeth/v2021.03.2-alpha/Linux).
ClientVersion(ctx context.Context, in *ClientVersionRequest, opts ...grpc.CallOption) (*ClientVersionReply, error)
Subscribe(ctx context.Context, in *SubscribeRequest, opts ...grpc.CallOption) (ETHBACKEND_SubscribeClient, error)
// High-level method - can read block from db, snapshots or apply any other logic
// it doesn't provide consistency
Block(ctx context.Context, in *BlockRequest, opts ...grpc.CallOption) (*BlockReply, error)
}
type eTHBACKENDClient struct {
@ -67,6 +76,33 @@ func (c *eTHBACKENDClient) NetPeerCount(ctx context.Context, in *NetPeerCountReq
return out, nil
}
func (c *eTHBACKENDClient) EngineGetPayloadV1(ctx context.Context, in *EngineGetPayloadRequest, opts ...grpc.CallOption) (*types.ExecutionPayload, error) {
out := new(types.ExecutionPayload)
err := c.cc.Invoke(ctx, "/remote.ETHBACKEND/EngineGetPayloadV1", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *eTHBACKENDClient) EngineExecutePayloadV1(ctx context.Context, in *types.ExecutionPayload, opts ...grpc.CallOption) (*EngineExecutePayloadReply, error) {
out := new(EngineExecutePayloadReply)
err := c.cc.Invoke(ctx, "/remote.ETHBACKEND/EngineExecutePayloadV1", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *eTHBACKENDClient) EngineForkChoiceUpdatedV1(ctx context.Context, in *EngineForkChoiceUpdatedRequest, opts ...grpc.CallOption) (*EngineForkChoiceUpdatedReply, error) {
out := new(EngineForkChoiceUpdatedReply)
err := c.cc.Invoke(ctx, "/remote.ETHBACKEND/EngineForkChoiceUpdatedV1", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *eTHBACKENDClient) Version(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*types.VersionReply, error) {
out := new(types.VersionReply)
err := c.cc.Invoke(ctx, "/remote.ETHBACKEND/Version", in, out, opts...)
@ -126,6 +162,15 @@ func (x *eTHBACKENDSubscribeClient) Recv() (*SubscribeReply, error) {
return m, nil
}
func (c *eTHBACKENDClient) Block(ctx context.Context, in *BlockRequest, opts ...grpc.CallOption) (*BlockReply, error) {
out := new(BlockReply)
err := c.cc.Invoke(ctx, "/remote.ETHBACKEND/Block", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// ETHBACKENDServer is the server API for ETHBACKEND service.
// All implementations must embed UnimplementedETHBACKENDServer
// for forward compatibility
@ -133,6 +178,12 @@ type ETHBACKENDServer interface {
Etherbase(context.Context, *EtherbaseRequest) (*EtherbaseReply, error)
NetVersion(context.Context, *NetVersionRequest) (*NetVersionReply, error)
NetPeerCount(context.Context, *NetPeerCountRequest) (*NetPeerCountReply, error)
// Fetch Execution Payload using its id.
EngineGetPayloadV1(context.Context, *EngineGetPayloadRequest) (*types.ExecutionPayload, error)
// Execute the payload.
EngineExecutePayloadV1(context.Context, *types.ExecutionPayload) (*EngineExecutePayloadReply, error)
// Update fork choice
EngineForkChoiceUpdatedV1(context.Context, *EngineForkChoiceUpdatedRequest) (*EngineForkChoiceUpdatedReply, error)
// Version returns the service version number
Version(context.Context, *emptypb.Empty) (*types.VersionReply, error)
// ProtocolVersion returns the Ethereum protocol version number (e.g. 66 for ETH66).
@ -140,6 +191,9 @@ type ETHBACKENDServer interface {
// ClientVersion returns the Ethereum client version string using node name convention (e.g. TurboGeth/v2021.03.2-alpha/Linux).
ClientVersion(context.Context, *ClientVersionRequest) (*ClientVersionReply, error)
Subscribe(*SubscribeRequest, ETHBACKEND_SubscribeServer) error
// High-level method - can read block from db, snapshots or apply any other logic
// it doesn't provide consistency
Block(context.Context, *BlockRequest) (*BlockReply, error)
mustEmbedUnimplementedETHBACKENDServer()
}
@ -156,6 +210,15 @@ func (UnimplementedETHBACKENDServer) NetVersion(context.Context, *NetVersionRequ
func (UnimplementedETHBACKENDServer) NetPeerCount(context.Context, *NetPeerCountRequest) (*NetPeerCountReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method NetPeerCount not implemented")
}
func (UnimplementedETHBACKENDServer) EngineGetPayloadV1(context.Context, *EngineGetPayloadRequest) (*types.ExecutionPayload, error) {
return nil, status.Errorf(codes.Unimplemented, "method EngineGetPayloadV1 not implemented")
}
func (UnimplementedETHBACKENDServer) EngineExecutePayloadV1(context.Context, *types.ExecutionPayload) (*EngineExecutePayloadReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method EngineExecutePayloadV1 not implemented")
}
func (UnimplementedETHBACKENDServer) EngineForkChoiceUpdatedV1(context.Context, *EngineForkChoiceUpdatedRequest) (*EngineForkChoiceUpdatedReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method EngineForkChoiceUpdatedV1 not implemented")
}
func (UnimplementedETHBACKENDServer) Version(context.Context, *emptypb.Empty) (*types.VersionReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Version not implemented")
}
@ -168,6 +231,9 @@ func (UnimplementedETHBACKENDServer) ClientVersion(context.Context, *ClientVersi
func (UnimplementedETHBACKENDServer) Subscribe(*SubscribeRequest, ETHBACKEND_SubscribeServer) error {
return status.Errorf(codes.Unimplemented, "method Subscribe not implemented")
}
func (UnimplementedETHBACKENDServer) Block(context.Context, *BlockRequest) (*BlockReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Block not implemented")
}
func (UnimplementedETHBACKENDServer) mustEmbedUnimplementedETHBACKENDServer() {}
// UnsafeETHBACKENDServer may be embedded to opt out of forward compatibility for this service.
@ -235,6 +301,60 @@ func _ETHBACKEND_NetPeerCount_Handler(srv interface{}, ctx context.Context, dec
return interceptor(ctx, in, info, handler)
}
func _ETHBACKEND_EngineGetPayloadV1_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(EngineGetPayloadRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ETHBACKENDServer).EngineGetPayloadV1(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/remote.ETHBACKEND/EngineGetPayloadV1",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ETHBACKENDServer).EngineGetPayloadV1(ctx, req.(*EngineGetPayloadRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ETHBACKEND_EngineExecutePayloadV1_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(types.ExecutionPayload)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ETHBACKENDServer).EngineExecutePayloadV1(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/remote.ETHBACKEND/EngineExecutePayloadV1",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ETHBACKENDServer).EngineExecutePayloadV1(ctx, req.(*types.ExecutionPayload))
}
return interceptor(ctx, in, info, handler)
}
func _ETHBACKEND_EngineForkChoiceUpdatedV1_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(EngineForkChoiceUpdatedRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ETHBACKENDServer).EngineForkChoiceUpdatedV1(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/remote.ETHBACKEND/EngineForkChoiceUpdatedV1",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ETHBACKENDServer).EngineForkChoiceUpdatedV1(ctx, req.(*EngineForkChoiceUpdatedRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ETHBACKEND_Version_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(emptypb.Empty)
if err := dec(in); err != nil {
@ -310,6 +430,24 @@ func (x *eTHBACKENDSubscribeServer) Send(m *SubscribeReply) error {
return x.ServerStream.SendMsg(m)
}
func _ETHBACKEND_Block_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(BlockRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ETHBACKENDServer).Block(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/remote.ETHBACKEND/Block",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ETHBACKENDServer).Block(ctx, req.(*BlockRequest))
}
return interceptor(ctx, in, info, handler)
}
// ETHBACKEND_ServiceDesc is the grpc.ServiceDesc for ETHBACKEND service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
@ -329,6 +467,18 @@ var ETHBACKEND_ServiceDesc = grpc.ServiceDesc{
MethodName: "NetPeerCount",
Handler: _ETHBACKEND_NetPeerCount_Handler,
},
{
MethodName: "EngineGetPayloadV1",
Handler: _ETHBACKEND_EngineGetPayloadV1_Handler,
},
{
MethodName: "EngineExecutePayloadV1",
Handler: _ETHBACKEND_EngineExecutePayloadV1_Handler,
},
{
MethodName: "EngineForkChoiceUpdatedV1",
Handler: _ETHBACKEND_EngineForkChoiceUpdatedV1_Handler,
},
{
MethodName: "Version",
Handler: _ETHBACKEND_Version_Handler,
@ -341,6 +491,10 @@ var ETHBACKEND_ServiceDesc = grpc.ServiceDesc{
MethodName: "ClientVersion",
Handler: _ETHBACKEND_ClientVersion_Handler,
},
{
MethodName: "Block",
Handler: _ETHBACKEND_Block_Handler,
},
},
Streams: []grpc.StreamDesc{
{

View File

@ -301,7 +301,7 @@ type Pair struct {
K []byte `protobuf:"bytes,1,opt,name=k,proto3" json:"k,omitempty"`
V []byte `protobuf:"bytes,2,opt,name=v,proto3" json:"v,omitempty"`
CursorID uint32 `protobuf:"varint,3,opt,name=cursorID,proto3" json:"cursorID,omitempty"` // send once after new cursor open
TxID uint64 `protobuf:"varint,4,opt,name=txID,proto3" json:"txID,omitempty"` // send once after tx open
TxID uint64 `protobuf:"varint,4,opt,name=txID,proto3" json:"txID,omitempty"` // send once after tx open. mdbx's tx.ID() - id of write transaction in db - where this changes happened
}
func (x *Pair) Reset() {

View File

@ -241,6 +241,116 @@ func (x *H512) GetLo() *H256 {
return nil
}
type H1024 struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Hi *H512 `protobuf:"bytes,1,opt,name=hi,proto3" json:"hi,omitempty"`
Lo *H512 `protobuf:"bytes,2,opt,name=lo,proto3" json:"lo,omitempty"`
}
func (x *H1024) Reset() {
*x = H1024{}
if protoimpl.UnsafeEnabled {
mi := &file_types_types_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *H1024) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*H1024) ProtoMessage() {}
func (x *H1024) ProtoReflect() protoreflect.Message {
mi := &file_types_types_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use H1024.ProtoReflect.Descriptor instead.
func (*H1024) Descriptor() ([]byte, []int) {
return file_types_types_proto_rawDescGZIP(), []int{4}
}
func (x *H1024) GetHi() *H512 {
if x != nil {
return x.Hi
}
return nil
}
func (x *H1024) GetLo() *H512 {
if x != nil {
return x.Lo
}
return nil
}
type H2048 struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Hi *H1024 `protobuf:"bytes,1,opt,name=hi,proto3" json:"hi,omitempty"`
Lo *H1024 `protobuf:"bytes,2,opt,name=lo,proto3" json:"lo,omitempty"`
}
func (x *H2048) Reset() {
*x = H2048{}
if protoimpl.UnsafeEnabled {
mi := &file_types_types_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *H2048) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*H2048) ProtoMessage() {}
func (x *H2048) ProtoReflect() protoreflect.Message {
mi := &file_types_types_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use H2048.ProtoReflect.Descriptor instead.
func (*H2048) Descriptor() ([]byte, []int) {
return file_types_types_proto_rawDescGZIP(), []int{5}
}
func (x *H2048) GetHi() *H1024 {
if x != nil {
return x.Hi
}
return nil
}
func (x *H2048) GetLo() *H1024 {
if x != nil {
return x.Lo
}
return nil
}
// Reply message containing the current service version on the service side
type VersionReply struct {
state protoimpl.MessageState
@ -255,7 +365,7 @@ type VersionReply struct {
func (x *VersionReply) Reset() {
*x = VersionReply{}
if protoimpl.UnsafeEnabled {
mi := &file_types_types_proto_msgTypes[4]
mi := &file_types_types_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -268,7 +378,7 @@ func (x *VersionReply) String() string {
func (*VersionReply) ProtoMessage() {}
func (x *VersionReply) ProtoReflect() protoreflect.Message {
mi := &file_types_types_proto_msgTypes[4]
mi := &file_types_types_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -281,7 +391,7 @@ func (x *VersionReply) ProtoReflect() protoreflect.Message {
// Deprecated: Use VersionReply.ProtoReflect.Descriptor instead.
func (*VersionReply) Descriptor() ([]byte, []int) {
return file_types_types_proto_rawDescGZIP(), []int{4}
return file_types_types_proto_rawDescGZIP(), []int{6}
}
func (x *VersionReply) GetMajor() uint32 {
@ -305,6 +415,152 @@ func (x *VersionReply) GetPatch() uint32 {
return 0
}
type ExecutionPayload struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
ParentHash *H256 `protobuf:"bytes,1,opt,name=parentHash,proto3" json:"parentHash,omitempty"`
Coinbase *H160 `protobuf:"bytes,2,opt,name=coinbase,proto3" json:"coinbase,omitempty"`
StateRoot *H256 `protobuf:"bytes,3,opt,name=stateRoot,proto3" json:"stateRoot,omitempty"`
LogsBloom *H2048 `protobuf:"bytes,4,opt,name=logsBloom,proto3" json:"logsBloom,omitempty"`
Random *H256 `protobuf:"bytes,5,opt,name=random,proto3" json:"random,omitempty"`
BlockNumber uint64 `protobuf:"varint,6,opt,name=blockNumber,proto3" json:"blockNumber,omitempty"`
GasLimit uint64 `protobuf:"varint,7,opt,name=gasLimit,proto3" json:"gasLimit,omitempty"`
GasUsed uint64 `protobuf:"varint,8,opt,name=gasUsed,proto3" json:"gasUsed,omitempty"`
Timestamp uint64 `protobuf:"varint,9,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
ExtraData *H256 `protobuf:"bytes,10,opt,name=extraData,proto3" json:"extraData,omitempty"`
BaseFeePerGas *H256 `protobuf:"bytes,11,opt,name=baseFeePerGas,proto3" json:"baseFeePerGas,omitempty"`
BlockHash *H256 `protobuf:"bytes,12,opt,name=blockHash,proto3" json:"blockHash,omitempty"`
//
//Array of transaction objects, each object is a byte list.
//See https://github.com/ethereum/execution-apis/blob/v1.0.0-alpha.2/src/engine/interop/specification.md
Transactions [][]byte `protobuf:"bytes,13,rep,name=transactions,proto3" json:"transactions,omitempty"`
}
func (x *ExecutionPayload) Reset() {
*x = ExecutionPayload{}
if protoimpl.UnsafeEnabled {
mi := &file_types_types_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ExecutionPayload) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ExecutionPayload) ProtoMessage() {}
func (x *ExecutionPayload) ProtoReflect() protoreflect.Message {
mi := &file_types_types_proto_msgTypes[7]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ExecutionPayload.ProtoReflect.Descriptor instead.
func (*ExecutionPayload) Descriptor() ([]byte, []int) {
return file_types_types_proto_rawDescGZIP(), []int{7}
}
func (x *ExecutionPayload) GetParentHash() *H256 {
if x != nil {
return x.ParentHash
}
return nil
}
func (x *ExecutionPayload) GetCoinbase() *H160 {
if x != nil {
return x.Coinbase
}
return nil
}
func (x *ExecutionPayload) GetStateRoot() *H256 {
if x != nil {
return x.StateRoot
}
return nil
}
func (x *ExecutionPayload) GetLogsBloom() *H2048 {
if x != nil {
return x.LogsBloom
}
return nil
}
func (x *ExecutionPayload) GetRandom() *H256 {
if x != nil {
return x.Random
}
return nil
}
func (x *ExecutionPayload) GetBlockNumber() uint64 {
if x != nil {
return x.BlockNumber
}
return 0
}
func (x *ExecutionPayload) GetGasLimit() uint64 {
if x != nil {
return x.GasLimit
}
return 0
}
func (x *ExecutionPayload) GetGasUsed() uint64 {
if x != nil {
return x.GasUsed
}
return 0
}
func (x *ExecutionPayload) GetTimestamp() uint64 {
if x != nil {
return x.Timestamp
}
return 0
}
func (x *ExecutionPayload) GetExtraData() *H256 {
if x != nil {
return x.ExtraData
}
return nil
}
func (x *ExecutionPayload) GetBaseFeePerGas() *H256 {
if x != nil {
return x.BaseFeePerGas
}
return nil
}
func (x *ExecutionPayload) GetBlockHash() *H256 {
if x != nil {
return x.BlockHash
}
return nil
}
func (x *ExecutionPayload) GetTransactions() [][]byte {
if x != nil {
return x.Transactions
}
return nil
}
var file_types_types_proto_extTypes = []protoimpl.ExtensionInfo{
{
ExtendedType: (*descriptorpb.FileOptions)(nil),
@ -362,30 +618,71 @@ var file_types_types_proto_rawDesc = []byte{
0x35, 0x31, 0x32, 0x12, 0x1b, 0x0a, 0x02, 0x68, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32,
0x0b, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, 0x32, 0x35, 0x36, 0x52, 0x02, 0x68, 0x69,
0x12, 0x1b, 0x0a, 0x02, 0x6c, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x74,
0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, 0x32, 0x35, 0x36, 0x52, 0x02, 0x6c, 0x6f, 0x22, 0x50, 0x0a,
0x0c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x14, 0x0a,
0x05, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6d, 0x61,
0x6a, 0x6f, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01,
0x28, 0x0d, 0x52, 0x05, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x61, 0x74,
0x63, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x70, 0x61, 0x74, 0x63, 0x68, 0x3a,
0x52, 0x0a, 0x15, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6d, 0x61, 0x6a, 0x6f, 0x72,
0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f,
0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xd1, 0x86, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x13,
0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x61, 0x6a, 0x6f, 0x72, 0x56, 0x65, 0x72, 0x73,
0x69, 0x6f, 0x6e, 0x3a, 0x52, 0x0a, 0x15, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6d,
0x69, 0x6e, 0x6f, 0x72, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x2e, 0x67,
0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46,
0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xd2, 0x86, 0x03, 0x20, 0x01,
0x28, 0x0d, 0x52, 0x13, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x69, 0x6e, 0x6f, 0x72,
0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3a, 0x52, 0x0a, 0x15, 0x73, 0x65, 0x72, 0x76, 0x69,
0x63, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e,
0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xd3,
0x86, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x13, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50,
0x61, 0x74, 0x63, 0x68, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x0f, 0x5a, 0x0d, 0x2e,
0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x3b, 0x74, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x33,
0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, 0x32, 0x35, 0x36, 0x52, 0x02, 0x6c, 0x6f, 0x22, 0x41, 0x0a,
0x05, 0x48, 0x31, 0x30, 0x32, 0x34, 0x12, 0x1b, 0x0a, 0x02, 0x68, 0x69, 0x18, 0x01, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, 0x35, 0x31, 0x32, 0x52,
0x02, 0x68, 0x69, 0x12, 0x1b, 0x0a, 0x02, 0x6c, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32,
0x0b, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, 0x35, 0x31, 0x32, 0x52, 0x02, 0x6c, 0x6f,
0x22, 0x43, 0x0a, 0x05, 0x48, 0x32, 0x30, 0x34, 0x38, 0x12, 0x1c, 0x0a, 0x02, 0x68, 0x69, 0x18,
0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, 0x31,
0x30, 0x32, 0x34, 0x52, 0x02, 0x68, 0x69, 0x12, 0x1c, 0x0a, 0x02, 0x6c, 0x6f, 0x18, 0x02, 0x20,
0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, 0x31, 0x30, 0x32,
0x34, 0x52, 0x02, 0x6c, 0x6f, 0x22, 0x50, 0x0a, 0x0c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e,
0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x18, 0x01,
0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x6d,
0x69, 0x6e, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6d, 0x69, 0x6e, 0x6f,
0x72, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x61, 0x74, 0x63, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d,
0x52, 0x05, 0x70, 0x61, 0x74, 0x63, 0x68, 0x22, 0x87, 0x04, 0x0a, 0x10, 0x45, 0x78, 0x65, 0x63,
0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x2b, 0x0a, 0x0a,
0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x48, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b,
0x32, 0x0b, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, 0x32, 0x35, 0x36, 0x52, 0x0a, 0x70,
0x61, 0x72, 0x65, 0x6e, 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x27, 0x0a, 0x08, 0x63, 0x6f, 0x69,
0x6e, 0x62, 0x61, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x74, 0x79,
0x70, 0x65, 0x73, 0x2e, 0x48, 0x31, 0x36, 0x30, 0x52, 0x08, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61,
0x73, 0x65, 0x12, 0x29, 0x0a, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x18,
0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, 0x32,
0x35, 0x36, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x2a, 0x0a,
0x09, 0x6c, 0x6f, 0x67, 0x73, 0x42, 0x6c, 0x6f, 0x6f, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b,
0x32, 0x0c, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, 0x32, 0x30, 0x34, 0x38, 0x52, 0x09,
0x6c, 0x6f, 0x67, 0x73, 0x42, 0x6c, 0x6f, 0x6f, 0x6d, 0x12, 0x23, 0x0a, 0x06, 0x72, 0x61, 0x6e,
0x64, 0x6f, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x74, 0x79, 0x70, 0x65,
0x73, 0x2e, 0x48, 0x32, 0x35, 0x36, 0x52, 0x06, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x12, 0x20,
0x0a, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x06, 0x20,
0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72,
0x12, 0x1a, 0x0a, 0x08, 0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x07, 0x20, 0x01,
0x28, 0x04, 0x52, 0x08, 0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x18, 0x0a, 0x07,
0x67, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x67,
0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74,
0x61, 0x6d, 0x70, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73,
0x74, 0x61, 0x6d, 0x70, 0x12, 0x29, 0x0a, 0x09, 0x65, 0x78, 0x74, 0x72, 0x61, 0x44, 0x61, 0x74,
0x61, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e,
0x48, 0x32, 0x35, 0x36, 0x52, 0x09, 0x65, 0x78, 0x74, 0x72, 0x61, 0x44, 0x61, 0x74, 0x61, 0x12,
0x31, 0x0a, 0x0d, 0x62, 0x61, 0x73, 0x65, 0x46, 0x65, 0x65, 0x50, 0x65, 0x72, 0x47, 0x61, 0x73,
0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48,
0x32, 0x35, 0x36, 0x52, 0x0d, 0x62, 0x61, 0x73, 0x65, 0x46, 0x65, 0x65, 0x50, 0x65, 0x72, 0x47,
0x61, 0x73, 0x12, 0x29, 0x0a, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x18,
0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, 0x32,
0x35, 0x36, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x22, 0x0a,
0x0c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x0d, 0x20,
0x03, 0x28, 0x0c, 0x52, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e,
0x73, 0x3a, 0x52, 0x0a, 0x15, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6d, 0x61, 0x6a,
0x6f, 0x72, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f,
0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c,
0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xd1, 0x86, 0x03, 0x20, 0x01, 0x28, 0x0d,
0x52, 0x13, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x61, 0x6a, 0x6f, 0x72, 0x56, 0x65,
0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3a, 0x52, 0x0a, 0x15, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
0x5f, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1c,
0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xd2, 0x86, 0x03,
0x20, 0x01, 0x28, 0x0d, 0x52, 0x13, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x69, 0x6e,
0x6f, 0x72, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3a, 0x52, 0x0a, 0x15, 0x73, 0x65, 0x72,
0x76, 0x69, 0x63, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69,
0x6f, 0x6e, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73,
0x18, 0xd3, 0x86, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x13, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63,
0x65, 0x50, 0x61, 0x74, 0x63, 0x68, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x0f, 0x5a,
0x0d, 0x2e, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x3b, 0x74, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@ -400,29 +697,44 @@ func file_types_types_proto_rawDescGZIP() []byte {
return file_types_types_proto_rawDescData
}
var file_types_types_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
var file_types_types_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
var file_types_types_proto_goTypes = []interface{}{
(*H128)(nil), // 0: types.H128
(*H160)(nil), // 1: types.H160
(*H256)(nil), // 2: types.H256
(*H512)(nil), // 3: types.H512
(*VersionReply)(nil), // 4: types.VersionReply
(*descriptorpb.FileOptions)(nil), // 5: google.protobuf.FileOptions
(*H1024)(nil), // 4: types.H1024
(*H2048)(nil), // 5: types.H2048
(*VersionReply)(nil), // 6: types.VersionReply
(*ExecutionPayload)(nil), // 7: types.ExecutionPayload
(*descriptorpb.FileOptions)(nil), // 8: google.protobuf.FileOptions
}
var file_types_types_proto_depIdxs = []int32{
0, // 0: types.H160.hi:type_name -> types.H128
0, // 1: types.H256.hi:type_name -> types.H128
0, // 2: types.H256.lo:type_name -> types.H128
2, // 3: types.H512.hi:type_name -> types.H256
2, // 4: types.H512.lo:type_name -> types.H256
5, // 5: types.service_major_version:extendee -> google.protobuf.FileOptions
5, // 6: types.service_minor_version:extendee -> google.protobuf.FileOptions
5, // 7: types.service_patch_version:extendee -> google.protobuf.FileOptions
8, // [8:8] is the sub-list for method output_type
8, // [8:8] is the sub-list for method input_type
8, // [8:8] is the sub-list for extension type_name
5, // [5:8] is the sub-list for extension extendee
0, // [0:5] is the sub-list for field type_name
0, // 0: types.H160.hi:type_name -> types.H128
0, // 1: types.H256.hi:type_name -> types.H128
0, // 2: types.H256.lo:type_name -> types.H128
2, // 3: types.H512.hi:type_name -> types.H256
2, // 4: types.H512.lo:type_name -> types.H256
3, // 5: types.H1024.hi:type_name -> types.H512
3, // 6: types.H1024.lo:type_name -> types.H512
4, // 7: types.H2048.hi:type_name -> types.H1024
4, // 8: types.H2048.lo:type_name -> types.H1024
2, // 9: types.ExecutionPayload.parentHash:type_name -> types.H256
1, // 10: types.ExecutionPayload.coinbase:type_name -> types.H160
2, // 11: types.ExecutionPayload.stateRoot:type_name -> types.H256
5, // 12: types.ExecutionPayload.logsBloom:type_name -> types.H2048
2, // 13: types.ExecutionPayload.random:type_name -> types.H256
2, // 14: types.ExecutionPayload.extraData:type_name -> types.H256
2, // 15: types.ExecutionPayload.baseFeePerGas:type_name -> types.H256
2, // 16: types.ExecutionPayload.blockHash:type_name -> types.H256
8, // 17: types.service_major_version:extendee -> google.protobuf.FileOptions
8, // 18: types.service_minor_version:extendee -> google.protobuf.FileOptions
8, // 19: types.service_patch_version:extendee -> google.protobuf.FileOptions
20, // [20:20] is the sub-list for method output_type
20, // [20:20] is the sub-list for method input_type
20, // [20:20] is the sub-list for extension type_name
17, // [17:20] is the sub-list for extension extendee
0, // [0:17] is the sub-list for field type_name
}
func init() { file_types_types_proto_init() }
@ -480,6 +792,30 @@ func file_types_types_proto_init() {
}
}
file_types_types_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*H1024); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_types_types_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*H2048); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_types_types_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*VersionReply); i {
case 0:
return &v.state
@ -491,6 +827,18 @@ func file_types_types_proto_init() {
return nil
}
}
file_types_types_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ExecutionPayload); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
@ -498,7 +846,7 @@ func file_types_types_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_types_types_proto_rawDesc,
NumEnums: 0,
NumMessages: 5,
NumMessages: 8,
NumExtensions: 3,
NumServices: 0,
},

View File

@ -18,11 +18,11 @@ web3 = []
arrayref = "0.3"
ethereum-types = { version = "0.12", default-features = false }
once_cell = { version = "1", optional = true }
prost = "0.8"
prost = "0.9"
serde = { version = "1", features = ["derive"], optional = true }
toml = { version = "0.5", optional = true }
tonic = "0.5"
tonic = "0.6"
[build-dependencies]
prost-build = "0.8"
tonic-build = "0.5"
prost-build = "0.9"
tonic-build = "0.6"

View File

@ -11,8 +11,18 @@ service ETHBACKEND {
rpc Etherbase(EtherbaseRequest) returns (EtherbaseReply);
rpc NetVersion(NetVersionRequest) returns (NetVersionReply);
rpc NetPeerCount(NetPeerCountRequest) returns (NetPeerCountReply);
// "The Merge" RPC Requests to be netively implemented in the Erigon Node Backend
// Fetch Execution Payload using its id.
rpc EngineGetPayloadV1(EngineGetPayloadRequest) returns (types.ExecutionPayload);
// Execute the payload.
rpc EngineExecutePayloadV1(types.ExecutionPayload) returns (EngineExecutePayloadReply);
// Update fork choice
rpc EngineForkChoiceUpdatedV1(EngineForkChoiceUpdatedRequest) returns (EngineForkChoiceUpdatedReply);
// Version returns the service version number
rpc Version(google.protobuf.Empty) returns (types.VersionReply);
@ -24,6 +34,10 @@ service ETHBACKEND {
rpc ClientVersion(ClientVersionRequest) returns (ClientVersionReply);
rpc Subscribe(SubscribeRequest) returns (stream SubscribeReply);
// High-level method - can read block from db, snapshots or apply any other logic
// it doesn't provide consistency
rpc Block(BlockRequest) returns (BlockReply);
}
enum Event {
@ -44,6 +58,38 @@ message NetPeerCountRequest {}
message NetPeerCountReply { uint64 count = 1; }
message EngineGetPayloadRequest {
uint64 payloadId = 1;
}
message EngineExecutePayloadReply {
string status = 1;
types.H256 latestValidHash = 2;
}
message EnginePreparePayload {
types.H256 parentHash = 1;
uint64 timestamp = 2;
types.H256 random = 3;
types.H160 feeRecipient = 4;
}
message EngineForkChoiceUpdated {
types.H256 headBlockHash = 1;
types.H256 safeBlockHash = 2;
types.H256 finalizedBlockHash = 3;
}
message EngineForkChoiceUpdatedRequest {
EnginePreparePayload headBlockHash = 1;
EngineForkChoiceUpdated safeBlockHash = 2;
}
message EngineForkChoiceUpdatedReply {
string status = 1;
uint64 payloadId = 2;
}
message ProtocolVersionRequest {}
message ProtocolVersionReply { uint64 id = 1; }
@ -61,3 +107,13 @@ message SubscribeReply {
bytes data = 2; // serialized data
}
message BlockRequest {
uint64 blockHeight = 2;
types.H256 blockHash = 3;
}
message BlockReply {
bytes blockRlp = 1;
bytes senders = 2;
}

View File

@ -20,6 +20,7 @@ service KV {
rpc Tx(stream Cursor) returns (stream Pair);
rpc StateChanges(StateChangeRequest) returns (stream StateChangeBatch);
}
enum Op {
@ -55,7 +56,7 @@ message Pair {
bytes k = 1;
bytes v = 2;
uint32 cursorID = 3; // send once after new cursor open
uint64 txID = 4; // send once after tx open
uint64 txID = 4; // send once after tx open. mdbx's tx.ID() - id of write transaction in db - where this changes happened
}
enum Action {

View File

@ -38,9 +38,38 @@ message H512 {
H256 lo = 2;
}
message H1024 {
H512 hi = 1;
H512 lo = 2;
}
message H2048 {
H1024 hi = 1;
H1024 lo = 2;
}
// Reply message containing the current service version on the service side
message VersionReply {
uint32 major = 1;
uint32 minor = 2;
uint32 patch = 3;
}
message ExecutionPayload {
types.H256 parentHash = 1;
types.H160 coinbase = 2;
types.H256 stateRoot = 3;
types.H2048 logsBloom = 4;
types.H256 random = 5;
uint64 blockNumber = 6;
uint64 gasLimit = 7;
uint64 gasUsed = 8;
uint64 timestamp = 9;
types.H256 extraData = 10;
types.H256 baseFeePerGas = 11;
types.H256 blockHash = 12;
/*
Array of transaction objects, each object is a byte list.
See https://github.com/ethereum/execution-apis/blob/v1.0.0-alpha.2/src/engine/interop/specification.md
*/
repeated bytes transactions = 13;
}