4553 Commits

Author SHA1 Message Date
Mike Zak
45ba3bec43 Merge remote-tracking branch 'upstream/v0.11.0-dev' into mempool-redesign 2021-06-09 15:05:14 +03:00
Mike Zak
befc0172ee Add allowOrphans to ValidateAndInsertTransaction stub 2021-06-09 14:56:27 +03:00
Mike Zak
82e807cf5a Use maximumOrphanTransactionCount 2021-06-09 14:53:31 +03:00
Mike Zak
bfa804b300 If a transaction was removed from the mempool - update it's redeemers in orphan pool as well 2021-06-09 12:13:39 +03:00
Constantine Bitensky
79c74c482b
Get connections from Seeder when no connections left (#1742)
Co-authored-by: Constantine Bitensky <constantinebitensky@gmail.com>
2021-06-08 17:42:13 +03:00
Mike Zak
7115b54d3f Implement RemoveTransaction 2021-06-08 17:39:10 +03:00
Mike Zak
25cc6184d6 Implement transactionsPool.addTransaction 2021-06-08 16:30:53 +03:00
Mike Zak
4e46be67a4 Implemented processOrphansAfterAcceptedTransaction 2021-06-08 16:05:39 +03:00
Mike Zak
35eb4b9d87 Implement maybeAddOrphan and AddOrphan 2021-06-08 15:45:08 +03:00
Ori Newman
3b0394eefe
Skip solving the block if SkipProofOfWork (#1741) 2021-06-08 15:44:27 +03:00
Mike Zak
2402d48c3e Implement removeOrphan 2021-06-08 14:35:54 +03:00
Mike Zak
9a1d548e7f Implemented removeOrphan 2021-06-08 14:00:26 +03:00
Mike Zak
65da2462b8 Implemented mempoolUTXOSet.checkDoubleSpends 2021-06-08 10:44:02 +03:00
Mike Zak
4335a8eaf8 Implement removeTransaction, remove sanity checks 2021-06-08 10:35:52 +03:00
Mike Zak
d88fe305c5 Implemented mempoolUTXOSet.addTransaction 2021-06-08 10:27:06 +03:00
Mike Zak
099f023b5b Implement getParentsInPool 2021-06-08 10:16:45 +03:00
Mike Zak
2294559198 Move all model objects to model package 2021-06-08 10:01:46 +03:00
Mike Zak
71875c99d6 Invert the condition for banning when mempool rejects a transaction 2021-06-07 14:07:25 +03:00
Mike Zak
c099fd2986 Add error.go to mempool 2021-06-07 11:46:31 +03:00
Mike Zak
17357a0fca Orphan maps should be idToOrphan 2021-06-07 10:21:36 +03:00
Mike Zak
01edc43e36 Imeplement transactionsOrderedByFeeRate 2021-06-07 10:08:33 +03:00
Mike Zak
b412cd9bbc Revert "Rename isHighPriority to neverExpires"
This reverts commit b2da9a4a00c02fb380d2518cf54fa16257bd8423.
2021-06-07 09:50:26 +03:00
tal
43e6467ff1 Fix merge errors 2021-06-06 17:00:29 +03:00
stasatdaglabs
363494ef7a Implement NotifyVirtualDaaScoreChanged (#1737)
* 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)
2021-06-06 16:46:02 +03:00
Mike Zak
e5e266ff0b Add stub for checkDoubleSpends 2021-06-06 16:31:00 +03:00
Mike Zak
b2da9a4a00 Rename isHighPriority to neverExpires 2021-06-06 14:39:28 +03:00
Mike Zak
ff10ce145a implement expireOldTransactions and expireOrphanTransactions 2021-06-06 14:13:19 +03:00
Mike Zak
619b7ab8cd Implement BlockCandidateTransactions 2021-06-06 12:53:37 +03:00
Mike Zak
04c98ac6df Add constructors to all main objects 2021-06-06 12:49:52 +03:00
Mike Zak
94ddf0aab0 Added model and stubs for all main methods 2021-06-06 12:27:25 +03:00
cbitensky
d1df97c4c5
added --password and --yes cmdline parameters (#1735)
* added --password and --yes cmdline parameters

* Renamed:
confPassword -> cmdLinePassword
yes -> forceOverride

Added password in ImportMnemonics

Co-authored-by: Ori Newman <orinewman1@gmail.com>
2021-06-01 15:36:18 +03:00
Svarog
4f52a6de51
Check if err != nil returned from ConnectionManager.Ban() (#1736) 2021-05-31 10:50:12 +03:00
Svarog
4f4a8934e7
Add option to specify blockHash in EstimateNetworkHashesPerSecond (#1731)
* 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
2021-05-27 14:59:29 +03:00
Svarog
16ba2bd312
Export DefaultPath + Add logging to kaspawallet daemon (#1730)
* Export DefaultPath + Add logging to kaspawallet daemon

* Export purpose and CoinType instead of defaultPath

* Move TODO to correct place
2021-05-26 18:51:11 +03:00
Svarog
6613faee2d
Invert coin-type and purpose in default derivation path (#1728) 2021-05-20 17:43:07 +03:00
Ori Newman
edc459ae1b
Improve pickVirtualParents performance and add many-tips to the stability tests suite (#1725)
* 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
2021-05-19 16:06:52 +03:00
talelbaz
d7f2cf81c0
Change merge set order to topological order (#1654)
* 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>
2021-05-19 14:40:55 +03:00
Ori Newman
4658f9d05c
Implement BIP 39 and HD wallet features (#1705)
* 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>
2021-05-19 10:03:23 +03:00
Ori Newman
010df3b0d3
Rename IncludeTransactionVerboseData flag to IncludeTransactions (#1717)
* Rename IncludeTransactionVerboseData flag to IncludeTransactions

* Regenerate auto-generated files
2021-05-18 17:40:06 +03:00
stasatdaglabs
346598e67f Fix merge errors. 2021-05-18 17:09:11 +03:00
Ori Newman
268906a7ce Add VirtualDaaScore to GetBlockDagInfo (#1719)
Co-authored-by: Svarog <feanorr@gmail.com>

(cherry picked from commit 36c56f73bf7b41528c81013d5d0d3bc7d7f6a206)
2021-05-18 17:07:07 +03:00
stasatdaglabs
befc60b185 Update changelog.txt for v0.10.2.
(cherry picked from commit 91866dd61cee1e970d269e8946329c2fd6b2201f)
2021-05-18 16:37:10 +03:00
Ori Newman
dd3e04e671 Fix overflow when checking coinbase maturity and don't ban peers that send transactions with immature spend (#1722)
* 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)
2021-05-18 16:33:29 +03:00
stasatdaglabs
9c743db4d6 Fix merge errors. 2021-05-18 16:33:01 +03:00
Ori Newman
eb3dba5c88 Fix calcTxSequenceLockFromReferencedUTXOEntries for loop break condition (#1723)
Co-authored-by: Svarog <feanorr@gmail.com>
(cherry picked from commit 04dc1947ffce9088f28f074eab0efcd2589df7d1)
2021-05-18 16:30:26 +03:00
stasatdaglabs
e46e2580b1 Add VirtualDaaScore to GetBlockDagInfo (#1719)
Co-authored-by: Svarog <feanorr@gmail.com>
(cherry picked from commit 36c56f73bf7b41528c81013d5d0d3bc7d7f6a206)

# Conflicts:
#	infrastructure/network/netadapter/server/grpcserver/protowire/rpc.pb.go
2021-05-18 16:28:57 +03:00
Ori Newman
414f58fb90 serializeAddress should always serialize as IPv6, since it assumes the IP size is 16 bytes (#1720)
(cherry picked from commit b76ca4110998a180ce7076f74f7f677a3fd068bc)
2021-05-18 16:05:36 +03:00
Ori Newman
9df80957b1 Fix getBlock and getBlocks RPC commands to return blocks and transactions properly (#1716)
* 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)
2021-05-13 16:00:42 +03:00
stasatdaglabs
268c9fa83c Update changelog for v0.10.1.
(cherry picked from commit 9e0b50c0dd3fd2cdac870d8c2770eea90ebfeb65)
2021-05-11 12:14:04 +03:00
Ori Newman
2e3592e351 Calculate virtual's acceptance data and multiset after importing a new pruning point (#1700)
(cherry picked from commit b405ea50e5736fc8a80880f6884414a3745f6590)
2021-05-11 12:14:00 +03:00