Skip to content

feat(vm): record internal tx for precompile value calls#37

Open
bladehan1 wants to merge 1 commit into
release_v4.8.2from
feature/precompile_internal_tx
Open

feat(vm): record internal tx for precompile value calls#37
bladehan1 wants to merge 1 commit into
release_v4.8.2from
feature/precompile_internal_tx

Conversation

@bladehan1

@bladehan1 bladehan1 commented Jun 11, 2026

Copy link
Copy Markdown
Owner

Replaces #36 to use the branch naming convention from CONTRIBUTING.md: feature/ prefix with underscore-separated words. #36 replaced #35, which was marked as merged after release_v4.8.2 was temporarily pushed to the feature commit by mistake.

What does this PR do?

Records an internal transaction when a successful precompiled contract call carries TRX or TRC10 value.

Zero-value precompiled contract calls still do not emit internal transactions. TRX value calls are recorded with the transferred TRX value, and TRC10 value calls are recorded with token information, matching normal contract call internal transaction semantics.

Why are these changes required?

Precompiled contract calls can currently carry value through the CALL/CALLTOKEN path when the precompiled address already has an account. The balance change is committed on successful execution, but no internal transaction is recorded, which makes the transfer difficult to reconcile from transaction results.

This change keeps the existing value-transfer behavior while making successful precompiled value calls observable through internal transactions.

This PR has been tested by:

  • Unit Tests: ./gradlew :framework:test --tests org.tron.common.runtime.vm.OperationsTest
  • Checkstyle: ./gradlew :framework:checkstyleMain :framework:checkstyleTest

Follow up

None.

Extra details

This PR is based on release_v4.8.2 and contains one commit with two changed files.


Summary by cubic

Record internal transactions for successful precompiled contract value calls (TRX and TRC10) so these transfers are visible in results. Zero-value calls remain unchanged.

  • New Features
    • Emit an internal transaction on successful precompile CALL/CALLTOKEN when value > 0; TRX uses the value field and TRC10 includes token info; note is "call".
    • No internal transaction for zero-value or failed calls, matching normal contract call semantics.

Written for commit b617af2. Summary will update on new commits.

Review in cubic

@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9284e2cb-32a5-4326-ba1a-d0ec5fe15423

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/precompile_internal_tx

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.

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No issues found across 2 files

Re-trigger cubic

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.

1 participant