From 44d7d0f3cedb2a9efe8bbf2d5c35ad333b433b5d Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Thu, 13 Apr 2023 10:32:08 +0200 Subject: [PATCH] implement two more values for gp relayer --- api/cosmos/base/node/v1beta1/query.pulsar.go | 354 +++++++++++++------ client/grpc/node/query.pb.go | 215 ++++++++--- client/grpc/node/service.go | 6 +- proto/cosmos/base/node/v1beta1/query.proto | 8 +- 4 files changed, 421 insertions(+), 162 deletions(-) diff --git a/api/cosmos/base/node/v1beta1/query.pulsar.go b/api/cosmos/base/node/v1beta1/query.pulsar.go index e2e588e812c9..ff8148beebbb 100644 --- a/api/cosmos/base/node/v1beta1/query.pulsar.go +++ b/api/cosmos/base/node/v1beta1/query.pulsar.go @@ -1276,18 +1276,22 @@ func (x *fastReflection_StatusRequest) ProtoMethods() *protoiface.Methods { } var ( - md_StatusResponse protoreflect.MessageDescriptor - fd_StatusResponse_earliest_store_height protoreflect.FieldDescriptor - fd_StatusResponse_latest_block_height protoreflect.FieldDescriptor - fd_StatusResponse_latest_block_height_timestamp protoreflect.FieldDescriptor + md_StatusResponse protoreflect.MessageDescriptor + fd_StatusResponse_earliest_store_height protoreflect.FieldDescriptor + fd_StatusResponse_height protoreflect.FieldDescriptor + fd_StatusResponse_timestamp protoreflect.FieldDescriptor + fd_StatusResponse_app_hash protoreflect.FieldDescriptor + fd_StatusResponse_validator_hash protoreflect.FieldDescriptor ) func init() { file_cosmos_base_node_v1beta1_query_proto_init() md_StatusResponse = File_cosmos_base_node_v1beta1_query_proto.Messages().ByName("StatusResponse") fd_StatusResponse_earliest_store_height = md_StatusResponse.Fields().ByName("earliest_store_height") - fd_StatusResponse_latest_block_height = md_StatusResponse.Fields().ByName("latest_block_height") - fd_StatusResponse_latest_block_height_timestamp = md_StatusResponse.Fields().ByName("latest_block_height_timestamp") + fd_StatusResponse_height = md_StatusResponse.Fields().ByName("height") + fd_StatusResponse_timestamp = md_StatusResponse.Fields().ByName("timestamp") + fd_StatusResponse_app_hash = md_StatusResponse.Fields().ByName("app_hash") + fd_StatusResponse_validator_hash = md_StatusResponse.Fields().ByName("validator_hash") } var _ protoreflect.Message = (*fastReflection_StatusResponse)(nil) @@ -1361,15 +1365,27 @@ func (x *fastReflection_StatusResponse) Range(f func(protoreflect.FieldDescripto return } } - if x.LatestBlockHeight != uint64(0) { - value := protoreflect.ValueOfUint64(x.LatestBlockHeight) - if !f(fd_StatusResponse_latest_block_height, value) { + if x.Height != uint64(0) { + value := protoreflect.ValueOfUint64(x.Height) + if !f(fd_StatusResponse_height, value) { return } } - if x.LatestBlockHeightTimestamp != nil { - value := protoreflect.ValueOfMessage(x.LatestBlockHeightTimestamp.ProtoReflect()) - if !f(fd_StatusResponse_latest_block_height_timestamp, value) { + if x.Timestamp != nil { + value := protoreflect.ValueOfMessage(x.Timestamp.ProtoReflect()) + if !f(fd_StatusResponse_timestamp, value) { + return + } + } + if len(x.AppHash) != 0 { + value := protoreflect.ValueOfBytes(x.AppHash) + if !f(fd_StatusResponse_app_hash, value) { + return + } + } + if len(x.ValidatorHash) != 0 { + value := protoreflect.ValueOfBytes(x.ValidatorHash) + if !f(fd_StatusResponse_validator_hash, value) { return } } @@ -1390,10 +1406,14 @@ func (x *fastReflection_StatusResponse) Has(fd protoreflect.FieldDescriptor) boo switch fd.FullName() { case "cosmos.base.node.v1beta1.StatusResponse.earliest_store_height": return x.EarliestStoreHeight != uint64(0) - case "cosmos.base.node.v1beta1.StatusResponse.latest_block_height": - return x.LatestBlockHeight != uint64(0) - case "cosmos.base.node.v1beta1.StatusResponse.latest_block_height_timestamp": - return x.LatestBlockHeightTimestamp != nil + case "cosmos.base.node.v1beta1.StatusResponse.height": + return x.Height != uint64(0) + case "cosmos.base.node.v1beta1.StatusResponse.timestamp": + return x.Timestamp != nil + case "cosmos.base.node.v1beta1.StatusResponse.app_hash": + return len(x.AppHash) != 0 + case "cosmos.base.node.v1beta1.StatusResponse.validator_hash": + return len(x.ValidatorHash) != 0 default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v1beta1.StatusResponse")) @@ -1412,10 +1432,14 @@ func (x *fastReflection_StatusResponse) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { case "cosmos.base.node.v1beta1.StatusResponse.earliest_store_height": x.EarliestStoreHeight = uint64(0) - case "cosmos.base.node.v1beta1.StatusResponse.latest_block_height": - x.LatestBlockHeight = uint64(0) - case "cosmos.base.node.v1beta1.StatusResponse.latest_block_height_timestamp": - x.LatestBlockHeightTimestamp = nil + case "cosmos.base.node.v1beta1.StatusResponse.height": + x.Height = uint64(0) + case "cosmos.base.node.v1beta1.StatusResponse.timestamp": + x.Timestamp = nil + case "cosmos.base.node.v1beta1.StatusResponse.app_hash": + x.AppHash = nil + case "cosmos.base.node.v1beta1.StatusResponse.validator_hash": + x.ValidatorHash = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v1beta1.StatusResponse")) @@ -1435,12 +1459,18 @@ func (x *fastReflection_StatusResponse) Get(descriptor protoreflect.FieldDescrip case "cosmos.base.node.v1beta1.StatusResponse.earliest_store_height": value := x.EarliestStoreHeight return protoreflect.ValueOfUint64(value) - case "cosmos.base.node.v1beta1.StatusResponse.latest_block_height": - value := x.LatestBlockHeight + case "cosmos.base.node.v1beta1.StatusResponse.height": + value := x.Height return protoreflect.ValueOfUint64(value) - case "cosmos.base.node.v1beta1.StatusResponse.latest_block_height_timestamp": - value := x.LatestBlockHeightTimestamp + case "cosmos.base.node.v1beta1.StatusResponse.timestamp": + value := x.Timestamp return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cosmos.base.node.v1beta1.StatusResponse.app_hash": + value := x.AppHash + return protoreflect.ValueOfBytes(value) + case "cosmos.base.node.v1beta1.StatusResponse.validator_hash": + value := x.ValidatorHash + return protoreflect.ValueOfBytes(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v1beta1.StatusResponse")) @@ -1463,10 +1493,14 @@ func (x *fastReflection_StatusResponse) Set(fd protoreflect.FieldDescriptor, val switch fd.FullName() { case "cosmos.base.node.v1beta1.StatusResponse.earliest_store_height": x.EarliestStoreHeight = value.Uint() - case "cosmos.base.node.v1beta1.StatusResponse.latest_block_height": - x.LatestBlockHeight = value.Uint() - case "cosmos.base.node.v1beta1.StatusResponse.latest_block_height_timestamp": - x.LatestBlockHeightTimestamp = value.Message().Interface().(*timestamppb.Timestamp) + case "cosmos.base.node.v1beta1.StatusResponse.height": + x.Height = value.Uint() + case "cosmos.base.node.v1beta1.StatusResponse.timestamp": + x.Timestamp = value.Message().Interface().(*timestamppb.Timestamp) + case "cosmos.base.node.v1beta1.StatusResponse.app_hash": + x.AppHash = value.Bytes() + case "cosmos.base.node.v1beta1.StatusResponse.validator_hash": + x.ValidatorHash = value.Bytes() default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v1beta1.StatusResponse")) @@ -1487,15 +1521,19 @@ func (x *fastReflection_StatusResponse) Set(fd protoreflect.FieldDescriptor, val // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_StatusResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.base.node.v1beta1.StatusResponse.latest_block_height_timestamp": - if x.LatestBlockHeightTimestamp == nil { - x.LatestBlockHeightTimestamp = new(timestamppb.Timestamp) + case "cosmos.base.node.v1beta1.StatusResponse.timestamp": + if x.Timestamp == nil { + x.Timestamp = new(timestamppb.Timestamp) } - return protoreflect.ValueOfMessage(x.LatestBlockHeightTimestamp.ProtoReflect()) + return protoreflect.ValueOfMessage(x.Timestamp.ProtoReflect()) case "cosmos.base.node.v1beta1.StatusResponse.earliest_store_height": panic(fmt.Errorf("field earliest_store_height of message cosmos.base.node.v1beta1.StatusResponse is not mutable")) - case "cosmos.base.node.v1beta1.StatusResponse.latest_block_height": - panic(fmt.Errorf("field latest_block_height of message cosmos.base.node.v1beta1.StatusResponse is not mutable")) + case "cosmos.base.node.v1beta1.StatusResponse.height": + panic(fmt.Errorf("field height of message cosmos.base.node.v1beta1.StatusResponse is not mutable")) + case "cosmos.base.node.v1beta1.StatusResponse.app_hash": + panic(fmt.Errorf("field app_hash of message cosmos.base.node.v1beta1.StatusResponse is not mutable")) + case "cosmos.base.node.v1beta1.StatusResponse.validator_hash": + panic(fmt.Errorf("field validator_hash of message cosmos.base.node.v1beta1.StatusResponse is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v1beta1.StatusResponse")) @@ -1511,11 +1549,15 @@ func (x *fastReflection_StatusResponse) NewField(fd protoreflect.FieldDescriptor switch fd.FullName() { case "cosmos.base.node.v1beta1.StatusResponse.earliest_store_height": return protoreflect.ValueOfUint64(uint64(0)) - case "cosmos.base.node.v1beta1.StatusResponse.latest_block_height": + case "cosmos.base.node.v1beta1.StatusResponse.height": return protoreflect.ValueOfUint64(uint64(0)) - case "cosmos.base.node.v1beta1.StatusResponse.latest_block_height_timestamp": + case "cosmos.base.node.v1beta1.StatusResponse.timestamp": m := new(timestamppb.Timestamp) return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cosmos.base.node.v1beta1.StatusResponse.app_hash": + return protoreflect.ValueOfBytes(nil) + case "cosmos.base.node.v1beta1.StatusResponse.validator_hash": + return protoreflect.ValueOfBytes(nil) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v1beta1.StatusResponse")) @@ -1588,11 +1630,19 @@ func (x *fastReflection_StatusResponse) ProtoMethods() *protoiface.Methods { if x.EarliestStoreHeight != 0 { n += 1 + runtime.Sov(uint64(x.EarliestStoreHeight)) } - if x.LatestBlockHeight != 0 { - n += 1 + runtime.Sov(uint64(x.LatestBlockHeight)) + if x.Height != 0 { + n += 1 + runtime.Sov(uint64(x.Height)) + } + if x.Timestamp != nil { + l = options.Size(x.Timestamp) + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.AppHash) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) } - if x.LatestBlockHeightTimestamp != nil { - l = options.Size(x.LatestBlockHeightTimestamp) + l = len(x.ValidatorHash) + if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } if x.unknownFields != nil { @@ -1624,8 +1674,22 @@ func (x *fastReflection_StatusResponse) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if x.LatestBlockHeightTimestamp != nil { - encoded, err := options.Marshal(x.LatestBlockHeightTimestamp) + if len(x.ValidatorHash) > 0 { + i -= len(x.ValidatorHash) + copy(dAtA[i:], x.ValidatorHash) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ValidatorHash))) + i-- + dAtA[i] = 0x2a + } + if len(x.AppHash) > 0 { + i -= len(x.AppHash) + copy(dAtA[i:], x.AppHash) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AppHash))) + i-- + dAtA[i] = 0x22 + } + if x.Timestamp != nil { + encoded, err := options.Marshal(x.Timestamp) if err != nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1638,8 +1702,8 @@ func (x *fastReflection_StatusResponse) ProtoMethods() *protoiface.Methods { i-- dAtA[i] = 0x1a } - if x.LatestBlockHeight != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.LatestBlockHeight)) + if x.Height != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Height)) i-- dAtA[i] = 0x10 } @@ -1718,9 +1782,9 @@ func (x *fastReflection_StatusResponse) ProtoMethods() *protoiface.Methods { } case 2: if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field LatestBlockHeight", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) } - x.LatestBlockHeight = 0 + x.Height = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -1730,14 +1794,14 @@ func (x *fastReflection_StatusResponse) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - x.LatestBlockHeight |= uint64(b&0x7F) << shift + x.Height |= uint64(b&0x7F) << shift if b < 0x80 { break } } case 3: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field LatestBlockHeightTimestamp", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1764,13 +1828,81 @@ func (x *fastReflection_StatusResponse) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - if x.LatestBlockHeightTimestamp == nil { - x.LatestBlockHeightTimestamp = ×tamppb.Timestamp{} + if x.Timestamp == nil { + x.Timestamp = ×tamppb.Timestamp{} } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.LatestBlockHeightTimestamp); err != nil { + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Timestamp); err != nil { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AppHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.AppHash = append(x.AppHash[:0], dAtA[iNdEx:postIndex]...) + if x.AppHash == nil { + x.AppHash = []byte{} + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ValidatorHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.ValidatorHash = append(x.ValidatorHash[:0], dAtA[iNdEx:postIndex]...) + if x.ValidatorHash == nil { + x.ValidatorHash = []byte{} + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -1932,9 +2064,11 @@ type StatusResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - EarliestStoreHeight uint64 `protobuf:"varint,1,opt,name=earliest_store_height,json=earliestStoreHeight,proto3" json:"earliest_store_height,omitempty"` - LatestBlockHeight uint64 `protobuf:"varint,2,opt,name=latest_block_height,json=latestBlockHeight,proto3" json:"latest_block_height,omitempty"` - LatestBlockHeightTimestamp *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=latest_block_height_timestamp,json=latestBlockHeightTimestamp,proto3" json:"latest_block_height_timestamp,omitempty"` + EarliestStoreHeight uint64 `protobuf:"varint,1,opt,name=earliest_store_height,json=earliestStoreHeight,proto3" json:"earliest_store_height,omitempty"` // earliest block height available in the store + Height uint64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` // current block height + Timestamp *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // block height timestamp + AppHash []byte `protobuf:"bytes,4,opt,name=app_hash,json=appHash,proto3" json:"app_hash,omitempty"` // app hash of the current block + ValidatorHash []byte `protobuf:"bytes,5,opt,name=validator_hash,json=validatorHash,proto3" json:"validator_hash,omitempty"` // validator hash provided by the consensus header } func (x *StatusResponse) Reset() { @@ -1964,16 +2098,30 @@ func (x *StatusResponse) GetEarliestStoreHeight() uint64 { return 0 } -func (x *StatusResponse) GetLatestBlockHeight() uint64 { +func (x *StatusResponse) GetHeight() uint64 { if x != nil { - return x.LatestBlockHeight + return x.Height } return 0 } -func (x *StatusResponse) GetLatestBlockHeightTimestamp() *timestamppb.Timestamp { +func (x *StatusResponse) GetTimestamp() *timestamppb.Timestamp { if x != nil { - return x.LatestBlockHeightTimestamp + return x.Timestamp + } + return nil +} + +func (x *StatusResponse) GetAppHash() []byte { + if x != nil { + return x.AppHash + } + return nil +} + +func (x *StatusResponse) GetValidatorHash() []byte { + if x != nil { + return x.ValidatorHash } return nil } @@ -2002,53 +2150,53 @@ var file_cosmos_base_node_v1beta1_query_proto_rawDesc = []byte{ 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x70, 0x72, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x22, 0x0f, 0x0a, 0x0d, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x22, 0xd9, 0x01, 0x0a, 0x0e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x74, 0x22, 0xde, 0x01, 0x0a, 0x0e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x15, 0x65, 0x61, 0x72, 0x6c, 0x69, 0x65, 0x73, 0x74, 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x13, 0x65, 0x61, 0x72, 0x6c, 0x69, 0x65, 0x73, 0x74, 0x53, 0x74, 0x6f, - 0x72, 0x65, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x2e, 0x0a, 0x13, 0x6c, 0x61, 0x74, 0x65, - 0x73, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x11, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x42, 0x6c, 0x6f, - 0x63, 0x6b, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x63, 0x0a, 0x1d, 0x6c, 0x61, 0x74, 0x65, - 0x73, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x5f, - 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x04, 0x90, 0xdf, 0x1f, - 0x01, 0x52, 0x1a, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, - 0x69, 0x67, 0x68, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x32, 0x99, 0x02, - 0x0a, 0x07, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x85, 0x01, 0x0a, 0x06, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x12, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, - 0x73, 0x65, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x6e, 0x6f, 0x64, 0x65, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x12, - 0x20, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x6e, 0x6f, - 0x64, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x12, 0x85, 0x01, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x27, 0x2e, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, - 0x61, 0x73, 0x65, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x28, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x42, 0xe4, 0x01, 0x0a, 0x1c, 0x63, 0x6f, - 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x6e, 0x6f, - 0x64, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x35, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x3b, 0x6e, 0x6f, 0x64, 0x65, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, - 0x02, 0x03, 0x43, 0x42, 0x4e, 0xaa, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x42, - 0x61, 0x73, 0x65, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0xca, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x73, 0x65, 0x5c, 0x4e, - 0x6f, 0x64, 0x65, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x24, 0x43, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x73, 0x65, 0x5c, 0x4e, 0x6f, 0x64, 0x65, 0x5c, 0x56, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0xea, 0x02, 0x1b, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x42, 0x61, 0x73, - 0x65, 0x3a, 0x3a, 0x4e, 0x6f, 0x64, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x72, 0x65, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, + 0x68, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, + 0x12, 0x3e, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, + 0x04, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x12, 0x19, 0x0a, 0x08, 0x61, 0x70, 0x70, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x07, 0x61, 0x70, 0x70, 0x48, 0x61, 0x73, 0x68, 0x12, 0x25, 0x0a, 0x0e, 0x76, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x48, 0x61, + 0x73, 0x68, 0x32, 0x99, 0x02, 0x0a, 0x07, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x85, + 0x01, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, + 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, + 0x73, 0x65, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x85, 0x01, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x12, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, + 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x2f, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x42, 0xe4, + 0x01, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, + 0x73, 0x65, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, + 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x35, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x6e, 0x6f, 0x64, 0x65, + 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x6e, 0x6f, 0x64, 0x65, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x42, 0x4e, 0xaa, 0x02, 0x18, 0x43, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x2e, 0x56, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, + 0x61, 0x73, 0x65, 0x5c, 0x4e, 0x6f, 0x64, 0x65, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0xe2, 0x02, 0x24, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x73, 0x65, 0x5c, 0x4e, + 0x6f, 0x64, 0x65, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1b, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x3a, 0x3a, 0x42, 0x61, 0x73, 0x65, 0x3a, 0x3a, 0x4e, 0x6f, 0x64, 0x65, 0x3a, 0x3a, 0x56, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2072,7 +2220,7 @@ var file_cosmos_base_node_v1beta1_query_proto_goTypes = []interface{}{ (*timestamppb.Timestamp)(nil), // 4: google.protobuf.Timestamp } var file_cosmos_base_node_v1beta1_query_proto_depIdxs = []int32{ - 4, // 0: cosmos.base.node.v1beta1.StatusResponse.latest_block_height_timestamp:type_name -> google.protobuf.Timestamp + 4, // 0: cosmos.base.node.v1beta1.StatusResponse.timestamp:type_name -> google.protobuf.Timestamp 0, // 1: cosmos.base.node.v1beta1.Service.Config:input_type -> cosmos.base.node.v1beta1.ConfigRequest 2, // 2: cosmos.base.node.v1beta1.Service.Status:input_type -> cosmos.base.node.v1beta1.StatusRequest 1, // 3: cosmos.base.node.v1beta1.Service.Config:output_type -> cosmos.base.node.v1beta1.ConfigResponse diff --git a/client/grpc/node/query.pb.go b/client/grpc/node/query.pb.go index aa19a67202bc..8e56808aa627 100644 --- a/client/grpc/node/query.pb.go +++ b/client/grpc/node/query.pb.go @@ -171,9 +171,11 @@ var xxx_messageInfo_StatusRequest proto.InternalMessageInfo // StateResponse defines the response structure for the status of a node. type StatusResponse struct { - EarliestStoreHeight uint64 `protobuf:"varint,1,opt,name=earliest_store_height,json=earliestStoreHeight,proto3" json:"earliest_store_height,omitempty"` - LatestBlockHeight uint64 `protobuf:"varint,2,opt,name=latest_block_height,json=latestBlockHeight,proto3" json:"latest_block_height,omitempty"` - LatestBlockHeightTimestamp *time.Time `protobuf:"bytes,3,opt,name=latest_block_height_timestamp,json=latestBlockHeightTimestamp,proto3,stdtime" json:"latest_block_height_timestamp,omitempty"` + EarliestStoreHeight uint64 `protobuf:"varint,1,opt,name=earliest_store_height,json=earliestStoreHeight,proto3" json:"earliest_store_height,omitempty"` + Height uint64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` + Timestamp *time.Time `protobuf:"bytes,3,opt,name=timestamp,proto3,stdtime" json:"timestamp,omitempty"` + AppHash []byte `protobuf:"bytes,4,opt,name=app_hash,json=appHash,proto3" json:"app_hash,omitempty"` + ValidatorHash []byte `protobuf:"bytes,5,opt,name=validator_hash,json=validatorHash,proto3" json:"validator_hash,omitempty"` } func (m *StatusResponse) Reset() { *m = StatusResponse{} } @@ -216,16 +218,30 @@ func (m *StatusResponse) GetEarliestStoreHeight() uint64 { return 0 } -func (m *StatusResponse) GetLatestBlockHeight() uint64 { +func (m *StatusResponse) GetHeight() uint64 { if m != nil { - return m.LatestBlockHeight + return m.Height } return 0 } -func (m *StatusResponse) GetLatestBlockHeightTimestamp() *time.Time { +func (m *StatusResponse) GetTimestamp() *time.Time { if m != nil { - return m.LatestBlockHeightTimestamp + return m.Timestamp + } + return nil +} + +func (m *StatusResponse) GetAppHash() []byte { + if m != nil { + return m.AppHash + } + return nil +} + +func (m *StatusResponse) GetValidatorHash() []byte { + if m != nil { + return m.ValidatorHash } return nil } @@ -242,38 +258,39 @@ func init() { } var fileDescriptor_8324226a07064341 = []byte{ - // 481 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0x41, 0x6b, 0x14, 0x31, - 0x14, 0xc7, 0x77, 0xd6, 0x52, 0x31, 0x62, 0xeb, 0x4e, 0x15, 0x96, 0x41, 0xa7, 0x65, 0x11, 0x5c, - 0x85, 0x26, 0x74, 0xfd, 0x06, 0xeb, 0xa1, 0x8a, 0x17, 0x99, 0xf5, 0xe4, 0x65, 0xc8, 0x4c, 0x5f, - 0xb3, 0x61, 0x67, 0x92, 0x69, 0x92, 0x59, 0xf0, 0x2a, 0x78, 0x2f, 0x78, 0x10, 0xbf, 0x91, 0xc7, - 0x82, 0x17, 0x3d, 0x29, 0xbb, 0x7e, 0x10, 0x49, 0x32, 0x29, 0x2c, 0xda, 0xea, 0x69, 0x32, 0xef, - 0xff, 0x7b, 0x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0x2e, 0x65, 0x1d, 0xa6, 0xf8, - 0xcf, 0xa1, 0x3e, 0x59, 0x90, 0xb2, 0xe2, 0x20, 0x0c, 0x61, 0xaa, 0x29, 0xdd, 0xdc, 0x62, 0xdb, - 0x45, 0xf3, 0xec, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0x43, 0x58, 0xee, 0xa3, 0x9a, 0x03, 0x00, - 0x00, + // 506 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xc1, 0x6f, 0xd3, 0x3e, + 0x1c, 0xc5, 0x9b, 0xfe, 0xfa, 0xeb, 0x98, 0x61, 0x1d, 0xcb, 0x00, 0x95, 0x0a, 0x65, 0x55, 0x05, + 0xa2, 0x20, 0xcd, 0xd6, 0xca, 0x9d, 0xc3, 0x38, 0x6c, 0x88, 0x0b, 0x4a, 0x39, 0x71, 0x89, 0xdc, + 0xf4, 0xbb, 0xc4, 0x5a, 0x62, 0x7b, 0xb6, 0x53, 0x89, 0x2b, 0x12, 0xf7, 0x49, 0x1c, 0x10, 0xff, + 0x11, 0xc7, 0x49, 0x5c, 0x38, 0x01, 0x6a, 0xf9, 0x43, 0x50, 0x6c, 0x67, 0xa8, 0x87, 0x0d, 0x4e, + 0xb1, 0xdf, 0xfb, 0xd8, 0x79, 0x7a, 0x5f, 0xa3, 0x87, 0xa9, 0xd0, 0xa5, 0xd0, 0x64, 0x46, 0x35, + 0x10, 0x2e, 0xe6, 0x40, 0x16, 0x07, 0x33, 0x30, 0xf4, 0x80, 0x9c, 0x55, 0xa0, 0xde, 0x61, 0xa9, + 0x84, 0x11, 0x61, 0xdf, 0x51, 0xb8, 0xa6, 0x70, 0x4d, 0x61, 0x4f, 0x0d, 0x1e, 0x64, 0x42, 0x64, + 0x05, 0x10, 0x2a, 0x19, 0xa1, 0x9c, 0x0b, 0x43, 0x0d, 0x13, 0x5c, 0xbb, 0x73, 0x83,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7e, 0xd3, 0x10, 0x87, 0x9d, 0xf3, 0x1f, 0x7b, 0x41, 0xfc, 0xe7, + 0x48, 0x78, 0x1f, 0xdd, 0xa0, 0x52, 0x26, 0x39, 0xd5, 0x79, 0xbf, 0x33, 0x0c, 0xc6, 0xb7, 0xe2, + 0x0d, 0x2a, 0xe5, 0x31, 0xd5, 0x79, 0xf8, 0x08, 0xf5, 0x16, 0xb4, 0x60, 0x73, 0x6a, 0x84, 0x72, + 0xc0, 0xff, 0x16, 0xd8, 0xba, 0x54, 0x6b, 0x6c, 0xf2, 0xb9, 0x8d, 0x36, 0xa6, 0xa0, 0x16, 0x75, + 0xb1, 0x1f, 0x02, 0xd4, 0x75, 0x73, 0x09, 0x1f, 0xe3, 0xab, 0xde, 0x08, 0x5e, 0x9b, 0xe5, 0x60, + 0xfc, 0x77, 0xd0, 0xf5, 0x36, 0x1a, 0xbf, 0xff, 0xfa, 0xeb, 0x63, 0x7b, 0x14, 0x0e, 0xc9, 0x95, + 0x8f, 0x34, 0x75, 0x3f, 0xaf, 0x73, 0xb8, 0xd2, 0xaf, 0xcb, 0xb1, 0x36, 0xa8, 0xeb, 0x72, 0xac, + 0xcf, 0xef, 0x5f, 0x72, 0x68, 0x7b, 0xe2, 0xf0, 0xe8, 0xcb, 0x32, 0x0a, 0x2e, 0x96, 0x51, 0xf0, + 0x73, 0x19, 0x05, 0xe7, 0xab, 0xa8, 0x75, 0xb1, 0x8a, 0x5a, 0xdf, 0x56, 0x51, 0xeb, 0xed, 0x7e, + 0xc6, 0x4c, 0x5e, 0xcd, 0x70, 0x2a, 0xca, 0xe6, 0x16, 0xf7, 0xd9, 0xd7, 0xf3, 0x53, 0x92, 0x16, + 0x0c, 0xb8, 0x21, 0x99, 0x92, 0xa9, 0xbd, 0x77, 0xd6, 0xb5, 0xb3, 0x7c, 0xf6, 0x3b, 0x00, 0x00, + 0xff, 0xff, 0x89, 0x73, 0x23, 0x6e, 0x9f, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -506,8 +523,22 @@ func (m *StatusResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.LatestBlockHeightTimestamp != nil { - n1, err1 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(*m.LatestBlockHeightTimestamp, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.LatestBlockHeightTimestamp):]) + if len(m.ValidatorHash) > 0 { + i -= len(m.ValidatorHash) + copy(dAtA[i:], m.ValidatorHash) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ValidatorHash))) + i-- + dAtA[i] = 0x2a + } + if len(m.AppHash) > 0 { + i -= len(m.AppHash) + copy(dAtA[i:], m.AppHash) + i = encodeVarintQuery(dAtA, i, uint64(len(m.AppHash))) + i-- + dAtA[i] = 0x22 + } + if m.Timestamp != nil { + n1, err1 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(*m.Timestamp, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.Timestamp):]) if err1 != nil { return 0, err1 } @@ -516,8 +547,8 @@ func (m *StatusResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x1a } - if m.LatestBlockHeight != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.LatestBlockHeight)) + if m.Height != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Height)) i-- dAtA[i] = 0x10 } @@ -588,11 +619,19 @@ func (m *StatusResponse) Size() (n int) { if m.EarliestStoreHeight != 0 { n += 1 + sovQuery(uint64(m.EarliestStoreHeight)) } - if m.LatestBlockHeight != 0 { - n += 1 + sovQuery(uint64(m.LatestBlockHeight)) + if m.Height != 0 { + n += 1 + sovQuery(uint64(m.Height)) + } + if m.Timestamp != nil { + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.Timestamp) + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.AppHash) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) } - if m.LatestBlockHeightTimestamp != nil { - l = github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.LatestBlockHeightTimestamp) + l = len(m.ValidatorHash) + if l > 0 { n += 1 + l + sovQuery(uint64(l)) } return n @@ -900,9 +939,9 @@ func (m *StatusResponse) Unmarshal(dAtA []byte) error { } case 2: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LatestBlockHeight", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) } - m.LatestBlockHeight = 0 + m.Height = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -912,14 +951,14 @@ func (m *StatusResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.LatestBlockHeight |= uint64(b&0x7F) << shift + m.Height |= uint64(b&0x7F) << shift if b < 0x80 { break } } case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LatestBlockHeightTimestamp", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -946,13 +985,81 @@ func (m *StatusResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.LatestBlockHeightTimestamp == nil { - m.LatestBlockHeightTimestamp = new(time.Time) + if m.Timestamp == nil { + m.Timestamp = new(time.Time) } - if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(m.LatestBlockHeightTimestamp, dAtA[iNdEx:postIndex]); err != nil { + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(m.Timestamp, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AppHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AppHash = append(m.AppHash[:0], dAtA[iNdEx:postIndex]...) + if m.AppHash == nil { + m.AppHash = []byte{} + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidatorHash = append(m.ValidatorHash[:0], dAtA[iNdEx:postIndex]...) + if m.ValidatorHash == nil { + m.ValidatorHash = []byte{} + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) diff --git a/client/grpc/node/service.go b/client/grpc/node/service.go index 9c3b2e811b67..0d4f27a42932 100644 --- a/client/grpc/node/service.go +++ b/client/grpc/node/service.go @@ -55,7 +55,9 @@ func (s queryServer) Status(ctx context.Context, _ *StatusRequest) (*StatusRespo // // Ref: ... // EarliestStoreHeight: sdkCtx.MultiStore(), - LatestBlockHeight: uint64(sdkCtx.BlockHeight()), - LatestBlockHeightTimestamp: &blockTime, + Height: uint64(sdkCtx.BlockHeight()), + Timestamp: &blockTime, + AppHash: sdkCtx.BlockHeader().AppHash, + ValidatorHash: sdkCtx.BlockHeader().NextValidatorsHash, }, nil } diff --git a/proto/cosmos/base/node/v1beta1/query.proto b/proto/cosmos/base/node/v1beta1/query.proto index 426929d49511..78fd9f6703a3 100644 --- a/proto/cosmos/base/node/v1beta1/query.proto +++ b/proto/cosmos/base/node/v1beta1/query.proto @@ -35,7 +35,9 @@ message StatusRequest {} // StateResponse defines the response structure for the status of a node. message StatusResponse { - uint64 earliest_store_height = 1; - uint64 latest_block_height = 2; - google.protobuf.Timestamp latest_block_height_timestamp = 3 [(gogoproto.stdtime) = true]; + uint64 earliest_store_height = 1; // earliest block height available in the store + uint64 height = 2; // current block height + google.protobuf.Timestamp timestamp = 3 [(gogoproto.stdtime) = true]; // block height timestamp + bytes app_hash = 4; // app hash of the current block + bytes validator_hash = 5; // validator hash provided by the consensus header }