-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
feat: add function for generating bytecode identifier #6674
Conversation
This is currently blocked because the related compiler change was reverted. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Appreciate all the comments done here as well.
Great work! Do you think it would be worthwhile having the source |
Thanks for bringing this up. I thought about having the tests generate the binary files from the source, but thought that it would be annoying to have to update the bytecode IDs in the tests whenever the compiler changes. I figured that if the tests aren't regenerating the binary from source, there was no need to include the source, since the source projects are already checked in under When we need to regenerate the binary files in the future, it would just be a matter of building those two examples with |
Didn't know the the source is already in examples; in that case no need for another source. Just thinking from the point of someone else having to fix the tests if they break. |
Good idea. I'll add a comment in a separate PR since this one is pretty much ready to go. |
## Description Adding comments per #6674 (comment) ## 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). - [ ] If my change requires substantial documentation changes, I have [requested support from the DevRel team](https://github.com/FuelLabs/devrel-requests/issues/new/choose) - [ ] 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](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md). - [ ] I have requested a review from the relevant team or maintainers. --------- Co-authored-by: JoshuaBatty <joshpbatty@gmail.com>
Description
Depends on #6522
Related FuelLabs/forc.pub#16
Adds a function,
get_bytecode_id
that generates a sha256 hash of the bytecode with the configurables section of the bytecode removed. This will be used for indexing and lookups of the corresponding ABIs for contracts, predicates, and scripts in the package registry (forc.pub).Checklist
Breaking*
orNew Feature
labels where relevant.