docs: fix bug metadata for TRON 0.8.30 security backports + fix: reject Ethereum units in AST imports - #149
Merged
CodeNinjaEvan merged 2 commits intoJul 29, 2026
Conversation
- Mark SOL-2025-1, SOL-2026-1, SOL-2026-2 and SOL-2026-3 as fixed in 0.8.30 on this release line: the fixes were backported from upstream 0.8.32/0.8.34/0.8.36, so the bug list must not claim 0.8.30 is still affected. - Restore TRON terminology (Trx) in legacy bug descriptions that were inadvertently overwritten with upstream wording (Ether) by the cherry-picks. - Regenerate docs/bugs_by_version.json from docs/bugs.json and this branch's Changelog.md; entries for versions not released on this branch (0.8.31+) drop out accordingly.
|
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
marked this pull request as ready for review
July 29, 2026 03:50
CodeNinjaEvan
approved these changes
Jul 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR contains two commits addressing audit findings for the 0.8.30 release:
Commit 1:
docs: fix bug metadata for TRON 0.8.30 security backportsFollow-up fix for two documentation issues found in the 0.8.29 → 0.8.30 audit (PR #142 security backports):
Bug version matrix inconsistency (docs/bugs.json, docs/bugs_by_version.json)
LostStorageArrayWriteOnSlotOverflow), SOL-2026-1 (TransientStorageClearingHelperCollision), SOL-2026-2 (UnsoundSpillInMutualRecursion) and SOL-2026-3 (InheritanceOrderReversalOnStorageEndWarning) were backported to TRON 0.8.30 via Backport SOL-2025-1 through SOL-2026-3 fixes to release_0.8.30 #142, but theirfixedfields still pointed at the upstream Ethereum releases (0.8.32/0.8.34/0.8.36). As a result,bugs_by_version.jsonclaimed 0.8.30 is still affected by all four bugs.fixedfields now say0.8.30on this release line, anddocs/bugs_by_version.jsonwas regenerated withscripts/update_bugs_by_version.py: 0.8.29 correctly lists all four bugs as affecting it, while 0.8.30 lists none.TRON terminology regression (docs/bugs.json)
Trx) with upstream wording (Ether) in three legacy bug entries: SOL-2017-5 (ZeroFunctionSelector), SOL-2016-7 (LibrariesNotCallableFromPayableFunctions), SOL-2016-6 (SendFailsForZeroEther).Commit 2:
fix: reject Ethereum units in AST importsFixes a unit-policy inconsistency between compilation entry points (audit ref CR-009):
wei/gwei/ether(Parser.cpp, "Ether unit denomination is not supported by the compiler"), but the same literal node imported via Standard JSONlanguage=SolidityASTwas silently accepted and constant-evaluated with Ethereum multipliers (e.g.1 ether→PUSH8 0x0de0b6b3a7640000, 10^18 instead of TRX's 10^6).ASTJsonImporter::subdenomination()now rejectswei/gwei/etherwithastAssert; the newcatch (InvalidAstError)inStandardCompiler::compileSolidity()turns it into a cleanJSONError("Failed to import AST: ...") instead of a fatal exception.SyntaxChecker::visit(Literal)rejects Ether denominations at the unified post-import analysis stage, with the same error id and message as the parser.RationalNumberType::isValidLiteral()treatsWei/Gwei/Etheras invalid, so even programmatically constructed Literals cannot be constant-evaluated with Ethereum multipliers.StandardCompiler/solidity_ast_rejects_ethereum_subdenominations(cross-entry end-to-end: compile1 trxfrom source, patch the exported AST to wei/gwei/ether, feed back via SolidityAST, expect JSONError and no contracts output) andSolidityTypes/ethereum_subdenominations_are_invalid.libsolidity/experimental/analysis/TypeInference.cppstill contains Ethereum multiplier handling for these denominations. It is unreachable — the experimental pipeline shares the same parser, and the AST import path is now guarded — and is intentionally left unchanged in this PR.Verification
python3 -m json.toolpasses for both files;scripts/update_bugs_by_version.pyoutput is byte-identical (reproducible).JSONErrorand no bytecode; source entry fortrx/sun/time denominations unchanged (10^6 / 1 / time multipliers verified in bytecode); source entry still rejects1 gweiat parse time.SolidityTypes,SyntaxChecker,ASTJSONsuites pass;syntaxTestsfailures (25) are byte-identical to the parent commit (all pre-existing fork debt); the 3StandardCompiler/basic_compilationfailures are the known pre-existing hardcoded-bytecode expectations not adapted to TRON token-value guards.Notes
fixed: 0.8.30on the TRON release line vs upstream fixed versions) should be confirmed by reviewers before merge.