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

Add function to clear transient storage array #3

Merged
merged 1 commit into from
Feb 7, 2025

Conversation

fedgiac
Copy link
Collaborator

@fedgiac fedgiac commented Feb 4, 2025

Code to clear the transient storage array. For gas efficiency, the actual transient storage is not cleared, however it's inaccessible after clearing. This function allows the transient storage array to be used as some kind of reentrancy guard (see #2).

Note that I also sneaked in a bug fix: a test was marked as private and not external, meaning that it wasn't actually being run. As a future improvement process, we should check with a linter that functions of the form test_* are either public or external.

How to test

New fuzz tests.

@fleupold
Copy link

fleupold commented Feb 6, 2025

Not sure how to do this with a linter, but you can add a nitpicker rule that would flag non public test function

@fedgiac fedgiac merged commit 5f12ec0 into main Feb 7, 2025
3 checks passed
@fedgiac fedgiac deleted the clear-transient-storage-array branch February 7, 2025 14:39
@github-actions github-actions bot locked and limited conversation to collaborators Feb 7, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants