Skip to content

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

Closed
paulgnz wants to merge 1 commit into
XPRNetwork:masterfrom
paulgnz:fix/msig-propose-serialization
Closed

paulgnz wants to merge 1 commit into
XPRNetwork:masterfrom
paulgnz:fix/msig-propose-serialization

Conversation

@paulgnz

@paulgnz paulgnz commented Mar 15, 2026

Copy link
Copy Markdown
Contributor

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>
@paulgnz

paulgnz commented Oct 29, 2026

Copy link
Copy Markdown
Contributor Author

Closing this as no longer needed. I re-ran the repro from the description (simpledex::forcerempool({poolId: 265}) wrapped in eosio.msig::propose) through the original propose code shape against mainnet ABIs, with sign:false, broadcast:false. It serializes and round-trips correctly (poolId decodes back to 265). The lockfile resolves the same @proton/js 27.13.0 / @proton/api 28.7.1 it did when this was opened, so the original 'Name should be less than 13 characters' error was most likely environment-specific (e.g. an older globally installed CLI) rather than a library bug. #45/#46 have since rewritten propose.ts, so this patch wouldn't apply anyway.

@paulgnz paulgnz closed this Oct 29, 2026
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