Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[hardening] updating SUI conservation check to account for dynamic fi…
…elds, fixing two SUI conservation bugs @tnowacki previously pointed out that the previous logic for identifying dynamic field inputs was incorrect + the right way to do this is to look at `writes` and `deletes` to identify objects that are not inputs. Refactored `check_sui_conserved` to use this approach, and turn off the logic that skips any code with dynamic fields. After doing this, a lot of tests using dynamic fields started failing conservation checks. I investigated this and discovered/fixed two related conservation bugs in `charge_gas_for_storage_changes`: - If a dynamic field with storage rebate `N` gets mutated, we will burn `N` SUI - If a dynamic field with storage rebate `N` gets deleted, we will burn `N` SUI After fixing these bugs, all tests pass the conservation checks. But it would still be good to make sure we have test coverage for all {wrap/unwrap/delete}, {dynamic field/input object} scenarios.
- Loading branch information