Closed maaku closed 5 years ago
I got the unknown error in p2p-fullblocktest.py
sorted out. It is an unrelated failure due to excess fee in calculations prior to the truncated inputs and ALU demurrage calculation soft-forks. I have an idea for fixing this, but it should be a separate PR. So this code is now ready to merge as-is.
For the past couple of releases the majority of RPC regression tests have bee disabled due to their implementation making certain assumptions about the behavior of the chain, such as blocks having 50 BTC subsidy, and not taking into account value decay due to demurrage. For example:
A test that mines 25 blocks, then 100 blocks for maturity, and checks that the available balance is 1250 coins is intending to test the wallet coinbase maturity code, not the block reward schedule. (These tests needed updating because the freicoin subsidy schedule is different from bitcoin's.)
A test that records the wallets balance, sends all available coins to a external address, checks the new balance is zero, then reorgs to a longer chain containing a double-spends back to itself and checks the wallet balance has returned to its original value is not supposed to be testing for demurrage. (These tests needed updating because wallet balances decay with each mined block.)
Previously I updated these tests individually, but this proved difficult to maintain. In recent rebasing efforts I delayed introduction of demurrage and changing subsidy until the end so the tests could at least be run against earlier patches. This PR introduces a more long-term solution.
This PR changes the subsidy on regtest to resemble bitcoin's (50 coins per block), and introduces a new consensus-impacting option
-notimeadjust
(only available with-regtest
) which disables demurrage / time-value adjustment. Running the JSON-RPC python test framework with the--bitcoin-mode
command line option turns on this no-demurrage mode.This proved sufficient to get all but one of the pull-tester's default JSON-RPC tests to run. I have not yet investigated the
-extended
tests, or gotten to the bottom of the one failing test script,p2p-fullblocktest.py
.Fixes #38.