contrib/signet/miner: miner won’t consider –nbits parameter #30091

issue edilmedeiros openend this issue on May 12, 2024
  1. edilmedeiros commented at 8:09 pm on May 12, 2024: contributor

    Is there an existing issue for this?

    • I have searched the existing issues

    Current behaviour

    contrib/signet/miner won’t respect the --nbits param. It will keep using an interval of 2m29s.

    0❯ ./contrib/signet/miner --cli "bitcoin-cli" generate --address $MINER_ADDR --grind-cmd "bitcoin-util grind" --nbits $NBITS --ongoing
    12024-05-12 16:09:20 INFO Mined block at height 362; next in 3m30s (mine)
    22024-05-12 16:12:51 INFO Mined block at height 363; next in 2m29s (mine)
    32024-05-12 16:15:21 INFO Mined block at height 364; next in 2m29s (mine)
    42024-05-12 16:17:51 INFO Mined block at height 365; next in 2m29s (mine)
    52024-05-12 16:20:21 INFO Mined block at height 366; next in 2m29s (mine)
    

    I used different values for $NBITS obtained as describe next. $MINER_ADD was generated by the issuer node and it is indeed receiving new funds each time a block is mined.

    When using the --min-nbits option I get the expected 10min interval as expected, but can’t control the miner to go faster or slower. In summary, seems that both behaviors are wrong:

    1. --nbits is not being considered;
    2. --min-nbits is not using minimum difficulty. (EDIT: it is, but minimum difficulty in the miner script mean the genesis block difficulty and not going as fast as possible as I expected from the docs and the help message. Yet, does not explain why the genesis block difficulty will make different computers run with the same 10m interval).

    I’m willing to investigate the miner script and submit a fix PR, but wanted to make sure I’m not screwing things myself before doing so.

    PS: I found this trying to follow instructions to run a custom signet on the bitcoin wiki (https://en.bitcoin.it/wiki/Signet). Unfortunately, the wiki does not cover how to make it using descriptor wallets and it took me some time to figure out. I’m trying to get writing permissions in the bitcoin wiki to update the wiki but don’t get a response anywhere. If someone knows who I should talk to, please let me know on the comments.

    Expected behaviour

    Documentation states that the --nbits param would be used to control how long it would take to mine blocks in the signet instead of going full speed.

    Steps to reproduce

    Use the miner to estimate the difficulty for a 600 seconds interval. There’s a slight variation each time the calibrate command is run, as expected.

    0$BTC_PATH/../contrib/signet/miner --cli "$BTC_PATH/bitcoin-cli -datadir=$DATA_DIR" calibrate --grind-cmd "$BTC_PATH/bitcoin-util grind" --seconds 600
    1nbits=1d00ac8d for 600s average mining time
    2NBITS=1d00ac8d
    

    Mine the first block setting the block time manually.

    0$BTC_PATH/../contrib/signet/miner --cli "$BTC_PATH/bitcoin-cli -datadir=$DATA_DIR" generate --address $MINER_ADDR --grind-cmd "$BTC_PATH/bitcoin-util grind" --nbits $NBITS --set-block-time $(date +%s)
    12024-05-12 16:43:49 INFO Mined block at height 1; next in 2m29s (mine)
    

    Let the miner run. Instead of the expected 10m interval I get 2m29s consistently after some transient.

    0❯ ./contrib/signet/miner --cli "bitcoin-cli" generate --address $MINER_ADDR --grind-cmd "bitcoin-util grind" --nbits $NBITS --ongoing
    12024-05-12 16:44:04 INFO Mined block at height 2; next in 4m44s (mine)
    22024-05-12 16:48:49 INFO Mined block at height 3; next in 2m29s (mine)
    32024-05-12 16:51:19 INFO Mined block at height 4; next in 2m29s (mine)
    42024-05-12 16:53:49 INFO Mined block at height 5; next in 2m29s (mine)
    52024-05-12 16:56:19 INFO Mined block at height 6; next in 2m29s (mine)
    

    To check that the --min-nbits will work to get the 10m interval (instead of going full speed as expected):

    0❯ ./contrib/signet/miner --cli "bitcoin-cli" generate --address $MINER_ADDR --grind-cmd "bitcoin-util grind" --nbits $NBITS --set-block-time $(date +%s)
    12024-05-12 17:15:45 INFO Mined block at height 11; next in 2m28s (mine)
    2
    3$BTC_PATH/../contrib/signet/miner --cli "$BTC_PATH/bitcoin-cli -datadir=$DATA_DIR" generate --address $MINER_ADDR --grind-cmd "$BTC_PATH/bitcoin-util grind" --min-nbits --ongoing
    42024-05-12 17:16:05 INFO Using nbits=1e0377ae
    52024-05-12 17:16:06 INFO Mined block at height 12; next in 19m38s (mine)
    62024-05-12 17:35:44 INFO Mined block at height 13; next in 10m0s (mine)
    72024-05-12 17:45:44 INFO Mined block at height 14; next in 10m0s (mine)
    
     0❯ ./contrib/signet/miner --debug --cli "bitcoin-cli" generate --address $MINER_ADDR --grind-cmd "bitcoin-util grind" --nbits $NBITS --ongoing
     12024-05-12 16:58:11 DEBUG Calling bitcoin-cli: ['/Users/jose.edil/2-development/bitcoin/bitcoin-core/src/bitcoin-cli', '-datadir=/tmp/signet-test', '-signet', 'getblockchaininfo']
     22024-05-12 16:58:11 DEBUG Calling bitcoin-cli: ['/Users/jose.edil/2-development/bitcoin/bitcoin-core/src/bitcoin-cli', '-datadir=/tmp/signet-test', '-signet', 'getblockheader', '000001651ecef69e66ea6413d356ae523f8993f4ac7580d7437c36bacfb32efb']
     32024-05-12 16:58:11 DEBUG Calling bitcoin-cli: ['/Users/jose.edil/2-development/bitcoin/bitcoin-core/src/bitcoin-cli', '-datadir=/tmp/signet-test', '-signet', 'getblocktemplate', '{"rules":["signet","segwit"]}']
     42024-05-12 16:58:11 DEBUG GBT template: {'capabilities': ['proposal'], 'version': 536870912, 'rules': ['csv', '!segwit', '!signet', 'taproot'], 'vbavailable': {}, 'vbrequired': 0, 'previousblockhash': '000001651ecef69e66ea6413d356ae523f8993f4ac7580d7437c36bacfb32efb', 'transactions': [], 'coinbaseaux': {}, 'coinbasevalue': 5000000000, 'longpollid': '000001651ecef69e66ea6413d356ae523f8993f4ac7580d7437c36bacfb32efb7', 'target': '00000377ae000000000000000000000000000000000000000000000000000000', 'mintime': 1715543330, 'mutable': ['time', 'transactions', 'prevblock'], 'noncerange': '00000000ffffffff', 'sigoplimit': 80000, 'sizelimit': 4000000, 'weightlimit': 4000000, 'curtime': 1715543891, 'bits': '1e0377ae', 'height': 7, 'signet_challenge': '00140b24b854187ee6dcd5a0a7063156b83a4605443c', 'default_witness_commitment': '6a24aa21a9ede2f61c3f71d1defd3fa999dfa36953755c690689799962b48bebd836974e8cf9'}
     52024-05-12 16:58:11 DEBUG Calling bitcoin-cli: ['/Users/jose.edil/2-development/bitcoin/bitcoin-core/src/bitcoin-cli', '-datadir=/tmp/signet-test', '-signet', 'getaddressinfo', 'tb1qpvjts4qc0mnde4dq5urrz44c8frq23puhc4mym']
     62024-05-12 16:58:11 DEBUG Mining block delta=2m30s start=1715543929 mine=True
     72024-05-12 16:58:11 DEBUG Calling bitcoin-cli: ['/Users/jose.edil/2-development/bitcoin/bitcoin-core/src/bitcoin-cli', '-datadir=/tmp/signet-test', '-signet', '-stdin', 'walletprocesspsbt']
     82024-05-12 16:58:11 DEBUG Calling bitcoin-cli: ['/Users/jose.edil/2-development/bitcoin/bitcoin-core/src/bitcoin-cli', '-datadir=/tmp/signet-test', '-signet', '-stdin', 'submitblock']
     92024-05-12 16:58:11 DEBUG Block hash 0000027a26160bedac78e820a47a939f76f15f3d026b231db5071bed5d3a1aee payout to tb1qpvjts4qc0mnde4dq5urrz44c8frq23puhc4mym
    102024-05-12 16:58:11 INFO Mined block at height 7; next in 3m7s (mine)
    112024-05-12 16:58:11 DEBUG Calling bitcoin-cli: ['/Users/jose.edil/2-development/bitcoin/bitcoin-core/src/bitcoin-cli', '-datadir=/tmp/signet-test', '-signet', 'getblockchaininfo']
    122024-05-12 16:58:11 DEBUG Calling bitcoin-cli: ['/Users/jose.edil/2-development/bitcoin/bitcoin-core/src/bitcoin-cli', '-datadir=/tmp/signet-test', '-signet', 'getblockheader', '0000027a26160bedac78e820a47a939f76f15f3d026b231db5071bed5d3a1aee']
    132024-05-12 16:58:11 DEBUG Sleeping for 1m, next block due in 3m7s (mine)
    142024-05-12 16:59:11 DEBUG Calling bitcoin-cli: ['/Users/jose.edil/2-development/bitcoin/bitcoin-core/src/bitcoin-cli', '-datadir=/tmp/signet-test', '-signet', 'getblockchaininfo']
    152024-05-12 16:59:11 DEBUG Sleeping for 1m, next block due in 2m7s (mine)
    162024-05-12 17:00:11 DEBUG Calling bitcoin-cli: ['/Users/jose.edil/2-development/bitcoin/bitcoin-core/src/bitcoin-cli', '-datadir=/tmp/signet-test', '-signet', 'getblockchaininfo']
    172024-05-12 17:00:11 DEBUG Sleeping for 1m, next block due in 1m7s (mine)
    182024-05-12 17:01:11 DEBUG Calling bitcoin-cli: ['/Users/jose.edil/2-development/bitcoin/bitcoin-core/src/bitcoin-cli', '-datadir=/tmp/signet-test', '-signet', 'getblockchaininfo']
    192024-05-12 17:01:11 DEBUG Sleeping for 7s, next block due in 7s (mine)
    202024-05-12 17:01:19 DEBUG Calling bitcoin-cli: ['/Users/jose.edil/2-development/bitcoin/bitcoin-core/src/bitcoin-cli', '-datadir=/tmp/signet-test', '-signet', 'getblockchaininfo']
    212024-05-12 17:01:19 DEBUG Calling bitcoin-cli: ['/Users/jose.edil/2-development/bitcoin/bitcoin-core/src/bitcoin-cli', '-datadir=/tmp/signet-test', '-signet', 'getblocktemplate', '{"rules":["signet","segwit"]}']
    222024-05-12 17:01:19 DEBUG GBT template: {'capabilities': ['proposal'], 'version': 536870912, 'rules': ['csv', '!segwit', '!signet', 'taproot'], 'vbavailable': {}, 'vbrequired': 0, 'previousblockhash': '0000027a26160bedac78e820a47a939f76f15f3d026b231db5071bed5d3a1aee', 'transactions': [], 'coinbaseaux': {}, 'coinbasevalue': 5000000000, 'longpollid': '0000027a26160bedac78e820a47a939f76f15f3d026b231db5071bed5d3a1aee8', 'target': '00000377ae000000000000000000000000000000000000000000000000000000', 'mintime': 1715543480, 'mutable': ['time', 'transactions', 'prevblock'], 'noncerange': '00000000ffffffff', 'sigoplimit': 80000, 'sizelimit': 4000000, 'weightlimit': 4000000, 'curtime': 1715544079, 'bits': '1e0377ae', 'height': 8, 'signet_challenge': '00140b24b854187ee6dcd5a0a7063156b83a4605443c', 'default_witness_commitment': '6a24aa21a9ede2f61c3f71d1defd3fa999dfa36953755c690689799962b48bebd836974e8cf9'}
    232024-05-12 17:01:19 DEBUG Mining block delta=2m30s start=1715544079 mine=True
    242024-05-12 17:01:19 DEBUG Calling bitcoin-cli: ['/Users/jose.edil/2-development/bitcoin/bitcoin-core/src/bitcoin-cli', '-datadir=/tmp/signet-test', '-signet', '-stdin', 'walletprocesspsbt']
    252024-05-12 17:01:19 DEBUG Calling bitcoin-cli: ['/Users/jose.edil/2-development/bitcoin/bitcoin-core/src/bitcoin-cli', '-datadir=/tmp/signet-test', '-signet', '-stdin', 'submitblock']
    262024-05-12 17:01:19 DEBUG Block hash 0000021265df166e29c9f812e001d459a969d5d084bd12b7549907e23c535167 payout to tb1qpvjts4qc0mnde4dq5urrz44c8frq23puhc4mym
    272024-05-12 17:01:19 INFO Mined block at height 8; next in 2m30s (mine)
    282024-05-12 17:01:19 DEBUG Calling bitcoin-cli: ['/Users/jose.edil/2-development/bitcoin/bitcoin-core/src/bitcoin-cli', '-datadir=/tmp/signet-test', '-signet', 'getblockchaininfo']
    292024-05-12 17:01:19 DEBUG Calling bitcoin-cli: ['/Users/jose.edil/2-development/bitcoin/bitcoin-core/src/bitcoin-cli', '-datadir=/tmp/signet-test', '-signet', 'getblockheader', '0000021265df166e29c9f812e001d459a969d5d084bd12b7549907e23c535167']
    302024-05-12 17:01:19 DEBUG Sleeping for 1m, next block due in 2m29s (mine)
    312024-05-12 17:02:19 DEBUG Calling bitcoin-cli: ['/Users/jose.edil/2-development/bitcoin/bitcoin-core/src/bitcoin-cli', '-datadir=/tmp/signet-test', '-signet', 'getblockchaininfo']
    322024-05-12 17:02:19 DEBUG Sleeping for 1m, next block due in 1m29s (mine)
    332024-05-12 17:03:19 DEBUG Calling bitcoin-cli: ['/Users/jose.edil/2-development/bitcoin/bitcoin-core/src/bitcoin-cli', '-datadir=/tmp/signet-test', '-signet', 'getblockchaininfo']
    342024-05-12 17:03:19 DEBUG Sleeping for 29s, next block due in 29s (mine)
    352024-05-12 17:03:49 DEBUG Calling bitcoin-cli: ['/Users/jose.edil/2-development/bitcoin/bitcoin-core/src/bitcoin-cli', '-datadir=/tmp/signet-test', '-signet', 'getblockchaininfo']
    362024-05-12 17:03:49 DEBUG Calling bitcoin-cli: ['/Users/jose.edil/2-development/bitcoin/bitcoin-core/src/bitcoin-cli', '-datadir=/tmp/signet-test', '-signet', 'getblocktemplate', '{"rules":["signet","segwit"]}']
    372024-05-12 17:03:49 DEBUG GBT template: {'capabilities': ['proposal'], 'version': 536870912, 'rules': ['csv', '!segwit', '!signet', 'taproot'], 'vbavailable': {}, 'vbrequired': 0, 'previousblockhash': '0000021265df166e29c9f812e001d459a969d5d084bd12b7549907e23c535167', 'transactions': [], 'coinbaseaux': {}, 'coinbasevalue': 5000000000, 'longpollid': '0000021265df166e29c9f812e001d459a969d5d084bd12b7549907e23c5351679', 'target': '00000377ae000000000000000000000000000000000000000000000000000000', 'mintime': 1715543480, 'mutable': ['time', 'transactions', 'prevblock'], 'noncerange': '00000000ffffffff', 'sigoplimit': 80000, 'sizelimit': 4000000, 'weightlimit': 4000000, 'curtime': 1715544229, 'bits': '1e0377ae', 'height': 9, 'signet_challenge': '00140b24b854187ee6dcd5a0a7063156b83a4605443c', 'default_witness_commitment': '6a24aa21a9ede2f61c3f71d1defd3fa999dfa36953755c690689799962b48bebd836974e8cf9'}
    382024-05-12 17:03:49 DEBUG Mining block delta=2m30s start=1715544229 mine=True
    392024-05-12 17:03:49 DEBUG Calling bitcoin-cli: ['/Users/jose.edil/2-development/bitcoin/bitcoin-core/src/bitcoin-cli', '-datadir=/tmp/signet-test', '-signet', '-stdin', 'walletprocesspsbt']
    402024-05-12 17:03:49 DEBUG Calling bitcoin-cli: ['/Users/jose.edil/2-development/bitcoin/bitcoin-core/src/bitcoin-cli', '-datadir=/tmp/signet-test', '-signet', '-stdin', 'submitblock']
    412024-05-12 17:03:49 DEBUG Block hash 00000121bec36cb911544a2278e9e15f68fc2dde265ca94656b2ccd706c9e92c payout to tb1qpvjts4qc0mnde4dq5urrz44c8frq23puhc4mym
    422024-05-12 17:03:49 INFO Mined block at height 9; next in 2m29s (mine)
    432024-05-12 17:03:49 DEBUG Calling bitcoin-cli: ['/Users/jose.edil/2-development/bitcoin/bitcoin-core/src/bitcoin-cli', '-datadir=/tmp/signet-test', '-signet', 'getblockchaininfo']
    442024-05-12 17:03:49 DEBUG Calling bitcoin-cli: ['/Users/jose.edil/2-development/bitcoin/bitcoin-core/src/bitcoin-cli', '-datadir=/tmp/signet-test', '-signet', 'getblockheader', '00000121bec36cb911544a2278e9e15f68fc2dde265ca94656b2ccd706c9e92c']
    452024-05-12 17:03:49 DEBUG Sleeping for 1m, next block due in 2m29s (mine)
    462024-05-12 17:04:49 DEBUG Calling bitcoin-cli: ['/Users/jose.edil/2-development/bitcoin/bitcoin-core/src/bitcoin-cli', '-datadir=/tmp/signet-test', '-signet', 'getblockchaininfo']
    472024-05-12 17:04:49 DEBUG Sleeping for 1m, next block due in 1m29s (mine)
    482024-05-12 17:05:49 DEBUG Calling bitcoin-cli: ['/Users/jose.edil/2-development/bitcoin/bitcoin-core/src/bitcoin-cli', '-datadir=/tmp/signet-test', '-signet', 'getblockchaininfo']
    492024-05-12 17:05:49 DEBUG Sleeping for 29s, next block due in 29s (mine)
    502024-05-12 17:06:19 DEBUG Calling bitcoin-cli: ['/Users/jose.edil/2-development/bitcoin/bitcoin-core/src/bitcoin-cli', '-datadir=/tmp/signet-test', '-signet', 'getblockchaininfo']
    512024-05-12 17:06:19 DEBUG Calling bitcoin-cli: ['/Users/jose.edil/2-development/bitcoin/bitcoin-core/src/bitcoin-cli', '-datadir=/tmp/signet-test', '-signet', 'getblocktemplate', '{"rules":["signet","segwit"]}']
    522024-05-12 17:06:19 DEBUG GBT template: {'capabilities': ['proposal'], 'version': 536870912, 'rules': ['csv', '!segwit', '!signet', 'taproot'], 'vbavailable': {}, 'vbrequired': 0, 'previousblockhash': '00000121bec36cb911544a2278e9e15f68fc2dde265ca94656b2ccd706c9e92c', 'transactions': [], 'coinbaseaux': {}, 'coinbasevalue': 5000000000, 'longpollid': '00000121bec36cb911544a2278e9e15f68fc2dde265ca94656b2ccd706c9e92c10', 'target': '00000377ae000000000000000000000000000000000000000000000000000000', 'mintime': 1715543630, 'mutable': ['time', 'transactions', 'prevblock'], 'noncerange': '00000000ffffffff', 'sigoplimit': 80000, 'sizelimit': 4000000, 'weightlimit': 4000000, 'curtime': 1715544379, 'bits': '1e0377ae', 'height': 10, 'signet_challenge': '00140b24b854187ee6dcd5a0a7063156b83a4605443c', 'default_witness_commitment': '6a24aa21a9ede2f61c3f71d1defd3fa999dfa36953755c690689799962b48bebd836974e8cf9'}
    532024-05-12 17:06:19 DEBUG Mining block delta=2m30s start=1715544379 mine=True
    542024-05-12 17:06:19 DEBUG Calling bitcoin-cli: ['/Users/jose.edil/2-development/bitcoin/bitcoin-core/src/bitcoin-cli', '-datadir=/tmp/signet-test', '-signet', '-stdin', 'walletprocesspsbt']
    552024-05-12 17:06:19 DEBUG Calling bitcoin-cli: ['/Users/jose.edil/2-development/bitcoin/bitcoin-core/src/bitcoin-cli', '-datadir=/tmp/signet-test', '-signet', '-stdin', 'submitblock']
    562024-05-12 17:06:19 DEBUG Block hash 0000034045f2e82e954cad452dc90212d1652687aa2a65e8bb50fc2447c1c89a payout to tb1qpvjts4qc0mnde4dq5urrz44c8frq23puhc4mym
    572024-05-12 17:06:19 INFO Mined block at height 10; next in 2m29s (mine)
    582024-05-12 17:06:19 DEBUG Calling bitcoin-cli: ['/Users/jose.edil/2-development/bitcoin/bitcoin-core/src/bitcoin-cli', '-datadir=/tmp/signet-test', '-signet', 'getblockchaininfo']
    592024-05-12 17:06:19 DEBUG Calling bitcoin-cli: ['/Users/jose.edil/2-development/bitcoin/bitcoin-core/src/bitcoin-cli', '-datadir=/tmp/signet-test', '-signet', 'getblockheader', '0000034045f2e82e954cad452dc90212d1652687aa2a65e8bb50fc2447c1c89a']
    602024-05-12 17:06:19 DEBUG Sleeping for 1m, next block due in 2m29s (mine)
    

    Relevant log output

      0
      1
      2
      3
      4
      52024-05-12T19:38:23Z Signet with challenge 00140b24b854187ee6dcd5a0a7063156b83a4605443c
      62024-05-12T19:38:23Z Bitcoin Core version v27.0 (release build)
      72024-05-12T19:38:23Z InitParameterInteraction: parameter interaction: -bind set -> setting -listen=1
      82024-05-12T19:38:23Z Signet derived magic (message start): 4605eff3
      92024-05-12T19:38:23Z Script verification uses 10 additional threads
     102024-05-12T19:38:23Z Using the 'arm_shani(1way,2way)' SHA256 implementation
     112024-05-12T19:38:23Z Default data directory /Users/jose.edil/Library/Application Support/Bitcoin
     122024-05-12T19:38:23Z Using data directory /tmp/signet-test/signet
     132024-05-12T19:38:23Z Config file: /tmp/signet-test/bitcoin.conf (not found, skipping)
     142024-05-12T19:38:23Z Command-line arg: bind="0.0.0.0"
     152024-05-12T19:38:23Z Command-line arg: daemon=""
     162024-05-12T19:38:23Z Command-line arg: datadir="/tmp/signet-test"
     172024-05-12T19:38:23Z Command-line arg: signet=""
     182024-05-12T19:38:23Z Command-line arg: signetchallenge="00140b24b854187ee6dcd5a0a7063156b83a4605443c"
     192024-05-12T19:38:23Z Command-line arg: txindex=""
     202024-05-12T19:38:23Z Using at most 125 automatic connections (285 file descriptors available)
     212024-05-12T19:38:23Z Using 16 MiB out of 16 MiB requested for signature cache, able to store 524288 elements
     222024-05-12T19:38:23Z Using 16 MiB out of 16 MiB requested for script execution cache, able to store 524288 elements
     232024-05-12T19:38:23Z scheduler thread start
     242024-05-12T19:38:23Z Binding RPC on address ::1 port 38332
     252024-05-12T19:38:23Z Binding RPC on address 127.0.0.1 port 38332
     262024-05-12T19:38:23Z Using random cookie authentication.
     272024-05-12T19:38:23Z Generated RPC authentication cookie /tmp/signet-test/signet/.cookie
     282024-05-12T19:38:23Z Starting HTTP server with 4 worker threads
     292024-05-12T19:38:23Z Using wallet directory /tmp/signet-test/signet/wallets
     302024-05-12T19:38:23Z init message: Verifying wallet(s)
     312024-05-12T19:38:23Z Using /16 prefix for IP bucketing
     322024-05-12T19:38:23Z init message: Loading P2P addresses
     332024-05-12T19:38:23Z Creating peers.dat because the file was not found ("/tmp/signet-test/signet/peers.dat")
     342024-05-12T19:38:23Z init message: Loading banlist
     352024-05-12T19:38:23Z Recreating the banlist database
     362024-05-12T19:38:23Z SetNetworkActive: true
     372024-05-12T19:38:23Z /tmp/signet-test/signet/fee_estimates.dat is not found. Continue anyway.
     382024-05-12T19:38:23Z Script verification uses 10 additional threads
     392024-05-12T19:38:23Z Cache configuration:
     402024-05-12T19:38:23Z * Using 2.0 MiB for block index database
     412024-05-12T19:38:23Z * Using 56.0 MiB for transaction index database
     422024-05-12T19:38:23Z * Using 8.0 MiB for chain state database
     432024-05-12T19:38:23Z * Using 384.0 MiB for in-memory UTXO set (plus up to 286.1 MiB of unused mempool space)
     442024-05-12T19:38:23Z init message: Loading block index
     452024-05-12T19:38:23Z Validating signatures for all blocks.
     462024-05-12T19:38:23Z Setting nMinimumChainWork=0000000000000000000000000000000000000000000000000000000000000000
     472024-05-12T19:38:23Z Opening LevelDB in /tmp/signet-test/signet/blocks/index
     482024-05-12T19:38:23Z Opened LevelDB successfully
     492024-05-12T19:38:23Z Using obfuscation key for /tmp/signet-test/signet/blocks/index: 0000000000000000
     502024-05-12T19:38:23Z LoadBlockIndexDB: last block file = 0
     512024-05-12T19:38:23Z LoadBlockIndexDB: last block file info: CBlockFileInfo(blocks=0, size=0, heights=0...0, time=1970-01-01...1970-01-01)
     522024-05-12T19:38:23Z Checking all blk files are present...
     532024-05-12T19:38:23Z Initializing databases...
     542024-05-12T19:38:23Z Initializing chainstate Chainstate [ibd] @ height -1 (null)
     552024-05-12T19:38:23Z Opening LevelDB in /tmp/signet-test/signet/chainstate
     562024-05-12T19:38:23Z Opened LevelDB successfully
     572024-05-12T19:38:23Z Wrote new obfuscate key for /tmp/signet-test/signet/chainstate: 71feb2eb26857ade
     582024-05-12T19:38:23Z Using obfuscation key for /tmp/signet-test/signet/chainstate: 71feb2eb26857ade
     592024-05-12T19:38:23Z Opening LevelDB in /tmp/signet-test/signet/chainstate
     602024-05-12T19:38:23Z Opened LevelDB successfully
     612024-05-12T19:38:23Z Using obfuscation key for /tmp/signet-test/signet/chainstate: 71feb2eb26857ade
     622024-05-12T19:38:23Z [Chainstate [ibd] @ height -1 (null)] resized coinsdb cache to 8.0 MiB
     632024-05-12T19:38:23Z [Chainstate [ibd] @ height -1 (null)] resized coinstip cache to 384.0 MiB
     642024-05-12T19:38:23Z init message: Verifying blocks
     652024-05-12T19:38:23Z  block index              44ms
     662024-05-12T19:38:23Z Opening LevelDB in /tmp/signet-test/signet/indexes/txindex
     672024-05-12T19:38:23Z Opened LevelDB successfully
     682024-05-12T19:38:23Z Using obfuscation key for /tmp/signet-test/signet/indexes/txindex: 0000000000000000
     692024-05-12T19:38:23Z Setting NODE_NETWORK on non-prune mode
     702024-05-12T19:38:23Z initload thread start
     712024-05-12T19:38:23Z UpdateTip: new best=00000008819873e925422c1ff0f99f7cc9bbb232af63a077a480a3633bee1ef6 height=0 version=0x00000001 log2_work=22.206105 tx=1 date='2020-09-01T00:00:00Z' progress=1.000000 cache=0.3MiB(0txo)
     722024-05-12T19:38:23Z block tree size = 1
     732024-05-12T19:38:23Z nBestHeight = 0
     742024-05-12T19:38:23Z txindex thread start
     752024-05-12T19:38:23Z txindex is enabled at height 0
     762024-05-12T19:38:23Z txindex thread exit
     772024-05-12T19:38:23Z Failed to open mempool file from disk. Continuing anyway.
     782024-05-12T19:38:23Z initload thread exit
     792024-05-12T19:38:23Z torcontrol thread start
     802024-05-12T19:38:23Z Bound to 0.0.0.0:38333
     812024-05-12T19:38:23Z Bound to 127.0.0.1:38334
     822024-05-12T19:38:23Z 0 block-relay-only anchors will be tried for connections.
     832024-05-12T19:38:23Z init message: Starting network threads
     842024-05-12T19:38:23Z net thread start
     852024-05-12T19:38:23Z dnsseed thread start
     862024-05-12T19:38:23Z 0 addresses found from DNS seeds
     872024-05-12T19:38:23Z dnsseed thread exit
     882024-05-12T19:38:23Z addcon thread start
     892024-05-12T19:38:23Z opencon thread start
     902024-05-12T19:38:23Z msghand thread start
     912024-05-12T19:38:23Z init message: Done loading
     922024-05-12T19:38:37Z Using SQLite Version 3.45.2
     932024-05-12T19:38:37Z Using wallet /tmp/signet-test/signet/wallets/miner
     942024-05-12T19:38:37Z init message: Loading wallet
     952024-05-12T19:38:37Z [miner] Wallet file version = 10500, last client version = 270000
     962024-05-12T19:38:37Z [miner] Legacy Wallet Keys: 0 plaintext, 0 encrypted, 0 w/ metadata, 0 total.
     972024-05-12T19:38:37Z [miner] Descriptors: 0, Descriptor Keys: 0 plaintext, 0 encrypted, 0 total.
     982024-05-12T19:38:37Z [miner] Setting minversion to 169900
     992024-05-12T19:38:37Z [miner] Setting spkMan to active: id = 7579d3a01bfa0f9a3e90cce85e7949ba664e41f9764187a1ddf59dcb59d976df, type = legacy, internal = false
    1002024-05-12T19:38:37Z [miner] Setting spkMan to active: id = b64657f5f8bdac3516c84721109fad770e7b0ec907e471f85d105f147786432b, type = p2sh-segwit, internal = false
    1012024-05-12T19:38:37Z [miner] Setting spkMan to active: id = 7354fdb77bba77cea4ef8220890a92de5cbbfa64dc490fa05bcfc7c2a91c0ddc, type = bech32, internal = false
    1022024-05-12T19:38:37Z [miner] Setting spkMan to active: id = e0681929869c26d99678c72666bbfde5ab8633e061b143449110dea9e321619c, type = bech32m, internal = false
    1032024-05-12T19:38:37Z [miner] Setting spkMan to active: id = cb86b5467867127b0a82bd4ae7ddc84a1fea58d344c3bbb67bd621527354b888, type = legacy, internal = true
    1042024-05-12T19:38:37Z [miner] Setting spkMan to active: id = 817c3cd0f5c8fc291cbda9e4d1354882554ee78d677531ca00c0ebb8a40858df, type = p2sh-segwit, internal = true
    1052024-05-12T19:38:37Z [miner] Setting spkMan to active: id = 79d9c4c0621385693ee3a50cfa1f920b350ddd0a963f7297fa0cad7639ae684c, type = bech32, internal = true
    1062024-05-12T19:38:37Z [miner] Setting spkMan to active: id = cc21e9f24e87b984a4f6084dd6cddf2bb5ca427e000072107a68a7bd588b6110, type = bech32m, internal = true
    1072024-05-12T19:38:37Z [miner] Wallet completed loading in             361ms
    1082024-05-12T19:38:37Z [miner] setKeyPool.size() = 8000
    1092024-05-12T19:38:37Z [miner] mapWallet.size() = 0
    1102024-05-12T19:38:37Z [miner] m_address_book.size() = 0
    1112024-05-12T19:38:51Z [miner] Setting spkMan to active: id = e2b049c63b1ec1fcffa1ce0191dadf3d9f2b539eb05de1ddd36141a627b32dac, type = legacy, internal = false
    1122024-05-12T19:38:51Z [miner] Setting spkMan to active: id = ee7e4c40a7fcc02a4cf7b195ff3b1fff78a4080405e3098198b3b5d1d4ac4ad0, type = legacy, internal = true
    1132024-05-12T19:38:51Z [miner] Setting spkMan to active: id = 05dc3a6b543e8f12ff842f85cd98caa2d17e665b02f5379265689b8f7eb00e06, type = p2sh-segwit, internal = false
    1142024-05-12T19:38:51Z [miner] Setting spkMan to active: id = 27c5b93ecb509bd2de6d266dce525fa50c38ce43efcd961499fc3f06c5cca36d, type = p2sh-segwit, internal = true
    1152024-05-12T19:38:51Z [miner] Setting spkMan to active: id = 3a72e2602ada99532906cb3015f77750d0608195bcd2cd4dc51c869e3851cb2c, type = bech32m, internal = false
    1162024-05-12T19:38:52Z [miner] Setting spkMan to active: id = 0dc671af4f42a0e55af2423ec2c00254b7667b3c36579f683b03970cca5c4f9d, type = bech32m, internal = true
    1172024-05-12T19:38:52Z [miner] Setting spkMan to active: id = 25483e7077c3121de11e1cd6ebac66a556303e482b5f46b06ced38376d7bf1e7, type = bech32, internal = false
    1182024-05-12T19:38:52Z [miner] Setting spkMan to active: id = 04c7f7b7b9e90ac9d4e78f4d95dc72f928de9507d849a2ce612867f2d8e00e76, type = bech32, internal = true
    1192024-05-12T19:38:52Z [miner] RescanFromTime: Rescanning last 1 blocks
    1202024-05-12T19:38:52Z [miner] Rescan started from block 00000008819873e925422c1ff0f99f7cc9bbb232af63a077a480a3633bee1ef6... (slow variant inspecting all blocks)
    1212024-05-12T19:38:52Z [miner] Scanning current mempool transactions.
    1222024-05-12T19:38:52Z [miner] Rescan completed in               0ms
    1232024-05-12T19:39:24Z Adding fixed seeds as 60 seconds have passed and addrman is empty for at least one reachable network
    1242024-05-12T19:39:24Z Added 0 fixed seeds from reachable networks.
    1252024-05-12T19:43:49Z CreateNewBlock(): block weight: 800 txs: 0 fees: 0 sigops 400
    1262024-05-12T19:43:49Z Leaving InitialBlockDownload (latching to false)
    1272024-05-12T19:43:49Z UpdateTip: new best=0000023efd709d9809aeeaf0080ce26dbac7f4f8272fefeffaaf2d6888f26dc6 height=1 version=0x20000000 log2_work=23.206105 tx=2 date='2024-05-12T19:43:49Z' progress=1.000000 cache=0.3MiB(1txo)
    1282024-05-12T19:43:49Z [miner] AddToWallet a91452c1c3650acd6e226dd23727f45c7515ddb7621f0d9dec9c695ddc3a171c  new Confirmed (block=0000023efd709d9809aeeaf0080ce26dbac7f4f8272fefeffaaf2d6888f26dc6, height=1, index=0)
    1292024-05-12T19:44:04Z CreateNewBlock(): block weight: 800 txs: 0 fees: 0 sigops 400
    1302024-05-12T19:44:04Z Saw new header hash=000000bde81e9a546e19d5ba094474ae86e7ed92f1be1ef4021ab07444942571 height=2
    1312024-05-12T19:44:04Z UpdateTip: new best=000000bde81e9a546e19d5ba094474ae86e7ed92f1be1ef4021ab07444942571 height=2 version=0x20000000 log2_work=23.791067 tx=3 date='2024-05-12T19:46:19Z' progress=1.000000 cache=0.3MiB(2txo)
    1322024-05-12T19:44:04Z [miner] AddToWallet e941dbaf77fdc763266c696d5457ff49f901019d086d924a95a64ecaef8539ad  new Confirmed (block=000000bde81e9a546e19d5ba094474ae86e7ed92f1be1ef4021ab07444942571, height=2, index=0)
    1332024-05-12T19:48:49Z CreateNewBlock(): block weight: 800 txs: 0 fees: 0 sigops 400
    1342024-05-12T19:48:49Z Saw new header hash=000001da13a2f3a8c3b3fb5ad0f1f333319db81da24b64bae4f32f80ab25a419 height=3
    1352024-05-12T19:48:49Z UpdateTip: new best=000001da13a2f3a8c3b3fb5ad0f1f333319db81da24b64bae4f32f80ab25a419 height=3 version=0x20000000 log2_work=24.206105 tx=4 date='2024-05-12T19:48:49Z' progress=1.000000 cache=0.3MiB(3txo)
    1362024-05-12T19:48:49Z [miner] AddToWallet a7598126921e31a66c08f3d2b6cd5fdd302629a7453974cd5f659e4c5c425467  new Confirmed (block=000001da13a2f3a8c3b3fb5ad0f1f333319db81da24b64bae4f32f80ab25a419, height=3, index=0)
    1372024-05-12T19:51:19Z CreateNewBlock(): block weight: 800 txs: 0 fees: 0 sigops 400
    1382024-05-12T19:51:19Z Saw new header hash=0000002921e540e9f745fe92b4ad649102a5c0fb56e2eb56f3f46997e54d2a33 height=4
    1392024-05-12T19:51:19Z UpdateTip: new best=0000002921e540e9f745fe92b4ad649102a5c0fb56e2eb56f3f46997e54d2a33 height=4 version=0x20000000 log2_work=24.528033 tx=5 date='2024-05-12T19:51:19Z' progress=1.000000 cache=0.3MiB(4txo)
    1402024-05-12T19:51:20Z [miner] AddToWallet d1eb236ab1a4d4c107ca645f26002fd0373e824817fd1a3986fc9781bc20629f  new Confirmed (block=0000002921e540e9f745fe92b4ad649102a5c0fb56e2eb56f3f46997e54d2a33, height=4, index=0)
    1412024-05-12T19:53:49Z CreateNewBlock(): block weight: 800 txs: 0 fees: 0 sigops 400
    1422024-05-12T19:53:49Z Saw new header hash=00000050bf9b5a2519c67495ef025282f51c5a08fc73410fd08c6c5cd52b00e7 height=5
    1432024-05-12T19:53:49Z UpdateTip: new best=00000050bf9b5a2519c67495ef025282f51c5a08fc73410fd08c6c5cd52b00e7 height=5 version=0x20000000 log2_work=24.791067 tx=6 date='2024-05-12T19:53:49Z' progress=1.000000 cache=0.3MiB(5txo)
    1442024-05-12T19:53:49Z [miner] AddToWallet 261d1d58808885053c2409443d86005f08f86d44fe9f7818a952204f94e1d587  new Confirmed (block=00000050bf9b5a2519c67495ef025282f51c5a08fc73410fd08c6c5cd52b00e7, height=5, index=0)
    1452024-05-12T19:56:19Z CreateNewBlock(): block weight: 800 txs: 0 fees: 0 sigops 400
    1462024-05-12T19:56:19Z Saw new header hash=000001651ecef69e66ea6413d356ae523f8993f4ac7580d7437c36bacfb32efb height=6
    1472024-05-12T19:56:19Z UpdateTip: new best=000001651ecef69e66ea6413d356ae523f8993f4ac7580d7437c36bacfb32efb height=6 version=0x20000000 log2_work=25.013459 tx=7 date='2024-05-12T19:56:19Z' progress=1.000000 cache=0.3MiB(6txo)
    1482024-05-12T19:56:19Z [miner] AddToWallet 46b2fb68ce76e3ee4ba0746321fca815e9bab394b3971862d4c8dd41bd0df550  new Confirmed (block=000001651ecef69e66ea6413d356ae523f8993f4ac7580d7437c36bacfb32efb, height=6, index=0)
    1492024-05-12T19:58:11Z CreateNewBlock(): block weight: 800 txs: 0 fees: 0 sigops 400
    1502024-05-12T19:58:11Z Saw new header hash=0000027a26160bedac78e820a47a939f76f15f3d026b231db5071bed5d3a1aee height=7
    1512024-05-12T19:58:11Z UpdateTip: new best=0000027a26160bedac78e820a47a939f76f15f3d026b231db5071bed5d3a1aee height=7 version=0x20000000 log2_work=25.206105 tx=8 date='2024-05-12T19:58:49Z' progress=1.000000 cache=0.3MiB(7txo)
    1522024-05-12T19:58:11Z [miner] AddToWallet 8a7a707443c76515e0c3ad087a5a8da77cf8753faac235536d27f17242e53710  new Confirmed (block=0000027a26160bedac78e820a47a939f76f15f3d026b231db5071bed5d3a1aee, height=7, index=0)
    1532024-05-12T20:01:19Z CreateNewBlock(): block weight: 800 txs: 0 fees: 0 sigops 400
    1542024-05-12T20:01:19Z Saw new header hash=0000021265df166e29c9f812e001d459a969d5d084bd12b7549907e23c535167 height=8
    1552024-05-12T20:01:19Z UpdateTip: new best=0000021265df166e29c9f812e001d459a969d5d084bd12b7549907e23c535167 height=8 version=0x20000000 log2_work=25.376030 tx=9 date='2024-05-12T20:01:19Z' progress=1.000000 cache=0.3MiB(8txo)
    1562024-05-12T20:01:19Z [miner] AddToWallet 104c9d5272dd809d38653fcbc4b2b3985ea79249ee5e4967388a772a806eb342  new Confirmed (block=0000021265df166e29c9f812e001d459a969d5d084bd12b7549907e23c535167, height=8, index=0)
    1572024-05-12T20:03:49Z CreateNewBlock(): block weight: 800 txs: 0 fees: 0 sigops 400
    1582024-05-12T20:03:49Z Saw new header hash=00000121bec36cb911544a2278e9e15f68fc2dde265ca94656b2ccd706c9e92c height=9
    1592024-05-12T20:03:49Z UpdateTip: new best=00000121bec36cb911544a2278e9e15f68fc2dde265ca94656b2ccd706c9e92c height=9 version=0x20000000 log2_work=25.528033 tx=10 date='2024-05-12T20:03:49Z' progress=1.000000 cache=0.3MiB(9txo)
    1602024-05-12T20:03:49Z [miner] AddToWallet ee4671535b097dd7cc5ab25733eefb5a9a247122057118c6ffc425b383109ede  new Confirmed (block=00000121bec36cb911544a2278e9e15f68fc2dde265ca94656b2ccd706c9e92c, height=9, index=0)
    1612024-05-12T20:06:19Z CreateNewBlock(): block weight: 800 txs: 0 fees: 0 sigops 400
    1622024-05-12T20:06:19Z Saw new header hash=0000034045f2e82e954cad452dc90212d1652687aa2a65e8bb50fc2447c1c89a height=10
    1632024-05-12T20:06:19Z UpdateTip: new best=0000034045f2e82e954cad452dc90212d1652687aa2a65e8bb50fc2447c1c89a height=10 version=0x20000000 log2_work=25.665536 tx=11 date='2024-05-12T20:06:19Z' progress=1.000000 cache=0.3MiB(10txo)
    1642024-05-12T20:06:19Z [miner] AddToWallet 6f736e3a9295276d8541af8b1554765c53c1cd211de188576dcf85042443a902  new Confirmed (block=0000034045f2e82e954cad452dc90212d1652687aa2a65e8bb50fc2447c1c89a, height=10, index=0)
    1652024-05-12T20:15:45Z CreateNewBlock(): block weight: 800 txs: 0 fees: 0 sigops 400
    1662024-05-12T20:15:45Z Saw new header hash=000001e931d1bab82b80508af105ee883b26cfc2589e698b88d02fa0524c3261 height=11
    1672024-05-12T20:15:45Z UpdateTip: new best=000001e931d1bab82b80508af105ee883b26cfc2589e698b88d02fa0524c3261 height=11 version=0x20000000 log2_work=25.791067 tx=12 date='2024-05-12T20:15:44Z' progress=1.000000 cache=0.3MiB(11txo)
    1682024-05-12T20:15:45Z [miner] AddToWallet 3b617646170837d3b5377c54119a1034cf61ac849a29dff361b4697487de9f55  new Confirmed (block=000001e931d1bab82b80508af105ee883b26cfc2589e698b88d02fa0524c3261, height=11, index=0)
    1692024-05-12T20:16:05Z CreateNewBlock(): block weight: 800 txs: 0 fees: 0 sigops 400
    1702024-05-12T20:16:06Z Saw new header hash=000002a464fb658d450bafcde453d6ab247c6141aceaa4b120f852c889d869e0 height=12
    1712024-05-12T20:16:06Z UpdateTip: new best=000002a464fb658d450bafcde453d6ab247c6141aceaa4b120f852c889d869e0 height=12 version=0x20000000 log2_work=25.906544 tx=13 date='2024-05-12T20:25:44Z' progress=1.000000 cache=0.3MiB(12txo)
    1722024-05-12T20:16:06Z [miner] AddToWallet ddc800c6bd38c6b60ac44e6e70ee79b8c79aedf7a8376423f34b1a1e93967303  new Confirmed (block=000002a464fb658d450bafcde453d6ab247c6141aceaa4b120f852c889d869e0, height=12, index=0)
    1732024-05-12T20:35:44Z CreateNewBlock(): block weight: 800 txs: 0 fees: 0 sigops 400
    1742024-05-12T20:35:44Z Saw new header hash=0000020cdce998ed1e0a0d96df2b97dfa660a4823a963ba0992a7259ead0ecc1 height=13
    1752024-05-12T20:35:44Z UpdateTip: new best=0000020cdce998ed1e0a0d96df2b97dfa660a4823a963ba0992a7259ead0ecc1 height=13 version=0x20000000 log2_work=26.013459 tx=14 date='2024-05-12T20:35:44Z' progress=1.000000 cache=0.3MiB(13txo)
    1762024-05-12T20:35:44Z [miner] AddToWallet 76045901e6f5d4064eda470f86cb76c564632202385c1d49535a5e54a4f5fa0f  new Confirmed (block=0000020cdce998ed1e0a0d96df2b97dfa660a4823a963ba0992a7259ead0ecc1, height=13, index=0)
    1772024-05-12T20:38:24Z Flushed fee estimates to fee_estimates.dat.
    1782024-05-12T20:45:44Z CreateNewBlock(): block weight: 800 txs: 0 fees: 0 sigops 400
    1792024-05-12T20:45:44Z Saw new header hash=0000020fb9b671e6b8b606290f8e418d39f39596c1831defadc35aa590f00f67 height=14
    1802024-05-12T20:45:44Z UpdateTip: new best=0000020fb9b671e6b8b606290f8e418d39f39596c1831defadc35aa590f00f67 height=14 version=0x20000000 log2_work=26.112995 tx=15 date='2024-05-12T20:45:44Z' progress=1.000000 cache=0.3MiB(14txo)
    1812024-05-12T20:45:44Z [miner] AddToWallet 26cc2eb8928ea5fb48a95d7793f3ddce79f15b1a6ddf0ff575fa197242d34244  new Confirmed (block=0000020fb9b671e6b8b606290f8e418d39f39596c1831defadc35aa590f00f67, height=14, index=0)
    

    How did you obtain Bitcoin Core

    Compiled from source

    What version of Bitcoin Core are you using?

    v27.0

    Operating system and version

    MacOS Sonoma 14.4

    Machine specifications

    Macbook Pro 14-inch, Nov 2023 Apple M3 Pro Memory 18GB

    No other heavy processes running in the machine.

  2. willcl-ark commented at 9:43 pm on May 12, 2024: member

    Thanks for the detailed report @edilmedeiros !

    I can confirm that I see the same behaviour as you running a custom signet, where even after (allegedly) calibrating to an nbits targetting --seconds=600, I get 2m30s blocks:

    02024-05-12 21:59:49 INFO Mined block at height 100; next in -2m58s (mine)
    12024-05-12 21:59:50 INFO Mined block at height 101; next in -29s (mine)
    22024-05-12 21:59:50 INFO Mined block at height 102; next in 2m0s (mine)
    32024-05-12 22:01:51 INFO Mined block at height 103; next in 2m29s (mine)
    42024-05-12 22:04:24 INFO Mined block at height 104; next in 2m26s (mine)
    52024-05-12 22:06:51 INFO Mined block at height 105; next in 2m29s (mine)
    

    Regarding the wiki updates, you could try joining the libera chat #bitcoin-wiki and request edit permissions.

    Failing that, it could perhaps be useful to in any case include information on creating a custom signet using descriptor wallets as a new section in contrib/signet/README.md, so that approach may also make sense ?

    Thanks for finding, reporting and offering to take a look into the root cause :)

  3. edilmedeiros commented at 10:05 pm on May 12, 2024: contributor

    Failing that, it could perhaps be useful to in any case include information on creating a custom signet using descriptor wallets as a new section in contrib/signet/README.md, so that approach may also make sense ?

    I’m already documenting so in my site, I can post it here when done. If there’s consensus, I can also open a PR for extending this piece of documentation.

  4. pinheadmz commented at 10:43 pm on May 12, 2024: member
    @edilmedeiros this might be expected behavior although not well documented. If I recall, the signet miner generates the first 100 blocks as fast as possible with 100% CPU (to cross coinbase maturity) so you can start spending signet coins right away. It will eventually retarget to your configured difficulty. If you’re able to, I’d let your process run at least 2,016 blocks and then check if its acting as expected.
  5. pinheadmz commented at 10:44 pm on May 12, 2024: member
    For the descriptor wallet question, I ran a custom signet for an educational program earlier this year and wrote a script that created a descriptor wallet in regtest, then spawned signet with that descriptor: https://github.com/chaincodelabs/signet-wallet-project/blob/main/signet-setup.py
  6. edilmedeiros commented at 10:57 pm on May 12, 2024: contributor

    @edilmedeiros this might be expected behavior although not well documented. If I recall, the signet miner generates the first 100 blocks as fast as possible with 100% CPU (to cross coinbase maturity) so you can start spending signet coins right away. It will eventually retarget to your configured difficulty. If you’re able to, I’d let your process run at least 2,016 blocks and then check if its acting as expected.

    I was running this way after the 100 block threshold when I perceived this behavior, but I’ll let it run to see what happens. I spawned a new issuer node to check my config and then another to take the messages to report the issue.

    Yet, this doesn’t explain the 2m29 interval I and Will are getting, probably in hardware with very different resources. Really seems to me that there’s something funky going on with the timing calculation.

    For the descriptor wallet question, I ran a custom signet for an educational program earlier this year and wrote a script that created a descriptor wallet in regtest, then spawned signet with that descriptor: https://github.com/chaincodelabs/signet-wallet-project/blob/main/signet-setup.py

    I was in the chaincode cohort and studying your script was key to make my setup work. It uses --min-nbits and run with the 10m interval from the very beginning (and I recall it running like a swiss clock in the 10m interval).

    Anyway, I think this topic of setting a custom signet up deserves a piece of documentation explaining the process so people could not only make it work but also understand the process. That’s what I’m writing here.

  7. ajtowns commented at 6:40 am on May 13, 2024: contributor

    The --nbits value sets the desired difficulty; to reach that desired difficulty when the target difficulty is lower, blocks need to be mined faster than normal. Since the maximum difficulty increase is 4x, the block rate will be at most 4x faster than normal, ie 2m30s instead of 10m. Setting –min-nbits is saying “I don’t need the difficulty to increase” which implies just mining a block every 10 minutes is fine since the chain starts at a difficulty matching min nbits.

    The fast mining of the initial 100 blocks is achieved by backdating block number one by 100 times the block interval (so 250 minutes if blocks are 2.5m apart), then mining blocks timestamped at regular intervals until it catches up with the current time.

    You probably don’t want 600s mining time – you’ll be constantly using 100% cpu across all cores in that case. Mining time is how much CPU you use once difficulty has reached your desired level, not how long the time is between blocks.

  8. ajtowns commented at 6:44 am on May 13, 2024: contributor
    (Signet adopts essentially the same rules as mainnet, so the only way to sustain blocks that are more frequent than once every 10 minutes is to continually raise the difficulty, which results in real costs, or to make use of the timewarp bug)
  9. willcl-ark commented at 7:54 am on May 13, 2024: member

    Ah I see!

    So the 2:30 block times are expected then, and at the first difficulty adjustment I would be expecting the difficulty to increase to such a point that it would take my CPU 600 seconds to generate a block.

    I did discuss this possiblilty with @pinheadmz late last night, but was too impatient to let my signet miner run to an adjustment to find out. Thanks @ajtowns

  10. ajtowns commented at 9:22 am on May 13, 2024: contributor

    So the 2:30 block times are expected then, and at the first difficulty adjustment I would be expecting the difficulty to increase to such a point that it would take my CPU 600 seconds to generate a block.

    I think you’ve got NBITS=1d00ac8d, which if my math is correct is ~1300 times more difficult than the min signet difficulty, which should take ~5 retarget periods to achieve. The 6th one would run at about 7m46s per block; for a total of ~28 days to ramp up the difficulty. (If you backdated the first block to be 30 days ago, you’d burn through this as fast as your cpu could handle)

    0def nbits2target(nbits):
    1    return (nbits & 0xFFFFFF) * 256**((nbits >> 24)-3)
    2
    3nbits2target(0x1e0377ae)/nbits2target(0x1d00ac8d)
    4# 1316.9804179023386
    
  11. edilmedeiros commented at 6:23 pm on May 13, 2024: contributor

    @ajtowns Thanks for the explanation, the miner behavior makes a lot more sense now.

    I did a “quick” experiment this morning: started a new signet with the first block starting a month ago. My CPU went close to 100% using all available cores.

     02024-05-13 13:06:47 INFO Mined block at height 2; next in -717h26m32s (mine)
     12024-05-13 13:06:47 INFO Mined block at height 3; next in -717h24m2s (mine)
     22024-05-13 13:06:47 INFO Mined block at height 4; next in -717h21m32s (mine)
     32024-05-13 13:06:48 INFO Mined block at height 5; next in -717h19m3s (mine)
     42024-05-13 13:06:48 INFO Mined block at height 6; next in -717h16m33s (mine)
     52024-05-13 13:06:48 INFO Mined block at height 7; next in -717h14m3s (mine)
     62024-05-13 13:06:48 INFO Mined block at height 8; next in -717h11m33s (mine)
     72024-05-13 13:06:48 INFO Mined block at height 9; next in -717h9m3s (mine)
     82024-05-13 13:06:49 INFO Mined block at height 10; next in -717h6m34s (mine)
     92024-05-13 13:06:49 INFO Mined block at height 11; next in -717h4m4s (mine)
    102024-05-13 13:06:50 INFO Mined block at height 12; next in -717h1m35s (mine)
    112024-05-13 13:06:50 INFO Mined block at height 13; next in -716h59m5s (mine)
    122024-05-13 13:06:50 INFO Mined block at height 14; next in -716h56m35s (mine)
    132024-05-13 13:06:50 INFO Mined block at height 15; next in -716h54m5s (mine)
    142024-05-13 13:06:50 INFO Mined block at height 16; next in -716h51m35s (mine)
    152024-05-13 13:06:50 INFO Mined block at height 17; next in -716h49m5s (mine)
    
     02024-05-13 15:02:52 INFO Mined block at height 6612; next in -443h57m37s (mine)
     12024-05-13 15:03:06 INFO Mined block at height 6613; next in -443h55m21s (mine)
     22024-05-13 15:03:11 INFO Mined block at height 6614; next in -443h52m56s (mine)
     32024-05-13 15:03:15 INFO Mined block at height 6615; next in -443h50m30s (mine)
     42024-05-13 15:03:24 INFO Mined block at height 6616; next in -443h48m8s (mine)
     52024-05-13 15:03:27 INFO Mined block at height 6617; next in -443h45m42s (mine)
     62024-05-13 15:03:36 INFO Mined block at height 6618; next in -443h43m21s (mine)
     72024-05-13 15:03:42 INFO Mined block at height 6619; next in -443h40m57s (mine)
     82024-05-13 15:03:50 INFO Mined block at height 6620; next in -443h38m35s (mine)
     92024-05-13 15:03:51 INFO Mined block at height 6621; next in -443h36m6s (mine)
    102024-05-13 15:04:09 INFO Mined block at height 6622; next in -443h33m54s (mine)
    112024-05-13 15:04:11 INFO Mined block at height 6623; next in -443h31m25s (mine)
    

    Seems that it will eventually converge to the 10 minute average. I’ll let it run a little more out of curiosity.

    Yet, I feel the documentation could be improved to explain this behavior: the mining time is controlled:

    1. by the difficulty + resources available; and
    2. by an internal timer the miner script keep.

    That is:

    • If resources abound, the internal timer tries to keep mining at the 10 minute interval;
    • If resources constrain, the internal timer gets out of the way as we can see in the above snippets.
    • Not only, the timer does its job by trying to mimic the difficulty adjustment rules of the network.

    I’ll study the source code and sketch something in a PR.

    Another thing, it doesn’t seem to exist an option to control the miner’s internal “timer”. That is, suppose I want to mine every minute instead of every 10 minutes. Now I see I can set the initial block unix time appropriately and the difficulty accordingly and it will eventually converge to that. But it will use all hardware resources to do so.

    Another option would be able to use --min-nbits to keep resource usage low and have, e.g., --seconds (or a new option) to set how long it will delay to mine a new block.

    What do you think of this idea?

    I think the timer will eventually break with such a config since the network rules restrict the valid range of new block’s times and thus how fast or slow the network can go. Yet, I believe it can be a valuable feature for educational settings like the cohort @pinheadmz helped running, and for research purposes.

  12. willcl-ark commented at 10:59 am on May 14, 2024: member

    @edilmedeiros I don’t think there’s anything to do here; contrib/signet/miner works as expected. Would you agree this issue can be closed now?

    If you have some code changes I’d be happy to review them in a future pull request.

  13. edilmedeiros closed this on May 14, 2024

  14. ajtowns commented at 1:40 pm on May 14, 2024: contributor

    Another thing, it doesn’t seem to exist an option to control the miner’s internal “timer”. That is, suppose I want to mine every minute instead of every 10 minutes.

    The nbits options exist to control the miner’s internal timer – if you were to mine every minute instead of every 10 minutes, that will increase the difficulty until you run out of hashpower, at which point you’ll be running your computer at full power 24/7 and end up getting blocks every 10 minutes. The “no matter how much hashpower you dedicate, you end up with blocks every 10 minutes” is the consensus rule, the only thing you get to choose is how you react to that: dedicate more hashpower and end up with a higher difficulty (and more frequent blocks in the short term) or less hashpower and end up with a lower difficulty (and fewer blocks in the short term).

    I think there are three things you could potentially do to get around this:

    • change the consensus rule to something else (eg #29365)
    • have the miner operate irregularly – when there’s txs in the mempool, mine more frequently, when there aren’t mine less frequently, but still with a long term 10 minute average
    • use the timewarp bug to mine more often than 10 minutes without increasing difficulty

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-09-29 01:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me