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 functionality to ensure that a program referenced in a Transaction struct has not been updated by the time the transaction is executed #55

Open
paul-schaaf opened this issue Apr 3, 2022 · 1 comment

Comments

@paul-schaaf
Copy link

No description provided.

@paul-schaaf paul-schaaf changed the title Add functionality to ensure that a program referenced in a TransactionAccount has not been updated by the time the transaction is updated Add functionality to ensure that a program referenced in a Transaction struct has not been updated by the time the transaction is updated Apr 3, 2022
@paul-schaaf paul-schaaf changed the title Add functionality to ensure that a program referenced in a Transaction struct has not been updated by the time the transaction is updated Add functionality to ensure that a program referenced in a Transaction struct has not been updated by the time the transaction is executed Apr 3, 2022
@paul-schaaf
Copy link
Author

paul-schaaf commented Apr 3, 2022

This could e.g. be achieved by adding a program_last_modified: Option<Slot> field to the Transaction struct that is None for < bpf3 programs and bpf3 programs where the upgrade authority is None and Some(X) for bpf3 programs with an upgrade authority where X equals the slot field on the Program Data account field at the time the Transaction is first proposed.

Inside execute_instruction the slot field on the Program Data account would be checked and the tx would fail if the slot != program_last_modified

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

No branches or pull requests

1 participant