Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(RES-151): support for multiple calls of the same function #2079

Merged
merged 21 commits into from
Oct 24, 2024

Conversation

oggy-dfin
Copy link
Member

@oggy-dfin oggy-dfin commented Oct 16, 2024

When the same function (e.g., ledger transfer) is called multiple times from an update method (e.g., disbursing a neuron, where we first burn the fees, and then transfer the disbursed amount), we need to allow the TLA model to distinguish in which context the function is being called. The contexts are defined through Pluscal labels. Thus:

  1. we add a new annotation, tla_function, which can (and should) be used in functions called in multiple contexts within the same update method
  2. we add a log_label macro to allow changing the context in the parent method
  3. we adopt a convention where we stack labels by concatenating them (separated by an underscore). So if the transfer function uses the Transfer label, we can have, e.g., Burn_Fees_Transfer in the Burn_Fees context and Transfer_Disbursed_Transfer in Transfer_Disbursed context)

The PR also includes some unrelated improvements to TLA error reporting (including reporting the source locations).

@github-actions github-actions bot added the feat label Oct 16, 2024
@oggy-dfin oggy-dfin changed the title feat(IC-1579): support for multiple calls of the same function feat(RES-151): support for multiple calls of the same function Oct 18, 2024
@oggy-dfin oggy-dfin marked this pull request as ready for review October 18, 2024 10:18
@oggy-dfin oggy-dfin requested review from a team as code owners October 18, 2024 10:18
@oggy-dfin oggy-dfin added this pull request to the merge queue Oct 24, 2024
Merged via the queue into master with commit 1023062 Oct 24, 2024
25 checks passed
@oggy-dfin oggy-dfin deleted the oggy/tla-multiple-calls branch October 24, 2024 11:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants