refactor(protocol): prune grpc-gateway proto and support go compile#6726
refactor(protocol): prune grpc-gateway proto and support go compile#6726317787106 wants to merge 5 commits intotronprotocol:developfrom
Conversation
|
Why haven’t the |
@lvs0075 To support compiling these proto files in Go, update go_package to point to the repository currently in use : github.com/tronprotocol/protocol. |
|
[SHOULD] This tutorial still tells contributors to set
|
| package protocol; | ||
|
|
||
| import "core/Tron.proto"; | ||
| import "google/api/annotations.proto"; |
There was a problem hiding this comment.
[SHOULD] After removing all google.api.http options in this PR, this import has no remaining consumers in the repo (grep -rn "google/api" protocol/ returns only this line). Compilation works either way (it's still provided transitively by proto-google-common-protos), but dropping the import keeps api.proto consistent with the "prune grpc-gateway" goal.
Summary
Closes #6548.
Removes all
google.api.httpoption annotations from gRPC service definitions, deletes eight unused empty proto files underprotocol/src/main/protos/core/tron/, and updatesoption go_packageacross all proto files to point to the canonical tronprotocol/protocol repository. No RPC method signatures, message types, or service interfaces are changed.Background
The grpc-gateway project, which relied on
google.api.httpmappings to translate HTTP requests into gRPC calls, has been deprecated and is no longer maintained. Every gRPC API already has a dedicated HTTP implementation inFullNodeHttpApiService, making the dual HTTP-REST route definitions redundant.The existing
option go_packagevalues pointed to the deprecatedgrpc-gatewayrepository (github.com/tronprotocol/grpc-gateway/...). They are updated here to point to the canonical protocol repository (github.com/tronprotocol/protocol/...), which is the correct home for Go code generated from these proto files.Changes
protocol/src/main/protos/api/api.protogoogle.api.httpoption blocks from 56 RPC methods across theWallet,WalletSolidity,WalletExtension, andMonitorservices.option go_packagefromgithub.com/tronprotocol/grpc-gateway/apitogithub.com/tronprotocol/protocol/api.Other proto files —
go_packageupdatesapi/zksnark.protogrpc-gateway/apiprotocol/apicore/Tron.proto,core/Discover.proto,core/TronInventoryItems.protogrpc-gateway/coreprotocol/corecore/contract/*.proto(12 files)grpc-gateway/coreor absentprotocol/core/contractDeleted files (
protocol/src/main/protos/core/tron/)Eight empty proto files that served no purpose after grpc-gateway was abandoned:
account.proto,block.proto,delegated_resource.proto,p2p.proto,proposal.proto,transaction.proto,vote.proto,witness.protoImpact
FullNodeHttpApiServiceand are unaffected.option go_packagenow points togithub.com/tronprotocol/protocol. Go consumers should generate stubs from the tronprotocol/protocol repository (ago.modwill be added there to complete Go module support).Test
NA — this is a pure proto cleanup with no logic changes. The generated Java/gRPC stubs are functionally identical.