Description
In the interactive updateaccountpermission flow, when an account has no existing active permission, wallet-cli applies a hardcoded default active-permission operations bitmap. That bitmap grants ContractType 51 (ShieldedTransferContract). Since shielded transfer is disabled by default on mainnet and most networks, the node rejects the whole transaction during validation with:
CONTRACT_VALIDATE_ERROR, Contract validate error : 51 isn't a validate ContractType
UpdateAccountPermission failed !!!
Steps to Reproduce
- Run interactive
updateaccountpermission on an account that has no active permission.
- Edit only the owner_permission (e.g. add an authorized key); leave active untouched.
- Preview, confirm, sign, and broadcast.
- The node returns
51 isn't a validate ContractType and the transaction fails.
Root Cause
The hardcoded default operations bitmap in src/main/java/org/tron/core/manager/UpdateAccountPermissionInteractive.java:108:
active.setOperations("7fff1fc0033efb0f000000000000000000000000000000000000000000000000");
Decoding this bitmap, the granted operations include bit 51:
[0,1,2,3,4,5,6,8,9,10,11,12,13,14,15,16,17,18,19,20,30,31,32,33,
41,42,43,44,45,48,49, 51, 52,53,54,55,56,57,58,59]
^^ ContractType 51 = ShieldedTransferContract
Byte index 6 is 0xfb (binary 1111 1011), whose bit 3 maps to operation 51. Shielded transfer is disabled by default, so when the node iterates the operations bitmap and hits the unavailable ContractType 51, it rejects the transaction.
Why the bit is invisible in the UI
operationsMap (the human-readable label table at lines 50–88 of the same file) jumps from 49 straight to 52 — there is no label for 51. Both the preview and the add/delete menus filter entries with operationsMap.get(...) != null. As a result:
- Bit 51 is actually present in the bitmap sent to the node,
- but it is silently hidden from the preview and the edit menu,
- so the user can neither see it nor remove it through the interactive UI.
This is the most subtle part of the bug and makes it very hard to self-diagnose.
Suggested Fix
- Correct the default bitmap to clear bit 51: byte index 6
0xfb -> 0xf3, i.e.
7fff1fc0033efb0f... -> 7fff1fc0033ef30f...
(keeps 48, 49, 52, 53, 54, 55; only removes 51).
- (Optional but recommended) Validate/sanitize every set bit in the default bitmap so this class of "present in the bitmap but missing from
operationsMap, hence invisible and undeletable in the UI" hidden bit cannot recur; or explicitly surface such unknown operations in the UI instead of silently filtering them out.
Environment
- Affected command: interactive
updateaccountpermission
- Affected file:
src/main/java/org/tron/core/manager/UpdateAccountPermissionInteractive.java:108
Description
In the interactive
updateaccountpermissionflow, when an account has no existing active permission, wallet-cli applies a hardcoded default active-permission operations bitmap. That bitmap grants ContractType 51 (ShieldedTransferContract). Since shielded transfer is disabled by default on mainnet and most networks, the node rejects the whole transaction during validation with:Steps to Reproduce
updateaccountpermissionon an account that has no active permission.51 isn't a validate ContractTypeand the transaction fails.Root Cause
The hardcoded default operations bitmap in
src/main/java/org/tron/core/manager/UpdateAccountPermissionInteractive.java:108:Decoding this bitmap, the granted operations include bit 51:
Byte index 6 is
0xfb(binary1111 1011), whose bit 3 maps to operation 51. Shielded transfer is disabled by default, so when the node iterates the operations bitmap and hits the unavailable ContractType 51, it rejects the transaction.Why the bit is invisible in the UI
operationsMap(the human-readable label table at lines 50–88 of the same file) jumps from49straight to52— there is no label for 51. Both the preview and the add/delete menus filter entries withoperationsMap.get(...) != null. As a result:This is the most subtle part of the bug and makes it very hard to self-diagnose.
Suggested Fix
0xfb->0xf3, i.e.7fff1fc0033efb0f...->7fff1fc0033ef30f...(keeps 48, 49, 52, 53, 54, 55; only removes 51).
operationsMap, hence invisible and undeletable in the UI" hidden bit cannot recur; or explicitly surface such unknown operations in the UI instead of silently filtering them out.Environment
updateaccountpermissionsrc/main/java/org/tron/core/manager/UpdateAccountPermissionInteractive.java:108