Skip to content

feat(tvm): optimize execution failure handling - #7105

Merged
yanghang8612 merged 2 commits into
tronprotocol:release_v4.8.3from
yanghang8612:opt/tvm-result-classification
Nov 12, 2026
Merged

yanghang8612 merged 2 commits into
tronprotocol:release_v4.8.3from
yanghang8612:opt/tvm-result-classification

Conversation

@yanghang8612

@yanghang8612 yanghang8612 commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

What does this PR do?

Optimize TVM execution failure handling under allowTvmResourceOptimization:

  • Give recognized VM exceptions priority over the REVERT flag in transaction result classification.
  • Preserve nested CREATE/CREATE2 revert data beginning with 0xEF and refund unused child Energy. London continues to reject normally returned deployment code beginning with 0xEF.

Both changes preserve historical behavior before activation.

Why are these changes required?

An end-of-transaction CPU timeout can coexist with the REVERT flag. Reporting OUT_OF_TIME lets retry and receipt validation distinguish this outcome from a normal REVERT.

Constructor revert data is not deployment code. Treating an 0xEF revert payload as invalid code discards the payload and consumes the child's remaining Energy, affecting subsequent caller execution.

This PR has been tested by:

Local validation on macOS ARM64 / JDK 17:

  • ./gradlew clean build -x test — passed.
  • ProgramCreateRevertTest — 64 cases passed, including the real-bytecode activation matrix, precise Energy and returndata, caller storage writes, existing exceptions, child rollback and nonce handling, post-child timeouts, and the existing CREATE2/Osaka buffer boundary.
  • ProgramChildDeadlineTest — 28 cases passed; the 10 RuntimeImpl regression cases and 2 London cases also passed.
  • ./gradlew test --continue — 5,724 passed, 16 skipped, 2 P2P DNS failures described below; no framework or actuator failures.
  • ./gradlew :framework:checkstyleMain :framework:checkstyleTest :plugins:checkstyleMain — passed.
  • bash .github/scripts/check_math_usage.sh — passed.

Follow up

  • Validate CI results across the supported platform matrix.
  • Include the nested creation revert-data and Energy rules in TIP-945 before coordinated activation. This implementation assumes parameter 104 has not already activated on the target chain; a chain where it is already active requires a new agreed activation condition for the additional semantics.

Extra details

The two local full-suite failures were LookUpTxtTest.testLookUpIp_nonexistentDomain_returnsNull and StartAppArgsTest.trustIpsSkipsWhatItCannotResolve. The local DNS resolver returned 198.18.x.x addresses for .invalid names, contrary to these tests' unresolved-host expectations.

Prioritize recognized exception result codes over REVERT when TVM resource
optimization is enabled, so post-REVERT CPU timeouts can trigger retry
and receipt validation. Preserve historical REVERT priority before
activation.

Cover exception mappings and post-REVERT timeouts for contract calls
and creation.
Preserve constructor REVERT data beginning with 0xEF when TVM resource
optimization is active. Retain London code rejection for normal returns
and historical behavior before activation.

Cover CREATE and CREATE2 activation combinations, remaining Energy,
caller-visible returndata, child rollback, exception precedence,
deadline handling and the existing Osaka return-buffer boundary.
@yanghang8612 yanghang8612 changed the title feat(tvm): optimize execution result classification feat(tvm): optimize execution failure handling Nov 12, 2026
@yanghang8612
yanghang8612 merged commit 6f74c05 into tronprotocol:release_v4.8.3 Nov 12, 2026
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants