iotaledger / iotaledger/ts-packages

Improve staking transaction to handle transaction Size Limit

Open
#39 1 comment 0 reactions 0 assignees View on GitHub
wallet wallet-dashboard
Dominant language
TypeScript
Stars
3
Forks
3
Avg merge
1d 2h
Merged PRs (30d)
12

Description

## Description

Currently `createStakeTransaction` uses just `splitCoins` to get staking amount:
`const stakeCoin = tx.splitCoins(tx.gas, [amount]);`

Limitations:
`splitCoins` has a limit of 50 objects that it trys to merge, in the background, in order to get the specified amount.

Issues:
- If user has a large number of objects and merger of 50 coin objects is not enough to reach the specified amount.
- Reaching any of transaction protocol limits (max_tx_size_bytes, max_input_objects, max_arguments...) will throw `SizeLimitExceded` error.

Suggestions:
We should look into a possibility to batch merging objects if more than 50 are needed to fulfill the specified staking amount.
For handling the `SizeLimitExceded` error we can implement a similar solution as in timelocked staking where this case is covered.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.