* 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>
* ''
* ''
* ''
* 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>
* Convert BlockGHOSTDAGData from an interface to a public struct with getters
* Move hashes.Less to externalapi so it can access the hashes directly without copying
* Reduce calls to ghostdagstore.Get in blueWindow
* Simplify the logic in RequiredDifficulty and reuse big.Int
* Remove bigintpool as its no longer used
* Use ChooseSelectedParent in RequiredDifficulty instead of looping over the parents
* Remove comment
* bug invalidateAndInsertPruningPoint: if ValidateAndInsertBlock returned a non-RuleError error - the error was ignored
* Convert checkNoPrefilledFields into checkNoPrefilledInputs
* Add log line
* clone pruning point when passing to validateBlockTransactionsAgainstPastUTXO
* Add recoverability for UTXO index
* Add comment
* Rename UTXOOutpointPair->OutpointUTXOPair
* Get rid of the db transaction on resetStore and collect all keys before deleting
* Use VirtualSelectedParent instead of selected tip
* Fix error
* 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.
* Send headers continuously without needing to run the BlockLocator protocol after ever ~maxBlueScoreDifference blocks
* Add logging.
* Make logs more descriptive.
* Change SyncRateWindow to 15 minutes + update sync times on block headers as well
* Rename result to isSyncRateTooLow
* Fix formula for expected blocks
* Add a field to TransactionAcceptanceData: TransactionInputUTXOEntries.
* Fix failing tests.
* Add transactionInputUtxoEntries to the database.
* Populate transactionInputUTXOEntries in applyMergeSetBlocks and use them in the UTXO index.
* Remove UTXOEntry.Clone().
* Add an additional equality test.
* Check that there are no prefilled fields when validating a block
* Use cleanBlockPrefilledFields in AddBlock
* Move cleanBlockPrefilledFields to BuildBlockWithParents
* Move cleanBlockPrefilledFields to func (bb *testBlockBuilder) BuildBlockWithParents
* 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.