* Add request_types and their help
* Added command parser
* Updated main to use command if it's specified
* Some progress in making everything work
* Fix command parser for pointers to structs
* Cleanup code
* Enhance usage text
* Fixed typo
* Some minor style fixing, and remove temporary code
* Correctly fallthrough in stringToValue unsupported types
Co-authored-by: stasatdaglabs <39559713+stasatdaglabs@users.noreply.github.com>
* Remove pruningPointUTXOSetStaging and implement UpdatePruningPointUTXOSet.
* Implement StageStartSavingNewPruningPointUTXOSet, HadStartedSavingNewPruningPointUTXOSet, and FinishSavingNewPruningPointUTXOSet.
* Fix a bad return.
* Implement UpdatePruningPointUTXOSetIfRequired.
* Call UpdatePruningPointUTXOSetIfRequired on consensus creation.
* Rename savingNewPruningPointUTXOSetKey to updatingPruningPointUTXOSet.
* Add a log.
* Add calls to runtime.GC() at its start and end.
* Rename a variable.
* Replace calls to runtime.GC to calls to LogMemoryStats.
* Wrap the contents of LogMemoryStats in a log closure.
* Replaced the content of MsgIBDRootUTXOSetChunk with pairs of outpoint-utxo entry pairs.
* Rename utxoIter to utxoIterator.
* Add a big stinky TODO on an assert.
* Replace pruningStore staging with a UTXO set iterator.
* Reimplement receiveAndInsertIBDRootUTXOSet.
* Extract OutpointAndUTXOEntryPairsToDomainOutpointAndUTXOEntryPairs into domainconverters.go.
* Pass the outpoint and utxy entry pairs to the pruning store.
* Implement InsertCandidatePruningPointUTXOs.
* Implement ClearCandidatePruningPointUTXOs.
* Implement UpdateCandidatePruningPointMultiset.
* Use the candidate pruning point multiset in updatePruningPoint.
* Implement CandidatePruningPointUTXOIterator.
* Use the pruning point utxo set iterator for StageVirtualUTXOSet.
* Defer ClearCandidatePruningPointUTXOs.
* Implement OverwriteVirtualUTXOSet.
* Implement CommitCandidatePruningPointUTXOSet.
* Implement BeginOverwritingVirtualUTXOSet and FinishOverwritingVirtualUTXOSet.
* Implement overwriteVirtualUTXOSetAndCommitPruningPointUTXOSet.
* Rename ClearCandidatePruningPointUTXOs to ClearCandidatePruningPointData.
* Add missing methods to dbManager.
* Implement PruningPointUTXOs.
* Implement RecoverUTXOIfRequired.
* Delete the utxoserialization package.
* Fix compilation errors in TestValidateAndInsertPruningPoint.
* Switch order of operations in the if statements in PruningPointUTXOs so that Next() wouldn't be unnecessarily called.
* Fix missing pruning point utxo set staging and bad slice length.
* Fix no default multiset in InsertCandidatePruningPointUTXOs.
* Make go vet happy.
* Rename candidateXXX to importedXXX.
* Do some more renaming.
* Rename some more.
* Fix bad MsgIBDRootNotFound logic.
* Fix an error message.
* Simplify receiveIBDRootBlock.
* Fix error message in receiveAndInsertIBDRootUTXOSet.
* Do some more renaming.
* Fix merge errors.
* Fix a bug caused by calling iterator.First() unnecessarily.
* Remove databaseContext from stores and don't use a transaction in ClearXXX functions.
* Simplify receiveAndInsertIBDRootUTXOSet.
* Fix offset count in PruningPointUTXOs().
* Fix readOnlyUTXOIteratorWithDiff.First().
* Split handleRequestIBDRootUTXOSetAndBlockFlow into smaller methods.
* Rename IbdRootNotFound to UnexpectedPruningPoint.
* Rename requestIBDRootHash to requestPruningPointHash.
* Rename IBDRootHash to PruningPointHash.
* Rename RequestIBDRootUTXOSetAndBlock to RequestPruningPointUTXOSetAndBlock.
* Rename IBDRootUTXOSetChunk to PruningPointUTXOSetChunk.
* Rename RequestNextIBDRootUTXOSetChunk to RequestNextPruningPointUTXOSetChunk.
* Rename DoneIBDRootUTXOSetChunks to DonePruningPointUTXOSetChunks.
* Rename remaining references to IBD root.
* Fix an error message.
* Add a check for HadStartedImportingPruningPointUTXOSet in commitVirtualUTXODiff.
* Add a check for HadStartedImportingPruningPointUTXOSet in ImportPruningPointUTXOSetIntoVirtualUTXOSet.
* Move FinishImportingPruningPointUTXOSet closer to HadStartedImportingPruningPointUTXOSet.
* Remove reference to pruningStore in utxoSetIterator.
* Pointerify utxoSetIterator receivers.
* Fix bad insert in CommitImportedPruningPointUTXOSet.
* Rename commitImportedPruningPointUTXOSetAll to applyImportedPruningPointUTXOSet.
* Simplify PruningPointUTXOs.
* Add populateTransactionWithUTXOEntriesFromUTXOSet.
* Fix a TODO comment.
* Rename InsertImportedPruningPointUTXOs to AppendImportedPruningPointUTXOs.
* Extract handleRequestPruningPointUTXOSetAndBlockMessage to a separate method.
* Rename stuff in readOnlyUTXOIteratorWithDiff.First().
* Address toAddIterator in readOnlyUTXOIteratorWithDiff.First().
* Call First() before any full iteration on ReadOnlyUTXOSetIterator.
* Call First() before any full iteration on a database Cursor.
* Put StartImportingPruningPointUTXOSet inside the pruning point transaction.
* Make serializeOutpoint and serializeUTXOEntry free functions in pruningStore.
* Fix readOnlyUTXOIteratorWithDiff.First().
* Fix bad validations in importPruningPoint.
* Remove superfluous call to validateBlockTransactionsAgainstPastUTXO.
* 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.
* 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
* 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>
* ''
* ''
* ''
* Changes genesis block version to 0.
* a
* a
* All tests are done.
* All tests passed for changed block version from int32 to uint16
* Adds validation of rejecting blocks with unknown versions.
* Changes txn version from int32 to uint16.
* .
* Adds comments to exported functions.
* Change functions name from ConvertFromRpcScriptPubKeyToRPCScriptPubKey to ConvertFromAppMsgRPCScriptPubKeyToRPCScriptPubKey and from ConvertFromRPCScriptPubKeyToRpcScriptPubKey to ConvertFromRPCScriptPubKeyToAppMsgRPCScriptPubKey
* change comment to "ScriptPublicKey represents a Kaspad ScriptPublicKey"
* delete part (tx.Version < 0) that cannot be exist on the if statement.
* Revert protobuf version.
* Fix a comment.
* Fix a comment.
* Rename a variable.
* Rename a variable.
* Remove a const.
* Rename a type.
* Rename a field.
* Rename a field.
* Remove commented-out code.
* Remove dangerous nil case in DomainTransactionOutput.Clone().
* Remove a constant.
* Fix a string.
* Fix wrong totalScriptPubKeySize in transactionMassStandalonePart.
* Remove a constant.
* Remove an unused error.
* Fix a serialization error.
* Specify version types to be uint16 explicitly.
* Use constants.ScriptPublicKeyVersion.
* Fix a bad test.
* Remove some whitespace.
* Add a case to utxoEntry.Equal().
* Rename scriptPubKey to scriptPublicKey.
* Remove a TODO.
* Rename constants.
* Rename a variable.
* Add version to parseShortForm.
Co-authored-by: tal <tal@daglabs.com>
Co-authored-by: stasatdaglabs <stas@daglabs.com>
* Add a new message: BlockHeadersMessage.
* Add a new message: BlockHeadersMessage.
* Send a lot of headers as a single message instead of many small messages.
* Keep a short queue of blockHeadersMessages so that there's never a moment when the node is not validating and inserting headers
* Add a missing return statement.
* Remove MsgBlockHeader from payloads.
* Add a new message: BlockLocatorHighestHash.
* Add a new message: IBDBlockLocator.
* Implement HandleIBDBlockLocator.
* Reimplement findHighestSharedBlockHash.
* Make HandleIBDBlockLocator only return hashes that are in the selected parent chain of the target hash.
* Increase the cache sizes of blockRelationStore, reachabilityDataStore, and ghostdagDataStore.
* Fix wrong initial highHash in findHighestSharedBlockHash.
* Make go vet happy.
* Protect against receiving wrong messages when expecting MsgIBDBlockLocatorHighestHash.
* Increase size of reachability cache
* Change DomainHash to struct with unexported hashArray
* Fixing compilation errors stemming from new DomainHash structure
* Remove obsolete Read/WriteElement methods in appmessage
* Fix all tests
* Fix all tests
* Add comments
* A few renamings
* go mod tidy
* 1) Calculate pruning point incrementally
2) Add IsValidPruningPoint to pruning manager and consensus
3) Use reachability children for selected child iterator
* Add request IBD root hash flow
* Fix UpdatePruningPointByVirtual and IsValidPruningPoint
* Regenerate messages.pb.go
* Make the pruning point the earliest chain block with finality interval higher than the previous pruning point
* Fix merge errors
* Get rid of insertMode
* Rename AddBlockToVirtual->AddBlock
* When F is not in the future of P, enforce finality with P and not with F.
* Don't allow blocks with invalid parents or with missing block body
* Check finality violation before checking block status
* Implement CalculateIndependentPruningPoint
* Move checkBlockStatus to validateBlock
* Add ValidateBlock to block processor interface
* Adjust SetPruningPoint to the new IBD flow
* Add pruning store to CSM's constructor
* Flip wrong condition on AddHeaderTip
* Fix func (hts *headerSelectedTipStore) Has
* Fix block stage order
* Call to ValidateBodyInContext from validatePostProofOfWork
* Enable overrideDAGParams
* Update log
* Rename SetPruningPoint to ValidateAndInsertPruningPoint and move most of its logic inside block processor
* Rename hasValidatedHeader->hasValidatedOnlyHeader
* Fix typo
* Name return values for fetchMissingUTXOSet
* Add comment
* Return ErrMissingParents when block body is missing
* Add logs and comments
* Fix merge error
* Fix pruning point calculation to be by virtual selected parent
* Replace CalculateIndependentPruningPoint to CalculatePruningPointByHeaderSelectedTip
* Fix isAwaitingUTXOSet to check pruning point by headers
* Change isAwaitingUTXOSet indication
* Remove IsBlockInHeaderPruningPointFuture from BlockInfo
* Fix LowestChainBlockAboveOrEqualToBlueScore
* Add validateNewPruningPointTransactions
* Add validateNewPruningAgainstPastUTXO
* Rename set_pruning_utxo_set.go to update_pruning_utxo_set.go
* Check missing block body hashes by missing block instead of status
* Validate pruning point against past UTXO with the pruning point as block hash
* Remove virtualHeaderHash
* Fix comment
* Fix imports
* Change DifficultyAdjustmentWindowSize and TimestampDeviationTolerance from uint64 to int
* refactor block_heap for readability and usage
* Add a new SizedUpHeap
* Refactor BlueWindow with the new DAA
* Update TestBlueBlockWindow with the new DAA window
* Fix review requested changes
* [NOD-1579] Remove selected tip hash messages.
* [NOD-1579] Start moving IBD stuff into blockrelay.
* [NOD-1579] Rename relaytransactions to transactionrelay.
* [NOD-1579] Move IBD files into blockrelay.
* [NOD-1579] Remove flow stuff from ibd.go.
* [NOD-1579] Bring back IsInIBD().
* [NOD-1579] Simplify block relay flow.
* [NOD-1579] Check orphan pool for missing parents to avoid unnecessary processing.
* [NOD-1579] Implement processOrphan.
* [NOD-1579] Implement addToOrphanSetAndRequestMissingParents.
* [NOD-1579] Fix TestIBD.
* [NOD-1579] Implement isBlockInOrphanResolutionRange.
* [NOD-1579] Implement limited block locators.
* [NOD-1579] Add some comments.
* [NOD-1579] Specifically check for StatusHeaderOnly in blockrelay.
* [NOD-1579] Simplify runIBDIfNotRunning.
* [NOD-1579] Don't run IBD if it is already running.
* [NOD-1579] Fix a comment.
* [NOD-1579] Rename mode to syncInfo.
* [NOD-1579] Simplify validateAndInsertBlock.
* [NOD-1579] Fix bad SyncStateSynced condition.
* [NOD-1579] Implement validateAgainstSyncStateAndResolveInsertMode.
* [NOD-1579] Use insertModeHeader.
* [NOD-1579] Add logs to TrySetIBDRunning and UnsetIBDRunning.
* [NOD-1579] Implement and use dequeueIncomingMessageAndSkipInvs.
* [NOD-1579] Fix a log.
* [NOD-1579] Fix a bug in createBlockLocator.
* [NOD-1579] Rename a variable.
* [NOD-1579] Fix a slew of bugs in missingBlockBodyHashes and selectedChildIterator.
* [NOD-1579] Fix bad chunk size in syncMissingBlockBodies.
* [NOD-1579] Remove maxOrphanBlueScoreDiff.
* [NOD-1579] Fix merge errors.
* [NOD-1579] Remove a debug log.
* [NOD-1579] Add logs.
* [NOD-1579] Make various go quality tools happy.
* [NOD-1579] Fix a typo in a variable name.
* [NOD-1579] Fix full blocks over header-only blocks not failing the missing-parents validation.
* [NOD-1579] Add an error log about a condition that should never happen.
* [NOD-1579] Check all antiPast hashes instead of just the lowHash's anticone to filter for header-only blocks.
* [NOD-1579] Remove the nil stuff from GetBlockLocator.
* [NOD-1579] Remove superfluous condition in handleRelayInvsFlow.start().
* [NOD-1579] Return a boolean from requestBlock instead of comparing to nil.
* [NOD-1579] Fix a bad log.Debugf.
* [NOD-1579] Remove a redundant check.
* [NOD-1579] Change an info log to a warning log.
* [NOD-1579] Move OnNewBlock out of relayBlock.
* [NOD-1579] Remove redundant exists check from runIBDIfNotRunning.
* [NOD-1579] Fix bad call to OnNewBlock.
* [NOD-1579] Remove an impossible check.
* [NOD-1579] Added a log.
* [NOD-1579] Rename insertModeBlockWithoutUpdatingVirtual to insertModeBlockBody.
* [NOD-1579] Add a check for duplicate headers.
* [NOD-1579] Added a comment.
* [NOD-1579] Tighten a stop condition.
* [NOD-1579] Simplify a log.
* [NOD-1579] Clarify a log.
* [NOD-1579] Move a log.
* [NOD-1582] Fix multiple request per missing ancestor
* [NOD-1582] Don't remove peer on routerpkg.ErrRouteClosed from RPC
* [NOD-1582] Use LogAndMeasureExecutionTime where possible