Transcript for #bitcoin-dev 2017/02/24

12:23 emzy so mal poloniex passwort geƤndert...
12:24 emzy wrong channel.
19:00 bsm117532 In regtest mode, `generate` and `generatetoaddress` do not actually mine any transactions from the mempool. What's the best way to generate a block containing my mempool transactions?
19:02 waxwing bsm117532: 'generate' should work? my txs are always mined when i do that
19:02 waxwing hmm, maybe there's some detail i'm overlooking
19:02 achow101 bsm117532: both should mine transactions from the mempool, they're based on the same code IIRC
19:04 bsm117532 Looking at src/rpc/mining.cpp it doesn't look like it gets anything from the mempool. (And I'm asking because I have ~130 txns in my mempool and none in my blocks)
19:04 arubi it should mine transactions from your mempool with 'generate'
19:05 bsm117532 Hmmm then what could I be doing wrong?
19:05 arubi special settings? abnormal transactions?
19:05 waxwing try the viabtc accelerator?
19:05 waxwing :)
19:05 arubi hehe
19:06 bsm117532 They're segwit txns, maybe that's the problem...
19:06 arubi at which block height are you?
19:06 achow101 bsm117532: blocks are built here:
19:06 waxwing oh i think there's some high number of blocks you need upfront
19:06 bsm117532 But I'm running with -bip9params=segwit:0.0 -prematurewitness -walletprematurewitness
19:06 waxwing yeah i remember back in the segnet days it was like 500 or something
19:06 achow101 IIRC you only need 288 blocks for segwit to activate on regtest
19:07 bsm117532 Even with that I'm at block 909 and it's still not mining my txns...
19:08 arubi are these just "normal" segwit transactions? you have nothing set for 'maxblockweight' or 'maxblocksize' ?
19:08 bsm117532 I've not touched those parameters.
19:08 bsm117532 The txns might be considered nonstandard...
19:09 arubi so last time I got my regtest to fail to include tx in blocks was when I had conflicting settings for maxweight\maxsize. these were also "nonstandard" segwit transactions
19:10 achow101 I thought on regtest non-standard transactions can still be confirmed
19:11 achow101 (they are still accepted and mined by core)
19:12 arubi yea, for me I had maxblockweight=4000000 , maxblocksize=1000000, so some very big segwit transactions got into the node's mempool, but didn't get included in any blocks
19:12 bsm117532 Here's one:
19:13 arubi looks pretty normal
19:14 bsm117532 @arubi I'm using the defaults for those parameters, so maxblockweight=3000000 maxblocksize=750000
19:15 achow101 your tranasction is spending from a witness output, so the transaction before it had to also confirm
19:16 bsm117532 This is a segwit-only regtest, I'm using generatetoaddress directly to a segwit address
19:16 arubi well p2sh(segwit)
19:17 arubi you can use bare scripts for segwit stuff, so you don't need to have the p2sh preimage in scriptsig
19:17 arubi saves some precious bytes, especially if it's p2wsh :)
19:19 arubi are these 0 fee by any chance?
19:30 bsm117532 I am using bare segwit scripts, though the wallet has its coinbasae funds in a p2wsh
19:30 bsm117532 Good question about the fees...checking...
19:34 bsm117532 No they're not zero fee...
19:55 arubi weird. anything interesting on the 'getmempoolentry <txid>' output?
19:56 arubi wonder if they're all depending on some initial one that's not confirmed. here is p2sh(p2wpkh) sending to p2wpkh and change to p2pkh. is the input from a block reward?
20:00 arubi do the transactions even appear in 'getblocktemplate '{"rules":["segwit"]}'' ?
20:03 bsm117532 Nothing obvious in getmempoolentry
20:03 bsm117532 getblocktemplate has no transactions, adding the "rules" doesn't change that...
20:03 arubi so you have transactions in your mempool but not in blocktemplate? sounds like a bug :)
20:04 arubi I mean, what's the use of a transaction in mempool if it can't be mined?
20:04 bsm117532 Bah! I don't have time for a bug! :-(
20:04 bsm117532 But yeah...
20:05 arubi actually it's the same scenario I had with the sizes. wonder what's causing it. wanna share the chain?
20:05 arubi I wanna look at it a bit later
20:06 achow101 bsm117532: what version of core are you using?
20:06 bsm117532 13.2
20:07 bsm117532 I'll make a tarball
20:15 bsm117532 @arubi here is a tarball with a mempool that mines empty blocks:
20:15 arubi thanks! I'll be checking it out a bit later
20:16 bsm117532 Thanks! Please ping me if you discover anything. I need to get this to mine blocks, like now so I'm going to keep beating on it.
20:17 arubi no problem
20:18 achow101 bsm117532: I can't replicate this on a build of master (I tried basically exactly your example transaction but with my addresses). can you try using 0.14.0rc2 or build master?
20:18 bsm117532 sure
20:19 bsm117532 Did you use generatetoaddress with a segwit address too?
20:19 achow101 yes
20:19 bsm117532 It might have something to do with the structure of these transactions then.
20:19 bsm117532 I'll try again with the tip of master.
20:24 achow101 -j32, that seems a bit excessive
20:25 achow101 where do you get a 32 core machine?
20:25 bsm117532 dual socket, 32 cores.
20:25 bsm117532 Compiles bitcoin in 1:30.
20:42 bsm117532 @achow101 same problem on master, `getmininginfo` shows nonzero pooledtx, but getblocktemplate has zero transactions.
20:44 achow101 did generate include the transaction?
20:45 bsm117532 no
20:46 achow101 hmm. interesting. I can't replicate this though
20:47 bsm117532 I linked the regtest dir above. Just untar that file in ~/.bitcoin to see a chain with this problem.
20:51 achow101 are you sure that there are transactions in the mempool?
20:52 bsm117532 Yes, `getmininginfo` shows them in `pooledtx` and I can get them directly with getrawtransaction or getmempoolentry
20:52 bsm117532 One mempool txid you can use if you're examining my tarball is 7c7c8f1d762750a25a721a07fcddf711ed412a9feb7c52a91838114b28f1e1ee
20:52 achow101 here's your problem. segwit has not activated yet
20:52 achow101 (at least in the tar)
20:53 achow101 do `getblockchaininfo` and it will tell you whether it has activated
20:53 bsm117532 I'm running bitcoind -bip9params=segwit:0:0 -prematurewitness -walletprematurewitness
20:53 bsm117532 But you're right, it doesn't seem to have activated...
20:54 bsm117532 What do I need to do to get it to activate?
20:55 achow101 hmm. with your parameters it is active..
20:55 achow101 activating it just requires mining a bunch of blocks
20:55 bsm117532 According to getblockchaininfo it's not though...
20:55 bsm117532 And I'm at height 655, so that should be higher than the activation anyway...
20:56 achow101 wait, no. I read that wrong. Segwit isn't even in my getblockchaininfo output
20:56 bsm117532 YEah not in mine either
20:57 achow101 I think the problem is with the bip9params option you have set
20:59 achow101 oh. duh. the bip9 parameters you have set completely disable segwit. it doesn't activate it, it sets the start time for deployment signalling to 0, and then the end time again to 0, so segwit is effectively off
20:59 bsm117532 Heh okay. would -bip9params=segwit:0:1 turn it on?
21:00 achow101 no. just don't set that option. that option doesn't turn on segwit, it just changes the deployment parameters. you still need to mine the blocks to activate it
21:01 achow101 don't set the option. then mine a few hundred blocks and check that it is listed as active in getblockchaininfo
21:01 bsm117532 Ok I see.
21:02 bsm117532 But I think bip9params=segwit:0:1 would turn it on from block 1, no?
21:02 achow101 then your transactions should work
21:03 achow101 no. it means that signalling starts at 0, and ends at 1
21:04 achow101 signalling =\= activation
21:27 arubi phew :)
21:28 arubi I like that even if segwit fails to activate, the transactions are still in mempool hehe
22:09 bsm117532 But does regtest must be doing signaling when it mines, so a 1-block long signaling window should see 100% support, and activate, no?
22:14 achow101 that option isn't for how many blocks are required for signalling. it is for the unixtimestamp of the date signalling can start, and the unix timestamp of the date signalling ends
22:14 bsm117532 aaaaaaaahhhhhhhh
22:14 bsm117532 thanks achow101
22:14 achow101 np