* Add the Address of node to whom connected in log of send/receiveVersion
* Don't call functions before LogAndMeasureExecutionTime
Co-authored-by: Ori Newman <orinewman1@gmail.com>
* Fix checkParentHeadersExist and cover pruning_violation_proof_of_work_and_difficulty.go with tests
* Remove unused variable
* Change consensus violation
* Change condition order
* Get rid of irrelevant error codes in extractRejectCode
* Fix wrong test db names
* Fix checkParentHeadersExist
* Extract syncPruningPointUTXOSet to a separate method.
* Implement logic to send pruning point utxo set chunks in a loop.
* Replace IBDRootUTXOSetAndBlockMessage with IbdRootUtxoSetChunkMessage.
* Add a new message: RequestNextIBDRootUTXOSetChunk.
* Add a new message: DoneIBDRootUTXOSetChunks.
* Protect HandleRequestIBDRootUTXOSetAndBlock from rogue messages.
* Reimplement receiveIBDRootUTXOSetAndBlock.
* Add CmdDoneIBDRootUTXOSetChunks to the HandleRelayInvs flow.
* Decrease the max message size to 10mb.
* Fix bad step.
* Fix confusion between outgoing/incoming routes.
* Measure how long it takes to send/receive the UTXO set.
* Use LogAndMeasure in handleRequestIBDRootUTXOSetAndBlockFlow.
* Prevent a race condition in findHighestSharedBlockHash where we get headersSelectedTip and then pass it as highHash to GetBlockLocator, without locking consensus
* Restart findHighestSharedBlockHash if lowHash or highHash are no longer in selectedParentChain
* Test for specifically ErrBlockNotInSelectedParentChain instead of database NotFound error
* Fix TestCreateHeadersSelectedChainBlockLocator
Co-authored-by: Ori Newman <orinewman1@gmail.com>
* Log the hashrate of each block
* Add a test for GetHashrateString
* Move difficulty related functions to its own package
* Convert the validated log in validateAndInsertBlock to a log function
* Add tests for max/min int
* Adds test for error cases on the function checkBlockStatus.
* Fix review's comments.
* Move test to validateandinsertblock_test.go
Co-authored-by: tal <tal@daglabs.com>
Co-authored-by: Ori Newman <orinewman1@gmail.com>
* Increase default log sizes, and increase kaspad log sizes
* Add an option to not print logs to stdout
* Allow logs to be printed in the current working directory
* Add more pruning related logs
* Add comment and increase log rotations to save last 64 logs
* Fix UTXO serialization, its test, and the static check that missed it
* Remove duplicate case
* Use one line for static check
Co-authored-by: Elichai Turkel <elichai.turkel@gmail.com>
* Add selected chain store and optimize block locator with it
* Fix build error
* Fix comments
* Fix IsStaged
* Rename CalculateSelectedParentChainChanges to CalculateChainPath and SelectedParentChainChanges->SelectedChainPath
* Use binary.LittleEndian directly to allow compiler optimizations
* Remove boolean from HeadersSelectedChainStore interface
* Prevent endless loop in block locator
* Initalize protoUTXOSetIterator with index = -1
* Handle error when failed to deserialize Script version
* Add support for (de)serialization of (u)int16
* Log the error when converting it into ErrMalformedUTXO
* commit for do fetch&merge
* Adds a new test to validate POW, and Fix Main-net and Testnet genesis block data.
* Fix window's test for testnet and change the expected pruning point for mainnet and testnet.
* Delete function "solveBlock" on proof_of_work_test.go and call the function mining.SolvaBlock instead. Also, remove using of random in "solveBlockWithWrongPOW" function.
* Replace 0xFFFFFFFFFFFFFFFF to math.MaxUint64 in "solveBlockWithWrongPOW" function and change the function's comment of "TestPOW"
* Replace 0xFFFFFFFFFFFFFFFF to math.MaxUint64 in "solveBlockWithWrongPOW" function and change the function's comment of "TestPOW"
* Change from <= to < in the for statement in "solveBlockWithWrongPOW" function
* Adds one arg to the function call "NewTestConsensus" (the function sig has changed).
Co-authored-by: tal <tal@daglabs.com>
Co-authored-by: Ori Newman <orinewman1@gmail.com>
* Make sure block locator doesn't include a hash lower than the lowHash in
the block locator
* Use finalityStore to optimize LowestChainBlockAboveOrEqualToBlueScore
* Add archival cli flag
* If --archival was activated - don't delete anything
* Fix tests
* Still change block status to StatusHeaderOnly even in archival nodes
* Split messages.proto to p2p and rpc.
* Split messages.proto to p2p and rpc.
* Write a short intro to the RPC docs.
* Start documenting RPC calls.
* Use a custom protoc-gen-doc.
* Continue writing RPC documentation.
* Finish writing RPC documentation.
* Fix a formatting error.
* Fix merge errors.
* Fix formatting into protowire/README.md.
* Rerun go generate ..
Co-authored-by: Ori Newman <orinewman1@gmail.com>