sui icon indicating copy to clipboard operation
sui copied to clipboard

[BUGFIX][object] Fix initial_shared_version being overridden by parent_sync

Open amnn opened this issue 3 years ago • 1 comments
trafficstars

If a validator is aware of an owned object but not aware that it was made shared, it was not able to correctly figure out its version as a shared object, because of the logic to handle shared object sequencing across epoch changes, which relies on parent sync.

This commit fixes that by relying on the property that if the initial_shared_version is greater than the version in parent_sync, it should be used.

Test Plan

Not including a regression test, because this change will likely be followed up with a change to prevent owned -> shared promotion, which is the only scenario in which this bug could occur (and is not easy to set-up test conditions for), but the existing tests should pass:

$ cargo simtest
$ cargo nextest run

amnn avatar Nov 04 '22 23:11 amnn

With #5873 this change is no longer strictly necessary, but it or a similar change may still be helpful? Interested to hear people's thoughts. Either we:

  • Leave it as-is -- with upgrades disabled, it should work fine.
  • Land both -- which adds redundancy -- things will keep working whether we have upgrades or not.
  • Disable upgrades, and then change this PR to introduce an assert that the initial_shared_version is never greater than the version in parent sync.

amnn avatar Nov 07 '22 14:11 amnn