diff --git a/direct/execution_client.go b/direct/execution_client.go index 867ec524a..3fd062cf8 100644 --- a/direct/execution_client.go +++ b/direct/execution_client.go @@ -88,3 +88,7 @@ func (s *ExecutionClientDirect) GetHeaderHashNumber(ctx context.Context, in *typ func (s *ExecutionClientDirect) GetForkChoice(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*execution.ForkChoice, error) { return s.server.GetForkChoice(ctx, in) } + +func (s *ExecutionClientDirect) Ready(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*execution.ReadyResponse, error) { + return s.server.Ready(ctx, in) +} diff --git a/go.mod b/go.mod index 1bfa25fbd..14299727b 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/ledgerwatch/erigon-lib go 1.19 require ( - github.com/ledgerwatch/interfaces v0.0.0-20230731192530-801b5852e33e + github.com/ledgerwatch/interfaces v0.0.0-20230804204553-2578723af0cf github.com/ledgerwatch/log/v3 v3.8.0 github.com/ledgerwatch/secp256k1 v1.0.0 github.com/ledgerwatch/trackerslist v1.1.0 diff --git a/go.sum b/go.sum index 710efef47..feb35e109 100644 --- a/go.sum +++ b/go.sum @@ -233,8 +233,8 @@ github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/leanovate/gopter v0.2.9 h1:fQjYxZaynp97ozCzfOyOuAGOU4aU/z37zf/tOujFk7c= -github.com/ledgerwatch/interfaces v0.0.0-20230731192530-801b5852e33e h1:a++pG0zOOAOpF/2yRwTwbh7urXLUfO7YZQfb182vjqA= -github.com/ledgerwatch/interfaces v0.0.0-20230731192530-801b5852e33e/go.mod h1:ugQv1QllJzBny3cKZKxUrSnykkjkBgm27eQM6dnGAcc= +github.com/ledgerwatch/interfaces v0.0.0-20230804204553-2578723af0cf h1:8M4mGiIRrH7LXErJ63pVkS/F9npjYExbaa0TD3PmOek= +github.com/ledgerwatch/interfaces v0.0.0-20230804204553-2578723af0cf/go.mod h1:ugQv1QllJzBny3cKZKxUrSnykkjkBgm27eQM6dnGAcc= github.com/ledgerwatch/log/v3 v3.8.0 h1:gCpp7uGtIerEz1jKVPeDnbIopFPud9ZnCpBLlLBGqPU= github.com/ledgerwatch/log/v3 v3.8.0/go.mod h1:J2Jl6zV/58LeA6LTaVVnCGyf1/cYYSEOOLHY4ZN8S2A= github.com/ledgerwatch/secp256k1 v1.0.0 h1:Usvz87YoTG0uePIV8woOof5cQnLXGYa162rFf3YnwaQ= diff --git a/gointerfaces/execution/execution.pb.go b/gointerfaces/execution/execution.pb.go index 4f936a188..beeb773d3 100644 --- a/gointerfaces/execution/execution.pb.go +++ b/gointerfaces/execution/execution.pb.go @@ -1337,6 +1337,53 @@ func (x *GetAssembledBlockResponse) GetBusy() bool { return false } +type ReadyResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Ready bool `protobuf:"varint,1,opt,name=ready,proto3" json:"ready,omitempty"` +} + +func (x *ReadyResponse) Reset() { + *x = ReadyResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_execution_execution_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReadyResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReadyResponse) ProtoMessage() {} + +func (x *ReadyResponse) ProtoReflect() protoreflect.Message { + mi := &file_execution_execution_proto_msgTypes[20] + 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 ReadyResponse.ProtoReflect.Descriptor instead. +func (*ReadyResponse) Descriptor() ([]byte, []int) { + return file_execution_execution_proto_rawDescGZIP(), []int{20} +} + +func (x *ReadyResponse) GetReady() bool { + if x != nil { + return x.Ready + } + return false +} + var File_execution_execution_proto protoreflect.FileDescriptor var file_execution_execution_proto_rawDesc = []byte{ @@ -1547,77 +1594,83 @@ var file_execution_execution_proto_rawDesc = []byte{ 0x6c, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x88, 0x01, 0x01, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x75, 0x73, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x62, 0x75, 0x73, 0x79, 0x42, 0x07, 0x0a, 0x05, 0x5f, - 0x64, 0x61, 0x74, 0x61, 0x2a, 0x71, 0x0a, 0x0f, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, - 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x75, 0x63, 0x63, 0x65, - 0x73, 0x73, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x42, 0x61, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, - 0x10, 0x01, 0x12, 0x0e, 0x0a, 0x0a, 0x54, 0x6f, 0x6f, 0x46, 0x61, 0x72, 0x41, 0x77, 0x61, 0x79, - 0x10, 0x02, 0x12, 0x12, 0x0a, 0x0e, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x67, - 0x6d, 0x65, 0x6e, 0x74, 0x10, 0x03, 0x12, 0x15, 0x0a, 0x11, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, - 0x64, 0x46, 0x6f, 0x72, 0x6b, 0x63, 0x68, 0x6f, 0x69, 0x63, 0x65, 0x10, 0x04, 0x12, 0x08, 0x0a, - 0x04, 0x42, 0x75, 0x73, 0x79, 0x10, 0x05, 0x32, 0xd1, 0x07, 0x0a, 0x09, 0x45, 0x78, 0x65, 0x63, - 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4c, 0x0a, 0x0d, 0x49, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x48, - 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x1f, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, - 0x6f, 0x6e, 0x2e, 0x49, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, - 0x69, 0x6f, 0x6e, 0x2e, 0x49, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, - 0x75, 0x6c, 0x74, 0x12, 0x4a, 0x0a, 0x0c, 0x49, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x42, 0x6f, 0x64, - 0x69, 0x65, 0x73, 0x12, 0x1e, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, - 0x49, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x42, 0x6f, 0x64, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, - 0x49, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, - 0x4b, 0x0a, 0x0d, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, - 0x12, 0x1c, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x56, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, - 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x12, 0x47, 0x0a, 0x10, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x46, 0x6f, 0x72, 0x6b, 0x43, 0x68, 0x6f, 0x69, 0x63, 0x65, - 0x12, 0x15, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x46, 0x6f, 0x72, - 0x6b, 0x43, 0x68, 0x6f, 0x69, 0x63, 0x65, 0x1a, 0x1c, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, - 0x69, 0x6f, 0x6e, 0x2e, 0x46, 0x6f, 0x72, 0x6b, 0x43, 0x68, 0x6f, 0x69, 0x63, 0x65, 0x52, 0x65, - 0x63, 0x65, 0x69, 0x70, 0x74, 0x12, 0x52, 0x0a, 0x0d, 0x41, 0x73, 0x73, 0x65, 0x6d, 0x62, 0x6c, - 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x1f, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, - 0x6f, 0x6e, 0x2e, 0x41, 0x73, 0x73, 0x65, 0x6d, 0x62, 0x6c, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, - 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x73, 0x73, 0x65, 0x6d, 0x62, 0x6c, 0x65, 0x42, 0x6c, 0x6f, 0x63, - 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5e, 0x0a, 0x11, 0x47, 0x65, 0x74, - 0x41, 0x73, 0x73, 0x65, 0x6d, 0x62, 0x6c, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x23, - 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x73, - 0x73, 0x65, 0x6d, 0x62, 0x6c, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, - 0x47, 0x65, 0x74, 0x41, 0x73, 0x73, 0x65, 0x6d, 0x62, 0x6c, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, - 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x45, 0x0a, 0x0d, 0x43, 0x75, 0x72, - 0x72, 0x65, 0x6e, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, - 0x74, 0x79, 0x1a, 0x1c, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, - 0x65, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x3f, 0x0a, 0x05, 0x47, 0x65, 0x74, 0x54, 0x44, 0x12, 0x1c, 0x2e, 0x65, 0x78, 0x65, 0x63, - 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, - 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x44, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x47, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x1c, - 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x65, - 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x65, - 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x48, 0x65, 0x61, 0x64, - 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x07, 0x47, 0x65, - 0x74, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x1c, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, + 0x64, 0x61, 0x74, 0x61, 0x22, 0x25, 0x0a, 0x0d, 0x52, 0x65, 0x61, 0x64, 0x79, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x65, 0x61, 0x64, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x72, 0x65, 0x61, 0x64, 0x79, 0x2a, 0x71, 0x0a, 0x0f, 0x45, + 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0b, + 0x0a, 0x07, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x42, + 0x61, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x10, 0x01, 0x12, 0x0e, 0x0a, 0x0a, 0x54, 0x6f, 0x6f, + 0x46, 0x61, 0x72, 0x41, 0x77, 0x61, 0x79, 0x10, 0x02, 0x12, 0x12, 0x0a, 0x0e, 0x4d, 0x69, 0x73, + 0x73, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x10, 0x03, 0x12, 0x15, 0x0a, + 0x11, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x46, 0x6f, 0x72, 0x6b, 0x63, 0x68, 0x6f, 0x69, + 0x63, 0x65, 0x10, 0x04, 0x12, 0x08, 0x0a, 0x04, 0x42, 0x75, 0x73, 0x79, 0x10, 0x05, 0x32, 0x8c, + 0x08, 0x0a, 0x09, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4c, 0x0a, 0x0d, + 0x49, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x1f, 0x2e, + 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x49, 0x6e, 0x73, 0x65, 0x72, 0x74, + 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, + 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x49, 0x6e, 0x73, 0x65, 0x72, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x4a, 0x0a, 0x0c, 0x49, 0x6e, + 0x73, 0x65, 0x72, 0x74, 0x42, 0x6f, 0x64, 0x69, 0x65, 0x73, 0x12, 0x1e, 0x2e, 0x65, 0x78, 0x65, + 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x49, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x42, 0x6f, 0x64, + 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x65, 0x78, 0x65, + 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x49, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x4b, 0x0a, 0x0d, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x12, 0x1c, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, + 0x69, 0x6f, 0x6e, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x63, 0x65, + 0x69, 0x70, 0x74, 0x12, 0x47, 0x0a, 0x10, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x46, 0x6f, 0x72, + 0x6b, 0x43, 0x68, 0x6f, 0x69, 0x63, 0x65, 0x12, 0x15, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, + 0x69, 0x6f, 0x6e, 0x2e, 0x46, 0x6f, 0x72, 0x6b, 0x43, 0x68, 0x6f, 0x69, 0x63, 0x65, 0x1a, 0x1c, + 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x46, 0x6f, 0x72, 0x6b, 0x43, + 0x68, 0x6f, 0x69, 0x63, 0x65, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x12, 0x52, 0x0a, 0x0d, + 0x41, 0x73, 0x73, 0x65, 0x6d, 0x62, 0x6c, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x1f, 0x2e, + 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x73, 0x73, 0x65, 0x6d, 0x62, + 0x6c, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, + 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x73, 0x73, 0x65, 0x6d, + 0x62, 0x6c, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x5e, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x41, 0x73, 0x73, 0x65, 0x6d, 0x62, 0x6c, 0x65, 0x64, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x23, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x73, 0x73, 0x65, 0x6d, 0x62, 0x6c, 0x65, 0x64, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x65, 0x78, 0x65, + 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x73, 0x73, 0x65, 0x6d, 0x62, + 0x6c, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x45, 0x0a, 0x0d, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1c, 0x2e, 0x65, 0x78, 0x65, 0x63, + 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3f, 0x0a, 0x05, 0x47, 0x65, 0x74, 0x54, 0x44, + 0x12, 0x1c, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, + 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, + 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x44, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x47, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x48, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x1c, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, - 0x47, 0x65, 0x74, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x3e, 0x0a, 0x0f, 0x49, 0x73, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x69, 0x63, 0x61, 0x6c, 0x48, 0x61, - 0x73, 0x68, 0x12, 0x0b, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, 0x32, 0x35, 0x36, 0x1a, - 0x1e, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x49, 0x73, 0x43, 0x61, - 0x6e, 0x6f, 0x6e, 0x69, 0x63, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x4a, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x48, 0x61, 0x73, 0x68, - 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x0b, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, - 0x32, 0x35, 0x36, 0x1a, 0x26, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, - 0x47, 0x65, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x48, 0x61, 0x73, 0x68, 0x4e, 0x75, 0x6d, - 0x62, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3e, 0x0a, 0x0d, 0x47, - 0x65, 0x74, 0x46, 0x6f, 0x72, 0x6b, 0x43, 0x68, 0x6f, 0x69, 0x63, 0x65, 0x12, 0x16, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, - 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x15, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, - 0x2e, 0x46, 0x6f, 0x72, 0x6b, 0x43, 0x68, 0x6f, 0x69, 0x63, 0x65, 0x42, 0x17, 0x5a, 0x15, 0x2e, - 0x2f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x65, 0x78, 0x65, 0x63, 0x75, - 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, + 0x47, 0x65, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x43, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x1c, 0x2e, 0x65, + 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x65, 0x67, 0x6d, + 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x65, 0x78, 0x65, + 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3e, 0x0a, 0x0f, 0x49, 0x73, 0x43, 0x61, 0x6e, 0x6f, + 0x6e, 0x69, 0x63, 0x61, 0x6c, 0x48, 0x61, 0x73, 0x68, 0x12, 0x0b, 0x2e, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2e, 0x48, 0x32, 0x35, 0x36, 0x1a, 0x1e, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, + 0x6f, 0x6e, 0x2e, 0x49, 0x73, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x69, 0x63, 0x61, 0x6c, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4a, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x48, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x48, 0x61, 0x73, 0x68, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x0b, 0x2e, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, 0x32, 0x35, 0x36, 0x1a, 0x26, 0x2e, 0x65, 0x78, 0x65, + 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x48, 0x61, 0x73, 0x68, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x3e, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x46, 0x6f, 0x72, 0x6b, 0x43, 0x68, 0x6f, + 0x69, 0x63, 0x65, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x15, 0x2e, 0x65, 0x78, + 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x46, 0x6f, 0x72, 0x6b, 0x43, 0x68, 0x6f, 0x69, + 0x63, 0x65, 0x12, 0x39, 0x0a, 0x05, 0x52, 0x65, 0x61, 0x64, 0x79, 0x12, 0x16, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, + 0x70, 0x74, 0x79, 0x1a, 0x18, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, + 0x52, 0x65, 0x61, 0x64, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x17, 0x5a, + 0x15, 0x2e, 0x2f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x65, 0x78, 0x65, + 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1633,7 +1686,7 @@ func file_execution_execution_proto_rawDescGZIP() []byte { } var file_execution_execution_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_execution_execution_proto_msgTypes = make([]protoimpl.MessageInfo, 20) +var file_execution_execution_proto_msgTypes = make([]protoimpl.MessageInfo, 21) var file_execution_execution_proto_goTypes = []interface{}{ (ExecutionStatus)(0), // 0: execution.ExecutionStatus (*ForkChoiceReceipt)(nil), // 1: execution.ForkChoiceReceipt @@ -1656,53 +1709,54 @@ var file_execution_execution_proto_goTypes = []interface{}{ (*GetAssembledBlockRequest)(nil), // 18: execution.GetAssembledBlockRequest (*AssembledBlockData)(nil), // 19: execution.AssembledBlockData (*GetAssembledBlockResponse)(nil), // 20: execution.GetAssembledBlockResponse - (*types.H256)(nil), // 21: types.H256 - (*types.H160)(nil), // 22: types.H160 - (*types.H2048)(nil), // 23: types.H2048 - (*types.Withdrawal)(nil), // 24: types.Withdrawal - (*types.ExecutionPayload)(nil), // 25: types.ExecutionPayload - (*types.BlobsBundleV1)(nil), // 26: types.BlobsBundleV1 - (*emptypb.Empty)(nil), // 27: google.protobuf.Empty + (*ReadyResponse)(nil), // 21: execution.ReadyResponse + (*types.H256)(nil), // 22: types.H256 + (*types.H160)(nil), // 23: types.H160 + (*types.H2048)(nil), // 24: types.H2048 + (*types.Withdrawal)(nil), // 25: types.Withdrawal + (*types.ExecutionPayload)(nil), // 26: types.ExecutionPayload + (*types.BlobsBundleV1)(nil), // 27: types.BlobsBundleV1 + (*emptypb.Empty)(nil), // 28: google.protobuf.Empty } var file_execution_execution_proto_depIdxs = []int32{ 0, // 0: execution.ForkChoiceReceipt.status:type_name -> execution.ExecutionStatus - 21, // 1: execution.ForkChoiceReceipt.latest_valid_hash:type_name -> types.H256 + 22, // 1: execution.ForkChoiceReceipt.latest_valid_hash:type_name -> types.H256 0, // 2: execution.ValidationReceipt.validation_status:type_name -> execution.ExecutionStatus - 21, // 3: execution.ValidationReceipt.latest_valid_hash:type_name -> types.H256 - 21, // 4: execution.ValidationReceipt.missing_hash:type_name -> types.H256 - 21, // 5: execution.Header.parent_hash:type_name -> types.H256 - 22, // 6: execution.Header.coinbase:type_name -> types.H160 - 21, // 7: execution.Header.state_root:type_name -> types.H256 - 21, // 8: execution.Header.receipt_root:type_name -> types.H256 - 23, // 9: execution.Header.logs_bloom:type_name -> types.H2048 - 21, // 10: execution.Header.prev_randao:type_name -> types.H256 - 21, // 11: execution.Header.difficulty:type_name -> types.H256 - 21, // 12: execution.Header.block_hash:type_name -> types.H256 - 21, // 13: execution.Header.ommer_hash:type_name -> types.H256 - 21, // 14: execution.Header.transaction_hash:type_name -> types.H256 - 21, // 15: execution.Header.base_fee_per_gas:type_name -> types.H256 - 21, // 16: execution.Header.withdrawal_hash:type_name -> types.H256 - 21, // 17: execution.BlockBody.block_hash:type_name -> types.H256 + 22, // 3: execution.ValidationReceipt.latest_valid_hash:type_name -> types.H256 + 22, // 4: execution.ValidationReceipt.missing_hash:type_name -> types.H256 + 22, // 5: execution.Header.parent_hash:type_name -> types.H256 + 23, // 6: execution.Header.coinbase:type_name -> types.H160 + 22, // 7: execution.Header.state_root:type_name -> types.H256 + 22, // 8: execution.Header.receipt_root:type_name -> types.H256 + 24, // 9: execution.Header.logs_bloom:type_name -> types.H2048 + 22, // 10: execution.Header.prev_randao:type_name -> types.H256 + 22, // 11: execution.Header.difficulty:type_name -> types.H256 + 22, // 12: execution.Header.block_hash:type_name -> types.H256 + 22, // 13: execution.Header.ommer_hash:type_name -> types.H256 + 22, // 14: execution.Header.transaction_hash:type_name -> types.H256 + 22, // 15: execution.Header.base_fee_per_gas:type_name -> types.H256 + 22, // 16: execution.Header.withdrawal_hash:type_name -> types.H256 + 22, // 17: execution.BlockBody.block_hash:type_name -> types.H256 4, // 18: execution.BlockBody.uncles:type_name -> execution.Header - 24, // 19: execution.BlockBody.withdrawals:type_name -> types.Withdrawal + 25, // 19: execution.BlockBody.withdrawals:type_name -> types.Withdrawal 4, // 20: execution.GetHeaderResponse.header:type_name -> execution.Header - 21, // 21: execution.GetTDResponse.td:type_name -> types.H256 + 22, // 21: execution.GetTDResponse.td:type_name -> types.H256 5, // 22: execution.GetBodyResponse.body:type_name -> execution.BlockBody - 21, // 23: execution.GetSegmentRequest.block_hash:type_name -> types.H256 + 22, // 23: execution.GetSegmentRequest.block_hash:type_name -> types.H256 4, // 24: execution.InsertHeadersRequest.headers:type_name -> execution.Header 5, // 25: execution.InsertBodiesRequest.bodies:type_name -> execution.BlockBody - 21, // 26: execution.ForkChoice.head_block_hash:type_name -> types.H256 - 21, // 27: execution.ForkChoice.finalized_block_hash:type_name -> types.H256 - 21, // 28: execution.ForkChoice.safe_block_hash:type_name -> types.H256 + 22, // 26: execution.ForkChoice.head_block_hash:type_name -> types.H256 + 22, // 27: execution.ForkChoice.finalized_block_hash:type_name -> types.H256 + 22, // 28: execution.ForkChoice.safe_block_hash:type_name -> types.H256 0, // 29: execution.InsertionResult.result:type_name -> execution.ExecutionStatus - 21, // 30: execution.ValidationRequest.hash:type_name -> types.H256 - 21, // 31: execution.AssembleBlockRequest.parentHash:type_name -> types.H256 - 21, // 32: execution.AssembleBlockRequest.mixDigest:type_name -> types.H256 - 22, // 33: execution.AssembleBlockRequest.suggestedFeeRecipent:type_name -> types.H160 - 24, // 34: execution.AssembleBlockRequest.withdrawals:type_name -> types.Withdrawal - 25, // 35: execution.AssembledBlockData.execution_payload:type_name -> types.ExecutionPayload - 21, // 36: execution.AssembledBlockData.block_value:type_name -> types.H256 - 26, // 37: execution.AssembledBlockData.blobs_bundle:type_name -> types.BlobsBundleV1 + 22, // 30: execution.ValidationRequest.hash:type_name -> types.H256 + 22, // 31: execution.AssembleBlockRequest.parentHash:type_name -> types.H256 + 22, // 32: execution.AssembleBlockRequest.mixDigest:type_name -> types.H256 + 23, // 33: execution.AssembleBlockRequest.suggestedFeeRecipent:type_name -> types.H160 + 25, // 34: execution.AssembleBlockRequest.withdrawals:type_name -> types.Withdrawal + 26, // 35: execution.AssembledBlockData.execution_payload:type_name -> types.ExecutionPayload + 22, // 36: execution.AssembledBlockData.block_value:type_name -> types.H256 + 27, // 37: execution.AssembledBlockData.blobs_bundle:type_name -> types.BlobsBundleV1 19, // 38: execution.GetAssembledBlockResponse.data:type_name -> execution.AssembledBlockData 11, // 39: execution.Execution.InsertHeaders:input_type -> execution.InsertHeadersRequest 12, // 40: execution.Execution.InsertBodies:input_type -> execution.InsertBodiesRequest @@ -1710,28 +1764,30 @@ var file_execution_execution_proto_depIdxs = []int32{ 13, // 42: execution.Execution.UpdateForkChoice:input_type -> execution.ForkChoice 16, // 43: execution.Execution.AssembleBlock:input_type -> execution.AssembleBlockRequest 18, // 44: execution.Execution.GetAssembledBlock:input_type -> execution.GetAssembledBlockRequest - 27, // 45: execution.Execution.CurrentHeader:input_type -> google.protobuf.Empty + 28, // 45: execution.Execution.CurrentHeader:input_type -> google.protobuf.Empty 10, // 46: execution.Execution.GetTD:input_type -> execution.GetSegmentRequest 10, // 47: execution.Execution.GetHeader:input_type -> execution.GetSegmentRequest 10, // 48: execution.Execution.GetBody:input_type -> execution.GetSegmentRequest - 21, // 49: execution.Execution.IsCanonicalHash:input_type -> types.H256 - 21, // 50: execution.Execution.GetHeaderHashNumber:input_type -> types.H256 - 27, // 51: execution.Execution.GetForkChoice:input_type -> google.protobuf.Empty - 14, // 52: execution.Execution.InsertHeaders:output_type -> execution.InsertionResult - 14, // 53: execution.Execution.InsertBodies:output_type -> execution.InsertionResult - 2, // 54: execution.Execution.ValidateChain:output_type -> execution.ValidationReceipt - 1, // 55: execution.Execution.UpdateForkChoice:output_type -> execution.ForkChoiceReceipt - 17, // 56: execution.Execution.AssembleBlock:output_type -> execution.AssembleBlockResponse - 20, // 57: execution.Execution.GetAssembledBlock:output_type -> execution.GetAssembledBlockResponse - 6, // 58: execution.Execution.CurrentHeader:output_type -> execution.GetHeaderResponse - 7, // 59: execution.Execution.GetTD:output_type -> execution.GetTDResponse - 6, // 60: execution.Execution.GetHeader:output_type -> execution.GetHeaderResponse - 8, // 61: execution.Execution.GetBody:output_type -> execution.GetBodyResponse - 3, // 62: execution.Execution.IsCanonicalHash:output_type -> execution.IsCanonicalResponse - 9, // 63: execution.Execution.GetHeaderHashNumber:output_type -> execution.GetHeaderHashNumberResponse - 13, // 64: execution.Execution.GetForkChoice:output_type -> execution.ForkChoice - 52, // [52:65] is the sub-list for method output_type - 39, // [39:52] is the sub-list for method input_type + 22, // 49: execution.Execution.IsCanonicalHash:input_type -> types.H256 + 22, // 50: execution.Execution.GetHeaderHashNumber:input_type -> types.H256 + 28, // 51: execution.Execution.GetForkChoice:input_type -> google.protobuf.Empty + 28, // 52: execution.Execution.Ready:input_type -> google.protobuf.Empty + 14, // 53: execution.Execution.InsertHeaders:output_type -> execution.InsertionResult + 14, // 54: execution.Execution.InsertBodies:output_type -> execution.InsertionResult + 2, // 55: execution.Execution.ValidateChain:output_type -> execution.ValidationReceipt + 1, // 56: execution.Execution.UpdateForkChoice:output_type -> execution.ForkChoiceReceipt + 17, // 57: execution.Execution.AssembleBlock:output_type -> execution.AssembleBlockResponse + 20, // 58: execution.Execution.GetAssembledBlock:output_type -> execution.GetAssembledBlockResponse + 6, // 59: execution.Execution.CurrentHeader:output_type -> execution.GetHeaderResponse + 7, // 60: execution.Execution.GetTD:output_type -> execution.GetTDResponse + 6, // 61: execution.Execution.GetHeader:output_type -> execution.GetHeaderResponse + 8, // 62: execution.Execution.GetBody:output_type -> execution.GetBodyResponse + 3, // 63: execution.Execution.IsCanonicalHash:output_type -> execution.IsCanonicalResponse + 9, // 64: execution.Execution.GetHeaderHashNumber:output_type -> execution.GetHeaderHashNumberResponse + 13, // 65: execution.Execution.GetForkChoice:output_type -> execution.ForkChoice + 21, // 66: execution.Execution.Ready:output_type -> execution.ReadyResponse + 53, // [53:67] is the sub-list for method output_type + 39, // [39:53] is the sub-list for method input_type 39, // [39:39] is the sub-list for extension type_name 39, // [39:39] is the sub-list for extension extendee 0, // [0:39] is the sub-list for field type_name @@ -1983,6 +2039,18 @@ func file_execution_execution_proto_init() { return nil } } + file_execution_execution_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReadyResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } file_execution_execution_proto_msgTypes[1].OneofWrappers = []interface{}{} file_execution_execution_proto_msgTypes[3].OneofWrappers = []interface{}{} @@ -1999,7 +2067,7 @@ func file_execution_execution_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_execution_execution_proto_rawDesc, NumEnums: 1, - NumMessages: 20, + NumMessages: 21, NumExtensions: 0, NumServices: 1, }, diff --git a/gointerfaces/execution/execution_grpc.pb.go b/gointerfaces/execution/execution_grpc.pb.go index 9c91b7215..8741f648d 100644 --- a/gointerfaces/execution/execution_grpc.pb.go +++ b/gointerfaces/execution/execution_grpc.pb.go @@ -34,6 +34,7 @@ const ( Execution_IsCanonicalHash_FullMethodName = "/execution.Execution/IsCanonicalHash" Execution_GetHeaderHashNumber_FullMethodName = "/execution.Execution/GetHeaderHashNumber" Execution_GetForkChoice_FullMethodName = "/execution.Execution/GetForkChoice" + Execution_Ready_FullMethodName = "/execution.Execution/Ready" ) // ExecutionClient is the client API for Execution service. @@ -58,6 +59,9 @@ type ExecutionClient interface { IsCanonicalHash(ctx context.Context, in *types.H256, opts ...grpc.CallOption) (*IsCanonicalResponse, error) GetHeaderHashNumber(ctx context.Context, in *types.H256, opts ...grpc.CallOption) (*GetHeaderHashNumberResponse, error) GetForkChoice(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ForkChoice, error) + // Misc + // We want to figure out whether we processed snapshots and cleanup sync cycles. + Ready(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ReadyResponse, error) } type executionClient struct { @@ -185,6 +189,15 @@ func (c *executionClient) GetForkChoice(ctx context.Context, in *emptypb.Empty, return out, nil } +func (c *executionClient) Ready(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ReadyResponse, error) { + out := new(ReadyResponse) + err := c.cc.Invoke(ctx, Execution_Ready_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // ExecutionServer is the server API for Execution service. // All implementations must embed UnimplementedExecutionServer // for forward compatibility @@ -207,6 +220,9 @@ type ExecutionServer interface { IsCanonicalHash(context.Context, *types.H256) (*IsCanonicalResponse, error) GetHeaderHashNumber(context.Context, *types.H256) (*GetHeaderHashNumberResponse, error) GetForkChoice(context.Context, *emptypb.Empty) (*ForkChoice, error) + // Misc + // We want to figure out whether we processed snapshots and cleanup sync cycles. + Ready(context.Context, *emptypb.Empty) (*ReadyResponse, error) mustEmbedUnimplementedExecutionServer() } @@ -253,6 +269,9 @@ func (UnimplementedExecutionServer) GetHeaderHashNumber(context.Context, *types. func (UnimplementedExecutionServer) GetForkChoice(context.Context, *emptypb.Empty) (*ForkChoice, error) { return nil, status.Errorf(codes.Unimplemented, "method GetForkChoice not implemented") } +func (UnimplementedExecutionServer) Ready(context.Context, *emptypb.Empty) (*ReadyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Ready not implemented") +} func (UnimplementedExecutionServer) mustEmbedUnimplementedExecutionServer() {} // UnsafeExecutionServer may be embedded to opt out of forward compatibility for this service. @@ -500,6 +519,24 @@ func _Execution_GetForkChoice_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } +func _Execution_Ready_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 { + return nil, err + } + if interceptor == nil { + return srv.(ExecutionServer).Ready(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Execution_Ready_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ExecutionServer).Ready(ctx, req.(*emptypb.Empty)) + } + return interceptor(ctx, in, info, handler) +} + // Execution_ServiceDesc is the grpc.ServiceDesc for Execution service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -559,6 +596,10 @@ var Execution_ServiceDesc = grpc.ServiceDesc{ MethodName: "GetForkChoice", Handler: _Execution_GetForkChoice_Handler, }, + { + MethodName: "Ready", + Handler: _Execution_Ready_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "execution/execution.proto", diff --git a/kv/memdb/memory_mutation.go b/kv/memdb/memory_mutation.go index b86ef637f..bca696ddc 100644 --- a/kv/memdb/memory_mutation.go +++ b/kv/memdb/memory_mutation.go @@ -17,6 +17,7 @@ import ( "bytes" "context" + "github.com/ledgerwatch/erigon-lib/common" "github.com/ledgerwatch/erigon-lib/kv/iter" "github.com/ledgerwatch/erigon-lib/kv/order" "github.com/ledgerwatch/log/v3" @@ -378,6 +379,72 @@ func (m *MemoryMutation) Flush(tx kv.RwTx) error { return nil } +func (m *MemoryMutation) Diff() (*MemoryDiff, error) { + memDiff := &MemoryDiff{ + diff: make(map[table][]entry), + deletedEntries: make(map[string][]string), + } + // Obtain buckets touched. + buckets, err := m.memTx.ListBuckets() + if err != nil { + return nil, err + } + // Obliterate buckets who are to be deleted + for bucket := range m.clearedTables { + memDiff.clearedTableNames = append(memDiff.clearedTableNames, bucket) + } + // Obliterate entries who are to be deleted + for bucket, keys := range m.deletedEntries { + for key := range keys { + memDiff.deletedEntries[bucket] = append(memDiff.deletedEntries[bucket], key) + } + } + // Iterate over each bucket and apply changes accordingly. + for _, bucket := range buckets { + if isTablePurelyDupsort(bucket) { + cbucket, err := m.memTx.CursorDupSort(bucket) + if err != nil { + return nil, err + } + defer cbucket.Close() + + t := table{ + name: bucket, + dupsort: true, + } + for k, v, err := cbucket.First(); k != nil; k, v, err = cbucket.Next() { + if err != nil { + return nil, err + } + memDiff.diff[t] = append(memDiff.diff[t], entry{ + k: common.Copy(k), + v: common.Copy(v), + }) + } + } else { + cbucket, err := m.memTx.Cursor(bucket) + if err != nil { + return nil, err + } + defer cbucket.Close() + t := table{ + name: bucket, + dupsort: false, + } + for k, v, err := cbucket.First(); k != nil; k, v, err = cbucket.Next() { + if err != nil { + return nil, err + } + memDiff.diff[t] = append(memDiff.diff[t], entry{ + k: common.Copy(k), + v: common.Copy(v), + }) + } + } + } + return memDiff, nil +} + // Check if a bucket is dupsorted and has dupsort conversion off func isTablePurelyDupsort(bucket string) bool { config, ok := kv.ChaindataTablesCfg[bucket] diff --git a/kv/memdb/memory_mutation_diff.go b/kv/memdb/memory_mutation_diff.go new file mode 100644 index 000000000..7f58b8a1d --- /dev/null +++ b/kv/memdb/memory_mutation_diff.go @@ -0,0 +1,58 @@ +package memdb + +import "github.com/ledgerwatch/erigon-lib/kv" + +type entry struct { + k []byte + v []byte +} + +type MemoryDiff struct { + diff map[table][]entry // god. + deletedEntries map[string][]string + clearedTableNames []string +} + +type table struct { + name string + dupsort bool +} + +func (m *MemoryDiff) Flush(tx kv.RwTx) error { + // Obliterate buckets who are to be deleted + for _, bucket := range m.clearedTableNames { + if err := tx.ClearBucket(bucket); err != nil { + return err + } + } + // Obliterate entries who are to be deleted + for bucket, keys := range m.deletedEntries { + for _, key := range keys { + if err := tx.Delete(bucket, []byte(key)); err != nil { + return err + } + } + } + // Iterate over each bucket and apply changes accordingly. + for bucketInfo, bucketDiff := range m.diff { + if bucketInfo.dupsort { + dbCursor, err := tx.RwCursorDupSort(bucketInfo.name) + if err != nil { + return err + } + defer dbCursor.Close() + for _, entry := range bucketDiff { + if err := dbCursor.Put(entry.k, entry.v); err != nil { + return err + } + } + } else { + for _, entry := range bucketDiff { + if err := tx.Put(bucketInfo.name, entry.k, entry.v); err != nil { + return err + } + } + } + } + return nil +}