Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upFaster wallet refreshes #3716
Conversation
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
glv2
May 21, 2018
Contributor
Here are some test results of a wallet scanning the whole blockchain:
computer
- OS: GNU/Linux x86-64
- CPU: Intel Core i7-3630QM @ 2.40GHz
- Storage: Samsung SSD 850 PRO
master branch (4b728d7)
- blocks: 1577488
- time: 31.3 minutes
master branch + PR3716
- blocks: 1577521
- time: 8.6 minutes
master branch + PR3716 + refresh-type=no-coinbase
- blocks: 1577526
- time: 7.2 minutes
|
Here are some test results of a wallet scanning the whole blockchain: computer
master branch (4b728d7)
master branch + PR3716
master branch + PR3716 + refresh-type=no-coinbase
|
moneromooo-monero
changed the title from
[DO NOT MERGE] Faster wallet refreshes, plus random stuff
to
Faster wallet refreshes
Jun 10, 2018
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Now ready for review. |
moneromooo-monero
referenced this pull request
Jun 10, 2018
Closed
Any special reason why Blockchain::get_transactions is template member function? #3967
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
stoffu
Jun 11, 2018
Contributor
Computer:
- OS: Windows 7 Professional, 64bit
- CPU: Intel Core i7-5690X @ 3.00GHz
- Storage: Samsung SSD 850 PRO
Master (25e7a7d):
- optimize-coinbase -> 26m 46s (1592555 blocks)
- no-coinbase -> 24m 24s (1592573 blocks)
PR-3716 (c4fda6d):
- optimize-coinbase -> 5m 31s (1592557 blocks)
- no-coinbase -> 4m 52s (1592578 blocks)
I can do two more tests on OSX machines with SSD and HDD.
|
Computer:
Master (25e7a7d):
PR-3716 (c4fda6d):
I can do two more tests on OSX machines with SSD and HDD. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
stoffu
Jun 11, 2018
Contributor
Note for testers: if you are to measure the time of scanning the entire blockchain from genesis, not only the restore height has to be set to 0, but also the wallet creation time must not be set to current. That is, if you create a new wallet and set refresh-from-block-height 0 and then rescan_bc, the wallet will NOT do the full scan of the blockchain (instead it skips old blocks based on timestamps). The correct way is to restore the wallet from seed and setting the restore height to 0.
|
Note for testers: if you are to measure the time of scanning the entire blockchain from genesis, not only the restore height has to be set to 0, but also the wallet creation time must not be set to current. That is, if you create a new wallet and |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
stoffu
Jun 11, 2018
Contributor
Computer:
- OS: Mac OSX 10.12.6
- CPU: 2.9 GHz Intel Core i7
- Storage: APPLE SSD SM2048L
Master:
- optimize-coinbase -> 23m 12s (1592682 blocks)
- no-coinbase -> 21m 31s (1592694 blocks)
PR-3716:
- optimize-coinbase -> 11m 9s (1592697 blocks)
- no-coinbase -> 9m 17s (1592702 blocks)
|
Computer:
Master:
PR-3716:
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
stoffu
Jun 13, 2018
Contributor
Computer:
- OS: macOS Sierra 10.12.6
- CPU: 2.3 GHz Intel Core i7
- Storage: APPLE HDD HTS541010A9E662
Master:
- optimize-coinbase -> 1h 58m 24s (1592635 blocks)
- no-coinbase -> 1h 56m 42s (1593176 blocks)
PR-3716:
- optimize-coinbase -> 2h 0m 18s (1593251 blocks)
- no-coinbase -> 1h 57m 50s (1593310 blocks)
|
Computer:
Master:
PR-3716:
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
moneromooo-monero
Jun 13, 2018
Contributor
That one seems odd since HDD means I/O is a bottleneck, and the new version reads much less from the database, since it stores prunable and unprunable data separately... Nevermind, the new db format patch is already merged in master.
|
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
SamsungGalaxyPlayer
Jun 14, 2018
Computer: Purism Librem 13
OS: PureOS GNU/Linux 8
Processor: Intel Core i7-6500U CPU @ 2.50 GHz
OS Hard Drive: 120 GB SATA SSD (unknown type)
Attached Hard Drive: 1TB Samsung 970 EVO
Master:
- optimize-coinbase
- 970 EVO -> 0h 28m 01s; 1598776 blocks (951.1 blocks per second)
- no-coinbase
- 970 EVO -> 0h 24m 20s; 1598750 blocks (1095.0 blocks per second)
PR-3716:
- optimize-coinbase
- 970 EVO -> 0h 20m 43s (limited by CPU); 1596508 blocks (1284.4 blocks per second)
- no-coinbase
- 970 EVO -> 0h 17m 25s (limited by CPU); 1597181 blocks (1528.4 blocks per second)
SamsungGalaxyPlayer
commented
Jun 14, 2018
•
|
Computer: Purism Librem 13 Master:
PR-3716:
|
| @@ -593,7 +597,7 @@ namespace cryptonote | ||
| return true; | ||
| } | ||
| sorted_txs.push_back(std::move(txs.front())); | ||
| - txs.pop_front(); | ||
| + txs.erase(txs.begin()); |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
stoffu
Jun 26, 2018
Contributor
Isn't this an unneeded burden which can be avoided by having a counter and doing sorted_txs.push_back(std::move(txs[counter]));?
stoffu
Jun 26, 2018
Contributor
Isn't this an unneeded burden which can be avoided by having a counter and doing sorted_txs.push_back(std::move(txs[counter]));?
| { | ||
| error = false; | ||
| try | ||
| { | ||
| drop_from_short_history(short_chain_history, 3); | ||
| - // prepend the last 3 blocks, should be enough to guard against a block or two's reorg |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
| + hw::reset_mode rst(hwdev); | ||
| + | ||
| + hwdev.set_mode(hw::device::TRANSACTION_PARSE); | ||
| + if (!hwdev.generate_key_derivation(tx_pub_key, keys.m_view_secret_key, derivation)) |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
stoffu
Jun 26, 2018
Contributor
Since the line 1133(before) tx_pub_key = pub_key_field.pub_key; was deleted, where does tx_pub_key get its value?
stoffu
Jun 26, 2018
Contributor
Since the line 1133(before) tx_pub_key = pub_key_field.pub_key; was deleted, where does tx_pub_key get its value?
| + hwdev.set_mode(hw::device::TRANSACTION_PARSE); | ||
| + const cryptonote::account_keys &keys = m_account.get_keys(); | ||
| + | ||
| + auto gender = [&](wallet2::is_out_data &iod) { |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
| @@ -1282,6 +1295,8 @@ namespace tools | ||
| std::string m_ring_database; | ||
| bool m_ring_history_saved; | ||
| std::unique_ptr<ringdb> m_ringdb; | ||
| + boost::optional<crypto::chacha_key> m_ringdb_key; | ||
| + unsigned int m_ringdb_key_refs; |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
| @@ -5791,6 +5810,7 @@ bool wallet2::get_ring(const crypto::chacha_key &key, const crypto::key_image &k | ||
| bool wallet2::get_rings(const crypto::hash &txid, std::vector<std::pair<crypto::key_image, std::vector<uint64_t>>> &outs) | ||
| { | ||
| + key_ref kref(*this); |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
| @@ -2332,6 +2333,8 @@ bool wallet2::delete_address_book_row(std::size_t row_id) { | ||
| //---------------------------------------------------------------------------------------------------- | ||
| void wallet2::refresh(uint64_t start_height, uint64_t & blocks_fetched, bool& received_money) | ||
| { | ||
| + key_ref kref(*this); |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
moneromooo-monero
Jun 26, 2018
Contributor
No, but it speeds up saving rings from incoming txes if there are several.
moneromooo-monero
Jun 26, 2018
Contributor
No, but it speeds up saving rings from incoming txes if there are several.
moneromooo-monero commentedApr 27, 2018
This has random stuff in it, because I need random stuff that's not merged, so all this has to be plonked in this tree for me to hack on it. I'll rebase once those things are merged.
Warning:
If you run this, your blockchain DB will upgrade to v2, which means you won't be able to run any daemon that does not have this patch (I'll get it merged once 0.12.1.0 is out of the way).
Speeds up between 2x and 5x. Speed tests welcome.
If your wallet is not a mining wallet (ie, you never got any coinbase output on it), setting refresh-type=no-coinbase now gives a pretty good speed boost.
vtnerd's wallet asm patch will give more speedup, as the wallet is using 90% of its time in the fe API.