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: add RVRT to unallowed opcodes for predicates #6290

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

bolajahmad
Copy link

@bolajahmad bolajahmad commented Jul 22, 2024

Statically prevent RVRT in predicates opcodes

Closes #5986

Checklist

  • I have linked to any relevant issues.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation where relevant (API docs, the reference, and the Sway book).
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added (or requested a maintainer to add) the necessary Breaking* or New Feature labels where relevant.
  • I have done my best to ensure that my PR adheres to the Fuel Labs Code Review Standards.
  • I have requested a review from the relevant team or maintainers.

@bolajahmad bolajahmad requested a review from a team as a code owner July 22, 2024 11:50
@bolajahmad bolajahmad marked this pull request as draft July 22, 2024 11:50
Copy link
Contributor

@IGI-111 IGI-111 left a comment

Choose a reason for hiding this comment

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

This needs a test.

@bolajahmad
Copy link
Author

This needs a test.

Thank you for reviewing my draft! I am working on adding the tests. Could you point me to where the existing tests are, or we need to create new one?

@IGI-111
Copy link
Contributor

IGI-111 commented Aug 8, 2024

Could you point me to where the existing tests are

https://github.com/FuelLabs/sway/tree/master/test/src/e2e_vm_tests/test_programs/should_fail/predicate_invalid_opcodes

@bolajahmad bolajahmad marked this pull request as ready for review August 12, 2024 10:37
@bolajahmad
Copy link
Author

Could you point me to where the existing tests are

https://github.com/FuelLabs/sway/tree/master/test/src/e2e_vm_tests/test_programs/should_fail/predicate_invalid_opcodes

It's straightforward to update the test.toml file to include tests for RVRT. Not so sure how the attached main.sw works to verify the tests.

I also cannot find a clear description of how to run the tests and ensure they pass.

@bolajahmad
Copy link
Author

The changes are not big and I believe they pass, but need this to be reviewed and also further docs on how to run the tests. Instructions on how the tests work will be appreciated too

@IGI-111
Copy link
Contributor

IGI-111 commented Aug 16, 2024

The provided test should be enough. Check the CI execution to see what commands to run specific tests locally

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.

Statically forbid usage of revert in predicates
3 participants