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

[framework][object] Introduce ability to recreate objects after deletion #15576

Draft
wants to merge 1 commit into
base: igor/add_to_property_map
Choose a base branch
from

Conversation

igor-aptos
Copy link
Contributor

Description

How Has This Been Tested?

Key Areas to Review

Type of Change

  • New feature
  • Bug fix
  • Breaking change
  • Performance improvement
  • Refactoring
  • Dependency update
  • Documentation update
  • Tests

Which Components or Systems Does This Change Impact?

  • Validator Node
  • Full Node (API, Indexer, etc.)
  • Move/Aptos Virtual Machine
  • Aptos Framework
  • Aptos CLI/SDK
  • Developer Infrastructure
  • Move Compiler
  • Other (specify)

Checklist

  • I have read and followed the CONTRIBUTING doc
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I identified and added all stakeholders and component owners affected by this change as reviewers
  • I tested both happy and unhappy path of the functionality
  • I have made corresponding changes to the documentation

Copy link

trunk-io bot commented Dec 12, 2024

⏱️ 53m total CI duration on this PR
Job Cumulative Duration Recent Runs
rust-cargo-deny 9m 🟩🟩🟩🟩🟩
rust-move-tests 8m 🟥
rust-move-tests 8m 🟥
rust-move-tests 7m 🟥
rust-move-tests 7m 🟥
check-dynamic-deps 6m 🟩🟩🟩🟩🟩
general-lints 3m 🟩🟩🟩🟩🟩
rust-move-tests 2m 🟥
semgrep/ci 2m 🟩🟩🟩🟩🟩
file_change_determinator 1m 🟩🟩🟩🟩🟩
permission-check 16s 🟩🟩🟩🟩🟩
permission-check 11s 🟩🟩🟩🟩🟩

settingsfeedbackdocs ⋅ learn more about trunk.io

Comment on lines 173 to 184
/// Used to (re)create object at a given address
enum CreateAtAddressRef has drop, store {
RecreateV1 {
object: address,
owner: address,
guid_creation_num: u64,
untransferable: bool,
allow_ungated_transfer: bool,
transfer_events: event::EventHandle<TransferEvent>
},
}
Copy link

Choose a reason for hiding this comment

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

Replace enum CreateAtAddressRef with a struct containing the same fields to be compatible with Move v1

Spotted by Graphite Reviewer (based on CI logs)

Is this helpful? React 👍 or 👎 to let us know.

Comment on lines 173 to 184
/// Used to (re)create object at a given address
enum CreateAtAddressRef has drop, store {
RecreateV1 {
object: address,
owner: address,
guid_creation_num: u64,
untransferable: bool,
allow_ungated_transfer: bool,
transfer_events: event::EventHandle<TransferEvent>
},
}
Copy link

Choose a reason for hiding this comment

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

Replace enum CreateAtAddressRef with a struct since Move 2 enum features are not yet enabled. Suggested replacement:

struct CreateAtAddressRef has drop, store {
object: address,
owner: address,
guid_creation_num: u64,
untransferable: bool,
allow_ungated_transfer: bool,
transfer_events: event::EventHandle
}

Spotted by Graphite Reviewer (based on CI logs)

Is this helpful? React 👍 or 👎 to let us know.

Comment on lines 55 to 56
/// Cannot delete_and_can_recreate with TombStone present.
const ETOMBSTONE_CANNOT_BE_PRESENT: u64 = 10;
Copy link

Choose a reason for hiding this comment

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

The error code 10 is already used by EBURN_NOT_ALLOWED, so ETOMBSTONE_CANNOT_BE_PRESENT should use a different value (such as 11) to avoid ambiguous error handling. Having two different error conditions share the same code could make debugging more difficult and impact error reporting accuracy.

Spotted by Graphite Reviewer

Is this helpful? React 👍 or 👎 to let us know.

@igor-aptos igor-aptos force-pushed the igor/add_to_property_map branch from b9bd71c to 80291e3 Compare December 12, 2024 18:38
@igor-aptos igor-aptos force-pushed the igor/object_delete_and_recreate branch from 7092a12 to 5cbb160 Compare December 12, 2024 18:38
@igor-aptos igor-aptos force-pushed the igor/add_to_property_map branch from 80291e3 to 1094f18 Compare December 16, 2024 22:23
@igor-aptos igor-aptos force-pushed the igor/object_delete_and_recreate branch from 5cbb160 to e5f2580 Compare December 16, 2024 22:23
@igor-aptos igor-aptos force-pushed the igor/add_to_property_map branch from 1094f18 to 4ce5c7c Compare December 17, 2024 19:43
@igor-aptos igor-aptos force-pushed the igor/object_delete_and_recreate branch from e5f2580 to 57414cf Compare December 17, 2024 19:44
@igor-aptos igor-aptos force-pushed the igor/add_to_property_map branch from 4ce5c7c to 38d0b84 Compare January 7, 2025 20:58
@igor-aptos igor-aptos force-pushed the igor/object_delete_and_recreate branch from 57414cf to 700d668 Compare January 7, 2025 20:58
@igor-aptos igor-aptos force-pushed the igor/add_to_property_map branch from 38d0b84 to 979fae3 Compare January 9, 2025 20:40
@igor-aptos igor-aptos force-pushed the igor/object_delete_and_recreate branch from 700d668 to b8a9b02 Compare January 9, 2025 20:40
@igor-aptos igor-aptos force-pushed the igor/add_to_property_map branch from 979fae3 to e86528e Compare January 10, 2025 06:41
@igor-aptos igor-aptos force-pushed the igor/object_delete_and_recreate branch from b8a9b02 to e0c474e Compare January 10, 2025 06:41
@igor-aptos igor-aptos force-pushed the igor/add_to_property_map branch from e86528e to 9836448 Compare January 10, 2025 07:31
@igor-aptos igor-aptos force-pushed the igor/object_delete_and_recreate branch from e0c474e to 95d8c20 Compare January 10, 2025 07:31
@igor-aptos igor-aptos force-pushed the igor/add_to_property_map branch from 9836448 to 2817048 Compare January 10, 2025 08:35
@igor-aptos igor-aptos force-pushed the igor/object_delete_and_recreate branch from 95d8c20 to 627e416 Compare January 10, 2025 08:35
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.

1 participant