* start
* pass tests, (cannot get before put!) and clean up.
* add rpc call.
* create and pass tests, fix bugs. fully implement rpc
* As always fmt
* remover old test
* clean up proto comment
* put the logger back in place.
* revert back to 10 sec limit.
* migration, change utxoChanged removal to whole utxoEntryPair, add methods to update circulating supply, intialize circulating supply from reset.
* Update utxoindex.go
* ad
* rename to max, change comment
* one more total to max
Co-authored-by: Ori Newman <orinewman1@gmail.com>
* include utxoIndex and isNearlySynced in GetInfo
* fmt fixing
* add missing IsNearlySynced
* change `isNearlySynced` -> `isSynced` & `isUtxoIndexSet` ->`isUtxoIndexed`
* Add a check for `HasPeers` to make `isSynced` identical to `GetBlockTemplate.isSynced`
Co-authored-by: msutton <mikisiton2@gmail.com>
* Move OnBlockAdded event to the channel that was only used by virtualChanged events
* Don't send notifications for header-only and invalid blocks
* Return block status from block processor and use it for event raising decision
* Use MaybeEnqueue for consensus events
* go lint
* Fix RPC call to actually include tx ids
Co-authored-by: msutton <mikisiton2@gmail.com>
* Increase virtualChangeChan to 100e3
Don't crash when sending UTXO RPC notification to a closed route
Throw error if virtualChangeChan is full
* Use MaybeEnqueue in more places
* Remove comment
* Ignore capacity reached errors on MaybeEnqueue
* Use a channel from within consensus in order to raise change events in order -- note that this is only a draft commit for discussion
* Fix compilation
* Check for nil
* Allow nil virtualChangeChan
* Remove redundant comments
* Call notifyVirtualChange instead of notifyUTXOsChanged
* Remove redundant comment
* Add a separate function for initVirtualChangeHandler
* Remove redundant type
* Check for nil in the right place
* Fix integration test
* Add data to virtual changeset and cleanup block added event logic
* Renames
* Comment
Co-authored-by: Ori Newman <orinewman1@gmail.com>
* Allow blank address in NotifyUTXOsChanged to get all updates
* To see if address is possible to extract: Check for NonStandardTy rather than error
* Don't swallow errors
Co-authored-by: Ori Newman <orinewman1@gmail.com>
* Block template cache improvement
* Avoid concurrent calls to template builder
* Clear cache on new block event
* Move IsNearlySynced logic to within consensus and cache it for each template
* Use a single consensus call for building template and checking synced
Co-authored-by: msutton <mikisiton2@gmail.com>
* Add acceptedTransactionIds to GetVirtualSelectedParentChainFromBlockResponseMessage and VirtualSelectedParentChainChangedNotificationMessage
* Modify appmessage structs to include new fields
* Implement the functionality for acceptedTransactionID notifications
* Add missing field for IncludeAcceptedTransactionIds
* Notify of block added before notifying that chain changed
* Use consensushashing instead of Transaction.ID
* Don't notify of empty virtual changes
* Don't generate virtualChainChanged notification if there's nobody subscribed
* Fix test to not expect empty notifications
* Don't generate acceptedTransactionIDs if they were not requested by anyone
Co-authored-by: Ori Newman <orinewman1@gmail.com>
* Use separate than finality depth for merge set calculations after HF
* Add comments and edit error messages
* Fix TestValidateTransactionInContextAndPopulateFee
* Don't disconnect from node if isViolatingBoundedMergeDepth
* Use new merge root for virtual pick parents; apply HF1 daa score split for validation only
* Use `blue work` heuristic to skip irrelevant relay blocks
* Minor
* Make sure virtual's merge depth root is a real block
* For ghostdag data we always use the non-trusted data
* Fix TestBoundedMergeDepth and in IBD use VirtualMergeDepthRoot instead of MergeDepthRoot
* Update HF1DAAScore
* Make sure merge root and finality are called + avoid calculating virtual root twice
* Update block version to 1 after HF
* Update to v0.12.0
Co-authored-by: msutton <mikisiton2@gmail.com>
* minor text fix
* Implement a block template cache with template modification/reuse mechanism
* Fix compilation error
* Address review comments
* Added a through TestModifyBlockTemplate test
* Update header timestamp if possible
* Avoid copying the transactions when only the header changed
* go fmt
* 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
* 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
* 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 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>
* Report progress percentage when downloading headers in IBD.
* Extract reporting logic to a separate type.
* Report progress for IBD missing block bodies.
* 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
* 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
* 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>
* Seed from DNS only if we ran out of addresses to connect to
* Remove address if it has failed 10 connections
* Change connectionFailedCountForRemove to 3
* Disallow by default RPC submission of out of date blocks (blocks which are out of virtual DAA window)
* go fmt
* Better condition test
* Make allowNonDAABlocks an RPC field and not a command line flag
* go fmt
* one more go fmt