bitcoin.conf assumevalid=0 does not seem to be working #16268

issue Linrono opened this issue on June 22, 2019
  1. Linrono commented at 3:31 PM on June 22, 2019: contributor

    <!-- This issue tracker is only for technical issues related to Bitcoin Core. General bitcoin questions and/or support requests are best directed to the Bitcoin StackExchange at https://bitcoin.stackexchange.com. For reporting security issues, please read instructions at https://bitcoincore.org/en/contact/. If the node is "stuck" during sync or giving "block checksum mismatch" errors, please ensure your hardware is stable by running memtest and observe CPU temperature with a load-test tool such as linpack before creating an issue! -->

    <!-- Describe the issue -->

    assumevalid=0 does not seem to work when it is in the bitcoin.conf file but does when set as a cli argument.

    <!--- What behavior did you expect? -->

    I thought setting this in the config file would be enough to set this value.

    <!--- What was the actual behavior (provide screenshots if the issue is GUI-related)? -->

    When set in the config file, the log says it is still using the default hex value. It does work when set as a command line argument. Screenshot from 2019-06-22 11-13-43 Screenshot from 2019-06-22 11-13-26 Screenshot from 2019-06-22 11-08-37

    <!--- How reliably can you reproduce the issue, what are the steps to do so? -->

    Just setting the config option without the command line argument recreates the issue. I did test my config file by removing the dbcache setting and that was reflected in the logs. Screenshot from 2019-06-22 11-26-23 Screenshot from 2019-06-22 11-26-32

    <!-- What version of Bitcoin Core are you using, where did you get it (website, self-compiled, etc)? -->

    I am using the downloaded release version 18.0.

    <!-- What type of machine are you observing the error on (OS/CPU and disk type)? -->

    I am using a laptop with Ubuntu and a platter hard drive.

    <!-- For the GUI-related issue on Linux provide names and versions of a distro, a desktop environment and a graphical shell (if relevant). -->

    <!-- Any extra information that might be useful in the debugging process. -->

    <!--- This is normally the contents of a `debug.log` or `config.log` file. Raw text or a link to a pastebin type site are preferred. -->

  2. MarcoFalke added the label good first issue on Jun 22, 2019
  3. MarcoFalke commented at 3:35 PM on June 22, 2019: member

    Could just be an issue that might be fixed by moving the print statement after the config files and include files have been parsed?

  4. gertjaap commented at 1:00 PM on June 24, 2019: contributor

    I have just tried this, and I cannot reproduce it:

    gertjaap@gjdesktop:~/src/bitcoin$ cat ~/.bitcoin/bitcoin.conf
    assumevalid=0
    gertjaap@gjdesktop:~/src/bitcoin$ bitcoind
    2019-06-24T13:00:03Z Bitcoin Core version v0.18.0.0-g2472733a24a9364e4c6233ccd04166a26a68cc65 (release build)
    2019-06-24T13:00:03Z Validating signatures for all blocks.
    

    Are you sure the bitcoin.conf file is in the correct folder?

  5. MarcoFalke added the label Questions and Help on Jun 24, 2019
  6. MarcoFalke removed the label good first issue on Jun 24, 2019
  7. Linrono commented at 12:38 AM on June 29, 2019: contributor

    @MarcoFalke That could fix it, I am not sure. I haven't really dived into the code for this. @gertjaap Yes I am sure my bitcoin.conf is in the correct folder, I had tested it with the dbcache setting with my last two screenshots.

  8. Linrono commented at 1:22 AM on June 29, 2019: contributor

    Screenshot from 2019-06-28 21-04-50

    Does this help show my setup?

  9. Linrono commented at 2:37 AM on June 29, 2019: contributor

    I have been trying to figure this out in the code. It looks like bitcoind.cpp calls ReadConfigFiles() which loads the config file before it calls AppInitParameterInteraction() which seems to be where this line in the output comes from so we can't move it after the loading of the config file because it already is. AppInitParameterInteraton() starts using hashAssumeValid at line 1042 in init.cpp. It calls GetArg with -assumevalid and the default value. It should either return the number 0 or the string 0. Instead, it is pulling the value from chainparams.cpp. I can not seem to figure out why. I do not see any obvious changes to init.cpp since the release I am using that would affect this.

  10. gertjaap commented at 12:53 PM on July 3, 2019: contributor

    @Linrono tried with the exact same settings, but can't reproduce it.

    gertjaap@gjdesktop:~$ cat ~/.bitcoin/bitcoin.conf
    assumevalid=0
    server=1
    txindex=1
    dbcache=2000
    gertjaap@gjdesktop:~$ bitcoind
    2019-07-03T12:51:36Z Bitcoin Core version v0.18.0.0-g2472733a24a9364e4c6233ccd04166a26a68cc65 (release build)
    2019-07-03T12:51:36Z Validating signatures for all blocks.
    2019-07-03T12:51:36Z Setting nMinimumChainWork=0000000000000
    

    Could you do hexdump ~/.bitcoin/bitcoin.conf just to ensure there's nothing funky in the file i'm not reproducing?

  11. Linrono commented at 11:51 PM on July 4, 2019: contributor

    Screenshot from 2019-07-04 19-46-09 I'm sorry I'm using screenshots, I don't know how to do the horizontal quote boxes. Is it with the grave marks? (`)

  12. hebasto commented at 2:50 AM on July 5, 2019: member

    @Linrono

    I'm sorry I'm using screenshots, I don't know how to do the horizontal quote boxes. Is it with the grave marks? (`)

    https://help.github.com/en/articles/basic-writing-and-formatting-syntax#quoting-code

  13. Linrono commented at 4:38 AM on July 9, 2019: contributor
    linrono@toaster:~$ hexdump /home/linrono/.bitcoin/bitcoin.conf 
    0000000 bbef 61bf 7373 6d75 7665 6c61 6469 303d
    0000010 730a 7265 6576 3d72 0a31 7874 6e69 6564
    0000020 3d78 0a31 6264 6163 6863 3d65 3032 3030
    0000030 000a                                   
    0000031
    linrono@toaster:~$ cat /home/linrono/.bitcoin/bitcoin.conf 
    assumevalid=0
    server=1
    txindex=1
    dbcache=2000
    linrono@toaster:~$ bitcoind
    2019-07-09T04:35:52Z Bitcoin Core version v0.18.0 (release build)
    2019-07-09T04:35:52Z Assuming ancestors of block 0000000000000000000f1c54590ee18d15ec70e68c8cd4cfbadb1b4f11697eee have valid signatures.
    2019-07-09T04:35:52Z Setting nMinimumChainWork=0000000000000000000000000000000000000000051dc8b82f450202ecb3d471
    2019-07-09T04:35:52Z Using the 'sse4(1way),sse41(4way)' SHA256 implementation
    2019-07-09T04:35:53Z Default data directory /home/linrono/.bitcoin
    2019-07-09T04:35:53Z Using data directory /home/linrono/.bitcoin
    2019-07-09T04:35:53Z Config file: /home/linrono/.bitcoin/bitcoin.conf
    

    There we go, thanks.

  14. Linrono commented at 11:41 PM on July 9, 2019: contributor

    @gertjapp You called it. Ended up being something wrong with the line that caused it to not work. I'm not sure how I did that. Thank you for you guys' help.

  15. Linrono closed this on Jul 9, 2019

  16. MarcoFalke locked this on Dec 16, 2021

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: 2026-04-21 18:14 UTC

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