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

fix(StdStorage): check last read slots first #581

Merged
merged 1 commit into from
Jul 16, 2024

Conversation

klkvr
Copy link
Member

@klkvr klkvr commented Jul 5, 2024

simple optimization which resolves #580 and optimizes slots detection in some cases

It is more likely that slot we are looking for will be one of latest sloads. e.g. if execution went like

sload slot_1 <- currently we start from here
sload slot_2
sload slot_3 <- in most of the cases this value is returned
return

so this PR simply changes order in which we go through vm.accesses output

@mattsse mattsse merged commit 3d8086d into foundry-rs:master Jul 16, 2024
3 checks passed
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.

BUG StdStorage: Unexpected 'find' function behavior when dynamic array length matches searched element value
2 participants