-
Notifications
You must be signed in to change notification settings - Fork 274
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
Assertion failed when calling sendredeem or sendupdate on imported wallet #381
Comments
Did you rescan after importing the mnemonic phrase? Did you make bids from an different wallet / node? |
I did call |
When viewing this wallet's balances, there are a bunch of locked coins. For example:
The line in HSD that is failing is this one: https://github.com/handshake-org/hsd/blob/master/lib/wallet/txdb.js#L3123 This leads me to believe that either the wrong set of outputs are being selected, or the Both cases I've seen have had enough money to pay for the update. |
Also - these wallets have been rescanned from zero and nonces have been imported. |
I did some further digging, and had a hacked HSD node output the value of
Basically, this means that no user will be able to send updates if they have a zero lockedUnconfirmed balance. |
Continuing to update here - a workaround is to place a bid on another name, which will increase your |
After a bunch of attempts, it seems as though you need to place enough in bids so that |
Can we also confirm that all cases of this issue occurred in a rescanned wallet with imported nonces? |
@pinheadmz this is confirmed, it only occurs when wallets are rescanned with imported nonces. Here's a script that will reproduce the issue 100% of the time on regtest: #!/usr/bin/env bash
set -e
hsw-cli --network=regtest --mnemonic="panda day strike tomato rapid inch market box student shell stool evolve middle brush fork news planet fiscal city range chuckle monitor veteran address" mkwallet main
hsw-cli --network=regtest --mnemonic="trust estate winter coil nut deal few vast tooth viable mango virus park garage ocean chapter collect broom shallow soap fox donate misery modify" mkwallet alt
mine_to_addr=`hsw-cli --network=regtest --id=alt account get default | jq -r .receiveAddress`
mine () {
hsd-cli rpc --network=regtest generatetoaddress $1 $mine_to_addr
}
mine 10
send_addr=`hsw-cli --id=main --network=regtest account get default | jq -r .receiveAddress`
hsw-cli --id=alt --network=regtest --value=100 --address=$send_addr send
mine 1
hsw-rpc --network=regtest selectwallet main
hsw-rpc --network=regtest sendopen foobar
mine 7
hsw-rpc --network=regtest sendbid foobar 1 10
mine 5
read -p "Stop HSD now. Press enter when finished..."
rm -rf ~/.hsd/regtest/wallet/*
read -p "Start HSD now. Press enter when finished..."
hsw-cli --network=regtest --mnemonic="panda day strike tomato rapid inch market box student shell stool evolve middle brush fork news planet fiscal city range chuckle monitor veteran address" mkwallet main
hsw-cli --network=regtest --mnemonic="trust estate winter coil nut deal few vast tooth viable mango virus park garage ocean chapter collect broom shallow soap fox donate misery modify" mkwallet alt
hsw-cli --id=main --network=regtest rescan 0
echo "Rescanning..."
sleep 10
bid_addr=`hsw-cli --network=regtest --id=main history | jq -r '[ .[].outputs[] ] | .[] | select(.covenant.action == "BID") | .address'`
hsw-rpc --network=regtest selectwallet main
hsw-rpc --network=regtest importnonce foobar $bid_addr 1
echo "Rescanning again..."
hsw-cli --id=main --network=regtest rescan 0
sleep 10
echo ""
echo "###########################"
echo "# Here come the problems! #"
echo "###########################"
echo ""
echo "Printing out the account balance:"
hsw-cli --network=regtest --id=main account get default
echo "Observe that lockedUnconfirmed is zero in the above output."
echo "Attempting to send reveal..."
hsw-rpc --network=regtest --id=main sendreveal foobar || 0
echo "Note the failed assertion."
echo "We know that the nonce was properly inserted because the"
echo "error message is a failed assertion rather than \"Blind"
echo "value not found.\"" You'll need two terminals, the |
I think I've tracked down the bug. In bcoin/hsd we have two balances This convention is currently broken in the "locked" values in a wallet balance. Meaning, the I have written a patch that passes @mslipper's test and will post shortly. |
@pinheadmz I tried the patch you posted and it does seem to fix this issue. |
@buffrr thanks but don't run this on mainnet. I already found a big problem with my patch (take a look at your balance -- is the |
OK, this patch is more correct I think: #387 And includes tests which run through both a "regular" auction and a rescanned auction. |
yeah no problem i just saw the PR and couldn't resist :) I didn't keep the node so I'm not sure what the value of lockedUnconfirmed was. |
I'm getting
Assertion failed
when I try to callsendredeem
on lost bids or when callingsendupdate
on a domain that I won after importing wallet.Steps to reproduce:
mkwallet
using mnemonic phrase.sendredeem
or callsendupdate
to update any record on a TLD.Error message:
Assertion failed
Both commands show assertion failed. Following suggestion by @pinheadmz I replaced blgr in hsd with the master branch to get stack traces.
Logs output:
The text was updated successfully, but these errors were encountered: