Assertion pindexPrev && pindexPrev == chainstate.m_chain.Tip() when running regtest #31562

issue dkatzan openend this issue on December 24, 2024
  1. dkatzan commented at 1:20 pm on December 24, 2024: none

    Is there an existing issue for this?

    • I have searched the existing issues

    Current behaviour

    I’m running a regtest chain in my CI\CD for some tests, occasionally, I will see my bitcoind fail with an assertion Assertion failed: pindexPrev && pindexPrev == chainstate.m_chain.Tip() (validation.cpp: TestBlockValidity: 4338)

    Expected behaviour

    The node to be stable and not crash

    Steps to reproduce

    I don’t have steps to reproduce, this happens very rearily as part of our CI\CD that runs a simple regtest chains, mines a few blocks, makes a few transactions and managing a few wallets

    Relevant log output

    No response

    How did you obtain Bitcoin Core

    Package manager

    What version of Bitcoin Core are you using?

    27.0-r1

    Operating system and version

    alpine:3.18

    Machine specifications

    I’m building an alpine image version 3.18 and installing bitcoin in my docker file as such

    0RUN apk add bitcoin=25.1-r1 --repository=https://dl-cdn.alpinelinux.org/alpine/v3.19/community
    1RUN apk add bitcoin-cli
    

    since 25 is now a bit old, I tried bumping the version, so I’m now running

    0RUN apk add bitcoin=25.1-r1 --repository=https://dl-cdn.alpinelinux.org/alpine/v3.19/community
    1RUN apk add bitcoin-cli
    

    but the issue persisted

  2. maflcko added the label Bug on Dec 24, 2024
  3. maflcko added the label Mining on Dec 24, 2024
  4. maflcko removed the label Mining on Dec 24, 2024
  5. maflcko added the label Tests on Dec 24, 2024
  6. maflcko commented at 2:28 pm on December 24, 2024: member

    I don’t have steps to reproduce, this happens very rearily as part of our CI\CD that runs a simple regtest chains, mines a few blocks, makes a few transactions and managing a few wallets

    Thanks for the report! I presume, you are calling the test-only generateblock RPC? If not, it would be good to have minimal reproducer, or a link to a log of the CI run, or the test code that hit the issue. Without a log or anything to reproduce, it will be harder to see where the bug happened.

  7. dkatzan commented at 3:07 pm on December 24, 2024: none

    Yep, I’m calling generateblock multiple times my tests are also running concurrently, so it might be called concurrently

    here are the latest logs I have from before the crash extract-2024-12-24T14_43_27.491Z.csv

  8. maflcko commented at 3:13 pm on December 24, 2024: member
    Thx, #https://github.com/bitcoin/bitcoin/pull/31563 should fix the assert crash
  9. dkatzan commented at 3:28 pm on December 24, 2024: none
    Thx alot! so is this expected to reach the next release cycle? which version will it be included in?
  10. ismaelsadeeq commented at 4:10 pm on December 24, 2024: member

    so is this expected to reach the next release cycle? which version will it be included in?

    After it is reviewed and merged yes it will be available in the next release. You can check #31029 for the plans regarding the next release.
    You can also volunteer to test and ensure that #31563 addresses your issue.

  11. davidgumberg referenced this in commit f030d896ff on Dec 25, 2024
  12. davidgumberg referenced this in commit 71577a8b3c on Dec 25, 2024
  13. davidgumberg referenced this in commit 1d456f726d on Dec 25, 2024
  14. davidgumberg referenced this in commit 969194ddf5 on Dec 25, 2024
  15. achow101 closed this on Dec 30, 2024

  16. Sjors referenced this in commit 87c9ebd889 on Dec 30, 2024
  17. mzumsande commented at 5:32 pm on January 3, 2025: contributor

    Thx alot! so is this expected to reach the next release cycle? which version will it be included in?

    Looks like it will already be fixed in 28.1 (backport PR #31594) which should be released soon.


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: 2025-01-21 06:12 UTC

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