Skip to content

fix(tvm): canonicalize ModExp zero modulus output (TIP-871)#6778

Closed
yanghang8612 wants to merge 1 commit into
developfrom
codex/tvm-osaka-modexp-create2
Closed

fix(tvm): canonicalize ModExp zero modulus output (TIP-871)#6778
yanghang8612 wants to merge 1 commit into
developfrom
codex/tvm-osaka-modexp-create2

Conversation

@yanghang8612
Copy link
Copy Markdown
Collaborator

Summary

  • gate MODEXP zero-modulus output canonicalization behind ALLOW_TVM_OSAKA
  • reset CREATE2 call return-data state behind the same Osaka gate
  • add direct Osaka MODEXP tests plus a Solidity 0.8.25 VM-level reproduction for MODEXP and CREATE2 observable behavior

Motivation

Related to tronprotocol/tips#871. MODEXP currently returns empty output for an all-zero modulus even when modLen > 0; after Osaka it should return modLen zero bytes. CREATE2 also needs to match CREATE by clearing stale return-data state before execution once the Osaka behavior is active.

Testing

./gradlew :framework:test --tests org.tron.common.runtime.vm.AllowTvmOsakaTest --tests org.tron.common.runtime.vm.TvmIssueVerifierTest

@yanghang8612 yanghang8612 changed the title Fix Osaka MODEXP zero modulus and CREATE2 call semantics Fix Osaka MODEXP zero modulus May 19, 2026
@yanghang8612 yanghang8612 changed the title Fix Osaka MODEXP zero modulus fix(tvm): canonicalize ModExp zero modulus output (TIP-871) May 19, 2026
@yanghang8612 yanghang8612 reopened this May 19, 2026
@yanghang8612
Copy link
Copy Markdown
Collaborator Author

Closing to reopen a clean PR with the finalized title.

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