* [NOD-1424] Write general unit-tests for Reachability
* Update the tests of reachabilityManager.
* Add a diagram for the created DAG in the test.
* Change tabs to spaces in the diagram.
Co-authored-by: karim1king <karimkaspersky@yahoo.com>
Co-authored-by: tal <tal@daglabs.com>
Co-authored-by: stasatdaglabs <39559713+stasatdaglabs@users.noreply.github.com>
* Save DAA score and DAA added blocks for each block
* Add test
* Add pruning support
* Replace 8 with uint64Length
* Separate DAABlocksStore cache size to DAA score and daaAddedBlocks
* Move timesorter to its own package and remove unused functions
* Remove padding+genesis from BlockWindow
* Adjust the difficulty even when there's less than difficultyAdjustmentWindowSize blocks
* Remove unnecessary check from checkBlockTransactionsFinalized
* Update tests with new pastMedianTime and Difficulty
* Review nit
* Write better tests for red blocks and DAA
* Fix comments
* Fix blue chain size
* Remove high timestamps from blue chain
Co-authored-by: Svarog <feanorr@gmail.com>
* Refactor mergeSetIncrease to return the current BFS block to allow easier merging
* Remove unneeded Heap/HashSet usages
* Add new IsAnyAncestorOf to DagTopolyManager
* Check if the new candidate is in the future of any existing candidate
* Add comments and fix off-by-one in the mergeSetIncrease queue
* Fixed DAGToplogy test mock
* Fix review comments
* Handle errors in p2p handshake better
* Add a new errNil in protowire
* Add nil checks for all protowire.toAppMessage() functions for the p2p
* Add nil checks for all protowire.toAppMessage() functions for the RPC
* Add nil check for protwire KaspadMessage
Co-authored-by: Svarog <feanorr@gmail.com>
* Remove Subsystems map and replace with RegisterSubSystem
* Clean up the logger
* Fix LOGFLAGS and make LongFile work correctly
* Parallelize the logger backend
* More logger cleanup
* Initialize and close the logger backend wherever it's needed
* Move the location where the backend is closed, also print the log if it panics while writing
* Add TestMain to reachability manager tests to preserve the same log level
* Fix review comments
Co-authored-by: Svarog <feanorr@gmail.com>
* Add Close() function to all the iterators
* Add defer iterator.Close() whenever we open an iterator
* Add isClosed to all iterators and panic/return error if used after closing
Co-authored-by: Svarog <feanorr@gmail.com>
* resolveSingleBlockStatus: If the block being resolved is not going to be the next selectedTip - set it's diffParent to be the old selectedTip
* resolveSingleBlockStatus: If the block being resolved is going to be the next selectedTip - set it as old selectedTip's diffChild
* Remove any mentions of virtualDiffParents
* If block is genesis - don't do all the mumbo-jumbo with oldSelectedTip
* Check an unchecked error
* Write a better log message
* [NOD-1453] cover failing block validation
* [NOD-1453] Complete covering test for invalid block
* [NOD-1453] Fix validator tests after rebase
* [NOD-1453] Cover tests for valid blocks
* [NOD-1453] Implement unit tests for ValidateTransactionInIsolation
* [NOD-1453] Add tests for ValidateTransactionInContextAndPopulateMassAndFee
* [NOD-1453] Cover ValidateHeaderInContext test
* [NOD-1453] Fix after rebase
* not finish
* commited for update the branch.
* Adds new tests to block_body_in_isolation_test.go according to (and instead of ) blockvalisator_test.go
* Adds a comment to type MEDIAN.
* Fixes according to the review notes: add notes and change variables name.
* Fix comment.
* Remove an unused test( all the tests in this file were passed to other test files).
* Change a variable name(txWithAnEmptyInvalidScript to txWithInvalidSignature).
* adds missing '}'.
* Change spaces to tab
Co-authored-by: karim1king <karimkaspersky@yahoo.com>
Co-authored-by: Karim A <karim.a@it-dimension.com>
Co-authored-by: tal <tal@daglabs.com>
* Adds tests for validateDifficulty
* fixes according to the review notes: adding the test's goal and fix an unmatch test name on the NewTestConsensus.
* Fixes according to the review notes:delete the function genesisBits - No usages.
* Fix according to review - fix comments.
Co-authored-by: tal <tal@daglabs.com>
Co-authored-by: Ori Newman <orinewman1@gmail.com>