Skip to content

fix: align TRON runtime and compiler semantics - #146

Merged
CodeNinjaEvan merged 7 commits into
tronprotocol:release_0.8.30from
yanghang8612:fix/release-0.8.30-runtime-correctness
Jul 28, 2026
Merged

fix: align TRON runtime and compiler semantics#146
CodeNinjaEvan merged 7 commits into
tronprotocol:release_0.8.30from
yanghang8612:fix/release-0.8.30-runtime-correctness

Conversation

@yanghang8612

@yanghang8612 yanghang8612 commented Jul 28, 2026

Copy link
Copy Markdown

Summary

  • reject TRON native/precompile operations for unsupported pre-Byzantium targets
  • align TRON builtin behavior between legacy and via-IR code generation
  • classify validatemultisign as view because it reads current account permission state
  • use a compile-time token ID bound and add defensive TRON builtin arity checks
  • model TRON state-changing builtins conservatively in SMTChecker

Details

The PR intentionally preserves the existing 168-bit TRON address validation, does not add EOF-specific opcode restrictions, and leaves Standard JSON viaIR behavior unchanged. EOF is already disabled at the CLI, Standard JSON, and CompilerStack entry points.

For the multisignature precompiles:

  • java-tron ValidateMultiSign reads the account, permission, signer weights, and threshold, so the compiler declaration must be view rather than pure.
  • java-tron BatchValidateSign only performs signature recovery and address comparison, so it remains pure.
  • both precompile addresses are gated by allowTvmSolidity059. When the proposal is unavailable, the address follows the empty-code call path and can succeed with zero-length returndata. Legacy codegen reads the pre-zeroed output word as zero, while the previous via-IR decoder reverted on fewer than 32 return bytes. The via-IR path now preserves the established legacy result without changing normal java-tron precompile success or failure handling.
  • java-tron 4.8.2 malformed-input failures return Pair.of(false, EMPTY_BYTE_ARRAY). Both compiler backends check the call success flag before decoding or applying short-return compatibility, so these failures still propagate as empty-data reverts.

References:

Validation

  • cmake --build build --target soltest solc -j2
  • StandardCompiler/tron_builtin_via_ir_codegen_guards — passed
  • syntaxTests/tron/validatemultisign_mutability — passed
  • syntaxTests/tron/precompiles_before_byzantium — passed
  • smtCheckerTests/tron/state_mutation_havocs_balance — passed
  • git diff --check origin/release_0.8.30...HEAD — passed

@github-actions

Copy link
Copy Markdown

Thank you for your contribution to the Solidity compiler! A team member will follow up shortly.

If you haven't read our contributing guidelines and our review checklist before, please do it now, this makes the reviewing process and accepting your contribution smoother.

If you have any questions or need our help, feel free to post them in the PR or talk to us directly on the #solidity-dev channel on Matrix.

@yanghang8612
yanghang8612 marked this pull request as ready for review July 28, 2026 07:36
@CodeNinjaEvan
CodeNinjaEvan merged commit a7ec301 into tronprotocol:release_0.8.30 Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants