feat(compiler): multi-compiler Solidity compatibility and diagnostic matrix (#76) - #113
Merged
Nanle-code merged 2 commits intoAug 30, 2026
Conversation
Contributor
|
@covenantalade Great job |
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
Closes #76
ChainProof.
pragma solidity >=0.7.0 <0.9.0;), which introduces severe audit and deployment blindspots when assumptions aboutcompiler behavior diverge across minor and patch releases. This PR introduces a deterministic TypeScript toolchain
for multi-compiler version evaluation, cross-file pragma constraint solving, artifact normalization, sandboxed
compilation, and differential comparison.
carets (
^), tildes (~), wildcards (*,x), hyphen ranges, inequalities (>=,<=,>,<), conjunctions,and disjunctions (
||).- Pragma Constraint Engine (
packages/core/src/compiler/pragma.ts): Extracts AST/regex pragmas, evaluatesfloating/overly broad/security-sensitive ranges, and resolves multi-file dependency trees to detect unsatisfiable or
conflicting import pragmas with pairwise conflict reporting.
11$\to$ 0.5 $\to$ 0.6 $\to$ 0.7 $\to$ 0.8).
to0.8.28mapping features, capabilities (checked arithmetic, custom errors, UDVTs, transient storage, push0, viaIR, ABI coder v2, storage layout output), and default EVM targets. - **Codegen Bugs & Hazards (SOL_CODEGEN_BUGS):** Curated database of known Solidity compiler code generation bugs (SOL-BUG-2024-1transient storage corruption,SOL-BUG-2023-1PUSH0 EVM mismatch,SOL-BUG-2022-7signed immutables sign-extension,SOL-BUG-2021-3` storage byte packing, etc.) mapped to AST triggering conditions.- Breaking Changes Registry: Detailed syntax and semantic migration registry across minor compiler families
(0.4
ABIs, calculates exact storage packing layouts, and models version-specific syntax/hazards.
-
NativeSolcAdapter: Sandboxed process runner for local verified compiler binaries with memory and executiontimeout limits.
- Cryptographic Binary Verification (
packages/core/src/compiler/checksums.ts): SHA-256 binary validationdatabase (
OFFICIAL_SOLC_CHECKSUMS) with zero dynamic network download requirements in CI.- Process Isolation & Sanitization (
packages/core/src/compiler/sandbox.ts): Environment scrubbing (redactsAPI keys and secrets), compiler cache corruption validation, and error sanitization (strips absolute host paths).
function selectors and 32-byte event topics, storage layout packing and slot hash computation, and bytecode opcode
parsing (
PUSH0,TSTORE,TLOAD).- Cross-Compiler Differential Comparator (
packages/core/src/compiler/comparator.ts): Compares compilationoutputs across versions:
- Storage Layout Drift: Detects slot collisions and offset shifts (critical for upgradeable proxy storage
corruption).
- ABI Diffs: Added, removed, or mutated function selectors, events, and errors.
- Bytecode & EVM Diffs: Size delta (bytes/percent), PUSH0 introduction hazards, and transient storage usage.
- Diagnostic & Finding Diffs: Compiler warnings and security detector findings.
,--fail-on-drift. - **REST Endpoints (packages/server/src/routes/compiler.ts&openapi.yaml):** -POST /compiler/inspect-POST /compiler/matrix-POST /compiler/compare-POST /compiler/audit`contracts, floating/broad pragmas, incompatible imports, storage layout collisions, and transient storage.
matrix, adapters, differential comparator, static rules, configuration migration, adversarial bounds, public APIs,
CLI commands, and server routes.
- Repository Validation:
-
npm run build: All 6 workspace packages build cleanly with 0 errors (core,server,cli,hardhat- plugin,vscode-extension,github-action).-
npm run lint: 0 ESLint errors.-
npm test: 52/52 test suites passed, 437/437 unit & integration tests passing.