lfglabs-dev / lfglabs-dev/verity

Typed interface calls cannot return multiple values

Open
#2,424 1 comment 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

Typed interface (dot-call) methods support a single return value:

interface IIdleCreditVault where
  function prepareStopEpochWithApr0(Uint256) returns (Uint256, Uint256)
end
...
let (a, b) ← strategy.prepareStopEpochWithApr0 x
-- error: interface call 'IIdleCreditVault.prepareStopEpochWithApr0' returns multiple values; typed dot calls currently support one return value

Pareto's stopEpoch calls two such methods (prepareStopEpochWithApr0, previewLossAdjustedWithdrawFunds, both (uint256, uint256)). The only compiling encoding is a name-keyed linked_externals external f(Uint256) -> (Uint256, Uint256) with callExternal, which loses the target address (the strategy) in the compilation model.

Ask: allow tuple destructuring of typed interface calls with static multi-word returns (the ABI-frame lowering tracked in #1982 covers the dynamic case; two static words should not need it).

Closure-side tracking: audit/VERITY-GAPS.md G14.

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 with the typed interface call example and the two Pareto methods named in the issue, then read the ABI-frame lowering work tracked in #1982. Check audit/VERITY-GAPS.md for G14 and trace how static two-word returns are compiled. Done means tuple destructuring works for these calls without losing the strategy target address.

Written by the indexing model from the issue text.

Assessment

Domain
blockchain, compilers
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.