Git Product home page Git Product logo

bitcoin-core-test-the-test's Introduction

Bitcoin Core: Test The Test

The goal of these exercises is to learn the Bitcoin Core development environment through the Bitcoin Test Framework.

Set Up

  1. Clone the Bitcoin Core repository
  2. Checkout the v26.0 tag (commit 44d8b13c81e5276eb610c99f227a4d090cc532f6)
  3. Build Bitcoin Core
    • The docs in the repo should provide sufficient guidance for this
    • If you have any problems, search the issues on GitHub or try Bitcoin Stack Exchange
    • Recommended minimal configure options:
      • ./configure --disable-bench --disable-fuzz-binary --enable-debug --without-gui --enable-suppress-external-warnings
  4. Run all the functional tests
    • All tests should pass!
    • You may be able to speed up the test suite using a RAM disk

Challenge

  1. Choose a target test from https://github.com/bitcoin/bitcoin/tree/44d8b13c81e5276eb610c99f227a4d090cc532f6/test/functional
  2. Write a minimal commit in src/ (*.cpp or *.h files only) that makes this one single test fail, and no others!
    • You can ignore "skipped" tests
  3. Submit your commit as a diff using git show <commit hash>
  • You do NOT need to run the unit tests or the extended tests (test_runner --extended) for this exercise.

Example

Target test

test/functional/feature_abortnode.py

Commit

commit 14683cab0e91f1e7984c61fb4b8b74574fb4b339
Author: Matthew Zipkin <[email protected]>
Date:   Sat Dec 30 13:04:24 2023 +0000

    make feature_abortnode.py fail

diff --git a/src/validation.cpp b/src/validation.cpp
index a6cab6b095..df093c9c34 100644
--- a/src/validation.cpp
+++ b/src/validation.cpp
@@ -3074,7 +3074,7 @@ bool Chainstate::ActivateBestChainStep(BlockValidationState& state, CBlockIndex*
             // If we're unable to disconnect a block during normal operation,
             // then that is a failure of our local system -- we should abort
             // rather than stay on a less work chain.
-            FatalError(m_chainman.GetNotifications(), state, "Failed to disconnect block; see debug.log for details");
+            // FatalError(m_chainman.GetNotifications(), state, "Failed to disconnect block; see debug.log for details");
             return false;
         }
         fBlocksDisconnected = true;

Functional test results

Example output (truncated):

...
wallet_txn_doublespend.py --mineblock                  | ✓ Passed  | 3 s
wallet_watchonly.py --legacy-wallet                    | ✓ Passed  | 3 s
wallet_watchonly.py --usecli --legacy-wallet           | ✓ Passed  | 3 s
...
wallet_backwards_compatibility.py --legacy-wallet      | ○ Skipped | 0 s
wallet_inactive_hdchains.py --legacy-wallet            | ○ Skipped | 0 s
wallet_upgradewallet.py --legacy-wallet                | ○ Skipped | 0 s
feature_abortnode.py                                   | ✖ Failed  | 6 s

ALL                                                    | ✖ Failed  | 4009 s (accumulated) 
Runtime: 714 s

bitcoin-core-test-the-test's People

Contributors

pinheadmz avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.