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

Ensure validate_state() is called after update_state() to enforce state validity and reduce redundant validation #1242

Open
sanity opened this issue Sep 26, 2024 · 5 comments

Comments

@sanity
Copy link
Collaborator

sanity commented Sep 26, 2024

To prevent buggy or malicious contract behavior from propagating invalid states across the network, we should enforce a design where validate_state() is always called after update_state(). This will ensure that the state remains valid after a delta is applied, without relying on redundant validation inside the update_state() function itself. We should remove the validate_delta() function (if present) and explicitly discourage performing state validation within update_state(), as validate_state() will handle this post-update validation.

@sanity sanity converted this from a draft issue Sep 26, 2024
@gogo2464
Copy link
Contributor

OH nice can I be assigned to this please?

@sanity
Copy link
Collaborator Author

sanity commented Oct 12, 2024

@gogo2464 You're welcome to try it and submit a pull request, assuming @iduartgomez hasn't started work on it.

@gogo2464
Copy link
Contributor

seems I could do it.

@sanity
Copy link
Collaborator Author

sanity commented Nov 3, 2024

Hasn't this been merged already? If so please close.

@gogo2464
Copy link
Contributor

gogo2464 commented Nov 4, 2024

not yet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Planned
Development

No branches or pull requests

3 participants