* Add notifyVirtualDaaScoreChanged to protowire.
* Add notifyVirtualDaaScoreChanged to the rest of kaspad.
* Add notifyVirtualDaaScoreChanged to the rest of kaspad.
* Test the DAA score notification in TestVirtualSelectedParentBlueScore.
* Rename TestVirtualSelectedParentBlueScore to TestVirtualSelectedParentBlueScoreAndVirtualDAAScore.
(cherry picked from commit 83e631548f206aaf2da5b2103681c715bc250c75)
* Add BlockHash optional parameter to EstimateNetworkBlockHashesPerSecond
* Allow to pass '-' for optional values in kaspactl
* Solve a division-by-zero in estimateNetworkHashesPerSecond
* Add BlockHash to toAppMessage/fromAppMessage functions
* Rename: topHash -> StartHash
* Return proper error message if provided startHash doesn't deserialize into a hash
* First limit the candidates size to 3*csm.maxBlockParents before taking the bottom csm.maxBlockParents/2
* Change log level of printing all tips to Tracef
* Add many-tips to run-fast.sh and run-slow.sh
* Fix preallocation size
* Assign intermediate variables
* Change mergeSet to be ordered topologically.
* Add special condition for genesis.
* Add check that the coinbase is validated.
* Change names of variables(old: chainHash, blueHash).
* Fix the DAG diagram in the comment above the function.
* Fix variables names.
Co-authored-by: tal <tal@daglabs.com>
Co-authored-by: Ori Newman <orinewman1@gmail.com>
* Naive bip39 with address reuse
* Avoid address reuse in libkaspawallet
* Add wallet daemon
* Use daemon everywhere
* Add forceOverride
* Make CreateUnsignedTransaction endpoint receive amount in sompis
* Collect close UTXOs
* Filter out non-spendable UTXOs from selectUTXOs
* Use different paths for multisig and non multisig
* Fix tests to use non zero path
* Fix multisig cosigner index detection
* Add comments
* Fix dump_unencrypted_data.go according to bip39 and bip32
* Fix wrong derivation path for multisig on wallet creation
* Remove IsSynced endpoint and add validation if wallet is synced for the relevant endpoints
* Rename server address to daemon address
* Fix capacity for extendedPublicKeys
* Use ReadBytes instead of ReadLine
* Add validation when importing
* Increment before using index value, and use it as is
* Save keys file exactly where needed
* Use %+v printErrorAndExit
* Remove redundant consts
* Rnemae collectCloseUTXOs and collectFarUTXOs
* Move typedefs around
* Add comment to addressesToQuery
* Update collectUTXOsFromRecentAddresses comment about locks
* Split collectUTXOs to small functions
* Add sanity check
* Add addEntryToUTXOSet function
* Change validateIsSynced to isSynced
* Simplify createKeyPairsFromFunction logic
* Rename .Sync() to .Save()
* Fix typo
* Create bip39BitSize const
* Add consts to purposes
* Add multisig check for 'send'
* Rename updatedPSTxBytes to partiallySignedTransaction
* Change collectUTXOsFromFarAddresses's comment
* Use setters for last used indexes
* Don't use the pstx acronym
* Fix SetPath
* Remove spaces when reading lines
* Fix walletserver to daemonaddress
* Fix isUTXOSpendable to use DAA score
Co-authored-by: Svarog <feanorr@gmail.com>
* Fix overflow when checking coinbase maturity and don't ban peers that send transactions with immature spend
* Fix tests
Co-authored-by: Svarog <feanorr@gmail.com>
(cherry picked from commit a18f2f8802d52261c691ba1051d7b3134ddf8a78)
* Fix getBlock RPC command to return transactions
* Fix getBlocks RPC command to return transactions and blocks
* Add GetBlockEvenIfHeaderOnly and use it for getBlock and getBlocks
* Implement GetBlockEvenIfHeaderOnly for fakeRelayInvsContext
* Use less nested code
(cherry picked from commit 50fd86e2878a6dcf1399610d8edc146466a5b492)
* Change removeTransactionAndItsChainedTransactions to be non-recursive
* Split the variables assigning.
* Change names of function and variables.
* Append the correct queue.
Co-authored-by: tal <tal@daglabs.com>
Co-authored-by: stasatdaglabs <39559713+stasatdaglabs@users.noreply.github.com>
* Unfinished code.
* Update the testnet version to testnet-5. (#1683)
* Generalize stability-tests/docker/Dockerfile. (#1685)
* Committed for rebasing.
* Adds stability-test many-tips, which tests kaspad handling with many tips in the DAG.
* Delete manytips_test.go.
* Add timeout to the test and create only one RPC client.
* Place the spawn before the for loop and remove a redundant condition.
Co-authored-by: tal <tal@daglabs.com>
Co-authored-by: stasatdaglabs <39559713+stasatdaglabs@users.noreply.github.com>
* [NOD-1344] relaytransactions: simple unit tests
* [NOD-1344] Add mid-complexity unit tests for relaytransactions
* Improve TestHandleRelayedTransactionssub tests
* Improve TestHandleRequestedTransactions sub tests
* [NOD-1344] Fix Simple call test
* [NOD-1344] Fix tests after redesign
* Divide transactionrelay_test.go to 2 separated tests and updates the tests.
* Changes due to review:change the test files name and the test function names, adds new comments and fix typo.
* Delete an unnecessary comparison to True in the if statement condition.
* Update the branch to v0.11.0-dev.
Co-authored-by: karim1king <karimkaspersky@yahoo.com>
Co-authored-by: tal <tal@daglabs.com>
Co-authored-by: Svarog <feanorr@gmail.com>
* Add -v to the `go test` command.
* Generate a new keypair for mempool-limits.
* Set mempool-limits to time out only after 24 hours.
(cherry picked from commit eb1703b948c740170334a333b0b0b29bcb208fdf)
* Use selectedParent instead of selectedTip for non-selectedTip blocks in restoreSingleBlockStatus
* Cache the selectedParent for re-use in a resolveSingleBlockStatus chain
* Implement and use reverseUTXOSet
* Reverse blocks in correct order
* Support resolveBlockStatus without separate stagingAreas for usage of testConsensus
* Handle the case where the tip of the resolved block is not the next selectedTip
* Unify isResolveTip
* Some minor fixes and cleanup
* Add full finality window re-org test to stability-slow
* rename: useSeparateStagingAreasPerBlock -> useSeparateStagingAreaPerBlock
* Better logs in resolveSingleBlockStatus
* A few retouches to reverseUTXODiffs
* TEMPORARY COMMIT: EXTRAT ALL DIFFFROMS TO SEPARATE METHODS
* TEMPORARY COMMIT: REMOVE DIFFICULTY CHECKS IN DEVNET
* Don't pre-allocate in utxo-algebra, since the numbers are not known ahead-of-time
* Add some logs to reverseUTXODiffs
* Revert "TEMPORARY COMMIT: REMOVE DIFFICULTY CHECKS IN DEVNET"
This reverts commit c0af9dc6ade78a914c970e11bc63c34605565f57.
* Revert "TEMPORARY COMMIT: EXTRAT ALL DIFFFROMS TO SEPARATE METHODS"
This reverts commit 4fcca1b48c3a1183598833a355b9bfaf169edba1.
* Remove redundant paranthesis
* Revise some logs messages
* Rename:oneBlockBeforeCurrentUTXOSet -> lastResolvedBlockUTXOSet
* Don't break if the block was resolved as invalid
* rename unverifiedBlocks to recentlyVerifiedBlcks in reverseUTXODiffs
* Add errors.New to the panic, for a stack trace
* Reverse the UTXODiffs after the main block has been commited
* Use the correct value for previousUTXODiff
* Add test for ReverseUTXODiff
* Fix some names and comments
* Update TestReverseUTXODiffs to use consensus.Config
* Fix comments mentioning 'oneBlockBeforeTip'
* Add a flag for sanity check pruning point utxo set and do the sanity check only if it's enabled
* add description to EnableSanityCheckPruningUTXOSet
* review fix
Co-authored-by: Svarog <feanorr@gmail.com>
* Add version file to database
* Remove redundant code
* Check for version before opening the database, create version file after
* Create version file before opening the database
* Add windows to the CI
* Cast syscall.Stdin into an integer
* DataDir -> AppDir in service_windows.go
* Rename mempool-limits package to something non-main
* Close database after re-assigining to it
* Up rpcTimout to 10 seconds
* Copy some boilerplate from the other stability tests.
* Fix a copy+paste error in run.sh.
* Copy over some stability test boilerplate go code.
* Run kaspad in the background.
* Catch panics and initialize the RPC client.
* Mine enough blocks to fund filling up the mempool.
* Extract coinbase transactions out of the generated blocks.
* Tidy up a bit.
* Implement submitting transactions.
* Lower the amount of outputs in each transaction.
* Verify that the mempool size has the expected amount of transactions.
* Pregenerate enough funds before submitting the first transaction so that block creation doesn't interfere with the test.
* Empty mempool out by continuously adding blocks to the DAG.
* Handle orphan transactions when overfilling the mempool.
* Increase mempoolSizeLimit to 1m.
* Fix a comment.
* Fix a comment.
* Add mempool-limits to run-slow.sh.
* Rename generateTransactionsWithLotsOfOutputs to generateTransactionsWithMultipleOutputs.
* Rename generateCoinbaseTransaction to mineBlockAndGetCoinbaseTransaction.
* Make generateFundingCoinbaseTransactions return an object instead of store a global variable.
* Convert mempool-limits into a Go test.
* Convert panics to t.Fatalfs.
* Fix a comment.
* Increase mempoolSizeLimit to 1m.
* Run TestMempoolLimits only if RUN_STABILITY_TESTS is set.
* Move the run of mempool-limits in run-slow.sh.
* Add a comment above fundingCoinbaseTransactions.
* Make a couple of stylistic changes.
* Use transactionhelper.CoinbaseTransactionIndex instead of hardcoding 0.
* Make uninteresting errors print %+v instead of %s.
Co-authored-by: Svarog <feanorr@gmail.com>
* Add oldPruningPoint to pruningStore
* Make the pruning store work with utxo diff and return an iterator over pruning point utxoset
* Redesign pruning point utxo storage by creating a diff and modifying the old pruning utxo set
* Fix review comments
* Rename updatePruningPointUTXOSet