Skip to content

ci: get the failing CI pipeline green#104

Open
km631 wants to merge 14 commits into
masterfrom
ci/fix-failing-checks
Open

ci: get the failing CI pipeline green#104
km631 wants to merge 14 commits into
masterfrom
ci/fix-failing-checks

Conversation

@km631

@km631 km631 commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

What

Fixes the failing CI jobs across the checks and formal verification workflows. Opened to verify the fixes pass in CI.

checks

  • lint — removed an unused rel binding in tron-batches.config.cjs (eslint no-unused-vars).
  • tests / tests-upgradeable — the patched -oz-tron FullNode.jar that the TRE harness gates on was never built, so run-tests-parallel.sh aborted at pre-flight. Added a cached build-tre-jar job that uploads the jar as an artifact; tests, tests-upgradeable and coverage now download it. Also:
    • compile the corpus once in run-tests-parallel.sh before fanning out (workers run --no-compile, artifacts/ is gitignored, and transpile.sh deletes it) — SKIP_COMPILE=1 reuses artifacts locally.
    • copy the upgradeable peer dependency to lib/tron-contracts to match the @openzeppelin/tron-contracts/ remapping (was lib/openzeppelin-contracts). Validated end-to-end: transpile + full tron compile = 571 artifacts.
  • harnesses — see FV below.

formal verification

  • apply-diff / harnesses — the fv/ Certora suite was inherited from upstream OZ and referenced renamed/absent contracts. Fixed the ERC721 patch path (TRC721), dropped the account-abstraction patch/harness/specs (no such contracts in this fork), and renamed harnesses/specs/methods ERCTRC, EIP712TIP712. Wired compile:harnesses to a dedicated batch config so it actually compiles the harnesses (19 artifacts via tron-solc) instead of silently compiling contracts/.
  • halmosvia_ir = true in foundry.toml so a bare forge build compiles the require(cond, CustomError()) overload.

Not included

  • coveragehardhat coverage can't run against this stack (solidity-coverage records 0 hits under the mandatory viaIR pipeline; collection is VM-hook-bound to an in-process EVM). Left as-is pending a separate decision.

Validation done locally

  • make -C fv apply, npm run compile:harnesses (19 harness artifacts), forge harness compile, transpile + npm run compile on the upgradeable output (571 artifacts), forge build --via-ir, npm run lint, and actionlint on the workflow — all green.

km631 and others added 14 commits June 19, 2026 12:15
The peer exposed-wrapper batch builder computed `rel` but never used it (include paths come straight from path.relative per file), tripping eslint no-unused-vars and failing the lint job.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The test jobs never built the patched -oz-tron FullNode.jar the TRE harness gates on, so run-tests-parallel aborted at pre-flight. Add a build-tre-jar job (cached + uploaded as an artifact) that tests, tests-upgradeable and coverage download. Also compile the corpus once in run-tests-parallel.sh before fanning out (workers use --no-compile and artifacts are gitignored), and copy the upgradeable peer to lib/tron-contracts to match the remapping.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Several contracts use the require(cond, CustomError()) overload, which only compiles via the IR pipeline. forge test passes --via-ir explicitly, but halmos runs a bare forge build and failed; set via_ir in the default profile.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The fv/ formal-verification subsystem was inherited from upstream OZ and referenced renamed/absent contracts: fix the ERC721 patch path (TRC721), drop the account-abstraction patch/harness/specs (no such contracts in this fork), and rename harnesses/specs/methods ERC->TRC, EIP712->TIP712. Also wire compile:harnesses to a dedicated batch config (BATCHES env + fv/harness-batches.config.cjs) so it compiles the harnesses instead of silently compiling contracts/.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Python 3.12+ rejects java-tron's FullNode.jar in zipfile with 'Overlapped entries (possible zip bomb)'; the ubuntu-latest system python is 3.12 so build-tre-fork.sh's repack failed. Pin 3.11 for the build-tre-jar job.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Pinning Python 3.11 didn't help — the 'possible zip bomb' overlap check is backported to all maintained CPython branches (3.11.15 included), and java-tron's FullNode.jar has a duplicate META-INF/LICENSE. build-jar.sh (fetched from hardhat-tron, not ours) repacks via zipfile and dies. Inject a sitecustomize.py on PYTHONPATH from build-tre-fork.sh that clears each entry's _end_offset so the guard is skipped (the repack already de-dupes by name). Revert the now-useless 3.11 pin.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Tests deploy $<X> hardhat-exposed wrappers, but contracts-exposed/ is gitignored (generated, not committed) and the tron compile runs SKIP_EXPOSED=1, so on a fresh CI checkout the wrappers don't exist — every $<X> deploy failed with 'Artifact not found' (tests: 170 fail, tests-upgradeable: 192 fail). Run exposed:regen (stock solc) before the compile in run-tests-parallel.sh when contracts-exposed/ is absent, so both jobs build the wrappers first.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Compilation (~8 min: exposed:regen + tron batches) is a pure function of the contract sources, compiler config and tron-solc version. Cache artifacts/ + contracts-exposed/ keyed on a hash of those (no restore-keys — a partial hit would test stale bytecode) and set SKIP_COMPILE on a hit so run-tests-parallel reuses them. tests-upgradeable caches post-transpile under a distinct key. Unlike the jar (one stable blob shared by 3 jobs, hence cache+artifact), each test corpus differs, so a per-job actions/cache fits better.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
test:pragma recompiles every contract individually to validate its pragma range — pure contract work that ran on every test run. Gate it on the compile cache: a hit means the corpus is byte-identical to a state where pragma already passed, so test-only changes now do zero compilation. Still runs on contract changes (cache miss).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…7913

The ERC-7913 P256 cases passed signMessage().serialized (65 bytes, r||s||v), but TRC7913P256Verifier requires exactly r||s (0x40) — the spurious recovery byte made it reject valid signatures, failing the 4 positive cases. Build the 64-byte form directly.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ble builds

The proxy-test skip-list still had the upstream path proxy/ERC1967/ERC1967Proxy.test.js; the fork's file is proxy/TRC1967/TRC1967Proxy.test.js. So after the transpiler strips proxies it wasn't skipped and tried to deploy the removed TRC1967Proxy/TRC1967ProxyUnsafe (23 failures). Fix the path.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
solidity-coverage recorded 0/3561 hits. Root cause: hardhat/tron-artifact-suffix.js eagerly accessed hre.ethers at HRE construction to wrap deployContract, binding hardhat-ethers to the pre-coverage provider — so the suite ran on a VM solidity-coverage never hooked via attachToHardhatVM. Gate that shim on a tron network (mirroring the bridge it supports) so it's inert under coverage. Also drive the coverage compile down the legacy pipeline where solidity-coverage attributes hits: defaultNetwork=hardhat, solc 0.8.28 + viaIR off (0.8.27+ compiles require(cond,CustomError()) in legacy), and exclude the one $TRC7739Mock wrapper that stack-too-deeps. Validated: TRC20.sol 100%, 126/126 passing (was 0 hits). TVM deploy pipeline untouched.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…overage)

With hardhat coverage now collecting hits on the in-process EVM, ~50 TVM-specific tests failed there. Add feature-detected EVM fallbacks (TVM path preserved; gated on receipt.internalTransactions presence or network.config.tron) for Clones/ProxyAdmin/UUPSUpgradeable (CREATE address via staticCall/AdminChanged event), AccessManager (FailedCall vs revertedWithoutReason) and sanity (block-height >/>=). Tag the genuinely TVM-only cases [skip-on-coverage] — the TVM 0x41 CREATE2 prefix is hardcoded in Create2/RelayedCall/Clones predict (no EVM equivalent), and $TRC7739*Mock wrappers are excluded under coverage. Result: full coverage run is 6481 passing / 10 pending / 0 failing, ~95% statement coverage.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@km631 km631 requested a review from pepebndc June 19, 2026 13:51
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