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

Account readwrite deescalation is not persisted in instruction execution context #13908

Closed
jstarry opened this issue Dec 2, 2020 · 1 comment · Fixed by #14626
Closed

Account readwrite deescalation is not persisted in instruction execution context #13908

jstarry opened this issue Dec 2, 2020 · 1 comment · Fixed by #14626
Assignees
Milestone

Comments

@jstarry
Copy link
Member

jstarry commented Dec 2, 2020

Problem

If a program passes a readwrite account as readonly to an inner instruction, then any writes should cause an error. Since the runtime doesn't track changes to write deescalation, it allows those instructions to succeed but will not return those state changes to the caller program due to this check:

if message.is_writable(i) && !account.executable {

Proposed Solution

Temporarily deescalate is_writable in PreAccounts for inner instructions.

@jstarry
Copy link
Member Author

jstarry commented Dec 2, 2020

Might make sense to remove both is_signer and is_writable from PreAccount actually. Then, is_writable can be passed in to the PreAccount verify functions.

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

3 participants