Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wallet: batch bulk actions #546

Merged
merged 5 commits into from
Jan 25, 2023
Merged

Conversation

rithvikvibhu
Copy link
Collaborator

@rithvikvibhu rithvikvibhu commented Aug 19, 2022

Closes #398 (better handling this time) and other issues which don't have GitHub issues (described below).

1. Consider pending transactions for stats

When calculating balance and cards, use getUnspentCoin so that pending txs don't conflict with bulk actions.
Ex: Reveal All would not work if there is a bid revealed but not yet confirmed.

2. Find renewable names based on height, not time

This is to match hsd's condition. Also update 2 months to match hsd's 3 months

3. Use batching for bulk actions

Major part of this PR. It replaces registerAll, transferMany, revealAll and redeemAll with hsd's equivalent batch rpc calls. Similarly adds finalizeAll and renewAll.
Until now, all the *All functions would create large (invalid) transactions if there were many bids or names (a few hundred+). With batching, these are broken up into multiple smaller transactions.

This behaviour is slightly different with Ledger wallets:

  • Regular wallets: Clicking "Reveal All" (or any bulk action) will repeated create and send txs until there are none left. I think this matches expected UX, and similar to UX goals in the hsd PR description
  • Ledger wallets: Clicking it will create and send only 1 tx with as much bids/names as possible. Once each output is confirmed on the device, the button will need to be clicked again for the next batch.

Note: This behavior is changed in #569. All types of wallets will always send 1 tx (the way Ledger wallets work above). Explained by in that PR.

Tested with both regular wallets and Ledger wallets.
For reviewers: be sure to run npm install as this currently requires handshake-org/hsd#764
You can use this script to create a lot of opens and place bids: https://gist.github.com/rithvikvibhu/9f891202a430a50af3a1cc6375f0dfe3

h/t to @pinheadmz for adding batch to hsd!

To do:

  • remove TEMP commit with hsd dependency change before merge (maybe replace it with commit hash)

@rithvikvibhu rithvikvibhu added the dependent Depends on another issue or PR to be resolved first label Aug 19, 2022
@rithvikvibhu
Copy link
Collaborator Author

GitHub build for this branch (Windows and Linux) for anyone who wants to try it out: https://github.com/rithvikvibhu/bob-wallet/actions/runs/3083707779

@enginux
Copy link

enginux commented Oct 22, 2022

Solve: Method not found: sendbatch

I encountered inconsistency in my wallet history, so I tried to secure and Transfer all my TLDs into new Seedphrase wallet.
It transferred after 2 days but when I Finalize it say "Exceed Policy Weight" limit.

Solution

1.) Download the source code for batching

2.) Extract, execute npm install then npm install handshake-org/hsd#master

3.) Build, execute npm run package-linux and npm run package-win for linux and windows respectively

4.) Run the software located in release/

@rithvikvibhu
Copy link
Collaborator Author

based on and blocked by #590. Also, while this PR doesn't have reviews, #569 is based on this and has been tested by multiple people.

@enginux
Copy link

enginux commented Jan 16, 2023

based on and blocked by #590. Also, while this PR doesn't have reviews, #569 is based on this and has been tested by multiple people.

Go for it. Been testing it with its max N and its great!
Ref: https://discord.com/channels/822591034202521641/822591754477371443/1039817135507128370

It would be cool for Bob with multisig and batching features release!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependent Depends on another issue or PR to be resolved first
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Could not resolve preferred inputs
2 participants