From d8216c7469476219ae3471f76a3784b049d628a6 Mon Sep 17 00:00:00 2001 From: Vineeth Kashyap Date: Mon, 4 Nov 2024 13:09:24 -0500 Subject: [PATCH] Abilities can be added during upgrade (#693) --- .../pages/en/build/smart-contracts/book/package-upgrades.mdx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/nextra/pages/en/build/smart-contracts/book/package-upgrades.mdx b/apps/nextra/pages/en/build/smart-contracts/book/package-upgrades.mdx index 32566a89b..39518d2d8 100644 --- a/apps/nextra/pages/en/build/smart-contracts/book/package-upgrades.mdx +++ b/apps/nextra/pages/en/build/smart-contracts/book/package-upgrades.mdx @@ -80,12 +80,13 @@ When using `compatible` upgrade policy, a module package can be upgraded. Howeve published previously need to be compatible and follow the rules below: - All existing structs' fields cannot be updated. This means no new fields can be added and existing fields cannot be - modified. Struct abilities also cannot be changed (no new ones added or existing removed). + modified. - All public and entry functions cannot change their signature (argument types, type argument, return types). However, argument names can change. - `public(friend)` functions are treated as private and thus their signature can arbitrarily change. This is safe as only modules in the same package can call friend functions anyway, and they need to be updated if the signature changes. - [Enum type upgrade compatibility rules](enums.mdx#enum-type-upgrade-compatibility). +- Existing abilities on a struct/enum type cannot be removed (but abilities can be added). When updating your modules, if you see an incompatible error, make sure to check the above rules and fix any violations.