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

feat(iota-framework): Display object extension #3861

Closed
wants to merge 12 commits into from

Conversation

valeriyr
Copy link
Contributor

@valeriyr valeriyr commented Nov 4, 2024

Description of change

TODO

Links to any relevant issues

fixes #3087

@valeriyr valeriyr added the sc-platform Issues related to the Smart Contract Platform group. label Nov 4, 2024
@valeriyr valeriyr self-assigned this Nov 4, 2024
@valeriyr valeriyr changed the title feat(iota-framework): added and integrated SystemDisplayCap feat(iota-framework): Display object extension Nov 4, 2024
@valeriyr valeriyr force-pushed the sc-platform/issue-3087-display-object-ext branch from a3b474e to fc6bdfa Compare November 4, 2024 10:29
@valeriyr valeriyr force-pushed the sc-platform/issue-3087-display-object-ext branch from 1b9d004 to cff774d Compare November 5, 2024 13:45
@valeriyr valeriyr force-pushed the sc-platform/issue-3087-display-object-ext branch from f4568b5 to 0fa27f6 Compare November 5, 2024 14:52
}

/// Immutable borrows the value associated with the key in the extra fields.
public(package) fun borrow_extra_field<K: copy + drop + store, V: store>(
Copy link
Member

Choose a reason for hiding this comment

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

Two questions:

  1. Can you show me how would you implement a x_y_z_object_display_exists() function on the authority state? This will be needed when we introduce creating/updating the displays with endofepoch, and I don't fully see how you'd do this, as it is not simply a does an object with this ID exists in the state? type of query.
  2. Assume there is an IotaSystemStateV2. How do you migrate the extra fields? You can't loop over them the way they are currently implemented, no? Would it make sense to use integer indexing so you can iterate over them since you know the bag size? And add some extra resolution table from index to type name.

Copy link
Member

@lzpap lzpap Nov 5, 2024

Choose a reason for hiding this comment

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

Assume there is an IotaSystemStateV2. How do you migrate the extra fields? You can't loop over them the way they are currently implemented, no? Would it make sense to use integer indexing so you can iterate over them since you know the bag size? And add some extra resolution table from index to type name.

We can hardcode the keys in the migration function that should exist at the previous version so this might not be an issue.

Copy link
Contributor Author

@valeriyr valeriyr Nov 5, 2024

Choose a reason for hiding this comment

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

Great questions:

  1. I was going to create such a function before marking the PR as ready to review 👍 We should also check if the Display of the specific version exists.
  2. The extra fields are migrated just by moving a Bag object:
    https://github.com/MystenLabs/sui/blob/69d3653419174917d8ffe667f230609970f9a544/crates/sui-framework/packages/sui-system/sources/sui_system_state_inner.move#L283
    because all the fields are added as Bag dynamic fields. Migration for each extra field should be done separately if it is required.

@valeriyr valeriyr force-pushed the sc-platform/issue-3087-display-object-ext branch from ad1d661 to 4860b6f Compare November 7, 2024 12:03
@valeriyr valeriyr force-pushed the sc-platform/issue-3087-display-object-ext branch from c6b5ed2 to 5235500 Compare November 8, 2024 12:52
@valeriyr valeriyr force-pushed the sc-platform/issue-3087-display-object-ext branch from aeb0ba0 to d1a7faf Compare November 14, 2024 09:52
@valeriyr valeriyr force-pushed the sc-platform/issue-3087-display-object-ext branch from d1a7faf to 8f82d05 Compare November 14, 2024 12:02
@valeriyr valeriyr closed this Dec 3, 2024
@valeriyr valeriyr deleted the sc-platform/issue-3087-display-object-ext branch December 3, 2024 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sc-platform Issues related to the Smart Contract Platform group.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Task: (SC-Platform)]: Display Objects for system types
3 participants