--- Log opened Tue Mar 07 00:00:03 2023 01:21 -!- midnight [~midnight@user/midnight] has quit [Ping timeout: 248 seconds] 01:23 -!- midnight [~midnight@user/midnight] has joined ##miniscript 08:23 -!- Hac [~Hac@2603-6080-d802-7a70-9458-c1de-55ab-56e8.res6.spectrum.com] has joined ##miniscript 08:25 < Hac> I believe I may have encountered a bug in miniscript or with core. I have imported a descriptor into a blank watch only wallet, generated an address and sent some funds. 08:25 < Hac> When I query the address I sent funds to with getaddressinfo I get back JSON where ismine = true. However, getbalance always returns 0.0000000. This occurs even when I complete a fresh rescan and the transaction has 250 confirmations so I am certain it is confirmed. 08:26 <@sipa> Is it a watch-only wallet? What about getbalances? 08:27 < Hac> yes it is a watch only wallet. Getbalances returns 0.0000s across the board 08:27 <@sipa> Is it a legacy wallet or a descriptor wallet? 08:27 <@sipa> As in did you use importdescriptors or importmulti ? 08:28 < Hac> importdescriptors 08:28 <@sipa> What is the descriptor like? Can you share it? 08:30 < Hac> "wsh(thresh(2,pk(xpub661MyMwAqRbcGMiXFbpTQS2o1cvBy6ozNAHh1BLHR5MNCkb3o2zHhhGfHJboZD4h7SpmSBqhmSmUo6SWV9hFsQ7omseEy6KGDuZ8TbGCqL8/*),s:pk(xpub661MyMwAqRbcGZRGkQTf6C7zQWFBQJxRffoWJ6h8RuxizvCXs9451zQgfc1pmcbmo9d74T3ejdCemgVex7bQFYH2SpC2vKLYyGhvMZRgNMF/*),s:pk(xpub661MyMwAqRbcEfUqHeN8gYhTh77yfF2tao2j35VCD7y62m3DWbpMepJSFL9SP7RfWUCM33zzqLtXYHE5KkhDHgeTS 08:30 < Hac> gnmyHtgmixb89K28wT/*),s:pk(xpub661MyMwAqRbcFRKfCMvSZU8cZ7M9L9BggknGPwJMGhtbLsQYR11QHrcLvNGMYKBp1zDqEwRwvcjr13Uvc7EbqMcrXfaJodgzeRjJCSVdPKW/*),s:pk(xpub661MyMwAqRbcFF6HuQ7uJ1yZ4AW5jXyEZ9NtLhwPWagcz3aqbb6PSXjUzzWcgFzDg3at6DjEgAu3rv1ofxoTxJGmm7unPXjJ6fiEuJcmT4r/*),s:pk(xpub661MyMwAqRbcGsqmXaNsG4uE1hpcCMFgAm7BJAbpEQ6xok9qL6ya2SCotW84uh6Nxi4JzwX8QCQ9rJp 08:30 < Hac> xpTx5XH4ZCTZ9h6skFKBx6kMqE1u/*),s:pk(xpub661MyMwAqRbcErs9ZGjTnGtoP5zk2hju6ixdE5zN3Vmuch2nNXBe6bFRcGNuUwB1JgC6cnqfPmf4AH97rQdi1eHTYEdPSziNc94AqstdGBF/*),sun:after(986902)))#fpylqhv6" 08:31 < Hac> 2 of 7 which decays down to 1 of 7 after approx 4 years 08:32 <@sipa> Is this Bitcoin Core 24.0+? 08:33 < Hac> 24.0.1 08:34 < Hac> .create_wallet(true, true, none, none) 08:34 < Hac> import_descriptors(, , active:true, range[0,100], nextindex:0, internal: none, label: none 08:37 < Hac> also did a manual rescan just to be sure 08:39 <@sipa> Does getaddressinfo report the output as solvable? 08:40 < Hac> solvable: false 08:41 <@sipa> Are you sure you're on 24.0.1? 08:41 <@sipa> I imported your descriptor, and it lists the generated address as solvable. 08:48 < Hac> yes I am sure 08:48 <@sipa> Also, I don't think this does what you want; only the bottom 16 bits of the nSequence value has an effect for relative locktimes 08:48 < Hac> although my .bitcoin may have been generated by 23.0 i dont know if that could be a contributing factor 08:49 <@sipa> achow101 darosior ^ any ideas? 08:49 < darosior> sipa: this is an absolute locktime that they are using 08:49 < darosior> (reading the scrollback now) 08:50 <@sipa> oh! 08:50 <@sipa> oops 08:51 < Hac> so its an issue with the descriptor then? 08:51 <@sipa> No, ignore my comment. 08:52 < darosior> Hac: trying to reproduce 08:52 < achow101> do you get the same issue if you make another wallet and import into there? 08:53 < achow101> smells a bit like https://github.com/bitcoin/bitcoin/issues/19808 08:53 < Hac> achow101, yes 08:53 < darosior> The descriptor in copy-able form: https://0bin.net/paste/RQJ3+Evn#e6uerxfFReKJeNnjOiKD9BGSQjxcUyF1kXN86z5nipb 08:54 < Hac> here is the output of my getaddress query 08:54 < Hac> ./bitcoin-cli -rpcwallet=/media/ubuntu/86c6d2e9-d350-47f3-8215-4dbefcb40e9c/home/ubuntu/.bitcoin/immediate_wallet getaddressinfo BC1QEXNWJVH5WRZ7UM2QDY6KY8XQK59830Y72VN9JAHQDDAZNRDQ8M6STYSHMG 08:54 < Hac> { 08:54 < Hac>   "address": "bc1qexnwjvh5wrz7um2qdy6ky8xqk59830y72vn9jahqddaznrdq8m6styshmg", 08:54 < Hac>   "scriptPubKey": "0020c9a6e932f470c5ee6d406935621cc0b50a78bc9e53265976e06b7a298da03ef5", 08:54 < Hac>   "ismine": true, 08:54 < Hac>   "solvable": false, 08:54 < Hac>   "parent_desc": "wsh(thresh(2,pk(xpub661MyMwAqRbcGMiXFbpTQS2o1cvBy6ozNAHh1BLHR5MNCkb3o2zHhhGfHJboZD4h7SpmSBqhmSmUo6SWV9hFsQ7omseEy6KGDuZ8TbGCqL8/*),s:pk(xpub661MyMwAqRbcGZRGkQTf6C7zQWFBQJxRffoWJ6h8RuxizvCXs9451zQgfc1pmcbmo9d74T3ejdCemgVex7bQFYH2SpC2vKLYyGhvMZRgNMF/*),s:pk(xpub661MyMwAqRbcEfUqHeN8gYhTh77yfF2tao2j35VCD7y62m3DWbpMepJSFL9SP7RfWUCM33z 08:54 < Hac> zqLtXYHE5KkhDHgeTSgnmyHtgmixb89K28wT/*),s:pk(xpub661MyMwAqRbcFRKfCMvSZU8cZ7M9L9BggknGPwJMGhtbLsQYR11QHrcLvNGMYKBp1zDqEwRwvcjr13Uvc7EbqMcrXfaJodgzeRjJCSVdPKW/*),s:pk(xpub661MyMwAqRbcFF6HuQ7uJ1yZ4AW5jXyEZ9NtLhwPWagcz3aqbb6PSXjUzzWcgFzDg3at6DjEgAu3rv1ofxoTxJGmm7unPXjJ6fiEuJcmT4r/*),s:pk(xpub661MyMwAqRbcGsqmXaNsG4uE1hpcCMFgAm7BJAbpEQ6xok9qL6ya2SCotW84u 08:54 < Hac> h6Nxi4JzwX8QCQ9rJpxpTx5XH4ZCTZ9h6skFKBx6kMqE1u/*),s:pk(xpub661MyMwAqRbcErs9ZGjTnGtoP5zk2hju6ixdE5zN3Vmuch2nNXBe6bFRcGNuUwB1JgC6cnqfPmf4AH97rQdi1eHTYEdPSziNc94AqstdGBF/*),sun:after(986902)))#fpylqhv6", 08:54 < Hac>   "iswatchonly": false, 08:54 < Hac>   "isscript": true, 08:54 < Hac>   "iswitness": true, 08:54 < Hac>   "witness_version": 0, 08:54 < Hac>   "witness_program": "c9a6e932f470c5ee6d406935621cc0b50a78bc9e53265976e06b7a298da03ef5", 08:54 < Hac>   "script": "nonstandard", 08:54 < Hac>   "hex": "210307cb602bb85f800a58d4c6f27f11cdae29c53b812ef70cd8106c27a6415db218ac7c2103ca7522aaae7a1c32a5f73e206f995c851ac4df227f5ee0b2fc8be49553bdacccac937c21035d8e875a539cc3b73cd50f4f765101a902268712a9f9a3b5931aa571755c1a07ac937c2102c08d1103915886b47f05836d3e995dc4b2cc5e828c55a06fce834aab35f750faac937c2102ad1e5e5e2d5667c0d62358b6cb67f516dc5e633d4 08:54 < Hac> f3c5ca680a4aa0f70620769ac937c21031052b704343d98d9dc35f4a9ee34b64511226556348452a980d91835197eb63fac937c210270548ac916833ed21f063cd944b66597a7703d58ddfdbdbf273233c7d2c758d0ac937c6303160f0fb192670068935287", 08:54 <@sipa> Please don't paste things on IRC, use a paste site. 08:54 < Hac> okay sorry 08:55 < achow101> sipa: does yours say solvable becaues you're using master which has signing support? 08:55 <@sipa> Oh, right. 08:55 <@sipa> I forgot 24.0.1 doesn't have miniscript signing yet. 08:56 <@sipa> But that shouldn't have an impact on balance computation? 08:57 < achow101> Hac: does the transaction appear in your wallet? 08:59 < Hac> a default listtransactions call returns an empty struct. I assume I need to pass in the watchonly true param? 09:00 < achow101> try gettransaction with the txid 09:01 < darosior> One thing i want to try: listsinceblock with 'include_change' set to true 09:04 < darosior> For what it's worth: https://blockstream.info/tx/f5f3efd152e52459e927a6b48a679118e0e4db34d73fd9f06eb6547d2d98ae26 09:04 < Hac> gettransaction "" returns invalid or non-wallet transaction id 09:05 < achow101> cannot replicate on master, will try 24.x 09:06 <@sipa> Hac: What timestamp did you import with? 09:07 < Hac> 1677988420, and then I did a manual rescanblockchain from block 750000 09:08 < darosior> (the transaction was confirmed at height 779514) 09:09 < darosior> I could find it using 24.0.1 09:09 < darosior> Let me copy paste my steps on a 0bin 09:11 < darosior> https://0bin.net/paste/H5EozuIb#-rOHFOAeUXiIcbdvA962TXXE1k7CYwJ0+xDuIDKJ87m 09:11 < darosior> Hac: is it basically what you did? ^ 09:13 < Hac> more or less exactly, my importdescriptors was a bit more specific 09:13 < Hac> import_descriptors(, , active:true, range[0,100], nextindex:0, internal: none, label: none 09:18 < achow101> I also cannot reproduce on 24.x 09:19 < achow101> Hac: could you share that wallet file? 09:20 < Hac> do you just want a textdump of the wallet.dat? 09:21 < achow101> the file itself would be preferable 09:21 < achow101> assuming it's a new blank one that only has the watch only descriptor and exhibits this issue for you 09:22 < Hac> is this sufficient? 09:22 < Hac> https://0bin.net/paste/3ZGbsUQ5#eYi2++-q47RGnmku6sq1VlKw8DT3xZ0EtmXPkPfBh2O 09:22 < achow101> no, I need something that can be loaded 09:24 < Hac> https://we.tl/t-3KFHI99aRd 09:24 < Hac> that's a download link to the wallet.dat file. Is that sufficient? 09:25 < achow101> that works, thanks 09:25 < Hac> I am not sure if that matters but I am also using a custom datadir when I start bitcoind 09:26 < achow101> is your node pruned? (you should get an error if it were, but doesn't hurt to check) 09:27 < Hac> it is not pruned 09:28 < achow101> and have you tried just restarting bitcoin core? 09:28 < Hac> yes, have been troubleshooting this issue for several days creating new wallets and reimporting etc 09:30 < achow101> can you provide a debug.log that covers creating the wallet, the import, and a rescan? 09:31 < achow101> there's nothing obviously wrong with the wallet file, and when I load it, it's automatically rescanned and the transaction is found 09:31 < achow101> not really sure what's gone wrong here 09:35 < Hac> https://0bin.net/paste/tnB3HNgB#jYTBdphVmSDOpWHl90SX26plzoIeA-m17Vt4IIgSqMX 09:42 < achow101> the debug log doesn't indicate any errors, other than the fact it clearly scanned past the block including the transaction 09:43 < achow101> have you tried reinstalling bitcoin core? 09:43 < achow101> other than that, I have no idea what's wrong or how to fix it. sorry. 09:44 < achow101> really is another instance of https://github.com/bitcoin/bitcoin/issues/19808 which we haven't been able to debug at all, particularly since it's hard to reproduce 09:48 < Hac> interesting. Yes, I have tried reinstalling core atleast once since encountering this problem, however, I did not delete my chainstate or blocks data 09:49 < darosior> Hac: on what architecture are you running? Could you post `bitcoind -version` and `uname -a`? Are you running a released `bitcoind` or did you compile it yourself? Not that i have any idea how to debug this further but maybe we'll find a pattern between the occurences of this bug, eventually. 09:50 < darosior> Also thanks for reporting and helping with debugging. 09:54 < Hac> I am running ubuntu 22.04.1 as an ubuntu live system and my datadir is on the internal storage disk. For continuity, here is a complete dump of my console for how I created the problem 09:54 < Hac> https://0bin.net/paste/CQ+mQcXw#b62GSApRBnlA7HV6RF-0eHkWNJTtc8D25bX0qZtTuFH 09:54 < Hac> where I clearly demonstrate that ismine: true and getbalances returns 0 09:56 < Hac> bitcoind -version returns 24.0.1 09:57 < Hac> I started bitcoin-24.0.1-x86_64-linux-gnu.tar.gz and I did not compile from source 09:58 < achow101> wait a sec 09:58 < achow101> I think you're not synced 09:58 < achow101> Loaded best chain: hashBestChain=000000000000000000025926dbac0aea9cc543321c3a6a2920f2e05e0057d8d3 height=776523 09:58 < achow101> the tx is in block 779514 09:58 < Hac> hm, that is odd 09:59 < achow101> and your node seems to be churning through outbound peers and never receiving any blocks 10:00 < achow101> is your internet connection particularly slow? 10:00 < Hac> No, it is quite fast 10:00 < Hac> the only thing in my conf is rpc creds 10:01 < Hac> gonna try something real quick I think i might know the issue 10:02 < Hac> when I do keygen and create my descriptors I start core with -networkactive=0. But I have restarted it many times since then. perhaps that flag is somehow persisting across restarting the daemon? 10:03 < achow101> no, i don't think that's it 10:03 < darosior> Oh good catch! 10:03 < Hac> I tried bitcoind -networkactive=1 but it didn't seem to have an affect. Perhaps I need to reindex? 10:03 < achow101> you have outbound peers, just not receiving any blocks from them 10:04 < achow101> you might just have a bunch of bad peers in the peers database. maybe delete peers.dat and restart? 10:08 < achow101> you can also try to connect to specific nodes with addnode. mine is 45.76.5.35 and it should be able to serve you the missing blocks 10:11 < Hac> deleting peers.dat did not seem to have any affect. 10:11 < Hac> Attempting to connect to your node was refused 10:15 < Hac> i feel like the best option at this point is to try and reindex 10:16 <@sipa> what does getchaintips say? 10:17 < Hac> i get back two tips 776525 which is invalid and 776523 which is active 10:20 < achow101> ah, you probably have block file corruption. you'll need to delete the highest numbered blk.dat and rev.dat files and then reindex 10:20 <@sipa> Just run with -reindex-chainstate 10:20 <@sipa> But also wonder why you ended up with a corrupted state in the first place. 10:21 < achow101> could just be an unlucky cosmic ray 10:22 < Hac> Cool. I will reindex, and then see if it fixes my issue and report back. Thanks for all the help. 10:22 < darosior> Maybe an issue with the connection between the live system (on a USB stick i assume?) and the internal storage 10:25 < Hac> It will probably due to an improper shutdown 10:25 < Hac> was* 10:25 < Hac> but usually it tells me when a block corruption happens 14:18 -!- Hac [~Hac@2603-6080-d802-7a70-9458-c1de-55ab-56e8.res6.spectrum.com] has quit [Quit: Client closed] --- Log closed Wed Mar 08 00:00:05 2023