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

Document/define storage slots for reentrancy locks #3382

Closed
pcaversaccio opened this issue May 3, 2023 · 3 comments · Fixed by #3605
Closed

Document/define storage slots for reentrancy locks #3382

pcaversaccio opened this issue May 3, 2023 · 3 comments · Fixed by #3605

Comments

@pcaversaccio
Copy link
Collaborator

pcaversaccio commented May 3, 2023

We should define somewhere properly how the storage slots for reentrancy locks are chosen. In the compiler code, we can see this here. Also, I feel we should disallow empty reentrancy locks like @nonreentrant("") or @nonreentrant(" ") for safety reasons.

@fubuloubu
Copy link
Member

It would be amazing to create an output storage slot table for viewing purposes, like in #1950

@charles-cooper
Copy link
Member

charles-cooper commented May 4, 2023

nonreentrant keys are in -f layout output format.

$ vyper -f layout /dev/stdin <<EOF
@external
@nonreentrant("x")
def foo():
  pass
EOF
{"storage_layout": {"nonreentrant.x": {"type": "nonreentrant lock", "slot": 0}}, "code_layout": {}}

@charles-cooper
Copy link
Member

invalid identifiers are prevented from being non-reentrancy keys in #3605

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 a pull request may close this issue.

3 participants