Skip to content

refactor(protocol): prune grpc-gateway related proto#6726

Open
317787106 wants to merge 5 commits intotronprotocol:developfrom
317787106:feature/prune_proto
Open

refactor(protocol): prune grpc-gateway related proto#6726
317787106 wants to merge 5 commits intotronprotocol:developfrom
317787106:feature/prune_proto

Conversation

@317787106
Copy link
Copy Markdown
Collaborator

@317787106 317787106 commented Apr 28, 2026

Summary

Closes #6548.

Removes all google.api.http option annotations from gRPC service definitions, deletes eight unused empty proto files under protocol/src/main/protos/core/tron/, and updates option go_package across 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.http mappings to translate HTTP requests into gRPC calls, has been deprecated and is no longer maintained. Every gRPC API already has a dedicated HTTP implementation in FullNodeHttpApiService, making the dual HTTP-REST route definitions redundant.

The existing option go_package values pointed to the deprecated grpc-gateway repository (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.proto

  • Removed google.api.http option blocks from 56 RPC methods across the Wallet, WalletSolidity, WalletExtension, and Monitor services.
  • Updated option go_package from github.com/tronprotocol/grpc-gateway/api to github.com/tronprotocol/protocol/api.

Other proto files — go_package updates

File(s) Old value New value
api/zksnark.proto grpc-gateway/api protocol/api
core/Tron.proto, core/Discover.proto, core/TronInventoryItems.proto grpc-gateway/core protocol/core
core/contract/*.proto (12 files) grpc-gateway/core or absent protocol/core/contract

Deleted 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.proto

Impact

  • gRPC clients (e.g., Trident SDK): no change — all RPC method signatures are identical.
  • HTTP clients: all HTTP APIs continue to be served by FullNodeHttpApiService and are unaffected.
  • grpc-gateway / HTTP-to-gRPC proxies: the REST route annotations are gone. Anyone still running a custom grpc-gateway setup must migrate to calling gRPC methods directly or use the dedicated HTTP API endpoints.
  • Go code generation: option go_package now points to github.com/tronprotocol/protocol. Go consumers should generate stubs from the tronprotocol/protocol repository (a go.mod will 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.

@lvs0075
Copy link
Copy Markdown
Collaborator

lvs0075 commented Apr 29, 2026

Why haven’t the go_package entries in Discover.proto and Tron.proto been removed?

@317787106
Copy link
Copy Markdown
Collaborator Author

317787106 commented Apr 29, 2026

Why haven’t the go_package entries in Discover.proto and Tron.proto been removed?

@lvs0075 To support compiling these proto files in Go, update go_package to point to the repository currently in use : github.com/tronprotocol/protocol.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deprecate http rest mappings in gRPC protos

3 participants