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

[fastx adapter] bytecode verifier pass to ensure all global objects have ID's #15

Closed
sblackshear opened this issue Dec 2, 2021 · 0 comments · Fixed by #38
Closed

[fastx adapter] bytecode verifier pass to ensure all global objects have ID's #15

sblackshear opened this issue Dec 2, 2021 · 0 comments · Fixed by #38
Assignees

Comments

@sblackshear
Copy link
Collaborator

sblackshear commented Dec 2, 2021

  • FastNFT requires that every object in the global object pool has a unique ID.
  • In Move, objects that can be stored in the global object pool must have the key attribute
  • Thus, we need a bytecode verifier pass that ensures that every struct declaration with the key attribute has a field of type ID
  • For convenience + to avoid ambiguity, we should also enforce that this is the first field in the declaration and that the field is named id
  • In addition, any struct declaration with the key attribute must not have the drop attribute. This ensures that mutable references into the global object pool (e.g., via a &mut parameter in an entrypoint) cannot change the ID of an existing object in the pool (because ID's must be immutable--see [fastx adapter] bytecode verifier pass to ensure immutability + non-reuse of ID's #18)

An example of a similar bytecode verifier pass inside the VM is here. The code for this bytecode verifier pass should live in the fastNFT repo + be run in the adapter on the code path for publishing new Move modules.

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

2 participants