* Replace BlockMessage with RpcBlock in rpc.proto.
* Convert everything in kaspad to use RPCBlocks and fix tests.
* Fix compilation errors in stability tests and the miner.
* Update TransactionVerboseData in rpc.proto.
* Update TransactionVerboseData in the rest of kaspad.
* Make golint happy.
* Include RpcTransactionVerboseData in RpcTransaction instead of the other way around.
* Regenerate rpc.pb.go after merge.
* Update appmessage types.
* Update appmessage request and response types.
* Reimplement conversion functions between appmessage.RPCTransaction and protowire.RpcTransaction.
* Extract RpcBlockHeader toAppMessage/fromAppMessage out of RpcBlock.
* Fix compilation errors in getBlock, getBlocks, and submitBlock.
* Fix compilation errors in getMempoolEntry.
* Fix compilation errors in notifyBlockAdded.
* Update verbosedata.go.
* Fix compilation errors in getBlock and getBlocks.
* Fix compilation errors in getBlocks tests.
* Fix conversions between getBlocks message types.
* Fix integration tests.
* Fix a comment.
* Add selectedParent to the verbose block response.
* Add StagingArea struct
* Implemented staging areas in blockStore
* Move blockStagingShard to separate folder
* Apply staging shard to acceptanceDataStore
* Update blockHeaderStore with StagingArea
* Add StagingArea to BlockRelationStore
* Add StagingArea to blockStatusStore
* Add StagingArea to consensusStateStore
* Add StagingArea to daaBlocksStore
* Add StagingArea to finalityStore
* Add StagingArea to ghostdagDataStore
* Add StagingArea to headersSelectedChainStore and headersSelectedTipStore
* Add StagingArea to multisetStore
* Add StagingArea to pruningStore
* Add StagingArea to reachabilityDataStore
* Add StagingArea to utxoDiffStore
* Fix forgotten compilation error
* Update reachability manager and some more things with StagingArea
* Add StagingArea to dagTopologyManager, and some more
* Add StagingArea to GHOSTDAGManager, and some more
* Add StagingArea to difficultyManager, and some more
* Add StagingArea to dagTraversalManager, and some more
* Add StagingArea to headerTipsManager, and some more
* Add StagingArea to constnsusStateManager, pastMedianTimeManager
* Add StagingArea to transactionValidator
* Add StagingArea to finalityManager
* Add StagingArea to mergeDepthManager
* Add StagingArea to pruningManager
* Add StagingArea to rest of ValidateAndInsertBlock
* Add StagingArea to blockValidator
* Add StagingArea to coinbaseManager
* Add StagingArea to syncManager
* Add StagingArea to blockBuilder
* Update consensus with StagingArea
* Add StagingArea to ghostdag2
* Fix remaining compilation errors
* Update names of stagingShards
* Fix forgotten stagingArea passing
* Mark stagingShard.isCommited = true once commited
* Move isStaged to stagingShard, so that it's available without going through store
* Make blockHeaderStore count be avilable from stagingShard
* Fix remaining forgotten stagingArea passing
* commitAllChanges should call dbTx.Commit in the end
* Fix all tests tests in blockValidator
* Fix all tests in consensusStateManager and some more
* Fix all tests in pruningManager
* Add many missing stagingAreas in tests
* Fix many tests
* Fix most of all other tests
* Fix ghostdag_test.go
* Add comment to StagingArea
* Make list of StagingShards an array
* Add comment to StagingShardID
* Make sure all staging shards are pointer-receiver
* Undo bucket rename in block_store
* Typo: isCommited -> isCommitted
* Add comment explaining why stagingArea.shards is an array
* Replace blue score with DAA score in UTXO entries
* Use DAA score for coinbase maturity
* Use DAA score for sequence lock
* Fix calcBlockSubsidy to use DAA score
* Don't pay to blocks that are not included in the DAA added blocks, and bestow red blocks reward to the merging block
* Fix TestGetPruningPointUTXOs
* Fix TestTransactionAcceptance
* Fix TestChainedTransactions
* Fix TestVirtualDiff
* Fix TestBlockWindow
* Fix TestPruning
* Use NewFromSlice instead of manually creating the hash set
* Add assert
* Add comment
* Remove redundant call to UpdateDAADataAndReturnDifficultyBits
* Add RequiredDifficulty, rename UpdateDAADataAndReturnDifficultyBits to StageDAADataAndReturnRequiredDifficulty and add comments
* Make buildUTXOInvalidHeader get bits as an argument
* Fix comments
* 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>
* Make antiPastHashesBetween return blocks sorted in ghostdag-order
* Return sortedMergeSet instead of blueMergeSet
* Invert the order of parameters of IsAncestorOf
* Add RenderDAGToDot to TestConsensus
* Add HighHash explicitly, unless lowHash == highHash
* Use Equal instead of == when comparing hashes
* Fixed TestSyncManager_GetHashesBetween
* Fix tests
* findHighHashAccordingToMaxBlueScoreDifference: don't start looking if the whole thing fits
* Handle a missed error
* Remove redundant call to RenderToDot
* Fix bug in findHighHashAccordingToMaxBlueScoreDifference
* In PropagateUTXOsChangedNotifications, add the given addresses to the address list instead of replacing them.
* Add StopNotifyingUtxosChangedRequestMessage to rpc.proto.
* Implement StopNotifyingUTXOsChanged.
* Optimize convertUTXOChangesToUTXOsChangedNotification.
* Don't error out if antiPastHashesBetween have 2 blocks with the same blue score
* Prepend lowHash to RPC GetBlocks request
* Add a test for GetHashesBetween
* Add a test for GetBlocks RPC call
* Update antipast.go
Co-authored-by: stasatdaglabs <39559713+stasatdaglabs@users.noreply.github.com>
* Remove BlockHexes from GetBlocks request and response
* Add GetBlocks RPC
* Include the selectedTip's anticone in GetBlocks
* Add Anticone to fakeRelayInvsContext
* Include verbose data only if it was requested + Add comments to HandleGetBlocks
* Allow antiPastHashesBetween to receive unrelated low and high hashes
* Convert to/from protowire GetBlocksResponse with no verbose data correctly
* Removed NextLowHash
* Update GetBlocks in rpc_client
* Validate in consensus.Anticone that blockHash exists
Co-authored-by: stasatdaglabs <39559713+stasatdaglabs@users.noreply.github.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
* 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
* ''
* ''
* ''
* 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>
* Fix notifyVirtualSelectedParentBlueScoreChanged to show the selected tip blue score instead of the virtual's
* Fix ShouldMine() to fetch selected tip header
* 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
* [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