-
Notifications
You must be signed in to change notification settings - Fork 17
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(sui-genesis-builder): migrate Alias Outputs #163
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
While creating foundries now maps the `(ObjectID, TypeOrigin)` to the `TokenId`.
…reate_basic_objects
kodemartin
reviewed
May 9, 2024
kodemartin
reviewed
May 9, 2024
kodemartin
reviewed
May 9, 2024
…utor::create_basic_objects
…n::Executor::create_basic_objects
…igration::Executor::create_basic_objects
Co-authored-by: Philipp Gackstatter <[email protected]>
6 tasks
5b6fcac
to
e60e613
Compare
Thoralf-M
reviewed
May 15, 2024
Thoralf-M
reviewed
May 15, 2024
miker83z
requested changes
May 15, 2024
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.
Great PR, it follows almost perfectly the assumed design!
I just signaled a major issue related to the security of generating ObjectIds + some small issues.
kodemartin
requested changes
May 16, 2024
miker83z
approved these changes
May 16, 2024
kodemartin
approved these changes
May 16, 2024
alexsporn
pushed a commit
that referenced
this pull request
Sep 6, 2024
* feat(sui-genesis-builder): store TypeOrigin of native tokens While creating foundries now maps the `(ObjectID, TypeOrigin)` to the `TokenId`. * refactor(sui-genesis-builder): split stardust::types module * feat(sui-genesis-builder): add unlock types * feat(sui-genesis-builder): add BasicOutput type * refactor(sui-genesis-builder): use OutputHeader while creating outputs * feat(sui-genesis-builder): implement stardust::migration::Executor::create_basic_objects * fixup! feat(sui-genesis-builder): implement stardust::migration::Executor::create_basic_objects * fixup! fixup! feat(sui-genesis-builder): implement stardust::migration::Executor::create_basic_objects * feat(sui-genesis-builder): fix native-token object ids during migration * fixup! fixup! fixup! feat(sui-genesis-builder): implement stardust::migration::Executor::create_basic_objects * fix(sui-genesis-builder): correct BasicOutput::type_ module and name Co-authored-by: Philipp Gackstatter <[email protected]> * fix(sui-genesis-builder): load packages and input objects correctly * fix(sui-genesis-builder): dummy transfer Bag object * Implement move data model in Rust * Execute alias creation transaction * Fix dependencies during PTB execution * Fix alias tags, extend test * Add TODO for dynamic object field * Expose `attach_alias` function * Fix outstanding alias migration TODOs * Prettify alias migration test * `cargo fmt` the genesis builder * Make state controller non-optional * Move alias migration test to separate file * Cleanup alias migration test * Add zeroized check and simplify match statement * Add non-zeroed alias id test * Use to_genesis_object approach * Use fresh_id as the alias output ID * Compute version of aliases via `lamport_timestamp` * Move crate-level migration test to module --------- Co-authored-by: Konstantinos Demartinos <[email protected]>
alexsporn
pushed a commit
that referenced
this pull request
Sep 6, 2024
* feat(sui-genesis-builder): store TypeOrigin of native tokens While creating foundries now maps the `(ObjectID, TypeOrigin)` to the `TokenId`. * refactor(sui-genesis-builder): split stardust::types module * feat(sui-genesis-builder): add unlock types * feat(sui-genesis-builder): add BasicOutput type * refactor(sui-genesis-builder): use OutputHeader while creating outputs * feat(sui-genesis-builder): implement stardust::migration::Executor::create_basic_objects * fixup! feat(sui-genesis-builder): implement stardust::migration::Executor::create_basic_objects * fixup! fixup! feat(sui-genesis-builder): implement stardust::migration::Executor::create_basic_objects * feat(sui-genesis-builder): fix native-token object ids during migration * fixup! fixup! fixup! feat(sui-genesis-builder): implement stardust::migration::Executor::create_basic_objects * fix(sui-genesis-builder): correct BasicOutput::type_ module and name Co-authored-by: Philipp Gackstatter <[email protected]> * fix(sui-genesis-builder): load packages and input objects correctly * fix(sui-genesis-builder): dummy transfer Bag object * Implement move data model in Rust * Execute alias creation transaction * Fix dependencies during PTB execution * Fix alias tags, extend test * Add TODO for dynamic object field * Expose `attach_alias` function * Fix outstanding alias migration TODOs * Prettify alias migration test * `cargo fmt` the genesis builder * Make state controller non-optional * Move alias migration test to separate file * Cleanup alias migration test * Add zeroized check and simplify match statement * Add non-zeroed alias id test * Use to_genesis_object approach * Use fresh_id as the alias output ID * Compute version of aliases via `lamport_timestamp` * Move crate-level migration test to module --------- Co-authored-by: Konstantinos Demartinos <[email protected]>
alexsporn
pushed a commit
that referenced
this pull request
Sep 6, 2024
* feat(sui-genesis-builder): store TypeOrigin of native tokens While creating foundries now maps the `(ObjectID, TypeOrigin)` to the `TokenId`. * refactor(sui-genesis-builder): split stardust::types module * feat(sui-genesis-builder): add unlock types * feat(sui-genesis-builder): add BasicOutput type * refactor(sui-genesis-builder): use OutputHeader while creating outputs * feat(sui-genesis-builder): implement stardust::migration::Executor::create_basic_objects * fixup! feat(sui-genesis-builder): implement stardust::migration::Executor::create_basic_objects * fixup! fixup! feat(sui-genesis-builder): implement stardust::migration::Executor::create_basic_objects * feat(sui-genesis-builder): fix native-token object ids during migration * fixup! fixup! fixup! feat(sui-genesis-builder): implement stardust::migration::Executor::create_basic_objects * fix(sui-genesis-builder): correct BasicOutput::type_ module and name Co-authored-by: Philipp Gackstatter <[email protected]> * fix(sui-genesis-builder): load packages and input objects correctly * fix(sui-genesis-builder): dummy transfer Bag object * Implement move data model in Rust * Execute alias creation transaction * Fix dependencies during PTB execution * Fix alias tags, extend test * Add TODO for dynamic object field * Expose `attach_alias` function * Fix outstanding alias migration TODOs * Prettify alias migration test * `cargo fmt` the genesis builder * Make state controller non-optional * Move alias migration test to separate file * Cleanup alias migration test * Add zeroized check and simplify match statement * Add non-zeroed alias id test * Use to_genesis_object approach * Use fresh_id as the alias output ID * Compute version of aliases via `lamport_timestamp` * Move crate-level migration test to module --------- Co-authored-by: Konstantinos Demartinos <[email protected]>
alexsporn
pushed a commit
that referenced
this pull request
Sep 9, 2024
* feat(sui-genesis-builder): store TypeOrigin of native tokens While creating foundries now maps the `(ObjectID, TypeOrigin)` to the `TokenId`. * refactor(sui-genesis-builder): split stardust::types module * feat(sui-genesis-builder): add unlock types * feat(sui-genesis-builder): add BasicOutput type * refactor(sui-genesis-builder): use OutputHeader while creating outputs * feat(sui-genesis-builder): implement stardust::migration::Executor::create_basic_objects * fixup! feat(sui-genesis-builder): implement stardust::migration::Executor::create_basic_objects * fixup! fixup! feat(sui-genesis-builder): implement stardust::migration::Executor::create_basic_objects * feat(sui-genesis-builder): fix native-token object ids during migration * fixup! fixup! fixup! feat(sui-genesis-builder): implement stardust::migration::Executor::create_basic_objects * fix(sui-genesis-builder): correct BasicOutput::type_ module and name Co-authored-by: Philipp Gackstatter <[email protected]> * fix(sui-genesis-builder): load packages and input objects correctly * fix(sui-genesis-builder): dummy transfer Bag object * Implement move data model in Rust * Execute alias creation transaction * Fix dependencies during PTB execution * Fix alias tags, extend test * Add TODO for dynamic object field * Expose `attach_alias` function * Fix outstanding alias migration TODOs * Prettify alias migration test * `cargo fmt` the genesis builder * Make state controller non-optional * Move alias migration test to separate file * Cleanup alias migration test * Add zeroized check and simplify match statement * Add non-zeroed alias id test * Use to_genesis_object approach * Use fresh_id as the alias output ID * Compute version of aliases via `lamport_timestamp` * Move crate-level migration test to module --------- Co-authored-by: Konstantinos Demartinos <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of change
Implements the Move models in Rust for the migration of the Alias Output.
Changes to the Alias Move model:
attach_alias
method public (was test-only before). This is needed so we can easily attach theAlias
to theAliasOutput
from a PTB, since we cannot passalias_output.id
as an argument todynamic_object_field::add
directly.Option<SuiAddress>
in the move code, unless I missed the argument for it.Links to any relevant issues
fixes issue #154.
Type of change
Choose a type of change, and delete any options that are not relevant.
How the change has been tested
Added a migration test. More to be added for native tokens and in case the alias id is zeroed.
Change checklist
Tick the boxes that are relevant to your changes, and delete any items that are not.