Skip to content

Commit

Permalink
[cherry-pick][SOD] Reshare objects at same initial_shared_version (#1…
Browse files Browse the repository at this point in the history
…7834) (#17840)

## Description 

Update the semantics of resharing so it preserves the initial shared
version of the shared object.

## Test plan 

Updated display for tests, and made sure that the initial shared version
is updated correctly under the new protocol version.

Bottom commit are the actual changes, and the updates to the meaningful
tests. The top (fixup) commit are the changes to the rest of the tests
to account for the update to the object owner display.

---

## Release notes

Check each box that your changes affect. If none of the boxes relate to
your changes, release notes aren't required.

For each box you select, include information after the relevant heading
that describes the impact of your changes that a user might notice and
any actions they must take to implement updates.

- [ ] Protocol: 
- [ ] Nodes (Validators and Full nodes): 
- [ ] Indexer: 
- [ ] JSON-RPC: 
- [ ] GraphQL: 
- [ ] CLI: 
- [ ] Rust SDK:

## Description 

Describe the changes or additions included in this PR.

## Test plan 

How did you test the new or updated feature?

---

## Release notes

Check each box that your changes affect. If none of the boxes relate to
your changes, release notes aren't required.

For each box you select, include information after the relevant heading
that describes the impact of your changes that a user might notice and
any actions they must take to implement updates.

- [ ] Protocol: 
- [ ] Nodes (Validators and Full nodes): 
- [ ] Indexer: 
- [ ] JSON-RPC: 
- [ ] GraphQL: 
- [ ] CLI: 
- [ ] Rust SDK:
  • Loading branch information
tzakian authored May 21, 2024
1 parent 0d87aef commit 6579e0e
Show file tree
Hide file tree
Showing 46 changed files with 332 additions and 86 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ mutated: object(0,0)
gas summary: computation_cost: 1000000, storage_cost: 5859600, storage_rebate: 0, non_refundable_storage_fee: 0

task 3 'view-object'. lines 49-53:
Owner: Shared
Owner: Shared( 2 )
Version: 2
Contents: test::m::S {
id: sui::object::UID {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ mutated: object(0,0)
gas summary: computation_cost: 1000000, storage_cost: 5859600, storage_rebate: 0, non_refundable_storage_fee: 0

task 3 'view-object'. lines 39-39:
Owner: Shared
Owner: Shared( 2 )
Version: 2
Contents: test::m::S {
id: sui::object::UID {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Contents: t3::o3::Obj3 {
}

task 7 'view-object'. lines 80-82:
Owner: Shared
Owner: Shared( 3 )
Version: 3
Contents: t2::o2::Obj2 {
id: sui::object::UID {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Error: Transaction Effects Status: The shared object operation is not allowed.
Debug of error: SharedObjectOperationNotAllowed at command None

task 5 'view-object'. lines 81-81:
Owner: Shared
Owner: Shared( 3 )
Version: 4
Contents: test::m::Child {
id: sui::object::UID {
Expand All @@ -39,7 +39,7 @@ Error: Transaction Effects Status: Move Runtime Abort. Location: sui::dynamic_fi
Debug of error: MoveAbort(MoveLocation { module: ModuleId { address: sui, name: Identifier("dynamic_field") }, function: 11, instruction: 0, function_name: Some("borrow_child_object") }, 1) at command Some(0)

task 7 'view-object'. lines 85-85:
Owner: Shared
Owner: Shared( 3 )
Version: 4
Contents: test::m::Child {
id: sui::object::UID {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ mutated: object(0,1)
gas summary: computation_cost: 1000000, storage_cost: 2219200, storage_rebate: 978120, non_refundable_storage_fee: 9880

task 5 'view-object'. lines 24-24:
Owner: Shared
Owner: Shared( 3 )
Version: 3
Contents: test::m1::Pub {
id: sui::object::UID {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ mutated: object(0,2)
gas summary: computation_cost: 1000000, storage_cost: 2226800, storage_rebate: 978120, non_refundable_storage_fee: 9880

task 3 'view-object'. lines 33-33:
Owner: Shared
Owner: Shared( 3 )
Version: 3
Contents: t2::o2::Obj2 {
id: sui::object::UID {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ mutated: object(0,1)
gas summary: computation_cost: 1000000, storage_cost: 2287600, storage_rebate: 978120, non_refundable_storage_fee: 9880

task 3 'view-object'. lines 30-30:
Owner: Shared
Owner: Shared( 3 )
Version: 3
Contents: test::m1::Coin {
id: sui::object::UID {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ mutated: object(0,1)
gas summary: computation_cost: 1000000, storage_cost: 1976000, storage_rebate: 978120, non_refundable_storage_fee: 9880

task 3 'view-object'. lines 21-21:
Owner: Shared
Owner: Shared( 3 )
Version: 3
Contents: sui::coin::Coin<sui::sui::SUI> {
id: sui::object::UID {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ mutated: object(0,1)
gas summary: computation_cost: 1000000, storage_cost: 1976000, storage_rebate: 978120, non_refundable_storage_fee: 9880

task 5 'view-object'. lines 30-32:
Owner: Shared
Owner: Shared( 3 )
Version: 3
Contents: sui::coin::Coin<sui::sui::SUI> {
id: sui::object::UID {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ mutated: object(0,2)
gas summary: computation_cost: 1000000, storage_cost: 2226800, storage_rebate: 978120, non_refundable_storage_fee: 9880

task 3 'view-object'. lines 26-26:
Owner: Shared
Owner: Shared( 3 )
Version: 3
Contents: t2::o2::Obj2 {
id: sui::object::UID {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ mutated: object(0,0)
gas summary: computation_cost: 1000000, storage_cost: 3420000, storage_rebate: 978120, non_refundable_storage_fee: 9880

task 3 'view-object'. lines 34-34:
Owner: Shared
Owner: Shared( 3 )
Version: 3
Contents: tto::M1::A {
id: sui::object::UID {
Expand All @@ -37,7 +37,7 @@ mutated: object(0,0), object(2,0), object(2,1)
gas summary: computation_cost: 1000000, storage_cost: 3420000, storage_rebate: 3385800, non_refundable_storage_fee: 34200

task 6 'view-object'. lines 40-40:
Owner: Shared
Owner: Shared( 3 )
Version: 4
Contents: tto::M1::A {
id: sui::object::UID {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Contents: sui::dynamic_field::Field<sui::dynamic_object_field::Wrapper<u64>, sui
}

task 4 'view-object'. lines 40-40:
Owner: Shared
Owner: Shared( 3 )
Version: 3
Contents: tto::M1::A {
id: sui::object::UID {
Expand Down Expand Up @@ -89,7 +89,7 @@ Contents: sui::dynamic_field::Field<sui::dynamic_object_field::Wrapper<u64>, sui
}

task 9 'view-object'. lines 50-50:
Owner: Shared
Owner: Shared( 3 )
Version: 4
Contents: tto::M1::A {
id: sui::object::UID {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ mutated: object(0,0)
gas summary: computation_cost: 1000000, storage_cost: 2204000, storage_rebate: 0, non_refundable_storage_fee: 0

task 4 'view-object'. lines 43-43:
Owner: Shared
Owner: Shared( 3 )
Version: 3
Contents: tto::M1::A {
id: sui::object::UID {
Expand All @@ -45,7 +45,7 @@ mutated: object(0,1), object(2,0), object(2,1)
gas summary: computation_cost: 1000000, storage_cost: 3420000, storage_rebate: 3385800, non_refundable_storage_fee: 34200

task 7 'view-object'. lines 50-50:
Owner: Shared
Owner: Shared( 3 )
Version: 4
Contents: tto::M1::A {
id: sui::object::UID {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ mutated: object(0,0)
gas summary: computation_cost: 1000000, storage_cost: 3420000, storage_rebate: 978120, non_refundable_storage_fee: 9880

task 3 'view-object'. lines 35-35:
Owner: Shared
Owner: Shared( 3 )
Version: 3
Contents: tto::M1::A {
id: sui::object::UID {
Expand All @@ -37,7 +37,7 @@ mutated: object(0,0), object(2,0), object(2,1)
gas summary: computation_cost: 1000000, storage_cost: 3420000, storage_rebate: 3385800, non_refundable_storage_fee: 34200

task 6 'view-object'. lines 41-41:
Owner: Shared
Owner: Shared( 3 )
Version: 4
Contents: tto::M1::A {
id: sui::object::UID {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ mutated: object(0,0)
gas summary: computation_cost: 1000000, storage_cost: 2211600, storage_rebate: 0, non_refundable_storage_fee: 0

task 3 'view-object'. lines 36-36:
Owner: Shared
Owner: Shared( 2 )
Version: 2
Contents: a::m::Obj {
id: sui::object::UID {
Expand All @@ -35,7 +35,7 @@ mutated: object(0,0)
gas summary: computation_cost: 1000000, storage_cost: 2211600, storage_rebate: 978120, non_refundable_storage_fee: 9880

task 6 'view-object'. lines 42-42:
Owner: Shared
Owner: Shared( 4 )
Version: 4
Contents: a::m::Obj {
id: sui::object::UID {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ mutated: object(0,0)
gas summary: computation_cost: 1000000, storage_cost: 2226800, storage_rebate: 0, non_refundable_storage_fee: 0

task 3 'view-object'. lines 43-43:
Owner: Shared
Owner: Shared( 2 )
Version: 2
Contents: a::m::Inner {
id: sui::object::UID {
Expand All @@ -34,7 +34,7 @@ mutated: object(0,0)
gas summary: computation_cost: 1000000, storage_cost: 2226800, storage_rebate: 978120, non_refundable_storage_fee: 9880

task 6 'view-object'. lines 49-49:
Owner: Shared
Owner: Shared( 4 )
Version: 4
Contents: a::m::Inner {
id: sui::object::UID {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ mutated: object(0,0)
gas summary: computation_cost: 1000000, storage_cost: 2226800, storage_rebate: 0, non_refundable_storage_fee: 0

task 3 'view-object'. lines 43-43:
Owner: Shared
Owner: Shared( 2 )
Version: 2
Contents: a::m::Inner {
id: sui::object::UID {
Expand All @@ -34,7 +34,7 @@ mutated: object(0,0)
gas summary: computation_cost: 1000000, storage_cost: 2226800, storage_rebate: 978120, non_refundable_storage_fee: 9880

task 6 'view-object'. lines 49-49:
Owner: Shared
Owner: Shared( 4 )
Version: 4
Contents: a::m::Inner {
id: sui::object::UID {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ mutated: object(0,0)
gas summary: computation_cost: 1000000, storage_cost: 2226800, storage_rebate: 978120, non_refundable_storage_fee: 9880

task 4 'view-object'. lines 40-42:
Owner: Shared
Owner: Shared( 4 )
Version: 4
Contents: t2::o2::Obj2 {
id: sui::object::UID {
Expand All @@ -37,7 +37,7 @@ mutated: object(0,0)
gas summary: computation_cost: 1000000, storage_cost: 2226800, storage_rebate: 978120, non_refundable_storage_fee: 9880

task 7 'view-object'. lines 47-49:
Owner: Shared
Owner: Shared( 6 )
Version: 6
Contents: t2::o2::Obj2 {
id: sui::object::UID {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ mutated: object(0,0)
gas summary: computation_cost: 1000000, storage_cost: 2226800, storage_rebate: 978120, non_refundable_storage_fee: 9880

task 4 'view-object'. lines 51-51:
Owner: Shared
Owner: Shared( 3 )
Version: 3
Contents: t2::o2::Obj2 {
id: sui::object::UID {
Expand All @@ -27,7 +27,7 @@ Contents: t2::o2::Obj2 {
}

task 5 'view-object'. lines 53-55:
Owner: Shared
Owner: Shared( 4 )
Version: 4
Contents: t2::o2::Obj2 {
id: sui::object::UID {
Expand All @@ -48,7 +48,7 @@ mutated: object(0,0)
gas summary: computation_cost: 1000000, storage_cost: 1976000, storage_rebate: 978120, non_refundable_storage_fee: 9880

task 8 'view-object'. lines 62-64:
Owner: Shared
Owner: Shared( 6 )
Version: 6
Contents: sui::coin::Coin<sui::sui::SUI> {
id: sui::object::UID {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ mutated: object(0,0)
gas summary: computation_cost: 1000000, storage_cost: 2226800, storage_rebate: 978120, non_refundable_storage_fee: 9880

task 4 'view-object'. lines 103-103:
Owner: Shared
Owner: Shared( 3 )
Version: 3
Contents: t2::o2::Obj2 {
id: sui::object::UID {
Expand All @@ -27,7 +27,7 @@ Contents: t2::o2::Obj2 {
}

task 5 'view-object'. lines 105-107:
Owner: Shared
Owner: Shared( 4 )
Version: 4
Contents: t2::o2::Obj2 {
id: sui::object::UID {
Expand Down Expand Up @@ -79,7 +79,7 @@ mutated: object(0,0)
gas summary: computation_cost: 1000000, storage_cost: 1976000, storage_rebate: 978120, non_refundable_storage_fee: 9880

task 16 'view-object'. lines 159-162:
Owner: Shared
Owner: Shared( 14 )
Version: 14
Contents: sui::coin::Coin<sui::sui::SUI> {
id: sui::object::UID {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ mutated: object(0,1)
gas summary: computation_cost: 1000000, storage_cost: 1976000, storage_rebate: 978120, non_refundable_storage_fee: 9880

task 4 'view-object'. lines 66-66:
Owner: Shared
Owner: Shared( 3 )
Version: 3
Contents: sui::coin::Coin<sui::sui::SUI> {
id: sui::object::UID {
Expand Down Expand Up @@ -81,7 +81,7 @@ Contents: sui::coin::Coin<sui::sui::SUI> {
}

task 11 'view-object'. lines 86-86:
Owner: Shared
Owner: Shared( 6 )
Version: 6
Contents: sui::coin::Coin<sui::sui::SUI> {
id: sui::object::UID {
Expand All @@ -95,7 +95,7 @@ Contents: sui::coin::Coin<sui::sui::SUI> {
}

task 12 'view-object'. lines 88-90:
Owner: Shared
Owner: Shared( 7 )
Version: 7
Contents: t2::o2::Obj2 {
id: sui::object::UID {
Expand Down Expand Up @@ -126,7 +126,7 @@ mutated: object(0,1)
gas summary: computation_cost: 1000000, storage_cost: 2226800, storage_rebate: 978120, non_refundable_storage_fee: 9880

task 17 'view-object'. lines 103-103:
Owner: Shared
Owner: Shared( 8 )
Version: 8
Contents: sui::coin::Coin<sui::sui::SUI> {
id: sui::object::UID {
Expand All @@ -140,7 +140,7 @@ Contents: sui::coin::Coin<sui::sui::SUI> {
}

task 18 'view-object'. lines 105-105:
Owner: Shared
Owner: Shared( 9 )
Version: 9
Contents: sui::coin::Coin<sui::sui::SUI> {
id: sui::object::UID {
Expand All @@ -154,7 +154,7 @@ Contents: sui::coin::Coin<sui::sui::SUI> {
}

task 19 'view-object'. lines 107-109:
Owner: Shared
Owner: Shared( 10 )
Version: 10
Contents: t2::o2::Obj2 {
id: sui::object::UID {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Contents: sui::coin::Coin<sui::sui::SUI> {
}

task 6 'view-object'. lines 72-72:
Owner: Shared
Owner: Shared( 4 )
Version: 4
Contents: sui::coin::Coin<sui::sui::SUI> {
id: sui::object::UID {
Expand All @@ -52,7 +52,7 @@ Contents: sui::coin::Coin<sui::sui::SUI> {
}

task 7 'view-object'. lines 74-76:
Owner: Shared
Owner: Shared( 5 )
Version: 5
Contents: t2::o2::Obj2 {
id: sui::object::UID {
Expand Down Expand Up @@ -98,7 +98,7 @@ mutated: object(0,1)
gas summary: computation_cost: 1000000, storage_cost: 2226800, storage_rebate: 978120, non_refundable_storage_fee: 9880

task 16 'view-object'. lines 109-109:
Owner: Shared
Owner: Shared( 6 )
Version: 6
Contents: sui::coin::Coin<sui::sui::SUI> {
id: sui::object::UID {
Expand All @@ -112,7 +112,7 @@ Contents: sui::coin::Coin<sui::sui::SUI> {
}

task 17 'view-object'. lines 111-111:
Owner: Shared
Owner: Shared( 7 )
Version: 7
Contents: sui::coin::Coin<sui::sui::SUI> {
id: sui::object::UID {
Expand All @@ -126,7 +126,7 @@ Contents: sui::coin::Coin<sui::sui::SUI> {
}

task 18 'view-object'. lines 113-115:
Owner: Shared
Owner: Shared( 8 )
Version: 8
Contents: t2::o2::Obj2 {
id: sui::object::UID {
Expand Down
Loading

0 comments on commit 6579e0e

Please sign in to comment.