[Feature] Remove the dead WalletExtension gRPC service and config

Aperta
#6,931 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
grpc, java
Ambito
api, backend

Direzione di ricerca

Start with protocol/src/main/protos/api/api.proto and RpcApiService.WalletExtensionApi, then trace node.walletExtensionApi through CommonParameter, NodeConfig, Args, and the bundled .conf files. Review the named cleanup targets in Util, GrpcClient, WalletClient, HttpMethed, and ParameterTest. Done means the service, five unused messages, configuration item, registration, and test helpers are removed while the stated compatibility behavior is preserved.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

topic:api topic:protocol type:feature

Summary

The WalletExtension gRPC service has been registered but not implemented since Odyssey-v3.7 (2020-03): all four of its RPCs return UNIMPLEMENTED. This proposal removes the unused Java implementation, the node.walletExtensionApi configuration item that controls it, and the service WalletExtension definition in api.proto. It also removes the messages that are no longer used without this service: AccountPaginated, TransactionList, TransactionListExtention, TimeMessage, and TimePaginatedMessage.

Problem

Motivation

java-tron still includes a gRPC service, a config switch, and a set of proto RPC definitions that do not work. The in-memory index that once supported these RPCs was removed long ago because it used too many node resources for the value it provided; transaction information by account address is now provided by TronGrid. The config name may make node operators think it controls whether a working API is exposed, while the proto definitions cause SDK code generators to create client stubs for methods that can never succeed.

Current State
  1. Proto definitions: protocol/src/main/protos/api/api.proto still defines four WalletExtension RPCs, all of which take AccountPaginated. GetTransactionsFromThis and GetTransactionsToThis return TransactionList; their *2 versions return TransactionListExtention. These RPCs are the only users of the three message types in any .proto file in the repository. TimePaginatedMessage and the TimeMessage it contains are also unused after their *ByTimestamp RPCs were removed in #909.
  2. Runtime behavior: RpcApiService.WalletExtensionApi provides no RPC implementation: it extends WalletExtensionGrpc.WalletExtensionImplBase but overrides none of its RPC methods, and its only private helper, transactionList2Extention(), has no callers. Every request therefore uses the generated default handler and returns UNIMPLEMENTED. Registration does not change this behavior. The service is added only on a solidity node when node.walletExtensionApi = true; reference.conf sets the key to false by default, but the bundled framework/src/main/resources/config.conf sets it to true. The old HTTP endpoints were removed with the RPC implementations in #2533, leaving only unused integration-test helpers.
Limitations or Risks

This does not add a new runtime risk. The main issue is unnecessary confusion. Node operators may think node.walletExtensionApi controls a working API, while generated SDKs still include methods that always return UNIMPLEMENTED. The remaining code and proto definitions also require maintenance.

Proposed Solution

Proposed Design
  1. Remove the Java implementation: Delete the WalletExtensionApi class, its registration branch in RpcApiService.addService(), and the WalletExtensionGrpc import.
  2. Delete the proto definitions: Remove service WalletExtension and its four RPCs from api.proto, together with the five messages listed above.
  3. Remove the configuration item: Delete node.walletExtensionApi from CommonParameter, NodeConfig, Args, and all bundled .conf files. If the old key is still present in an operator config, log a removal warning at startup.
  4. Clean up the remaining unused code: Remove Util.printTransactionList() from main sources, whose only caller is its own unit test; remove the unused WalletExtension test code from GrpcClient, WalletClient, and HttpMethed; and delete the getter/setter assertions for the removed parameter from ParameterTest.
Key Changes
  • Modules: framework, common, protocol, and related test code
  • API / Behavior Surface: The four service WalletExtension RPCs are no longer registered. Their gRPC status remains UNIMPLEMENTED; only the status description changes, from unimplemented-method wording to unregistered-service wording.

Impact

The change keeps the same gRPC status code and has no performance effect other than registering one fewer service at startup. It makes the node configuration and code easier to understand and maintain: it removes a config item that looks like an API switch but does not control a working service, stops generating SDK stubs for methods that can never succeed, and removes unused code from about a dozen files.

Compatibility

  • Breaking Change: Yes, for clients that use the removed definitions. Runtime behavior and the wire format do not change because all four RPCs already return UNIMPLEMENTED. Clients such as wallet-cli or Trident may keep their own copy of api.proto or generated gRPC code; if that code uses WalletExtensionGrpc or the five messages listed above, it must be updated when the new proto is adopted.
  • Default Behavior Change: No.
  • Migration Required: Only for clients that use the removed definitions; no action is required for node operators. Existing walletExtensionApi entries are ignored with a startup warning.

Additional Notes

  • Do you have ideas regarding implementation? Yes
  • Are you willing to implement this feature? Yes
Lingua principale
Java
Stelle
4.2k
Fork
1.7k
Merge medio
6g 20h
PR unite (30g)
14

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di tronprotocol/java-tron

Tutte le issue di tronprotocol/java-tron

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.