Skip to content

Fix msig:propose serialization for non-name fields#37

Open
paulgnz wants to merge 1 commit intoXPRNetwork:masterfrom
paulgnz:fix/msig-propose-serialization
Open

Fix msig:propose serialization for non-name fields#37
paulgnz wants to merge 1 commit intoXPRNetwork:masterfrom
paulgnz:fix/msig-propose-serialization

Conversation

@paulgnz
Copy link
Contributor

@paulgnz paulgnz commented Mar 15, 2026

Summary

  • Fixes msig:propose failing with "Name should be less than 13 characters" when proposing transactions with u64/u128 action fields (e.g. poolId: 265)
  • Root cause: api.transact() recursively re-serializes already-serialized action data in the nested trx field, treating hex strings as structured JSON
  • Fix: manually serialize the inner transaction and propose data to raw bytes after api.serializeActions(), bypassing recursive serialization

Reproduction

proton msig:propose myproposal '[{"account":"simpledex","name":"forcerempool","data":{"poolId":265},"authorization":[{"actor":"protonnz","permission":"active"}]}]' 'simplesetup@active'
# Before: Error: Name should be less than 13 characters
# After: Multisig myproposal successfully proposed.

Test plan

  • Build succeeds (npm run build)
  • Tested on Proton mainnet: msig:propose with simpledex::forcerempool({poolId: 265}) — proposal created successfully
  • msig:approve and msig:exec unchanged (no nested transactions)

🤖 Generated with Claude Code

The propose command failed with "Name should be less than 13 characters"
when proposing msig transactions containing actions with u64/u128 fields
(e.g. poolId: 265). The bug occurred because api.transact() recursively
re-serialized already-serialized action data within the nested transaction,
treating hex strings as structured JSON.

Fix: manually serialize the inner transaction and propose action data to
raw bytes, bypassing the library's recursive serialization. The inner
actions are still properly serialized via api.serializeActions() using
contract ABIs — only the final assembly is done manually.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant