Skip to content

feat[lang]!: ban nonreentrant on internal functions #4573

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

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

charles-cooper
Copy link
Member

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

What I did

How I did it

How to verify it

Commit message

this commit removes the possibility of adding `@nonreentrant` to
internal functions.

first of all, it was a fairly strange feature, since users don't
typically think about marking internal functions as nonreentrant

second of all, it had strange behavior, since a nonreentrant internal
function called by another function (internal or external) would
revert, since the caller had already set the nonreentrancy lock. we
could fix this, but it's a fairly complicated fix.

lastly, with plans to disable reentrancy by default (see GH 3380), the
ideal default behavior of internal functions (not marked with either
`@reentrant` or `@nonreentrant`) is not clear. to avoid this ambiguity,
we simply remove the possibility of nonreentrancy on all internal
functions.

references:
- https://github.com/vyperlang/vyper/issues/3380
- https://github.com/vyperlang/vyper/issues/4509

Description for the changelog

Cute Animal Picture

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

Copy link

codecov bot commented Apr 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.70%. Comparing base (2d515d3) to head (44d6cf7).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4573   +/-   ##
=======================================
  Coverage   92.70%   92.70%           
=======================================
  Files         123      123           
  Lines       17526    17527    +1     
  Branches     2971     2971           
=======================================
+ Hits        16248    16249    +1     
  Misses        879      879           
  Partials      399      399           

☔ 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
Copy link
Member Author

@cyberthirst added a sanity check 44d6cf7

@charles-cooper charles-cooper enabled auto-merge (squash) April 12, 2025 08:52
@charles-cooper charles-cooper disabled auto-merge April 12, 2025 08:53
@charles-cooper
Copy link
Member Author

@charles-cooper charles-cooper marked this pull request as draft April 13, 2025 18:52
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