Skip to content

fix[lang]!: ban calling nonreentrant functions from nonreentrant functions#4574

Merged
charles-cooper merged 6 commits intovyperlang:masterfrom
charles-cooper:feat/no-call-nonreentrant-from-nonreentrant
Apr 13, 2025
Merged

fix[lang]!: ban calling nonreentrant functions from nonreentrant functions#4574
charles-cooper merged 6 commits intovyperlang:masterfrom
charles-cooper:feat/no-call-nonreentrant-from-nonreentrant

Conversation

@charles-cooper
Copy link
Copy Markdown
Member

@charles-cooper charles-cooper commented Apr 12, 2025

What I did

How I did it

How to verify it

test case:

@external
@nonreentrant
def foo():
    self.bar()

@nonreentrant
@internal
def bar():
    pass

Commit message

this commit disallows calling nonreentrant functions from other
nonreentrant functions, including nonreentrant functions that are
directly called, or reachable anywhere in the call graph. the reason
for this is that the current codegen has very unintuitive behavior --
since the outer function sets the lock, the inner function will revert
on checking if the lock is set. better to ban the behavior and work on
how to relax it (if at all) later.

Description for the changelog

Cute Animal Picture

Put a link to a cute animal picture inside the parenthesis-->

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 12, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.63%. Comparing base (c05c1b9) to head (8dd10ca).
Report is 84 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4574      +/-   ##
==========================================
- Coverage   92.66%   92.63%   -0.03%     
==========================================
  Files         123      122       -1     
  Lines       17516    17525       +9     
  Branches     2967     2979      +12     
==========================================
+ Hits        16231    16235       +4     
- Misses        883      892       +9     
+ Partials      402      398       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@charles-cooper charles-cooper changed the title ban calling nonreentrant functions from other nonreentrant functions fix[lang]!: ban calling nonreentrant functions from nonreentrant functions Apr 13, 2025
@charles-cooper charles-cooper merged commit 1f994f5 into vyperlang:master Apr 13, 2025
162 of 163 checks passed
@charles-cooper charles-cooper deleted the feat/no-call-nonreentrant-from-nonreentrant branch April 13, 2025 19:22
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.

2 participants