Skip to content

Record internal tx for precompile value calls#34

Closed
bladehan1 wants to merge 10 commits into
release_v4.8.2from
feat/internalTx
Closed

Record internal tx for precompile value calls#34
bladehan1 wants to merge 10 commits into
release_v4.8.2from
feat/internalTx

Conversation

@bladehan1

@bladehan1 bladehan1 commented Jun 11, 2026

Copy link
Copy Markdown
Owner

Summary

  • record an internal transaction when a successful precompiled contract call carries TRX or TRC10 value
  • keep zero-value precompile calls from emitting internal transactions
  • add regression coverage for precompile value calls

Tests

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

Summary by cubic

Record internal transactions for successful precompiled contract calls that transfer TRX or TRC10 value; zero-value precompile calls emit none. Adds regression tests to cover value-carrying precompiles.

  • New Features

    • Add internal tx on precompile calls with value (TRX/TRC10); include token info for TRC10.
    • Introduce signature truncation in TransactionUtil.truncateSignatures; enforce bounds in API.
    • CI: add single-node and multi-node integration workflows; add reference.conf comment-coverage gate and bean parity tests.
  • Bug Fixes

    • Replace MerkleTree singleton with per-call MerkleTree.build(...) to fix concurrency races.
    • Harden shutdown: exit Solidity node block sync promptly; avoid park/unpark race in TronNetDelegate.
    • Add VM guards for CREATE2 depth and modexp edge case (fork VERSION_4_8_1_1) to cap CPU.
    • Storage config: apply only user overrides to DB options; clarify reference.conf and tests.

Written for commit 74b23b5. Summary will update on new commits.

Review in cubic

317787106 and others added 10 commits June 2, 2026 18:16
…onprotocol#6816)

MerkleTree was a shared volatile singleton holding per-build mutable state (leaves/hashList/root). When merkle validation runs concurrently (e.g. pre-broadcast validation on the P2P handler threads alongside the apply path), concurrent calls mutated the shared leaves list and threw ArrayIndexOutOfBoundsException (surfaced on an ARM SR due to its weaker memory model), which escaped the BadBlockException catch and dropped peers.

- MerkleTree: replace the getInstance() singleton with a static build() factory returning a thread-confined instance; drop the now-inaccurate @NotThreadSafe.
- BlockCapsule.calcMerkleRoot: use MerkleTree.build(ids); keeps the config-driven hash engine, so no consensus behavior change.
- MerkleTreeTest: switch call sites to build(); un-ignore testConcurrent and turn it into a regression test asserting 1000 concurrent builds succeed.
* feat(*): disable exchange transaction (tronprotocol#6507)

* update a new version. version name:GreatVoyage-v4.8.0-1-g45e3bf88ca,version code:18634 (tronprotocol#6508)

* Merge release_v4.8.1 to master (tronprotocol#6541)

* update a new version. version name:GreatVoyage-v4.8.0.1-1-g44a4bc8263,version code:18636 (tronprotocol#6542)

* feat(vm): optimize the check for create2

* feat(vm): optimize the check for ModExp

* test(vm): add tests for create2/modExp checks

* feat(version): update version to 4.8.1.1

* feat(ci): add PR pipeline and system-test workflows

New workflows:
- pr-build.yml: multi-OS build matrix (macOS, Ubuntu, RockyLinux, Debian11)
  and changed-line/overall coverage gate
- pr-check.yml: PR title/body lint + Checkstyle
- pr-reviewer.yml: scope-based reviewer auto-assignment
- pr-cancel.yml: cancel in-progress runs when PR is closed unmerged
- system-test.yml: spin up FullNode and run the system-test suite

Existing workflows:
- codeql.yml: bump to v4/v5 actions, switch to manual build-mode with
  JDK 8, add paths-ignore for docs-only changes
- math-check.yml: bump checkout/upload-artifact/github-script versions

* feat(config): fix git.properties NPE

* update a new version. version name:GreatVoyage-v4.8.1-6-g52d7d9d23e,version code:18643

---------

Co-authored-by: YAaron <4241080+kuny0707@users.noreply.github.com>
Co-authored-by: zz <aaa@bb.cc>
@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: 8d6ba996-493b-4aa9-870a-806af522f484

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 feat/internalTx

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
Owner Author

Superseded by #35, which is based directly on release_v4.8.2 and contains only the intended commit.

@bladehan1 bladehan1 closed this Jun 11, 2026
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.

6 participants