security(Tron): Remove Tron direct transaction signing#4666
Open
sergei-boiko-trustwallet wants to merge 4 commits intomasterfrom
Open
security(Tron): Remove Tron direct transaction signing#4666sergei-boiko-trustwallet wants to merge 4 commits intomasterfrom
sergei-boiko-trustwallet wants to merge 4 commits intomasterfrom
Conversation
Copilot started reviewing on behalf of
sergei-boiko-trustwallet
February 25, 2026 08:49
View session
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes Tron “direct signing” support (signing via txId or raw JSON), simplifying the Tron signing API and implementation by forcing all signing through the standard transaction-building path.
Changes:
- Removed
txIdandraw_jsonfromTron.protoSigningInput. - Deleted direct-signing code paths and raw-JSON handling in the Tron signer implementation.
- Removed C++ and Android instrumentation tests that covered direct signing.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/proto/Tron.proto |
Simplifies Tron SigningInput by removing direct-signing fields. |
src/Tron/Signer.cpp |
Removes signDirect and raw-JSON branches; consolidates signing behavior. |
tests/chains/Tron/SignerTests.cpp |
Removes direct-signing unit tests. |
tests/chains/Tron/TransactionCompilerTests.cpp |
Removes raw-JSON compile/signature test coverage. |
android/app/src/androidTest/java/com/trustwallet/core/app/blockchains/tron/TestTronTransactionSigner.kt |
Removes Android test for direct signing via txId. |
Comments suppressed due to low confidence (1)
src/Tron/Signer.cpp:443
- After removing the
raw_json/direct-signing code paths,Signer.cppno longer usesnlohmann::jsondirectly (only the#include <nlohmann/json.hpp>remains). Consider dropping that include to reduce compile-time dependencies and keep includes minimal.
Proto::SigningOutput Signer::compile(const Data& signature) const {
Proto::SigningOutput output;
auto preImage = signaturePreimage();
auto hash = Hash::sha256(preImage);
auto transaction = buildTransaction(input);
const auto json = transactionJSON(transaction, hash, signature).dump();
output.set_json(json.data(), json.size());
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Binary size comparison➡️ aarch64-apple-ios: 14.34 MB ➡️ aarch64-apple-ios-sim: - 14.34 MB
+ 14.34 MB -1 KB➡️ aarch64-linux-android: 18.77 MB ➡️ armv7-linux-androideabi: - 16.20 MB
+ 16.20 MB -1 KB➡️ wasm32-unknown-emscripten: - 13.68 MB
+ 13.68 MB -1 KB |
|
Why is this not being handled? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request removes support for "direct signing" of Tron transactions using either the
txIdor raw JSON input fields. The changes simplify the Tron transaction signing logic by eliminating code paths and tests related to this feature, and by removing the now-unnecessary fields from the protocol buffer definition.Key changes:
Protocol/API simplification:
txIdandraw_jsonfields from theSigningInputmessage inTron.proto, as well as all related documentation.Core signing logic cleanup:
signDirectfunction and all code handling direct signing viatxIdorraw_jsoninSigner.cpp, consolidating all signing through the standard transaction-building path.Signer::compile,Signer::signaturePreimage, andSigner::signaturePreimageHashthat previously parsed and handled raw JSON input.Test suite cleanup:
txIdor raw JSON from both Kotlin (TestTronTransactionSigner.kt) and C++ test suites (SignerTests.cpp,TransactionCompilerTests.cpp).These changes make the Tron signing codebase more maintainable by removing rarely used or redundant signing paths.