Permalink
Commits on Apr 19, 2016
Commits on Sep 30, 2015
  1. Support very-fast-running benchmarks

    gavinandresen committed Sep 29, 2015
    Avoid calling gettimeofday every time through the benchmarking loop, by keeping
    track of how long each loop takes and doubling the number of iterations done
    between time checks when they take less than 1/16'th of the total elapsed time.
  2. Simple benchmarking framework

    gavinandresen committed Sep 24, 2015
    Benchmarking framework, loosely based on google's micro-benchmarking
    library (https://github.com/google/benchmark)
    
    Wny not use the Google Benchmark framework? Because adding Even More Dependencies
    isn't worth it. If we get a dozen or three benchmarks and need nanosecond-accurate
    timings of threaded code then switching to the full-blown Google Benchmark library
    should be considered.
    
    The benchmark framework is hard-coded to run each benchmark for one wall-clock second,
    and then spits out .csv-format timing information to stdout. It is left as an
    exercise for later (or maybe never) to add command-line arguments to specify which
    benchmark(s) to run, how long to run them for, how to format results, etc etc etc.
    Again, see the Google Benchmark framework for where that might end up.
    
    See src/bench/MilliSleep.cpp for a sanity-test benchmark that just benchmarks
    'sleep 100 milliseconds.'
    
    To compile and run benchmarks:
      cd src; make bench
    
    Sample output:
    
    Benchmark,count,min,max,average
    Sleep100ms,10,0.101854,0.105059,0.103881
Commits on Jul 27, 2015
  1. Unit test doublespends in new blocks

    gavinandresen authored and sipa committed Mar 3, 2015
    As suggested by Greg Maxwell-- unit test to make sure a block
    with a double-spend in it doesn't pass validation if half of
    the double-spend is already in the memory pool (so full-blown
    transaction validation is skipped) when the block is received.
Commits on Jul 15, 2015
  1. configure --enable-debug changes

    gavinandresen committed Jul 13, 2015
    Three changes to how configure --enable-debug behaves:
    
    1. Preserve user-passed CXXFLAGS/CFLAGS
    2. Compile with -DDEBUG_LOCKORDER
    3. Add -DDEBUG -DDEBUG_LOCKORDER to CPPFLAGS (since they are preprocessor options)
Commits on Jun 24, 2015
  1. Testing infrastructure: mocktime fixes

    gavinandresen committed Jun 19, 2015
    New, undocumented-on-purpose -mocktime=timestamp command-line
    argument to startup with mocktime set. Needed because
    time-related blockchain sanity checks are done on startup, before a
    test has a chance to make a setmocktime RPC call.
    
    And changed the setmocktime RPC call so calling it will not result in
    currently connected peers being disconnected due to inactivity timeouts.
Commits on Jun 8, 2015
  1. Use best header chain timestamps to detect partitioning

    gavinandresen committed Jun 8, 2015
    The partition checking code was using chainActive timestamps
    to detect partitioning; with headers-first syncing, it should use
    (and with this pull request, does use) pIndexBestHeader timestamps.
    
    Fixes issue #6251
Commits on May 16, 2015
  1. Merge pull request #6146

    gavinandresen committed May 16, 2015
    f501054 More robust CScheduler unit test (Gavin Andresen)
  2. More robust CScheduler unit test

    gavinandresen committed May 15, 2015
    On a busy or slow system, the CScheduler unit test could fail because it
    assumed all threads would be done after a couple of milliseconds.
    
    Replace the hard-coded sleep with CScheduler stop() method that
    will cleanly exit the servicing threads when all tasks are completely
    finished.
Commits on May 14, 2015
  1. Alert if it is very likely we are getting a bad chain

    gavinandresen committed Mar 26, 2015
    Create a monitoring task that counts how many blocks have been found in the last four hours.
    
    If very few or too many have been found, an alert is triggered.
    
    "Very few" and "too many" are set based on a false positive rate of once every fifty years of constant running with constant hashing power, which works out to getting 5 or fewer or 48 or more blocks in four hours (instead of the average of 24).
    
    Only one alert per day is triggered, so if you get disconnected from the network (or are being Sybil'ed) -alertnotify will be triggered after 3.5 hours but you won't get another -alertnotify for 24 hours.
    
    Tested with a new unit test and by running on the main network with -debug=partitioncheck
    
    Run test/test_bitcoin --log_level=message to see the alert messages:
        WARNING: check your network connection, 3 blocks received in the last 4 hours (24 expected)
        WARNING: abnormally high number of blocks generated, 60 blocks received in the last 4 hours (24 expected)
    
    The -debug=partitioncheck debug.log messages look like:
        ThreadPartitionCheck : Found 22 blocks in the last 4 hours
        ThreadPartitionCheck : likelihood: 0.0777702
  2. Merge pull request #5964

    gavinandresen committed May 14, 2015
    9a1dcea Use CScheduler for net's DumpAddresses (Gavin Andresen)
    ddd0acd Create a scheduler thread for lightweight tasks (Gavin Andresen)
    68d370b CScheduler unit test (Gavin Andresen)
    cfefe5b scheduler: fix with boost <= 1.50 (Cory Fields)
    ca66717 build: make libboost_chrono mandatory (Cory Fields)
    928b950 CScheduler class for lightweight task scheduling (Gavin Andresen)
    e656560 [Qt] add defaultConfirmTarget constant to sendcoinsdialog (Philip Kaufmann)
  3. Use CScheduler for net's DumpAddresses

    gavinandresen committed Apr 2, 2015
    Instead of starting Yet Another Thread to dump addresses,
    use CScheduler to do it.
  4. CScheduler unit test

    gavinandresen committed Apr 10, 2015
  5. CScheduler class for lightweight task scheduling

    gavinandresen committed Apr 2, 2015
    Simple class to manage a task queue that is serviced by one or
    more threads.
Commits on May 13, 2015
  1. Merge pull request #6125

    gavinandresen committed May 13, 2015
    472b4c5 Clean up parsing of bool command line args (Alex Morcos)
Commits on Apr 30, 2015
  1. Replace mruset setAddrKnown with CRollingBloomFilter addrKnown

    gavinandresen authored and sipa committed Apr 25, 2015
    Use a probabilistic bloom filter to keep track of which addresses
    we think we have given our peers, instead of a list.
    
    This uses much less memory, at the cost of sometimes failing to
    relay an address to a peer-- worst case if the bloom filter happens
    to be as full as it gets, 1-in-1,000.
    
    Measured memory usage of a full mruset setAddrKnown: 650Kbytes
    Constant memory usage of CRollingBloomFilter addrKnown: 37Kbytes.
    
    This will also help heap fragmentation, because the 37K of storage
    is allocated when a CNode is created (when a connection to a peer
    is established) and then there is no per-item-remembered memory
    allocation.
    
    I plan on testing by restarting a full node with an empty peers.dat,
    running a while with -debug=addrman and -debug=net, and making sure
    that the 'addr' message traffic out is reasonable.
    (suggestions for better tests welcome)
  2. Rolling bloom filter class

    gavinandresen authored and sipa committed Apr 24, 2015
    For when you need to keep track of the last N items
    you've seen, and can tolerate some false-positives.
    
    Rebased-by: Pieter Wuille <pieter.wuille@gmail.com>
Commits on Mar 26, 2015
  1. Keep mempool consistent during block-reorgs

    gavinandresen committed Mar 25, 2015
    This fixes a subtle bug involving block re-orgs and non-standard transactions.
    
    Start with a block containing a non-standard transaction, and
    one or more transactions spending it in the memory pool.
    
    Then re-org away from that block to another chain that does
    not contain the non-standard transaction.
    
    Result before this fix: the dependent transactions get stuck
    in the mempool without their parent, putting the mempool
    in an inconsistent state.
    
    Tested with a new unit test.
Commits on Mar 24, 2015
  1. Regression test for ResendWalletTransactions

    gavinandresen committed Mar 23, 2015
    Adds a regression test for the wallet's ResendWalletTransactions function, which uses a new, hidden RPC command "resendwallettransactions."
    
    I refactored main's Broadcast signal so it is passed the best-block time, which let me remove a global variable shared between main.cpp and the wallet (nTimeBestReceived).
    
    I also manually tested the "rebroadcast unconfirmed every half hour or so" functionality by:
    
    1. Running bitcoind -connect=0.0.0.0:8333
    2. Creating a couple of send-to-self transactions
    3. Connect to a peer using -addnode
    4. Waited a while, monitoring debug.log, until I see:
    ```2015-03-23 18:48:10 ResendWalletTransactions: rebroadcast 2 unconfirmed transactions```
    
    One last change: don't bother putting ResendWalletTransactions messages in debug.log unless unconfirmed transactions were actually rebroadcast.
Commits on Mar 6, 2015
  1. Run unit tests in different orders

    gavinandresen committed Mar 5, 2015
    Set the BOOST_TEST_RANDOM environment variable, to
    run unit tests in different orders for each test in the
    test matrix that runs tests.
Commits on Dec 8, 2014
Commits on Dec 6, 2014
  1. Merge pull request #5432

    gavinandresen committed Dec 6, 2014
    db0916b Fix missing python2 in rpc-tests (Matt Corallo)
    
    Signed-off-by: Gavin Andresen <gavinandresen@gmail.com>
Commits on Dec 3, 2014
  1. Coinbases-in-mempool regression test

    gavinandresen committed Dec 2, 2014
    Immature coinbase spends are allowed in the memory pool if they can be mined in the next block.
    They are not allowed in the memory pool if they cannot be mined in the next block.
    
    This regression test tests those edge cases.
Commits on Dec 2, 2014
  1. Merge pull request #5369

    gavinandresen committed Dec 2, 2014
    b2d0162 Test resurrecting memory pool transactions during chain re-org (Gavin Andresen)
    3dd8ed7 Delay writing block indexes in invalidate/reconsider (Pieter Wuille)
    798faec Add 'invalidateblock' and 'reconsiderblock' RPC commands. (Pieter Wuille)
Commits on Nov 24, 2014
  1. Merge pull request #5335

    gavinandresen committed Nov 24, 2014
    7e615f5 Fixed mempool sync after sending a transaction (Suhas Daftuar)
Commits on Nov 19, 2014
  1. Port/fix txnmall.sh regression test

    gavinandresen committed Nov 19, 2014
    Ported txnmall.sh to Python, and updated to match
    recent transaction malleability changes.
    
    I also modified it so it tests both double-spending
    confirmed and unconfirmed (only-in-mempool) transactions.
    
    Renamed to txn_doublespend, since that is really what is
    being tested. And told the pull-tester to run both
    variations on this test.
Commits on Nov 18, 2014
  1. Merge pull request #5280

    gavinandresen committed Nov 18, 2014
    3c30f27 travis: disable rpc tests for windows until they're not so flaky (Cory Fields)
    daf03e7 RPC tests: create initial chain with specific timestamps (Gavin Andresen)
    a8b2ce5 regression test only setmocktime RPC call (Gavin Andresen)
Commits on Nov 17, 2014
  1. RPC tests: create initial chain with specific timestamps

    gavinandresen committed Nov 13, 2014
    Use setmocktime to create the initial block chain with
    10-minute-apart-blocks starting 1 Jan 2014.
  2. Merge pull request #5275

    gavinandresen committed Nov 17, 2014
    1837987 Optimize -regtest setgenerate block generation (Gavin Andresen)
    
    Signed-off-by: Gavin Andresen <gavinandresen@gmail.com>
Commits on Nov 14, 2014
  1. Optimize -regtest setgenerate block generation

    gavinandresen committed Nov 13, 2014
    Speed up generating blocks in regression test mode, by moving
    block-creating and nonce-finding directly into the setgenerate
    RPC call (instead of starting up a mining thread and waiting for
    it to find a block).
    
    This makes the forknotify RPC test three times quicker, for
    example (10 seconds runtime instead of 30 seconds, assuming
    the initial blockchain cache is already built).
Commits on Nov 3, 2014
  1. Merge pull request #5201 from sipa/order

    gavinandresen committed Nov 3, 2014
    Remove file and class order guidelines