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

svm: simplify inspect logic #3769

Merged
merged 2 commits into from
Nov 28, 2024
Merged

Conversation

2501babe
Copy link
Member

@2501babe 2501babe commented Nov 25, 2024

Problem

current inspect flow is not quite right, an account that has been dropped may be inspected as alive instead of dead. this is harmless, because the first inspect will necessary be as writable, but technically incorrect

Summary of Changes

fix it. originally i was going to inspect inside the lamports if/else but i realized we can simply inspect after resolving the account, so now we only have one place in svm where this function is called

@2501babe 2501babe force-pushed the 20241124_inspectfix branch 3 times, most recently from a37e2bd to 8e2a228 Compare November 25, 2024 13:14
@2501babe 2501babe self-assigned this Nov 27, 2024
@2501babe 2501babe marked this pull request as ready for review November 27, 2024 10:21
@2501babe 2501babe requested a review from a team as a code owner November 27, 2024 10:21
jstarry
jstarry previously approved these changes Nov 27, 2024
// If lamports is 0, a previous transaction deallocated this account.
// Return None without inspecting, so it can be recreated.
// We must shadow the cache entry so the account may be reopened.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really get what this comment is trying to say

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i reworded it to be clearer, i just meant we have to ignore whats in account_cache because load_transaction_account needs to run the same logic as if there was nothing in accounts-db

@2501babe 2501babe merged commit dc57128 into anza-xyz:master Nov 28, 2024
40 checks passed
@2501babe 2501babe deleted the 20241124_inspectfix branch November 28, 2024 05:07
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.

3 participants