refactor(protocol): prune grpc-gateway related proto#72
Conversation
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the 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 configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (17)
📝 WalkthroughWalkthroughThis pull request removes Go package generation directives and HTTP/REST gateway annotations from proto files. The Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Review rate limit: 0/1 reviews remaining, refill in 15 minutes and 40 seconds.Comment |
There was a problem hiding this comment.
3 issues found across 17 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="protocol/src/main/protos/core/contract/shield_contract.proto">
<violation number="1" location="protocol/src/main/protos/core/contract/shield_contract.proto:7">
P3: Remove the `go_package` option; this file is meant to be part of the proto cleanup that strips Go-generation metadata.</violation>
</file>
<file name="protocol/src/main/protos/core/contract/smart_contract.proto">
<violation number="1" location="protocol/src/main/protos/core/contract/smart_contract.proto:7">
P3: Remove the `go_package` option here; it contradicts the proto cleanup and keeps this contract proto generateable as Go.</violation>
</file>
<file name="protocol/src/main/protos/core/contract/storage_contract.proto">
<violation number="1" location="protocol/src/main/protos/core/contract/storage_contract.proto:7">
P2: Remove this `go_package` option. It keeps Go stub generation enabled for this proto, which contradicts the cleanup.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| option java_package = "org.tron.protos.contract"; //Specify the name of the package that generated the Java file | ||
| //option java_outer_classname = "BuyStorageBytesContract"; //Specify the class name of the generated Java file | ||
| option go_package = "github.com/tronprotocol/grpc-gateway/core"; | ||
| option go_package = "github.com/tronprotocol/protocol/core/contract"; |
There was a problem hiding this comment.
P2: Remove this go_package option. It keeps Go stub generation enabled for this proto, which contradicts the cleanup.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At protocol/src/main/protos/core/contract/storage_contract.proto, line 7:
<comment>Remove this `go_package` option. It keeps Go stub generation enabled for this proto, which contradicts the cleanup.</comment>
<file context>
@@ -4,6 +4,7 @@ package protocol;
option java_package = "org.tron.protos.contract"; //Specify the name of the package that generated the Java file
//option java_outer_classname = "BuyStorageBytesContract"; //Specify the class name of the generated Java file
+option go_package = "github.com/tronprotocol/protocol/core/contract";
message BuyStorageBytesContract {
</file context>
| option java_package = "org.tron.protos.contract"; //Specify the name of the package that generated the Java file | ||
| //option java_outer_classname = "ShieldedTransferContract"; //Specify the class name of the generated Java file | ||
| option go_package = "github.com/tronprotocol/grpc-gateway/core"; | ||
| option go_package = "github.com/tronprotocol/protocol/core/contract"; |
There was a problem hiding this comment.
P3: Remove the go_package option; this file is meant to be part of the proto cleanup that strips Go-generation metadata.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At protocol/src/main/protos/core/contract/shield_contract.proto, line 7:
<comment>Remove the `go_package` option; this file is meant to be part of the proto cleanup that strips Go-generation metadata.</comment>
<file context>
@@ -4,6 +4,7 @@ package protocol;
option java_package = "org.tron.protos.contract"; //Specify the name of the package that generated the Java file
//option java_outer_classname = "ShieldedTransferContract"; //Specify the class name of the generated Java file
+option go_package = "github.com/tronprotocol/protocol/core/contract";
// for shielded transaction
</file context>
| option java_package = "org.tron.protos.contract"; //Specify the name of the package that generated the Java file | ||
| //option java_outer_classname = "CreateSmartContract"; //Specify the class name of the generated Java file | ||
| option go_package = "github.com/tronprotocol/grpc-gateway/core"; | ||
| option go_package = "github.com/tronprotocol/protocol/core/contract"; |
There was a problem hiding this comment.
P3: Remove the go_package option here; it contradicts the proto cleanup and keeps this contract proto generateable as Go.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At protocol/src/main/protos/core/contract/smart_contract.proto, line 7:
<comment>Remove the `go_package` option here; it contradicts the proto cleanup and keeps this contract proto generateable as Go.</comment>
<file context>
@@ -4,6 +4,7 @@ package protocol;
option java_package = "org.tron.protos.contract"; //Specify the name of the package that generated the Java file
//option java_outer_classname = "CreateSmartContract"; //Specify the class name of the generated Java file
+option go_package = "github.com/tronprotocol/protocol/core/contract";
import "core/Tron.proto";
</file context>
Summary
Closes tronprotocol#6548.
Removes all
google.api.httpoption annotations from gRPC service definitions and deletes eight unused empty proto files underprotocol/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.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. Retaining them adds maintenance overhead and cognitive complexity without providing value.Changes
protocol/src/main/protos/api/api.protogoogle.api.httpoption blocks from 56 RPC methods across theWallet,WalletSolidity,WalletExtension, andMonitorservices.option go_packagedeclarations 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.protoblock.protodelegated_resource.protop2p.protoproposal.prototransaction.protovote.protowitness.protoImpact
FullNodeHttpApiServiceand are unaffected.option go_packagehas 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.