* protobuf for new block template notification structs
* appmessage and wire for new block template notification structs
* Set up the entire handler/call-chain for managing the new-block-template event
* Unite all reachability stores
* Upgrade script
* Fix tests
* Add UpdateReindexRoot to RebuildReachability
* Use dbTx when deleting reachability stores
* Use ghostdagDataWithoutPrunedBlocks when rebuilding reachability
* Use next tree ancestor wherever possible and avoid finality point search if the block is too close to pruning point
* Address the boundary case where the pruning point becomes the finality point
* some minor fixes
* Remove RebuildReachability and use manual syncing between old and new consensus for migration
* Remove sanity test (it failed when tips where not in the same order)
Co-authored-by: msutton <mikisiton2@gmail.com>
* Add GetUTXOsByBalances command to rpc
* Fix wrong commands in GetBalanceByAddress
* Moved calculation of TransactionMass out of TransactionValidator, so t that it can be used in kaspawallet
* Allow CreateUnsignedTransaction to return multiple transactions
* Start working on split
* Implement maybeSplitTransactionInner
* estimateMassIncreaseForSignatures should multiply by the number of inputs
* Implement createSplitTransaction
* Implement mergeTransactions
* Broadcast all transaction, not only 1
* workaround missing UTXOEntry in partially signed transaction
* Bugfix in broadcast loop
* Add underscores in some constants
* Make all nets RelayNonStdTxs: false
* Change estimateMassIncreaseForSignatures to estimateMassAfterSignatures
* Allow situations where merge transaction doesn't have enough funds to pay fees
* Add comments
* A few of renames
* Handle missed errors
* Fix clone of PubKeySignaturePair to properly clone nil signatures
* Add sanity check to make sure originalTransaction has exactly two outputs
* Re-use change address for splitAddress
* Add one more utxo if the total amount is smaller then what we need to send due to fees
* Fix off-by-1 error in splitTrasnaction
* Add a comment to maybeAutoCompoundTransaction
* Add comment on why we are increasing inputCountPerSplit
* Add comment explaining while originalTransaction has 1 or 2 outputs
* Move oneMoreUTXOForMergeTransaction to split_transaction.go
* Allow to add multiple utxos to pay fee for mergeTransactions, if needed
* calculate split input counts and sizes properly
* Allow multiple transactions inside the create-unsigned-transaction -> sign -> broadcast workflow
* Print the number of transaction which was sent, in case there were multiple
* Rename broadcastConfig.Transaction(File) to Transactions(File)
* Convert alreadySelectedUTXOs to a map
* Fix a typo
* Add comment explaining that we assume all inputs are the same
* Revert over-refactor of rename of config.Transaction -> config.Transactions
* Rename: inputPerSplitCount -> inputsPerSplitCount
* Add comment for splitAndInputPerSplitCounts
* Use createSplitTransaction to calculate the upper bound of mass for split transactions
* Fix a bug in the case where syncer chain is fully known to syncee
* Extract chain negotiation to a separated method
* Bump version and update the changelog
* Add zoom-in progress validation and some debug logs
* Improved error explanation
* go fmt
* Validate zoom-in progress through a total count
* a patch for fixing p2p v4 IBD issues for all side-chains
* Perform side-chain check earlier to avoid IBD start
* A few comments explaining the IBD patch
* Improve output of non-critical protocol errors to avoid user panic
* Add log messages at the end of IBD with headers proof
* Found a case where this was falsely triggered due to the wrong equality test
* The first message is expected to contain headers and not a "done" message (+comment and error text fixes)
* Dequeue w/o timeout during pp anticone batch processing
* Add a verification step for catching possible new IBD errors
* Fetch missing bodies for both, syncer selected tip past and relay block past
* Make sure the syncer is behaving correctly to avoid out of index errors
* Make sure progress reporter does not exceed 100%
* No orphan roots, so no need to queue the empty list
* Add a log to report utxo fetch failure with err message
* A duplicate blocks should not appear as a warning
* typo
* Fix error message referencing wrong function name
* Ignore not found errors from tp.transactionsOrderedByFeeRate.Remove.
Co-authored-by: stasatdaglabs <39559713+stasatdaglabs@users.noreply.github.com>
* add p2p v5 which is currently identical to v4
* set all internal imports to v5
* set default version to 5
* Send pruning point and its anticone in batches
* go lint
* Fix jsom format
* Use DequeueWithTimeout
* Assert that batch size < route capacity
* oops, this is a flow handler, by definition it needs to be w/o a timeout
* here however, a timeout is required
* Keep IDs of prev messages unmodified
* previous merge operation accidentally erased an important part of this pr
* Extend timeout of simple sync
Co-authored-by: Ori Newman <orinewman1@gmail.com>
* add p2p v5 which is currently identical to v4
* set all internal imports to v5
* wip
* set default version to 5
* protobuf gen for new ibd chain locator
* wire for new ibd chain locator types
* new ibd shared block algo -- only basic test passing
* address the case where pruning points disagree, now both IBD tests pass
* protobuf gen for new past diff request message
* wire for new request past diff message
* handle and flow for new request past diff message - logic unimplemented yet
* implement ibd sync past diff of relay and selected tip
* go fmt
* remove unused methods
* missed one err check
* addressing simple comments
* apply the traversal limit logic and sort headers
* rename pastdiff -> anticone
* apply Don't relay blocks in virtual anticone #1970 to v5
* go fmt
* Fixed minor comments
* Limit the number of chain negotiation restarts
* Make findTransactionIndex return wasFound explicitly + fix crash caused by invalid handling of not found transaction
* Add comment on findTransactionIndex
* Add boilerplate for the `parse` sub command.
* Deserialize the given transaction hax.
* Implement the rest of the wallet parse command.
* Hide transaction inputs behind a `verbose` flag.
* Indicate that we aren't able to extract an address out of a nonstandard transaction.
Co-authored-by: Ori Newman <orinewman1@gmail.com>
* Add cache to block window
* Copy the window heap slice with the right capacity
* Use WindowHeapSliceStore
* Use the selected parent window as a basis (and some comments and variable renames)
* Clone slice on newSizedUpHeapFromSlice
* Rename isNotFoundError->currentIsNonTrustedBlock
* Increase windowHeapSliceStore cache size to 2000 and some cosmetic changes
* Make MaxBlockLevel a DAG params instead of a constant.
* Change the testnet network name to 9.
* Fix TestBlockWindow.
* Set MaxBlockLevels for non-mainnet networks to 250.
* Revert "Fix TestBlockWindow."
This reverts commit 30a7892f53e0bb8d0d24435a68f0561a8efab575.
* Fix TestPruning.
* Make kaspawallet store the utxos sorted by amount, so that the bigger utxos are spent first - making it less likely a compound will be required
* Start refactor addEntryToUTXOSet
* Add GetUTXOsByBalances command to rpc
* Store list of addresses, updated with the collectAddresses methods
(replacing collectUTXOs methods)
* Fix wrong commands in GetBalanceByAddress
* Rename: refreshExistingUTXOs -> refreshUTXOs
Co-authored-by: Ori Newman <orinewman1@gmail.com>
* Split ApplyPruningPointProof to multiple small database transactions.
* Increase the timeout duration in TestIBDWithPruning.
* Increase the timeout duration in simple-sync.
* Explain that if ApplyPruningPointProof fails, the database must be discarded.
* Report progress percentage when downloading headers in IBD.
* Extract reporting logic to a separate type.
* Report progress for IBD missing block bodies.
* Fix for rare consensus bug: daa window min-time-block was not deterministic when timestamps are equal
* Something is missing
* Extract compare logic to a function with better performance
* typo
* Add monitoring of heap and save heap profile if size is over some limit
* Exported function
* Extract dump logic to a function (for defer close)
* Change trackHeapSize ticker interval to 10 seconds
* Add timestamp to dump file name
Co-authored-by: Ori Newman <>
* Separate IBD to a new flow (so now invs are handled concurrently and no route capacity errors)
* Invs messages should be queued while waiting for BlockLocator msg
* Close IBD channel so that HandleIBDFlow exits too
* Apply flow separation to p2p protocol v4
* Manage the IBDRequestChannel through the Peer struct
* Some IBDs take a little longer
* Add --transaction-file to the sign wallet subcommand.
* Fix bad short sign config option.
* Trim whitespace around the hex file.
* Add --transaction-file to the broadcast subcommand.
* Copy blockrelay flows to v4
* Remove duplicate sending of the same DAA blocks
* Advance testnet version
* Renames and add comments
* Add IBD test between v3 and v4
* Fix syncee v4 p2p version
* Check if netsync finished with selected tip
* Implement upgrade mechanism for p2p
* Remove dependencies from flowcontext to v3
* Add p2p v4
* Add Ready flow
* Remove copy paste code of v3
* Register SendAddresses flow at the top level
* Add option to set protocol version from CLI and add TestAddressExchangeV3V4
* Send ready message on minimal net adapter
* Rename defaultMaxProtocolVersion->maxAcceptableProtocolVersion
* Address manager refactor stage 1
* Use a simpler weightedRand function which makes it easier parameterize to the process
* Switch back to connectionFailedCount
* Simplify selected entry deletion
* Fix function comment
Co-authored-by: Constantine Bitensky <cbitensky1@gmail.com>
Co-authored-by: Ori Newman <orinewman1@gmail.com>
* Fix stability test mining (allow submission of non DAA blocks too)
* Comments for go fmt
* Use SubmitBlockAlsoIfNonDAA for all tests
Co-authored-by: Elichai Turkel <elichai.turkel@gmail.com>