lfglabs-dev / lfglabs-dev/verity
feat(codegen): emit solc-shaped ABI, allocation, arithmetic, and library Yul helpers
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 writesabi_decode_address*: 7 keysfinalize_allocation*: 4 keysabi_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_allocationandarray_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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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