* Fix stability test mining (allow submission of non DAA blocks too)
* Comments for go fmt
* Use SubmitBlockAlsoIfNonDAA for all tests
Co-authored-by: Elichai Turkel <elichai.turkel@gmail.com>
* Pruning headers p2p basic structure
* Remove headers-first
* Fix consensus tests except TestValidateAndInsertPruningPointWithSideBlocks and TestValidateAndInsertImportedPruningPoint
* Add virtual genesis
* Implement PruningPointAndItsAnticoneWithMetaData
* Start fixing TestValidateAndInsertImportedPruningPoint
* Fix TestValidateAndInsertImportedPruningPoint
* Fix BlockWindow
* Update p2p and gRPC
* Fix all tests except TestHandleRelayInvs
* Delete TestHandleRelayInvs parts that cover the old IBD flow
* Fix lint errors
* Add p2p_request_ibd_blocks.go
* Clean code
* Make MsgBlockWithMetaData implement its own representation
* Remove redundant check if highest share block is below the pruning point
* Fix TestCheckLockTimeVerifyConditionedByAbsoluteTimeWithWrongLockTime
* Fix comments, errors ane names
* Fix window size to the real value
* Check reindex root after each block at TestUpdateReindexRoot
* Remove irrelevant check
* Renames and comments
* Remove redundant argument from sendGetBlockLocator
* Don't delete staging on non-recoverable errors
* Renames and comments
* Remove redundant code
* Commit changes inside ResolveVirtual
* Add comment to IsRecoverableError
* Remove blocksWithMetaDataGHOSTDAGDataStore
* Increase windows pagefile
* Move DeleteStagingConsensus outside of defer
* Get rid of mustAccepted in receiveBlockWithMetaData
* Ban on invalid pruning point
* Rename interface_datastructures_daawindowstore.go to interface_datastructures_blocks_with_meta_data_daa_window_store.go
* * Change GetVirtualSelectedParentChainFromBlockResponseMessage and VirtualSelectedParentChainChangedNotificationMessage to show only added block hashes
* Remove ResolveVirtual
* Use externalapi.ConsensusWrapper inside MiningManager
* Fix pruningmanager.blockwithmetadata
* Set pruning point selected child when importing the pruning point UTXO set
* Change virtual genesis hash
* replace the selected parent with virtual genesis on removePrunedBlocksFromGHOSTDAGData
* Get rid of low hash in block locators
* Remove +1 from everywhere we use difficultyAdjustmentWindowSize and increase the default value by one
* Add comments about consensus wrapper
* Don't use separate staging area when resolving resolveBlockStatus
* Fix netsync stability test
* Fix checkResolveVirtual
* Rename ConsensusWrapper->ConsensusReference
* Get rid of blockHeapNode
* Add comment to defaultDifficultyAdjustmentWindowSize
* Add SelectedChild to DAGTraversalManager
* Remove redundant copy
* Rename blockWindowHeap->calculateBlockWindowHeap
* Move isVirtualGenesisOnlyParent to utils
* Change BlockWithMetaData->BlockWithTrustedData
* Get rid of maxReasonLength
* Split IBD to 100 blocks each time
* Fix a bug in calculateBlockWindowHeap
* Switch to trusted data when encountering virtual genesis in blockWithTrustedData
* Move ConsensusReference to domain
* Update ConsensusReference comment
* Add comment
* Rename shouldNotAddGenesis->skipAddingGenesis
* Copy over boilerplate and begin implementing TestDAA.
* Implement a fairly reliable method of hashing at a certain hashrate.
* Convert the DAA test to an application.
* Start kaspad and make sure that hashrate throttling works with that as well.
* Finish implementing testConstantHashRate.
* Tidied up a bit.
* Convert TestDAA back into a go test.
* Reorganize TestDAA to be more like a traditional test.
* Add sudden hashrate drop/jump tests.
* Simplify targetHashNanosecondsFunction.
* Improve progress logs.
* Add more tests.
* Remove the no-longer relevant `hashes` part of targetHashNanosecondsFunction.
* Implement a constant hashrate increase test.
* Implement a constant hashrate decrease test.
* Give the correct run duration to the constant hashrate decrease test.
* Add cooldowns to exponential functions.
* Add run.sh to the DAA test.
* Add a README.
* Add `daa` to run-slow.sh.
* Make go lint happy.
* Fix the README's title.
* Keep running tests even if one of them failed on high block rate deviation.
* Fix hashrate peak/valley tests.
* Preallocate arrays for hash and mining durations.
* Add more statistics to the "mined block" log.
* Make sure runDAATest stops when it's suppposed to.
* Add a newline after "5 minute cooldown."
* Fix variable names.
* Rename totalElapsedTime to tatalElapsedDuration.
* In measureMachineHashNanoseconds, generate a random nonce only once.
* In runDAATest, add "DAA" to the start/finish log.
* Remove --logdir from kaspadRunCommand.
* In runDAATest, enlarge the nonce range to the entirety of uint64.
* Explain what targetHashNanosecondsFunction is.
* Move RunKaspadForTesting into common.
* Rename runForDuration to loopForDuration.
* Make go lint happy.
* Extract fetchBlockForMining to a separate function.
* Extract waitUntilTargetHashDurationHadElapsed to a separate function.
* Extract pushHashDuration and pushMiningDuration to separate functions.
* Extract logMinedBlockStatsAndUpdateStatFields to a separate function.
* Extract submitMinedBlock to a separate function.
* Extract tryNonceForMiningAndIncrementNonce to a separate function.
* Add comments.
* Use a rolling average instead of appending to an array for performance/accuracy.
* Change a word in a comment.
* Explain why we wait for five minutes at the end of the exponential increase/decrease tests.
Co-authored-by: Svarog <feanorr@gmail.com>