From fa494afd9756ecb1637e6d5d6a71c177528ce496 Mon Sep 17 00:00:00 2001 From: elizabeth Date: Mon, 10 Apr 2023 19:16:59 -0400 Subject: [PATCH] rename state_root to block_hash --- grpc/execution/server.go | 6 ++---- grpc/gen/proto/execution/v1/execution.pb.go | 22 ++++++++++----------- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/grpc/execution/server.go b/grpc/execution/server.go index 18f413d8c8..11b7f39e82 100644 --- a/grpc/execution/server.go +++ b/grpc/execution/server.go @@ -104,8 +104,7 @@ func (s *ExecutionServiceServer) DoBlock(ctx context.Context, req *executionv1.D } res := &executionv1.DoBlockResponse{ - // TODO: RENAME THIS - this is not the state root!! it's the block hash - StateRoot: fcEndResp.PayloadStatus.LatestValidHash.Bytes(), + BlockHash: fcEndResp.PayloadStatus.LatestValidHash.Bytes(), } return res, nil } @@ -113,8 +112,7 @@ func (s *ExecutionServiceServer) DoBlock(ctx context.Context, req *executionv1.D func (s *ExecutionServiceServer) InitState(ctx context.Context, req *executionv1.InitStateRequest) (*executionv1.InitStateResponse, error) { currHead := s.eth.BlockChain().CurrentHeader() res := &executionv1.InitStateResponse{ - // TODO: RENAME THIS - this is not the state root!! it's the block hash - StateRoot: currHead.Hash().Bytes(), + BlockHash: currHead.Hash().Bytes(), } return res, nil diff --git a/grpc/gen/proto/execution/v1/execution.pb.go b/grpc/gen/proto/execution/v1/execution.pb.go index 2382493e64..a47be286cc 100644 --- a/grpc/gen/proto/execution/v1/execution.pb.go +++ b/grpc/gen/proto/execution/v1/execution.pb.go @@ -89,7 +89,7 @@ type DoBlockResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - StateRoot []byte `protobuf:"bytes,1,opt,name=state_root,json=stateRoot,proto3" json:"state_root,omitempty"` + BlockHash []byte `protobuf:"bytes,1,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty"` } func (x *DoBlockResponse) Reset() { @@ -124,9 +124,9 @@ func (*DoBlockResponse) Descriptor() ([]byte, []int) { return file_proto_execution_v1_execution_proto_rawDescGZIP(), []int{1} } -func (x *DoBlockResponse) GetStateRoot() []byte { +func (x *DoBlockResponse) GetBlockHash() []byte { if x != nil { - return x.StateRoot + return x.BlockHash } return nil } @@ -174,7 +174,7 @@ type InitStateResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - StateRoot []byte `protobuf:"bytes,1,opt,name=state_root,json=stateRoot,proto3" json:"state_root,omitempty"` + BlockHash []byte `protobuf:"bytes,1,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty"` } func (x *InitStateResponse) Reset() { @@ -209,9 +209,9 @@ func (*InitStateResponse) Descriptor() ([]byte, []int) { return file_proto_execution_v1_execution_proto_rawDescGZIP(), []int{3} } -func (x *InitStateResponse) GetStateRoot() []byte { +func (x *InitStateResponse) GetBlockHash() []byte { if x != nil { - return x.StateRoot + return x.BlockHash } return nil } @@ -235,13 +235,13 @@ var file_proto_execution_v1_execution_proto_rawDesc = []byte{ 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x30, 0x0a, 0x0f, 0x44, 0x6f, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0x12, + 0x1d, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x22, 0x12, 0x0a, 0x10, 0x49, 0x6e, 0x69, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x32, 0x0a, 0x11, 0x49, 0x6e, 0x69, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, - 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x74, 0x61, - 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x32, 0xa8, 0x01, 0x0a, 0x10, 0x45, 0x78, 0x65, 0x63, 0x75, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x32, 0xa8, 0x01, 0x0a, 0x10, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x46, 0x0a, 0x07, 0x44, 0x6f, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x1c, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x6f, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71,