lfglabs-dev / lfglabs-dev/verity

feat(codegen): emit solc-shaped ABI, allocation, arithmetic, and library Yul helpers

Open
#2,059 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Lean
Stars
148
Forks
20
Avg merge
1d 14h
Merged PRs (30d)
29

Description

Context

Downstream Morpho Midnight Yul identity is gated by python3 scripts/report_yul_identity_gap.py --midnight --enforce-configured-gate in morpho-verity.

Current function-level drift has no hash mismatches, but still has 75 onlyInSolidity functions. The largest Solidity-only families are solc generated helpers:

  • fun_*: 16 keys (fun_hasCredit, fun_isHealthy, fun_mulDivUp, fun_touchMarket, fun_updatePosition, etc.)
  • update_storage_value*: 9 keys for packed/offest storage writes
  • abi_decode_address*: 7 keys
  • finalize_allocation*: 4 keys
  • abi_decode_struct*: 3 keys
  • checked arithmetic helpers: 9 total across add/sub/mul/div/mod families

Feature request

Add a Solidity-parity Yul helper emission mode for common solc helper families, so Verity-generated Yul can intentionally emit solc-shaped helper functions when targeting Yul identity against Solidity irOptimized output.

High-value helper families from the Midnight report:

  • ABI encode/decode helpers for address, bool, bytes, dynamic arrays, and structs.
  • Memory allocation helpers such as finalize_allocation and array_allocation_size_*.
  • Checked arithmetic helpers matching solc 0.8 overflow semantics and helper names where feasible.
  • Library/internal fun_* helper emission for Solidity-shaped functions used by Midnight.

Why this matters

These helpers are the largest Solidity-only part of the Midnight Yul identity manifest after the Verity-only internal helper drift. Closing them would substantially reduce the fail-closed manifest and make the Verity artifact structurally closer to solc output.

Related issues: #1982 (broad roadmap), #1993 (checked arithmetic), #2055 (dynamic calldata decoder refinement).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running python3 scripts/report_yul_identity_gap.py --midnight --enforce-configured-gate in morpho-verity and reviewing the helper families listed in the report. Read related issues #1982, #1993, and #2055 for existing scope, then trace the codegen emission path. Done means a configurable Solidity-parity mode emits the requested ABI, allocation, arithmetic, and library helpers and substantially reduces the Solidity-only identity gap.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, solidity
Domain
blockchain, compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.