Hot answers tagged

13 votes
Accepted

Is there a sandbox in bitcoin for testing?

Testnet is really heavy (hundreds of gigabytes), there is a lighter alternative to that now: signet. There is also a local-only network called regtest, which I put in its own section. Finally, I'll ...
Janus Troelsen's user avatar
8 votes
Accepted

How does bitcoin functional test framework work?

The functional tests test the RPCs. The unit tests test the C++ code directly by calling the functions. The functional test frameworks uses a version of python-bitcoinrpc which can be found here. ...
Ava Chow's user avatar
  • 70.1k
8 votes
Accepted

Is it advisable to operate a release candidate full node on mainnet?

Running release candidates poses little to no danger to the network. The node software is designed to be highly self-reliant, at worst a node would ignore incorrect information and disconnect another ...
Murch's user avatar
  • 74.5k
7 votes

Does each bitcoin node do Continuous Integration? Is this merely the process of the node syncing with the network? What is involved with it?

Continuous integration is a paradigm used in software development. In the context of the Bitcoin Core software repository, it specifically refers to the automated testing setup: all changes and ...
Pieter Wuille's user avatar
6 votes
Accepted

I would like to dig into the open Taproot PR to understand it, test it and possibly even review it. Any advice or recommendations?

Previous Bitcoin Core PR review club sessions A good starting point is the various Bitcoin Core PR review club sessions that have been held thus far on specific commits of the Taproot PR. The latest ...
Michael Folkson's user avatar
5 votes
Accepted

How can I analyze the test coverage of the Bitcoin Core codebase?

Marco Falke has a site that analyzes the current line, function and branch coverage for unit tests, functional tests and fuzz tests. Alternatively, vasild runs clang's tools and then a script to ...
Michael Folkson's user avatar
5 votes

Is it advisable to operate a release candidate full node on mainnet?

There is basically no risk to the network, as it's designed to resist even malicious actors, much less honest users just running untested software. There is some risk to you as the user if you use the ...
Vojtěch Strnad's user avatar
4 votes

How thoroughly has Segregated Witness been tested?

I'd suggest starting here: https://bitcoincore.org/en/2015/12/23/capacity-increases-faq/. There's also a SegWit adoption page on the site somewhere. Finally, this article has some details on recent ...
Нонн Болдырев's user avatar
4 votes

How can I analyze the test coverage of the Bitcoin Core codebase?

If your intention is to contribute to Bitcoin Core, you must be able to build these reports locally. So that you can compare if your changes have been effective at increasing coverage. The general ...
givanse's user avatar
  • 230
4 votes
Accepted

What is structured fuzzing and is the fuzzing that Bitcoin Core does currently considered structured?

I'll use the definitions used in this presentation from Jonathan Metzman at Black Hat 2019 but obviously this is a relatively new field and so there may well be disagreement amongst researchers and ...
Michael Folkson's user avatar
4 votes

Is it advisable to operate a release candidate full node on mainnet?

As its name suggests, it is not recommended to run a release candidate in production if you are not sure what you are doing. However Bitcoin Core release candidates aim to meet high quality standards. ...
Antoine Poinsot's user avatar
3 votes

I have written a test for an open Bitcoin Core PR. Should I open a PR to the author's fork or wait for it to be merged?

It depends on the situation. When the change is a few lines of code it is sufficient to show the author the patch and they will amend the pull request. You can do this using a ``` diff in the comments ...
Michael Folkson's user avatar
3 votes
Accepted

Can someone explain the output from running Bitcoin Core unit tests on Mac OS please?

This is the output for all platforms at the moment, not just MacOS. To paraphrase from sipa on IRC: The first summary is bitcoin's own summary: because of some hackery to run unit tests in parallel, ...
wumpus's user avatar
  • 311
3 votes
Accepted

How thoroughly has Segregated Witness been tested?

Summarized from Bitcoin Core's Segregated Witness announcement: The original version of SegWit was implemented in April through June 2015 for the Elements Project. It has facilitated every ...
Murch's user avatar
  • 74.5k
3 votes
Accepted

Which altcoin would be the easiest to fork a cryptocurrency from for educational purposes?

You could take a look at Jeremy Rubin's TinyCoin: https://github.com/JeremyRubin/tinycoin It is, exactly as the name suggests, a very small cryptocurrency written in python which is designed purely ...
meshcollider's user avatar
  • 11.8k
3 votes
Accepted

Any idea how to download a small part of the chain for testing purposes?

If you know what hashes of the blocks you want, you can use the P2P protocol to connect to a node and request those specific blocks. However, you cannot just do that with block heights as the block's ...
Ava Chow's user avatar
  • 70.1k
3 votes
Accepted

What is fuzz testing?

In the paper The Art, Science and Engineering of Fuzzing the authors define fuzzing as “a process of repeatedly running a program with generated inputs that may be syntactically or semantically ...
Michael Folkson's user avatar
3 votes
Accepted

How can I simulate a reorg for testing?

I was able to successfully get electrs to change a transaction from confirmed to unconfirmed by using a second mining node, as suggested by Murch on twitter. My test setup looks like this: electrum -&...
Not Mandatory's user avatar
3 votes
Accepted

What is the history on how previous soft forks were tested prior to being considered for activation?

AJ Towns answered this on the bitcoin-dev mailing list. p2sh was briefly tested on testnet (and an alternative was tested on mainnet) https://bitcointalk.org/index.php?topic=58579.msg786939#...
Michael Folkson's user avatar
2 votes

Any idea how to download a small part of the chain for testing purposes?

As far as I know, there is no way to download arbitrary blocks (although I suspect it's not too hard to do if you implement your own client). If you just want blocks for testing, you won't have much ...
Raghav Sood's user avatar
2 votes
Accepted

What is the simplest command I could use to test that my wallet unlocking process works properly?

You can sign a message using the signmessage command. Note that this only works if you are using legacy addresses (Bitcoin Core currently defaults to p2sh-segwit addresses which cannot be used to sign ...
Ava Chow's user avatar
  • 70.1k
2 votes
Accepted

Debugging Bitcoin Core with gdb - how to turn off compiler optimizations

Bitcoin Core disables -O2 and enables -Og when --enable-debug is set. -Og is intended for debugging; however, it removes some of the debugging information and is buggy. To disable it and to improve ...
MCCCS's user avatar
  • 10.2k
2 votes

Where can I get bigger amount of test BTC?

If you need 100 coins, you should use regtest mode, this is a message from a faucet website: Please do not ask me to send a coin outside the faucet! My stocks of coins are shrinking and ...
Luong Nguyen's user avatar
2 votes
Accepted

Should I run the tests every time I review an open Bitcoin Core PR?

The Bitcoin Core contributing guidelines recommend that post Concept ACK, Approach ACK: A review begins with ACK BRANCH_COMMIT, where BRANCH_COMMIT is the top of the PR branch, followed by a ...
Michael Folkson's user avatar
2 votes
Accepted

What is an uninitialized read? Can you point out some examples found in Bitcoin Core? How do you detect them?

An uninitialized read is when a variable is created without an initial value and then the value of this variable is read. This should be avoided as the resulting behavior is unpredictable and could be ...
Michael Folkson's user avatar
2 votes

Setting the fee rate on regtest, or, quickly generating full blocks

You can use a wrapper to mock the feerate. Let's say you are writing your tests in Python. You can set up a Python RPC wrapper for the bitcoind interface, and optionally turn on a mock for specific ...
Antoine Poinsot's user avatar
2 votes

Setting the fee rate on regtest, or, quickly generating full blocks

I have created a bash script that is less complex than the Python script that @darosior references, but is heavily influenced by it. It keeps creating sets of 10-30 transactions until estimatesmartfee ...
gijswijs's user avatar
  • 285
2 votes
Accepted

What is lnprototest exactly? Can it be used to test an individual Lightning implementation or just interoperability between implementations?

Rusty Russell discussed lnprototest (repo link) during the August 2020 Sydney Socratic Seminar. What is lnprototest exactly? It is a pure Python3 test system and some packages to interface with the ...
Michael Folkson's user avatar
2 votes
Accepted

Tests for Pay To Taproot addresses?

Meanwhile, BIP341 has been updated to link to a set of test vectors covering scriptPubKey computation, keypath spending, and control block construction.
Murch's user avatar
  • 74.5k
1 vote
Accepted

Property based tests have been added to Bitcoin Core. What are they and could they replace some of the unit tests in Bitcoin Core?

I think this is a fair summary. I would hesitate to phase out unit tests, rather supplement them with property based tests. In a library I maintain called bitcoin-s we use them in tandem. Concepts ...
Chris Stewart's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible