Skip to content

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

Open
317787106 wants to merge 2 commits intodevelopfrom
feature/prune_proto
Open

refactor(protocol): prune grpc-gateway related proto#72
317787106 wants to merge 2 commits intodevelopfrom
feature/prune_proto

Conversation

@317787106
Copy link
Copy Markdown
Owner

@317787106 317787106 commented Apr 17, 2026

Summary

Closes tronprotocol#6548.

Removes all google.api.http option annotations from gRPC service definitions and deletes eight unused empty proto files under protocol/src/main/protos/core/tron/. 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. Retaining them adds maintenance overhead and cognitive complexity without providing value.

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.
  • Removed option go_package declarations from API and contract proto files.

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 has been removed; Go client stubs can no longer be generated directly from these proto files.

Test

NA — this is a pure proto cleanup with no logic changes. The generated Java/gRPC stubs are functionally identical.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 17, 2026

Warning

Rate limit exceeded

@317787106 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 17 minutes and 41 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 17 minutes and 41 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 75936eb2-b76e-4a6e-aa7d-a0331f1bbae0

📥 Commits

Reviewing files that changed from the base of the PR and between 04821b8 and 52e1d1a.

📒 Files selected for processing (2)
  • protocol/src/main/protos/core/Discover.proto
  • protocol/src/main/protos/core/Tron.proto
📝 Walkthrough

Walkthrough

This pull request removes Go package generation directives and HTTP/REST gateway annotations from proto files. The go_package option is deleted from 15 proto files across API and contract modules. Additionally, all google.api.http annotations (including HTTP method mappings and bindings) are removed from the Wallet, WalletSolidity, WalletExtension, and Monitor services in the main API proto file.

Changes

Cohort / File(s) Summary
API Gateway HTTP Mappings
protocol/src/main/protos/api/api.proto
Removed go_package option and all google.api.http annotations (post/get, body, additional_bindings) from Wallet, WalletSolidity, WalletExtension, and Monitor RPC methods. RPC signatures unchanged; HTTP/REST gateway routes no longer declared.
ZkSnark Service Configuration
protocol/src/main/protos/api/zksnark.proto
Removed go_package option from proto file. Service and RPC declarations remain unchanged.
Contract Proto Package Configuration
protocol/src/main/protos/core/contract/*.proto (account_contract, asset_issue_contract, balance_contract, common, exchange_contract, market_contract, proposal_contract, shield_contract, smart_contract, storage_contract, vote_asset_contract, witness_contract)
Removed go_package option from 12 contract proto files. Message definitions and java_package options remain unchanged.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 Hops of joy!
HTTP routes now drift away,
Go packages freed from chains,
Proto files spring-cleaned today,
Cleaner code in our veins! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: removing grpc-gateway related proto options across multiple files. It is concise, specific, and clearly summarizes the primary refactoring objective.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/prune_proto

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 22 files

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deprecate http rest mappings in gRPC protos

1 participant