Skip to content

fix(tron): account for NATIVEVOTE gas and modifier diagnostics#127

Open
yanghang8612 wants to merge 1 commit into
tronprotocol:release_0.8.28from
yanghang8612:fix/nativevote-gas-viewpure-checker
Open

fix(tron): account for NATIVEVOTE gas and modifier diagnostics#127
yanghang8612 wants to merge 1 commit into
tronprotocol:release_0.8.28from
yanghang8612:fix/nativevote-gas-viewpure-checker

Conversation

@yanghang8612

Copy link
Copy Markdown

Summary

  • Account for the two NATIVEVOTE memory-array arguments as word arrays in gas estimation.
  • Keep nested modifier mutability diagnostics aligned with TRON payable builtins (msg.tokenid and msg.tokenvalue).
  • Update the modifier-view syntax test so it reaches the ViewPureChecker diagnostic on TRON.

Root Cause

NATIVEVOTE receives array lengths as element counts, but the gas estimator only charged the fixed vote cost and did not expand memory for the referenced array data. Separately, the nested modifier payable diagnostic still mentioned only msg.value and callvalue(), while the direct diagnostic had already been updated for TRON token fields.

Validation

  • cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DUSE_Z3=OFF -DCMAKE_CXX_FLAGS='-Wno-deprecated-literal-operator'
  • cmake --build build --target solc isoltest -j2
  • build/test/tools/isoltest --no-semantic-tests -t 'syntaxTests/memberLookup/msg_value_modifier_view'
  • build/solc/solc --bin --optimize - with a minimal vote(address[],uint256[]) smoke contract

Local build note: Z3 was disabled because the installed version is newer than the pinned test version; the compiler warning flag suppresses an existing AppleClang warning in base code.

@github-actions

github-actions Bot commented Jul 2, 2026

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 force-pushed the fix/nativevote-gas-viewpure-checker branch from 99f7e53 to 63453b5 Compare July 2, 2026 04:11
@yanghang8612 yanghang8612 changed the title Fix NATIVEVOTE gas and modifier diagnostics fix(tron): account for NATIVEVOTE gas and modifier diagnostics Jul 2, 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.

1 participant