OneKeyHQ / OneKeyHQ/firmware-pro

I use tonsdk under apps in the warehouse to apply it to my own wallet framework code. If there is a problem with the generated transaction signature, an error will be reported.

Open
#312 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C
Stars
32
Forks
20
PR merge metrics
No merged PRs in 30d

Description

When I applied the ton SDK in core/src/apps/ton in the warehouse to our hardware wallet framework for use, the boc request https://toncenter.com/api/v2/sendBoc of the ton transaction information generated by sign_message.py in the SDK was broadcast, and it would prompt: {'ok': False, 'error': 'INVALID_BAG_OF_CELLS: bodyinvalid bag-of-cells failed to deserialize cell #1 [Error : 0 : invalid index entry [116; 53], [data.size():169]]', 'code': 500}, and when the boc = bytes(signing_message.to_boc()) returned by the create_transaction_digest method in _wallet_contract.py was changed to boc = bytes(signing_message.to_boc(False)), when broadcasting again, the error message would become: {'ok': False, 'error': 'INVALID_BAG_OF_CELLS: bodyinvalid bag-of-cells failed to deserialize cell #1 [Error : 0 : invalid index entry [116; 53], [data.size():169]]', 'code': 500}. 'error': 'LITE_SERVER_UNKNOWN: cannot apply external message to current state : External message was not accepted\nCannot run message on account: inbound external message rejected by transaction FCBC39F68D71AE15B42A0E6A5DFAB4D5AA70A2BD3D5A54B7679976DDB6040BFC:\nexitcode=33, steps=23, gas_used=0\nVM Log (truncated):\n...te NOW\nexecute LEQ\nexecute THROWIF 36\nexecute PUSH c4\nexecute CTOS\nexecute LDU 32\nexecute LDU 32\nexecute LDU 256\nexecute LDDICT\nexecute ENDS\nexecute XCPU s4,s3\nexecute EQUAL\nexecute THROWIFNOT 33\ndefault exception handler, terminating vm with exit code 33\n', 'code': 500}, do you know what the reason is?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with core/src/apps/ton, sign_message.py, and _wallet_contract.py, then compare the transaction BOC produced by create_transaction_digest with the TON Center sendBoc request. Reproduce the broadcast and trace the signature and serialization inputs; done means identifying why the external message is rejected and documenting or correcting the failing transaction path.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, python
Domain
blockchain, embedded-iot
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.